Stephane-D / SGDK

SGDK - A free and open development kit for the Sega Mega Drive
https://www.patreon.com/SGDK
MIT License
1.74k stars 187 forks source link

SpriteEngine - auto anim #296

Closed skarab closed 5 months ago

skarab commented 1 year ago

Hi! By now it's not possible to bypass the auto frames animation, it looks its reset in the visibility update, I have hard patched it in the lib but it would be cool to have an option to wholy disable sprite->timer things. Cheers!

Stephane-D commented 6 months ago

Not sure to understand this one, normally setting sprite->timer to 0 is enough to disable auto animation.

skarab commented 5 months ago

Great thanks.

skarab commented 5 months ago

Just a side note, to get it working we need to set sprite->timer to 0 at each frame, else it got overwriden by static u16 updateFrame(Sprite* sprite, u16 status)

Stephane-D commented 5 months ago

Indeed, it requires to reset timer to 0 each time you change frame. I added a new SPR_setAutoAnimation(sprite, bool) method to take care of that in a better way :)