diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-02-23 19:59:54 -0500 |
|---|---|---|
| committer | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-02-23 19:59:54 -0500 |
| commit | c4ad9f7241e2f4bf09a88deb62d683796c4d4200 (patch) | |
| tree | ed547fe2bc212092cda87cd3d4ca09b86731de43 /src/d/actor/d_a_shutter.cpp | |
| parent | 730b74e2e3097297258deee1eb2a68c7f82d1ce2 (diff) | |
Various cleanup
Diffstat (limited to 'src/d/actor/d_a_shutter.cpp')
| -rw-r--r-- | src/d/actor/d_a_shutter.cpp | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/d/actor/d_a_shutter.cpp b/src/d/actor/d_a_shutter.cpp index 321abdbf..321cba9b 100644 --- a/src/d/actor/d_a_shutter.cpp +++ b/src/d/actor/d_a_shutter.cpp @@ -44,7 +44,7 @@ static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { /* 00000128-000002B8 .text CreateHeap__11daShutter_cFv */ BOOL daShutter_c::CreateHeap() { J3DModelData* modelData = (J3DModelData *)dComIfG_getObjectRes(m_arcname[mType], m_bdlidx[mType]); - JUT_ASSERT(0x121, modelData != 0); + JUT_ASSERT(0x121, modelData != NULL); for (int i = 0; i < (int)ARRAY_SIZE(mMtx); i++) { mpModel[i] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); if (!mpModel[i]) { @@ -142,32 +142,43 @@ bool daShutter_c::_execute() { /* 00000788-00000B14 .text shutter_move__11daShutter_cFv */ void daShutter_c::shutter_move() { - static char* action_table[] = {"WAIT", "WAIT02", "OPEN", "CLOSE"}; + static char* action_table[] = { + "WAIT", + "WAIT02", + "OPEN", + "CLOSE", + }; + enum { + ACT_WAIT, + ACT_WAIT02, + ACT_OPEN, + ACT_CLOSE, + }; int actionIndex = dComIfGp_evmng_getMyActIdx(mStaffId, action_table, ARRAY_SIZE(action_table), FALSE, 0); - float maxVel = m_max_speed[mType];; + float maxVel = m_max_speed[mType]; float minVel = m_min_speed[mType]; float fVar4; float fVar5; switch (actionIndex) { - case 0: //WAIT + case ACT_WAIT: { mTimer = 0xf; field_0x33A = 0; dComIfGp_evmng_cutEnd(mStaffId); - return; + break; } - case 1: //WAIT02 + case ACT_WAIT02: { if (!cLib_calcTimer(&mTimer)) { field_0x339 = 0; dComIfGp_evmng_cutEnd(mStaffId); } - return; + break; } - case 2: //OPEN + case ACT_OPEN: { field_0x33A++; if (field_0x339 == 0) { @@ -183,15 +194,15 @@ void daShutter_c::shutter_move() { dComIfGp_getVibration().StartShock(4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); } if (fVar4 != 0.0f){ - return; + break; } if (fVar5 != 0.0f) { - return; + break; } dComIfGp_evmng_cutEnd(mStaffId); - return; + break; } - case 3: //CLOSE + case ACT_CLOSE: { if (field_0x339 == 0) { field_0x339 = 1; @@ -199,16 +210,20 @@ void daShutter_c::shutter_move() { fVar4 = cLib_addCalc(&mcXyz[0].x, -m_width[mType] / 2.0f, 0.1f, maxVel, minVel); fVar5 = cLib_addCalc(&mcXyz[1].x, m_width[mType] / 2.0f, 0.1f, maxVel, minVel); if (fVar4 != 0.0f) { - return; + break; } if (fVar5 != 0.0f) { - return; + break; } dComIfGp_evmng_cutEnd(mStaffId); - return; + break; + } + default: + { + dComIfGp_evmng_cutEnd(mStaffId); + break; } } - dComIfGp_evmng_cutEnd(mStaffId); } /* 00000B14-00000CF0 .text demo__11daShutter_cFv */ |
