mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
P_DemoCameraMovement: don't let A button press from menu carry over to rise camera
This commit is contained in:
parent
83f02231e3
commit
0f9ceab817
3 changed files with 23 additions and 4 deletions
|
|
@ -239,6 +239,7 @@ void M_PlaybackToggleFreecam(INT32 choice)
|
||||||
if (!demo.freecam) // toggle on
|
if (!demo.freecam) // toggle on
|
||||||
{
|
{
|
||||||
demo.freecam = true;
|
demo.freecam = true;
|
||||||
|
democam.button_a_held = 2;
|
||||||
}
|
}
|
||||||
else // toggle off
|
else // toggle off
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,14 @@ struct camera_t
|
||||||
angle_t old_angle, old_aiming;
|
angle_t old_angle, old_aiming;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// demo freecam or something before i commit die
|
||||||
|
struct demofreecam_s {
|
||||||
|
|
||||||
|
UINT8 button_a_held; // A button was held since entering from menu, so don't move camera
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct demofreecam_s democam;
|
||||||
|
|
||||||
extern camera_t camera[MAXSPLITSCREENPLAYERS];
|
extern camera_t camera[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS], cv_cam_still[MAXSPLITSCREENPLAYERS], cv_cam_height[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS], cv_cam_still[MAXSPLITSCREENPLAYERS], cv_cam_height[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||||
|
|
|
||||||
10
src/p_user.c
10
src/p_user.c
|
|
@ -2939,6 +2939,8 @@ fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
||||||
fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
||||||
fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
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)
|
||||||
{
|
{
|
||||||
ticcmd_t *cmd;
|
ticcmd_t *cmd;
|
||||||
|
|
@ -2954,10 +2956,18 @@ void P_DemoCameraMovement(camera_t *cam)
|
||||||
cam->aiming = G_ClipAimingPitch((INT32 *)&cam->aiming);
|
cam->aiming = G_ClipAimingPitch((INT32 *)&cam->aiming);
|
||||||
|
|
||||||
// camera movement:
|
// camera movement:
|
||||||
|
if (!democam.button_a_held)
|
||||||
|
{
|
||||||
if (cmd->buttons & BT_ACCELERATE)
|
if (cmd->buttons & BT_ACCELERATE)
|
||||||
cam->z += 32*mapobjectscale;
|
cam->z += 32*mapobjectscale;
|
||||||
else if (cmd->buttons & BT_BRAKE)
|
else if (cmd->buttons & BT_BRAKE)
|
||||||
cam->z -= 32*mapobjectscale;
|
cam->z -= 32*mapobjectscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(cmd->buttons & BT_ACCELERATE) && democam.button_a_held)
|
||||||
|
{
|
||||||
|
democam.button_a_held--;
|
||||||
|
}
|
||||||
|
|
||||||
// if you hold item, you will lock on to displayplayer. (The last player you were ""f12-ing"")
|
// if you hold item, you will lock on to displayplayer. (The last player you were ""f12-ing"")
|
||||||
if (demo.freecam && cmd->buttons & BT_ATTACK)
|
if (demo.freecam && cmd->buttons & BT_ATTACK)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue