Match and link CDamageInfo

This commit is contained in:
Phillip Stephens
2026-01-22 01:14:22 -08:00
parent 1099735899
commit 3ea6f89030
13 changed files with 398 additions and 396 deletions
+3 -3
View File
@@ -211,8 +211,8 @@ lbl_1_rodata_B4 = .rodata:0x000000B4; // type:object size:0x20 align:4 data:floa
lbl_1_rodata_D4 = .rodata:0x000000D4; // type:object size:0x4 align:4 data:float
lbl_1_rodata_D8 = .rodata:0x000000D8; // type:object size:0x4 align:4 data:float
lbl_1_rodata_E0 = .rodata:0x000000E0; // type:object size:0x24 align:8
lbl_1_data_0 = .data:0x00000000; // type:object size:0x10
lbl_1_data_10 = .data:0x00000010; // type:object size:0x20
lbl_1_data_0 = .data:0x00000000; // type:object size:0xD data:string
lbl_1_data_10 = .data:0x00000010; // type:object size:0x19 data:string
lbl_1_data_30 = .data:0x00000030; // type:object size:0x1D940
lbl_1_data_1D970 = .data:0x0001D970; // type:object size:0x160
lbl_1_data_1DAD0 = .data:0x0001DAD0; // type:object size:0x28
@@ -220,7 +220,7 @@ lbl_1_data_1DAF8 = .data:0x0001DAF8; // type:object size:0x1030
lbl_1_data_1EB28 = .data:0x0001EB28; // type:object size:0x80
lbl_1_data_1EBA8 = .data:0x0001EBA8; // type:object size:0x18
lbl_1_data_1EBC0 = .data:0x0001EBC0; // type:object size:0x18 align:4 data:float
lbl_1_data_1EBD8 = .data:0x0001EBD8; // type:object size:0x18
lbl_1_data_1EBD8 = .data:0x0001EBD8; // type:object size:0x2 data:string
lbl_1_data_1EBF0 = .data:0x0001EBF0; // type:object size:0x8 data:4byte
lbl_1_data_1EBF8 = .data:0x0001EBF8; // type:object size:0x60 data:4byte
lbl_1_data_1EC58 = .data:0x0001EC58; // type:object size:0x100 data:byte
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -211,8 +211,8 @@ lbl_1_rodata_B4 = .rodata:0x000000B4; // type:object size:0x20 align:4 data:floa
lbl_1_rodata_D4 = .rodata:0x000000D4; // type:object size:0x4 align:4 data:float
lbl_1_rodata_D8 = .rodata:0x000000D8; // type:object size:0x4 align:4 data:float
lbl_1_rodata_E0 = .rodata:0x000000E0; // type:object size:0x24 align:8
lbl_1_data_0 = .data:0x00000000; // type:object size:0x10
lbl_1_data_10 = .data:0x00000010; // type:object size:0x20
lbl_1_data_0 = .data:0x00000000; // type:object size:0xD data:string
lbl_1_data_10 = .data:0x00000010; // type:object size:0x19 data:string
lbl_1_data_30 = .data:0x00000030; // type:object size:0x1D940
lbl_1_data_1D970 = .data:0x0001D970; // type:object size:0x160
lbl_1_data_1DAD0 = .data:0x0001DAD0; // type:object size:0x28
@@ -220,7 +220,7 @@ lbl_1_data_1DAF8 = .data:0x0001DAF8; // type:object size:0x1030
lbl_1_data_1EB28 = .data:0x0001EB28; // type:object size:0x80
lbl_1_data_1EBA8 = .data:0x0001EBA8; // type:object size:0x18
lbl_1_data_1EBC0 = .data:0x0001EBC0; // type:object size:0x18 align:4 data:float
lbl_1_data_1EBD8 = .data:0x0001EBD8; // type:object size:0x18
lbl_1_data_1EBD8 = .data:0x0001EBD8; // type:object size:0x2 data:string
lbl_1_data_1EBF0 = .data:0x0001EBF0; // type:object size:0x8 data:4byte
lbl_1_data_1EBF8 = .data:0x0001EBF8; // type:object size:0x60 data:4byte
lbl_1_data_1EC58 = .data:0x0001EC58; // type:object size:0x100 data:byte
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -331,7 +331,7 @@ lbl_1_data_1F170 = .data:0x0001F170; // type:object size:0x28
lbl_1_data_1F198 = .data:0x0001F198; // type:object size:0x80
lbl_1_data_1F218 = .data:0x0001F218; // type:object size:0x18
lbl_1_data_1F230 = .data:0x0001F230; // type:object size:0x18 align:4 data:float
lbl_1_data_1F248 = .data:0x0001F248; // type:object size:0x18
lbl_1_data_1F248 = .data:0x0001F248; // type:object size:0x2 data:string
lbl_1_data_1F260 = .data:0x0001F260; // type:object size:0x4 data:4byte
lbl_1_bss_0 = .bss:0x00000000; // type:object size:0x1 data:byte
lbl_1_bss_4 = .bss:0x00000004; // type:object size:0x8 data:byte
+1 -1
View File
@@ -643,7 +643,7 @@ config.libs = [
MatchingFor("GM8E01_00", "GM8E01_01"),
"MetroidPrime/ScriptObjects/CScriptPickup.cpp",
),
Object(NonMatching, "MetroidPrime/CDamageInfo.cpp"),
Object(MatchingFor("GM8E01_00", "GM8E01_01"), "MetroidPrime/CDamageInfo.cpp"),
Object(
MatchingFor("GM8E01_00", "GM8E01_01"),
"MetroidPrime/CMemoryDrawEnum.cpp",
-1
View File
@@ -37,7 +37,6 @@ class CPrimitive;
class CAnimData {
public:
enum EAnimDir {
kAD_Forward,
kAD_Backward,
+12 -11
View File
@@ -10,24 +10,17 @@ struct SShotParam;
class CDamageVulnerability;
class CDamageInfo {
CWeaponMode x0_weaponMode;
float x8_damage;
float xc_radiusDamage;
float x10_radius;
float x14_knockback;
bool x18_24_noImmunity : 1;
public:
CDamageInfo()
: x0_weaponMode()
: x0_weaponMode(CWeaponMode::Invalid())
, x8_damage(0.f)
, xc_radiusDamage(0.f)
, x10_radius(0.f)
, x14_knockback(0.f)
, x18_24_noImmunity(false) {}
CDamageInfo(const CWeaponMode& mode, const float damage, const float radius, const float knockback,
const bool noImmunity = false)
CDamageInfo(const CWeaponMode& mode, const float damage, const float radius,
const float knockback, const bool noImmunity = false)
: x0_weaponMode(mode)
, x8_damage(damage)
, xc_radiusDamage(x8_damage)
@@ -77,8 +70,16 @@ public:
x10_radius *= m;
x14_knockback *= m;
}
CDamageInfo MakeScaledForTime(const float dt) const;
private:
CWeaponMode x0_weaponMode;
float x8_damage;
float xc_radiusDamage;
float x10_radius;
float x14_knockback;
bool x18_24_noImmunity : 1;
};
#endif // _CDAMAGEINFO
-1
View File
@@ -70,7 +70,6 @@ public:
CModelData();
CModelData(const CAnimRes&);
CModelData(const CStaticRes&);
//CModelData(const CModelData& other);
~CModelData();
CAdvancementDeltas AdvanceAnimation(float dt, CStateManager& mgr, TAreaId aid, bool advTree);
+3 -2
View File
@@ -24,12 +24,13 @@ template < typename I1, typename I2 >
inline void iter_swap(I1 a, I2 b) {
swap(*a, *b);
}
template < class T, class Cmp >
void __sort3(T& a, T& b, T& c, Cmp comp); // TODO
template < typename It, class Cmp >
void __insertion_sort(It first, It last, Cmp cmp);
template < class T, class Cmp >
void __sort3(T& a, T& b, T& c, Cmp comp); // TODO
template < typename It, class Cmp >
void sort(It first, It last, Cmp cmp); // TODO
+1
View File
@@ -24,6 +24,7 @@
#include "rstl/math.hpp"
#pragma inline_max_size(250)
static CMaterialList MakeActorMaterialList(const CMaterialList& in,
const CActorParameters& params) {
CMaterialList ret = in;
+3 -3
View File
@@ -3,7 +3,8 @@
#include "Kyoto/Streams/CInputStream.hpp"
#include "MetroidPrime/CDamageVulnerability.hpp"
CDamageInfo::CDamageInfo(CInputStream& in) : x18_24_noImmunity(false) {
CDamageInfo::CDamageInfo(CInputStream& in)
: x0_weaponMode(CWeaponMode::Invalid()), x18_24_noImmunity(false) {
in.ReadLong();
x0_weaponMode = CWeaponMode(EWeaponType(in.ReadLong()));
x8_damage = in.ReadFloat();
@@ -61,6 +62,5 @@ CDamageInfo::CDamageInfo(const CDamageInfo& other, float dt)
, x18_24_noImmunity(true) {}
CDamageInfo CDamageInfo::MakeScaledForTime(const float dt) const {
return CDamageInfo(x0_weaponMode, x8_damage * (60.f * dt), x10_radius,
x14_knockback, true);
return CDamageInfo(x0_weaponMode, x8_damage * (60.f * dt), x10_radius, x14_knockback, true);
}
+4 -3
View File
@@ -357,9 +357,10 @@ CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in, int propCo
static CAABox GetCollisionBox(CStateManager& stateMgr, TAreaId id, const CVector3f& extent,
const CVector3f& offset) {
CAABox box(-extent * 0.5f + offset, extent * 0.5f + offset);
const CTransform4f& rot = stateMgr.GetWorld()->GetAreaAlways(id).GetTM().GetRotation();
return box.GetTransformedAABox(rot);
const CAABox box(0.5f * -extent.GetX() + offset.GetX(), 0.5f * -extent.GetY() + offset.GetY(),
0.5f * -extent.GetZ() + offset.GetZ(), 0.5f * extent.GetX() + offset.GetX(),
0.5f * extent.GetY() + offset.GetY(), 0.5f * extent.GetZ() + offset.GetZ());
return box.GetTransformedAABox(stateMgr.GetWorld()->GetAreaAlways(id).GetTM().GetRotation());
}
CEntity* ScriptLoader::LoadActor(CStateManager& mgr, CInputStream& in, int propCount,