This commit is contained in:
robojumper
2025-05-19 23:46:33 +02:00
parent c1f8ff572b
commit ffcaeff995
12 changed files with 127 additions and 48 deletions
@@ -42,7 +42,7 @@ calcRoll__10dAcOtubo_cFv = .text:0x00001D30; // type:function size:0x78C
adjustRoll__10dAcOtubo_cFv = .text:0x000024C0; // type:function size:0x1B0
fn_272_2670__10dAcOtubo_cFv = .text:0x00002670; // type:function size:0x3A0
attemptDestroy__10dAcOtubo_cFv = .text:0x00002A10; // type:function size:0x324
attemptDestroyOnWall__10dAcOtubo_cFPUlPCUc = .text:0x00002D40; // type:function size:0x64
attemptDestroyOnWall__10dAcOtubo_cFRCUlRCb = .text:0x00002D40; // type:function size:0x64
getCenter__10dAcOtubo_cCFv = .text:0x00002DB0; // type:function size:0xAC
fn_272_2E60__10dAcOtubo_cFRC7mVec3_c = .text:0x00002E60; // type:function size:0x1B8
fn_272_3020__10dAcOtubo_cFv = .text:0x00003020; // type:function size:0x12C
+7 -3
View File
@@ -248,15 +248,19 @@ d/d_player_act.cpp:
.bss start:0x805A06B0 end:0x805A06C8
d/d_player_mdl.cpp:
.text start:0x8005CE90 end:0x80061B10 align:16
.ctors start:0x804DB68C end:0x804DB690
.text start:0x8005CE90 end:0x80061AA4 align:16
.rodata start:0x804DE1E8 end:0x804E0B38
.data start:0x8050D690 end:0x8050DDD8
.sdata start:0x80571C80 end:0x80571D08
.sbss start:0x80575208 end:0x80575220
.sbss start:0x80575208 end:0x80575210
.sdata2 start:0x80577020 end:0x80577680
.bss start:0x805A06C8 end:0x805A06F0
d/d_player_guide_colors.cpp:
.text start:0x80061AB0 end:0x80061B0C align:16
.ctors start:0x804DB68C end:0x804DB690
.sbss start:0x80575210 end:0x80575220
d/d_rawarchive.cpp:
.text start:0x80061B10 end:0x800629D0 align:16
.data start:0x8050DDD8 end:0x8050DDF8
+22 -22
View File
@@ -978,7 +978,7 @@ polyAttrsToGroundEffectIdx__14dJEffManager_cFll = .text:0x8002A380; // type:func
spawnGroundEffect__14dJEffManager_cFRC7mVec3_cUcUcRC7mVec3_clff = .text:0x8002A450; // type:function size:0x1C0
fn_8002A610 = .text:0x8002A610; // type:function size:0x678
fn_8002AC90 = .text:0x8002AC90; // type:function size:0x460
fn_8002B0F0 = .text:0x8002B0F0; // type:function size:0x8
vt_0x1C0__17daPlayerActBase_cCFv = .text:0x8002B0F0; // type:function size:0x8
init__14dWaterEffect_cFP12dAcObjBase_cfff = .text:0x8002B100; // type:function size:0x14
execute__14dWaterEffect_cFff = .text:0x8002B120; // type:function size:0x1F4
drawAfter__18JPAEmitterCallBackFP14JPABaseEmitter = .text:0x8002B320; // type:function size:0x4
@@ -1151,13 +1151,13 @@ ActorEnemyBase__shouldUpdateMaybe = .text:0x8002F400; // type:function size:0xB4
ActorEnemyBase__postUpdate = .text:0x8002F4C0; // type:function size:0x7C
ActorEnemyBase__preDraw = .text:0x8002F540; // type:function size:0x74
fn_8002F5C0 = .text:0x8002F5C0; // type:function size:0x110
fn_8002F6D0 = .text:0x8002F6D0; // type:function size:0x8
fn_8002F6E0 = .text:0x8002F6E0; // type:function size:0x8
checkBeetleActorReferences__17daPlayerActBase_cFv = .text:0x8002F6D0; // type:function size:0x8
getBeetleActorReferencesSize__17daPlayerActBase_cFv = .text:0x8002F6E0; // type:function size:0x8
fn_8002F6F0 = .text:0x8002F6F0; // type:function size:0xC
fn_8002F700 = .text:0x8002F700; // type:function size:0x8
fn_8002F710 = .text:0x8002F710; // type:function size:0x110
fn_8002F820 = .text:0x8002F820; // type:function size:0x8
fn_8002F830 = .text:0x8002F830; // type:function size:0x8
checkRefArrayAtIndex__17daPlayerActBase_cFv = .text:0x8002F820; // type:function size:0x8
sizeOfActorRefs_16__17daPlayerActBase_cFv = .text:0x8002F830; // type:function size:0x8
fn_8002F840 = .text:0x8002F840; // type:function size:0x8
fn_8002F850 = .text:0x8002F850; // type:function size:0x70
fn_8002F8C0 = .text:0x8002F8C0; // type:function size:0x70
@@ -1195,7 +1195,7 @@ fn_80030C70 = .text:0x80030C70; // type:function size:0x4
fn_80030C80 = .text:0x80030C80; // type:function size:0x8
ActorEnemyBase__initList = .text:0x80030C90; // type:function size:0x14
ActorNpcEventFlowManager__handleType3Flow = .text:0x80030CB0; // type:function size:0xC34
fn_800318F0 = .text:0x800318F0; // type:function size:0x4
setActorRef9__17daPlayerActBase_cFv = .text:0x800318F0; // type:function size:0x4
fn_80031900 = .text:0x80031900; // type:function size:0x8
fn_80031910 = .text:0x80031910; // type:function size:0x8
fn_80031920 = .text:0x80031920; // type:function size:0x8
@@ -1205,7 +1205,7 @@ fn_80031A40 = .text:0x80031A40; // type:function size:0x44
fn_80031A90 = .text:0x80031A90; // type:function size:0xAC
fn_80031B40 = .text:0x80031B40; // type:function size:0x98
fn_80031BE0 = .text:0x80031BE0; // type:function size:0x9C
fn_80031C80 = .text:0x80031C80; // type:function size:0x4
vt_0x2B0__17daPlayerActBase_cFv = .text:0x80031C80; // type:function size:0x4
fn_80031C90 = .text:0x80031C90; // type:function size:0xF8
fn_80031D90 = .text:0x80031D90; // type:function size:0xF0
fn_80031E80 = .text:0x80031E80; // type:function size:0xC0
@@ -1289,9 +1289,9 @@ getLinkRotation = .text:0x80034690; // type:function size:0x20
ActorLink__setObjActorFlags0x200 = .text:0x800346B0; // type:function size:0x14
ActorLink__unsetObjActorFlags0x200 = .text:0x800346D0; // type:function size:0x14
fn_800346F0 = .text:0x800346F0; // type:function size:0xDC
fn_800347D0 = .text:0x800347D0; // type:function size:0x4
fn_800347E0 = .text:0x800347E0; // type:function size:0x4
fn_800347F0 = .text:0x800347F0; // type:function size:0x8
vt_0x2AC__17daPlayerActBase_cFv = .text:0x800347D0; // type:function size:0x4
triggerMoveEventMaybe__17daPlayerActBase_cFv = .text:0x800347E0; // type:function size:0x4
vt_0x2C4__17daPlayerActBase_cFv = .text:0x800347F0; // type:function size:0x8
fn_80034800 = .text:0x80034800; // type:function size:0x170
fn_80034970 = .text:0x80034970; // type:function size:0xFC
fn_80034A70 = .text:0x80034A70; // type:function size:0x8
@@ -1303,7 +1303,7 @@ fn_80034B50 = .text:0x80034B50; // type:function size:0xB8
fn_80034C10 = .text:0x80034C10; // type:function size:0x64
fn_80034C80 = .text:0x80034C80; // type:function size:0x104
fn_80034D90 = .text:0x80034D90; // type:function size:0x8
fn_80034DA0 = .text:0x80034DA0; // type:function size:0x8
isDashing__17daPlayerActBase_cFv = .text:0x80034DA0; // type:function size:0x8
acNpc_vt_0x11C__8dAcNpc_cFv = .text:0x80034DB0; // type:function size:0x10
fn_80034DC0 = .text:0x80034DC0; // type:function size:0x50
ActorNpcBase2__rotateToGoal = .text:0x80034E10; // type:function size:0x5C
@@ -1439,7 +1439,7 @@ fn_80038B70 = .text:0x80038B70; // type:function size:0x138
fn_80038CB0 = .text:0x80038CB0; // type:function size:0xCC
fn_80038D80 = .text:0x80038D80; // type:function size:0x7C
fn_80038E00 = .text:0x80038E00; // type:function size:0x4C
fn_80038E50 = .text:0x80038E50; // type:function size:0x4
unlinkActorRef9__17daPlayerActBase_cFv = .text:0x80038E50; // type:function size:0x4
fn_80038E60 = .text:0x80038E60; // type:function size:0x18
fn_80038E80 = .text:0x80038E80; // type:function size:0x28
fn_80038EB0 = .text:0x80038EB0; // type:function size:0x38
@@ -1924,7 +1924,7 @@ fn_8004B380 = .text:0x8004B380; // type:function size:0xD0
fn_8004B450 = .text:0x8004B450; // type:function size:0x140
fn_8004B590 = .text:0x8004B590; // type:function size:0x3B8
fn_8004B950 = .text:0x8004B950; // type:function size:0x14
fn_8004B970 = .text:0x8004B970; // type:function size:0x8
vt_0x2C0__17daPlayerActBase_cFv = .text:0x8004B970; // type:function size:0x8
AcOrdinaryNpc__statePainEnter = .text:0x8004B980; // type:function size:0x50
fn_8004B9D0 = .text:0x8004B9D0; // type:function size:0x1C
AcOrdinaryNpc__statePainUpdate = .text:0x8004B9F0; // type:function size:0xB8
@@ -2641,7 +2641,7 @@ play__16daPlBaseAnmChr_cFv = .text:0x8005D2E0; // type:function size:0x34
isFinished__16daPlBaseAnmChr_cFv = .text:0x8005D320; // type:function size:0x80
timingB__22daPlBaseHeadCallback_cFUlPQ34nw4r3g3d13WorldMtxManipQ34nw4r3g3d6ResMdl = .text:0x8005D3A0; // type:function size:0x8
ExecCallbackC__23daPlBaseHandsCallback_cFPQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r3g3d16FuncObjCalcWorld = .text:0x8005D3B0; // type:function size:0x30
fn_8005D3E0 = .text:0x8005D3E0; // type:function size:0x28
isBodyAnmPart_0_2_4__19daPlayerModelBase_cFl = .text:0x8005D3E0; // type:function size:0x28
freeFrmHeap__19daPlayerModelBase_cFP16mHeapAllocator_c = .text:0x8005D410; // type:function size:0x60
allocFrmHeap__19daPlayerModelBase_cFP16mHeapAllocator_cUlPCc = .text:0x8005D470; // type:function size:0x58
allocExternalDataBuffers__19daPlayerModelBase_cFv = .text:0x8005D4D0; // type:function size:0x9C
@@ -2688,7 +2688,7 @@ mainModelTimingC__19daPlayerModelBase_cFPQ34nw4r4math5MTX34 = .text:0x8005FE40;
handsCallbackC__19daPlayerModelBase_cFPQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r3g3d16FuncObjCalcWorld = .text:0x8005FE90; // type:function size:0xA8
headModelTimingB__19daPlayerModelBase_cFUlPQ34nw4r3g3d13WorldMtxManip = .text:0x8005FF40; // type:function size:0x118
setTransformAndCalc__19daPlayerModelBase_cFRQ23m3d9scnLeaf_cPC6mMtx_c = .text:0x80060060; // type:function size:0x40
fn_800600A0 = .text:0x800600A0; // type:function size:0xD4
setShieldTransform__19daPlayerModelBase_cFb = .text:0x800600A0; // type:function size:0xD4
fn_80060180 = .text:0x80060180; // type:function size:0xB0
getItemResFile__19daPlayerModelBase_cFPCcR12mAllocator_c = .text:0x80060230; // type:function size:0xD4
getExternalCompressedFile__19daPlayerModelBase_cFPCcPCcPvUl = .text:0x80060310; // type:function size:0x94
@@ -2704,10 +2704,10 @@ ActorLink__SetFaceAnmChr = .text:0x80060820; // type:function size:0xF0
fn_80060910 = .text:0x80060910; // type:function size:0x38
fn_80060950 = .text:0x80060950; // type:function size:0x164
fn_80060AC0 = .text:0x80060AC0; // type:function size:0x6C
fn_80060B30 = .text:0x80060B30; // type:function size:0xCC
loadSound__19daPlayerModelBase_cFQ34nw4r3g3d7ResFilePCcl = .text:0x80060B30; // type:function size:0xCC
fn_80060C00 = .text:0x80060C00; // type:function size:0xE0
fn_80060CE0 = .text:0x80060CE0; // type:function size:0x64
fn_80060D50 = .text:0x80060D50; // type:function size:0x54
syncSoundWithAnim__19daPlayerModelBase_cFv = .text:0x80060CE0; // type:function size:0x64
registMassObj__19daPlayerModelBase_cFP8cCcD_ObjUc = .text:0x80060D50; // type:function size:0x54
updateModelColliders__19daPlayerModelBase_cFv = .text:0x80060DB0; // type:function size:0x29C
updateCachedPositions__19daPlayerModelBase_cFv = .text:0x80061050; // type:function size:0x1B0
fn_80061200 = .text:0x80061200; // type:function size:0x210
@@ -2737,7 +2737,7 @@ __dt__13daPlBaseMdl_cFv = .text:0x800619C0; // type:function size:0x6C
__dt__21daPlBaseMdlCallback_cFv = .text:0x80061A30; // type:function size:0x58
ExecCallbackB__Q34nw4r3g3d18ICalcWorldCallbackFPQ34nw4r3g3d13WorldMtxManipQ34nw4r3g3d6ResMdlPQ34nw4r3g3d16FuncObjCalcWorld = .text:0x80061A90; // type:function size:0x4
ExecCallbackA__Q34nw4r3g3d18ICalcWorldCallbackFPQ34nw4r3g3d12ChrAnmResultQ34nw4r3g3d6ResMdlPQ34nw4r3g3d16FuncObjCalcWorld = .text:0x80061AA0; // type:function size:0x4
dPlayerModel__sinit = .text:0x80061AB0; // type:function size:0x5C
__sinit_\d_player_mdl_cpp = .text:0x80061AB0; // type:function size:0x5C scope:local
computeChecksumInner__FPvUl = .text:0x80061B10; // type:function size:0x88
computeChecksum__FPvUl = .text:0x80061BA0; // type:function size:0x34
setPrefix__FP18ArcCallbackHandlerPCcUl = .text:0x80061BE0; // type:function size:0x10
@@ -41295,9 +41295,9 @@ lbl_80575200 = .sbss:0x80575200; // type:object size:0x8 data:byte
DefaultHandMats = .sbss:0x80575208; // type:object size:0x1 data:byte
lbl_8057520A = .sbss:0x8057520A; // type:object size:0x1 data:byte
lbl_8057520B = .sbss:0x8057520B; // type:object size:0x5 data:byte
guideColor1 = .sbss:0x80575210; // type:object size:0x4 data:4byte
guideColor2 = .sbss:0x80575214; // type:object size:0x4 data:4byte
guideColor3 = .sbss:0x80575218; // type:object size:0x8 data:4byte
sGuideColor1__19daPlayerModelBase_c = .sbss:0x80575210; // type:object size:0x4 data:4byte
sGuideColor2__19daPlayerModelBase_c = .sbss:0x80575214; // type:object size:0x4 data:4byte
sGuideColor3__19daPlayerModelBase_c = .sbss:0x80575218; // type:object size:0x8 data:4byte
RootActorParams = .sbss:0x80575220; // type:object size:0x4 scope:local data:4byte
ms_configuration_p__6dSys_c = .sbss:0x80575228; // type:object size:0x4 data:4byte
dSys_c__ms_RootHeapMem1 = .sbss:0x8057522C; // type:object size:0x4 data:4byte
+1
View File
@@ -414,6 +414,7 @@ config.libs = [
Object(NonMatching, "d/d_pad_player.cpp"),
Object(NonMatching, "d/d_player_act.cpp"),
Object(NonMatching, "d/d_player_mdl.cpp"),
Object(Matching, "d/d_player_guide_colors.cpp"),
Object(Matching, "d/d_rawarchive.cpp"),
Object(Matching, "d/d_scene.cpp"),
Object(NonMatching, "d/d_state.cpp"),
+1 -1
View File
@@ -19,7 +19,7 @@ struct SoundSource {
virtual bool shutdown(); // 0x48
virtual bool isReadyMaybe(); // 0x100
virtual bool load(void *data, const char *name); // 0x100
virtual bool load(void *data, const char *name); // 0x104
virtual void setFrame(f32 frame); // 0x108
virtual void setRate(f32 frame); // 0x10C
virtual void set_0x164(UNKWORD val); // 0x114
+18 -5
View File
@@ -95,7 +95,7 @@ private:
class daPlBaseMdl_c : public m3d::mdl_c {
public:
daPlBaseMdl_c() : field_0x5C(0) {}
daPlBaseMdl_c() : mpSoundData(nullptr) {}
virtual bool setAnm(m3d::banm_c &anm) override;
virtual void remove() override;
@@ -109,11 +109,16 @@ public:
return mCallback.getNodeResult(node);
}
void setSoundRelated(u16 id, void *data) {
field_0x5A = id;
mpSoundData = data;
}
private:
/* 0x24 */ daPlBaseMdlCallback_c mCallback;
/* 0x58 */ u8 field_0x58;
/* 0x5A */ u16 field_0x5A;
/* 0x5C */ u32 field_0x5C;
/* 0x5C */ void *mpSoundData;
};
class daPlBaseMainCallback_c : public m3d::callback_c {
@@ -884,6 +889,7 @@ public:
static bool createGenericMdl(nw4r::g3d::ResMdl resMdl, m3d::mdl_c &mdl, mAllocator_c *alloc, u32 bufferOption);
static bool createGenericSmdl(nw4r::g3d::ResMdl resMdl, m3d::smdl_c &mdl, mAllocator_c *alloc, u32 bufferOption);
static void setTransformAndCalc(m3d::scnLeaf_c &lf, const mMtx_c *mtx);
void setShieldTransform(bool inHand);
static nw4r::g3d::ResFile getItemResFile(const char *name, mAllocator_c &allocator);
nw4r::g3d::ResFile getExternalCompressedFile(const char *name, const char *extension, void *dest, u32 maxSize);
@@ -967,10 +973,10 @@ public:
mMainMdl.getNodeWorldMtx(boneIdx, *out_mtx);
}
/* vt 0x190 */ virtual void getSheathModelMatrix(mMtx_c *out_mtx) override {
mSheathMdl.getLocalMtx();
mSheathMdl.getLocalMtx(*out_mtx);
}
/* vt 0x194 */ virtual void getSwordModelMatrix(mMtx_c *out_mtx) override {
mSwordMdl.getLocalMtx();
mSwordMdl.getLocalMtx(*out_mtx);
}
/* vt 0x198 */ virtual mAng vt_0x198() override {
return field_0x1268;
@@ -991,6 +997,10 @@ public:
mSwordAndMoreStates &= ~mask;
}
void loadSound(nw4r::g3d::ResFile file, const char *name, s32 animIdx);
void syncSoundWithAnim();
static void registMassObj(cCcD_Obj* obj, u8 priority);
void updateModelColliders();
void updateCachedPositions();
@@ -1015,6 +1025,9 @@ public:
static const PlayerAnimation sAnimations[443];
static const u8 sShieldDurabilities[10];
static const u8 sShieldRegenTimes[10];
static mColor sGuideColor1;
static mColor sGuideColor2;
static mColor sGuideColor3;
protected:
/* 0x370 */ mHeapAllocator_c mModelAllocator;
@@ -1063,7 +1076,7 @@ protected:
/* 0x1208 */ u8 field_0x1208[2];
/* 0x120A */ u8 field_0x120A;
/* 0x120B */ u8 mTunicType;
/* 0x120C */ u8 field_0x120C;
/* 0x120C */ u8 mCurrentAnmChrIdx;
/* 0x120D */ u8 mShieldPouchSlot;
/* 0x120E */ s8 mPouchMatId;
/* 0x120F */ s8 mBeltMatId;
+4
View File
@@ -38,6 +38,10 @@ public:
// This is a remnant of cCcS, which dCcS::Ct calls. Idk the correct layout
void Ct_cCcS();
dCcMassS_Mng &GetMassMng() {
return mMassMng;
}
void Ct();
void Dt();
+1 -1
View File
@@ -71,7 +71,7 @@ struct mAng {
return (360.0f / 65536.0f) * mVal;
}
static mAng fromDeg(f32 deg) {
static s16 fromDeg(f32 deg) {
return deg * sDegToAng;
}
f32 degree2() const {
+5
View File
@@ -220,6 +220,11 @@ public:
u32 GetShpID() const;
u32 GetNodeID() const;
};
// Not sure, but d_player_mdl has these strings at the end of .data (inlines) and in reverse order (in the same inline)
DrawEnumerator ConstructDrawEnumerator() const {
return DrawEnumerator(GetResByteCode("DrawOpa"), GetResByteCode("DrawXlu"));
}
};
} // namespace g3d
+3 -3
View File
@@ -459,13 +459,13 @@ void dAcOtubo_c::destroy() {
mActorCarryInfo.fn_80050EA0(this);
dEmitterBase_c *fx_thing = dJEffManager_c::spawnEffect(
PARTICLE_RESOURCE_ID_MAPPING_209_, poscopy2, nullptr, nullptr, nullptr, nullptr, 0, 0
PARTICLE_RESOURCE_ID_MAPPING_211_, poscopy2, nullptr, nullptr, nullptr, nullptr, 0, 0
);
if (fx_thing) {
fx_thing->attachEmitterCallbackId(mSubtype != 0 ? dJEffManager_c::TsuboB : dJEffManager_c::TsuboA);
}
fx_thing = dJEffManager_c::spawnEffect(
PARTICLE_RESOURCE_ID_MAPPING_109_, position, nullptr, nullptr, nullptr, nullptr, 0, 0
PARTICLE_RESOURCE_ID_MAPPING_116_, position, nullptr, nullptr, nullptr, nullptr, 0, 0
);
if (fx_thing) {
fx_thing->bindShpEmitter(mSubtype != 0 ? dJEffManager_c::TsuboB : dJEffManager_c::TsuboA, false);
@@ -573,7 +573,7 @@ void dAcOtubo_c::fn_272_2670() {
static const s16 unk = {0}; // needed for rodata ordering
if (!cM::isZero(mField_0x9CA)) {
angle.y = (*(s16 *)((u8 *)this + 0x9CA)); // HACK to force load again
mField_0x9CA = 0;
mField_0x9CA.set(0);
} else {
mQuat_c q;
q.set(1.f, 0.f, 0.f, 0.f);
+7
View File
@@ -0,0 +1,7 @@
#include "d/a/d_a_player.h"
// Need to be their own file due to sbss alignment
mColor daPlayerModelBase_c::sGuideColor1(0x00, 0x82, 0xDC, 0xFF);
mColor daPlayerModelBase_c::sGuideColor2(0x64, 0xFF, 0xFF, 0xFF);
mColor daPlayerModelBase_c::sGuideColor3(0x46, 0xC8, 0xFF, 0xFF);
+57 -12
View File
@@ -1,6 +1,7 @@
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/d_a_player.h"
#include "d/col/cc/d_cc_s.h"
#include "d/d_heap.h"
#include "d/d_pouch.h"
#include "d/d_rawarchive.h"
@@ -46,7 +47,7 @@ static u8 sHandMats[14] = {};
#pragma push
#pragma readonly_strings on
const char *sFaceResNames[] = {
static const char *sFaceResNames[] = {
"F_Default",
"Fmaba01",
"F_M",
@@ -179,7 +180,7 @@ bool daPlBaseMdl_c::create(
setBlendNodeRange(0, 0xFFFF, 0.0f);
field_0x58 = 0;
field_0x5C = 0;
mpSoundData = nullptr;
field_0x5A = 0xFFFF;
SoundSource *sound = player->getSoundSource();
if (sound->isReadyMaybe()) {
@@ -242,6 +243,11 @@ void daPlBaseHandsCallback_c::ExecCallbackC(
mpPlayer->handsCallbackC(pMtxArray, mdl, pFuncObj);
}
// TODO explain
bool daPlayerModelBase_c::isBodyAnmPart_0_2_4(s32 part) {
return part == 0 || part == 2 || part == 4;
}
void daPlayerModelBase_c::freeFrmHeap(mHeapAllocator_c *allocator) {
EGG::Heap::toFrmHeap(allocator->getHeap())->free(0x1 | 0x2);
}
@@ -381,10 +387,10 @@ void daPlayerModelBase_c::loadBody() {
animObj = static_cast<nw4r::g3d::AnmObjChr *>(anms->getAnimObj());
animObj->Release();
if (isBodyAnmPart_0_2_4(i)) {
animObj->Bind(bodyMdl, 16, nw4r::g3d::AnmObjChr::BIND_PARTIAL);
animObj->Bind(bodyMdl, 0, nw4r::g3d::AnmObjChr::BIND_ONE);
animObj->Bind(bodyMdl, PLAYER_MAIN_NODE_WAIST, nw4r::g3d::AnmObjChr::BIND_PARTIAL);
animObj->Bind(bodyMdl, PLAYER_MAIN_NODE_CENTER, nw4r::g3d::AnmObjChr::BIND_ONE);
} else {
animObj->Bind(bodyMdl, 1, nw4r::g3d::AnmObjChr::BIND_PARTIAL);
animObj->Bind(bodyMdl, PLAYER_MAIN_NODE_BACKBONE_1, nw4r::g3d::AnmObjChr::BIND_PARTIAL);
}
mAnmChrBlend.attach(i, anms, f);
anms++;
@@ -447,7 +453,7 @@ void daPlayerModelBase_c::loadHandsModels() {
sSavedHandMats[0] = 7;
sSavedHandMats[1] = 0;
nw4r::g3d::ResMdl::DrawEnumerator drawEnumerator(mdl.GetResByteCode("DrawOpa"), mdl.GetResByteCode("DrawXlu"));
nw4r::g3d::ResMdl::DrawEnumerator drawEnumerator = mdl.ConstructDrawEnumerator();
while (drawEnumerator.IsValid()) {
for (int j = 0; j < 14; j++) {
if (ids[j] == drawEnumerator.GetMatID()) {
@@ -552,8 +558,8 @@ static const char *sShieldModelsBase[] = {
};
static const char *sShieldModelsBroken[] = {
"EquipShieldWoodBroken", "EquipShieldIronBroken", "EquipShieldHolyBroken",
"EquipShieldHyliaBroken", "EquipShieldWoodBroken",
"EquipShieldWoodBroken", "EquipShieldIronBroken", "EquipShieldHolyBroken",
"EquipShieldHylia", "EquipShieldWoodBroken",
};
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_529_;
@@ -797,12 +803,11 @@ void daPlayerModelBase_c::adjustMainModelWorldMtx(PlayerMainModelNode_e nodeId,
result->SetMtxUnchecked(orig);
} else if (nodeId == PLAYER_MAIN_NODE_HAND_R || nodeId == PLAYER_MAIN_NODE_HAND_L) {
if (isOnTightRope()) {
// TODO: I'd like this to be a neat ternary...
// nodeId == PLAYER_MAIN_NODE_HAND_R ? -5461 : -7282;
mAng rot;
rot = -7282;
if (nodeId == PLAYER_MAIN_NODE_HAND_R) {
rot = -5461;
} else {
rot = -7282;
}
applyWorldRotationMaybe(result, rot, 0, 0, nullptr, false);
} else if (isOnVines()) {
@@ -899,7 +904,7 @@ void daPlayerModelBase_c::updateBlendWeights(PlayerMainModelNode_e nodeId) {
break;
case 6:
if (nodeId == PLAYER_MAIN_NODE_HEAD) {
updateMainBlend2(0.0f, false);
updateMainBlend2(1.0f, false);
} else if (nodeId == PLAYER_MAIN_NODE_POD) {
updateMainBlend2(0.0f, false);
}
@@ -1026,6 +1031,20 @@ void daPlayerModelBase_c::setTransformAndCalc(m3d::scnLeaf_c &lf, const mMtx_c *
lf.calc(false);
}
void daPlayerModelBase_c::setShieldTransform(bool inHand) {
mMtx_c targetTransform;
if (inHand) {
mMainMdl.getNodeWorldMtx(PLAYER_MAIN_NODE_WEAPON_L, targetTransform);
} else {
mMainMdl.getNodeWorldMtx(PLAYER_MAIN_NODE_POD, targetTransform);
mMtx_c mtx2;
MTXTrans(mtx2, 4.2f, 4.4f, 20.0f);
MTXConcat(targetTransform, mtx2, targetTransform);
targetTransform.ZYXrotM(mAng::fromDeg(91.0f), mAng::fromDeg(-123.0f), 0);
}
setTransformAndCalc(mShieldMdl, &targetTransform);
}
nw4r::g3d::ResFile daPlayerModelBase_c::getItemResFile(const char *name, mAllocator_c &allocator) {
SizedString<64> buf;
buf.sprintf("dat/%s.brresC", name);
@@ -1094,6 +1113,29 @@ nw4r::g3d::ResAnmTexSrt daPlayerModelBase_c::getExternalAnmTexSrt(const char *na
return result;
}
void daPlayerModelBase_c::loadSound(nw4r::g3d::ResFile file, const char *name, s32 animIdx) {
SoundSource *s = getSoundSource();
mCurrentAnmChrIdx = animIdx;
SizedString<64> path;
path.sprintf("%s.brasd", name);
void *dat = file.GetExternalData(path);
if (dat == nullptr && file == mCurrentRes) {
dat = mPlCommonSoundRes.GetExternalData(path);
}
mMainMdl.setSoundRelated(mAnimations[animIdx], dat);
s->load(dat, name);
}
void daPlayerModelBase_c::syncSoundWithAnim() {
f32 frame = mAnmChrs[mCurrentAnmChrIdx].getFrame();
getSoundSource()->setFrame(frame);
}
void daPlayerModelBase_c::registMassObj(cCcD_Obj* obj, u8 priority) {
dCcS::GetInstance()->Set(obj);
dCcS::GetInstance()->GetMassMng().SetObj(obj, priority);
}
void daPlayerModelBase_c::updateModelColliders() {
mVec3_c bodyTranslation;
mMainMdl.getNodeWorldMtxMultVecZero(PLAYER_MAIN_NODE_CENTER, bodyTranslation);
@@ -1178,3 +1220,6 @@ void daPlayerModelBase_c::fn_80061410() {
/* vt 0x114 */ void daPlayerModelBase_c::somethingWithCarriedActorFlags() {
// TODO
}
mColor daPlayerModelBase_c::sGuideColor1(0x00, 0x82, 0xDC, 0xFF);
mColor daPlayerModelBase_c::sGuideColor2(0x64, 0xFF, 0xFF, 0xFF);
mColor daPlayerModelBase_c::sGuideColor3(0x46, 0xC8, 0xFF, 0xFF);