From 300d25116f8639fcc75efefce681942f5d4aef19 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 26 Jan 2020 21:07:04 -0800 Subject: [PATCH] Revise cvars, inverseslope is now the default --- src/p_local.h | 4 +++- src/p_user.c | 15 ++++++++++++--- src/r_main.c | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 4c657eca6..b97a11cda 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -132,10 +132,12 @@ 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_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCREENPLAYERS]; -extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_inverseslope; +extern consvar_t cv_slopeview; extern consvar_t cv_quaketilt; +extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS]; + 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); diff --git a/src/p_user.c b/src/p_user.c index 6c5aa1c74..c0f2a2ea0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2725,7 +2725,15 @@ consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS] = { {"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL} }; -consvar_t cv_inverseslope = {"inverseslope", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t slopeview_cons_t[] = +{ + { 0, "Off" }, + { 1, "On" }, + { 2, "Inverse" }, + + {0} +}; +consvar_t cv_slopeview = {"slopeview", "Off", CV_SAVE, slopeview_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_quaketilt = {"quaketilt", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; @@ -4203,12 +4211,13 @@ DoABarrelRoll (player_t *player) angle_t slope; angle_t delta; - if (player->mo->standingslope) + if (cv_slopeview.value && player->mo->standingslope) { delta = ( player->mo->angle - player->mo->standingslope->xydirection ); slope = FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), player->mo->standingslope->zangle); - if (cv_inverseslope.value) + /* invert the screen tilt as if tilting the view instead */ + if (cv_slopeview.value != 2)/* :james: mode */ slope = -slope; } else diff --git a/src/r_main.c b/src/r_main.c index cfe4be094..a7e4f8de2 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1705,7 +1705,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_cam_rotate[i]); } - CV_RegisterVar(&cv_inverseslope); + CV_RegisterVar(&cv_slopeview); CV_RegisterVar(&cv_quaketilt); CV_RegisterVar(&cv_showhud);