diff options
| author | robojumper <robojumper@gmail.com> | 2025-06-24 22:15:25 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-09-13 10:53:29 +0200 |
| commit | b522045f0e80f5537e6ffc3d38de0ba86677ce08 (patch) | |
| tree | d62e6ab3b8064953041088277488aed285e19315 /src/d/snd/d_snd_source_obj.cpp | |
| parent | 21eef4331b3e39f8e602679723fb2d05ff925377 (diff) | |
Another two obj source files
Diffstat (limited to 'src/d/snd/d_snd_source_obj.cpp')
| -rw-r--r-- | src/d/snd/d_snd_source_obj.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/d/snd/d_snd_source_obj.cpp b/src/d/snd/d_snd_source_obj.cpp new file mode 100644 index 00000000..67792119 --- /dev/null +++ b/src/d/snd/d_snd_source_obj.cpp @@ -0,0 +1,38 @@ +#include "d/snd/d_snd_source_obj.h" + +#include "common.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/math/math_types.h" + +void dSndSourceObj_c::postSetup() { + if (isName("Fire")) { + if (dSndStateMgr_c::isInStage("F008r")) { + // Inside Goddess Statue + setVolumeFade(0.7f, 0); + } + return; + } + + if ((isName("TDoor") || isName("Wind") || isName("Flag")) && + dSndStateMgr_c::GetInstance()->getField_0x058() >= 13) { + setVolumeFade(0.0f, 0); + } +} + +void dSndSourceObjLightShaft_c::setPosition(const nw4r::math::VEC3 &position) { + if (dSndSourceMgr_c::getPlayerSource() != nullptr) { + f32 y = dSndSourceMgr_c::getPlayerSource()->GetPosition().y; + nw4r::math::VEC3 v = position; + if (y > 0.0f) { + v.y = y; + } else { + v.y = 0.0f; + } + SetPosition(v); + mFlags = 0; + holdSound(SE_LightLi_LV); + } +} |
