diff --git a/src/g_game.c b/src/g_game.c index 1b5626669..03a022339 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -524,7 +524,6 @@ static CV_PossibleValue_t sloperolldist_cons_t[] = { {8192, "8192"}, {0, "Infinite"}, {0, NULL}}; consvar_t cv_sloperolldist = {"sloperolldist", "Infinite", CV_SAVE, sloperolldist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t sloperoll_cons_t[] = {{0, "Off"}, {1, "Players"}, {2, "Everything"}, {0, NULL}}; -consvar_t cv_spriteroll = {"spriteroll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL, sloperoll_cons_t, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sparkroll = {"sparkroll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sliptideroll = {"sliptideroll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/g_game.h b/src/g_game.h index b00bf1343..81d653774 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -166,7 +166,6 @@ extern consvar_t cv_saltysquish; extern consvar_t cv_driftsparkpulse; extern consvar_t cv_gravstretch; extern consvar_t cv_sloperoll; -extern consvar_t cv_spriteroll; extern consvar_t cv_sliptideroll; extern consvar_t cv_slamsound; extern consvar_t cv_sloperolldist; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 79e817ae1..9cbcfe9e9 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4509,8 +4509,8 @@ static void HWR_ProjectSprite(mobj_t *thing) #ifdef ROTSPRITE // determine here if sprite should rotate for optimization - const boolean sliprollrotate = (cv_spriteroll.value && cv_sliptideroll.value && (thing->player && thing->player->sliproll)); - const boolean shouldrotate = (cv_spriteroll.value && (interp.roll || interp.pitch || interp.sloperoll || interp.slopepitch || thing->rollangle || sliprollrotate)); + const boolean sliprollrotate = (cv_sloperoll.value && cv_sliptideroll.value && (thing->player && thing->player->sliproll)); + const boolean shouldrotate = (cv_sloperoll.value && (interp.roll || interp.pitch || interp.sloperoll || interp.slopepitch || thing->rollangle || sliprollrotate)); #endif //Fab : 02-08-98: 'skin' override spritedef currently used for skin diff --git a/src/m_menu.c b/src/m_menu.c index 6fea58256..530cb98fb 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2224,22 +2224,20 @@ static menuitem_t OP_PlayerDistortMenu[] = { {IT_HEADER, NULL, "Sprite Distortion", NULL, 0}, - {IT_STRING | IT_CVAR, NULL, "Sprite Rotation", &cv_spriteroll, 15}, - {IT_STRING | IT_CVAR, NULL, "Sprite Slope Rotation", &cv_sloperoll, 30}, - {IT_STRING | IT_CVAR, NULL, "Slope Rotation Distance", &cv_sloperolldist, 45}, - {IT_STRING | IT_CVAR, NULL, "Rotate Players when Sliptiding", &cv_sliptideroll, 60}, - {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 75}, - {IT_STRING | IT_CVAR, NULL, "Player Stretch Factor", &cv_gravstretch, 90}, - {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 105}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 120}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 135}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 150}, + {IT_STRING | IT_CVAR, NULL, "Sprite Slope Rotation", &cv_sloperoll, 15}, + {IT_STRING | IT_CVAR, NULL, "Slope Rotation Distance", &cv_sloperolldist, 30}, + {IT_STRING | IT_CVAR, NULL, "Rotate Players when Sliptiding", &cv_sliptideroll, 45}, + {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 60}, + {IT_STRING | IT_CVAR, NULL, "Player Stretch Factor", &cv_gravstretch, 75}, + {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 90}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 105}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 120}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 135}, }; static const char* OP_PlayerDistortTooltips[] = { NULL, - "Sprite rotation features.", "Sprite rotation on slopes. Can either be just players or all objects.", "Distance object rotation should be visable.", "Player rotation when sliptiding.", @@ -2254,7 +2252,6 @@ static const char* OP_PlayerDistortTooltips[] = enum { spriteheader, - spriterotate, sloperotate, slrotatedist, sliptide, @@ -3397,7 +3394,7 @@ void Addons_option_Onchange(void) void PDistort_menu_Onchange(void) { - if (!cv_spriteroll.value) + if (!cv_sloperoll.value) { OP_PlayerDistortMenu[sloperotate].status = IT_GRAYEDOUT; OP_PlayerDistortMenu[sliptide].status = IT_GRAYEDOUT; @@ -3408,15 +3405,10 @@ void PDistort_menu_Onchange(void) OP_PlayerDistortMenu[sliptide].status = IT_STRING | IT_CVAR; } - if ((cv_sloperoll.value) && (cv_spriteroll.value)) //enable/disable sloperotate distance + if (cv_sloperoll.value) //enable/disable sloperotate distance OP_PlayerDistortMenu[slrotatedist].status = IT_STRING | IT_CVAR; else OP_PlayerDistortMenu[slrotatedist].status = IT_GRAYEDOUT; - - if ((cv_sloperoll.value == 2) && (cv_spriteroll.value)) //enable/disable sparkroll depending on which setting - OP_PlayerDistortMenu[sparkrotate].status = IT_STRING | IT_CVAR; - else - OP_PlayerDistortMenu[sparkrotate].status = IT_GRAYEDOUT; } void Bird_menu_Onchange(void) diff --git a/src/p_mobj.c b/src/p_mobj.c index 9da7b0235..eab9629b2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6014,15 +6014,17 @@ void P_RollPitchMobj(mobj_t* mobj) if (!mobj || P_MobjWasRemoved(mobj)) return; - if (cv_spriteroll.value && cv_sloperoll.value == 2) - { - K_RollMobjBySlopes(mobj, cv_sloperolldist.value && !splitscreen); - } - else + I_Assert(mo->subsector != NULL); + I_Assert(mo->subsector->sector != NULL); + + if (cv_sloperoll.value != 2) { mobj->sloperoll = FixedAngle(0); mobj->slopepitch = FixedAngle(0); + return; } + + K_RollMobjBySlopes(mobj, cv_sloperolldist.value && !splitscreen); } angle_t P_MobjPitchAndRoll(mobj_t *mobj) @@ -6033,7 +6035,7 @@ angle_t P_MobjPitchAndRoll(mobj_t *mobj) angle_t camang = 0; angle_t return_angle = 0; - if (!cv_spriteroll.value) + if (!cv_sloperoll.value) return 0; if (P_MobjWasRemoved(mobj)) diff --git a/src/r_main.c b/src/r_main.c index 1c45d4112..1cba82f2c 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1749,7 +1749,6 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_driftsparkpulse); CV_RegisterVar(&cv_gravstretch); CV_RegisterVar(&cv_sloperoll); - CV_RegisterVar(&cv_spriteroll); CV_RegisterVar(&cv_sliptideroll); CV_RegisterVar(&cv_sloperolldist); CV_RegisterVar(&cv_sparkroll); diff --git a/src/r_things.c b/src/r_things.c index fa2b02293..e6c175d4a 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1224,8 +1224,8 @@ static void R_ProjectSprite(mobj_t *thing) #ifdef ROTSPRITE // determine here if sprite should rotate for optimization - const boolean sliprollrotate = (cv_spriteroll.value && cv_sliptideroll.value && (thing->player && thing->player->sliproll)); - const boolean shouldrotate = (cv_spriteroll.value && (interp.roll || interp.pitch || interp.sloperoll || interp.slopepitch || thing->rollangle || sliprollrotate)); + const boolean sliprollrotate = (cv_sloperoll.value && cv_sliptideroll.value && (thing->player && thing->player->sliproll)); + const boolean shouldrotate = (cv_sloperoll.value && (interp.roll || interp.pitch || interp.sloperoll || interp.slopepitch || thing->rollangle || sliprollrotate)); #endif //Fab : 02-08-98: 'skin' override spritedef currently used for skin