From 0998e542a398e3657c29160e5ec631ec767294de Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sat, 22 Nov 2025 13:37:48 -0600 Subject: [PATCH] feat(sound): add SI2::GetSoundKitID --- src/sound/SI2.cpp | 10 ++++++++++ src/sound/SI2.hpp | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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();