d_snd_anim_sound OK

This commit is contained in:
robojumper
2025-06-15 21:22:07 +02:00
parent 6cb7f3bfdc
commit f6e5303ea2
12 changed files with 449 additions and 100 deletions
+30
View File
@@ -0,0 +1,30 @@
#ifndef D_SND_ANIM_SOUND_H
#define D_SND_ANIM_SOUND_H
#include "d/snd/d_snd_types.h"
#include "nw4r/snd/snd_AnimSound.h"
// Could also inherit from AnimSound
class dSndAnimSound_c {
public:
dSndAnimSound_c(dSoundSource_c *source);
void setData(const void *data);
void setFrame(f32 frame);
void resetFrame(f32 frame);
void setRate(f32 rate);
void setCallback(dSoundSource_c *source);
void setCallback(nw4r::snd::AnimSound::Callback cb, void *userData);
private:
static void animCallback(int, s32, const char *, UNKWORD, void *userData);
/* 0x00 */ nw4r::snd::AnimSound mSound;
/* 0x90 */ const void *mpData;
/* 0x94 */ f32 field_0x94;
/* 0x98 */ f32 field_0x98;
/* 0x9C */ bool mNeedFrameReset;
/* 0xA0 */ nw4r::snd::AnimSound::PlayDirection mDirection;
};
#endif
+18 -1
View File
@@ -29,7 +29,14 @@ public:
dSndSmallEffectMgr_c();
void initialize();
void calc();
void calcTimer();
void stopAllSound(s32 fadeFrames);
void stopAllSoundDemoRelated(s32 fadeFrames); // TODO: better name
void stopAllSoundExceptEvent(s32 fadeFrames);
void stopAllSoundExceptEffectOrLink(s32 fadeFrames);
bool playSound(u32 soundId);
// used for clawshots cursor, pan depends on where on the screen
@@ -47,7 +54,17 @@ public:
bool playDowsingPingSound(f32 volume, f32 pitch);
bool holdDowsingNearestSound();
bool playSirenCountdownSound(s32 timer);
bool playMinigameCountdownSound();
bool playMinigameTimeUpSound(s32 timer);
bool playMinigameStartSound();
bool playMinigameFinishSound();
bool playMinigameFinishWhistleSound();
bool playMinigameScoreUpSound(s32 param);
bool playMinigameScoreDownSound();
bool playMinigameMusasabiSound(s32 count);
bool playSkbSound(u32 soundId);
bool playButtonPressSoundWhenAdvancingTextBoxes(f32);
+3 -1
View File
@@ -63,7 +63,9 @@ public:
virtual void d_s_vt_0x1D4();
virtual void d_s_vt_0x1D8();
virtual void d_s_vt_0x1DC();
virtual void d_s_vt_0x1E0();
virtual void onAnimSoundEvent(UNKWORD arg) {
field_0x154 = arg;
}
virtual void d_s_vt_0x1E4();
virtual u32 d_s_vt_0x1E8(u32 soundId);
+3
View File
@@ -26,6 +26,9 @@ public:
return GetInstance()->mpBoomerangSource;
}
void stopAllSound();
void stopAllNonPlayerSound();
private:
static bool isCertainEnemyType(dSoundSource_c *source);
void removeSourceFromList(dSoundSource_c *source, nw4r::ut::List *list);
+9
View File
@@ -36,6 +36,10 @@ public:
static bool isInStage(const char *stageName);
s32 getStageId_0x044() const {
return field_0x044;
}
u32 getField_0x11C() const {
return field_0x11C;
}
@@ -62,6 +66,11 @@ public:
void setFlowEvent(u32 eventId);
const char *getCurrentStageMusicDemoName() const;
bool isInDemo() const {
return getCurrentStageMusicDemoName() != nullptr;
}
private:
u32 getStageTypeFlags(const char *stageName) const;
// ET, FS, or corresponding Sky Keep rooms