[Scummvm-devel] 'gob' engine & 8bpp

Johannes Schickel lordhoto at gmail.com
Wed Apr 1 17:46:29 CEST 2015


On 04/01/2015 12:54 PM, Miro Kropáček wrote:
>
>
>     As of the GUI, we broke 8bpp awhile ago but changes for bringing
>     it back should be not that big. There is FANCY_THEMES define on
>     the code for letting only classic 4 color themes used. Though I
>     did not try that for ages.
>
>     Thus I think it is still possible to have 8bpp-only backend
>     implemented without tremendous effort.
>
> Oh, that's definitely good news. In the meantime I've gotten hold of 
> an Amiga port source code, the author had used his own 8bpp backend so 
> it must be possible. He had decided to use an older version to port 
> (1.4.1), however.
>

The define mentioned has two major effects:

1. It disables the anti-aliasted rendering code.

     This change will help you in the sense that you possibly have to 
adapt less code (depending on which direction you go with the GUI).

2. It disables (some) GUI code which uses images (like the ScummVM logo 
in the launcher etc.).

     This change will break the modern theme in its "high resolution" 
version (i.e. the one which uses the ScummVM logo in the launcher). 
However, it won't force ScummVM to use the classic theme though. The 
modern theme still works fine at 320x200 and 320x240 (or at least should 
work fine, which a quick test launch of ScummVM compiled with 
DISABLE_FANCY_THEMES seems to confirm).
     It does not completely remove the usage of images in the GUI 
though. The high resolution version of the save/load dialog will still 
display thumbnails (even in classic mode). This might not be an issue 
for you since you might be using 320x200 anyway.

However, even with the DISABLE_FANCY_THEMES define set the rendering 
pipeline is still assuming that all colors are RGB based and not color 
indexed.
As I mentioned in my previous mail, you could try to use a 8bpp RGB mode 
like RGB332 or similar and then simply setup the palette to match 
RGB332. Then adapting the GUI might be simply a matter of adding a 
"uint8" case to createRenderer in graphics/VectorRendererSpec.cpp 
341-367 (and assuring that the 1Bpp mode the overlay is set to is not a 
indexed one). This is probably the least amount of work.

Adaping the GUI to actually work with paletted CLUT8 might get a lot 
trickier. The VectorRenderer API itself gets R, G, B values for the 
colors it is supposed to draw (see graphics/VectorRenderer.h). This is fine.
You would now need to adapt the implementation inside VectorRendererSpec 
to find closest color matches in the palette (note that 
VectorRendererSpec does not know about any palettes right now too) and 
use this. This might be some amount of work for the various renderering 
calls. You could only adapt the ones used by the classic theme, this 
would reduce the amount of work.
Be aware that even the current classic theme uses alpha blending in some 
cases (for example, check the dialog background of the "About" dialog). 
Back in the days we had a way to disable this in the GUI graphics code, 
but this does not exist anymore. Thus, you would need to check how to 
handle that.

// Johannes




More information about the Scummvm-devel mailing list