diff options
| author | robojumper <robojumper@gmail.com> | 2025-06-14 21:45:38 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-09-13 10:51:35 +0200 |
| commit | d3d5b5736339b5309d2ffec7f7af08ff4fb075e9 (patch) | |
| tree | 5ef672427a0177e6783ff561081d08d0d8bc37cf /include/d | |
| parent | b9ed6c26bda715f2bae11ce6c6e05165072728f8 (diff) | |
d_snd_distant_sound_actor_pool OK
Diffstat (limited to 'include/d')
| -rw-r--r-- | include/d/snd/d_snd_3d_actor.h | 6 | ||||
| -rw-r--r-- | include/d/snd/d_snd_distant_sound_actor.h | 10 | ||||
| -rw-r--r-- | include/d/snd/d_snd_distant_sound_actor_pool.h | 8 |
3 files changed, 23 insertions, 1 deletions
diff --git a/include/d/snd/d_snd_3d_actor.h b/include/d/snd/d_snd_3d_actor.h index 7c7ac4ea..c744a35d 100644 --- a/include/d/snd/d_snd_3d_actor.h +++ b/include/d/snd/d_snd_3d_actor.h @@ -74,6 +74,10 @@ public: mFlags |= flag; } + void setDisabled(bool value) { + mIsDisabled = value; + } + f32 getDistanceToListener() { updateDistanceToListener(); return mDistanceToListener; @@ -98,7 +102,7 @@ public: protected: // a_ prefix to prevent multiple inheritance clashes /* 0x7D */ u8 a_field_0x7D; - /* 0x7E */ u8 a_field_0x7E; + /* 0x7E */ bool mIsDisabled; /* 0x7F */ u8 a_field_0x7F; /* 0x80 */ u8 mIsPaused; /* 0x84 */ f32 a_field_0x84; diff --git a/include/d/snd/d_snd_distant_sound_actor.h b/include/d/snd/d_snd_distant_sound_actor.h index fe29dfec..79070fd8 100644 --- a/include/d/snd/d_snd_distant_sound_actor.h +++ b/include/d/snd/d_snd_distant_sound_actor.h @@ -38,6 +38,10 @@ public: return mpSoundSource == source; } + bool hasAttachedSource() const { + return mpSoundSource; + } + nw4r::snd::SoundHandle *getHandle() { return mpSoundHandle; } @@ -46,6 +50,12 @@ public: mpSoundSource = source; } + // not sure if this combination makes sense + void resetHandle() { + field_0x0F4 = 0; + mpSoundHandle = &mSoundHandle; + } + bool isActive() const { return mIsActive; } diff --git a/include/d/snd/d_snd_distant_sound_actor_pool.h b/include/d/snd/d_snd_distant_sound_actor_pool.h index d7f55a01..108dcc7e 100644 --- a/include/d/snd/d_snd_distant_sound_actor_pool.h +++ b/include/d/snd/d_snd_distant_sound_actor_pool.h @@ -30,15 +30,23 @@ public: return sParam; } + void initialize(); + void calc(); void onChangeStage(); dSndDistantSoundActor_c *acquireActor(u32 soundId, const nw4r::math::VEC3 *position, dSoundSource_c *source); dSndDistantSoundActor_c *findActiveActor(u32 soundId, dSoundSource_c *source); + bool startSound(u32 soundId, const nw4r::math::VEC3 *position); bool holdSound(u32 soundId, const nw4r::math::VEC3 *position); + void setAllPause(bool flag, s32 fadeFrames); + void disableAll(); + void enableAll(); + private: void addToActiveList(dSndDistantSoundActor_c *actor, u32 id); + void removeFromActiveList(dSndDistantSoundActor_c *actor); /* 0x0010 */ dSndDistantSoundActor_c mSounds[POOL_SIZE]; /* 0x4210 */ UNKWORD field_0x4210; |
