koboredux
koboredux copied to clipboard
Smarter handling of inaudible continuous sound effects
Currently, the continuous sound effects are (almost) always started unconditionally, and keep running until killed, whether or not they're actually audible. This is because KOBO_sound::g_move() wouldn't know which sound effect to start after the fact, as the program handle is only passed to g_start()!
(The only exception is when sound is muted, in which case ALL continuous sound effects are restarted as needed from a higher level, where all the program handles are available.)
The easiest way to deal with this is probably to pass the program handle to g_move() as well, so it can just start the intended sound if it isn't running already. We could probably just replace g_start() and g_move() with a single g_run() call, to avoid confusion.
This might not seem like a big deal, but there are a lot of cores on some levels... And there will most likely show up a lot of new continuous sound effects as well. As I've probably mentioned elsewhere, I'm considering using a single A2S program for each object, encapsulating all sound effects for the object, for more flexibility - similar to how the core sounds actually respond to damage, rather than just triggering additional "damage" sound effects.
Note to self: This needs fade-out + kill - not stop + release! We don't want to trigger (inaudible) death sound effects and stuff.