Updated vs decomp

This commit is contained in:
KiritoDv
2024-12-24 10:48:09 -06:00
committed by Lywx
parent d5ac40a4de
commit f40105e778
73 changed files with 1850 additions and 1205 deletions
+13 -13
View File
@@ -87,7 +87,7 @@ void AllRange_GetStarWolfHits(Actor* this) {
}
bool AllRange_PlayMessage(u16* msg, RadioCharacterId rcid) {
if ((gRadioState == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) {
if ((gRadioState == 0) && (gPlayer[0].state != PLAYERSTATE_STANDBY)) {
Radio_PlayMessage(msg, rcid);
return true;
} else {
@@ -227,7 +227,7 @@ void AllRange_GreatFoxRepair(Player* player) {
gCsCamEyeX -= 1.0f;
player->rot.x += 0.4f;
if (gCsFrameCount >= 130) {
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->arwing.drawFace = false;
player->unk_014 = 0;
player->unk_018 = 0;
@@ -477,7 +477,7 @@ void ActorAllRange_SpawnStarWolf(void) {
}
void ActorAllRange_PlayMessage(u16* msg, RadioCharacterId character) {
if (!gHideRadio && (gActors[0].state == STATE360_2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) {
if (!gHideRadio && (gActors[0].state == STATE360_2) && (gPlayer[0].state != PLAYERSTATE_STANDBY)) {
Radio_PlayMessage(msg, character);
}
}
@@ -508,7 +508,7 @@ void ActorAllRange_UpdateStarWolfEvents(ActorAllRange* this) {
if (gAllRangeEventTimer == gAllRangeSpawnEvent) {
ActorAllRange_SpawnStarWolf();
this->state = STATE360_3;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY;
gPlayer[0].state = PLAYERSTATE_STANDBY;
if ((gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_BOLSE)) {
gPlayer[0].camRoll = 20.0f;
}
@@ -698,7 +698,8 @@ void ActorAllRange_SpawnSupplies(Actor* this) {
}
}
}
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !gAllRangeSuppliesSent) {
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && !gAllRangeSuppliesSent) {
if (gAllRangeWingRepairTimer != 0) {
gAllRangeWingRepairTimer--;
}
@@ -710,7 +711,7 @@ void ActorAllRange_SpawnSupplies(Actor* this) {
}
void ActorAllRange_UpdateEvents(Actor* this) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT)) {
if ((gPlayer[0].state == PLAYERSTATE_DOWN) || (gPlayer[0].state == PLAYERSTATE_NEXT)) {
Object_Kill(&this->obj, this->sfxSource);
return;
}
@@ -810,7 +811,7 @@ s32 ActorAllRange_CheckObjectNearby(ActorAllRange* this) {
Boss* boss = &gBosses[0];
s32 pad[4];
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
return 0;
}
@@ -1229,7 +1230,7 @@ void ActorAllRange_ApplyDamage(ActorAllRange* this) {
}
void ActorAllRange_CheckPlayerNearby(ActorAllRange* this) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->iwork[24] != 0) &&
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && (this->iwork[24] != 0) &&
(fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) &&
(fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 1000.0f) &&
(fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) {
@@ -1501,7 +1502,7 @@ void ActorAllRange_Update(ActorAllRange* this) {
break;
case STATE360_0:
if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) {
if (gPlayer[0].state != PLAYERSTATE_START_360) {
this->fwork[0] = this->fwork[1] = 40.0f;
if (gActors[0].state == STATE360_5) {
@@ -1573,7 +1574,7 @@ void ActorAllRange_Update(ActorAllRange* this) {
if (this->aiIndex == AI360_FOX) {
if (gCurrentLevel != LEVEL_VENOM_2) {
if ((gPlayer[0].somersault && (this->iwork[4] > 10)) ||
((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY))) {
((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state == PLAYERSTATE_STANDBY))) {
this->state = STATE360_3;
this->counter_04E = 300;
this->timer_0BC = 160;
@@ -1656,8 +1657,7 @@ void ActorAllRange_Update(ActorAllRange* this) {
this->fwork[1] = gActors[this->aiIndex].fwork[0] - 5.0f;
} else {
this->fwork[1] = gPlayer[0].baseSpeed - 5.0f;
if ((gCurrentLevel == LEVEL_VENOM_2) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) &&
if ((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state == PLAYERSTATE_U_TURN) &&
(gPlayer[0].aerobaticPitch > 100.0f)) {
this->iwork[16] = STATE360_8;
}
@@ -1925,7 +1925,7 @@ void ActorAllRange_Update(ActorAllRange* this) {
spE0 = 0.0f;
}
spDC = RAND_FLOAT_CENTERED(10000.0f);
if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) {
if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state == PLAYERSTATE_STANDBY)) {
spE4 = RAND_FLOAT_CENTERED(5000.0f);
spDC = RAND_FLOAT_CENTERED(5000.0f);
}
+35 -16
View File
@@ -851,7 +851,7 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) {
}
test.z = test.x;
if ((i != shot->sourceId) &&
((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_DOWN)) &&
((player->state == PLAYERSTATE_ACTIVE) || (player->state == PLAYERSTATE_DOWN)) &&
(fabsf(player->trueZpos - shot->obj.pos.z) < test.z) &&
(fabsf(player->pos.x - shot->obj.pos.x) < test.x) &&
(fabsf(player->pos.y - shot->obj.pos.y) < test.y)) {
@@ -1100,8 +1100,7 @@ void PlayerShot_DrawLaser(PlayerShot* shot) {
if (gCamCount < 4) {
RCP_SetupDL_21();
twinLaserSeparation = 9.0f;
if ((shot->unk_58 == 0) ||
((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO))) {
if ((shot->unk_58 == 0) || ((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO))) {
width = 4.0f;
length = 20.0f;
} else {
@@ -1137,7 +1136,7 @@ void PlayerShot_DrawLaser(PlayerShot* shot) {
var_a1 = 2;
}
} else if (gCurrentLevel == LEVEL_KATINA) {
if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO) {
if (shot->sourceId > NPC_SHOT_ID + AI360_PEPPY) {
if (gActors[shot->sourceId - NPC_SHOT_ID].animFrame == 0) {
var_a1 = 1;
@@ -1739,8 +1738,8 @@ bool PlayerShot_FindLockTarget(PlayerShot* shot) {
}
if (gVersusMode) {
for (i = 0, player = gPlayer; i < gCamCount; i++, player++) {
if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !player->somersault &&
(player->form != FORM_ON_FOOT) && (i != shot->sourceId) && (gVsLockOnTimers[i][shot->sourceId] == 0) &&
if ((player->state == PLAYERSTATE_ACTIVE) && !player->somersault && (player->form != FORM_ON_FOOT) &&
(i != shot->sourceId) && (gVsLockOnTimers[i][shot->sourceId] == 0) &&
(fabsf(shot->obj.pos.x - player->pos.x) <= lockRange) &&
(fabsf(shot->obj.pos.y - player->pos.y) <= lockRange) &&
(fabsf(shot->obj.pos.z - player->trueZpos) <= lockRange)) {
@@ -1877,7 +1876,7 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
Player* player;
f32 radius = shot->scale * 60.0f;
scenery = gScenery;
scenery = &gScenery[0];
for (i = 0; i < ARRAY_COUNT(gScenery); i++, scenery++) {
if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_CO_DOORS)) {
dx = scenery->obj.pos.x - shot->obj.pos.x;
@@ -1889,7 +1888,8 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
scenery->dmgPart = 0;
}
}
sprite = gSprites;
sprite = &gSprites[0];
for (i = 0; i < ARRAY_COUNT(gSprites); i++, sprite++) {
if ((sprite->obj.status == OBJ_ACTIVE) &&
((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_TI_CACTUS) ||
@@ -1902,6 +1902,7 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
}
}
}
actor = &gActors[0];
for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) {
if ((actor->obj.status == OBJ_ACTIVE) && (actor->timer_0C2 == 0) &&
@@ -1915,12 +1916,14 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
if ((gLevelMode == LEVELMODE_ON_RAILS) && (dz < 0.0f)) {
dz *= 0.6f;
}
actor->hitPos.x = shot->obj.pos.x;
actor->hitPos.y = shot->obj.pos.y;
actor->hitPos.z = shot->obj.pos.z;
if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < radius) {
if ((actor->obj.id == OBJ_ACTOR_CO_RADAR) || (actor->obj.id == OBJ_ACTOR_ME_LASER_CANNON_1) ||
(actor->obj.id == OBJ_MISSILE_SEEK_TEAM) || (actor->obj.id == OBJ_ACTOR_ME_HOPBOT) ||
(actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_TEAM) || (actor->obj.id == OBJ_ACTOR_ME_HOPBOT) ||
(actor->obj.id == OBJ_ACTOR_ME_METEO_BALL) || (actor->obj.id == OBJ_ACTOR_ME_LASER_CANNON_2) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SUPPLY_CRATE)) ||
((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SX_WARP_GATE)) ||
@@ -1958,6 +1961,7 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
}
}
}
if (gCurrentLevel == LEVEL_MACBETH) {
Macbeth_801AD144(shot);
} else if (gCurrentLevel == LEVEL_VENOM_1) {
@@ -1965,7 +1969,8 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
} else {
PlayerShot_CheckBossHitbox(shot);
}
effect = gEffects;
effect = &gEffects[0];
for (i = 0; i < ARRAY_COUNT(gEffects); i++, effect++) {
if (effect->obj.status == OBJ_ACTIVE) {
dx = effect->obj.pos.x - shot->obj.pos.x;
@@ -1992,10 +1997,11 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) {
}
}
}
if (gVersusMode) {
player = gPlayer;
for (i = 0; i < gCamCount; i++, player++) {
if ((i != shot->sourceId) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->hitTimer == 0)) {
if ((i != shot->sourceId) && (player->state == PLAYERSTATE_ACTIVE) && (player->hitTimer == 0)) {
dx = player->pos.x - shot->obj.pos.x;
dy = player->pos.y - shot->obj.pos.y;
dz = player->trueZpos - shot->obj.pos.z;
@@ -2028,14 +2034,17 @@ void PlayerShot_UpdateBomb(PlayerShot* shot) {
PlayerShot_ExplodeBomb(shot);
break;
}
if ((shot->obj.pos.y < gGroundHeight) && (gGroundType != 4)) {
PlayerShot_ExplodeBomb(shot);
break;
}
if ((gPlayer[shot->sourceId].form == FORM_LANDMASTER) || (gPlayer[shot->sourceId].form == FORM_ON_FOOT)) {
shot->vel.y -= 1.0f;
Math_SmoothStepToF(&shot->obj.rot.x, -90.0f, 0.05f, 1.0f, 0.0f);
}
if (shot->timer < 25) {
if (gVersusMode) {
if (gControllerPress[shot->sourceId].button & gBombButton[shot->sourceId]) {
@@ -2049,19 +2058,22 @@ void PlayerShot_UpdateBomb(PlayerShot* shot) {
}
}
}
if (!((gCurrentLevel == LEVEL_VENOM_ANDROSS) && (gBosses[0].obj.status == OBJ_ACTIVE) &&
(gBosses[0].state == 17))) {
PlayerShot_CollisionCheck(shot);
}
PlayerShot_SetBombLight(shot);
break;
case 1:
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)) {
if (!gVersusMode && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) {
if (!gVersusMode &&
((gPlayer[0].state == PLAYERSTATE_ACTIVE) || (gPlayer[0].state == PLAYERSTATE_U_TURN))) {
test.x = gPlayer[0].pos.x - shot->obj.pos.x;
test.y = gPlayer[0].pos.y - shot->obj.pos.y;
test.z = gPlayer[0].trueZpos - shot->obj.pos.z;
@@ -2074,6 +2086,7 @@ void PlayerShot_UpdateBomb(PlayerShot* shot) {
}
PlayerShot_SetBombLight(shot);
}
if (shot->timer == 0) {
shot->unk_58 -= 8;
if (shot->unk_58 < 0) {
@@ -2125,8 +2138,9 @@ void PlayerShot_UpdateLockOnShot(PlayerShot* shot) {
sLockOnPos.y += actor->info.targetOffset;
}
}
for (i = 0, player = gPlayer; i < gCamCount; i++, player++) {
if (((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) &&
for (i = 0, player = &gPlayer[0]; i < gCamCount; i++, player++) {
if (((player->state == PLAYERSTATE_ACTIVE) || (player->state == PLAYERSTATE_U_TURN)) &&
(gVsLockOnTimers[i][shot->sourceId] != 0)) {
var_a3 = 1;
gVsLockOnTimers[i][shot->sourceId] = 2;
@@ -2139,6 +2153,7 @@ void PlayerShot_UpdateLockOnShot(PlayerShot* shot) {
sLockOnPos.z = player->trueZpos;
}
}
if (var_a3 != 0) {
sp6C = shot->obj.pos.x - sLockOnPos.x;
sp68 = shot->obj.pos.y - sLockOnPos.y;
@@ -2164,12 +2179,14 @@ void PlayerShot_UpdateLockOnShot(PlayerShot* shot) {
shot->unk_60 = 1;
}
}
Math_SmoothStepToF(&shot->unk_50, 360.0f, 1.0f, 3.0f, 0.f);
if (shot->unk_60 != 0) {
Math_SmoothStepToF(&shot->unk_54, 169.0f, 1.0f, 13.0f, 0.f);
} else {
Math_SmoothStepToF(&shot->unk_54, 91.0f, 1.0f, 7.7999997f, 0.f);
}
if (!((gPlayer[shot->sourceId].form == FORM_LANDMASTER) && (shot->unk_60 != 0))) {
Vec3f sp44;
Vec3f sp38;
@@ -2185,6 +2202,7 @@ void PlayerShot_UpdateLockOnShot(PlayerShot* shot) {
shot->vel.y = sp38.y;
shot->vel.z = sp38.z;
}
PlayerShot_CollisionCheck(shot);
gLight3x = shot->obj.pos.x;
gLight3y = shot->obj.pos.y;
@@ -2203,6 +2221,7 @@ void PlayerShot_UpdateShot(PlayerShot* shot, s32 index) {
shot->obj.pos.x += shot->vel.x;
shot->obj.pos.y += shot->vel.y;
shot->obj.pos.z += shot->vel.z;
switch (shot->obj.id) {
case PLAYERSHOT_SINGLE_LASER:
PlayerShot_UpdateBeam(shot, index);
@@ -2288,7 +2307,7 @@ void PlayerShot_Update(PlayerShot* shot) {
break;
case PLAYERSHOT_SINGLE_LASER:
case PLAYERSHOT_TWIN_LASER:
if ((shot->unk_58 == 0) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((shot->unk_58 == 0) || (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO)) {
ticks = 4;
} else {
ticks = 3;
+79 -67
View File
@@ -54,16 +54,12 @@ u16 gStarColors[16] = {
0x294B, 0x18DF, 0x294B, 0x1085, 0x39FF, 0x108B, 0x18CD, 0x108B,
};
Gfx* sSunDLs[13] = {
aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL,
aRadarMarkKaSaucererDL, D_BG_PLANET_20112C0, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL,
aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, D_BG_PLANET_20112C0,
aRadarMarkKaSaucererDL,
aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, D_BG_PLANET_20112C0,
aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, D_BG_PLANET_20112C0,
aBallDL,
};
Gfx* sKaSunDLs[13] = {
aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL,
aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL,
aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL, aRadarMarkKaSaucererDL,
aRadarMarkKaSaucererDL,
aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL, aBallDL,
};
f32 sSunShifts[13] = {
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 13.0f, 20.0f, 35.0f, 40.0f, 50.0f, 50.0f, 70.0f,
@@ -362,6 +358,7 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in
cos = __cosf(gStarfieldRoll);
sin = __sinf(gStarfieldRoll);
for (i = 0; i < var_s2; i++, sp5C++, sp60++, sp58++) {
bx = *sp60 + spf68;
by = *sp5C + spf64;
@@ -424,8 +421,8 @@ static u8 skipInterpolation;
void Background_DrawBackdrop(void) {
f32 sp12C;
f32 sp13C;
f32 sp138;
f32 sp134;
f32 bgXpos;
f32 bgYpos;
f32 sp130;
f32 camYawDeg;
f32 scale;
@@ -460,12 +457,12 @@ void Background_DrawBackdrop(void) {
case LEVEL_KATINA:
case LEVEL_VENOM_2:
case LEVEL_VERSUS:
sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f);
bgYpos = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f);
sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f);
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
// Start by translating the matrix to the far left position
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -2000.0f + sp134, -6000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -2000.0f + bgYpos, -6000.0f, MTXF_APPLY);
if (gCurrentLevel == LEVEL_FORTUNA) {
Matrix_Translate(gGfxMatrix, 0.0f, -2000.0f, 0, MTXF_APPLY);
@@ -541,7 +538,7 @@ void Background_DrawBackdrop(void) {
skipInterpolation = (fabsf(sp13C - bgPrevPosX) > 7280.0f / 2.0f);
f32 bgCutsceneFix;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_CORNERIA)) {
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) && (gCurrentLevel == LEVEL_CORNERIA)) {
bgCutsceneFix = 100.0f;
} else {
bgCutsceneFix = 0.0f;
@@ -549,7 +546,7 @@ void Background_DrawBackdrop(void) {
// Apply camera roll and translate matrix to the starting position (far left)
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -2000.0f + sp134 + bgCutsceneFix, -6000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -2000.0f + bgYpos + bgCutsceneFix, -6000.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
// Render the textures across a wider range to cover the screen
@@ -590,7 +587,7 @@ void Background_DrawBackdrop(void) {
case LEVEL_VENOM_ANDROSS: // WIP
if (gDrawBackdrop != 6) {
sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f);
bgYpos = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f);
sp13C =
Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f);
@@ -628,7 +625,7 @@ void Background_DrawBackdrop(void) {
// Leftmost DL (-2x translation)
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 2 * 7280.0f, -2000.0f + sp134, -6000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 2 * 7280.0f, -2000.0f + bgYpos, -6000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, -2500.0f, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_VE2_60038E0);
@@ -689,23 +686,23 @@ void Background_DrawBackdrop(void) {
break;
case LEVEL_AQUAS:
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
sp13C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114;
sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f);
bgYpos = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f);
sp13C = Math_ModF(sp13C * -40.44444f * 2.0f, 7280.0f); // close to 7280.0f / 180.0f
RCP_SetupDL_17();
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY);
// Start by translating the matrix to the far left position
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, sp134, -7000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, bgYpos, -7000.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
// Render the textures across the screen (left to right)
for (int i = 0; i < 5; i++) {
FrameInterpolation_RecordOpenChild("Backdrop", i);
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
gSPDisplayList(gMasterDisp++, D_AQ_601AFF0);
} else {
gSPDisplayList(gMasterDisp++, D_AQ_601C080);
@@ -726,18 +723,18 @@ void Background_DrawBackdrop(void) {
case LEVEL_MACBETH:
case LEVEL_TITANIA:
camYawDeg = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114;
sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f);
bgYpos = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f);
sp13C = camYawDeg * -40.44444f * 2.0f; // close to 7280.0f / 180.0f
if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) &&
(gPlayer[0].csState < 3)) {
D_bg_8015F968 += __sinf(gPlayer[0].camYaw) * 20.0f;
sp13C += D_bg_8015F968;
}
if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) &&
(gPlayer[0].csState >= 2) && (gPlayer[0].cam.eye.z <= -1900.0f)) {
D_bg_8015F968 = __sinf(gPlayer[0].camPitch) * 7000.0f;
sp134 -= fabsf(D_bg_8015F968);
bgYpos -= fabsf(D_bg_8015F968);
}
sp13C = Math_ModF(sp13C, 7280.0f);
@@ -756,11 +753,11 @@ void Background_DrawBackdrop(void) {
Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY);
if ((gCurrentLevel == LEVEL_TITANIA) || (gCurrentLevel == LEVEL_ZONESS)) {
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -3000.0f + sp134, -7000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -3000.0f + bgYpos, -7000.0f, MTXF_APPLY);
} else if (gCurrentLevel == LEVEL_SOLAR) {
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -3500.0f + sp134, -7000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -3500.0f + bgYpos, -7000.0f, MTXF_APPLY);
} else if (gCurrentLevel == LEVEL_MACBETH) {
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -4000.0f + sp134, -7000.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 14560.0f, -4000.0f + bgYpos, -7000.0f, MTXF_APPLY);
}
Matrix_SetGfxMtx(&gMasterDisp);
@@ -804,14 +801,14 @@ void Background_DrawBackdrop(void) {
break;
case LEVELTYPE_SPACE:
if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
if (gPlayer[0].state != PLAYERSTATE_ENTER_WARP_ZONE) {
Matrix_Push(&gGfxMatrix);
camYawDeg = Math_RadToDeg(gPlayer[0].camYaw);
sp130 = Math_RadToDeg(gPlayer[0].camPitch);
if (((camYawDeg < 110.0f) || (camYawDeg > 260.0f)) && ((sp130 < 40.0f) || (sp130 > 325.0f))) {
RCP_SetupDL_36();
sp138 = gStarfieldX; /* @port. Range: 0.0f - 960.0f */
sp134 = gStarfieldY;
bgXpos = gStarfieldX; /* @port. Range: 0.0f - 960.0f */
bgYpos = gStarfieldY;
if (((gCurrentLevel == LEVEL_SECTOR_X) || (gCurrentLevel == LEVEL_METEO)) && (gLevelPhase == 1)) {
levelId = LEVEL_WARP_ZONE;
@@ -819,36 +816,36 @@ void Background_DrawBackdrop(void) {
if (levelId == LEVEL_SECTOR_X) {
// @port. Accomodate for expanded aspect ratio
sp138 = Math_ModF(sp138 + 60.0f, (320.0f * 3.0f) + 120.0f);
sp134 = Math_ModF(sp134 + 360.0f - 40.0f, 360.0f);
bgXpos = Math_ModF(bgXpos + 60.0f, (320.0f * 3.0f) + 120.0f);
bgYpos = Math_ModF(bgYpos + 360.0f - 40.0f, 360.0f);
} else if (levelId == LEVEL_TRAINING) {
// @port. Accomodate for expanded aspect ratio
sp138 = Math_ModF(sp138 - 30.0f, (320.0f * 3.0f) + 120.0f);
sp134 = Math_ModF(sp134 + 360.0f - 40.0f, 360.0f);
bgXpos = Math_ModF(bgXpos - 30.0f, (320.0f * 3.0f) + 120.0f);
bgYpos = Math_ModF(bgYpos + 360.0f - 40.0f, 360.0f);
} else if ((levelId == LEVEL_SECTOR_Y) && (gLevelMode == LEVELMODE_ON_RAILS)) {
// @port. Accomodate for expanded aspect ratio
sp138 = Math_ModF(sp138 + (320.0f * 3.0f) + 120.0f /* - 60.0f*/, (320.0f * 3.0f) + 120.0f);
sp134 = Math_ModF(sp134, 360.0f);
bgXpos = Math_ModF(bgXpos + (320.0f * 3.0f) + 120.0f /* - 60.0f*/, (320.0f * 3.0f) + 120.0f);
bgYpos = Math_ModF(bgYpos, 360.0f);
} else if (levelId == LEVEL_FORTUNA) {
// @port. Accomodate for expanded aspect ratio
sp138 = Math_ModF(sp138 - 34.5f, (320.0f * 3.0f) + 120.0f);
sp134 = Math_ModF(sp134 + 19.0f, 360.0f);
bgXpos = Math_ModF(bgXpos - 34.5f, (320.0f * 3.0f) + 120.0f);
bgYpos = Math_ModF(bgYpos + 19.0f, 360.0f);
} else if (levelId == LEVEL_BOLSE) {
if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].csState < 10)) {
sp134 = Math_ModF(sp134 + 360.0f - 100.0f, 360.0f);
if ((gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE) || (gPlayer[0].csState < 10)) {
bgYpos = Math_ModF(bgYpos + 360.0f - 100.0f, 360.0f);
}
} else {
// @port. Accomodate for expanded aspect ratio
sp138 = Math_ModF(sp138, (320.0f * 3.0f) + 120.0f);
sp134 = Math_ModF(sp134, 360.0f);
bgXpos = Math_ModF(bgXpos, (320.0f * 3.0f) + 120.0f);
bgYpos = Math_ModF(bgYpos, 360.0f);
}
if ((camYawDeg < 180.0f) && (sp138 > 380.0f)) {
if ((camYawDeg < 180.0f) && (bgXpos > 380.0f)) {
// @port. Accomodate for expanded aspect ratio
sp138 = -((320.0f * 3.0f) - sp138);
bgXpos = -((320.0f * 3.0f) - bgXpos);
}
if ((sp130 > 180.0f) && (sp134 > 280.0f)) {
sp134 = -(360.0f - sp134);
if ((sp130 > 180.0f) && (bgYpos > 280.0f)) {
bgYpos = -(360.0f - bgYpos);
}
// @port: Tag the transform.
@@ -858,7 +855,7 @@ void Background_DrawBackdrop(void) {
switch (levelId) {
case LEVEL_SECTOR_Z:
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
@@ -869,7 +866,7 @@ void Background_DrawBackdrop(void) {
if ((s32) gWarpZoneBgAlpha != 0) {
RCP_SetupDL_62();
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) gWarpZoneBgAlpha);
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, MTXF_APPLY);
Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY);
@@ -883,14 +880,14 @@ void Background_DrawBackdrop(void) {
break;
case LEVEL_METEO:
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCsFrameCount > 260)) {
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 30.0f, -290.0f,
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) && (gCsFrameCount > 260)) {
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f) - 30.0f, -290.0f,
MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_ME_600DDF0);
} else if (gPathProgress > 185668.0f) {
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 130.0f, -290.0f,
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f) - 130.0f, -290.0f,
MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
@@ -900,7 +897,7 @@ void Background_DrawBackdrop(void) {
case LEVEL_SECTOR_X:
if (gSceneSetup == 0) {
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_62();
@@ -910,7 +907,7 @@ void Background_DrawBackdrop(void) {
break;
case LEVEL_TRAINING:
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.2f, 0.2f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_62();
@@ -924,13 +921,13 @@ void Background_DrawBackdrop(void) {
if (scale > 3.5f) {
scale = 3.5f;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
scale = D_bg_8015F984;
if (scale > 3.5f) {
scale = 3.5f;
}
}
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, scale * 0.75, scale * 0.75f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_A6_601BB40);
@@ -946,7 +943,7 @@ void Background_DrawBackdrop(void) {
if ((gCsFrameCount > 500 /*400*/) && (gMissionStatus == MISSION_COMPLETE)) {
scale = 0.75f;
}
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_FO_600B4B0);
@@ -954,17 +951,17 @@ void Background_DrawBackdrop(void) {
case LEVEL_BOLSE:
scale = 1.0f;
if ((gCsFrameCount > 500) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if ((gCsFrameCount > 500) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) {
scale = 1.3f;
}
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_BO_600D190);
break;
case LEVEL_SECTOR_Y:
Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, bgXpos - 120.0f, -(bgYpos - 120.0f), -290.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_62();
@@ -1024,9 +1021,10 @@ void Background_DrawSun(void) {
if (gPlayerGlareAlphas[gPlayerNum] > 300) {
gPlayerGlareAlphas[gPlayerNum] = 0;
}
if (((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO)) ||
(((gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_U_TURN) || (gLevelMode == LEVELMODE_ALL_RANGE) ||
(gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) &&
if (((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO)) ||
(((gPlayer[gPlayerNum].state == PLAYERSTATE_U_TURN) || (gLevelMode == LEVELMODE_ALL_RANGE) ||
(gPlayer[gPlayerNum].state == PLAYERSTATE_LEVEL_COMPLETE)) &&
(gLevelType == LEVELTYPE_PLANET) && (gCurrentLevel != LEVEL_TITANIA) && (gCurrentLevel != LEVEL_AQUAS))) {
gPlayerGlareReds[gPlayerNum] = 128;
gPlayerGlareGreens[gPlayerNum] = 128;
@@ -1107,6 +1105,7 @@ void Background_DrawLensFlare(void) {
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, gSunViewX, gSunViewY, -200.0f, MTXF_APPLY);
RCP_SetupDL_62();
lensFlareOffsetX = gSunViewX * -0.03f;
lensFlareOffsetY = gSunViewY * 0.03f;
lensFlareColor = &sSunColors[5];
@@ -1591,9 +1590,9 @@ void Background_DrawGround(void) {
RCP_SetupDL(&gMasterDisp, SETUPDL_37);
}
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].csState < 2)) {
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) && (gPlayer[0].csState < 2)) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
} else if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_bg_8015F974, D_bg_8015F978, D_bg_8015F97C,
D_bg_8015F980);
} else {
@@ -2044,26 +2043,39 @@ void Background_DrawGround(void) {
Matrix_Pop(&gGfxMatrix);
}
// Unused. Early water implementation in Aquas?
void func_bg_80042D38(void) {
f32 xEye;
f32 zEye;
if (!gPlayer[gPlayerNum].cam.eye.x) {}
if (!gPlayer[gPlayerNum].cam.eye.y) {} // all sorts of fake
// all sorts of fake
if (gPlayer[gPlayerNum].cam.eye.x == 0.0f) {
// Commented out code?
}
if (gPlayer[gPlayerNum].cam.eye.z == 0.0f) {
// Commented out code?
}
Matrix_Push(&gGfxMatrix);
xEye = gPlayer[gPlayerNum].cam.eye.x;
if (0) {}
if (0) {} //! FAKE
zEye = gPlayer[gPlayerNum].cam.eye.z;
Matrix_Translate(gGfxMatrix, xEye, 2.0f + gCameraShakeY, zEye, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY);
RCP_SetupDL_37(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 125);
Matrix_SetGfxMtx(&gMasterDisp);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_AQ_602C030);
} else {
gSPDisplayList(gMasterDisp++, D_AQ_602C088);
}
Matrix_Pop(&gGfxMatrix);
}
+1 -1
View File
@@ -114,7 +114,7 @@ void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) {
gBossDeathCamAtX = xPos;
gBossDeathCamAtY = yPos;
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
player->state = PLAYERSTATE_LEVEL_COMPLETE;
player->csState = 10;
player->csTimer = 50;
player->csEventTimer = 50;
+19 -19
View File
@@ -216,7 +216,7 @@ void Cutscene_WarpZoneComplete(Player* player) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlphaStep = 8;
if (gFillScreenAlpha == 255) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->state = PLAYERSTATE_NEXT;
player->csTimer = 0;
gFadeoutType = 4;
if (gCurrentLevel == LEVEL_METEO) {
@@ -570,7 +570,7 @@ void Cutscene_EnterWarpZone(Player* player) {
if (player->csTimer == 0) {
gWarpZoneBgAlpha = 0.0f;
gStarWarpDistortion = 0.0f;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->unk_014 = 0.0f;
player->unk_018 = 0.0f;
gDrawSmallRocks = 0;
@@ -836,7 +836,7 @@ void Cutscene_AllRangeMode(Player* player) {
}
if (D_ctx_80177A48[1] > 350.0f) {
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->unk_014 = 0.0f;
player->unk_018 = 0.1f;
player->unk_194 = 10.0f;
@@ -1249,7 +1249,7 @@ void Cutscene_CoComplete2(Player* player) {
gCsCamAtZ += D_ctx_80177A48[9];
player->draw = false;
if (player->csTimer == 0) {
player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->state = PLAYERSTATE_NEXT;
player->csTimer = 0;
gFadeoutType = 4;
Audio_FadeOutAll(10);
@@ -1519,7 +1519,7 @@ void Cutscene_UTurn(Player* player) {
}
if (player->csTimer == 0) {
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->unk_014 = 0.0f;
player->unk_018 = 0.0f;
}
@@ -1576,7 +1576,7 @@ void Cutscene_KillPlayer(Player* player) {
Audio_StopPlayerNoise(player->num);
Audio_KillSfxBySourceAndId(player->sfxSource, NA_SE_ARWING_DOWN);
Player_PlaySfx(player->sfxSource, NA_SE_ARWING_EXPLOSION, player->num);
player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->state = PLAYERSTATE_NEXT;
player->csTimer = 70;
player->dmgEffectTimer = 20;
gFadeoutType = 7;
@@ -2134,7 +2134,7 @@ void func_demo_8004F05C(ActorCutscene* this) {
case LEVEL_BOLSE:
switch (this->animFrame) {
case ACTOR_CS_TEAM_ARWING:
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
this->rot_0F4.z += this->rot_0F4.y;
this->vel.x = SIN_DEG(this->rot_0F4.z) * 10.0f;
this->obj.rot.z = SIN_DEG(this->rot_0F4.z) * 40.0f;
@@ -2313,8 +2313,8 @@ void ActorCutscene_Update(ActorCutscene* this) {
return;
}
switch (gPlayer[0].state_1C8) {
case PLAYERSTATE_1C8_LEVEL_COMPLETE:
switch (gPlayer[0].state) {
case PLAYERSTATE_LEVEL_COMPLETE:
switch (gCurrentLevel) {
case LEVEL_SECTOR_Y:
if (gPlayer[0].csState >= 3) {
@@ -2432,15 +2432,15 @@ void ActorCutscene_Update(ActorCutscene* this) {
}
break;
case PLAYERSTATE_1C8_LEVEL_INTRO:
case PLAYERSTATE_LEVEL_INTRO:
func_demo_8004F05C(this);
break;
case PLAYERSTATE_1C8_ENTER_WARP_ZONE:
case PLAYERSTATE_ENTER_WARP_ZONE:
func_demo_8004F798(this);
break;
case PLAYERSTATE_1C8_STANDBY:
case PLAYERSTATE_STANDBY:
if (gCurrentLevel == LEVEL_SECTOR_Y) {
SectorY_8019FF00(this);
}
@@ -2533,7 +2533,7 @@ void ActorCutscene_Draw(ActorCutscene* this) {
f32 x;
switch (this->animFrame) {
case ACTOR_CS_1000:
case ACTOR_CS_JAMES_ARWING:
RCP_SetupDL(&gMasterDisp, SETUPDL_45);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->work_046);
gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0);
@@ -2655,7 +2655,7 @@ void ActorCutscene_Draw(ActorCutscene* this) {
break;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
Matrix_Push(&gGfxMatrix);
Matrix_RotateX(gGfxMatrix, 20.0f * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, (gGameFrameCount * 0.5f) * M_DTOR, MTXF_APPLY);
@@ -2709,7 +2709,7 @@ void ActorCutscene_Draw(ActorCutscene* this) {
gDPSetPrimColor(gMasterDisp++, 0, 0, (s32) D_800CA210, (s32) D_800CA214, (s32) D_800CA218, 128);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
Matrix_Scale(gGfxMatrix, 1.02f, 1.02f, 1.02f, MTXF_APPLY);
} else {
Matrix_Scale(gGfxMatrix, 0.97f, 0.97f, 0.97f, MTXF_APPLY);
@@ -2724,7 +2724,7 @@ void ActorCutscene_Draw(ActorCutscene* this) {
Matrix_Pop(&gGfxMatrix);
Matrix_Pop(&gGfxMatrix);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
Matrix_Scale(gGfxMatrix, 0.075f, 0.075f, 0.075f, MTXF_APPLY);
break;
}
@@ -2742,7 +2742,7 @@ void ActorCutscene_Draw(ActorCutscene* this) {
break;
case ACTOR_CS_CORNERIAN_FIGHTER:
if ((this->index == 3) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if ((this->index == 3) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) {
gSPDisplayList(gMasterDisp++, aBillShipDL);
} else {
gSPDisplayList(gMasterDisp++, aKaCornerianFighterDL);
@@ -2780,7 +2780,7 @@ void ActorCutscene_Draw(ActorCutscene* this) {
gSPDisplayList(gMasterDisp++, aOrbDL);
break;
case ACTOR_CS_38:
case ACTOR_CS_SY_ROBOT:
animFrameData = Animation_GetFrameData(D_demo_800CA1F4[this->iwork[4]], this->iwork[5], sp144);
Math_SmoothStepToVec3fArray(sp144, this->vwork, 1, animFrameData, this->fwork[2], 100.0f, .0f);
RCP_SetupDL_30(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
@@ -2933,7 +2933,7 @@ void Cutscene_DrawGreatFox(void) {
}
if ((gCurrentLevel != LEVEL_AQUAS) &&
((gCurrentLevel != LEVEL_SECTOR_Z) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE))) {
((gCurrentLevel != LEVEL_SECTOR_Z) || (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE))) {
RCP_SetupDL_49();
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255);
for (i = 0, var_s6_2 = D_demo_800CA0BC; i < ARRAY_COUNT(sp9C); i++, var_s6_2++) {
+28 -30
View File
@@ -45,7 +45,7 @@ void Display_DrawHelpAlert(void) {
return;
}
if ((gTeamHelpActor->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) {
if ((gTeamHelpActor->obj.status != OBJ_ACTIVE) || (gPlayer[0].state != PLAYERSTATE_ACTIVE)) {
gTeamHelpActor = NULL;
gTeamHelpTimer = 0;
return;
@@ -274,7 +274,7 @@ void Display_OnFootMuzzleFlash(Player* player) {
FrameInterpolation_RecordOpenChild("Display_OnFootMuzzleFlash", player->num);
Matrix_Copy(gGfxMatrix, &gIdentityMatrix);
if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->csTimer != 0)) {
if ((player->state == PLAYERSTATE_ACTIVE) && (player->csTimer != 0)) {
Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y,
D_display_801613B0[player->num].z, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->csTimer - 1], D_display_800CA23C[player->csTimer - 1],
@@ -377,7 +377,7 @@ void Display_LandmasterMuzzleFlash(Player* player) {
// @port: Tag the transform.
FrameInterpolation_RecordOpenChild("Display_LandmasterMuzzleFlash", player->num);
if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->unk_1A0 != 0)) {
if ((player->state == PLAYERSTATE_ACTIVE) && (player->unk_1A0 != 0)) {
Matrix_Translate(gGfxMatrix, D_display_80161548[player->num].x, D_display_80161548[player->num].y,
D_display_80161548[player->num].z, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, D_display_800CA248[player->unk_1A0 - 1], D_display_800CA248[player->unk_1A0 - 1],
@@ -661,7 +661,7 @@ void Display_ArwingWings(ArwingInfo* arwing) {
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_64_2();
if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) &&
(gCurrentLevel == LEVEL_CORNERIA)) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 120);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
@@ -762,14 +762,14 @@ void Display_Arwing(Player* player, s32 reflectY) {
}
}
// Arwing only
void Display_Reticle(Player* player) {
Vec3f* translate;
s32 i;
if ((gPlayerNum == player->num) && ((player->form == FORM_ARWING) || (player->form == FORM_LANDMASTER)) &&
player->draw &&
(((gGameState == GSTATE_PLAY) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) ||
(gGameState == GSTATE_MENU))) {
(((gGameState == GSTATE_PLAY) && (player->state == PLAYERSTATE_ACTIVE)) || (gGameState == GSTATE_MENU))) {
for (i = 0; i < 2; i++) {
FrameInterpolation_RecordOpenChild("Reticle", (player->num << 16) + i);
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
@@ -869,7 +869,7 @@ void Display_PlayerShadow_Draw(Player* player) {
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK);
Matrix_Pop(&gGfxMatrix);
break;
@@ -1214,7 +1214,7 @@ void Display_PlayerFeatures(Player* player) {
f32 var_fv0;
s32 pad[3];
if (player->draw && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) {
if (player->draw && (player->state != PLAYERSTATE_DOWN)) {
switch (player->form) {
case FORM_ARWING:
Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + player->damageShake + 180.0f) * M_DTOR,
@@ -1292,7 +1292,7 @@ void Display_ArwingWingTrail_Draw(Player* player) {
yRot *= 0.25f;
sp50 = player->rot.x * 0.25f;
if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (player->state == PLAYERSTATE_LEVEL_COMPLETE) {
yRot = 0.0f;
sp50 = 0.0f;
}
@@ -1313,7 +1313,7 @@ void Display_ArwingWingTrail_Draw(Player* player) {
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
Matrix_Pop(&gGfxMatrix);
}
@@ -1333,7 +1333,7 @@ void Display_ArwingWingTrail_Draw(Player* player) {
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
Matrix_Pop(&gGfxMatrix);
}
@@ -1781,7 +1781,7 @@ void Display_Update(void) {
#endif
Matrix_Push(&gGfxMatrix);
if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state == PLAYERSTATE_ACTIVE)) {
Math_SmoothStepToF(&gCamDistortion, 0.01f, 0.2f, 0.002f, 0.0f);
} else {
Math_SmoothStepToF(&gCamDistortion, 0.0f, 0.2f, 0.002f, 0.0f);
@@ -1822,7 +1822,7 @@ void Display_Update(void) {
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) {
} else if (camPlayer->state == PLAYERSTATE_LEVEL_COMPLETE) {
Display_CsLevelCompleteHandleCamera(camPlayer);
} else {
gPlayCamEye.x = camPlayer->cam.eye.x;
@@ -1859,7 +1859,7 @@ void Display_Update(void) {
if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) {
if ((gCurrentLevel == LEVEL_TITANIA) &&
((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (gPlayer[0].unk_19C != 0))) {
((gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO) || (gPlayer[0].unk_19C != 0))) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
@@ -1889,7 +1889,7 @@ void Display_Update(void) {
Display_SetupPlayerSfxPos(player);
}
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
Lights_SetOneLight(&gMasterDisp, gLight2x, -1 * gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR,
gAmbientG, gAmbientB);
Matrix_Push(&gGfxMatrix);
@@ -1911,7 +1911,8 @@ void Display_Update(void) {
TexturedLine_Draw();
gReflectY = 1;
PlayerShot_DrawAll();
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
Matrix_Push(&gGfxMatrix);
Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY);
gReflectY = -1;
@@ -1921,7 +1922,7 @@ void Display_Update(void) {
gReflectY = -1;
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
Matrix_Push(&gGfxMatrix);
Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY);
for (i = 0, player = &gPlayer[0]; i < gCamCount; i++, player++) {
@@ -1947,8 +1948,7 @@ void Display_Update(void) {
if ((gCurrentLevel != LEVEL_AQUAS) &&
(((gCurrentLevel != LEVEL_CORNERIA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) ||
((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) &&
(gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)))) {
((gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)))) {
Effect_Draw(0);
}
@@ -1965,13 +1965,12 @@ void Display_Update(void) {
}
}
if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state == PLAYERSTATE_ACTIVE)) {
Aquas_801AA20C();
}
if (((gCurrentLevel == LEVEL_CORNERIA) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) &&
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO))) {
((gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) || (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO))) {
Effect_Draw(0);
}
@@ -1997,14 +1996,13 @@ void Display_Update(void) {
}
}
if ((gLevelMode == LEVELMODE_TURRET) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
if ((gLevelMode == LEVELMODE_TURRET) && (gPlayer[0].state == PLAYERSTATE_ACTIVE)) {
Turret_Draw(gPlayer);
}
Background_DrawLensFlare();
if ((gCamCount != 1) &&
((camPlayer->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (camPlayer->state_1C8 == PLAYERSTATE_1C8_U_TURN))) {
if ((gCamCount != 1) && ((camPlayer->state == PLAYERSTATE_ACTIVE) || (camPlayer->state == PLAYERSTATE_U_TURN))) {
HUD_Draw();
HUD_EdgeArrows_Update();
}
@@ -2051,7 +2049,7 @@ void Display_Update(void) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlphaStep = 8;
gShowLevelClearStatusScreen = false;
pl->state_1C8 = PLAYERSTATE_1C8_NEXT;
pl->state = PLAYERSTATE_NEXT;
pl->csTimer = 0;
gFadeoutType = 4;
}
@@ -2067,14 +2065,14 @@ void Display_Update(void) {
}
if (gCurrentLevel == LEVEL_SECTOR_X) {
gRingPassCount++;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE;
gPlayer[0].state = PLAYERSTATE_ENTER_WARP_ZONE;
gPlayer[0].csState = 0;
gSceneSetup = 1;
AUDIO_PLAY_SFX(NA_SE_WARP_HOLE, gDefaultSfxSource, 0);
gMissionStatus = MISSION_WARP;
gLeveLClearStatus[gCurrentLevel] = 1;
} else {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE;
gPlayer[0].state = PLAYERSTATE_ENTER_WARP_ZONE;
gPlayer[0].csState = 0;
AUDIO_PLAY_SFX(NA_SE_WARP_HOLE, gDefaultSfxSource, 0);
gMissionStatus = MISSION_WARP;
@@ -2097,7 +2095,7 @@ void Display_Update(void) {
}
if (gControllerPress[0].button & L_TRIG) {
pl->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
pl->state = PLAYERSTATE_LEVEL_COMPLETE;
gMissionStatus = MISSION_ACCOMPLISHED;
}
}
@@ -2106,7 +2104,7 @@ void Display_Update(void) {
Player* pl2 = &gPlayer[0];
if ((gLevelMode != LEVELMODE_ALL_RANGE) && (gControllerPress[0].button & L_TRIG)) {
pl2->state_1C8 = PLAYERSTATE_1C8_START_360;
pl2->state = PLAYERSTATE_START_360;
}
}
+2 -2
View File
@@ -306,8 +306,8 @@ ObjectInfo gObjectInfo[] = {
/* OBJ_ACTOR_ME_LASER_CANNON_2 */ {(void*) aMeLaserCannon2DL, 0, (ObjectFunc) Meteo_MeLaserCannon2_Update, aMeLaserCannon2Hitbox, 200.0f, 0, 1, 39, 0, 1.0f, 1 },
/* OBJ_ACTOR_AQ_UNK_188 */ {(void*) Aquas_Actor188_Draw, 1, (ObjectFunc) Aquas_Actor188_Update, aAqActor188Hitbox, 200.0f, 0, 1, 39, 0, 1.0f, 1 },
/* OBJ_ACTOR_DEBRIS */ {(void*) ActorDebris_Draw, 1, (ObjectFunc) ActorDebris_Update, gNoHitbox, 0.0f, 0, 0, 39, 0, 0.0f, 0 },
/* OBJ_MISSILE_SEEK_TEAM */ {(void*) ActorMissileSeek_Draw, 1, (ObjectFunc) ActorMissileSeek_Update, gActorMissileSeekHitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 },
/* OBJ_MISSILE_SEEK_PLAYER */ {(void*) ActorMissileSeek_Draw, 1, (ObjectFunc) ActorMissileSeek_Update, gActorMissileSeekHitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 },
/* OBJ_ACTOR_MISSILE_SEEK_TEAM */ {(void*) ActorMissileSeek_Draw, 1, (ObjectFunc) ActorMissileSeek_Update, gActorMissileSeekHitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 },
/* OBJ_ACTOR_MISSILE_SEEK_PLAYER */ {(void*) ActorMissileSeek_Draw, 1, (ObjectFunc) ActorMissileSeek_Update, gActorMissileSeekHitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 },
/* OBJ_ACTOR_CO_SKIBOT */ {(void*) CoSkibot_Draw, 1, (ObjectFunc) CoSkibot_Update, aCoActorSkibotHitbox, 200.0f, 0, 1, 39, 0, 50.0f, 1 },
/* OBJ_ACTOR_CO_RADAR */ {(void*) CoRadar_Draw, 1, (ObjectFunc) CoRadar_Update, aCoActorRadarHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 0 },
/* OBJ_ACTOR_ME_MORA */ {(void*) MeMora_Draw, 1, (ObjectFunc) MeMora_Update, gMeMoraHitbox, 200.0f, 0, 1, 39, 0, 0.0f, 1 },
+61 -54
View File
@@ -1,3 +1,8 @@
/*
* File: fox_edisplay.c
* Description: Object Draw routines
*/
#include "prevent_bss_reordering.h"
#include "global.h"
#include "sf64object.h"
@@ -40,8 +45,8 @@ void Object_ApplyWaterDistortion(void) {
Matrix_SetGfxMtx(&gMasterDisp);
}
void Object_SetCullDirection(s32 arg0) {
if (arg0 < 0) {
void Object_SetCullDirection(s32 cullDirection) {
if (cullDirection < 0) {
gSPSetGeometryMode(gMasterDisp++, G_CULL_FRONT);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
}
@@ -510,7 +515,7 @@ void Actor_DrawEngineAndContrails(Actor* this) {
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -70.0f, -10.0f, -100.0f, MTXF_APPLY);
@@ -519,7 +524,7 @@ void Actor_DrawEngineAndContrails(Actor* this) {
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
Matrix_Pop(&gGfxMatrix);
}
}
@@ -558,15 +563,15 @@ void ActorTeamArwing_Draw(ActorTeamArwing* this) {
Matrix_MultVec3f(gGfxMatrix, &src, &dest);
if (((/*(fabsf(dest.z) < 3000.0f) && (fabsf(dest.x) < 3000.0f) &&*/ !gBossActive) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || (gCurrentLevel == LEVEL_VENOM_ANDROSS) ||
(gCurrentLevel == LEVEL_VENOM_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) &&
(gPlayer[0].state == PLAYERSTATE_STANDBY) || (gCurrentLevel == LEVEL_VENOM_ANDROSS) ||
(gCurrentLevel == LEVEL_VENOM_2) || (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) &&
(gCurrentLevel != LEVEL_MACBETH) && (gCurrentLevel != LEVEL_TITANIA)) {
if (this->obj.id == OBJ_ACTOR_CUTSCENE) {
if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) &&
if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) &&
(this->index == 10)) ||
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gPlayer[0].csState >= 100) &&
((gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) && (gPlayer[0].csState >= 100) &&
(gCurrentLevel == LEVEL_KATINA) && (this->index == 1)) ||
((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) &&
((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state == PLAYERSTATE_STANDBY) &&
(this->state == 5))) {
gActorTeamArwing.rightWingState = gPlayer[0].arwing.rightWingState;
gActorTeamArwing.leftWingState = gPlayer[0].arwing.leftWingState;
@@ -584,7 +589,7 @@ void ActorTeamArwing_Draw(ActorTeamArwing* this) {
gActorTeamArwing.laserGunsYpos = gActorTeamArwing.laserGunsXpos = gActorTeamArwing.wingsXrot =
gActorTeamArwing.wingsYrot = gActorTeamArwing.cockpitGlassXrot = gActorTeamArwing.wingsZrot = 0.0f;
gActorTeamArwing.unk_28 = this->fwork[17];
gActorTeamArwing.drawFace = this->iwork[14];
gActorTeamArwing.drawFace = this->iwork[TEAM_FACE];
gActorTeamArwing.teamFaceXrot = this->fwork[20];
gActorTeamArwing.teamFaceYrot = this->fwork[19];
@@ -681,7 +686,7 @@ void Object_SetShadowDL(ObjectId objId, s32 index) {
Matrix_Scale(gGfxMatrix, 1.2f, 0.0f, 1.2f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
}
RCP_SetupDL(&gMasterDisp, SETUPDL_64);
break;
@@ -725,13 +730,13 @@ void Object_SetShadowDL(ObjectId objId, s32 index) {
break;
case OBJ_BOSS_KA_SAUCERER:
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) {
if (gPlayer[0].state == PLAYERSTATE_STANDBY) {
RCP_SetupDL(&gMasterDisp, SETUPDL_64);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 200);
}
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Graphics_SetScaleMtx(150.0f);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
break;
case OBJ_BOSS_CO_CARRIER:
@@ -944,7 +949,7 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) {
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK | G_LIGHTING);
}
void func_edisplay_8005D008(Object* obj, s32 drawType) {
void Object_SetMatrix(Object* obj, s32 drawType) {
bool isBanned = (obj->id >= OBJ_SCENERY_CO_BUILDING_5 &&
obj->id <= OBJ_SCENERY_CO_BUILDING_8 || obj->id == OBJ_SCENERY_CO_BUILDING_10);
bool skipRot = false;
@@ -960,7 +965,6 @@ void func_edisplay_8005D008(Object* obj, s32 drawType) {
skipRot = prevRot != obj->rot.y;
}
if (drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
@@ -991,7 +995,7 @@ void func_edisplay_8005D008(Object* obj, s32 drawType) {
}
}
void func_edisplay_8005D1F0(Object* obj, s32 drawType) {
void Boss_SetMatrix(Object* obj, s32 drawType) {
if (drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
@@ -1011,7 +1015,8 @@ void func_edisplay_8005D1F0(Object* obj, s32 drawType) {
}
}
void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) {
// Used for EVID_A6_UMBRA_STATION, OBJ_EFFECT_ENEMY_LASER_1 and OBJ_EFFECT_369
void ObjSpecial_SetMatrix(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) {
if (drawType == 2) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, gPathProgress, MTXF_APPLY);
Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW);
@@ -1038,9 +1043,9 @@ void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawT
}
}
void Scenery_Draw(Scenery* this, s32 arg1) {
void Scenery_Draw(Scenery* this, s32 cullDirection) {
this->obj.pos.y += gCameraShakeY;
func_edisplay_8005D008(&this->obj, this->info.drawType);
Object_SetMatrix(&this->obj, this->info.drawType);
this->obj.pos.y -= gCameraShakeY;
if (this->info.drawType == 0) {
@@ -1049,7 +1054,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
if (arg1 < 0) {
if (cullDirection < 0) {
Object_ApplyWaterDistortion();
}
@@ -1057,15 +1062,15 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
} else {
if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) {
if (arg1 < 0) {
if (cullDirection < 0) {
return; // weird control flow
}
RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
}
Object_SetCullDirection(arg1);
Object_SetCullDirection(cullDirection);
if (arg1 < 0) {
if (cullDirection < 0) {
Object_ApplyWaterDistortion();
}
@@ -1076,7 +1081,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
}
}
} else if (this->info.draw != NULL) {
Object_SetCullDirection(arg1);
Object_SetCullDirection(cullDirection);
this->info.draw(&this->obj);
}
}
@@ -1084,7 +1089,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) {
void Sprite_Draw(Sprite* this, s32 arg1) {
if (arg1 >= 0) {
this->obj.pos.y += gCameraShakeY;
func_edisplay_8005D008(&this->obj, 0);
Object_SetMatrix(&this->obj, 0);
this->obj.pos.y -= gCameraShakeY;
if (this->info.drawType == 0) {
@@ -1113,13 +1118,13 @@ void Actor_DrawOnRails(Actor* this) {
} else {
if (this->info.unk_19 != 0) {
this->obj.pos.y += gCameraShakeY;
func_edisplay_8005D008(&this->obj, this->info.drawType);
Object_SetMatrix(&this->obj, this->info.drawType);
this->obj.pos.y -= gCameraShakeY;
} else if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->eventType != EVID_A6_UMBRA_STATION)) {
func_edisplay_8005D3CC(&this->obj, this->vwork[29].x, this->vwork[29].y,
this->vwork[29].z + this->rot_0F4.z, this->info.drawType);
ObjSpecial_SetMatrix(&this->obj, this->vwork[29].x, this->vwork[29].y,
this->vwork[29].z + this->rot_0F4.z, this->info.drawType);
} else {
func_edisplay_8005D008(&this->obj, this->info.drawType);
Object_SetMatrix(&this->obj, this->info.drawType);
}
if (this->info.drawType == 0) {
@@ -1182,7 +1187,7 @@ void Actor_DrawAllRange(Actor* this) {
Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
this->info.draw(&this->obj);
sDrewActor = true;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) &&
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) &&
(this->aiType == AI360_MISSILE)) {
gTeamArrowsViewPos[0] = sViewPos;
}
@@ -1193,8 +1198,7 @@ void Actor_DrawAllRange(Actor* this) {
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_APPLY);
Matrix_MultVec3f(gGfxMatrix, &srcViewPos, &sViewPos);
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) ||
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) || (gPlayer[0].state == PLAYERSTATE_STANDBY) ||
((this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType >= AI360_GREAT_FOX)) ||
((this->obj.id == OBJ_ACTOR_CUTSCENE) && (this->info.bonus != 0))) {
var_ft5 = var_fv0 = 3000.0f;
@@ -1221,7 +1225,7 @@ void Actor_DrawAllRange(Actor* this) {
Matrix_SetGfxMtx(&gMasterDisp);
this->info.draw(&this->obj);
sDrewActor = true;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) &&
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) &&
(((this->obj.id == OBJ_ACTOR_ALLRANGE) &&
((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_KATT) ||
(this->aiType == AI360_BILL))) ||
@@ -1265,10 +1269,10 @@ void Boss_Draw(Boss* this, s32 arg1) {
if (this->info.unk_19 != 0) {
this->obj.pos.y += this->yOffset + gCameraShakeY;
func_edisplay_8005D1F0(&this->obj, this->info.drawType);
Boss_SetMatrix(&this->obj, this->info.drawType);
this->obj.pos.y -= this->yOffset + gCameraShakeY;
} else {
func_edisplay_8005D1F0(&this->obj, this->info.drawType);
Boss_SetMatrix(&this->obj, this->info.drawType);
}
Matrix_MultVec3f(&D_edisplay_801615F0, &origin, &D_edisplay_801615D0);
@@ -1335,13 +1339,13 @@ void Effect_DrawOnRails(Effect* this, s32 arg1) {
}
if ((this->obj.id == OBJ_EFFECT_ENEMY_LASER_1) || (this->obj.id == OBJ_EFFECT_369)) {
func_edisplay_8005D3CC(&this->obj, this->unk_60.x, this->unk_60.y, this->unk_60.z, 0);
ObjSpecial_SetMatrix(&this->obj, this->unk_60.x, this->unk_60.y, this->unk_60.z, 0);
} else if (this->info.unk_14 == -1) {
this->obj.pos.y += gCameraShakeY;
func_edisplay_8005D008(&this->obj, 0);
Object_SetMatrix(&this->obj, 0);
this->obj.pos.y -= gCameraShakeY;
} else {
func_edisplay_8005D008(&this->obj, 0);
Object_SetMatrix(&this->obj, 0);
}
if (this->info.draw != NULL) {
@@ -1664,7 +1668,7 @@ void Display_SetSecondLight(Vec3f* pos) {
sp9C.y = pos->y - gLight3y;
sp9C.z = pos->z - gLight3z;
lightDist = VEC3F_MAG(&sp9C);
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
lightFade = 700.0f / lightDist;
} else {
lightFade = 200.0f / lightDist;
@@ -1727,7 +1731,7 @@ bool func_edisplay_8005F9DC(Vec3f* arg0) {
return false;
}
void Object_DrawAll(s32 arg0) {
void Object_DrawAll(s32 cullDirection) {
Vec3f spAC;
s32 i;
s32 pad[5]; // probably separate iterators for each loop
@@ -1768,11 +1772,11 @@ void Object_DrawAll(s32 arg0) {
if (scenery->obj.status >= OBJ_ACTIVE) {
FrameInterpolation_RecordOpenChild(scenery, i);
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
if (arg0 > 0) {
if (cullDirection > 0) {
Display_SetSecondLight(&scenery->obj.pos);
}
Matrix_Push(&gGfxMatrix);
Scenery_Draw(scenery, arg0);
Scenery_Draw(scenery, cullDirection);
Matrix_Pop(&gGfxMatrix);
Object_UpdateSfxSource(scenery->sfxSource);
FrameInterpolation_RecordCloseChild();
@@ -1780,7 +1784,7 @@ void Object_DrawAll(s32 arg0) {
}
}
for (i = 0, boss = gBosses; i < ARRAY_COUNT(gBosses); i++, boss++) {
for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) {
if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id != OBJ_BOSS_BO_BASE_SHIELD)) {
FrameInterpolation_RecordOpenChild(boss, i);
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
@@ -1790,9 +1794,10 @@ void Object_DrawAll(s32 arg0) {
RCP_SetupDL_27();
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255);
}
Object_SetCullDirection(arg0);
Object_SetCullDirection(cullDirection);
Matrix_Push(&gGfxMatrix);
Boss_Draw(boss, arg0);
Boss_Draw(boss, cullDirection);
Matrix_Pop(&gGfxMatrix);
if (boss->drawShadow && (D_edisplay_801615D0.y > 0.0f)) {
Matrix_Push(&gGfxMatrix);
@@ -1806,7 +1811,7 @@ void Object_DrawAll(s32 arg0) {
Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG,
gAmbientB);
for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++, sprite++) {
for (i = 0, sprite = &gSprites[0]; i < ARRAY_COUNT(gSprites); i++, sprite++) {
if ((sprite->obj.status >= OBJ_ACTIVE) && func_enmy_80060FE4(&sprite->obj.pos, -12000.0f)) {
FrameInterpolation_RecordOpenChild(sprite, i);
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
@@ -1818,7 +1823,7 @@ void Object_DrawAll(s32 arg0) {
RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
}
Sprite_Draw(sprite, arg0);
Sprite_Draw(sprite, cullDirection);
Matrix_Pop(&gGfxMatrix);
FrameInterpolation_RecordCloseChild();
}
@@ -1848,12 +1853,13 @@ void Object_DrawAll(s32 arg0) {
case LEVELMODE_ON_RAILS:
case LEVELMODE_TURRET:
Matrix_Push(&gGfxMatrix);
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) {
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) ||
(gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) {
Display_SetSecondLight(&actor->obj.pos);
}
Object_SetCullDirection(arg0);
Object_SetCullDirection(cullDirection);
Actor_DrawOnRails(actor);
Matrix_Pop(&gGfxMatrix);
@@ -1891,8 +1897,8 @@ void Object_DrawAll(s32 arg0) {
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
Matrix_Push(&gGfxMatrix);
RCP_SetupDL(&gMasterDisp, SETUPDL_29);
Object_SetCullDirection(arg0);
Item_Draw(item, arg0);
Object_SetCullDirection(cullDirection);
Item_Draw(item, cullDirection);
Matrix_Pop(&gGfxMatrix);
FrameInterpolation_RecordCloseChild();
}
@@ -1958,7 +1964,8 @@ void Effect_DrawAll(s32 arg0) {
void Object_Draw(s32 arg0) {
gReflectY = 1;
Object_DrawAll(1);
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
gReflectY = -1;
Lights_SetOneLight(&gMasterDisp, gLight1x, -1 * gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR,
gAmbientG, gAmbientB);
@@ -1975,7 +1982,7 @@ void Effect_Draw(u8 arg0) {
if (arg0 == 0) {
gReflectY = 1;
Effect_DrawAll(1);
} else if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
} else if ((gGroundSurface == SURFACE_WATER) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
gReflectY = -1;
Matrix_Push(&gGfxMatrix);
Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY);
+21 -15
View File
@@ -1,3 +1,9 @@
/*
* File: fox_effect.c
* System: Effect
* Description: Effect Draw routines
*/
#include "global.h"
#include "assets/ast_blue_marine.h"
#include "assets/ast_arwing.h"
@@ -54,7 +60,7 @@ void BonusText_Update(void) {
if (gLevelMode == LEVELMODE_ON_RAILS) {
bonus->pos.z -= gPathVelZ;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
} else if (gPlayer[0].state == PLAYERSTATE_ACTIVE) {
bonus->pos.x += gPlayer[0].vel.x;
bonus->pos.z += gPlayer[0].vel.z;
}
@@ -227,7 +233,7 @@ void Effect_Effect384_Draw(Effect384* this) {
Graphics_SetScaleMtx(this->scale2);
if ((this->scale1 == 71.0f) ||
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCurrentLevel == LEVEL_CORNERIA))) {
((gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) && (gCurrentLevel == LEVEL_CORNERIA))) {
RCP_SetupDL(&gMasterDisp, SETUPDL_38);
} else {
RCP_SetupDL(&gMasterDisp, SETUPDL_67);
@@ -376,7 +382,7 @@ void Effect_Effect347_Draw(Effect347* this) {
void Effect_Effect351_Draw(Effect351* this) {
Graphics_SetScaleMtx(this->scale2);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
}
void Effect_Clouds_Draw(EffectClouds* this) {
@@ -694,8 +700,7 @@ void Effect_Effect357_Update(Effect357* this) {
this->vel.y -= 0.5f;
}
if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) &&
(gCsFrameCount > 175)) {
if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) && (gCsFrameCount > 175)) {
this->vel.x *= 0.95f;
this->vel.y *= 0.95f;
this->vel.z *= 0.95f;
@@ -722,7 +727,7 @@ bool func_effect_800798C4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, vo
void Effect_Effect357_Draw(Effect357* this) {
Vec3f frameJointTable[50];
if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) {
Display_SetSecondLight(&this->obj.pos);
}
@@ -1484,11 +1489,11 @@ void Effect_Effect362_Spawn(f32 xPos, f32 yPos, f32 zPos, f32 scale2) {
}
void Effect_Effect362_Update(Effect362* this) {
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
this->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch);
this->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw);
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) {
if (gPlayer[0].state == PLAYERSTATE_NEXT) {
this->unk_46 = 2;
this->vel.y -= 0.13f;
}
@@ -1721,7 +1726,7 @@ void Effect_Effect343_Setup(Effect343* this, f32 xPos, f32 yPos, f32 zPos, f32 s
this->unk_48 = -this->unk_48;
}
if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT)) {
if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state != PLAYERSTATE_NEXT)) {
this->unk_4A = 180;
} else {
this->unk_4A = 255;
@@ -1759,7 +1764,7 @@ void Effect_Effect387_Update(Effect387* this) {
s32 var_v0;
var_v0 = 1 - 1;
if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT)) {
if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state != PLAYERSTATE_NEXT)) {
var_v0 = 4 - 1;
}
@@ -1995,7 +2000,7 @@ void func_effect_8007D2C8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) {
void Effect_Effect339_Update(EffectFireSmoke* this) {
if (gLevelType == LEVELTYPE_PLANET) {
if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) {
this->vel.y += 0.1f;
if (this->timer_50 == 0) {
this->unk_4C++;
@@ -2008,7 +2013,7 @@ void Effect_Effect339_Update(EffectFireSmoke* this) {
}
}
} else {
if ((gCurrentLevel == LEVEL_MACBETH) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) &&
if ((gCurrentLevel == LEVEL_MACBETH) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) &&
(this->vel.x != 0)) {
Math_SmoothStepToF(&this->vel.x, -1.0f, 1.0f, 1.0f, 0.0f);
Math_SmoothStepToF(&this->vel.z, 4.0f, 1.0f, 1.0f, 0.0f);
@@ -3332,8 +3337,9 @@ void func_effect_800815DC(void) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if ((gEffects[i].obj.id == OBJ_EFFECT_366 || (gEffects[i].obj.id == OBJ_EFFECT_395 && gEffects[i].state == 1) ||
gEffects[i].obj.id == OBJ_EFFECT_364 || gEffects[i].obj.id == OBJ_EFFECT_346) &&
if (((gEffects[i].obj.id == OBJ_EFFECT_366) ||
((gEffects[i].obj.id == OBJ_EFFECT_395) && (gEffects[i].state == 1)) ||
(gEffects[i].obj.id == OBJ_EFFECT_364) || (gEffects[i].obj.id == OBJ_EFFECT_346)) &&
gEffects[i].obj.status == OBJ_ACTIVE) {
gEffects[i].obj.status = OBJ_FREE;
break;
@@ -3504,7 +3510,7 @@ void Effect_Effect395_Update(Effect395* this) {
velocity.y = this->vel.y;
velocity.z = this->vel.z;
//! FAKE: Probably some debug stuff printing different messages depending on what unk_4E is.
//! FAKE: Probably some debug stuff printing different messages depending on what state is.
if ((this->state != 0) && (this->state != 6) && (this->state != 7) && (this->state != 11)) {
if (gCurrentLevel) {}
PRINTF("ZO_MOVE HELP %d\n");
+22 -22
View File
@@ -98,7 +98,7 @@ bool func_enmy_80060FE4(Vec3f* arg0, f32 arg1) {
Vec3f src;
Vec3f dest;
if ((gLevelMode != LEVELMODE_ALL_RANGE) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gLevelMode != LEVELMODE_ALL_RANGE) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
return true;
}
@@ -125,7 +125,7 @@ bool func_enmy_80061148(Vec3f* arg0, f32 arg1) {
return true;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
return func_enmy_80060FE4(arg0, arg1);
}
@@ -333,7 +333,6 @@ void func_enmy_80061B68(void) {
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == OBJ_FREE) {
x = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(2000.0f) + (5.0f * gPlayer[0].vel.x);
y = 0;
while (y <= gGroundHeight) {
@@ -1232,8 +1231,8 @@ void Object_Init(s32 index, ObjectId objId) {
gActors[index].obj.status = OBJ_FREE;
}
break;
case OBJ_MISSILE_SEEK_TEAM:
case OBJ_MISSILE_SEEK_PLAYER:
case OBJ_ACTOR_MISSILE_SEEK_TEAM:
case OBJ_ACTOR_MISSILE_SEEK_PLAYER:
AUDIO_PLAY_SFX(NA_SE_EN_MISSILE_ENGINE, gActors[index].sfxSource, 4);
break;
case OBJ_ACTOR_CO_SKIBOT:
@@ -1457,7 +1456,7 @@ void func_enmy_800654E4(Object* obj) {
void func_enmy_800655C8(ActorMissileSeekTeam* this, f32 xPos, f32 yPos, f32 zPos, s32 eventType) {
Actor_Initialize(this);
this->obj.status = OBJ_INIT;
this->obj.id = OBJ_MISSILE_SEEK_TEAM;
this->obj.id = OBJ_ACTOR_MISSILE_SEEK_TEAM;
this->obj.pos.x = xPos;
this->obj.pos.y = yPos;
this->obj.pos.z = zPos;
@@ -1508,7 +1507,7 @@ void ActorMissileSeek_Update(Actor* this) {
var_ra = (gLevelMode == LEVELMODE_ALL_RANGE) ? 2 : 0;
if (this->iwork[2] == 0) {
if (this->obj.id == OBJ_MISSILE_SEEK_TEAM) {
if (this->obj.id == OBJ_ACTOR_MISSILE_SEEK_TEAM) {
for (i = 0; i < 3; i++) {
spB4[i] = gTeamShields[i + 1];
spA8[i] = var_ra + i;
@@ -1653,7 +1652,7 @@ void ActorMissileSeek_Update(Actor* this) {
sp8C.z = this->vel.z;
if ((Object_CheckCollision(this->index, &this->obj.pos, &sp8C, 1) != 0) || (this->dmgType != DMG_NONE) ||
(this->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
(this->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) {
func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f);
Object_Kill(&this->obj, this->sfxSource);
if (this->dmgType != DMG_NONE) {
@@ -1985,7 +1984,7 @@ void func_enmy_80066EE4(Sprite* this) {
void Item_CheckBounds(Item* this) {
f32 var_fa1;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) {
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) || (gPlayer[0].state == PLAYERSTATE_STANDBY)) {
Object_Kill(&this->obj, this->sfxSource);
}
@@ -2138,7 +2137,7 @@ void ActorSupplies_Update(ActorSupplies* this) {
gRadarMarks[63].yRot = 0.0f;
}
void ActorSupplies_Draw(Actor* this) {
void ActorSupplies_Draw(ActorEvent* this) {
s32 i;
Lights_SetOneLight(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20);
@@ -2406,7 +2405,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) {
gRingPassCount++;
if (gRingPassCount >= 7) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE;
gPlayer[0].state = PLAYERSTATE_ENTER_WARP_ZONE;
gPlayer[0].csState = 0;
AUDIO_PLAY_SFX(NA_SE_WARP_HOLE, gDefaultSfxSource, 0);
gMissionStatus = MISSION_WARP;
@@ -2475,14 +2474,15 @@ void ItemRingCheck_Update(Item* this) {
void ItemPathChange_Update(Item* this) {
gLastPathChange = this->obj.id;
if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE) {
if (gPlayer[0].state != PLAYERSTATE_ACTIVE) {
Object_Kill(&this->obj, this->sfxSource);
} else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelPhase == 1)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
gPlayer[0].state = PLAYERSTATE_LEVEL_COMPLETE;
gPlayer[0].csState = 0;
Object_Kill(&this->obj, this->sfxSource);
} else if (gCurrentLevel == LEVEL_TRAINING) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360;
gPlayer[0].state = PLAYERSTATE_START_360;
gPlayer[0].csState = 0;
Object_Kill(&this->obj, this->sfxSource);
} else if (this->state == 0) {
@@ -2617,7 +2617,7 @@ void Object_Dying(s32 index, ObjectId objId) {
break;
case OBJ_BOSS_TI_GORAS:
Titania_801990DC(&gBosses[index]);
Titania_TiGoras_Dying(&gBosses[index]);
break;
case OBJ_ACTOR_TI_RASCO:
@@ -2647,7 +2647,7 @@ void Actor_Move(Actor* this) {
if ((this->obj.id == OBJ_ACTOR_ZO_DODORA) || (gCurrentLevel == LEVEL_MACBETH) ||
((this->obj.id == OBJ_ACTOR_EVENT) && (this->eventType == EVID_TI_GREAT_FOX))) {
var_fv0 = 8000.0f;
} else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
} else if (gPlayer[0].state == PLAYERSTATE_ENTER_WARP_ZONE) {
var_fv0 = 100000.0f;
}
@@ -2698,7 +2698,7 @@ void Boss_Move(Boss* this) {
}
void Scenery_Move(Scenery* this) {
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) {
this->obj.pos.z += this->effectVel.z;
if ((this->info.cullDistance * 1.5f) < this->obj.pos.z) {
Object_Kill(&this->obj, this->sfxSource);
@@ -2997,7 +2997,7 @@ void TexturedLine_Update(TexturedLine* this) {
if (gGameState == GSTATE_PLAY) {
if (((this->mode == 1) || (this->mode == 101) || (this->mode == 50)) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].hitTimer == 0)) {
(gPlayer[0].state == PLAYERSTATE_ACTIVE) && (gPlayer[0].hitTimer == 0)) {
Matrix_RotateX(gCalcMatrix, -this->xRot, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, -this->yRot, MTXF_APPLY);
@@ -3057,13 +3057,13 @@ void Object_Update(void) {
gCullObjects = false;
if ((gLevelMode == LEVELMODE_ON_RAILS) &&
((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_INIT) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) ||
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_START_360) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT))) {
((gPlayer[0].state == PLAYERSTATE_INIT) || (gPlayer[0].state == PLAYERSTATE_ACTIVE) ||
(gPlayer[0].state == PLAYERSTATE_DOWN) || (gPlayer[0].state == PLAYERSTATE_ENTER_WARP_ZONE) ||
(gPlayer[0].state == PLAYERSTATE_START_360) || (gPlayer[0].state == PLAYERSTATE_NEXT))) {
gCullObjects = true;
}
if (gLevelMode != LEVELMODE_ALL_RANGE) {
if ((gLoadLevelObjects != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gLoadLevelObjects != 0) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
Object_LoadLevelObjects();
}
for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) {
+5 -5
View File
@@ -1184,7 +1184,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
this->drawShadow = true;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
if (gPlayer[0].state == PLAYERSTATE_ACTIVE) {
if (this->eventType == EVID_KATT) {
Audio_PlayFanfare(NA_BGM_KATT, 20, 10, 10);
}
@@ -1331,7 +1331,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) {
case EV_OPC(EVOP_PLAY_MSG):
msg = Message_PtrFromId(actorScript[this->aiIndex + 1]);
if ((msg != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
if ((msg != NULL) && (gPlayer[0].state == PLAYERSTATE_ACTIVE)) {
Radio_PlayMessage(msg, actorScript[this->aiIndex] & 0x1FF);
}
this->aiIndex += 2;
@@ -1840,7 +1840,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) {
Vec3f sp6C;
Sprite* sprite;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->eventType != EVID_SARUMARINE_PERISCOPE) &&
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && (this->eventType != EVID_SARUMARINE_PERISCOPE) &&
(this->eventType != EVID_ANDROSS_GATE) && (this->eventType != EVID_ANDROSS_GATE_2) &&
(this->eventType != EVID_SY_ROBOT_1) && (this->eventType != EVID_SY_ROBOT_2) &&
(this->eventType != EVID_SY_ROBOT_3)) {
@@ -3042,7 +3042,7 @@ void ActorEvent_Update(ActorEvent* this) {
Vec3f spAC;
Vec3f spA0;
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || gKillEventActors) {
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) || gKillEventActors) {
Object_Kill(&this->obj, this->sfxSource);
return;
}
@@ -3459,7 +3459,7 @@ void ActorEvent_Update(ActorEvent* this) {
this->vel.z -= gPathVelZ;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) {
if (gPlayer[0].state == PLAYERSTATE_ENTER_WARP_ZONE) {
this->vel.z = 100.0f;
}
+47 -50
View File
@@ -13,7 +13,7 @@ s32 D_801616D0[13];
s32 D_hud_80161704;
s32 D_hud_80161708;
s32 D_hud_8016170C;
s32 D_hud_80161710;
s32 gRadarMissileAlarmTimer;
s32 gTotalHits;
s32 D_80161718;
s32 D_8016171C;
@@ -192,7 +192,7 @@ void HUD_TeamDownWrench_Draw(s32 arg0) {
RCP_SetupDL(&gMasterDisp, SETUPDL_36);
if (arg0 == 0) {
for (i = 1; i < 4; i++) {
if (((gTeamShields[i] != 0) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) &&
if (((gTeamShields[i] != 0) || (gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE)) &&
(gTeamShields[i] <= 0) && (gTeamShields[i] != -2)) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, sTeamDownWrenchPos[i - 1].x, sTeamDownWrenchPos[i - 1].y,
@@ -499,7 +499,7 @@ void HUD_TeamShields_Draw(f32 xPos, f32 yPos, s32 arg2) {
((gPlayState == PLAY_PAUSE) || (gShowLevelClearStatusScreen == 1) || (gLevelStartStatusScreenTimer != 0))) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255);
if ((arg2 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if ((arg2 == 0) && (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE)) {
Graphics_DisplaySmallText(xPos + (8.0f * xScale) + 4.0f, yPos + 2.0f, 1.0f, 1.0f, " OK ");
} else {
Graphics_DisplaySmallText(xPos + (8.0f * xScale) + 4.0f, yPos + 2.0f, 1.0f, 1.0f, "DOWN");
@@ -1467,7 +1467,7 @@ void HUD_PauseScreen_Update(void) {
break;
case 2:
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY;
gPlayer[0].state = PLAYERSTATE_STANDBY;
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
gFillScreenAlphaTarget = 255;
gFillScreenAlphaStep = 32;
@@ -1589,7 +1589,7 @@ void HUD_PauseScreen_Update(void) {
gSavedHitCount = gSavedObjectLoadIndex = 0;
Audio_StopPlayerNoise(0);
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT;
gPlayer[0].state = PLAYERSTATE_NEXT;
gScreenFlashTimer = 0;
gPlayer[0].csTimer = 0;
gFillScreenAlpha = gFillScreenAlphaTarget = 255;
@@ -1758,7 +1758,7 @@ void HUD_RadarMark_KaSaucerer_Draw(void) {
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255);
Matrix_Scale(gGfxMatrix, 125.0f, 125.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkKaSaucererDL);
gSPDisplayList(gMasterDisp++, aBallDL);
}
void HUD_RadarMark_Missile_Draw(void) {
@@ -1874,7 +1874,7 @@ void HUD_RadarMark_Draw(s32 type) {
arwingMarkColor = 1;
}
if (gPlayer[type].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) {
if (gPlayer[type].state == PLAYERSTATE_VS_STANDBY) {
break;
}
}
@@ -1971,7 +1971,7 @@ void HUD_RadarMarks_Setup(void) {
Item* item;
for (i = 0; i < gCamCount; i++) {
if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_NEXT) {
if (gPlayer[i].state == PLAYERSTATE_NEXT) {
continue;
}
gRadarMarks[i].enabled = true;
@@ -1988,7 +1988,7 @@ void HUD_RadarMarks_Setup(void) {
continue;
}
if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_ACTIVE) {
if (gPlayer[i].state != PLAYERSTATE_ACTIVE) {
continue;
}
@@ -2178,11 +2178,11 @@ s32 HUD_RadarMarks_Update(void) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, x1 + gHudOffsetPers, y1, z1, MTXF_APPLY);
if ((gCurrentLevel == LEVEL_SECTOR_Z) && (D_hud_80161710 != 0)) {
if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gRadarMissileAlarmTimer != 0)) {
Matrix_Push(&gGfxMatrix);
HUD_RadarMissileAlarm_Draw();
Matrix_Pop(&gGfxMatrix);
D_hud_80161710--;
gRadarMissileAlarmTimer--;
}
for (i = ARRAY_COUNT(gRadarMarks) - 1; i >= 0; i--) {
@@ -2220,19 +2220,20 @@ s32 ActorMissileSeek_ModeCheck(ActorMissileSeekMode mode) {
for (i = 0, actor = &gActors[0]; i < 60; i++, actor++) {
switch (mode) {
case MISSILE_SEEK_TEAMMATES:
if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_MISSILE_SEEK_TEAM)) {
if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_TEAM)) {
ret++;
}
break;
case MISSILE_SEEK_PLAYER:
if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_MISSILE_SEEK_PLAYER)) {
if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_PLAYER)) {
ret++;
}
break;
case MISSILE_SEEK_EITHER:
if (((actor->obj.id == OBJ_MISSILE_SEEK_TEAM) || (actor->obj.id == OBJ_MISSILE_SEEK_PLAYER)) &&
if (((actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_TEAM) ||
(actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_PLAYER)) &&
(actor->obj.status == OBJ_ACTIVE)) {
ret++;
}
@@ -3295,7 +3296,7 @@ void HUD_Radar(void) {
HUD_RadarMarks_Update();
}
void HUD_Hitpoints_Update(f32 xPos, f32 yPos) {
void HUD_Score_Update(f32 xPos, f32 yPos) {
f32 r;
f32 g;
f32 b;
@@ -3381,24 +3382,22 @@ void HUD_Hitpoints_Update(f32 xPos, f32 yPos) {
r = 255;
g = 255;
b = 255;
} else if (medalStatus) {
r = 200;
g = 100;
b = 50;
} else {
if (medalStatus) {
r = 200;
g = 100;
b = 50;
} else {
r = 90;
g = 160;
b = 200;
}
r = 90;
g = 160;
b = 200;
}
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, 255);
HUD_Hitpoints_Draw(xPos, yPos);
HUD_Score_Draw(xPos, yPos);
}
void HUD_Shield_GoldRings_HitPoints(f32 xPos, f32 yPos) {
HUD_Hitpoints_Update(xPos, yPos);
void HUD_Shield_GoldRings_Score(f32 xPos, f32 yPos) {
HUD_Score_Update(xPos, yPos);
HUD_PlayerShield_GoldRings();
}
@@ -3626,7 +3625,7 @@ void HUD_SinglePlayer(void) {
HUD_IncomingMsg();
if (D_hud_80161708 != 0) {
HUD_Shield_GoldRings_HitPoints(24.0f, 30.0f);
HUD_Shield_GoldRings_Score(24.0f, 30.0f);
if (gCurrentLevel != LEVEL_TRAINING) {
HUD_LivesCount2_Draw(248.0f, 11.0f, gLifeCount[gPlayerNum]);
}
@@ -3753,13 +3752,13 @@ void HUD_Draw(void) {
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
}
void FoBase_Draw(Boss* boss) {
void FoBase_Draw(Boss* this) {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gSPDisplayList(gMasterDisp++, aFoBaseDL2);
RCP_SetupDL_34(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK);
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, (s32) boss->fwork[1], (s32) boss->fwork[2], 255);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, (s32) this->fwork[1], (s32) this->fwork[2], 255);
gSPDisplayList(gMasterDisp++, aFoBaseDL1);
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
}
@@ -4247,7 +4246,7 @@ void ActorTeamBoss_SetAction(ActorTeamBoss* this) {
this->state = 3;
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
if ((this->state != 2) && (this->state != 3)) {
this->iwork[4] = 1;
this->state = 2;
@@ -4534,7 +4533,7 @@ void ActorTeamBoss_Radarmarks_Init(ActorTeamBoss* this) {
void ActorTeamBoss_DmgEffect(ActorTeamBoss* this) {
s32 mask;
if ((gTeamShields[this->aiType] < 64) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if ((gTeamShields[this->aiType] < 64) && (gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE)) {
mask = 8 - 1;
if (gTeamShields[this->aiType] > 16) {
mask = 16 - 1;
@@ -4830,14 +4829,14 @@ void ActorTeamBoss_Update(ActorTeamBoss* this) {
}
if ((this->iwork[10] != 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (this->iwork[9] == 0) &&
(gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
(gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE)) {
this->work_048 = 2;
this->work_04A = 0;
}
if ((gLevelMode == LEVELMODE_ALL_RANGE) &&
(fabsf(this->obj.pos.x > range) || fabsf(this->obj.pos.z > range)) &&
(gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
(gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE)) {
this->work_048 = 2;
this->work_04A = 1;
}
@@ -4877,7 +4876,7 @@ void Aquas_CsIntroActors_Update(ActorCutscene* this) {
if (this->state == 0) {
switch (this->animFrame) {
case 1:
if ((player->state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (this->animFrame != 1)) {
if ((player->state != PLAYERSTATE_LEVEL_INTRO) || (this->animFrame != 1)) {
if (gCsFrameCount > 1588) {
this->fwork[0] = 5.0f;
} else {
@@ -4942,8 +4941,7 @@ void Aquas_Effect363_Spawn(f32 x, f32 y, f32 z, f32 arg3) {
effect->obj.pos.y = y;
effect->obj.pos.z = z;
if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) &&
(player->csState < 2)) {
if ((player->state == PLAYERSTATE_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState < 2)) {
effect->scale1 = 0.4f;
effect->unk_44 = 0;
effect->unk_46 = 24;
@@ -5362,7 +5360,7 @@ void Aquas_CsLevelStart(Player* player) {
if (player->csTimer <= 900) {
gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->csState = 0;
player->csTimer = 0;
@@ -5418,7 +5416,7 @@ f32 D_800D24CC = 0.02f;
void Aquas_Effect363_Update(Effect363* this) {
Player* player = &gPlayer[0];
if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState < 2)) {
if ((player->state == PLAYERSTATE_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState < 2)) {
switch (this->state) {
case 0:
this->unk_44 += this->unk_46;
@@ -5449,12 +5447,12 @@ void Aquas_Effect363_Update(Effect363* this) {
}
this->obj.rot.z += this->unk_48;
} else {
if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (player->state == PLAYERSTATE_LEVEL_COMPLETE) {
this->obj.rot.x = RAD_TO_DEG(player->camPitch);
this->obj.rot.y = RAD_TO_DEG(-player->camYaw);
}
if (player->state_1C8 == PLAYERSTATE_1C8_NEXT) {
if (player->state == PLAYERSTATE_NEXT) {
this->unk_46 = 2;
if (player->csState >= 4) {
this->vel.y -= 0.13f;
@@ -5464,8 +5462,8 @@ void Aquas_Effect363_Update(Effect363* this) {
this->scale2 += 0.8f;
this->unk_4A -= this->unk_46;
if ((this->unk_4A < 0) || ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
(gCurrentLevel == LEVEL_AQUAS) && (player->csState == 5))) {
if ((this->unk_4A < 0) ||
((player->state == PLAYERSTATE_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState == 5))) {
Object_Kill(&this->obj, this->sfxSource);
}
this->obj.rot.z += this->unk_48;
@@ -5473,8 +5471,7 @@ void Aquas_Effect363_Update(Effect363* this) {
}
void Aquas_Effect363_Draw(Effect363* this) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) &&
(gPlayer[0].csState < 2)) {
if ((gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].csState < 2)) {
RCP_SetupDL(&gMasterDisp, SETUPDL_68);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, this->unk_4A);
gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0);
@@ -5492,7 +5489,7 @@ void stub_80094D10(void) {
void stub_80094D18(void) {
}
void HUD_Hitpoints_Draw(f32 x, f32 y) {
void HUD_Score_Draw(f32 x, f32 y) {
u8* D_800D24DC[] = { aLargeText_0, aLargeText_1, aLargeText_2, aLargeText_3, aLargeText_4,
aLargeText_5, aLargeText_6, aLargeText_7, aLargeText_8, aLargeText_9 };
s32 D_800D2504[] = { 100, 10, 1 };
@@ -5665,7 +5662,7 @@ void Aquas_AqCoralReef2_Setup(ActorCutscene* this, s32 posIdx) {
this->obj.id = OBJ_ACTOR_CUTSCENE;
this->obj.pos = sAqCoralReef2Pos[posIdx];
this->obj.pos.z -= gPathProgress;
this->animFrame = 46;
this->animFrame = ACTOR_CS_AQ_CORAL_REEF_2;
Object_SetInfo(&this->info, this->obj.id);
}
@@ -5680,7 +5677,7 @@ void Aquas_AqRock_Setup(ActorCutscene* this, s32 posIdx) {
this->obj.id = OBJ_ACTOR_CUTSCENE;
this->obj.pos = sAqRockPos[posIdx];
this->obj.pos.z -= gPathProgress;
this->animFrame = 47;
this->animFrame = ACTOR_CS_AQ_ROCK;
Object_SetInfo(&this->info, this->obj.id);
}
@@ -5966,7 +5963,7 @@ void Aquas_CsLevelComplete(Player* player) {
if (gFillScreenAlpha == 255) {
gLeveLClearStatus[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1;
player->state_1C8 = PLAYERSTATE_1C8_NEXT;
player->state = PLAYERSTATE_NEXT;
player->csTimer = 0;
Audio_FadeOutAll(10);
gFadeoutType = 4;
@@ -6189,7 +6186,7 @@ void Venom1_LevelStart2(Player* player) {
if (gCsFrameCount == 300) {
gPathTexScroll = 0;
gLevelStartStatusScreenTimer = 50;
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->baseSpeed = gArwingSpeed;
player->csState = 0;
player->csTimer = 0;
+86 -82
View File
@@ -436,7 +436,7 @@ void Play_Setup360_CO(void) {
}
}
for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++) {
for (i = 0, sprite = &gSprites[0]; i < ARRAY_COUNT(gSprites); i++) {
if (gLevelObjects[i].id <= OBJ_INVALID) {
break;
}
@@ -1656,8 +1656,7 @@ void Player_CheckItemCollect(Player* player) {
for (i = 0, item = gItems; i < ARRAY_COUNT(gItems); i++, item++) {
if ((item->obj.status == OBJ_ACTIVE) &&
((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) &&
(item->timer_4A == 0) &&
((player->state == PLAYERSTATE_ACTIVE) || (player->state == PLAYERSTATE_U_TURN)) && (item->timer_4A == 0) &&
Player_CheckHitboxCollision(player, item->info.hitbox, &sp6C, item->obj.pos.x, item->obj.pos.y,
item->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)) {
item->collected = true;
@@ -1801,7 +1800,7 @@ void Player_CollisionCheck(Player* player) {
break;
}
} else if (player->form == FORM_ARWING) {
if ((player->hit1.y < (gGroundHeight + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) {
if ((player->hit1.y < (gGroundHeight + 13.0f)) && (player->state != PLAYERSTATE_DOWN)) {
if (gGroundSurface == SURFACE_WATER) {
player->hitTimer = 7;
player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.5f;
@@ -1814,7 +1813,7 @@ void Player_CollisionCheck(Player* player) {
Effect_Effect362_Spawn(player->hit1.x, player->hit1.y, player->hit1.z, 6.0f);
}
}
if ((player->hit2.y < (gGroundHeight + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) {
if ((player->hit2.y < (gGroundHeight + 13.0f)) && (player->state != PLAYERSTATE_DOWN)) {
if (gGroundSurface == SURFACE_WATER) {
player->hitTimer = 7;
player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.5f;
@@ -2058,7 +2057,7 @@ void Player_CollisionCheck(Player* player) {
}
}
for (i = 0, boss = gBosses; i < ARRAY_COUNT(gBosses); i++, boss++) {
for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) {
if (boss->obj.status == OBJ_ACTIVE) {
if ((boss->obj.id == OBJ_BOSS_VE2_BASE) || (boss->obj.id == OBJ_BOSS_FO_BASE) ||
(boss->obj.id == OBJ_BOSS_SZ_GREAT_FOX) || (boss->obj.id == OBJ_BOSS_BO_BASE)) {
@@ -2216,7 +2215,7 @@ void Player_CollisionCheck(Player* player) {
}
} else {
actor->dmgType = DMG_COLLISION;
if (actor->obj.id == OBJ_MISSILE_SEEK_TEAM) {
if (actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_TEAM) {
actor->dmgType = -1;
}
if (actor->info.damage) {
@@ -2258,7 +2257,7 @@ void Player_CollisionCheck(Player* player) {
if (gCamCount == 4) {
for (opponent = &gPlayer[3], i = 3; i >= 0; i--, opponent--) {
if ((i != gPlayerNum) && (opponent->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
if ((i != gPlayerNum) && (opponent->state == PLAYERSTATE_ACTIVE)) {
spC8.x = 25.0f;
if (player->form == FORM_ON_FOOT) {
spC8.x = 4.0f;
@@ -2316,7 +2315,7 @@ void Player_CollisionCheck(Player* player) {
player->knockback.y = 30.0f;
player->rot.x = (player->baseSpeed + player->boostSpeed) * 0.8f;
}
if (player->state_1C8 == PLAYERSTATE_1C8_DOWN) {
if (player->state == PLAYERSTATE_DOWN) {
player->radioDamageTimer = 2;
Effect_Effect382_Spawn(player->pos.x, player->trueZpos, 30.0f, 0.0f, 5.0f);
Effect_Effect382_Spawn(player->pos.x, player->trueZpos, -30.0f, 0.0f, 5.0f);
@@ -2851,7 +2850,7 @@ void Play_Init(void) {
gSceneSetup = 0;
}
gShowHud = 1;
gShowHud = true;
gDrawGround = gDrawBackdrop = 1;
gAqDrawMode = sOverheadCam = 0;
gCamDistortion = sOverheadCamDist = 0.0f;
@@ -2945,7 +2944,7 @@ void Play_Init(void) {
MEM_ARRAY_ALLOCATE(gPlayer, gCamCount);
Player_InitializeAll();
for (i = 0; i < gCamCount; i++) {
gPlayer[i].state_1C8 = PLAYERSTATE_1C8_INIT;
gPlayer[i].state = PLAYERSTATE_INIT;
gPlayerGlareAlphas[i] = D_ctx_801783C0[i] = 0;
gControllerRumbleTimers[i] = 0;
gPlayerScores[i] = 0;
@@ -3298,8 +3297,8 @@ bool Player_CanLockOn(s32 playerNum) {
if (gVersusMode) {
for (i = 0; i < gCamCount; i++) {
if (((gPlayer[playerNum].state_1C8 == PLAYERSTATE_1C8_ACTIVE) ||
(gPlayer[playerNum].state_1C8 == PLAYERSTATE_1C8_U_TURN)) &&
if (((gPlayer[playerNum].state == PLAYERSTATE_ACTIVE) ||
(gPlayer[playerNum].state == PLAYERSTATE_U_TURN)) &&
(gVsLockOnTimers[i][playerNum] != 0)) {
return false;
}
@@ -3321,7 +3320,7 @@ bool Player_UpdateLockOn(Player* player) {
Object_PlayerSfx(player->sfxSource, NA_SE_LOCK_SEARCH, player->num);
}
if (!((gInputHold->button & R_TRIG) && (gInputHold->button & Z_TRIG) && (player->form == FORM_ARWING) &&
(player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) &&
(player->state == PLAYERSTATE_ACTIVE)) &&
((gGameFrameCount % 4) == 0) && Player_CanLockOn(player->num)) {
if (gChargeTimers[player->num] > 20) {
for (i = 0; i < 13; i++) { // bug? should be 11
@@ -3673,7 +3672,7 @@ void Player_CheckBounds360(Player* player) {
var_fv1 = 100000.0f;
}
if ((var_fv1 < fabsf(player->pos.x)) || (var_fv1 < fabsf(player->pos.z))) {
player->state_1C8 = PLAYERSTATE_1C8_U_TURN;
player->state = PLAYERSTATE_U_TURN;
player->unk_19C = 0;
player->csState = 0;
player->unk_000 = 0.0f;
@@ -4721,7 +4720,7 @@ void Player_Setup(Player* playerx) {
Camera_Update360(player, true);
}
player->state_1C8 = PLAYERSTATE_1C8_ACTIVE;
player->state = PLAYERSTATE_ACTIVE;
player->wingPosition = gLevelType;
if ((gLevelMode == LEVELMODE_ALL_RANGE) && !gVersusMode) {
@@ -4755,7 +4754,7 @@ void Player_Setup(Player* playerx) {
switch (gCurrentLevel) {
case LEVEL_CORNERIA:
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_INTRO;
player->state = PLAYERSTATE_LEVEL_INTRO;
player->wingPosition = 1;
gGroundSurface = gSavedGroundSurface = SURFACE_WATER;
Play_dummy_MuteSfx();
@@ -4777,10 +4776,10 @@ void Player_Setup(Player* playerx) {
case LEVEL_KATINA:
case LEVEL_SECTOR_Z:
case LEVEL_VENOM_2:
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_INTRO;
player->state = PLAYERSTATE_LEVEL_INTRO;
break;
case LEVEL_METEO:
player->state_1C8 = PLAYERSTATE_1C8_LEVEL_INTRO;
player->state = PLAYERSTATE_LEVEL_INTRO;
break;
}
} else {
@@ -4805,7 +4804,7 @@ void Player_Setup(Player* playerx) {
}
}
if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) {
if (player->state == PLAYERSTATE_LEVEL_INTRO) {
player->draw = true;
switch (gCurrentLevel) {
case LEVEL_CORNERIA:
@@ -4885,7 +4884,7 @@ void Player_Setup(Player* playerx) {
Display_SetupPlayerSfxPos(player);
if (!gVersusMode && (((gCurrentLevel != LEVEL_TITANIA) && (gCurrentLevel != LEVEL_SOLAR)) || gVersusMode ||
(player->state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO))) {
(player->state != PLAYERSTATE_LEVEL_INTRO))) {
Audio_StartPlayerNoise(gPlayerNum);
}
@@ -5055,7 +5054,7 @@ void Player_UpdateTankRoll(Player* player) {
void Player_ArwingBoost(Player* player) {
f32 sp2C;
f32 sp28;
s32 var;
s32 stickY;
if ((player->boostMeter != 0.0f) && (gInputHold->button & gBrakeButton[player->num]) &&
(gInputHold->button & gBoostButton[player->num])) {
@@ -5073,7 +5072,8 @@ void Player_ArwingBoost(Player* player) {
player->sfx.boost = 0;
var = gInputPress->stick_y; // fake?
stickY = gInputPress->stick_y; // fake?
if (gLoopDownTimers[gPlayerNum] != 0) {
gLoopDownTimers[gPlayerNum]--;
}
@@ -5082,7 +5082,7 @@ void Player_ArwingBoost(Player* player) {
gLoopBoostTimers[gPlayerNum]--;
}
if (!player->somersault && (gDrawBackdrop < 5)) {
if (var >= -50) {
if (stickY >= -50) {
gLoopDownTimers[gPlayerNum] = 5;
}
if ((gLoopDownTimers[gPlayerNum] > 0) && (gLoopDownTimers[gPlayerNum] < 5) &&
@@ -5131,7 +5131,7 @@ void Player_ArwingBoost(Player* player) {
}
}
if ((gInputHold->button & gBoostButton[player->num]) && !(gInputHold->button & gBrakeButton[player->num]) &&
(player->state_1C8 != PLAYERSTATE_1C8_U_TURN) && !player->boostCooldown) {
(player->state != PLAYERSTATE_U_TURN) && !player->boostCooldown) {
if (player->boostMeter == 0.0f) {
Player_PlaySfx(player->sfxSource, NA_SE_ARWING_BOOST, player->num);
player->unk_194 = 5.0f;
@@ -5218,7 +5218,7 @@ void Player_ArwingBrake(Player* player) {
(gUturnBrakeTimers[gPlayerNum] != 0)) {
gUturnDownTimers[gPlayerNum] = 0;
gUturnBrakeTimers[gPlayerNum] = 0;
player->state_1C8 = PLAYERSTATE_1C8_U_TURN;
player->state = PLAYERSTATE_U_TURN;
player->csState = 0;
player->unk_19C = 1;
player->unk_000 = 0.0f;
@@ -5231,7 +5231,7 @@ void Player_ArwingBrake(Player* player) {
}
if ((gInputHold->button & gBrakeButton[player->num]) && !(gInputHold->button & gBoostButton[player->num]) &&
(player->state_1C8 != PLAYERSTATE_1C8_U_TURN) && !player->boostCooldown) {
(player->state != PLAYERSTATE_U_TURN) && !player->boostCooldown) {
if (player->boostMeter == 0.0f) {
Player_PlaySfx(player->sfxSource, NA_SE_ARWING_BRAKE, player->num);
if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gInputPress->button & gBrakeButton[player->num])) {
@@ -5513,7 +5513,7 @@ void Player_UpdateEffects(Player* player) {
if (player->form == FORM_ARWING) {
player->damageShake =
SIN_DEG(player->hitTimer * 400.0f) * player->hitTimer * D_800D3164[player->hitDirection];
if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
if (player->state == PLAYERSTATE_ACTIVE) {
player->xShake =
SIN_DEG(player->hitTimer * 400.0f) * player->hitTimer * D_800D3164[player->hitDirection] * 0.8f;
}
@@ -5606,7 +5606,8 @@ void Play_dummy_800B41E0(Player* player) {
}
void Player_Down(Player* player) {
player->state_1C8 = PLAYERSTATE_1C8_DOWN;
player->state = PLAYERSTATE_DOWN;
if (!gVersusMode) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1);
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1);
@@ -5622,7 +5623,7 @@ void Player_Down(Player* player) {
player->hitTimer = 0;
player->radioDamageTimer = 0;
player->damageShake = 0.0f;
gShowHud = 0;
gShowHud = false;
}
void Player_UpdateOnRails(Player* player) {
@@ -5760,7 +5761,7 @@ void Player_Update360(Player* player) {
void Player_LowHealthMsg(Player* player) {
s32 teamId;
if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gTeamLowHealthMsgTimer >= 0)) {
if ((player->state == PLAYERSTATE_ACTIVE) && (gTeamLowHealthMsgTimer >= 0)) {
gTeamLowHealthMsgTimer++;
if (gTeamLowHealthMsgTimer > 32 * 30) {
gTeamLowHealthMsgTimer = 0;
@@ -5832,13 +5833,13 @@ void Player_Update(Player* player) {
*gControllerRumble = 1;
}
}
if (player->state_1C8 > PLAYERSTATE_1C8_INIT) {
if (player->state > PLAYERSTATE_INIT) {
Player_UpdateEffects(player);
}
player->flags_228 = 0;
if ((player->state_1C8 > PLAYERSTATE_1C8_INIT) && (player->form == FORM_ARWING) && !gVersusMode) {
if ((player->state > PLAYERSTATE_INIT) && (player->form == FORM_ARWING) && !gVersusMode) {
switch (player->wingPosition) {
case 0:
sp1C4 = Animation_GetFrameData(&D_arwing_3015AF4, 0, sp58);
@@ -5858,28 +5859,28 @@ void Player_Update(Player* player) {
player->whooshTimer--;
}
switch (player->state_1C8) {
case PLAYERSTATE_1C8_STANDBY:
switch (player->state) {
case PLAYERSTATE_STANDBY:
player->draw = false;
gShowHud = 0;
gShowHud = false;
gPauseEnabled = false;
break;
case PLAYERSTATE_1C8_INIT:
case PLAYERSTATE_INIT:
Player_Setup(player);
gFillScreenAlphaTarget = 0;
gPauseEnabled = false;
break;
case PLAYERSTATE_1C8_LEVEL_INTRO:
gShowHud = 0;
case PLAYERSTATE_LEVEL_INTRO:
gShowHud = false;
gPauseEnabled = false;
player->arwing.drawFace = true;
Cutscene_LevelStart(player);
break;
case PLAYERSTATE_1C8_ACTIVE:
gShowHud = 1;
case PLAYERSTATE_ACTIVE:
gShowHud = true;
Player_LowHealthMsg(player);
player->arwing.drawFace = false;
D_hud_80161704 = 255;
@@ -5914,7 +5915,7 @@ void Player_Update(Player* player) {
sp1C4 = RAND_INT(3.9f);
} while (gPlayerInactive[sp1C4]);
player->attacker = sp1C4 + 1;
player->state_1C8 = PLAYERSTATE_1C8_VS_STANDBY;
player->state = PLAYERSTATE_VS_STANDBY;
player->csState = 0;
Camera_FollowPlayer(player, player->attacker - 1, 1);
} else {
@@ -5943,11 +5944,11 @@ void Player_Update(Player* player) {
}
break;
case PLAYERSTATE_1C8_DOWN:
case PLAYERSTATE_DOWN:
Cutscene_PlayerDown(player);
break;
case PLAYERSTATE_1C8_U_TURN:
case PLAYERSTATE_U_TURN:
if (gVersusMode) {
gVsLockOnTimers[player->num][0] = gVsLockOnTimers[player->num][1] = gVsLockOnTimers[player->num][2] =
gVsLockOnTimers[player->num][3] = 0;
@@ -5969,7 +5970,8 @@ void Player_Update(Player* player) {
Player_CheckItemCollect(player);
}
break;
case PLAYERSTATE_1C8_LEVEL_COMPLETE:
case PLAYERSTATE_LEVEL_COMPLETE:
player->alternateView = false;
gPauseEnabled = false;
Player_UpdateShields(player);
@@ -5978,14 +5980,14 @@ void Player_Update(Player* player) {
gShowHud = gChargeTimers[player->num] = 0;
break;
case PLAYERSTATE_1C8_ENTER_WARP_ZONE:
case PLAYERSTATE_ENTER_WARP_ZONE:
gPauseEnabled = false;
Player_UpdateShields(player);
Cutscene_EnterWarpZone(player);
gShowHud = 0;
gShowHud = false;
break;
case PLAYERSTATE_1C8_START_360:
case PLAYERSTATE_START_360:
gPauseEnabled = false;
Player_UpdateShields(player);
Cutscene_AllRangeMode(player);
@@ -5993,21 +5995,21 @@ void Player_Update(Player* player) {
gChargeTimers[player->num] = player->alternateView = gShowHud = 0;
break;
case PLAYERSTATE_1C8_GFOX_REPAIR:
case PLAYERSTATE_GFOX_REPAIR:
gPauseEnabled = false;
AllRange_GreatFoxRepair(player);
gShowHud = 0;
gShowHud = false;
break;
case PLAYERSTATE_1C8_ANDROSS_MOUTH:
case PLAYERSTATE_ANDROSS_MOUTH:
Andross_8018C390(player);
Player_UpdateShields(player);
break;
case PLAYERSTATE_1C8_12:
case PLAYERSTATE_UNK_12:
break;
case PLAYERSTATE_1C8_VS_STANDBY:
case PLAYERSTATE_VS_STANDBY:
player->draw = false;
if (gPlayerInactive[player->num] == true) {
Camera_FollowPlayer(player, player->attacker - 1, 0);
@@ -6027,8 +6029,8 @@ void Player_Update(Player* player) {
}
break;
case PLAYERSTATE_1C8_NEXT:
gShowHud = 0;
case PLAYERSTATE_NEXT:
gShowHud = false;
if (!gVersusMode) {
gPauseEnabled = false;
@@ -6048,7 +6050,7 @@ void Player_Update(Player* player) {
}
if (player->csTimer == 0) {
if (gCamCount == 4) {
player->state_1C8 = PLAYERSTATE_1C8_VS_STANDBY;
player->state = PLAYERSTATE_VS_STANDBY;
player->csTimer = 200;
} else {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0;
@@ -6126,7 +6128,7 @@ void Player_Update(Player* player) {
Math_SmoothStepToF(&player->pathWidth, sp1C8, 1.0f, 10.0f, 0.0f);
if (player->form == FORM_ARWING) {
Math_SmoothStepToF(&player->unk_194, player->unk_190, 0.5f, 5.0f, 0.0f);
if (player->boostCooldown && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) {
if (player->boostCooldown && (gPlayer[0].state == PLAYERSTATE_ACTIVE)) {
player->unk_190 = 0.5f;
} else {
player->unk_190 = 1.0f;
@@ -6144,14 +6146,15 @@ void Camera_UpdateArwingOnRails(Player* player) {
f32 temp;
gCsCamEyeX = (player->pos.x - player->xPath) * player->unk_148;
if (((player->form == FORM_ARWING) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) ||
(player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
if (((player->form == FORM_ARWING) && (player->state == PLAYERSTATE_ACTIVE)) ||
(player->state == PLAYERSTATE_U_TURN)) {
gCsCamEyeY = (player->pos.y - player->yPath) * player->unk_148;
}
var_fv1 = gInputPress->stick_x;
var_fv0 = -gInputPress->stick_y;
if ((player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) || player->somersault) {
if ((player->state != PLAYERSTATE_ACTIVE) || player->somersault) {
var_fv0 = 0.0f;
var_fv1 = 0;
}
@@ -6266,7 +6269,7 @@ void Camera_FollowPlayer(Player* player, s32 playerNum, bool arg2) {
if (((gGameFrameCount & mask) == (gPlayerNum * 32)) || arg2) {
for (i = 0; i < 100; i++) {
playerNum = RAND_INT(3.9f);
if ((gPlayer[playerNum].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) && !gPlayerInactive[playerNum]) {
if ((gPlayer[playerNum].state != PLAYERSTATE_VS_STANDBY) && !gPlayerInactive[playerNum]) {
break;
}
}
@@ -6373,7 +6376,7 @@ void Camera_UpdateArwing360(Player* player, bool arg1) {
var_fv0 = (player->somersault) ? 1.0f : 0.79f;
atY = (player->pos.y * (var_fv0)) + player->damageShake + (player->xRock * 5.0f);
atY += (player->unk_02C * 0.5f);
if (player->state_1C8 == PLAYERSTATE_1C8_U_TURN) {
if (player->state == PLAYERSTATE_U_TURN) {
atY = player->pos.y;
}
atZ = player->pos.z;
@@ -6390,7 +6393,8 @@ void Camera_UpdateArwing360(Player* player, bool arg1) {
eyeZ += sp68.z;
atX += sp68.x;
atZ += sp68.z;
if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) {
if (player->state == PLAYERSTATE_ACTIVE) {
Math_SmoothStepToF(&player->cam.eye.x, eyeX, player->unk_014, 30000.0f, 0);
Math_SmoothStepToF(&player->cam.eye.y, eyeY, player->unk_014, 30000.0f, 0);
Math_SmoothStepToF(&player->cam.eye.z, eyeZ, player->unk_014, 30000.0f, 0);
@@ -6564,8 +6568,7 @@ void Camera_SetStarfieldPos(f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32
gStarfieldX = FloatMod(sp34, starfieldWidth);
gStarfieldY = FloatMod(sp30, starfieldHeight);
// Special case handling for specific game state and level
if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) &&
(gCurrentLevel == LEVEL_METEO)) {
if (fabsf(gStarfieldX - sp20) < 50.0f) {
D_bg_8015F96C = 0.0f;
@@ -6591,8 +6594,8 @@ void Camera_Update360(Player* player, bool arg1) {
}
void Camera_Update(Player* player) {
switch (player->state_1C8) {
case PLAYERSTATE_1C8_ACTIVE:
switch (player->state) {
case PLAYERSTATE_ACTIVE:
switch (gLevelMode) {
case LEVELMODE_ON_RAILS:
if (player->form == FORM_ARWING) {
@@ -6618,12 +6621,12 @@ void Camera_Update(Player* player) {
}
break;
case PLAYERSTATE_1C8_U_TURN:
case PLAYERSTATE_U_TURN:
player->camRoll -= player->camRoll * 0.1f;
Camera_Update360(player, false);
break;
case PLAYERSTATE_1C8_DOWN:
case PLAYERSTATE_DOWN:
if ((gLevelMode == LEVELMODE_ON_RAILS) && (player->form == FORM_ARWING)) {
player->cam.eye.x += (player->pos.x - player->cam.eye.x) * 0.1f;
player->cam.eye.y += (player->pos.y - player->cam.eye.y) * 0.1f;
@@ -6636,8 +6639,9 @@ void Camera_Update(Player* player) {
player->cam.at.z = player->trueZpos + gPathProgress - 1.0f;
}
break;
case PLAYERSTATE_1C8_NEXT:
case PLAYERSTATE_1C8_LEVEL_COMPLETE:
case PLAYERSTATE_NEXT:
case PLAYERSTATE_LEVEL_COMPLETE:
break;
}
}
@@ -6647,7 +6651,7 @@ void Camera_SetupLights(Player* player) {
Vec3f dest;
f32 pad;
if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) {
if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state != PLAYERSTATE_LEVEL_INTRO)) {
gEnvLightyRot = gLight1yRotTarget = gLight1yRotTarget = gLight2yRotTarget = gLight1yRotTarget = 110.0f;
if ((gGameFrameCount & 0x20) != 0) {
gEnvLightyRot = gLight1yRotTarget = gLight1yRotTarget = gLight2yRotTarget = gLight1yRotTarget = 90.0f;
@@ -6777,8 +6781,8 @@ void Play_UpdateLevel(void) {
break;
case LEVEL_VENOM_2:
if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gLevelPhase == 2)) {
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE;
if ((gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE) && (gLevelPhase == 2)) {
gPlayer[0].state = PLAYERSTATE_LEVEL_COMPLETE;
gPlayer[0].csState = 0;
gPlayer[0].draw = true;
gPlayer[0].pos.z = 15000.0f;
@@ -6810,7 +6814,7 @@ void Play_UpdateLevel(void) {
case LEVEL_SECTOR_X:
if (gLevelPhase == 1) {
gBlurAlpha = 128;
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state == PLAYERSTATE_LEVEL_COMPLETE) {
Math_SmoothStepToF(&gWarpZoneBgAlpha, 0.0f, 1.0f, 1.0f, 0.0f);
} else {
Math_SmoothStepToF(&gWarpZoneBgAlpha, 128.0f, 1.0f, 1.0f, 0.0f);
@@ -6819,7 +6823,7 @@ void Play_UpdateLevel(void) {
if ((gCurrentLevel == LEVEL_SECTOR_X) && (gLevelPhase == 0) && (gRingPassCount == 4)) {
gRingPassCount++;
gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE;
gPlayer[0].state = PLAYERSTATE_ENTER_WARP_ZONE;
gPlayer[0].csState = 0;
gSceneSetup = 1;
AUDIO_PLAY_SFX(NA_SE_WARP_HOLE, gDefaultSfxSource, 0);
@@ -6845,7 +6849,7 @@ void Play_UpdateLevel(void) {
for (gPathTexScroll; gPathTexScroll >= 10.0f; gPathTexScroll -= 10.0f) {
Lib_Texture_Scroll(D_SO_6005710, 32, 32, 1);
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) {
if (gPlayer[0].state == PLAYERSTATE_NEXT) {
Lib_Texture_Scroll(D_SO_6005710, 32, 32, 1);
}
Lib_Texture_Mottle(D_SO_601E1E8, D_SO_6020F60, 3);
@@ -6875,7 +6879,7 @@ void Play_UpdateLevel(void) {
#endif
}
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && ((gGameFrameCount & cycleMask) == 0)) {
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && ((gGameFrameCount & cycleMask) == 0)) {
gPlayer[0].shields--;
if (gPlayer[0].shields <= 0) {
gPlayer[0].shields = 0;
@@ -6893,7 +6897,7 @@ void Play_UpdateLevel(void) {
Audio_SetHeatAlarmParams(shields, heightParam);
if (((gGameFrameCount % 8) == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) {
if (((gGameFrameCount % 8) == 0) && (gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE)) {
Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -80.0f,
gPlayer[0].trueZpos + (RAND_FLOAT(2000.0f) + -6000.0f),
RAND_FLOAT(10.0f) + 20.0f); // check
@@ -6911,7 +6915,7 @@ void Play_UpdateLevel(void) {
for (gPathTexScroll; gPathTexScroll >= 20.0f; gPathTexScroll -= 20.0f) {
Lib_Texture_Scroll(D_ZO_602C2CC, 32, 32, 1);
}
if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) {
if (gPlayer[0].state == PLAYERSTATE_NEXT) {
Lib_Texture_Scroll(D_ZO_602C2CC, 32, 32, 1);
}
@@ -7094,7 +7098,7 @@ void Play_Main(void) {
Play_Update();
if ((gControllerPress[gMainController].button & START_BUTTON) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) &&
(gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) &&
gSaveFile.save.data.planet[sSaveSlotFromLevel[gCurrentLevel]].normalClear) {
Audio_ClearVoice();
Audio_SetEnvSfxReverb(0);
@@ -7127,7 +7131,7 @@ void Play_Main(void) {
case PLAY_PAUSE:
if (!gVersusMode) {
if ((gControllerPress[gMainController].button & R_TRIG) && (gPlayer[0].form != FORM_BLUE_MARINE) &&
(gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) {
(gPlayer[0].state != PLAYERSTATE_STANDBY)) {
if (gShowReticles[0] = 1 - gShowReticles[0]) {
AUDIO_PLAY_SFX(NA_SE_MAP_WINDOW_OPEN, gDefaultSfxSource, 4);
} else {
+2 -1
View File
@@ -757,7 +757,7 @@ void Radio_Draw(void) {
}
if ((gActors[idx].obj.status != OBJ_ACTIVE) && (gGameFrameCount & 4) &&
(gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gCurrentRadioPortrait != RCID_STATIC) &&
(gPlayer[0].state == PLAYERSTATE_ACTIVE) && (gCurrentRadioPortrait != RCID_STATIC) &&
(gCurrentRadioPortrait != RCID_STATIC + 1) && (gCurrentRadioPortrait != RCID_1000)) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
@@ -779,6 +779,7 @@ void Radio_Draw(void) {
}
}
// Unused in VERSION_US and absent in VERSION_EU, probably a leftover from VERSION_JP ?
void func_radio_800BC040(void) {
if (gPlayState != PLAY_PAUSE) {
if (gRadioStateTimer > 0) {
+120 -19
View File
@@ -1,27 +1,128 @@
#include "global.h"
SaveFile gSaveFile;
// clang-format off
Save gDefaultSave = {
{
// Replace with SaveData once that struct is complete
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x02, 0x03, 0x04, 0x00, 0x63, 0x63, 0x63, 0x46, 0x4F, 0x58, 0x50, 0x45, 0x50, 0x53, 0x4C, 0x50, 0x46,
0x41, 0x4C, 0x57, 0x4C, 0x46, 0x4C, 0x4F, 0x4E, 0x50, 0x49, 0x47, 0x41, 0x4E, 0x52, 0x42, 0x49, 0x4C,
0x4B, 0x41, 0x54, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x90, 0x09, 0x57, 0x09, 0xB7, 0x09, 0x87,
0x09, 0x37, 0x09, 0x17, 0x09, 0xF7, 0x5A, 0x90, 0x09, 0x54, 0x09, 0x64, 0x09, 0xD4, 0x09, 0x74, 0x09,
0x14, 0x09, 0xF4, 0x50, 0x90, 0x09, 0x02, 0x09, 0xC2, 0x09, 0x42, 0x09, 0xA2, 0x09, 0x22, 0x09, 0xE2,
0x46, 0x90, 0x09, 0x01, 0x09, 0xC1, 0x09, 0x41, 0x09, 0xA1, 0x09, 0x21, 0x09, 0xE1, 0x3C, 0x90, 0x09,
0x05, 0x09, 0xC5, 0x09, 0x45, 0x09, 0xA5, 0x09, 0x25, 0x09, 0xE5, 0x32, 0x90, 0x04, 0x03, 0x09, 0xC3,
0x09, 0x43, 0x09, 0xA3, 0x09, 0x23, 0x09, 0xE3, 0x28, 0x90, 0x01, 0x06, 0x02, 0xC6, 0x09, 0x46, 0x09,
0xA6, 0x09, 0x26, 0x09, 0xE6, 0x1E, 0x90, 0x01, 0x02, 0x01, 0xC4, 0x01, 0x47, 0x08, 0xA5, 0x09, 0x23,
0x09, 0xE6, 0x14, 0x90, 0x01, 0x03, 0x01, 0xC5, 0x01, 0x47, 0x01, 0xA4, 0x06, 0x22, 0x09, 0xE1, 0x0A,
0x90, 0x01, 0x07, 0x01, 0xC4, 0x01, 0x44, 0x01, 0xA2, 0x01, 0x21, 0x04, 0xE5, 0xFF, 0x09, 0x01, 0x02,
0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
},
0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // PlanetData
0x01, 0x02, 0x03, 0x04, // pad10
SOUNDMODE_STEREO,
99, // musicVolume
99, // voiceVolume
99, // sfxVolume
// rankNameEntry
'F', 'O', 'X',
'P', 'E', 'P',
'S', 'L', 'P',
'F', 'A', 'L',
'W', 'L', 'F',
'L', 'O', 'N',
'P', 'I', 'G',
'A', 'N', 'R',
'B', 'I', 'L',
'K', 'A', 'T',
// rankingRoute
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// rankingLives
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// rankingMedal
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// stats
PLANET_STATS(100, PLANET_CORNERIA, false, false, false),
PLANET_STATS(9, PLANET_SECTOR_Y, true, true, true),
PLANET_STATS(9, PLANET_AQUAS, true, true, true),
PLANET_STATS(9, PLANET_ZONESS, true, true, true),
PLANET_STATS(9, PLANET_SECTOR_Z, true, true, true),
PLANET_STATS(9, PLANET_AREA_6, true, true, true),
PLANET_STATS(9, SAVE_SLOT_VENOM_2, true, true, true),
PLANET_STATS(90, PLANET_CORNERIA, false, false, false),
PLANET_STATS(9, PLANET_SECTOR_Y, true, false, false),
PLANET_STATS(9, PLANET_KATINA, true, false, false),
PLANET_STATS(9, PLANET_VENOM, true, false, false),
PLANET_STATS(9, PLANET_MACBETH, true, false, false),
PLANET_STATS(9, PLANET_AREA_6, true, false, false),
PLANET_STATS(9, SAVE_SLOT_VENOM_2, true, false, false),
PLANET_STATS(80, PLANET_CORNERIA, false, false, false),
PLANET_STATS(9, PLANET_METEO, false, true, false),
PLANET_STATS(9, PLANET_FORTUNA, false, true, false),
PLANET_STATS(9, PLANET_SECTOR_X, false, true, false),
PLANET_STATS(9, PLANET_TITANIA, false, true, false),
PLANET_STATS(9, PLANET_BOLSE, false, true, false),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, false, true, false),
PLANET_STATS(70, PLANET_CORNERIA, false, false, false),
PLANET_STATS(9, PLANET_METEO, false, false, true),
PLANET_STATS(9, PLANET_FORTUNA, false, false, true),
PLANET_STATS(9, PLANET_SECTOR_X, false, false, true),
PLANET_STATS(9, PLANET_TITANIA, false, false, true),
PLANET_STATS(9, PLANET_BOLSE, false, false, true),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, false, false, true),
PLANET_STATS(60, PLANET_CORNERIA, false, false, false),
PLANET_STATS(9, PLANET_METEO, true, false, true),
PLANET_STATS(9, PLANET_FORTUNA, true, false, true),
PLANET_STATS(9, PLANET_SECTOR_X, true, false, true),
PLANET_STATS(9, PLANET_TITANIA, true, false, true),
PLANET_STATS(9, PLANET_BOLSE, true, false, true),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, true, false, true),
PLANET_STATS(50, PLANET_CORNERIA, false, false, false),
PLANET_STATS(4, PLANET_METEO, false, true, true),
PLANET_STATS(9, PLANET_FORTUNA, false, true, true),
PLANET_STATS(9, PLANET_SECTOR_X, false, true, true),
PLANET_STATS(9, PLANET_TITANIA, false, true, true),
PLANET_STATS(9, PLANET_BOLSE, false, true, true),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, false, true, true),
PLANET_STATS(40, PLANET_CORNERIA, false, false, false),
PLANET_STATS(1, PLANET_METEO, true, true, false),
PLANET_STATS(2, PLANET_FORTUNA, true, true, false),
PLANET_STATS(9, PLANET_SECTOR_X, true, true, false),
PLANET_STATS(9, PLANET_TITANIA, true, true, false),
PLANET_STATS(9, PLANET_BOLSE, true, true, false),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, true, true, false),
PLANET_STATS(30, PLANET_CORNERIA, false, false, false),
PLANET_STATS(1, PLANET_METEO, false, true, false),
PLANET_STATS(1, PLANET_FORTUNA, true, false, false),
PLANET_STATS(1, PLANET_SECTOR_X, true, true, true),
PLANET_STATS(8, PLANET_TITANIA, true, false, true),
PLANET_STATS(9, PLANET_BOLSE, false, true, true),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, true, true, false),
PLANET_STATS(20, PLANET_CORNERIA, false, false, false),
PLANET_STATS(1, PLANET_METEO, false, true, true),
PLANET_STATS(1, PLANET_FORTUNA, true, false, true),
PLANET_STATS(1, PLANET_SECTOR_X, true, true, true),
PLANET_STATS(1, PLANET_TITANIA, true, false, false),
PLANET_STATS(6, PLANET_BOLSE, false, true, false),
PLANET_STATS(9, SAVE_SLOT_VENOM_1, false, false, true),
PLANET_STATS(10, PLANET_CORNERIA, false, false, false),
PLANET_STATS(1, PLANET_METEO, true, true, true),
PLANET_STATS(1, PLANET_FORTUNA, true, false, false),
PLANET_STATS(1, PLANET_SECTOR_X, true, false, false),
PLANET_STATS(1, PLANET_TITANIA, false, true, false),
PLANET_STATS(1, PLANET_BOLSE, false, false, true),
PLANET_STATS(4, SAVE_SLOT_VENOM_1, true, false, true),
// unk_EA
0xFF,
// padding
0x09, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
};
// clang-format on
u16 Save_Checksum(Save* arg0) {
u16 var_v1;
+8 -3
View File
@@ -229,10 +229,12 @@ void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable,
Matrix_Push(&gCalcMatrix);
Matrix_Copy(gCalcMatrix, transform);
skeleton = LOAD_ASSET(skeletonSegment);
skeleton = SEGMENTED_TO_VIRTUAL(skeletonSegment);
rootLimb = SEGMENTED_TO_VIRTUAL(skeleton[0]);
rootIndex = Animation_GetLimbIndex(skeleton[0], skeleton);
baseRot = jointTable[rootIndex];
if (mode & 1) {
baseTrans.x = rootLimb->trans.x;
baseTrans.y = rootLimb->trans.y;
@@ -242,6 +244,7 @@ void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable,
baseTrans.y = jointTable[0].y;
baseTrans.z = jointTable[0].z;
}
dList = rootLimb->dList;
Matrix_Push(&gGfxMatrix);
@@ -249,11 +252,11 @@ void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable,
FrameInterpolation_RecordOpenChild(TAG_LIMB(rootLimb, data), rootIndex);
if (overrideLimbDraw == NULL) {
override = 0;
override = false;
} else {
override = overrideLimbDraw(rootIndex - 1, &dList, &baseTrans, &baseRot, data);
}
if (override == 0) {
if (!override) {
Matrix_Translate(gCalcMatrix, baseTrans.x, baseTrans.y, baseTrans.z, MTXF_APPLY);
Matrix_RotateZ(gCalcMatrix, baseRot.z * M_DTOR, MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, baseRot.y * M_DTOR, MTXF_APPLY);
@@ -272,10 +275,12 @@ void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable,
FrameInterpolation_RecordCloseChild();
Matrix_Pop(&gGfxMatrix);
if (rootLimb->child != NULL) {
Animation_DrawLimb(mode, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, data);
}
Matrix_Pop(&gCalcMatrix);
if (mode >= 2) {
Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY);
}
+4 -3
View File
@@ -490,7 +490,7 @@ void func_tank_80044868(Player* player) {
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)) {
if ((gCurrentLevel == LEVEL_MACBETH) && (player->state == PLAYERSTATE_LEVEL_COMPLETE)) {
// Using D_TI_6009BB8 since it's the same texture, D_Tex_800DACB8 might be imported incorrectly.
func_tank_80043280(D_landmaster_3005EA8, /* D_Tex_800DACB8 */ D_TI_6009BB8, gGameFrameCount * -55.0f);
}
@@ -1305,7 +1305,7 @@ void func_tank_80047FBC(Player* player) {
if (!(D_800C9F08 & 1)) {
Math_SmoothStepToF(&player->rot.z, -((player->vel.z / 5.0f) * 4.0f), 0.4f, 8.0f, 0.01f);
if (player->rot.z >= 3.0f) {
if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) {
if (gPlayer[0].state != PLAYERSTATE_LEVEL_COMPLETE) {
AUDIO_PLAY_SFX(NA_SE_RAILWAY_BOUND, player->sfxSource, 0);
}
D_800C9F08 |= 1;
@@ -1471,7 +1471,8 @@ void func_tank_800481F4(Player* player) {
actor->obj.rot.y, actor->obj.rot.z, 0.0f, 0.0f, 0.0f);
if (temp_v0 != 0) {
actor->dmgType = DMG_COLLISION;
if ((actor->obj.id == OBJ_ACTOR_TI_LANDMINE) || (actor->obj.id == OBJ_MISSILE_SEEK_TEAM)) {
if ((actor->obj.id == OBJ_ACTOR_TI_LANDMINE) ||
(actor->obj.id == OBJ_ACTOR_MISSILE_SEEK_TEAM)) {
actor->dmgType = -1;
}
if (actor->info.damage) {
+11 -12
View File
@@ -267,7 +267,7 @@ void func_versus_800BDE44(void) {
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255);
for (i = 0; i < 4; i++) {
if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_U_TURN)) {
if ((gPlayer[i].state == PLAYERSTATE_ACTIVE) || (gPlayer[i].state == PLAYERSTATE_U_TURN)) {
if ((gPlayerScores[i] != sVsDisplayedScores[i]) || (D_80178810[i] != 0)) {
D_80178810[i] += 4;
if (D_80178810[i] > 15) {
@@ -590,7 +590,7 @@ s32 Versus_UpdatePlayerStatus(void) {
for (i = 0, ret = 0; i < 4; i++) {
D_80178850[i] = true;
if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) {
if (gPlayer[i].state != PLAYERSTATE_VS_STANDBY) {
D_80178850[i] = false;
sPlayerRespawnTimer[i] = 150;
continue;
@@ -714,7 +714,7 @@ void func_versus_800BF750(void) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76);
for (i = 0; i < 4; i++) {
if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_ACTIVE) {
if (gPlayer[i].state != PLAYERSTATE_ACTIVE) {
continue;
}
for (j = 0, temp = 0; j < 4; j++) {
@@ -737,10 +737,10 @@ bool Versus_CheckForWinner(void) {
switch (gVsMatchType) {
case VS_MATCH_POINTS:
for (i = 0, numDown = 0; i < 4; i++) {
if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) {
if (gPlayer[i].state != PLAYERSTATE_VS_STANDBY) {
sVsWinner = i;
}
if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) {
if (gPlayer[i].state == PLAYERSTATE_VS_STANDBY) {
numDown++;
}
}
@@ -772,7 +772,7 @@ bool Versus_CheckForWinner(void) {
if (gPlayer[j].attacker >= 0) {
gPlayer[j].attacker = i + 1;
}
gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY;
gPlayer[j].state = PLAYERSTATE_VS_STANDBY;
}
gVsMatchWon = true;
sVsWinner = i;
@@ -781,10 +781,10 @@ bool Versus_CheckForWinner(void) {
case VS_MATCH_BATTLE:
for (i = 0, numDown = 0; i < 4; i++) {
if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) {
if (gPlayer[i].state != PLAYERSTATE_VS_STANDBY) {
sVsWinner = i;
}
if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) {
if (gPlayer[i].state == PLAYERSTATE_VS_STANDBY) {
numDown++;
}
}
@@ -811,7 +811,7 @@ bool Versus_CheckForWinner(void) {
if (gPlayer[j].attacker >= 0) {
gPlayer[j].attacker = i + 1;
}
gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY;
gPlayer[j].state = PLAYERSTATE_VS_STANDBY;
}
gVsMatchWon = true;
}
@@ -824,8 +824,7 @@ bool Versus_CheckForWinner(void) {
if (gVsMatchType == VS_MATCH_TIME) {
for (i = 0; i < 4; i++) {
if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) ||
(gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY)) {
if ((gPlayer[i].state == PLAYERSTATE_DOWN) || (gPlayer[i].state == PLAYERSTATE_VS_STANDBY)) {
gPlayerScores[i] = D_80178838[i] = sVsDisplayedScores[i] = D_80178810[i] = 0;
sPlayerDownFrames[i]++;
}
@@ -912,7 +911,7 @@ bool Versus_CheckForWinner(void) {
gPlayer[j].attacker = i + 1;
}
gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY;
gPlayer[j].state = PLAYERSTATE_VS_STANDBY;
}
gVsMatchWon = true;
break;