mirror of
https://github.com/zeldaret/st
synced 2026-08-11 03:26:12 -04:00
Decompiling Actor NFSP (#117)
* feat: decompiling UnkNFSP * feat: matching jp .data and enhance .text * feat: match last function thx2yanis * fix: reorder functions and localize symbols * style: cleanup * style: move default case
This commit is contained in:
@@ -446,9 +446,9 @@ bool ActorHeart_C4::vfunc_00(ActorRef ref, unk32 param3) {
|
||||
return this->Actor_C4::vfunc_00(ref, param3);
|
||||
}
|
||||
|
||||
void ActorHeart_C4::vfunc_04() {
|
||||
bool ActorHeart_C4::vfunc_04() {
|
||||
this->GetActorPtr<ActorHeart>()->SetState(ActorHeartState_5);
|
||||
this->Actor_C4::vfunc_04();
|
||||
return this->Actor_C4::vfunc_04();
|
||||
}
|
||||
|
||||
void ActorHeart_C4::vfunc_0C(unk32 param1) {
|
||||
|
||||
@@ -542,9 +542,9 @@ bool ActorItemDrop_C4::vfunc_00(ActorRef ref, unk32 param2) {
|
||||
return Actor_C4::vfunc_00(ref, param2);
|
||||
}
|
||||
|
||||
void ActorItemDrop_C4::vfunc_04() {
|
||||
bool ActorItemDrop_C4::vfunc_04() {
|
||||
this->GetActorPtr<ActorItemDrop>()->SetState(ActorItemDropState_5);
|
||||
Actor_C4::vfunc_04();
|
||||
return Actor_C4::vfunc_04();
|
||||
}
|
||||
|
||||
void ActorItemDrop_C4::vfunc_0C(unk32 param1) {
|
||||
|
||||
@@ -829,9 +829,9 @@ bool ActorRupee_C4::vfunc_00(ActorRef ref, unk32 param2) {
|
||||
return this->Actor_C4::vfunc_00(ref, param2);
|
||||
}
|
||||
|
||||
void ActorRupee_C4::vfunc_04() {
|
||||
bool ActorRupee_C4::vfunc_04() {
|
||||
this->GetActorPtr<ActorRupee>()->SetState(ActorRupeeState_8);
|
||||
this->Actor_C4::vfunc_04();
|
||||
return this->Actor_C4::vfunc_04();
|
||||
}
|
||||
|
||||
void ActorRupee_C4::vfunc_0C(unk32 param1) {
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#include "Actor/ActorUnkNFSP.hpp"
|
||||
|
||||
#include "Actor/ActorManager.hpp"
|
||||
#include "MapObject/MapObjectUnkSWFS.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
|
||||
class ActorUnkNFSP_vfunc_54 : public Actor {
|
||||
public:
|
||||
/* 000 (base) */
|
||||
/* 094 */ STRUCT_PAD(0x94, 0x2B0);
|
||||
/* 2B0 */ unk32 mUnk_2B0;
|
||||
/* 2B4 */
|
||||
};
|
||||
|
||||
class ActorUnkNFSP_ov031_020fb9b4 : public Actor {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
/* 94 */ STRUCT_PAD(0x94, 0xE8);
|
||||
/* E8 */ VecFx32 mUnk_E8;
|
||||
/* F4 */
|
||||
};
|
||||
|
||||
extern "C" void func_01ff993c(VecFx32 *, VecFx32 *, unk32);
|
||||
|
||||
DECL_PROFILE(ActorProfileUnkNFSP);
|
||||
|
||||
Actor *ActorProfileUnkNFSP::Create() {
|
||||
@@ -10,26 +29,200 @@ Actor *ActorProfileUnkNFSP::Create() {
|
||||
}
|
||||
|
||||
ActorProfileUnkNFSP::ActorProfileUnkNFSP() :
|
||||
ActorProfile_Derived1(ActorId_NFSP) {}
|
||||
ActorProfile_Derived1(ActorId_NFSP) {
|
||||
this->mUnk_04.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.4f));
|
||||
}
|
||||
|
||||
ActorUnkNFSP::ActorUnkNFSP() {}
|
||||
ActorUnkNFSP::ActorUnkNFSP() :
|
||||
mUnk_94(0x4),
|
||||
mUnk_98(0x0),
|
||||
mUnk_9A(0x0),
|
||||
mUnk_9C(NULL),
|
||||
mUnk_C0(this),
|
||||
mUnk_E4(0x0) {
|
||||
this->mUnk_40 = &this->mUnk_C0;
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fb8d8(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fb920(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fb988(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fb994(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fb9b4(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fba60(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbaec(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbb88(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbb8c(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbba0(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbbe0(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbc04(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbc3c(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbc94(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbcc0(void) {}
|
||||
void ActorUnkNFSP::func_ov031_020fbcf0(void) {}
|
||||
bool ActorUnkNFSP::vfunc_18(unk32 param1) {
|
||||
this->mUnk_9C = (MapObjectUnkSWFS *) param1;
|
||||
|
||||
ActorUnkNFSP::~ActorUnkNFSP() {}
|
||||
ActorProfileUnkNFSP::~ActorProfileUnkNFSP() {}
|
||||
this->mUnk_C0.mUnk_08 = 0x0;
|
||||
this->mUnk_C0.mUnk_0A = 0x0;
|
||||
this->mUnk_C0.mUnk_0C = 0x1000;
|
||||
this->mUnk_C0.mUnk_0E = 0x0;
|
||||
this->mUnk_C0.mUnk_10 = 0x0;
|
||||
this->mUnk_C0.mUnk_12 = 0x1000;
|
||||
|
||||
if (this->mUnk_5C.mParams[3] == 0x0) {
|
||||
this->vfunc_54(0x0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::vfunc_20() {
|
||||
this->mUnk_C0.mUnk_1C = 0x1;
|
||||
|
||||
switch (this->mUnk_94) {
|
||||
case 0:
|
||||
this->func_ov031_020fb988();
|
||||
break;
|
||||
case 1:
|
||||
this->func_ov031_020fb994();
|
||||
break;
|
||||
case 2:
|
||||
this->func_ov031_020fb9b4();
|
||||
break;
|
||||
case 3:
|
||||
this->func_ov031_020fba60();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (this->mUnk_98 < this->mUnk_9A) {
|
||||
++this->mUnk_98;
|
||||
}
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fb988() {
|
||||
this->func_ov031_020fbb8c();
|
||||
}
|
||||
|
||||
Actor *ActorUnkNFSP::func_ov031_020fb994() {
|
||||
Actor *pActor = gpActorManager->func_01fff3b4(this->mUnk_E4);
|
||||
|
||||
if (pActor != NULL) {
|
||||
return pActor;
|
||||
}
|
||||
|
||||
//! @bug: missing return
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fb9b4() {
|
||||
ActorUnkNFSP_ov031_020fb9b4 *actor = (ActorUnkNFSP_ov031_020fb9b4 *) gpActorManager->func_01fff3b4(this->mUnk_E4);
|
||||
if (actor == NULL) {
|
||||
return;
|
||||
}
|
||||
VecFx32_Copy(&this->mPos, &this->mPrevPos);
|
||||
|
||||
VecFx32 vec = actor->mUnk_E8;
|
||||
|
||||
data_027e0ce0->func_01fff148(0x0);
|
||||
vec.z -= FLOAT_TO_FX32(1.0f);
|
||||
VecFx32_Copy(&vec, &this->mPos);
|
||||
|
||||
#if IS_JP
|
||||
this->mUnk_9C->func_ov031_0210d794(&this->mPos, 0x1);
|
||||
#else
|
||||
this->mUnk_9C->func_ov031_0210d794(&this->mPos, 0x0, 0x0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fba60() {
|
||||
VecFx32_Copy(&this->mPos, &this->mPrevPos);
|
||||
func_01ff993c(&this->mPos, &this->mUnk_5C.mInitialPos, 0x666);
|
||||
|
||||
#if IS_JP
|
||||
this->mUnk_9C->func_ov031_0210d794(&this->mPos, 0x0);
|
||||
#else
|
||||
this->mUnk_9C->func_ov031_0210d794(&this->mPos, 0x0, 0x0);
|
||||
#endif
|
||||
|
||||
if (this->mPos.x != this->mUnk_5C.mInitialPos.x || this->mPos.y != this->mUnk_5C.mInitialPos.y ||
|
||||
this->mPos.z != this->mUnk_5C.mInitialPos.z) {
|
||||
return;
|
||||
}
|
||||
#if IS_JP
|
||||
this->vfunc_54(0x4);
|
||||
#else
|
||||
this->vfunc_54(0x0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::vfunc_54(unk32 param1) {
|
||||
this->mUnk_94 = param1;
|
||||
this->mUnk_9A = 0xFFFF;
|
||||
this->mUnk_98 = 0x0;
|
||||
|
||||
switch (param1) {
|
||||
case 0x0:
|
||||
this->mUnk_40 = &this->mUnk_C0;
|
||||
break;
|
||||
case 0x1:
|
||||
this->mUnk_40 = &this->mUnk_C0;
|
||||
break;
|
||||
case 0x2:
|
||||
this->mUnk_40 = &this->mUnk_C0;
|
||||
break;
|
||||
case 0x3:
|
||||
ActorUnkNFSP_vfunc_54 *actor = (ActorUnkNFSP_vfunc_54 *) gpActorManager->func_01fff3b4(this->mUnk_E4);
|
||||
if (actor != NULL) {
|
||||
actor->mUnk_2B0 = 0x0;
|
||||
}
|
||||
this->mUnk_E4 = 0x0;
|
||||
this->mUnk_40 = NULL;
|
||||
if (this->mUnk_9C == NULL) {
|
||||
break;
|
||||
}
|
||||
this->mUnk_9C->func_ov031_0210d750();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::vfunc_2C(unk32 param1) {}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fbb8c() {
|
||||
this->mUnk_3C = &this->mUnk_A0;
|
||||
this->func_ov000_020989e0();
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fbba0(ActorRef ref) {
|
||||
if (this->mUnk_94 == 0x2) {
|
||||
return;
|
||||
}
|
||||
this->mUnk_E4 = ref;
|
||||
this->vfunc_54(0x1);
|
||||
}
|
||||
|
||||
void ActorUnkNFSP::func_ov031_020fbbe0() {
|
||||
this->vfunc_54(0x2);
|
||||
this->mUnk_9C->func_ov031_0210d710();
|
||||
}
|
||||
|
||||
ActorUnkNFSP_C0::ActorUnkNFSP_C0(ActorUnkNFSP *actor) :
|
||||
Actor_C4(actor) {
|
||||
this->mUnk_20 = actor;
|
||||
this->mUnk_04 = 0x1;
|
||||
}
|
||||
|
||||
bool ActorUnkNFSP_C0::vfunc_00(ActorRef ref, unk32 param2) {
|
||||
if (this->GetActorPtr<ActorUnkNFSP>()->mUnk_94 != 0x0) {
|
||||
return false;
|
||||
}
|
||||
if (param2 != 0x0) {
|
||||
this->GetActorPtr<ActorUnkNFSP>()->func_ov031_020fbba0(ref);
|
||||
}
|
||||
return this->Actor_C4::vfunc_00(ref, param2);
|
||||
}
|
||||
|
||||
bool ActorUnkNFSP_C0::vfunc_04() {
|
||||
if (this->GetActorPtr<ActorUnkNFSP>()->mUnk_94 != 0x1) {
|
||||
return false;
|
||||
}
|
||||
this->GetActorPtr<ActorUnkNFSP>()->func_ov031_020fbbe0();
|
||||
return this->Actor_C4::vfunc_04();
|
||||
}
|
||||
|
||||
void ActorUnkNFSP_C0::vfunc_08() {
|
||||
this->mUnk_04 = 0x1;
|
||||
this->GetActorPtr<ActorUnkNFSP>()->vfunc_54(0x3);
|
||||
this->Actor_C4::vfunc_08();
|
||||
}
|
||||
|
||||
void ActorUnkNFSP_C0::vfunc_0C(unk32 param1) {
|
||||
this->mUnk_04 = 0x1;
|
||||
this->GetActorPtr<ActorUnkNFSP>()->vfunc_54(0x3);
|
||||
this->Actor_C4::vfunc_0C(param1);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,11 @@ void MapObjectUnkSWFS::func_ov031_0210d5c4(void) {}
|
||||
void MapObjectUnkSWFS::func_ov031_0210d664(void) {}
|
||||
void MapObjectUnkSWFS::func_ov031_0210d710(void) {}
|
||||
void MapObjectUnkSWFS::func_ov031_0210d750(void) {}
|
||||
void MapObjectUnkSWFS::func_ov031_0210d794(void) {}
|
||||
#if IS_JP
|
||||
void MapObjectUnkSWFS::func_ov031_0210d794(VecFx32 *param1, unk32 param2) {}
|
||||
#else
|
||||
void MapObjectUnkSWFS::func_ov031_0210d794(VecFx32 *param1, unk32 param2, unk32 param3) {}
|
||||
#endif
|
||||
void MapObjectUnkSWFS::func_ov031_0210d924(void) {}
|
||||
void MapObjectUnkSWFS::func_ov031_0210d968(void) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user