[Scummvm-devel] Issues with kyrandia engine

Max Horn max at quendi.de
Mon Jun 7 16:19:42 CEST 2010


Am 07.06.2010 um 15:31 schrieb yotam barnoy:

[...]
> I think you're right -- the updates for the animations arrive less
> than 1/30th of a second after the previous ones, and since they're
> single updates, they get ignored by the FPS limit code.

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.



Bye,
Max



More information about the Scummvm-devel mailing list