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 /include | |
| parent | 21eef4331b3e39f8e602679723fb2d05ff925377 (diff) | |
Another two obj source files
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/snd/d_snd_source.h | 2 | ||||
| -rw-r--r-- | include/d/snd/d_snd_source_mgr.h | 4 | ||||
| -rw-r--r-- | include/d/snd/d_snd_source_obj.h | 35 | ||||
| -rw-r--r-- | include/d/snd/d_snd_source_obj_clef.h | 14 | ||||
| -rw-r--r-- | include/d/snd/d_snd_state_mgr.h | 4 |
5 files changed, 58 insertions, 1 deletions
diff --git a/include/d/snd/d_snd_source.h b/include/d/snd/d_snd_source.h index 69a11856..80677ab2 100644 --- a/include/d/snd/d_snd_source.h +++ b/include/d/snd/d_snd_source.h @@ -209,6 +209,7 @@ public: protected: StartResult setupSoundCommon(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg); + void setVolumeFade(f32 volume, u32 fadeFrames); private: /** @@ -255,7 +256,6 @@ private: dSndSeSound2_c *getHandleType2ForSoundHandle_Dupe(nw4r::snd::SoundHandle *pHandle); void initVolumeFade(); - void setVolumeFade(f32 volume, u32 fadeFrames); void calcVolumeFade(); // at 0x00: dSoundSourceIf_c vtable diff --git a/include/d/snd/d_snd_source_mgr.h b/include/d/snd/d_snd_source_mgr.h index 09811591..4ad20816 100644 --- a/include/d/snd/d_snd_source_mgr.h +++ b/include/d/snd/d_snd_source_mgr.h @@ -26,6 +26,10 @@ public: static s32 getSourceCategoryForSourceType(s32 sourceType, const char *name); static bool isSwOrEOc(const char *name); + static dSoundSource_c *getPlayerSource() { + return GetInstance()->mpPlayerSource; + } + static dSoundSource_c *getBoomerangSource() { return GetInstance()->mpBoomerangSource; } diff --git a/include/d/snd/d_snd_source_obj.h b/include/d/snd/d_snd_source_obj.h new file mode 100644 index 00000000..083d91cf --- /dev/null +++ b/include/d/snd/d_snd_source_obj.h @@ -0,0 +1,35 @@ +#ifndef D_SND_SOURCE_OBJ_H +#define D_SND_SOURCE_OBJ_H + +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/math/math_types.h" + +class dSndSourceObj_c : public dSoundSource_c { +public: + dSndSourceObj_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x188 */ virtual void postSetup() override; + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + + /* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId) override { + return specializeBgHitSoundId(soundId, mPolyAttr0, mPolyAttr1); + } + +private: + bool isName(const char *name) const { + return streq(name, getName()); + } +}; + +class dSndSourceObjLightShaft_c : public dSndSourceObj_c { +public: + dSndSourceObjLightShaft_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x1EC */ virtual void setPosition(const nw4r::math::VEC3 &position) override; +}; + +#endif diff --git a/include/d/snd/d_snd_source_obj_clef.h b/include/d/snd/d_snd_source_obj_clef.h new file mode 100644 index 00000000..5ad59445 --- /dev/null +++ b/include/d/snd/d_snd_source_obj_clef.h @@ -0,0 +1,14 @@ +#ifndef D_SND_SOURCE_OBJ_CLEF_H +#define D_SND_SOURCE_OBJ_CLEF_H + +#include "d/snd/d_snd_source_obj.h" + +class dSndSourceObjClef_c : public dSndSourceObj_c { +public: + dSndSourceObjClef_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {} + + bool startTadtoneSound(u32 groupIdx, u32 noteIdx); +}; + +#endif diff --git a/include/d/snd/d_snd_state_mgr.h b/include/d/snd/d_snd_state_mgr.h index 0bf38ac3..d551c57a 100644 --- a/include/d/snd/d_snd_state_mgr.h +++ b/include/d/snd/d_snd_state_mgr.h @@ -49,6 +49,10 @@ public: return field_0x044; } + s32 getField_0x058() const { + return field_0x058; + } + u32 getField_0x11C() const { return field_0x11C; } |
