diff options
Diffstat (limited to 'src/render/mod.rs')
-rw-r--r-- | src/render/mod.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/render/mod.rs b/src/render/mod.rs index 293e566..9a5bd2d 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -57,12 +57,15 @@ impl Renderer { let mut visible = Vec::<((isize, isize, isize), (isize, isize, isize))>::new(); - for ix in (sx * SEG_SIZE)..((sx + 1) * SEG_SIZE) { - for iy in (sy * (SEG_SIZE * 2))..((sy + 1) * (SEG_SIZE * 2)) { + let offx = sx * SEG_SIZE; + let offy = sy * SEG_SIZE * 2; + + for ix in 0..SEG_SIZE { + for iy in 0..(SEG_SIZE * 2) { for off in 0..=1 { let mut y = 319; - let mut x = -ix + iy; - let mut z = ix + iy + off; + let mut x = -ix - offx + iy + offy; + let mut z = ix + offx + iy + offy + off; loop { let (solid, has_texture) = solid(x, y, z); if has_texture { |