From c4af44a5e4c82c0ccd68960db5732da8f3eababd Mon Sep 17 00:00:00 2001 From: ashley Date: Mon, 18 Sep 2023 20:22:12 -0400 Subject: [PATCH] Changes to fix level output in --system md --- src/reskit/level/system.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reskit/level/system.rs b/src/reskit/level/system.rs index 26a8040..0538e79 100644 --- a/src/reskit/level/system.rs +++ b/src/reskit/level/system.rs @@ -14,7 +14,7 @@ pub fn get_tiles( tilemap: &TiledTilemap ) -> Result<(Vec, Vec), Box = Vec::new(); + let mut all_tiles: Vec = vec![0; 32]; // --system md, start with a blank buffer tile let tiles_height = tilemap.tileset.image.height() / 8; // --system md let tiles_width = tilemap.tileset.image.width() / 8; // --system md @@ -93,7 +93,7 @@ pub fn get_tilemap( tilemap: &TiledTilemap ) -> Result, Box> let source_tile = target_tile - 1; // From the starting point of x, y "stamp" the target tile's indices - let nametable_entry = source_tile; + let nametable_entry = target_tile; let selected_pal = tilemap.tileset.palettes[ source_tile as usize ]; if let Some( selected_pal ) = selected_pal { nametable[ ( y * tilemap.width ) + x ] = ( ( selected_pal as u16 ) << 13 ) | nametable_entry; @@ -123,7 +123,7 @@ pub fn get_tilemap( tilemap: &TiledTilemap ) -> Result, Box> let source_tile = target_tile - 1; // From the starting point of x, y "stamp" the target tile's indices - let nametable_entry = source_tile; + let nametable_entry = target_tile; let selected_pal = tilemap.tileset.palettes[ source_tile as usize ]; if let Some( selected_pal ) = selected_pal { nametable[ ( y * tilemap.width ) + x ] = ( ( selected_pal as u16 ) << 13 ) | nametable_entry;