mirror of
https://github.com/zeldaret/ss
synced 2026-06-10 12:55:12 -04:00
Actor sound source cleanup
This commit is contained in:
@@ -124,6 +124,7 @@ toBeSorted/d_effects_2.cpp:
|
||||
|
||||
toBeSorted/sound_info.cpp:
|
||||
.text start:0x8002C130 end:0x8002C3A0 align:16
|
||||
.data start:0x80501528 end:0x80501538
|
||||
|
||||
d/a/d_a_base.cpp:
|
||||
.text start:0x8002C3A0 end:0x8002DE40 align:16
|
||||
|
||||
+20
-20
@@ -1021,11 +1021,11 @@ fn_8002BFB0 = .text:0x8002BFB0; // type:function size:0x54
|
||||
fn_8002C010 = .text:0x8002C010; // type:function size:0x58
|
||||
fn_8002C070 = .text:0x8002C070; // type:function size:0x58
|
||||
fn_8002C0D0 = .text:0x8002C0D0; // type:function size:0x58
|
||||
fn_8002C130 = .text:0x8002C130; // type:function size:0x24
|
||||
__dt__16dSoundSourceIf_cFv = .text:0x8002C160; // type:function size:0x40
|
||||
fn_8002C1A0 = .text:0x8002C1A0; // type:function size:0xB0
|
||||
fn_8002C250 = .text:0x8002C250; // type:function size:0xB8
|
||||
fn_8002C310 = .text:0x8002C310; // type:function size:0x90
|
||||
__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
|
||||
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
|
||||
__dt__7dBase_cFv = .text:0x8002C530; // type:function size:0x58
|
||||
@@ -1069,21 +1069,21 @@ getDistToPlayer__9dAcBase_cFv = .text:0x8002D470; // type:function size:0x30
|
||||
getSquareDistToPlayer__9dAcBase_cFv = .text:0x8002D4A0; // type:function size:0x10
|
||||
updateRoomId__9dAcBase_cFf = .text:0x8002D4B0; // type:function size:0x90
|
||||
isRoomFlags_0x6_Set__9dAcBase_cFv = .text:0x8002D540; // type:function size:0x44
|
||||
FUN_8002d590__9dAcBase_cFv = .text:0x8002D590; // type:function size:0x20
|
||||
setSoundSourceSubtype__9dAcBase_cFUc = .text:0x8002D590; // type:function size:0x20
|
||||
FUN_8002d5b0__9dAcBase_cFv = .text:0x8002D5B0; // type:function size:0x20
|
||||
playSound__9dAcBase_cFUs = .text:0x8002D5D0; // type:function size:0x28
|
||||
FUN_8002d600__9dAcBase_cFv = .text:0x8002D600; // type:function size:0x28
|
||||
FUN_8002d630__9dAcBase_cFv = .text:0x8002D630; // type:function size:0x9C
|
||||
FUN_8002d6d0__9dAcBase_cFv = .text:0x8002D6D0; // type:function size:0x40
|
||||
playSoundEffect1__9dAcBase_cFUs = .text:0x8002D710; // type:function size:0x28
|
||||
FUN_8002d740__9dAcBase_cFv = .text:0x8002D740; // type:function size:0x28
|
||||
FUN_8002d770__9dAcBase_cFUsf = .text:0x8002D770; // type:function size:0x28
|
||||
FUN_8002d7a0__9dAcBase_cFv = .text:0x8002D7A0; // type:function size:0x28
|
||||
FUN_8002d7d0__9dAcBase_cFv = .text:0x8002D7D0; // type:function size:0x20
|
||||
FUN_8002d7f0__9dAcBase_cFv = .text:0x8002D7F0; // type:function size:0x20
|
||||
FUN_8002d810__9dAcBase_cFv = .text:0x8002D810; // type:function size:0x20
|
||||
FUN_8002d830__9dAcBase_cFv = .text:0x8002D830; // type:function size:0x28
|
||||
FUN_8002d860__9dAcBase_cFi = .text:0x8002D860; // type:function size:0x20
|
||||
startSound__9dAcBase_cFUl = .text:0x8002D5D0; // type:function size:0x28
|
||||
startSoundWithFloatParam__9dAcBase_cFUlf = .text:0x8002D600; // type:function size:0x28
|
||||
startBgHitSound__9dAcBase_cFUlRC13cBgS_PolyInfoPC7mVec3_c = .text:0x8002D630; // type:function size:0x9C
|
||||
startSoundAtPosition__9dAcBase_cFUlPC7mVec3_c = .text:0x8002D6D0; // type:function size:0x40
|
||||
holdSound__9dAcBase_cFUl = .text:0x8002D710; // type:function size:0x28
|
||||
holdSoundWithIntParam__9dAcBase_cFUll = .text:0x8002D740; // type:function size:0x28
|
||||
holdSoundWithFloatParam__9dAcBase_cFUlf = .text:0x8002D770; // type:function size:0x28
|
||||
holdSoundWithParams__9dAcBase_cFUlfl = .text:0x8002D7A0; // type:function size:0x28
|
||||
onSoundSourceFlag2__9dAcBase_cFUl = .text:0x8002D7D0; // type:function size:0x20
|
||||
onSoundSourceFlag1__9dAcBase_cFUl = .text:0x8002D7F0; // type:function size:0x20
|
||||
offSoundSourceFlag1__9dAcBase_cFUl = .text:0x8002D810; // type:function size:0x20
|
||||
isPlayingSound__9dAcBase_cFUl = .text:0x8002D830; // type:function size:0x28
|
||||
setBattleBgmRelated__9dAcBase_cFi = .text:0x8002D860; // type:function size:0x20
|
||||
getSoundSource__9dAcBase_cFv = .text:0x8002D880; // type:function size:0x8
|
||||
removeSoundInfo__9dAcBase_cFP9SoundInfo = .text:0x8002D890; // type:function size:0x88
|
||||
setActorRef__9dAcBase_cFP9dAcBase_c = .text:0x8002D920; // type:function size:0x8
|
||||
@@ -29993,7 +29993,7 @@ lbl_8050140C = .data:0x8050140C; // type:object size:0xB4
|
||||
lbl_805014C0 = .data:0x805014C0; // type:object size:0x28
|
||||
lbl_805014E8 = .data:0x805014E8; // type:object size:0x18
|
||||
lbl_80501500 = .data:0x80501500; // type:object size:0x28
|
||||
lbl_80501528 = .data:0x80501528; // type:object size:0x10
|
||||
__vt__9SoundInfo = .data:0x80501528; // type:object size:0xC
|
||||
@19465 = .data:0x80501538; // type:object size:0xC data:string
|
||||
__vt__9dAcBase_c = .data:0x80501544; // type:object size:0x74
|
||||
ActorObjectBase__vtable = .data:0x805015B8; // type:object size:0x80
|
||||
|
||||
+1
-1
@@ -410,7 +410,7 @@ config.libs = [
|
||||
Object(Matching, "d/d_light_env.cpp"),
|
||||
Object(NonMatching, "toBeSorted/d_emitter.cpp"),
|
||||
Object(NonMatching, "toBeSorted/d_effects_2.cpp"),
|
||||
Object(NonMatching, "toBeSorted/sound_info.cpp"),
|
||||
Object(Matching, "toBeSorted/sound_info.cpp"),
|
||||
Object(NonMatching, "d/a/d_a_base.cpp"),
|
||||
Object(NonMatching, "d/a/obj/d_a_obj_base.cpp"),
|
||||
Object(NonMatching, "d/a/e/d_a_e_base.cpp"),
|
||||
|
||||
+19
-25
@@ -9,18 +9,10 @@
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/actor_info.h"
|
||||
#include "toBeSorted/raii_ptr.h"
|
||||
#include "toBeSorted/tlist.h"
|
||||
#include "toBeSorted/sound_info.h"
|
||||
|
||||
class dAcBase_c;
|
||||
struct cBgS_PolyInfo;
|
||||
|
||||
struct SoundInfo {
|
||||
dAcBase_c *actor;
|
||||
dSoundSourceIf_c *sound_source;
|
||||
mVec3_c *obj_pos;
|
||||
TListNode<SoundInfo> mLink;
|
||||
};
|
||||
|
||||
/**
|
||||
* A list node that will automatically unlink upon destruction.
|
||||
*/
|
||||
@@ -67,10 +59,12 @@ public:
|
||||
// non-official name
|
||||
class dAcBase_c : public dBase_c {
|
||||
public:
|
||||
typedef TList<SoundInfo, 12> SoundInfoList;
|
||||
|
||||
/* 0x68 */ mHeapAllocator_c heap_allocator;
|
||||
/* 0x84 */ const ActorInfo *mpActorInfo;
|
||||
/* 0x88 */ TList<SoundInfo, 12> sound_list;
|
||||
/* 0x94 */ RaiiPtr<dSoundSourceIf_c> sound_source;
|
||||
/* 0x88 */ SoundInfoList sound_list;
|
||||
/* 0x94 */ RaiiPtr<dSoundSourceIf_c> mpSoundSource;
|
||||
/* 0x98 */ mVec3_c *obj_pos;
|
||||
/* 0x9C */ mVec3_c pos_copy;
|
||||
/* 0xA8 */ u32 params2;
|
||||
@@ -213,21 +207,21 @@ public:
|
||||
/* 8002d540 */ bool isRoomFlags_0x6_Set();
|
||||
|
||||
// Start of SoundSource stuff
|
||||
/* 8002d590 */ void FUN_8002d590();
|
||||
/* 8002d590 */ void setSoundSourceSubtype(u8 subType);
|
||||
/* 8002d5b0 */ void FUN_8002d5b0();
|
||||
/* 8002d5d0 */ void playSound(u16 effect);
|
||||
/* 8002d600 */ void FUN_8002d600();
|
||||
/* 8002d630 */ void FUN_8002d630();
|
||||
/* 8002d6d0 */ void FUN_8002d6d0();
|
||||
/* 8002d710 */ void playSoundEffect1(u16 effect);
|
||||
/* 8002d740 */ void FUN_8002d740();
|
||||
/* 8002d770 */ void FUN_8002d770(u16, f32);
|
||||
/* 8002d7a0 */ void FUN_8002d7a0();
|
||||
/* 8002d7d0 */ void FUN_8002d7d0();
|
||||
/* 8002d7f0 */ void FUN_8002d7f0();
|
||||
/* 8002d810 */ void FUN_8002d810();
|
||||
/* 8002d830 */ void FUN_8002d830();
|
||||
/* 8002d860 */ void FUN_8002d860(UNKWORD val);
|
||||
/* 8002d5d0 */ bool startSound(u32 soundId);
|
||||
/* 8002d600 */ bool startSoundWithFloatParam(u32 soundId, f32 param);
|
||||
/* 8002d630 */ bool startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position);
|
||||
/* 8002d6d0 */ bool startSoundAtPosition(u32 soundId, const mVec3_c *position);
|
||||
/* 8002d710 */ bool holdSound(u32 soundId);
|
||||
/* 8002d740 */ bool holdSoundWithIntParam(u32 soundId, s32 param);
|
||||
/* 8002d770 */ bool holdSoundWithFloatParam(u32 soundId, f32 param);
|
||||
/* 8002d7a0 */ bool holdSoundWithParams(u32 soundId, f32 fValue, s32 value);
|
||||
/* 8002d7d0 */ void onSoundSourceFlag2(u32 mask);
|
||||
/* 8002d7f0 */ void onSoundSourceFlag1(u32 mask);
|
||||
/* 8002d810 */ void offSoundSourceFlag1(u32 mask);
|
||||
/* 8002d830 */ bool isPlayingSound(u32 soundId);
|
||||
/* 8002d860 */ void setBattleBgmRelated(UNKWORD val);
|
||||
/* 8002d880 */ dSoundSourceIf_c *getSoundSource();
|
||||
// End of SoundSource stuff
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef SOUND_INFO_H
|
||||
#define SOUND_INFO_H
|
||||
|
||||
#include "m/m_vec.h"
|
||||
#include "d/snd/d_snd_source_if.h"
|
||||
#include "toBeSorted/raii_ptr.h"
|
||||
#include "toBeSorted/tlist.h"
|
||||
|
||||
class dAcBase_c;
|
||||
class cBgS_PolyInfo;
|
||||
|
||||
class SoundInfo {
|
||||
private:
|
||||
/* 0x00 */ dAcBase_c *mpActor;
|
||||
/* 0x04 */ RaiiPtr<dSoundSourceIf_c> mpSource;
|
||||
/* 0x08 */ const mVec3_c *mpPosPtr;
|
||||
/* 0x0C */ TListNode<SoundInfo> mLink;
|
||||
|
||||
public:
|
||||
SoundInfo(dAcBase_c *ac);
|
||||
/* vtable at 0x14 */
|
||||
virtual ~SoundInfo();
|
||||
|
||||
dSoundSourceIf_c *getSource() {
|
||||
return mpSource.get();
|
||||
}
|
||||
|
||||
void calc() {
|
||||
mpSource->calc(*mpPosPtr);
|
||||
}
|
||||
|
||||
bool initSource(u8 sourceType, const char *name, const mVec3_c *posPtr);
|
||||
bool startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -190,9 +190,9 @@ void dAcBombf_c::executeState_Wait() {
|
||||
|
||||
if (mTimeAreaStruct.check(roomid, checkPos, 0, 30.0f, 0.1f) && field_0x3D4 != 1) {
|
||||
if (mTimeAreaStruct.field_0x04 == 1) {
|
||||
playSound(SE_TIMESLIP_TIMESLIP);
|
||||
startSound(SE_TIMESLIP_TIMESLIP);
|
||||
} else {
|
||||
playSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
startSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
}
|
||||
dJEffManager_c::spawnEffect(lbl_8057A750, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
}
|
||||
|
||||
+12
-12
@@ -310,7 +310,7 @@ int dAcEsm_c::actorPostCreate() {
|
||||
if (field_0xBBF == 1 || field_0xBBF == 3) {
|
||||
clearActorProperty(1);
|
||||
fn_800306d0();
|
||||
FUN_8002d860(0);
|
||||
setBattleBgmRelated(0);
|
||||
}
|
||||
|
||||
return SUCCEEDED;
|
||||
@@ -391,10 +391,10 @@ int dAcEsm_c::actorExecute() {
|
||||
dJEffManager_c::spawnEffect(effectID, mEffPos, nullptr, &effScale, nullptr, nullptr, 0, 0);
|
||||
|
||||
if (timeCheck > 0) {
|
||||
playSound(SE_TIMESLIP_TIMESLIP);
|
||||
startSound(SE_TIMESLIP_TIMESLIP);
|
||||
fn_800306d0();
|
||||
} else {
|
||||
playSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
startSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
fn_80030700();
|
||||
}
|
||||
}
|
||||
@@ -441,7 +441,7 @@ int dAcEsm_c::actorExecute() {
|
||||
field_0xBB8 = 0;
|
||||
}
|
||||
field_0xBBF = 0;
|
||||
FUN_8002d860(2);
|
||||
setBattleBgmRelated(2);
|
||||
fn_80030700();
|
||||
rotation.y = angle.y = getXZAngleToPlayer();
|
||||
}
|
||||
@@ -555,7 +555,7 @@ int dAcEsm_c::actorExecute() {
|
||||
fn_187_4540(2);
|
||||
} else {
|
||||
mHealth = 100;
|
||||
playSound(SE_ESm_NO_DMG);
|
||||
startSound(SE_ESm_NO_DMG);
|
||||
fn_187_61B0(7);
|
||||
}
|
||||
|
||||
@@ -615,7 +615,7 @@ int dAcEsm_c::actorExecute() {
|
||||
pOther->field_0xBC8 = 1;
|
||||
pOther->mDamageTimer = 8;
|
||||
pOther->mStateMgr.changeState(StateID_Fusion);
|
||||
playSound(SE_ESm_UNITE);
|
||||
startSound(SE_ESm_UNITE);
|
||||
mStateMgr.changeState(StateID_Fusion);
|
||||
}
|
||||
}
|
||||
@@ -634,7 +634,7 @@ int dAcEsm_c::actorExecute() {
|
||||
if (bomb != nullptr && std::abs(bomb->GetPosition().y - mHomePos1.y) < 0.7f * lookRadius) {
|
||||
if (bomb->GetLinkage().tryAttach(bomb, this, &mBombRef, dLinkage_c::CONNECTION_1, false)) {
|
||||
mTimer_0xBAE = 160;
|
||||
playSound(SE_ESm_BRING_IN);
|
||||
startSound(SE_ESm_BRING_IN);
|
||||
clearActorProperty(1);
|
||||
}
|
||||
}
|
||||
@@ -664,7 +664,7 @@ int dAcEsm_c::actorExecute() {
|
||||
|
||||
mSph.SetC(mHomePos1);
|
||||
if (mSph.ChkTgElectric()) {
|
||||
playSoundEffect1(SE_ESm_ELEC_LV);
|
||||
holdSound(SE_ESm_ELEC_LV);
|
||||
}
|
||||
|
||||
radius *= mScaleTarget.x;
|
||||
@@ -683,9 +683,9 @@ int dAcEsm_c::actorExecute() {
|
||||
sLib::addCalcScaled(&field_0xB80, 0.3f, 1.f);
|
||||
|
||||
if (field_0xBCB == 0) {
|
||||
playSoundEffect1(SE_ESm_MOVE);
|
||||
holdSound(SE_ESm_MOVE);
|
||||
} else {
|
||||
playSoundEffect1(SE_ESm_MOVE_HI);
|
||||
holdSound(SE_ESm_MOVE_HI);
|
||||
}
|
||||
|
||||
if (field_0xBC8 == 0 && !mStateMgr.isState(StateID_Absorption)) {
|
||||
@@ -867,7 +867,7 @@ bool dAcEsm_c::fn_187_4090() {
|
||||
field_0xB50 = 0.f;
|
||||
field_0xB70 = 0.f;
|
||||
|
||||
playSound(SE_ESm_LAND);
|
||||
startSound(SE_ESm_LAND);
|
||||
|
||||
if (field_0xBA0 == 0) {
|
||||
if (fn_800301b0(position, rotation.y, true, 10.f) == 3 /* TODO: Enum?*/) {
|
||||
@@ -1081,7 +1081,7 @@ void dAcEsm_c::fn_187_4540(int param0) {
|
||||
if (field_0xB98 == 2) {
|
||||
mTimer_0xBC4 = 20;
|
||||
}
|
||||
playSound(SE_ESm_JUMP);
|
||||
startSound(SE_ESm_JUMP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "nw4r/types_nw4r.h"
|
||||
#include "toBeSorted/area_utils.h"
|
||||
|
||||
@@ -94,7 +95,7 @@ void dAcOappearBridge_c::initializeState_Appear() {
|
||||
mSrtAnm.setRate(sMovementRate, 0);
|
||||
mClrAnm.setRate(sMovementRate, 0);
|
||||
dBgS::GetInstance()->Regist(&mCollision, this);
|
||||
playSound(0xAA4);
|
||||
startSound(SE_ApBridg_APPEAR_LV);
|
||||
}
|
||||
void dAcOappearBridge_c::executeState_Appear() {
|
||||
mClrAnm.isStop(0); // ?
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "d/col/cc/d_cc_s.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 "m/m3d/m_fanm.h"
|
||||
#include "m/m_angle.h"
|
||||
@@ -226,7 +227,7 @@ void dAcODungeonShip_c::executeState_Wait() {
|
||||
field_0x863 = 0;
|
||||
field_0x864 = 0x8C;
|
||||
mAppearEvent = field_0x849;
|
||||
playSound(0xB62);
|
||||
startSound(SE_d2ship_APPEAR);
|
||||
mStateMgr.changeState(StateID_AppearEvent);
|
||||
} else {
|
||||
fn_485_1BF0();
|
||||
@@ -244,7 +245,7 @@ void dAcODungeonShip_c::executeState_Transparency() {
|
||||
field_0x863 = 0;
|
||||
field_0x855 = 0;
|
||||
mNumTimesHit++;
|
||||
playSound(0xB62);
|
||||
startSound(SE_d2ship_APPEAR);
|
||||
} else if (mNumTimesHit == 2) {
|
||||
field_0x863 = 0;
|
||||
mNumTimesHit++;
|
||||
@@ -252,7 +253,7 @@ void dAcODungeonShip_c::executeState_Transparency() {
|
||||
mAppearEvent = mAppearEventFromParam;
|
||||
field_0x8D8 = 1;
|
||||
mStateMgr.changeState(StateID_AppearEvent);
|
||||
playSound(0xB62);
|
||||
startSound(SE_d2ship_APPEAR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "d/col/c/c_m3d_g_lin.h"
|
||||
#include "d/col/cc/d_cc_s.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "egg/math/eggMath.h"
|
||||
#include "m/m3d/m3d.h"
|
||||
#include "m/m_angle.h"
|
||||
@@ -1116,7 +1117,7 @@ void dAcOivyRope_c::fn_256_E3E0() {
|
||||
mField_0x1030 = 60;
|
||||
mStateMgr.changeState(StateID_RopeReturn);
|
||||
fn_256_DEE0();
|
||||
playSound(0xB76 /* HANGDOWN */);
|
||||
startSound(SE_IvyRope_HANGDOWN);
|
||||
}
|
||||
} break;
|
||||
case 4: {
|
||||
|
||||
@@ -93,9 +93,9 @@ void dAcOTowerGearD101_c::executeState_Wait() {
|
||||
mAng newRotation = diff * scale5 / 2400.0f;
|
||||
if (newRotation != mCurrRotation) {
|
||||
if (mPreviousTurnSpeed == 0) {
|
||||
playSound(SE_TGrD101_ROLL_START);
|
||||
startSound(SE_TGrD101_ROLL_START);
|
||||
} else {
|
||||
playSoundEffect1(SE_TGrD101_ROLL_LV);
|
||||
holdSound(SE_TGrD101_ROLL_LV);
|
||||
playVisualEffect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "d/col/bg/d_bg_w.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "f/f_base.h"
|
||||
#include "m/m3d/m_fanm.h"
|
||||
#include "m/m_angle.h"
|
||||
@@ -597,7 +598,7 @@ void dAcOTowerHandD101_c::initializeState_Close() {
|
||||
mMdl.getAnm().setPlayState(m3d::PLAY_MODE_1);
|
||||
mMdl.setRate(getCloseRate());
|
||||
mEffects.createEffect(PARTICLE_RESOURCE_ID_MAPPING_573_, position, nullptr, nullptr, nullptr, nullptr);
|
||||
playSound(0xC0C);
|
||||
startSound(SE_TowerHa_CLENCH);
|
||||
}
|
||||
void dAcOTowerHandD101_c::executeState_Close() {
|
||||
dAcPy_c *link = dAcPy_c::LINK;
|
||||
@@ -649,7 +650,7 @@ void dAcOTowerHandD101_c::initializeState_Open() {
|
||||
mMdl.getAnm().setPlayState(m3d::PLAY_MODE_3);
|
||||
mMdl.setRate(getOpenRate());
|
||||
}
|
||||
playSound(0xC0D);
|
||||
startSound(SE_TowerHa_OPEN);
|
||||
}
|
||||
void dAcOTowerHandD101_c::executeState_Open() {
|
||||
dAcPy_c *link = dAcPy_c::LINK;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/math/math_arithmetic.h"
|
||||
#include "s/s_Math.h"
|
||||
@@ -74,7 +75,7 @@ void dAcOtrapRock1_c::initializeState_TrapAction() {
|
||||
field_0x5A0 = 0x2000;
|
||||
field_0x5A5 = 1;
|
||||
field_0x5A2 = 0x2D8;
|
||||
playSound(0xB0E);
|
||||
startSound(SE_TrapRc1_TRAP_ACTION);
|
||||
}
|
||||
|
||||
void dAcOtrapRock1_c::executeState_TrapAction() {
|
||||
|
||||
@@ -217,7 +217,7 @@ void dAcOtubo_c::executeState_Wait() {
|
||||
dJEffManager_c::spawnGroundEffect(position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
}
|
||||
if (mbField_0x9F3) {
|
||||
playSound(SE_Tubo_PUT);
|
||||
startSound(SE_Tubo_PUT);
|
||||
mbField_0x9F3 = false;
|
||||
}
|
||||
if (checkOnLava()) {
|
||||
@@ -226,7 +226,7 @@ void dAcOtubo_c::executeState_Wait() {
|
||||
position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0
|
||||
);
|
||||
}
|
||||
playSound(SE_O_FALL_LAVA_S);
|
||||
startSound(SE_O_FALL_LAVA_S);
|
||||
}
|
||||
}
|
||||
} else if (mObjAcch.ChkGndHit()) {
|
||||
@@ -467,7 +467,7 @@ void dAcOtubo_c::destroy() {
|
||||
fx_thing->bindShpEmitter(mSubtype != 0 ? dJEffManager_c::TsuboB : dJEffManager_c::TsuboA, false);
|
||||
}
|
||||
|
||||
playSound(SE_Tubo_BREAK);
|
||||
startSound(SE_Tubo_BREAK);
|
||||
|
||||
if (mSceneflag < 0xFF && !checkSceneflag()) {
|
||||
SceneflagManager::sInstance->setFlag(roomid, mSceneflag);
|
||||
@@ -607,7 +607,7 @@ void dAcOtubo_c::fn_272_2670() {
|
||||
cLib::addCalcPosXZ(&velocity, mVec3_c::Zero, 0.05f, 1.0f, 0.2f);
|
||||
forwardSpeed = EGG::Math<f32>::sqrt(velocity.x * velocity.x + velocity.z * velocity.z);
|
||||
if (!noSound) {
|
||||
playSound(SE_O_FALL_WATER_S);
|
||||
startSound(SE_O_FALL_WATER_S);
|
||||
}
|
||||
mbSubmerged = true;
|
||||
} else {
|
||||
@@ -855,7 +855,7 @@ void dAcOtubo_c::playRollSound() {
|
||||
return;
|
||||
}
|
||||
|
||||
FUN_8002d770(SE_Tubo_ROLL_LV, forwardSpeed);
|
||||
holdSoundWithFloatParam(SE_Tubo_ROLL_LV, forwardSpeed);
|
||||
}
|
||||
|
||||
void float_order() {
|
||||
|
||||
@@ -144,7 +144,7 @@ int dAcOTumbleWeed_c::actorExecute() {
|
||||
dCcS::GetInstance()->Set(&mSph);
|
||||
updateMatrix();
|
||||
calcMatrix();
|
||||
playSoundEffect1(0xC2C); // TODO(Sound Id)
|
||||
holdSound(SE_TWeed_ROLL_LV);
|
||||
mMdl.setLocalMtx(mWorldMtx);
|
||||
mMdl.setScale(mScale);
|
||||
mMdl.calc(false);
|
||||
@@ -262,7 +262,7 @@ bool dAcOTumbleWeed_c::checkInvalidGround() const {
|
||||
}
|
||||
|
||||
void dAcOTumbleWeed_c::doBreak() {
|
||||
playSound(SE_TWeed_CUT);
|
||||
startSound(SE_TWeed_CUT);
|
||||
mVec3_c pos = getPosition();
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_743_, pos, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
deleteRequest();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/g3d/res/g3d_resanmclr.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
@@ -109,7 +110,7 @@ void dAcOUgSwitch_c::executeState_Active() {
|
||||
if (mVariant == 0 && !SceneflagManager::sInstance->checkBoolFlag(roomid, mActiveSceneFlag)) {
|
||||
if (isWithinPlayerRadius(sActivationRadius) && dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_CRAWLING)) {
|
||||
mOnEventTimer = sEventTimer;
|
||||
playSound(0xB12);
|
||||
startSound(SE_UgSwitc_ON_ZERO);
|
||||
mStateMgr.changeState(StateID_On);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +118,7 @@ void dAcOUgSwitch_c::executeState_Active() {
|
||||
if (!SceneflagManager::sInstance->checkBoolFlag(roomid, field_0x3BD)) {
|
||||
if (isWithinPlayerRadius(sActivationRadius) && dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_CRAWLING)) {
|
||||
mOnEventTimer = sEventTimer;
|
||||
playSound(0xB13);
|
||||
startSound(SE_UgSwitc_ON);
|
||||
mStateMgr.changeState(StateID_On);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "d/a/obj/d_a_obj_utajima_main_mecha.h"
|
||||
#include "d/col/bg/d_bg_s.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"
|
||||
@@ -105,17 +106,17 @@ void dAcOutajimaIsland_c::executeState_Wait() {
|
||||
|
||||
if (mPlaySound) {
|
||||
if (mRingLayer == 1) {
|
||||
playSoundEffect1(0xC6E);
|
||||
holdSound(SE_UtaLand_MoveA);
|
||||
} else if (mRingLayer == 2) {
|
||||
playSoundEffect1(0xC6F);
|
||||
holdSound(SE_UtaLand_MoveB);
|
||||
} else if (mRingLayer == 3) {
|
||||
playSoundEffect1(0xC70);
|
||||
holdSound(SE_UtaLand_MoveC);
|
||||
}
|
||||
|
||||
if (mOldPosition == position) {
|
||||
mPlaySound = false;
|
||||
if (mParam2 == 0 && !sPlatformsSettled) {
|
||||
playSound(0xC71);
|
||||
startSound(SE_UtaLand_StopOK);
|
||||
sPlatformsSettled = true;
|
||||
}
|
||||
}
|
||||
|
||||
+152
-40
@@ -11,6 +11,7 @@
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
#include "d/snd/d_snd_source.h"
|
||||
#include "egg/core/eggAllocator.h"
|
||||
#include "egg/math/eggMath.h"
|
||||
#include "f/f_base.h"
|
||||
@@ -38,13 +39,11 @@ dAcBase_c *dAcBase_c::s_Create_Parent;
|
||||
const ActorInfo *dAcBase_c::s_Create_ActorInfo;
|
||||
u8 dAcBase_c::s_Create_Subtype;
|
||||
|
||||
extern "C" dSoundSourceIf_c *soundForActorInitRelated_803889c0(s8, fBase_c *, const char *, u8);
|
||||
|
||||
bool dAcBase_c::createHeap() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// sound_source and sound_list need to be ironed out before this can match
|
||||
// mpSoundSource and sound_list need to be ironed out before this can match
|
||||
// NOT MATCHING
|
||||
// 8002c3b0
|
||||
dAcBase_c::dAcBase_c()
|
||||
@@ -90,7 +89,7 @@ dAcBase_c::dAcBase_c()
|
||||
// 8002c530
|
||||
// dBase_c::~dBase_c() {}
|
||||
|
||||
// Fixing the sound_source and sound_info in the ctor should make this match
|
||||
// Fixing the mpSoundSource and sound_info in the ctor should make this match
|
||||
// NOT MATCHING
|
||||
// 8002c590
|
||||
dAcBase_c::~dAcBase_c() {}
|
||||
@@ -122,7 +121,7 @@ dSoundSourceIf_c *dAcBase_c::createSoundSource() {
|
||||
}
|
||||
|
||||
const char *actorName = getActorName(mpActorInfo);
|
||||
return soundForActorInitRelated_803889c0(soundSourceType, this, actorName, subtype);
|
||||
return dSoundSource_c::create(soundSourceType, this, actorName, subtype);
|
||||
}
|
||||
|
||||
int dAcBase_c::initAllocatorWork1Heap(int size, char *name, int align) {
|
||||
@@ -133,7 +132,7 @@ int dAcBase_c::initAllocator(int size, char *name, EGG::Heap *heap, int align) {
|
||||
if (!heap_allocator.createFrmHeapToCurrent(size, heap, name, 0x20, mHeap::OPT_NONE)) {
|
||||
return 0;
|
||||
}
|
||||
sound_source = createSoundSource();
|
||||
mpSoundSource = createSoundSource();
|
||||
int success = createHeap();
|
||||
heap_allocator.adjustFrmHeapRestoreCurrent();
|
||||
return success;
|
||||
@@ -192,7 +191,10 @@ void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
|
||||
// NOT MATCHING
|
||||
// 8002c940
|
||||
int dAcBase_c::preDelete() {
|
||||
int fbaseDelete = fBase_c::preDelete();
|
||||
int ret = SUCCEEDED;
|
||||
if (fBase_c::preDelete() == NOT_READY) {
|
||||
ret = NOT_READY;
|
||||
}
|
||||
|
||||
if (!checkActorProperty(0x800) && checkActorProperty(0x10000000) &&
|
||||
fBase_c::getConnectParent()->lifecycle_state != TO_BE_DELETED) {
|
||||
@@ -201,29 +203,39 @@ int dAcBase_c::preDelete() {
|
||||
}
|
||||
|
||||
} else {
|
||||
if (sound_source != nullptr) {
|
||||
// TODO: add func call
|
||||
if (mpSoundSource != nullptr) {
|
||||
mpSoundSource->stopAllSound(0);
|
||||
}
|
||||
// TODO - TList
|
||||
for (SoundInfoList::Iterator it = sound_list.GetBeginIter(); it != sound_list.GetEndIter(); ++it) {
|
||||
it->getSource()->stopAllSound(0);
|
||||
}
|
||||
|
||||
// TODO: add sound_info stuff once the SoundInfo x Heap weirdness is figured out
|
||||
}
|
||||
|
||||
if (fbaseDelete == 0) {
|
||||
return false;
|
||||
if (ret == NOT_READY) {
|
||||
return NOT_READY;
|
||||
}
|
||||
|
||||
if (sound_source != nullptr) {
|
||||
// TODO: add func calls
|
||||
return false;
|
||||
if (mpSoundSource != nullptr) {
|
||||
mpSoundSource->shutdown();
|
||||
if (mpSoundSource->hasPlayingSounds()) {
|
||||
return NOT_READY;
|
||||
}
|
||||
}
|
||||
// TODO - TList
|
||||
for (SoundInfoList::Iterator it = sound_list.GetBeginIter(); it != sound_list.GetEndIter(); ++it) {
|
||||
it->getSource()->shutdown();
|
||||
if (it->getSource()->hasPlayingSounds()) {
|
||||
return NOT_READY;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: add sound_info stuff once the SoundInfo x Heap weirdness is figured out
|
||||
|
||||
if (checkActorProperty(0x20000000)) {
|
||||
if (checkActorProperty(0x02000000)) {
|
||||
changeLoadedEntitiesNoSet();
|
||||
}
|
||||
|
||||
return true;
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
// 8002cb10
|
||||
@@ -263,9 +275,20 @@ int dAcBase_c::actorExecuteInEvent() {
|
||||
return actorExecute();
|
||||
}
|
||||
|
||||
// Can't make progress on this til the SoundInfo x Heap weirdness is figured out
|
||||
// 8002ccc0
|
||||
void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {}
|
||||
void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {
|
||||
if (mpSoundSource != nullptr) {
|
||||
mpSoundSource->calc(*obj_pos);
|
||||
mpSoundSource->setPolyAttrs(polyAttr0, polyAttr1);
|
||||
}
|
||||
|
||||
// TODO - TList
|
||||
for (SoundInfoList::Iterator it = sound_list.GetBeginIter(); it != sound_list.GetEndIter(); ++it) {
|
||||
it->calc();
|
||||
}
|
||||
|
||||
// TODO - ...
|
||||
}
|
||||
|
||||
// 8002ce90
|
||||
void dAcBase_c::unkVirtFunc_0x5C() {
|
||||
@@ -494,29 +517,118 @@ bool dAcBase_c::isRoomFlags_0x6_Set() {
|
||||
return (room->checkFlag(0x4 | 0x2));
|
||||
}
|
||||
|
||||
// Start of SoundSource stuff
|
||||
void dAcBase_c::FUN_8002d590() {}
|
||||
void dAcBase_c::FUN_8002d5b0() {}
|
||||
void dAcBase_c::playSound(u16) {}
|
||||
void dAcBase_c::FUN_8002d600() {}
|
||||
void dAcBase_c::FUN_8002d630() {}
|
||||
void dAcBase_c::FUN_8002d6d0() {}
|
||||
// currently named ActorBase__playSoundEffect1
|
||||
void dAcBase_c::playSoundEffect1(u16) {}
|
||||
void dAcBase_c::FUN_8002d740() {}
|
||||
void dAcBase_c::FUN_8002d770(u16, f32) {}
|
||||
void dAcBase_c::FUN_8002d7a0() {}
|
||||
void dAcBase_c::FUN_8002d7d0() {}
|
||||
void dAcBase_c::FUN_8002d7f0() {}
|
||||
void dAcBase_c::FUN_8002d810() {}
|
||||
void dAcBase_c::FUN_8002d830() {}
|
||||
void dAcBase_c::FUN_8002d860(UNKWORD) {}
|
||||
void dAcBase_c::setSoundSourceSubtype(u8 subType) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpSoundSource->setSubtype(subType);
|
||||
}
|
||||
|
||||
void dAcBase_c::FUN_8002d5b0() {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpSoundSource->vt_0x0F0_noop();
|
||||
}
|
||||
|
||||
bool dAcBase_c::startSound(u32 soundId) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->startSound(soundId);
|
||||
}
|
||||
|
||||
bool dAcBase_c::startSoundWithFloatParam(u32 soundId, f32 param) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->startSoundWithFloatParam(soundId, param);
|
||||
}
|
||||
|
||||
bool dAcBase_c::startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->startBgHitSound(
|
||||
soundId, dBgS::GetInstance()->GetPolyAtt0(info), dBgS::GetInstance()->GetPolyAtt1(info),
|
||||
position != nullptr ? position : &this->position
|
||||
);
|
||||
}
|
||||
|
||||
bool dAcBase_c::startSoundAtPosition(u32 soundId, const mVec3_c *position) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->startSoundAtPosition(soundId, position != nullptr ? position : &this->position);
|
||||
}
|
||||
|
||||
bool dAcBase_c::holdSound(u32 soundId) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->holdSound(soundId);
|
||||
}
|
||||
|
||||
bool dAcBase_c::holdSoundWithIntParam(u32 soundId, s32 param) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->holdSoundWithIntParam(soundId, param);
|
||||
}
|
||||
|
||||
bool dAcBase_c::holdSoundWithFloatParam(u32 soundId, f32 param) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->holdSoundWithFloatParam(soundId, param);
|
||||
}
|
||||
|
||||
bool dAcBase_c::holdSoundWithParams(u32 soundId, f32 fValue, s32 value) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->holdSoundWithParams(soundId, fValue, value);
|
||||
}
|
||||
|
||||
void dAcBase_c::onSoundSourceFlag2(u32 mask) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpSoundSource->onFlag2(mask);
|
||||
}
|
||||
|
||||
void dAcBase_c::onSoundSourceFlag1(u32 mask) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpSoundSource->onFlag1(mask);
|
||||
}
|
||||
|
||||
void dAcBase_c::offSoundSourceFlag1(u32 mask) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpSoundSource->offFlag1(mask);
|
||||
}
|
||||
|
||||
bool dAcBase_c::isPlayingSound(u32 soundId) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return mpSoundSource->isPlayingSound(soundId);
|
||||
}
|
||||
|
||||
void dAcBase_c::setBattleBgmRelated(UNKWORD param) {
|
||||
if (mpSoundSource == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpSoundSource->setBattleBgmRelated(param);
|
||||
}
|
||||
|
||||
// 8002d880
|
||||
dSoundSourceIf_c *dAcBase_c::getSoundSource() {
|
||||
return sound_source.get();
|
||||
return mpSoundSource.get();
|
||||
}
|
||||
// End of SoundSource stuff
|
||||
|
||||
// 8002d890
|
||||
void dAcBase_c::removeSoundInfo(SoundInfo *soundInfo) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
void dAcOInsect_c::kill() {
|
||||
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_394_, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
|
||||
playSound(SE_Insect_DISAPPEAR);
|
||||
startSound(SE_Insect_DISAPPEAR);
|
||||
deleteRequest();
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ int dAcOsw_c::actorExecute() {
|
||||
dJEffManager_c::spawnEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0
|
||||
);
|
||||
playSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
startSound(SE_TIMESLIP_TIMESLIP_REV);
|
||||
mHidden = true;
|
||||
}
|
||||
} else {
|
||||
@@ -175,7 +175,7 @@ int dAcOsw_c::actorExecute() {
|
||||
dJEffManager_c::spawnEffect(
|
||||
PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0
|
||||
);
|
||||
playSound(SE_TIMESLIP_TIMESLIP);
|
||||
startSound(SE_TIMESLIP_TIMESLIP);
|
||||
mShown = true;
|
||||
}
|
||||
} else {
|
||||
@@ -250,7 +250,7 @@ void dAcOsw_c::executeState_OnWait() {
|
||||
void dAcOsw_c::finalizeState_OnWait() {}
|
||||
|
||||
void dAcOsw_c::initializeState_On() {
|
||||
playSound(0xA19);
|
||||
startSound(SE_Sw_SLIDE);
|
||||
}
|
||||
void dAcOsw_c::executeState_On() {
|
||||
if (sLib::chase(&mButtonCtrl.mElevation, -20.0f, 2.0f)) {
|
||||
@@ -259,7 +259,7 @@ void dAcOsw_c::executeState_On() {
|
||||
}
|
||||
|
||||
void dAcOsw_c::finalizeState_On() {
|
||||
playSound(0xA18);
|
||||
startSound(SE_Sw_ON);
|
||||
dRumble_c::start(dRumble_c::sRumblePreset2, 0x1);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ void dAcOsw_c::executeState_OffWait() {
|
||||
void dAcOsw_c::finalizeState_OffWait() {}
|
||||
|
||||
void dAcOsw_c::initializeState_Off() {
|
||||
playSound(0xA19);
|
||||
startSound(SE_Sw_SLIDE);
|
||||
}
|
||||
void dAcOsw_c::executeState_Off() {
|
||||
if (sLib::chase(&mButtonCtrl.mElevation, 0.0f, 2.0f)) {
|
||||
|
||||
@@ -1934,7 +1934,7 @@ extern "C" dAcItem_c *giveItem3(u16 item, s32);
|
||||
|
||||
void dAcTbox_c::initializeState_Open() {
|
||||
mScale.set(1.0f, 1.0f, 1.0f);
|
||||
playSound(SE_TBox_OPEN_A);
|
||||
startSound(SE_TBox_OPEN_A);
|
||||
clearActorProperty(0x100);
|
||||
if (mVariant == NORMAL) {
|
||||
mAnmMatClr1.setFrame(mAnmMatClr1.getFrameMax(0), 0);
|
||||
|
||||
@@ -1,13 +1,32 @@
|
||||
#include "toBeSorted/sound_info.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_base.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/snd/d_snd_source.h"
|
||||
|
||||
extern "C" dSoundSourceIf_c *soundForActorInitRelated_803889c0(int, fBase_c *, char *, u8);
|
||||
SoundInfo::SoundInfo(dAcBase_c *ac) : mpActor(ac) {}
|
||||
|
||||
extern "C" bool fn_8002C250(SoundInfo *p1, int someNum, char *name, mVec3_c *position) {
|
||||
p1->sound_source = soundForActorInitRelated_803889c0(someNum, p1->actor, name, 0);
|
||||
if (!p1->sound_source) {
|
||||
SoundInfo::~SoundInfo() {
|
||||
if (mpActor != nullptr) {
|
||||
mpActor->removeSoundInfo(this);
|
||||
mpActor = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool SoundInfo::initSource(u8 sourceType, const char *name, const mVec3_c *posPtr) {
|
||||
mpSource = dSoundSource_c::create(sourceType, mpActor, name, 0);
|
||||
if (mpSource == nullptr) {
|
||||
return false;
|
||||
}
|
||||
p1->actor->sound_list.append(p1);
|
||||
p1->obj_pos = position;
|
||||
mpActor->sound_list.append(this);
|
||||
mpPosPtr = posPtr;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SoundInfo::startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position) {
|
||||
return mpSource->startBgHitSound(
|
||||
soundId, dBgS::GetInstance()->GetPolyAtt0(info), dBgS::GetInstance()->GetPolyAtt1(info),
|
||||
position != nullptr ? position : &mpActor->position
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user