From 65d5fd0784e2d6a0e8343dad2100786a69bc5d56 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 25 Jan 2020 21:43:39 -0800 Subject: [PATCH 01/19] GONNAHURL HARDCODE --- src/p_local.h | 1 + src/p_user.c | 31 +++++++++++++++++++++++++++++++ src/r_main.c | 2 ++ 3 files changed, 34 insertions(+) diff --git a/src/p_local.h b/src/p_local.h index a010cd37b..0300cffa4 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -133,6 +133,7 @@ extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS], cv_cam_still[MAXSPLITSCREEN 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; void P_AddPlayerScore(player_t *player, UINT32 amount); void P_ResetCamera(player_t *player, camera_t *thiscam); diff --git a/src/p_user.c b/src/p_user.c index ef9713808..2dc6b60b7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2725,6 +2725,8 @@ 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}; + fixed_t t_cam_dist[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}; @@ -4160,6 +4162,33 @@ static void P_HandleFollower(player_t *player) } } + /* gaysed script from me, based on Golden's sprite slope roll */ + +static void +DoABarrelRoll (player_t *player) +{ + angle_t slope; + angle_t delta; + + if (player->mo->standingslope) + { + delta = ( player->mo->angle - player->mo->standingslope->xydirection ); + slope = FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), + player->mo->standingslope->zangle); + if (cv_inverseslope.value) + slope = -slope; + } + else + slope = 0; + + delta = (INT32)( slope - player->viewrollangle )/ 16; + + if (delta) + player->viewrollangle += delta; + else + player->viewrollangle = slope; +} + // // P_PlayerThink // @@ -4535,6 +4564,8 @@ void P_PlayerThink(player_t *player) K_KartPlayerThink(player, cmd); // SRB2kart + DoABarrelRoll(player); + LUAh_PlayerThink(player); } diff --git a/src/r_main.c b/src/r_main.c index 4ee99fc45..7f7000588 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1705,6 +1705,8 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_cam_rotate[i]); } + CV_RegisterVar(&cv_inverseslope); + CV_RegisterVar(&cv_showhud); CV_RegisterVar(&cv_translucenthud); From a8fe25dd41ae65b494913cd2570e1630bd285892 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 25 Jan 2020 23:36:24 -0800 Subject: [PATCH 02/19] QUAAAAAAAAKE --- src/p_local.h | 1 + src/p_user.c | 36 ++++++++++++++++++++++++++++++++++++ src/r_main.c | 1 + 3 files changed, 38 insertions(+) diff --git a/src/p_local.h b/src/p_local.h index 0300cffa4..4c657eca6 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -134,6 +134,7 @@ extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCRE extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_inverseslope; +extern consvar_t cv_quaketilt; void P_AddPlayerScore(player_t *player, UINT32 amount); void P_ResetCamera(player_t *player, camera_t *thiscam); diff --git a/src/p_user.c b/src/p_user.c index 2dc6b60b7..0c0c0d67e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2726,6 +2726,7 @@ consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS] = { }; consvar_t cv_inverseslope = {"inverseslope", "Off", CV_SAVE, CV_OnOff, 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}; fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; @@ -4164,6 +4165,38 @@ static void P_HandleFollower(player_t *player) /* gaysed script from me, based on Golden's sprite slope roll */ +// holy SHIT +static INT32 +Quaketilt (player_t *player) +{ + angle_t tilt; + fixed_t lowb; // this threshold for speed + angle_t moma = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); + angle_t delta = (INT32)( player->mo->angle - moma ); + fixed_t speed; + // Hi! I'm "not a math guy"! + if (abs(delta) > ANGLE_90) + delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle ); + if (P_IsObjectOnGround(player->mo)) + { + tilt = ANGLE_11hh; + lowb = 15*FRACUNIT; + } + else + { + tilt = ANGLE_45; + lowb = 10*FRACUNIT; + } + moma = FixedMul(FixedDiv(delta, ANGLE_90), tilt); + speed = abs( player->mo->momx + player->mo->momy ); + if (speed < lowb) + { + // ease out tilt as we slow... + moma = FixedMul(moma, FixedDiv(speed, lowb)); + } + return moma; +} + static void DoABarrelRoll (player_t *player) { @@ -4181,6 +4214,9 @@ DoABarrelRoll (player_t *player) else slope = 0; + if (cv_quaketilt.value) + slope += Quaketilt(player); + delta = (INT32)( slope - player->viewrollangle )/ 16; if (delta) diff --git a/src/r_main.c b/src/r_main.c index 7f7000588..d3762de3c 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1706,6 +1706,7 @@ void R_RegisterEngineStuff(void) } CV_RegisterVar(&cv_inverseslope); + CV_RegisterVar(&cv_quaketilt); CV_RegisterVar(&cv_showhud); CV_RegisterVar(&cv_translucenthud); From eef273c42b2f92bbec6b541159586ecfe56413d9 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 26 Jan 2020 00:02:34 -0800 Subject: [PATCH 03/19] One last adjustment --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0c0c0d67e..6c5aa1c74 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4179,12 +4179,12 @@ Quaketilt (player_t *player) delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle ); if (P_IsObjectOnGround(player->mo)) { - tilt = ANGLE_11hh; + tilt = 4*ANGLE_11hh/5; lowb = 15*FRACUNIT; } else { - tilt = ANGLE_45; + tilt = ANGLE_22h; lowb = 10*FRACUNIT; } moma = FixedMul(FixedDiv(delta, ANGLE_90), tilt); From c82ac33c0c4fed8e597ac6854ada2e154fa8c11e Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 26 Jan 2020 15:57:28 -0800 Subject: [PATCH 04/19] Rumble rumble --- src/doomstat.h | 1 + src/p_tick.c | 9 ++++++++- src/r_main.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 7356a8c18..ba6e18a7f 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -304,6 +304,7 @@ extern struct quake { // camera offsets and duration fixed_t x,y,z; + angle_t roll; UINT16 time; // location, radius, and intensity... diff --git a/src/p_tick.c b/src/p_tick.c index 071e80d6c..4b94b579a 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -632,10 +632,17 @@ void P_Ticker(boolean run) quake.x = M_RandomRange(-ir,ir); quake.y = M_RandomRange(-ir,ir); quake.z = M_RandomRange(-ir,ir); + ir >>= 2; + ir = M_RandomRange(-ir,ir); + if (ir < 0) + ir = ANGLE_MAX - FixedAngle(-ir); + else + ir = FixedAngle(ir); + quake.roll = ir; --quake.time; } else - quake.x = quake.y = quake.z = 0; + quake.x = quake.y = quake.z = quake.roll = 0; if (metalplayback) G_ReadMetalTic(metalplayback); diff --git a/src/r_main.c b/src/r_main.c index d3762de3c..cfe4be094 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -639,7 +639,7 @@ void R_CheckViewMorph(int s) float fisheyemap[MAXVIDWIDTH/2 + 1]; #endif - angle_t rollangle = players[displayplayers[s]].viewrollangle; + angle_t rollangle = players[displayplayers[s]].viewrollangle + quake.roll; #ifdef WOUGHMP_WOUGHMP fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value #endif From 300d25116f8639fcc75efefce681942f5d4aef19 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 26 Jan 2020 21:07:04 -0800 Subject: [PATCH 05/19] 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); From 176657fe543ac61d1bbd0d442baf60b437685fe0 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 26 Jan 2020 21:10:24 -0800 Subject: [PATCH 06/19] Make rolling quake optional --- src/p_local.h | 1 + src/p_user.c | 1 + src/r_main.c | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/p_local.h b/src/p_local.h index b97a11cda..486198ee5 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -135,6 +135,7 @@ extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCRE extern consvar_t cv_inverseslope; extern consvar_t cv_slopeview; extern consvar_t cv_quaketilt; +extern consvar_t cv_actionmovie; extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS]; diff --git a/src/p_user.c b/src/p_user.c index c0f2a2ea0..cd0545e62 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2735,6 +2735,7 @@ static CV_PossibleValue_t slopeview_cons_t[] = }; 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}; +consvar_t cv_actionmovie = {"actionmovie", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; diff --git a/src/r_main.c b/src/r_main.c index a7e4f8de2..cfc520f92 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -639,7 +639,7 @@ void R_CheckViewMorph(int s) float fisheyemap[MAXVIDWIDTH/2 + 1]; #endif - angle_t rollangle = players[displayplayers[s]].viewrollangle + quake.roll; + angle_t rollangle = players[displayplayers[s]].viewrollangle; #ifdef WOUGHMP_WOUGHMP fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value #endif @@ -649,6 +649,9 @@ void R_CheckViewMorph(int s) v->zoomneeded = FRACUNIT; } + if (cv_actionmovie.value) + rollangle += quake.roll; + rollangle >>= ANGLETOFINESHIFT; rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot. @@ -1707,6 +1710,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_slopeview); CV_RegisterVar(&cv_quaketilt); + CV_RegisterVar(&cv_actionmovie); CV_RegisterVar(&cv_showhud); CV_RegisterVar(&cv_translucenthud); From 6893db46a1bf9ddcddcb39810c755d0c1f0751c7 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 26 Jan 2020 21:10:48 -0800 Subject: [PATCH 07/19] Please turn it on --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index cd0545e62..db74da438 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2733,7 +2733,7 @@ static CV_PossibleValue_t slopeview_cons_t[] = {0} }; -consvar_t cv_slopeview = {"slopeview", "Off", CV_SAVE, slopeview_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_slopeview = {"slopeview", "On", 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}; consvar_t cv_actionmovie = {"actionmovie", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; From 68bd632bac37b5852088d55dfcd96ed1ae4134f9 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 28 Jan 2020 21:28:26 -0800 Subject: [PATCH 08/19] You have entered the comedy area --- src/d_main.c | 2 ++ src/doomstat.h | 2 ++ src/i_system.h | 2 ++ src/p_tick.c | 1 + src/sdl/i_system.c | 6 ++++++ src/sdl/i_video.c | 3 +++ 6 files changed, 16 insertions(+) diff --git a/src/d_main.c b/src/d_main.c index e3c334d92..7f141d509 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -98,6 +98,8 @@ int SUBVERSION; // platform independant focus loss UINT8 window_notinfocus = false; +INT32 window_x; +INT32 window_y; // // DEMO LOOP diff --git a/src/doomstat.h b/src/doomstat.h index ba6e18a7f..9d425819b 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -146,6 +146,8 @@ extern boolean digital_disabled; extern boolean menuactive; // Menu overlaid? extern UINT8 paused; // Game paused? extern UINT8 window_notinfocus; // are we in focus? (backend independant -- handles auto pausing and display of "focus lost" message) +extern INT32 window_x; +extern INT32 window_y; extern boolean nodrawers; extern boolean noblit; diff --git a/src/i_system.h b/src/i_system.h index daa76f3ab..9a6dd782c 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -342,4 +342,6 @@ const char *I_ClipboardPaste(void); void I_RegisterSysCommands(void); +void I_CursedWindowMovement(int xd, int yd); + #endif diff --git a/src/p_tick.c b/src/p_tick.c index 4b94b579a..70b0d05a6 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -632,6 +632,7 @@ void P_Ticker(boolean run) quake.x = M_RandomRange(-ir,ir); quake.y = M_RandomRange(-ir,ir); quake.z = M_RandomRange(-ir,ir); + I_CursedWindowMovement(FixedInt(quake.x), FixedInt(quake.y)); ir >>= 2; ir = M_RandomRange(-ir,ir); if (ir < 0) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 47c7c5e20..c85caa021 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -836,6 +836,12 @@ INT32 I_GetKey (void) return rc; } +void +I_CursedWindowMovement (int xd, int yd) +{ + SDL_SetWindowPosition(window, window_x + xd, window_y + yd); +} + // // I_JoyScale // diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index bf61797f3..0e8032184 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -638,6 +638,9 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) break; case SDL_WINDOWEVENT_MAXIMIZED: break; + case SDL_WINDOWEVENT_MOVED: + window_x = evt.data1; + window_y = evt.data2; } if (mousefocus && kbfocus) From 6d206ed644d00167a7b3f62e4fa5c08392883e24 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 28 Jan 2020 21:29:51 -0800 Subject: [PATCH 09/19] Slower roll --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index db74da438..5b510ea08 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4227,7 +4227,7 @@ DoABarrelRoll (player_t *player) if (cv_quaketilt.value) slope += Quaketilt(player); - delta = (INT32)( slope - player->viewrollangle )/ 16; + delta = (INT32)( slope - player->viewrollangle )/ 32; if (delta) player->viewrollangle += delta; From 79fda7b814fe1078e1d13a3e12cfaf25e48fabce Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 28 Jan 2020 21:32:30 -0800 Subject: [PATCH 10/19] bruhhhhh --- src/p_tick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_tick.c b/src/p_tick.c index 70b0d05a6..75e5a6bef 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -25,6 +25,7 @@ #include "k_kart.h" #include "k_battle.h" #include "k_waypoint.h" +#include "i_system.h" // Object place #include "m_cheat.h" From c5df256d9e254633fee46e90b7cf85c82210fc91 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 29 Jan 2020 20:40:24 -0800 Subject: [PATCH 11/19] Make fucking with the window optional --- src/p_local.h | 1 + src/p_tick.c | 3 ++- src/p_user.c | 1 + src/r_main.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p_local.h b/src/p_local.h index 486198ee5..db422e58d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -136,6 +136,7 @@ extern consvar_t cv_inverseslope; extern consvar_t cv_slopeview; extern consvar_t cv_quaketilt; extern consvar_t cv_actionmovie; +extern consvar_t cv_windowquake; extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS]; diff --git a/src/p_tick.c b/src/p_tick.c index 75e5a6bef..cb3d9ccbb 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -633,7 +633,8 @@ void P_Ticker(boolean run) quake.x = M_RandomRange(-ir,ir); quake.y = M_RandomRange(-ir,ir); quake.z = M_RandomRange(-ir,ir); - I_CursedWindowMovement(FixedInt(quake.x), FixedInt(quake.y)); + if (cv_windowquake.value) + I_CursedWindowMovement(FixedInt(quake.x), FixedInt(quake.y)); ir >>= 2; ir = M_RandomRange(-ir,ir); if (ir < 0) diff --git a/src/p_user.c b/src/p_user.c index 5b510ea08..99ba14192 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2736,6 +2736,7 @@ static CV_PossibleValue_t slopeview_cons_t[] = consvar_t cv_slopeview = {"slopeview", "On", 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}; consvar_t cv_actionmovie = {"actionmovie", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_windowquake = {"windowquake", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42}; diff --git a/src/r_main.c b/src/r_main.c index cfc520f92..6b253a958 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1711,6 +1711,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_slopeview); CV_RegisterVar(&cv_quaketilt); CV_RegisterVar(&cv_actionmovie); + CV_RegisterVar(&cv_windowquake); CV_RegisterVar(&cv_showhud); CV_RegisterVar(&cv_translucenthud); From 15601d18ddb0404daabb6ab7e8bc0b31ee0742a3 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 23 Sep 2020 18:03:26 -0700 Subject: [PATCH 12/19] angle_t -> INT32 --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 99ba14192..da7d73cc8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4182,7 +4182,7 @@ Quaketilt (player_t *player) angle_t tilt; fixed_t lowb; // this threshold for speed angle_t moma = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); - angle_t delta = (INT32)( player->mo->angle - moma ); + INT32 delta = (INT32)( player->mo->angle - moma ); fixed_t speed; // Hi! I'm "not a math guy"! if (abs(delta) > ANGLE_90) From a24e3c4bd1332638c5d2601b3e4c9bf6ef3bef87 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 23 Sep 2020 18:15:22 -0700 Subject: [PATCH 13/19] Reduce quake tilting --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index da7d73cc8..bb02b0951 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4189,7 +4189,7 @@ Quaketilt (player_t *player) delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle ); if (P_IsObjectOnGround(player->mo)) { - tilt = 4*ANGLE_11hh/5; + tilt = ANGLE_11hh/2; lowb = 15*FRACUNIT; } else From f0c024e9bdf0f555495e4c6882ab4154d831076b Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 24 Sep 2020 19:54:30 -0700 Subject: [PATCH 14/19] Remove inverse slope option, merge quaketilt and slopeview into tilting cvar --- src/p_local.h | 4 +--- src/p_user.c | 31 +++++++++++++------------------ src/r_main.c | 3 +-- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index db422e58d..3d2b6bced 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -132,9 +132,7 @@ 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 consvar_t cv_inverseslope; -extern consvar_t cv_slopeview; -extern consvar_t cv_quaketilt; +extern consvar_t cv_tilting; extern consvar_t cv_actionmovie; extern consvar_t cv_windowquake; diff --git a/src/p_user.c b/src/p_user.c index bb02b0951..a3d952505 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2725,16 +2725,8 @@ consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS] = { {"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL} }; -static CV_PossibleValue_t slopeview_cons_t[] = -{ - { 0, "Off" }, - { 1, "On" }, - { 2, "Inverse" }, +consvar_t cv_tilting = {"tilting", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; - {0} -}; -consvar_t cv_slopeview = {"slopeview", "On", 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}; consvar_t cv_actionmovie = {"actionmovie", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_windowquake = {"windowquake", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -4213,20 +4205,16 @@ DoABarrelRoll (player_t *player) angle_t slope; angle_t delta; - if (cv_slopeview.value && player->mo->standingslope) + if (player->mo->standingslope) { delta = ( player->mo->angle - player->mo->standingslope->xydirection ); - slope = FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), - player->mo->standingslope->zangle); - /* invert the screen tilt as if tilting the view instead */ - if (cv_slopeview.value != 2)/* :james: mode */ - slope = -slope; + slope = -(FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), + player->mo->standingslope->zangle)); } else slope = 0; - if (cv_quaketilt.value) - slope += Quaketilt(player); + slope += Quaketilt(player); delta = (INT32)( slope - player->viewrollangle )/ 32; @@ -4611,7 +4599,14 @@ void P_PlayerThink(player_t *player) K_KartPlayerThink(player, cmd); // SRB2kart - DoABarrelRoll(player); + if (cv_tilting.value) + { + DoABarrelRoll(player); + } + else + { + player->viewrollangle = 0; + } LUAh_PlayerThink(player); } diff --git a/src/r_main.c b/src/r_main.c index 6b253a958..37eac393d 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1708,8 +1708,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_cam_rotate[i]); } - CV_RegisterVar(&cv_slopeview); - CV_RegisterVar(&cv_quaketilt); + CV_RegisterVar(&cv_tilting); CV_RegisterVar(&cv_actionmovie); CV_RegisterVar(&cv_windowquake); From f2812dbbe616db99ac19646ea00540edc8c6171a Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 24 Sep 2020 19:55:58 -0700 Subject: [PATCH 15/19] Quake tilt in correct direction --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index a3d952505..f17ffecd6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4176,6 +4176,7 @@ Quaketilt (player_t *player) angle_t moma = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); INT32 delta = (INT32)( player->mo->angle - moma ); fixed_t speed; + // Hi! I'm "not a math guy"! if (abs(delta) > ANGLE_90) delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle ); @@ -4214,7 +4215,7 @@ DoABarrelRoll (player_t *player) else slope = 0; - slope += Quaketilt(player); + slope -= Quaketilt(player); delta = (INT32)( slope - player->viewrollangle )/ 32; From 3a7a537d0ea49b973e7fe0be3d3d59118d671fc4 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 24 Sep 2020 19:59:24 -0700 Subject: [PATCH 16/19] Require slope angle > 11.25 to tilt camera --- src/p_user.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index f17ffecd6..32e8cec31 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4208,12 +4208,22 @@ DoABarrelRoll (player_t *player) if (player->mo->standingslope) { - delta = ( player->mo->angle - player->mo->standingslope->xydirection ); - slope = -(FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), - player->mo->standingslope->zangle)); + slope = player->mo->standingslope->zangle; } else + { slope = 0; + } + + if (abs((INT32)slope) > ANGLE_11hh) + { + delta = ( player->mo->angle - player->mo->standingslope->xydirection ); + slope = -(FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), slope)); + } + else + { + slope = 0; + } slope -= Quaketilt(player); From 85afc1ed5a1f2c2a8ef94cfd4d66dbfd2d13665b Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 24 Sep 2020 20:00:19 -0700 Subject: [PATCH 17/19] Big Large tilt while sliptiding --- src/p_user.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 32e8cec31..a274b1b15 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4177,13 +4177,27 @@ Quaketilt (player_t *player) INT32 delta = (INT32)( player->mo->angle - moma ); fixed_t speed; + boolean sliptiding = + ( + player->kartstuff[k_aizdriftstrat] != 0 && + player->kartstuff[k_drift] == 0 + ); + // Hi! I'm "not a math guy"! if (abs(delta) > ANGLE_90) delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle ); if (P_IsObjectOnGround(player->mo)) { - tilt = ANGLE_11hh/2; - lowb = 15*FRACUNIT; + if (sliptiding) + { + tilt = ANGLE_45; + lowb = 5*FRACUNIT; + } + else + { + tilt = ANGLE_11hh/2; + lowb = 15*FRACUNIT; + } } else { From 006c6e1e75c242a264f508297b4659ef9a753597 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 24 Sep 2020 20:01:56 -0700 Subject: [PATCH 18/19] Don't quake tilt if just going backward THIS IS A HACK FOR WHEN ANGLE IS 90 DEGREES --- src/p_user.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index a274b1b15..6ea4bfc5d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4183,6 +4183,11 @@ Quaketilt (player_t *player) player->kartstuff[k_drift] == 0 ); + if (delta == (INT32)ANGLE_180)/* FUCK YOU HAVE A HACK */ + { + return 0; + } + // Hi! I'm "not a math guy"! if (abs(delta) > ANGLE_90) delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle ); From 4240b30453a26e5f747f2a0f699082e8822add11 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 27 Sep 2020 23:02:04 -0700 Subject: [PATCH 19/19] Apply quake rolling to opengl too, cv_actionmovie depends on cv_tilting (cherry picked from commit b69162e92d972b58c59b73a19eed2ea234e464f3) --- src/d_player.h | 1 + src/p_user.c | 29 ++++++++++++++++++----------- src/r_main.c | 3 --- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 283196e4d..3d1c4f5ad 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -485,6 +485,7 @@ typedef struct player_s fixed_t bob; angle_t viewrollangle; + angle_t tilt; angle_t angleturn; diff --git a/src/p_user.c b/src/p_user.c index becb3e3e7..041f0eb9e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4247,12 +4247,26 @@ DoABarrelRoll (player_t *player) slope -= Quaketilt(player); - delta = (INT32)( slope - player->viewrollangle )/ 32; + delta = (INT32)( slope - player->tilt )/ 32; if (delta) - player->viewrollangle += delta; + player->tilt += delta; else - player->viewrollangle = slope; + player->tilt = slope; + + if (cv_tilting.value) + { + player->viewrollangle = player->tilt; + + if (cv_actionmovie.value) + { + player->viewrollangle += quake.roll; + } + } + else + { + player->viewrollangle = 0; + } } // @@ -4624,14 +4638,7 @@ void P_PlayerThink(player_t *player) K_KartPlayerThink(player, cmd); // SRB2kart - if (cv_tilting.value) - { - DoABarrelRoll(player); - } - else - { - player->viewrollangle = 0; - } + DoABarrelRoll(player); LUAh_PlayerThink(player); } diff --git a/src/r_main.c b/src/r_main.c index 05d65d9af..e4078e0b8 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -645,9 +645,6 @@ void R_CheckViewMorph(int s) v->zoomneeded = FRACUNIT; } - if (cv_actionmovie.value) - rollangle += quake.roll; - rollangle >>= ANGLETOFINESHIFT; rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot.