Progress on dSndSourceMgr_c::createSource

This commit is contained in:
robojumper
2025-06-27 23:46:02 +02:00
parent c73a1af098
commit 3b5344d4a1
33 changed files with 379 additions and 77 deletions
+19 -19
View File
@@ -1024,7 +1024,7 @@ fn_8002C0D0 = .text:0x8002C0D0; // type:function size:0x58
__ct__9SoundInfoFP9dAcBase_c = .text:0x8002C130; // type:function size:0x24
__dt__16dSoundSourceIf_cFv = .text:0x8002C160; // type:function size:0x40 scope:weak
__dt__9SoundInfoFv = .text:0x8002C1A0; // type:function size:0xB0
initSource__9SoundInfoFUcPCcPC7mVec3_c = .text:0x8002C250; // type:function size:0xB8
initSource__9SoundInfoFlPCcPC7mVec3_c = .text:0x8002C250; // type:function size:0xB8
startBgHitSound__9SoundInfoFUlRC13cBgS_PolyInfoPC7mVec3_c = .text:0x8002C310; // type:function size:0x90
createHeap__9dAcBase_cFv = .text:0x8002C3A0; // type:function size:0x8
__ct__9dAcBase_cFv = .text:0x8002C3B0; // type:function size:0x178
@@ -19838,7 +19838,7 @@ __ct__11dSndActor_cFRQ34nw4r3snd18SoundArchivePlayer = .text:0x8035A560; // type
__dt__Q34nw4r3snd11SoundHandleFv = .text:0x8035A5A0; // type:function size:0x54 scope:weak
__cl__22SoundPropertiesCheckerFRQ34nw4r3snd11SoundHandle = .text:0x8035A600; // type:function size:0x240 scope:weak
__dt__11dSndActor_cFv = .text:0x8035A840; // type:function size:0x58 scope:weak
__ct__13dSnd3DActor_cFP15dSndSourceParamUc = .text:0x8035A8A0; // type:function size:0xE8
__ct__13dSnd3DActor_cFP15dSndSourceParaml = .text:0x8035A8A0; // type:function size:0xE8
setPosition__13dSnd3DActor_cFRCQ34nw4r4math4VEC3 = .text:0x8035A990; // type:function size:0x40
resetCachedRelativePositions__13dSnd3DActor_cFv = .text:0x8035A9D0; // type:function size:0x2C
setSourceParam__13dSnd3DActor_cFPC15dSndSourceParam = .text:0x8035AA00; // type:function size:0x30
@@ -19976,8 +19976,8 @@ getSomeUserParam__15dSndPlayerMgr_cCFUl = .text:0x8035EB90; // type:function siz
fn_8035EC10 = .text:0x8035EC10; // type:function size:0x5C
fn_8035EC70 = .text:0x8035EC70; // type:function size:0x84
convertLabelStringToSoundId__15dSndPlayerMgr_cCFPCc = .text:0x8035ED00; // type:function size:0x3C
getSoundArchivePlayerForType__15dSndPlayerMgr_cFUc = .text:0x8035ED40; // type:function size:0x44
canUseThisPlayer__15dSndPlayerMgr_cCFUc = .text:0x8035ED90; // type:function size:0x5C
getSoundArchivePlayerForType__15dSndPlayerMgr_cFl = .text:0x8035ED40; // type:function size:0x44
canUseThisPlayer__15dSndPlayerMgr_cCFl = .text:0x8035ED90; // type:function size:0x5C
loadDemoArchive__15dSndPlayerMgr_cFPCc = .text:0x8035EDF0; // type:function size:0x198
shutdown__15dSndPlayerMgr_cFv = .text:0x8035EF90; // type:function size:0x38
calc__15dSndPlayerMgr_cFv = .text:0x8035EFD0; // type:function size:0x40
@@ -20949,7 +20949,7 @@ fn_80382410 = .text:0x80382410; // type:function size:0xC0
fn_803824D0 = .text:0x803824D0; // type:function size:0x24
isSwOrEOc__15dSndSourceMgr_cFPCc = .text:0x80382500; // type:function size:0x90
getSourceCategoryForSourceType__15dSndSourceMgr_cFlPCc = .text:0x80382590; // type:function size:0xB0
createSource__15dSndSourceMgr_cFUlP9dAcBase_cPCcUc = .text:0x80382640; // type:function size:0xFD8
createSource__15dSndSourceMgr_cFlP9dAcBase_cPCcUc = .text:0x80382640; // type:function size:0xFD8
__dt__25dSndSourceEnemyAnimBase_cFv = .text:0x80383620; // type:function size:0x94
__dt__26dSndSourceEnemyMultiBase_cFv = .text:0x803836C0; // type:function size:0x98
__dt__15dSndSourceObj_cFv = .text:0x80383760; // type:function size:0x58
@@ -20957,7 +20957,7 @@ __dt__23dSndSourceObjAnimBase_cFv = .text:0x803837C0; // type:function size:0x9C
__dt__21dSndSourceAnimSound_cFv = .text:0x80383860; // type:function size:0x94
__dt__15dSndSourceNpc_cFv = .text:0x80383900; // type:function size:0x58
__dt__23dSndSourceNpcAnimBase_cFv = .text:0x80383960; // type:function size:0x9C
d_s_vt_0x180__14dSoundSource_cFUl = .text:0x80383A00; // type:function size:0x8
setOrigName__14dSoundSource_cFPCc = .text:0x80383A00; // type:function size:0x8
isMultiSource__14dSoundSource_cCFv = .text:0x80383A10; // type:function size:0x8
registerAdditionalSource__14dSoundSource_cFP14dSoundSource_c = .text:0x80383A20; // type:function size:0x4
__dt__33SndMgrDisposer<15dSndSourceMgr_c>Fv = .text:0x80383A30; // type:function size:0x78
@@ -21129,8 +21129,8 @@ getSourceClosestToListener__17dSndSourceGroup_cFv = .text:0x80386CF0; // type:fu
getSourceClosestToPlayer__17dSndSourceGroup_cFv = .text:0x80386DE0; // type:function size:0x110
fn_80386EF0 = .text:0x80386EF0; // type:function size:0x80
setParamFromName__17dSndSourceGroup_cFPCc = .text:0x80386F70; // type:function size:0x1A4C
create__16dSoundSourceIf_cFUlP9dAcBase_cPCcUc = .text:0x803889C0; // type:function size:0x4
__ct__14dSoundSource_cFUcP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x803889D0; // type:function size:0x108
create__16dSoundSourceIf_cFlP9dAcBase_cPCcUc = .text:0x803889C0; // type:function size:0x4
__ct__14dSoundSource_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x803889D0; // type:function size:0x108
__dt__14dSoundSource_cFv = .text:0x80388AE0; // type:function size:0xC4
setup__14dSoundSource_cFv = .text:0x80388BB0; // type:function size:0x118
shutdown__14dSoundSource_cFv = .text:0x80388CD0; // type:function size:0x9C
@@ -21234,7 +21234,7 @@ setupSoundCommon__14dSoundSource_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14Sou
__sinit_\d_snd_source_cpp = .text:0x8038C3D0; // type:function size:0x18 scope:local
@88@__dt__14dSoundSource_cFv = .text:0x8038C3F0; // type:function size:0x8 scope:weak
@4@__dt__14dSoundSource_cFv = .text:0x8038C400; // type:function size:0x8 scope:weak
fn_8038C410 = .text:0x8038C410; // type:function size:0xEC
__ct__18dSndSourcePlayer_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038C410; // type:function size:0xEC
fn_8038C500 = .text:0x8038C500; // type:function size:0xC4
fn_8038C5D0 = .text:0x8038C5D0; // type:function size:0x3D0
fn_8038C9A0 = .text:0x8038C9A0; // type:function size:0x44
@@ -21263,7 +21263,7 @@ fn_8038D510 = .text:0x8038D510; // type:function size:0x8
fn_8038D520 = .text:0x8038D520; // type:function size:0x8
fn_8038D530 = .text:0x8038D530; // type:function size:0x8
fn_8038D540 = .text:0x8038D540; // type:function size:0x8
linkSoundRelated = .text:0x8038D550; // type:function size:0x7C
__ct__22dSndSourcePlayerHead_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038D550; // type:function size:0x7C
fn_8038D5D0 = .text:0x8038D5D0; // type:function size:0x40
fn_8038D610 = .text:0x8038D610; // type:function size:0x40
__dt__9dSndRng_cFv = .text:0x8038D650; // type:function size:0x40
@@ -21285,7 +21285,7 @@ fn_8038DCD0 = .text:0x8038DCD0; // type:function size:0x8
fn_8038DCE0 = .text:0x8038DCE0; // type:function size:0x8
fn_8038DCF0 = .text:0x8038DCF0; // type:function size:0x8
fn_8038DD00 = .text:0x8038DD00; // type:function size:0x8
__ct__17dSndSourceEnemy_cFUcP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038DD10; // type:function size:0x94
__ct__17dSndSourceEnemy_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038DD10; // type:function size:0x94
__dt__17dSndSourceEnemy_cFv = .text:0x8038DDB0; // type:function size:0x7C
shutdown__17dSndSourceEnemy_cFv = .text:0x8038DE30; // type:function size:0x34
unregisterEnemySource__17dSndSourceEnemy_cFv = .text:0x8038DE70; // type:function size:0x34
@@ -21317,12 +21317,12 @@ __dt__25dSndSourceObjLightShaft_cFv = .text:0x8038EA30; // type:function size:0x
@4@__dt__25dSndSourceObjLightShaft_cFv = .text:0x8038EAD0; // type:function size:0x8 scope:weak
startTadtoneSound__19dSndSourceObjClef_cFUlUl = .text:0x8038EAE0; // type:function size:0xE4
__sinit_\d_snd_source_obj_clef_cpp = .text:0x8038EBD0; // type:function size:0x20 scope:local
__ct__21dSndSourceEquipment_cFUcP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038EBF0; // type:function size:0x4C
__ct__21dSndSourceEquipment_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038EBF0; // type:function size:0x4C
shutdown__21dSndSourceEquipment_cFv = .text:0x8038EC40; // type:function size:0x5C
overrideStartSoundId__21dSndSourceEquipment_cFUl = .text:0x8038ECA0; // type:function size:0x1F0
postStartSound__21dSndSourceEquipment_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x8038EE90; // type:function size:0x54
overrideHitObjSoundId__21dSndSourceEquipment_cFUlP14dSoundSource_c = .text:0x8038EEF0; // type:function size:0x1D8
__ct__25dSndSourceEquipmentWhip_cFUcP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F0D0; // type:function size:0x4C
__ct__25dSndSourceEquipmentWhip_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F0D0; // type:function size:0x4C
__dt__21dSndSourceEquipment_cFv = .text:0x8038F120; // type:function size:0x58 scope:weak
postCalc__25dSndSourceEquipmentWhip_cFv = .text:0x8038F180; // type:function size:0x68
d_s_vt_0x1E8__21dSndSourceEquipment_cFUl = .text:0x8038F1F0; // type:function size:0xC scope:weak
@@ -21332,10 +21332,10 @@ __dt__25dSndSourceEquipmentWhip_cFv = .text:0x8038F200; // type:function size:0x
@88@__dt__25dSndSourceEquipmentWhip_cFv = .text:0x8038F280; // type:function size:0x8 scope:weak
@4@postStartSound__21dSndSourceEquipment_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x8038F290; // type:function size:0x8 scope:weak
@4@__dt__25dSndSourceEquipmentWhip_cFv = .text:0x8038F2A0; // type:function size:0x8 scope:weak
fn_8038F2B0 = .text:0x8038F2B0; // type:function size:0x7C
__ct__22dSndSourceNpcSpecial_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F2B0; // type:function size:0x7C
fn_8038F330 = .text:0x8038F330; // type:function size:0x64
fn_8038F3A0 = .text:0x8038F3A0; // type:function size:0xD8
fn_8038F480 = .text:0x8038F480; // type:function size:0x90
__ct__17dSndSourceNpcDr_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F480; // type:function size:0x90
fn_8038F510 = .text:0x8038F510; // type:function size:0xA0
fn_8038F5B0 = .text:0x8038F5B0; // type:function size:0x158
fn_8038F710 = .text:0x8038F710; // type:function size:0x84
@@ -21351,7 +21351,7 @@ fn_8038FEE0 = .text:0x8038FEE0; // type:function size:0x8
fn_8038FEF0 = .text:0x8038FEF0; // type:function size:0x8
fn_8038FF00 = .text:0x8038FF00; // type:function size:0x8
fn_8038FF10 = .text:0x8038FF10; // type:function size:0x8
fn_8038FF20 = .text:0x8038FF20; // type:function size:0xC0
__ct__19dSndSourceNpcHead_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038FF20; // type:function size:0xC0
fn_8038FFE0 = .text:0x8038FFE0; // type:function size:0x1E8
fn_803901D0 = .text:0x803901D0; // type:function size:0x18
fn_803901F0 = .text:0x803901F0; // type:function size:0x18
@@ -21363,7 +21363,7 @@ load__18dSndSourcePyBird_cFPvPCc = .text:0x803902A0; // type:function size:0x1B0
__dt__18dSndSourcePyBird_cFv = .text:0x80390450; // type:function size:0x98 scope:weak
@88@__dt__18dSndSourcePyBird_cFv = .text:0x803904F0; // type:function size:0x8 scope:weak
@4@__dt__18dSndSourcePyBird_cFv = .text:0x80390500; // type:function size:0x8 scope:weak
fn_80390510 = .text:0x80390510; // type:function size:0x7C
__ct__16dSndSourceDemo_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80390510; // type:function size:0x7C
fn_80390590 = .text:0x80390590; // type:function size:0x1EC
fn_80390780 = .text:0x80390780; // type:function size:0x8C
fn_80390810 = .text:0x80390810; // type:function size:0x58
@@ -21376,7 +21376,7 @@ fn_803909C0 = .text:0x803909C0; // type:function size:0x24
fn_803909F0 = .text:0x803909F0; // type:function size:0x8
fn_80390A00 = .text:0x80390A00; // type:function size:0x8
fn_80390A10 = .text:0x80390A10; // type:function size:0x8
__ct__23dSndSourceHarpRelated_cFUcP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80390A20; // type:function size:0x108
__ct__23dSndSourceHarpRelated_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80390A20; // type:function size:0x108
__dt__23dSndSourceHarpRelated_cFv = .text:0x80390B30; // type:function size:0xA8
postCalc__23dSndSourceHarpRelated_cFv = .text:0x80390BE0; // type:function size:0x2F8
setPause__23dSndSourceHarpRelated_cFbi = .text:0x80390EE0; // type:function size:0xFC
@@ -21426,7 +21426,7 @@ fn_80392E00 = .text:0x80392E00; // type:function size:0x8
fn_80392E10 = .text:0x80392E10; // type:function size:0x8
fn_80392E20 = .text:0x80392E20; // type:function size:0x8
fn_80392E30 = .text:0x80392E30; // type:function size:0x8
fn_80392E40 = .text:0x80392E40; // type:function size:0x54
__ct__19dSndSourceTgSound_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80392E40; // type:function size:0x54
fn_80392EA0 = .text:0x80392EA0; // type:function size:0x74
fn_80392F20 = .text:0x80392F20; // type:function size:0x28
fn_80392F50 = .text:0x80392F50; // type:function size:0x30
+1 -1
View File
@@ -10,7 +10,7 @@
class dSnd3DActor_c : public nw4r::snd::Sound3DActor {
public:
dSnd3DActor_c(dSndSourceParam *pSourceParam, u8 sourceType);
dSnd3DActor_c(dSndSourceParam *pSourceParam, s32 sourceType);
virtual ~dSnd3DActor_c() {}
+2 -2
View File
@@ -54,8 +54,8 @@ public:
static bool isBgmPlayerId(u32 id);
u32 getSomeUserParam(u32 soundId) const;
nw4r::snd::SoundArchivePlayer &getSoundArchivePlayerForType(u8 sourceType);
bool canUseThisPlayer(u8 sourceType) const;
nw4r::snd::SoundArchivePlayer &getSoundArchivePlayerForType(s32 sourceType);
bool canUseThisPlayer(s32 sourceType) const;
void stopAllSound();
+4 -4
View File
@@ -16,7 +16,7 @@
class dSoundSource_c : public dSoundSourceIf_c, public dSnd3DActor_c {
public:
dSoundSource_c(u8 sourceType, dAcBase_c *, const char *name, dSndSourceGroup_c *pOwnerGroup);
dSoundSource_c(s32 sourceType, dAcBase_c *, const char *name, dSndSourceGroup_c *pOwnerGroup);
virtual ~dSoundSource_c();
u32 modifySoundId(u32 baseSoundId);
@@ -41,8 +41,8 @@ public:
/* 0x17C */ virtual const char *getName() const {
return mpName;
}
/* 0x180 */ virtual void d_s_vt_0x180(u32 arg) {
field_0x0F4 = arg;
/* 0x180 */ virtual void setOrigName(const char *arg) {
mpOrigName = arg;
}
/* 0x184 */ virtual void preCalc();
/* 0x188 */ virtual void postSetup() {}
@@ -263,7 +263,7 @@ private:
protected:
/* 0x0E8 */ nw4r::ut::Node mMgrLink;
/* 0x0F0 */ const char *mpName;
/* 0x0F4 */ UNKWORD field_0x0F4;
/* 0x0F4 */ const char *mpOrigName;
/* 0x0F8 */ dAcBase_c *mpActor;
/* 0x0FC */ u8 mSourceCategory;
/* 0x0FD */ u8 mSourceType;
+1 -1
View File
@@ -6,7 +6,7 @@
class dSndSourceAnimSound_c : public dSoundSource_c {
public:
dSndSourceAnimSound_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceAnimSound_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {}
/* 0x1A8 */ virtual StartResult
+11
View File
@@ -0,0 +1,11 @@
#ifndef D_SND_SOURCE_DEMO_H
#define D_SND_SOURCE_DEMO_H
#include "d/snd/d_snd_source_anim_sound.h"
class dSndSourceDemo_c : public dSndSourceAnimSound_c {
public:
dSndSourceDemo_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
};
#endif
+1 -1
View File
@@ -5,7 +5,7 @@
class dSndSourceESpark_c : public dSoundSource_c {
public:
dSndSourceESpark_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceESpark_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup) {}
// okay
+6 -6
View File
@@ -9,7 +9,7 @@
class dSndSourceEnemy_c : public dSoundSource_c {
public:
dSndSourceEnemy_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
dSndSourceEnemy_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
virtual ~dSndSourceEnemy_c();
/* 0x020 */ virtual void vt_0x020() override;
@@ -47,7 +47,7 @@ private:
class dSndSourceEnemyAnimBase_c : public dSndSourceEnemy_c {
public:
dSndSourceEnemyAnimBase_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceEnemyAnimBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceEnemy_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {}
/* 0x1A8 */ virtual StartResult
@@ -82,7 +82,7 @@ protected:
class dSndSourceEnemyAnim_c : public dSndSourceEnemyAnimBase_c {
public:
dSndSourceEnemyAnim_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceEnemyAnim_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceEnemyAnimBase_c(sourceType, ac, name, pOwnerGroup) {}
/* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId) override;
@@ -93,7 +93,7 @@ private:
class dSndSourceEnemyMultiBase_c : public dSndSourceEnemyAnimBase_c {
public:
dSndSourceEnemyMultiBase_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceEnemyMultiBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceEnemyAnimBase_c(sourceType, ac, name, pOwnerGroup) {
nw4r::ut::List_Init(&mSubSourceList, 0x14C);
mAnimSound.setCallback(this);
@@ -157,13 +157,13 @@ private:
class dSndSourceEnemyMulti_c : public dSndSourceEnemyMultiBase_c {
public:
dSndSourceEnemyMulti_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceEnemyMulti_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceEnemyMultiBase_c(sourceType, ac, name, pOwnerGroup) {}
/* 0x18C */ virtual void postCalc() override;
private:
};
#endif
+2
View File
@@ -33,6 +33,7 @@ enum SoundSourceType_e {
// 32-42: Object? (3)
SND_SOURCE_OBJECT = 32,
SND_SOURCE_OBJECT_33 = 33,
SND_SOURCE_BAMBOO = 34,
SND_SOURCE_ITEM = 35,
SND_SOURCE_TERRY_SHOP = 36,
@@ -50,6 +51,7 @@ enum SoundSourceType_e {
SND_SOURCE_NPC_NUSI = 46,
SND_SOURCE_NPC_HEAD = 48,
SND_SOURCE_INSECT = 49,
SND_SOURCE_NPC_50 = 50,
SND_SOURCE_NPC_NRM = 51,
SND_SOURCE_NPC_DRAGON = 52,
+2 -2
View File
@@ -5,7 +5,7 @@
class dSndSourceEquipment_c : public dSoundSource_c {
public:
dSndSourceEquipment_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
dSndSourceEquipment_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
/* 0x040 */ virtual void shutdown() override;
/* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId) override;
@@ -30,7 +30,7 @@ private:
class dSndSourceEquipmentWhip_c : public dSndSourceEquipment_c {
public:
dSndSourceEquipmentWhip_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
dSndSourceEquipmentWhip_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
/* 0x1CC */ virtual void postCalc() override;
};
+4
View File
@@ -37,6 +37,10 @@ public:
void set(s32 type, const char *name);
void calc();
const char *getName() const {
return mName;
}
private:
bool setParamFromName(const char *name);
void resetSoundSourceParam();
+2 -2
View File
@@ -5,7 +5,7 @@
class dSndSourceHarpRelated_c : public dSoundSource_c {
public:
dSndSourceHarpRelated_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
dSndSourceHarpRelated_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
virtual ~dSndSourceHarpRelated_c();
/* 0x18C */ virtual void postCalc() override;
@@ -24,7 +24,7 @@ private:
class dSndSourceHarpTg_c : public dSndSourceHarpRelated_c {
public:
dSndSourceHarpTg_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceHarpTg_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceHarpRelated_c(sourceType, ac, name, pOwnerGroup) {}
private:
+1 -1
View File
@@ -27,7 +27,7 @@ struct dSndSoundCtxParam {
/** An abstract interface for sound relating to a particular actor. */
class dSoundSourceIf_c {
public:
static dSoundSourceIf_c *create(u32 id, dAcBase_c *actor, const char *name, u8 subtype);
static dSoundSourceIf_c *create(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype);
virtual ~dSoundSourceIf_c() {}
+8 -2
View File
@@ -16,7 +16,7 @@ class dSndSourceMgr_c {
public:
dSndSourceMgr_c();
static dSoundSource_c *createSource(u32 id, dAcBase_c *actor, const char *name, u8 subtype);
static dSoundSource_c *createSource(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype);
void registerSource(dSoundSource_c *source);
void unregisterSource(dSoundSource_c *source);
@@ -59,10 +59,16 @@ public:
private:
static bool isCertainEnemyType(dSoundSource_c *source);
static bool isAnimSoundSource(s32 sourceType, const char *name);
static bool isMultiSoundSource(s32 sourceType, const char *name);
void removeSourceFromList(dSoundSource_c *source, nw4r::ut::List *list);
void clearSourceLists();
void clearSourceList(nw4r::ut::List *list);
dSndSourceGroup_c *findGroup(s32 sourceType, dAcBase_c *actor, const char *name, const char *origName, u8 subtype);
bool fn_803846D0(s32 sourceType, const char *name, u8 subtype);
/* 0x0010 */ u8 field_0x0010;
/* 0x0011 */ u8 field_0x0011;
/* 0x0012 */ u8 field_0x0012;
@@ -75,7 +81,7 @@ private:
/* 0x003C */ dSndSourceGroup_c mGroups[NUM_GROUPS];
// Not sure what these are for
/* 0x383C */ nw4r::ut::List mAllSources; // node offset 0xE8, -> dSoundSource::mMgrLink
/* 0x383C */ nw4r::ut::List mAllSources; // node offset 0xE8, -> dSoundSource::mMgrLink
/* 0x3848 */ nw4r::ut::List field_0x3848; // node offset 0x15C, -> dSndSourceEnemy_c::mMgrEnemyLink
/* 0x3854 */ nw4r::ut::List field_0x3854; // node offset 0x160
+3 -3
View File
@@ -8,7 +8,7 @@
// so this is the base class and also instantiated in createSource
class dSndSourceNpc_c : public dSoundSource_c {
public:
dSndSourceNpc_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceNpc_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup) {}
/* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override;
@@ -24,7 +24,7 @@ private:
class dSndSourceNpcAnimBase_c : public dSndSourceNpc_c {
public:
dSndSourceNpcAnimBase_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceNpcAnimBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceNpc_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {}
/* 0x1A8 */ virtual StartResult
@@ -59,7 +59,7 @@ private:
class dSndSourceNpcAnim_c : public dSndSourceNpcAnimBase_c {
public:
dSndSourceNpcAnim_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceNpcAnim_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceNpcAnimBase_c(sourceType, ac, name, pOwnerGroup) {}
private:
+20
View File
@@ -0,0 +1,20 @@
#ifndef D_SND_SOURCE_NPC_HEAD_H
#define D_SND_SOURCE_NPC_HEAD_H
#include "common.h"
#include "d/snd/d_snd_source.h"
class dSndSourceNpcHead_c : public dSoundSource_c {
public:
dSndSourceNpcHead_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
void setMainName(const char *name) {
mpMainName = name;
}
private:
/* 0x15C */ UNKWORD field_0x15C;
/* 0x160 */ const char *mpMainName;
};
#endif
+21
View File
@@ -0,0 +1,21 @@
#ifndef D_SND_SOURCE_NPC_SPECIAL_H
#define D_SND_SOURCE_NPC_SPECIAL_H
#include "common.h"
#include "d/snd/d_snd_source_npc.h"
class dSndSourceNpcSpecial_c : public dSndSourceNpcAnimBase_c {
public:
dSndSourceNpcSpecial_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
private:
};
class dSndSourceNpcDr_c : public dSndSourceNpcSpecial_c {
public:
dSndSourceNpcDr_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
private:
};
#endif
+4 -4
View File
@@ -8,7 +8,7 @@
class dSndSourceObj_c : public dSoundSource_c {
public:
dSndSourceObj_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceObj_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup) {}
/* 0x188 */ virtual void postSetup() override;
@@ -29,7 +29,7 @@ private:
class dSndSourceObjLightShaft_c : public dSndSourceObj_c {
public:
dSndSourceObjLightShaft_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceObjLightShaft_c(s32 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;
@@ -37,7 +37,7 @@ public:
class dSndSourceObjAnimBase_c : public dSndSourceObj_c {
public:
dSndSourceObjAnimBase_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceObjAnimBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceObj_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {}
/* 0x1A8 */ virtual StartResult
@@ -72,7 +72,7 @@ protected:
class dSndSourceObjAnim_c : public dSndSourceObjAnimBase_c {
public:
dSndSourceObjAnim_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceObjAnim_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceObjAnimBase_c(sourceType, ac, name, pOwnerGroup) {}
};
+1 -1
View File
@@ -5,7 +5,7 @@
class dSndSourceObjClef_c : public dSndSourceObj_c {
public:
dSndSourceObjClef_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceObjClef_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {}
bool startTadtoneSound(u32 groupIdx, u32 noteIdx);
+11
View File
@@ -0,0 +1,11 @@
#ifndef D_SND_SOURCE_PLAYER_H
#define D_SND_SOURCE_PLAYER_H
#include "d/snd/d_snd_source_anim_sound.h"
class dSndSourcePlayer_c : public dSndSourceAnimSound_c {
public:
dSndSourcePlayer_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
};
#endif
+11
View File
@@ -0,0 +1,11 @@
#ifndef D_SND_SOURCE_PLAYER_HEAD_H
#define D_SND_SOURCE_PLAYER_HEAD_H
#include "d/snd/d_snd_source.h"
class dSndSourcePlayerHead_c : public dSoundSource_c {
public:
dSndSourcePlayerHead_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
};
#endif
+1 -1
View File
@@ -5,7 +5,7 @@
class dSndSourcePyBird_c : public dSndSourceAnimSound_c {
public:
dSndSourcePyBird_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourcePyBird_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceAnimSound_c(sourceType, ac, name, pOwnerGroup), mSeqVarValue(0) {}
/* 0x104 */ virtual void load(void *data, const char *name) override;
+11
View File
@@ -0,0 +1,11 @@
#ifndef D_SND_SOURCE_TG_SOUND_H
#define D_SND_SOURCE_TG_SOUND_H
#include "d/snd/d_snd_source.h"
class dSndSourceTgSound_c : public dSoundSource_c {
public:
dSndSourceTgSound_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup);
};
#endif
+4
View File
@@ -10,6 +10,10 @@ inline bool streq(const char *left, const char *right) {
return !std::strcmp(left, right);
}
inline bool strneq(const char *left, const char *right, size_t len) {
return !std::strncmp(left, right, len);
}
// This list setup is convenient, and it allows declaring local variables in
// a consistent order without causing regswaps when multiple loops are involved
// in a single funcion.
+1 -1
View File
@@ -29,7 +29,7 @@ public:
mpSource->calc(*mpPosPtr);
}
bool initSource(u8 sourceType, const char *name, const mVec3_c *posPtr);
bool initSource(s32 sourceType, const char *name, const mVec3_c *posPtr);
bool startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position);
};
+1 -1
View File
@@ -10,7 +10,7 @@
#include <cmath>
dSnd3DActor_c::dSnd3DActor_c(dSndSourceParam *pSourceParam, u8 sourceType)
dSnd3DActor_c::dSnd3DActor_c(dSndSourceParam *pSourceParam, s32 sourceType)
: nw4r::snd::Sound3DActor(
dSndPlayerMgr_c::GetInstance()->getSoundArchivePlayerForType(sourceType),
dSnd3DManager_c::GetInstance()->getManager()
+2 -2
View File
@@ -112,14 +112,14 @@ u32 dSndPlayerMgr_c::convertLabelStringToSoundId(const char *label) const {
return dSndMgr_c::GetInstance()->changeNameToId(label);
}
nw4r::snd::SoundArchivePlayer &dSndPlayerMgr_c::getSoundArchivePlayerForType(u8 sourceType) {
nw4r::snd::SoundArchivePlayer &dSndPlayerMgr_c::getSoundArchivePlayerForType(s32 sourceType) {
if (canUseThisPlayer(sourceType)) {
return mSoundArchivePlayer;
}
return dSndMgr_c::getPlayer();
}
bool dSndPlayerMgr_c::canUseThisPlayer(u8 sourceType) const {
bool dSndPlayerMgr_c::canUseThisPlayer(s32 sourceType) const {
if (!mSoundArchivePlayer.IsAvailable()) {
return false;
}
+4 -4
View File
@@ -33,14 +33,14 @@
static dSndSoundCtxParam sCtxParams;
bool dSoundSource_c::sIsStartingBaseSound;
dSoundSourceIf_c *dSoundSourceIf_c::create(u32 id, dAcBase_c *actor, const char *name, u8 subtype) {
return dSndSourceMgr_c::createSource(id, actor, name, subtype);
dSoundSourceIf_c *dSoundSourceIf_c::create(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype) {
return dSndSourceMgr_c::createSource(sourceType, actor, name, subtype);
}
dSoundSource_c::dSoundSource_c(u8 sourceType, dAcBase_c *actor, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSoundSource_c::dSoundSource_c(s32 sourceType, dAcBase_c *actor, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSnd3DActor_c(pOwnerGroup->getAmbientParam(), sourceType),
mpName(name),
field_0x0F4(0),
mpOrigName(nullptr),
mpActor(actor),
mSourceType(sourceType),
mSubtype(0),
+1 -1
View File
@@ -7,7 +7,7 @@
#include "d/snd/d_snd_source_mgr.h"
#include "d/snd/d_snd_wzsound.h"
dSndSourceEnemy_c::dSndSourceEnemy_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
dSndSourceEnemy_c::dSndSourceEnemy_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup), field_0x164(2), field_0x168(0), field_0x169(0) {
if ((SoundSourceType_e)sourceType < SND_SOURCE_ENEMY_28) {
dSndSourceMgr_c::GetInstance()->incrementEnemyCount();
+2 -2
View File
@@ -8,7 +8,7 @@
#include "d/snd/d_snd_wzsound.h"
dSndSourceEquipment_c::dSndSourceEquipment_c(
u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup
s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup
)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup) {}
@@ -137,7 +137,7 @@ u32 dSndSourceEquipment_c::overrideHitObjSoundId(u32 soundId, dSoundSource_c *so
}
dSndSourceEquipmentWhip_c::dSndSourceEquipmentWhip_c(
u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup
s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup
)
: dSndSourceEquipment_c(sourceType, ac, name, pOwnerGroup) {}
+1 -1
View File
@@ -3,7 +3,7 @@
#include "d/snd/d_snd_source.h"
dSndSourceHarpRelated_c::dSndSourceHarpRelated_c(
u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup
s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup
)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup) {
// TODO
+215 -14
View File
@@ -1,24 +1,45 @@
#include "d/snd/d_snd_source_mgr.h"
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/snd/d_snd_player_mgr.h"
#include "d/snd/d_snd_source.h"
// clang-format off
#include "d/snd/d_snd_source_e_spark.h"
#include "d/snd/d_snd_source_enums.h"
#include "d/snd/d_snd_source_equipment.h"
#include "d/snd/d_snd_source_group.h"
#include "d/snd/d_snd_source_py_bird.h"
#include "d/snd/d_snd_source_enemy.h"
#include "d/snd/d_snd_source_obj_clef.h"
#include "d/snd/d_snd_source_obj.h"
#include "d/snd/d_snd_source_npc.h"
#include "d/snd/d_snd_source_harp_related.h"
#include "d/snd/d_snd_source_demo.h"
#include "d/snd/d_snd_source_player.h"
#include "d/snd/d_snd_source_player_head.h"
#include "d/snd/d_snd_source_npc_head.h"
#include "d/snd/d_snd_source_npc_special.h"
#include "d/snd/d_snd_source_tg_sound.h"
// clang-format on
#include "d/snd/d_snd_state_mgr.h"
#include "d/snd/d_snd_util.h"
#include "nw4r/ut/ut_list.h"
#include "sized_string.h"
#include <cmath>
// TODO move
struct ActorBaseNamePair {
const char *variant;
const char *base;
};
extern "C" const ActorBaseNamePair Actor_BaseActorName_Pairs[];
extern "C" const s32 lbl_8057E394;
s32 dSndSourceMgr_c::getSourceCategoryForSourceType(s32 sourceType, const char *name) {
// This might be a full-on switch statement but I don't want to write out
// all the unknown entries yet and this matches anyway
@@ -58,20 +79,201 @@ s32 dSndSourceMgr_c::getSourceCategoryForSourceType(s32 sourceType, const char *
}
}
dSoundSource_c *dSndSourceMgr_c::createSource(u32 id, dAcBase_c *actor, const char *name, u8 subtype) {
// TODO
new dSndSourceESpark_c(0, actor, name, nullptr);
new dSndSourceEnemyAnim_c(0, actor, name, nullptr);
new dSndSourceEnemyMulti_c(0, actor, name, nullptr);
new dSndSourceObjAnim_c(0, actor, name, nullptr);
new dSndSourceObjClef_c(0, actor, name, nullptr);
new dSndSourcePyBird_c(0, actor, name, nullptr);
new dSndSourceNpc_c(0, actor, name, nullptr);
new dSndSourceNpcAnimBase_c(0, actor, name, nullptr);
new dSndSourceNpcAnim_c(0, actor, name, nullptr);
new dSndSourceHarpTg_c(0, actor, name, nullptr);
dSoundSource_c *dSndSourceMgr_c::createSource(s32 sourceType, dAcBase_c *actor, const char *name, u8 _subtype) {
if (actor == nullptr) {
return nullptr;
}
return nullptr;
u8 subtype = actor->subtype;
SizedString<64> nameStr;
nameStr.sprintf("%s", name);
bool isModified = false;
if (dSndStateMgr_c::GetInstance()->isInDemo() != nullptr && strneq(name, "$act", 4)) {
nameStr.sprintf("%s_%s", name + 1, dSndStateMgr_c::GetInstance()->getCurrentStageMusicDemoName());
isModified = true;
}
dSoundSource_c *existingSource = static_cast<dSoundSource_c *>(actor->getSoundSource());
if (!isModified) {
bool allowSubtype = true;
switch (sourceType) {
case SND_SOURCE_BIGBOSS:
nameStr = "BBigBos";
isModified = true;
break;
case SND_SOURCE_GIRAHUMU_3:
nameStr = "BGh3";
isModified = true;
break;
case SND_SOURCE_NPC_HEAD:
if (existingSource != nullptr) {
name = existingSource->getName();
nameStr.sprintf("%sHead", name);
allowSubtype = false;
}
break;
}
if (strneq(name, "NpcMole", 7)) {
if (subtype != 0) {
nameStr = "NpcMoT";
subtype = 0;
isModified = true;
}
} else if (strneq(name, "NpcMoT2", 7)) {
nameStr = "NpcMoT";
isModified = true;
} else if (strneq(name, "NpcMoN2", 7)) {
nameStr = "NpcMoN";
isModified = true;
} else if (strneq(name, "NpcMoEN", 7)) {
nameStr = "NpcMole";
subtype = 0;
isModified = true;
} else if (strneq(name, "NpcMoS", 6)) {
nameStr = "NpcMoE1";
isModified = true;
}
if (allowSubtype && subtype != 0) {
nameStr.sprintf("%s_A%d", &nameStr, subtype);
isModified = true;
}
if (sourceType == SND_SOURCE_NPC_NRM) {
const ActorBaseNamePair *pair = Actor_BaseActorName_Pairs;
for (int i = 0; i < lbl_8057E394; i++) {
if (streq(nameStr, Actor_BaseActorName_Pairs[i].variant)) {
nameStr = Actor_BaseActorName_Pairs[i].base;
isModified = true;
break;
}
}
}
}
const char *actualName = nameStr;
s32 category = getSourceCategoryForSourceType(sourceType, actualName);
dSndSourceGroup_c *group = nullptr;
if (category != SND_SOURCE_CATEGORY_9) {
if (isModified) {
group = GetInstance()->findGroup(sourceType, actor, actualName, name, subtype);
} else {
group = GetInstance()->findGroup(sourceType, actor, actualName, nullptr, subtype);
}
actualName = group->getName();
}
s32 sourceCategory = getSourceCategoryForSourceType(sourceType, actualName);
dSoundSource_c *newSource = nullptr;
bool isAnimSource = isAnimSoundSource(sourceType, actualName);
bool isMultiSource = isMultiSoundSource(sourceType, actualName);
bool isDemo = dSndPlayerMgr_c::GetInstance()->canUseThisPlayer(sourceType);
if (isDemo) {
newSource = new dSndSourceDemo_c(sourceType, actor, actualName, group);
}
if (newSource == nullptr) {
switch (sourceCategory) {
case SND_SOURCE_CATEGORY_PLAYER:
if (sourceType == SND_SOURCE_PLAYER_HEAD) {
newSource = new dSndSourcePlayerHead_c(sourceType, actor, actualName, group);
} else {
newSource = new dSndSourcePlayer_c(sourceType, actor, actualName, group);
}
break;
case SND_SOURCE_CATEGORY_ENEMY:
if (sourceType == SND_SOURCE_SPARK) {
newSource = new dSndSourceESpark_c(sourceType, actor, actualName, group);
} else if (isAnimSource) {
if (isMultiSource) {
newSource = new dSndSourceEnemyMulti_c(sourceType, actor, actualName, group);
} else {
newSource = new dSndSourceEnemyAnim_c(sourceType, actor, actualName, group);
}
} else {
newSource = new dSndSourceEnemy_c(sourceType, actor, actualName, group);
}
break;
case SND_SOURCE_CATEGORY_OBJECT:
if (sourceType == SND_SOURCE_OBJECT_33) {
return nullptr;
}
if (sourceType == SND_SOURCE_LIGHT_SHAFT) {
newSource = new dSndSourceObjLightShaft_c(sourceType, actor, actualName, group);
} else if (sourceType == SND_SOURCE_CLEF) {
newSource = new dSndSourceObjClef_c(sourceType, actor, actualName, group);
} else if (isAnimSource) {
newSource = new dSndSourceObjAnim_c(sourceType, actor, actualName, group);
} else {
newSource = new dSndSourceObj_c(sourceType, actor, actualName, group);
}
break;
case SND_SOURCE_CATEGORY_EQUIPMENT:
if (sourceType == SND_SOURCE_WHIP) {
newSource = new dSndSourceEquipmentWhip_c(sourceType, actor, actualName, group);
} else {
newSource = new dSndSourceEquipment_c(sourceType, actor, actualName, group);
}
break;
case SND_SOURCE_CATEGORY_NPC:
if (sourceType == SND_SOURCE_NPC_HEAD) {
newSource = new dSndSourceNpcHead_c(sourceType, actor, actualName, group);
} else if (sourceType == SND_SOURCE_NPC_DRAGON) {
newSource = new dSndSourceNpcDr_c(sourceType, actor, actualName, group);
} else if (sourceType >= SND_SOURCE_NPC_50) {
newSource = new dSndSourceNpcSpecial_c(sourceType, actor, actualName, group);
} else if (sourceType == SND_SOURCE_PLAYER_BIRD) {
newSource = new dSndSourcePyBird_c(sourceType, actor, actualName, group);
} else if (isAnimSource) {
newSource = new dSndSourceNpcAnim_c(sourceType, actor, actualName, group);
} else {
newSource = new dSndSourceNpc_c(sourceType, actor, actualName, group);
}
break;
case SND_SOURCE_CATEGORY_TG_SOUND:
newSource = new dSndSourceTgSound_c(sourceType, actor, actualName, group);
break;
case SND_SOURCE_CATEGORY_HARP_RELATED:
// TODO
new dSndSourceHarpTg_c(0, actor, name, nullptr);
break;
case SND_SOURCE_CATEGORY_7: newSource = new dSndSourceDemo_c(sourceType, actor, actualName, group); break;
default:
if (sourceType < SND_SOURCE_59 + 1) {
GetInstance()->fn_803846D0(sourceType, actualName, subtype);
}
return nullptr;
}
}
if (newSource == nullptr) {
return nullptr;
}
newSource->setSubtype(subtype);
newSource->setup();
if (!streq(name, actualName)) {
newSource->setOrigName(name);
}
if (sourceType == SND_SOURCE_NPC_HEAD) {
if (existingSource != nullptr && strneq(existingSource->getName(), "NpcMoT", 6)) {
static_cast<dSndSourceNpcHead_c *>(newSource)->setMainName(existingSource->getName());
} else if (existingSource != nullptr && streq(name, "NpcGrd")) {
static_cast<dSndSourceNpcHead_c *>(newSource)->setMainName("NpcGra");
}
}
if (existingSource != nullptr && existingSource != newSource && sourceType != SND_SOURCE_NPC_HEAD && existingSource->isMultiSource()) {
existingSource->registerAdditionalSource(newSource);
}
return newSource;
}
SND_DISPOSER_DEFINE(dSndSourceMgr_c);
@@ -223,7 +425,6 @@ s32 dSndSourceMgr_c::getPlayerSourceRoomId() const {
return mpPlayerSource->getRoomId();
}
struct dSndSourceMgrEmptySinit {
dSndSourceMgrEmptySinit() {}
};
+1 -1
View File
@@ -13,7 +13,7 @@ SoundInfo::~SoundInfo() {
}
}
bool SoundInfo::initSource(u8 sourceType, const char *name, const mVec3_c *posPtr) {
bool SoundInfo::initSource(s32 sourceType, const char *name, const mVec3_c *posPtr) {
mpSource = dSoundSourceIf_c::create(sourceType, mpActor, name, 0);
if (mpSource == nullptr) {
return false;