mirror of
https://github.com/zeldaret/ss
synced 2026-05-30 08:56:34 -04:00
More and cleanup
This commit is contained in:
+12
-12
@@ -1035,7 +1035,7 @@ createSoundSource__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78
|
||||
initAllocatorWork1Heap__9dAcBase_cFiPci = .text:0x8002C710; // type:function size:0xC
|
||||
initAllocator__9dAcBase_cFiPcPQ23EGG4Heapi = .text:0x8002C720; // type:function size:0x8C
|
||||
addActorToRoom__9dAcBase_cFl = .text:0x8002C7B0; // type:function size:0x88
|
||||
setBit_field_0xE8__9dAcBase_cFl = .text:0x8002C840; // type:function size:0x18
|
||||
setTgSndAreaFlag__9dAcBase_cFl = .text:0x8002C840; // type:function size:0x18
|
||||
actorCreate__9dAcBase_cFv = .text:0x8002C860; // type:function size:0x8
|
||||
actorPostCreate__9dAcBase_cFv = .text:0x8002C870; // type:function size:0x8
|
||||
create__9dAcBase_cFv = .text:0x8002C880; // type:function size:0x70
|
||||
@@ -20058,7 +20058,7 @@ isVolcanicDungeon__14dSndStateMgr_cFUl = .text:0x80361FD0; // type:function size
|
||||
isSeekerStoneStage__14dSndStateMgr_cFPCcl = .text:0x80362020; // type:function size:0x84
|
||||
isActiveDemoMaybe__14dSndStateMgr_cCFl = .text:0x803620B0; // type:function size:0x5C
|
||||
isSomeSkyloftRoom__14dSndStateMgr_cCFv = .text:0x80362110; // type:function size:0x34
|
||||
fn_80362150 = .text:0x80362150; // type:function size:0xB0
|
||||
onGotoStage__14dSndStateMgr_cFl = .text:0x80362150; // type:function size:0xB0
|
||||
fn_80362200 = .text:0x80362200; // type:function size:0xFC
|
||||
fn_80362300 = .text:0x80362300; // type:function size:0x84
|
||||
fn_80362390 = .text:0x80362390; // type:function size:0x6C
|
||||
@@ -20067,8 +20067,8 @@ fn_80362410 = .text:0x80362410; // type:function size:0xC
|
||||
checkFlag0x18__14dSndStateMgr_cFUl = .text:0x80362420; // type:function size:0x18
|
||||
isInStage__14dSndStateMgr_cFPCc = .text:0x80362440; // type:function size:0x34
|
||||
fn_80362480 = .text:0x80362480; // type:function size:0x6C
|
||||
fn_803624F0 = .text:0x803624F0; // type:function size:0xF4
|
||||
fn_803625F0 = .text:0x803625F0; // type:function size:0x140
|
||||
onStageLoad__14dSndStateMgr_cFv = .text:0x803624F0; // type:function size:0xF4
|
||||
onRestartScene__14dSndStateMgr_cFl = .text:0x803625F0; // type:function size:0x140
|
||||
loadStageSound__14dSndStateMgr_cFv = .text:0x80362730; // type:function size:0x8
|
||||
loadStageSound__14dSndStateMgr_cFb = .text:0x80362740; // type:function size:0x59C
|
||||
calc__14dSndStateMgr_cFv = .text:0x80362CE0; // type:function size:0xFC
|
||||
@@ -20137,9 +20137,9 @@ setBgmLpf__14dSndStateMgr_cFv = .text:0x80365970; // type:function size:0x8
|
||||
setBgmLpf__14dSndStateMgr_cFl = .text:0x80365980; // type:function size:0x54
|
||||
resetBgmAndStageEffectLpf__14dSndStateMgr_cFv = .text:0x803659E0; // type:function size:0x4C
|
||||
resetBgmLpf__14dSndStateMgr_cFv = .text:0x80365A30; // type:function size:0x48
|
||||
fn_80365A80 = .text:0x80365A80; // type:function size:0x4C
|
||||
calcFxSend3D__14dSndStateMgr_cFv = .text:0x80365A80; // type:function size:0x4C
|
||||
restoreEffects__14dSndStateMgr_cFv = .text:0x80365AD0; // type:function size:0xA8
|
||||
fn_80365B80 = .text:0x80365B80; // type:function size:0x5C
|
||||
setFxSend3DTarget__14dSndStateMgr_cFv = .text:0x80365B80; // type:function size:0x5C
|
||||
getUserParamVolume__14dSndStateMgr_cFUl = .text:0x80365BE0; // type:function size:0x70
|
||||
fn_80365C50 = .text:0x80365C50; // type:function size:0xC8
|
||||
loadObjectSound__14dSndStateMgr_cFv = .text:0x80365D20; // type:function size:0x3C
|
||||
@@ -20178,7 +20178,7 @@ fn_80366DE0 = .text:0x80366DE0; // type:function size:0x118
|
||||
fn_80366F00 = .text:0x80366F00; // type:function size:0x5C
|
||||
fn_80366F60 = .text:0x80366F60; // type:function size:0x30C
|
||||
fn_80367270 = .text:0x80367270; // type:function size:0xC
|
||||
fn_80367280 = .text:0x80367280; // type:function size:0x18C
|
||||
setCallbacksForStage__14dSndStateMgr_cFv = .text:0x80367280; // type:function size:0x18C
|
||||
cbUnkNoop__14dSndStateMgr_cFv = .text:0x80367410; // type:function size:0x4
|
||||
fn_80367420 = .text:0x80367420; // type:function size:0x24
|
||||
fn_80367450 = .text:0x80367450; // type:function size:0x14
|
||||
@@ -20463,9 +20463,9 @@ musicForStageRelated = .text:0x8036F3B0; // type:function size:0x9EC
|
||||
fn_8036FDA0 = .text:0x8036FDA0; // type:function size:0x2C
|
||||
fn_8036FDD0 = .text:0x8036FDD0; // type:function size:0x298
|
||||
fn_80370070 = .text:0x80370070; // type:function size:0xC8
|
||||
fn_80370140 = .text:0x80370140; // type:function size:0x8
|
||||
setOverrideBgmId__12dSndBgmMgr_cFUl = .text:0x80370140; // type:function size:0x8
|
||||
fn_80370150 = .text:0x80370150; // type:function size:0x20
|
||||
fn_80370170 = .text:0x80370170; // type:function size:0x1C
|
||||
activateOverrideBgmId__12dSndBgmMgr_cFv = .text:0x80370170; // type:function size:0x1C
|
||||
fn_80370190 = .text:0x80370190; // type:function size:0x180
|
||||
fn_80370310 = .text:0x80370310; // type:function size:0x8
|
||||
fn_80370320 = .text:0x80370320; // type:function size:0xF4
|
||||
@@ -20502,8 +20502,8 @@ setBgmToPlayOnEventEnd__12dSndBgmMgr_cFUl = .text:0x803713D0; // type:function s
|
||||
onEventEnd__12dSndBgmMgr_cFv = .text:0x80371420; // type:function size:0x58
|
||||
fn_80371480 = .text:0x80371480; // type:function size:0x7C
|
||||
fn_80371500 = .text:0x80371500; // type:function size:0x60
|
||||
fn_80371560 = .text:0x80371560; // type:function size:0x84
|
||||
fn_803715F0 = .text:0x803715F0; // type:function size:0x84
|
||||
onTgSndAreaFlagsChange__12dSndBgmMgr_cFUlUl = .text:0x80371560; // type:function size:0x84
|
||||
onTgSndAreaMgFlagsChange__12dSndBgmMgr_cFUlUl = .text:0x803715F0; // type:function size:0x84
|
||||
fn_80371680 = .text:0x80371680; // type:function size:0xB0
|
||||
fn_80371730 = .text:0x80371730; // type:function size:0x84
|
||||
fn_803717C0 = .text:0x803717C0; // type:function size:0x160
|
||||
@@ -20889,7 +20889,7 @@ __dt__20dSndHarpSongEntry2_cFv = .text:0x8037FBD0; // type:function size:0x58
|
||||
setup__17dSndHarpSongMgr_cFv = .text:0x8037FC30; // type:function size:0x4
|
||||
setupState0__17dSndHarpSongMgr_cFv = .text:0x8037FC40; // type:function size:0xA8
|
||||
fn_8037FCF0 = .text:0x8037FCF0; // type:function size:0x6C
|
||||
putHarpAway = .text:0x8037FD60; // type:function size:0x74
|
||||
deactivate__17dSndHarpSongMgr_cFv = .text:0x8037FD60; // type:function size:0x74
|
||||
fn_8037FDE0 = .text:0x8037FDE0; // type:function size:0x58
|
||||
calc__17dSndHarpSongMgr_cFv = .text:0x8037FE40; // type:function size:0x220
|
||||
fn_80380060 = .text:0x80380060; // type:function size:0x130
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
/* 0xCC */ mVec3_c mScale;
|
||||
/* 0xD8 */ u32 actor_properties;
|
||||
/* 0xDC */ dAcRef_c<dAcBase_c> actor_node;
|
||||
/* 0xE8 */ u32 field_0xe8;
|
||||
/* 0xE8 */ u32 mTgSndAreaFlags;
|
||||
/* 0xEC */ s8 roomid;
|
||||
/* 0xED */ u8 actor_subtype;
|
||||
/* 0xEE */ u8 polyAttr0;
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
/* 8002c710 */ int initAllocatorWork1Heap(int size, char *name, int align);
|
||||
/* 8002c720 */ int initAllocator(int size, char *name, EGG::Heap *heap, int align);
|
||||
/* 8002c7b0 */ bool addActorToRoom(s32 roomId);
|
||||
/* 8002c840 */ void setBit_field_0xE8(s32);
|
||||
/* 8002c840 */ void setTgSndAreaFlag(s32);
|
||||
/* 8002cf10 */ u32 itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype);
|
||||
/* 8002cf90 */ void fillUpperParams2Byte();
|
||||
/* 8002cfa0 */ u32 getParams2_ignoreLower();
|
||||
|
||||
@@ -93,6 +93,10 @@ public:
|
||||
return LINK;
|
||||
}
|
||||
|
||||
static dAcPy_c *GetLinkM() {
|
||||
return LINK;
|
||||
}
|
||||
|
||||
static dAcPy_c *GetLink2() {
|
||||
return LINK2;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ protected:
|
||||
/* 0xCC */ u16 mFlags;
|
||||
/* 0xD0 */ nw4r::math::VEC3 mPositionRelativeToPlayer;
|
||||
/* 0xDC */ f32 mDistanceToPlayer;
|
||||
/* 0xE0 */ f32 a_field_0xE0;
|
||||
/* 0xE0 */ f32 mFxSend3D;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,6 +46,12 @@ public:
|
||||
bool onEventFinalize(const char *eventName, u32 soundEventId, bool skipped);
|
||||
void prepareBgm();
|
||||
|
||||
void setOverrideBgmId(u32 id);
|
||||
void activateOverrideBgmId();
|
||||
|
||||
void onTgSndAreaMgFlagsChange(u32 newFlags, u32 oldFlags);
|
||||
void onTgSndAreaFlagsChange(u32 newFlags, u32 oldFlags);
|
||||
|
||||
dSndBgmSound_c *getSoundHandleForBgm(u32 soundId, u32 startOffset);
|
||||
bool isPlayingBgmSound() const;
|
||||
bool isPlayingBgmSoundId(u32 soundId) const;
|
||||
|
||||
@@ -19,6 +19,9 @@ public:
|
||||
|
||||
void calc();
|
||||
|
||||
void activate();
|
||||
void deactivate();
|
||||
|
||||
nw4r::snd::SoundHandle &getFiSingHandle() {
|
||||
return mFiSingHandle;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public:
|
||||
|
||||
public:
|
||||
typedef void (*OnEventStartCallback)(s32 soundEventId, u32 flags);
|
||||
typedef void (*OnFlagsChangeCallback)(u32 newFlags, u32 oldFlags);
|
||||
|
||||
enum StageFlags_e {
|
||||
STAGE_FIELD = 0x1,
|
||||
@@ -77,12 +78,10 @@ public:
|
||||
return mFrameCounter;
|
||||
}
|
||||
|
||||
f32 getField_0x49C() const {
|
||||
return field_0x49C;
|
||||
f32 getFxSend3D() const {
|
||||
return mFxSend3D;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void resetEventName() {
|
||||
mEventName = "EVENT_NONE";
|
||||
}
|
||||
@@ -173,6 +172,8 @@ public:
|
||||
|
||||
void onStageOrLayerUpdate();
|
||||
void onStageLoad();
|
||||
void onRestartScene(s32 fadeFrames);
|
||||
void onGotoStage(s32 fadeFrames);
|
||||
void loadStageSound();
|
||||
void loadObjectSound();
|
||||
|
||||
@@ -227,6 +228,8 @@ private:
|
||||
void setRoomId(s32 roomId);
|
||||
void calcTgSnd();
|
||||
void calcFilters();
|
||||
void calcFxSend3D();
|
||||
void setFxSend3DTarget();
|
||||
|
||||
u32 getBgmLabelSoundId();
|
||||
void doLabelSuffix(const char *suffix);
|
||||
@@ -250,7 +253,7 @@ private:
|
||||
u32 getCmdCameraId();
|
||||
u32 getCmdMsgWaitId();
|
||||
u32 getCmdFrameCountId();
|
||||
|
||||
|
||||
void calcSe();
|
||||
bool calcBgm();
|
||||
void calcCmd();
|
||||
@@ -306,16 +309,16 @@ private:
|
||||
/* 0x060 */ UNKWORD field_0x060;
|
||||
/* 0x064 */ u8 field_0x064;
|
||||
/* 0x065 */ bool field_0x065;
|
||||
/* 0x066 */ u8 field_0x066;
|
||||
/* 0x067 */ u8 field_0x067;
|
||||
/* 0x068 */ UNKWORD field_0x068;
|
||||
/* 0x06C */ UNKWORD field_0x06C;
|
||||
/* 0x066 */ bool mHasChangedTgSndAreaFlags;
|
||||
/* 0x067 */ bool mHasChangedTgSndAreaMgFlags;
|
||||
/* 0x068 */ u32 mSavedTgSndAreaFlags;
|
||||
/* 0x06C */ u32 mSavedTgSndAreaMgFlags;
|
||||
/* 0x070 */ void (*mpUnkCallback)();
|
||||
/* 0x074 */ UNKWORD field_0x074;
|
||||
/* 0x078 */ OnEventStartCallback mpOnEventStartCallback;
|
||||
/* 0x07C */ UNKWORD field_0x07C;
|
||||
/* 0x080 */ UNKWORD field_0x080;
|
||||
/* 0x084 */ UNKWORD field_0x084;
|
||||
/* 0x080 */ OnFlagsChangeCallback mpTgSndAreaFlagsChangeCallback;
|
||||
/* 0x084 */ OnFlagsChangeCallback mpTgSndAreaMgFlagsChangeCallback;
|
||||
/* 0x088 */ UNKWORD field_0x088;
|
||||
/* 0x08C */ s32 mSoundEventId;
|
||||
/* 0x090 */ s32 mCameraCutCounter;
|
||||
@@ -346,11 +349,11 @@ private:
|
||||
/* 0x258 */ u32 field_0x258;
|
||||
/* 0x25C */ nw4r::snd::FxReverbStdDpl2 mFx;
|
||||
/* 0x48C */ UNKWORD field_0x48C;
|
||||
/* 0x490 */ f32 field_0x490;
|
||||
/* 0x494 */ f32 field_0x494;
|
||||
/* 0x498 */ f32 field_0x498;
|
||||
/* 0x49C */ f32 field_0x49C;
|
||||
/* 0x4A0 */ f32 field_0x4A0;
|
||||
/* 0x490 */ f32 mFxSend3DDefault;
|
||||
/* 0x494 */ f32 mFxSend3DOverride;
|
||||
/* 0x498 */ f32 mFxSend3DNext;
|
||||
/* 0x49C */ f32 mFxSend3D;
|
||||
/* 0x4A0 */ f32 mFxSend3DTarget;
|
||||
/* 0x4A4 */ u32 field_0x4A4;
|
||||
/* 0x4A8 */ u8 field_0x4A8;
|
||||
/* 0x4A9 */ bool mNeedsGroupsReload;
|
||||
|
||||
@@ -16,8 +16,12 @@ public:
|
||||
virtual int doDelete() override;
|
||||
virtual int create() override;
|
||||
|
||||
void setBgmFlag(int flag) {
|
||||
mBgmFlags |= 1 << flag;
|
||||
void setSndFlag(int flag) {
|
||||
mSndFlags |= 1 << flag;
|
||||
}
|
||||
|
||||
u32 getSndFlags() const {
|
||||
return mSndFlags;
|
||||
}
|
||||
|
||||
static dTgSndMg_c *GetInstance() {
|
||||
@@ -26,7 +30,8 @@ public:
|
||||
|
||||
private:
|
||||
static dTgSndMg_c *sInstance;
|
||||
u32 mBgmFlags;
|
||||
|
||||
/* 0xFC */ u32 mSndFlags;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "d/snd/d_snd_player_mgr.h"
|
||||
#include "d/snd/d_snd_state_mgr.h"
|
||||
|
||||
class dSndSound_c;
|
||||
|
||||
// A lot of these names are and were guesses that are probably wrong in a lot of ways.
|
||||
|
||||
@@ -16,8 +13,4 @@ extern "C" void fn_8035E820(dSndPlayerMgr_c *);
|
||||
extern "C" void fn_8035E880(dSndPlayerMgr_c *);
|
||||
extern "C" void fn_8035E310(dSndPlayerMgr_c *);
|
||||
|
||||
#define ENEMY_SOUND_MGR (dSndStateMgr_c::GetInstance())
|
||||
extern "C" void fn_80362150(dSndStateMgr_c *, u16);
|
||||
extern "C" void fn_803625F0(dSndStateMgr_c *, u16);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@ int dTgSndAr_c::create() {
|
||||
}
|
||||
dAcBase_c *ac = static_cast<dAcBase_c *>(base);
|
||||
if (!ac->isActorPlayer() && checkPosInArea(ac->position)) {
|
||||
ac->setBit_field_0xE8(params & 0xFF);
|
||||
ac->setTgSndAreaFlag(params & 0xFF);
|
||||
}
|
||||
}
|
||||
return SUCCEEDED;
|
||||
@@ -49,12 +49,12 @@ int dTgSndAr_c::doDelete() {
|
||||
int dTgSndAr_c::actorExecute() {
|
||||
dAcBase_c *link = dAcPy_c::LINK;
|
||||
if (link != nullptr && checkPosInArea(link->position)) {
|
||||
link->setBit_field_0xE8(params & 0xFF);
|
||||
link->setTgSndAreaFlag(params & 0xFF);
|
||||
}
|
||||
if (dSnd3DManager_c::GetInstance() != nullptr) {
|
||||
mVec3_c pos(dSnd3DManager_c::GetInstance()->getCameraTargetPos());
|
||||
if (checkPosInArea(pos) && dTgSndMg_c::GetInstance() != nullptr) {
|
||||
dTgSndMg_c::GetInstance()->setBgmFlag(params & 0xFF);
|
||||
dTgSndMg_c::GetInstance()->setSndFlag(params & 0xFF);
|
||||
}
|
||||
}
|
||||
return SUCCEEDED;
|
||||
|
||||
@@ -18,9 +18,9 @@ int dTgSndMg_c::doDelete() {
|
||||
|
||||
int dTgSndMg_c::actorExecute() {
|
||||
if (dAcPy_c::LINK != nullptr) {
|
||||
dAcPy_c::LINK->field_0xe8 = 0;
|
||||
dAcPy_c::LINK->mTgSndAreaFlags = 0;
|
||||
}
|
||||
mBgmFlags = 0;
|
||||
mSndFlags = 0;
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,8 +151,8 @@ bool dAcBase_c::addActorToRoom(s32 roomId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void dAcBase_c::setBit_field_0xE8(s32 shift) {
|
||||
field_0xe8 |= (1 << shift);
|
||||
void dAcBase_c::setTgSndAreaFlag(s32 shift) {
|
||||
mTgSndAreaFlags |= (1 << shift);
|
||||
}
|
||||
|
||||
int dAcBase_c::actorCreate() {
|
||||
|
||||
+2
-2
@@ -6,6 +6,7 @@
|
||||
#include "d/d_gfx.h"
|
||||
#include "d/d_stage_mgr.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "d/snd/d_snd_state_mgr.h"
|
||||
#include "f/f_base.h"
|
||||
#include "f/f_profile_name.h"
|
||||
#include "m/m_fader_base.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
#include "toBeSorted/arc_managers/oarc_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/minigame_mgr.h"
|
||||
#include "toBeSorted/music_mgrs.h"
|
||||
#include "toBeSorted/unk_save_time.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -166,7 +166,7 @@ void dScGame_c::executeState_Action() {
|
||||
}
|
||||
} else if (mReloadTrigger != fProfile::PROFILE_MAX) {
|
||||
mFader.fadeOut();
|
||||
fn_80362150(ENEMY_SOUND_MGR, mFader.getFadeOutFrame());
|
||||
dSndStateMgr_c::GetInstance()->onGotoStage(mFader.getFadeOutFrame());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "d/d_reset.h"
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/d_sys.h"
|
||||
#include "d/snd/d_snd_state_mgr.h"
|
||||
#include "f/f_base.h"
|
||||
#include "f/f_profile_name.h"
|
||||
#include "m/m_color.h"
|
||||
@@ -162,7 +163,7 @@ void dScTitle_c::loadTitleScreen(u32 params) {
|
||||
} else {
|
||||
actuallyTriggerEntrance("F000", 0, 28, 48, 0, 0, dFader_c::FADER_BLACK, 15, -1);
|
||||
}
|
||||
fn_80362150(ENEMY_SOUND_MGR, 30);
|
||||
dSndStateMgr_c::GetInstance()->onGotoStage(30);
|
||||
}
|
||||
|
||||
void dScTitle_c::setSomethingSkbRelated() {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "toBeSorted/arc_managers/layout_arc_manager.h"
|
||||
#include "toBeSorted/arc_managers/oarc_manager.h"
|
||||
#include "toBeSorted/d_particle.h"
|
||||
#include "toBeSorted/music_mgrs.h"
|
||||
|
||||
SPECIAL_BASE_PROFILE(STAGE_MANAGER, dStageMgr_c, fProfile::STAGE_MANAGER, 0X5, 1536);
|
||||
|
||||
@@ -280,7 +279,7 @@ void dStageMgr_c::finalizeState_RestartSceneWait() {}
|
||||
void dStageMgr_c::initializeState_RestartScene() {
|
||||
triggerFade(dScGame_c::nextSpawnInfo.transitionType, dScGame_c::nextSpawnInfo.transitionFadeFrames);
|
||||
mFader.setFadeInType(dScGame_c::nextSpawnInfo.transitionType);
|
||||
fn_803625F0(ENEMY_SOUND_MGR, mFader.getFadeOutFrame());
|
||||
dSndStateMgr_c::GetInstance()->onRestartScene(mFader.getFadeOutFrame());
|
||||
}
|
||||
|
||||
void dStageMgr_c::executeState_RestartScene() {
|
||||
|
||||
@@ -30,7 +30,7 @@ dSnd3DActor_c::dSnd3DActor_c(dSndSourceParam *pSourceParam, s32 sourceType)
|
||||
mpSourceParam(pSourceParam),
|
||||
mFlags(0),
|
||||
mDistanceToPlayer(INFINITY),
|
||||
a_field_0xE0(0.0f) {
|
||||
mFxSend3D(0.0f) {
|
||||
resetCachedRelativePositions();
|
||||
// Portability hazard
|
||||
SetUserParam(reinterpret_cast<u32>(this));
|
||||
@@ -41,7 +41,7 @@ dSnd3DActor_c::dSnd3DActor_c(dSndSourceParam *pSourceParam, s32 sourceType)
|
||||
|
||||
void dSnd3DActor_c::setPosition(const nw4r::math::VEC3 &rPosition) {
|
||||
SetPosition(rPosition);
|
||||
a_field_0xE0 = dSndStateMgr_c::GetInstance()->getField_0x49C();
|
||||
mFxSend3D = dSndStateMgr_c::GetInstance()->getFxSend3D();
|
||||
mFlags = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void dSndDistantSoundActor_c::setPause(bool flag, int fadeFrames) {
|
||||
}
|
||||
|
||||
void dSndDistantSoundActor_c::updateSome3DField() {
|
||||
a_field_0xE0 = dSndStateMgr_c::GetInstance()->getField_0x49C();
|
||||
mFxSend3D = dSndStateMgr_c::GetInstance()->getFxSend3D();
|
||||
}
|
||||
|
||||
UNKWORD dSndDistantSoundActor_c::d_vt_0x3C() {
|
||||
|
||||
+107
-14
@@ -9,6 +9,7 @@
|
||||
#include "d/snd/d_snd_checkers.h"
|
||||
#include "d/snd/d_snd_control_player_mgr.h"
|
||||
#include "d/snd/d_snd_event.h"
|
||||
#include "d/snd/d_snd_harp_song_mgr.h"
|
||||
#include "d/snd/d_snd_mgr.h"
|
||||
#include "d/snd/d_snd_player_mgr.h"
|
||||
#include "d/snd/d_snd_small_effect_mgr.h"
|
||||
@@ -16,6 +17,7 @@
|
||||
#include "d/snd/d_snd_stage_data.h"
|
||||
#include "d/snd/d_snd_util.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "d/t/d_t_sound_area_mgr.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "nw4r/snd/snd_FxReverbStdDpl2.h"
|
||||
#include "nw4r/snd/snd_SeqSoundHandle.h"
|
||||
@@ -42,16 +44,16 @@ dSndStateMgr_c::dSndStateMgr_c()
|
||||
field_0x060(0),
|
||||
field_0x064(0),
|
||||
field_0x065(false),
|
||||
field_0x066(0),
|
||||
field_0x067(0),
|
||||
field_0x068(-1),
|
||||
field_0x06C(-1),
|
||||
mHasChangedTgSndAreaFlags(false),
|
||||
mHasChangedTgSndAreaMgFlags(false),
|
||||
mSavedTgSndAreaFlags(-1),
|
||||
mSavedTgSndAreaMgFlags(-1),
|
||||
mpUnkCallback(nullptr),
|
||||
field_0x074(0),
|
||||
mpOnEventStartCallback(nullptr),
|
||||
field_0x07C(0),
|
||||
field_0x080(0),
|
||||
field_0x084(0),
|
||||
mpTgSndAreaFlagsChangeCallback(nullptr),
|
||||
mpTgSndAreaMgFlagsChangeCallback(nullptr),
|
||||
field_0x088(0),
|
||||
mSoundEventId(SND_EVENT_0x89),
|
||||
mCameraCutCounter(0),
|
||||
@@ -74,11 +76,11 @@ dSndStateMgr_c::dSndStateMgr_c()
|
||||
field_0x254(0),
|
||||
field_0x258(0),
|
||||
field_0x48C(0),
|
||||
field_0x490(0.02f),
|
||||
field_0x494(-1.0f),
|
||||
field_0x498(-1.0f),
|
||||
field_0x49C(0.02f),
|
||||
field_0x4A0(0.02f),
|
||||
mFxSend3DDefault(0.02f),
|
||||
mFxSend3DOverride(-1.0f),
|
||||
mFxSend3DNext(-1.0f),
|
||||
mFxSend3D(0.02f),
|
||||
mFxSend3DTarget(0.02f),
|
||||
field_0x4A4(-1),
|
||||
field_0x4A8(0),
|
||||
mNeedsGroupsReload(false) {}
|
||||
@@ -228,6 +230,38 @@ bool dSndStateMgr_c::isSomeSkyloftRoom() const {
|
||||
}
|
||||
}
|
||||
|
||||
void dSndStateMgr_c::onRestartScene(s32 fadeFrames) {
|
||||
if (field_0x064) {
|
||||
return;
|
||||
}
|
||||
|
||||
s32 nextLayer = dScGame_c::nextSpawnInfo.layer;
|
||||
// This combines next stage with current layer, so this effectively checks if you're leaving the Hint Movie scene
|
||||
if (isSeekerStoneStage(mStageName, dScGame_c::currentSpawnInfo.layer)) {
|
||||
dSndBgmMgr_c::GetInstance()->stopAllBgm(fadeFrames);
|
||||
} else if (mLayer != nextLayer) {
|
||||
if (isSeekerStoneStage(mStageName, nextLayer)) {
|
||||
dSndBgmMgr_c::GetInstance()->stopAllBgm(fadeFrames);
|
||||
dSndBgmMgr_c::GetInstance()->prepareBgm(BGM_HINT_SELECT, 0);
|
||||
dSndBgmMgr_c::GetInstance()->setOverrideBgmId(BGM_HINT_SELECT);
|
||||
dSndBgmMgr_c::GetInstance()->activateOverrideBgmId();
|
||||
dSndAreaSoundEffectMgr_c::GetInstance()->stopSounds(fadeFrames);
|
||||
} else {
|
||||
onGotoStage(fadeFrames);
|
||||
onFlag0x10(0x01);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dSndSmallEffectMgr_c::GetInstance()->stopAllSoundExceptEvent(fadeFrames);
|
||||
dSndBgmMgr_c::GetInstance()->prepareBgm();
|
||||
dSndHarpSongMgr_c::GetInstance()->deactivate();
|
||||
onFlag0x10(0x01);
|
||||
dSndBgmMgr_c::GetInstance()->setField_0x306(1);
|
||||
offFlag0x10(0x4);
|
||||
offFlag0x10(0x10);
|
||||
}
|
||||
|
||||
void dSndStateMgr_c::loadStageSound() {
|
||||
loadStageSound(false);
|
||||
}
|
||||
@@ -405,7 +439,7 @@ void dSndStateMgr_c::loadStageSound(bool force) {
|
||||
f32 volume = -1.0f;
|
||||
dSndAreaSoundEffectMgr_c::GetInstance()->loadStageSound(&volume);
|
||||
if (volume > 0.0f) {
|
||||
field_0x490 = volume;
|
||||
mFxSend3DDefault = volume;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -700,7 +734,7 @@ void dSndStateMgr_c::handleSeLv() {
|
||||
if (dSndMgr_c::GetInstance()->holdSound(&mSeLvSoundHandle, soundId)) {
|
||||
u32 id = dSndPlayerMgr_c::GetInstance()->getDemoArchive()->GetSoundUserParam(soundId);
|
||||
if ((dSndPlayerMgr_c::sEventMuteFlagsMask & id & 0x2000000) == 0) {
|
||||
mSeLvSoundHandle.SetFxSend(nw4r::snd::AUX_A, field_0x49C);
|
||||
mSeLvSoundHandle.SetFxSend(nw4r::snd::AUX_A, mFxSend3D);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -849,7 +883,35 @@ void dSndStateMgr_c::setRoomId(s32 roomId) {
|
||||
}
|
||||
|
||||
void dSndStateMgr_c::calcTgSnd() {
|
||||
// ...
|
||||
mHasChangedTgSndAreaFlags = false;
|
||||
mHasChangedTgSndAreaMgFlags = false;
|
||||
dAcPy_c *link = dAcPy_c::GetLinkM();
|
||||
if (link != nullptr && dTgSndMg_c::GetInstance() != nullptr) {
|
||||
u32 flags = dTgSndMg_c::GetInstance()->getSndFlags();
|
||||
if (flags != mSavedTgSndAreaMgFlags) {
|
||||
mHasChangedTgSndAreaMgFlags = true;
|
||||
if (mpTgSndAreaMgFlagsChangeCallback != nullptr) {
|
||||
(mpTgSndAreaMgFlagsChangeCallback)(flags, mSavedTgSndAreaMgFlags);
|
||||
}
|
||||
dSndBgmMgr_c::GetInstance()->onTgSndAreaMgFlagsChange(flags, mSavedTgSndAreaMgFlags);
|
||||
mSavedTgSndAreaMgFlags = flags;
|
||||
}
|
||||
|
||||
if (dSndSourceMgr_c::getBoomerangSource() != nullptr) {
|
||||
flags = mSavedTgSndAreaMgFlags;
|
||||
} else {
|
||||
flags = link->mTgSndAreaFlags;
|
||||
}
|
||||
if (flags != mSavedTgSndAreaFlags) {
|
||||
mHasChangedTgSndAreaFlags = true;
|
||||
if (mpTgSndAreaFlagsChangeCallback != nullptr) {
|
||||
(mpTgSndAreaFlagsChangeCallback)(flags, mSavedTgSndAreaFlags);
|
||||
}
|
||||
mFxSend3DNext = getUserParamVolume(flags);
|
||||
dSndBgmMgr_c::GetInstance()->onTgSndAreaFlagsChange(flags, mSavedTgSndAreaFlags);
|
||||
mSavedTgSndAreaFlags = flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dSndStateMgr_c::calcFilters() {
|
||||
@@ -975,6 +1037,37 @@ void dSndStateMgr_c::resetBgmLpf() {
|
||||
}
|
||||
}
|
||||
|
||||
void dSndStateMgr_c::calcFxSend3D() {
|
||||
if (mFxSend3D > mFxSend3DTarget) {
|
||||
mFxSend3D -= 0.02f;
|
||||
if (mFxSend3D < mFxSend3DTarget) {
|
||||
mFxSend3D = mFxSend3DTarget;
|
||||
}
|
||||
} else if (mFxSend3D < mFxSend3DTarget) {
|
||||
mFxSend3D += 0.02f;
|
||||
if (mFxSend3D > mFxSend3DTarget) {
|
||||
mFxSend3D = mFxSend3DTarget;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dSndStateMgr_c::setFxSend3DTarget() {
|
||||
// TODO - weird control flow
|
||||
f32 target = mFxSend3DDefault;
|
||||
if (mFxSend3DNext > 0.0f) {
|
||||
target = mFxSend3DNext;
|
||||
} else if (mFxSend3DOverride > 0.0f) {
|
||||
target = mFxSend3DOverride;
|
||||
}
|
||||
|
||||
if (target < 0.02f) {
|
||||
target = 0.02f;
|
||||
} else if (target > 0.3f) {
|
||||
target = 0.3f;
|
||||
}
|
||||
mFxSend3DTarget = target;
|
||||
}
|
||||
|
||||
f32 dSndStateMgr_c::getUserParamVolume(u32 userParam) {
|
||||
s32 bit = 31;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
||||
Reference in New Issue
Block a user