add toggle to be able to either rotate just players or everything

you can either just having Players be rotated on slopes, or every mobj

more customizable and also for performance concerns for some
also some stuff i forgor
This commit is contained in:
Alug committed 2024-01-08 08:34:32 +01:00
1 parent 9bf10bf35b
commit 213718d1bd
4 files changed
+11 -6

No files matched your search

+2 -1
View File
@@ -511,8 +511,9 @@ static CV_PossibleValue_t sloperolldist_cons_t[] = {
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
consvar_t cv_sloperolldist = {"sloperolldist", "Infinite", CV_SAVE, sloperolldist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, PDistort_menu_Onchange, 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};
+1 -1
View File
@@ -6446,7 +6446,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (cv_sloperolldist.value > 0)
usedist = true;
if (cv_sloperoll.value == 1)
if ((cv_spriteroll.value) && (cv_sloperoll.value))
{
if ((!player->mo->salty_jump)) // seeing a character rotate mid-hop looks really janky
K_RollMobjBySlopes(player->mo, usedist);
+4 -3
View File
@@ -2061,15 +2061,16 @@ static menuitem_t OP_PlayerDistortMenu[] =
{
{IT_HEADER, NULL, "Sprite Distortion", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Rotate Objects on Slopes", &cv_sloperoll, 20},
{IT_STRING | IT_CVAR, NULL, "Sprite Rotation", &cv_spriteroll, 10},
{IT_STRING | IT_CVAR, NULL, "Sprite Slope Rotation", &cv_sloperoll, 20},
{IT_STRING | IT_CVAR, NULL, "Slope Rotation Distance", &cv_sloperolldist, 35},
{IT_STRING | IT_CVAR, NULL, "Rotate Players when Sliptiding", &cv_sliptideroll, 50},
{IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 65},
{IT_STRING | IT_CVAR, NULL, "Player Stretch Factor", &cv_gravstretch, 80},
{IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 95},
{IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 110},
{IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 110},
{IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 125},
{IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 140},
{IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 140},
};
static const char* OP_PlayerDistortTooltips[] =
+4 -1
View File
@@ -6263,7 +6263,7 @@ void P_RollPitchMobj(mobj_t* mobj)
if (cv_sloperolldist.value > 0)
usedist = true;
if (cv_sloperoll.value == 1)
if ((cv_spriteroll.value) && (cv_sloperoll.value == 2))
{
K_RollMobjBySlopes(mobj, usedist);
}
@@ -6284,6 +6284,9 @@ angle_t P_MobjPitchAndRoll(mobj_t *mobj)
if (P_MobjWasRemoved(mobj))
return 0;
if (cv_spriteroll.value)
return 0;
size_t rot = mobj->frame & FF_FRAMEMASK;
boolean papersprite = (mobj->frame & FF_PAPERSPRITE);