I need to do some more testing with my audiolib findings before I report anything. There is definitely something going on, which is causing problems in my multithreading code, the problem is not 100% confident on where its coming from yet. SDL_Mixer is definetly fucking with classic and Polymost somehow in my branch. I just don't know how yet.
Hendricks, in my branch I plan on replacing all FX_SoundActive calls with a custom SoundActive function I created that tests if the channel playing the audio is playing the audio the code is expecting. My sound system has been using this for awhile, but there are extra calls FX_SoundActive calls through out the SW codebase. Callbackval is set by FX_Play3D or FX_SoundPlay with the value of the sound id passed in PlaySound. Do you see a problem with this?
//
// SW_SoundIsActive
//
bool SW_SoundIsActive(int handle, int snum)
{
return FX_SoundActive(handle) && FX_GetVoiceCallback(handle) == snum;
}
Where FX_GetVoiceCallback calls MV_GetCallback
int32_t MV_GetCallback(int32_t handle)
{
VoiceNode *voice = MV_GetVoice(handle);
if (voice == NULL)
return MV_Error;
int32_t callbackval = voice->callbackval;
return callbackval;
}
So in DoZillaMove:
if (!FX_SoundActive(handle))
{
...
}
Would turn into
if (!SW_SoundIsActive(handle, DIGI_Z16004.GetVar()))
{
...
}