diff --git a/scripts/loaders/SpriteLoader.gd b/scripts/loaders/SpriteLoader.gd index 0a732aa..4b3a0a8 100644 --- a/scripts/loaders/SpriteLoader.gd +++ b/scripts/loaders/SpriteLoader.gd @@ -139,11 +139,8 @@ static func generate_palette_from_colorarray(colors: PoolColorArray, format:=Ima static func make_tile_atlas(tile_images) -> Image: var image = Image.new() image.create(128, 128, false, INDEX_FORMAT) - var tile = 0 - for y in tile_images.size()/16: - for x in 16: - image.blit_rect(tile_images[tile], TILE_RECT, Vector2(x*8, y*8)) - tile += 1 + for tile in len(tile_images): + image.blit_rect(tile_images[tile], TILE_RECT, Vector2((tile%16)*8, (tile/16)*8)) return image diff --git a/scripts/loaders/snes/battle_bgs.gd b/scripts/loaders/snes/battle_bgs.gd index bb6bf20..2cd8991 100644 --- a/scripts/loaders/snes/battle_bgs.gd +++ b/scripts/loaders/snes/battle_bgs.gd @@ -83,9 +83,9 @@ static func apply_battle_tilemap_flips(buffer: StreamPeer, tilemap: Array): tile_i += 1 static func add_anim_palettes(buffer: StreamPeer, palettes: Array): - # TODO: check if the very first entry is added too var pal1_id: int = palettes[0][0] var pal2_id: int = palettes[0][1] + palettes.pop_back() # Cycles look more correct without the first palettes while true: var b := buffer.get_u8() if b == 0xFF: