summaryrefslogtreecommitdiff
path: root/src/code/z_play.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-11-08 00:52:09 +1100
committerGitHub <noreply@github.com>2023-11-07 10:52:09 -0300
commitdfb6c5b02c1d0c201d7201aa4b0b121d3f2d5683 (patch)
tree527d0c5abc4d0e3b89a61e977848e5f47ba79a2b /src/code/z_play.c
parent28e2da2a18ddf1fc2dd81199e73eb18252684b43 (diff)
Struct Returns (#1466)
* change args * more funcs * cleanup * play cleanup * missed a file * weird warnings * missed some * fix func from honotrap
Diffstat (limited to 'src/code/z_play.c')
-rw-r--r--src/code/z_play.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 709b128ae..d2110c1e2 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -1129,10 +1129,10 @@ void Play_PostWorldDraw(PlayState* this) {
void Play_DrawMain(PlayState* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
- Lights* sp268;
+ Lights* lights;
Vec3f temp;
u8 sp25B = false;
- f32 var_fv0; // zFar
+ f32 zFar;
if (R_PAUSE_BG_PRERENDER_STATE >= PAUSE_BG_PRERENDER_UNK4) {
PreRender_ApplyFiltersSlowlyDestroy(&this->pauseBgPreRender);
@@ -1169,19 +1169,17 @@ void Play_DrawMain(PlayState* this) {
gSPSegment(OVERLAY_DISP++, 0x02, this->sceneSegment);
if (1) {
-
ShrinkWindow_Draw(gfxCtx);
POLY_OPA_DISP = Play_SetFog(this, POLY_OPA_DISP);
POLY_XLU_DISP = Play_SetFog(this, POLY_XLU_DISP);
- // zFar
- var_fv0 = this->lightCtx.zFar;
- if (var_fv0 > 12800.0f) {
- var_fv0 = 12800.0f;
+ zFar = this->lightCtx.zFar;
+ if (zFar > 12800.0f) {
+ zFar = 12800.0f;
}
- View_SetPerspective(&this->view, this->view.fovy, this->view.zNear, var_fv0);
+ View_SetPerspective(&this->view, this->view.fovy, this->view.zNear, zFar);
View_Apply(&this->view, 0xF);
@@ -1293,14 +1291,14 @@ void Play_DrawMain(PlayState* this) {
Environment_Draw(this);
}
- sp268 = LightContext_NewLights(&this->lightCtx, gfxCtx);
+ lights = LightContext_NewLights(&this->lightCtx, gfxCtx);
if (this->roomCtx.curRoom.enablePosLights || (MREG(93) != 0)) {
- sp268->enablePosLights = true;
+ lights->enablePosLights = true;
}
- Lights_BindAll(sp268, this->lightCtx.listHead, NULL, this);
- Lights_Draw(sp268, gfxCtx);
+ Lights_BindAll(lights, this->lightCtx.listHead, NULL, this);
+ Lights_Draw(lights, gfxCtx);
if (1) {
u32 roomDrawFlags = ((1) ? 1 : 0) | (((void)0, 1) ? 2 : 0); // FAKE:
@@ -1313,12 +1311,12 @@ void Play_DrawMain(PlayState* this) {
}
if (this->skyboxCtx.skyboxShouldDraw) {
- Vec3f sp78;
+ Vec3f quakeOffset;
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);
+ quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(this));
+ Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + quakeOffset.x,
+ this->view.eye.y + quakeOffset.y, this->view.eye.z + quakeOffset.z);
}
}