From 6ad5ceebc637b766163d0b3e75adb9035e99949c Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 18 Jul 2020 22:09:24 +0100 Subject: [PATCH] fix tile image --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 590b94c..979abad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,8 +50,8 @@ pub fn add_tiles(game_data: String, image: String, prefix: String) -> String { for row in 0..rows { let mut pixels = Vec::with_capacity(64); - for x in (column * SD)..((column + 1) * SD) { - for y in (row * SD)..((row + 1) * SD) { + for y in (row * SD)..((row + 1) * SD) { + for x in (column * SD)..((column + 1) * SD) { let pixel = image.get_pixel(x, y).to_rgb(); let total: u32 = (pixel[0] as u32 + pixel[1] as u32 + pixel[2] as u32) as u32; // is each channel brighter than 128/255 on average?