swars
swars copied to clipboard
Choppy cursor
As mentioned elsewhere already, the cursor feels very choppy, like it only updates a few times per second.
If the mouse could update at the same rate as the OS or at least at 60+ fps, it would greatly increase playability.
for keeperFx (other rewrite that uses same engine) rainlizard started implementing a feature that would decouple the fps from the gamelogic speed kfx has most of the code rewritten in C and there he mentioned it might not be worth finishing because it caused so many small glitches everywhere, given that swars in largely asm would probably be even harder
https://github.com/dkfans/keeperfx/pull/1539
Everything related to mouse is already rewritten in swars, and already part of bflibrary. And for the asynchronous cursor - I don't really see how it wouldn't work. It just needs to be implemented properly. There is already a pair of Draw/Undraw features for mouse, and the related classes are already thread safe (they use semaphores).
The KeeperFX PR you linked to tries to detach the whole drawing, not only mouse cursor.
Idling function now has a callback executed every 20ms - that would be a good place for the mouse cursor redrawing: https://github.com/mefistotelis/swars/commit/1308fb5f850e680ac2ab1d99f832ca37d2a853c5