mirror of
https://github.com/zeldaret/st
synced 2026-08-06 18:02:49 -04:00
Decompile overlay 101 (#118)
* delink the overlay * ItemManager_101 OK * UnkStruct_027e0ce0_40_101 OK * PlayerLinkActor_A0_1C_101 OK * UnkStruct_027e09a4_54_101 OK * UnkStruct_027e0cd8_0C_101 OK and MapObjectProfile_Derived6_101 OK
This commit is contained in:
@@ -221,7 +221,7 @@ THUMB_END
|
||||
|
||||
bool ItemManager::func_ov000_020a89d4() {
|
||||
if (this->mUnk_20 != NULL) {
|
||||
return (this->mUnk_20->mUnk_14.mUnk_08 & 0xFFFF) != 0xFFFF;
|
||||
return (this->mUnk_20->mUnk_14.mUnk_00.mUnk_08 & 0xFFFF) != 0xFFFF;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -253,18 +253,18 @@ bool ItemManager::func_ov000_020a8a74() {
|
||||
return this->mUnk_20->func_ov031_020db8f8();
|
||||
}
|
||||
|
||||
unk32 ItemManager::func_ov000_020a8a90() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_00 : 0;
|
||||
UnkStruct_ItemManager_20_00 *ItemManager::func_ov000_020a8a90() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_00 : NULL;
|
||||
}
|
||||
|
||||
unk32 ItemManager::func_ov000_020a8aa4() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_04 : 0;
|
||||
UnkStruct_ItemManager_20_04 *ItemManager::func_ov000_020a8aa4() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_04 : NULL;
|
||||
}
|
||||
|
||||
unk32 ItemManager::func_ov000_020a8ab8() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_0C : 0;
|
||||
UnkStruct_ItemManager_20_0C *ItemManager::func_ov000_020a8ab8() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_0C : NULL;
|
||||
}
|
||||
|
||||
unk32 ItemManager::func_ov000_020a8acc() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_10 : 0;
|
||||
UnkStruct_ItemManager_20_10 *ItemManager::func_ov000_020a8acc() {
|
||||
return this->mUnk_20 != NULL ? this->mUnk_20->mUnk_10 : NULL;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ ModelRender_Derived4::ModelRender_Derived4(PlayerCharacter character, unk32 para
|
||||
this->func_ov000_0208c058(this->mUnk_7C[1]);
|
||||
}
|
||||
|
||||
PlayerActorBase::PlayerActorBase(PlayerCharacter character, unk32 param2, unk32 param3, UnkStruct_027e0ce0_40 *param4) :
|
||||
PlayerActorBase::PlayerActorBase(PlayerCharacter character, unk32 param2, ItemManager *pItemMgr,
|
||||
UnkStruct_027e0ce0_40 *param4) :
|
||||
mPos(0, 0, 0),
|
||||
mPrevPos(0, 0, 0),
|
||||
mVel(0, 0, 0),
|
||||
@@ -52,7 +53,7 @@ PlayerActorBase::PlayerActorBase(PlayerCharacter character, unk32 param2, unk32
|
||||
mCharacter(character),
|
||||
mUnk_4C(param2),
|
||||
mUnk_50(param2, this->mUnk_44),
|
||||
mUnk_54(param3),
|
||||
mUnk_54(pItemMgr),
|
||||
mUnk_58(param4) {
|
||||
this->mUnk_5C.mUnk_04 = 0;
|
||||
this->mUnk_5C.mUnk_10 = &this->mUnk_5C.mUnk_08;
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0d34.hpp"
|
||||
|
||||
PlayerLinkActor::PlayerLinkActor(unk32 param1, unk32 param2, UnkStruct_027e0ce0_40 *param3, bool *param4) :
|
||||
PlayerActorBase(PlayerCharacter_Link, param1, param2, param3),
|
||||
PlayerLinkActor::PlayerLinkActor(unk32 param1, ItemManager *pItemMgr, UnkStruct_027e0ce0_40 *param3,
|
||||
UnkStruct_027e0ce0_40_150 *param4) :
|
||||
PlayerActorBase(PlayerCharacter_Link, param1, pItemMgr, param3),
|
||||
mUnk_094(param4),
|
||||
mUnk_098(0),
|
||||
mUnk_09C(new(HeapIndex_1) PlayerLinkActor_9C(param3, *(u32 *) &this->mUnk_50, this->mCharacter)),
|
||||
mUnk_0A0(new(HeapIndex_1) PlayerLinkActor_A0(param2, param3, this, this->mUnk_09C)),
|
||||
mUnk_0A0(new(HeapIndex_1) PlayerLinkActor_A0(pItemMgr, param3, this, this->mUnk_09C)),
|
||||
mUnk_0A4(this, this->mUnk_0A0),
|
||||
mUnk_0B0(-1),
|
||||
mUnk_0B4(false),
|
||||
@@ -45,7 +46,7 @@ PlayerLinkActor::~PlayerLinkActor() {
|
||||
delete this->mUnk_09C;
|
||||
}
|
||||
|
||||
void PlayerLinkActor::func_ov001_020bcb60(unk32 param1) {
|
||||
void PlayerLinkActor::func_ov001_020bcb60(UnkStruct_027e0ce0_40_328 *param1) {
|
||||
this->mUnk_098 = param1;
|
||||
this->mUnk_09C->mUnk_0F4 = param1;
|
||||
}
|
||||
@@ -79,8 +80,8 @@ void PlayerLinkActor::func_ov001_020bcbd0(VecFx32 *pVec) {
|
||||
this->mUnk_0A0->func_ov000_0209378c());
|
||||
|
||||
bool uVar1 = false;
|
||||
if (this->mUnk_094 != 0) {
|
||||
uVar1 = *this->mUnk_094;
|
||||
if (this->mUnk_094 != NULL) {
|
||||
uVar1 = this->mUnk_094->mUnk_00;
|
||||
}
|
||||
|
||||
this->mUnk_0A0->func_ov001_020bd388(uVar1, this->mUnk_0B6);
|
||||
|
||||
@@ -24,39 +24,11 @@ extern int data_ov089_02171540;
|
||||
|
||||
static UnkStruct_ov001_020c40f4 data_ov001_020c40f4[0x40];
|
||||
|
||||
struct UnkStruct_ov001_020c2a40 {
|
||||
/* 00 */ unk32 unk_00;
|
||||
/* 04 */ unk32 unk_04;
|
||||
/* 08 */ unk16 unk_08;
|
||||
/* 0A */ u8 unk_0A;
|
||||
/* 0B */ u8 unk_0B;
|
||||
/* 0C */ u8 unk_0C;
|
||||
/* 0D */ u8 unk_0D;
|
||||
/* 0E */ u8 unk_0E;
|
||||
/* 0F */ u8 unk_0F;
|
||||
/* 10 */ u8 unk_10;
|
||||
/* 11 */ STRUCT_PAD(0x11, 0x14); // pad?
|
||||
/* 14 */
|
||||
|
||||
UnkStruct_ov001_020c2a40(unk32 param1, unk32 param2, unk16 param3, unk8 param4, unk8 param5, unk8 param6, unk8 param7) {
|
||||
this->unk_00 = param1;
|
||||
this->unk_04 = param2;
|
||||
this->unk_08 = param3;
|
||||
this->unk_0A = param4;
|
||||
this->unk_0B = param5;
|
||||
this->unk_0C = param6;
|
||||
this->unk_0D = param7;
|
||||
this->unk_0E = 0x2B;
|
||||
this->unk_0F = 0;
|
||||
this->unk_10 = 0;
|
||||
}
|
||||
};
|
||||
|
||||
static const UnkStruct_ov001_020c2a40 data_ov001_020c2a40[] = {
|
||||
UnkStruct_ov001_020c2a40(0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C),
|
||||
UnkStruct_ov001_020c2a40(0x29, 0x00, 0x00, 0x0B, 0x01, 0x00, 0x3D),
|
||||
UnkStruct_ov001_020c2a40(0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E),
|
||||
UnkStruct_ov001_020c2a40(0x04, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x3F),
|
||||
static const EntranceInfo data_ov001_020c2a40[] = {
|
||||
EntranceInfo(SceneIndex_f_bridge, 0x00, 0x00, 0, 0, false, 0x3C),
|
||||
EntranceInfo(SceneIndex_f_htown, 0x00, 0x00, 11, 1, false, 0x3D),
|
||||
EntranceInfo(SceneIndex_f_tetsuo, 0x00, 0x00, 0, 0, false, 0x3E),
|
||||
EntranceInfo(SceneIndex_t_area0, 0x00, 0x00, 0, 0xFA, false, 0x3F),
|
||||
};
|
||||
|
||||
// https://decomp.me/scratch/JcRNn
|
||||
@@ -356,8 +328,8 @@ void UnkStruct_027e0cd8_0C_Base::func_ov001_020b8c30(const EntranceInfo ¶m1)
|
||||
this->mUnk_154.push_back(param1);
|
||||
}
|
||||
|
||||
void *UnkStruct_027e0cd8_0C_Base::func_ov001_020b8c80(unk32 param1) {
|
||||
return (void *) &data_ov001_020c2a40[param1 - 0x3C];
|
||||
const EntranceInfo *UnkStruct_027e0cd8_0C_Base::func_ov001_020b8c80(unk32 param1) {
|
||||
return &data_ov001_020c2a40[param1 - 0x3C];
|
||||
}
|
||||
|
||||
void UnkStruct_027e0cd8_0C_Base::func_ov001_020b8c90(ZMBSectionCMPT *pCMPT) {
|
||||
|
||||
@@ -37,7 +37,7 @@ UnkStruct_027e0ce0 *UnkStruct_027e0ce0::Create() {
|
||||
UnkStruct_027e0ce0::UnkStruct_027e0ce0() :
|
||||
mUnk_02(false),
|
||||
mUnk_03(false),
|
||||
mUnk_04(NULL),
|
||||
mEquippedItem(ItemFlag_Nothing),
|
||||
mUnk_08(false),
|
||||
mUnk_0C(this),
|
||||
mUnk_1C(new(HeapIndex_1) UnkStruct_027e0ce0_1C()),
|
||||
@@ -100,9 +100,9 @@ void UnkStruct_027e0ce0::func_ov001_020bc524(bool param1) {
|
||||
this->mUnk_24->func_ov021_020eaa08(this->mUnk_20);
|
||||
} else {
|
||||
if (data_027e09a4->IsTrain()) {
|
||||
this->mUnk_03 = false;
|
||||
this->mUnk_04 = NULL;
|
||||
this->mUnk_38 = &data_027e0478.train;
|
||||
this->mUnk_03 = false;
|
||||
this->mEquippedItem = ItemFlag_Nothing;
|
||||
this->mUnk_38 = &data_027e0478.train;
|
||||
new(this->mUnk_38) UnkStruct_027e0ce0_38(0);
|
||||
this->mUnk_38->func_ov026_020dc8f0();
|
||||
} else {
|
||||
@@ -111,7 +111,7 @@ void UnkStruct_027e0ce0::func_ov001_020bc524(bool param1) {
|
||||
this->func_ov000_0208a2c4(0x0C, 0);
|
||||
}
|
||||
|
||||
this->mUnk_04 = NULL;
|
||||
this->mEquippedItem = ItemFlag_Nothing;
|
||||
} else if (this->mHealth == 0) {
|
||||
this->func_ov000_0208a2c4(0x01, 0);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void UnkStruct_027e0ce0::func_ov001_020bc524(bool param1) {
|
||||
this->mUnk_3C = new(HeapIndex_1) UnkStruct_027e0ce0_3C();
|
||||
} else {
|
||||
this->mUnk_40 = &data_027e0478.land;
|
||||
new(this->mUnk_40) UnkStruct_027e0ce0_40(param1, this->mUnk_20, &this->mUnk_04, this->mUnk_28);
|
||||
new(this->mUnk_40) UnkStruct_027e0ce0_40(param1, this->mUnk_20, &this->mEquippedItem, this->mUnk_28);
|
||||
uVar3 = this->mUnk_40;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ void CargoManager::RemoveAmount(unk32 decr) {
|
||||
|
||||
bool CargoManager::func_ov017_020bec9c() {
|
||||
if (data_027e09a4->IsTrain()) {
|
||||
return data_027e0cd8->GetUnk0C()->mUnk_160->func_ov026_02106aa8();
|
||||
return data_027e0cd8->GetUnk0C()->mUnk_160[0]->func_ov026_02106aa8();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -10,9 +10,7 @@ MapObject *MapObjectProfileUnkSAND::Create() {
|
||||
}
|
||||
|
||||
MapObjectProfileUnkSAND::MapObjectProfileUnkSAND() :
|
||||
MapObjectProfile(MapObjectId_SAND) {}
|
||||
|
||||
MapObjectUnkSAND::MapObjectUnkSAND() {}
|
||||
MapObjectProfile_Derived6(MapObjectId_SAND, MapObjectId_SAND) {}
|
||||
|
||||
void MapObjectUnkSAND::func_ov031_0210acd4(void) {}
|
||||
void MapObjectUnkSAND::func_ov031_0210ad64(void) {}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#include "Item/ItemManager.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_027e0d2c.hpp"
|
||||
#include "Unknown/UnkStruct_027e0d30.hpp"
|
||||
#include "Unknown/UnkStruct_027e0d38.hpp"
|
||||
|
||||
UnkStruct_ItemManager_20_04::UnkStruct_ItemManager_20_04() :
|
||||
mUnk_000(0),
|
||||
mUnk_004(false) {}
|
||||
|
||||
UnkStruct_ItemManager_20_04::~UnkStruct_ItemManager_20_04() {}
|
||||
|
||||
UnkStruct_ItemManager_20::UnkStruct_ItemManager_20() :
|
||||
mUnk_00(new(HeapIndex_1) UnkStruct_ItemManager_20_00()),
|
||||
mUnk_04(new(HeapIndex_1) UnkStruct_ItemManager_20_04()),
|
||||
mUnk_08(new(HeapIndex_1) UnkStruct_ItemManager_20_08()),
|
||||
mUnk_0C(new(HeapIndex_1) UnkStruct_ItemManager_20_0C()),
|
||||
mUnk_10(new(HeapIndex_1) UnkStruct_ItemManager_20_10()) {
|
||||
this->mUnk_00->func_ov031_020d9bd0();
|
||||
this->mUnk_04->func_ov031_020d9598();
|
||||
this->mUnk_08->func_ov031_020d9658();
|
||||
}
|
||||
|
||||
UnkStruct_ItemManager_20::~UnkStruct_ItemManager_20() {
|
||||
UnkStruct_027e0d30::Destroy();
|
||||
UnkStruct_027e0d2c::Destroy();
|
||||
UnkStruct_027e0d38::Destroy();
|
||||
delete this->mUnk_10;
|
||||
delete this->mUnk_0C;
|
||||
delete this->mUnk_08;
|
||||
delete this->mUnk_04;
|
||||
delete this->mUnk_00;
|
||||
}
|
||||
|
||||
void UnkStruct_ItemManager_20::func_ov101_02182d5c() {
|
||||
this->mUnk_00->func_ov031_020dba40();
|
||||
this->mUnk_04->func_ov031_020db338();
|
||||
|
||||
UnkStruct_ItemManager_20_08 *pUnk_08 = this->mUnk_08;
|
||||
pUnk_08->mUnk_00 = 0;
|
||||
pUnk_08->mUnk_02 = 1;
|
||||
pUnk_08->func_ov031_020db5b4();
|
||||
|
||||
this->mUnk_0C->func_ov031_020db954();
|
||||
this->mUnk_10->func_ov031_020db2b0();
|
||||
}
|
||||
|
||||
void UnkStruct_027e0d30::Destroy() {
|
||||
if (data_027e0d30 != NULL) {
|
||||
delete data_027e0d30;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0d2c::Destroy() {
|
||||
if (data_027e0d2c != NULL) {
|
||||
delete data_027e0d2c;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0d38::Destroy() {
|
||||
if (data_027e0d38 != NULL) {
|
||||
delete data_027e0d38;
|
||||
}
|
||||
}
|
||||
|
||||
DECL_INSTANCE_DTOR(UnkStruct_027e0d30, data_027e0d30);
|
||||
DECL_INSTANCE_DTOR(UnkStruct_027e0d2c, data_027e0d2c);
|
||||
DECL_INSTANCE_DTOR(UnkStruct_027e0d38, data_027e0d38);
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "MapObject/MapObjectProfile.hpp"
|
||||
#include "Unknown/UnkStruct_027e09c0.hpp"
|
||||
|
||||
extern UnkStruct_027e09c0_04 data_ov031_02118900;
|
||||
|
||||
// probably not here but this is unused
|
||||
struct UnkStruct_ov101_021839c8 {
|
||||
/* 00 */ unk32 mUnk_00;
|
||||
/* 00 */ unk32 mUnk_04;
|
||||
/* 00 */ unk32 mUnk_08;
|
||||
|
||||
UnkStruct_ov101_021839c8() {
|
||||
this->mUnk_04 = 0x10002;
|
||||
this->mUnk_00 = 0x10006;
|
||||
this->mUnk_08 = 0x10009;
|
||||
}
|
||||
};
|
||||
static const UnkStruct_ov101_021839c8 data_ov101_021839c8;
|
||||
|
||||
void MapObjectProfile_Derived6::vfunc_10() {
|
||||
this->MapObjectProfile_Derived2::vfunc_10();
|
||||
data_ov031_02118900.func_ov000_0207f4d4();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "Actor/ActorManager.hpp"
|
||||
#include "Player/PlayerLink.hpp"
|
||||
|
||||
extern unk32 data_ov000_020b3000;
|
||||
|
||||
PlayerLinkActor_A0_1C::PlayerLinkActor_A0_1C(unk32 param1) {
|
||||
this->mUnk_00 = param1;
|
||||
this->mUnk_04 = 0x00;
|
||||
this->mUnk_06 = false;
|
||||
this->mUnk_0C.Reset();
|
||||
}
|
||||
|
||||
void PlayerLinkActor_A0_1C::func_ov101_02183290() {
|
||||
this->mUnk_06 = false;
|
||||
this->mUnk_0C.Reset();
|
||||
|
||||
struct {
|
||||
void *ptr;
|
||||
unk32 actorId;
|
||||
} local_14;
|
||||
local_14.ptr = &data_ov000_020b3000;
|
||||
local_14.actorId = ActorId_IWTS;
|
||||
|
||||
Actor **ppActor = gpActorManager->func_01fff350(&local_14, gpActorManager->mActorTable);
|
||||
|
||||
// why is this a loop
|
||||
while (ppActor != gpActorManager->mUnk_08) {
|
||||
ActorRef ref = (*ppActor)->mRef;
|
||||
this->mUnk_0C = ref;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#include "Unknown/Common.hpp"
|
||||
#include "Unknown/UnkStruct_02049be0.hpp"
|
||||
#include "Unknown/UnkStruct_027e09a0.hpp"
|
||||
#include "Unknown/UnkStruct_027e09a4.hpp"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
UnkStruct_027e09a4_54_Derived1::UnkStruct_027e09a4_54_Derived1(unk32 *param1) :
|
||||
UnkStruct_027e09a4_54_Base(param1) {
|
||||
this->mUnk_04.Init(sizeof(UnkStruct_027e09a4_54_04) * 4);
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4_54_Derived1::vfunc_0C() {
|
||||
this->UnkStruct_027e09a4_54_Base::vfunc_0C();
|
||||
|
||||
bool unk_1B_and_0x40 = data_027e09a0->GetCourseEntry(this->mUnk_1C.sceneIndex)->unk_1B & 0x40;
|
||||
|
||||
{
|
||||
UnkStruct_StackTitleScreen auStack_2c("Screen/tex2d.bin", 0x01);
|
||||
|
||||
if (unk_1B_and_0x40) {
|
||||
auStack_2c.func_ov000_02059270(0x28, "scratchBalloon", 0x35B00000);
|
||||
auStack_2c.func_ov000_02059270(0x29, "scratchPen", 0x35A00000);
|
||||
auStack_2c.func_ov000_02059270(0x2A, "scratchArrow", 0x34B00000);
|
||||
auStack_2c.func_ov000_02059270(0x2B, "scratchLink0", 0x2D200000);
|
||||
auStack_2c.func_ov000_02059270(0x2C, "scratchLink1", 0x34A00000);
|
||||
}
|
||||
|
||||
auStack_2c.func_ov000_02059270(0x2E, "boomhit", 0x29200000);
|
||||
auStack_2c.func_ov000_02059270(0x2F, "subhit", 0x29200000);
|
||||
|
||||
this->vfunc_10(&auStack_2c);
|
||||
}
|
||||
|
||||
if (unk_1B_and_0x40) {
|
||||
const char *pcVar2 = data_02049be0.func_02014ff4();
|
||||
|
||||
wchar_t acStack_6c[32];
|
||||
acStack_6c[ARRAY_LEN(acStack_6c) - 1] = L'\0';
|
||||
|
||||
strncpy((char *) acStack_6c, pcVar2, sizeof(acStack_6c) - 1);
|
||||
|
||||
const char *pathEnd = "/Screen/tex2d.bin";
|
||||
size_t length = strlen((char *) acStack_6c);
|
||||
strncpy((char *) acStack_6c + length, pathEnd, sizeof(acStack_6c) - 1 - length);
|
||||
|
||||
UnkStruct_StackTitleScreen austack_80((char *) acStack_6c, 0x01);
|
||||
austack_80.func_ov000_02059270(0x2D, "scratchText", 0x34B00000);
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e09a4_54_Derived1::vfunc_10(UnkStruct_StackTitleScreen *param1) {}
|
||||
@@ -0,0 +1,176 @@
|
||||
#include "Actor/Actor.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_0204a088.hpp"
|
||||
#include "Unknown/UnkStruct_027e09b8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
|
||||
#include <nitro/mi.h>
|
||||
|
||||
struct UnkStruct_ov070_0214dc74 {
|
||||
/* 00 */ SceneIndex sceneIndex;
|
||||
/* 04 */ u8 unk_04[4];
|
||||
/* 08 */
|
||||
};
|
||||
extern UnkStruct_ov070_0214dc74 data_ov070_0214dc74[18];
|
||||
extern "C" UnkStruct_ov070_0214dc74 *func_ov070_02143fe4(int index);
|
||||
|
||||
UnkStruct_027e0cd8_0C::UnkStruct_027e0cd8_0C(UnkStruct_027e0cd8 *param1) :
|
||||
UnkStruct_027e0cd8_0C_Base(param1) {
|
||||
this->mUnk_1D0 = 0x00;
|
||||
this->mUnk_1D4 = 0x00;
|
||||
this->mUnk_1D8 = -1;
|
||||
this->mUnk_1DC = false;
|
||||
this->mUnk_1DD = false;
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(this->mUnk_170); i++) {
|
||||
this->mUnk_160[i] = NULL;
|
||||
this->mUnk_1C0[i] = NULL;
|
||||
|
||||
for (int j = 0; j < ARRAY_LEN(this->mUnk_170[i]); j++) {
|
||||
this->mUnk_170[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_027e0cd8_0C::~UnkStruct_027e0cd8_0C() {
|
||||
for (int i = 0; i < this->mUnk_1D4; i++) {
|
||||
if (this->mUnk_160[i] != NULL) {
|
||||
this->mUnk_160[i]->~UnkStruct_027e0cd8_0C_160();
|
||||
DELETE(this->mUnk_160[i]);
|
||||
}
|
||||
|
||||
this->mUnk_1C0[i] = NULL;
|
||||
|
||||
for (int j = 0; j < ARRAY_LEN(this->mUnk_170[i]); j++) {
|
||||
DELETE(this->mUnk_170[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->mUnk_1D0 != NULL) {
|
||||
delete this->mUnk_1D0;
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0cd8_0C::vfunc_38() {
|
||||
this->UnkStruct_027e0cd8_0C_Base::vfunc_38();
|
||||
|
||||
EntranceInfo local_28;
|
||||
MI_CpuCopy32((void *) this->func_ov001_020b8c80(0x3F), &local_28, sizeof(EntranceInfo));
|
||||
local_28.sceneIndex = data_027e09a4->mUnk_2C.mSceneIndex;
|
||||
this->func_ov001_020b8c30(local_28);
|
||||
|
||||
EntranceInfo auStack_3c;
|
||||
MI_CpuCopy32((void *) this->func_ov001_020b8c80(0x3D), &auStack_3c, sizeof(EntranceInfo));
|
||||
this->func_ov001_020b8c30(auStack_3c);
|
||||
|
||||
this->func_ov031_020d8738();
|
||||
this->func_ov031_020d88c0();
|
||||
this->func_ov031_020d8ae4();
|
||||
|
||||
if (data_027e09a4->CurrentCSIndex() == CutsceneIndex_PassengerCarBeforeMalladusFight &&
|
||||
!data_027e09b8->HasAdventureFlag(AdventureFlag_DefeatedDemonTrain2)) {
|
||||
stack_ov000_02073578 local_48;
|
||||
local_48.unk_08 = 0x16;
|
||||
local_48.unk_00 = 0x01;
|
||||
data_027e09b8->func_ov000_02073578(&local_48, 0x01);
|
||||
} else {
|
||||
data_0204a088->func_ov000_020611fc(0x01);
|
||||
data_0204a088->func_ov000_02061230();
|
||||
}
|
||||
|
||||
if (data_027e09a4->IsSceneModeAdventure()) {
|
||||
this->mUnk_1D0 = new(HeapIndex_1) UnkStruct_027e0cd8_0C_1D0();
|
||||
}
|
||||
}
|
||||
|
||||
void UnkStruct_027e0cd8_0C::vfunc_08() {
|
||||
if (this->mUnk_1D0 != NULL) {
|
||||
this->mUnk_1D0->func_ov101_021837a0();
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_027e0cd8_0C_1D0::UnkStruct_027e0cd8_0C_1D0() {}
|
||||
|
||||
UnkStruct_027e0cd8_0C_1D0::~UnkStruct_027e0cd8_0C_1D0() {}
|
||||
|
||||
void func_ov101_02183884(int index, unk32 param2, unk32 param3);
|
||||
|
||||
void UnkStruct_027e0cd8_0C_1D0::func_ov101_021837a0() {
|
||||
ActorParams sp14;
|
||||
ActorRef sp10;
|
||||
bool spC;
|
||||
|
||||
struct {
|
||||
u32 i;
|
||||
SceneIndex sceneIndex;
|
||||
} stack;
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
func_ov101_02183884(i, 0x00, 0x00);
|
||||
}
|
||||
|
||||
spC = false;
|
||||
|
||||
bool var_r6;
|
||||
if (data_027e09a4->IsCutscene()) {
|
||||
var_r6 = false;
|
||||
} else {
|
||||
var_r6 = true;
|
||||
bool var_r4_2 = true;
|
||||
|
||||
UnkStruct_027e09a4 *ptr = data_027e09a4;
|
||||
if (ptr->GetCurrentCourseEntry()->unk_10 != 0x01 && ptr->GetCurrentCourseEntry()->unk_10 != 0x03) {
|
||||
var_r4_2 = false;
|
||||
}
|
||||
|
||||
if (var_r4_2) {
|
||||
|
||||
stack.sceneIndex = data_027e09a4->CurrentSceneIndex();
|
||||
|
||||
for (stack.i = 0; stack.i < ARRAY_LEN(data_ov070_0214dc74); stack.i++) {
|
||||
UnkStruct_ov070_0214dc74 *pEntry = func_ov070_02143fe4(stack.i);
|
||||
|
||||
if (stack.sceneIndex == pEntry->sceneIndex) {
|
||||
spC = true;
|
||||
var_r6 = false;
|
||||
|
||||
for (int j = 0; j < ARRAY_LEN(pEntry->unk_04); j++) {
|
||||
if (pEntry->unk_04[j] == data_027e0cd8->func_ov000_02081d5c()) {
|
||||
var_r6 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spC) {
|
||||
sp14.mUnk_28.Reset();
|
||||
sp14.func_ov000_020975f8();
|
||||
sp14.func_ov000_020975f8();
|
||||
|
||||
if (var_r6) {
|
||||
sp14.mParams[1] = 0x01;
|
||||
}
|
||||
|
||||
Actor::func_ov000_020973f4(&sp10, &data_ov000_020b539c_eur, ActorId_RCSG, &sp14, 0x00);
|
||||
}
|
||||
|
||||
if (var_r6) {
|
||||
data_027e0cd8->mUnk_17 = true;
|
||||
}
|
||||
}
|
||||
|
||||
void func_ov101_02183884(int index, unk32 param2, unk32 param3) {
|
||||
ActorParams params;
|
||||
ActorRef ref;
|
||||
|
||||
params.mUnk_28.Reset();
|
||||
params.func_ov000_020975f8();
|
||||
|
||||
params.mParams[0] = index;
|
||||
params.mUnk_18[0] = param2;
|
||||
params.mUnk_1A[0] = param3;
|
||||
|
||||
Actor::func_ov000_020973f4(&ref, &data_ov000_020b539c_eur, ActorId_MLCK, ¶ms, 0x00);
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
#include "System/OverlayManager.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_027e09a4.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0ce0.hpp"
|
||||
|
||||
#include <nitro/math.h>
|
||||
|
||||
UnkStruct_027e0ce0_40::UnkStruct_027e0ce0_40(bool param1, UnkStruct_027e0ce0_20 *param2, ItemFlag *pEquippedItem,
|
||||
ItemManager *pItemMgr) :
|
||||
UnkStruct_027e0ce0_40_Base(-1, param2, pItemMgr),
|
||||
mUnk_14C(gOverlayManager.IsPlayerSub() ? new(HeapIndex_1) UnkStruct_027e0ce0_40_14C() : NULL),
|
||||
mUnk_150(data_027e09a4->IsCastleOrTown() ? new(HeapIndex_1) UnkStruct_027e0ce0_40_150() : NULL),
|
||||
mPlayer(-1, pItemMgr, this, this->mUnk_150),
|
||||
mUnk_328(gOverlayManager.IsPlayerSub() ? new(HeapIndex_1)
|
||||
UnkStruct_027e0ce0_40_328(pItemMgr, this, this->mUnk_150, pEquippedItem)
|
||||
: NULL),
|
||||
mEquippedItem(*pEquippedItem),
|
||||
mIsSceneTowerInsideStairs(data_027e09a4->IsTowerInsideStairs()),
|
||||
mIsSceneTowerOutsideStairs(data_027e09a4->IsTowerOutsideStairs()),
|
||||
mIsSceneBossByrne(data_027e09a4->IsBossByrne()),
|
||||
mUnk_33B(param1) {
|
||||
this->mpPlayer = &this->mPlayer;
|
||||
this->mUnk_330 = this->mUnk_328;
|
||||
this->mPlayer.func_ov001_020bcb60(this->mUnk_328);
|
||||
|
||||
if (this->mUnk_328 != NULL) {
|
||||
this->mUnk_328->mpPlayer = &this->mPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_027e0ce0_40::~UnkStruct_027e0ce0_40() {
|
||||
delete this->mUnk_328;
|
||||
delete this->mUnk_150;
|
||||
delete this->mUnk_14C;
|
||||
}
|
||||
|
||||
bool UnkStruct_027e0ce0_40::func_ov101_02182fb4(bool param1) {
|
||||
this->func_ov001_020bc0e0(true);
|
||||
|
||||
if (this->mUnk_14C != NULL) {
|
||||
this->mUnk_14C->func_ov093_02168850();
|
||||
}
|
||||
|
||||
if (this->mUnk_150 != NULL) {
|
||||
param1 = this->mUnk_150->func_ov096_02179c54(param1, this->mUnk_33B);
|
||||
}
|
||||
|
||||
this->mPlayer.func_ov001_020bcb70();
|
||||
|
||||
if (this->mUnk_328 != NULL) {
|
||||
this->mUnk_328->func_ov093_0216d0d4();
|
||||
}
|
||||
|
||||
return param1;
|
||||
}
|
||||
|
||||
void UnkStruct_027e0ce0_40::func_ov101_02183004() {
|
||||
if (this->mUnk_328 != NULL) {
|
||||
this->mUnk_328->func_ov093_0216d160();
|
||||
}
|
||||
|
||||
this->mPlayer.func_ov001_020bcba8();
|
||||
}
|
||||
|
||||
void UnkStruct_027e0ce0_40::func_ov101_02183024(const UnkStruct_ov001_020c40f4 *param1, const UnkStruct_ov001_020c40f4 *param2,
|
||||
unk32 param3, unk32 param4, ItemManager *pItemMgr,
|
||||
UnkStruct_027e0ce0_30 *param6, bool param7, bool param8) {
|
||||
bool var_r7 = false;
|
||||
|
||||
if (this->mUnk_328 != NULL) {
|
||||
if (GET_FLAG2(this->mUnk_104, UnkFlags3_4)) {
|
||||
var_r7 = true;
|
||||
}
|
||||
|
||||
switch (param4) {
|
||||
case 0x00:
|
||||
if (this->mIsSceneTowerInsideStairs || this->mIsSceneTowerOutsideStairs || this->mIsSceneBossByrne) {
|
||||
var_r7 = true;
|
||||
|
||||
if (this->mEquippedItem == ItemFlag_Nothing) {
|
||||
var_r7 = false;
|
||||
}
|
||||
|
||||
if (this->mIsSceneTowerInsideStairs && pItemMgr != NULL) {
|
||||
if (pItemMgr->GetTearsAmount() != 0 && pItemMgr->GetTearsAmount() != MAX_TEARS_OF_LIGHT) {
|
||||
pItemMgr->SetTearsAmount(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x01:
|
||||
var_r7 = true;
|
||||
break;
|
||||
case 0x02:
|
||||
var_r7 = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->mUnk_150 != NULL && this->mUnk_150->mUnk_01) {
|
||||
var_r7 = false;
|
||||
} else if (param7 || param8) {
|
||||
var_r7 = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool sp8 = var_r7;
|
||||
if (var_r7) {
|
||||
if (!VecFx32_IsEqual(¶m1->mUnk_00, ¶m2->mUnk_00)) {
|
||||
sp8 = false;
|
||||
}
|
||||
}
|
||||
|
||||
this->func_ov000_02088060(var_r7);
|
||||
|
||||
if (this->mUnk_33B && !var_r7 && pItemMgr != NULL) {
|
||||
pItemMgr->SetTearsAmount(0);
|
||||
}
|
||||
|
||||
UnkStruct_ov001_020c40f4 sp40 = *param1;
|
||||
|
||||
if (sp8) {
|
||||
VecFx32 sp34 = sp40.mUnk_00;
|
||||
|
||||
//! TODO: fake match?
|
||||
switch ((u32) ((sp40.mUnk_0C + 0x2000) << 0x10) >> 0x1E) {
|
||||
case 0x03:
|
||||
sp34.z += FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
case 0x01:
|
||||
sp34.z -= FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
case 0x02:
|
||||
sp34.x -= FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
case 0x00:
|
||||
sp34.x += FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
VecFx32_Copy(&sp34, &sp40.mUnk_00);
|
||||
}
|
||||
|
||||
this->mPlayer.func_ov001_020bcbd0(&sp40.mUnk_00);
|
||||
|
||||
if (this->mUnk_328 != NULL) {
|
||||
UnkStruct_ov001_020c40f4 sp1C = *param2;
|
||||
|
||||
if (sp8) {
|
||||
VecFx32 sp10 = sp1C.mUnk_00;
|
||||
|
||||
//! TODO: fake match?
|
||||
switch ((u32) ((sp1C.mUnk_0C + 0x2000) << 0x10) >> 0x1E) {
|
||||
case 0x03:
|
||||
sp10.z -= FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
case 0x01:
|
||||
sp10.z += FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
case 0x02:
|
||||
sp10.x += FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
case 0x00:
|
||||
sp10.x -= FLOAT_TO_FX32(0.5f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
VecFx32_Copy(&sp10, &sp1C.mUnk_00);
|
||||
}
|
||||
|
||||
this->mUnk_328->func_ov093_0216d1cc(param3, &sp1C, var_r7, param8);
|
||||
}
|
||||
|
||||
param6->func_ov001_020bbf7c((unk32) this, (unk32 *) &this->mPlayer, (unk32) this->mUnk_328);
|
||||
this->mUnk_33B = false;
|
||||
}
|
||||
Reference in New Issue
Block a user