summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>2026-10-15 12:41:55 -0400
committerGitHub <noreply@github.com>2026-10-15 12:41:55 -0400
commitab2eff8a8487d896be2d224bd57189f679034f56 (patch)
tree5f080d4595e2a2f6e87bed34b00f0764e8788bea
parenta84c13a4bb5a6122c3e5caf0dcec850b72a9ef8a (diff)
parent95c9fe3a014493f3749dbe964366145324a6d9d5 (diff)
Merge pull request #356 from lisasunlight98-crypto/match-d_t_beetle
Match d_t_beetle (100%)
-rw-r--r--config/SOUE01/rels/d_t_beetleNP/symbols.txt10
-rw-r--r--configure.py2
-rw-r--r--include/d/t/d_t_beetle.h4
-rw-r--r--src/REL/d/t/d_t_beetle.cpp59
4 files changed, 29 insertions, 46 deletions
diff --git a/config/SOUE01/rels/d_t_beetleNP/symbols.txt b/config/SOUE01/rels/d_t_beetleNP/symbols.txt
index 91f91a8c..8916b454 100644
--- a/config/SOUE01/rels/d_t_beetleNP/symbols.txt
+++ b/config/SOUE01/rels/d_t_beetleNP/symbols.txt
@@ -12,10 +12,8 @@ updateBeetle__11dTgBeetle_cFR14dAcBoomerang_c = .text:0x00000620; // type:functi
__dt__11dTgBeetle_cFv = .text:0x00000680; // type:function size:0x5C
_ctors = .ctors:0x00000000; // type:label scope:global
_dtors = .dtors:0x00000000; // type:label scope:global
-lbl_302_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float
-dTgBeetle__scaleMultiplier = .rodata:0x00000004; // type:object size:0xC align:4 data:float
-lbl_302_rodata_4.y = .rodata:0x00000010; // type:object size:0x4 align:4 data:float
-lbl_302_rodata_4.z = .rodata:0x00000014; // type:object size:0x4 align:4 data:float
+unused_ = .rodata:0x00000000; // type:object size:0x4 scope:global data:float
+lbl_302_rodata_4 = .rodata:0x00000004; // type:object size:0x14 scope:local align:4 data:float
g_profile_BEETLE_TAG = .data:0x00000000; // type:object size:0x10
-lbl_302_data_10 = .data:0x00000010; // type:object size:0x5 data:string
-dTgBeetle__vtable = .data:0x00000018; // type:object size:0x74
+lbl_302_data_10 = .data:0x00000010; // type:object size:0x8 scope:local data:string
+__vt__11dTgBeetle_c = .data:0x00000018; // type:object size:0x74
diff --git a/configure.py b/configure.py
index 22107970..fd876e44 100644
--- a/configure.py
+++ b/configure.py
@@ -2898,7 +2898,7 @@ config.libs = [
Rel(NonMatching, "d_t_bb_quake", "REL/d/t/d_t_bb_quake.cpp"),
Rel(NonMatching, "d_t_bcal_tag", "REL/d/t/d_t_bcal_tag.cpp"),
Rel(NonMatching, "d_t_bcz", "REL/d/t/d_t_bcz.cpp"),
- Rel(NonMatching, "d_t_beetle", "REL/d/t/d_t_beetle.cpp"),
+ Rel(Matching, "d_t_beetle", "REL/d/t/d_t_beetle.cpp"),
Rel(Matching, "d_t_belt_obstacle", "REL/d/t/d_t_belt_obstacle.cpp"),
Rel(NonMatching, "d_t_clef_game", "REL/d/t/d_t_clef_game.cpp"),
Rel(NonMatching, "d_t_clef_manager", "REL/d/t/d_t_clef_manager.cpp"),
diff --git a/include/d/t/d_t_beetle.h b/include/d/t/d_t_beetle.h
index 56fb505e..554288c8 100644
--- a/include/d/t/d_t_beetle.h
+++ b/include/d/t/d_t_beetle.h
@@ -15,8 +15,8 @@ public:
virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;
- u32 isWithinSphere(const mVec3_c &param) const;
- u32 isWithinCylinder(const mVec3_c &param) const;
+ bool isWithinSphere(const mVec3_c &param) const;
+ bool isWithinCylinder(const mVec3_c &param) const;
void updateBeetle(dAcBoomerang_c &boomerang);
virtual int draw() override;
diff --git a/src/REL/d/t/d_t_beetle.cpp b/src/REL/d/t/d_t_beetle.cpp
index cc0c305c..9ba5b33d 100644
--- a/src/REL/d/t/d_t_beetle.cpp
+++ b/src/REL/d/t/d_t_beetle.cpp
@@ -10,6 +10,8 @@
SPECIAL_ACTOR_PROFILE(BEETLE_TAG, dTgBeetle_c, fProfile::BEETLE_TAG, 0x297, 0, 0);
+extern const f32 unused_ = 0.0f;
+
int dTgBeetle_c::create() {
if (dScGame_c::currentSpawnInfo.stageName == "F103") { // flooded faron woods
if (mActorSubtype) {
@@ -37,7 +39,7 @@ int dTgBeetle_c::create() {
mZoneShape = SphereShape;
}
}
- matrixCreateFromPosRotYScale(mMatrix1, mPosition, mRotation.y, mScale, nullptr, 0);
+ matrixCreateFromPosRotYScale(mMatrix1, mPosition, mRotation.y, mScale, nullptr, 0.0f);
return SUCCEEDED;
}
}
@@ -48,7 +50,7 @@ int dTgBeetle_c::doDelete() {
int dTgBeetle_c::actorExecute() {
if (mPastOnly == 1 && !mActorSubtype) {
- if (dTimeAreaMgr_c::GetInstance()->checkPositionIsInPastState(mRoomID, mPosition, nullptr, 1.0f) == 0) {
+ if (dTimeAreaMgr_c::GetInstance()->checkPositionIsInPastState(mRoomID, mPosition, nullptr, 1.0f) == 0.0f) {
return SUCCEEDED;
}
}
@@ -75,55 +77,38 @@ int dTgBeetle_c::actorExecute() {
return SUCCEEDED;
}
-u32 dTgBeetle_c::isWithinSphere(
- const mVec3_c &position
-) const { // fn_302_520 is position within a sphere the size of the zone
+int dTgBeetle_c::draw() {
+ return SUCCEEDED;
+}
- mVec3_c diff = position - (mPosition + mScale.y * mVec3_c::Ey * 1.0f);
+bool dTgBeetle_c::isWithinCylinder(const mVec3_c &position) const {
+ mVec3_c diff = (position - (mPosition + mVec3_c::Ey * mScale.y * 0.5f));
diff.x /= mScale.x;
diff.y /= mScale.y;
diff.z /= mScale.z;
- return diff.mag() <= 1.0f; // is beetle within a certain distance from center
+ return diff.absXZ() <= 1.0f && diff.y <= 0.5f && diff.y >= -0.5f;
}
-u32 dTgBeetle_c::isWithinCylinder(
- const mVec3_c &position
-) const { // is position within a really thin cylinder inside the zone
-
- mVec3_c diff = (position - (mPosition + mVec3_c::Ey * mScale.y * 0.5f));
-
- bool returnValue = 0;
- bool returnCheck = 0;
+bool dTgBeetle_c::isWithinSphere(const mVec3_c &position) const {
+ mVec3_c diff = position - (mPosition + mScale.y * mVec3_c::Ey * 1.0f);
diff.x /= mScale.x;
diff.y /= mScale.y;
diff.z /= mScale.z;
- if (diff.absXZ() <= 0.01f && diff.y <= 0.5f) {
- returnCheck = 1;
- }
-
- if (returnCheck && diff.y >= -0.5f) {
- returnValue = 1;
- }
-
- return returnValue;
+ return diff.mag() <= 1.0f;
}
-void dTgBeetle_c::updateBeetle(dAcBoomerang_c &boomerang) { // fn_302_620 update beetle based on zone type
- if (mZoneType == LeafZone) { // leaf zone
- return boomerang.setField_0x8CC(0x20);
- } else if (mZoneType == BorderZone) { // border zone, reduce flight time
- return boomerang.setRemainingFlightTime(0x3C);
- } else if (mZoneType == UnknownZone) { //???
- return boomerang.setField_0x8CC(0x80);
- } else { // instant flashing red
- return boomerang.setRemainingFlightTime(-1);
+void dTgBeetle_c::updateBeetle(dAcBoomerang_c &boomerang) {
+ if (mZoneType == LeafZone) {
+ boomerang.setField_0x8CC(0x20);
+ } else if (mZoneType == BorderZone) {
+ boomerang.setRemainingFlightTime(0x3C);
+ } else if (mZoneType == UnknownZone) {
+ boomerang.setField_0x8CC(0x80);
+ } else {
+ boomerang.setRemainingFlightTime(-1);
}
}
-
-int dTgBeetle_c::draw() {
- return SUCCEEDED;
-}