From 568890e9b38bc664c1e3a7dafa58b4ef908d9c4d Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 7 Mar 2025 09:51:29 +0100 Subject: [PATCH] remove erronous cv_sloperoll checks this cvar is meant to be only the toggle for the player slope rotation, however, spriterotation should still be usable in any case with this disabled. the global toggle "cv_spriteroll" has been removed i kinda forgot to remove those when i did some refactoring ealier --- src/hardware/hw_main.c | 4 ++-- src/hardware/hw_md2.c | 2 +- src/lua_hudlib.c | 18 ++++++------------ src/m_menu.c | 15 ++------------- src/r_main.c | 2 +- src/r_things.c | 4 ++-- 6 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2a921b480..e01da4d4e 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4646,8 +4646,8 @@ static void HWR_ProjectSprite(mobj_t *thing) #ifdef ROTSPRITE // determine here if sprite should rotate for optimization - 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)); + const boolean sliprollrotate = (cv_sliptideroll.value && (thing->player && thing->player->sliproll)); + const boolean shouldrotate = (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/hardware/hw_md2.c b/src/hardware/hw_md2.c index 7d10e62d7..611871a9a 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1383,7 +1383,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr) p.angley = FIXED_TO_FLOAT(anglef); } - const angle_t sliptideroll = ((cv_sloperoll.value && cv_sliptideroll.value && spr->mobj->player) ? spr->mobj->player->sliproll : 0); + const angle_t sliptideroll = ((cv_sliptideroll.value && spr->mobj->player) ? spr->mobj->player->sliproll : 0); const SINT8 flipfactor = flip ? -1 : 1; if (spr->mobj->rollangle || sliptideroll) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 7d5d03a80..ccafd59aa 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -401,17 +401,10 @@ static int libd_cachePatch(lua_State *L) static int libd_cachePatchRotated(lua_State *L) { HUDONLY - if (cv_sloperoll.value) - { - angle_t rollangle = luaL_checkangle(L, 2); - INT32 rot = R_GetRollAngle(rollangle); + angle_t rollangle = luaL_checkangle(L, 2); + INT32 rot = R_GetRollAngle(rollangle); + LUA_PushUserdata(L, W_CachePatchNameRotated(luaL_checkstring(L, 1), rot, PU_STATIC), META_PATCH); - LUA_PushUserdata(L, W_CachePatchNameRotated(luaL_checkstring(L, 1), rot, PU_STATIC), META_PATCH); - } - else - { - LUA_PushUserdata(L, W_CachePatchName(luaL_checkstring(L, 1), PU_STATIC), META_PATCH); - } return 1; } #endif @@ -508,12 +501,13 @@ static int libd_getSpritePatch(lua_State *L) angle = (angle & 7); // modulus angle by 8 // rotsprite????? - if (lua_isnumber(L, 4) && cv_sloperoll.value) + if (lua_isnumber(L, 4)) { angle_t rollangle = luaL_checkangle(L, 4); INT32 rot = R_GetRollAngle(rollangle); - if (rot) { + if (rot) + { patch_t *rotsprite = Patch_GetRotatedSprite(sprframe, frame, angle, sprframe->flip & (1<mo)) + if (!cv_sliptideroll.value || !player || P_MobjWasRemoved(player->mo)) return 0; mo = player->mo; diff --git a/src/r_things.c b/src/r_things.c index 35a30f8ea..5a955d1fa 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1264,8 +1264,8 @@ static void R_ProjectSprite(mobj_t *thing) #ifdef ROTSPRITE // determine here if sprite should rotate for optimization - 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)); + const boolean sliprollrotate = (cv_sliptideroll.value && (thing->player && thing->player->sliproll)); + const boolean shouldrotate = (interp.roll || interp.pitch || interp.sloperoll || interp.slopepitch || thing->rollangle || sliprollrotate); #endif //Fab : 02-08-98: 'skin' override spritedef currently used for skin