mirror of
https://github.com/zeldaret/ph
synced 2026-09-01 01:22:10 -04:00
Merge branch 'zeldaret:main' into decomp/MapManager
This commit is contained in:
@@ -48,8 +48,7 @@ ARM Actor::Actor() :
|
||||
mUnk_010(0),
|
||||
mUnk_011(0),
|
||||
mUnk_012(0),
|
||||
mUnk_034(-1),
|
||||
mUnk_038(-1),
|
||||
mUnk_034(-1, -1),
|
||||
mUnk_03c(-1),
|
||||
mUnk_040(-1, -1),
|
||||
mGravity(FLOAT_TO_Q20(0.0498)),
|
||||
@@ -113,7 +112,7 @@ ARM Actor::Actor() :
|
||||
|
||||
ARM Actor::~Actor() {}
|
||||
|
||||
ARM bool Actor::vfunc_08() {
|
||||
ARM bool Actor::Init() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ ARM Actor *ActorManager::GetActor(ActorRef *ref) {
|
||||
|
||||
ARM bool FilterActor::Filter(Actor *actor) {
|
||||
if (mType != actor->mType) return false;
|
||||
if (mUnk_08 != -1 && mUnk_08 != actor->mUnk_034) return false;
|
||||
if (mUnk_08 != -1 && mUnk_08 != actor->mUnk_034.id) return false;
|
||||
if (mExcludeRefs != NULL) {
|
||||
for (s32 i = 0; mExcludeRefs[i].id != -1; ++i) {
|
||||
ActorRef *ref = &mExcludeRefs[i];
|
||||
|
||||
@@ -1,10 +1,98 @@
|
||||
#include "Actor/ActorSpawner.hpp"
|
||||
#include "Actor/ActorManager.hpp"
|
||||
#include "Map/MapManager.hpp"
|
||||
|
||||
ActorSpawner *ActorSpawner::Create() {}
|
||||
void ActorSpawner::Destroy() {}
|
||||
ActorSpawner::ActorSpawner() {}
|
||||
ActorSpawner::~ActorSpawner() {}
|
||||
void ActorSpawner::func_ov000_020c4014() {}
|
||||
void ActorSpawner::func_ov000_020c4018() {}
|
||||
Actor *ActorSpawner::CreateActor(ActorTypeId type) {}
|
||||
s32 ActorSpawner::Spawn(ActorTypeId type, Vec3p *pos, void *param3, ActorRef *ref) {}
|
||||
extern u32 *data_027e0ce0[];
|
||||
ARM ActorSpawner *ActorSpawner::Create() {
|
||||
gActorSpawner = new(data_027e0ce0[1], 4) ActorSpawner();
|
||||
}
|
||||
|
||||
ARM void ActorSpawner::Destroy() {
|
||||
delete gActorSpawner;
|
||||
gActorSpawner = NULL;
|
||||
}
|
||||
|
||||
ARM ActorSpawner::ActorSpawner() {}
|
||||
|
||||
ARM ActorSpawner::~ActorSpawner() {}
|
||||
|
||||
ARM void ActorSpawner::func_ov000_020c4014() {}
|
||||
|
||||
ARM void ActorSpawner::func_ov000_020c4018() {}
|
||||
|
||||
ARM Actor *ActorSpawner::CreateActor(ActorTypeId typeId) {
|
||||
Actor *actor = NULL;
|
||||
ActorType *type = ActorType::Find(typeId);
|
||||
if (type != NULL) {
|
||||
actor = type->create();
|
||||
}
|
||||
return actor;
|
||||
}
|
||||
|
||||
extern "C" unk32 GetCardinal(s16 angle);
|
||||
ARM s32 ActorSpawner::Spawn(ActorTypeId type, Vec3p *pos, ActorSpawnOptions *options, ActorRef *ref) {
|
||||
ActorManager *actorManager = gActorManager;
|
||||
u16 maxActors = actorManager->mMaxActors;
|
||||
s32 id = -1;
|
||||
s32 index;
|
||||
Actor **actorSlot = actorManager->mActorTable;
|
||||
for (index = 0; index < maxActors; index++, actorSlot++) {
|
||||
if (*actorSlot != NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Actor *actor = this->CreateActor(type);
|
||||
*actorSlot = actor;
|
||||
if (actor == NULL) {
|
||||
if (ref != NULL) {
|
||||
ref->Reset();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
actor->mType = type;
|
||||
(*actorSlot)->mRef.id = actorManager->mNextActorId;
|
||||
(*actorSlot)->mRef.index = index;
|
||||
(*actorSlot)->mUnk_014 = *pos;
|
||||
(*actorSlot)->mUnk_020 = options->mUnk_00;
|
||||
(*actorSlot)->mAngle = options->mAngle;
|
||||
(*actorSlot)->mUnk_012 = options->mAngle;
|
||||
(*actorSlot)->mUnk_074 = GetCardinal(options->mAngle);
|
||||
if (options->mUnk_18 >= 0xffff) {
|
||||
(*actorSlot)->mUnk_03c = -1;
|
||||
} else {
|
||||
(*actorSlot)->mUnk_03c = options->mUnk_18;
|
||||
}
|
||||
(*actorSlot)->mUnk_034 = options->mUnk_1c;
|
||||
(*actorSlot)->mUnk_140 = options->mUnk_24;
|
||||
(*actorSlot)->mUnk_144 = options->mUnk_28;
|
||||
Actor *actor2 = *actorSlot;
|
||||
actor2->mPos = *pos;
|
||||
actor2->mPrevPos = *pos;
|
||||
(*actorSlot)->mUnk_010 = gMapManager->GetCourseData_Unk_1c();
|
||||
(*actorSlot)->mUnk_011 = gMapManager->GetCourseData_Unk_1d();
|
||||
u16 nextIndex = index + 1;
|
||||
if (actorManager->mMaxActorIndex < nextIndex) {
|
||||
actorManager->mMaxActorIndex = nextIndex;
|
||||
}
|
||||
actorManager->mCacheEmptyActorIndex = index;
|
||||
|
||||
id = actorManager->mNextActorId;
|
||||
if (ref != NULL) {
|
||||
*ref = ActorRef(id, index);
|
||||
}
|
||||
actorManager->mNextActorId += 1;
|
||||
actorManager->mNumActors += 1;
|
||||
if (!(*actorSlot)->Init()) {
|
||||
(*actorSlot)->mAlive = false;
|
||||
if (ref != NULL) {
|
||||
ref->Reset();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ((id == -1) && (ref != NULL)) {
|
||||
ref->Reset();
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ ARM ActorActionObject::ActorActionObject() {}
|
||||
ARM ActorActionObject::~ActorActionObject() {}
|
||||
|
||||
// non-matching
|
||||
ARM bool ActorActionObject::vfunc_08() {
|
||||
ARM bool ActorActionObject::Init() {
|
||||
mGravity = 0;
|
||||
mHitbox.pos = gVec3p_ZERO;
|
||||
mHitbox.size = -1;
|
||||
|
||||
@@ -4,7 +4,7 @@ ActorType ActorEventIcon::gType = ActorType(ActorTypeId_EventIcon, (ActorCreateF
|
||||
|
||||
ActorEventIcon *ActorEventIcon::Create() {}
|
||||
ActorEventIcon::ActorEventIcon() {}
|
||||
bool ActorEventIcon::vfunc_08() {}
|
||||
bool ActorEventIcon::Init() {}
|
||||
void ActorEventIcon::vfunc_14(u32 param1) {}
|
||||
void ActorEventIcon::vfunc_18(u32 param1) {}
|
||||
u32 ActorEventIcon::func_ov000_02090648(u32 param1) {}
|
||||
|
||||
@@ -5,8 +5,8 @@ ActorType ActorSwitchObject::gType = ActorType(ActorTypeId_SwitchObject, (ActorC
|
||||
|
||||
ActorSwitchObject *ActorSwitchObject::Create() {}
|
||||
|
||||
bool ActorSwitchObject::vfunc_08() {
|
||||
Actor::vfunc_08();
|
||||
bool ActorSwitchObject::Init() {
|
||||
Actor::Init();
|
||||
this->func_ov000_0208fc7c();
|
||||
this->mUnk_130 = 0;
|
||||
return true;
|
||||
|
||||
@@ -461,7 +461,7 @@ static char *sItemModelNames2[8] = {
|
||||
[ItemId_SandOfHours - ItemId_SwordsmanScroll] = "sand_m",
|
||||
};
|
||||
static char *sItemModelNames3[9] = {
|
||||
[ItemId_CycloneSlate - ItemId_CycloneSlate] = "compass", [ItemId_Unk_128 - ItemId_CycloneSlate] = "lure",
|
||||
[ItemId_CycloneSlate - ItemId_CycloneSlate] = "compass", [ItemId_BigCatchLure - ItemId_CycloneSlate] = "lure",
|
||||
[ItemId_Rupoor10 - ItemId_CycloneSlate] = "rupee_bb", [ItemId_Rupoor50 - ItemId_CycloneSlate] = "rupee_bb",
|
||||
[ItemId_Unk_131 - ItemId_CycloneSlate] = NULL, [ItemId_Unk_132 - ItemId_CycloneSlate] = NULL,
|
||||
[ItemId_Unk_133 - ItemId_CycloneSlate] = NULL, [ItemId_Unk_134 - ItemId_CycloneSlate] = NULL,
|
||||
@@ -778,8 +778,8 @@ THUMB void ItemManager::GiveItem(ItemId id) {
|
||||
SET_FLAG(mItemFlags.flags, ItemFlag_CycloneSlate);
|
||||
} break;
|
||||
|
||||
case ItemId_Unk_128: {
|
||||
SET_FLAG(mItemFlags.flags, ItemFlag_Unk_47);
|
||||
case ItemId_BigCatchLure: {
|
||||
SET_FLAG(mItemFlags.flags, ItemFlag_BigCatchLure);
|
||||
} break;
|
||||
|
||||
case ItemId_Rupoor10: {
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
ActorNaviBase::ActorNaviBase() {}
|
||||
ActorNaviBase::~ActorNaviBase() {}
|
||||
void func_ov004_021079d4(unk32 *param1) {}
|
||||
bool ActorNaviBase::vfunc_08() {}
|
||||
bool ActorNaviBase::Init() {}
|
||||
|
||||
@@ -36,7 +36,7 @@ ActorRupee::ActorRupee() {
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/1qjCc
|
||||
bool ActorRupee::vfunc_08() {
|
||||
bool ActorRupee::Init() {
|
||||
u32 dVar5;
|
||||
u32 iVar7;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ void ActorArrow::func_ov014_0211fd80(unk32 param1) {}
|
||||
void ActorArrow::func_ov014_0211fd90() {}
|
||||
ActorArrow::ActorArrow() {}
|
||||
ActorArrow::~ActorArrow() {}
|
||||
bool ActorArrow::vfunc_08() {}
|
||||
bool ActorArrow::Init() {}
|
||||
bool ActorArrow::CollidesWith(Actor *other) {}
|
||||
void ActorArrow::func_ov014_021200d4() {}
|
||||
void ActorArrow::func_ov014_02120118() {}
|
||||
|
||||
@@ -6,7 +6,7 @@ ActorBlast *ActorBlast::Create() {}
|
||||
void ActorBlast_Unk1::vfunc_10(s32 *param1) {}
|
||||
ActorBlast::ActorBlast() {}
|
||||
ActorBlast::~ActorBlast() {}
|
||||
bool ActorBlast::vfunc_08() {}
|
||||
bool ActorBlast::Init() {}
|
||||
void ActorBlast::vfunc_14(u32 param1) {}
|
||||
ActorBlast_Unk1::~ActorBlast_Unk1() {}
|
||||
void ActorBlast::vfunc_18(u32 param1) {}
|
||||
|
||||
@@ -9,7 +9,7 @@ ActorBomb::ActorBomb() {}
|
||||
ActorBomb_Unk2::~ActorBomb_Unk2() {}
|
||||
ActorBomb::~ActorBomb() {}
|
||||
ActorBomb_Unk2::ActorBomb_Unk2() {}
|
||||
bool ActorBomb::vfunc_08() {}
|
||||
bool ActorBomb::Init() {}
|
||||
void ActorBomb::vfunc_14(u32 param1) {}
|
||||
ActorBomb_Unk1::~ActorBomb_Unk1() {}
|
||||
void ActorBomb::vfunc_18(u32 param1) {}
|
||||
|
||||
@@ -41,16 +41,16 @@ ARM ActorRefill::ActorRefill(unk32 param1) :
|
||||
|
||||
ARM ActorRefill::~ActorRefill() {}
|
||||
|
||||
ARM bool ActorRefill::vfunc_08() {
|
||||
ARM bool ActorRefill::Init() {
|
||||
ItemManager *itemManager;
|
||||
|
||||
if (this->vfunc_b4() == ItemFlag_None) {
|
||||
if (this->GetAmmoItem() == ItemFlag_None) {
|
||||
if (data_027e0d38->func_ov000_02078b40() != 3) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
ItemManager *itemManager = gItemManager;
|
||||
ItemFlag item = this->vfunc_b4();
|
||||
ItemFlag item = this->GetAmmoItem();
|
||||
if (!itemManager->HasItem(item)) {
|
||||
return false;
|
||||
}
|
||||
@@ -111,11 +111,11 @@ ARM void ActorRefill::vfunc_14(u32 param1) {
|
||||
case 4:
|
||||
case 5:
|
||||
if (this->CollidesWithPlayer(PlayerCollide_PickupFlags) != 0) {
|
||||
if (this->vfunc_b4() == -1) {
|
||||
if (this->GetAmmoItem() == -1) {
|
||||
data_027e103c->func_ov000_020cfbf0(mUnk_158 * 60, 1, 0);
|
||||
} else {
|
||||
ItemManager *itemManager = gItemManager;
|
||||
itemManager->GiveAmmo(this->vfunc_b4(), mUnk_158);
|
||||
itemManager->GiveAmmo(this->GetAmmoItem(), mUnk_158);
|
||||
}
|
||||
func_ov000_020d7ad4(&data_ov000_020eec9c, 0x100);
|
||||
this->func_ov014_02135364(3);
|
||||
@@ -227,7 +227,7 @@ ARM ActorRefillBombs::ActorRefillBombs() :
|
||||
|
||||
ARM ActorRefillBombs::~ActorRefillBombs() {}
|
||||
|
||||
ARM ItemFlag ActorRefillBombs::vfunc_b4() {
|
||||
ARM ItemFlag ActorRefillBombs::GetAmmoItem() {
|
||||
return ItemFlag_BombBag;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ ARM ActorRefillBombchus::ActorRefillBombchus() :
|
||||
|
||||
ARM ActorRefillBombchus::~ActorRefillBombchus() {}
|
||||
|
||||
ARM ItemFlag ActorRefillBombchus::vfunc_b4() {
|
||||
ARM ItemFlag ActorRefillBombchus::GetAmmoItem() {
|
||||
return ItemFlag_BombchuBag;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ ARM ActorRefillArrows::ActorRefillArrows() :
|
||||
|
||||
ARM ActorRefillArrows::~ActorRefillArrows() {}
|
||||
|
||||
ARM ItemFlag ActorRefillArrows::vfunc_b4() {
|
||||
ARM ItemFlag ActorRefillArrows::GetAmmoItem() {
|
||||
return ItemFlag_Bow;
|
||||
}
|
||||
|
||||
@@ -263,8 +263,8 @@ ARM ActorRefillTime::ActorRefillTime() :
|
||||
|
||||
ARM ActorRefillTime::~ActorRefillTime() {}
|
||||
|
||||
ARM bool ActorRefillTime::vfunc_08() {
|
||||
if (!ActorRefill::vfunc_08()) {
|
||||
ARM bool ActorRefillTime::Init() {
|
||||
if (!ActorRefill::Init()) {
|
||||
return false;
|
||||
}
|
||||
switch (mUnk_020.mUnk_00[0]) {
|
||||
@@ -293,7 +293,7 @@ ARM bool ActorRefillTime::vfunc_08() {
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM ItemFlag ActorRefillTime::vfunc_b4() {
|
||||
ARM ItemFlag ActorRefillTime::GetAmmoItem() {
|
||||
return ItemFlag_None;
|
||||
}
|
||||
|
||||
@@ -305,8 +305,8 @@ ARM ActorLSTM::ActorLSTM() :
|
||||
|
||||
ARM ActorLSTM::~ActorLSTM() {}
|
||||
|
||||
ARM bool ActorLSTM::vfunc_08() {
|
||||
if (!ActorRefill::vfunc_08()) {
|
||||
ARM bool ActorLSTM::Init() {
|
||||
if (!ActorRefill::Init()) {
|
||||
return false;
|
||||
}
|
||||
switch (mUnk_020.mUnk_00[0]) {
|
||||
@@ -335,6 +335,6 @@ ARM bool ActorLSTM::vfunc_08() {
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM ItemFlag ActorLSTM::vfunc_b4() {
|
||||
ARM ItemFlag ActorLSTM::GetAmmoItem() {
|
||||
return ItemFlag_None;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ ActorRope_Unk_0219a3b0 gUnk_0219a3b0;
|
||||
void ActorRope_Unk_0219a3b0::vfunc_08(unk16 *param1) {}
|
||||
void ActorRope_Unk_0219a3b0::vfunc_10(s32 *param1) {}
|
||||
ActorRope::ActorRope() {}
|
||||
bool ActorRope::vfunc_08() {}
|
||||
bool ActorRope::Init() {}
|
||||
q20 ActorRope::func_ov057_0219a5ac() {}
|
||||
void ActorRope::func_ov057_0219a6b8() {}
|
||||
void ActorRope::func_ov057_0219a850() {}
|
||||
|
||||
Reference in New Issue
Block a user