Battle BG fixes

This commit is contained in:
Luke Hubmayer-Werner 2023-08-15 16:20:13 +09:30
parent ab81dafe52
commit 2d4d44d224
2 changed files with 3 additions and 6 deletions

View File

@ -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

View File

@ -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: