From b1d2db56f8ba84484171d76d01cd87de9418b355 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 | 2 +- src/p_user.c | 15 ++++++++++++--- src/r_main.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 56df91585..4c2789a46 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -136,7 +136,7 @@ extern consvar_t cv_cam3_speed, cv_cam3_rotate, cv_cam3_rotspeed; extern consvar_t cv_cam4_dist, cv_cam4_still, cv_cam4_height; extern consvar_t cv_cam4_speed, cv_cam4_rotate, cv_cam4_rotspeed; -extern consvar_t cv_inverseslope; +extern consvar_t cv_slopeview; extern consvar_t cv_quaketilt; extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate; diff --git a/src/p_user.c b/src/p_user.c index f29c3a21a..3733f7e49 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7108,7 +7108,15 @@ consvar_t cv_cam4_speed = {"cam4_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, N consvar_t cv_cam4_rotate = {"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_rotspeed = {"cam4_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 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 = -42; @@ -8260,12 +8268,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 96f21e51f..fca595a28 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1843,7 +1843,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_cam4_rotate); CV_RegisterVar(&cv_cam4_rotspeed); - CV_RegisterVar(&cv_inverseslope); + CV_RegisterVar(&cv_slopeview); CV_RegisterVar(&cv_quaketilt); CV_RegisterVar(&cv_showhud);