From ad8d691c11aedb9e8a7578374df21c6797c97f6d Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 20 Feb 2024 13:16:50 +0100 Subject: [PATCH] kill this --- src/p_mobj.c | 24 ++++-------------------- src/r_main.c | 47 ----------------------------------------------- src/r_main.h | 4 +--- 3 files changed, 5 insertions(+), 70 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b31fb2dfe..8304e6a0f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -791,16 +791,8 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (mobj->player) - { - if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) + if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) return P_GetZAt(slope, testx, testy); - } - else - { - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) - return P_GetZAt(slope, testx, testy); - } // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point if (perfect) { @@ -875,16 +867,8 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (mobj->player) - { - if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) + if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) return P_GetZAt(slope, testx, testy); - } - else - { - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) - return P_GetZAt(slope, testx, testy); - } // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point if (perfect) { @@ -960,7 +944,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) + if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) return P_GetZAt(slope, testx, testy); // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point @@ -1036,7 +1020,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) + if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) return P_GetZAt(slope, testx, testy); // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point diff --git a/src/r_main.c b/src/r_main.c index 0a3426aad..7474a4e77 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1062,52 +1062,6 @@ void R_Init(void) framecount = 0; } - -// -// R_IsPointInSector -// -boolean R_IsPointInSector(sector_t *sector, fixed_t x, fixed_t y) -{ - size_t i; - size_t passes = 0; - - for (i = 0; i < sector->linecount; i++) - { - line_t *line = sector->lines[i]; - vertex_t *v1, *v2; - - if (line->frontsector == line->backsector) - continue; - - v1 = line->v1; - v2 = line->v2; - - // make sure v1 is below v2 - if (v1->y > v2->y) - { - vertex_t *tmp = v1; - v1 = v2; - v2 = tmp; - } - else if (v1->y == v2->y) - // horizontal line, we can't match this - continue; - - if (v1->y < y && y <= v2->y) - { - // if the y axis in inside the line, find the point where we intersect on the x axis... - fixed_t vx = v1->x + (INT64)(v2->x - v1->x) * (y - v1->y) / (v2->y - v1->y); - - // ...and if that point is to the left of the point, count it as inside. - if (vx < x) - passes++; - } - } - - // and odd number of passes means we're inside the polygon. - return passes % 2; -} - // // R_PointInSubsector // @@ -1146,7 +1100,6 @@ subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y) ret = &subsectors[nodenum & ~NF_SUBSECTOR]; for (i = 0; i < ret->numlines; i++) - //if (R_PointOnSegSide(x, y, &segs[ret->firstline + i])) -- breaks in ogl because polyvertex_t cast over vertex pointers if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side) return 0; diff --git a/src/r_main.h b/src/r_main.h index d8d014a89..71f314fd6 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -76,14 +76,12 @@ fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1); angle_t R_PlayerSliptideAngle(player_t *player); fixed_t R_ScaleFromGlobalAngle(angle_t visangle); -boolean R_IsPointInSector(sector_t *sector, fixed_t x, fixed_t y); subsector_t *R_PointInSubsector(fixed_t x, fixed_t y); subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y); boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixed_t bottomh, fixed_t toph); // Performance stats - extern precise_t ps_prevframetime;// time when previous frame was rendered extern ps_metric_t ps_rendercalltime; extern ps_metric_t ps_otherrendertime; @@ -114,7 +112,7 @@ extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4; extern consvar_t cv_shadow, cv_shadowoffs; extern consvar_t cv_ffloorclip, cv_spriteclip; extern consvar_t cv_translucency; -extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip, cv_lessprecip; +extern consvar_t cv_drawdist, cv_drawdist_precip, cv_lessprecip; extern consvar_t cv_fov; extern consvar_t cv_skybox; extern consvar_t cv_tailspickup;