Checking for Sprite in WIMP sprite pool.
Gareth Lock (2186) 51 posts |
Is there an easy way of looking for a given sprite name in the WIMP sprite pool without failing hard if not found? |
André Timmermans (100) 655 posts |
Use SWI Wimp_SpriteOp which is basically OS_SpriteOp with the sprite area address (R1) filled in by the Wimp. |
Rick Murray (539) 13851 posts |
Minor correction – XWimp_SpriteOp so if the sprite doesn’t exist, the call will return with the V flag set (and R0 pointing to an error block). Easy to check the V flag and know that the call failed. |
Steve Fryatt (216) 2105 posts |
If you just want to know whether or not the sprite exists, the usual way is to read its info and see if that fails. In C with OSLib
and in BASIC
|