From d03ec2dd9db10ed08e6d3c59644c1516c07f2dd9 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Sat, 17 Dec 2022 13:26:32 -0500 Subject: [PATCH] Small improvements to camera freeze (#244) --- src/game/camera.c | 11 +++++++---- src/game/mario_actions_stationary.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/camera.c b/src/game/camera.c index 4c91be39..2cc5a2ff 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -3051,13 +3051,15 @@ void update_lakitu(struct Camera *c) { * Gets controller input, checks for cutscenes, handles mode changes, and moves the camera */ void update_camera(struct Camera *c) { - if (gOverrideFreezeCamera && !gDjuiInMainMenu) { - return; - } UNUSED u8 unused[24]; gCamera = c; update_camera_hud_status(c); + + if (gOverrideFreezeCamera && !gDjuiInMainMenu) { + return; + } + if (c->cutscene == 0) { // Only process R_TRIG if 'fixed' is not selected in the menu if (cam_select_alt_mode(0) == CAM_SELECTION_MARIO @@ -4006,7 +4008,8 @@ s32 update_camera_hud_status(struct Camera *c) { s16 status = CAM_STATUS_NONE; if (c->cutscene != 0 - || ((gPlayer1Controller->buttonDown & R_TRIG) && cam_select_alt_mode(0) == CAM_SELECTION_FIXED)) { + || ((gPlayer1Controller->buttonDown & R_TRIG) && cam_select_alt_mode(0) == CAM_SELECTION_FIXED) + || gOverrideFreezeCamera) { status |= CAM_STATUS_FIXED; } else if (set_cam_angle(0) == CAM_ANGLE_MARIO) { status |= CAM_STATUS_MARIO; diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index 6281d9c1..0593fcef 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -1075,7 +1075,7 @@ s32 act_first_person(struct MarioState *m) { set_camera_mode(m->area->camera, CAMERA_MODE_C_UP, 0x10); } m->actionState = 1; - } else if (!(m->input & INPUT_FIRST_PERSON) || sp1C) { + } else if (!(m->input & INPUT_FIRST_PERSON) || sp1C || gOverrideFreezeCamera) { if (m->playerIndex == 0) { raise_background_noise(2); // Go back to the last camera mode