Refactoring

This commit is contained in:
robojumper
2025-06-04 23:47:43 +02:00
parent e9935e6233
commit 35ae04fdf9
53 changed files with 455 additions and 218 deletions
+13 -4
View File
@@ -2386,6 +2386,7 @@ d/snd/d_snd_control_player_mgr.cpp:
d/snd/d_snd_3d_manager.cpp:
.text start:0x80360C30 end:0x8036145C align:16
.data start:0x805487D0 end:0x805487E0
.sbss start:0x80575D58 end:0x80575D60
.sdata2 start:0x8057D3B8 end:0x8057D3F8
d/snd/d_snd_mgr_enemy.cpp:
@@ -2393,10 +2394,18 @@ d/snd/d_snd_mgr_enemy.cpp:
.ctors start:0x804DB918 end:0x804DB91C
d/snd/d_snd_unk_component_2.cpp:
.text start:0x80366430 end:0x8036B8D0 align:16
.text start:0x80366430 end:0x8036A3A4 align:16
d/snd/d_snd_sound_ex.cpp:
.text start:0x8036B8D0 end:0x8036C090 align:16
d/snd/d_snd_area_sound_effect_mgr.cpp:
.text start:0x8036A3B0 end:0x8036B8D0
.data start:0x80548B38 end:0x80548B48
.sbss start:0x80575D78 end:0x80575D80
.sdata2 start:0x8057D8B0 end:0x8057D8E8
d/snd/d_snd_area_sound.cpp:
.text start:0x8036B8D0 end:0x8036C090
.data start:0x80548B48 end:0x80548B78
.sdata2 start:0x8057D8E8 end:0x8057D920
d/snd/d_snd_control_sound.cpp:
.text start:0x8036C090 end:0x8036C444 align:16
@@ -2411,7 +2420,7 @@ d/snd/d_snd_control_player.cpp:
d/snd/d_snd_unk_15.cpp:
.text start:0x8036C6B0 end:0x8037D800 align:16
d/snd/d_snd_effect_mgr.cpp:
d/snd/d_snd_small_effect_mgr.cpp:
.text start:0x8037D800 end:0x8037F8B4 align:16
.data start:0x805491B8 end:0x805491D0
.sbss start:0x80575D98 end:0x80575DA0
+29 -29
View File
@@ -19889,7 +19889,7 @@ __dt__33dSndControlSoundStrmTrackVolume_cFv = .text:0x8035C7D0; // type:function
__dt__11dSndSound_cFv = .text:0x8035C810; // type:function size:0xA0
cancel__11dSndSound_cFv = .text:0x8035C8B0; // type:function size:0x84
resetControls__11dSndSound_cFv = .text:0x8035C940; // type:function size:0xE8
executeCtrls__11dSndSound_cFv = .text:0x8035CA30; // type:function size:0xD8
calc__11dSndSound_cFv = .text:0x8035CA30; // type:function size:0xD8
fadeIn__11dSndSound_cFUll = .text:0x8035CB10; // type:function size:0x6C
stop__11dSndSound_cFl = .text:0x8035CB80; // type:function size:0xD4
pause__11dSndSound_cFbl = .text:0x8035CC60; // type:function size:0xCC
@@ -20019,7 +20019,7 @@ setFxSend__22dSndControlPlayerMgr_cFUlfl = .text:0x80360510; // type:function si
getAppliedPlayerVolume__22dSndControlPlayerMgr_cCFUl = .text:0x80360530; // type:function size:0x38
setControlValue__22dSndControlPlayerMgr_cFQ222dSndControlPlayerMgr_c12PlayerCtrl_eUlfl = .text:0x80360570; // type:function size:0xB0
resetControls__22dSndControlPlayerMgr_cFv = .text:0x80360620; // type:function size:0xAC
getTargetValue__22dSndControlPlayerMgr_cCFQ222dSndControlPlayerMgr_c12PlayerCtrl_eUl = .text:0x803606D0; // type:function size:0x40
getControlTarget__22dSndControlPlayerMgr_cCFQ222dSndControlPlayerMgr_c12PlayerCtrl_eUl = .text:0x803606D0; // type:function size:0x40
fn_80360710 = .text:0x80360710; // type:function size:0x78
fn_80360790 = .text:0x80360790; // type:function size:0x5C
fn_803607F0 = .text:0x803607F0; // type:function size:0x60
@@ -20335,24 +20335,24 @@ fn_8036A220 = .text:0x8036A220; // type:function size:0x3C
fn_8036A260 = .text:0x8036A260; // type:function size:0x6C
fn_8036A2D0 = .text:0x8036A2D0; // type:function size:0xB8
fn_8036A390 = .text:0x8036A390; // type:function size:0x14
fn_8036A3B0 = .text:0x8036A3B0; // type:function size:0x78
fn_8036A430 = .text:0x8036A430; // type:function size:0x48
fn_8036A480 = .text:0x8036A480; // type:function size:0x10
fn_8036A490 = .text:0x8036A490; // type:function size:0x88
fn_8036A520 = .text:0x8036A520; // type:function size:0x58
fn_8036A580 = .text:0x8036A580; // type:function size:0x74
__dt__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c>Fv = .text:0x8036A3B0; // type:function size:0x78
create__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c>Fv = .text:0x8036A430; // type:function size:0x48
remove__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c>Fv = .text:0x8036A480; // type:function size:0x10
__ct__24dSndAreaSoundEffectMgr_cFv = .text:0x8036A490; // type:function size:0x88
__dt__15dSndAreaSound_cFv = .text:0x8036A520; // type:function size:0x58
calc__24dSndAreaSoundEffectMgr_cFv = .text:0x8036A580; // type:function size:0x74
fn_8036A600 = .text:0x8036A600; // type:function size:0x88
fn_8036A690 = .text:0x8036A690; // type:function size:0x9C
fn_8036A730 = .text:0x8036A730; // type:function size:0xEC
startSound__24dSndAreaSoundEffectMgr_cFUlUl = .text:0x8036A730; // type:function size:0xEC
fn_8036A820 = .text:0x8036A820; // type:function size:0x328
fn_8036AB50 = .text:0x8036AB50; // type:function size:0x20
fn_8036AB70 = .text:0x8036AB70; // type:function size:0x4
fn_8036AB80 = .text:0x8036AB80; // type:function size:0x4
fn_8036AB90 = .text:0x8036AB90; // type:function size:0xFC
fn_8036AC90 = .text:0x8036AC90; // type:function size:0x68
stopSounds__24dSndAreaSoundEffectMgr_cFl = .text:0x8036AC90; // type:function size:0x68
fn_8036AD00 = .text:0x8036AD00; // type:function size:0xB0
fn_8036ADB0 = .text:0x8036ADB0; // type:function size:0x44
fn_8036AE00 = .text:0x8036AE00; // type:function size:0x80
isPlayingAnySound__24dSndAreaSoundEffectMgr_cCFv = .text:0x8036ADB0; // type:function size:0x44
isPlayingSound__24dSndAreaSoundEffectMgr_cCFUl = .text:0x8036AE00; // type:function size:0x80
fn_8036AE80 = .text:0x8036AE80; // type:function size:0xF4
fn_8036AF80 = .text:0x8036AF80; // type:function size:0x2C
fn_8036AFB0 = .text:0x8036AFB0; // type:function size:0x1C0
@@ -20364,12 +20364,12 @@ fn_8036B5C0 = .text:0x8036B5C0; // type:function size:0x6C
fn_8036B630 = .text:0x8036B630; // type:function size:0x170
fn_8036B7A0 = .text:0x8036B7A0; // type:function size:0x110
fn_8036B8B0 = .text:0x8036B8B0; // type:function size:0x20
fn_8036B8D0 = .text:0x8036B8D0; // type:function size:0x54
fn_8036B930 = .text:0x8036B930; // type:function size:0x34
fn_8036B970 = .text:0x8036B970; // type:function size:0xC4
fn_8036BA40 = .text:0x8036BA40; // type:function size:0x50
fn_8036BA90 = .text:0x8036BA90; // type:function size:0xBC
fn_8036BB50 = .text:0x8036BB50; // type:function size:0x74
__ct__15dSndAreaSound_cFv = .text:0x8036B8D0; // type:function size:0x54
cancel__15dSndAreaSound_cFv = .text:0x8036B930; // type:function size:0x34
calc__15dSndAreaSound_cFv = .text:0x8036B970; // type:function size:0xC4
fadeIn__15dSndAreaSound_cFUll = .text:0x8036BA40; // type:function size:0x50
pause__15dSndAreaSound_cFl = .text:0x8036BA90; // type:function size:0xBC
unpause__15dSndAreaSound_cFl = .text:0x8036BB50; // type:function size:0x74
fn_8036BBD0 = .text:0x8036BBD0; // type:function size:0x24
fn_8036BC00 = .text:0x8036BC00; // type:function size:0x24
fn_8036BC30 = .text:0x8036BC30; // type:function size:0x24
@@ -20828,11 +20828,11 @@ fn_8037D640 = .text:0x8037D640; // type:function size:0x6C
fn_8037D6B0 = .text:0x8037D6B0; // type:function size:0x5C
fn_8037D710 = .text:0x8037D710; // type:function size:0x94
fn_8037D7B0 = .text:0x8037D7B0; // type:function size:0x50
SoundEffectSoundMgr__dtor = .text:0x8037D800; // type:function size:0x78
initSoundEffectSoundMgr = .text:0x8037D880; // type:function size:0x48
SoundEffectSoundMgr__deref = .text:0x8037D8D0; // type:function size:0x10
SoundEffectSoundMgr__ctor = .text:0x8037D8E0; // type:function size:0x9C
fn_8037D980 = .text:0x8037D980; // type:function size:0xC
__dt__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D800; // type:function size:0x78
create__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D880; // type:function size:0x48
remove__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D8D0; // type:function size:0x10
__ct__20dSndSmallEffectMgr_cFv = .text:0x8037D8E0; // type:function size:0x9C
__ct__Q34nw4r3snd11SoundHandleFv = .text:0x8037D980; // type:function size:0xC
fn_8037D990 = .text:0x8037D990; // type:function size:0x4
fn_8037D9A0 = .text:0x8037D9A0; // type:function size:0xA0
fn_8037DA40 = .text:0x8037DA40; // type:function size:0x18
@@ -20842,13 +20842,13 @@ fn_8037DBB0 = .text:0x8037DBB0; // type:function size:0x98
fn_8037DC50 = .text:0x8037DC50; // type:function size:0x70
fn_8037DCC0 = .text:0x8037DCC0; // type:function size:0x48
fn_8037DD10 = .text:0x8037DD10; // type:function size:0x1BC
playSound__17SmallSoundManagerF7WZSound = .text:0x8037DED0; // type:function size:0x2D0
playSound__20dSndSmallEffectMgr_cFUl = .text:0x8037DED0; // type:function size:0x2D0
fn_8037E1A0 = .text:0x8037E1A0; // type:function size:0x90
fn_8037E230 = .text:0x8037E230; // type:function size:0xEC
fn_8037E320 = .text:0x8037E320; // type:function size:0x78
fn_8037E3A0 = .text:0x8037E3A0; // type:function size:0x158
fn_8037E500 = .text:0x8037E500; // type:function size:0x58
playSoundWithPitch__17SmallSoundManagerF7WZSoundf = .text:0x8037E560; // type:function size:0xBC
playSoundWithPitch__20dSndSmallEffectMgr_cFUlf = .text:0x8037E560; // type:function size:0xBC
fn_8037E620 = .text:0x8037E620; // type:function size:0xDC
fn_8037E700 = .text:0x8037E700; // type:function size:0x8
fn_8037E710 = .text:0x8037E710; // type:function size:0x8
@@ -20872,7 +20872,7 @@ fn_8037EE40 = .text:0x8037EE40; // type:function size:0x3C
fn_8037EE80 = .text:0x8037EE80; // type:function size:0x64
playSound = .text:0x8037EEF0; // type:function size:0xAC
fn_8037EFA0 = .text:0x8037EFA0; // type:function size:0x80
playButtonPressSoundWhenAdvancingTextBoxes__17SmallSoundManagerFf = .text:0x8037F020; // type:function size:0xB4
playButtonPressSoundWhenAdvancingTextBoxes__20dSndSmallEffectMgr_cFf = .text:0x8037F020; // type:function size:0xB4
fn_8037F0E0 = .text:0x8037F0E0; // type:function size:0xC
fn_8037F0F0 = .text:0x8037F0F0; // type:function size:0x60
fn_8037F150 = .text:0x8037F150; // type:function size:0x6D0
@@ -37733,7 +37733,7 @@ lbl_80549188 = .data:0x80549188; // type:object size:0x10
lbl_80549198 = .data:0x80549198; // type:object size:0x10
lbl_805491A8 = .data:0x805491A8; // type:object size:0x10
lbl_805491B8 = .data:0x805491B8; // type:object size:0xC
vtable5 = .data:0x805491C4; // type:object size:0xC
__vt__38SndMgrDisposer<20dSndSmallEffectMgr_c> = .data:0x805491C4; // type:object size:0xC
lbl_805491D0 = .data:0x805491D0; // type:object size:0x10
jumptable_805491E0 = .data:0x805491E0; // type:object size:0x20 scope:local
lbl_80549200 = .data:0x80549200; // type:object size:0x14 data:4byte
@@ -41909,8 +41909,8 @@ FANFARE_SOUND_MGR_source = .sbss:0x80575D84; // type:object size:0x4 data:4byte
lbl_80575D88 = .sbss:0x80575D88; // type:object size:0x8 data:4byte
SOME_UNUSED_SOUND_MGR = .sbss:0x80575D90; // type:object size:0x4 data:4byte
SOME_UNUSED_SOUND_MGR_source = .sbss:0x80575D94; // type:object size:0x4 data:4byte
sInstance__17SmallSoundManager = .sbss:0x80575D98; // type:object size:0x4 data:4byte
SOUND_EFFECT_SOUND_MGR_source = .sbss:0x80575D9C; // type:object size:0x4 data:4byte
sInstance__20dSndSmallEffectMgr_c = .sbss:0x80575D98; // type:object size:0x4 data:4byte
sDisposer__20dSndSmallEffectMgr_c = .sbss:0x80575D9C; // type:object size:0x4 data:4byte
lbl_80575DA0 = .sbss:0x80575DA0; // type:object size:0x4 data:4byte
lbl_80575DA4 = .sbss:0x80575DA4; // type:object size:0x4 data:4byte
ENEMY_BGM_RELATED_MGR = .sbss:0x80575DA8; // type:object size:0x4 data:4byte
+3 -2
View File
@@ -712,11 +712,12 @@ config.libs = [
Object(Matching, "d/snd/d_snd_3d_manager.cpp"),
Object(NonMatching, "d/snd/d_snd_mgr_enemy.cpp"),
Object(NonMatching, "d/snd/d_snd_unk_component_2.cpp"),
Object(NonMatching, "d/snd/d_snd_sound_ex.cpp"),
Object(NonMatching, "d/snd/d_snd_area_sound_effect_mgr.cpp"),
Object(NonMatching, "d/snd/d_snd_area_sound.cpp"),
Object(Matching, "d/snd/d_snd_control_sound.cpp"),
Object(Matching, "d/snd/d_snd_control_player.cpp"),
Object(NonMatching, "d/snd/d_snd_unk_15.cpp"),
Object(NonMatching, "d/snd/d_snd_effect_mgr.cpp"),
Object(NonMatching, "d/snd/d_snd_small_effect_mgr.cpp"),
Object(NonMatching, "d/snd/d_snd_harp_mgr.cpp"),
Object(NonMatching, "d/snd/d_snd_anim_sound.cpp"),
Object(NonMatching, "d/snd/d_snd_mgr_unk_14.cpp"),
-2
View File
@@ -52,8 +52,6 @@ public:
void updatePositionRelativeToListener();
void updateDistanceToListener();
void resetFloats();
bool checkFlag(u16 flag) const {
return (mFlags & flag);
}
+4 -19
View File
@@ -9,24 +9,10 @@
#include "nw4r/snd/snd_Sound3DListener.h"
#include "nw4r/snd/snd_Sound3DManager.h"
class dSnd3DManager_c;
extern template class SndMgrDisposer<dSnd3DManager_c>;
SND_DISPOSER_FORWARD_DECL(dSnd3DManager_c);
class dSnd3DManager_c {
public:
SndMgrDisposer<dSnd3DManager_c> *GetDisposer() {
return &mDisposer;
}
static dSnd3DManager_c *GetInstance() {
return sInstance;
}
static dSnd3DManager_c *sInstance;
static SndMgrDisposer<dSnd3DManager_c> *sDisposer;
private:
SndMgrDisposer<dSnd3DManager_c> mDisposer;
SND_DISPOSER_MEMBERS(dSnd3DManager_c);
public:
dSnd3DManager_c();
@@ -37,8 +23,8 @@ public:
void resetCamDistance();
void calc();
void clearState();
nw4r::snd::Sound3DManager& getManager() {
nw4r::snd::Sound3DManager &getManager() {
return mManager;
}
@@ -59,7 +45,6 @@ public:
}
private:
void updateListenerPos(f32);
/* 0x10 */ bool mIsSetup;
/* 0x11 */ bool mCalculationsFresh;
+38
View File
@@ -0,0 +1,38 @@
#ifndef D_SND_AREA_SOUND_H
#define D_SND_AREA_SOUND_H
#include "common.h"
#include "d/snd/d_snd_sound.h"
/** A sound class used for dSndAreaSoundEffectMgr */
class dSndAreaSound_c : public dSndSound_c {
public:
dSndAreaSound_c();
virtual void cancel() override; // 0x08
virtual void calc() override; // 0x0C
virtual void fadeIn(u32 id, s32 fadeFrames) override; // 0x10
virtual void initCallback(u32 id); // 0x28
typedef void (*Callback)(dSndAreaSound_c &sound);
using dSndSound_c::pause;
void pause(s32 fadeFrames);
void unpause(s32 fadeFrames);
private:
bool isFadingOut() const {
return mIsFadingOut && IsAttachedSound();
}
/* 0x0F0 */ bool field_0xF0;
/* 0x0F4 */ Callback mpCalcCallback;
/* 0x0F8 */ UNKWORD field_0xF8;
/* 0x0FC */ UNKWORD field_0xFC;
/* 0x100 */ UNKWORD field_0x100;
/* 0x104 */ UNKWORD field_0x104;
};
#endif
@@ -0,0 +1,39 @@
#ifndef D_SND_AREA_SOUND_EFFECT_MGR_H
#define D_SND_AREA_SOUND_EFFECT_MGR_H
#include "common.h"
#include "d/snd/d_snd_actor.h"
#include "d/snd/d_snd_area_sound.h"
#include "d/snd/d_snd_util.h"
SND_DISPOSER_FORWARD_DECL(dSndAreaSoundEffectMgr_c);
/**
* A singleton sound actor for playing persistent environmental background
* sound effects. Turn this off and the Faron birds will stop singing.
*
* Plays sounds like SE_A_F100 (hence the name, not sure if it's the real meaning).
*/
class dSndAreaSoundEffectMgr_c {
SND_DISPOSER_MEMBERS(dSndAreaSoundEffectMgr_c)
public:
dSndAreaSoundEffectMgr_c();
bool startSound(u32 soundId, u32 handleIdx);
void calc();
void stopSounds(s32 fadeFrames);
private:
bool isPlayingAnySound() const;
bool isPlayingSound(u32 soundId) const;
/* 0x010 */ dSndAreaSound_c mSounds[3];
/* 0x328 */ UNKWORD field_0x328;
/* 0x32C */ f32 field_0x32C;
/* 0x330 */ f32 field_0x330;
/* 0x334 */ dSndActor_c mActor;
/* 0x388 */ f32 field_0x388;
};
#endif
+3 -17
View File
@@ -32,24 +32,10 @@ Notes on player groups:
17: TgSound
*/
class dSndControlPlayerMgr_c;
extern template class SndMgrDisposer<dSndControlPlayerMgr_c>;
SND_DISPOSER_FORWARD_DECL(dSndControlPlayerMgr_c);
class dSndControlPlayerMgr_c {
public:
SndMgrDisposer<dSndControlPlayerMgr_c> *GetDisposer() {
return &mDisposer;
}
static dSndControlPlayerMgr_c *GetInstance() {
return sInstance;
}
static dSndControlPlayerMgr_c *sInstance;
static SndMgrDisposer<dSndControlPlayerMgr_c> *sDisposer;
private:
SndMgrDisposer<dSndControlPlayerMgr_c> mDisposer;
SND_DISPOSER_MEMBERS(dSndControlPlayerMgr_c);
public:
enum PlayerCtrl_e {
@@ -87,7 +73,7 @@ private:
void unlinkCtrl(dSndControlPlayer_c *);
void setControlValue(PlayerCtrl_e ctrlType, u32 playerIdx, f32 value, s32 frames);
f32 getAppliedPlayerVolume(u32 playerIdx) const;
f32 getControlVolumeTarget(PlayerCtrl_e ctrlType, u32 playerIdx) const;
f32 getControlTarget(PlayerCtrl_e ctrlType, u32 playerIdx) const;
/* 0x10 */ dSndControlPlayer_c *mpCtrls[CTRL_MAX];
/* 0x1C */ f32 *mpTargetVolumes;
+2 -15
View File
@@ -7,8 +7,7 @@
#include "nw4r/snd/snd_SoundHandle.h"
#include "nw4r/snd/snd_SoundStartable.h"
class dSndPlayerMgr_c;
extern template class SndMgrDisposer<dSndPlayerMgr_c>;
SND_DISPOSER_FORWARD_DECL(dSndPlayerMgr_c);
/**
* The main interface for managing sound stuff. Will delegate to dSndMgr_c for
@@ -16,19 +15,7 @@ extern template class SndMgrDisposer<dSndPlayerMgr_c>;
*/
class dSndPlayerMgr_c {
public:
SndMgrDisposer<dSndPlayerMgr_c> *GetDisposer() {
return &mDisposer;
}
static dSndPlayerMgr_c *GetInstance() {
return sInstance;
}
static dSndPlayerMgr_c *sInstance;
static SndMgrDisposer<dSndPlayerMgr_c> *sDisposer;
private:
SndMgrDisposer<dSndPlayerMgr_c> mDisposer;
SND_DISPOSER_MEMBERS(dSndPlayerMgr_c);
public:
dSndPlayerMgr_c();
+31
View File
@@ -0,0 +1,31 @@
#ifndef D_SND_SMALL_EFFECT_MGR_H
#define D_SND_SMALL_EFFECT_MGR_H
#include "d/snd/d_snd_util.h"
#include "d/snd/d_snd_wzsound.h" // IWYU pragma: export
#include "nw4r/snd/snd_SoundHandle.h"
SND_DISPOSER_FORWARD_DECL(dSndSmallEffectMgr_c);
/**
* An interface for playing the SE_S ("sound effect, small"?) sounds.
*/
class dSndSmallEffectMgr_c {
SND_DISPOSER_MEMBERS(dSndSmallEffectMgr_c)
public:
dSndSmallEffectMgr_c();
void playSound(u32 soundId);
void playSoundWithPitch(u32 soundId, f32 pitch);
void playButtonPressSoundWhenAdvancingTextBoxes(f32);
private:
/* 0x10 */ void *field_0x10;
/* 0x14 */ void *field_0x14;
/* 0x18 */ void *field_0x18;
/* 0x1C */ nw4r::snd::SoundHandle mHandles[3];
};
#endif
+7 -7
View File
@@ -136,14 +136,14 @@ public:
dSndSound_c();
~dSndSound_c();
virtual void cancel(); // 0x08
virtual void executeCtrls(); // 0x0C
virtual void fadeIn(u32 id, s32 fadeFrames); // 0x10
virtual void cancel(); // 0x08
virtual void calc(); // 0x0C
virtual void fadeIn(u32 id, s32 fadeFrames); // 0x10
virtual nw4r::snd::SoundStartable::StartResult prepareSound(u32 soundId, u32 startOffset); // 0x14
virtual nw4r::snd::SoundStartable::StartResult prepareSound(const char *label, u32 startOffset); // 0x18
virtual void onPreparing(u32 soundId, u32 startOffset); // 0x1C
virtual void stop(s32 fadeFrames); // 0x20
virtual void pause(bool pauseFlag, s32 fadeFrames); // 0x24
virtual void onPreparing(u32 soundId, u32 startOffset); // 0x1C
virtual void stop(s32 fadeFrames); // 0x20
virtual void pause(bool pauseFlag, s32 fadeFrames); // 0x24
bool isStrmSound();
bool isWaveSound();
@@ -173,7 +173,7 @@ public:
void linkCtrl(dSndControlSound_c *);
void unlinkCtrl(dSndControlSound_c *);
private:
protected:
bool cannotStart() const {
return mIsRunning && !mIsFadingOut && IsAttachedSound();
}
+29
View File
@@ -39,4 +39,33 @@ void SndMgrDisposer<T>::remove() {
T::sDisposer = nullptr;
}
#define SND_DISPOSER_FORWARD_DECL(class_name) \
class class_name; \
extern template class SndMgrDisposer<class_name>;
#define SND_DISPOSER_DEFINE(class_name) \
template class SndMgrDisposer<class_name>; \
class_name *class_name::sInstance; \
SndMgrDisposer<class_name> *class_name::sDisposer;
#define SND_DISPOSER_MEMBERS(class_name) \
public: \
SndMgrDisposer<class_name> *GetDisposer() { \
return &mDisposer; \
} \
\
static class_name *GetInstance() { \
return sInstance; \
} \
\
static void create() { \
SndMgrDisposer<class_name>::create(); \
} \
\
static class_name *sInstance; \
static SndMgrDisposer<class_name> *sDisposer; \
\
private: \
SndMgrDisposer<class_name> mDisposer;
#endif
@@ -1,9 +1,8 @@
#ifndef SMALL_SOUND_MGR_H
#define SMALL_SOUND_MGR_H
#ifndef D_SND_WZSOUND_H
#define D_SND_WZSOUND_H
// Thanks kiwi! https://gist.github.com/kiwi515/47bb17b07ed502bdfa7faa60bc48a3c7
#include "common.h"
enum WZSound {
/* 0x0000 */ SE_L_FLIPED,
/* 0x0001 */ SE_L_FS_START,
@@ -6469,18 +6468,4 @@ enum WZSound {
/* 0x193D */ LABEL_SOUND_END
};
class SmallSoundManager {
public:
void playSound(WZSound id);
void playSoundWithPitch(WZSound id, f32 pitch);
void playButtonPressSoundWhenAdvancingTextBoxes(f32);
static SmallSoundManager *GetInstance() {
return sInstance;
}
private:
static SmallSoundManager *sInstance;
};
#endif
+7
View File
@@ -64,6 +64,13 @@ namespace nw4r { namespace snd
return IsAttachedSound() && mSound->IsPause();
}
int GetRemainingFadeFrames() const {
if (IsAttachedSound())
return mSound->GetRemainingFadeFrames();
return 0;
}
u32 GetId() const
{
if (IsAttachedSound())
+1 -1
View File
@@ -5,9 +5,9 @@
#include "d/col/bg/d_bg_s.h"
#include "d/col/bg/d_bg_s_lin_chk.h"
#include "d/flag/sceneflag_manager.h"
#include "d/snd/d_snd_wzsound.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "toBeSorted/small_sound_mgr.h"
#include "toBeSorted/time_area_mgr.h"
SPECIAL_ACTOR_PROFILE(BOMBF, dAcBombf_c, fProfile::BOMBF, 0x129, 0, 4099);
+1 -1
View File
@@ -20,6 +20,7 @@
#include "d/d_sc_game.h"
#include "d/flag/sceneflag_manager.h"
#include "d/flag/storyflag_manager.h"
#include "d/snd/d_snd_wzsound.h"
#include "f/f_base.h"
#include "f/f_profile_name.h"
#include "m/m3d/m_fanm.h"
@@ -38,7 +39,6 @@
#include "s/s_Math.h"
#include "toBeSorted/blur_and_palette_manager.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/small_sound_mgr.h"
#include "toBeSorted/time_area_mgr.h"
#include <cmath.h>
+1 -1
View File
@@ -5,12 +5,12 @@
#include "d/a/obj/d_a_obj_tower_D101.h"
#include "d/col/bg/d_bg_s_wtr_chk.h"
#include "d/d_stage.h"
#include "d/snd/d_snd_wzsound.h"
#include "f/f_base.h"
#include "f/f_manager.h"
#include "f/f_profile_name.h"
#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "toBeSorted/small_sound_mgr.h"
SPECIAL_ACTOR_PROFILE(OBJ_TOWER_GEAR_D101, dAcOTowerGearD101_c, fProfile::OBJ_TOWER_GEAR_D101, 0x17E, 0, 7);
+1 -1
View File
@@ -20,6 +20,7 @@
#include "d/d_linkage.h"
#include "d/flag/dungeonflag_manager.h"
#include "d/flag/sceneflag_manager.h"
#include "d/snd/d_snd_wzsound.h"
#include "egg/math/eggMath.h"
#include "f/f_manager.h"
#include "f/f_profile_name.h"
@@ -34,7 +35,6 @@
#include "toBeSorted/blur_and_palette_manager.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/small_sound_mgr.h"
#include "toBeSorted/special_item_drop_mgr.h"
void float_ordering() {
+1 -2
View File
@@ -10,6 +10,7 @@
#include "d/col/c/c_m3d_g_pla.h"
#include "d/col/cc/d_cc_d.h"
#include "d/col/cc/d_cc_s.h"
#include "d/snd/d_snd_wzsound.h"
#include "egg/math/eggMath.h"
#include "egg/math/eggQuat.h"
#include "m/m_angle.h"
@@ -20,8 +21,6 @@
#include "toBeSorted/blur_and_palette_manager.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/small_sound_mgr.h"
void float_ordering() {
const f32 arr[] = {5.f, 15.f, 7.f, 0.5f, 0.1f};
+4 -4
View File
@@ -9,8 +9,8 @@
#include "d/d_pouch.h"
#include "d/d_sc_game.h"
#include "d/flag/sceneflag_manager.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "m/m_angle.h"
#include "toBeSorted/small_sound_mgr.h"
SPECIAL_ACTOR_PROFILE(TAG_REACTION, dTgReaction_c, fProfile::TAG_REACTION, 0x0151, 0, 0);
@@ -172,7 +172,7 @@ void dTgReaction_c::checkForBonkItem() {
if (dAcObjBase_c::create(fProfile::ITEM, roomid, newItemParms, &c2, nullptr, nullptr, 0xFFFFFFFF)) {
field_0x4DD = 1;
onDelete();
SmallSoundManager::GetInstance()->playSound(SE_S_READ_RIDDLE_A);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_READ_RIDDLE_A);
}
}
} else {
@@ -194,7 +194,7 @@ void dTgReaction_c::checkForBonkItem() {
pos.y += field_0x4E4;
if (fn_578_DB0(pos, uVar3)) {
SmallSoundManager::GetInstance()->playSound(SE_S_READ_RIDDLE_B);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_READ_RIDDLE_B);
}
SceneflagManager::sInstance->setFlag(roomid, getSceneFlag());
onDelete();
@@ -228,7 +228,7 @@ void dTgReaction_c::checkForSlingBellowsItem() {
mVec3_c spawnPos = position;
spawnPos.y += field_0x4E4;
if (fn_578_DB0(spawnPos, uVar3)) {
SmallSoundManager::GetInstance()->playSound(SE_S_READ_RIDDLE_B);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_READ_RIDDLE_B);
}
SceneflagManager::sInstance->setFlag(roomid, getSceneFlag());
onDelete();
+1 -1
View File
@@ -10,12 +10,12 @@
#include "d/col/bg/d_bg_w_base.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_pla.h"
#include "d/snd/d_snd_wzsound.h"
#include "m/m_angle.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "toBeSorted/attention.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/small_sound_mgr.h"
void dAcOInsect_c::kill() {
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_394_, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
+1 -1
View File
@@ -6,10 +6,10 @@
#include "d/d_linkage.h"
#include "d/d_rumble.h"
#include "d/flag/sceneflag_manager.h"
#include "d/snd/d_snd_wzsound.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "s/s_Math.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/small_sound_mgr.h"
SPECIAL_ACTOR_PROFILE(OBJ_SW, dAcOsw_c, fProfile::OBJ_SW, 0x12B, 0, 0x1002);
+2 -2
View File
@@ -17,6 +17,7 @@
#include "d/flag/sceneflag_manager.h"
#include "d/flag/storyflag_manager.h"
#include "d/flag/tboxflag_manager.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "d/t/d_t_siren.h"
#include "m/m3d/m_fanm.h"
#include "m/m3d/m_scnleaf.h"
@@ -35,7 +36,6 @@
#include "toBeSorted/counters/goddess_chest_counter.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/small_sound_mgr.h"
SPECIAL_ACTOR_PROFILE(TBOX, dAcTbox_c, fProfile::TBOX, 0x018D, 0, 6);
@@ -1781,7 +1781,7 @@ void dAcTbox_c::executeState_DemoAppear() {
if (isStop && mAnmMatClr1.isStop(0) && field_0x11F8 > 0x5A) {
mEvent.advanceNext();
mStateMgr.changeState(StateID_WaitOpen);
SmallSoundManager::GetInstance()->playSound(SE_S_READ_RIDDLE_A);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_READ_RIDDLE_A);
}
}
}
+2 -2
View File
@@ -3,9 +3,9 @@
#include "d/d_cs_base.h"
#include "d/d_cursor_hit_check.h"
#include "d/lyt/d2d.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "f/f_base.h"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/small_sound_mgr.h"
SPECIAL_BASE_PROFILE(C_GAME, dCsGame_c, fProfile::C_GAME, 0x2BF, 0x06F9);
@@ -407,7 +407,7 @@ void dCsGame_c::lytItemCursor_c::lytBowCsr_c::executeState_Charge() {
if (!mAnm[MAIN_ANIM_ARROW_PEAK].isEnabled()) {
mAnm[MAIN_ANIM_ARROW_PEAK].setAnimEnable(true);
mAnm[MAIN_ANIM_ARROW_PEAK].setFrame(0.0f);
SmallSoundManager::GetInstance()->playSound(SE_S_BW_ALIGN_SIGHT);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_BW_ALIGN_SIGHT);
}
mAnm[MAIN_ANIM_ARROW_KEEP].setAnimEnable(false);
} else {
+2 -2
View File
@@ -22,6 +22,7 @@
#include "d/lyt/d_lyt_mini_game.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/lyt/msg_window/d_lyt_msg_window.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "egg/core/eggHeap.h"
#include "f/f_base.h"
#include "f/f_profile.h"
@@ -38,7 +39,6 @@
#include "toBeSorted/file_manager.h"
#include "toBeSorted/minigame_mgr.h"
#include "toBeSorted/music_mgrs.h"
#include "toBeSorted/small_sound_mgr.h"
#include "toBeSorted/unk_save_time.h"
#include "rvl/OS.h"
@@ -216,7 +216,7 @@ void dFlow_c::playSound(u32 params) {
switch (sSoundDefs[idx].mSoundMgr) {
case 0: AnotherSoundMgr__playSound(FANFARE_SOUND_MGR, sSoundDefs[idx].mSoundId); break;
case 1: SmallSoundManager::GetInstance()->playSound(sSoundDefs[idx].mSoundId); break;
case 1: dSndSmallEffectMgr_c::GetInstance()->playSound(sSoundDefs[idx].mSoundId); break;
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
#include "d/lyt/d_lyt_bird_gauge.h"
#include "common.h"
#include "toBeSorted/small_sound_mgr.h"
#include "d/snd/d_snd_small_effect_mgr.h"
STATE_DEFINE(dLytBirdGaugeMain_c, ModeNone);
STATE_DEFINE(dLytBirdGaugeMain_c, ModeIn);
@@ -181,7 +181,7 @@ void dLytBirdGaugeMain_c::changeToRecovery() {
mAnmGroups[LYT_SKY_GAUGE_MAIN_ANIM_RECOVERY + mNumDisplayedDashes].setAnimEnable(true);
mAnmGroups[LYT_SKY_GAUGE_MAIN_ANIM_RECOVERY + mNumDisplayedDashes].setFrame(0.0f);
mLyt.calc();
SmallSoundManager::GetInstance()->playSound(SE_S_BIRD_RECOVER);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_BIRD_RECOVER);
mStateMgr.changeState(StateID_ModeRecovery);
mIsAnimating = false;
mNumDisplayedDashes++;
+3 -3
View File
@@ -5,7 +5,7 @@
#include "common.h"
#include "d/d_sys.h"
#include "d/lyt/d2d.h"
#include "toBeSorted/small_sound_mgr.h"
#include "d/snd/d_snd_small_effect_mgr.h"
static const d2d::LytBrlanMapping brlanMap[] = {
{ "aBtn_00_in.brlan", "G_inOut_00"},
@@ -186,9 +186,9 @@ void dLytCommonABtn_c::goToStateDecideOut() {
anm.setRate(1.0f);
}
if (mSoundVariant == VARIANT_NORMAL) {
SmallSoundManager::GetInstance()->playSound(SE_S_WINDOW_PRESS_A);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_WINDOW_PRESS_A);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TITLE_PRESS_START);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TITLE_PRESS_START);
}
}
}
+5 -5
View File
@@ -2,9 +2,9 @@
#include "d/d_cs_base.h"
#include "d/d_cursor_hit_check.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "rvl/MTX/mtx.h"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytCommonArrow_c, None);
STATE_DEFINE(dLytCommonArrow_c, In);
@@ -262,9 +262,9 @@ void dLytCommonArrow_c::executeState_Wait() {
if (field_0x6C0 != 2) {
displayElement(field_0x6C0 + ANIM_DECIDE_OFFSET, 0.0f);
if (field_0x6C0 == 0) {
SmallSoundManager::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_LEFT);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_LEFT);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_RIGHT);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_RIGHT);
}
mTimer++;
}
@@ -287,9 +287,9 @@ void dLytCommonArrow_c::executeState_Wait() {
if (field_0x6BC != field_0x6B8 && field_0x6B8 != 2) {
if (field_0x6B8 == 0) {
SmallSoundManager::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_LEFT);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_LEFT);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_RIGHT);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_RIGHT);
}
}
}
+2 -2
View File
@@ -3,12 +3,12 @@
#include "common.h"
#include "d/a/d_a_player.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "nw4r/lyt/lyt_pane.h"
#include "nw4r/lyt/lyt_types.h"
#include "nw4r/math/math_types.h"
#include "sized_string.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/small_sound_mgr.h"
struct DoButtonClass {
DoButtonClass();
@@ -639,7 +639,7 @@ void dLytDobutton_c::realize() {
}
if (mDoActionToShow == ACT_DO_CATCH) {
SmallSoundManager::GetInstance()->playSound(SE_S_CALL_BIRD_CATCH);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_CALL_BIRD_CATCH);
}
}
+3 -3
View File
@@ -31,6 +31,7 @@
#include "d/lyt/d_lyt_sky_gauge.h"
#include "d/lyt/msg_window/d_lyt_msg_window.h"
#include "d/lyt/msg_window/d_lyt_simple_window.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "f/f_manager.h"
#include "f/f_profile_name.h"
#include "m/m_vec.h"
@@ -40,7 +41,6 @@
#include "toBeSorted/event_manager.h"
#include "toBeSorted/minigame_mgr.h"
#include "toBeSorted/misc_actor.h"
#include "toBeSorted/small_sound_mgr.h"
// clang-format on
static dLytMeterConfiguration_c sConf;
@@ -207,7 +207,7 @@ bool dLytMeter1Button_c::execute() {
if (mAnm[BUTTON_1_ANIM_CALL].isEnabled()) {
mAnm[BUTTON_1_ANIM_CALL].play();
if (meter->checkAllFlags(METER_BTN_1) && mCallCount < 3 && mAnm[BUTTON_1_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_1_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_1_BUTTON_BLINK);
mCallCount++;
}
}
@@ -384,7 +384,7 @@ bool dLytMeter2Button_c::execute() {
if (mAnm[BUTTON_1_ANIM_CALL].isEnabled()) {
mAnm[BUTTON_1_ANIM_CALL].play();
if (meter->checkAllFlags(METER_BTN_2) && mCallCount < 3 && mAnm[BUTTON_1_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_2_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_2_BUTTON_BLINK);
mCallCount++;
}
}
+4 -4
View File
@@ -7,10 +7,10 @@
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_unknowns.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/fi_context.h"
#include "toBeSorted/misc_actor.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterCrossBtnParts_c, Wait);
STATE_DEFINE(dLytMeterCrossBtnParts_c, On);
@@ -504,7 +504,7 @@ bool dLytMeterCrossBtn_c::execute() {
mAnm[CROSS_BTN_ANIM_CALL_0].play();
if (mParts[CROSS_BTN_PART_DOWN].isActive() && mCallCount0 < 3 &&
mAnm[CROSS_BTN_ANIM_CALL_0].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_SG_CALL);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SG_CALL);
mCallCount0++;
}
}
@@ -525,7 +525,7 @@ bool dLytMeterCrossBtn_c::execute() {
mAnm[CROSS_BTN_ANIM_CALL_1].play();
if (mParts[CROSS_BTN_PART_TOP].isActive() && mCallCount1 < 3 &&
mAnm[CROSS_BTN_ANIM_CALL_1].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_CATAPULT_READY);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_CATAPULT_READY);
mCallCount1++;
}
}
@@ -546,7 +546,7 @@ bool dLytMeterCrossBtn_c::execute() {
if (mAnm[CROSS_BTN_ANIM_CALL_2].isEnabled()) {
mAnm[CROSS_BTN_ANIM_CALL_2].play();
if (mParts[CROSS_BTN_PART_DOWN].isActive() && mAnm[CROSS_BTN_ANIM_CALL_2].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_BIRD_CALL);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_BIRD_CALL);
}
}
}
+3 -3
View File
@@ -10,6 +10,7 @@
#include "d/lyt/d_lyt_util_items.h"
#include "d/lyt/d_window.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_group.h"
#include "nw4r/math/math_types.h"
@@ -17,7 +18,6 @@
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterDowsingMenuIcon_c, Wait);
STATE_DEFINE(dLytMeterDowsingMenuIcon_c, On);
@@ -717,7 +717,7 @@ void dLytMeterDowsing_c::executeState_DemoMove() {
nw4r::math::MTX34 mtx = mpPanes[idx]->GetGlobalMtx();
mVec3_c pos(mtx._03, mtx._13, 0.0f);
dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_970_, pos, nullptr, nullptr, nullptr, nullptr);
SmallSoundManager::GetInstance()->playSound(SE_S_DOWSING_ADD);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_DOWSING_ADD);
}
} else if (mDemoFrame == 16) {
for (int i = 0; i < DOWSING_NUM_ITEMS; i++) {
@@ -1010,7 +1010,7 @@ bool dLytMeterDowsing_c::execute() {
if (mAnm[DOWSING_ANIM_CALL].isEnabled()) {
mAnm[DOWSING_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_C) && mAnm[DOWSING_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_C_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_C_BUTTON_BLINK);
}
}
} else if (field_0x5509 == 1) {
+4 -4
View File
@@ -5,11 +5,11 @@
#include "d/d_sc_game.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_game_over.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "nw4r/math/math_types.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/small_sound_mgr.h"
static const d2d::LytBrlanMapping brlanMap[] = {
{ "heartAll_00_heat.brlan", "G_heart_00"},
@@ -288,7 +288,7 @@ void dLytMeterHeart_c::executeInternal() {
nw4r::math::MTX34 mtx = mpHeartPanes[mEffectHeartIdx]->GetGlobalMtx();
mVec3_c pos(mtx._03, mtx._13, 0.0f);
dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_972_, pos, nullptr, nullptr, nullptr, nullptr);
SmallSoundManager::GetInstance()->playSound(SE_S_HEART_ADD);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_HEART_ADD);
mEffectHeartIdx = -1;
}
@@ -323,14 +323,14 @@ void dLytMeterHeart_c::executeInternal() {
if (mpAlphaPane->IsVisible() && mpAlphaPane->GetGlobalAlpha() != 0 && mStoredHealth % 4 == 0 &&
(!(dScGame_c::currentSpawnInfo.stageName == "F406") || dScGame_c::currentSpawnInfo.layer != 13) &&
dLytGameOver_c::GetInstance() == nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_HP_GAUGE_UP);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_HP_GAUGE_UP);
}
} else {
if (mStoredHealth - 1 >= current) {
mStoredHealth = mStoredHealth - 1;
if (EventManager::isInEvent() && !strcmp(EventManager::getCurrentEventName(), ("MoleF202Start")) &&
mStoredHealth % 4 == 0) {
SmallSoundManager::GetInstance()->playSound(SE_S_HP_GAUGE_DOWN);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_HP_GAUGE_DOWN);
}
}
}
+8 -8
View File
@@ -13,6 +13,7 @@
#include "d/lyt/d_lyt_do_button.h"
#include "d/lyt/d_lyt_unknowns.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_group.h"
#include "nw4r/math/math_types.h"
@@ -22,7 +23,6 @@
#include "toBeSorted/event_manager.h"
#include "toBeSorted/minigame_mgr.h"
#include "toBeSorted/misc_actor.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterItemSelectIcon_c, Wait);
STATE_DEFINE(dLytMeterItemSelectIcon_c, On);
@@ -1392,7 +1392,7 @@ void dLytMeterItemSelect_c::initializeState_DemoMove() {
mAnm[i + ITEM_SELECT_ANIM_HAVE_OFFSET].setAnimEnable(false);
}
SmallSoundManager::GetInstance()->playSound(SE_S_GET_ITEM_SET);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_GET_ITEM_SET);
}
void dLytMeterItemSelect_c::executeState_DemoMove() {
@@ -1988,7 +1988,7 @@ bool dLytMeterItemSelect_c::execute() {
if (dLytDobutton_c::getField0x47C() == dLytDobutton_c::ACT_DO_SAILCLOTH) {
if (field_0x5774 == 0) {
SmallSoundManager::GetInstance()->playSound(SE_S_PARACHUTE_CALL);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_PARACHUTE_CALL);
}
field_0x5774++;
if (field_0x5774 >= mAnm[ITEM_SELECT_ANIM_CALL].getAnimDuration() / 2.0f) {
@@ -2058,11 +2058,11 @@ bool dLytMeterItemSelect_c::execute() {
mAnm[ITEM_SELECT_ANIM_FULL].setFrame(0.0f);
mAnm[ITEM_SELECT_ANIM_FULL].setAnimEnable(true);
if (field_0x5797 == I_BOMB_BAG) {
SmallSoundManager::GetInstance()->playSound(SE_S_BM_MAX);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_BM_MAX);
} else if (field_0x5797 == I_BOW) {
SmallSoundManager::GetInstance()->playSound(SE_S_AW_MAX);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_AW_MAX);
} else if (field_0x5797 == I_SLINGSHOT) {
SmallSoundManager::GetInstance()->playSound(SE_S_PC_MAX);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_PC_MAX);
}
}
field_0x57B7 = false;
@@ -2094,7 +2094,7 @@ bool dLytMeterItemSelect_c::execute() {
mAnm[ITEM_SELECT_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_B) &&
mAnm[ITEM_SELECT_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_B_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_B_BUTTON_BLINK);
}
}
b2 = true;
@@ -2115,7 +2115,7 @@ bool dLytMeterItemSelect_c::execute() {
mAnm[ITEM_SELECT_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_B) &&
mAnm[ITEM_SELECT_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_PARACHUTE_CALL);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_PARACHUTE_CALL);
}
}
b2 = true;
+3 -3
View File
@@ -5,9 +5,9 @@
#include "d/a/d_a_item.h"
#include "d/d_stage_mgr.h"
#include "d/lyt/d2d.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_pane.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterKakeraKey_c, Wait);
STATE_DEFINE(dLytMeterKakeraKey_c, On);
@@ -87,9 +87,9 @@ void dLytMeterKakeraKey_c::initializeState_Increase() {
mAnm[mNextKeyPieceCount - 1 + KEY_KAKERA_ANIM_NUMBER_OFFSET].setFrame(0.0f);
mSavedKeyPieceCount = dAcItem_c::getKeyPieceCount();
if (mSavedKeyPieceCount == KEY_KAKERA_NUM_PIECES) {
SmallSoundManager::GetInstance()->playSound(SE_S_KEY_COMPLETE);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_KEY_COMPLETE);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_KEY_PARTS);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_KEY_PARTS);
}
}
void dLytMeterKakeraKey_c::executeState_Increase() {
+4 -4
View File
@@ -7,12 +7,12 @@
#include "d/lyt/d_lyt_control_game.h"
#include "d/lyt/d_lyt_util_items.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "m/m_angle.h"
#include "nw4r/lyt/lyt_group.h"
#include "nw4r/math/math_types.h"
#include "sized_string.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterMinusBtnMenuIcon_c, Wait);
STATE_DEFINE(dLytMeterMinusBtnMenuIcon_c, On);
@@ -635,9 +635,9 @@ void dLytMeterMinusBtn_c::initializeState_DemoMove() {
}
if (field_0x4E8C == 0) {
SmallSoundManager::GetInstance()->playSound(SE_S_DOGU_PORCH_ADD_FIRST);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_DOGU_PORCH_ADD_FIRST);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_DOGU_PORCH_ADD);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_DOGU_PORCH_ADD);
}
}
void dLytMeterMinusBtn_c::executeState_DemoMove() {
@@ -898,7 +898,7 @@ bool dLytMeterMinusBtn_c::execute() {
mAnm[MINUS_BTN_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_MINUS) &&
mAnm[MINUS_BTN_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_MINUS_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MINUS_BUTTON_BLINK);
}
}
} else if (field_0x4EBA == 1) {
+2 -2
View File
@@ -9,11 +9,11 @@
#include "d/lyt/d_lyt_unknowns.h"
#include "d/lyt/d_window.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "d/t/d_t_map_mark.h"
#include "f/f_base.h"
#include "f/f_manager.h"
#include "f/f_profile_name.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterPlusBtn_c, Wait);
STATE_DEFINE(dLytMeterPlusBtn_c, ToUse);
@@ -196,7 +196,7 @@ bool dLytMeterPlusBtn_c::execute() {
mAnm[PLUS_BTN_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_PLUS) &&
mAnm[PLUS_BTN_ANIM_CALL].getFrame() == 1.0f && mCallCount < 3) {
SmallSoundManager::GetInstance()->playSound(SE_S_PLUS_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_PLUS_BUTTON_BLINK);
mCallCount++;
}
}
+6 -6
View File
@@ -4,8 +4,8 @@
#include "d/a/d_a_item.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_meter_configuration.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "nw4r/math/math_types.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterRupyStart_c, Wait);
STATE_DEFINE(dLytMeterRupyStart_c, Start);
@@ -426,9 +426,9 @@ bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) {
b = true;
if (field_0x8AB) {
if (newNumDisplayed == amount) {
SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_COUNT_DOWN_END);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_RUPEE_COUNT_DOWN_END);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_COUNT_DOWN);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_RUPEE_COUNT_DOWN);
}
}
if (field_0x8AD) {
@@ -445,13 +445,13 @@ bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) {
b = true;
if (field_0x8AB) {
if (newNumDisplayed == amount) {
SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_COUNT_UP_END);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_RUPEE_COUNT_UP_END);
if (field_0x8AD) {
field_0x890 = 0;
field_0x8AD = 0;
}
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_COUNT_UP);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_RUPEE_COUNT_UP);
}
}
}
@@ -511,7 +511,7 @@ bool dLytMeterRupy_c::updateDisplayedAmount(bool suppressSound) {
mPrevDigits[2] = mDisplayedDigits[2];
mPrevDigits[3] = mDisplayedDigits[3];
} else if (field_0x8AD && amount == dAcItem_c::getCurrentWalletCapacity()) {
SmallSoundManager::GetInstance()->playSound(SE_S_RUPEE_MAX);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_RUPEE_MAX);
field_0x890 = 0;
field_0x8AD = 0;
}
+4 -4
View File
@@ -5,8 +5,8 @@
#include "d/d_pouch.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_meter_configuration.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterShieldGauge_c, Normal);
STATE_DEFINE(dLytMeterShieldGauge_c, Use);
@@ -181,13 +181,13 @@ bool dLytMeterShieldGauge_c::execute() {
if (mCurrentDurability >= mMaxDurability) {
if (field_0x31E) {
// Unreachable?
SmallSoundManager::GetInstance()->playSoundWithPitch(SE_S_GAUGE_SHIELD_UP_LV, 1.0f);
dSndSmallEffectMgr_c::GetInstance()->playSoundWithPitch(SE_S_GAUGE_SHIELD_UP_LV, 1.0f);
}
SmallSoundManager::GetInstance()->playSound(SE_S_GAUGE_SHIELD_UP_MAX);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_GAUGE_SHIELD_UP_MAX);
} else {
if (field_0x31E) {
// Unreachable?
SmallSoundManager::GetInstance()->playSoundWithPitch(
dSndSmallEffectMgr_c::GetInstance()->playSoundWithPitch(
SE_S_GAUGE_SHIELD_UP_LV, mCurrentDurability / mMaxDurability
);
}
+2 -2
View File
@@ -10,13 +10,13 @@
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_drop_line.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "d/t/d_t_siren.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_pane.h"
#include "nw4r/math/math_types.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/small_sound_mgr.h"
#include <cstring>
@@ -328,7 +328,7 @@ bool LytMeterTimerPart1_c::incrementTearCount() {
startNextFruitAnim();
if (!dLytMeter_c::getfn_800C9FE0()) {
createEffect(mActualTearCount - 1);
SmallSoundManager::GetInstance()->playSound(SE_S_SIREN_SHIZUKU_GET_IN);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SIREN_SHIZUKU_GET_IN);
}
if (mActualTearCount < TIMER_01_NUM_TEARS) {
+2 -2
View File
@@ -7,8 +7,8 @@
#include "d/lyt/d_lyt_control_game.h"
#include "d/lyt/d_lyt_unknowns.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "toBeSorted/attention.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterZBtn_c, Wait);
STATE_DEFINE(dLytMeterZBtn_c, On);
@@ -224,7 +224,7 @@ bool dLytMeterZBtn_c::execute() {
if (mAnm[Z_BTN_ANIM_CALL].isEnabled()) {
mAnm[Z_BTN_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(0x800) && mAnm[Z_BTN_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_Z_BUTTON_BLINK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_Z_BUTTON_BLINK);
}
}
} else if (field_0x1C6 == 1) {
+2 -2
View File
@@ -27,6 +27,7 @@
#include "d/lyt/d_lyt_auto_caption.h"
// clang-format on
#include "d/snd/d_snd_small_effect_mgr.h"
#include "f/f_base.h"
#include "m/m_fader_base.h"
#include "m/m_vec.h"
@@ -38,7 +39,6 @@
#include "toBeSorted/lyt_related_floats.h"
#include "toBeSorted/music_mgrs.h"
#include "toBeSorted/other_sound_stuff.h"
#include "toBeSorted/small_sound_mgr.h"
#include <cstring>
@@ -308,7 +308,7 @@ void dLytMsgWindow_c::executeState_OutputText() {
} else if (mpTagProcessor->getMsgWindowSubtype() <= MSG_WINDOW_1 && oldValue != mpMsgWindowUnk->getField_0x147A()) {
u16 a = mpMsgWindowUnk->getField_0x147C();
f32 b = (dTagProcessor_c::fn_800B8040(0, 0) * 100.0f);
SmallSoundManager::GetInstance()->playButtonPressSoundWhenAdvancingTextBoxes(a / b);
dSndSmallEffectMgr_c::GetInstance()->playButtonPressSoundWhenAdvancingTextBoxes(a / b);
}
if (setTextToDisplay(mpMsgWindowUnk->getProcessedText())) {
@@ -3,8 +3,8 @@
#include "common.h"
#include "d/d_pad.h"
#include "d/lyt/d2d.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "toBeSorted/music_mgrs.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, Wait);
@@ -278,11 +278,11 @@ void dLytMsgWindowSelectBtn_c::initializeState_In() {
} else {
if (field_0x9CF != 0) {
if (field_0x9A0 == 1) {
SmallSoundManager::GetInstance()->playSound(SE_S_CHOICE_START);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_CHOICE_START);
} else if (field_0x9A0 == 2) {
SmallSoundManager::GetInstance()->playSound(SE_S_CHOICE_START_GAMEOVER);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_CHOICE_START_GAMEOVER);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CHOICE_START);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CHOICE_START);
}
}
mAnm[SELECT_BTN_ANIM_IN].setFrame(0.0f);
@@ -323,7 +323,7 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
mpWindow->UpdateSize(mpSizeBox, 32.0f);
} else if (v == 3) {
field_0x9D1 = 1;
SmallSoundManager::GetInstance()->playSound(SE_S_POINTER_RESET);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_POINTER_RESET);
mStateMgr.changeState(StateID_In);
return;
}
@@ -334,9 +334,9 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
mStateMgr.changeState(StateID_WaitDecide);
// TODO
if (mpTagProcessor != nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
}
fn_8035E880(BGM_MGR);
} else if (dPad::checkButtonBPressed()) {
@@ -347,9 +347,9 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
mStateMgr.changeState(StateID_WaitCancel);
// TODO
if (mpTagProcessor != nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
}
fn_8035E880(BGM_MGR);
}
+1 -1
View File
@@ -27,7 +27,7 @@ dSnd3DActor_c::dSnd3DActor_c(UNKTYPE *a1, u8 a2)
mFlags(0),
mDistanceToPlayer(INFINITY),
a_field_0xE0(0.0f) {
resetFloats();
resetCachedRelativePositions();
// Portability hazard
SetUserParam(reinterpret_cast<u32>(this));
if (dSndPlayerMgr_c::GetInstance()->canUseThisPlayer(a2)) {
+1 -1
View File
@@ -9,7 +9,7 @@
#include "nw4r/snd/snd_SoundArchive.h"
#include "toBeSorted/music_mgrs.h"
template class SndMgrDisposer<dSnd3DManager_c>;
SND_DISPOSER_DEFINE(dSnd3DManager_c);
dSnd3DManager_c::dSnd3DManager_c() : mIsSetup(false), mCalculationsFresh(0) {
mCameraPosSqVelocity = 0.0f;
+61
View File
@@ -0,0 +1,61 @@
#include "d/snd/d_snd_area_sound.h"
#include "common.h"
#include "d/snd/d_snd_sound.h"
dSndAreaSound_c::dSndAreaSound_c()
: field_0xF0(false), mpCalcCallback(nullptr), field_0xF8(nullptr), field_0xFC(nullptr), field_0x100(nullptr) {}
void dSndAreaSound_c::cancel() {
dSndSound_c::cancel();
field_0xF0 = false;
}
void dSndAreaSound_c::calc() {
if (isFadingOut() && mPauseFlag) {
if (GetRemainingFadeFrames() <= 0) {
Stop(0);
cancel();
}
}
dSndSound_c::calc();
if (mpCalcCallback != nullptr) {
(mpCalcCallback)(*this);
}
}
void dSndAreaSound_c::fadeIn(u32 id, s32 fadeFrames) {
dSndSound_c::fadeIn(id, fadeFrames);
initCallback(id);
}
void dSndAreaSound_c::pause(s32 fadeFrames) {
if (isRunning()) {
if (fadeFrames != 0) {
pause(true, fadeFrames);
mIsFadingOut = true;
} else {
Stop(fadeFrames);
cancel();
}
} else {
cancel();
}
}
void dSndAreaSound_c::unpause(s32 fadeFrames) {
if (isFadingOut()) {
pause(false, fadeFrames);
mIsFadingOut = false;
}
}
void dSndAreaSound_c::initCallback(u32 id) {
Callback cb = nullptr;
mpCalcCallback = nullptr;
field_0xF8 = nullptr;
field_0xFC = nullptr;
field_0x100 = nullptr;
field_0x104 = nullptr;
}
+75
View File
@@ -0,0 +1,75 @@
#include "d/snd/d_snd_area_sound_effect_mgr.h"
#include "common.h"
#include "d/d_sc_game.h"
#include "d/snd/d_snd_mgr.h"
#include "d/snd/d_snd_player_mgr.h"
#include "d/snd/d_snd_util.h"
#include "nw4r/snd/snd_SoundStartable.h"
SND_DISPOSER_DEFINE(dSndAreaSoundEffectMgr_c);
dSndAreaSoundEffectMgr_c::dSndAreaSoundEffectMgr_c()
: field_0x328(0),
field_0x32C(1.0f),
field_0x330(1.0f),
mActor(*dSndMgr_c::GetInstance()->getPlayer()),
field_0x388(1.0f) {}
void dSndAreaSoundEffectMgr_c::calc() {
for (int i = 0; i < 3; i++) {
mSounds[i].calc();
}
}
bool dSndAreaSoundEffectMgr_c::startSound(u32 soundId, u32 handleIdx) {
if (dSndPlayerMgr_c::GetInstance()->checkFlag(0x2)) {
return false;
}
if (isPlayingSound(soundId)) {
return false;
}
if (handleIdx > 2) {
return false;
}
if (dScGame_c::currentSpawnInfo.getTrial() == SpawnInfo::TRIAL) {
return false;
}
dSndAreaSound_c *snd = &mSounds[handleIdx];
nw4r::snd::SoundStartable::StartResult res = mActor.detail_StartSound(snd, soundId, nullptr);
if (res == nw4r::snd::SoundStartable::START_SUCCESS) {
snd->fadeIn(soundId, 30);
}
// @bug should probably be `res != nw4r::snd::SoundStartable::START_SUCCESS`
// all callers seem to ignore return value though
return res;
}
void dSndAreaSoundEffectMgr_c::stopSounds(s32 fadeFrames) {
for (u32 i = 0; i < 3; i++) {
mSounds[i].stop(fadeFrames);
}
}
bool dSndAreaSoundEffectMgr_c::isPlayingAnySound() const {
for (int i = 0; i < 3; i++) {
if (mSounds[i].IsAttachedSound()) {
return true;
}
}
return false;
}
bool dSndAreaSoundEffectMgr_c::isPlayingSound(u32 soundId) const {
for (int i = 0; i < 3; i++) {
if (mSounds[i].GetId() == soundId) {
return true;
}
}
return false;
}
+6 -6
View File
@@ -4,7 +4,7 @@
#include "d/snd/d_snd_control_player.h"
#include "nw4r/ut/ut_list.h"
template class SndMgrDisposer<dSndControlPlayerMgr_c>;
SND_DISPOSER_DEFINE(dSndControlPlayerMgr_c);
dSndControlPlayerMgr_c::dSndControlPlayerMgr_c() : mOverrideVolumeMask(0) {
// TODO offsetof
@@ -47,7 +47,7 @@ void dSndControlPlayerMgr_c::calcVolumes() {
f32 currentVolume = getAppliedPlayerVolume(i);
f32 targetVolume = mpTargetVolumes[i];
f32 maxVolumeDecrease = mpMaxVolumeDecreases[i];
f32 maxVolumeIncrease = mpMaxVolumeDecreases[i];
f32 maxVolumeIncrease = mpMaxVolumeIncreases[i];
if (currentVolume != targetVolume) {
if (currentVolume - targetVolume > maxVolumeDecrease) {
@@ -61,7 +61,7 @@ void dSndControlPlayerMgr_c::calcVolumes() {
}
mpTargetVolumes[i] = 1.0f;
mpMaxVolumeDecreases[i] = 0.1f;
mpMaxVolumeDecreases[i] = 0.025f;
mpMaxVolumeIncreases[i] = 0.025f;
}
}
}
@@ -101,7 +101,7 @@ void dSndControlPlayerMgr_c::setVolume(u32 playerIdx, f32 value, s32 frames) {
} else {
// Volume is not overridden, set volume normally
setControlValue(CTRL_VOLUME, playerIdx, value, frames);
mpSavedVolumes[playerIdx] = getControlVolumeTarget(CTRL_VOLUME, playerIdx);
mpSavedVolumes[playerIdx] = getControlTarget(CTRL_VOLUME, playerIdx);
}
}
@@ -111,7 +111,7 @@ void dSndControlPlayerMgr_c::overrideVolume(u32 playerIdx, f32 volume, s32 frame
}
u32 mask = (1 << playerIdx);
if ((mOverrideVolumeMask & mask) == 0) {
mpSavedVolumes[playerIdx] = getControlVolumeTarget(CTRL_VOLUME, playerIdx);
mpSavedVolumes[playerIdx] = getControlTarget(CTRL_VOLUME, playerIdx);
mOverrideVolumeMask |= mask;
}
setControlValue(CTRL_VOLUME, playerIdx, volume, frames);
@@ -171,7 +171,7 @@ f32 dSndControlPlayerMgr_c::getAppliedPlayerVolume(u32 playerIdx) const {
return getPlayer1(playerIdx)->GetVolume();
}
f32 dSndControlPlayerMgr_c::getControlVolumeTarget(PlayerCtrl_e ctrlType, u32 playerIdx) const {
f32 dSndControlPlayerMgr_c::getControlTarget(PlayerCtrl_e ctrlType, u32 playerIdx) const {
if (ctrlType >= CTRL_MAX) {
return 1.0f;
}
+7 -8
View File
@@ -1,17 +1,16 @@
#include "d/snd/d_snd_mgr.h"
#include "d/snd/d_snd_3d_manager.h"
#include "d/snd/d_snd_area_sound_effect_mgr.h"
#include "d/snd/d_snd_control_player_mgr.h"
#include "d/snd/d_snd_player_mgr.h"
#include "d/snd/d_snd_util.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "egg/audio/eggAudioRmtSpeakerMgr.h"
#include "egg/audio/eggAudioUtility.h"
extern "C" void initEnemySoundMgr();
extern "C" void initFanfareSoundMgr();
extern "C" void initSomeUnusedSoundMgr();
extern "C" void initSoundEffectSoundMgr();
extern "C" void fn_8036A430();
extern "C" void initEnemyBgmRelatedMgr();
extern "C" void fn_80393530();
extern "C" void fn_80394830();
@@ -23,14 +22,14 @@ dSndMgr_c *dSndMgr_c::sInstance;
dSndMgr_c::dSndMgr_c(): field_0x6CC(0) {
sInstance = this;
SndMgrDisposer<dSndPlayerMgr_c>::create();
SndMgrDisposer<dSndControlPlayerMgr_c>::create();
dSndPlayerMgr_c::create();
dSndControlPlayerMgr_c::create();
initEnemySoundMgr();
SndMgrDisposer<dSnd3DManager_c>::create();
dSnd3DManager_c::create();
initFanfareSoundMgr();
initSomeUnusedSoundMgr();
initSoundEffectSoundMgr();
fn_8036A430();
dSndSmallEffectMgr_c::create();
dSndAreaSoundEffectMgr_c::create();
initEnemyBgmRelatedMgr();
fn_80393530();
fn_80394830();
+1 -1
View File
@@ -12,7 +12,7 @@ const char *dSndPlayerMgr_c::getSoundArchivePath() {
return "Sound/WZSound.brsar";
}
template class SndMgrDisposer<dSndPlayerMgr_c>;
SND_DISPOSER_DEFINE(dSndPlayerMgr_c);
dSndPlayerMgr_c::dSndPlayerMgr_c()
: field_0x010(0), field_0x011(0), field_0x014(-1), field_0x018(-1), field_0x01C(-1), mFlags(0) {}
+8
View File
@@ -0,0 +1,8 @@
#include "d/snd/d_snd_small_effect_mgr.h"
#include "d/snd/d_snd_util.h"
SND_DISPOSER_DEFINE(dSndSmallEffectMgr_c)
dSndSmallEffectMgr_c::dSndSmallEffectMgr_c() {}
+1 -1
View File
@@ -61,7 +61,7 @@ void dSndSound_c::resetControls() {
resetTrackVolumes();
}
void dSndSound_c::executeCtrls() {
void dSndSound_c::calc() {
if (mIsRunning && !IsAttachedSound()) {
cancel();
}
+2 -2
View File
@@ -11,6 +11,7 @@
#include "d/d_sys.h"
#include "d/lyt/d_lyt_save_msg_window.h"
#include "d/lyt/d_lyt_system_window.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "egg/core/eggHeap.h"
#include "m/m_pad.h"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
@@ -18,7 +19,6 @@
#include "toBeSorted/nand_request_thread.h"
#include "toBeSorted/nand_result_tracker.h"
#include "toBeSorted/reload_color_fader.h"
#include "toBeSorted/small_sound_mgr.h"
#include "rvl/NAND.h"
#include "rvl/TPL.h"
@@ -511,7 +511,7 @@ void SaveMgr::executeSaveBanner() {
if (b == 1) {
if (!dDvdUnk::FontUnk::GetInstance()->getField_0x28()) {
SmallSoundManager::GetInstance()->playSound(SE_S_SAVE_FINISH);
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SAVE_FINISH);
}
mDelayTimer = 0;
mStep++;