cleanup and doc

This commit is contained in:
elijah-thomas774
2025-11-23 14:41:54 -05:00
parent 51040758a5
commit fce6ad876d
4 changed files with 31 additions and 30 deletions
+5 -4
View File
@@ -52,13 +52,14 @@ _dtors = .dtors:0x00000000; // type:label scope:global
__destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global
lbl_442_rodata_0 = .rodata:0x00000000; // type:object size:0x14 data:float
g_profile_TAG_BARREL = .data:0x00000000; // type:object size:0x10 data:4byte
TgBarrel__vtable = .data:0x00000010; // type:object size:0x78
__vt__11dTgBarrel_c = .data:0x00000010; // type:object size:0x74
lbl_442_data_88 = .data:0x00000088; // type:object size:0x30
lbl_442_data_B8 = .data:0x000000B8; // type:object size:0x30
lbl_442_data_E8 = .data:0x000000E8; // type:object size:0x18
lbl_442_data_100 = .data:0x00000100; // type:object size:0x10C
lbl_442_data_20C = .data:0x0000020C; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_442_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte
TgBarrel__StateID_Wait = .bss:0x00000018; // type:object size:0x40 data:4byte
TgBarrel__StateID_Stop = .bss:0x00000058; // type:object size:0x30 data:4byte
@23673 = .bss:0x00000008; // type:object size:0xC scope:local data:4byte
StateID_Wait__11dTgBarrel_c = .bss:0x00000018; // type:object size:0x30 data:4byte
@23677 = .bss:0x00000048; // type:object size:0xC scope:local data:4byte
StateID_Stop__11dTgBarrel_c = .bss:0x00000058; // type:object size:0x30 data:4byte
+7 -7
View File
@@ -33,13 +33,13 @@ private:
/* 0x144 */ dAcRef_c<dTgBarrelPos_c> mTgBarrelPosArr[10];
/* 0x1BC */ dAcRef_c<dAcOBarrel_c> mBarrelArr[10];
/* 0x234 */ mVec3_c mSpawnPosition;
/* 0x240 */ u8 field_0x240; ///< Stop Sceneflag
/* 0x241 */ u8 field_0x241; ///< Barrel Spawn Interval in Seconds
/* 0x242 */ u8 field_0x242; ///< Barrel Spawn Timer
/* 0x243 */ u8 field_0x243;
/* 0x244 */ u8 field_0x244;
/* 0x245 */ u8 field_0x245;
/* 0x246 */ u8 field_0x246;
/* 0x240 */ u8 mStopFlag; ///< Stop Sceneflag - Note there is no checking done to see if valid
/* 0x241 */ u8 mSpawnInterval; ///< Barrel Spawn Interval in Seconds
/* 0x242 */ u8 mSpawnTimer; ///< Barrel Spawn Timer
/* 0x243 */ u8 mBarrelPosCount; ///< Repesents the index of the highest dTgBarrelPos_c in mTgBarrelPosArr
/* 0x244 */ u8 mBarrelPosIndex; ///< Rolling index to spawn dAcOBarrel_c from a dTgBarrelPos_c
/* 0x245 */ u8 mLinkId; ///< Link Id used to find correct dTgBarrelPos_c
/* 0x246 */ bool mSpawnActive; ///< Used to reset the spawn timer after the player has already entered the area
};
#endif
+2 -2
View File
@@ -26,8 +26,8 @@ public:
private:
/* 0x0FC */ dAcRef_c<dAcOstageSink_c> mStageRef;
/* 0x108 */ mVec3_c mSpawnPosition;
/* 0x114 */ u8 mLinkIndex;
/* 0x115 */ u8 mLinkId;
/* 0x114 */ u8 mLinkIndex; ///< Link Index used in dTgBarrel_c array
/* 0x115 */ u8 mLinkId; ///< Link Id used to find correct dTgBarrel_c
};
#endif
+17 -17
View File
@@ -27,10 +27,10 @@ STATE_DEFINE(dTgBarrel_c, Stop);
// dAcRef_c<dAcOBarrel_c>
int dTgBarrel_c::actorCreate() {
field_0x240 = getFromParams(0, 0xFF);
field_0x245 = getFromParams(16, 0xF);
field_0x241 = getFromParams(8, 0xFF);
field_0x242 = 1;
mStopFlag = getFromParams(0, 0xFF);
mLinkId = getFromParams(16, 0xF);
mSpawnInterval = getFromParams(8, 0xFF);
mSpawnTimer = 1;
mStageRef.link(dAcOstageSink_c::GetInstance());
mSpawnPosition = mPosition;
@@ -52,10 +52,10 @@ int dTgBarrel_c::actorPostCreate() {
if (pTgBarrelPos != nullptr) {
u8 index = pTgBarrelPos->getLinkIndex();
if (field_0x245 == pTgBarrelPos->getLinkId()) {
if (mLinkId == pTgBarrelPos->getLinkId()) {
mTgBarrelPosArr[index].link(pTgBarrelPos);
if (index >= field_0x243) {
field_0x243 = index + 1;
if (index >= mBarrelPosCount) {
mBarrelPosCount = index + 1;
}
}
}
@@ -80,7 +80,7 @@ int dTgBarrel_c::draw() {
void dTgBarrel_c::initializeState_Wait() {}
void dTgBarrel_c::executeState_Wait() {
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, field_0x240)) {
if (SceneflagManager::sInstance->checkBoolFlag(mRoomID, mStopFlag)) {
mStateMgr.changeState(StateID_Stop);
return;
}
@@ -98,8 +98,8 @@ void dTgBarrel_c::executeState_Wait() {
mPosition += pos;
if (checkPlayerPos(dAcPy_c::GetLink()->mPosition)) {
if (0 == sLib::calcTimer(&field_0x242)) {
field_0x246 = 1;
if (0 == sLib::calcTimer(&mSpawnTimer)) {
mSpawnActive = true;
u8 idx = 0xFF;
for (int i = 0; i < (int)ARRAY_LENGTH(mBarrelArr); ++i) {
@@ -110,7 +110,7 @@ void dTgBarrel_c::executeState_Wait() {
}
if (idx != 0xFF) {
dTgBarrelPos_c *pTgBarrelPos = mTgBarrelPosArr[field_0x244].get();
dTgBarrelPos_c *pTgBarrelPos = mTgBarrelPosArr[mBarrelPosIndex].get();
if (pTgBarrelPos != nullptr) {
mVec3_c spawnPos = pTgBarrelPos->mPosition;
mAng3_c spawnRot(0, 0x4000, 0);
@@ -119,15 +119,15 @@ void dTgBarrel_c::executeState_Wait() {
);
mBarrelArr[idx].link(static_cast<dAcOBarrel_c *>(pObj));
}
if (++field_0x244 >= field_0x243) {
field_0x244 = 0;
if (++mBarrelPosIndex >= mBarrelPosCount) {
mBarrelPosIndex = 0;
}
}
field_0x242 = field_0x241 * 30;
mSpawnTimer = mSpawnInterval * 30;
}
} else {
if (field_0x246) {
field_0x242 = field_0x241 * 30;
if (mSpawnActive) {
mSpawnTimer = mSpawnInterval * 30;
}
}
}
@@ -135,7 +135,7 @@ void dTgBarrel_c::finalizeState_Wait() {}
void dTgBarrel_c::initializeState_Stop() {}
void dTgBarrel_c::executeState_Stop() {
if (!SceneflagManager::sInstance->checkBoolFlag(mRoomID, field_0x240)) {
if (!SceneflagManager::sInstance->checkBoolFlag(mRoomID, mStopFlag)) {
mStateMgr.changeState(StateID_Wait);
}
}