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: static func make_tile_atlas(tile_images) -> Image:
var image = Image.new() var image = Image.new()
image.create(128, 128, false, INDEX_FORMAT) image.create(128, 128, false, INDEX_FORMAT)
var tile = 0 for tile in len(tile_images):
for y in tile_images.size()/16: image.blit_rect(tile_images[tile], TILE_RECT, Vector2((tile%16)*8, (tile/16)*8))
for x in 16:
image.blit_rect(tile_images[tile], TILE_RECT, Vector2(x*8, y*8))
tile += 1
return image return image

View File

@ -83,9 +83,9 @@ static func apply_battle_tilemap_flips(buffer: StreamPeer, tilemap: Array):
tile_i += 1 tile_i += 1
static func add_anim_palettes(buffer: StreamPeer, palettes: Array): 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 pal1_id: int = palettes[0][0]
var pal2_id: int = palettes[0][1] var pal2_id: int = palettes[0][1]
palettes.pop_back() # Cycles look more correct without the first palettes
while true: while true:
var b := buffer.get_u8() var b := buffer.get_u8()
if b == 0xFF: if b == 0xFF: