[Scummvm-devel] OSystem::setPalette() and grabPalette() in 16bit gfx mode, changes to the SDL backend

Andre Heider a.heider at gmail.com
Thu Apr 22 22:33:12 CEST 2010


Hi there,

recently I discovered a problem on the Wii backend:
I check the current pixel format in said functions for "bytesPerPixel
== 1" via assert(), so if those get called when a 16bit gfx mode is
active, it ends in a nice abort() ;)

You might have guessed it, a user ran into that (bug #2964893), and it
looks like there were at least 2 circumstances for this:
- when generating a thumbnail for savegames via the general load/save interface
- using the MT32 emu

Afaict the former could only happen on Loom/PC-Engine, and the latter
only with 11th hour.

Since those calls do not make any sense in 16bit modes, I commited:
r48733: fix the thumbnail issue
r48753: fix the MT32 gfx output
and most importantly:
r48757: "assert(_screenFormat.bytesPerPixel == 1);" in the 2 functions
in the SDL backend.

Please report any issues with these, if a game asserts() now, I missed
it in my tests and it needs to be changed ;)

The doxygen doc's for the 2 palette functions have been adopted:
"It is an error if this function gets called when the pixel format in
use (the return value of getScreenFormat) has more than one byte per
pixel."

Feel free to use the same asserts in your backend :)

Regards,
Andre




More information about the Scummvm-devel mailing list