ImmutableOctet / sonicgba

A cross-platform port of Sonic Advance
https://www.reddit.com/r/sonicgba
Other
16 stars 2 forks source link

Desktop (GLFW) builds do not render backgrounds correctly #17

Closed ImmutableOctet closed 7 years ago

ImmutableOctet commented 8 years ago

While playing NGHZ1 on GLFW builds, the background seems to flash between normal and black.

ImmutableOctet commented 8 years ago

I figured this out, for the record.

Basically, the game's trying to load "palette files", which patch 8-bit PNGs. Specifically 8-bit PNGs. These will either be patched differently (No longer direct format-injection), or just statically processed.

The flashing was from incorrect frame initialization. To be more specific, I accidentally set the mip-mapping flag.

Still, alt-frames for backgrounds and tile-maps need to be resolved, so I'll be looking into both options.

ImmutableOctet commented 8 years ago

After slightly more research, I have concluded that these palette files are PLTE chunks. This also makes it obvious why the magic number 37 was used as an offset for palettes.

ImmutableOctet commented 7 years ago

Palettes are now supported. Efficiency is another issue, but for now, this has been sorted out.