From 8fcb44d5ed5091285c9ff34de009d7f4cda857ff Mon Sep 17 00:00:00 2001 From: DemoJameson Date: Sat, 17 Sep 2022 20:28:01 +0800 Subject: [PATCH] feat: remove the maximum play sounds limit on FMOD5 --- kkapturedll/sound.cpp | 65 +++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 42 deletions(-) diff --git a/kkapturedll/sound.cpp b/kkapturedll/sound.cpp index d2acf80..68538ad 100644 --- a/kkapturedll/sound.cpp +++ b/kkapturedll/sound.cpp @@ -1613,8 +1613,7 @@ struct FMODExSoundDesc float frequency; }; -static const int FMODExNumSounds = 65535; // max # of active (playing) sounds supported -static FMODExSoundDesc FMODExSounds[FMODExNumSounds]; +static std::unordered_map FMODExSoundDescs; static int __stdcall Mine_System_init(void *sys,int maxchan,int flags,void *extradriverdata) { @@ -1630,20 +1629,12 @@ static int __stdcall Mine_System_playSound(void *sys,int index,void *sound,bool int result = Real_System_playSound(sys,index,sound,paused,&chan); if(result == 0) // FMOD_OK { - // find a free sound desc - int index = 0; - while(index