[Scummvm-devel] OSystem::clearScreen documentation / implementation

Max Horn max at quendi.de
Sun Feb 15 08:44:57 CET 2009


Am 15.02.2009 um 04:59 schrieb Paul Gilbert:

> On Sun, Feb 15, 2009 at 1:45 PM, Johannes Schickel  
> <lordhoto at gmail.com> wrote:
> Eugene Sandulenko schrieb:
> > My 2 cents is to extend this method a bit and add optional  
> parameter to
> > it, that is the color value, defaulting to 0. And of course, reflect
> > that in the documentation.
> >
>
> Yeah I thought of that too, but I guess we should then rename it to
> something like OSystem::fillScreen.
>
> I was thinking along the same lines too.. there just seems something  
> hackish about having it as an extra parameter, since it becomes just  
> as efective for filling the screen with any given palette index  
> rather than just clearing the screen.
>
> If we did implement a separate fillScreen method, we could have the  
> existing clearScreen method simply call fillScreen(0). That way  
> engines that specifically need use a non-standard palette index can  
> call fillScreen rather than clearScreen, but we keep the  
> clearScreen() as is for the existing engines.

Hi,

actually, I don't think we need that. With two exceptions (base/ 
main.cpp and sound/softsynth/mt32.cpp), only engines call this method,  
and they should "know" which color they want to clear to / fill with.  
For the two exceptions, well, I think they set up their own palette as  
well, so that is fine.

In fact, I think it's wrong that the PalmOS port overloads clearScreen  
the way it does, though I am not 100% sure. Anyway, I think it would  
be sufficient (and indeed clearer) to have only a  
OSystem::fillScreen(byte color) method (or, thinking about future  
extensions to 16 or 32 bit, maybe make that an uint32 param).


Cheers,
Max




More information about the Scummvm-devel mailing list