summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-06-10 23:37:43 +1000
committerGitHub <noreply@github.com>2023-06-10 09:37:43 -0400
commit8672dc0a57a7406cf6fd7b18dd8101563c9f63a8 (patch)
tree947c5ef601f6db4558c763615bfbf528f5f63f48 /src/code
parente19b1395043baede06bdab4faa2d3df3e93afa79 (diff)
Misc Cleanup 4 (#1271)
* begin next cleanup * more cleanup * climbAnim * more cleanup * more * quick, a few more before anyone looks * PR * another fix * table * another small cleanup * PR Suggestion
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_camera.c7
-rw-r--r--src/code/z_fireobj.c3
-rw-r--r--src/code/z_play.c33
-rw-r--r--src/code/z_sub_s.c2
4 files changed, 23 insertions, 22 deletions
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index ce09f7c4d..acb4af20a 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -1844,8 +1844,6 @@ void Camera_CalcDefaultSwing(Camera* camera, VecGeo* arg1, VecGeo* arg2, f32 arg
if (swing->unk_64 == 1) {
if (arg3 < (sp88 = OLib_Vec3fDist(at, &swing->collisionClosePoint))) {
- //! FAKE:
- dummy:;
swing->unk_64 = 0;
} else if ((sp88 = Math3D_SignedDistanceFromPlane(swing->eyeAtColChk.norm.x, swing->eyeAtColChk.norm.y,
swing->eyeAtColChk.norm.z, swing->eyeAtColChk.poly->dist,
@@ -6325,8 +6323,9 @@ s32 Camera_Demo4(Camera* camera) {
sCameraInterfaceFlags = roData->interfaceFlags;
switch (camera->animState) {
- //! FAKE:
- if (1) {}
+ default:
+ break;
+
case 0:
camera->animState++;
rwData->timer = 0;
diff --git a/src/code/z_fireobj.c b/src/code/z_fireobj.c
index 5565bc876..98d14874b 100644
--- a/src/code/z_fireobj.c
+++ b/src/code/z_fireobj.c
@@ -67,8 +67,7 @@ void FireObj_StepSize(FireObj* fire) {
if (Math_StepToF(&fire->dynamicSize, 1.0f, fire->dynamicSizeStep)) {
FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_FULLY_LIT);
}
- } else if ((fire->state == FIRE_STATE_SHRINKING) &&
- (Math_StepToF(&fire->dynamicSize, 0.0f, fire->dynamicSizeStep))) {
+ } else if ((fire->state == FIRE_STATE_SHRINKING) && Math_StepToF(&fire->dynamicSize, 0.0f, fire->dynamicSizeStep)) {
FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_NOT_LIT);
}
if (fire->sizeGrowsCos2 == 1) {
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 6ef734aee..9063c9151 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -1117,7 +1117,7 @@ void Play_PostWorldDraw(PlayState* this) {
}
#ifdef NON_MATCHING
-// Stack issues and 1 small issue around Play_PostWorldDraw
+// Something weird going on with the stack of the unused arg0 of `Camera_Update`
void Play_DrawMain(PlayState* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
Lights* sp268;
@@ -1270,7 +1270,7 @@ void Play_DrawMain(PlayState* this) {
if (!this->unk_18844) {
if (1) {
- if ((this->skyboxId != SKYBOX_NONE) && !this->envCtx.skyboxDisabled) {
+ if (((u32)this->skyboxId != SKYBOX_NONE) && !this->envCtx.skyboxDisabled) {
if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_3)) {
Environment_UpdateSkybox(this->skyboxId, &this->envCtx, &this->skyboxCtx);
Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, this->envCtx.skyboxBlend,
@@ -1306,10 +1306,11 @@ void Play_DrawMain(PlayState* this) {
if (this->skyboxCtx.skyboxShouldDraw) {
Vec3f sp78;
- if (1) {}
- Camera_GetQuakeOffset(&sp78, GET_ACTIVE_CAM(this));
- Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + sp78.x,
- this->view.eye.y + sp78.y, this->view.eye.z + sp78.z);
+ if (1) {
+ Camera_GetQuakeOffset(&sp78, GET_ACTIVE_CAM(this));
+ Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + sp78.x,
+ this->view.eye.y + sp78.y, this->view.eye.z + sp78.z);
+ }
}
// envCtx.precipitation[PRECIP_RAIN_CUR]
@@ -1370,9 +1371,8 @@ void Play_DrawMain(PlayState* this) {
Play_DrawMotionBlur(this);
- if (((R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_SETUP) ||
- (gTransitionTileState == TRANS_TILE_SETUP)) ||
- (R_PICTO_PHOTO_STATE == PICTO_PHOTO_STATE_SETUP)) {
+ if ((R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_SETUP) ||
+ (gTransitionTileState == TRANS_TILE_SETUP) || (R_PICTO_PHOTO_STATE == PICTO_PHOTO_STATE_SETUP)) {
Gfx* sp74;
Gfx* sp70 = POLY_OPA_DISP;
@@ -1405,15 +1405,18 @@ void Play_DrawMain(PlayState* this) {
POLY_OPA_DISP = sp74;
this->unk_18B49 = 2;
SREG(33) |= 1;
- } else {
- PostWorldDraw:
- if (1) {
- Play_PostWorldDraw(this);
- }
+ goto SkipPostWorldDraw;
+ }
+
+ PostWorldDraw:
+ if (1) {
+ Play_PostWorldDraw(this);
}
}
}
+SkipPostWorldDraw:
+
if ((this->view.unk164 != 0) && !gDbgCamEnabled) {
Vec3s sp4C;
@@ -1429,7 +1432,7 @@ void Play_DrawMain(PlayState* this) {
func_800FE3E0(this);
}
- CLOSE_DISPS(this->state.gfxCtx);
+ CLOSE_DISPS(gfxCtx);
}
#else
void Play_DrawMain(PlayState* this);
diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c
index 90d09a4b1..1c3f1ae3a 100644
--- a/src/code/z_sub_s.c
+++ b/src/code/z_sub_s.c
@@ -188,7 +188,7 @@ s32 SubS_UpdateLimb(s16 newRotZ, s16 newRotY, Vec3f* pos, Vec3s* rot, s32 stepRo
Matrix_MultVec3f(&zeroVec, &newPos);
Matrix_Get(&curState);
- Matrix_MtxFToYXZRot(&curState, &newRot, MTXMODE_NEW);
+ Matrix_MtxFToYXZRot(&curState, &newRot, false);
*pos = newPos;
if (!stepRot && !overrideRot) {