mirror of
https://github.com/zeldaret/ss
synced 2026-05-26 23:47:22 -04:00
d_snd_id_mappers OK
This commit is contained in:
@@ -2810,6 +2810,7 @@ d/snd/d_snd_source_demo.cpp:
|
||||
d/snd/d_snd_source_harp_related.cpp:
|
||||
.text start:0x80390A20 end:0x80392E38 align:16
|
||||
.data start:0x8054C9C0 end:0x8054D1C0
|
||||
.sdata2 start:0x8057DDE8 end:0x8057DE30
|
||||
|
||||
d/snd/d_snd_source_tg_sound.cpp:
|
||||
.text start:0x80392E40 end:0x80393008 align:16
|
||||
@@ -2818,6 +2819,13 @@ d/snd/d_snd_source_tg_sound.cpp:
|
||||
|
||||
d/snd/d_snd_id_mappers.cpp:
|
||||
.text start:0x80393010 end:0x803934A8 align:16
|
||||
.data start:0x8054D3B0 end:0x8054D400
|
||||
.sdata start:0x80574818 end:0x80574830
|
||||
.sdata2 start:0x8057DE30 end:0x8057DEB8
|
||||
|
||||
d/snd/d_snd_id_mappers_data.cpp:
|
||||
.rodata start:0x804F39B8 end:0x804F3E38
|
||||
.sdata2 start:0x8057DEB8 end:0x8057E398
|
||||
|
||||
d/snd/d_snd_distant_sound_actor_pool.cpp:
|
||||
.text start:0x803934B0 end:0x80393DF4 align:16
|
||||
@@ -2851,12 +2859,15 @@ d/snd/d_snd_se_sound_pool.cpp:
|
||||
|
||||
d/snd/d_snd_sound_link_body_callbacks.cpp:
|
||||
.text start:0x80394DE0 end:0x803957B8 align:16
|
||||
.sdata start:0x80574830 end:0x80574860
|
||||
|
||||
d/snd/d_snd_sound_enemy_callbacks.cpp:
|
||||
.text start:0x803957C0 end:0x80396104 align:16
|
||||
.sdata start:0x80574860 end:0x80574898
|
||||
|
||||
d/snd/d_snd_sound_object_callbacks.cpp:
|
||||
.text start:0x80396110 end:0x80398430 align:16
|
||||
.sdata start:0x80574898 end:0x805748D8
|
||||
|
||||
d/snd/d_snd_sound_equipment_callbacks.cpp:
|
||||
.text start:0x80398430 end:0x80398AD4 align:16
|
||||
@@ -2870,9 +2881,11 @@ d/snd/d_snd_sound_npc_callbacks.cpp:
|
||||
|
||||
d/snd/d_snd_sound_npc_2_callbacks.cpp:
|
||||
.text start:0x80398E20 end:0x80398FFC align:16
|
||||
.sdata start:0x805748E0 end:0x805748E8
|
||||
|
||||
d/snd/d_snd_sound_tgsound_callbacks.cpp:
|
||||
.text start:0x80399000 end:0x8039942C align:16
|
||||
.sdata start:0x805748E8 end:0x805748F0
|
||||
|
||||
d/snd/d_snd_mgr_unk_17.cpp:
|
||||
.text start:0x80399430 end:0x80399574 align:16
|
||||
|
||||
+11
-11
@@ -20559,7 +20559,7 @@ getFanSoundHandleForFan2__12dSndBgmMgr_cFUl = .text:0x803734C0; // type:function
|
||||
isCurrentlyPlayingFanSound__12dSndBgmMgr_cCFUl = .text:0x80373550; // type:function size:0x110
|
||||
hasPlayingFanSounds__12dSndBgmMgr_cCFv = .text:0x80373660; // type:function size:0xC8
|
||||
stopFanSounds__12dSndBgmMgr_cFl = .text:0x80373730; // type:function size:0x68
|
||||
fn_803737A0 = .text:0x803737A0; // type:function size:0x108
|
||||
calcStopOldBgmSounds__12dSndBgmMgr_cFv = .text:0x803737A0; // type:function size:0x108
|
||||
registSound__12dSndBgmMgr_cFP11dSndSound_c = .text:0x803738B0; // type:function size:0x4C
|
||||
unregistSound__12dSndBgmMgr_cFP11dSndSound_c = .text:0x80373900; // type:function size:0x4C
|
||||
isSoundRegist__12dSndBgmMgr_cFP11dSndSound_c = .text:0x80373950; // type:function size:0x7C
|
||||
@@ -21434,13 +21434,13 @@ preCalc__19dSndSourceTgSound_cFv = .text:0x80392F80; // type:function size:0x4 s
|
||||
__dt__19dSndSourceTgSound_cFv = .text:0x80392F90; // type:function size:0x58 scope:weak
|
||||
@88@__dt__19dSndSourceTgSound_cFv = .text:0x80392FF0; // type:function size:0x8 scope:weak
|
||||
@4@__dt__19dSndSourceTgSound_cFv = .text:0x80393000; // type:function size:0x8 scope:weak
|
||||
fn_80393010 = .text:0x80393010; // type:function size:0x98
|
||||
fn_803930B0 = .text:0x803930B0; // type:function size:0xD0
|
||||
fn_80393180 = .text:0x80393180; // type:function size:0x64
|
||||
fn_803931F0 = .text:0x803931F0; // type:function size:0xDC
|
||||
fn_803932D0 = .text:0x803932D0; // type:function size:0x64
|
||||
fn_80393340 = .text:0x80393340; // type:function size:0xC8
|
||||
fn_80393410 = .text:0x80393410; // type:function size:0x64
|
||||
getBaseVariant__FPCc = .text:0x80393010; // type:function size:0x98
|
||||
getGrpId__FlPCc = .text:0x803930B0; // type:function size:0xD0
|
||||
getGrpId__FP17dSndSourceGroup_c = .text:0x80393180; // type:function size:0x64
|
||||
getBnkSeId__FlPCc = .text:0x803931F0; // type:function size:0xDC
|
||||
getBnkSeId__FP17dSndSourceGroup_c = .text:0x803932D0; // type:function size:0x64
|
||||
getSeId__FlPCc = .text:0x80393340; // type:function size:0xC8
|
||||
getSeId__FP17dSndSourceGroup_c = .text:0x80393410; // type:function size:0x64
|
||||
getHitEffectName__FUl = .text:0x80393480; // type:function size:0x28
|
||||
__dt__45SndMgrDisposer<27dSndDistantSoundActorPool_c>Fv = .text:0x803934B0; // type:function size:0x78 scope:weak
|
||||
create__45SndMgrDisposer<27dSndDistantSoundActorPool_c>Fv = .text:0x80393530; // type:function size:0x48 scope:weak
|
||||
@@ -29055,7 +29055,7 @@ lbl_804F3A48 = .rodata:0x804F3A48; // type:object size:0xC
|
||||
lbl_804F3A54 = .rodata:0x804F3A54; // type:object size:0xC
|
||||
lbl_804F3A60 = .rodata:0x804F3A60; // type:object size:0xC
|
||||
lbl_804F3A6C = .rodata:0x804F3A6C; // type:object size:0xC
|
||||
Actor_BaseActorName_Pairs = .rodata:0x804F3A78; // type:object size:0x3C0 data:4byte
|
||||
sActorBaseNamePairs = .rodata:0x804F3A78; // type:object size:0x3C0 data:4byte
|
||||
lbl_804F3E38 = .rodata:0x804F3E38; // type:object size:0x4C0
|
||||
lbl_804F42F8 = .rodata:0x804F42F8; // type:object size:0x480
|
||||
lbl_804F4778 = .rodata:0x804F4778; // type:object size:0x788 align:4 data:float
|
||||
@@ -38105,7 +38105,7 @@ __vt__23dSndSourceHarpObjWarp_c = .data:0x8054CDC8; // type:object size:0x1FC
|
||||
__vt__23dSndSourceHarpRelated_c = .data:0x8054CFC4; // type:object size:0x1FC
|
||||
__vt__19dSndSourceTgSound_c = .data:0x8054D1C0; // type:object size:0x1EC
|
||||
lbl_8054D3B0 = .data:0x8054D3B0; // type:object size:0xC
|
||||
lbl_8054D3BC = .data:0x8054D3BC; // type:object size:0x44
|
||||
sSndHitEffects = .data:0x8054D3BC; // type:object size:0x44
|
||||
__vt__45SndMgrDisposer<27dSndDistantSoundActorPool_c> = .data:0x8054D400; // type:object size:0xC scope:weak
|
||||
__vt__23dSndDistantSoundActor_c = .data:0x8054D410; // type:object size:0x60
|
||||
__vt__13dSndSeSound_c = .data:0x8054D470; // type:object size:0x14
|
||||
@@ -49445,7 +49445,7 @@ lbl_8057E378 = .sdata2:0x8057E378; // type:object size:0x8 data:string
|
||||
lbl_8057E380 = .sdata2:0x8057E380; // type:object size:0x8 data:string
|
||||
lbl_8057E388 = .sdata2:0x8057E388; // type:object size:0x8 data:string
|
||||
lbl_8057E390 = .sdata2:0x8057E390; // type:object size:0x4 data:string
|
||||
lbl_8057E394 = .sdata2:0x8057E394; // type:object size:0x4 data:4byte
|
||||
sNumActorBaseNamePairs = .sdata2:0x8057E394; // type:object size:0x4 data:4byte
|
||||
@4479 = .sdata2:0x8057E398; // type:object size:0x4 scope:local align:4 data:float
|
||||
@4480 = .sdata2:0x8057E39C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@4481 = .sdata2:0x8057E3A0; // type:object size:0x4 scope:local align:4 data:float
|
||||
|
||||
+2
-1
@@ -779,7 +779,8 @@ config.libs = [
|
||||
Object(NonMatching, "d/snd/d_snd_source_demo.cpp"),
|
||||
Object(NonMatching, "d/snd/d_snd_source_harp_related.cpp"),
|
||||
Object(Matching, "d/snd/d_snd_source_tg_sound.cpp"),
|
||||
Object(NonMatching, "d/snd/d_snd_id_mappers.cpp"),
|
||||
Object(Matching, "d/snd/d_snd_id_mappers.cpp"),
|
||||
Object(Matching, "d/snd/d_snd_id_mappers_data.cpp"),
|
||||
Object(Matching, "d/snd/d_snd_distant_sound_actor_pool.cpp"),
|
||||
Object(Matching, "d/snd/d_snd_distant_sound_actor.cpp"),
|
||||
Object(Matching, "d/snd/d_snd_se_sound.cpp"),
|
||||
|
||||
@@ -87,6 +87,7 @@ private:
|
||||
bool stopBgmHandleIdx(u32 handleIdx, s32 fadeFrames);
|
||||
|
||||
void calcLists();
|
||||
void calcStopOldBgmSounds();
|
||||
|
||||
void addToBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound);
|
||||
void appendToBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound);
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
#define D_SND_ID_MAPPERS_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/snd/d_snd_types.h"
|
||||
|
||||
u32 getGrpId(dSndSourceGroup_c *pGroup);
|
||||
u32 getBnkSeId(dSndSourceGroup_c *pGroup);
|
||||
u32 getSeId(dSndSourceGroup_c *pGroup);
|
||||
|
||||
// TODO move somewhere else, or maybe remove entirely
|
||||
// could plausibly belong in d/col/bg
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef D_SND_ID_MAPPERS_DATA_H
|
||||
#define D_SND_ID_MAPPERS_DATA_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
struct ActorBaseNamePair {
|
||||
const char *variant;
|
||||
const char *base;
|
||||
};
|
||||
|
||||
extern const ActorBaseNamePair sActorBaseNamePairs[];
|
||||
extern const s32 sNumActorBaseNamePairs;
|
||||
|
||||
extern const char *sSndHitEffects[];
|
||||
|
||||
#endif
|
||||
@@ -196,6 +196,10 @@ public:
|
||||
return mIsRunning || mIsPreparing || IsAttachedSound();
|
||||
}
|
||||
|
||||
bool isPaused() const {
|
||||
return mPauseFlag;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool isRunning() const {
|
||||
return mIsRunning && IsAttachedSound();
|
||||
|
||||
@@ -41,6 +41,14 @@ public:
|
||||
return mName;
|
||||
}
|
||||
|
||||
const char *getOrigName() const {
|
||||
return mpOrigName;
|
||||
}
|
||||
|
||||
s32 getField_0x10() const {
|
||||
return field_0x10;
|
||||
}
|
||||
|
||||
bool isActive() const {
|
||||
return mIsActive;
|
||||
}
|
||||
@@ -56,13 +64,13 @@ private:
|
||||
|
||||
/* 0x00 */ nw4r::ut::Node mNode1;
|
||||
/* 0x08 */ nw4r::ut::Node mNode2;
|
||||
/* 0x10 */ UNKWORD field_0x10;
|
||||
/* 0x10 */ s32 field_0x10;
|
||||
/* 0x14 */ s32 mSourceCategory;
|
||||
/* 0x18 */ s32 mSubtype;
|
||||
/* 0x1C */ bool mIsActive;
|
||||
/* 0x1D */ u8 field_0x1D;
|
||||
/* 0x1E */ SizedString<32> mName;
|
||||
/* 0x40 */ UNKWORD field_0x40;
|
||||
/* 0x40 */ const char *mpOrigName;
|
||||
/* 0x44 */ nw4r::ut::List mSourceList;
|
||||
/* 0x50 */ dSndSourceParam mParam;
|
||||
/* 0x64 */ dSoundSource_c *mpCachedClosestSourceToListener;
|
||||
|
||||
@@ -140,7 +140,7 @@ bool dSndBgmMgr_c::beginBgmBattleRoom() {
|
||||
return false;
|
||||
}
|
||||
|
||||
return playBattleBgm(BGM_BATTLE_ROOM_MAIN, 5);
|
||||
return playBattleBgm(BGM_BATTLE_ROOM_MAIN, true);
|
||||
}
|
||||
|
||||
bool dSndBgmMgr_c::endBgmBattleRoom() {
|
||||
@@ -462,6 +462,28 @@ void dSndBgmMgr_c::stopFanSounds(s32 fadeFrames) {
|
||||
}
|
||||
}
|
||||
|
||||
void dSndBgmMgr_c::calcStopOldBgmSounds() {
|
||||
s32 numPlayingSounds = 0;
|
||||
|
||||
dSndBgmSound_c *it;
|
||||
for (it = getFirstInBgmSoundList(BGM_LIST_PLAYING); it != nullptr;
|
||||
it = getNextInBgmSoundList(BGM_LIST_PLAYING, it)) {
|
||||
if (!it->isPaused() && it->isStrmSound()) {
|
||||
numPlayingSounds++;
|
||||
}
|
||||
}
|
||||
|
||||
// If more than one strm sound is playing, stop all but the first one
|
||||
if (numPlayingSounds >= 2) {
|
||||
for (it = getFirstInBgmSoundList(BGM_LIST_PLAYING); it != nullptr;
|
||||
it = getNextInBgmSoundList(BGM_LIST_PLAYING, it)) {
|
||||
if (!it->isPaused() && it->isStrmSound() && it != getFirstInBgmSoundList(BGM_LIST_PLAYING)) {
|
||||
it->stop(15);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dSndBgmMgr_c::registSound(dSndSound_c *sound) {
|
||||
if (sound == nullptr) {
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
#include "d/snd/d_snd_id_mappers.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/snd/d_snd_mgr.h"
|
||||
#include "d/snd/d_snd_player_mgr.h"
|
||||
#include "d/snd/d_snd_source_group.h"
|
||||
#include "d/snd/d_snd_util.h"
|
||||
#include "d/snd/d_snd_id_mappers_data.h"
|
||||
#include "sized_string.h"
|
||||
|
||||
const char *getBaseVariant(const char *name) {
|
||||
const ActorBaseNamePair *pair = sActorBaseNamePairs;
|
||||
for (int i = 0; i < sNumActorBaseNamePairs; i++) {
|
||||
if (streq(name, sActorBaseNamePairs[i].variant)) {
|
||||
return sActorBaseNamePairs[i].base;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
u32 getGrpId(s32 unk, const char *name) {
|
||||
if (name == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
if (unk < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (unk >= 0x3C) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
SizedString<64> label;
|
||||
label.sprintf("GRP_%s", name);
|
||||
u32 id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label);
|
||||
if (id != -1) {
|
||||
return id;
|
||||
}
|
||||
const char *base = getBaseVariant(name);
|
||||
if (base != nullptr) {
|
||||
label.sprintf("GRP_%s", base);
|
||||
id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label);
|
||||
return id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
u32 getGrpId(dSndSourceGroup_c *pGroup) {
|
||||
if (pGroup == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
u32 id = getGrpId(pGroup->getField_0x10(), pGroup->getName());
|
||||
if (id == -1 && pGroup->getOrigName() != nullptr) {
|
||||
id = getGrpId(pGroup->getField_0x10(), pGroup->getOrigName());
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
u32 getBnkSeId(s32 unk, const char *name) {
|
||||
if (name == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
if (unk < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (unk >= 0x3C) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
SizedString<64> label;
|
||||
label.sprintf("BNK_SE_%s", name);
|
||||
u32 id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToBankId(label);
|
||||
if (id != -1) {
|
||||
return id;
|
||||
}
|
||||
const char *base = getBaseVariant(name);
|
||||
if (base != nullptr) {
|
||||
label.sprintf("BNK_SE_%s", base);
|
||||
id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToBankId(label);
|
||||
return id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
u32 getBnkSeId(dSndSourceGroup_c *pGroup) {
|
||||
if (pGroup == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
u32 id = getBnkSeId(pGroup->getField_0x10(), pGroup->getName());
|
||||
if (id == -1 && pGroup->getOrigName() != nullptr) {
|
||||
id = getBnkSeId(pGroup->getField_0x10(), pGroup->getOrigName());
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
u32 getSeId(s32 unk, const char *name) {
|
||||
if (name == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
if (unk < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (unk >= 0x3C) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
SizedString<64> label;
|
||||
label.sprintf("SE_%s", name);
|
||||
u32 id = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label);
|
||||
if (id != -1) {
|
||||
return id;
|
||||
}
|
||||
const char *base = getBaseVariant(name);
|
||||
if (base != nullptr) {
|
||||
label.sprintf("SE_%s", base);
|
||||
id = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label);
|
||||
return id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
u32 getSeId(dSndSourceGroup_c *pGroup) {
|
||||
if (pGroup == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
u32 id = getSeId(pGroup->getField_0x10(), pGroup->getName());
|
||||
if (id == -1 && pGroup->getOrigName() != nullptr) {
|
||||
id = getSeId(pGroup->getField_0x10(), pGroup->getOrigName());
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
#pragma push
|
||||
#pragma readonly_strings on
|
||||
// TODO could be yet another file
|
||||
const char *sSndHitEffects[] = {
|
||||
"TUTI", "ROCK", "SAND", "GRASS", "TREE", "LAVA", "WATER", "STONE", "LOTUS",
|
||||
"METAL", "NUMA", "TUTA", "LIFE", "CARPET", "QSAND", "WOOD", "DEATH",
|
||||
};
|
||||
|
||||
#pragma pop
|
||||
|
||||
const char *getHitEffectName(u32 polyAttr0) {
|
||||
if (polyAttr0 >= 1 && polyAttr0 < SND_MAT_MAX) {
|
||||
polyAttr0 -= 1;
|
||||
return sSndHitEffects[polyAttr0];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
#include "d/snd/d_snd_id_mappers_data.h"
|
||||
|
||||
#pragma push
|
||||
#pragma readonly_strings on
|
||||
|
||||
const ActorBaseNamePair sActorBaseNamePairs[] = {
|
||||
{ "KinokoA", "Kinoko"},
|
||||
{ "KinokoB", "Kinoko"},
|
||||
{ "KinokoC", "Kinoko"},
|
||||
{ "KinokoD", "Kinoko"},
|
||||
{ "SKinoko", "Kinoko"},
|
||||
{ "Tbox", "TBox"},
|
||||
{ "LBmaker", "LBird"},
|
||||
{ "TansuA", "chest"},
|
||||
{ "TansuB", "chest"},
|
||||
{ "TansuC", "chest"},
|
||||
{ "BbsRock", "RolRock"},
|
||||
{ "NpcRvlR", "NpcBRvl"},
|
||||
{ "NpcMWNi", "NpcSalS_A2"},
|
||||
{ "NpcMHNi", "NpcSalS_A8"},
|
||||
{ "NpcIcgK", "NpcKbn2"},
|
||||
{ "NpcKb2N", "NpcKbn2"},
|
||||
{ "NpcDoNi", "NpcSalS_A1"},
|
||||
{ "NpcJkNi", "NpcSalS_A4"},
|
||||
{ "NpcAzNi", "NpcSalS_A5"},
|
||||
{ "NpcPcs", "NpcCbFd"},
|
||||
{ "NpcAkuH", "NpcAkum"},
|
||||
{ "NpcJkML", "NpcJkMo"},
|
||||
{ "NpcDoML", "NpcDoMo"},
|
||||
{ "NpcSAML", "NpcSAMo"},
|
||||
{"NpcResc_A3", "NpcResc"},
|
||||
{"NpcResc_A4", "NpcResc_A1"},
|
||||
{"NpcResc_A5", "NpcResc_A2"},
|
||||
{ "NpcGrb", "NpcGra"},
|
||||
{ "NpcGrc", "NpcGra"},
|
||||
{ "NpcGrd", "NpcGra"},
|
||||
{ "OcGrsL", "OctGrs"},
|
||||
{ "NpcOkyu", "Npckyu"},
|
||||
{ "Npckyu1", "Npckyu"},
|
||||
{ "Npckyu2", "Npckyu"},
|
||||
{ "Npckyu3", "Npckyu"},
|
||||
{ "Npckyu4", "Npckyu"},
|
||||
{ "NpcSlKy", "Npckyu"},
|
||||
{ "rpiller", "rpillar"},
|
||||
{ "EOc", "EBc"},
|
||||
{ "EBce", "EBc"},
|
||||
{ "CupA00", "tware"},
|
||||
{ "CupA01", "tware"},
|
||||
{ "CupA02", "tware"},
|
||||
{ "CupB00", "tware"},
|
||||
{ "CupB01", "tware"},
|
||||
{ "CupB02", "tware"},
|
||||
{ "PltA00", "tware"},
|
||||
{ "PltA01", "tware"},
|
||||
{ "PltA02", "tware"},
|
||||
{ "PltB00", "tware"},
|
||||
{ "PltB01", "tware"},
|
||||
{ "PltB02", "tware"},
|
||||
{ "FlvsA", "tware"},
|
||||
{ "FlvsB", "tware"},
|
||||
{ "FlvsC", "tware"},
|
||||
{ "PlntA00", "tware"},
|
||||
{ "PlntA01", "tware"},
|
||||
{ "PlntB", "tware"},
|
||||
{ "PlntC00", "tware"},
|
||||
{ "PlntC01", "tware"},
|
||||
{ "ERupGue", "EGue"},
|
||||
{ "BirdNpc", "BirdCommon"},
|
||||
{ "BirdKA", "BirdCommon"},
|
||||
{ "BirdKB", "BirdCommon"},
|
||||
{ "BirdT", "BirdCommon"},
|
||||
{ "NpcBdsw", "BirdCommon"},
|
||||
{ "DbidNpc", "BirdCommon"},
|
||||
{ "KndBird", "BirdCommon"},
|
||||
{ "BrdMob", "BirdCommon"},
|
||||
{ "NpcBdz", "BirdZT"},
|
||||
{ "InsctTg", "Insect"},
|
||||
{ "Ladybug", "Insect"},
|
||||
{ "Drgnfly", "Insect"},
|
||||
{ "Beetle", "Insect"},
|
||||
{ "Kuwagat", "Insect"},
|
||||
{ "Grshpr", "Insect"},
|
||||
{ "Cicada", "Insect"},
|
||||
{ "Ant", "Insect"},
|
||||
{ "Butrfly", "Insect"},
|
||||
{ "Mantis", "Insect"},
|
||||
{ "Scarab", "Insect"},
|
||||
{ "Firefly", "Insect"},
|
||||
{ "BcAlArr", "BcArrow"},
|
||||
{ "FShutte", "FenceIr"},
|
||||
{ "BBigBo2", "BBigBos"},
|
||||
{ "BBigBo3", "BBigBos"},
|
||||
{ "NusiNpc", "Nusi"},
|
||||
{ "NusiB", "Nusi"},
|
||||
{ "NpcMoN2", "NpcMoN"},
|
||||
{ "NpcMoEN", "NpcMole"},
|
||||
{ "NpcMoS", "NpcMoEl"},
|
||||
{ "NpcMoT2", "NpcMoT"},
|
||||
{ "BGh2", "BGh"},
|
||||
{ "BGh3Fst", "BGh3"},
|
||||
{ "BGh3Snd", "BGh3"},
|
||||
{ "BGh3Trd", "BGh3"},
|
||||
{ "NpcSlb2", "NpcSlrb"},
|
||||
{ "NpcSlFB", "NpcSlrb"},
|
||||
{ "NpcSlRp", "NpcSlrb"},
|
||||
{ "NpcSlFl", "NpcSlrb"},
|
||||
{ "FlySlrb", "NpcSlrb"},
|
||||
{ "NpcKenT", "NpcKen"},
|
||||
{ "GuardLg", "SliceLg"},
|
||||
{ "SlicePt", "SliceLg"},
|
||||
{ "TrShtCs", "trlshut"},
|
||||
{ "Fmaker", "Fish"},
|
||||
{ "TgTw", "TWeed"},
|
||||
{ "BltObsT", "Obstacl"},
|
||||
{ "Item_A44", "Item_A43"},
|
||||
{ "Item_A45", "Item_A43"},
|
||||
{ "Item_A46", "Item_A43"},
|
||||
{ "PmpknBd", "Pumpkin"},
|
||||
{ "MgPmpkn", "Pumpkin"},
|
||||
{ "CmCloud", "CumlClud"},
|
||||
{ "IslTreB", "RockSkB"},
|
||||
{ "WnLeafA", "wnleaf"},
|
||||
{ "WnLeafB", "wnleaf"},
|
||||
{ "WnLeafC", "wnleaf"},
|
||||
{ "WnLeafD", "wnleaf"},
|
||||
{ "EOrCann", "EOr"},
|
||||
};
|
||||
|
||||
const s32 sNumActorBaseNamePairs = ARRAY_LENGTH(sActorBaseNamePairs);
|
||||
|
||||
#pragma pop
|
||||
@@ -73,7 +73,7 @@ dSndSourceGroup_c::dSndSourceGroup_c()
|
||||
mIsActive(false),
|
||||
field_0x1D(0),
|
||||
mName(""),
|
||||
field_0x40(0),
|
||||
mpOrigName(nullptr),
|
||||
mpCachedClosestSourceToListener(nullptr),
|
||||
mpCachedClosestSourceToPlayer(nullptr),
|
||||
mCalculatedClosestToListener(false),
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_base.h"
|
||||
#include "d/snd/d_snd_control_player_mgr.h"
|
||||
#include "d/snd/d_snd_id_mappers_data.h"
|
||||
#include "d/snd/d_snd_player_mgr.h"
|
||||
#include "d/snd/d_snd_small_effect_mgr.h"
|
||||
#include "d/snd/d_snd_source.h"
|
||||
@@ -42,14 +43,6 @@
|
||||
// dSndAnimSound_c are reversed compared to their natural vtable order,
|
||||
// and the overridden `SetupSound` function seems to be immune to reordering
|
||||
|
||||
// TODO move
|
||||
struct ActorBaseNamePair {
|
||||
const char *variant;
|
||||
const char *base;
|
||||
};
|
||||
extern "C" const ActorBaseNamePair Actor_BaseActorName_Pairs[];
|
||||
extern "C" const s32 lbl_8057E394;
|
||||
|
||||
bool dSndSourceMgr_c::isAnimSoundSource(s32 sourceType, const char *name) {
|
||||
switch (getSourceCategoryForSourceType(sourceType, name)) {
|
||||
case SND_SOURCE_CATEGORY_PLAYER:
|
||||
@@ -199,10 +192,10 @@ dSoundSourceIf_c *dSndSourceMgr_c::createSource(s32 sourceType, dAcBase_c *actor
|
||||
}
|
||||
|
||||
if (sourceType == SND_SOURCE_NPC_51) {
|
||||
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;
|
||||
const ActorBaseNamePair *pair = sActorBaseNamePairs;
|
||||
for (int i = 0; i < sNumActorBaseNamePairs; i++) {
|
||||
if (streq(nameStr, sActorBaseNamePairs[i].variant)) {
|
||||
nameStr = sActorBaseNamePairs[i].base;
|
||||
isModified = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user