From e5245c508dc0a1fe86b6409101b16c6e3082cfea Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 26 Mar 2017 17:11:04 -0400 Subject: [PATCH] Reimplemented analog mode cam_dist increase, slight comment updates Analog mode's camera is now x1.2 of your actual cam_dist setting, instead of being strictly 192. "analog on" seems to reset this modifier every once in a while, but "useranalog on" prevents this. The wiki itself says that you should only change useranalog though, so it shouldn't be too big of a deal. --- src/g_game.c | 12 ------------ src/p_setup.c | 23 +++++++++++------------ src/p_user.c | 4 ++++ 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index f3ccbce99..137f8609a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1565,12 +1565,6 @@ static void Analog_OnChange(void) return; // cameras are not initialized at this point - // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! - - /*if (leveltime > 1) - CV_SetValue(&cv_cam_dist, 128); - if (cv_analog.value || demoplayback) - CV_SetValue(&cv_cam_dist, 192);*/ if (!cv_chasecam.value && cv_analog.value) { CV_SetValue(&cv_analog, 0); @@ -1591,12 +1585,6 @@ static void Analog2_OnChange(void) return; // cameras are not initialized at this point - // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! - - /*if (leveltime > 1) - CV_SetValue(&cv_cam2_dist, 128); - if (cv_analog2.value) - CV_SetValue(&cv_cam2_dist, 192);*/ if (!cv_chasecam2.value && cv_analog2.value) { CV_SetValue(&cv_analog2, 0); diff --git a/src/p_setup.c b/src/p_setup.c index 97bcb61f1..e718637c9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2583,8 +2583,9 @@ boolean P_SetupLevel(boolean skipprecip) if (!dedicated) { - //if (!cv_cam_speed.changed) - //CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue); + // Salt: CV_ClearChangedFlags() messes with your settings :( + /*if (!cv_cam_speed.changed) + CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/ if (!cv_chasecam.changed) CV_SetValue(&cv_chasecam, chase); @@ -2881,24 +2882,22 @@ boolean P_SetupLevel(boolean skipprecip) } } - // Salt: I don't understand *why* it does this, but this overwrites the player's setting, even though it looks like it shouldn't do that unless if it's already the default + // Salt: CV_ClearChangedFlags() messes with your settings :( /*if (!cv_cam_height.changed) CV_Set(&cv_cam_height, cv_cam_height.defaultvalue); - - if (!cv_cam_dist.changed) - CV_Set(&cv_cam_dist, cv_cam_dist.defaultvalue); - - if (!cv_cam_rotate.changed) - CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue); - if (!cv_cam2_height.changed) CV_Set(&cv_cam2_height, cv_cam2_height.defaultvalue); + if (!cv_cam_dist.changed) + CV_Set(&cv_cam_dist, cv_cam_dist.defaultvalue); if (!cv_cam2_dist.changed) - CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue); + CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue);*/ + // Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P + if (!cv_cam_rotate.changed) + CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue); if (!cv_cam2_rotate.changed) - CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);*/ + CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue); if (!cv_analog.changed) CV_SetValue(&cv_analog, 0); diff --git a/src/p_user.c b/src/p_user.c index 8b1589c42..1e527607e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8289,6 +8289,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall { dist = camdist; + // x1.2 dist for analog + if (P_AnalogMove(player)) + dist = FixedMul(dist, 6*FRACUNIT/5); + if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] && player->powers[pw_carry] != CR_PLAYER)) dist <<= 1; }