[Scummvm-devel] Issues with kyrandia engine

Johannes Schickel lordhoto at scummvm.org
Mon Jun 7 18:26:40 CEST 2010


On 06/07/2010 04:19 PM, Max Horn wrote:
>
> This sounds like your throttling logic is broken. It is only correct if one assumes that one either only ever gets rare screen updates (always more than 1/30th apart), or always gets very frequent updates (in your case, that would mean that screen updates should happen at least 30 times per sec, but to be on the safe side and actually always get at least 30FPS, the engine would have to make at least 60 updates per sec, cf Nyquist Frequency).
>
> A more appropriate approach would be this: Whenever you get a screen update request, set a "screen is dirty variable". Then, update the screen from a thread resp. triggered by a timer at regular intervals. If you don't have threads/timers or if those are not available, then a good workaround is to hook into various OSystem methods (like pollEvent, delayMillis, getMillis, ...) and add code to them which checks if a screen update is necessary, and if so, performs one. Various backends (e.g. the NDS one) use this approach
>
> This way, you still rate limit the screen update frequency, but don't miss critical updates.
>    

Sounds very sensible to me. I guess it might be a good idea to mention 
this on the wiki page too...

// Johannes





More information about the Scummvm-devel mailing list