Change how we reset the camera when bubbled/on star collection

This commit is contained in:
MysterD 2020-10-01 22:00:21 -07:00
parent 0a68abc055
commit 2c6ab5d4ab
5 changed files with 11 additions and 3 deletions

View File

@ -3252,6 +3252,13 @@ 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
*/

View File

@ -687,6 +687,7 @@ 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);

View File

@ -403,7 +403,7 @@ void mario_set_bubbled(struct MarioState* m) {
gCutsceneTimer = 0;
if (m->playerIndex == 0) {
set_camera_mode(m->area->camera, m->area->camera->defMode, 1);
semi_reset_camera(m->area->camera);
}
}

View File

@ -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) {
set_camera_mode(m->area->camera, m->area->camera->defMode, 1);
semi_reset_camera(m->area->camera);
}
return force_idle_state(m);
}

View File

@ -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) {
reset_camera(m->area->camera);
semi_reset_camera(m->area->camera);
}
}
}