[Scummvm-devel] ATTN porters: updateScreen() OSystem method

Marcus Comstedt marcus at mc.pp.se
Wed Apr 19 02:35:07 CEST 2006


"Paul Gilbert" <paulfgilbert at gmail.com> writes:

> I may be missing something obvious, but if the backend is going to be
> responsible for keeping track of the time and only actually doing
> updates every X milliseconds, then couldn't the backend just call
> updateScreen() doing the event generation? That is, every time the
> mouse moves it could just call updateScreen(), which would allow
> responsive updates of the mouse cursor, freeing the engine to only
> need to call it when it actually does some updates itself. It would
> cuts down on CPU usage on battery powered devices, as the calls
> wouldn't be made when there's no cursor movement or screen changes.


Well, the thing is that the backend provides a back-buffering service
to the engine.  The engine can update several rectangles of the screen
after each other, and then call updateScreen().  If the backend were
to render the screen with only a few rectangles in place, the result
might look bad.  (E.g. if you have a scrolling background with sprites
on top of it, the engine might send one rectangle for the background,
and then one for each sprite.  If the screen would be updated before
all sprites had been placed out, some of them would appear to
flicker.)


  // Marcus






More information about the Scummvm-devel mailing list