diff options
Diffstat (limited to 'src/render/mod.rs')
-rw-r--r-- | src/render/mod.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/render/mod.rs b/src/render/mod.rs index 6f5d5b4..9ae8b7a 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -52,16 +52,15 @@ impl Renderer { .unwrap_or((true, true)) }; - let mut view: Texture = - ImageBuffer::new(16 * (SEG_SIZE + 1) as u32, 16 * (SEG_SIZE + 1) as u32); + let mut view: Texture = ImageBuffer::new(16 * SEG_SIZE as u32, 16 * SEG_SIZE as u32); let mut visible = Vec::<((isize, isize, isize), (isize, isize, isize))>::new(); 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 ix in -1..SEG_SIZE { + for iy in -1..(SEG_SIZE * 2) { for off in 0..=1 { let mut y = 319; let mut x = -ix - offx + iy + offy; @@ -94,7 +93,7 @@ impl Renderer { let texture = &self.load_texture(name); let ix = ix * 16 + off * 8; let iy = iy * 8 + off * 4; - image_buffer_blit(&mut view, texture, (ix as u32, iy as u32)); + image_buffer_blit(&mut view, texture, (ix, iy)); } let end_time = Instant::now(); |