summaryrefslogtreecommitdiff
path: root/src/d/snd/d_snd_source.cpp
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-06-06 14:43:21 +0200
committerrobojumper <robojumper@gmail.com>2025-06-06 14:49:39 +0200
commit03e518622a9b10bc45e28170a6b03aba1c09f391 (patch)
tree54f838444f5d489bcbe7cf3337873bc12125ba7c /src/d/snd/d_snd_source.cpp
parented0f2fed88a7ab36c3b323d64f0c45a4aaa09a9b (diff)
A bit of dSndSmallEffectMgr_c
Diffstat (limited to 'src/d/snd/d_snd_source.cpp')
-rw-r--r--src/d/snd/d_snd_source.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/d/snd/d_snd_source.cpp b/src/d/snd/d_snd_source.cpp
index 11a1589e..96b554a5 100644
--- a/src/d/snd/d_snd_source.cpp
+++ b/src/d/snd/d_snd_source.cpp
@@ -3,6 +3,8 @@
#include "common.h"
#include "d/snd/d_snd_3d_actor.h"
#include "d/snd/d_snd_3d_manager.h"
+#include "d/snd/d_snd_mgr.h"
+#include "d/snd/d_snd_player_mgr.h"
#include "nw4r/snd/snd_SoundStartable.h"
#include "nw4r/ut/ut_list.h"
#include "sized_string.h"
@@ -99,6 +101,26 @@ void dSoundSource_c::d_vt_0x5C() {
// noop
}
+u32 dSoundSource_c::getCharacterTalkSoundId(u32 baseSoundId, dSoundSource_c *source) {
+ if (baseSoundId != -1 && source != nullptr) {
+ SizedString<64> label;
+
+ // maybe an inline
+ const char *baseLabel = nullptr;
+ if (dSndMgr_c::GetInstance()->getArchive() != nullptr) {
+ baseLabel = dSndMgr_c::GetInstance()->getArchive()->GetSoundLabelString(baseSoundId);
+ }
+
+ const char *charLabel = source->d_s_vt_0x17C();
+ label.sprintf("%s_%s", baseLabel, charLabel);
+ u32 newLabel = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label);
+ if (newLabel != -1) {
+ return newLabel;
+ }
+ }
+ return baseSoundId;
+}
+
u32 dSoundSource_c::getRemoConSoundVariant(u32 soundId) const {
const char *label = soundIdToSoundLabel(soundId);
SizedString<64> str;