Hello,
I have some objects in my game that, when killed, are disabled (orxObject_Enable( object, orxFALSE )) to avoid the overhead of deleting and recreating the object.
The problem is when the object is disabled all sounds added to it never end. Is there a way to stop and remove all those sounds?
Comments
You should be able to stop all the sounds on your object with a call to orxSoundPointer_Stop(), however they won't get removed.
I can add a orxSoundPointer_RemoveAllSound() tonight for that purpose.
Out of curiosity, were you often deleting/creating a lot of objects and did it become a performance issue?
For shaders and sounds, simply call the CreateFromConfig() with the appropriate name and whenever you want to unload the asset, you can call Delete() on them.
For textures, call CreateFromFile() to load them and Delete() to unload them.
You can easily find the names in your config data or add explicit lists of load/unload per level for example, or whichever scheme suits your game.
For Drops, I preload all the sound samples while the splash screen is displayed to prevent any glitch later. The source's available if you wanted an example.