From 4b593647d658116417bdcedf976ca25b2fd7ef69 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Fri, 14 Oct 2022 02:06:56 +0300 Subject: [PATCH] Add CEffect --- asm/MetroidPrime/CEffect.s | 20 +++++++++---------- asm/MetroidPrime/CExplosion.s | 8 ++++---- .../ScriptObjects/CHUDBillboardEffect.s | 4 ++-- asm/MetroidPrime/Weapons/CIceImpact.s | 4 ++-- include/MetroidPrime/CEffect.hpp | 6 +++++- src/MetroidPrime/CEffect.cpp | 12 +++++++++++ 6 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 src/MetroidPrime/CEffect.cpp diff --git a/asm/MetroidPrime/CEffect.s b/asm/MetroidPrime/CEffect.s index 956c4dec..431c5e57 100644 --- a/asm/MetroidPrime/CEffect.s +++ b/asm/MetroidPrime/CEffect.s @@ -3,8 +3,8 @@ .section .data .balign 8 -.global lbl_803DA118 -lbl_803DA118: +.global __vt__7CEffect +__vt__7CEffect: # ROM: 0x3D7118 .4byte 0 .4byte 0 @@ -15,8 +15,8 @@ lbl_803DA118: .4byte AcceptScriptMsg__6CActorF20EScriptObjectMessage9TUniqueIdR13CStateManager .4byte SetActive__6CActorFb .4byte PreRender__6CActorFR13CStateManagerRC14CFrustumPlanes - .4byte nullsub_83 - .4byte nullsub_84 + .4byte AddToRenderer__7CEffectCFRC14CFrustumPlanesRC13CStateManager + .4byte Render__7CEffectCFRC13CStateManager .4byte CanRenderUnsorted__6CActorCFRC13CStateManager .4byte CalculateRenderBounds__6CActorFv .4byte HealthInfo__6CActorFR13CStateManager @@ -83,12 +83,12 @@ lbl_8005AD28: /* 8005AD40 00057CA0 38 21 00 20 */ addi r1, r1, 0x20 /* 8005AD44 00057CA4 4E 80 00 20 */ blr -.global nullsub_83 -nullsub_83: +.global AddToRenderer__7CEffectCFRC14CFrustumPlanesRC13CStateManager +AddToRenderer__7CEffectCFRC14CFrustumPlanesRC13CStateManager: /* 8005AD48 00057CA8 4E 80 00 20 */ blr -.global nullsub_84 -nullsub_84: +.global Render__7CEffectCFRC13CStateManager +Render__7CEffectCFRC13CStateManager: /* 8005AD4C 00057CAC 4E 80 00 20 */ blr .global "__ct__7CEffectF9TUniqueIdRC11CEntityInfobRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>RC12CTransform4f" @@ -143,9 +143,9 @@ nullsub_84: /* 8005AE0C 00057D6C 38 61 00 88 */ addi r3, r1, 0x88 /* 8005AE10 00057D70 38 80 FF FF */ li r4, -1 /* 8005AE14 00057D74 48 0B BC 39 */ bl __dt__10CModelDataFv -/* 8005AE18 00057D78 3C 80 80 3E */ lis r4, lbl_803DA118@ha +/* 8005AE18 00057D78 3C 80 80 3E */ lis r4, __vt__7CEffect@ha /* 8005AE1C 00057D7C 7F E3 FB 78 */ mr r3, r31 -/* 8005AE20 00057D80 38 04 A1 18 */ addi r0, r4, lbl_803DA118@l +/* 8005AE20 00057D80 38 04 A1 18 */ addi r0, r4, __vt__7CEffect@l /* 8005AE24 00057D84 90 1F 00 00 */ stw r0, 0(r31) /* 8005AE28 00057D88 BB 41 00 D8 */ lmw r26, 0xd8(r1) /* 8005AE2C 00057D8C 80 01 00 F4 */ lwz r0, 0xf4(r1) diff --git a/asm/MetroidPrime/CExplosion.s b/asm/MetroidPrime/CExplosion.s index 3cfc2193..ac958202 100644 --- a/asm/MetroidPrime/CExplosion.s +++ b/asm/MetroidPrime/CExplosion.s @@ -583,9 +583,9 @@ __dt__10CExplosionFv: lbl_8005A890: /* 8005A890 000577F0 28 1E 00 00 */ cmplwi r30, 0 /* 8005A894 000577F4 41 82 00 1C */ beq lbl_8005A8B0 -/* 8005A898 000577F8 3C 80 80 3E */ lis r4, lbl_803DA118@ha +/* 8005A898 000577F8 3C 80 80 3E */ lis r4, __vt__7CEffect@ha /* 8005A89C 000577FC 7F C3 F3 78 */ mr r3, r30 -/* 8005A8A0 00057800 38 04 A1 18 */ addi r0, r4, lbl_803DA118@l +/* 8005A8A0 00057800 38 04 A1 18 */ addi r0, r4, __vt__7CEffect@l /* 8005A8A4 00057804 38 80 00 00 */ li r4, 0 /* 8005A8A8 00057808 90 1E 00 00 */ stw r0, 0(r30) /* 8005A8AC 0005780C 4B FF AE 45 */ bl __dt__6CActorFv @@ -730,9 +730,9 @@ __dt__7CEffectFv: /* 8005AAAC 00057A0C 93 C1 00 08 */ stw r30, 8(r1) /* 8005AAB0 00057A10 7C 7E 1B 79 */ or. r30, r3, r3 /* 8005AAB4 00057A14 41 82 00 28 */ beq lbl_8005AADC -/* 8005AAB8 00057A18 3C A0 80 3E */ lis r5, lbl_803DA118@ha +/* 8005AAB8 00057A18 3C A0 80 3E */ lis r5, __vt__7CEffect@ha /* 8005AABC 00057A1C 38 80 00 00 */ li r4, 0 -/* 8005AAC0 00057A20 38 05 A1 18 */ addi r0, r5, lbl_803DA118@l +/* 8005AAC0 00057A20 38 05 A1 18 */ addi r0, r5, __vt__7CEffect@l /* 8005AAC4 00057A24 90 1E 00 00 */ stw r0, 0(r30) /* 8005AAC8 00057A28 4B FF AC 29 */ bl __dt__6CActorFv /* 8005AACC 00057A2C 7F E0 07 35 */ extsh. r0, r31 diff --git a/asm/MetroidPrime/ScriptObjects/CHUDBillboardEffect.s b/asm/MetroidPrime/ScriptObjects/CHUDBillboardEffect.s index 26c268bf..8e29b015 100644 --- a/asm/MetroidPrime/ScriptObjects/CHUDBillboardEffect.s +++ b/asm/MetroidPrime/ScriptObjects/CHUDBillboardEffect.s @@ -387,9 +387,9 @@ lbl_8012FE84: lbl_8012FEAC: /* 8012FEAC 0012CE0C 28 1E 00 00 */ cmplwi r30, 0 /* 8012FEB0 0012CE10 41 82 00 1C */ beq lbl_8012FECC -/* 8012FEB4 0012CE14 3C 80 80 3E */ lis r4, lbl_803DA118@ha +/* 8012FEB4 0012CE14 3C 80 80 3E */ lis r4, __vt__7CEffect@ha /* 8012FEB8 0012CE18 7F C3 F3 78 */ mr r3, r30 -/* 8012FEBC 0012CE1C 38 04 A1 18 */ addi r0, r4, lbl_803DA118@l +/* 8012FEBC 0012CE1C 38 04 A1 18 */ addi r0, r4, __vt__7CEffect@l /* 8012FEC0 0012CE20 38 80 00 00 */ li r4, 0 /* 8012FEC4 0012CE24 90 1E 00 00 */ stw r0, 0(r30) /* 8012FEC8 0012CE28 4B F2 58 29 */ bl __dt__6CActorFv diff --git a/asm/MetroidPrime/Weapons/CIceImpact.s b/asm/MetroidPrime/Weapons/CIceImpact.s index 8f6e9e3c..6abc040d 100644 --- a/asm/MetroidPrime/Weapons/CIceImpact.s +++ b/asm/MetroidPrime/Weapons/CIceImpact.s @@ -2188,9 +2188,9 @@ lbl_801B79E0: lbl_801B7A08: /* 801B7A08 001B4968 28 1E 00 00 */ cmplwi r30, 0 /* 801B7A0C 001B496C 41 82 00 1C */ beq lbl_801B7A28 -/* 801B7A10 001B4970 3C 80 80 3E */ lis r4, lbl_803DA118@ha +/* 801B7A10 001B4970 3C 80 80 3E */ lis r4, __vt__7CEffect@ha /* 801B7A14 001B4974 7F C3 F3 78 */ mr r3, r30 -/* 801B7A18 001B4978 38 04 A1 18 */ addi r0, r4, lbl_803DA118@l +/* 801B7A18 001B4978 38 04 A1 18 */ addi r0, r4, __vt__7CEffect@l /* 801B7A1C 001B497C 38 80 00 00 */ li r4, 0 /* 801B7A20 001B4980 90 1E 00 00 */ stw r0, 0(r30) /* 801B7A24 001B4984 4B E9 DC CD */ bl __dt__6CActorFv diff --git a/include/MetroidPrime/CEffect.hpp b/include/MetroidPrime/CEffect.hpp index 01bd2a3b..eaec2278 100644 --- a/include/MetroidPrime/CEffect.hpp +++ b/include/MetroidPrime/CEffect.hpp @@ -11,7 +11,11 @@ public: const CTransform4f& xf); // CEntity - ~CEffect(); + ~CEffect() {} + + // CActor + virtual void AddToRenderer(const CFrustumPlanes&, const CStateManager&) const; + virtual void Render(const CStateManager&) const; }; CHECK_SIZEOF(CEffect, 0xe8) diff --git a/src/MetroidPrime/CEffect.cpp b/src/MetroidPrime/CEffect.cpp new file mode 100644 index 00000000..e7ade404 --- /dev/null +++ b/src/MetroidPrime/CEffect.cpp @@ -0,0 +1,12 @@ +#include "MetroidPrime/CEffect.hpp" + +#include "MetroidPrime/CActorParameters.hpp" + +CEffect::CEffect(TUniqueId uid, const CEntityInfo& info, bool active, const rstl::string& name, + const CTransform4f& xf) +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(kMT_NoStepLogic), + CActorParameters::None(), kInvalidUniqueId) {} + +void CEffect::AddToRenderer(const CFrustumPlanes&, const CStateManager&) const {} + +void CEffect::Render(const CStateManager&) const {}