From 4e73c05ef9cecb763aa6c11448b8b4f6240de7c2 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 10 Jul 2024 09:50:25 +0200 Subject: [PATCH] remove R_Pointtoangle toggle its bloat, the difference is negigble at best --- src/m_menu.c | 4 ---- src/r_bsp.c | 25 ++++--------------------- src/r_main.c | 28 ---------------------------- src/r_main.h | 1 - src/tables.h | 2 +- 5 files changed, 5 insertions(+), 55 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index df496815d..3055fc222 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1461,8 +1461,6 @@ static menuitem_t OP_ExpOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 42}, - {IT_STRING | IT_CVAR, NULL, "Clipping R_PointToAngle Version", &cv_pointoangleexor64, 49}, - {IT_STRING | IT_CVAR, NULL, "FFloorclip", &cv_ffloorclip, 56}, {IT_STRING | IT_CVAR, NULL, "Spriteclip", &cv_spriteclip, 61}, #ifdef HWRENDER @@ -1482,7 +1480,6 @@ static const char* OP_ExpTooltips[] = "Should weather be interpolated? Weather should look about the\nsame but perform a bit better when disabled.", "When weather is on this will cut the object amount used in half.", "Toggle being able to see the sky.", - "Which version of R_PointToAngle should\nbe used for Sector Clipping?\n64 may fix rendering issues on larger maps\nat the cost of performance.", "Hides 3DFloors which are not visible\npotentially resulting in a performance boost.", "Hides Sprites which are not visible\npotentially resulting in a performance boost.", #ifdef HWRENDER @@ -1501,7 +1498,6 @@ enum op_exp_precipinter, op_exp_lessprecip, op_exp_skybox, - op_exp_angleshit, op_exp_ffclip, op_exp_sprclip, #ifdef HWRENDER diff --git a/src/r_bsp.c b/src/r_bsp.c index 0795fea15..10f8225f5 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -420,17 +420,8 @@ static void R_AddLine(seg_t *line) return; // big room fix - - if (cv_pointoangleexor64.value) - { - angle1 = R_PointToAngle64(line->v1->x, line->v1->y); - angle2 = R_PointToAngle64(line->v2->x, line->v2->y); - } - else - { - angle1 = R_PointToAngleEx(viewx, viewy, line->v1->x, line->v1->y); - angle2 = R_PointToAngleEx(viewx, viewy, line->v2->x, line->v2->y); - } + angle1 = R_PointToAngle64(line->v1->x, line->v1->y); + angle2 = R_PointToAngle64(line->v2->x, line->v2->y); curline = line; @@ -652,16 +643,8 @@ static boolean R_CheckBBox(const fixed_t *bspcoord) check = checkcoord[boxpos]; // big room fix - if (cv_pointoangleexor64.value) - { - angle1 = R_PointToAngle64(bspcoord[check[0]], bspcoord[check[1]]) - viewangle; - angle2 = R_PointToAngle64(bspcoord[check[2]], bspcoord[check[3]]) - viewangle; - } - else - { - angle1 = R_PointToAngleEx(viewx, viewy, bspcoord[check[0]], bspcoord[check[1]]) - viewangle; - angle2 = R_PointToAngleEx(viewx, viewy, bspcoord[check[2]], bspcoord[check[3]]) - viewangle; - } + angle1 = R_PointToAngle64(bspcoord[check[0]], bspcoord[check[1]]) - viewangle; + angle2 = R_PointToAngle64(bspcoord[check[2]], bspcoord[check[3]]) - viewangle; if ((signed)angle1 < (signed)angle2) { diff --git a/src/r_main.c b/src/r_main.c index 04ab84ac3..e5f0df5aa 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -220,9 +220,6 @@ consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL consvar_t cv_maxportals = {"maxportals", "2", CV_SAVE, maxportals_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -static CV_PossibleValue_t pointoangle_cons_t[] = {{0, "Ex"}, {1, "64"}, {0, NULL}}; -consvar_t cv_pointoangleexor64 = {"r_pointtoangle", "64", CV_SAVE, pointoangle_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; - void SplitScreen_OnChange(void) { UINT8 i; @@ -426,29 +423,6 @@ angle_t R_PointToAngle64(INT64 x, INT64 y) 0; } -angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1) -{ - INT64 dx = x1-x2; - INT64 dy = y1-y2; - if (dx < INT32_MIN || dx > INT32_MAX || dy < INT32_MIN || dy > INT32_MAX) - { - x1 = (int)(dx / 2 + x2); - y1 = (int)(dy / 2 + y2); - } - return (y1 -= y2, (x1 -= x2) || y1) ? - x1 >= 0 ? - y1 >= 0 ? - (x1 > y1) ? tantoangle[SlopeDivEx(y1,x1)] : // octant 0 - ANGLE_90-tantoangle[SlopeDivEx(x1,y1)] : // octant 1 - x1 > (y1 = -y1) ? 0-tantoangle[SlopeDivEx(y1,x1)] : // octant 8 - ANGLE_270+tantoangle[SlopeDivEx(x1,y1)] : // octant 7 - y1 >= 0 ? (x1 = -x1) > y1 ? ANGLE_180-tantoangle[SlopeDivEx(y1,x1)] : // octant 3 - ANGLE_90 + tantoangle[SlopeDivEx(x1,y1)] : // octant 2 - (x1 = -x1) > (y1 = -y1) ? ANGLE_180+tantoangle[SlopeDivEx(y1,x1)] : // octant 4 - ANGLE_270-tantoangle[SlopeDivEx(x1,y1)] : // octant 5 - 0; -} - angle_t R_PointToAngle2(fixed_t pviewx, fixed_t pviewy, fixed_t x, fixed_t y) { return (y -= pviewy, (x -= pviewx) || y) ? @@ -1893,8 +1867,6 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_uncappedhud); CV_RegisterVar(&cv_maxportals); - - CV_RegisterVar(&cv_pointoangleexor64); CV_RegisterVar(&cv_grmaxinterpdist); diff --git a/src/r_main.h b/src/r_main.h index 7c2249873..1a589088d 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -72,7 +72,6 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *node); INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line); angle_t R_PointToAngle(fixed_t x, fixed_t y); angle_t R_PointToAngle64(INT64 x, INT64 y); -angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1); angle_t R_PointToAngle2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1); fixed_t R_PointToDist(fixed_t x, fixed_t y); fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1); diff --git a/src/tables.h b/src/tables.h index 761a6499e..0ea09caf6 100644 --- a/src/tables.h +++ b/src/tables.h @@ -86,7 +86,7 @@ extern angle_t tantoangle[SLOPERANGE+1]; // Utility function, called by R_PointToAngle. FUNCMATH unsigned SlopeDiv(unsigned num, unsigned den); -// Only called by R_PointToAngleEx +// Only called by R_PointToAngle64 FUNCMATH UINT64 SlopeDivEx(unsigned int num, unsigned int den); // 360 - angle_t(ANGLE_45) = ANGLE_315