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);