swars icon indicating copy to clipboard operation
swars copied to clipboard

Choppy cursor

Open geist22 opened this issue 2 years ago • 3 comments

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.

geist22 avatar Jun 14 '22 05:06 geist22

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

PieterVdc avatar Jun 14 '22 07:06 PieterVdc

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.

mefistotelis avatar Jun 14 '22 07:06 mefistotelis

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

mefistotelis avatar Sep 11 '22 09:09 mefistotelis