From a06c4a8c9825406a8830f85a323fa1dd2b14ac0e Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 18 May 2020 15:23:56 +0200 Subject: [PATCH] Rename P_GetZAt to P_GetSlopeZAt and P_GetZAt2 to P_GetZAt --- src/am_map.c | 4 ++-- src/hardware/hw_main.c | 24 ++++++++++++------------ src/lua_baselib.c | 12 ++++++++---- src/m_cheat.c | 2 +- src/p_floor.c | 4 ++-- src/p_mobj.c | 32 ++++++++++++++++---------------- src/p_slopes.c | 18 +++++++++--------- src/p_slopes.h | 6 +++--- src/p_user.c | 6 +++--- src/r_bsp.c | 4 ++-- src/r_plane.c | 14 +++++++------- src/r_segs.c | 16 ++++++++-------- src/r_things.c | 4 ++-- 13 files changed, 75 insertions(+), 71 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 79087278a..53a7480a5 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -931,8 +931,8 @@ static inline void AM_drawWalls(void) l.b.y = lines[i].v2->y >> FRACTOMAPBITS; #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, lines[i].v1->x, lines[i].v1->y, normalheight); \ - end2 = P_GetZAt2(slope, lines[i].v2->x, lines[i].v2->y, normalheight); + end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y, normalheight); \ + end2 = P_GetZAt(slope, lines[i].v2->x, lines[i].v2->y, normalheight); SLOPEPARAMS(lines[i].frontsector->f_slope, frontf1, frontf2, lines[i].frontsector->floorheight) SLOPEPARAMS(lines[i].frontsector->c_slope, frontc1, frontc2, lines[i].frontsector->ceilingheight) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 7942ba128..26013f779 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -513,7 +513,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is // Set fixedheight to the slope's height from our viewpoint, if we have a slope if (slope) - fixedheight = P_GetZAt(slope, viewx, viewy); + fixedheight = P_GetSlopeZAt(slope, viewx, viewy); height = FIXED_TO_FLOAT(fixedheight); @@ -665,7 +665,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is if (slope) { - fixedheight = P_GetZAt(slope, FLOAT_TO_FIXED(pv->x), FLOAT_TO_FIXED(pv->y)); + fixedheight = P_GetSlopeZAt(slope, FLOAT_TO_FIXED(pv->x), FLOAT_TO_FIXED(pv->y)); v3d->y = FIXED_TO_FLOAT(fixedheight); } } @@ -686,7 +686,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is sector_t *psector = gr_frontsector; if (slope) - fixedheight = P_GetZAt(slope, psector->soundorg.x, psector->soundorg.y); + fixedheight = P_GetSlopeZAt(slope, psector->soundorg.x, psector->soundorg.y); if (psector->ffloors) { @@ -1062,8 +1062,8 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, float endpegt, endpegb, endpegmul; float endheight = 0.0f, endbheight = 0.0f; - // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly - // use this as a temp var to store P_GetZAt's return value each time + // compiler complains when P_GetSlopeZAt is used in FLOAT_TO_FIXED directly + // use this as a temp var to store P_GetSlopeZAt's return value each time fixed_t temp; fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x); @@ -1290,8 +1290,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) v2y = FLOAT_TO_FIXED(ve.y); #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, v1x, v1y, normalheight); \ - end2 = P_GetZAt2(slope, v2x, v2y, normalheight); + end1 = P_GetZAt(slope, v1x, v1y, normalheight); \ + end2 = P_GetZAt(slope, v2x, v2y, normalheight); SLOPEPARAMS(gr_frontsector->c_slope, worldtop, worldtopslope, gr_frontsector->ceilingheight) SLOPEPARAMS(gr_frontsector->f_slope, worldbottom, worldbottomslope, gr_frontsector->floorheight) @@ -2158,8 +2158,8 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks v2x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->x); v2y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->y); #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, v1x, v1y, normalheight); \ - end2 = P_GetZAt2(slope, v2x, v2y, normalheight); + end1 = P_GetZAt(slope, v1x, v1y, normalheight); \ + end2 = P_GetZAt(slope, v2x, v2y, normalheight); SLOPEPARAMS(afrontsector->f_slope, frontf1, frontf2, afrontsector-> floorheight) SLOPEPARAMS(afrontsector->c_slope, frontc1, frontc2, afrontsector->ceilingheight) @@ -2714,8 +2714,8 @@ static void HWR_AddLine(seg_t * line) fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, v1x, v1y, normalheight); \ - end2 = P_GetZAt2(slope, v2x, v2y, normalheight); + end1 = P_GetZAt(slope, v1x, v1y, normalheight); \ + end2 = P_GetZAt(slope, v2x, v2y, normalheight); SLOPEPARAMS(gr_frontsector->f_slope, frontf1, frontf2, gr_frontsector-> floorheight) SLOPEPARAMS(gr_frontsector->c_slope, frontc1, frontc2, gr_frontsector->ceilingheight) @@ -3898,7 +3898,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale { for (i = 0; i < 4; i++) { - slopez = P_GetZAt(floorslope, FLOAT_TO_FIXED(shadowVerts[i].x), FLOAT_TO_FIXED(shadowVerts[i].z)); + slopez = P_GetSlopeZAt(floorslope, FLOAT_TO_FIXED(shadowVerts[i].x), FLOAT_TO_FIXED(shadowVerts[i].z)); shadowVerts[i].y = FIXED_TO_FLOAT(slopez) + 0.05f; } } diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 3379ad3aa..b25915e6b 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -14,7 +14,7 @@ #include "fastcmp.h" #include "p_local.h" #include "p_setup.h" // So we can have P_SetupLevelSky -#include "p_slopes.h" // P_GetZAt +#include "p_slopes.h" // P_GetSlopeZAt #include "z_zone.h" #include "r_main.h" #include "r_draw.h" @@ -2182,10 +2182,14 @@ static int lib_pGetZAt(lua_State *L) fixed_t x = luaL_checkfixed(L, 2); fixed_t y = luaL_checkfixed(L, 3); //HUDSAFE - if (!slope) - return LUA_ErrInvalid(L, "pslope_t"); + if (slope) + lua_pushfixed(L, P_GetSlopeZAt(slope, x, y)); + else + { + fixed_t z = luaL_checkfixed(L, 4); + lua_pushfixed(L, P_GetZAt(slope, x, y, z)); + } - lua_pushfixed(L, P_GetZAt(slope, x, y)); return 1; } diff --git a/src/m_cheat.c b/src/m_cheat.c index 30306c55e..e705f26d8 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1026,7 +1026,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling) if (ceiling) { // Truncate position to match where mapthing would be when spawned - // (this applies to every further P_GetZAt call as well) + // (this applies to every further P_GetSlopeZAt call as well) fixed_t cheight = P_GetSectorCeilingZAt(sec, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000); if (((cheight - player->mo->z - player->mo->height)>>FRACBITS) >= (1 << (16-ZSHIFT))) diff --git a/src/p_floor.c b/src/p_floor.c index b8b40df3c..5da0a1833 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -3177,9 +3177,9 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) { mobj_t *spawned = NULL; if (*rover->t_slope) - topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1); + topz = P_GetSlopeZAt(*rover->t_slope, a, b) - (spacing>>1); if (*rover->b_slope) - bottomz = P_GetZAt(*rover->b_slope, a, b); + bottomz = P_GetSlopeZAt(*rover->b_slope, a, b); for (c = topz; c > bottomz; c -= spacing) { diff --git a/src/p_mobj.c b/src/p_mobj.c index c678e2d4a..20b9a1144 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -958,12 +958,12 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line, /*CONS_Printf("BEFORE: v1 = %f %f %f\n", FIXED_TO_FLOAT(v1.x), FIXED_TO_FLOAT(v1.y), - FIXED_TO_FLOAT(P_GetZAt(slope, v1.x, v1.y)) + FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v1.x, v1.y)) ); CONS_Printf(" v2 = %f %f %f\n", FIXED_TO_FLOAT(v2.x), FIXED_TO_FLOAT(v2.y), - FIXED_TO_FLOAT(P_GetZAt(slope, v2.x, v2.y)) + FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v2.x, v2.y)) );*/ if (abs(v1.x-x) > radius) { @@ -1021,24 +1021,24 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line, /*CONS_Printf("AFTER: v1 = %f %f %f\n", FIXED_TO_FLOAT(v1.x), FIXED_TO_FLOAT(v1.y), - FIXED_TO_FLOAT(P_GetZAt(slope, v1.x, v1.y)) + FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v1.x, v1.y)) ); CONS_Printf(" v2 = %f %f %f\n", FIXED_TO_FLOAT(v2.x), FIXED_TO_FLOAT(v2.y), - FIXED_TO_FLOAT(P_GetZAt(slope, v2.x, v2.y)) + FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v2.x, v2.y)) );*/ // Return the higher of the two points if (actuallylowest) return min( - P_GetZAt(slope, v1.x, v1.y), - P_GetZAt(slope, v2.x, v2.y) + P_GetSlopeZAt(slope, v1.x, v1.y), + P_GetSlopeZAt(slope, v2.x, v2.y) ); else return max( - P_GetZAt(slope, v1.x, v1.y), - P_GetZAt(slope, v2.x, v2.y) + P_GetSlopeZAt(slope, v1.x, v1.y), + P_GetSlopeZAt(slope, v2.x, v2.y) ); } @@ -1072,7 +1072,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t // If the highest point is in the sector, then we have it easy! Just get the Z at that point if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) - return P_GetZAt(slope, testx, testy); + return P_GetSlopeZAt(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) { @@ -1112,7 +1112,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t // If we're just testing for base sector location (no collision line), just go for the center's spot... // It'll get fixed when we test for collision anyway, and the final result can't be lower than this if (line == NULL) - return P_GetZAt(slope, x, y); + return P_GetSlopeZAt(slope, x, y); return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the floor height @@ -1149,7 +1149,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed // If the highest point is in the sector, then we have it easy! Just get the Z at that point if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) - return P_GetZAt(slope, testx, testy); + return P_GetSlopeZAt(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) { @@ -1189,7 +1189,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed // If we're just testing for base sector location (no collision line), just go for the center's spot... // It'll get fixed when we test for collision anyway, and the final result can't be lower than this if (line == NULL) - return P_GetZAt(slope, x, y); + return P_GetSlopeZAt(slope, x, y); return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the ceiling height @@ -1227,7 +1227,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix // If the highest point is in the sector, then we have it easy! Just get the Z at that point if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) - return P_GetZAt(slope, testx, testy); + return P_GetSlopeZAt(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) { @@ -1267,7 +1267,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix // If we're just testing for base sector location (no collision line), just go for the center's spot... // It'll get fixed when we test for collision anyway, and the final result can't be lower than this if (line == NULL) - return P_GetZAt(slope, x, y); + return P_GetSlopeZAt(slope, x, y); return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the floor height @@ -1304,7 +1304,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f // If the highest point is in the sector, then we have it easy! Just get the Z at that point if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) - return P_GetZAt(slope, testx, testy); + return P_GetSlopeZAt(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) { @@ -1344,7 +1344,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f // If we're just testing for base sector location (no collision line), just go for the center's spot... // It'll get fixed when we test for collision anyway, and the final result can't be lower than this if (line == NULL) - return P_GetZAt(slope, x, y); + return P_GetSlopeZAt(slope, x, y); return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the ceiling height diff --git a/src/p_slopes.c b/src/p_slopes.c index 4b3b0aad1..940a37f19 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -656,7 +656,7 @@ void P_SpawnSlopes(const boolean fromsave) { // // Returns the height of the sloped plane at (x, y) as a fixed_t -fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y) +fixed_t P_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y) { fixed_t dist = FixedMul(x - slope->o.x, slope->d.x) + FixedMul(y - slope->o.y, slope->d.y); @@ -664,40 +664,40 @@ fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y) return slope->o.z + FixedMul(dist, slope->zdelta); } -// Like P_GetZAt but falls back to z if slope is NULL -fixed_t P_GetZAt2(const pslope_t *slope, fixed_t x, fixed_t y, fixed_t z) +// Like P_GetSlopeZAt but falls back to z if slope is NULL +fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y, fixed_t z) { - return slope ? P_GetZAt(slope, x, y) : z; + return slope ? P_GetSlopeZAt(slope, x, y) : z; } // Returns the height of the sector floor at (x, y) fixed_t P_GetSectorFloorZAt(const sector_t *sector, fixed_t x, fixed_t y) { - return sector->f_slope ? P_GetZAt(sector->f_slope, x, y) : sector->floorheight; + return sector->f_slope ? P_GetSlopeZAt(sector->f_slope, x, y) : sector->floorheight; } // Returns the height of the sector ceiling at (x, y) fixed_t P_GetSectorCeilingZAt(const sector_t *sector, fixed_t x, fixed_t y) { - return sector->c_slope ? P_GetZAt(sector->c_slope, x, y) : sector->ceilingheight; + return sector->c_slope ? P_GetSlopeZAt(sector->c_slope, x, y) : sector->ceilingheight; } // Returns the height of the FOF top at (x, y) fixed_t P_GetFFloorTopZAt(const ffloor_t *ffloor, fixed_t x, fixed_t y) { - return *ffloor->t_slope ? P_GetZAt(*ffloor->t_slope, x, y) : *ffloor->topheight; + return *ffloor->t_slope ? P_GetSlopeZAt(*ffloor->t_slope, x, y) : *ffloor->topheight; } // Returns the height of the FOF bottom at (x, y) fixed_t P_GetFFloorBottomZAt(const ffloor_t *ffloor, fixed_t x, fixed_t y) { - return *ffloor->b_slope ? P_GetZAt(*ffloor->b_slope, x, y) : *ffloor->bottomheight; + return *ffloor->b_slope ? P_GetSlopeZAt(*ffloor->b_slope, x, y) : *ffloor->bottomheight; } // Returns the height of the light list at (x, y) fixed_t P_GetLightZAt(const lightlist_t *light, fixed_t x, fixed_t y) { - return light->slope ? P_GetZAt(light->slope, x, y) : light->height; + return light->slope ? P_GetSlopeZAt(light->slope, x, y) : light->height; } diff --git a/src/p_slopes.h b/src/p_slopes.h index 3032b3de2..06d900b66 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -33,10 +33,10 @@ void P_CopySectorSlope(line_t *line); pslope_t *P_SlopeById(UINT16 id); // Returns the height of the sloped plane at (x, y) as a fixed_t -fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y); +fixed_t P_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y); -// Like P_GetZAt but falls back to z if slope is NULL -fixed_t P_GetZAt2(const pslope_t *slope, fixed_t x, fixed_t y, fixed_t z); +// Like P_GetSlopeZAt but falls back to z if slope is NULL +fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y, fixed_t z); // Returns the height of the sector at (x, y) fixed_t P_GetSectorFloorZAt (const sector_t *sector, fixed_t x, fixed_t y); diff --git a/src/p_user.c b/src/p_user.c index 141cc577c..6b43c6f9c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7748,7 +7748,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) if (player->mo->standingslope) { - ground = P_GetZAt(player->mo->standingslope, newx, newy); + ground = P_GetSlopeZAt(player->mo->standingslope, newx, newy); if (player->mo->eflags & MFE_VERTICALFLIP) ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); } @@ -11103,8 +11103,8 @@ static void P_MinecartThink(player_t *player) if (minecart->standingslope) { fixed_t fa2 = (minecart->angle >> ANGLETOFINESHIFT) & FINEMASK; - fixed_t front = P_GetZAt(minecart->standingslope, minecart->x, minecart->y); - fixed_t back = P_GetZAt(minecart->standingslope, minecart->x - FINECOSINE(fa2), minecart->y - FINESINE(fa2)); + fixed_t front = P_GetSlopeZAt(minecart->standingslope, minecart->x, minecart->y); + fixed_t back = P_GetSlopeZAt(minecart->standingslope, minecart->x - FINECOSINE(fa2), minecart->y - FINESINE(fa2)); if (abs(front - back) < 3*FRACUNIT) currentSpeed += (back - front)/3; diff --git a/src/r_bsp.c b/src/r_bsp.c index 457a9f7cb..3474b5f69 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -500,8 +500,8 @@ static void R_AddLine(seg_t *line) fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, line->v1->x, line->v1->y, normalheight); \ - end2 = P_GetZAt2(slope, line->v2->x, line->v2->y, normalheight); + end1 = P_GetZAt(slope, line->v1->x, line->v1->y, normalheight); \ + end2 = P_GetZAt(slope, line->v2->x, line->v2->y, normalheight); SLOPEPARAMS(frontsector->f_slope, frontf1, frontf2, frontsector-> floorheight) SLOPEPARAMS(frontsector->c_slope, frontc1, frontc2, frontsector->ceilingheight) diff --git a/src/r_plane.c b/src/r_plane.c index ca5aa758e..79273c33a 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -851,15 +851,15 @@ static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge) floatv3_t p, m, n; float ang; float vx, vy, vz; - // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly - // use this as a temp var to store P_GetZAt's return value each time + // compiler complains when P_GetSlopeZAt is used in FLOAT_TO_FIXED directly + // use this as a temp var to store P_GetSlopeZAt's return value each time fixed_t temp; vx = FIXED_TO_FLOAT(pl->viewx+xoffs); vy = FIXED_TO_FLOAT(pl->viewy-yoffs); vz = FIXED_TO_FLOAT(pl->viewz); - temp = P_GetZAt(pl->slope, pl->viewx, pl->viewy); + temp = P_GetSlopeZAt(pl->slope, pl->viewx, pl->viewy); zeroheight = FIXED_TO_FLOAT(temp); // p is the texture origin in view space @@ -868,7 +868,7 @@ static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge) ang = ANG2RAD(ANGLE_270 - pl->viewangle); p.x = vx * cos(ang) - vy * sin(ang); p.z = vx * sin(ang) + vy * cos(ang); - temp = P_GetZAt(pl->slope, -xoffs, yoffs); + temp = P_GetSlopeZAt(pl->slope, -xoffs, yoffs); p.y = FIXED_TO_FLOAT(temp) - vz; // m is the v direction vector in view space @@ -881,9 +881,9 @@ static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge) n.z = -cos(ang); ang = ANG2RAD(pl->plangle); - temp = P_GetZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(sin(ang)), pl->viewy + FLOAT_TO_FIXED(cos(ang))); + temp = P_GetSlopeZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(sin(ang)), pl->viewy + FLOAT_TO_FIXED(cos(ang))); m.y = FIXED_TO_FLOAT(temp) - zeroheight; - temp = P_GetZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(cos(ang)), pl->viewy - FLOAT_TO_FIXED(sin(ang))); + temp = P_GetSlopeZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(cos(ang)), pl->viewy - FLOAT_TO_FIXED(sin(ang))); n.y = FIXED_TO_FLOAT(temp) - zeroheight; if (ds_powersoftwo) @@ -1193,7 +1193,7 @@ void R_DrawSinglePlane(visplane_t *pl) if (itswater) { INT32 i; - fixed_t plheight = abs(P_GetZAt(pl->slope, pl->viewx, pl->viewy) - pl->viewz); + fixed_t plheight = abs(P_GetSlopeZAt(pl->slope, pl->viewx, pl->viewy) - pl->viewz); fixed_t rxoffs = xoffs; fixed_t ryoffs = yoffs; diff --git a/src/r_segs.c b/src/r_segs.c index 4d406cdb3..15dec20dc 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -805,8 +805,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) rlight = &dc_lightlist[p]; #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, ds-> leftpos.x, ds-> leftpos.y, normalheight); \ - end2 = P_GetZAt2(slope, ds->rightpos.x, ds->rightpos.y, normalheight); + end1 = P_GetZAt(slope, ds-> leftpos.x, ds-> leftpos.y, normalheight); \ + end2 = P_GetZAt(slope, ds->rightpos.x, ds->rightpos.y, normalheight); SLOPEPARAMS(light->slope, leftheight, rightheight, light->height) SLOPEPARAMS(*pfloor->b_slope, pfloorleft, pfloorright, *pfloor->bottomheight) @@ -819,8 +819,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (leftheight > pfloorleft && rightheight > pfloorright && i+1 < dc_numlights) { lightlist_t *nextlight = &frontsector->lightlist[i+1]; - if (P_GetZAt2(nextlight->slope, ds-> leftpos.x, ds-> leftpos.y, nextlight->height) > pfloorleft - && P_GetZAt2(nextlight->slope, ds->rightpos.x, ds->rightpos.y, nextlight->height) > pfloorright) + if (P_GetZAt(nextlight->slope, ds-> leftpos.x, ds-> leftpos.y, nextlight->height) > pfloorleft + && P_GetZAt(nextlight->slope, ds->rightpos.x, ds->rightpos.y, nextlight->height) > pfloorright) continue; } @@ -1777,8 +1777,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) #define SLOPEPARAMS(slope, end1, end2, normalheight) \ - end1 = P_GetZAt2(slope, segleft.x, segleft.y, normalheight); \ - end2 = P_GetZAt2(slope, segright.x, segright.y, normalheight); + end1 = P_GetZAt(slope, segleft.x, segleft.y, normalheight); \ + end2 = P_GetZAt(slope, segright.x, segright.y, normalheight); SLOPEPARAMS(frontsector->c_slope, worldtop, worldtopslope, frontsector->ceilingheight) SLOPEPARAMS(frontsector->f_slope, worldbottom, worldbottomslope, frontsector->floorheight) @@ -1809,8 +1809,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; #endif - ffloor[i].f_pos = P_GetZAt2(ffloor[i].slope, segleft .x, segleft .y, ffloor[i].height) - viewz; - ffloor[i].f_pos_slope = P_GetZAt2(ffloor[i].slope, segright.x, segright.y, ffloor[i].height) - viewz; + ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft .x, segleft .y, ffloor[i].height) - viewz; + ffloor[i].f_pos_slope = P_GetZAt(ffloor[i].slope, segright.x, segright.y, ffloor[i].height) - viewz; } } diff --git a/src/r_things.c b/src/r_things.c index 016cf283f..00b7e5554 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2387,8 +2387,8 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps continue; // Effective height may be different for each comparison in the case of slopes - planeobjectz = P_GetZAt2(r2->plane->slope, rover->gx, rover->gy, r2->plane->height); - planecameraz = P_GetZAt2(r2->plane->slope, viewx, viewy, r2->plane->height); + planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy, r2->plane->height); + planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy, r2->plane->height); if (rover->mobjflags & MF_NOCLIPHEIGHT) {