From 0b7a6ed7f5cfadd122285188d7c7fd1104063028 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 1 Oct 2023 22:09:28 -0700 Subject: [PATCH] P_DemoCameraMovement: use splitscreen ticcmd --- src/p_local.h | 2 +- src/p_user.c | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index a254e332f..15b338f9d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -154,7 +154,7 @@ void P_AddPlayerScore(player_t *player, UINT32 amount); void P_ResetCamera(player_t *player, camera_t *thiscam); boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam); void P_SlideCameraMove(camera_t *thiscam); -void P_DemoCameraMovement(camera_t *cam); +void P_DemoCameraMovement(camera_t *cam, UINT8 num); boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled); void P_ToggleDemoCamera(void); diff --git a/src/p_user.c b/src/p_user.c index 98cd2703b..122a8964e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2887,7 +2887,7 @@ fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; struct demofreecam_s democam; -void P_DemoCameraMovement(camera_t *cam) +void P_DemoCameraMovement(camera_t *cam, UINT8 num) { ticcmd_t *cmd; angle_t thrustangle; @@ -2897,7 +2897,7 @@ void P_DemoCameraMovement(camera_t *cam) boolean moving = false; // first off we need to get button input - cmd = D_LocalTiccmd(0); + cmd = D_LocalTiccmd(num); if (cmd->aiming != 0) { @@ -3083,18 +3083,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL) return true; - if (demo.freecam || player->spectator) - { - P_DemoCameraMovement(thiscam); - return true; - } - - if (paused || P_AutoPause()) - return true; - - playerScale = FixedDiv(player->mo->scale, mapobjectscale); - scaleDiff = playerScale - FRACUNIT; - if (thiscam == &camera[1]) // Camera 2 { num = 1; @@ -3112,6 +3100,18 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall num = 0; } + if (demo.freecam || player->spectator) + { + P_DemoCameraMovement(thiscam, num); + return true; + } + + if (paused || P_AutoPause()) + return true; + + playerScale = FixedDiv(player->mo->scale, mapobjectscale); + scaleDiff = playerScale - FRACUNIT; + mo = player->mo; if (P_MobjIsFrozen(mo) || player->playerstate == PST_DEAD)