diff options
| author | tslil clingman <> | 2021-09-09 23:47:24 -0400 |
|---|---|---|
| committer | tslil clingman <> | 2021-09-09 23:50:18 -0400 |
| commit | 9e15cb6352c9afc771c41451dea86b93e35349e5 (patch) | |
| tree | ca3e55b9560869495e1b9aea923ea1e0dd62851b /src | |
| parent | d2f6860430f93291a52d1cdaccf6831cd57be9a5 (diff) | |
Don't override the skycylinder!
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 4 | ||||
| -rw-r--r-- | src/raycast.zig | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig index 8f8753d..2dec9be 100644 --- a/src/main.zig +++ b/src/main.zig @@ -111,7 +111,7 @@ pub fn main() !void { var back_sprite = try sf.Sprite.createFromTexture(back_texture); defer back_sprite.destroy(); - back_sprite.setScale(.{ .x = 4.0 * constants.ScreenWidth / constants.BackTextureWidth, .y = constants.ScreenHeight / (2 * constants.BackTextureHeight) }); + back_sprite.setScale(.{ .x = 4.0 * constants.ScreenWidth / constants.BackTextureWidth, .y = constants.ScreenHeight / constants.BackTextureHeight }); // Load wall textures var wall_textures = try sf.Texture.createFromFile("walls.png"); @@ -180,8 +180,6 @@ pub fn main() !void { player.acc_y -= std.math.sin(player.ang) * acc_mag; } - window.clear(sf.Color.fromRGB(100, 100, 100)); - // First the background const back_scroll = @floatToInt(i32, -constants.BackTextureWidth * player.ang / (2 * PI)); back_sprite.setTextureRect(sf.IntRect{ diff --git a/src/raycast.zig b/src/raycast.zig index 2b377de..6711cb2 100644 --- a/src/raycast.zig +++ b/src/raycast.zig @@ -322,7 +322,7 @@ pub fn Player(PlaneWidth: f32, PlaneHeight: f32) type { rendered_floors_texture: Texture, map: level.Map, ) !void { - var pixels = [_]Colour{Colour.Black} ** (PlaneWidth * PlaneHeight); + var pixels = [_]Colour{Colour.fromRGBA(0, 0, 0, 0)} ** (PlaneWidth * PlaneHeight); // Again, another TERRIBLE hack: we do the same nasty linear // interpolation trick and for whatever reason the floors look fine. |
