From fdaf00d43905dc060566a0a9b94c522faddfda80 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 2 Oct 2020 22:20:59 -0700 Subject: [PATCH] Do a full reset of the camera again. More janky, but prevents camera softlock --- src/game/camera.c | 7 ------- src/game/camera.h | 1 - src/game/mario.c | 2 +- src/game/mario_actions_automatic.c | 2 +- src/game/mario_actions_cutscene.c | 2 +- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/game/camera.c b/src/game/camera.c index e759edf4..c439b6d2 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -3252,13 +3252,6 @@ void update_camera(struct Camera *c) { gLakituState.lastFrameAction = sMarioCamState->action; } -void semi_reset_camera(struct Camera* c) { - s16 oldMovementFlags = gCameraMovementFlags; - reset_camera(c); - - // don't cause a reset of position/rotation - gCameraMovementFlags = oldMovementFlags; -} /** * Reset all the camera variables to their arcane defaults */ diff --git a/src/game/camera.h b/src/game/camera.h index 3378c874..95017afb 100644 --- a/src/game/camera.h +++ b/src/game/camera.h @@ -687,7 +687,6 @@ void move_mario_head_c_up(UNUSED struct Camera *c); void transition_next_state(UNUSED struct Camera *c, s16 frames); void set_camera_mode(struct Camera *c, s16 mode, s16 frames); void update_camera(struct Camera *c); -void semi_reset_camera(struct Camera* c); void reset_camera(struct Camera *c); void init_camera(struct Camera *c); void select_mario_cam_mode(void); diff --git a/src/game/mario.c b/src/game/mario.c index fdb216b8..aad3af6c 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -403,7 +403,7 @@ void mario_set_bubbled(struct MarioState* m) { gCutsceneTimer = 0; if (m->playerIndex == 0) { - semi_reset_camera(m->area->camera); + reset_camera(m->area->camera); } } diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index c6b36f83..1a72b295 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -953,7 +953,7 @@ s32 act_bubbled(struct MarioState* m) { m->vel[2] = 0; m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; if (m->playerIndex == 0) { - semi_reset_camera(m->area->camera); + reset_camera(m->area->camera); } return force_idle_state(m); } diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index c370d15a..045f82ea 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -710,7 +710,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { set_mario_action(m, isInWater ? ACT_WATER_IDLE : ACT_IDLE, 0); } if (gServerSettings.stayInLevelAfterStar) { - semi_reset_camera(m->area->camera); + reset_camera(m->area->camera); } } }