Skip to content

Commit

Permalink
Fix widescreen scaling for Oceff_Wipe effect
Browse files Browse the repository at this point in the history
- Correctly calculate aspect ratio using viewport dimensions
- Adjust Matrix_Scale to account for widescreen aspect ratio
  • Loading branch information
mckinlee authored May 21, 2024
1 parent ad0e173 commit 4c4df01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);

Matrix_Translate(eye.x + vec.x, eye.y + vec.y, eye.z + vec.z, MTXMODE_NEW);
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
float aspectRatio = (float)(play->view.viewport.rightX - play->view.viewport.leftX) /
(float)(play->view.viewport.bottomY - play->view.viewport.topY);
Matrix_Scale(0.1f * aspectRatio, 0.1f, 0.1f, MTXMODE_APPLY);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY);

Expand Down

0 comments on commit 4c4df01

Please sign in to comment.