diff --git a/src/sound/SI2.cpp b/src/sound/SI2.cpp index 7bd8a56..14189b8 100644 --- a/src/sound/SI2.cpp +++ b/src/sound/SI2.cpp @@ -17,6 +17,16 @@ SOUNDKITDEF* SI2::GetSoundKitDef(int32_t id) { return SI2::s_SoundKitDefs[id]; } +int32_t SI2::GetSoundKitID(const char* name) { + auto lookup = SI2::s_SoundKitLookupTable.Ptr(name); + + if (lookup) { + return lookup->ID; + } + + return 0; +} + int32_t SI2::Init(int32_t a1) { // TODO // if (CmdLineGetBool(26)) { diff --git a/src/sound/SI2.hpp b/src/sound/SI2.hpp index 9c78edd..20644b9 100644 --- a/src/sound/SI2.hpp +++ b/src/sound/SI2.hpp @@ -2,10 +2,9 @@ #define SOUND_SI2_HPP #include "sound/SI2Script.hpp" -#include "storm/hash/Hashkey.hpp" -#include "storm/hash/TSHashTable.hpp" #include "ui/Types.hpp" #include +#include #include class SOUNDKITDEF; @@ -20,6 +19,7 @@ class SI2 { // Static functions static SOUNDKITDEF* GetSoundKitDef(int32_t id); + static int32_t GetSoundKitID(const char* name); static int32_t Init(int32_t a1); static void InitSoundKitDefs(); static void InitSoundKitGroups();