mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-16 03:41:18 +01:00
update sprite priority behavior to make golden sun work (not documented in gbatek or tonc)
This commit is contained in:
parent
fb3354521c
commit
625b79fc35
1 changed files with 5 additions and 4 deletions
|
@ -275,10 +275,11 @@ class PPU
|
|||
pal_idx += (sprite.palette_number << 4) if pal_idx > 0
|
||||
end
|
||||
|
||||
if sprite.obj_mode == 0b10 && pal_idx > 0
|
||||
@sprite_pixels[col] = @sprite_pixels[col].copy_with window: true
|
||||
elsif @sprite_pixels[col].palette == 0 || @sprite_pixels[col].priority > sprite.priority
|
||||
@sprite_pixels[col] = SpritePixel.new(sprite.priority, pal_idx.to_u16, sprite.obj_mode == 0b01, @sprite_pixels[col].window)
|
||||
if sprite.obj_mode == 0b10
|
||||
@sprite_pixels[col] = @sprite_pixels[col].copy_with window: true if pal_idx > 0
|
||||
elsif sprite.priority < @sprite_pixels[col].priority || @sprite_pixels[col].palette == 0
|
||||
@sprite_pixels[col] = @sprite_pixels[col].copy_with priority: sprite.priority
|
||||
@sprite_pixels[col] = @sprite_pixels[col].copy_with palette: pal_idx.to_u16, blends: sprite.obj_mode == 0b01 if pal_idx > 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue