diff options
| author | petrie911 <69443847+petrie911@users.noreply.github.com> | 2024-05-11 15:53:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-11 17:53:37 -0300 |
| commit | 0dbbf453f93f9f1b3e3d95fbfd96caf85c85ddf7 (patch) | |
| tree | 186e6d9c15cf82eaf87609b6ab0227306680c283 /src/engine | |
| parent | 5bda92de97922f060c2c7ad032aca686bdd1715c (diff) | |
More actor docs. starting on event IDs (#238)
* id start
* stuff
* comp and cam
* add errors
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/fox_360.c | 88 | ||||
| -rw-r--r-- | src/engine/fox_A48A0.c | 6 | ||||
| -rw-r--r-- | src/engine/fox_beam.c | 71 | ||||
| -rw-r--r-- | src/engine/fox_bg.c | 24 | ||||
| -rw-r--r-- | src/engine/fox_boss.c | 10 | ||||
| -rw-r--r-- | src/engine/fox_context.c | 112 | ||||
| -rw-r--r-- | src/engine/fox_demo.c | 159 | ||||
| -rw-r--r-- | src/engine/fox_display.c | 199 | ||||
| -rw-r--r-- | src/engine/fox_edata.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_edisplay.c | 63 | ||||
| -rw-r--r-- | src/engine/fox_effect.c | 51 | ||||
| -rw-r--r-- | src/engine/fox_enmy.c | 107 | ||||
| -rw-r--r-- | src/engine/fox_enmy2.c | 524 | ||||
| -rw-r--r-- | src/engine/fox_fade.c | 36 | ||||
| -rw-r--r-- | src/engine/fox_game.c | 75 | ||||
| -rw-r--r-- | src/engine/fox_hud.c | 135 | ||||
| -rw-r--r-- | src/engine/fox_load.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_play.c | 201 | ||||
| -rw-r--r-- | src/engine/fox_tank.c | 10 | ||||
| -rw-r--r-- | src/engine/fox_versus.c | 72 |
20 files changed, 991 insertions, 956 deletions
diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index 0bb58c2c..e026dd71 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -278,7 +278,7 @@ void AllRange_ClearRadio(void) { sStarWolfKillTimer = gRadioState = gActors[1].iwork[1] = gActors[2].iwork[1] = gActors[3].iwork[1] = 0; } -void func_360_8002EE64(Actor* this) { +void ActorAllRange_SetShadowData(Actor* this) { s32 i; s32 colId; Scenery360* scenery360; @@ -297,7 +297,7 @@ void func_360_8002EE64(Actor* this) { s32 pad2; this->fwork[25] = this->fwork[26] = this->fwork[28] = this->fwork[27] = 0.0f; - if ((this->unk_0C9 != 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (gLevelType == LEVELTYPE_PLANET)) { + if (this->drawShadow && (gLevelMode == LEVELMODE_ALL_RANGE) && (gLevelType == LEVELTYPE_PLANET)) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && ((scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_149) || @@ -387,13 +387,13 @@ void ActorAllRange_SpawnTeam(void) { actor->aiIndex = sTeamSpawnTargets[i]; } actor->state = STATE360_2; - actor->unk_0F4.y = 180.0f; + actor->rot_0F4.y = 180.0f; if (actor->aiIndex <= -1) { actor->state = STATE360_3; } actor->health = 50; if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { - actor->unk_0C9 = 1; + actor->drawShadow = true; } actor->iwork[11] = 1; if (actor->aiType <= AI360_PEPPY) { @@ -434,11 +434,11 @@ void ActorAllRange_SpawnStarWolf(void) { actor->aiIndex = sStarWolfSpawnTargets[i]; gActors[actor->aiIndex].aiIndex = -1; actor->health = 100; - actor->unk_0C9 = 1; - actor->unk_0F4.y = 225.0f; + actor->drawShadow = true; + actor->rot_0F4.y = 225.0f; actor->state = STATE360_0; actor->timer_0BC = 250; - actor->unk_0F4.x = -20.0f; + actor->rot_0F4.x = -20.0f; actor->iwork[11] = 1; if (gCurrentLevel == LEVEL_VENOM_2) { actor->obj.rot.z = sStarWolfVE2SpawnRot[i]; @@ -534,7 +534,7 @@ void ActorAllRange_UpdateStarWolfEvents(Actor* this) { if (actor->aiType == AI360_WOLF) { if (gCurrentLevel != LEVEL_VENOM_2) { actor->state = STATE360_3; - actor->unk_04E = 300; + actor->counter_04E = 300; } } else { actor->state = STATE360_3; @@ -562,7 +562,7 @@ void ActorAllRange_ChooseNewTarget(Actor* actor) { s32 enemyId; for (enemyId = AI360_10, enemy = &gActors[AI360_10]; enemyId < ARRAY_COUNT(gActors); enemyId++, enemy++) { - if ((enemy->obj.status == OBJ_ACTIVE) && (enemy->obj.id == OBJ_ACTOR_ALLRANGE) && (enemy->unk_0B6 == 0) && + if ((enemy->obj.status == OBJ_ACTIVE) && (enemy->obj.id == OBJ_ACTOR_ALLRANGE) && (enemy->animFrame == 0) && (enemy->aiIndex <= -1)) { alreadyTaken = false; for (teamId = AI360_FALCO, team = &gActors[AI360_FALCO]; teamId <= AI360_PEPPY; teamId++, team++) { @@ -829,7 +829,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } if (this->dmgType != DMG_NONE) { var_a1 = false; - if ((this->unk_0B6 == 3) || + if ((this->animFrame == 3) || ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (this->aiType >= AI360_WOLF)) || ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && @@ -920,7 +920,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { if (this->damage >= 20) { this->timer_0BC = 0; } - if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->dmgSource == AI360_FOX + 1)) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->animFrame == 1) && (this->dmgSource == AI360_FOX + 1)) { if (gKaAllyKillCount < 2) { ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL); } @@ -1028,7 +1028,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); if (this->aiType < AI360_GREAT_FOX) { - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->rot_0F4.y * M_DTOR, MTXF_NEW); sp48.x = 30.0f; if (Rand_ZeroOne() < 0.5f) { sp48.x = -30.0f; @@ -1067,7 +1067,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } else if (this->dmgSource <= AI360_PEPPY + 101) { if (this->aiType >= AI360_WOLF) { if (this->dmgSource == AI360_FOX + 1) { - if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && !gKaKilledAlly) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->animFrame == 1) && !gKaKilledAlly) { gKaKilledAlly = true; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); } else if (this->aiType == AI360_KATT) { @@ -1250,8 +1250,8 @@ void ActorAllRange_Update(Actor* this) { switch (this->state) { case STATE360_7: case STATE360_8: - if (this->unk_0F4.x > 180.0f) { - this->unk_0F4.x -= 360.0f; + if (this->rot_0F4.x > 180.0f) { + this->rot_0F4.x -= 360.0f; } this->unk_046 = 0; break; @@ -1407,16 +1407,16 @@ void ActorAllRange_Update(Actor* this) { if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { this->fwork[0] = this->fwork[1] = 40.0f; if (gActors[0].state == STATE360_5) { - Math_SmoothStepToF(&this->unk_0F4.x, 30.0f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->rot_0F4.x, 30.0f, 0.1f, 0.5f, 0.0f); this->fwork[1] = 200.0f; } if (this->timer_0BC == 0) { if (this->aiType == AI360_WOLF) { this->state = STATE360_3; if (gCurrentLevel == LEVEL_VENOM_2) { - this->unk_04E = 200; + this->counter_04E = 200; } else { - this->unk_04E = 200; + this->counter_04E = 200; } } else { this->state = STATE360_2; @@ -1432,7 +1432,7 @@ void ActorAllRange_Update(Actor* this) { case STATE360_1: this->fwork[1] = 40.0f; if ((this->timer_0BC < 35) && (gCurrentLevel == LEVEL_FORTUNA)) { - Math_SmoothStepToF(&this->unk_0F4.x, 15.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->rot_0F4.x, 15.0f, 0.1f, 1.0f, 0.0f); } if (this->timer_0BC == 0) { this->state = STATE360_3; @@ -1451,7 +1451,7 @@ void ActorAllRange_Update(Actor* this) { sp10F = 0xB; if (this->aiType == AI360_FALCO) { spF0 = 0.5f; - } else if ((this->unk_0B6 != 2) && (this->unk_0B6 == 3)) { + } else if ((this->animFrame != 2) && (this->animFrame == 3)) { spF0 = 0.5f; } if (this->aiIndex == AI360_FOX) { @@ -1470,7 +1470,7 @@ void ActorAllRange_Update(Actor* this) { if ((gPlayer[0].somersault && (this->iwork[4] > 10)) || ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY))) { this->state = STATE360_3; - this->unk_04E = 300; + this->counter_04E = 300; this->timer_0BC = 160; if (this->aiType == AI360_WOLF) { ActorAllRange_PlayMessage(gMsg_ID_9369, RCID_WOLF); @@ -1822,10 +1822,10 @@ void ActorAllRange_Update(Actor* this) { this->iwork[2] = AI360_FOX; } if (this->aiIndex == AI360_FOX) { - if (this->unk_04E != 0) { - this->unk_04E--; + if (this->counter_04E != 0) { + this->counter_04E--; } - if (this->unk_04E == 0) { + if (this->counter_04E == 0) { this->state = STATE360_2; this->iwork[2] = AI360_FOX; } @@ -1833,9 +1833,9 @@ void ActorAllRange_Update(Actor* this) { break; case STATE360_7: this->fwork[1] = 40.0f; - Math_SmoothStepToF(&this->unk_0F4.x, 360.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.x, 360.0f, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&this->obj.rot.z, 0.0f, 0.1f, 3.0f, 0.01f); - if (this->unk_0F4.x > 350.0f) { + if (this->rot_0F4.x > 350.0f) { this->state = STATE360_3; } break; @@ -1848,19 +1848,19 @@ void ActorAllRange_Update(Actor* this) { } switch (this->unk_046) { case 0: - Math_SmoothStepToF(&this->unk_0F4.x, 200.0f, 0.1f, 6.0f, 0.0001f); - if (this->unk_0F4.x > 190.0f) { - this->unk_0F4.y += 190.0f; - if (this->unk_0F4.y >= 360.0f) { - this->unk_0F4.y -= 360.0f; + Math_SmoothStepToF(&this->rot_0F4.x, 200.0f, 0.1f, 6.0f, 0.0001f); + if (this->rot_0F4.x > 190.0f) { + this->rot_0F4.y += 190.0f; + if (this->rot_0F4.y >= 360.0f) { + this->rot_0F4.y -= 360.0f; } - this->unk_0F4.x = 360.0f - (this->unk_0F4.x - 180.0f); + this->rot_0F4.x = 360.0f - (this->rot_0F4.x - 180.0f); this->obj.rot.z += 180.0f; if (this->obj.rot.z >= 360.0f) { this->obj.rot.z -= 360.0f; } this->timer_0BC = 40; - this->unk_046 += 1; + this->unk_046++; } this->obj.pos.y -= 3.0f; break; @@ -1873,7 +1873,7 @@ void ActorAllRange_Update(Actor* this) { break; case STATE360_9: this->fwork[1] = 40.0f; - if (Math_SmoothStepToAngle(&this->unk_0F4.y, this->fwork[19], 0.5f, 5.0f, 0.0f) < 0.0f) { + if (Math_SmoothStepToAngle(&this->rot_0F4.y, this->fwork[19], 0.5f, 5.0f, 0.0f) < 0.0f) { spD0 = 70.0f; } else { spD0 = 290.0f; @@ -1903,7 +1903,7 @@ void ActorAllRange_Update(Actor* this) { if (gCurrentLevel == LEVEL_VENOM_2) { var_v0 = 2 - 1; } - if (!((this->index + gGameFrameCount) & var_v0)) { + if (((this->index + gGameFrameCount) & var_v0) == 0) { this->fwork[19] = Math_RadToDeg(Math_Atan2F(spE4, spDC)); this->fwork[20] = Math_RadToDeg(Math_Atan2F(spE0, sqrtf(SQ(spE4) + SQ(spDC)))); } @@ -1939,11 +1939,11 @@ void ActorAllRange_Update(Actor* this) { } } else if ((this->obj.pos.y < (gGroundHeight + 50.0f)) && (spD8 > 180.0f)) { spD8 = 0.0f; - this->unk_0F4.x = 0.0f; + this->rot_0F4.x = 0.0f; } } - Math_SmoothStepToAngle(&this->unk_0F4.x, spD8, 0.5f, this->fwork[2], 0.0001f); - spD0 = Math_SmoothStepToAngle(&this->unk_0F4.y, spD4, 0.5f, this->fwork[2], 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&this->rot_0F4.x, spD8, 0.5f, this->fwork[2], 0.0001f); + spD0 = Math_SmoothStepToAngle(&this->rot_0F4.y, spD4, 0.5f, this->fwork[2], 0.0001f) * 30.0f; if (spD0 < 0.0f) { spD0 = spD0 * -1.0f; } else { @@ -1979,8 +1979,8 @@ void ActorAllRange_Update(Actor* this) { } } } - this->obj.rot.x = -this->unk_0F4.x; - this->obj.rot.y = this->unk_0F4.y; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y; Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.2f, 1.0f, 0.1f); Math_SmoothStepToF(&this->fwork[2], this->fwork[3], 1.0f, 0.1f, 0.1f); spC0 = SIN_DEG(this->obj.rot.x); @@ -2053,7 +2053,7 @@ void ActorAllRange_Update(Actor* this) { radarMark->pos.x = this->obj.pos.x; radarMark->pos.y = this->obj.pos.y; radarMark->pos.z = this->obj.pos.z; - radarMark->yRot = this->unk_0F4.y + 180.0f; + radarMark->yRot = this->rot_0F4.y + 180.0f; if (this->iwork[1] != 0) { this->iwork[1]--; if ((this->iwork[1] == 0) && (gActors[0].state == STATE360_2) && (gRadioState == 0)) { @@ -2106,7 +2106,7 @@ void ActorAllRange_Update(Actor* this) { } } if (gCurrentLevel == LEVEL_FORTUNA) { - func_360_8002EE64(this); + ActorAllRange_SetShadowData(this); } else if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { this->unk_04A++; if (this->unk_04A >= Animation_GetFrameCount(&D_VE2_600C200)) { @@ -2258,7 +2258,7 @@ void ActorAllRange_Draw(ActorAllRange* this) { break; case AI360_GREAT_FOX: Display_SetSecondLight(&this->obj.pos); - this->unk_0B6 = 1; + this->animFrame = 1; ActorCutscene_Draw(this); break; case AI360_MISSILE: @@ -2278,7 +2278,7 @@ void ActorAllRange_Draw(ActorAllRange* this) { Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Actor_DrawEngineGlow(this, 2); } else if (gCurrentLevel == LEVEL_KATINA) { - switch (this->unk_0B6) { + switch (this->animFrame) { case 0: gSPDisplayList(gMasterDisp++, aKaEnemy1LowPolyDL); break; diff --git a/src/engine/fox_A48A0.c b/src/engine/fox_A48A0.c index 677cf218..acda833b 100644 --- a/src/engine/fox_A48A0.c +++ b/src/engine/fox_A48A0.c @@ -22,11 +22,7 @@ void func_800A3E00(void) { case 1: D_ctx_80177868 = 2; gDrawMode = DRAW_UNK_7; - gCsCamAtY = 0.0f; - gCsCamAtX = gCsCamAtY; - gCsCamEyeZ = gCsCamAtX; - gCsCamEyeY = gCsCamEyeZ; - gCsCamEyeX = gCsCamEyeY; + gCsCamEyeX = gCsCamEyeY = gCsCamEyeZ = gCsCamAtX = gCsCamAtY = 0.0f; gCsCamAtZ = -10.0f; break; case 2: diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 5f28e4eb..5160d6f1 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -126,9 +126,9 @@ void PlayerShot_Impact(PlayerShot* shot) { Object_Kill(&shot->obj, shot->sfxSource); return; } - shot->obj.pos.z = D_ctx_80178498; // strange order on the globals - shot->obj.pos.y = D_ctx_801784A0; - shot->obj.pos.x = D_ctx_8017849C; + shot->obj.pos.z = gShotHitPosZ; // strange order on the globals + shot->obj.pos.y = gShotHitPosY; + shot->obj.pos.x = gShotHitPosX; if ((shot->obj.id == PLAYERSHOT_BOMB) || ((gCurrentLevel != LEVEL_AQUAS) && (shot->obj.id == PLAYERSHOT_LOCK_ON) && (shot->unk_5C != 0))) { if (shot->obj.id == PLAYERSHOT_LOCK_ON) { @@ -391,10 +391,10 @@ s32 PlayerShot_CheckEventHitbox(PlayerShot* shot, Actor* actor) { Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); } - if (((actor->vwork[29].z != 0.0f) || (actor->vwork[29].x != 0.0f) || (actor->unk_0F4.z != 0.0f) || + if (((actor->vwork[29].z != 0.0f) || (actor->vwork[29].x != 0.0f) || (actor->rot_0F4.z != 0.0f) || (actor->vwork[29].y != 0.0f)) && - (actor->unk_0B4 != EVID_31)) { - Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, MTXF_APPLY); + (actor->eventType != EVID_31)) { + Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->rot_0F4.z) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, -actor->vwork[29].x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -actor->vwork[29].y * M_DTOR, MTXF_APPLY); } @@ -686,9 +686,10 @@ void PlayerShot_ApplyDamageToActor(PlayerShot* shot, Actor* actor, s32 hitIndex) actor->hitPos.y = shot->obj.pos.y; actor->hitPos.z = shot->obj.pos.z; if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && - ((actor->unk_0B4 == EVID_48) || (actor->unk_0B4 == EVID_49) || (actor->unk_0B4 == EVID_50))) || + ((actor->eventType == EVID_48) || (actor->eventType == EVID_49) || (actor->eventType == EVID_50))) || ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->fwork[23] > 1.0f)) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && (actor->unk_0B4 == EVID_67)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->dmgPart == 0) && + (actor->eventType == EVID_METEO_PYRAMID_SHIP)) || ((actor->obj.id == OBJ_ACTOR_261) && (shot->obj.id != PLAYERSHOT_LOCK_ON) && ((actor->state < 3) || (actor->state >= 5))) || ((actor->obj.id == OBJ_ACTOR_260) && (shot->obj.id != PLAYERSHOT_LOCK_ON) && (actor->timer_0BC != 0))) { @@ -713,7 +714,7 @@ void PlayerShot_ApplyDamageToActor(PlayerShot* shot, Actor* actor, s32 hitIndex) actor->timer_0C2 = 3; func_effect_80078E50(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 4); - Play_SpawnHitmark(D_ctx_8017849C, D_ctx_801784A0, D_ctx_80178498); + Play_SpawnHitmark(gShotHitPosX, gShotHitPosY, gShotHitPosZ); } } else { PlayerShot_Impact(shot); @@ -765,13 +766,13 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) { } break; case OBJ_ACTOR_EVENT: - if (actor->unk_0B4 == EVID_42) { + if (actor->eventType == EVID_42) { if (PlayerShot_CheckPolyCollision(shot, ACTOR_EVENT_ID, &actor->obj)) { actor->dmgType = DMG_BEAM; actor->dmgPart = shot->sourceId; return; } - } else if (actor->unk_0B4 == EVID_63) { + } else if (actor->eventType == EVID_63) { test.x = fabsf(actor->obj.pos.x - shot->obj.pos.x); test.y = fabsf(actor->obj.pos.y - shot->obj.pos.y); test.z = fabsf(actor->obj.pos.z - shot->obj.pos.z); @@ -939,11 +940,11 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) { if (sprite->obj.status == OBJ_ACTIVE) { if (sprite->obj.id != OBJ_SPRITE_TI_CACTUS) { if (PlayerShot_CheckSpriteHitbox(shot, sprite)) { - sprite->unk_46 = 1; + sprite->destroy = 1; } } else { if (PlayerShot_CheckObjectHitbox(shot, sprite->info.hitbox, &sprite->obj) != 0) { - sprite->unk_46 = 1; + sprite->destroy = 1; } } } @@ -1125,14 +1126,14 @@ void PlayerShot_DrawLaser(PlayerShot* shot) { } else if (gCurrentLevel == LEVEL_KATINA) { if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) { if (shot->sourceId > NPC_SHOT_ID + AI360_PEPPY) { - if (gActors[shot->sourceId - NPC_SHOT_ID].unk_0B6 == 0) { + if (gActors[shot->sourceId - NPC_SHOT_ID].animFrame == 0) { var_a1 = 1; } - if (gActors[shot->sourceId - NPC_SHOT_ID].unk_0B6 == 2) { + if (gActors[shot->sourceId - NPC_SHOT_ID].animFrame == 2) { var_a1 = 2; } } - } else if (gActors[shot->sourceId - NPC_SHOT_ID].unk_0B6 == 34) { + } else if (gActors[shot->sourceId - NPC_SHOT_ID].animFrame == 34) { var_a1 = 1; } } @@ -1538,9 +1539,9 @@ void PlayerShot_UpdateShot2(PlayerShot* shot, Player* player) { } for (sp5C.z = 0.0f; sp5C.z <= shot->scale; sp5C.z += 200.0f) { Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp38); - D_ctx_80178498 = shot->obj.pos.z; - D_ctx_801784A0 = shot->obj.pos.y; - D_ctx_8017849C = shot->obj.pos.x; + gShotHitPosZ = shot->obj.pos.z; + gShotHitPosY = shot->obj.pos.y; + gShotHitPosX = shot->obj.pos.x; shot->obj.pos.x = player->pos.x + sp38.x; shot->obj.pos.y = player->pos.y + sp38.y; shot->obj.pos.z = player->trueZpos + sp38.z; @@ -1575,7 +1576,7 @@ void PlayerShot_UpdateShot2(PlayerShot* shot, Player* player) { shot->unk_4C += shot->vel.y; shot->unk_50 += shot->vel.z; if (((gGameFrameCount % 4) == 0)) { - Play_SpawnHitmark(D_ctx_8017849C, D_ctx_801784A0, D_ctx_80178498); + Play_SpawnHitmark(gShotHitPosX, gShotHitPosY, gShotHitPosZ); } if ((fabsf(shot->obj.pos.x - shot->unk_48) < 200.0f) && (fabsf(shot->obj.pos.y - shot->unk_4C) < 200.0f) && (fabsf(shot->obj.pos.z - shot->unk_50) < 200.0f)) { @@ -1823,18 +1824,18 @@ void PlayerShot_CheckBossHitbox(PlayerShot* shot) { } void PlayerShot_SetBombLight(PlayerShot* shot) { - static u8 D_800C9C18[4] = { 255, 255, 32, 32 }; - static u8 D_800C9C1C[4] = { 255, 32, 255, 32 }; - static u8 D_800C9C20[4] = { 32, 32, 32, 255 }; + static u8 sPlayerReds[4] = { 255, 255, 32, 32 }; + static u8 sPlayerGreens[4] = { 255, 32, 255, 32 }; + static u8 sPlayerBlues[4] = { 32, 32, 32, 255 }; f32 brightness; gLight3x = shot->obj.pos.x; gLight3y = shot->obj.pos.y; gLight3z = shot->obj.pos.z; if (gVersusMode) { - gLight3R = D_800C9C18[shot->sourceId]; - gLight3G = D_800C9C1C[shot->sourceId]; - gLight3B = D_800C9C20[shot->sourceId]; + gLight3R = sPlayerReds[shot->sourceId]; + gLight3G = sPlayerGreens[shot->sourceId]; + gLight3B = sPlayerBlues[shot->sourceId]; } else { gLight3R = 90; gLight3G = 90; @@ -1881,7 +1882,7 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) { dy = sprite->obj.pos.y - shot->obj.pos.y; dz = sprite->obj.pos.z - shot->obj.pos.z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < radius) { - sprite->unk_46 = 1; + sprite->destroy = 1; } } } @@ -1905,8 +1906,8 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) { if ((actor->obj.id == OBJ_ACTOR_193) || (actor->obj.id == OBJ_ACTOR_186) || (actor->obj.id == OBJ_ACTOR_190) || (actor->obj.id == OBJ_ACTOR_202) || (actor->obj.id == OBJ_ACTOR_201) || (actor->obj.id == OBJ_ACTOR_187) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_78)) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_38)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SUPPLY_CRATE)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SX_WARP_GATE)) || (actor->obj.id == OBJ_ACTOR_196)) { actor->dmgType = DMG_EXPLOSION; actor->dmgPart = 0; @@ -2039,7 +2040,7 @@ void PlayerShot_UpdateBomb(PlayerShot* shot) { PlayerShot_SetBombLight(shot); break; case 1: - D_ctx_8017812C = 2; + gGroundClipMode = 2; shot->obj.rot.y += 1.0f; Math_SmoothStepToF(&shot->scale, shot->unk_48, 0.05f, 1.5f, 0.001f); if ((shot->timer > 0) && (shot->timer < 30)) { @@ -2062,7 +2063,7 @@ void PlayerShot_UpdateBomb(PlayerShot* shot) { if (shot->unk_58 < 0) { shot->unk_58 = 0; Object_Kill(&shot->obj, shot->sfxSource); - D_ctx_8017812C = 0; + gGroundClipMode = 0; } } PlayerShot_ApplyExplosionDamage(shot, 50); @@ -2225,7 +2226,7 @@ void PlayerShot_UpdateShot(PlayerShot* shot, s32 index) { BonusText_Display(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z, bonus); gHitCount += shot->bonus; } - if ((shot->bonus >= 7) && (gBossActive == 0) && (gLevelMode == LEVELMODE_ON_RAILS) && + if ((shot->bonus >= 7) && !gBossActive && (gLevelMode == LEVELMODE_ON_RAILS) && ((gTeamShields[TEAM_ID_FALCO] > 0) || (gTeamShields[TEAM_ID_SLIPPY] > 0) || (gTeamShields[TEAM_ID_PEPPY] > 0))) { do { @@ -2284,9 +2285,9 @@ void PlayerShot_Update(PlayerShot* shot) { if (shot->timer > 0) { shot->timer--; } - D_ctx_80178498 = shot->obj.pos.z; - D_ctx_801784A0 = shot->obj.pos.y; - D_ctx_8017849C = shot->obj.pos.x; + gShotHitPosZ = shot->obj.pos.z; + gShotHitPosY = shot->obj.pos.y; + gShotHitPosX = shot->obj.pos.x; PlayerShot_UpdateShot(shot, i); } break; diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 78c2b18e..dbded0a9 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -249,7 +249,7 @@ void Background_DrawBackdrop(void) { u8 levelType; s32 levelId; - if (D_ctx_80177AB0 == 0) { + if (gDrawBackdrop == 0) { return; } @@ -353,16 +353,16 @@ void Background_DrawBackdrop(void) { } break; case LEVEL_VENOM_ANDROSS: - if (D_ctx_80177AB0 != 6) { - if ((D_ctx_80177AB0 == 2) || (D_ctx_80177AB0 == 7)) { + if (gDrawBackdrop != 6) { + if ((gDrawBackdrop == 2) || (gDrawBackdrop == 7)) { Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, -4000.0f, -7000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE2_600F670); - } else if ((D_ctx_80177AB0 == 3) || (D_ctx_80177AB0 == 4)) { + } else if ((gDrawBackdrop == 3) || (gDrawBackdrop == 4)) { RCP_SetupDL(&gMasterDisp, 0x3E); - if (D_ctx_80177AB0 == 4) { - if (!(gGameFrameCount & 8)) { + if (gDrawBackdrop == 4) { + if ((gGameFrameCount & 8) == 0) { Math_SmoothStepToF(&gAndrossUnkBrightness, 0.0f, 1.0f, 30.0f, 0); } else { Math_SmoothStepToF(&gAndrossUnkBrightness, 120.0f, 1.0f, 30.0f, 0); @@ -387,7 +387,7 @@ void Background_DrawBackdrop(void) { } else { fake_label: // fake RCP_SetupDL(&gMasterDisp, 0x3E); - if (D_ctx_80177AB0 == 5) { + if (gDrawBackdrop == 5) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 64); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 255, 128, (s32) gAndrossUnkAlpha); @@ -400,7 +400,7 @@ void Background_DrawBackdrop(void) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C039208); Matrix_Pop(&gGfxMatrix); - if (D_ctx_80177AB0 != 5) { + if (gDrawBackdrop != 5) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 1.0f, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (gPlayer[0].camRoll + (gGameFrameCount * -1.3f)) * M_DTOR, @@ -821,7 +821,7 @@ void Background_DrawGround(void) { u16* sp1C4; Gfx* sp1C0; - if ((gCurrentLevel != LEVEL_VENOM_2) && ((gPlayer[0].cam.eye.y > 4000.0f) || (D_ctx_80177A98 == 0))) { + if ((gCurrentLevel != LEVEL_VENOM_2) && ((gPlayer[0].cam.eye.y > 4000.0f) || !gDrawGround)) { return; } if ((gCurrentLevel == LEVEL_BOLSE) && gBolseDynamicGround) { @@ -886,7 +886,7 @@ void Background_DrawGround(void) { Matrix_SetGfxMtx(&gMasterDisp); switch (gCurrentLevel) { case LEVEL_CORNERIA: - if (D_ctx_8017812C != 0) { + if (gGroundClipMode != 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -1066,7 +1066,7 @@ void Background_DrawGround(void) { case LEVEL_KATINA: case LEVEL_BOLSE: case LEVEL_VENOM_2: - if ((D_ctx_8017812C != 0) || (gCurrentLevel == LEVEL_BOLSE)) { + if ((gGroundClipMode != 0) || (gCurrentLevel == LEVEL_BOLSE)) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -1088,7 +1088,7 @@ void Background_DrawGround(void) { } break; case LEVEL_VERSUS: - if (D_ctx_8017812C != 0) { + if (gGroundClipMode != 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); diff --git a/src/engine/fox_boss.c b/src/engine/fox_boss.c index 66806874..6d5d0858 100644 --- a/src/engine/fox_boss.c +++ b/src/engine/fox_boss.c @@ -88,12 +88,12 @@ void Boss_SpawnDebris(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5 for (i = (ARRAY_COUNT(gActors)) - 1; i >= 0; i--) { if (gActors[i].obj.status == OBJ_FREE) { Boss_SetupDebris(&gActors[i], arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, argA, argB); - return; + break; } } } -void func_boss_80043188(Boss* boss) { +void Boss_SetCullDistance(Boss* boss) { boss->info.cullDistance = 30000.0f; } @@ -102,9 +102,9 @@ void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); gCsFrameCount = 0; - D_ctx_80178448 = zPos + gPathProgress; - D_ctx_80178440 = xPos; - D_ctx_80178444 = yPos; + gBossDeathCamAtZ = zPos + gPathProgress; + gBossDeathCamAtX = xPos; + gBossDeathCamAtY = yPos; player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; player->csState = 10; diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index dc11cf2e..3384f5e3 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -9,11 +9,11 @@ s32 gSceneSetup; s32 D_ctx_80177824; // some sort of flag s32 D_ctx_8017782C; // some sort of flag. all range related? GameState gGameState; -s32 gNextGameStateTimer; // next game state timer? -s32 gVsItemSpawnTimer; // timer for vs item spawn +s32 gNextGameStateTimer; +s32 gVsItemSpawnTimer; OptionState gOptionMenuStatus; -s32 gPlayState; // pause-related state -s32 D_ctx_80177868; // some sort of state. pause-related? +s32 gPlayState; +s32 D_ctx_80177868; // some sort of state. pause-related? Also used by game over LevelMode gLevelMode; DrawMode gDrawMode; s32 gPlayerNum; @@ -22,9 +22,9 @@ s32 gTeamShields[6]; s32 gSavedTeamShields[6]; s32 gPrevPlanetSavedTeamShields[6]; s32 gTeamDamage[6]; -u8 gMissionStatus; // next planet path +u8 gMissionStatus; f32 gGroundHeight; -f32 D_ctx_80177950; +f32 D_ctx_80177950; // Related to camera z-rotations? Only set to -1 in corneria intro, where it does nothing? f32 gPlayerTurnRate; f32 gPlayerTurnStickMod; f32 gCsCamEyeX; @@ -33,14 +33,14 @@ f32 gCsCamEyeZ; f32 gCsCamAtX; f32 gCsCamAtY; f32 gCsCamAtZ; -Vec3f gPlayerCamEye; -Vec3f gPlayerCamAt; +Vec3f gPlayCamEye; +Vec3f gPlayCamAt; bool gExpertMode; -s32 D_ctx_80177A10[10]; -f32 D_ctx_80177A48[10]; +s32 D_ctx_80177A10[10]; // work buffer +f32 D_ctx_80177A48[10]; // work buffer s32 gCsFrameCount; -u8 D_ctx_80177A98; // some sort of flag. Used in background -u8 D_ctx_80177AB0; +u8 gDrawGround; // some sort of flag. Used in background +u8 gDrawBackdrop; u8 gAqDrawMode; s32 gTitleState; s32 gMainController; @@ -56,7 +56,7 @@ s32 gPlanetPathStatus[24]; s32 gPlanetPathStatus[22]; // overruns gPrevPlanetTeamShields? #endif s32 gPrevPlanetTeamShields[6]; -s32 D_ctx_80177C58[6]; +s32 D_ctx_80177C58[6]; // another saved team shields. maybe this is prev planet? u8 gOptionSoundMode; s32 gVolumeSettings[3]; u16 gBgmSeqId; @@ -83,11 +83,11 @@ s32 gRingPassCount; Vec3f gFormationInitRot; Vec3f gFormationInitPos; UNK_TYPE F_80178020; -s32 D_ctx_8017812C; +s32 gGroundClipMode; LevelId gCurrentLevel; s32 gLevelPhase; s32 gBossActive; -s32 D_ctx_8017828C; +bool gKillEventActors; s32 gUseDynaFloor; s32 gRadioState; s32 gCurrentRadioPortrait; @@ -96,9 +96,9 @@ s32 gRadioMouthTimer; u8 gLeveLClearStatus[30] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -s32 D_ctx_801782C0; -s32 D_ctx_801782C8; -s32 D_ctx_801782D0; +s32 D_ctx_801782C0; // set to 0, never used +s32 D_ctx_801782C8; // set to 0, never used +s32 D_ctx_801782D0; // set to 0, never used s32 gRadioMsgCharIndex; UNK_TYPE F_801782E0; s32 gRadioMsgId; @@ -150,39 +150,43 @@ UNK_TYPE F_8017840C; UNK_TYPE P_800D31A0 = 0; s32 gStarCount; f32 gStarWarpDistortion; -f32 D_ctx_80178418; +f32 gCOComplete2CamRotY; UNK_TYPE F_8017841C; f32 gStarfieldX; f32 gStarfieldY; f32 gStarfieldRoll; -f32 D_ctx_8017842C; -f32 D_ctx_80178430; +f32 gStarfieldScrollX; // starfield yaw? +f32 gStarfieldScrollY; // starfield roll? UNK_TYPE F_80178434; UNK_TYPE F_80178438; UNK_TYPE F_8017843C; -f32 D_ctx_80178440; -f32 D_ctx_80178444; -f32 D_ctx_80178448; -f32 D_ctx_80178450[3]; // x positions of certain actors (teammates?) -f32 D_ctx_80178460[3]; // y positions of certain actors (teammates?) -f32 D_ctx_80178470[3]; // z positions of certain actors (teammates?) +f32 gBossDeathCamAtX; // +f32 gBossDeathCamAtY; +f32 gBossDeathCamAtZ; +f32 gCsTeamTargetsX[3]; // x positions of certain actors (teammates?) +f32 gCsTeamTargetsY[3]; // y positions of certain actors (teammates?) +f32 gCsTeamTargetsZ[3]; // z positions of certain actors (teammates?) f32 gCameraShakeY; s32 gCameraShake; -s32 D_ctx_80178484; // set to 10000 but not used +s32 D_ctx_80178484; // set to 100000 when pausing but not used bool gLoadLevelObjects; UNK_TYPE F_8017848C; UNK_TYPE F_80178490; -s32 D_ctx_80178494; -f32 D_ctx_80178498; -f32 D_ctx_8017849C; -f32 D_ctx_801784A0; -s32 D_ctx_801784A4; +#ifdef AVOID_UB +s32 D_ctx_80178494 = 0; +#else +s32 D_ctx_80178494; // Torpedoes have this set to their unk_5C. Were they shot2s at some point? +#endif +f32 gShotHitPosZ; +f32 gShotHitPosX; +f32 gShotHitPosY; +s32 gZOSnakeWaypointCount; UNK_TYPE F_801784A8; GroundType gGroundType; UNK_TYPE F_801784B0; UNK_TYPE F_801784B4; -// light source 1 +// light source 1. Used for most things f32 gLight1xRot; // effective Vec3f f32 gLight1yRot; f32 gLight1zRot; @@ -197,7 +201,7 @@ s32 gLight1y; s32 gLight1z; f32 gLight1rotStep; -// light source 2 +// light source 2. used for Players f32 gLight2xRot; // effective Vec3f f32 gLight2yRot; f32 gLight2zRot; @@ -209,7 +213,7 @@ s32 gLight2y; s32 gLight2z; f32 gLight2rotStep; -// this section looks like a third light source +// this section looks like a third light source. May have been for scenery shadows UNK_TYPE F_801784514; UNK_TYPE F_801784518; UNK_TYPE F_80178451C; @@ -221,16 +225,19 @@ UNK_TYPE F_801784530; UNK_TYPE F_801784534; f32 D_ctx_80178538; -f32 D_ctx_8017853C; // hitbox size modifier. always 0.0f. seems out of place +f32 D_ctx_8017853C; // hitbox size modifier for player collisions. always 0.0f. seems out of place s32 gLight2colorStep; // light 2 color step s32 D_ctx_80178544; // light 3 color step? -s32 gLight1R; // Color32 light color 1 + +s32 gLight1R; // Color32 light color 1 s32 gLight1G; s32 gLight1B; s32 gAmbientR; // Color32 ambient color s32 gAmbientG; s32 gAmbientB; + UNK_TYPE F_80178560; + s32 gLight2R; // Color32 light color 2 s32 gLight2G; s32 gLight2B; @@ -238,16 +245,17 @@ s32 gLight2RTarget; // Color32 light color 2 modifier? s32 gLight2GTarget; s32 gLight2BTarget; -s32 D_ctx_80161A70; // Color32 set but not used, start of bss +s32 D_ctx_80161A70; // unused Color32, perhaps for third light? start of bss s32 D_ctx_80161A74; s32 D_ctx_80161A78; -s32 D_ctx_80161A7C; // Color32? set but not used +s32 D_ctx_80161A7C; // unused Color32, perhaps targets for third light? s32 D_ctx_80161A80; s32 D_ctx_80161A84; + GroundSurface gGroundSurface; GroundSurface gSavedGroundSurface; u8 gGoldRingCount[4]; -u8 D_ctx_80161A94[4]; +u8 gSavedGoldRingCount[4]; s32 gHitCount; s32 gSavedHitCount; s16 gLifeCount[4]; @@ -282,7 +290,7 @@ s32 gLevelStartStatusScreenTimer; s32 gLevelClearScreenTimer; // timer for mission accomplished scrren s32 gBossHealthBar; s32 D_ctx_80177850; // bonus text related. set to 15 but never read -s32 D_ctx_80177858[4]; // set to 3 but never used +s32 D_ctx_80177858[4]; // set to 3 but never used. related to VS mode customization? PlayerForm gPlayerForms[4]; s32 gHandicap[4]; VsStage gVersusStage; @@ -321,7 +329,7 @@ u8 gGreatFoxIntact; u8 gTiStartLandmaster; u16 gControllerRumbleTimers[4]; u16 gPlayerScores[4]; -s32 D_ctx_80177C50; +s32 gCircleWipeFrame; s32 D_ctx_80177C70; // sets camera field of view Y. initialized to 0 and never changed s32 gTraining360MsgTimer; s32 gTraining360MsgIndex; @@ -341,10 +349,10 @@ s32 gLeftWingFlashTimer[4]; s32 gRightWingDebrisTimer[4]; s32 gLeftWingDebrisTimer[4]; s32 gBombCount[4]; -s32 D_ctx_80177DB8[4]; -s32 D_ctx_80177DD0[4][10]; -s32 D_ctx_80177E74; -s32 D_ctx_80177E7C; +s32 gVsPoints[4]; +s32 gVsKills[4][10]; +s32 gVsMatchOver; +s32 gVsMatchStart; bool gChangeTo360; Vec3f gTeamArrowsViewPos[10]; f32 D_ctx_80177F20[65]; // Seem to be an early implementation of RadarMark @@ -358,16 +366,16 @@ u32* gStarFillColors; UNK_TYPE F_801782A0; Scenery360* gScenery360; UNK_TYPE F_801782B0; -s32 D_ctx_801782B8; -s32 D_ctx_801782BC; -PosRot* D_ctx_801782C4; -f32* D_ctx_801782CC; +s32 gDrawSmallRocks; +s32 D_ctx_801782BC; // set to 0, never used +PosRot* gZOSnakePosRots; +f32* D_ctx_801782CC; // arrays used for dynamic floor f32* D_ctx_801782D4; f32* D_ctx_801782DC; f32* D_ctx_801782E4; f32* D_ctx_801782EC; UNK_TYPE F_801782F4; -s32 D_ctx_801782FC; +s32 gDynaFloorTimer; // timer related to dynamic floor UNK_TYPE F_80178304; UNK_TYPE F_8017830C; UNK_TYPE F_80178314; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index f3efc421..663d910d 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -169,14 +169,14 @@ void func_demo_80048CC4(Actor* actor, s32 arg1) { actor->obj.pos.x = D_demo_800C9F60[arg1].x + gPlayer[0].pos.x; actor->obj.pos.y = D_demo_800C9F60[arg1].y + gPlayer[0].pos.y; actor->obj.pos.z = D_demo_800C9F60[arg1].z + gPlayer[0].trueZpos; - actor->unk_0F4.y = 0.0f; - actor->unk_0F4.z = D_demo_800C9F90[arg1]; + actor->rot_0F4.y = 0.0f; + actor->rot_0F4.z = D_demo_800C9F90[arg1]; Object_SetInfo(&actor->info, actor->obj.id); if (arg1 == 3) { AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); - actor->unk_0B6 = 1; + actor->animFrame = 1; } else { actor->iwork[11] = 1; AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); @@ -350,9 +350,9 @@ void func_demo_80049630(ActorCutscene* this) { Math_SmoothStepToF(&this->obj.pos.x, this->vwork[0].x, 0.05f, 50.0f, 0.0001f); Math_SmoothStepToF(&this->obj.pos.y, this->vwork[0].y, 0.05f, 50.0f, 0.0001f); Math_SmoothStepToF(&this->obj.pos.z, this->vwork[0].z, 0.05f, 50.0f, 0.0001f); - Math_SmoothStepToF(&this->unk_0F4.x, gPlayer[0].rot.x, 0.1f, 2.0f, 0.0001f); - Math_SmoothStepToF(&this->unk_0F4.y, gPlayer[0].rot.y, 0.1f, 2.0f, 0.0001f); - Math_SmoothStepToF(&this->unk_0F4.z, 0.0f, 0.05f, 0.2f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.x, gPlayer[0].rot.x, 0.1f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.y, gPlayer[0].rot.y, 0.1f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.z, 0.0f, 0.05f, 0.2f, 0.0001f); break; case 1: @@ -369,8 +369,8 @@ void func_demo_80049630(ActorCutscene* this) { } break; } - Matrix_RotateY(gCalcMatrix, (this->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(this->unk_0F4.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; @@ -382,9 +382,9 @@ void func_demo_80049630(ActorCutscene* this) { this->vel.y = sp30.y; this->vel.z = sp30.z; - this->obj.rot.x = -this->unk_0F4.x; - this->obj.rot.y = this->unk_0F4.y + 180.0f; - this->obj.rot.z = -this->unk_0F4.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } void func_demo_8004990C(Player* player) { @@ -404,7 +404,7 @@ void func_demo_80049968(Actor* actor, s32 arg1) { actor->obj.pos.z = D_demo_800C9FF0[arg1] + gPlayer[0].trueZpos; actor->fwork[0] = D_demo_800CA000[arg1]; actor->fwork[1] = D_demo_800CA010[arg1]; - actor->unk_0B6 = D_demo_800CA030[arg1]; + actor->animFrame = D_demo_800CA030[arg1]; actor->state = D_demo_800CA040[arg1]; actor->obj.rot.z = D_demo_800CA020[arg1]; actor->obj.rot.y = 180.0f; @@ -451,7 +451,7 @@ void Cutscene_EnterWarpZone(Player* player) { player->pos.x += player->vel.x; player->flags_228 = 0; - player->cockpitView = false; + player->alternateView = false; player->pos.y += player->vel.y; player->pos.z += player->vel.z; @@ -587,7 +587,7 @@ void Cutscene_EnterWarpZone(Player* player) { player->unk_234 = 1; gLevelPhase = 1; - D_display_800CA230 = 0.15f; + gCamDistortion = 0.15f; AUDIO_PLAY_SFX(NA_SE_WARP_OUT, gDefaultSfxSource, 0); Play_InitLevel(); } @@ -626,7 +626,7 @@ void Cutscene_EnterWarpZone(Player* player) { player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.0f; - D_ctx_801782B8 = 0; + gDrawSmallRocks = 0; gLoadLevelObjects = 1; } Math_SmoothStepToF(&player->cam.eye.y, (player->pos.y * player->unk_148) + 50.0f, 0.2f, 15.0f, 0.01f); @@ -639,7 +639,7 @@ void Cutscene_EnterWarpZone(Player* player) { } void Cutscene_LevelStart(Player* player) { - gCsFrameCount += 1; + gCsFrameCount++; if (gLevelMode == LEVELMODE_ON_RAILS) { switch (gCurrentLevel) { case LEVEL_CORNERIA: @@ -807,7 +807,7 @@ void Cutscene_AllRangeMode(Player* player) { s32 pad1; s32 pad2; - gCsFrameCount += 1; + gCsFrameCount++; Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); if (gCsFrameCount == 37) { gChangeTo360 = true; @@ -892,7 +892,7 @@ void Cutscene_AllRangeMode(Player* player) { actor->obj.pos.x = D_demo_800CA080[i] + player->pos.x; actor->obj.pos.y = D_demo_800CA08C[i] + player->pos.y; actor->obj.pos.z = player->trueZpos - 1000.0f; - actor->unk_0F4.y = 180.0f; + actor->rot_0F4.y = 180.0f; Object_SetInfo(&actor->info, actor->obj.id); } } @@ -979,12 +979,12 @@ void Cutscene_CoComplete2(Player* player) { case 11: D_ctx_80177A48[0] = 0.0f; Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 1.0f, 5.0f, 0.0f); - player->cam.at.x += (D_ctx_80178440 - player->cam.at.x) * 0.01f; - player->cam.at.y += (D_ctx_80178444 - player->cam.at.y) * 0.01f; - player->cam.at.z += (D_ctx_80178448 - player->cam.at.z) * 0.01f; + player->cam.at.x += (gBossDeathCamAtX - player->cam.at.x) * 0.01f; + player->cam.at.y += (gBossDeathCamAtY - player->cam.at.y) * 0.01f; + player->cam.at.z += (gBossDeathCamAtZ - player->cam.at.z) * 0.01f; player->cam.eye.x += (player->cam.at.x + (500.0f * player->unk_004) - player->cam.eye.x) * 0.01f; player->cam.eye.y += (player->cam.at.y + 500.0f - player->cam.eye.y) * 0.01f; - player->cam.eye.z += (D_ctx_80178448 + (2000.0f * D_ctx_80177950) - player->cam.eye.z) * 0.01f; + player->cam.eye.z += (gBossDeathCamAtZ + (2000.0f * D_ctx_80177950) - player->cam.eye.z) * 0.01f; if (player->csEventTimer > 25) { D_ctx_80177A48[2] += 1.5f * player->unk_004; @@ -1106,7 +1106,7 @@ void Cutscene_CoComplete2(Player* player) { player->csTimer = 200; player->csEventTimer = 500; player->csState = 2; - player->unk_000 = (player->unk_004 = (player->unk_008 = (D_ctx_80178418 = 0.0f))); + player->unk_000 = player->unk_004 = player->unk_008 = gCOComplete2CamRotY = 0.0f; player->baseSpeed = 0.0f; D_ctx_80177A48[6] = 0.0f; } @@ -1114,7 +1114,7 @@ void Cutscene_CoComplete2(Player* player) { case 2: player->pos.y += 5.0f; - Matrix_RotateY(gCalcMatrix, ((player->rot.y + 180.0f) + D_ctx_80178418) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->rot.y + 180.0f + gCOComplete2CamRotY) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY); @@ -1134,12 +1134,12 @@ void Cutscene_CoComplete2(Player* player) { player->unk_000 = 0.3f; } - gCsCamEyeX += ((player->pos.x + sp6C.x) - gCsCamEyeX) * player->unk_000; - gCsCamEyeY += ((player->pos.y + sp6C.y) - gCsCamEyeY) * player->unk_000; - gCsCamEyeZ += ((player->trueZpos + gPathProgress + sp6C.z) - gCsCamEyeZ) * player->unk_000; - D_ctx_80178430 += 0.2f; - D_ctx_8017842C += 0.2f; - D_ctx_80178418 += player->unk_008; + gCsCamEyeX += (player->pos.x + sp6C.x - gCsCamEyeX) * player->unk_000; + gCsCamEyeY += (player->pos.y + sp6C.y - gCsCamEyeY) * player->unk_000; + gCsCamEyeZ += (player->trueZpos + gPathProgress + sp6C.z - gCsCamEyeZ) * player->unk_000; + gStarfieldScrollY += 0.2f; + gStarfieldScrollX += 0.2f; + gCOComplete2CamRotY += player->unk_008; Math_SmoothStepToAngle(&player->rot.z, 0.0f, 0.1f, 2.0f, 0.0f); if (player->csTimer == 0) { @@ -1176,7 +1176,7 @@ void Cutscene_CoComplete2(Player* player) { Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, -((player->bankAngle + player->rockAngle) * M_DTOR), MTXF_APPLY); - if ((D_ctx_80178418 > 70.0f) && (D_ctx_80178418 < 280.0f)) { + if ((gCOComplete2CamRotY > 70.0f) && (gCOComplete2CamRotY < 280.0f)) { func_demo_8004AA84(); } sp78.x = gActors[0].fwork[0] * gActors[0].fwork[3]; @@ -1185,9 +1185,9 @@ void Cutscene_CoComplete2(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); - D_ctx_80178450[0] = player->pos.x + sp6C.x; - D_ctx_80178460[0] = player->pos.y + sp6C.y; - D_ctx_80178470[0] = player->trueZpos + sp6C.z; + gCsTeamTargetsX[0] = player->pos.x + sp6C.x; + gCsTeamTargetsY[0] = player->pos.y + sp6C.y; + gCsTeamTargetsZ[0] = player->trueZpos + sp6C.z; sp78.x = gActors[1].fwork[0] * gActors[1].fwork[3]; sp78.y = gActors[1].fwork[1] * gActors[1].fwork[3]; @@ -1195,9 +1195,9 @@ void Cutscene_CoComplete2(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); - D_ctx_80178450[1] = player->pos.x + sp6C.x; - D_ctx_80178460[1] = player->pos.y + sp6C.y; - D_ctx_80178470[1] = player->trueZpos + sp6C.z; + gCsTeamTargetsX[1] = player->pos.x + sp6C.x; + gCsTeamTargetsY[1] = player->pos.y + sp6C.y; + gCsTeamTargetsZ[1] = player->trueZpos + sp6C.z; sp78.x = gActors[2].fwork[0] * gActors[2].fwork[3]; sp78.y = gActors[2].fwork[1] * gActors[2].fwork[3]; @@ -1205,9 +1205,9 @@ void Cutscene_CoComplete2(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); - D_ctx_80178450[2] = player->pos.x + sp6C.x; - D_ctx_80178460[2] = player->pos.y + sp6C.y; - D_ctx_80178470[2] = player->trueZpos + sp6C.z; + gCsTeamTargetsX[2] = player->pos.x + sp6C.x; + gCsTeamTargetsY[2] = player->pos.y + sp6C.y; + gCsTeamTargetsZ[2] = player->trueZpos + sp6C.z; switch (gCsFrameCount) { case 330: @@ -1245,8 +1245,8 @@ void Cutscene_CoComplete2(Player* player) { break; case 3: - D_ctx_80178430 += 0.2f; - D_ctx_8017842C += 0.2f; + gStarfieldScrollY += 0.2f; + gStarfieldScrollX += 0.2f; if (player->csTimer == 0) { player->csState = 4; player->csTimer = 30; @@ -1257,8 +1257,8 @@ void Cutscene_CoComplete2(Player* player) { break; case 4: - D_ctx_80178430 += 0.2f; - D_ctx_8017842C += 0.2f; + gStarfieldScrollY += 0.2f; + gStarfieldScrollX += 0.2f; player->unk_190 = 2.0f; player->contrailScale += 0.1f; if (player->contrailScale > 0.6f) { @@ -1355,7 +1355,7 @@ void Cutscene_LevelComplete(Player* player) { s32 sp20; s32 btn; - gCsFrameCount += 1; + gCsFrameCount++; switch (player->form) { case FORM_ARWING: @@ -1650,13 +1650,13 @@ void Cutscene_KillPlayer(Player* player) { } if (gCurrentLevel != LEVEL_TRAINING) { - gLifeCount[gPlayerNum] -= 1; + gLifeCount[gPlayerNum]--; } } else { if (player->attacker > 0) { - D_ctx_80177DD0[player->attacker - 1][D_ctx_80177DB8[player->attacker - 1]] = player->num; - D_ctx_80177DB8[player->attacker - 1] += 1; - if (gVsPointsToWin == D_ctx_80177DB8[player->attacker - 1]) { + gVsKills[player->attacker - 1][gVsPoints[player->attacker - 1]] = player->num; + gVsPoints[player->attacker - 1]++; + if (gVsPointsToWin == gVsPoints[player->attacker - 1]) { player->attacker = -1; if (player->unk_284 == 0) { func_effect_8007C688(player->pos.x, player->pos.y, player->trueZpos, 3.0f, 1000); @@ -1695,8 +1695,8 @@ void func_demo_8004D828(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; - if ((gCurrentLevel != LEVEL_VENOM_1 || gBossActive == 0) && - (gLevelType == LEVELTYPE_PLANET || gCurrentLevel == LEVEL_BOLSE)) { + if (!((gCurrentLevel == LEVEL_VENOM_1) && gBossActive) && + ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE))) { player->vel.y -= 0.5f; player->rot.x -= 2.0f; } @@ -1814,7 +1814,7 @@ void func_demo_8004DEF8(Player* player) { player->pos.x += player->vel.x; player->pos.y += player->vel.y; - if (((gCurrentLevel != LEVEL_VENOM_ANDROSS) || (gBossActive == 0)) && (gLevelType == LEVELTYPE_PLANET)) { + if (!((gCurrentLevel == LEVEL_VENOM_ANDROSS) && gBossActive) && (gLevelType == LEVELTYPE_PLANET)) { player->vel.y = player->vel.y - 0.5f; } @@ -1931,7 +1931,7 @@ void func_demo_8004E4D4(ActorCutscene* this) { f32 sp34; this->fwork[7] += 3.0f; - this->unk_0F4.z = SIN_DEG(this->fwork[7]) * 1.5f; + this->rot_0F4.z = SIN_DEG(this->fwork[7]) * 1.5f; this->fwork[8] += 2.0f; sp34 = SIN_DEG(this->fwork[8]) * 10.0f; @@ -2027,7 +2027,7 @@ void func_demo_8004E4D4(ActorCutscene* this) { case 31: AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); - this->state += 1; + this->state++; this->fwork[29] = 5.0f; /* fallthrough */ @@ -2059,9 +2059,9 @@ void func_demo_8004EBD0(ActorCutscene* this) { if (this->state < 4) { this->fwork[9] = 0.4f; - this->obj.pos.x += (D_ctx_80178450[this->index] - this->obj.pos.x) * 0.4f; - this->obj.pos.y += (D_ctx_80178460[this->index] - this->obj.pos.y) * 0.4f; - this->obj.pos.z += (D_ctx_80178470[this->index] - this->obj.pos.z) * 0.4f; + this->obj.pos.x += (gCsTeamTargetsX[this->index] - this->obj.pos.x) * 0.4f; + this->obj.pos.y += (gCsTeamTargetsY[this->index] - this->obj.pos.y) * 0.4f; + this->obj.pos.z += (gCsTeamTargetsZ[this->index] - this->obj.pos.z) * 0.4f; this->obj.rot.z *= 0.98f; this->obj.rot.x = -gPlayer[0].rot.x; @@ -2070,14 +2070,14 @@ void func_demo_8004EBD0(ActorCutscene* this) { if (1) {} this->fwork[7] += 1.0f; - if ((s32) this->fwork[7] & 0x40) { + if (((s32) this->fwork[7] & 0x40) != 0) { this->fwork[0] += 0.1f; } else { this->fwork[0] -= 0.1f; } this->fwork[8] += 1.2f; - if ((s32) this->fwork[8] & 0x40) { + if (((s32) this->fwork[8] & 0x40) != 0) { this->fwork[1] += 0.1f; } else { this->fwork[1] -= 0.1f; @@ -2088,7 +2088,7 @@ void func_demo_8004EBD0(ActorCutscene* this) { case 0: this->fwork[3] *= 0.992f; if (this->fwork[3] < 1.2f) { - this->state += 1; + this->state++; } break; @@ -2096,7 +2096,7 @@ void func_demo_8004EBD0(ActorCutscene* this) { this->fwork[3] *= 0.997f; if (this->fwork[3] < 1.0f) { this->fwork[3] = 1.0f; - this->state += 1; + this->state++; } this->timer_0BC = 560; break; @@ -2158,19 +2158,19 @@ void func_demo_8004EBD0(ActorCutscene* this) { } void func_demo_8004F05C(Actor* actor) { - if (((gLevelType == LEVELTYPE_PLANET) && (actor->unk_0B6 == 0)) || (gCurrentLevel == LEVEL_BOLSE)) { + if (((gLevelType == LEVELTYPE_PLANET) && (actor->animFrame == 0)) || (gCurrentLevel == LEVEL_BOLSE)) { actor->fwork[0] += 3.0f; actor->fwork[1] = SIN_DEG(actor->fwork[0]) * 1.5f; } switch (gCurrentLevel) { case LEVEL_BOLSE: - switch (actor->unk_0B6) { + switch (actor->animFrame) { case 0: if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { - actor->unk_0F4.z += actor->unk_0F4.y; - actor->vel.x = SIN_DEG(actor->unk_0F4.z) * 10.0f; - actor->obj.rot.z = SIN_DEG(actor->unk_0F4.z) * 40.0f; + actor->rot_0F4.z += actor->rot_0F4.y; + actor->vel.x = SIN_DEG(actor->rot_0F4.z) * 10.0f; + actor->obj.rot.z = SIN_DEG(actor->rot_0F4.z) * 40.0f; break; } @@ -2203,7 +2203,7 @@ void func_demo_8004F05C(Actor* actor) { break; case 32: - actor->obj.rot.z += actor->unk_0F4.z; + actor->obj.rot.z += actor->rot_0F4.z; if (actor->timer_0BC == 0) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -2219,7 +2219,7 @@ void func_demo_8004F05C(Actor* actor) { break; case LEVEL_SECTOR_Y: - switch (actor->unk_0B6) { + switch (actor->animFrame) { case 0: SectorY_8019FF00(actor); break; @@ -2266,8 +2266,8 @@ void func_demo_8004F05C(Actor* actor) { break; case 0: - actor->obj.rot.z = actor->unk_0F4.z; - if (actor->unk_0B6 == 10) { + actor->obj.rot.z = actor->rot_0F4.z; + if (actor->animFrame == 10) { actor->obj.pos.z = gPlayer[0].cam.eye.z + 12000.0f; } break; @@ -2388,14 +2388,13 @@ void ActorCutscene_Update(ActorCutscene* this) { case LEVEL_METEO: if (gLevelPhase == 0) { Meteo_8018ED9C(this); - break; + } else { + func_demo_80049630(this); } - - func_demo_80049630(this); break; case LEVEL_FORTUNA: - if (this->unk_0B6 == 11) { + if (this->animFrame == 11) { switch (this->state) { case 0: if (gCsFrameCount == 100) { @@ -2436,19 +2435,17 @@ void ActorCutscene_Update(ActorCutscene* this) { case LEVEL_CORNERIA: if (gLevelMode == LEVELMODE_ALL_RANGE) { func_demo_8004E4D4(this); - break; + } else { + func_demo_8004EBD0(this); } - - func_demo_8004EBD0(this); break; case LEVEL_SECTOR_X: if (gLevelPhase != 0) { func_demo_80049630(this); - break; + } else { + func_demo_8004E4D4(this); } - - func_demo_8004E4D4(this); break; case LEVEL_TITANIA: @@ -2537,7 +2534,7 @@ void ActorCutscene_Draw(Actor* actor) { f32 y; f32 x; - switch (actor->unk_0B6) { + switch (actor->animFrame) { case 1000: RCP_SetupDL(&gMasterDisp, 0x2D); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->unk_046); diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index 99a85e1d..a2209ff1 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -19,13 +19,13 @@ s32 D_display_800CA220 = 0; u8 sPlayersVisible[] = { 0, 0, 0, 0 }; // s32 sDrawCockpit = 0; // s32 D_display_800CA22C = 0; // -f32 D_display_800CA230 = 0.0f; +f32 gCamDistortion = 0.0f; Actor* gTeamHelpActor = NULL; s32 gTeamHelpTimer = 0; f32 D_display_800CA23C[3] = { 0.5f, 0.25f, 0.25f }; // f32 D_display_800CA248[3] = { 2.0f, 1.0f, 0.5f }; // -void func_display_80051B30(void) { +void Display_DrawHelpAlert(void) { s32 sp7C; f32 sp78; f32 sp74; @@ -47,7 +47,7 @@ void func_display_80051B30(void) { return; } } - if (!(gTeamHelpTimer & 4)) { + if ((gTeamHelpTimer & 4) == 0) { Matrix_RotateY(gCalcMatrix, gPlayer[0].camYaw, MTXF_NEW); Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); sp68.x = gTeamHelpActor->obj.pos.x - gPlayer[0].cam.eye.x; @@ -615,7 +615,7 @@ void func_display_80053C38(Player* player, s32 arg1) { sp4C.z = 2400.0f + sp48; Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_801613E0[1]); } - if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS) && + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS) && (fabsf(player->trueZpos + gPathProgress - player->cam.eye.z) < 10.0f)) { if (arg1 == 0) { sDrawCockpit = 1; @@ -876,7 +876,7 @@ void func_display_80054E80(Player* player) { if (gChargeTimers[player->num] > 10) { RCP_SetupDL(&gMasterDisp, 0x43); Matrix_Copy(gCalcMatrix, &D_display_80161418[player->num]); - if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { Matrix_MultVec3f(gCalcMatrix, &spB8, &sp94); } else { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); @@ -886,7 +886,7 @@ void func_display_80054E80(Player* player) { Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, sp80, sp80, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); } else { Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); @@ -918,7 +918,7 @@ void func_display_80054E80(Player* player) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); Matrix_Pop(&gGfxMatrix); - if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); } Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY); @@ -943,7 +943,7 @@ void func_display_80054E80(Player* player) { case LASERS_SINGLE: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 192, 255, 192, 128); gDPSetEnvColor(gMasterDisp++, 64, 255, 64, 128); - if (player->cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { Matrix_MultVec3f(gCalcMatrix, &spB8, &sp94); } else { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); @@ -1382,7 +1382,7 @@ void func_display_80057248(void) { s32 i; f32 var_fs0; - if (!(gGameFrameCount & 4)) { + if ((gGameFrameCount & 4) == 0) { RCP_SetupDL_40(); for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) { if (gTeamArrowsViewPos[i].z < 0.0f) { @@ -1487,12 +1487,12 @@ void func_display_800578C4(Player* player) { case 0: Math_SmoothStepToAngle(&player->wings.unk_30, 0.0f, 0.2f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->wings.unk_34, 0.0f, 0.2f, 3.0f, 0.0f); - gPlayerCamEye.x = player->cam.eye.x; - gPlayerCamEye.y = player->cam.eye.y; - gPlayerCamEye.z = player->cam.eye.z; - gPlayerCamAt.x = player->cam.at.x; - gPlayerCamAt.y = player->cam.at.y; - gPlayerCamAt.z = player->cam.at.z; + gPlayCamEye.x = player->cam.eye.x; + gPlayCamEye.y = player->cam.eye.y; + gPlayCamEye.z = player->cam.eye.z; + gPlayCamAt.x = player->cam.at.x; + gPlayCamAt.y = player->cam.at.y; + gPlayCamAt.z = player->cam.at.z; break; case 1: case 2: @@ -1521,12 +1521,12 @@ void func_display_800578C4(Player* player) { Matrix_RotateX(gCalcMatrix, (player->rot.y + D_display_800CA380) * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.x + D_display_800CA384) * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); - gPlayerCamEye.x = player->pos.x + sp40.x; - gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f; - gPlayerCamEye.z = player->trueZpos + sp40.z; - gPlayerCamAt.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x; - gPlayerCamAt.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; - gPlayerCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->trueZpos; + gPlayCamEye.x = player->pos.x + sp40.x; + gPlayCamEye.y = player->pos.y + sp40.y + 20.0f; + gPlayCamEye.z = player->trueZpos + sp40.z; + gPlayCamAt.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x; + gPlayCamAt.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; + gPlayCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->trueZpos; break; } } @@ -1535,10 +1535,10 @@ void Play_Draw(void) { s32 i; Vec3f tempVec; Vec3f playerCamUp; - Vec3f opponentPos; + Vec3f playerPos; s32 pad; - Player* opponent; - Player* player = &gPlayer[gPlayerNum]; + Player* player; + Player* camPlayer = &gPlayer[gPlayerNum]; sDrawCockpit = 0; @@ -1547,72 +1547,77 @@ void Play_Draw(void) { } Matrix_Push(&gGfxMatrix); if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { - Math_SmoothStepToF(&D_display_800CA230, 0.01f, 0.2f, 0.002f, 0.0f); + Math_SmoothStepToF(&gCamDistortion, 0.01f, 0.2f, 0.002f, 0.0f); } else { - Math_SmoothStepToF(&D_display_800CA230, 0.0f, 0.2f, 0.002f, 0.0f); + Math_SmoothStepToF(&gCamDistortion, 0.0f, 0.2f, 0.002f, 0.0f); } Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 1.0f + D_display_800CA230, 1.0f - D_display_800CA230, 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f + gCamDistortion, 1.0f - gCamDistortion, 1.0f, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 1.0f + D_display_800CA230, 1.0f - D_display_800CA230, 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f + gCamDistortion, 1.0f - gCamDistortion, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Camera_SetupLights(player); + Camera_SetupLights(camPlayer); Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); if (gLevelMode == LEVELMODE_ON_RAILS) { - Matrix_RotateY(gCalcMatrix, player->yRot_114 * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->xRot_120 * M_DTOR, MTXF_APPLY); - - tempVec.x = player->cam.eye.x - player->pos.x; - tempVec.y = player->cam.eye.y - player->pos.y; - tempVec.z = player->cam.eye.z - (player->trueZpos + player->zPath); - Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamEye); - gPlayerCamEye.x += player->pos.x; - gPlayerCamEye.y += player->pos.y; - gPlayerCamEye.z += player->trueZpos + player->zPath; - - tempVec.x = player->cam.at.x - player->pos.x; - tempVec.y = player->cam.at.y - player->pos.y; - tempVec.z = player->cam.at.z - (player->trueZpos + player->zPath); - Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamAt); - gPlayerCamAt.x += player->pos.x; - gPlayerCamAt.y += player->pos.y; - gPlayerCamAt.z += player->trueZpos + player->zPath; - - if (player->cockpitView && (player->boostSpeed > 5.0f)) { - gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->boostSpeed * 0.2f; - } - } else if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { - func_display_800578C4(player); + Matrix_RotateY(gCalcMatrix, camPlayer->yRot_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, camPlayer->xRot_120 * M_DTOR, MTXF_APPLY); + + tempVec.x = camPlayer->cam.eye.x - camPlayer->pos.x; + tempVec.y = camPlayer->cam.eye.y - camPlayer->pos.y; + tempVec.z = camPlayer->cam.eye.z - (camPlayer->trueZpos + camPlayer->zPath); + Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayCamEye); + gPlayCamEye.x += camPlayer->pos.x; + gPlayCamEye.y += camPlayer->pos.y; + gPlayCamEye.z += camPlayer->trueZpos + camPlayer->zPath; + + tempVec.x = camPlayer->cam.at.x - camPlayer->pos.x; + tempVec.y = camPlayer->cam.at.y - camPlayer->pos.y; + tempVec.z = camPlayer->cam.at.z - (camPlayer->trueZpos + camPlayer->zPath); + Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayCamAt); + gPlayCamAt.x += camPlayer->pos.x; + gPlayCamAt.y += camPlayer->pos.y; + gPlayCamAt.z += camPlayer->trueZpos + camPlayer->zPath; + + if (camPlayer->alternateView && (camPlayer->boostSpeed > 5.0f)) { + gPlayCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * camPlayer->boostSpeed * 0.2f; + } + } else if (camPlayer->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { + func_display_800578C4(camPlayer); } else { - gPlayerCamEye.x = player->cam.eye.x; - gPlayerCamEye.y = player->cam.eye.y; - gPlayerCamEye.z = player->cam.eye.z; - gPlayerCamAt.x = player->cam.at.x; - gPlayerCamAt.y = player->cam.at.y; - gPlayerCamAt.z = player->cam.at.z; - } - player->camYaw = -Math_Atan2F(gPlayerCamEye.x - gPlayerCamAt.x, gPlayerCamEye.z - gPlayerCamAt.z); - player->camPitch = -Math_Atan2F(gPlayerCamEye.y - gPlayerCamAt.y, - sqrtf(SQ(gPlayerCamEye.z - gPlayerCamAt.z) + SQ(gPlayerCamEye.x - gPlayerCamAt.x))); - Matrix_RotateY(gCalcMatrix, -player->camYaw, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, player->camPitch, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -player->camRoll * M_DTOR, MTXF_APPLY); + gPlayCamEye.x = camPlayer->cam.eye.x; + gPlayCamEye.y = camPlayer->cam.eye.y; + gPlayCamEye.z = camPlayer->cam.eye.z; + gPlayCamAt.x = camPlayer->cam.at.x; + gPlayCamAt.y = camPlayer->cam.at.y; + gPlayCamAt.z = camPlayer->cam.at.z; + } + camPlayer->camYaw = -Math_Atan2F(gPlayCamEye.x - gPlayCamAt.x, gPlayCamEye.z - gPlayCamAt.z); + camPlayer->camPitch = -Math_Atan2F(gPlayCamEye.y - gPlayCamAt.y, + sqrtf(SQ(gPlayCamEye.z - gPlayCamAt.z) + SQ(gPlayCamEye.x - gPlayCamAt.x))); + Matrix_RotateY(gCalcMatrix, -camPlayer->camYaw, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, camPlayer->camPitch, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -camPlayer->camRoll * M_DTOR, MTXF_APPLY); tempVec.x = 0.0f; tempVec.y = 100.0f; tempVec.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &tempVec, &playerCamUp); if (gStarCount != 0) { gStarfieldRoll = DEG_TO_RAD(gPlayer[0].camRoll); - Camera_SetStarfieldPos(gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, - gPlayerCamAt.z); + Camera_SetStarfieldPos(gPlayCamEye.x, gPlayCamEye.y, gPlayCamEye.z, gPlayCamAt.x, gPlayCamAt.y, gPlayCamAt.z); Background_DrawStarfield(); } Background_DrawBackdrop(); Background_DrawSun(); Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, - gPlayerCamAt.z, playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); + // if(gControllerHold[gMainController]. button & L_TRIG) { + // Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, + // playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); + // } else { + Matrix_LookAt(gGfxMatrix, gPlayCamEye.x, gPlayCamEye.y, gPlayCamEye.z, gPlayCamAt.x, gPlayCamAt.y, gPlayCamAt.z, + playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); + // } + if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { if ((gCurrentLevel == LEVEL_TITANIA) && ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (gPlayer[0].unk_19C != 0))) { @@ -1629,24 +1634,24 @@ void Play_Draw(void) { } Lights_SetOneLight(&gMasterDisp, gLight2x, gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); - for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { - opponentPos.x = opponent->pos.x; - opponentPos.y = opponent->pos.y; - opponentPos.z = opponent->trueZpos; - Display_SetSecondLight(&opponentPos); - func_display_800564C0(opponent, 0); - func_display_80057814(opponent); + for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { + playerPos.x = player->pos.x; + playerPos.y = player->pos.y; + playerPos.z = player->trueZpos; + Display_SetSecondLight(&playerPos); + func_display_800564C0(player, 0); + func_display_80057814(player); } if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { Lights_SetOneLight(&gMasterDisp, gLight2x, -1 * gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); - for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { - opponentPos.x = opponent->pos.x; - opponentPos.y = opponent->pos.y; - opponentPos.z = opponent->trueZpos; - func_display_800564C0(opponent, 1); + for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { + playerPos.x = player->pos.x; + playerPos.y = player->pos.y; + playerPos.z = player->trueZpos; + func_display_800564C0(player, 1); } Matrix_Pop(&gGfxMatrix); } @@ -1667,10 +1672,10 @@ void Play_Draw(void) { if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); - for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { + for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { if (sPlayersVisible[i] != 0) { - func_display_80055B58(opponent); - func_display_80056230(opponent); + func_display_80055B58(player); + func_display_80056230(player); } Matrix_Pop(&gGfxMatrix); } @@ -1690,11 +1695,11 @@ void Play_Draw(void) { Effect_Draw(0); } gReflectY = 1; - for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { + for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { if (sPlayersVisible[i] != 0) { - func_display_80056E2C(opponent); - func_display_80055B58(opponent); - func_display_80056230(opponent); + func_display_80056E2C(player); + func_display_80055B58(player); + func_display_80056230(player); } } if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { @@ -1712,15 +1717,15 @@ void Play_Draw(void) { if (sDrawCockpit != 0) { func_display_80053B18(); } - for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { + for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { if (sPlayersVisible[i] != 0) { if (gShowCrosshairs[i]) { - func_display_80053F7C(opponent); + func_display_80053F7C(player); } - if (opponent->form == FORM_LANDMASTER) { - func_display_80052B80(opponent); - } else if (opponent->form == FORM_ON_FOOT) { - func_display_80052584(opponent); + if (player->form == FORM_LANDMASTER) { + func_display_80052B80(player); + } else if (player->form == FORM_ON_FOOT) { + func_display_80052584(player); } } } @@ -1729,12 +1734,12 @@ void Play_Draw(void) { } Background_DrawLensFlare(); if ((gCamCount != 1) && - ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN))) { + ((camPlayer->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (camPlayer->state_1C8 == PLAYERSTATE_1C8_U_TURN))) { HUD_Draw(); HUD_DrawEdgeArrows(); } Matrix_Pop(&gGfxMatrix); - func_display_80051B30(); + Display_DrawHelpAlert(); sPlayersVisible[gPlayerNum] = 0; Matrix_Pop(&gGfxMatrix); } diff --git a/src/engine/fox_edata.c b/src/engine/fox_edata.c index 3780107d..c58f1357 100644 --- a/src/engine/fox_edata.c +++ b/src/engine/fox_edata.c @@ -2,7 +2,7 @@ #include "fox_edata_info.c" -f32* D_edata_800CF964[] = { NULL }; +f32* D_edata_800CF964[] = { NULL }; // Likely a scrapped array of scenery shadow boxes void func_edata_800594F0(Scenery* scenery) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 0d315d6e..56d9ac26 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -24,7 +24,7 @@ Vec3f D_edisplay_801615D0; Vec3f sViewPos; -s32 sDrewActor; +bool sDrewActor; Matrix D_edisplay_801615F0; WingInfo D_edisplay_80161630; @@ -90,11 +90,11 @@ f32 D_edisplay_800CFA2C[] = { void Actor202_Draw(Actor202* this) { Vec3f sp30[30]; - f32 temp = D_edisplay_800CF9B0[this->unk_0B6] - 114.0f; + f32 temp = D_edisplay_800CF9B0[this->animFrame] - 114.0f; Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Animation_GetFrameData(&D_ME_601E8C4, this->unk_0B6, sp30); + Animation_GetFrameData(&D_ME_601E8C4, this->animFrame, sp30); Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, Actor202_PostLimbDraw, &this->index, &gIdentityMatrix); } @@ -119,7 +119,7 @@ void Scenery42_Draw(Scenery_42* this) { } void Actor196_Draw(Actor196* this) { - if (this->unk_0B6 != 0) { + if (this->animFrame != 0) { gSPDisplayList(gMasterDisp++, D_CO_6032BC0); } } @@ -133,7 +133,7 @@ void Sprite167_Draw(Sprite167* this) { void FogShadow_Draw(FogShadow* this) { RCP_SetupDL_47(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 180); - switch (this->unk_45) { + switch (this->sceneryId) { case OBJ_SCENERY_0: Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.7f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -179,8 +179,9 @@ void func_edisplay_80059FDC(Scenery* scenery) { gSPDisplayList(gMasterDisp++, D_CO_6035DA0); } +// repurposed into OBJ_SCENERY_15 void func_edisplay_8005A010(Sprite* sprite) { - if (sprite->unk_48 == 0) { + if (!sprite->toLeft) { Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_60361F0); @@ -576,7 +577,7 @@ void func_edisplay_8005B7CC(Actor* actor) { void func_edisplay_8005B848(Actor* actor) { f32 scale; - switch (actor->unk_0B4) { + switch (actor->eventType) { case 0: gSPDisplayList(gMasterDisp++, D_1028230); break; @@ -600,7 +601,7 @@ void func_edisplay_8005B848(Actor* actor) { void func_edisplay_8005B9A4(Actor* actor) { Matrix_Translate(gGfxMatrix, 0.0f, -124.0f, 0.0f, MTXF_APPLY); - Animation_GetFrameData(&D_CO_6029528, actor->unk_0B6, actor->vwork); + Animation_GetFrameData(&D_CO_6029528, actor->animFrame, actor->vwork); Animation_DrawSkeleton(1, D_CO_6029674, actor->vwork, NULL, NULL, actor, &gIdentityMatrix); } @@ -619,7 +620,7 @@ f32 D_edisplay_800CFCCC[] = { 0.0f, 0.05f, 0.03f, 0.02f, 0.01f, 0.05f, 0.0f, 0.02f, }; -void func_edisplay_8005BAB4(ObjectId objId, s32 index) { +void Object_SetShadowDL(ObjectId objId, s32 index) { f32 temp_fv0; f32 temp1; f32 temp2; @@ -637,7 +638,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { case OBJ_ACTOR_CUTSCENE: case OBJ_ACTOR_TEAM_BOSS: case OBJ_ACTOR_EVENT: - switch (gActors[index].unk_0B4) { + switch (gActors[index].eventType) { case EVID_3: Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); @@ -763,7 +764,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { void ItemCheckpoint_Draw(ItemCheckpoint* this) { s32 i; - if ((gGameFrameCount & 0x18) && (this->state == 0)) { + if (((gGameFrameCount & 0x18) != 0) && (this->state == 0)) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x40); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -1001,16 +1002,16 @@ void Actor_DrawOnRails(Actor* this) { Zoness_80190F08(this); return; } - if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->unk_0B4 == EVID_200)) { + if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->eventType == EVID_200)) { Actor194_Draw(this); } else { if (this->info.unk_19 != 0) { this->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&this->obj, this->info.drawType); this->obj.pos.y -= gCameraShakeY; - } else if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->unk_0B4 != EVID_31)) { + } else if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->eventType != EVID_31)) { func_edisplay_8005D3CC(&this->obj, this->vwork[29].x, this->vwork[29].y, - this->vwork[29].z + this->unk_0F4.z, this->info.drawType); + this->vwork[29].z + this->rot_0F4.z, this->info.drawType); } else { func_edisplay_8005D008(&this->obj, this->info.drawType); } @@ -1021,7 +1022,7 @@ void Actor_DrawOnRails(Actor* this) { this->info.draw(&this->obj); Object_UpdateSfxSource(this->sfxSource); if (((this->obj.id == OBJ_ACTOR_TEAM_BOSS) || - ((this->obj.id == OBJ_ACTOR_SLIPPY_SX) && (this->unk_0B6 > 0))) && + ((this->obj.id == OBJ_ACTOR_SLIPPY_SX) && (this->animFrame > 0))) && (gReflectY > 0)) { Matrix_MultVec3f(gGfxMatrix, &sp34, &gTeamArrowsViewPos[this->aiType]); } @@ -1140,9 +1141,9 @@ void Boss_Draw(Boss* this, s32 arg1) { Vec3f origin = { 0.0f, 0.0f, 0.0f }; if (this->info.unk_19 != 0) { - this->obj.pos.y += this->unk_068 + gCameraShakeY; + this->obj.pos.y += this->yOffset + gCameraShakeY; func_edisplay_8005D1F0(&this->obj, this->info.drawType); - this->obj.pos.y -= this->unk_068 + gCameraShakeY; + this->obj.pos.y -= this->yOffset + gCameraShakeY; } else { func_edisplay_8005D1F0(&this->obj, this->info.drawType); } @@ -1299,7 +1300,7 @@ void ActorAllRange_DrawShadow(Actor* actor) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); } else if (gCurrentLevel == LEVEL_KATINA) { - if ((actor->unk_0B6 == 1) || (actor->unk_0B6 == 2)) { + if ((actor->animFrame == 1) || (actor->animFrame == 2)) { gSPDisplayList(gMasterDisp++, D_KA_600D730); } else { gSPDisplayList(gMasterDisp++, D_KA_600DBC0); @@ -1347,7 +1348,7 @@ void Object_DrawShadow(s32 index, Object* obj) { Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); - func_edisplay_8005BAB4(obj->id, index); + Object_SetShadowDL(obj->id, index); } } @@ -1381,9 +1382,9 @@ void Object_SetSfxSourceToPos(f32* sfxSrc, Vec3f* pos) { } else { Matrix_RotateY(gCalcMatrix, gPlayer[0].camYaw, MTXF_NEW); Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); - sp2C.x = pos->x - gPlayerCamEye.x; - sp2C.y = pos->y - gPlayerCamEye.y; - sp2C.z = pos->z + gPathProgress - gPlayerCamEye.z; + sp2C.x = pos->x - gPlayCamEye.x; + sp2C.y = pos->y - gPlayCamEye.y; + sp2C.z = pos->z + gPathProgress - gPlayCamEye.z; Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); sfxSrc[0] = sp20.x; sfxSrc[1] = sp20.y; @@ -1494,7 +1495,7 @@ void Display_SetSecondLight(Vec3f* pos) { if (lightFade > 1.0f) { lightFade = 1.0f; } - if (D_ctx_8017812C == 2) { + if (gGroundClipMode == 2) { lightFade = 1.0f; } sp94 = Math_Atan2F(sp9C.x, sp9C.z); @@ -1550,7 +1551,7 @@ void Object_DrawAll(s32 arg0) { if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gCurrentLevel != LEVEL_KATINA)) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - if (D_ctx_80177AB0 == 5) { + if (gDrawBackdrop == 5) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); } for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { @@ -1593,7 +1594,7 @@ void Object_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Boss_Draw(boss, arg0); Matrix_Pop(&gGfxMatrix); - if ((boss->unk_05E != 0) && (D_edisplay_801615D0.y > 0.0f)) { + if (boss->drawShadow && (D_edisplay_801615D0.y > 0.0f)) { Matrix_Push(&gGfxMatrix); Object_DrawShadow(i, &boss->obj); Matrix_Pop(&gGfxMatrix); @@ -1641,7 +1642,7 @@ void Object_DrawAll(s32 arg0) { Object_SetCullDirection(arg0); Actor_DrawOnRails(actor); Matrix_Pop(&gGfxMatrix); - if (actor->unk_0C9 != 0) { + if (actor->drawShadow) { Matrix_Push(&gGfxMatrix); Object_DrawShadow(i, &actor->obj); Matrix_Pop(&gGfxMatrix); @@ -1651,7 +1652,7 @@ void Object_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Actor_DrawAllRange(actor); Matrix_Pop(&gGfxMatrix); - if ((actor->unk_0C9 != 0) && (sDrewActor != 0) && + if (actor->drawShadow && sDrewActor && ((sViewPos.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { Matrix_Push(&gGfxMatrix); Object_DrawShadow(i, &actor->obj); @@ -1808,8 +1809,8 @@ void TexturedLine_Draw(void) { if (gCurrentLevel == LEVEL_MACBETH) { gSPDisplayList(gMasterDisp++, D_MA_6012C00); } else { - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue, - texLine->alpha); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->prim.r, texLine->prim.g, texLine->prim.b, + texLine->prim.a); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); } } @@ -1821,12 +1822,12 @@ void TexturedLine_Draw(void) { void TexturedLine_DrawPath(s32 index) { TexturedLine* texLine = &gTexturedLines[index]; - if (texLine->alpha == 255) { + if (texLine->prim.a == 255) { RCP_SetupDL(&gMasterDisp, 5); } else { RCP_SetupDL(&gMasterDisp, 0xE); } - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->red, texLine->green, texLine->blue, texLine->alpha); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->prim.r, texLine->prim.g, texLine->prim.b, texLine->prim.a); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, texLine->posAA.x, texLine->posAA.y, texLine->posAA.z, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, texLine->yRot, MTXF_APPLY); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 3318e235..385455c4 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -423,7 +423,7 @@ static s32 D_800D173C[] = { 255, 255, 255, 0, 0, 0, 255, 0, 255, 0, 0, 0, 255, 2 void func_effect_800788B0(Effect* effect) { s32 temp_ft3; - s32* tmp; + s32 tmp; switch (gCurrentLevel) { case LEVEL_METEO: @@ -436,8 +436,8 @@ void func_effect_800788B0(Effect* effect) { RCP_SetupDL(&gMasterDisp, 0x43); temp_ft3 = Math_ModF(effect->index, 4.0f); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) effect->scale1); - tmp = &D_800D173C[(s32) (temp_ft3 * 4.0f)]; - gDPSetEnvColor(gMasterDisp++, tmp[0], tmp[1], tmp[2], 255); + tmp = temp_ft3 * 4.0f; + gDPSetEnvColor(gMasterDisp++, D_800D173C[tmp + 0], D_800D173C[tmp + 1], D_800D173C[tmp + 2], 255); Graphics_SetScaleMtx(effect->scale2); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x40); @@ -873,7 +873,7 @@ void func_effect_800798F0(Effect* effect) { void func_effect_8007A28C(Effect* effect) { Texture_Scroll(D_10190C0, 16, 32, 0); - D_ctx_8017812C = 2; + gGroundClipMode = 2; effect->obj.rot.y += 1.0f; Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.05f, 1.5f, 0.001f); @@ -895,7 +895,7 @@ void func_effect_8007A28C(Effect* effect) { if (effect->unk_44 < 0) { effect->unk_44 = 0; Object_Kill(&effect->obj, effect->sfxSource); - D_ctx_8017812C = 0; + gGroundClipMode = 0; } } } @@ -1596,12 +1596,12 @@ void func_effect_8007C250(Effect* effect) { Math_SmoothStepToF(&effect->vel.y, 0.0f, 0.2f, 10.0f, 0.1f); Math_SmoothStepToF(&effect->vel.z, 0.0f, 0.2f, 10.0f, 0.1f); - var_v0 = 3; + var_v0 = 4 - 1; if (gLevelMode == LEVELMODE_ALL_RANGE) { - var_v0 = 1; + var_v0 = 2 - 1; } - if (!(effect->timer_50 & var_v0)) { + if ((effect->timer_50 & var_v0) == 0) { randX = RAND_FLOAT_CENTERED(40.0f); randY = RAND_FLOAT_CENTERED(40.0f); randOther = RAND_FLOAT(0.5f) + 1.0f; @@ -1738,12 +1738,12 @@ void func_effect_8007C8C4(Effect* effect) { f32 randOther; s32 var_v0; - var_v0 = 0; + var_v0 = 1 - 1; if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT)) { - var_v0 = 3; + var_v0 = 4 - 1; } - if (!(effect->timer_50 & var_v0) && (gLevelType == LEVELTYPE_PLANET)) { + if (((effect->timer_50 & var_v0) == 0) && (gLevelType == LEVELTYPE_PLANET)) { randX = RAND_FLOAT_CENTERED(10.0f); randY = RAND_FLOAT_CENTERED(10.0f); randOther = RAND_FLOAT(0.5f) + 1.0f; @@ -2032,8 +2032,7 @@ static f32 D_800D17F8[] = { 1.6f, 1.6f, 1.7f, 1.7f, 1.8f, 1.8f, 1.9f, 1.9f, 2.0f, 2.0f, }; -// RGBA values -static u8 D_800D184C[][4] = { +static Color_RGBA32 D_800D184C[] = { { 255, 255, 255, 255 }, { 255, 0, 0, 255 }, { 255, 40, 40, 255 }, { 255, 80, 80, 255 }, { 255, 120, 120, 255 }, { 255, 160, 160, 255 }, { 255, 200, 200, 255 }, { 255, 240, 240, 255 }, { 255, 255, 255, 255 }, { 255, 255, 255, 255 }, { 255, 255, 255, 255 }, { 255, 255, 255, 255 }, @@ -2053,8 +2052,8 @@ void func_effect_8007D55C(Effect* effect) { Graphics_SetScaleMtx(effect->scale2); if (gLevelType == LEVELTYPE_PLANET) { - gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D184C[effect->unk_4C][0], D_800D184C[effect->unk_4C][1], - D_800D184C[effect->unk_4C][2], D_800D184C[effect->unk_4C][3]); + gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D184C[effect->unk_4C].r, D_800D184C[effect->unk_4C].g, + D_800D184C[effect->unk_4C].b, D_800D184C[effect->unk_4C].a); scale = D_800D17F8[effect->unk_4C] - 0.5f; Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2324,7 +2323,7 @@ void func_effect_8007E45C(Effect* effect) { } effect->scale2 += 0.02f; - effect->unk_44 -= 1; + effect->unk_44--; if (effect->unk_44 < 0) { Object_Kill(&effect->obj, effect->sfxSource); @@ -2643,7 +2642,7 @@ void func_effect_8007F438(Effect* effect) { if (effect->unk_46 == 0) { effect->unk_46 = 30; - effect->unk_44 += 1; + effect->unk_44++; effect->unk_44 &= 1; } else { effect->unk_46--; @@ -2670,7 +2669,7 @@ void func_effect_8007F438(Effect* effect) { void func_effect_8007F5AC(Effect* effect) { if (effect->unk_4C == 0) { effect->unk_46++; - if (!(effect->unk_46 & 0x20)) { + if ((effect->unk_46 & 0x20) == 0) { effect->vel.x += 0.5f; } else { effect->vel.x -= 0.5f; @@ -2684,7 +2683,7 @@ void func_effect_8007F5AC(Effect* effect) { } effect->scale2 += 0.02f; - if (!(gGameFrameCount & 0x10)) { + if ((gGameFrameCount & 0x10) == 0) { effect->scale2 += 0.01f; } else { effect->scale2 -= 0.01f; @@ -2846,7 +2845,7 @@ void func_effect_8007FE88(Effect* effect) { return; } - if (func_effect_8007FD84(effect) != 0) { + if (func_effect_8007FD84(effect)) { Object_Kill(&effect->obj, effect->sfxSource); return; } @@ -2870,7 +2869,7 @@ void func_effect_8007FE88(Effect* effect) { effect->vel.x = destVelocity.x; effect->vel.y = destVelocity.y; effect->vel.z = destVelocity.z; - gPlayer[0].unk_2C4 += 1; + gPlayer[0].unk_2C4++; AUDIO_PLAY_SFX(NA_SE_ROLLING_REFLECT, effect->sfxSource, 0); } @@ -2979,7 +2978,7 @@ void func_effect_8008040C(Effect* effect) { return; } - if (func_effect_8007FD84(effect) != 0) { + if (func_effect_8007FD84(effect)) { Object_Kill(&effect->obj, effect->sfxSource); return; } @@ -3079,11 +3078,11 @@ void func_effect_80080ACC(Effect* effect) { break; case 1: - effect->unk_46 -= 1; + effect->unk_46--; break; case 10: - effect->unk_44 -= 1; + effect->unk_44--; if (effect->unk_44 <= 0) { effect->unk_44 = effect->unk_46; } @@ -3572,7 +3571,7 @@ void func_effect_80081C5C(Effect* effect) { Object_Kill(&effect->obj, effect->sfxSource); func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f); } else if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 1000.0f) { - ActorEvent_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); + ActorEvent_SpawnEffect347(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); Object_Kill(&effect->obj, effect->sfxSource); } sp84 = 50.0f; @@ -3756,7 +3755,7 @@ void func_effect_80081C5C(Effect* effect) { effect->unk_46 = 50; } if (effect->unk_46 != 0) { - effect->unk_46 -= 1; + effect->unk_46--; } if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) { D_800D18EC = diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 13cce9b7..7d918bbb 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -175,7 +175,7 @@ void Boss_Initialize(Boss* boss) { for (i = 0; i < sizeof(Boss); i++, ptr++) { *ptr = 0; } - boss->unk_3F8 = 1.0f; + boss->scale = 1.0f; } void Item_Initialize(Item* item) { @@ -380,12 +380,12 @@ void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) { actor->obj.pos.z += -3000.0f + objInit->zPos2; actor->obj.pos.x = objInit->xPos; actor->obj.pos.y = objInit->yPos; - actor->obj.rot.y = actor->unk_0F4.y = objInit->rot.y; - actor->obj.rot.x = actor->unk_0F4.x = objInit->rot.x; - actor->unk_0F4.z = objInit->rot.z; + actor->obj.rot.y = actor->rot_0F4.y = objInit->rot.y; + actor->obj.rot.x = actor->rot_0F4.x = objInit->rot.x; + actor->rot_0F4.z = objInit->rot.z; actor->obj.id = OBJ_ACTOR_EVENT; actor->timer_0C2 = 10; - actor->unk_0B4 = EVID_FFF; + actor->eventType = EVID_FFF; actor->aiType = objInit->id - ACTOR_EVENT_ID; Object_SetInfo(&actor->info, actor->obj.id); @@ -483,12 +483,11 @@ void Object_Load(ObjectInit* objInit, f32 xMax, f32 xMin, f32 yMax, f32 yMin) { D_Andross_801A7F60 = -(f32) objInit->rot.x; break; case OBJ_UNK_400: - D_ctx_801782B8++; + gDrawSmallRocks++; break; case OBJ_UNK_401: - if (D_ctx_801782B8 > 0) { - D_ctx_801782B8--; - break; + if (gDrawSmallRocks > 0) { + gDrawSmallRocks--; } break; } @@ -538,8 +537,8 @@ void Object_LoadLevelObjects(void) { } else { gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[gCurrentLevel]); } - if (D_ctx_8017812C == 0) { - for (j = 0; j < D_ctx_801782B8; j++) { + if (gGroundClipMode == 0) { + for (j = 0; j < gDrawSmallRocks; j++) { if (gCurrentLevel == LEVEL_AQUAS) { func_enmy_80061B68(); } else { @@ -561,10 +560,10 @@ void Object_LoadLevelObjects(void) { yMin = xMin = -4000.0f; } - if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].yRot_118 < 0.0f)) { + if ((gPlayer[0].pathChangeTimer != 0) && (gPlayer[0].pathChangeYaw < 0.0f)) { xMax = 10000.0f; } - if ((gPlayer[0].timer_210 != 0) && (gPlayer[0].yRot_118 > 0.0f)) { + if ((gPlayer[0].pathChangeTimer != 0) && (gPlayer[0].pathChangeYaw > 0.0f)) { xMin = -10000.0f; } gLastPathChange = 0; @@ -851,7 +850,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { Object_CheckSingleHitbox(pos, sprite->info.hitbox, &sprite->obj.pos)) { if ((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_TREE) || (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { - sprite->unk_46 = 1; + sprite->destroy = 1; } return 0; } @@ -904,7 +903,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } } else if (actor->scale < 0.0f) { if (Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, - actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z)) { + actor->vwork[29].y, actor->vwork[29].z + actor->rot_0F4.z)) { actor->dmgType = DMG_BEAM; actor->damage = 10; actor->dmgPart = -1; @@ -962,7 +961,7 @@ void func_enmy_80063D58(Scenery* scenery) { Sprite_Initialize(&gSprites[i]); gSprites[i].obj.status = OBJ_INIT; gSprites[i].obj.id = OBJ_SPRITE_FOG_SHADOW; - gSprites[i].unk_45 = scenery->obj.id; + gSprites[i].sceneryId = scenery->obj.id; gSprites[i].obj.pos.x = scenery->obj.pos.x; gSprites[i].obj.pos.y = 5.0f; gSprites[i].obj.pos.z = scenery->obj.pos.z; @@ -1144,16 +1143,16 @@ void Object_Init(s32 index, ObjectId objId) { } break; case OBJ_ACTOR_239: - gActors[index].iwork[0] = D_ctx_801784A4; - D_ctx_801784A4++; + gActors[index].iwork[0] = gZOSnakeWaypointCount; + gZOSnakeWaypointCount++; break; case OBJ_ACTOR_236: - D_ctx_801784A4 = 0; - gActors[index].unk_0F4.x = gActors[index].obj.rot.x; - gActors[index].unk_0F4.y = gActors[index].obj.rot.y; + gZOSnakeWaypointCount = 0; + gActors[index].rot_0F4.x = gActors[index].obj.rot.x; + gActors[index].rot_0F4.y = gActors[index].obj.rot.y; gActors[index].obj.rot.x = gActors[index].obj.rot.y = 0.0f; gActors[index].fwork[2] = gActors[index].obj.pos.y; - var_v0 = D_ctx_801782C4; + var_v0 = gZOSnakePosRots; for (var_a0 = 0; var_a0 < 200; var_a0++, var_v0++) { var_v0->pos.x = gActors[index].obj.pos.x; var_v0->pos.y = gActors[index].obj.pos.y; @@ -1185,7 +1184,7 @@ void Object_Init(s32 index, ObjectId objId) { AUDIO_PLAY_SFX(NA_SE_EN_MISSILE_ENGINE, gActors[index].sfxSource, 4); break; case OBJ_ACTOR_192: - gActors[index].unk_0C9 = 1; + gActors[index].drawShadow = true; break; case OBJ_BOSS_320: Andross_Boss320_Init(&gBosses[index]); @@ -1408,9 +1407,9 @@ void func_enmy_800655C8(Actor* actor, f32 xPos, f32 yPos, f32 zPos, s32 arg4) { actor->obj.pos.x = xPos; actor->obj.pos.y = yPos; actor->obj.pos.z = zPos; - actor->unk_0B4 = arg4; + actor->eventType = arg4; actor->timer_0BE = 50; - if (actor->unk_0B4 == 1) { + if (actor->eventType == 1) { actor->timer_0BE = 30; } actor->fwork[5] = 15.0f; @@ -1530,7 +1529,7 @@ void func_enmy_800656D4(Actor* actor) { sp88 = actor->fwork[27] - actor->obj.pos.x; sp80 = actor->fwork[29] - actor->obj.pos.z; sp80 = sqrtf(SQ(sp88) + SQ(sp80)) * 0.2f; - if (actor->unk_0B4 == 1) { + if (actor->eventType == 1) { sp80 = 0.1f; } spD0 = SIN_DEG(actor->fwork[0]) * sp80; @@ -1562,10 +1561,10 @@ void func_enmy_800656D4(Actor* actor) { actor->vel.x = sp98.x; actor->vel.y = sp98.y; actor->vel.z = sp98.z - gPathVelZ; - if (actor->unk_0B4 == 0) { + if (actor->eventType == 0) { actor->obj.rot.z += 5.0f; } - if (actor->unk_0B4 == 1) { + if (actor->eventType == 1) { if (actor->timer_0BE == 0) { actor->timer_0BE = 30; Math_Vec3fFromAngles(&sp98, actor->obj.rot.x, actor->obj.rot.y, 120.0f); @@ -1656,7 +1655,7 @@ void Actor_Despawn(Actor* actor) { !((D_versus_80178768[0] == 0) && (D_versus_80178768[1] == 0) && (D_versus_80178768[2] == 0))) { gPlayerScores[actor->dmgSource - 1] += actor->info.bonus; } - } else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->unk_0B6 == 1))) { + } else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->animFrame == 1))) { if ((actor->dmgSource == AI360_FOX + 1) && (actor->info.bonus != 0)) { gHitCount += actor->info.bonus; D_ctx_80177850 = 15; @@ -1723,17 +1722,17 @@ void func_enmy_8006654C(Actor* actor) { if (actor->fwork[0] < 20.0f) { actor->fwork[0] += 0.5f; } - actor->unk_0B6++; - if (Animation_GetFrameCount(&D_CO_6029528) < actor->unk_0B6) { - actor->unk_0B6 = 0; + actor->animFrame++; + if (Animation_GetFrameCount(&D_CO_6029528) < actor->animFrame) { + actor->animFrame = 0; } - if ((actor->obj.rot.z < 15.0f) && (actor->unk_0B6 < 20)) { + if ((actor->obj.rot.z < 15.0f) && (actor->animFrame < 20)) { actor->obj.rot.z += 1.0f; } - if ((actor->obj.rot.z > -15.0f) && (actor->unk_0B6 > 20)) { + if ((actor->obj.rot.z > -15.0f) && (actor->animFrame > 20)) { actor->obj.rot.z -= 1.0f; } - if ((actor->unk_0B6 == 20) || (actor->unk_0B6 == 40)) { + if ((actor->animFrame == 20) || (actor->animFrame == 40)) { actor->state++; actor->timer_0BC = 20; } @@ -1920,7 +1919,7 @@ void Item_CheckBounds(Item* this) { if (this->obj.pos.y < gGroundHeight + 70.0f) { Math_SmoothStepToF(&this->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f); } - if ((gCurrentLevel == LEVEL_AQUAS) && (gBossActive != 0)) { + if ((gCurrentLevel == LEVEL_AQUAS) && gBossActive) { this->obj.pos.z += 20.0f; } } else if (this->obj.pos.y < -500.0f) { @@ -2208,7 +2207,7 @@ void ItemSupplyRing_Update(Item* this) { } else { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f; } - if (gPlayer[0].cockpitView && (gLevelMode == LEVELMODE_ON_RAILS)) { + if (gPlayer[0].alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 300.0f - this->obj.pos.z) * 0.3f; } else { this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f; @@ -2308,7 +2307,7 @@ void ItemCheckpoint_Update(ItemCheckpoint* this) { } else { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.3f; } - if (gPlayer[0].cockpitView) { + if (gPlayer[0].alternateView) { this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 200.0f - this->obj.pos.z) * 0.3f; } else { this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 100.0f - this->obj.pos.z) * 0.3f; @@ -2384,40 +2383,40 @@ void ItemPathChange_Update(Item* this) { if (this->collected) { Object_Kill(&this->obj, this->sfxSource); gPlayer[0].pathStep = 0.0f; - gPlayer[0].timer_210 = this->width * 0.05f; + gPlayer[0].pathChangeTimer = this->width * 0.05f; switch (this->obj.id) { case OBJ_ITEM_PATH_SPLIT_X: if (this->obj.pos.x < gPlayer[0].pos.x) { - gPlayer[0].yRot_118 = -30.0f; + gPlayer[0].pathChangeYaw = -30.0f; gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width; } else { - gPlayer[0].yRot_118 = 30.0f; + gPlayer[0].pathChangeYaw = 30.0f; gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width; } break; case OBJ_ITEM_PATH_TURN_LEFT: - gPlayer[0].yRot_118 = 30.0f; + gPlayer[0].pathChangeYaw = 30.0f; gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width; break; case OBJ_ITEM_PATH_TURN_RIGHT: - gPlayer[0].yRot_118 = -30.0f; + gPlayer[0].pathChangeYaw = -30.0f; gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width; break; case OBJ_ITEM_PATH_SPLIT_Y: if (this->obj.pos.y < gPlayer[0].pos.y) { - gPlayer[0].xRot_124 = 30.0f; + gPlayer[0].pathChangePitch = 30.0f; gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width; } else { - gPlayer[0].xRot_124 = -30.0f; + gPlayer[0].pathChangePitch = -30.0f; gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width; } break; case OBJ_ITEM_PATH_TURN_UP: - gPlayer[0].xRot_124 = 30.0f; + gPlayer[0].pathChangePitch = 30.0f; gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width; break; case OBJ_ITEM_PATH_TURN_DOWN: - gPlayer[0].xRot_124 = -30.0f; + gPlayer[0].pathChangePitch = -30.0f; gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width; break; } @@ -2430,7 +2429,7 @@ void Sprite_UpdateDoodad(Sprite* this) { (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress)) * 180.0f) / M_PI; - if (this->unk_46 != 0) { + if (this->destroy) { this->obj.status = OBJ_FREE; func_effect_8007A6F0(&this->obj.pos, NA_SE_OB_EXPLOSION_S); switch (this->obj.id) { @@ -2505,7 +2504,7 @@ void Actor_Move(Actor* actor) { var_fv0 = 4000.0f; if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_56))) { + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_56))) { var_fv0 = 8000.0f; } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { var_fv0 = 100000.0f; @@ -2517,7 +2516,7 @@ void Actor_Move(Actor* actor) { Object_Kill(&actor->obj, actor->sfxSource); switch (actor->obj.id) { case OBJ_ACTOR_236: - D_ctx_801784A4 = 0; + gZOSnakeWaypointCount = 0; break; case OBJ_ACTOR_229: Titania_8018E3B0(actor); @@ -2526,9 +2525,9 @@ void Actor_Move(Actor* actor) { gActor194Status[actor->unk_046] = 0; break; case OBJ_ACTOR_EVENT: - if ((actor->unk_0B4 >= EVID_200) && (actor->unk_0B4 < EVID_300)) { + if ((actor->eventType >= EVID_200) && (actor->eventType < EVID_300)) { gActor194Status[actor->unk_046] = 0; - } else if ((actor->unk_0B4 == EVID_38) && (actor->unk_046 != 2)) { + } else if ((actor->eventType == EVID_SX_WARP_GATE) && (actor->unk_046 != 2)) { gRingPassCount = -1; } break; @@ -2552,7 +2551,7 @@ void Boss_Move(Boss* boss) { void Scenery_Move(Scenery* scenery) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { - scenery->obj.pos.z += scenery->unk_60; + scenery->obj.pos.z += scenery->effectVel.z; if (scenery->info.cullDistance < scenery->obj.pos.z) { Object_Kill(&scenery->obj, scenery->sfxSource); } @@ -2580,7 +2579,7 @@ void Sprite_Move(Sprite* sprite) { f32 var_fa0 = 500.0f; if (((sprite->obj.id == OBJ_SPRITE_FOG_SHADOW) && - ((sprite->unk_45 == OBJ_SCENERY_6) || (sprite->unk_45 == OBJ_SCENERY_7))) || + ((sprite->sceneryId == OBJ_SCENERY_6) || (sprite->sceneryId == OBJ_SCENERY_7))) || (sprite->obj.id == OBJ_SCENERY_8)) { var_fa0 = 1000.0f; } diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index 85565616..2628bb02 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -164,13 +164,13 @@ void Actor202_Update(Actor202* this) { switch (this->state) { case 0: - this->unk_0B6++; + this->animFrame++; - if (this->unk_0B6 >= 30) { - this->unk_0B6 = 0; + if (this->animFrame >= 30) { + this->animFrame = 0; } - if (this->unk_0B6 == 21) { + if (this->animFrame == 21) { this->state = 1; this->vel.y = 40.0f; @@ -192,14 +192,14 @@ void Actor202_Update(Actor202* this) { case 1: if (this->vel.y > 10.0f) { - this->unk_0B6++; - if (this->unk_0B6 >= 30) { - this->unk_0B6 = 29; + this->animFrame++; + if (this->animFrame >= 30) { + this->animFrame = 29; } } else { - this->unk_0B6--; - if (this->unk_0B6 < 0) { - this->unk_0B6 = 0; + this->animFrame--; + if (this->animFrame < 0) { + this->animFrame = 0; } } @@ -244,18 +244,18 @@ void Actor194_Dying(Actor194* this) { Vec3f sp34; s32 temp_hi; - this->unk_04E++; + this->counter_04E++; - if (this->unk_04E >= 100) { - this->unk_04E = 0; + if (this->counter_04E >= 100) { + this->counter_04E = 0; } - gActor194xPos[this->unk_046][this->unk_04E] = this->obj.pos.x; - gActor194yPos[this->unk_046][this->unk_04E] = this->obj.pos.y; - gActor194zPos[this->unk_046][this->unk_04E] = this->obj.pos.z; - gActor194xRot[this->unk_046][this->unk_04E] = this->obj.rot.x; - gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y; - gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z; + gActor194xPos[this->unk_046][this->counter_04E] = this->obj.pos.x; + gActor194yPos[this->unk_046][this->counter_04E] = this->obj.pos.y; + gActor194zPos[this->unk_046][this->counter_04E] = this->obj.pos.z; + gActor194xRot[this->unk_046][this->counter_04E] = this->obj.rot.x; + gActor194yRot[this->unk_046][this->counter_04E] = this->obj.rot.y; + gActor194zRot[this->unk_046][this->counter_04E] = this->obj.rot.z; this->obj.rot.x -= 10.0f; this->obj.rot.y += 3.0f; @@ -268,7 +268,7 @@ void Actor194_Dying(Actor194* this) { this->vel.z = sp34.z; if ((this->timer_0BC == 0) && ((gGameFrameCount % 4) == 0)) { - temp_hi = (D_800CFF94[this->unk_04A] + this->unk_04E) % 100; + temp_hi = (D_800CFF94[this->unk_04A] + this->counter_04E) % 100; if (this->unk_04A == 0) { func_effect_8007D2C8(gActor194xPos[this->unk_046][temp_hi], gActor194yPos[this->unk_046][temp_hi], gActor194zPos[this->unk_046][temp_hi], 7.0f); @@ -333,7 +333,7 @@ void Actor194_Draw(Actor194* this) { s16 temp_hi; for (var_s0 = this->unk_04A; var_s0 < 16; var_s0++) { - temp_hi = (D_800CFF94[var_s0] + this->unk_04E) % 100; + temp_hi = (D_800CFF94[var_s0] + this->counter_04E) % 100; Actor194_8006B46C(this, gActor194xPos[this->unk_046][temp_hi], gActor194yPos[this->unk_046][temp_hi], gActor194zPos[this->unk_046][temp_hi], gActor194xRot[this->unk_046][temp_hi], gActor194yRot[this->unk_046][temp_hi], gActor194zRot[this->unk_046][temp_hi], @@ -435,7 +435,7 @@ void Actor196_Update(Actor196* this) { case 2: if (this->timer_0BC == 0) { this->state = 3; - this->unk_0B6 = 1; + this->animFrame = 1; this->obj.pos.y += 30.0f; this->timer_0BC = 30; this->vel.y = 30.0f; @@ -454,7 +454,7 @@ void Actor196_Update(Actor196* this) { if (this->obj.pos.y < (gGroundHeight + 10.0f)) { this->obj.pos.y = gGroundHeight; this->state = 4; - this->unk_0B6 = 0; + this->animFrame = 0; this->vel.y = 0.0f; this->gravity = 0.0f; this->obj.rot.x = 0.0f; @@ -473,12 +473,12 @@ void Actor196_Update(Actor196* this) { func_enmy2_8006BB1C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); } - if (((gGameFrameCount % 8) == 0)) { + if ((gGameFrameCount % 8) == 0) { func_enmy2_8006A900(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, this->obj.pos.y + 10.0f, RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 0.5f); } - if ((this->dmgType != DMG_NONE) && (this->unk_0B6 != 0)) { + if ((this->dmgType != DMG_NONE) && (this->animFrame != 0)) { func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, this->vel.y, 0.0f, 3.0f, 5); Object_Kill(&this->obj, this->sfxSource); this->itemDrop = DROP_SILVER_RING; @@ -579,7 +579,7 @@ void ActorDebris_Update(ActorDebris* this) { Math_SmoothStepToF(&this->fwork[2], 0.0f, 0.8f, 1.0f, 0.01f); Math_SmoothStepToF(&this->vel.x, 0.0f, 0.5f, 1.0f, 0.01f); this->obj.pos.y = 0.0f; - this->iwork[0] += 1; + this->iwork[0]++; if (this->vel.y < 0.0f) { if (this->unk_04A & 2) { this->vel.y = this->vel.y * -0.05f; @@ -855,6 +855,7 @@ void ActorDebris_Update(ActorDebris* this) { } } +// Appears to be a collision check for scenery shadow boxes void func_enmy2_8006D0F4(Actor* this) { s32 i; s32 j; @@ -1045,7 +1046,8 @@ static EventActorInfo sEventActorInfo[108] = { /* 106 */ { NULL, gCubeHitbox100, 1.0f, 100.0f, 3000.0f, 0, 0, EISFX_EN_ALIEN_FLY, 0, 0.0f, 0 }, /* 107 */ { D_MA_6002890, D_MA_60368E0, -1.0f, 100.0f, 3000.0f, 1, 0, EISFX_NONE, 0, 0.0f, 1 }, }; -static u8 D_800D0DBC[6][4] = { + +static Color_RGBA32 sEventTexLineColors[6] = { // could be in-function { 255, 255, 255, 255 }, { 160, 160, 255, 255 }, { 80, 80, 255, 255 }, { 80, 255, 80, 255 }, { 255, 80, 80, 255 }, { 255, 255, 80, 255 }, @@ -1118,9 +1120,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) { case EV_OPC(EVOP_INIT_ACTOR): Audio_KillSfxBySource(this->sfxSource); - this->unk_0B4 = actorScript[this->aiIndex + 1]; + this->eventType = actorScript[this->aiIndex + 1]; - if (this->unk_0B4 == EVID_40) { + if (this->eventType == EVID_EVENT_HANDLER) { this->timer_0C2 = 10000; } else { this->timer_0C2 = 0; @@ -1129,16 +1131,16 @@ void ActorEvent_ProcessScript(ActorEvent* this) { this->fwork[11] = 0.0f; this->fwork[12] = 0.0f; - if ((this->unk_0B4 == EVID_64) || (this->unk_0B4 == EVID_81)) { + if ((this->eventType == EVID_64) || (this->eventType == EVID_81)) { this->fwork[15] = 0.0f; - } else if (this->unk_0B4 == EVID_79) { + } else if (this->eventType == EVID_79) { this->info.drawType = 2; } this->health = actorScript[this->aiIndex] & 0x1FF; this->aiIndex += 2; - if ((this->unk_0B4 >= EVID_200) && (this->unk_0B4 < EVID_300)) { + if ((this->eventType >= EVID_200) && (this->eventType < EVID_300)) { this->unk_046 = 100; this->info.hitbox = gCubeHitbox200; this->info.targetOffset = 1.0f; @@ -1151,7 +1153,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { gActor194yPos[i][j] = this->obj.pos.y; gActor194zPos[i][j] = this->obj.pos.z; } - if (this->unk_0B4 == EVID_200) { + if (this->eventType == EVID_200) { AUDIO_PLAY_SFX(NA_SE_EN_SPACE_SNAKE, this->sfxSource, 4); } break; @@ -1163,52 +1165,52 @@ void ActorEvent_ProcessScript(ActorEvent* this) { } } - if ((this->unk_0B4 == EVID_2) || (this->unk_0B4 == EVID_43)) { - this->unk_0C9 = 1; + if ((this->eventType == EVID_2) || (this->eventType == EVID_TEAMMATE)) { + this->drawShadow = true; this->iwork[11] = 1; } - if (this->unk_0B4 == EVID_81) { - this->unk_0C9 = 1; + if (this->eventType == EVID_81) { + this->drawShadow = true; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - if (this->unk_0B4 == EVID_86) { + if (this->eventType == EVID_KATT) { Audio_PlayFanfare(NA_BGM_KATT, 20, 10, 10); } - if (this->unk_0B4 == EVID_85) { + if (this->eventType == EVID_BILL) { Audio_PlayFanfare(NA_BGM_BILL, 20, 10, 10); } } - if (this->unk_0B4 == EVID_103) { - this->unk_0B6 = 0; + if (this->eventType == EVID_ANDROSS_GATE) { + this->animFrame = 0; } - if (this->unk_0B4 == EVID_104) { - this->unk_0B6 = Animation_GetFrameCount(&D_VE2_6014658) - 1; + if (this->eventType == EVID_ANDROSS_GATE_2) { + this->animFrame = Animation_GetFrameCount(&D_VE2_6014658) - 1; } - if (this->unk_0B4 < EVID_200) { - this->info.hitbox = SEGMENTED_TO_VIRTUAL(sEventActorInfo[this->unk_0B4].hitbox); - this->scale = sEventActorInfo[this->unk_0B4].scale; - this->info.unk_16 = sEventActorInfo[this->unk_0B4].info_unk_16; - this->info.unk_14 = sEventActorInfo[this->unk_0B4].info_unk_14; - this->info.unk_19 = sEventActorInfo[this->unk_0B4].info_unk_19; - this->info.targetOffset = sEventActorInfo[this->unk_0B4].targetOffset; - this->info.bonus = sEventActorInfo[this->unk_0B4].bonus; + if (this->eventType < EVID_200) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(sEventActorInfo[this->eventType].hitbox); + this->scale = sEventActorInfo[this->eventType].scale; + this->info.unk_16 = sEventActorInfo[this->eventType].info_unk_16; + this->info.unk_14 = sEventActorInfo[this->eventType].info_unk_14; + this->info.unk_19 = sEventActorInfo[this->eventType].info_unk_19; + this->info.targetOffset = sEventActorInfo[this->eventType].targetOffset; + this->info.bonus = sEventActorInfo[this->eventType].bonus; - if (this->unk_0B4 == EVID_78) { + if (this->eventType == EVID_SUPPLY_CRATE) { this->info.damage = 0; } - this->info.cullDistance = sEventActorInfo[this->unk_0B4].cullDistance; - this->fwork[25] = sEventActorInfo[this->unk_0B4].unk_10; + this->info.cullDistance = sEventActorInfo[this->eventType].cullDistance; + this->fwork[25] = sEventActorInfo[this->eventType].unk_10; - switch (sEventActorInfo[this->unk_0B4].sfx) { + switch (sEventActorInfo[this->eventType].sfx) { case EISFX_EN_ENGINE_01: - if (!((gCurrentLevel == LEVEL_SOLAR) || (this->unk_0B4 == EVID_6) || - ((gCurrentLevel == LEVEL_CORNERIA) && (this->unk_0B4 == EVID_8)))) { + if (!((gCurrentLevel == LEVEL_SOLAR) || (this->eventType == EVID_6) || + ((gCurrentLevel == LEVEL_CORNERIA) && (this->eventType == EVID_8)))) { AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, this->sfxSource, 4); } break; @@ -1237,9 +1239,9 @@ void ActorEvent_ProcessScript(ActorEvent* this) { } if (this->info.unk_16 == 0) { - this->obj.rot.z = this->fwork[23] = this->unk_0F4.z; - if (this->unk_0B4 != EVID_31) { - this->unk_0F4.z = 0.0f; + this->obj.rot.z = this->fwork[23] = this->rot_0F4.z; + if (this->eventType != EVID_31) { + this->rot_0F4.z = 0.0f; } } } @@ -1389,10 +1391,10 @@ void ActorEvent_ProcessScript(ActorEvent* this) { gTexturedLines[i].posAA.x = this->obj.pos.x - this->vel.x; gTexturedLines[i].posAA.y = this->obj.pos.y - this->vel.y; gTexturedLines[i].posAA.z = this->obj.pos.z - this->vel.z; - gTexturedLines[i].red = D_800D0DBC[actorScript[this->aiIndex + 1]][0]; - gTexturedLines[i].green = D_800D0DBC[actorScript[this->aiIndex + 1]][1]; - gTexturedLines[i].blue = D_800D0DBC[actorScript[this->aiIndex + 1]][2]; - gTexturedLines[i].alpha = D_800D0DBC[actorScript[this->aiIndex + 1]][3]; + gTexturedLines[i].prim.r = sEventTexLineColors[actorScript[this->aiIndex + 1]].r; + gTexturedLines[i].prim.g = sEventTexLineColors[actorScript[this->aiIndex + 1]].g; + gTexturedLines[i].prim.b = sEventTexLineColors[actorScript[this->aiIndex + 1]].b; + gTexturedLines[i].prim.a = sEventTexLineColors[actorScript[this->aiIndex + 1]].a; this->iwork[8] = i; break; } @@ -1626,7 +1628,7 @@ void ActorEvent_UpdateTexLines(ActorEvent* this) { } } -void ActorEvent_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_SetupEffect374(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_374; @@ -1640,12 +1642,12 @@ void ActorEvent_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { AUDIO_PLAY_SFX(NA_SE_EN_FALLING_DOWN, effect->sfxSource, 4); } -void ActorEvent_8006EB64(f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_SpawnEffect374(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 50; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - ActorEvent_8006EAC4(&gEffects[i], xPos, yPos, zPos); + ActorEvent_SetupEffect374(&gEffects[i], xPos, yPos, zPos); break; } } @@ -1747,7 +1749,7 @@ void Actor_SpawnGreatFoxLaser(s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVe } } -void ActorEvent_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { +void ActorEvent_SetupEffect347(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_347; @@ -1762,18 +1764,18 @@ void ActorEvent_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale func_effect_8007A6F0(&effect->obj.pos, NA_SE_EN_EXPLOSION_M); } -void ActorEvent_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { +void ActorEvent_SpawnEffect347(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - ActorEvent_8006F044(&gEffects[i], xPos, yPos, zPos, scale1); + ActorEvent_SetupEffect347(&gEffects[i], xPos, yPos, zPos, scale1); break; } } } -void ActorEvent_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { +void ActorEvent_SetupEffect394(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_394; @@ -1791,12 +1793,12 @@ void ActorEvent_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale func_effect_8007A6F0(&effect->obj.pos, NA_SE_EN_EXPLOSION_M); } -void ActorEvent_8006F1EC(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { +void ActorEvent_SpawnEffect394(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - ActorEvent_8006F140(&gEffects[i], xPos, yPos, zPos, scale1); + ActorEvent_SetupEffect394(&gEffects[i], xPos, yPos, zPos, scale1); break; } } @@ -1808,9 +1810,9 @@ void ActorEvent_8006F254(ActorEvent* this) { Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->rot_0F4.z) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->rot_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->rot_0F4.x * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0.0f; @@ -1819,7 +1821,7 @@ void ActorEvent_8006F254(ActorEvent* this) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); func_effect_8007F04C(OBJ_EFFECT_353, this->obj.pos.x + sp48.x, this->obj.pos.y + sp48.y, this->obj.pos.z + sp48.z, this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, this->vwork[29].x, this->vwork[29].y, - this->vwork[29].z + this->unk_0F4.z, sp48.x, sp48.y, sp48.z, 1.0f); + this->vwork[29].z + this->rot_0F4.z, sp48.x, sp48.y, sp48.z, 1.0f); } void ActorEvent_ProcessActions(ActorEvent* this) { @@ -1828,9 +1830,9 @@ void ActorEvent_ProcessActions(ActorEvent* this) { Vec3f sp6C; Sprite* sprite; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->unk_0B4 != EVID_52) && (this->unk_0B4 != EVID_103) && - (this->unk_0B4 != EVID_104) && (this->unk_0B4 != EVID_48) && (this->unk_0B4 != EVID_49) && - (this->unk_0B4 != EVID_50)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->eventType != EVID_52) && + (this->eventType != EVID_ANDROSS_GATE) && (this->eventType != EVID_ANDROSS_GATE_2) && + (this->eventType != EVID_48) && (this->eventType != EVID_49) && (this->eventType != EVID_50)) { switch (this->unk_048) { case EVACT_NONE: break; @@ -1857,8 +1859,8 @@ void ActorEvent_ProcessActions(ActorEvent* this) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); Actor_SpawnPlayerLaser(this->index, this->obj.pos.x + (sp6C.x * 1.5), this->obj.pos.y + (sp6C.y * 1.5), this->obj.pos.z + (sp6C.z * 1.5), sp6C.x, - sp6C.y, sp6C.z, this->unk_0F4.x, this->unk_0F4.y, - this->vwork[29].z + this->unk_0F4.z); + sp6C.y, sp6C.z, this->rot_0F4.x, this->rot_0F4.y, + this->vwork[29].z + this->rot_0F4.z); this->timer_0C2 = 2; this->timer_04C--; if (this->timer_04C <= 0) { @@ -1868,16 +1870,16 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_4: // shoot blue energy balls - ActorEvent_8006EB64(this->obj.pos.x, this->obj.pos.y - 20.0f, this->obj.pos.z); + ActorEvent_SpawnEffect374(this->obj.pos.x, this->obj.pos.y - 20.0f, this->obj.pos.z); this->unk_048 = EVACT_NONE; break; case EVACT_5: Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->rot_0F4.z) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->rot_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->rot_0F4.x * M_DTOR, MTXF_APPLY); sp78.x = 0.0f; sp78.y = 0.0f; @@ -1886,7 +1888,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); func_effect_8007F04C(OBJ_EFFECT_355, this->obj.pos.x + sp6C.x, this->obj.pos.y + sp6C.y, this->obj.pos.z + sp6C.z, this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, - this->vwork[29].x, this->vwork[29].y, this->vwork[29].z + this->unk_0F4.z, sp6C.x, + this->vwork[29].x, this->vwork[29].y, this->vwork[29].z + this->rot_0F4.z, sp6C.x, sp6C.y, sp6C.z, 1.0f); this->unk_048 = EVACT_NONE; break; @@ -1920,18 +1922,18 @@ void ActorEvent_ProcessActions(ActorEvent* this) { case EVACT_9: if (gCurrentLevel == LEVEL_AQUAS) { - ActorEvent_8006F1EC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 12.0f); + ActorEvent_SpawnEffect394(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 12.0f); } else { - ActorEvent_8006F0D8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); + ActorEvent_SpawnEffect347(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); } Object_Kill(&this->obj, this->sfxSource); break; case EVACT_10: if (gCurrentLevel == LEVEL_AQUAS) { - ActorEvent_8006F1EC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f); + ActorEvent_SpawnEffect394(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f); } else { - ActorEvent_8006F0D8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 15.0f); + ActorEvent_SpawnEffect347(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 15.0f); } Object_Kill(&this->obj, this->sfxSource); break; @@ -2090,38 +2092,38 @@ void ActorEvent_800701E0(ActorEvent* this) { if (ActorEvent_800700A4(this)) { return; } - if ((this->dmgType != DMG_NONE) && (this->unk_0B4 == EVID_67) && (this->dmgPart == 0)) { + if ((this->dmgType != DMG_NONE) && (this->eventType == EVID_METEO_PYRAMID_SHIP) && (this->dmgPart == 0)) { this->dmgType = DMG_NONE; } - if ((this->dmgType != DMG_NONE) && (this->unk_0B4 == EVID_83) && (this->timer_0C2 >= 2)) { + if ((this->dmgType != DMG_NONE) && (this->eventType == EVID_AQ_CLAM) && (this->timer_0C2 >= 2)) { this->dmgType = DMG_NONE; } if ((this->dmgType != DMG_NONE) && - (((this->unk_0B4 == EVID_64) && (this->dmgPart == 2)) || (this->unk_0B4 != EVID_64))) { + (((this->eventType == EVID_64) && (this->dmgPart == 2)) || (this->eventType != EVID_64))) { if (this->iwork[12] >= TEAM_ID_KATT) { this->damage = 0; } if ((this->iwork[12] >= TEAM_ID_FALCO) && (this->iwork[12] <= TEAM_ID_PEPPY)) { gTeamShields[this->iwork[12]] -= this->damage; - } else if ((this->unk_0B4 == EVID_83) && ((this->damage == 30) || (this->damage == 31))) { + } else if ((this->eventType == EVID_AQ_CLAM) && ((this->damage == 30) || (this->damage == 31))) { this->health = 0; } else { this->health -= this->damage; } if (this->health <= 0) { - if (this->unk_0B4 == EVID_106) { + if (this->eventType == EVID_KILLER_BEE) { BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3); if (1) {} gHitCount += 4; D_ctx_80177850 = 15; } - if (this->unk_0B4 != EVID_83) { - if ((this->unk_0B4 == EVID_6) && (gCurrentLevel == LEVEL_SOLAR)) { + if (this->eventType != EVID_AQ_CLAM) { + if ((this->eventType == EVID_6) && (gCurrentLevel == LEVEL_SOLAR)) { AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DOWN, this->sfxSource, 4); } else { AUDIO_PLAY_SFX(NA_SE_EN_CRASH_DOWN, this->sfxSource, 4); @@ -2135,9 +2137,9 @@ void ActorEvent_800701E0(ActorEvent* this) { } if (((Rand_ZeroOne() < chance) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) && - (this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_14) && (this->unk_0B4 != EVID_61) && - (this->damage <= 30) && (this->unk_0B4 != EVID_62) && (this->unk_0B4 != EVID_64) && - (this->unk_0B4 != EVID_72) && (this->unk_0B4 != EVID_68)) { + (this->eventType != EVID_13) && (this->eventType != EVID_14) && (this->eventType != EVID_61) && + (this->damage <= 30) && (this->eventType != EVID_62) && (this->eventType != EVID_64) && + (this->eventType != EVID_72) && (this->eventType != EVID_68)) { func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 4.0f); this->dmgType = DMG_NONE; } @@ -2146,11 +2148,11 @@ void ActorEvent_800701E0(ActorEvent* this) { this->timer_0BE = 0; this->unk_046 = 255; this->unk_048 = 900; - this->unk_0C9 = 1; + this->drawShadow = true; if (gLevelType == LEVELTYPE_PLANET) { this->timer_04C = RAND_INT(2.9f); - if (this->unk_0B4 == EVID_2) { + if (this->eventType == EVID_2) { this->timer_04C = 1; if (this->obj.pos.x < this->hitPos.x) { Play_SpawnDebris(1, this->obj.pos.x + 20.0f, this->obj.pos.y, this->obj.pos.z); @@ -2175,11 +2177,11 @@ void ActorEvent_800701E0(ActorEvent* this) { } } - if (this->unk_0B4 == EVID_90) { + if (this->eventType == EVID_90) { this->timer_04C = 999; } } else { - switch (this->unk_0B4) { + switch (this->eventType) { case EVID_13: func_enmy_800654E4(&this->obj); break; @@ -2211,14 +2213,14 @@ void ActorEvent_800701E0(ActorEvent* this) { } } - if (this->unk_0B4 == EVID_82) { + if (this->eventType == EVID_82) { AUDIO_PLAY_SFX(NA_SE_OB_SMOKE, this->sfxSource, 0); this->dmgType = DMG_BEAM; func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60); } } else { this->timer_0C6 = 20; - if ((this->unk_0B4 == EVID_6) && (gCurrentLevel == LEVEL_SOLAR)) { + if ((this->eventType == EVID_6) && (gCurrentLevel == LEVEL_SOLAR)) { AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DAMAGE, this->sfxSource, 4); } else if (this->health < 20) { AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); @@ -2226,12 +2228,12 @@ void ActorEvent_800701E0(ActorEvent* this) { AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); } - if ((this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_61) && (this->unk_0B4 != EVID_83)) { + if ((this->eventType != EVID_13) && (this->eventType != EVID_61) && (this->eventType != EVID_AQ_CLAM)) { func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 1.5f); } if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && - (this->unk_0B4 != EVID_21) && (this->unk_0B4 != EVID_23)) { + (this->eventType != EVID_A6_MISSILE) && (this->eventType != EVID_23)) { this->fwork[13] = 20.0f; if (this->obj.pos.x < this->hitPos.x) { this->fwork[13] *= -1.0f; @@ -2287,12 +2289,12 @@ void ActorEvent_800701E0(ActorEvent* this) { this->obj.status = OBJ_DYING; this->obj.pos.z -= this->vel.z; this->dmgType = DMG_BEAM; - if (this->unk_0B4 == EVID_13) { + if (this->eventType == EVID_13) { this->obj.id = OBJ_ACTOR_182; func_enmy_800654E4(&this->obj); } - if (this->unk_0B4 == EVID_61) { + if (this->eventType == EVID_61) { Meteo_8018CCF8(this); } } @@ -2302,7 +2304,7 @@ void ActorEvent_800701E0(ActorEvent* this) { void ActorEvent_80070BA8(ActorEvent* this) { if (this->dmgType != DMG_NONE) { this->dmgType = DMG_NONE; - if ((this->unk_0B4 != EVID_17) || ((this->unk_0B4 == EVID_17) && (this->dmgPart == 0))) { + if ((this->eventType != EVID_17) || ((this->eventType == EVID_17) && (this->dmgPart == 0))) { this->timer_0C6 = 10; func_effect_8007C120(this->hitPos.x, this->hitPos.y, this->hitPos.z, this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); @@ -2851,17 +2853,17 @@ void ActorEvent_80071DC0(ActorEvent* this) { Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); - if (this->unk_0B4 == EVID_30) { + if (this->eventType == EVID_30) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1074) - 1.1f); // off by 1 error? Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1074[rInd], &sp38); } - if (this->unk_0B4 == EVID_17) { + if (this->eventType == EVID_17) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D0DD4) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D0DD4[rInd], &sp38); } - if (this->unk_0B4 == EVID_31) { + if (this->eventType == EVID_31) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1194) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1194[rInd], &sp38); } @@ -2899,7 +2901,7 @@ void ActorEvent_800720E8(ActorEvent* this) { } if ((this->dmgSource >= NPC_SHOT_ID + 1) && - (gActors[this->dmgSource - NPC_SHOT_ID - 1].unk_0B4 == EVID_85)) { + (gActors[this->dmgSource - NPC_SHOT_ID - 1].eventType == EVID_BILL)) { this->damage = 20; } @@ -2932,7 +2934,7 @@ void ActorEvent_800720E8(ActorEvent* this) { } } -void ActorEvent_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { +void ActorEvent_SetupEffect365(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { Vec3f sp2C; Vec3f sp20; @@ -2956,17 +2958,18 @@ void ActorEvent_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) Object_SetInfo(&effect->info, effect->obj.id); } -void ActorEvent_8007240C(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { +void ActorEvent_SpawnEffect365(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - ActorEvent_800722EC(&gEffects[i], xPos, yPos, zPos, yRot); + ActorEvent_SetupEffect365(&gEffects[i], xPos, yPos, zPos, yRot); break; } } } +// turn for the purpose of shooting? void ActorEvent_80072474(ActorEvent* this) { f32 var_fv1; @@ -2991,7 +2994,7 @@ void ActorEvent_80072474(ActorEvent* this) { if (this->iwork[15] != 0) { var_fv1 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].trueZpos - this->obj.pos.z)); } else if (this->iwork[6] != 0) { - var_fv1 = this->unk_0F4.y; + var_fv1 = this->rot_0F4.y; } else { var_fv1 = 0.0f; } @@ -3020,7 +3023,7 @@ void ActorEvent_Update(ActorEvent* this) { Vec3f spAC; Vec3f spA0; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (D_ctx_8017828C != 0)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || gKillEventActors) { Object_Kill(&this->obj, this->sfxSource); return; } @@ -3034,27 +3037,27 @@ void ActorEvent_Update(ActorEvent* this) { } return; } - if (((this->unk_0B4 == EVID_17) || (this->unk_0B4 == EVID_30) || (this->unk_0B4 == EVID_31)) && + if (((this->eventType == EVID_17) || (this->eventType == EVID_30) || (this->eventType == EVID_31)) && (this->health <= 0)) { ActorEvent_80071DC0(this); return; } - if (this->unk_0B4 == EVID_300) { + if (this->eventType == EVID_300) { gPlayer[0].unk_1A4 = this->index; this->timer_0C2 = 100; - } else if (this->unk_0B4 >= EVID_200) { - this->unk_04E++; + } else if (this->eventType >= EVID_200) { + this->counter_04E++; - if (this->unk_04E >= 100) { - this->unk_04E = 0; + if (this->counter_04E >= 100) { + this->counter_04E = 0; } - gActor194xPos[this->unk_046][this->unk_04E] = this->obj.pos.x; - gActor194yPos[this->unk_046][this->unk_04E] = this->obj.pos.y; - gActor194zPos[this->unk_046][this->unk_04E] = this->obj.pos.z; - gActor194xRot[this->unk_046][this->unk_04E] = this->obj.rot.x; - gActor194yRot[this->unk_046][this->unk_04E] = this->obj.rot.y; - gActor194zRot[this->unk_046][this->unk_04E] = this->obj.rot.z; + gActor194xPos[this->unk_046][this->counter_04E] = this->obj.pos.x; + gActor194yPos[this->unk_046][this->counter_04E] = this->obj.pos.y; + gActor194zPos[this->unk_046][this->counter_04E] = this->obj.pos.z; + gActor194xRot[this->unk_046][this->counter_04E] = this->obj.rot.x; + gActor194yRot[this->unk_046][this->counter_04E] = this->obj.rot.y; + gActor194zRot[this->unk_046][this->counter_04E] = this->obj.rot.z; if (this->dmgType != DMG_NONE) { this->dmgType = DMG_NONE; @@ -3074,7 +3077,7 @@ void ActorEvent_Update(ActorEvent* this) { } } - if ((this->unk_0B4 == EVID_27) && (this->timer_0C2 != 0)) { + if ((this->eventType == EVID_27) && (this->timer_0C2 != 0)) { this->state = EVSTATE_READY; } @@ -3097,8 +3100,8 @@ void ActorEvent_Update(ActorEvent* this) { spEC = this->obj.pos.y; spE8 = this->obj.pos.z; - if ((this->unk_0B4 == EVID_33) || (this->unk_0B4 == EVID_68)) { - Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_NEW); + if ((this->eventType == EVID_33) || (this->eventType == EVID_68)) { + Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->rot_0F4.z) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, MTXF_APPLY); @@ -3136,7 +3139,7 @@ void ActorEvent_Update(ActorEvent* this) { if (((this->timer_0BC % 32) == 0) && (spFC == 0)) { Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->rot_0F4.z) * M_DTOR, MTXF_APPLY); spB8.x = 0.0f; spB8.y = 25.0f; @@ -3152,7 +3155,7 @@ void ActorEvent_Update(ActorEvent* this) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - if (this->unk_0B4 == EVID_68) { + if (this->eventType == EVID_68) { var_fv0 = 80.0f; } else { var_fv0 = 0.0f; @@ -3161,7 +3164,7 @@ void ActorEvent_Update(ActorEvent* this) { func_effect_8007F04C(OBJ_EFFECT_353, this->obj.pos.x + spAC.x + spA0.x, this->obj.pos.y + spAC.y + spA0.y + var_fv0, this->obj.pos.z + spAC.z + spA0.z, this->fwork[15], this->obj.rot.y, this->obj.rot.z, this->vwork[29].x, - this->vwork[29].y, this->vwork[29].z + this->unk_0F4.z, spAC.x, spAC.y, spAC.z, + this->vwork[29].y, this->vwork[29].z + this->rot_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); this->fwork[16] = -15.0f; } @@ -3177,7 +3180,7 @@ void ActorEvent_Update(ActorEvent* this) { } Math_SmoothStepToAngle(&this->vwork[29].z, 0.0f, 0.1f, 5.0f, 0.0001f); - Math_SmoothStepToAngle(&this->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&this->rot_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); spE0 = Math_RadToDeg(Math_Atan2F(spCC - spF0, spC4 - spE8)); @@ -3189,9 +3192,9 @@ void ActorEvent_Update(ActorEvent* this) { } spE4 = Math_RadToDeg(-Math_Atan2F(spC8 - spEC, sqrtf(SQ(spCC - spF0) + SQ(spC4 - spE8)))); - spEC = Math_SmoothStepToAngle(&this->unk_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); + spEC = Math_SmoothStepToAngle(&this->rot_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); - Math_SmoothStepToAngle(&this->unk_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); + Math_SmoothStepToAngle(&this->rot_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); if (this->iwork[6] != 0) { var_fv0 = 330.0f; @@ -3232,9 +3235,9 @@ void ActorEvent_Update(ActorEvent* this) { spE4 = Math_RadToDeg(-Math_Atan2F(gActors[this->iwork[1]].obj.pos.y + spD8 - spEC, sqrtf(SQ(gActors[this->iwork[1]].obj.pos.x + spDC - spF0) + SQ(gActors[this->iwork[1]].obj.pos.z + spD4 - spE8)))); - spEC = Math_SmoothStepToAngle(&this->unk_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); + spEC = Math_SmoothStepToAngle(&this->rot_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); - Math_SmoothStepToAngle(&this->unk_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); + Math_SmoothStepToAngle(&this->rot_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); if (this->iwork[6] != 0) { var_fv0 = 310.0f; @@ -3251,7 +3254,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case EVSTATE_F4_PLUS_X: - this->unk_0F4.x += this->fwork[3]; + this->rot_0F4.x += this->fwork[3]; this->fwork[2] -= this->fwork[3]; if (this->fwork[2] <= 0.0f) { ActorEvent_ProcessScript(this); @@ -3259,7 +3262,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case EVSTATE_F4_MINUS_X: - this->unk_0F4.x -= this->fwork[3]; + this->rot_0F4.x -= this->fwork[3]; this->fwork[2] -= this->fwork[3]; if (this->fwork[2] <= 0.0f) { ActorEvent_ProcessScript(this); @@ -3267,7 +3270,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case EVSTATE_F4_PLUS_Y: - this->unk_0F4.y += this->fwork[3]; + this->rot_0F4.y += this->fwork[3]; this->fwork[2] -= this->fwork[3]; if (this->fwork[2] <= 0.0f) { ActorEvent_ProcessScript(this); @@ -3275,7 +3278,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case EVSTATE_F4_MINUS_Y: - this->unk_0F4.y -= this->fwork[3]; + this->rot_0F4.y -= this->fwork[3]; this->fwork[2] -= this->fwork[3]; if (this->fwork[2] <= 0.0f) { ActorEvent_ProcessScript(this); @@ -3309,7 +3312,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case EVSTATE_TEAM_RETREAT: - Math_SmoothStepToAngle(&this->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); gTeamShields[this->iwork[12]] = -1; gTeamDamage[this->iwork[12]] = 0; break; @@ -3340,26 +3343,26 @@ void ActorEvent_Update(ActorEvent* this) { Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.1f, 5.0f, 0.0001f); - if (this->unk_0F4.x >= 360.0f) { - this->unk_0F4.x -= 360.0f; + if (this->rot_0F4.x >= 360.0f) { + this->rot_0F4.x -= 360.0f; } - if (this->unk_0F4.x < 0.0f) { - this->unk_0F4.x += 360.0f; + if (this->rot_0F4.x < 0.0f) { + this->rot_0F4.x += 360.0f; } - if (this->unk_0F4.y >= 360.0f) { - this->unk_0F4.y -= 360.0f; + if (this->rot_0F4.y >= 360.0f) { + this->rot_0F4.y -= 360.0f; } - if (this->unk_0F4.y < 0.0f) { - this->unk_0F4.y += 360.0f; + if (this->rot_0F4.y < 0.0f) { + this->rot_0F4.y += 360.0f; } if (this->iwork[6] != 0) { - if ((gLevelMode == LEVELMODE_UNK_2) && (this->unk_0B4 == EVID_200)) { - Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.1f, 10.0f, 0.00001f); + if ((gLevelMode == LEVELMODE_UNK_2) && (this->eventType == EVID_200)) { + Math_SmoothStepToAngle(&this->obj.rot.x, this->rot_0F4.x, 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->rot_0F4.y, 0.1f, 10.0f, 0.00001f); } else { - Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.2f, 100.0f, 0.00001f); - Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.x, this->rot_0F4.x, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->rot_0F4.y, 0.2f, 100.0f, 0.00001f); } } @@ -3386,10 +3389,10 @@ void ActorEvent_Update(ActorEvent* this) { } if (this->fwork[10] > 0.0f) { - if ((this->unk_0B4 == EVID_13) || (this->unk_0B4 == EVID_14) || (this->unk_0B4 == EVID_61) || - (this->unk_0B4 == EVID_62) || (this->unk_0B4 == EVID_63) || (this->unk_0B4 == EVID_64) || - (this->unk_0B4 == EVID_65) || (this->unk_0B4 == EVID_66) || (this->unk_0B4 == EVID_94) || - (this->unk_0B4 == EVID_95) || (this->unk_0B4 == EVID_97)) { + if ((this->eventType == EVID_13) || (this->eventType == EVID_14) || (this->eventType == EVID_61) || + (this->eventType == EVID_62) || (this->eventType == EVID_63) || (this->eventType == EVID_64) || + (this->eventType == EVID_65) || (this->eventType == EVID_66) || (this->eventType == EVID_94) || + (this->eventType == EVID_95) || (this->eventType == EVID_97)) { this->obj.rot.y -= this->fwork[11] * this->fwork[12]; this->obj.rot.x += this->fwork[11] * this->fwork[12]; } else { @@ -3406,9 +3409,9 @@ void ActorEvent_Update(ActorEvent* this) { } Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[23], 0.2f, 100.0f, 0.0001f); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->rot_0F4.z) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->rot_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->rot_0F4.x * M_DTOR, MTXF_APPLY); spB8.x = 0.0f; spB8.y = 0.0f; @@ -3442,14 +3445,14 @@ void ActorEvent_Update(ActorEvent* this) { ActorEvent_ProcessActions(this); ActorEvent_UpdateTexLines(this); - if (this->unk_0B4 == EVID_38) { + if (this->eventType == EVID_SX_WARP_GATE) { ActorEvent_800720E8(this); } else { if (this->scale <= -1.999f) { ActorEvent_80070BA8(this); } else { - if ((this->dmgType == DMG_BEAM) && (this->scale < 0.5f) && (this->unk_0B4 != EVID_48) && - (this->unk_0B4 != EVID_49) && (this->unk_0B4 != EVID_50)) { + if ((this->dmgType == DMG_BEAM) && (this->scale < 0.5f) && (this->eventType != EVID_48) && + (this->eventType != EVID_49) && (this->eventType != EVID_50)) { this->dmgType = DMG_NONE; if (gCurrentLevel == LEVEL_METEO) { AUDIO_PLAY_SFX(NA_SE_ROCK_REFLECT, this->sfxSource, 4); @@ -3458,9 +3461,9 @@ void ActorEvent_Update(ActorEvent* this) { } } - if ((this->unk_0B4 < EVID_200) && (this->unk_0B4 != EVID_78) && (this->scale >= 0.5f)) { - switch (this->unk_0B4) { - case EVID_71: + if ((this->eventType < EVID_200) && (this->eventType != EVID_SUPPLY_CRATE) && (this->scale >= 0.5f)) { + switch (this->eventType) { + case EVID_WING_REPAIR: ActorEvent_8006FE28(this); break; case EVID_79: @@ -3473,7 +3476,7 @@ void ActorEvent_Update(ActorEvent* this) { } } } - switch (this->unk_0B4) { + switch (this->eventType) { case EVID_92: case EVID_93: case EVID_94: @@ -3496,7 +3499,7 @@ void ActorEvent_Update(ActorEvent* this) { if (Math_SmoothStepToF(&this->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { spF0 = 350.0f; if (((gGameFrameCount % 4) == 0)) { - ActorEvent_8007240C(this->obj.pos.x, spEC, this->obj.pos.z, this->obj.rot.y); + ActorEvent_SpawnEffect365(this->obj.pos.x, spEC, this->obj.pos.z, this->obj.rot.y); AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_S, this->sfxSource, 4); } } @@ -3511,42 +3514,42 @@ void ActorEvent_Update(ActorEvent* this) { Math_SmoothStepToAngle(&this->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); } } - this->obj.rot.y = this->unk_0F4.y; + this->obj.rot.y = this->rot_0F4.y; break; case EVID_31: this->obj.rot.z = gGameFrameCount; break; - case EVID_21: - case EVID_22: + case EVID_A6_MISSILE: + case EVID_A6_ROCKET: this->obj.rot.z = gGameFrameCount * 3.0f; break; case EVID_3: - this->unk_0C9 = 1; + this->drawShadow = true; this->obj.rot.y -= 10.0f; break; case EVID_6: - this->unk_0B6++; + this->animFrame++; if (gCurrentLevel == LEVEL_SOLAR) { - if (this->unk_0B6 >= Animation_GetFrameCount(&D_SO_600636C)) { - this->unk_0B6 = 0; + if (this->animFrame >= Animation_GetFrameCount(&D_SO_600636C)) { + this->animFrame = 0; } - if (((s32) gGameFrameCount % 3) == 0) { + if ((gGameFrameCount % 3) == 0) { Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y - 20, this->obj.pos.z - 180.0f, 0.0f, RAND_FLOAT(20.0f) * -1.0f, 0.0f, 4.0f, 2); } - } else if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { - this->unk_0B6 = 0; + } else if (this->animFrame >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { + this->animFrame = 0; } break; case EVID_9: - this->unk_0B6++; - if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { - this->unk_0B6 = 0; + this->animFrame++; + if (this->animFrame >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { + this->animFrame = 0; } if (this->iwork[6] == 0) { this->obj.rot.y = 0.0f; @@ -3563,15 +3566,15 @@ void ActorEvent_Update(ActorEvent* this) { ActorEvent_80072474(this); break; - case EVID_78: + case EVID_SUPPLY_CRATE: ActorSupplies_Update(this); break; case EVID_79: if (this->timer_0C4 == 0) { - this->unk_0B6 += 1; - if (Animation_GetFrameCount(&D_ZO_600E5EC) < this->unk_0B6) { - this->unk_0B6 = 0; + this->animFrame++; + if (Animation_GetFrameCount(&D_ZO_600E5EC) < this->animFrame) { + this->animFrame = 0; } } break; @@ -3588,7 +3591,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case 0: - Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->rot_0F4.z * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); if ((this->obj.pos.y + sp90.y) > -30.0f) { @@ -3627,7 +3630,7 @@ void ActorEvent_Update(ActorEvent* this) { if ((fabsf(this->fwork[0]) > 10.0f) && ((gGameFrameCount % 2) == 0)) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { - Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->rot_0F4.z * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); effect->unk_78 = effect->unk_7A = 11; @@ -3675,7 +3678,7 @@ void ActorEvent_Update(ActorEvent* this) { effect->unk_60.z = -effect->unk_60.z; } - if (gGameFrameCount & 4) { + if ((gGameFrameCount & 4) != 0) { effect->vel.y = -effect->vel.y; } } @@ -3705,9 +3708,9 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EVID_83: + case EVID_AQ_CLAM: if (this->health <= 0) { - if (this->unk_0B6 == 20) { + if (this->animFrame == 20) { spD4 = this->obj.pos.z; spD8 = this->obj.pos.y; @@ -3718,14 +3721,14 @@ void ActorEvent_Update(ActorEvent* this) { this->obj.pos.z = spD4; } - if ((this->unk_0B6 >= 18) && (this->unk_0B6 < 24)) { + if ((this->animFrame >= 18) && (this->animFrame < 24)) { func_effect_8007BC7C(this->obj.pos.x, this->obj.pos.y + 80.0f, this->obj.pos.z + 60.0f, 20.0f); } - if (this->unk_0B6 < 49) { - this->unk_0B6++; - if (this->unk_0B6 >= 49) { - this->unk_0B6 = 49; + if (this->animFrame < 49) { + this->animFrame++; + if (this->animFrame >= 49) { + this->animFrame = 49; } if ((gGameFrameCount % 2) != 0) { Aquas_801AC8A8(RAND_FLOAT_CENTERED(100.0f) + this->obj.pos.x, @@ -3737,7 +3740,7 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EVID_88: + case EVID_AQ_STARFISH: if (this->unk_04A == 0) { this->unk_046 += 4; if (this->unk_046 >= 255) { @@ -3753,15 +3756,15 @@ void ActorEvent_Update(ActorEvent* this) { } break; - case EVID_103: - case EVID_104: + case EVID_ANDROSS_GATE: + case EVID_ANDROSS_GATE_2: Andross_80187530(this); break; - case EVID_106: - this->unk_0B6++; - if (this->unk_0B6 >= 6) { - this->unk_0B6 = 0; + case EVID_KILLER_BEE: + this->animFrame++; + if (this->animFrame >= 6) { + this->animFrame = 0; } break; } @@ -3769,7 +3772,7 @@ void ActorEvent_Update(ActorEvent* this) { if (gLevelMode == LEVELMODE_ALL_RANGE) { D_ctx_80177F20[this->index + 1] = this->obj.pos.x; D_ctx_80178028[this->index + 1] = this->obj.pos.z; - D_ctx_80178130[this->index + 1] = Math_ModF(this->unk_0F4.y, 360.0f) + 180.0f; + D_ctx_80178130[this->index + 1] = Math_ModF(this->rot_0F4.y, 360.0f) + 180.0f; D_ctx_80178238[this->index + 1] = 1; } } @@ -3819,7 +3822,7 @@ bool ActorEvent_OverrideLimbDraw2(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* return false; } -void ActorEvent_80074E3C(ActorEvent* this) { +void ActorEvent_DrawEVID_SX_WARP_GATE(ActorEvent* this) { Vec3f sp30[10]; Animation_GetFrameData(&D_SX_6013820, 0, sp30); @@ -3851,18 +3854,19 @@ void ActorEvent_Draw(ActorEvent* this) { s16 temp_s0; s32 pad; - if (this->timer_0C6 && (this->unk_0B4 != EVID_90) && (this->unk_0B4 != EVID_68) && (this->unk_0B4 != EVID_72)) { - if ((this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_14) && (this->unk_0B4 != EVID_61) && - (this->unk_0B4 != EVID_62) && (this->unk_0B4 != EVID_83) && (this->unk_0B4 != EVID_98) && + if (this->timer_0C6 && (this->eventType != EVID_90) && (this->eventType != EVID_68) && + (this->eventType != EVID_72)) { + if ((this->eventType != EVID_13) && (this->eventType != EVID_14) && (this->eventType != EVID_61) && + (this->eventType != EVID_62) && (this->eventType != EVID_AQ_CLAM) && (this->eventType != EVID_98) && (this->scale > 0.5f) && (this->timer_0C6 >= 9) && ((this->timer_0C6 & 3) == 0) && (gPlayState != PLAY_PAUSE)) { func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, this->scale * 0.07f, 3); } - if ((this->unk_0B4 != EVID_21) && (this->unk_0B4 != EVID_23) && (this->unk_0B4 != EVID_79) && - (this->unk_0B4 != EVID_83) && (this->unk_0B4 != EVID_27) && (this->unk_0B4 != EVID_51) && - (this->unk_0B4 != EVID_13) && (this->unk_0B4 != EVID_72) && (this->unk_0B4 != EVID_28) && + if ((this->eventType != EVID_A6_MISSILE) && (this->eventType != EVID_23) && (this->eventType != EVID_79) && + (this->eventType != EVID_AQ_CLAM) && (this->eventType != EVID_27) && (this->eventType != EVID_51) && + (this->eventType != EVID_13) && (this->eventType != EVID_72) && (this->eventType != EVID_28) && (this->scale > 0.5f)) { sp40 = SIN_DEG(this->timer_0C6 * 400.0f) * this->timer_0C6; Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, MTXF_APPLY); @@ -3877,10 +3881,10 @@ void ActorEvent_Draw(ActorEvent* this) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } - if ((this->unk_0B4 == EVID_29) || (this->unk_0B4 == EVID_59) || (this->unk_0B4 == EVID_60)) { + if ((this->eventType == EVID_29) || (this->eventType == EVID_59) || (this->eventType == EVID_60)) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - } else if ((this->unk_0B4 == EVID_82) || (this->unk_0B4 == EVID_90) || - ((this->unk_0B4 == EVID_6) && (gCurrentLevel == LEVEL_SOLAR))) { + } else if ((this->eventType == EVID_82) || (this->eventType == EVID_90) || + ((this->eventType == EVID_6) && (gCurrentLevel == LEVEL_SOLAR))) { if ((this->timer_0C6 % 2) == 0) { RCP_SetupDL(&gMasterDisp, 0x39); } else { @@ -3888,7 +3892,7 @@ void ActorEvent_Draw(ActorEvent* this) { } } - switch (this->unk_0B4) { + switch (this->eventType) { case EVID_92: case EVID_93: case EVID_94: @@ -3898,15 +3902,15 @@ void ActorEvent_Draw(ActorEvent* this) { gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[15], (s32) this->fwork[16], (s32) this->fwork[17], 255); - gSPDisplayList(gMasterDisp++, sEventActorInfo[this->unk_0B4].dList); + gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; default: - if ((this->unk_0B4 < EVID_200) && (sEventActorInfo[this->unk_0B4].dList != NULL)) { - gSPDisplayList(gMasterDisp++, sEventActorInfo[this->unk_0B4].dList); + if ((this->eventType < EVID_200) && (sEventActorInfo[this->eventType].dList != NULL)) { + gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList); } - switch (this->unk_0B4) { + switch (this->eventType) { case EVID_56: Cutscene_DrawGreatFox(); break; @@ -3934,7 +3938,7 @@ void ActorEvent_Draw(ActorEvent* this) { func_edisplay_8005B388(this); break; - case EVID_43: + case EVID_TEAMMATE: if (gLevelType == LEVELTYPE_PLANET) { gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); } else { @@ -3951,11 +3955,11 @@ void ActorEvent_Draw(ActorEvent* this) { case EVID_6: if (gCurrentLevel == LEVEL_SOLAR) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Animation_GetFrameData(&D_SO_600636C, this->unk_0B6, sp114); + Animation_GetFrameData(&D_SO_600636C, this->animFrame, sp114); Animation_DrawSkeleton(1, D_SO_6006558, sp114, NULL, NULL, this, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } else { - Animation_GetFrameData(&D_ENMY_PLANET_40057AC, this->unk_0B6, sp114); + Animation_GetFrameData(&D_ENMY_PLANET_40057AC, this->animFrame, sp114); Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, sp114, NULL, NULL, this, &gIdentityMatrix); } break; @@ -3967,7 +3971,7 @@ void ActorEvent_Draw(ActorEvent* this) { case EVID_9: Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); - Animation_GetFrameData(&D_ENMY_PLANET_40001A4, this->unk_0B6, sp114); + Animation_GetFrameData(&D_ENMY_PLANET_40001A4, this->animFrame, sp114); Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, this, &gIdentityMatrix); break; @@ -3994,7 +3998,7 @@ void ActorEvent_Draw(ActorEvent* this) { gSPDisplayList(gMasterDisp++, D_A6_601A120); break; - case EVID_21: + case EVID_A6_MISSILE: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6018BF0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -4003,7 +4007,7 @@ void ActorEvent_Draw(ActorEvent* this) { Actor_DrawEngineGlow(this, 2); break; - case EVID_22: + case EVID_A6_ROCKET: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6019730); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -4035,7 +4039,7 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EVID_33: - Animation_GetFrameData(&D_ENMY_SPACE_400A30C, this->unk_0B6, sp114); + Animation_GetFrameData(&D_ENMY_SPACE_400A30C, this->animFrame, sp114); Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Animation_DrawSkeleton(1, D_ENMY_SPACE_400A398, sp114, ActorEvent_OverrideLimbDraw1, NULL, this, @@ -4044,13 +4048,13 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EVID_36: - Animation_GetFrameData(&D_TI1_700CAF4, this->unk_0B6, sp114); + Animation_GetFrameData(&D_TI1_700CAF4, this->animFrame, sp114); sp114[2].z += this->fwork[15]; Animation_DrawSkeleton(1, D_TI1_700CB60, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case EVID_38: - ActorEvent_80074E3C(this); + case EVID_SX_WARP_GATE: + ActorEvent_DrawEVID_SX_WARP_GATE(this); break; case EVID_48: @@ -4060,7 +4064,7 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EVID_52: - Animation_GetFrameData(&D_ZO_601F874, this->unk_0B6, sp114); + Animation_GetFrameData(&D_ZO_601F874, this->animFrame, sp114); sp114[2].z -= this->fwork[15]; gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); @@ -4070,8 +4074,8 @@ void ActorEvent_Draw(ActorEvent* this) { case EVID_64: Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->rot_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->rot_0F4.y * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, this->fwork[15], 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4084,13 +4088,13 @@ void ActorEvent_Draw(ActorEvent* this) { Matrix_Pop(&gGfxMatrix); break; - case EVID_67: + case EVID_METEO_PYRAMID_SHIP: gSPDisplayList(gMasterDisp++, D_ME_6008AA0); RCP_SetupDL(&gMasterDisp, 0x35); gSPDisplayList(gMasterDisp++, D_ME_6009E30); break; - case EVID_78: + case EVID_SUPPLY_CRATE: ActorSupplies_Draw(this); break; @@ -4122,23 +4126,23 @@ void ActorEvent_Draw(ActorEvent* this) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case EVID_83: + case EVID_AQ_CLAM: Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); - Animation_GetFrameData(&D_AQ_602201C, this->unk_0B6, sp114); + Animation_GetFrameData(&D_AQ_602201C, this->animFrame, sp114); Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case EVID_85: + case EVID_BILL: gSPDisplayList(gMasterDisp++, D_D00B880); Actor_DrawEngineAndContrails(this); break; - case EVID_86: + case EVID_KATT: gSPDisplayList(gMasterDisp++, D_D009A40); Actor_DrawEngineAndContrails(this); break; - case EVID_88: + case EVID_AQ_STARFISH: RCP_SetupDL(&gMasterDisp, 0x16); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, this->unk_046, this->unk_046, this->unk_046, 255); gSPDisplayList(gMasterDisp++, D_AQ_6008970); @@ -4149,20 +4153,20 @@ void ActorEvent_Draw(ActorEvent* this) { gSPDisplayList(gMasterDisp++, D_AQ_6000E10); break; - case EVID_103: - case EVID_104: + case EVID_ANDROSS_GATE: + case EVID_ANDROSS_GATE_2: Andross_8018769C(this); break; - case EVID_105: + case EVID_SX_WARP_ENMY: RCP_SetupDL(&gMasterDisp, 0x23); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 143); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); gSPDisplayList(gMasterDisp++, D_WZ_7000000); break; - case EVID_106: - Animation_GetFrameData(&D_ENMY_SPACE_4000080, this->unk_0B6, sp114); + case EVID_KILLER_BEE: + Animation_GetFrameData(&D_ENMY_SPACE_4000080, this->animFrame, sp114); Animation_DrawSkeleton(1, D_ENMY_SPACE_400014C, sp114, NULL, NULL, this, &gIdentityMatrix); break; @@ -4192,7 +4196,7 @@ void func_enmy2_800763A4(Actor* actor) { Vec3f sp4C; s32 pad; - if (actor->unk_0B4 == EVID_27) { + if (actor->eventType == EVID_27) { actor->obj.pos.y -= actor->vel.y; actor->obj.status = OBJ_ACTIVE; func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, @@ -4247,7 +4251,7 @@ void func_enmy2_800763A4(Actor* actor) { break; } - if (((actor->timer_0BC % 4U) == 1) && (actor->unk_0B4 != EVID_13) && (actor->unk_0B4 != EVID_61)) { + if (((actor->timer_0BC % 4U) == 1) && (actor->eventType != EVID_13) && (actor->eventType != EVID_61)) { func_effect_8007D24C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.2f); } @@ -4305,7 +4309,7 @@ void func_enmy2_800763A4(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); } - if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EVID_2)) { + if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_2)) { if (actor->fwork[17] < 360.0f) { Play_SpawnDebris(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z); actor->fwork[17] = 777.0f; @@ -4392,12 +4396,12 @@ void func_enmy2_800763A4(Actor* actor) { actor->vel.z, 5.0f, 15); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); } else { - if ((actor->unk_0B4 != EVID_13) && (actor->unk_0B4 != EVID_61)) { + if ((actor->eventType != EVID_13) && (actor->eventType != EVID_61)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f); } - if (actor->unk_0B4 == EVID_36) { + if (actor->eventType == EVID_36) { func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 5.0f, 15); } @@ -4416,16 +4420,16 @@ void func_enmy2_800763A4(Actor* actor) { if (gLevelMode == LEVELMODE_ALL_RANGE) { D_ctx_80177F20[actor->index + 1] = actor->obj.pos.x; D_ctx_80178028[actor->index + 1] = actor->obj.pos.z; - D_ctx_80178130[actor->index + 1] = actor->unk_0F4.y + 180.0f; + D_ctx_80178130[actor->index + 1] = actor->rot_0F4.y + 180.0f; } if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { - func_360_8002EE64(actor); + ActorAllRange_SetShadowData(actor); } } void ActorEvent_Dying(ActorEvent* this) { - if ((this->unk_0B4 == EVID_48) || (this->unk_0B4 == EVID_49) || (this->unk_0B4 == EVID_50)) { + if ((this->eventType == EVID_48) || (this->eventType == EVID_49) || (this->eventType == EVID_50)) { SectorY_Actor204_Update(this); } else { func_enmy2_800763A4(this); diff --git a/src/engine/fox_fade.c b/src/engine/fox_fade.c index fb127c18..2999878d 100644 --- a/src/engine/fox_fade.c +++ b/src/engine/fox_fade.c @@ -1,23 +1,23 @@ #include "global.h" -void func_fade_80084370(s32 arg0) { - Graphics_FillRectangle(&gMasterDisp, 0, 0, arg0, SCREEN_HEIGHT, 0, 0, 0, 255); - Graphics_FillRectangle(&gMasterDisp, SCREEN_WIDTH - arg0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); +void Wipe_Horizontal(s32 frame) { + Graphics_FillRectangle(&gMasterDisp, 0, 0, frame, SCREEN_HEIGHT, 0, 0, 0, 255); + Graphics_FillRectangle(&gMasterDisp, SCREEN_WIDTH - frame, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); } -void func_fade_800843FC(s32 arg0) { - Graphics_FillRectangle(&gMasterDisp, 0, 0, SCREEN_WIDTH, arg0, 0, 0, 0, 255); - Graphics_FillRectangle(&gMasterDisp, 0, SCREEN_HEIGHT - arg0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); +void Wipe_Vertical(s32 frame) { + Graphics_FillRectangle(&gMasterDisp, 0, 0, SCREEN_WIDTH, frame, 0, 0, 0, 255); + Graphics_FillRectangle(&gMasterDisp, 0, SCREEN_HEIGHT - frame, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); } -void func_fade_80084488(s32 arg0) { +void Wipe_Circular(s32 frame) { s32 var_s1; RCP_SetupDL_12(); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -150.0f, MTXF_NEW); - for (var_s1 = 0; var_s1 < MIN(360, arg0 * 15); var_s1 += 15) { - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, MIN((arg0 - (var_s1 / 15)) * 15, 255)); + for (var_s1 = 0; var_s1 < MIN(360, frame * 15); var_s1 += 15) { + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, MIN((frame - (var_s1 / 15)) * 15, 255)); Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, var_s1 * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.53f, 1.0f, 1.0f, MTXF_APPLY); @@ -28,17 +28,17 @@ void func_fade_80084488(s32 arg0) { Matrix_Pop(&gGfxMatrix); } -void func_fade_80084688(s32 fade, s32 progress) { - if (progress != 0) { - switch (fade) { - case 0: - func_fade_80084488(progress); +void Wipe_Draw(WipeMode mode, s32 frame) { + if (frame != 0) { + switch (mode) { + case WIPE_CIRCULAR: + Wipe_Circular(frame); break; - case 1: - func_fade_80084370(progress); + case WIPE_HORIZONTAL: + Wipe_Horizontal(frame); break; - case 2: - func_fade_800843FC(progress); + case WIPE_VERTICAL: + Wipe_Vertical(frame); break; default: (void) "そのような フェード は ない (%d)\n"; // There is no such fade diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index 3852212e..c46a9b24 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -4,15 +4,15 @@ #include "assets/ast_logo.h" #include "mods.h" -f32 D_game_80161A10; -f32 D_game_80161A14; +f32 gNextVsViewScale; +f32 gVsViewScale; s32 gPlayerInactive[4]; -s32 D_game_80161A28; +s32 gVsMenuSelection; u8 gShowHud; u16 gNextLevelPhase; u16 gNextLevel; u16 gNextGameState; -u16 D_game_80161A34; +u16 gLastGameState; u16 gBgColor; u8 gBlurAlpha; u8 gGameStandby; @@ -20,8 +20,8 @@ f32 gFovY; f32 gProjectNear; f32 gProjectFar; -s32 gShowCrosshairs[4] = { true, true, true, true }; -s32 D_game_800D2870 = 0; +bool gShowCrosshairs[4] = { true, true, true, true }; +bool D_game_800D2870 = false; static s32 sVsCameraULx[] = { 0, SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2 }; static s32 sVsCameraLRx[] = { SCREEN_WIDTH / 2 - 1, SCREEN_WIDTH - 1, SCREEN_WIDTH / 2 - 1, SCREEN_WIDTH - 1 }; static s32 sVsCameraULy[] = { 0, 0, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / 2 }; @@ -73,7 +73,7 @@ void Game_Initialize(void) { gFovY = 45.0f; gProjectNear = 10.0f; gProjectFar = 12800.0f; - D_game_80161A10 = D_game_80161A14 = 0.0f; + gNextVsViewScale = gVsViewScale = 0.0f; gSceneId = SCENE_LOGO; gSceneSetup = 0; Load_InitDmaAndMsg(); @@ -81,7 +81,7 @@ void Game_Initialize(void) { } void Game_SetGameState(void) { - D_game_80161A14 = D_game_80161A10; + gVsViewScale = gNextVsViewScale; if (gNextGameState == GSTATE_NONE) { return; @@ -202,48 +202,48 @@ void Game_InitViewport(Gfx** dList, u8 camCount, u8 camIndex) { if ((camCount != 1) && (camCount == 4)) { switch (camIndex) { case 0: - gViewport->vp.vscale[0] = SCREEN_WIDTH * (D_game_80161A14 - 1.0f) * 2; - gViewport->vp.vscale[1] = SCREEN_HEIGHT * (D_game_80161A14 - 1.0f) * 2; + gViewport->vp.vscale[0] = SCREEN_WIDTH * (gVsViewScale - 1.0f) * 2; + gViewport->vp.vscale[1] = SCREEN_HEIGHT * (gVsViewScale - 1.0f) * 2; gViewport->vp.vscale[2] = G_MAXZ / 2; gViewport->vp.vscale[3] = 0; - gViewport->vp.vtrans[0] = SCREEN_WIDTH * (2.0f - D_game_80161A14) * 2; - gViewport->vp.vtrans[1] = SCREEN_HEIGHT * (2.0f - D_game_80161A14) * 2; + gViewport->vp.vtrans[0] = SCREEN_WIDTH * (2.0f - gVsViewScale) * 2; + gViewport->vp.vtrans[1] = SCREEN_HEIGHT * (2.0f - gVsViewScale) * 2; gViewport->vp.vtrans[2] = G_MAXZ / 2; gViewport->vp.vtrans[3] = 0; gDPSetScissor((*dList)++, G_SC_NON_INTERLACE, SCREEN_MARGIN, SCREEN_MARGIN, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2); break; case 1: - gViewport->vp.vscale[0] = SCREEN_WIDTH * (D_game_80161A14 - 1.0f) * 2; - gViewport->vp.vscale[1] = SCREEN_HEIGHT * (D_game_80161A14 - 1.0f) * 2; + gViewport->vp.vscale[0] = SCREEN_WIDTH * (gVsViewScale - 1.0f) * 2; + gViewport->vp.vscale[1] = SCREEN_HEIGHT * (gVsViewScale - 1.0f) * 2; gViewport->vp.vscale[2] = G_MAXZ / 2; gViewport->vp.vscale[3] = 0; - gViewport->vp.vtrans[0] = SCREEN_WIDTH * D_game_80161A14 * 2; - gViewport->vp.vtrans[1] = SCREEN_HEIGHT * (2.0f - D_game_80161A14) * 2; + gViewport->vp.vtrans[0] = SCREEN_WIDTH * gVsViewScale * 2; + gViewport->vp.vtrans[1] = SCREEN_HEIGHT * (2.0f - gVsViewScale) * 2; gViewport->vp.vtrans[2] = G_MAXZ / 2; gViewport->vp.vtrans[3] = 0; gDPSetScissor((*dList)++, G_SC_NON_INTERLACE, SCREEN_WIDTH / 2, SCREEN_MARGIN, SCREEN_WIDTH - SCREEN_MARGIN, SCREEN_HEIGHT / 2); break; case 2: - gViewport->vp.vscale[0] = SCREEN_WIDTH * (D_game_80161A14 - 1.0f) * 2; - gViewport->vp.vscale[1] = SCREEN_HEIGHT * (D_game_80161A14 - 1.0f) * 2; + gViewport->vp.vscale[0] = SCREEN_WIDTH * (gVsViewScale - 1.0f) * 2; + gViewport->vp.vscale[1] = SCREEN_HEIGHT * (gVsViewScale - 1.0f) * 2; gViewport->vp.vscale[2] = G_MAXZ / 2; gViewport->vp.vscale[3] = 0; - gViewport->vp.vtrans[0] = SCREEN_WIDTH * (2.0f - D_game_80161A14) * 2; - gViewport->vp.vtrans[1] = SCREEN_HEIGHT * D_game_80161A14 * 2; + gViewport->vp.vtrans[0] = SCREEN_WIDTH * (2.0f - gVsViewScale) * 2; + gViewport->vp.vtrans[1] = SCREEN_HEIGHT * gVsViewScale * 2; gViewport->vp.vtrans[2] = G_MAXZ / 2; gViewport->vp.vtrans[3] = 0; gDPSetScissor((*dList)++, G_SC_NON_INTERLACE, SCREEN_MARGIN, SCREEN_HEIGHT / 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT - SCREEN_MARGIN); break; case 3: - gViewport->vp.vscale[0] = SCREEN_WIDTH * (D_game_80161A14 - 1.0f) * 2; - gViewport->vp.vscale[1] = SCREEN_HEIGHT * (D_game_80161A14 - 1.0f) * 2; + gViewport->vp.vscale[0] = SCREEN_WIDTH * (gVsViewScale - 1.0f) * 2; + gViewport->vp.vscale[1] = SCREEN_HEIGHT * (gVsViewScale - 1.0f) * 2; gViewport->vp.vscale[2] = G_MAXZ / 2; gViewport->vp.vscale[3] = 0; - gViewport->vp.vtrans[0] = SCREEN_WIDTH * D_game_80161A14 * 2; - gViewport->vp.vtrans[1] = SCREEN_HEIGHT * D_game_80161A14 * 2; + gViewport->vp.vtrans[0] = SCREEN_WIDTH * gVsViewScale * 2; + gViewport->vp.vtrans[1] = SCREEN_HEIGHT * gVsViewScale * 2; gViewport->vp.vtrans[2] = G_MAXZ / 2; gViewport->vp.vtrans[3] = 0; gDPSetScissor((*dList)++, G_SC_NON_INTERLACE, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, @@ -413,7 +413,7 @@ void Game_Update(void) { gPlayState = gOptionMenuStatus = gDrawMode = gShowBossHealth = gShowHud = gBgColor = gFillScreenAlpha = 0; gNextGameState = D_ctx_80177C94 = D_ctx_80177CAC = D_ctx_80177CB4 = D_ctx_80177CBC = D_ctx_80177CC4 = - D_ctx_80177C9C = D_ctx_80177CA4 = D_play_80161A5C = D_game_80161A34 = 0; + D_ctx_80177C9C = D_ctx_80177CA4 = D_play_80161A5C = gLastGameState = GSTATE_NONE; #ifdef MODS_BOOT_STATE gNextGameState = MODS_BOOT_STATE; #endif @@ -568,7 +568,30 @@ void Game_Update(void) { if ((gGameState == GSTATE_PLAY) && gVersusMode) { Versus_Draw(); } - func_fade_80084688(0, D_ctx_80177C50); + + Wipe_Draw(WIPE_CIRCULAR, gCircleWipeFrame); + // { + // static mode = 0; + // if(gControllerPress[gMainController].button & L_TRIG) { + // mode = 1 - mode; + // } + // if(gControllerHold[gMainController].button & L_TRIG) { + // if(mode) { + // gCircleWipeFrame++; + // } else { + // gCircleWipeFrame--; + // } + // if(gCircleWipeFrame > 41) { + // gCircleWipeFrame = 41; + // } else if (gCircleWipeFrame < 0) { + // gCircleWipeFrame = 0; + // } + // } + // RCP_SetupDL(&gMasterDisp, 0x53); + // gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + // Graphics_Printf("FADE PROGRESS: %d", gCircleWipeFrame); + // Graphics_DisplaySmallText(14, 9, 1.0f, 1.0f, D_801619A0); + // } if (!partialFill) { Graphics_FillRectangle(&gMasterDisp, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, gFillScreenRed, gFillScreenGreen, gFillScreenBlue, gFillScreenAlpha); diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index 0e3fff84..fc3a41c8 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -328,7 +328,7 @@ void func_hud_80085944(void) { } if ((D_80161900[4] == 0) && (gGoldRingCount[0] > gGoldRingCount[1])) { - gGoldRingCount[1] += 1; // needs to be += 1 + gGoldRingCount[1] += 1; // can't be ++ if ((i = gGoldRingCount[1] % 3) == 0) { i = 3; @@ -724,7 +724,7 @@ void HUD_DrawLevelStartStatusScreen(void) { f32 temp; if ((gPlayState != PLAY_PAUSE) && (gLevelStartStatusScreenTimer != 0)) { - gLevelStartStatusScreenTimer -= 1; + gLevelStartStatusScreenTimer--; } if (gLevelStartStatusScreenTimer == 1) { @@ -1490,7 +1490,7 @@ void func_hud_80088970(void) { gNextGameStateTimer = 2; gOptionMenuStatus = OPTION_WAIT; gDrawMode = DRAW_NONE; - D_game_80161A34 = 7; + gLastGameState = GSTATE_PLAY; gStarCount = 0; break; } else { @@ -2010,7 +2010,7 @@ s32 func_hud_8008A4DC(void) { return 0; } - if (D_ctx_80177AB0 >= 5) { + if (gDrawBackdrop >= 5) { return 0; } @@ -2066,7 +2066,7 @@ s32 func_hud_8008A4DC(void) { y = 162.000f; x1 += D_800D1E10 * temp3; } else { - if ((D_ctx_80177E7C == 0) || (D_versus_80178750 != 0)) { + if ((gVsMatchStart == 0) || (D_versus_80178750 != 0)) { return 0; } temp2 = 13000.00f; @@ -2460,7 +2460,7 @@ s32 func_hud_8008B774(void) { (gCurrentLevel == LEVEL_SECTOR_Y))) { for (i = 0; i < ARRAY_COUNT(gActors); i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) { - if ((gActors[i].unk_0B4 == EVID_2) || (gActors[i].unk_0B4 == EVID_43) || + if ((gActors[i].eventType == EVID_2) || (gActors[i].eventType == EVID_TEAMMATE) || ((gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) && ((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) || (gActors[i].aiType == AI360_PEPPY)))) { @@ -2742,7 +2742,7 @@ void func_hud_8008C6F4(s32 idx, s32 arg1) { Matrix_Push(&gGfxMatrix); - if (gPlayer[0].cockpitView) { + if (gPlayer[0].alternateView) { Matrix_RotateZ(gGfxMatrix, M_DTOR * gPlayer[0].camRoll, MTXF_APPLY); } @@ -2775,7 +2775,8 @@ void HUD_DrawEdgeArrows(void) { s32 i; s32 j; - if ((gPlayer[gPlayerNum].flags_228 != 0) && (gPlayer[gPlayerNum].timer_210 == 0) && (gPlayState != PLAY_PAUSE)) { + if ((gPlayer[gPlayerNum].flags_228 != 0) && (gPlayer[gPlayerNum].pathChangeTimer == 0) && + (gPlayState != PLAY_PAUSE)) { j = gPlayer[gPlayerNum].flags_228; for (i = 0; i < 12; i++) { @@ -2828,19 +2829,19 @@ void func_hud_8008CBE4(void) { break; case 1: - if (D_ctx_80177E7C == 0) { + if (gVsMatchStart == 0) { D_80161758 = 0; break; } - if (D_80161760[gPlayerNum]) { + if (D_80161760[gPlayerNum] != 0) { D_80161760[gPlayerNum]--; - if (D_80161760[gPlayerNum] & 4) { + if ((D_80161760[gPlayerNum] & 4) != 0) { break; } } - for (i = 0; i < D_ctx_80177DB8[gPlayerNum]; i++) { + for (i = 0; i < gVsPoints[gPlayerNum]; i++) { if (D_80161748[gPlayerNum] < (i + 1)) { if (((i + 1) != 1) && ((i + 1) == (gVsPointsToWin - 1))) { D_80161760[gPlayerNum] = 50; @@ -2853,12 +2854,12 @@ void func_hud_8008CBE4(void) { if ((D_80161748[gPlayerNum] == (i + 1)) && (D_80161738[gPlayerNum] != 0)) { D_80161738[gPlayerNum]--; - if (D_80161738[gPlayerNum] & 4) { + if ((D_80161738[gPlayerNum] & 4) != 0) { continue; } } - j = D_ctx_80177DD0[gPlayerNum][i]; + j = gVsKills[gPlayerNum][i]; RCP_SetupDL(&gMasterDisp, 0x4D); @@ -3010,7 +3011,7 @@ void func_hud_8008D984(void) { D_800D2190[gPlayerNum]--; } - if ((D_800D2190[gPlayerNum] & 2) || ((D_800D2190[gPlayerNum] == 0) && (gBombCount[gPlayerNum] != 0))) { + if (((D_800D2190[gPlayerNum] & 2) != 0) || ((D_800D2190[gPlayerNum] == 0) && (gBombCount[gPlayerNum] != 0))) { RCP_SetupDL_78(); if (gBombCount[gPlayerNum] >= 2) { if (Math_SmoothStepToF(&D_800D21A4, D_800D21A0, 0.4f, 100.0f, 0.1f) == 0.0f) { @@ -3029,7 +3030,7 @@ void func_hud_8008D984(void) { } void func_hud_8008DC34(void) { - if ((D_ctx_80177E7C != 0) && (D_versus_80178750 == 0)) { + if ((gVsMatchStart != 0) && (D_versus_80178750 == 0)) { func_hud_8008D250(); func_hud_8008D7F4(); func_hud_8008D4F0(0, 0); @@ -3273,7 +3274,7 @@ void func_hud_8008E620(f32 arg0, f32 arg1) { break; } - if (gMedalFlashTimer) { + if (gMedalFlashTimer != 0) { gMedalFlashTimer--; } @@ -3687,7 +3688,7 @@ void func_hud_8008FFF0(Boss* boss, s32 arg1) { i = RAND_INT(36.0f); - if (!(gGameFrameCount & 2)) { + if ((gGameFrameCount & 2) == 0) { func_effect_8007C120(boss->obj.pos.x + D_800D21C8[i].x, boss->obj.pos.y + D_800D21C8[i].y, boss->obj.pos.z + D_800D21C8[i].z, 0.0f, 0.0f, 0.0f, 0.3f * temp, 20); } @@ -3861,8 +3862,8 @@ bool func_hud_80090A00(Actor* actor) { actor->fwork[8] = 0.0f; actor->fwork[7] = 360.0f; actor->timer_0BC = 8; - actor->unk_0F4.y = 100.0f; - actor->unk_0F4.x = 300.0f; + actor->rot_0F4.y = 100.0f; + actor->rot_0F4.x = 300.0f; actor->iwork[4] = 1; actor->iwork[5] = 1; @@ -4156,7 +4157,7 @@ bool func_hud_800915FC(Actor* actor) { Scenery360* scenery360; bool ret = false; - Math_Vec3fFromAngles(&vec, 0.0f, actor->unk_0F4.y, 650.0f + actor->fwork[9] * 10.0f); + Math_Vec3fFromAngles(&vec, 0.0f, actor->rot_0F4.y, 650.0f + actor->fwork[9] * 10.0f); if (gLevelMode == LEVELMODE_ALL_RANGE) { for (i = 0, scenery360 = &gScenery360[0]; i < 200; i++, scenery360++) { @@ -4230,8 +4231,8 @@ bool func_hud_80091864(Actor* actor) { actor->iwork[0] = 0; } - sp3C = Math_SmoothStepToAngle(&actor->unk_0F4.y, sp40, 0.5f, actor->fwork[2], 0.001f) * 30.0f; - Math_SmoothStepToAngle(&actor->unk_0F4.x, sp44, 0.5f, actor->fwork[2], 0.0001f); + sp3C = Math_SmoothStepToAngle(&actor->rot_0F4.y, sp40, 0.5f, actor->fwork[2], 0.001f) * 30.0f; + Math_SmoothStepToAngle(&actor->rot_0F4.x, sp44, 0.5f, actor->fwork[2], 0.0001f); sp2C = sp28 = 0.0f; if (sp3C < 0.0f) { @@ -4265,8 +4266,8 @@ bool func_hud_80091864(Actor* actor) { bool func_hud_80091B90(Actor* actor) { Vec3f vec; - actor->obj.rot.x = -actor->unk_0F4.x; - actor->obj.rot.y = actor->unk_0F4.y; + actor->obj.rot.x = -actor->rot_0F4.x; + actor->obj.rot.y = actor->rot_0F4.y; Math_SmoothStepToF(&actor->fwork[0], actor->fwork[1], 0.2f, 1.0f, 0.0f); Math_SmoothStepToF(&actor->fwork[2], actor->fwork[3], 1.0f, 1.0f, 0.0f); @@ -4345,7 +4346,7 @@ bool func_hud_80091F00(Actor* actor) { AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, actor->sfxSource, 4); func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, actor->rot_0F4.y * M_DTOR, MTXF_NEW); if (Rand_ZeroOne() < 0.5f) { sp40.x = -20.0f; @@ -4420,7 +4421,7 @@ void func_hud_80092244(Actor* actor) { gRadarMarks[actor->index].pos.x = actor->obj.pos.x; gRadarMarks[actor->index].pos.y = actor->obj.pos.y; gRadarMarks[actor->index].pos.z = actor->obj.pos.z; - gRadarMarks[actor->index].yRot = actor->unk_0F4.y + 180.0f; + gRadarMarks[actor->index].yRot = actor->rot_0F4.y + 180.0f; } void func_hud_800922F4(Actor* actor) { @@ -4438,7 +4439,7 @@ void func_hud_800922F4(Actor* actor) { temp = 64 - 1; } - if (!(gGameFrameCount & temp)) { + if ((gGameFrameCount & temp) == 0) { func_effect_8007D10C(actor->obj.pos.x + RAND_FLOAT_CENTERED(10.0f), actor->obj.pos.y + RAND_FLOAT(10.0f), actor->obj.pos.z + RAND_FLOAT_CENTERED(10.0f), 2.2f); } @@ -4495,8 +4496,8 @@ bool func_hud_800924E0(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.z, 0.0f, 0.1f, 5.0f, 0.0f); actor->obj.rot.x = actor->vwork[29].x + (360.0f - actor->fwork[19]); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * ((actor->unk_0F4.x + actor->vwork[29].x) + actor->fwork[19])), + Matrix_RotateY(gCalcMatrix, actor->rot_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * ((actor->rot_0F4.x + actor->vwork[29].x) + actor->fwork[19])), MTXF_APPLY); src.z = actor->fwork[1]; @@ -4577,14 +4578,14 @@ bool func_hud_800927A0(Actor* actor) { Math_SmoothStepToF(&actor->fwork[20], 0.0f, 0.1f, 15.0f, 0.0f); if (actor->fwork[19] > 180.0f) { - actor->unk_0F4.y += 180.0f; - if (actor->unk_0F4.y >= 360.0f) { - actor->unk_0F4.y = actor->unk_0F4.y - 360.0f; + actor->rot_0F4.y += 180.0f; + if (actor->rot_0F4.y >= 360.0f) { + actor->rot_0F4.y = actor->rot_0F4.y - 360.0f; } actor->fwork[19] -= 180.0f; - if ((sp50 - actor->unk_0F4.y) < 180.0f) { + if ((sp50 - actor->rot_0F4.y) < 180.0f) { actor->fwork[20] = 180.0f; } else { actor->fwork[20] = -180.0f; @@ -4609,7 +4610,7 @@ bool func_hud_800927A0(Actor* actor) { Math_SmoothStepToF(&actor->fwork[27], -sp54, 0.3f, 100.0f, 0.0f); if (actor->unk_04A != 0) { - Math_SmoothStepToAngle(&actor->unk_0F4.y, sp50, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToAngle(&actor->rot_0F4.y, sp50, 0.1f, 2.0f, 0.0f); } if (actor->obj.pos.y < gPlayer[0].pathHeight) { @@ -4632,12 +4633,12 @@ bool func_hud_800927A0(Actor* actor) { } actor->obj.rot.x = actor->vwork[29].x - actor->fwork[19]; - actor->obj.rot.y = actor->unk_0F4.y; + actor->obj.rot.y = actor->rot_0F4.y; actor->obj.rot.z = actor->vwork[29].z + actor->fwork[20]; actor->obj.pos.y += actor->fwork[28]; - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0U); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * (actor->unk_0F4.x + actor->vwork[29].x + actor->fwork[19])), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, actor->rot_0F4.y * M_DTOR, 0U); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * (actor->rot_0F4.x + actor->vwork[29].x + actor->fwork[19])), MTXF_APPLY); src.z = actor->fwork[1]; src.y = 0.0f; @@ -4671,7 +4672,7 @@ void ActorTeamBoss_Init(Actor* actor) { actor->iwork[11] = 1; if (gLevelType == LEVELTYPE_PLANET) { - actor->unk_0C9 = 1; + actor->drawShadow = true; } AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); @@ -4769,9 +4770,9 @@ void func_hud_80093164(Actor* actor) { Player* player = &gPlayer[0]; if (actor->state == 0) { - switch (actor->unk_0B6) { + switch (actor->animFrame) { case 1: - if ((player->state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (actor->unk_0B6 != 1)) { + if ((player->state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (actor->animFrame != 1)) { if (gCsFrameCount > 1588) { actor->fwork[0] = 5.0f; } else { @@ -4794,8 +4795,8 @@ void func_hud_80093164(Actor* actor) { } } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = actor->fwork[0]; @@ -4803,9 +4804,9 @@ void func_hud_80093164(Actor* actor) { actor->vel.x = dest.x; actor->vel.y = dest.y; actor->vel.z = dest.z; - actor->obj.rot.x = -actor->unk_0F4.x; - actor->obj.rot.y = actor->unk_0F4.y + 180.0f; - actor->obj.rot.z = -actor->unk_0F4.z; + actor->obj.rot.x = -actor->rot_0F4.x; + actor->obj.rot.y = actor->rot_0F4.y + 180.0f; + actor->obj.rot.z = -actor->rot_0F4.z; } void func_hud_80093310(void) { @@ -4816,7 +4817,7 @@ void func_hud_80093310(void) { this->obj.pos.x = 0.0f; this->obj.pos.y += 1700.0f; this->obj.pos.z -= 5000.0f; - gActors[0].unk_0B6 = 1; + gActors[0].animFrame = 1; if (1) {} this->obj.id = OBJ_ACTOR_CUTSCENE; Object_SetInfo(&this->info, this->obj.id); @@ -4917,7 +4918,7 @@ void HUD_AquasStart(Player* player) { case 0: func_hud_80093310(); gCsFrameCount = 0; - D_ctx_80177AB0 = 1; + gDrawBackdrop = 1; gAqDrawMode = 1; player->unk_234 = 0; player->csState = 1; @@ -4940,7 +4941,7 @@ void HUD_AquasStart(Player* player) { D_801616A0.y = 124.17f; D_801616A0.z = 0.00f; - actor->unk_0F4.y = 30.0f; + actor->rot_0F4.y = 30.0f; D_ctx_80177A48[5] = 14.0f; D_ctx_80177A48[0] = 0.2f; @@ -5076,7 +5077,7 @@ void HUD_AquasStart(Player* player) { player->csState = 3; - D_ctx_80177AB0 = 0; + gDrawBackdrop = 0; player->camRoll = 60.0f; player->csTimer = 1000; @@ -5133,8 +5134,8 @@ void HUD_AquasStart(Player* player) { D_ctx_80177A48[0] = 0.0f; temp2 = 0.0f; - if (D_ctx_80177A10[9]) { - D_ctx_80177A10[9] -= 1; + if (D_ctx_80177A10[9] != 0) { + D_ctx_80177A10[9]--; temp = D_ctx_80177A10[9]; if (temp > 20.0f) { temp = 20.0f; @@ -5461,7 +5462,7 @@ void func_hud_80094D20(f32 x, f32 y) { boolTemp = true; } - if ((!boolTemp) && (xScale != 0.0f)) { + if (!boolTemp && (xScale != 0.0f)) { TextureRect_8bIA(&gMasterDisp, D_800D24DC[0], 16, 15, x1, y1, xScale, 1.0f); } @@ -5525,7 +5526,7 @@ void func_hud_80095350(Actor* actor) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->unk_0B6 = 9999; + actor->animFrame = 9999; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5542,7 +5543,7 @@ void func_hud_800953A0(Actor* actor, s32 arg1) { actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos = D_800D2510[arg1]; actor->obj.pos.z -= gPathProgress; - actor->unk_0B6 = 45; + actor->animFrame = 45; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5557,7 +5558,7 @@ void func_hud_8009546C(Actor* actor, s32 arg1) { actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos = D_800D2540[arg1]; actor->obj.pos.z -= gPathProgress; - actor->unk_0B6 = 46; + actor->animFrame = 46; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5572,7 +5573,7 @@ void func_hud_80095538(Actor* actor, s32 arg1) { actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->obj.pos = D_800D257C[arg1]; actor->obj.pos.z -= gPathProgress; - actor->unk_0B6 = 47; + actor->animFrame = 47; Object_SetInfo(&actor->info, actor->obj.id); } void HUD_AquasComplete(Player* player) { @@ -5622,10 +5623,10 @@ void HUD_AquasComplete(Player* player) { if ((gCsFrameCount >= 30) && (gCsFrameCount < 90)) { D_ctx_80177A48[5] -= 0.6f; - if ((D_ctx_80177A48[5]) < 0.0f) { + if (D_ctx_80177A48[5] < 0.0f) { D_ctx_80177A48[5] += 360.0f; } - if ((D_ctx_80177A48[5]) > 360.0f) { + if (D_ctx_80177A48[5] > 360.0f) { D_ctx_80177A48[5] -= 360.0f; } src.x = 1000.0f; @@ -5770,14 +5771,14 @@ void HUD_AquasComplete(Player* player) { actor->fwork[3] = 2600.0f; actor->fwork[7] = 0.5f; - actor->unk_0F4.y = 130.0f; + actor->rot_0F4.y = 130.0f; src.x = actor->fwork[1]; src.y = actor->fwork[2]; src.z = actor->fwork[3]; Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos + gPathProgress, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->rot_0F4.y), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); player->cam.at.x = gCsCamAtX = player->pos.x; @@ -5830,12 +5831,12 @@ void HUD_AquasComplete(Player* player) { } D_ctx_80177A48[0] = 0.05f; - actor->unk_0F4.y += actor->fwork[7]; - if ((actor->unk_0F4.y) < 0.0f) { - actor->unk_0F4.y += 360.0f; + actor->rot_0F4.y += actor->fwork[7]; + if ((actor->rot_0F4.y) < 0.0f) { + actor->rot_0F4.y += 360.0f; } - if ((actor->unk_0F4.y) > 360.0f) { - actor->unk_0F4.y -= 360.0f; + if ((actor->rot_0F4.y) > 360.0f) { + actor->rot_0F4.y -= 360.0f; } src.x = actor->fwork[1]; @@ -5843,7 +5844,7 @@ void HUD_AquasComplete(Player* player) { src.z = actor->fwork[3]; Matrix_Translate(gCalcMatrix, actor->fwork[4], actor->fwork[5], actor->fwork[6], MTXF_NEW); - Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->rot_0F4.y), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); gCsCamEyeX = dest.x; diff --git a/src/engine/fox_load.c b/src/engine/fox_load.c index 14023192..2d233fc8 100644 --- a/src/engine/fox_load.c +++ b/src/engine/fox_load.c @@ -72,7 +72,7 @@ u8 Load_SceneFiles(Scene* scene) { gSPSegment(gUnkDisp1++, segment + 1, K0_TO_PHYS(ramPtr)); ramPtr = ramPtr + SEGMENT_SIZE(scene->assets[segment]); } - segment += 1; + segment += 1; // can't be ++ } for (segment; segment < 15; segment += 1) { sCurrentScene.assets[segment].start = scene->assets[segment].start; diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 3d70b0e3..5949dd79 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -23,13 +23,13 @@ #include "assets/ast_zoness.h" UNK_TYPE D_800D2F50 = 0; // unused -s32 D_800D2F54 = 0; -f32 D_800D2F58 = 0.0f; +s32 sOverheadCam = 0; +f32 sOverheadCamDist = 0.0f; f32 sMusicVolume = 0.0f; f32 sVoiceVolume = 0.0f; f32 sSfxVolume = 0.0f; u8 gVenomHardClear = 0; -u8 D_800D2F6C[20] = { +u8 sSaveSlotFromLevel[20] = { PLANET_CORNERIA, PLANET_METEO, PLANET_SECTOR_X, PLANET_AREA_6, PLANET_AREA_6, PLANET_SECTOR_Y, SAVE_SLOT_VENOM_1, SAVE_SLOT_SOLAR, PLANET_ZONESS, SAVE_SLOT_VENOM_1, PLANET_CORNERIA, PLANET_MACBETH, PLANET_TITANIA, PLANET_AQUAS, PLANET_FORTUNA, @@ -38,11 +38,11 @@ u8 D_800D2F6C[20] = { u8 gSavedZoSearchlightStatus; f32 gArwingSpeed; -s32 D_play_80161A58; -s32 D_play_80161A5C; +s32 D_play_80161A58; // unused +s32 D_play_80161A5C; // saved hit count for venom -> andross u16 gScreenFlashTimer; u16 gDropHitCountItem; -s32 D_play_80161A64; +s32 sPlayWingSplash; Environment* sEnvironment; #define MEM_ARRAY_ALLOCATE(arr, count) ((arr) = Memory_Allocate((count) * sizeof(*(arr)))) @@ -85,7 +85,7 @@ void Play_UpdateDynaFloor(void) { f32 sp88; f32 sp84; - D_ctx_801782FC++; + gDynaFloorTimer++; switch (gCurrentLevel) { case LEVEL_SOLAR: if ((gGameFrameCount % 2) != 0) { @@ -94,7 +94,7 @@ void Play_UpdateDynaFloor(void) { spB4 = SEGMENTED_TO_VIRTUAL(D_SO_6004500); } spB0 = SEGMENTED_TO_VIRTUAL(D_SO_6022760); - spA8 = 15; + spA8 = 16 - 1; sp90 = 70.0f; sp8C = 0.1f; sp88 = 2.2f; @@ -107,7 +107,7 @@ void Play_UpdateDynaFloor(void) { spB4 = SEGMENTED_TO_VIRTUAL(D_ZO_600C780); } spB0 = SEGMENTED_TO_VIRTUAL(D_ZO_602AC50); - spA8 = 7; + spA8 = 8 - 1; sp90 = 40.0f; sp8C = 0.2f; sp88 = 1.0f; @@ -122,7 +122,7 @@ void Play_UpdateDynaFloor(void) { for (i = 0; i < 17 * 17; i++, var_s3++, var_s5++, var_s4++, var_s0++, var_s1++, spB0++) { Math_SmoothStepToF(var_s3, *var_s5, sp8C, *var_s4, 0.0f); Math_SmoothStepToF(var_s4, 100.0f, 1.0f, sp84, 0.0f); - if ((D_ctx_801782FC & spA8) == (i & spA8)) { + if ((gDynaFloorTimer & spA8) == (i & spA8)) { *var_s5 = RAND_FLOAT(sp90); *var_s4 = 0.0f; } @@ -154,7 +154,8 @@ void Player_WingEffects(Player* player) { player->xRock = SIN_DEG(player->rockPhase * 0.7f) * 0.5f; player->bobPhase += 10.0f; player->rockPhase += 8.0f; - if ((gLevelType == LEVELTYPE_PLANET) || ((player->cockpitView == true) && (gLevelMode == LEVELMODE_ON_RAILS))) { + if ((gLevelType == LEVELTYPE_PLANET) || + ((player->alternateView == true) && (gLevelMode == LEVELMODE_ON_RAILS))) { player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; if ((player->wings.rightState <= WINGSTATE_BROKEN) || (player->wings.leftState <= WINGSTATE_BROKEN)) { player->rockAngle = SIN_DEG(player->rockPhase) * 5.0f; @@ -169,7 +170,7 @@ void Player_DamageEffects(Player* player) { s32 var_v1; f32 sp40; - if (!player->cockpitView || (gLevelMode == LEVELMODE_ALL_RANGE)) { + if (!player->alternateView || (gLevelMode == LEVELMODE_ALL_RANGE)) { if (player->wings.rightState <= WINGSTATE_BROKEN) { if (((gGameFrameCount % 2U) == 0) && (gRightWingDebrisTimer[player->num] != 0)) { func_effect_8007D10C(RAND_FLOAT_CENTERED(10.0f) + player->hit1.x, RAND_FLOAT(5.0f) + player->hit1.y, @@ -204,7 +205,7 @@ void Player_DamageEffects(Player* player) { if (player->shields > 48) { var_v1 = 64 - 1; } - if (!player->cockpitView || (gLevelMode == LEVELMODE_ALL_RANGE)) { + if (!player->alternateView || (gLevelMode == LEVELMODE_ALL_RANGE)) { sp40 = 0.0f; if (player->form == FORM_LANDMASTER) { sp40 = 30.0f; @@ -244,7 +245,7 @@ void Player_WaterEffects(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp48, &sp30); if (player->pos.y < (gGroundHeight + 100.0f)) { if ((sp3C.y < gGroundHeight + 80.0f) && ((gGameFrameCount % 2) == 0)) { - if (D_play_80161A64) {} + if (sPlayWingSplash) {} func_effect_8007ACE0(sp3C.x, gGroundHeight, sp3C.z, 0.1f, 2.0f, player->rot.y + player->yRot_114 + 20.0f); } @@ -254,12 +255,12 @@ void Player_WaterEffects(Player* player) { } } if ((sp30.y < gGroundHeight + 80.0f) || (sp3C.y < gGroundHeight + 80.0f)) { - if (D_play_80161A64 == 0) { - D_play_80161A64 = 1; + if (!sPlayWingSplash) { + sPlayWingSplash = true; AUDIO_PLAY_SFX(NA_SE_SPLASH_LEVEL_S, player->sfxSource, 0); } } else { - D_play_80161A64 = 0; + sPlayWingSplash = false; Audio_KillSfxBySourceAndId(player->sfxSource, NA_SE_SPLASH_LEVEL_S); } } @@ -655,8 +656,8 @@ void Play_ClearObjectData(void) { Object_Kill(&gPlayerShots[i].obj, gPlayerShots[i].sfxSource); PlayerShot_Initialize(&gPlayerShots[i]); } - D_ctx_801782B8 = D_ctx_801782BC = D_ctx_801782C0 = D_ctx_801782D0 = gBossActive = D_ctx_8017828C = D_ctx_8017812C = - gPrevEventActorIndex = gFormationLeaderIndex = gRingPassCount = 0; + gDrawSmallRocks = D_ctx_801782BC = D_ctx_801782C0 = D_ctx_801782D0 = gBossActive = gKillEventActors = + gGroundClipMode = gPrevEventActorIndex = gFormationLeaderIndex = gRingPassCount = 0; gFormationInitPos.x = gFormationInitPos.y = gFormationInitPos.z = gFormationInitRot.x = gFormationInitRot.y = gFormationInitRot.z = 0.0f; for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) { @@ -688,7 +689,7 @@ void Play_UpdateFillScreen(void) { Math_SmoothStepToF(&gLight3Brightness, 0.0f, 1.0f, 0.04f, 0.001f); if (gScreenFlashTimer != 0) { gScreenFlashTimer--; - if (gScreenFlashTimer & 2) { + if ((gScreenFlashTimer & 2) != 0) { gFillScreenRed = 255; gFillScreenGreen = 255; gFillScreenBlue = 255; @@ -836,7 +837,7 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { if (player->unk_1A4 > 40) { sp34 = (player->boostSpeed * 0.3f) + 20.0f; player->timer_498 = 5; - } else if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (gBossActive == 0)) { + } else if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && !gBossActive) { player->timer_498 = 3; } else if ((gCurrentLevel == LEVEL_VENOM_1) || (gCurrentLevel == LEVEL_AQUAS)) { player->timer_498 = 5; @@ -1919,14 +1920,14 @@ void Player_CollisionCheck(Player* player) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } } else if (actor->obj.id == OBJ_ACTOR_EVENT) { - if (actor->unk_0B4 == EVID_42) { + if (actor->eventType == EVID_42) { temp_v0 = Player_CheckPolyCollision(player, ACTOR_EVENT_ID, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } - } else if (actor->unk_0B4 == EVID_63) { + } else if (actor->eventType == EVID_63) { spfD4.x = fabsf(actor->obj.pos.x - player->pos.x); spfD4.y = fabsf(actor->obj.pos.y - player->pos.y); spfD4.z = fabsf(actor->obj.pos.z - player->trueZpos); @@ -1938,9 +1939,9 @@ void Player_CollisionCheck(Player* player) { temp_v0 = Player_CheckHitboxCollision( player, actor->info.hitbox, &sp98, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, actor->vwork[29].x, - actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z); + actor->vwork[29].y, actor->vwork[29].z + actor->rot_0F4.z); if (temp_v0 != 0) { - if ((temp_v0 < 0) && (actor->unk_0B4 == EVID_38)) { + if ((temp_v0 < 0) && (actor->eventType == EVID_SX_WARP_GATE)) { actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032328); if (gRingPassCount >= 0) { actor->unk_046 = 2; @@ -2019,7 +2020,7 @@ void Player_CollisionCheck(Player* player) { if (temp_v0 != 0) { if ((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_POLE) || (sprite->obj.id == OBJ_SPRITE_TI_CACTUS) || (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { - sprite->unk_46 = 1; + sprite->destroy = 1; player->hitTimer = 6; player->unk_21C = 0; } else { @@ -2422,8 +2423,8 @@ void Play_InitLevel(void) { } break; case LEVEL_VENOM_ANDROSS: - D_ctx_80177A98 = 0; - D_ctx_80177AB0 = 6; + gDrawGround = false; + gDrawBackdrop = 6; D_Andross_801A7F58 = D_Andross_801A7F60 = D_Andross_801A7F68 = D_Andross_801A7F70 = D_Andross_801A7F78 = 0.0f; break; @@ -2441,12 +2442,12 @@ void Play_InitLevel(void) { Macbeth_80199920(); break; case LEVEL_ZONESS: - MEM_ARRAY_ALLOCATE(D_ctx_801782C4, 200); - ptr = (u8*) D_ctx_801782C4; - for (i = 0; i < 200 * sizeof(*D_ctx_801782C4); i++, ptr++) { + MEM_ARRAY_ALLOCATE(gZOSnakePosRots, 200); + ptr = (u8*) gZOSnakePosRots; + for (i = 0; i < 200 * sizeof(*gZOSnakePosRots); i++, ptr++) { *ptr = 0; } - D_ctx_801784A4 = 0; + gZOSnakeWaypointCount = 0; /* fallthrough */ case LEVEL_SOLAR: gUseDynaFloor = true; @@ -2521,14 +2522,14 @@ void Player_ResetVsData(void) { gVsMatchState = 0; for (i = 0; i < 4; i++) { - D_ctx_80177DB8[i] = 0; + gVsPoints[i] = 0; for (j = 0; j < 10; j++) { - D_ctx_80177DD0[i][j] = 0; + gVsKills[i][j] = 0; } gLaserStrength[i] = LASERS_SINGLE; gBombCount[i] = 0; } - D_ctx_80177E7C = D_ctx_80177E74 = 0; + gVsMatchStart = gVsMatchOver = 0; } void Player_InitVersus(void) { @@ -2574,9 +2575,9 @@ void Play_Init(void) { gSceneSetup = 0; } gShowHud = 1; - D_ctx_80177A98 = D_ctx_80177AB0 = 1; - gAqDrawMode = D_800D2F54 = 0; - D_display_800CA230 = D_800D2F58 = 0.0f; + gDrawGround = gDrawBackdrop = 1; + gAqDrawMode = sOverheadCam = 0; + gCamDistortion = sOverheadCamDist = 0.0f; gLevelMode = LEVELMODE_ON_RAILS; gPathTexScroll = D_bg_8015F968 = 0.0f; D_hud_800D1970 = gVersusMode = gHideRadio = gChangeTo360 = false; @@ -2590,10 +2591,10 @@ void Play_Init(void) { if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (gLevelPhase == 1)) { gLevelMode = LEVELMODE_ALL_RANGE; } - D_ctx_80177E7C = 0; + gVsMatchStart = 0; Play_InitEnvironment(); gDropHitCountItem = gTeamLowHealthMsgTimer = gStartAndrossFightTimer = gSoShieldsEmpty = gAllRangeEventTimer = - gAllRangeFrameCount = gBossActive = gGameFrameCount = gCameraShake = D_ctx_801782FC = gBossFrameCount = + gAllRangeFrameCount = gBossActive = gGameFrameCount = gCameraShake = gDynaFloorTimer = gBossFrameCount = gCallTimer = gAllRangeSupplyTimer = gMissionStatus = 0; if (gCurrentLevel == LEVEL_SECTOR_X) { @@ -2607,7 +2608,7 @@ void Play_Init(void) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; } gScreenFlashTimer = gLight3R = gLight3G = gLight3B = D_hud_80161704 = D_hud_80161708 = gFillScreenAlpha = - D_ctx_80177C50 = gShowAllRangeCountdown = gCoUturnCount = 0; + gCircleWipeFrame = gShowAllRangeCountdown = gCoUturnCount = 0; gCsFrameCount = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; @@ -2616,12 +2617,12 @@ void Play_Init(void) { gLight3Brightness = 0.0f; gWarpZoneBgAlpha = 0.0f; gGroundHeight = 0.0f; - gStarWarpDistortion = gStarfieldX = gStarfieldY = gStarfieldRoll = D_ctx_8017842C = D_ctx_80178430 = 0.0f; + gStarWarpDistortion = gStarfieldX = gStarfieldY = gStarfieldRoll = gStarfieldScrollX = gStarfieldScrollY = 0.0f; if ((gLevelType == LEVELTYPE_SPACE) || (gCurrentLevel == LEVEL_TRAINING)) { Play_SetupStarfield(); if (gCurrentLevel != LEVEL_TRAINING) { - D_ctx_80177A98 = 0; + gDrawGround = false; } } else { gStarCount = 0; @@ -3244,7 +3245,7 @@ void Player_UpdatePath(Player* player) { if (gGroundType == 4) { gPathGroundScroll = player->zPathVel; } - if ((gBossActive == 0) && (player->zPath > 500000.0f)) { + if (!gBossActive && (player->zPath > 500000.0f)) { player->zPath = 0.0f; player->pos.z = 0.0f; gObjectLoadIndex = 0; @@ -3276,10 +3277,10 @@ void Player_UpdatePath(Player* player) { gPathVelX = Math_SmoothStepToF(&player->xPath, player->xPathTarget, 0.1f, player->pathStep, 0.0001f); gPathVelY = Math_SmoothStepToF(&player->yPath, player->yPathTarget, 0.1f, player->pathStep, 0.0001f); } - if (player->timer_210 != 0) { - player->timer_210--; - Math_SmoothStepToF(&player->yRot_114, player->yRot_118, 0.03f, 0.5f, 0.0001f); - Math_SmoothStepToF(&player->xRot_120, player->xRot_124, 0.03f, 0.5f, 0.0001f); + if (player->pathChangeTimer != 0) { + player->pathChangeTimer--; + Math_SmoothStepToF(&player->yRot_114, player->pathChangeYaw, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->xRot_120, player->pathChangePitch, 0.03f, 0.5f, 0.0001f); } else { Math_SmoothStepToF(&player->yRot_114, 0.0f, 0.03f, 0.5f, 0.0001f); Math_SmoothStepToF(&player->xRot_120, 0.0f, 0.03f, 0.5f, 0.0001f); @@ -3328,7 +3329,7 @@ void Player_CheckBounds360(Player* player) { var_fv1 = 10000.0f; } else if (gCurrentLevel == LEVEL_SECTOR_Z) { var_fv1 = 20000.0f; - } else if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (D_ctx_80177AB0 >= 4)) { + } else if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (gDrawBackdrop >= 4)) { var_fv1 = 100000.0f; } if ((var_fv1 < fabsf(player->pos.x)) || (var_fv1 < fabsf(player->pos.z))) { @@ -3341,7 +3342,7 @@ void Player_CheckBounds360(Player* player) { } } -void Player_ArwingMove360(Player* player) { +void Player_MoveArwing360(Player* player) { f32 sp7C; f32 sp78; f32 scale; @@ -3507,8 +3508,8 @@ void Player_PerformLoop(Player* player) { player->unk_018 = 0.05f; player->unk_014 = 0.05f; } else { - player->cockpitView = player->savedCockpitView; - if (player->cockpitView) { + player->alternateView = player->savedAlternateView; + if (player->alternateView) { player->unk_014 = 0.0f; } } @@ -3538,7 +3539,7 @@ void Player_PerformLoop(Player* player) { Player_DamageEffects(player); } -void Player_ArwingMoveOnRails(Player* player) { +void Player_MoveArwingOnRails(Player* player) { f32 stickX; f32 stickY; f32 var_fa0; @@ -3567,7 +3568,7 @@ void Player_ArwingMoveOnRails(Player* player) { Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.01f); - if (player->cockpitView) { + if (player->alternateView) { Matrix_RotateZ(gCalcMatrix, player->zRotBank * M_DTOR, MTXF_NEW); sp68.z = 0.0f; @@ -3736,7 +3737,7 @@ void Player_ArwingMoveOnRails(Player* player) { Player_WingEffects(player); } -void Player_TankMove360(Player* player) { +void Player_MoveTank360(Player* player) { f32 sp5C; f32 var_fa0; f32 var_fa1; @@ -3880,7 +3881,7 @@ void Player_OnFootUpdateSpeed(Player* player) { Math_SmoothStepToF(&player->unk_008, sp28, 0.1f, sp24, 0.00001f); } -void Player_OnFootMove(Player* player) { +void Player_MoveOnFoot(Player* player) { Vec3f sp78[30]; f32 sp74; f32 sp70; @@ -4181,7 +4182,7 @@ void Player_Setup(Player* playerx) { if (gCurrentLevel != LEVEL_CORNERIA) { gSavedGroundSurface = SURFACE_GRASS; } - gGoldRingCount[0] = D_ctx_80161A94[0]; + gGoldRingCount[0] = gSavedGoldRingCount[0]; do { if (gGoldRingCount[0] > 3) { gGoldRingCount[0] -= 3; @@ -4231,7 +4232,7 @@ void Player_Setup(Player* playerx) { player->cam.eye.y = (player->pos.y * player->unk_148) + 10.0f; player->cam.eye.x = player->pos.x * player->unk_148; - gPlayerCamAt.x = gPlayerCamAt.y = gPlayerCamAt.z = gPlayerCamEye.x = gPlayerCamEye.y = gPlayerCamEye.z = 0.0f; + gPlayCamAt.x = gPlayCamAt.y = gPlayCamAt.z = gPlayCamEye.x = gPlayCamEye.y = gPlayCamEye.z = 0.0f; if (gVersusMode) { gLaserStrength[gPlayerNum] = LASERS_SINGLE; @@ -4337,7 +4338,7 @@ void Player_Setup(Player* playerx) { } if (gCurrentLevel == LEVEL_BOLSE) { - D_ctx_80177A98 = 1; + gDrawGround = true; } if ((gCurrentLevel == LEVEL_MACBETH) && (gSavedObjectLoadIndex == 0)) { @@ -4407,7 +4408,7 @@ void Player_Setup(Player* playerx) { gStarWolfTeamAlive[j] = gSavedStarWolfTeamAlive[j] = 1; } gLaserStrength[gPlayerNum] = LASERS_SINGLE; - gGoldRingCount[0] = D_ctx_80161A94[0] = gTotalHits = 0; + gGoldRingCount[0] = gSavedGoldRingCount[0] = gTotalHits = 0; gLifeCount[gPlayerNum] = 2; gBombCount[gPlayerNum] = 3; gGreatFoxIntact = true; @@ -4623,7 +4624,7 @@ void Player_ArwingBoost(Player* player) { if (gLoopBoostTimers[gPlayerNum] != 0) { gLoopBoostTimers[gPlayerNum]--; } - if (!player->somersault && (D_ctx_80177AB0 < 5)) { + if (!player->somersault && (gDrawBackdrop < 5)) { if (var >= -50) { gLoopDownTimers[gPlayerNum] = 5; } @@ -4631,8 +4632,8 @@ void Player_ArwingBoost(Player* player) { (gLoopBoostTimers[gPlayerNum] != 0)) { player->somersault = true; if (gLevelMode == LEVELMODE_ON_RAILS) { - player->savedCockpitView = player->cockpitView; - player->cockpitView = false; + player->savedAlternateView = player->alternateView; + player->alternateView = false; } player->unk_014 = player->unk_018 = 0.0f; if (player->aerobaticPitch > 340.0f) { @@ -4752,7 +4753,7 @@ void Player_ArwingBrake(Player* player) { if (var >= -50) { gUturnDownTimers[gPlayerNum] = 5; } - if ((gUturnDownTimers[gPlayerNum] > 0) && (gUturnDownTimers[gPlayerNum] < 5) && (D_ctx_80177AB0 < 5) && + if ((gUturnDownTimers[gPlayerNum] > 0) && (gUturnDownTimers[gPlayerNum] < 5) && (gDrawBackdrop < 5) && (gUturnBrakeTimers[gPlayerNum] != 0)) { gUturnDownTimers[gPlayerNum] = 0; gUturnBrakeTimers[gPlayerNum] = 0; @@ -5011,9 +5012,9 @@ void Player_UpdateEffects(Player* player) { if (player->timer_278 != 0) { if ((player->timer_278 % 8) == 0) { if (player->timer_278 & 8) { - D_ctx_80177DB8[gPlayerNum]++; + gVsPoints[gPlayerNum]++; } else { - D_ctx_80177DB8[gPlayerNum]--; + gVsPoints[gPlayerNum]--; } } player->timer_278--; @@ -5147,7 +5148,7 @@ void Player_UpdateOnRails(Player* player) { if (player->somersault) { Player_PerformLoop(player); } else { - Player_ArwingMoveOnRails(player); + Player_MoveArwingOnRails(player); } Player_UpdatePath(player); Player_Shoot(player); @@ -5161,7 +5162,7 @@ void Player_UpdateOnRails(Player* player) { player->vel.x *= 0.2f; player->vel.y = 5.0f; player->rot.x = player->rot.y = 0.0f; - player->cockpitView = 0; + player->alternateView = false; player->csTimer = 20; if (gLevelType == LEVELTYPE_SPACE) { player->csTimer = 40; @@ -5200,7 +5201,7 @@ void Player_Update360(Player* player) { if (player->somersault) { Player_PerformLoop(player); } else { - Player_ArwingMove360(player); + Player_MoveArwing360(player); } Player_Shoot(player); Player_CollisionCheck(player); @@ -5230,7 +5231,7 @@ void Player_Update360(Player* player) { Player_TankBoostBrake(player); Play_dummy_800B41E0(player); Player_UpdateTankRoll(player); - Player_TankMove360(player); + Player_MoveTank360(player); Player_Shoot(player); Player_CollisionCheck(player); Player_FloorCheck(player); @@ -5244,7 +5245,7 @@ void Player_Update360(Player* player) { break; case FORM_ON_FOOT: Player_OnFootUpdateSpeed(player); - Player_OnFootMove(player); + Player_MoveOnFoot(player); Player_Shoot(player); Player_CollisionCheck(player); Player_FloorCheck(player); @@ -5326,7 +5327,7 @@ void Player_Update(Player* player) { } if (gControllerRumbleTimers[player->num] != 0) { gControllerRumbleTimers[player->num]--; - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { *gControllerRumble = 1; } } @@ -5375,9 +5376,9 @@ void Player_Update(Player* player) { Player_LowHealthMsg(player); player->wings.modelId = 0; D_hud_80161704 = 255; - if ((!gVersusMode || (D_ctx_80177E7C != 0)) && !player->somersault && (gInputPress->button & U_CBUTTONS) && + if ((!gVersusMode || (gVsMatchStart != 0)) && !player->somersault && (gInputPress->button & U_CBUTTONS) && ((player->form == FORM_ARWING) || (gVersusMode && (player->form == FORM_LANDMASTER)))) { - if (player->cockpitView = 1 - player->cockpitView) { + if (player->alternateView = 1 - player->alternateView) { AUDIO_PLAY_SFX(NA_SE_VIEW_MOVE_IN, gDefaultSfxSource, 4); } else { AUDIO_PLAY_SFX(NA_SE_VIEW_MOVE_OUT, gDefaultSfxSource, 4); @@ -5397,7 +5398,7 @@ void Player_Update(Player* player) { if (!gVersusMode) { Player_Update360(player); player->unk_234 = 1; - } else if (D_ctx_80177E7C != 0) { + } else if (gVsMatchStart != 0) { if (gPlayerInactive[player->num] == true) { do { sp1C4 = RAND_INT(3.9f); @@ -5407,8 +5408,8 @@ void Player_Update(Player* player) { player->csState = 0; Camera_FollowPlayer(player, player->attacker - 1, 1); } else { - if (D_ctx_80177E7C == 1) { - D_ctx_80177E7C += 1; + if (gVsMatchStart == 1) { + gVsMatchStart++; for (i = 0; i < 4; i++) { Player_PlaySfx(gPlayer[i].sfxSource, NA_SE_ARWING_BOOST, gPlayer[i].num); gPlayer[i].unk_190 = gPlayer[i].unk_194 = 5.0f; @@ -5453,7 +5454,7 @@ void Player_Update(Player* player) { } break; case PLAYERSTATE_1C8_LEVEL_COMPLETE: - player->cockpitView = false; + player->alternateView = false; gPauseEnabled = false; Player_UpdateShields(player); Cutscene_LevelComplete(player); @@ -5471,7 +5472,7 @@ void Player_Update(Player* player) { Player_UpdateShields(player); Cutscene_AllRangeMode(player); Player_UpdateArwingRoll(player); - gChargeTimers[player->num] = player->cockpitView = gShowHud = 0; + gChargeTimers[player->num] = player->alternateView = gShowHud = 0; break; case PLAYERSTATE_1C8_GFOX_REPAIR: gPauseEnabled = 0; @@ -5488,7 +5489,7 @@ void Player_Update(Player* player) { player->unk_234 = 0; if (gPlayerInactive[player->num] == true) { Camera_FollowPlayer(player, player->attacker - 1, 0); - } else if ((D_ctx_80177E74 == 0) && (player->csState != 0)) { + } else if ((gVsMatchOver == 0) && (player->csState != 0)) { player->csState = 0; Player_Initialize(player); Player_Setup(player); @@ -5534,7 +5535,7 @@ void Player_Update(Player* player) { gShowAllRangeCountdown = gRadioState = 0; Audio_ClearVoice(); Audio_SetEnvSfxReverb(0); - D_ctx_80161A94[0] = gGoldRingCount[0]; + gSavedGoldRingCount[0] = gGoldRingCount[0]; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { D_ctx_80177C94 = gGoldRingCount[0]; } @@ -5545,7 +5546,7 @@ void Player_Update(Player* player) { gNextGameStateTimer = 2; gOptionMenuStatus = OPTION_WAIT; gDrawMode = DRAW_NONE; - D_game_80161A34 = 7; + gLastGameState = GSTATE_PLAY; gStarCount = 0; } else { if ((gCurrentLevel == LEVEL_SECTOR_X) || (gCurrentLevel == LEVEL_METEO)) { @@ -5553,7 +5554,7 @@ void Player_Update(Player* player) { } if (gLifeCount[gPlayerNum] < 0) { gNextGameState = GSTATE_GAME_OVER; - D_ctx_80161A94[0] = 0; + gSavedGoldRingCount[0] = 0; } else { gPlayState = PLAY_INIT; } @@ -5565,7 +5566,7 @@ void Player_Update(Player* player) { break; case 4: gNextGameState = GSTATE_MAP; - D_game_80161A34 = 7; + gLastGameState = GSTATE_PLAY; gDrawMode = DRAW_NONE; break; default: @@ -5639,19 +5640,19 @@ void Camera_UpdateArwingOnRails(Player* player) { gCsCamAtY = ((player->pos.y - player->yPath) * player->unk_14C) + 20.0f; gCsCamAtY += player->xRock * 5.0f; gCsCamAtY -= player->unk_02C * 0.25f; - switch (D_800D2F54) { + switch (sOverheadCam) { case 0: - Math_SmoothStepToF(&D_800D2F58, 0.0f, 0.4f, 10.0f, 0); + Math_SmoothStepToF(&sOverheadCamDist, 0.0f, 0.4f, 10.0f, 0); break; case 1: - Math_SmoothStepToF(&D_800D2F58, 200.0f, 0.4f, 10.0f, 0); + Math_SmoothStepToF(&sOverheadCamDist, 200.0f, 0.4f, 10.0f, 0); break; } gCsCamEyeX += player->xPath; gCsCamAtX += player->xPath; - gCsCamEyeY += player->yPath + D_800D2F58; - gCsCamAtZ = (player->trueZpos + gPathProgress) - 1.0f; - gCsCamEyeZ = 400.0f + D_800D2F58; + gCsCamEyeY += player->yPath + sOverheadCamDist; + gCsCamAtZ = player->trueZpos + gPathProgress - 1.0f; + gCsCamEyeZ = 400.0f + sOverheadCamDist; if (D_ctx_80177C70 == 2) { gCsCamEyeZ -= 50.0f; } @@ -5664,7 +5665,7 @@ void Camera_UpdateArwingOnRails(Player* player) { Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, 0.2f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_018, 1.0f, 1.0f, 0.05f, 0.0f); } - gCsCamAtY += player->yPath + (D_800D2F58 * 0.5f); + gCsCamAtY += player->yPath + (sOverheadCamDist * 0.5f); Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0.0f); Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_018, 1000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, player->unk_014, 1000.0f, 0.0f); @@ -5801,7 +5802,7 @@ void Camera_UpdateArwing360(Player* player, s32 arg1) { Matrix_RotateX(gCalcMatrix, player->damageShake * 0.2f * M_DTOR, MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; - if (player->cockpitView) { + if (player->alternateView) { sp74.z = 1000.0f - player->camDist; } else { sp74.z = 300.0f - player->camDist; @@ -5873,7 +5874,7 @@ void Camera_UpdateTank360(Player* player, s32 arg1) { Matrix_RotateY(gCalcMatrix, (player->yRot_114 + (player->damageShake * 0.2f)) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->damageShake * 0.2f * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; - if (player->cockpitView) { + if (player->alternateView) { sp54.y = 150.0f; sp54.z = 500.0f - player->camDist; } else { @@ -5881,7 +5882,7 @@ void Camera_UpdateTank360(Player* player, s32 arg1) { sp54.z = 250.0f - player->camDist; } Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - if (player->cockpitView) { + if (player->alternateView) { Math_SmoothStepToF(&player->unk_02C, -player->unk_17C * 3.0f + 30.0f, 0.2f, 8.0f, 0.001f); } else { Math_SmoothStepToF(&player->unk_02C, -player->unk_17C * 3.0f, 0.2f, 8.0f, 0.001f); @@ -5979,8 +5980,8 @@ void Camera_SetStarfieldPos(f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 if (gCurrentLevel == LEVEL_UNK_15) { tempf = gPlayer[0].cam.eye.y * 0.03f; } - sp30 = (-pitch * (-8.0f / 3.0f * M_RTOD) * 2.0f) + 3000.0f + D_ctx_80178430 + tempf; - sp34 = (yaw * (-8.0f / 3.0f * M_RTOD) * 2.0f) + 3000.0f + D_ctx_8017842C; + sp30 = (-pitch * (-8.0f / 3.0f * M_RTOD) * 2.0f) + 3000.0f + gStarfieldScrollY + tempf; + sp34 = (yaw * (-8.0f / 3.0f * M_RTOD) * 2.0f) + 3000.0f + gStarfieldScrollX; sp20 = gStarfieldX; gStarfieldX = Math_ModF(sp34, SCREEN_WIDTH * 1.5f); gStarfieldY = Math_ModF(sp30, SCREEN_HEIGHT * 1.5f); @@ -6015,7 +6016,7 @@ void Camera_Update(Player* player) { switch (gLevelMode) { case LEVELMODE_ON_RAILS: if (player->form == FORM_ARWING) { - if (!player->cockpitView) { + if (!player->alternateView) { Camera_UpdateArwingOnRails(player); } else { Camera_UpdateCockpitOnRails(player, 0); @@ -6064,7 +6065,7 @@ void Camera_SetupLights(Player* player) { if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { gEnvLightyRot = gLight1yRotTarget = gLight1yRotTarget = gLight2yRotTarget = gLight1yRotTarget = 110.0f; - if (gGameFrameCount & 0x20) { + if ((gGameFrameCount & 0x20) != 0) { gEnvLightyRot = gLight1yRotTarget = gLight1yRotTarget = gLight2yRotTarget = gLight1yRotTarget = 90.0f; } gLight1rotStep = gLight2rotStep = D_ctx_80178538 = 1.0f; @@ -6368,7 +6369,7 @@ void Play_SpawnVsItem(ObjectId objId, Item* item) { u8 spawnIndex = (u8) RAND_FLOAT(5.0f); if (sVsItemSpawnIndex == spawnIndex) { - gVsItemSpawnTimer -= 1; + gVsItemSpawnTimer--; } else { sVsItemSpawnIndex = spawnIndex; if (item->obj.status == OBJ_FREE) { @@ -6458,7 +6459,7 @@ void Play_Main(void) { Play_Update(); if ((gControllerPress[gMainController].button & START_BUTTON) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && - gSaveFile.save.data.planet[D_800D2F6C[gCurrentLevel]].normalClear) { + gSaveFile.save.data.planet[sSaveSlotFromLevel[gCurrentLevel]].normalClear) { Audio_ClearVoice(); Audio_SetEnvSfxReverb(0); Play_ClearObjectData(); diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index 7a27a145..3310efc8 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -487,7 +487,7 @@ void func_tank_80044868(Player* player) { } if (player->baseSpeed > 0.0f) { Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); - if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { + if ((gCurrentLevel == LEVEL_TITANIA) && !gBossActive) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } if ((gCurrentLevel == LEVEL_MACBETH) && (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { @@ -496,7 +496,7 @@ void func_tank_80044868(Player* player) { } if (player->baseSpeed > 10.0f) { Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); - if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { + if ((gCurrentLevel == LEVEL_TITANIA) && !gBossActive) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } } @@ -1399,7 +1399,7 @@ void func_tank_800481F4(Player* player) { temp_v0 = Player_CheckHitboxCollision(player, actor->info.hitbox, &sp98, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, actor->vwork[29].x, - actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z); + actor->vwork[29].y, actor->vwork[29].z + actor->rot_0F4.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); actor->dmgType = DMG_COLLISION; @@ -1487,11 +1487,11 @@ void func_tank_800481F4(Player* player) { if (temp_v0 != 0) { if ((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { - sprite->unk_46 = 1; + sprite->destroy = 1; player->hitTimer = 6; player->unk_21C = 0; } else if (sprite->obj.id == OBJ_SPRITE_TI_CACTUS) { - sprite->unk_46 = 1; + sprite->destroy = 1; } else { Player_ApplyDamage(player, temp_v0, sprite->info.damage); } diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index 4d8f1d5e..c7cb3406 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -326,9 +326,9 @@ void func_versus_800BDE44(void) { D_80178810[i] += 4; if (D_80178810[i] > 15) { if (gPlayerScores[i] > D_80178808[i]) { - D_80178808[i] += 1; + D_80178808[i] += 1; // can't be ++ } else { - D_80178808[i] -= 1; + D_80178808[i] -= 1; // can't be -- } if (gPlayerScores[i] != D_80178808[i]) { @@ -568,13 +568,13 @@ s32 func_versus_800BEDDC(void) { continue; } - if (!D_80178780[i]) { + if (D_80178780[i] == 0) { func_versus_800BE924(i); } else { func_versus_800BECA8(i); } - if (D_80178780[i]) { + if (D_80178780[i] != 0) { var_s4++; if (var_s4 == D_801787B4) { func_versus_800BED78(); @@ -646,7 +646,7 @@ s32 func_versus_800BF17C(void) { continue; } - if ((gPlayerInactive[i]) || (gVsMatchType == 1) || ((D_801787B4 == 1) && (gVsMatchType != 2)) || + if (gPlayerInactive[i] || (gVsMatchType == 1) || ((D_801787B4 == 1) && (gVsMatchType != 2)) || ((gVsMatchType == 2) && (D_versus_80178768[0] == 0) && (D_versus_80178768[1] == 0) && (D_versus_80178768[2] == 0))) { ret = Math_SmoothStepToF(&D_801787D8[i], D_801787E8[i], 0.3f, 100.0f, 1.0f); @@ -670,8 +670,8 @@ s32 func_versus_800BF17C(void) { } } - if (D_801787F8[i]) { - D_801787F8[i] -= 1; + if (D_801787F8[i] != 0) { + D_801787F8[i]--; } if (sUnlockLandmaster && (D_80178780[i] == 0) && (gControllerPress[i].button & B_BUTTON)) { @@ -791,21 +791,21 @@ s32 Versus_CheckForWinner(void) { gVsWinner = i; } if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) { - var_a3 += 1; + var_a3++; } } if ((D_801787B4 == 1) && (var_a3 == 4)) { - D_ctx_80177E74 = 1; + gVsMatchOver = 1; gVsWinner = 99; break; } for (i = 0; i < 4; i++) { - if (D_ctx_80177DB8[i] == gVsPointsToWin) { + if (gVsPoints[i] == gVsPointsToWin) { break; } - if (D_ctx_80177DB8[i] == (gVsPointsToWin - 1)) { + if (gVsPoints[i] == (gVsPointsToWin - 1)) { sStartVsHurryBgm = 1; } } @@ -814,7 +814,7 @@ s32 Versus_CheckForWinner(void) { return 0; } - if (gPlayer[i].timer_278) { + if (gPlayer[i].timer_278 != 0) { return 0; } @@ -827,7 +827,7 @@ s32 Versus_CheckForWinner(void) { } gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; } - D_ctx_80177E74 = 1; + gVsMatchOver = 1; gVsWinner = i; break; @@ -838,11 +838,11 @@ s32 Versus_CheckForWinner(void) { gVsWinner = i; } if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) { - var_a3 += 1; + var_a3++; } } if ((D_801787B4 == 1) && (var_a3 == 4)) { - D_ctx_80177E74 = 1; + gVsMatchOver = 1; gVsWinner = 99; break; } @@ -868,7 +868,7 @@ s32 Versus_CheckForWinner(void) { } gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; } - D_ctx_80177E74 = 1; + gVsMatchOver = 1; break; case 2: @@ -881,7 +881,7 @@ s32 Versus_CheckForWinner(void) { if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY)) { gPlayerScores[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0; - D_80178820[i] += 1; + D_80178820[i]++; } } } @@ -994,7 +994,7 @@ s32 Versus_CheckForWinner(void) { gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; } - D_ctx_80177E74 = 1; + gVsMatchOver = 1; break; default: @@ -1064,7 +1064,7 @@ s32 func_versus_800C04DC(f32 xPos, f32 scale, s32 arg2) { f32 x; f32 y; - if ((gVsMatchType == 2) && (D_800D4A98 & 0x20) && (gVsWinner != 99)) { + if ((gVsMatchType == 2) && ((D_800D4A98 & 0x20) != 0) && (gVsWinner != 99)) { x = 118.0f; y = 110.0f; @@ -1113,7 +1113,7 @@ s32 func_versus_800C07C4(void) { } } - if (stick_y) { + if (stick_y != 0) { if (stick_y > 0) { stick_y = -1; } else { @@ -1313,7 +1313,7 @@ bool func_versus_800C107C(s32 playerNum) { D_80178798 = 0; } - if (D_801787B8 < D_ctx_80177DB8[playerNum]) { + if (D_801787B8 < gVsPoints[playerNum]) { return false; } else { return true; @@ -1331,7 +1331,7 @@ s32 func_versus_800C1138(s32 max, s32 arg1) { for (i = 0; i < max; i++) { RCP_SetupDL(&gMasterDisp, 0x4D); - j = D_ctx_80177DD0[arg1][i]; + j = gVsKills[arg1][i]; gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, D_800D4CD8[j], D_800D4CE8[j], D_800D4CF8[j], 0); func_versus_800BD720(D_800D4CB8[arg1] + (i * 9.0f), D_800D4CC8[arg1]); @@ -1356,7 +1356,7 @@ void func_versus_800C1368(void) { D_801787D0 = 0.0f; D_801787AC = 255.0f; D_801787B0 = 0.0f; - D_game_80161A10 = 0.5f; + gNextVsViewScale = 0.5f; D_80178778 = 0; D_80178790 = 4; D_80178794 = 1; @@ -1413,8 +1413,8 @@ void func_versus_800C1368(void) { bool func_versus_800C15D8(void) { bool ret = false; - if (D_game_80161A10 >= 1.5f) { - D_game_80161A10 = 1.5f; + if (gNextVsViewScale >= 1.5f) { + gNextVsViewScale = 1.5f; switch (gVersusStage) { case VS_STAGE_CORNERIA: gBgColor = 0x8FBD; // 136, 240, 240 @@ -1434,7 +1434,7 @@ bool func_versus_800C15D8(void) { } ret = true; } else { - D_game_80161A10 += 0.05f; + gNextVsViewScale += 0.05f; gBgColor = 0; } @@ -1466,7 +1466,7 @@ void func_versus_800C1700(void) { gGameState = GSTATE_MENU; gNextGameStateTimer = 2; gOptionMenuStatus = OPTION_WAIT; - D_game_800D2870 = 1; + D_game_800D2870 = true; gBgColor = 0; } @@ -1520,7 +1520,7 @@ bool Versus_Update(void) { break; } if (ret == 1) { - D_ctx_80177E7C = 1; + gVsMatchStart = 1; } if (func_versus_800C16A0(30)) { gVsMatchState = 4; @@ -1765,7 +1765,7 @@ void Versus_Draw(void) { break; } case 4: - if ((gVsMatchType != 2) || (!(D_800D4A98 & 0x20))) { + if ((gVsMatchType != 2) || ((D_800D4A98 & 0x20) == 0)) { if (gVsWinner < 4) { func_versus_800C075C(); } @@ -1800,7 +1800,7 @@ void Versus_Draw(void) { if (var_a1 >= 121) { var_a1 = 121; } - func_fade_80084688(2, var_a1); + Wipe_Draw(WIPE_VERTICAL, var_a1); } void Versus_StartMatch(void) { @@ -1919,12 +1919,12 @@ void func_versus_800C2244(Actor* actor) { } else if (actor->obj.pos.y < gGroundHeight + 50.0f) { if (x3 > 180.0f) { x3 = 0.0f; - actor->unk_0F4.x = 0.0f; + actor->rot_0F4.x = 0.0f; } } - Math_SmoothStepToAngle(&actor->unk_0F4.x, x3, 0.5f, 1.0f, 0.0001f); - y3 = Math_SmoothStepToAngle(&actor->unk_0F4.y, actor->fwork[19], 0.5f, 1.0f, 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&actor->rot_0F4.x, x3, 0.5f, 1.0f, 0.0001f); + y3 = Math_SmoothStepToAngle(&actor->rot_0F4.y, actor->fwork[19], 0.5f, 1.0f, 0.0001f) * 30.0f; if (y3 < 0.0f) { y3 *= -1.0f; @@ -1935,8 +1935,8 @@ void func_versus_800C2244(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.z, y3, 0.1f, 3.0f, 0.01f); } - actor->obj.rot.x = -actor->unk_0F4.x; - actor->obj.rot.y = actor->unk_0F4.y; + actor->obj.rot.x = -actor->rot_0F4.x; + actor->obj.rot.y = actor->rot_0F4.y; vec.z = +cosX * 38.0f; vec.y = -sinX * 38.0f; @@ -1970,7 +1970,7 @@ void func_versus_800C26C8(void) { Vec3f dest; Actor* actor; - if ((gVsMatchType != 2) || (D_ctx_80177E7C == 0)) { + if ((gVsMatchType != 2) || (gVsMatchStart == 0)) { return; } |
