From 892a8dd6e7832d2f3139b7315946b953d2ce3daf Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 20 Mar 2020 18:55:29 +0100 Subject: [PATCH] Make SRB2 flat like Earth --- src/am_map.c | 33 +--- src/dehacked.c | 3 +- src/doomdef.h | 5 - src/hardware/hw_main.c | 305 ++---------------------------- src/hardware/hw_trick.c | 4 - src/lua_baselib.c | 6 - src/lua_libs.h | 2 - src/lua_maplib.c | 26 --- src/lua_mobjlib.c | 8 - src/lua_script.c | 10 - src/m_cheat.c | 24 --- src/p_enemy.c | 5 - src/p_floor.c | 4 - src/p_local.h | 4 - src/p_map.c | 85 +-------- src/p_maputl.c | 28 --- src/p_maputl.h | 2 - src/p_mobj.c | 208 +++++--------------- src/p_mobj.h | 2 - src/p_saveg.c | 26 +-- src/p_setup.c | 6 - src/p_sight.c | 24 --- src/p_slopes.c | 5 - src/p_slopes.h | 3 - src/p_spec.c | 10 +- src/p_user.c | 93 +-------- src/r_bsp.c | 136 +++----------- src/r_defs.h | 10 - src/r_draw.c | 2 - src/r_draw.h | 6 - src/r_draw8.c | 2 - src/r_draw8_npo2.c | 5 - src/r_main.c | 2 - src/r_plane.c | 40 +--- src/r_plane.h | 9 +- src/r_segs.c | 407 +++------------------------------------- src/r_things.c | 29 +-- src/screen.c | 4 - src/screen.h | 2 - 39 files changed, 153 insertions(+), 1432 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 234df1abd..cdbaaf80a 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -920,10 +920,8 @@ static inline void AM_drawWalls(void) { size_t i; static mline_t l; -#ifdef ESLOPE fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends fixed_t backf1 = 0, backf2 = 0, backc1 = 0, backc2 = 0; // back floor ceiling ends -#endif for (i = 0; i < numlines; i++) { @@ -931,7 +929,7 @@ static inline void AM_drawWalls(void) l.a.y = lines[i].v1->y >> FRACTOMAPBITS; l.b.x = lines[i].v2->x >> FRACTOMAPBITS; l.b.y = lines[i].v2->y >> FRACTOMAPBITS; -#ifdef ESLOPE + #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y); \ @@ -946,7 +944,6 @@ static inline void AM_drawWalls(void) SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight) } #undef SLOPEPARAMS -#endif if (!lines[i].backsector) // 1-sided { @@ -955,19 +952,11 @@ static inline void AM_drawWalls(void) else AM_drawMline(&l, WALLCOLORS); } -#ifdef ESLOPE else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier || (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier { if (backf1 == backc1 && backf2 == backc2 && frontf1 == frontc1 && frontf2 == frontc2) // BOTH are thok barriers -#else - else if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight // Back is thok barrier - || lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // Front is thok barrier - { - if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight - && lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // BOTH are thok barriers -#endif { if (lines[i].flags & ML_NOCLIMB) AM_drawMline(&l, NOCLIMBTSWALLCOLORS); @@ -985,20 +974,10 @@ static inline void AM_drawWalls(void) else { if (lines[i].flags & ML_NOCLIMB) { -#ifdef ESLOPE if (backf1 != frontf1 || backf2 != frontf2) { -#else - if (lines[i].backsector->floorheight - != lines[i].frontsector->floorheight) { -#endif AM_drawMline(&l, NOCLIMBFDWALLCOLORS); // floor level change } -#ifdef ESLOPE else if (backc1 != frontc1 || backc2 != frontc2) { -#else - else if (lines[i].backsector->ceilingheight - != lines[i].frontsector->ceilingheight) { -#endif AM_drawMline(&l, NOCLIMBCDWALLCOLORS); // ceiling level change } else @@ -1006,20 +985,10 @@ static inline void AM_drawWalls(void) } else { -#ifdef ESLOPE if (backf1 != frontf1 || backf2 != frontf2) { -#else - if (lines[i].backsector->floorheight - != lines[i].frontsector->floorheight) { -#endif AM_drawMline(&l, FDWALLCOLORS); // floor level change } -#ifdef ESLOPE else if (backc1 != frontc1 || backc2 != frontc2) { -#else - else if (lines[i].backsector->ceilingheight - != lines[i].frontsector->ceilingheight) { -#endif AM_drawMline(&l, CDWALLCOLORS); // ceiling level change } else diff --git a/src/dehacked.c b/src/dehacked.c index 588b78142..c6cd0b9e5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9678,11 +9678,10 @@ struct { // Node flags {"NF_SUBSECTOR",NF_SUBSECTOR}, // Indicate a leaf. #endif -#ifdef ESLOPE + // Slope flags {"SL_NOPHYSICS",SL_NOPHYSICS}, {"SL_DYNAMIC",SL_DYNAMIC}, -#endif // Angles {"ANG1",ANG1}, diff --git a/src/doomdef.h b/src/doomdef.h index 71c885019..2ed66aecc 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -562,14 +562,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; // None of these that are disabled in the normal build are guaranteed to work perfectly // Compile them at your own risk! -/// Kalaron/Eternity Engine slope code (SRB2CB ported) -#define ESLOPE - -#ifdef ESLOPE /// Backwards compatibility with SRB2CB's slope linedef types. /// \note A simple shim that prints a warning. #define ESLOPE_TYPESHIM -#endif /// Allows the use of devmode in multiplayer. AKA "fishcake" //#define NETGAME_DEVMODE diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index efed9b602..c56f0ec06 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -42,9 +42,7 @@ #include "../m_cheat.h" #include "../f_finale.h" #include "../r_things.h" // R_GetShadowZ -#ifdef ESLOPE #include "../p_slopes.h" -#endif #include "hw_md2.h" #ifdef NEWCLIP @@ -486,9 +484,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is angle_t angle = 0; FSurfaceInfo Surf; fixed_t tempxsow, tempytow; -#ifdef ESLOPE pslope_t *slope = NULL; -#endif static FOutVector *planeVerts = NULL; static UINT16 numAllocedPlaneVerts = 0; @@ -499,7 +495,6 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is if (!xsub->planepoly) return; -#ifdef ESLOPE // Get the slope pointer to simplify future code if (FOFsector) { @@ -519,7 +514,6 @@ 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); -#endif height = FIXED_TO_FLOAT(fixedheight); @@ -669,13 +663,11 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is v3d->y = height; v3d->z = pv->y; -#ifdef ESLOPE if (slope) { fixedheight = P_GetZAt(slope, FLOAT_TO_FIXED(pv->x), FLOAT_TO_FIXED(pv->y)); v3d->y = FIXED_TO_FLOAT(fixedheight); } -#endif } // only useful for flat coloured triangles @@ -693,10 +685,8 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { sector_t *psector = gr_frontsector; -#ifdef ESLOPE if (slope) fixedheight = P_GetZAt(slope, psector->soundorg.x, psector->soundorg.y); -#endif if (psector->ffloors) { @@ -1068,7 +1058,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, float pegt, pegb, pegmul; float height = 0.0f, bheight = 0.0f; -#ifdef ESLOPE float endrealtop, endrealbot, endtop, endbot; float endpegt, endpegb, endpegmul; float endheight = 0.0f, endbheight = 0.0f; @@ -1076,7 +1065,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, // 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 fixed_t temp; -#endif fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x); fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].z); // not a typo @@ -1095,23 +1083,18 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, pegb = wallVerts[0].t; pegmul = (pegb - pegt) / (top - bot); -#ifdef ESLOPE endrealtop = endtop = wallVerts[2].y; endrealbot = endbot = wallVerts[1].y; endpegt = wallVerts[2].t; endpegb = wallVerts[1].t; endpegmul = (endpegb - endpegt) / (endtop - endbot); -#endif for (i = 0; i < sector->numlights; i++) { -#ifdef ESLOPE - if (endtop < endrealbot) -#endif - if (top < realbot) + if (endtop < endrealbot && top < realbot) return; - // There's a compiler warning here if this comment isn't here because of indentation + // There's a compiler warning here if this comment isn't here because of indentation if (!(list[i].flags & FF_NOSHADE)) { if (pfloor && (pfloor->flags & FF_FOG)) @@ -1143,7 +1126,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, else solid = false; -#ifdef ESLOPE if (list[i].slope) { temp = P_GetZAt(list[i].slope, v1x, v1y); @@ -1165,26 +1147,15 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, else bheight = endbheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight); } -#else - height = FIXED_TO_FLOAT(list[i].height); - if (solid) - bheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight); -#endif -#ifdef ESLOPE - if (endheight >= endtop) -#endif - if (height >= top) + if (endheight >= endtop && height >= top) { if (solid && top > bheight) top = bheight; -#ifdef ESLOPE if (solid && endtop > endbheight) endtop = endbheight; -#endif } -#ifdef ESLOPE if (i + 1 < sector->numlights) { if (list[i+1].slope) @@ -1202,21 +1173,8 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, bheight = realbot; endbheight = endrealbot; } -#else - if (i + 1 < sector->numlights) - { - bheight = FIXED_TO_FLOAT(list[i+1].height); - } - else - { - bheight = realbot; - } -#endif -#ifdef ESLOPE - if (endbheight >= endtop) -#endif - if (bheight >= top) + if (endbheight >= endtop && bheight >= top) continue; //Found a break; @@ -1225,15 +1183,12 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, if (bot < realbot) bot = realbot; -#ifdef ESLOPE endbot = endbheight; if (endbot < endrealbot) endbot = endrealbot; -#endif Surf->FlatColor.s.alpha = alpha; -#ifdef ESLOPE wallVerts[3].t = pegt + ((realtop - top) * pegmul); wallVerts[2].t = endpegt + ((endrealtop - endtop) * endpegmul); wallVerts[0].t = pegt + ((realtop - bot) * pegmul); @@ -1244,14 +1199,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, wallVerts[2].y = endtop; wallVerts[0].y = bot; wallVerts[1].y = endbot; -#else - wallVerts[3].t = wallVerts[2].t = pegt + ((realtop - top) * pegmul); - wallVerts[0].t = wallVerts[1].t = pegt + ((realtop - bot) * pegmul); - - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; -#endif if (cutflag & FF_FOG) HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap); @@ -1261,22 +1208,16 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, HWR_ProjectWall(wallVerts, Surf, PF_Masked, lightnum, colormap); top = bot; -#ifdef ESLOPE endtop = endbot; -#endif } bot = realbot; -#ifdef ESLOPE endbot = endrealbot; - if (endtop <= endrealbot) -#endif - if (top <= realbot) + if (endtop <= endrealbot && top <= realbot) return; Surf->FlatColor.s.alpha = alpha; -#ifdef ESLOPE wallVerts[3].t = pegt + ((realtop - top) * pegmul); wallVerts[2].t = endpegt + ((endrealtop - endtop) * endpegmul); wallVerts[0].t = pegt + ((realtop - bot) * pegmul); @@ -1287,14 +1228,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, wallVerts[2].y = endtop; wallVerts[0].y = bot; wallVerts[1].y = endbot; -#else - wallVerts[3].t = wallVerts[2].t = pegt + ((realtop - top) * pegmul); - wallVerts[0].t = wallVerts[1].t = pegt + ((realtop - bot) * pegmul); - - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; -#endif if (cutflag & FF_FOG) HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap); @@ -1339,19 +1272,15 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) fixed_t worldtop, worldbottom; fixed_t worldhigh = 0, worldlow = 0; -#ifdef ESLOPE fixed_t worldtopslope, worldbottomslope; fixed_t worldhighslope = 0, worldlowslope = 0; fixed_t v1x, v1y, v2x, v2y; -#endif GLTexture_t *grTex = NULL; float cliplow = 0.0f, cliphigh = 0.0f; INT32 gr_midtexture; fixed_t h, l; // 3D sides and 2s middle textures -#ifdef ESLOPE fixed_t hS, lS; -#endif FUINT lightnum = 0; // shut up compiler extracolormap_t *colormap; @@ -1370,13 +1299,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) ve.x = ((polyvertex_t *)gr_curline->pv2)->x; ve.y = ((polyvertex_t *)gr_curline->pv2)->y; -#ifdef ESLOPE v1x = FLOAT_TO_FIXED(vs.x); v1y = FLOAT_TO_FIXED(vs.y); v2x = FLOAT_TO_FIXED(ve.x); v2y = FLOAT_TO_FIXED(ve.y); -#endif -#ifdef ESLOPE #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ @@ -1387,10 +1313,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) SLOPEPARAMS(gr_frontsector->c_slope, worldtop, worldtopslope, gr_frontsector->ceilingheight) SLOPEPARAMS(gr_frontsector->f_slope, worldbottom, worldbottomslope, gr_frontsector->floorheight) -#else - worldtop = gr_frontsector->ceilingheight; - worldbottom = gr_frontsector->floorheight; -#endif // remember vertices ordering // 3--2 @@ -1440,14 +1362,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) boolean bothceilingssky = false; // turned on if both back and front ceilings are sky boolean bothfloorssky = false; // likewise, but for floors -#ifdef ESLOPE SLOPEPARAMS(gr_backsector->c_slope, worldhigh, worldhighslope, gr_backsector->ceilingheight) SLOPEPARAMS(gr_backsector->f_slope, worldlow, worldlowslope, gr_backsector->floorheight) #undef SLOPEPARAMS -#else - worldhigh = gr_backsector->ceilingheight; - worldlow = gr_backsector->floorheight; -#endif // hack to allow height changes in outdoor areas // This is what gets rid of the upper textures if there should be sky @@ -1470,12 +1387,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) gr_bottomtexture = R_GetTextureNum(gr_sidedef->bottomtexture); // check TOP TEXTURE - if (( -#ifdef ESLOPE - worldhighslope < worldtopslope || -#endif - worldhigh < worldtop - ) && gr_toptexture) + if ((worldhighslope < worldtopslope || worldhigh < worldtop) && gr_toptexture) { { fixed_t texturevpegtop; // top @@ -1485,15 +1397,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) // PEGGING if (gr_linedef->flags & ML_DONTPEGTOP) texturevpegtop = 0; -#ifdef ESLOPE else if (gr_linedef->flags & ML_EFFECT1) texturevpegtop = worldhigh + textureheight[gr_sidedef->toptexture] - worldtop; else texturevpegtop = gr_backsector->ceilingheight + textureheight[gr_sidedef->toptexture] - gr_frontsector->ceilingheight; -#else - else - texturevpegtop = worldhigh + textureheight[gr_sidedef->toptexture] - worldtop; -#endif texturevpegtop += gr_sidedef->rowoffset; @@ -1505,7 +1412,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; -#ifdef ESLOPE // Adjust t value for sloped walls if (!(gr_linedef->flags & ML_EFFECT1)) { @@ -1528,19 +1434,13 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[3].t = wallVerts[0].t - (worldtop - worldhigh) * grTex->scaleY; wallVerts[2].t = wallVerts[1].t - (worldtopslope - worldhighslope) * grTex->scaleY; } -#endif } // set top/bottom coords -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldtop); wallVerts[0].y = FIXED_TO_FLOAT(worldhigh); wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope); wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldtop); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldhigh); -#endif if (gr_frontsector->numlights) HWR_SplitWall(gr_frontsector, wallVerts, gr_toptexture, &Surf, FF_CUTLEVEL, NULL); @@ -1552,9 +1452,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) // check BOTTOM TEXTURE if (( -#ifdef ESLOPE worldlowslope > worldbottomslope || -#endif worldlow > worldbottom) && gr_bottomtexture) //only if VISIBLE!!! { { @@ -1563,19 +1461,12 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) grTex = HWR_GetTexture(gr_bottomtexture); // PEGGING -#ifdef ESLOPE if (!(gr_linedef->flags & ML_DONTPEGBOTTOM)) texturevpegbottom = 0; else if (gr_linedef->flags & ML_EFFECT1) texturevpegbottom = worldbottom - worldlow; else texturevpegbottom = gr_frontsector->floorheight - gr_backsector->floorheight; -#else - if (gr_linedef->flags & ML_DONTPEGBOTTOM) - texturevpegbottom = worldbottom - worldlow; - else - texturevpegbottom = 0; -#endif texturevpegbottom += gr_sidedef->rowoffset; @@ -1587,7 +1478,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; -#ifdef ESLOPE // Adjust t value for sloped walls if (!(gr_linedef->flags & ML_EFFECT1)) { @@ -1610,19 +1500,13 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].t = (texturevpegbottom + worldlow - worldbottom) * grTex->scaleY; wallVerts[1].t = (texturevpegbottom + worldlowslope - worldbottomslope) * grTex->scaleY; } -#endif } // set top/bottom coords -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldlow); wallVerts[0].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldlowslope); wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldlow); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldbottom); -#endif if (gr_frontsector->numlights) HWR_SplitWall(gr_frontsector, wallVerts, gr_bottomtexture, &Surf, FF_CUTLEVEL, NULL); @@ -1692,16 +1576,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) else #endif { -#ifdef ESLOPE popentop = min(worldtop, worldhigh); popenbottom = max(worldbottom, worldlow); -#else - popentop = min(front->ceilingheight, back->ceilingheight); - popenbottom = max(front->floorheight, back->floorheight); -#endif } -#ifdef ESLOPE if (gr_linedef->flags & ML_EFFECT2) { if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3)) @@ -1716,9 +1594,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) } } else if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3)) -#else - if (gr_linedef->flags & ML_DONTPEGBOTTOM) -#endif { polybottom = popenbottom + gr_sidedef->rowoffset; polytop = polybottom + textureheight[gr_midtexture]*repeats; @@ -1750,11 +1625,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { // PEGGING -#ifdef ESLOPE if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3)) -#else - if (gr_linedef->flags & ML_DONTPEGBOTTOM) -#endif texturevpeg = textureheight[gr_sidedef->midtexture]*repeats - h + polybottom; else texturevpeg = polytop - h; @@ -1773,7 +1644,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h); wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l); -#ifdef ESLOPE // Correct to account for slopes { fixed_t midtextureslant; @@ -1816,7 +1686,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = FIXED_TO_FLOAT(h); wallVerts[1].y = FIXED_TO_FLOAT(l); } -#endif // set alpha for transparent walls (new boom and legacy linedef types) // ooops ! this do not work at all because render order we should render it in backtofront order @@ -1918,12 +1787,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) if (gr_backsector->ceilingpic != skyflatnum) // don't cull if back sector is also sky { wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(INT32_MAX); // draw to top of map space -#ifdef ESLOPE wallVerts[0].y = FIXED_TO_FLOAT(worldtop); wallVerts[1].y = FIXED_TO_FLOAT(worldtopslope); -#else - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldtop); -#endif HWR_DrawSkyWall(wallVerts, &Surf); } } @@ -1932,12 +1797,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { if (gr_backsector->floorpic != skyflatnum) // don't cull if back sector is also sky { -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldbottomslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); -#endif wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(INT32_MIN); // draw to bottom of map space HWR_DrawSkyWall(wallVerts, &Surf); } @@ -1954,12 +1815,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { fixed_t texturevpeg; // PEGGING -#ifdef ESLOPE if ((gr_linedef->flags & (ML_DONTPEGBOTTOM|ML_EFFECT2)) == (ML_DONTPEGBOTTOM|ML_EFFECT2)) texturevpeg = gr_frontsector->floorheight + textureheight[gr_sidedef->midtexture] - gr_frontsector->ceilingheight + gr_sidedef->rowoffset; - else -#endif - if (gr_linedef->flags & ML_DONTPEGBOTTOM) + else if (gr_linedef->flags & ML_DONTPEGBOTTOM) texturevpeg = worldbottom + textureheight[gr_sidedef->midtexture] - worldtop + gr_sidedef->rowoffset; else // top of texture at top @@ -1972,7 +1830,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; -#ifdef ESLOPE // Texture correction for slopes if (gr_linedef->flags & ML_EFFECT2) { wallVerts[3].t += (gr_frontsector->ceilingheight - worldtop) * grTex->scaleY; @@ -1986,19 +1843,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[0].t = wallVerts[3].t - (worldbottom-worldtop) * grTex->scaleY; wallVerts[1].t = wallVerts[2].t - (worldbottomslope-worldtopslope) * grTex->scaleY; } -#endif } -#ifdef ESLOPE + //Set textures properly on single sided walls that are sloped wallVerts[3].y = FIXED_TO_FLOAT(worldtop); wallVerts[0].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope); wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope); -#else - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldtop); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldbottom); -#endif + // I don't think that solid walls can use translucent linedef types... if (gr_frontsector->numlights) HWR_SplitWall(gr_frontsector, wallVerts, gr_midtexture, &Surf, FF_CUTLEVEL, NULL); @@ -2016,22 +1868,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) if (gr_frontsector->ceilingpic == skyflatnum) // It's a single-sided line with sky for its sector { wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(INT32_MAX); // draw to top of map space -#ifdef ESLOPE wallVerts[0].y = FIXED_TO_FLOAT(worldtop); wallVerts[1].y = FIXED_TO_FLOAT(worldtopslope); -#else - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldtop); -#endif HWR_DrawSkyWall(wallVerts, &Surf); } if (gr_frontsector->floorpic == skyflatnum) { -#ifdef ESLOPE wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); wallVerts[2].y = FIXED_TO_FLOAT(worldbottomslope); -#else - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldbottom); -#endif wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(INT32_MIN); // draw to bottom of map space HWR_DrawSkyWall(wallVerts, &Surf); } @@ -2072,7 +1916,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } -#ifdef ESLOPE h = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight; hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight; l = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight; @@ -2089,19 +1932,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[0].y = FIXED_TO_FLOAT(l); wallVerts[1].y = FIXED_TO_FLOAT(lS); -#else - h = *rover->topheight; - l = *rover->bottomheight; - if (h > highcut) - h = highcut; - if (l < lowcut) - l = lowcut; - //Hurdler: HW code starts here - //FIXME: check if peging is correct - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l); -#endif if (rover->flags & FF_FOG) { wallVerts[3].t = wallVerts[2].t = 0; @@ -2113,9 +1943,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { fixed_t texturevpeg; boolean attachtobottom = false; -#ifdef ESLOPE boolean slopeskew = false; // skew FOF walls with slopes? -#endif // Wow, how was this missing from OpenGL for so long? // ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software @@ -2124,22 +1952,17 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { texturevpeg = sides[newline->sidenum[0]].rowoffset; attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM); -#ifdef ESLOPE slopeskew = !!(newline->flags & ML_DONTPEGTOP); -#endif } else { texturevpeg = sides[rover->master->sidenum[0]].rowoffset; attachtobottom = !!(gr_linedef->flags & ML_DONTPEGBOTTOM); -#ifdef ESLOPE slopeskew = !!(rover->master->flags & ML_DONTPEGTOP); -#endif } grTex = HWR_GetTexture(texnum); -#ifdef ESLOPE if (!slopeskew) // no skewing { if (attachtobottom) @@ -2164,12 +1987,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].t = wallVerts[1].t - (hS - lS) * grTex->scaleY; } } -#else - if (attachtobottom) - texturevpeg -= *rover->topheight - *rover->bottomheight; - wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; -#endif wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; @@ -2238,7 +2055,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) newline = rover->master->frontsector->lines[0] + linenum; texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } -#ifdef ESLOPE //backsides h = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight; hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight; l = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight; @@ -2255,19 +2071,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[0].y = FIXED_TO_FLOAT(l); wallVerts[1].y = FIXED_TO_FLOAT(lS); -#else - h = *rover->topheight; - l = *rover->bottomheight; - if (h > highcut) - h = highcut; - if (l < lowcut) - l = lowcut; - //Hurdler: HW code starts here - //FIXME: check if peging is correct - // set top/bottom coords - wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h); - wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l); -#endif if (rover->flags & FF_FOG) { wallVerts[3].t = wallVerts[2].t = 0; @@ -2365,7 +2168,6 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks // GZDoom method of sloped line clipping -#ifdef ESLOPE if (afrontsector->f_slope || afrontsector->c_slope || abacksector->f_slope || abacksector->c_slope) { fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t @@ -2387,7 +2189,6 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks #undef SLOPEPARAMS } else -#endif { frontf1 = frontf2 = afrontsector->floorheight; frontc1 = frontc2 = afrontsector->ceilingheight; @@ -2928,7 +2729,6 @@ static void HWR_AddLine(seg_t * line) goto clippass; // treat like wide open window instead } -#ifdef ESLOPE if (gr_frontsector->f_slope || gr_frontsector->c_slope || gr_backsector->f_slope || gr_backsector->c_slope) { fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends @@ -2973,7 +2773,6 @@ static void HWR_AddLine(seg_t * line) goto clippass; } else -#endif { // if both ceilings are skies, consider it always "open" // same for floors @@ -3511,7 +3310,6 @@ static void HWR_Subsector(size_t num) cullFloorHeight = locFloorHeight = gr_frontsector->floorheight; cullCeilingHeight = locCeilingHeight = gr_frontsector->ceilingheight; -#ifdef ESLOPE if (gr_frontsector->f_slope) { cullFloorHeight = P_GetZAt(gr_frontsector->f_slope, viewx, viewy); @@ -3523,7 +3321,6 @@ static void HWR_Subsector(size_t num) cullCeilingHeight = P_GetZAt(gr_frontsector->c_slope, viewx, viewy); locCeilingHeight = P_GetZAt(gr_frontsector->c_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y); } -#endif } // ----- end special tricks ----- @@ -3615,15 +3412,13 @@ static void HWR_Subsector(size_t num) fixed_t cullHeight, centerHeight; // bottom plane -#ifdef ESLOPE if (*rover->b_slope) { cullHeight = P_GetZAt(*rover->b_slope, viewx, viewy); centerHeight = P_GetZAt(*rover->b_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y); } else -#endif - cullHeight = centerHeight = *rover->bottomheight; + cullHeight = centerHeight = *rover->bottomheight; if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES)) continue; @@ -3683,15 +3478,13 @@ static void HWR_Subsector(size_t num) } // top plane -#ifdef ESLOPE if (*rover->t_slope) { cullHeight = P_GetZAt(*rover->t_slope, viewx, viewy); centerHeight = P_GetZAt(*rover->t_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y); } else -#endif - cullHeight = centerHeight = *rover->topheight; + cullHeight = centerHeight = *rover->topheight; if (centerHeight >= locFloorHeight && centerHeight <= locCeilingHeight && @@ -4263,13 +4056,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) float realheight, heightmult; const sector_t *sector = spr->mobj->subsector->sector; const lightlist_t *list = sector->lightlist; -#ifdef ESLOPE float endrealtop, endrealbot, endtop, endbot; float endbheight; float endrealheight; fixed_t temp; fixed_t v1x, v1y, v2x, v2y; -#endif this_scale = FIXED_TO_FLOAT(spr->mobj->scale); @@ -4341,10 +4132,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) towbot = baseWallVerts[0].tow; towmult = (towbot - towtop) / (top - bot); -#ifdef ESLOPE endrealtop = endtop = baseWallVerts[2].y; endrealbot = endbot = baseWallVerts[1].y; -#endif // copy the contents of baseWallVerts into the drawn wallVerts array // baseWallVerts is used to know the final shape to easily get the vertex @@ -4384,7 +4173,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) if (spr->mobj->frame & FF_FULLBRIGHT) lightlevel = 255; -#ifdef ESLOPE for (i = 1; i < sector->numlights; i++) { fixed_t h = sector->lightlist[i].slope ? P_GetZAt(sector->lightlist[i].slope, spr->mobj->x, spr->mobj->y) @@ -4397,19 +4185,10 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) break; } } -#else - i = R_GetPlaneLight(sector, temp, false); - if (!(spr->mobj->frame & FF_FULLBRIGHT)) - lightlevel = *list[i].lightlevel; - colormap = *list[i].extra_colormap; -#endif for (i = 0; i < sector->numlights; i++) { -#ifdef ESLOPE - if (endtop < endrealbot) -#endif - if (top < realbot) + if (endtop < endrealbot && top < realbot) return; // even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite @@ -4420,7 +4199,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) colormap = *list[i].extra_colormap; } -#ifdef ESLOPE if (i + 1 < sector->numlights) { if (list[i+1].slope) @@ -4438,21 +4216,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) bheight = realbot; endbheight = endrealbot; } -#else - if (i + 1 < sector->numlights) - { - bheight = FIXED_TO_FLOAT(list[i+1].height); - } - else - { - bheight = realbot; - } -#endif -#ifdef ESLOPE - if (endbheight >= endtop) -#endif - if (bheight >= top) + if (endbheight >= endtop && bheight >= top) continue; bot = bheight; @@ -4460,14 +4225,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) if (bot < realbot) bot = realbot; -#ifdef ESLOPE endbot = endbheight; if (endbot < endrealbot) endbot = endrealbot; -#endif -#ifdef ESLOPE wallVerts[3].tow = towtop + ((realtop - top) * towmult); wallVerts[2].tow = towtop + ((endrealtop - endtop) * towmult); wallVerts[0].tow = towtop + ((realtop - bot) * towmult); @@ -4501,32 +4263,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult; wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult; } -#else - wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult); - wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult); - - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; - - // The x and y only need to be adjusted in the case that it's not a papersprite - if (cv_grspritebillboarding.value - && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE)) - { - // Get the x and z of the vertices so billboarding draws correctly - realheight = realbot - realtop; - heightmult = (realtop - top) / realheight; - wallVerts[3].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult; - wallVerts[3].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult; - wallVerts[2].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult; - wallVerts[2].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult; - - heightmult = (realtop - bot) / realheight; - wallVerts[0].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult; - wallVerts[0].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult; - wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult; - wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult; - } -#endif if (colormap) Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false); @@ -4538,21 +4274,15 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated|PF_Clip); top = bot; -#ifdef ESLOPE endtop = endbot; -#endif } bot = realbot; -#ifdef ESLOPE endbot = endrealbot; - if (endtop <= endrealbot) -#endif - if (top <= realbot) + if (endtop <= endrealbot && top <= realbot) return; // If we're ever down here, somehow the above loop hasn't draw all the light levels of sprite -#ifdef ESLOPE wallVerts[3].tow = towtop + ((realtop - top) * towmult); wallVerts[2].tow = towtop + ((endrealtop - endtop) * towmult); wallVerts[0].tow = towtop + ((realtop - bot) * towmult); @@ -4562,13 +4292,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) wallVerts[2].y = endtop; wallVerts[0].y = bot; wallVerts[1].y = endbot; -#else - wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult); - wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult); - - wallVerts[2].y = wallVerts[3].y = top; - wallVerts[0].y = wallVerts[1].y = bot; -#endif if (colormap) Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false); diff --git a/src/hardware/hw_trick.c b/src/hardware/hw_trick.c index 97d86b944..82d81b5b2 100644 --- a/src/hardware/hw_trick.c +++ b/src/hardware/hw_trick.c @@ -610,10 +610,8 @@ static boolean isCeilingFloating(sector_t *thisSector) if (!adjSector) // assume floating sectors have surrounding sectors return false; -#ifdef ESLOPE if (adjSector->c_slope) // Don't bother with slopes return false; -#endif if (!refSector) { @@ -663,10 +661,8 @@ static boolean isFloorFloating(sector_t *thisSector) if (!adjSector) // assume floating sectors have surrounding sectors return false; -#ifdef ESLOPE if (adjSector->f_slope) // Don't bother with slopes return false; -#endif if (!refSector) { diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 4f924aa18..3379ad3aa 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -14,9 +14,7 @@ #include "fastcmp.h" #include "p_local.h" #include "p_setup.h" // So we can have P_SetupLevelSky -#ifdef ESLOPE #include "p_slopes.h" // P_GetZAt -#endif #include "z_zone.h" #include "r_main.h" #include "r_draw.h" @@ -2175,7 +2173,6 @@ static int lib_evStartCrumble(lua_State *L) return 0; } -#ifdef ESLOPE // P_SLOPES //////////// @@ -2191,7 +2188,6 @@ static int lib_pGetZAt(lua_State *L) lua_pushfixed(L, P_GetZAt(slope, x, y)); return 1; } -#endif // R_DEFS //////////// @@ -3222,10 +3218,8 @@ static luaL_Reg lib[] = { {"EV_CrumbleChain",lib_evCrumbleChain}, {"EV_StartCrumble",lib_evStartCrumble}, -#ifdef ESLOPE // p_slopes {"P_GetZAt",lib_pGetZAt}, -#endif // r_defs {"R_PointToAngle",lib_rPointToAngle}, diff --git a/src/lua_libs.h b/src/lua_libs.h index bf1e28b5d..d0334d725 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -43,11 +43,9 @@ extern lua_State *gL; #define META_SEG "SEG_T*" #define META_NODE "NODE_T*" #endif -#ifdef ESLOPE #define META_SLOPE "PSLOPE_T*" #define META_VECTOR2 "VECTOR2_T" #define META_VECTOR3 "VECTOR3_T" -#endif #define META_MAPHEADER "MAPHEADER_T*" #define META_CVAR "CONSVAR_T*" diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 32150a4bc..d851c820e 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -15,9 +15,7 @@ #include "p_local.h" #include "p_setup.h" #include "z_zone.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "r_main.h" #include "lua_script.h" @@ -41,13 +39,9 @@ enum sector_e { sector_heightsec, sector_camsec, sector_lines, -#ifdef ESLOPE sector_ffloors, sector_fslope, sector_cslope -#else - sector_ffloors -#endif }; static const char *const sector_opt[] = { @@ -64,10 +58,8 @@ static const char *const sector_opt[] = { "camsec", "lines", "ffloors", -#ifdef ESLOPE "f_slope", "c_slope", -#endif NULL}; enum subsector_e { @@ -180,10 +172,8 @@ enum ffloor_e { ffloor_toplightlevel, ffloor_bottomheight, ffloor_bottompic, -#ifdef ESLOPE ffloor_tslope, ffloor_bslope, -#endif ffloor_sector, ffloor_flags, ffloor_master, @@ -200,10 +190,8 @@ static const char *const ffloor_opt[] = { "toplightlevel", "bottomheight", "bottompic", -#ifdef ESLOPE "t_slope", "b_slope", -#endif "sector", // secnum pushed as control sector userdata "flags", "master", // control linedef @@ -289,7 +277,6 @@ static const char *const bbox_opt[] = { "right", NULL}; -#ifdef ESLOPE enum slope_e { slope_valid = 0, slope_o, @@ -324,7 +311,6 @@ static const char *const vector_opt[] = { "y", "z", NULL}; -#endif static const char *const array_opt[] ={"iterate",NULL}; static const char *const valid_opt[] ={"valid",NULL}; @@ -570,14 +556,12 @@ static int sector_get(lua_State *L) LUA_PushUserdata(L, sector->ffloors, META_FFLOOR); lua_pushcclosure(L, sector_iterate, 2); // push lib_iterateFFloors and sector->ffloors as upvalues for the function return 1; -#ifdef ESLOPE case sector_fslope: // f_slope LUA_PushUserdata(L, sector->f_slope, META_SLOPE); return 1; case sector_cslope: // c_slope LUA_PushUserdata(L, sector->c_slope, META_SLOPE); return 1; -#endif } return 0; } @@ -601,10 +585,8 @@ static int sector_set(lua_State *L) case sector_camsec: // camsec case sector_lines: // lines case sector_ffloors: // ffloors -#ifdef ESLOPE case sector_fslope: // f_slope case sector_cslope: // c_slope -#endif default: return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]); case sector_floorheight: { // floorheight @@ -1692,14 +1674,12 @@ static int ffloor_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } -#ifdef ESLOPE case ffloor_tslope: LUA_PushUserdata(L, *ffloor->t_slope, META_SLOPE); return 1; case ffloor_bslope: LUA_PushUserdata(L, *ffloor->b_slope, META_SLOPE); return 1; -#endif case ffloor_sector: LUA_PushUserdata(L, §ors[ffloor->secnum], META_SECTOR); return 1; @@ -1739,10 +1719,8 @@ static int ffloor_set(lua_State *L) switch(field) { case ffloor_valid: // valid -#ifdef ESLOPE case ffloor_tslope: // t_slope case ffloor_bslope: // b_slope -#endif case ffloor_sector: // sector case ffloor_master: // master case ffloor_target: // target @@ -1803,7 +1781,6 @@ static int ffloor_set(lua_State *L) return 0; } -#ifdef ESLOPE ////////////// // pslope_t // ////////////// @@ -1976,7 +1953,6 @@ static int vector3_get(lua_State *L) return 0; } -#endif ///////////////////// // mapheaderinfo[] // @@ -2225,7 +2201,6 @@ int LUA_MapLib(lua_State *L) lua_setfield(L, -2, "__index"); lua_pop(L, 1); -#ifdef ESLOPE luaL_newmetatable(L, META_SLOPE); lua_pushcfunction(L, slope_get); lua_setfield(L, -2, "__index"); @@ -2243,7 +2218,6 @@ int LUA_MapLib(lua_State *L) lua_pushcfunction(L, vector3_get); lua_setfield(L, -2, "__index"); lua_pop(L, 1); -#endif luaL_newmetatable(L, META_MAPHEADER); lua_pushcfunction(L, mapheaderinfo_get); diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 4b580a2fe..81729b788 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -84,9 +84,7 @@ enum mobj_e { mobj_extravalue2, mobj_cusval, mobj_cvmem, -#ifdef ESLOPE mobj_standingslope, -#endif mobj_colorized, mobj_shadowscale }; @@ -152,9 +150,7 @@ static const char *const mobj_opt[] = { "extravalue2", "cusval", "cvmem", -#ifdef ESLOPE "standingslope", -#endif "colorized", "shadowscale", NULL}; @@ -383,11 +379,9 @@ static int mobj_get(lua_State *L) case mobj_cvmem: lua_pushinteger(L, mo->cvmem); break; -#ifdef ESLOPE case mobj_standingslope: LUA_PushUserdata(L, mo->standingslope, META_SLOPE); break; -#endif case mobj_colorized: lua_pushboolean(L, mo->colorized); break; @@ -716,10 +710,8 @@ static int mobj_set(lua_State *L) case mobj_cvmem: mo->cvmem = luaL_checkinteger(L, 3); break; -#ifdef ESLOPE case mobj_standingslope: return NOSET; -#endif case mobj_colorized: mo->colorized = luaL_checkboolean(L, 3); break; diff --git a/src/lua_script.c b/src/lua_script.c index 6fa6cf57d..8c0cd5351 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -23,9 +23,7 @@ #include "byteptr.h" #include "p_saveg.h" #include "p_local.h" -#ifdef ESLOPE #include "p_slopes.h" // for P_SlopeById -#endif #ifdef LUA_ALLOW_BYTECODE #include "d_netfil.h" // for LUA_DumpFile #endif @@ -731,9 +729,7 @@ enum ARCH_NODE, #endif ARCH_FFLOOR, -#ifdef ESLOPE ARCH_SLOPE, -#endif ARCH_MAPHEADER, ARCH_TEND=0xFF, @@ -758,9 +754,7 @@ static const struct { {META_NODE, ARCH_NODE}, #endif {META_FFLOOR, ARCH_FFLOOR}, -#ifdef ESLOPE {META_SLOPE, ARCH_SLOPE}, -#endif {META_MAPHEADER, ARCH_MAPHEADER}, {NULL, ARCH_NULL} }; @@ -1015,7 +1009,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } -#ifdef ESLOPE case ARCH_SLOPE: { pslope_t *slope = *((pslope_t **)lua_touserdata(gL, myindex)); @@ -1027,7 +1020,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } -#endif case ARCH_MAPHEADER: { mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex)); @@ -1249,11 +1241,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX) LUA_PushUserdata(gL, rover, META_FFLOOR); break; } -#ifdef ESLOPE case ARCH_SLOPE: LUA_PushUserdata(gL, P_SlopeById(READUINT16(save_p)), META_SLOPE); break; -#endif case ARCH_MAPHEADER: LUA_PushUserdata(gL, mapheaderinfo[READUINT16(save_p)], META_MAPHEADER); break; diff --git a/src/m_cheat.c b/src/m_cheat.c index 93e8f2911..4a1a4fb58 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1025,13 +1025,9 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling) if (ceiling) { -#ifdef ESLOPE // Truncate position to match where mapthing would be when spawned // (this applies to every further P_GetZAt call as well) fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight; -#else - fixed_t cheight = sec->ceilingheight; -#endif if (((cheight - player->mo->z - player->mo->height)>>FRACBITS) >= (1 << (16-ZSHIFT))) { @@ -1042,11 +1038,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling) } else { -#ifdef ESLOPE fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight; -#else - fixed_t fheight = sec->floorheight; -#endif if (((player->mo->z - fheight)>>FRACBITS) >= (1 << (16-ZSHIFT))) { CONS_Printf(M_GetText("Sorry, you're too %s to place this object (max: %d %s).\n"), M_GetText("high"), @@ -1093,20 +1085,12 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c mt->y = (INT16)(player->mo->y>>FRACBITS); if (ceiling) { -#ifdef ESLOPE fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->ceilingheight; -#else - fixed_t cheight = sec->ceilingheight; -#endif mt->z = (UINT16)((cheight - player->mo->z - player->mo->height)>>FRACBITS); } else { -#ifdef ESLOPE fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->floorheight; -#else - fixed_t fheight = sec->floorheight; -#endif mt->z = (UINT16)((player->mo->z - fheight)>>FRACBITS); } mt->angle = (INT16)(FixedInt(AngleFixed(player->mo->angle))); @@ -1352,20 +1336,12 @@ void OP_ObjectplaceMovement(player_t *player) if (!!(mobjinfo[op_currentthing].flags & MF_SPAWNCEILING) ^ !!(cv_opflags.value & MTF_OBJECTFLIP)) { -#ifdef ESLOPE fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight; -#else - fixed_t cheight = sec->ceilingheight; -#endif op_displayflags = (UINT16)((cheight - player->mo->z - mobjinfo[op_currentthing].height)>>FRACBITS); } else { -#ifdef ESLOPE fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight; -#else - fixed_t fheight = sec->floorheight; -#endif op_displayflags = (UINT16)((player->mo->z - fheight)>>FRACBITS); } op_displayflags <<= ZSHIFT; diff --git a/src/p_enemy.c b/src/p_enemy.c index 9dea0ecc5..09d33c537 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -6764,13 +6764,8 @@ void A_MixUp(mobj_t *actor) P_SetThingPosition(players[i].mo); -#ifdef ESLOPE players[i].mo->floorz = P_GetFloorZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL); players[i].mo->ceilingz = P_GetCeilingZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL); -#else - players[i].mo->floorz = players[i].mo->subsector->sector->floorheight; - players[i].mo->ceilingz = players[i].mo->subsector->sector->ceilingheight; -#endif P_CheckPosition(players[i].mo, players[i].mo->x, players[i].mo->y); } diff --git a/src/p_floor.c b/src/p_floor.c index 9c5ab9057..b8b40df3c 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -15,9 +15,7 @@ #include "doomstat.h" #include "m_random.h" #include "p_local.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "r_state.h" #include "s_sound.h" #include "z_zone.h" @@ -3178,12 +3176,10 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (R_PointInSubsector(a, b)->sector == sec) { mobj_t *spawned = NULL; -#ifdef ESLOPE if (*rover->t_slope) topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1); if (*rover->b_slope) bottomz = P_GetZAt(*rover->b_slope, a, b); -#endif for (c = topz; c > bottomz; c -= spacing) { diff --git a/src/p_local.h b/src/p_local.h index 99c465f9b..becb045f7 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -66,9 +66,7 @@ typedef enum THINK_POLYOBJ, THINK_MAIN, THINK_MOBJ, -#ifdef ESLOPE THINK_DYNSLOPE, -#endif THINK_PRECIP, NUM_THINKERLISTS } thinklistnum_t; /**< Thinker lists. */ @@ -383,9 +381,7 @@ extern mobj_t *tmfloorthing, *tmhitthing, *tmthing; extern camera_t *mapcampointer; extern fixed_t tmx; extern fixed_t tmy; -#ifdef ESLOPE extern pslope_t *tmfloorslope, *tmceilingslope; -#endif /* cphipps 2004/08/30 */ extern void P_MapStart(void); diff --git a/src/p_map.c b/src/p_map.c index 988089989..accc52836 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -27,9 +27,7 @@ #include "r_splats.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "z_zone.h" @@ -53,9 +51,7 @@ static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector mobj_t *tmhitthing; // the solid thing you bumped into (for collisions) ffloor_t *tmfloorrover, *tmceilingrover; -#ifdef ESLOPE pslope_t *tmfloorslope, *tmceilingslope; -#endif // keep track of the line that lowers the ceiling, // so missiles don't explode against sky hack walls @@ -262,9 +258,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (!vertispeed && !horizspeed) return false; -#ifdef ESLOPE object->standingslope = NULL; // Okay, now we know it's not going to be relevant - no launching off at silly angles for you. -#endif if (spring->eflags & MFE_VERTICALFLIP) vertispeed *= -1; @@ -439,9 +433,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) P_SetPlayerMobjState(object, S_PLAY_FALL); } -#ifdef ESLOPE object->standingslope = NULL; // And again. -#endif final = true; @@ -491,9 +483,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) zdist = object->z - spring->z; } -#ifdef ESLOPE object->standingslope = NULL; // No launching off at silly angles for you. -#endif switch (spring->type) { @@ -1736,9 +1726,7 @@ static boolean PIT_CheckThing(mobj_t *thing) { tmfloorz = thing->z + thing->height; tmfloorrover = NULL; -#ifdef ESLOPE tmfloorslope = NULL; -#endif } return true; } @@ -1757,18 +1745,14 @@ static boolean PIT_CheckThing(mobj_t *thing) tmfloorz = tmceilingz = topz; // block while in air tmceilingrover = NULL; -#ifdef ESLOPE tmceilingslope = NULL; -#endif tmfloorthing = thing; // needed for side collision } else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height) { tmceilingz = topz; tmceilingrover = NULL; -#ifdef ESLOPE tmceilingslope = NULL; -#endif tmfloorthing = thing; // thing we may stand on } } @@ -1783,9 +1767,7 @@ static boolean PIT_CheckThing(mobj_t *thing) { tmceilingz = thing->z; tmceilingrover = NULL; -#ifdef ESLOPE tmceilingslope = NULL; -#endif } return true; } @@ -1804,18 +1786,14 @@ static boolean PIT_CheckThing(mobj_t *thing) tmfloorz = tmceilingz = topz; // block while in air tmfloorrover = NULL; -#ifdef ESLOPE tmfloorslope = NULL; -#endif tmfloorthing = thing; // needed for side collision } else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z) { tmfloorz = topz; tmfloorrover = NULL; -#ifdef ESLOPE tmfloorslope = NULL; -#endif tmfloorthing = thing; // thing we may stand on } } @@ -1976,18 +1954,14 @@ static boolean PIT_CheckLine(line_t *ld) tmceilingz = opentop; ceilingline = ld; tmceilingrover = openceilingrover; -#ifdef ESLOPE tmceilingslope = opentopslope; -#endif } if (openbottom > tmfloorz) { tmfloorz = openbottom; tmfloorrover = openfloorrover; -#ifdef ESLOPE tmfloorslope = openbottomslope; -#endif } if (highceiling > tmdrpoffceilz) @@ -2068,10 +2042,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight; tmfloorrover = NULL; tmceilingrover = NULL; -#ifdef ESLOPE tmfloorslope = newsubsec->sector->f_slope; tmceilingslope = newsubsec->sector->c_slope; -#endif // Check list of fake floors and see if tmfloorz/tmceilingz need to be altered. if (newsubsec->sector->ffloors) @@ -2112,9 +2084,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (tmfloorz < topheight - sinklevel) { tmfloorz = topheight - sinklevel; tmfloorrover = rover; -#ifdef ESLOPE tmfloorslope = *rover->t_slope; -#endif } } else if (thing->eflags & MFE_VERTICALFLIP && thingtop <= bottomheight + sinklevel && thing->momz >= 0) @@ -2122,9 +2092,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (tmceilingz > bottomheight + sinklevel) { tmceilingz = bottomheight + sinklevel; tmceilingrover = rover; -#ifdef ESLOPE tmceilingslope = *rover->b_slope; -#endif } } } @@ -2147,9 +2115,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (tmfloorz < thing->z) { tmfloorz = thing->z; tmfloorrover = rover; -#ifdef ESLOPE tmfloorslope = NULL; -#endif } } // Quicksand blocks never change heights otherwise. @@ -2166,9 +2132,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) { tmfloorz = tmdropoffz = topheight; tmfloorrover = rover; -#ifdef ESLOPE tmfloorslope = *rover->t_slope; -#endif } if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2) && !(rover->flags & FF_PLATFORM) @@ -2176,9 +2140,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) { tmceilingz = tmdrpoffceilz = bottomheight; tmceilingrover = rover; -#ifdef ESLOPE tmceilingslope = *rover->b_slope; -#endif } } } @@ -2253,17 +2215,13 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (polytop > tmfloorz && abs(delta1) < abs(delta2)) { tmfloorz = tmdropoffz = polytop; -#ifdef ESLOPE tmfloorslope = NULL; -#endif tmfloorrover = NULL; } if (polybottom < tmceilingz && abs(delta1) >= abs(delta2)) { tmceilingz = tmdrpoffceilz = polybottom; -#ifdef ESLOPE tmceilingslope = NULL; -#endif tmceilingrover = NULL; } } @@ -2664,10 +2622,8 @@ boolean PIT_PushableMoved(mobj_t *thing) line_t *oldblockline = blockingline; ffloor_t *oldflrrover = tmfloorrover; ffloor_t *oldceilrover = tmceilingrover; -#ifdef ESLOPE pslope_t *oldfslope = tmfloorslope; pslope_t *oldcslope = tmceilingslope; -#endif // Move the player P_TryMove(thing, thing->x+stand->momx, thing->y+stand->momy, true); @@ -2682,10 +2638,8 @@ boolean PIT_PushableMoved(mobj_t *thing) blockingline = oldblockline; tmfloorrover = oldflrrover; tmceilingrover = oldceilrover; -#ifdef ESLOPE tmfloorslope = oldfslope; tmceilingslope = oldcslope; -#endif thing->momz = stand->momz; } else @@ -2707,9 +2661,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) fixed_t tryy = thing->y; fixed_t radius = thing->radius; fixed_t thingtop = thing->z + thing->height; -#ifdef ESLOPE fixed_t startingonground = P_IsObjectOnGround(thing); -#endif floatok = false; if (radius < MAXRADIUS/2) @@ -2795,14 +2747,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->ceilingrover = tmceilingrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#ifdef ESLOPE else if (tmceilingz < thingtop && thingtop - tmceilingz <= maxstep) { thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height; thing->ceilingrover = tmceilingrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#endif } else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->z - tmfloorz <= maxstep) { @@ -2810,14 +2760,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->floorrover = tmfloorrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#ifdef ESLOPE else if (tmfloorz > thing->z && tmfloorz - thing->z <= maxstep) { thing->z = thing->floorz = tmfloorz; thing->floorrover = tmfloorrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; } -#endif } if (thing->eflags & MFE_VERTICALFLIP) @@ -2881,7 +2829,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->floorrover = tmfloorrover; thing->ceilingrover = tmceilingrover; -#ifdef ESLOPE if (!(thing->flags & MF_NOCLIPHEIGHT)) { // Assign thing's standingslope if needed @@ -2902,7 +2849,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) } else // don't set standingslope if you're not going to clip against it thing->standingslope = NULL; -#endif thing->x = x; thing->y = y; @@ -3268,13 +3214,8 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle) glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy); -#ifdef ESLOPE floorz = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) : glidesector->sector->floorheight; ceilingz = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y) : glidesector->sector->ceilingheight; -#else - floorz = glidesector->sector->floorheight; - ceilingz = glidesector->sector->ceilingheight; -#endif if (glidesector->sector != player->mo->subsector->sector) { @@ -3292,12 +3233,10 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y); -#endif floorclimb = true; @@ -3453,12 +3392,10 @@ isblocking: topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, slidemo->x, slidemo->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, slidemo->x, slidemo->y); -#endif if (topheight < slidemo->z) continue; @@ -3663,10 +3600,8 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec) if (rover->master->flags & ML_BLOCKMONSTERS) continue; - topheight = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : -#endif + topheight = *rover->t_slope ? + P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; if (mo->eflags & MFE_VERTICALFLIP) @@ -3680,10 +3615,8 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec) continue; } - bottomheight = -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : -#endif + bottomheight = *rover->b_slope ? + P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; if (mo->eflags & MFE_VERTICALFLIP) @@ -4271,12 +4204,10 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -/*#ifdef ESLOPE - if (rover->t_slope) + /*if (rover->t_slope) topheight = P_GetZAt(rover->t_slope, thing->x, thing->y); if (rover->b_slope) - bottomheight = P_GetZAt(rover->b_slope, thing->x, thing->y); -#endif*/ + bottomheight = P_GetZAt(rover->b_slope, thing->x, thing->y);*/ delta1 = thing->z - (bottomheight + topheight)/2; delta2 = thingtop - (bottomheight + topheight)/2; @@ -5057,10 +4988,8 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) sector_t *sec = R_PointInSubsector(x, y)->sector; fixed_t floorz = sec->floorheight; -#ifdef ESLOPE if (sec->f_slope) floorz = P_GetZAt(sec->f_slope, x, y); -#endif // Intercept the stupid 'fall through 3dfloors' bug Tails 03-17-2002 if (sec->ffloors) @@ -5080,12 +5009,10 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, x, y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, x, y); -#endif if (rover->flags & FF_QUICKSAND) { diff --git a/src/p_maputl.c b/src/p_maputl.c index 69be5a70f..bfca72eda 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -277,9 +277,7 @@ fixed_t P_InterceptVector(divline_t *v2, divline_t *v1) // OPTIMIZE: keep this precalculated // fixed_t opentop, openbottom, openrange, lowfloor, highceiling; -#ifdef ESLOPE pslope_t *opentopslope, *openbottomslope; -#endif ffloor_t *openfloorrover, *openceilingrover; // P_CameraLineOpening @@ -307,24 +305,20 @@ void P_CameraLineOpening(line_t *linedef) { frontfloor = sectors[front->camsec].floorheight; frontceiling = sectors[front->camsec].ceilingheight; -#ifdef ESLOPE if (sectors[front->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera.x, camera.y); if (sectors[front->camsec].c_slope) frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera.x, camera.y); -#endif } else if (front->heightsec >= 0) { frontfloor = sectors[front->heightsec].floorheight; frontceiling = sectors[front->heightsec].ceilingheight; -#ifdef ESLOPE if (sectors[front->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera.x, camera.y); if (sectors[front->heightsec].c_slope) frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera.x, camera.y); -#endif } else { @@ -335,23 +329,19 @@ void P_CameraLineOpening(line_t *linedef) { backfloor = sectors[back->camsec].floorheight; backceiling = sectors[back->camsec].ceilingheight; -#ifdef ESLOPE if (sectors[back->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera.x, camera.y); if (sectors[back->camsec].c_slope) frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera.x, camera.y); -#endif } else if (back->heightsec >= 0) { backfloor = sectors[back->heightsec].floorheight; backceiling = sectors[back->heightsec].ceilingheight; -#ifdef ESLOPE if (sectors[back->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope) frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera.x, camera.y); if (sectors[back->heightsec].c_slope) frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera.x, camera.y); -#endif } else { @@ -469,9 +459,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) openbottom = INT32_MIN; highceiling = INT32_MIN; lowfloor = INT32_MAX; -#ifdef ESLOPE opentopslope = openbottomslope = NULL; -#endif } else #endif @@ -485,17 +473,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { opentop = frontheight; highceiling = backheight; -#ifdef ESLOPE opentopslope = front->c_slope; -#endif } else { opentop = backheight; highceiling = frontheight; -#ifdef ESLOPE opentopslope = back->c_slope; -#endif } frontheight = P_GetFloorZ(mobj, front, tmx, tmy, linedef); @@ -505,17 +489,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { openbottom = frontheight; lowfloor = backheight; -#ifdef ESLOPE openbottomslope = front->f_slope; -#endif } else { openbottom = backheight; lowfloor = frontheight; -#ifdef ESLOPE openbottomslope = back->f_slope; -#endif } } @@ -647,9 +627,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (bottomheight < opentop) { opentop = bottomheight; -#ifdef ESLOPE opentopslope = *rover->b_slope; -#endif openceilingrover = rover; } else if (bottomheight < highceiling) @@ -660,9 +638,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (topheight > openbottom) { openbottom = topheight; -#ifdef ESLOPE openbottomslope = *rover->t_slope; -#endif openfloorrover = rover; } else if (topheight > lowfloor) @@ -693,9 +669,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (bottomheight < opentop) { opentop = bottomheight; -#ifdef ESLOPE opentopslope = *rover->b_slope; -#endif openceilingrover = rover; } else if (bottomheight < highceiling) @@ -706,9 +680,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) { if (topheight > openbottom) { openbottom = topheight; -#ifdef ESLOPE openbottomslope = *rover->t_slope; -#endif openfloorrover = rover; } else if (topheight > lowfloor) diff --git a/src/p_maputl.h b/src/p_maputl.h index bb09c3ed1..08b606833 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -55,9 +55,7 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y); boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y); extern fixed_t opentop, openbottom, openrange, lowfloor, highceiling; -#ifdef ESLOPE extern pslope_t *opentopslope, *openbottomslope; -#endif extern ffloor_t *openfloorrover, *openceilingrover; void P_LineOpening(line_t *plinedef, mobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index 8ba1adc73..347f5fce7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -31,9 +31,7 @@ #include "i_video.h" #include "lua_hook.h" #include "b_bot.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "f_finale.h" #include "m_cond.h" @@ -931,12 +929,10 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y); -#endif if (mobj->z > topheight) return false; @@ -947,7 +943,6 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover) return true; } -#ifdef ESLOPE // P_GetFloorZ (and its ceiling counterpart) // Gets the floor height (or ceiling height) of the mobj's contact point in sector, assuming object's center if moved to [x, y] // If line is supplied, it's a divider line on the sector. Set it to NULL if you're not checking for collision with a line @@ -1051,15 +1046,12 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line, P_GetZAt(slope, v2.x, v2.y) ); } -#endif fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->f_slope) { fixed_t testx, testy; pslope_t *slope = sector->f_slope; @@ -1129,25 +1121,14 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the floor height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->floorheight; } fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->c_slope) { fixed_t testx, testy; pslope_t *slope = sector->c_slope; @@ -1217,26 +1198,15 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the ceiling height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->ceilingheight; } // Now do the same as all above, but for cameras because apparently cameras are special? fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->f_slope) { fixed_t testx, testy; pslope_t *slope = sector->f_slope; @@ -1306,25 +1276,14 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the floor height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->floorheight; } fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect) { -#ifdef ESLOPE I_Assert(mobj != NULL); -#endif I_Assert(sector != NULL); -#ifdef ESLOPE + if (sector->c_slope) { fixed_t testx, testy; pslope_t *slope = sector->c_slope; @@ -1394,15 +1353,6 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f return HighestOnLine(mobj->radius, x, y, line, slope, lowest); } else // Well, that makes it easy. Just get the ceiling height -#else - (void)mobj; - (void)boundsec; - (void)x; - (void)y; - (void)line; - (void)lowest; - (void)perfect; -#endif return sector->ceilingheight; } static void P_PlayerFlip(mobj_t *mo) @@ -1674,10 +1624,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy) else if (abs(player->rmomx) < FixedMul(STOPSPEED, mo->scale) && abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale) && (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING)) -#ifdef ESLOPE - && !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2)) -#endif - ) + && !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2))) { // if in a walking frame, stop moving if (player->panim == PA_WALK) @@ -1824,11 +1771,9 @@ void P_XYMovement(mobj_t *mo) fixed_t xmove, ymove; fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls boolean moved; -#ifdef ESLOPE pslope_t *oldslope = NULL; vector3_t slopemom; fixed_t predictedz = 0; -#endif I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); @@ -1858,7 +1803,6 @@ void P_XYMovement(mobj_t *mo) oldx = mo->x; oldy = mo->y; -#ifdef ESLOPE if (mo->flags & MF_NOCLIPHEIGHT) mo->standingslope = NULL; @@ -1883,7 +1827,6 @@ void P_XYMovement(mobj_t *mo) } } else if (P_IsObjectOnGround(mo) && !mo->momz) predictedz = mo->z; -#endif // Pushables can break some blocks if (CheckForBustableBlocks && ((mo->flags & MF_PUSHABLE) || ((mo->info->flags & MF_PUSHABLE) && mo->fuse))) @@ -1956,7 +1899,6 @@ void P_XYMovement(mobj_t *mo) } else if (player || mo->flags & (MF_SLIDEME|MF_PUSHABLE)) { // try to slide along it -#ifdef ESLOPE // Wall transfer part 1. pslope_t *transferslope = NULL; fixed_t transfermomz = 0; @@ -1966,14 +1908,12 @@ void P_XYMovement(mobj_t *mo) if (((transferslope->zangle < ANGLE_180) ? transferslope->zangle : InvAngle(transferslope->zangle)) >= ANGLE_45) // Prevent some weird stuff going on on shallow slopes. transfermomz = P_GetWallTransferMomZ(mo, transferslope); } -#endif P_SlideMove(mo); if (player) player->powers[pw_pushing] = 3; xmove = ymove = 0; -#ifdef ESLOPE // Wall transfer part 2. if (transfermomz && transferslope) // Are we "transferring onto the wall" (really just a disguised vertical launch)? { @@ -1996,7 +1936,6 @@ void P_XYMovement(mobj_t *mo) } } } -#endif } else if (mo->type == MT_SPINFIRE) { @@ -2052,7 +1991,6 @@ void P_XYMovement(mobj_t *mo) if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;; return; -#ifdef ESLOPE if (moved && oldslope && !(mo->flags & MF_NOCLIPHEIGHT)) { // Check to see if we ran off if (oldslope != mo->standingslope) { // First, compare different slopes @@ -2098,7 +2036,6 @@ void P_XYMovement(mobj_t *mo) //CONS_Printf("Launched off of flat surface running into downward slope\n"); } } -#endif // Check the gravity status. P_CheckGravity(mo, false); @@ -2149,11 +2086,9 @@ void P_XYMovement(mobj_t *mo) if (player && player->powers[pw_carry] == CR_NIGHTSMODE) return; // no friction for NiGHTS players -#ifdef ESLOPE if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED) && (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes return; -#endif if (((!(mo->eflags & MFE_VERTICALFLIP) && mo->z > mo->floorz) || (mo->eflags & MFE_VERTICALFLIP && mo->z+mo->height < mo->ceilingz)) && !(player && player->pflags & PF_SLIDING)) @@ -2421,7 +2356,6 @@ static boolean P_ZMovement(mobj_t *mo) mo->z += mo->momz; onground = P_IsObjectOnGround(mo); -#ifdef ESLOPE if (mo->standingslope) { if (mo->flags & MF_NOCLIPHEIGHT) @@ -2429,7 +2363,6 @@ static boolean P_ZMovement(mobj_t *mo) else if (!onground) P_SlopeLaunch(mo); } -#endif switch (mo->type) { @@ -2631,7 +2564,6 @@ static boolean P_ZMovement(mobj_t *mo) else mo->z = mo->floorz; -#ifdef ESLOPE if (!(mo->flags & MF_MISSILE) && mo->standingslope) // You're still on the ground; why are we here? { mo->momz = 0; @@ -2644,7 +2576,6 @@ static boolean P_ZMovement(mobj_t *mo) mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope; P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope); } -#endif // hit the floor if (mo->type == MT_FIREBALL) // special case for the fireball @@ -2744,13 +2675,11 @@ static boolean P_ZMovement(mobj_t *mo) else mom.y -= FixedMul(6*FRACUNIT, mo->scale); } -#ifdef ESLOPE else if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8) { // Pop the object up a bit to encourage bounciness //mom.z = P_MobjFlip(mo)*mo->scale; } -#endif else { mom.x = mom.y = mom.z = 0; @@ -2790,11 +2719,9 @@ static boolean P_ZMovement(mobj_t *mo) else if (tmfloorthing) mom.z = tmfloorthing->momz; -#ifdef ESLOPE if (mo->standingslope) { // MT_STEAM will never have a standingslope, see above. P_QuantizeMomentumToSlope(&mom, mo->standingslope); } -#endif mo->momx = mom.x; mo->momy = mom.y; @@ -2916,7 +2843,6 @@ static void P_PlayerZMovement(mobj_t *mo) || mo->player->playerstate == PST_REBORN) return; -#ifdef ESLOPE if (mo->standingslope) { if (mo->flags & MF_NOCLIPHEIGHT) @@ -2924,7 +2850,6 @@ static void P_PlayerZMovement(mobj_t *mo) else if (!onground) P_SlopeLaunch(mo); } -#endif // clip movement if (onground && !(mo->flags & MF_NOCLIPHEIGHT)) @@ -2952,12 +2877,10 @@ static void P_PlayerZMovement(mobj_t *mo) if (mo->player->panim == PA_PAIN) P_SetPlayerMobjState(mo, S_PLAY_WALK); -#ifdef ESLOPE if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) { // Handle landing on slope during Z movement P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)); } -#endif if (P_MobjFlip(mo)*mo->momz < 0) // falling { @@ -3290,10 +3213,8 @@ static boolean P_SceneryZMovement(mobj_t *mo) // boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) { - fixed_t topheight = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : -#endif + fixed_t topheight = *rover->t_slope ? + P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; if (!player->powers[pw_carry] && !player->homing @@ -3340,13 +3261,11 @@ void P_MobjCheckWater(mobj_t *mobj) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y); -#endif if (mobj->eflags & MFE_VERTICALFLIP) { @@ -3596,13 +3515,11 @@ static void P_SceneryCheckWater(mobj_t *mobj) topheight = *rover->topheight; bottomheight = *rover->bottomheight; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); if (*rover->b_slope) bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y); -#endif if (topheight <= mobj->z || bottomheight > (mobj->z + (mobj->height>>1))) @@ -3647,14 +3564,12 @@ static boolean P_CameraCheckHeat(camera_t *thiscam) if (!(rover->flags & FF_EXISTS)) continue; - if (halfheight >= ( -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : -#endif - *rover->topheight) || halfheight <= ( -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) : -#endif + if (halfheight >= (*rover->t_slope ? + P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : + *rover->topheight)) + continue; + if (halfheight <= (*rover->b_slope ? + P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) : *rover->bottomheight)) continue; @@ -3683,14 +3598,12 @@ static boolean P_CameraCheckWater(camera_t *thiscam) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS) continue; - if (halfheight >= ( -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : -#endif - *rover->topheight) || halfheight <= ( -#ifdef ESLOPE + if (halfheight >= (*rover->t_slope ? + P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) : + *rover->topheight)) + continue; + if (halfheight <= ( *rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) : -#endif *rover->bottomheight)) continue; @@ -3880,9 +3793,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) P_MobjCheckWater(mobj); -#ifdef ESLOPE P_ButteredSlope(mobj); -#endif // momentum movement mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN; @@ -4041,10 +3952,8 @@ static void CalculatePrecipFloor(precipmobj_t *mobj) mobjsecsubsec = mobj->subsector->sector; else return; - mobj->floorz = -#ifdef ESLOPE - mobjsecsubsec->f_slope ? P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) : -#endif + mobj->floorz = mobjsecsubsec->f_slope ? + P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) : mobjsecsubsec->floorheight; if (mobjsecsubsec->ffloors) { @@ -4060,12 +3969,10 @@ static void CalculatePrecipFloor(precipmobj_t *mobj) if (!(rover->flags & FF_BLOCKOTHERS) && !(rover->flags & FF_SWIMMABLE)) continue; -#ifdef ESLOPE if (*rover->t_slope) topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y); else -#endif - topheight = *rover->topheight; + topheight = *rover->topheight; if (topheight > mobj->floorz) mobj->floorz = topheight; @@ -10241,7 +10148,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->eflags &= ~MFE_JUSTHITFLOOR; } -#ifdef ESLOPE // Sliding physics for slidey mobjs! + // Sliding physics for slidey mobjs! if (mobj->type == MT_FLINGRING || mobj->type == MT_FLINGCOIN || mobj->type == MT_FLINGBLUESPHERE @@ -10256,7 +10163,6 @@ void P_MobjThinker(mobj_t *mobj) //if (mobj->standingslope) CONS_Printf("slope physics on mobj\n"); P_ButteredSlope(mobj); } -#endif if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health && P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz @@ -10590,15 +10496,11 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // Make sure scale matches destscale immediately when spawned P_SetScale(mobj, mobj->destscale); - mobj->floorz = -#ifdef ESLOPE - mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) : -#endif + mobj->floorz = mobj->subsector->sector->f_slope ? + P_GetZAt(mobj->subsector->sector->f_slope, x, y) : mobj->subsector->sector->floorheight; - mobj->ceilingz = -#ifdef ESLOPE - mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) : -#endif + mobj->ceilingz = mobj->subsector->sector->c_slope ? + P_GetZAt(mobj->subsector->sector->c_slope, x, y) : mobj->subsector->sector->ceilingheight; mobj->floorrover = NULL; @@ -10952,15 +10854,11 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype // set subsector and/or block links P_SetPrecipitationThingPosition(mobj); - mobj->floorz = starting_floorz = -#ifdef ESLOPE - mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) : -#endif + mobj->floorz = starting_floorz = mobj->subsector->sector->f_slope ? + P_GetZAt(mobj->subsector->sector->f_slope, x, y) : mobj->subsector->sector->floorheight; - mobj->ceilingz = -#ifdef ESLOPE - mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) : -#endif + mobj->ceilingz = mobj->subsector->sector->c_slope ? + P_GetZAt(mobj->subsector->sector->c_slope, x, y) : mobj->subsector->sector->ceilingheight; mobj->floorrover = NULL; @@ -11596,16 +11494,12 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) // set Z height sector = R_PointInSubsector(x, y)->sector; - floor = -#ifdef ESLOPE - sector->f_slope ? P_GetZAt(sector->f_slope, x, y) : -#endif - sector->floorheight; - ceiling = -#ifdef ESLOPE - sector->c_slope ? P_GetZAt(sector->c_slope, x, y) : -#endif - sector->ceilingheight; + floor = sector->f_slope ? + P_GetZAt(sector->f_slope, x, y) : + sector->floorheight; + ceiling = sector->c_slope ? + P_GetZAt(sector->c_slope, x, y) : + sector->ceilingheight; ceilingspawn = ceiling - mobjinfo[MT_PLAYER].height; if (mthing) @@ -11675,16 +11569,12 @@ void P_MovePlayerToStarpost(INT32 playernum) P_SetThingPosition(mobj); sector = R_PointInSubsector(mobj->x, mobj->y)->sector; - floor = -#ifdef ESLOPE - sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) : -#endif - sector->floorheight; - ceiling = -#ifdef ESLOPE - sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) : -#endif - sector->ceilingheight; + floor = sector->f_slope ? + P_GetZAt(sector->f_slope, mobj->x, mobj->y) : + sector->floorheight; + ceiling = sector->c_slope ? + P_GetZAt(sector->c_slope, mobj->x, mobj->y) : + sector->ceilingheight; z = p->starpostz << FRACBITS; @@ -11733,17 +11623,11 @@ static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x, // Establish height. if (flip) - return ( -#ifdef ESLOPE - ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : -#endif - ss->sector->ceilingheight) - offset - mobjinfo[mobjtype].height; + return (ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : ss->sector->ceilingheight) + - offset - mobjinfo[mobjtype].height; else - return ( -#ifdef ESLOPE - ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : -#endif - ss->sector->floorheight) + offset; + return (ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : ss->sector->floorheight) + + offset; } static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mthing, const fixed_t x, const fixed_t y) diff --git a/src/p_mobj.h b/src/p_mobj.h index 63c91571b..5deb288e4 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -370,9 +370,7 @@ typedef struct mobj_s INT32 cusval; INT32 cvmem; -#ifdef ESLOPE struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?) -#endif boolean colorized; // Whether the mobj uses the rainbow colormap fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius diff --git a/src/p_saveg.c b/src/p_saveg.c index 37d5f99ba..716904432 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -31,9 +31,7 @@ #include "r_sky.h" #include "p_polyobj.h" #include "lua_script.h" -#ifdef ESLOPE #include "p_slopes.h" -#endif savedata_t savedata; UINT8 *save_p; @@ -1252,9 +1250,7 @@ typedef enum MD2_HPREV = 1<<8, MD2_FLOORROVER = 1<<9, MD2_CEILINGROVER = 1<<10, -#ifdef ESLOPE MD2_SLOPE = 1<<11, -#endif MD2_COLORIZED = 1<<12, MD2_ROLLANGLE = 1<<13, MD2_SHADOWSCALE = 1<<14, @@ -1294,10 +1290,8 @@ typedef enum tc_fade, tc_fadecolormap, tc_planedisplace, -#ifdef ESLOPE tc_dynslopeline, tc_dynslopevert, -#endif // ESLOPE #ifdef POLYOBJECTS tc_polyrotate, // haleyjd 03/26/06: polyobjects tc_polymove, @@ -1336,13 +1330,11 @@ static inline UINT32 SavePlayer(const player_t *player) return 0xFFFFFFFF; } -#ifdef ESLOPE static UINT32 SaveSlope(const pslope_t *slope) { if (slope) return (UINT32)(slope->id); return 0xFFFFFFFF; } -#endif // ESLOPE // // SaveMobjThinker @@ -1471,10 +1463,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) diff2 |= MD2_FLOORROVER; if (mobj->ceilingrover) diff2 |= MD2_CEILINGROVER; -#ifdef ESLOPE if (mobj->standingslope) diff2 |= MD2_SLOPE; -#endif if (mobj->colorized) diff2 |= MD2_COLORIZED; if (mobj->rollangle) @@ -1639,10 +1629,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) WRITEUINT32(save_p, mobj->hnext->mobjnum); if (diff2 & MD2_HPREV) WRITEUINT32(save_p, mobj->hprev->mobjnum); -#ifdef ESLOPE if (diff2 & MD2_SLOPE) WRITEUINT16(save_p, mobj->standingslope->id); -#endif if (diff2 & MD2_COLORIZED) WRITEUINT8(save_p, mobj->colorized); if (diff2 & MD2_ROLLANGLE) @@ -1993,7 +1981,7 @@ static void SavePlaneDisplaceThinker(const thinker_t *th, const UINT8 type) WRITEFIXED(save_p, ht->speed); WRITEUINT8(save_p, ht->type); } -#ifdef ESLOPE + /// Save a dynamic slope thinker. static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type) { @@ -2008,7 +1996,6 @@ static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type WRITEMEM(save_p, ht->tags, sizeof(ht->tags)); WRITEMEM(save_p, ht->vex, sizeof(ht->vex)); } -#endif // ESLOPE #ifdef POLYOBJECTS @@ -2391,7 +2378,6 @@ static void P_NetArchiveThinkers(void) continue; } #endif -#ifdef ESLOPE else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeLine) { SaveDynamicSlopeThinker(th, tc_dynslopeline); @@ -2402,7 +2388,6 @@ static void P_NetArchiveThinkers(void) SaveDynamicSlopeThinker(th, tc_dynslopevert); continue; } -#endif // ESLOPE #ifdef PARANOIA else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection I_Error("unknown thinker type %p", th->function.acp1); @@ -2463,7 +2448,6 @@ static inline player_t *LoadPlayer(UINT32 player) return &players[player]; } -#ifdef ESLOPE static inline pslope_t *LoadSlope(UINT32 slopeid) { pslope_t *p = slopelist; @@ -2475,7 +2459,6 @@ static inline pslope_t *LoadSlope(UINT32 slopeid) } while ((p = p->next)); return NULL; } -#endif // ESLOPE // // LoadMobjThinker @@ -2720,10 +2703,8 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker) mobj->hnext = (mobj_t *)(size_t)READUINT32(save_p); if (diff2 & MD2_HPREV) mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p); -#ifdef ESLOPE if (diff2 & MD2_SLOPE) mobj->standingslope = P_SlopeById(READUINT16(save_p)); -#endif if (diff2 & MD2_COLORIZED) mobj->colorized = READUINT8(save_p); if (diff2 & MD2_ROLLANGLE) @@ -3183,7 +3164,6 @@ static inline thinker_t* LoadPlaneDisplaceThinker(actionf_p1 thinker) return &ht->thinker; } -#ifdef ESLOPE /// Save a dynamic slope thinker. static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker) { @@ -3198,7 +3178,6 @@ static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker) READMEM(save_p, ht->vex, sizeof(ht->vex)); return &ht->thinker; } -#endif // ESLOPE #ifdef POLYOBJECTS @@ -3578,7 +3557,7 @@ static void P_NetUnArchiveThinkers(void) th = LoadPolyfadeThinker((actionf_p1)T_PolyObjFade); break; #endif -#ifdef ESLOPE + case tc_dynslopeline: th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeLine); break; @@ -3586,7 +3565,6 @@ static void P_NetUnArchiveThinkers(void) case tc_dynslopevert: th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeVert); break; -#endif // ESLOPE case tc_scroll: th = LoadScrollThinker((actionf_p1)T_Scroll); diff --git a/src/p_setup.c b/src/p_setup.c index b3b86886f..cdf867d61 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -77,9 +77,7 @@ #include "hardware/hw_model.h" #endif -#ifdef ESLOPE #include "p_slopes.h" -#endif #include "fastcmp.h" // textmap parsing @@ -909,11 +907,9 @@ static void P_InitializeSector(sector_t *ss) ss->preciplist = NULL; ss->touching_preciplist = NULL; -#ifdef ESLOPE ss->f_slope = NULL; ss->c_slope = NULL; ss->hasslope = false; -#endif ss->spawn_lightlevel = ss->lightlevel; @@ -3580,9 +3576,7 @@ boolean P_LoadLevel(boolean fromnetsave) // anything that P_SpawnSlopes/P_LoadThings needs to know P_InitSpecials(); -#ifdef ESLOPE P_SpawnSlopes(fromnetsave); -#endif P_SpawnMapThings(!fromnetsave); skyboxmo[0] = skyboxviewpnts[0]; diff --git a/src/p_sight.c b/src/p_sight.c index 4ea14cca0..c9083b99b 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -218,9 +218,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) const vertex_t *v1,*v2; fixed_t frac; fixed_t frontf, backf, frontc, backc; -#ifdef ESLOPE fixed_t fracx, fracy; -#endif if (seg->glseg) continue; @@ -263,7 +261,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) front = seg->frontsector; back = seg->backsector; -#ifdef ESLOPE // calculate position at intercept fracx = los->strace.x + FixedMul(los->strace.dx, frac); fracy = los->strace.y + FixedMul(los->strace.dy, frac); @@ -272,12 +269,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) frontc = (front->c_slope) ? P_GetZAt(front->c_slope, fracx, fracy) : front->ceilingheight; backf = (back->f_slope) ? P_GetZAt(back->f_slope, fracx, fracy) : back->floorheight; backc = (back->c_slope) ? P_GetZAt(back->c_slope, fracx, fracy) : back->ceilingheight; -#else - frontf = front->floorheight; - frontc = front->ceilingheight; - backf = back->floorheight; - backc = back->ceilingheight; -#endif // crosses a two sided line // no wall to block sight with? if (frontf == backf && frontc == backc @@ -327,13 +318,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) continue; } -#ifdef ESLOPE topz = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight; bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight; -#else - topz = *rover->topheight; - bottomz = *rover->bottomheight; -#endif topslope = FixedDiv(topz - los->sightzstart , frac); bottomslope = FixedDiv(bottomz - los->sightzstart , frac); if (topslope >= los->topslope && bottomslope <= los->bottomslope) @@ -348,13 +334,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) continue; } -#ifdef ESLOPE topz = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight; bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight; -#else - topz = *rover->topheight; - bottomz = *rover->bottomheight; -#endif topslope = FixedDiv(topz - los->sightzstart , frac); bottomslope = FixedDiv(bottomz - los->sightzstart , frac); if (topslope >= los->topslope && bottomslope <= los->bottomslope) @@ -487,7 +468,6 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) continue; } -#ifdef ESLOPE if (*rover->t_slope) { topz1 = P_GetZAt(*rover->t_slope, t1->x, t1->y); @@ -503,10 +483,6 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) } else bottomz1 = bottomz2 = *rover->bottomheight; -#else - topz1 = topz2 = *rover->topheight; - bottomz1 = bottomz2 = *rover->bottomheight; -#endif // Check for blocking floors here. if ((los.sightzstart < bottomz1 && t2->z >= topz2) diff --git a/src/p_slopes.c b/src/p_slopes.c index e275964e3..4b5838077 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -23,8 +23,6 @@ #include "p_maputl.h" #include "w_wad.h" -#ifdef ESLOPE - pslope_t *slopelist = NULL; UINT16 slopecount = 0; @@ -844,6 +842,3 @@ void P_ButteredSlope(mobj_t *mo) P_Thrust(mo, mo->standingslope->xydirection, thrust); } - -// EOF -#endif // #ifdef ESLOPE diff --git a/src/p_slopes.h b/src/p_slopes.h index f8159b884..e7c850ab8 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -15,8 +15,6 @@ #include "m_fixed.h" // Vectors -#ifdef ESLOPE - extern pslope_t *slopelist; extern UINT16 slopecount; @@ -74,5 +72,4 @@ typedef struct void T_DynamicSlopeLine (dynplanethink_t* th); void T_DynamicSlopeVert (dynplanethink_t* th); -#endif // #ifdef ESLOPE #endif // #ifndef P_SLOPES_H__ diff --git a/src/p_spec.c b/src/p_spec.c index 8938a51b6..cd26dcf9e 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5788,7 +5788,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f fflr->topyoffs = &sec2->ceiling_yoffs; fflr->topangle = &sec2->ceilingpic_angle; -#ifdef ESLOPE // Add slopes fflr->t_slope = &sec2->c_slope; fflr->b_slope = &sec2->f_slope; @@ -5796,7 +5795,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f // (this fixes FOF slopes glitching initially at level load in software mode) if (sec2->hasslope) sec->hasslope = true; -#endif if ((flags & FF_SOLID) && (master->flags & ML_EFFECT1)) // Block player only flags &= ~FF_BLOCKOTHERS; @@ -6274,15 +6272,11 @@ void T_LaserFlash(laserthink_t *flash) sourcesec = fflr->master->frontsector; // Less to type! -#ifdef ESLOPE top = (*fflr->t_slope) ? P_GetZAt(*fflr->t_slope, sector->soundorg.x, sector->soundorg.y) : *fflr->topheight; bottom = (*fflr->b_slope) ? P_GetZAt(*fflr->b_slope, sector->soundorg.x, sector->soundorg.y) : *fflr->bottomheight; sector->soundorg.z = (top + bottom)/2; -#else - sector->soundorg.z = (*fflr->topheight + *fflr->bottomheight)/2; -#endif S_StartSound(§or->soundorg, sfx_laser); // Seek out objects to DESTROY! MUAHAHHAHAHAA!!!*cough* @@ -7927,12 +7921,10 @@ void T_Disappear(disappear_t *d) if (!(lines[d->sourceline].flags & ML_NOCLIMB)) { -#ifdef ESLOPE if (*rover->t_slope) sectors[s].soundorg.z = P_GetZAt(*rover->t_slope, sectors[s].soundorg.x, sectors[s].soundorg.y); else -#endif - sectors[s].soundorg.z = *rover->topheight; + sectors[s].soundorg.z = *rover->topheight; S_StartSound(§ors[s].soundorg, sfx_appear); } } diff --git a/src/p_user.c b/src/p_user.c index 19b53e16f..c12bc0c59 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2274,13 +2274,8 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space if (GETSECSPECIAL(rover->master->frontsector->special, 1) != SPACESPECIAL) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (mo->z + (mo->height/2) > topheight) continue; @@ -2517,13 +2512,8 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand if (!(rover->flags & FF_QUICKSAND)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (mo->z + flipoffset > topheight) continue; @@ -2693,9 +2683,7 @@ static void P_CheckBouncySectors(player_t *player) fixed_t oldx; fixed_t oldy; fixed_t oldz; -#ifdef ESLOPE vector3_t momentum; -#endif oldx = player->mo->x; oldy = player->mo->y; @@ -2750,7 +2738,6 @@ static void P_CheckBouncySectors(player_t *player) { fixed_t newmom; -#ifdef ESLOPE pslope_t *slope; if (abs(oldz - topheight) < abs(oldz + player->mo->height - bottomheight)) { // Hit top slope = *rover->t_slope; @@ -2766,9 +2753,6 @@ static void P_CheckBouncySectors(player_t *player) P_ReverseQuantizeMomentumToSlope(&momentum, slope); newmom = momentum.z = -FixedMul(momentum.z,linedist)/2; -#else - newmom = -FixedMul(player->mo->momz,linedist); -#endif if (abs(newmom) < (linedist*2)) { @@ -2791,7 +2775,6 @@ static void P_CheckBouncySectors(player_t *player) else if (newmom < -P_GetPlayerHeight(player)/2) newmom = -P_GetPlayerHeight(player)/2; -#ifdef ESLOPE momentum.z = newmom*2; if (slope) @@ -2800,9 +2783,6 @@ static void P_CheckBouncySectors(player_t *player) player->mo->momx = momentum.x; player->mo->momy = momentum.y; player->mo->momz = momentum.z/2; -#else - player->mo->momz = newmom; -#endif if (player->pflags & PF_SPINNING) { @@ -2859,13 +2839,8 @@ static void P_CheckQuicksand(player_t *player) if (!(rover->flags & FF_QUICKSAND)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height) { @@ -3199,26 +3174,21 @@ static void P_DoClimbing(player_t *player) boolean thrust = false; boolean boostup = false; boolean skyclimber = false; - fixed_t floorheight, ceilingheight; // ESLOPE + fixed_t floorheight, ceilingheight; if (!glidesector) floorclimb = true; else { -#ifdef ESLOPE floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) : glidesector->sector->floorheight; ceilingheight = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y) : glidesector->sector->ceilingheight; -#else - floorheight = glidesector->sector->floorheight; - ceilingheight = glidesector->sector->ceilingheight; -#endif if (glidesector->sector->ffloors) { ffloor_t *rover; - fixed_t topheight, bottomheight; // ESLOPE + fixed_t topheight, bottomheight; for (rover = glidesector->sector->ffloors; rover; rover = rover->next) { @@ -3227,13 +3197,8 @@ static void P_DoClimbing(player_t *player) floorclimb = true; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif // Only supports rovers that are moving like an 'elevator', not just the top or bottom. if (rover->master->frontsector->floorspeed && rover->master->frontsector->ceilspeed == 42) @@ -3274,11 +3239,7 @@ static void P_DoClimbing(player_t *player) if (roverbelow == rover) continue; -#ifdef ESLOPE bottomheight2 = *roverbelow->b_slope ? P_GetZAt(*roverbelow->b_slope, player->mo->x, player->mo->y) : *roverbelow->bottomheight; -#else - bottomheight2 = *roverbelow->bottomheight; -#endif if (bottomheight2 < topheight + FixedMul(16*FRACUNIT, player->mo->scale)) foundfof = true; @@ -3324,11 +3285,7 @@ static void P_DoClimbing(player_t *player) if (roverbelow == rover) continue; -#ifdef ESLOPE topheight2 = *roverbelow->t_slope ? P_GetZAt(*roverbelow->t_slope, player->mo->x, player->mo->y) : *roverbelow->topheight; -#else - topheight2 = *roverbelow->topheight; -#endif if (topheight2 > bottomheight - FixedMul(16*FRACUNIT, player->mo->scale)) foundfof = true; @@ -3383,11 +3340,7 @@ static void P_DoClimbing(player_t *player) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP)) continue; -#ifdef ESLOPE bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - bottomheight = *rover->bottomheight; -#endif if (bottomheight < floorheight + FixedMul(16*FRACUNIT, player->mo->scale)) { @@ -3428,11 +3381,7 @@ static void P_DoClimbing(player_t *player) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; -#else - topheight = *rover->topheight; -#endif if (topheight > ceilingheight - FixedMul(16*FRACUNIT, player->mo->scale)) { @@ -3807,12 +3756,10 @@ static void P_DoTeeter(player_t *player) ceilingheight = sec->ceilingheight; floorheight = sec->floorheight; -#ifdef ESLOPE if (sec->c_slope) ceilingheight = P_GetZAt(sec->c_slope, checkx, checky); if (sec->f_slope) floorheight = P_GetZAt(sec->f_slope, checkx, checky); -#endif highestceilingheight = (ceilingheight > highestceilingheight) ? ceilingheight : highestceilingheight; lowestfloorheight = (floorheight < lowestfloorheight) ? floorheight : lowestfloorheight; @@ -3823,13 +3770,8 @@ static void P_DoTeeter(player_t *player) { if (!(rover->flags & FF_EXISTS)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (P_CheckSolidLava(rover)) ; @@ -4638,9 +4580,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) return; } -#ifdef ESLOPE canstand = (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2); -#endif /////////////////////////////// // ability-specific behavior // @@ -5903,12 +5843,10 @@ static void P_3dMovement(player_t *player) controlstyle_e controlstyle; boolean spin = ((onground = P_IsObjectOnGround(player->mo)) && (player->pflags & (PF_SPINNING|PF_THOKKED)) == PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH)); fixed_t oldMagnitude, newMagnitude; -#ifdef ESLOPE vector3_t totalthrust; totalthrust.x = totalthrust.y = 0; // I forget if this is needed totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes -#endif // ESLOPE // Get the old momentum; this will be needed at the end of the function! -SH oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); @@ -6109,12 +6047,8 @@ static void P_3dMovement(player_t *player) movepushforward = FixedMul(movepushforward, player->mo->scale); -#ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward); -#else - P_Thrust(player->mo, movepushangle, movepushforward); -#endif } // Sideways movement if (player->climbing) @@ -6157,12 +6091,8 @@ static void P_3dMovement(player_t *player) movepushforward = FixedMul(movepushforward, player->mo->scale); -#ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward); totalthrust.y += P_ReturnThrustY(player->mo, controldirection, movepushforward); -#else - P_Thrust(player->mo, controldirection, movepushforward); -#endif } } else if (cmd->sidemove && !(player->pflags & PF_GLIDING) && !player->exiting && !P_PlayerInPain(player)) @@ -6191,15 +6121,10 @@ static void P_3dMovement(player_t *player) // Finally move the player now that their speed/direction has been decided. movepushside = FixedMul(movepushside, player->mo->scale); -#ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, movepushsideangle, movepushside); totalthrust.y += P_ReturnThrustY(player->mo, movepushsideangle, movepushside); -#else - P_Thrust(player->mo, movepushsideangle, movepushside); -#endif } -#ifdef ESLOPE if ((totalthrust.x || totalthrust.y) && player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) { // Factor thrust to slope, but only for the part pushing up it! @@ -6219,7 +6144,6 @@ static void P_3dMovement(player_t *player) player->mo->momx += totalthrust.x; player->mo->momy += totalthrust.y; -#endif // Time to ask three questions: // 1) Are we over topspeed? @@ -7832,14 +7756,13 @@ void P_ElementalFire(player_t *player, boolean cropcircle) newx = player->mo->x + P_ReturnThrustX(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); newy = player->mo->y + P_ReturnThrustY(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); -#ifdef ESLOPE if (player->mo->standingslope) { ground = P_GetZAt(player->mo->standingslope, newx, newy); if (player->mo->eflags & MFE_VERTICALFLIP) ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); } -#endif + flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); P_SetTarget(&flame->target, player->mo); flame->angle = travelangle; @@ -10740,13 +10663,8 @@ static void P_CalcPostImg(player_t *player) if (!(rover->flags & FF_EXISTS)) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (pviewheight >= topheight || pviewheight <= bottomheight) continue; @@ -10768,13 +10686,8 @@ static void P_CalcPostImg(player_t *player) if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER) continue; -#ifdef ESLOPE topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; -#else - topheight = *rover->topheight; - bottomheight = *rover->bottomheight; -#endif if (pviewheight >= topheight || pviewheight <= bottomheight) continue; diff --git a/src/r_bsp.c b/src/r_bsp.c index c0011f4b9..85113be43 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -359,10 +359,8 @@ boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back) #endif back->ceilingpic == front->ceilingpic && back->floorpic == front->floorpic -#ifdef ESLOPE && back->f_slope == front->f_slope && back->c_slope == front->c_slope -#endif && back->lightlevel == front->lightlevel && !line->sidedef->midtexture // Check offsets too! @@ -497,7 +495,6 @@ static void R_AddLine(seg_t *line) } // Closed door. -#ifdef ESLOPE if (frontsector->f_slope || frontsector->c_slope || backsector->f_slope || backsector->c_slope) { fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends @@ -542,7 +539,6 @@ static void R_AddLine(seg_t *line) goto clippass; } else -#endif { // if both ceilings are skies, consider it always "open" // same for floors @@ -863,16 +859,12 @@ static void R_Subsector(size_t num) floorcolormap = ceilingcolormap = frontsector->extra_colormap; - floorcenterz = -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + floorcenterz = frontsector->f_slope ? + P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : frontsector->floorheight; - ceilingcenterz = -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + ceilingcenterz = frontsector->c_slope ? + P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : frontsector->ceilingheight; // Check and prep all 3D floors. Set the sector floor/ceiling light levels and colormaps. @@ -899,34 +891,23 @@ static void R_Subsector(size_t num) sub->sector->extra_colormap = frontsector->extra_colormap; - if ((( -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : -#endif - frontsector->floorheight) < viewz || frontsector->floorpic == skyflatnum - || (frontsector->heightsec != -1 - && sectors[frontsector->heightsec].ceilingpic == skyflatnum))) + if ((frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : frontsector->floorheight) < viewz + || frontsector->floorpic == skyflatnum + || (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum)) { floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel, frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , frontsector->f_slope -#endif - ); + , frontsector->f_slope); } else floorplane = NULL; - if ((( -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : -#endif - frontsector->ceilingheight) > viewz || frontsector->ceilingpic == skyflatnum - || (frontsector->heightsec != -1 - && sectors[frontsector->heightsec].floorpic == skyflatnum))) + if ((frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : frontsector->ceilingheight) > viewz + || frontsector->ceilingpic == skyflatnum + || (frontsector->heightsec != -1 && sectors[frontsector->heightsec].floorpic == skyflatnum)) { ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic, ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle, @@ -934,18 +915,13 @@ static void R_Subsector(size_t num) #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , frontsector->c_slope -#endif - ); + , frontsector->c_slope); } else ceilingplane = NULL; numffloors = 0; -#ifdef ESLOPE ffloor[numffloors].slope = NULL; -#endif ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; if (frontsector->ffloors) @@ -970,16 +946,12 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; - heightcheck = -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) : -#endif + heightcheck = *rover->b_slope ? + P_GetZAt(*rover->b_slope, viewx, viewy) : *rover->bottomheight; - planecenterz = -#ifdef ESLOPE - *rover->b_slope ? P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + planecenterz = *rover->b_slope ? + P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) : *rover->bottomheight; if (planecenterz <= ceilingcenterz && planecenterz >= floorcenterz @@ -995,18 +967,13 @@ static void R_Subsector(size_t num) #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , *rover->b_slope -#endif - ); + , *rover->b_slope); -#ifdef ESLOPE ffloor[numffloors].slope = *rover->b_slope; // Tell the renderer this sector has slopes in it. if (ffloor[numffloors].slope) frontsector->hasslope = true; -#endif ffloor[numffloors].height = heightcheck; ffloor[numffloors].ffloor = rover; @@ -1017,16 +984,12 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; - heightcheck = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) : -#endif + heightcheck = *rover->t_slope ? + P_GetZAt(*rover->t_slope, viewx, viewy) : *rover->topheight; - planecenterz = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif + planecenterz = *rover->t_slope ? + P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) : *rover->topheight; if (planecenterz >= floorcenterz && planecenterz <= ceilingcenterz @@ -1041,18 +1004,13 @@ static void R_Subsector(size_t num) #ifdef POLYOBJECTS_PLANES , NULL #endif -#ifdef ESLOPE - , *rover->t_slope -#endif - ); + , *rover->t_slope); -#ifdef ESLOPE ffloor[numffloors].slope = *rover->t_slope; // Tell the renderer this sector has slopes in it. if (ffloor[numffloors].slope) frontsector->hasslope = true; -#endif ffloor[numffloors].height = heightcheck; ffloor[numffloors].ffloor = rover; @@ -1090,18 +1048,13 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floor_xoffs, polysec->floor_yoffs, polysec->floorpic_angle-po->angle, - (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po -#ifdef ESLOPE - , NULL // will ffloors be slopable eventually? -#endif - ); + (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po, + NULL); // will ffloors be slopable eventually? ffloor[numffloors].height = polysec->floorheight; ffloor[numffloors].polyobj = po; -#ifdef ESLOPE ffloor[numffloors].slope = NULL; -#endif -// ffloor[numffloors].ffloor = rover; + //ffloor[numffloors].ffloor = rover; po->visplane = ffloor[numffloors].plane; numffloors++; } @@ -1118,18 +1071,13 @@ static void R_Subsector(size_t num) light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle, - (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po -#ifdef ESLOPE - , NULL // will ffloors be slopable eventually? -#endif - ); + (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po, + NULL); // will ffloors be slopable eventually? ffloor[numffloors].polyobj = po; ffloor[numffloors].height = polysec->ceilingheight; -#ifdef ESLOPE ffloor[numffloors].slope = NULL; -#endif -// ffloor[numffloors].ffloor = rover; + //ffloor[numffloors].ffloor = rover; po->visplane = ffloor[numffloors].plane; numffloors++; } @@ -1192,11 +1140,9 @@ void R_Prep3DFloors(sector_t *sector) fixed_t bestheight, maxheight; INT32 count, i; sector_t *sec; -#ifdef ESLOPE pslope_t *bestslope = NULL; fixed_t heighttest; // I think it's better to check the Z height at the sector's center // than assume unsloped heights are accurate indicators of order in sloped sectors. -Red -#endif count = 1; for (rover = sector->ffloors; rover; rover = rover->next) @@ -1219,14 +1165,10 @@ void R_Prep3DFloors(sector_t *sector) else memset(sector->lightlist, 0, sizeof (lightlist_t) * count); -#ifdef ESLOPE heighttest = sector->c_slope ? P_GetZAt(sector->c_slope, sector->soundorg.x, sector->soundorg.y) : sector->ceilingheight; sector->lightlist[0].height = heighttest + 1; sector->lightlist[0].slope = sector->c_slope; -#else - sector->lightlist[0].height = sector->ceilingheight + 1; -#endif sector->lightlist[0].lightlevel = §or->lightlevel; sector->lightlist[0].caster = NULL; sector->lightlist[0].extra_colormap = §or->extra_colormap; @@ -1244,7 +1186,6 @@ void R_Prep3DFloors(sector_t *sector) && !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES))) continue; -#ifdef ESLOPE heighttest = *rover->t_slope ? P_GetZAt(*rover->t_slope, sector->soundorg.x, sector->soundorg.y) : *rover->topheight; if (heighttest > bestheight && heighttest < maxheight) @@ -1266,21 +1207,6 @@ void R_Prep3DFloors(sector_t *sector) continue; } } -#else - if (*rover->topheight > bestheight && *rover->topheight < maxheight) - { - best = rover; - bestheight = *rover->topheight; - continue; - } - if (rover->flags & FF_DOUBLESHADOW && *rover->bottomheight > bestheight - && *rover->bottomheight < maxheight) - { - best = rover; - bestheight = *rover->bottomheight; - continue; - } -#endif } if (!best) { @@ -1291,9 +1217,7 @@ void R_Prep3DFloors(sector_t *sector) sector->lightlist[i].height = maxheight = bestheight; sector->lightlist[i].caster = best; sector->lightlist[i].flags = best->flags; -#ifdef ESLOPE sector->lightlist[i].slope = bestslope; -#endif sec = §ors[best->secnum]; if (best->flags & FF_NOSHADE) @@ -1314,12 +1238,8 @@ void R_Prep3DFloors(sector_t *sector) if (best->flags & FF_DOUBLESHADOW) { -#ifdef ESLOPE heighttest = *best->b_slope ? P_GetZAt(*best->b_slope, sector->soundorg.x, sector->soundorg.y) : *best->bottomheight; if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red -#else - if (bestheight == *best->bottomheight) -#endif { sector->lightlist[i].lightlevel = sector->lightlist[best->lastlight].lightlevel; sector->lightlist[i].extra_colormap = diff --git a/src/r_defs.h b/src/r_defs.h index e6f1e4e7c..0c6ff1d30 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -171,11 +171,9 @@ typedef struct ffloor_s fixed_t *bottomyoffs; angle_t *bottomangle; -#ifdef ESLOPE // Pointers to pointers. Yup. struct pslope_s **t_slope; struct pslope_s **b_slope; -#endif size_t secnum; ffloortype_e flags; @@ -208,9 +206,7 @@ typedef struct lightlist_s extracolormap_t **extra_colormap; // pointer-to-a-pointer, so we can react to colormap changes INT32 flags; ffloor_t *caster; -#ifdef ESLOPE struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh. -#endif } lightlist_t; @@ -244,7 +240,6 @@ typedef struct linechain_s // Slopes -#ifdef ESLOPE typedef enum { SL_NOPHYSICS = 1, /// This plane will have no physics applied besides the positioning. SL_DYNAMIC = 1<<1, /// This plane slope will be assigned a thinker to make it dynamic. @@ -268,7 +263,6 @@ typedef struct pslope_s UINT8 flags; // Slope options } pslope_t; -#endif typedef enum { @@ -379,12 +373,10 @@ typedef struct sector_s precipmobj_t *preciplist; struct mprecipsecnode_s *touching_preciplist; -#ifdef ESLOPE // Eternity engine slope pslope_t *f_slope; // floor slope pslope_t *c_slope; // ceiling slope boolean hasslope; // The sector, or one of its visible FOFs, contains a slope -#endif // for fade thinker INT16 spawn_lightlevel; @@ -668,11 +660,9 @@ typedef struct drawseg_s UINT8 portalpass; // if > 0 and <= portalrender, do not affect sprite clipping -#ifdef ESLOPE fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures vertex_t leftpos, rightpos; // Used for rendering FOF walls with slopes -#endif } drawseg_t; typedef enum diff --git a/src/r_draw.c b/src/r_draw.c index f46f4fb13..b983db0aa 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -105,12 +105,10 @@ boolean ds_powersoftwo; UINT8 *ds_source; // start of a 64*64 tile image UINT8 *ds_transmap; // one of the translucency tables -#ifdef ESLOPE pslope_t *ds_slope; // Current slope being used floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff? floatv3_t *ds_sup, *ds_svp, *ds_szp; float focallengthf, zeroheight; -#endif /** \brief Variable flat sizes */ diff --git a/src/r_draw.h b/src/r_draw.h index 870d294c3..4d94f861b 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -62,7 +62,6 @@ extern boolean ds_powersoftwo; extern UINT8 *ds_source; extern UINT8 *ds_transmap; -#ifdef ESLOPE typedef struct { float x, y, z; } floatv3_t; @@ -71,7 +70,6 @@ extern pslope_t *ds_slope; // Current slope being used extern floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff? extern floatv3_t *ds_sup, *ds_svp, *ds_szp; extern float focallengthf, zeroheight; -#endif // Variable flat sizes extern UINT32 nflatxshift; @@ -152,7 +150,6 @@ void R_DrawSpan_8(void); void R_DrawSplat_8(void); void R_DrawTranslucentSpan_8(void); void R_DrawTranslucentSplat_8(void); -#ifdef ESLOPE void R_DrawTiltedSpan_8(void); void R_DrawTiltedTranslucentSpan_8(void); #ifndef NOWATER @@ -161,7 +158,6 @@ void R_DrawTiltedTranslucentWaterSpan_8(void); void R_DrawTiltedSplat_8(void); void R_CalcTiltedLighting(fixed_t start, fixed_t end); extern INT32 tiltlighting[MAXVIDWIDTH]; -#endif #ifndef NOWATER void R_DrawTranslucentWaterSpan_8(void); extern INT32 ds_bgofs; @@ -174,14 +170,12 @@ void R_DrawSpan_NPO2_8(void); void R_DrawTranslucentSpan_NPO2_8(void); void R_DrawSplat_NPO2_8(void); void R_DrawTranslucentSplat_NPO2_8(void); -#ifdef ESLOPE void R_DrawTiltedSpan_NPO2_8(void); void R_DrawTiltedTranslucentSpan_NPO2_8(void); #ifndef NOWATER void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void); #endif void R_DrawTiltedSplat_NPO2_8(void); -#endif #ifndef NOWATER void R_DrawTranslucentWaterSpan_NPO2_8(void); #endif diff --git a/src/r_draw8.c b/src/r_draw8.c index fe0a23770..940ea724b 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -620,7 +620,6 @@ void R_DrawSpan_8 (void) } } -#ifdef ESLOPE // R_CalcTiltedLighting // Exactly what it says on the tin. I wish I wasn't too lazy to explain things properly. INT32 tiltlighting[MAXVIDWIDTH]; @@ -1199,7 +1198,6 @@ void R_DrawTiltedSplat_8(void) } #endif } -#endif // ESLOPE /** \brief The R_DrawSplat_8 function Just like R_DrawSpan_8, but skips transparent pixels. diff --git a/src/r_draw8_npo2.c b/src/r_draw8_npo2.c index b91f492f2..020155694 100644 --- a/src/r_draw8_npo2.c +++ b/src/r_draw8_npo2.c @@ -61,8 +61,6 @@ void R_DrawSpan_NPO2_8 (void) } } -#ifdef ESLOPE - #define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan)) /** \brief The R_DrawTiltedSpan_NPO2_8 function @@ -661,7 +659,6 @@ void R_DrawTiltedSplat_NPO2_8(void) } #endif } -#endif // ESLOPE /** \brief The R_DrawSplat_NPO2_8 function Just like R_DrawSpan_NPO2_8, but skips transparent pixels. @@ -846,7 +843,6 @@ void R_DrawTranslucentWaterSpan_NPO2_8(void) } } -#ifdef ESLOPE /** \brief The R_DrawTiltedTranslucentWaterSpan_NPO2_8 function Like DrawTiltedTranslucentSpan_NPO2, but for water */ @@ -1043,5 +1039,4 @@ void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void) } #endif } -#endif // ESLOPE #endif // NOWATER diff --git a/src/r_main.c b/src/r_main.c index 409a82f28..9a3d98870 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -459,9 +459,7 @@ static void R_InitTextureMapping(void) focallength = FixedDiv(projection, FINETANGENT(FINEANGLES/4+FIELDOFVIEW/2)); -#ifdef ESLOPE focallengthf = FIXED_TO_FLOAT(focallength); -#endif for (i = 0; i < FINEANGLES/2; i++) { diff --git a/src/r_plane.c b/src/r_plane.c index e1e45517a..ca5aa758e 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -202,7 +202,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) // Needed for ds_bgofs R_PlaneRipple(currentplane, y, planeheight); -#ifdef ESLOPE if (currentplane->slope) { ds_sup = &ds_su[y]; @@ -210,7 +209,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) ds_szp = &ds_sz[y]; } else -#endif { ds_xfrac += ripple_xfrac; ds_yfrac += ripple_yfrac; @@ -227,12 +225,10 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2) if (pindex >= MAXLIGHTZ) pindex = MAXLIGHTZ - 1; -#ifdef ESLOPE if (currentplane->slope) ds_colormap = colormaps; else -#endif - ds_colormap = planezlight[pindex]; + ds_colormap = planezlight[pindex]; if (currentplane->extra_colormap) ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps); @@ -345,17 +341,12 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef POLYOBJECTS_PLANES , polyobj_t *polyobj #endif -#ifdef ESLOPE - , pslope_t *slope -#endif - ) + , pslope_t *slope) { visplane_t *check; unsigned hash; -#ifdef ESLOPE - if (slope); else // Don't mess with this right now if a slope is involved -#endif + if (!slope) // Don't mess with this right now if a slope is involved { xoff += viewx; yoff -= viewy; @@ -413,10 +404,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewangle == viewangle && check->plangle == plangle -#ifdef ESLOPE - && check->slope == slope -#endif - ) + && check->slope == slope) { return check; } @@ -441,9 +429,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef POLYOBJECTS_PLANES check->polyobj = polyobj; #endif -#ifdef ESLOPE check->slope = slope; -#endif memset(check->top, 0xff, sizeof (check->top)); memset(check->bottom, 0x00, sizeof (check->bottom)); @@ -513,9 +499,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop) #ifdef POLYOBJECTS_PLANES new_pl->polyobj = pl->polyobj; #endif -#ifdef ESLOPE new_pl->slope = pl->slope; -#endif pl = new_pl; pl->minx = start; pl->maxx = stop; @@ -860,7 +844,6 @@ static UINT8 *R_GetTextureFlat(levelflat_t *levelflat, boolean leveltexture, boo return flat; } -#ifdef ESLOPE static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge) { // Potentially override other stuff for now cus we're mean. :< But draw a slope plane! @@ -951,7 +934,6 @@ d.z = (v1.x * v2.y) - (v1.y * v2.x) } #undef SFMULT } -#endif // ESLOPE void R_DrawSinglePlane(visplane_t *pl) { @@ -1087,10 +1069,8 @@ void R_DrawSinglePlane(visplane_t *pl) } else light = (pl->lightlevel >> LIGHTSEGSHIFT); -#ifdef ESLOPE - if (!pl->slope) // Don't mess with angle on slopes! We'll handle this ourselves later -#endif - if (viewangle != pl->viewangle+pl->plangle) + if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later + && viewangle != pl->viewangle+pl->plangle) { memset(cachedheight, 0, sizeof (cachedheight)); angle = (pl->viewangle+pl->plangle-ANGLE_90)>>ANGLETOFINESHIFT; @@ -1148,7 +1128,6 @@ void R_DrawSinglePlane(visplane_t *pl) if (light < 0) light = 0; -#ifdef ESLOPE if (pl->slope) { float fudgecanyon = 0; @@ -1248,10 +1227,9 @@ void R_DrawSinglePlane(visplane_t *pl) spanfunctype = SPANDRAWFUNC_TILTED; planezlight = scalelight[light]; - } else -#endif // ESLOPE - - planezlight = zlight[light]; + } + else + planezlight = zlight[light]; // Use the correct span drawer depending on the powers-of-twoness if (!ds_powersoftwo) diff --git a/src/r_plane.h b/src/r_plane.h index 405dd9726..a1a5b7a78 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -50,9 +50,7 @@ typedef struct visplane_s #ifdef POLYOBJECTS_PLANES polyobj_t *polyobj; #endif -#ifdef ESLOPE pslope_t *slope; -#endif } visplane_t; extern visplane_t *visplanes[MAXVISPLANES]; @@ -86,10 +84,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t #ifdef POLYOBJECTS_PLANES , polyobj_t *polyobj #endif -#ifdef ESLOPE - , pslope_t *slope -#endif - ); + , pslope_t *slope); visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop); void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop); void R_PlaneBounds(visplane_t *plane); @@ -110,13 +105,11 @@ typedef struct planemgr_s INT16 f_clip[MAXVIDWIDTH]; INT16 c_clip[MAXVIDWIDTH]; -#ifdef ESLOPE // For slope rendering; the height at the other end fixed_t f_pos_slope; fixed_t b_pos_slope; struct pslope_s *slope; -#endif struct ffloor_s *ffloor; #ifdef POLYOBJECTS_PLANES diff --git a/src/r_segs.c b/src/r_segs.c index 0233b1161..d8f1981ee 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -52,20 +52,16 @@ static fixed_t rw_offset2; // for splats static fixed_t rw_scale, rw_scalestep; static fixed_t rw_midtexturemid, rw_toptexturemid, rw_bottomtexturemid; static INT32 worldtop, worldbottom, worldhigh, worldlow; -#ifdef ESLOPE static INT32 worldtopslope, worldbottomslope, worldhighslope, worldlowslope; // worldtop/bottom at end of slope static fixed_t rw_toptextureslide, rw_midtextureslide, rw_bottomtextureslide; // Defines how to adjust Y offsets along the wall for slopes static fixed_t rw_midtextureback, rw_midtexturebackslide; // Values for masked midtexture height calculation -#endif static fixed_t pixhigh, pixlow, pixhighstep, pixlowstep; static fixed_t topfrac, topstep; static fixed_t bottomfrac, bottomstep; static lighttable_t **walllights; static INT16 *maskedtexturecol; -#ifdef ESLOPE static fixed_t *maskedtextureheight = NULL; -#endif // ========================================================================== // R_Splats Wall Splats Drawer @@ -299,9 +295,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) sector_t *front, *back; INT32 times, repeats; INT64 overflow_test; -#ifdef ESLOPE INT32 range; -#endif // Calculate light table. // Use different light tables @@ -349,9 +343,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) colfunc = colfuncs[COLDRAWFUNC_FUZZY]; } -#ifdef ESLOPE range = max(ds->x2-ds->x1, 1); -#endif rw_scalestep = ds->scalestep; spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep; @@ -389,12 +381,9 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) for (i = 0; i < dc_numlights; i++) { -#ifdef ESLOPE fixed_t leftheight, rightheight; -#endif light = &frontsector->lightlist[i]; rlight = &dc_lightlist[i]; -#ifdef ESLOPE if (light->slope) { leftheight = P_GetZAt(light->slope, ds->leftpos.x, ds->leftpos.y); rightheight = P_GetZAt(light->slope, ds->rightpos.x, ds->rightpos.y); @@ -409,10 +398,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) rlight->heightstep = (rlight->heightstep-rlight->height)/(range); //if (x1 > ds->x1) //rlight->height -= (x1 - ds->x1)*rlight->heightstep; -#else - rlight->height = (centeryfrac) - FixedMul((light->height - viewz), spryscale); - rlight->heightstep = -FixedMul(rw_scalestep, (light->height - viewz)); -#endif rlight->startheight = rlight->height; // keep starting value here to reset for each repeat rlight->lightlevel = *light->lightlevel; rlight->extra_colormap = *light->extra_colormap; @@ -513,40 +498,17 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) } } -#ifndef ESLOPE - if (curline->linedef->flags & ML_DONTPEGBOTTOM) - { - dc_texturemid = front->floorheight > back->floorheight - ? front->floorheight : back->floorheight; - dc_texturemid = dc_texturemid + textureheight[texnum] - viewz; - } - else - { - dc_texturemid = front->ceilingheight < back->ceilingheight - ? front->ceilingheight : back->ceilingheight; - dc_texturemid = dc_texturemid - viewz; - } - dc_texturemid += curline->sidedef->rowoffset; - - if (curline->linedef->flags & ML_DONTPEGBOTTOM) - dc_texturemid += (textureheight[texnum])*times; - else - dc_texturemid -= (textureheight[texnum])*times; -#endif - dc_texheight = textureheight[texnum]>>FRACBITS; // draw the columns for (dc_x = x1; dc_x <= x2; dc_x++) { -#ifdef ESLOPE dc_texturemid = ds->maskedtextureheight[dc_x]; if (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3)) dc_texturemid += (textureheight[texnum])*times + textureheight[texnum]; else dc_texturemid -= (textureheight[texnum])*times; -#endif // calculate lighting if (maskedtexturecol[dc_x] != INT16_MAX) { @@ -755,14 +717,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) fixed_t offsetvalue = 0; lightlist_t *light; r_lightlist_t *rlight; -#ifdef ESLOPE INT32 range; -#endif -#ifndef ESLOPE - fixed_t lheight; -#endif line_t *newline = NULL; -#ifdef ESLOPE // Render FOF sides kinda like normal sides, with the frac and step and everything // NOTE: INT64 instead of fixed_t because overflow concerns INT64 top_frac, top_step, bottom_frac, bottom_step; @@ -772,7 +728,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) INT32 oldx = -1; fixed_t left_top, left_bottom; // needed here for slope skewing pslope_t *skewslope = NULL; -#endif void (*colfunc_2s) (column_t *); @@ -829,9 +784,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (pfloor->flags & FF_FOG) colfunc = colfuncs[COLDRAWFUNC_FOG]; -#ifdef ESLOPE range = max(ds->x2-ds->x1, 1); -#endif //SoM: Moved these up here so they are available for my lightlist calculations rw_scalestep = ds->scalestep; spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep; @@ -848,14 +801,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) for (i = p = 0; i < dc_numlights; i++) { -#ifdef ESLOPE fixed_t leftheight, rightheight; fixed_t pfloorleft, pfloorright; INT64 overflow_test; -#endif light = &frontsector->lightlist[i]; rlight = &dc_lightlist[p]; -#ifdef ESLOPE #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ @@ -896,21 +846,9 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (overflow_test > (INT64)CLAMPMIN) rlight->heightstep = (fixed_t)overflow_test; else rlight->heightstep = CLAMPMIN; rlight->heightstep = (rlight->heightstep-rlight->height)/(range); -#else - if (light->height < *pfloor->bottomheight) - continue; - - if (light->height > *pfloor->topheight && i+1 < dc_numlights && frontsector->lightlist[i+1].height > *pfloor->topheight) - continue; - - lheight = light->height;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : light->height; - rlight->heightstep = -FixedMul (rw_scalestep, (lheight - viewz)); - rlight->height = (centeryfrac) - FixedMul((lheight - viewz), spryscale); -#endif rlight->flags = light->flags; if (light->flags & FF_CUTLEVEL) { -#ifdef ESLOPE SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight) #undef SLOPEPARAMS leftheight -= viewz; @@ -927,11 +865,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (overflow_test > (INT64)CLAMPMIN) rlight->botheightstep = (fixed_t)overflow_test; else rlight->botheightstep = CLAMPMIN; rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range); -#else - lheight = *light->caster->bottomheight;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : *light->caster->bottomheight; - rlight->botheightstep = -FixedMul (rw_scalestep, (lheight - viewz)); - rlight->botheight = (centeryfrac) - FixedMul((lheight - viewz), spryscale); -#endif } rlight->lightlevel = *light->lightlevel; @@ -988,7 +921,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) mceilingclip = ds->sprtopclip; dc_texheight = textureheight[texnum]>>FRACBITS; -#ifdef ESLOPE // calculate both left ends if (*pfloor->t_slope) left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; @@ -1011,21 +943,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (slopeskew) dc_texturemid = left_top; else -#endif - dc_texturemid = *pfloor->topheight - viewz; + dc_texturemid = *pfloor->topheight - viewz; if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) { -#ifdef ESLOPE skewslope = *pfloor->b_slope; // skew using bottom slope if (slopeskew) dc_texturemid = left_bottom; else -#endif - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; } } else @@ -1033,17 +962,14 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) { -#ifdef ESLOPE skewslope = *pfloor->b_slope; // skew using bottom slope if (slopeskew) dc_texturemid = left_bottom; else -#endif - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; } } -#ifdef ESLOPE if (slopeskew) { angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y); @@ -1051,7 +977,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (skewslope) ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT)); } -#endif dc_texturemid += offsetvalue; @@ -1076,7 +1001,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) column2s_length = textures[texnum]->height; } -#ifdef ESLOPE // Set heights according to plane, or slope, whichever { fixed_t right_top, right_bottom; @@ -1104,24 +1028,20 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) top_frac += top_step * (x1 - ds->x1); bottom_frac += bottom_step * (x1 - ds->x1); } -#endif // draw the columns for (dc_x = x1; dc_x <= x2; dc_x++) { if (maskedtexturecol[dc_x] != INT16_MAX) { -#ifdef ESLOPE if (ffloortextureslide) { // skew FOF walls if (oldx != -1) dc_texturemid += FixedMul(ffloortextureslide, (maskedtexturecol[oldx]-maskedtexturecol[dc_x])< (INT64)CLAMPMAX) sprtopscreen = windowtop = CLAMPMAX; else if (top_frac > (INT64)CLAMPMIN) sprtopscreen = windowtop = (fixed_t)top_frac; else sprtopscreen = windowtop = CLAMPMIN; @@ -1131,10 +1051,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) top_frac += top_step; bottom_frac += bottom_step; -#else - sprtopscreen = windowtop = (centeryfrac - FixedMul((dc_texturemid - offsetvalue), spryscale)); - sprbotscreen = windowbottom = FixedMul(*pfloor->topheight - *pfloor->bottomheight, spryscale) + sprtopscreen; -#endif // SoM: If column is out of range, why bother with it?? if (windowbottom < topbounds || windowtop > bottombounds) @@ -1344,9 +1260,7 @@ static void R_RenderSegLoop (void) INT32 mid; fixed_t texturecolumn = 0; -#ifdef ESLOPE fixed_t oldtexturecolumn = -1; -#endif INT32 top; INT32 bottom; INT32 i; @@ -1466,7 +1380,6 @@ static void R_RenderSegLoop (void) angle = (rw_centerangle + xtoviewangle[rw_x])>>ANGLETOFINESHIFT; texturecolumn = rw_offset-FixedMul(FINETANGENT(angle),rw_distance); -#ifdef ESLOPE if (oldtexturecolumn != -1) { rw_bottomtexturemid += FixedMul(rw_bottomtextureslide, oldtexturecolumn-texturecolumn); rw_midtexturemid += FixedMul(rw_midtextureslide, oldtexturecolumn-texturecolumn); @@ -1474,7 +1387,6 @@ static void R_RenderSegLoop (void) rw_midtextureback += FixedMul(rw_midtexturebackslide, oldtexturecolumn-texturecolumn); } oldtexturecolumn = texturecolumn; -#endif texturecolumn >>= FRACBITS; @@ -1650,13 +1562,11 @@ static void R_RenderSegLoop (void) // for backdrawing of masked mid texture maskedtexturecol[rw_x] = (INT16)texturecolumn; -#ifdef ESLOPE if (maskedtextureheight != NULL) { maskedtextureheight[rw_x] = (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3) ? max(rw_midtexturemid, rw_midtextureback) : min(rw_midtexturemid, rw_midtextureback)); } -#endif } if (dc_numlights) @@ -1712,26 +1622,19 @@ void R_StoreWallRange(INT32 start, INT32 stop) fixed_t sineval; angle_t distangle, offsetangle; boolean longboi; -#ifndef ESLOPE - fixed_t vtop; -#endif INT32 lightnum; INT32 i, p; lightlist_t *light; r_lightlist_t *rlight; INT32 range; -#ifdef ESLOPE vertex_t segleft, segright; fixed_t ceilingfrontslide, floorfrontslide, ceilingbackslide, floorbackslide; -#endif static size_t maxdrawsegs = 0; -#ifdef ESLOPE maskedtextureheight = NULL; //initialize segleft and segright memset(&segleft, 0x00, sizeof(segleft)); memset(&segright, 0x00, sizeof(segright)); -#endif colfunc = colfuncs[BASEDRAWFUNC]; @@ -1841,7 +1744,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) // calculate texture boundaries // and decide if floor / ceiling marks are needed -#ifdef ESLOPE // Figure out map coordinates of where start and end are mapping to on seg, so we can clip right for slope bullshit if (frontsector->hasslope || (backsector && backsector->hasslope)) // Commenting this out for FOFslop. -Red { @@ -1908,10 +1810,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) worldtopslope -= viewz; worldbottom -= viewz; worldbottomslope -= viewz; -#else - worldtop = frontsector->ceilingheight - viewz; - worldbottom = frontsector->floorheight - viewz; -#endif midtexture = toptexture = bottomtexture = maskedtexture = 0; ds_p->maskedtexturecol = NULL; @@ -1933,18 +1831,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; #endif -#ifdef ESLOPE if (ffloor[i].slope) { ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz; ffloor[i].f_pos_slope = P_GetZAt(ffloor[i].slope, segright.x, segright.y) - viewz; - } else - ffloor[i].f_pos_slope = -#endif - ffloor[i].f_pos = ffloor[i].height - viewz; + } + else + ffloor[i].f_pos_slope = ffloor[i].f_pos = ffloor[i].height - viewz; } } -#ifdef ESLOPE // Set up texture Y offset slides for sloped walls rw_toptextureslide = rw_midtextureslide = rw_bottomtextureslide = 0; ceilingfrontslide = floorfrontslide = ceilingbackslide = floorbackslide = 0; @@ -1964,7 +1859,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (backsector && backsector->c_slope) ceilingbackslide = FixedMul(backsector->c_slope->zdelta, FINECOSINE((lineangle-backsector->c_slope->xydirection)>>ANGLETOFINESHIFT)); } -#endif if (!backsector) { @@ -1974,33 +1868,22 @@ void R_StoreWallRange(INT32 start, INT32 stop) texheight = textureheight[midtexture]; // a single sided line is terminal, so it must mark ends markfloor = markceiling = true; -#ifdef ESLOPE if (linedef->flags & ML_EFFECT2) { if (linedef->flags & ML_DONTPEGBOTTOM) rw_midtexturemid = frontsector->floorheight + texheight - viewz; else rw_midtexturemid = frontsector->ceilingheight - viewz; } - else -#endif - if (linedef->flags & ML_DONTPEGBOTTOM) + else if (linedef->flags & ML_DONTPEGBOTTOM) { -#ifdef ESLOPE rw_midtexturemid = worldbottom + texheight; rw_midtextureslide = floorfrontslide; -#else - vtop = frontsector->floorheight + texheight; - // bottom of texture at bottom - rw_midtexturemid = vtop - viewz; -#endif } else { // top of texture at top rw_midtexturemid = worldtop; -#ifdef ESLOPE rw_midtextureslide = ceilingfrontslide; -#endif } rw_midtexturemid += sidedef->rowoffset; @@ -2016,17 +1899,12 @@ void R_StoreWallRange(INT32 start, INT32 stop) boolean bothceilingssky = false; // turned on if both back and front ceilings are sky boolean bothfloorssky = false; // likewise, but for floors -#ifdef ESLOPE SLOPEPARAMS(backsector->c_slope, worldhigh, worldhighslope, backsector->ceilingheight) SLOPEPARAMS(backsector->f_slope, worldlow, worldlowslope, backsector->floorheight) worldhigh -= viewz; worldhighslope -= viewz; worldlow -= viewz; worldlowslope -= viewz; -#else - worldhigh = backsector->ceilingheight - viewz; - worldlow = backsector->floorheight - viewz; -#endif // hack to allow height changes in outdoor areas // This is what gets rid of the upper textures if there should be sky @@ -2048,27 +1926,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothfloorssky) { - if ( -#ifdef ESLOPE - worldbottomslope > worldlowslope || -#endif - worldbottom > worldlow) + if (worldbottomslope > worldlowslope || worldbottom > worldlow) { ds_p->silhouette = SIL_BOTTOM; -#ifdef ESLOPE if ((backsector->f_slope ? P_GetZAt(backsector->f_slope, viewx, viewy) : backsector->floorheight) > viewz) ds_p->bsilheight = INT32_MAX; else ds_p->bsilheight = (frontsector->f_slope ? INT32_MAX : frontsector->floorheight); -#else - ds_p->bsilheight = frontsector->floorheight; -#endif } -#ifdef ESLOPE else if ((backsector->f_slope ? P_GetZAt(backsector->f_slope, viewx, viewy) : backsector->floorheight) > viewz) -#else - else if (backsector->floorheight > viewz) -#endif { ds_p->silhouette = SIL_BOTTOM; ds_p->bsilheight = INT32_MAX; @@ -2078,27 +1944,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothceilingssky) { - if ( -#ifdef ESLOPE - worldtopslope < worldhighslope || -#endif - worldtop < worldhigh) + if (worldtopslope < worldhighslope || worldtop < worldhigh) { ds_p->silhouette |= SIL_TOP; -#ifdef ESLOPE if ((backsector->c_slope ? P_GetZAt(backsector->c_slope, viewx, viewy) : backsector->ceilingheight) < viewz) ds_p->tsilheight = INT32_MIN; else ds_p->tsilheight = (frontsector->c_slope ? INT32_MIN : frontsector->ceilingheight); -#else - ds_p->tsilheight = frontsector->ceilingheight; -#endif } -#ifdef ESLOPE else if ((backsector->c_slope ? P_GetZAt(backsector->c_slope, viewx, viewy) : backsector->ceilingheight) < viewz) -#else - else if (backsector->ceilingheight < viewz) -#endif { ds_p->silhouette |= SIL_TOP; ds_p->tsilheight = INT32_MIN; @@ -2108,22 +1962,14 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothceilingssky && !bothfloorssky) { -#ifdef ESLOPE if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) -#else - if (worldhigh <= worldbottom) -#endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } -#ifdef ESLOPE if (worldlow >= worldtop && worldlowslope >= worldtopslope) -#else - if (worldlow >= worldtop) -#endif { ds_p->sprtopclip = screenheightarray; ds_p->tsilheight = INT32_MIN; @@ -2136,21 +1982,13 @@ void R_StoreWallRange(INT32 start, INT32 stop) // Without the following code, sprites get displayed behind closed doors. if (!bothceilingssky && !bothfloorssky) { -#ifdef ESLOPE if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) -#else - if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) -#endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } -#ifdef ESLOPE if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) -#else - if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) -#endif { // killough 1/17/98, 2/8/98 ds_p->sprtopclip = screenheightarray; ds_p->tsilheight = INT32_MIN; @@ -2165,10 +2003,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) markfloor = false; } else if (worldlow != worldbottom -#ifdef ESLOPE || worldlowslope != worldbottomslope || backsector->f_slope != frontsector->f_slope -#endif || backsector->floorpic != frontsector->floorpic || backsector->lightlevel != frontsector->lightlevel //SoM: 3/22/2000: Check floor x and y offsets. @@ -2198,10 +2034,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) markceiling = false; } else if (worldhigh != worldtop -#ifdef ESLOPE || worldhighslope != worldtopslope || backsector->c_slope != frontsector->c_slope -#endif || backsector->ceilingpic != frontsector->ceilingpic || backsector->lightlevel != frontsector->lightlevel //SoM: 3/22/2000: Check floor x and y offsets. @@ -2225,13 +2059,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (!bothceilingssky && !bothfloorssky) { -#ifdef ESLOPE if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) || (worldlow >= worldtop && worldlowslope >= worldtopslope)) -#else - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) -#endif { // closed door markceiling = markfloor = true; @@ -2240,11 +2069,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // check TOP TEXTURE if (!bothceilingssky // never draw the top texture if on - && (worldhigh < worldtop -#ifdef ESLOPE - || worldhighslope < worldtopslope -#endif - )) + && (worldhigh < worldtop || worldhighslope < worldtopslope)) { fixed_t texheight; // top texture @@ -2264,67 +2089,47 @@ void R_StoreWallRange(INT32 start, INT32 stop) toptexture = R_GetTextureNum(sidedef->toptexture); texheight = textureheight[toptexture]; } -#ifdef ESLOPE if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked if (linedef->flags & ML_DONTPEGTOP) rw_toptexturemid = frontsector->ceilingheight - viewz; else rw_toptexturemid = backsector->ceilingheight - viewz; - } else -#endif - if (linedef->flags & ML_DONTPEGTOP) + } + else if (linedef->flags & ML_DONTPEGTOP) { // top of texture at top rw_toptexturemid = worldtop; -#ifdef ESLOPE rw_toptextureslide = ceilingfrontslide; -#endif } else { -#ifdef ESLOPE rw_toptexturemid = worldhigh + texheight; rw_toptextureslide = ceilingbackslide; -#else - vtop = backsector->ceilingheight + texheight; - // bottom of texture - rw_toptexturemid = vtop - viewz; -#endif } } // check BOTTOM TEXTURE if (!bothfloorssky // never draw the bottom texture if on - && (worldlow > worldbottom -#ifdef ESLOPE - || worldlowslope > worldbottomslope -#endif - )) //seulement si VISIBLE!!! + && (worldlow > worldbottom || worldlowslope > worldbottomslope)) // Only if VISIBLE!!! { // bottom texture bottomtexture = R_GetTextureNum(sidedef->bottomtexture); -#ifdef ESLOPE if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked if (linedef->flags & ML_DONTPEGBOTTOM) rw_bottomtexturemid = frontsector->floorheight - viewz; else rw_bottomtexturemid = backsector->floorheight - viewz; - } else -#endif - if (linedef->flags & ML_DONTPEGBOTTOM) + } + else if (linedef->flags & ML_DONTPEGBOTTOM) { // bottom of texture at bottom // top of texture at top rw_bottomtexturemid = worldbottom; -#ifdef ESLOPE rw_bottomtextureslide = floorfrontslide; -#endif } else { // top of texture at top rw_bottomtexturemid = worldlow; -#ifdef ESLOPE rw_bottomtextureslide = floorbackslide; -#endif } } @@ -2337,12 +2142,10 @@ void R_StoreWallRange(INT32 start, INT32 stop) ffloor_t *rover; ffloor_t *r2; fixed_t lowcut, highcut; -#ifdef ESLOPE fixed_t lowcutslope, highcutslope; // Used for height comparisons and etc across FOFs and slopes fixed_t high1, highslope1, low1, lowslope1, high2, highslope2, low2, lowslope2; -#endif //markceiling = markfloor = true; maskedtexture = true; @@ -2352,10 +2155,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) lowcut = max(worldbottom, worldlow) + viewz; highcut = min(worldtop, worldhigh) + viewz; -#ifdef ESLOPE lowcutslope = max(worldbottomslope, worldlowslope) + viewz; highcutslope = min(worldtopslope, worldhighslope) + viewz; -#endif if (frontsector->ffloors && backsector->ffloors) { @@ -2370,16 +2171,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight) SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight) if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope)) continue; -#else - if (*rover->topheight < lowcut || *rover->bottomheight > highcut) - continue; -#endif for (r2 = frontsector->ffloors; r2; r2 = r2->next) { @@ -2403,7 +2199,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; } -#ifdef ESLOPE SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight) SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight) @@ -2411,12 +2206,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2)) continue; -#else - if (*r2->topheight < lowcut || *r2->bottomheight > highcut) - continue; - if (*rover->topheight > *r2->topheight || *rover->bottomheight < *r2->bottomheight) - continue; -#endif break; } @@ -2437,16 +2226,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight) SLOPEPARAMS(*rover->b_slope, low1, lowslope1, *rover->bottomheight) if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope)) continue; -#else - if (*rover->topheight < lowcut || *rover->bottomheight > highcut) - continue; -#endif for (r2 = backsector->ffloors; r2; r2 = r2->next) { @@ -2470,7 +2254,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; } -#ifdef ESLOPE SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight) SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight) #undef SLOPEPARAMS @@ -2478,12 +2261,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2)) continue; -#else - if (*r2->topheight < lowcut || *r2->bottomheight > highcut) - continue; - if (*rover->topheight > *r2->topheight || *rover->bottomheight < *r2->bottomheight) - continue; -#endif break; } @@ -2503,17 +2280,12 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE // Oy vey. - if (( (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldbottom+viewz - && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldbottomslope+viewz) - ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldtop+viewz - && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope+viewz)) + if ( ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover-> topheight) <= worldbottom + viewz + && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover-> topheight) <= worldbottomslope + viewz) + ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldtop + viewz + && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope + viewz)) continue; -#else - if (*rover->topheight <= frontsector->floorheight || *rover->bottomheight >= frontsector->ceilingheight) - continue; -#endif ds_p->thicksides[i] = rover; i++; @@ -2527,25 +2299,18 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; if (rover->norender == leveltime) continue; -#ifdef ESLOPE // Oy vey. - if (( (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldbottom+viewz - && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldbottomslope+viewz) - ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldtop+viewz - && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope+viewz)) + if ( ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover-> topheight) <= worldbottom + viewz + && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover-> topheight) <= worldbottomslope + viewz) + ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldtop + viewz + && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope + viewz)) continue; - if (( (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldlow+viewz - && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldlowslope+viewz) - ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldhigh+viewz - && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldhighslope+viewz)) + if ( ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover-> topheight) <= worldlow + viewz + && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover-> topheight) <= worldlowslope + viewz) + ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldhigh + viewz + && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldhighslope + viewz)) continue; -#else - if (*rover->topheight <= frontsector->floorheight || *rover->bottomheight >= frontsector->ceilingheight) - continue; - if (*rover->topheight <= backsector->floorheight || *rover->bottomheight >= backsector->ceilingheight) - continue; -#endif ds_p->thicksides[i] = rover; i++; @@ -2565,7 +2330,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) else ds_p->maskedtexturecol = ds_p->thicksidecol; -#ifdef ESLOPE maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0]) #ifdef POLYOBJECTS @@ -2598,7 +2362,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) } rw_midtexturemid += sidedef->rowoffset; rw_midtextureback += sidedef->rowoffset; -#endif maskedtexture = true; } @@ -2662,22 +2425,16 @@ void R_StoreWallRange(INT32 start, INT32 stop) // and doesn't need to be marked. if (frontsector->heightsec == -1) { - if (frontsector->floorpic != skyflatnum - && ( -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : -#endif + if (frontsector->floorpic != skyflatnum && (frontsector->f_slope ? + P_GetZAt(frontsector->f_slope, viewx, viewy) : frontsector->floorheight) >= viewz) { // above view plane markfloor = false; } - if (frontsector->ceilingpic != skyflatnum - && ( -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : -#endif + if (frontsector->ceilingpic != skyflatnum && (frontsector->c_slope ? + P_GetZAt(frontsector->c_slope, viewx, viewy) : frontsector->ceilingheight) <= viewz) { // below view plane @@ -2688,10 +2445,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) // calculate incremental stepping values for texture edges worldtop >>= 4; worldbottom >>= 4; -#ifdef ESLOPE worldtopslope >>= 4; worldbottomslope >>= 4; -#endif if (linedef->special == HORIZONSPECIAL) { // HORIZON LINES topstep = bottomstep = 0; @@ -2704,7 +2459,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) bottomstep = -FixedMul (rw_scalestep,worldbottom); bottomfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale); -#ifdef ESLOPE if (frontsector->c_slope) { fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldtopslope, ds_p->scale2); topstep = (topfracend-topfrac)/(range); @@ -2713,7 +2467,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldbottomslope, ds_p->scale2); bottomstep = (bottomfracend-bottomfrac)/(range); } -#endif } dc_numlights = 0; @@ -2729,14 +2482,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) for (i = p = 0; i < dc_numlights; i++) { -#ifdef ESLOPE fixed_t leftheight, rightheight; -#endif light = &frontsector->lightlist[i]; rlight = &dc_lightlist[p]; -#ifdef ESLOPE if (light->slope) { leftheight = P_GetZAt(light->slope, segleft.x, segleft.y); rightheight = P_GetZAt(light->slope, segright.x, segright.y); @@ -2751,38 +2501,23 @@ void R_StoreWallRange(INT32 start, INT32 stop) leftheight >>= 4; rightheight >>= 4; -#endif if (i != 0) { -#ifdef ESLOPE if (leftheight < worldbottom && rightheight < worldbottomslope) continue; if (leftheight > worldtop && rightheight > worldtopslope && i+1 < dc_numlights && frontsector->lightlist[i+1].height > frontsector->ceilingheight) continue; -#else - if (light->height < frontsector->floorheight) - continue; - - if (light->height > frontsector->ceilingheight && i+1 < dc_numlights && frontsector->lightlist[i+1].height > frontsector->ceilingheight) - continue; -#endif } -#ifdef ESLOPE rlight->height = (centeryfrac>>4) - FixedMul(leftheight, rw_scale); rlight->heightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2); rlight->heightstep = (rlight->heightstep-rlight->height)/(range); -#else - rlight->height = (centeryfrac>>4) - FixedMul((light->height - viewz) >> 4, rw_scale); - rlight->heightstep = -FixedMul (rw_scalestep, (light->height - viewz) >> 4); -#endif rlight->flags = light->flags; if (light->caster && light->caster->flags & FF_CUTSOLIDS) { -#ifdef ESLOPE if (*light->caster->b_slope) { leftheight = P_GetZAt(*light->caster->b_slope, segleft.x, segleft.y); rightheight = P_GetZAt(*light->caster->b_slope, segright.x, segright.y); @@ -2802,10 +2537,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) rlight->botheightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2); rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range); -#else - rlight->botheight = (centeryfrac >> 4) - FixedMul((*light->caster->bottomheight - viewz) >> 4, rw_scale); - rlight->botheightstep = -FixedMul (rw_scalestep, (*light->caster->bottomheight - viewz) >> 4); -#endif } rlight->lightlevel = *light->lightlevel; @@ -2821,9 +2552,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) for (i = 0; i < numffloors; i++) { ffloor[i].f_pos >>= 4; -#ifdef ESLOPE ffloor[i].f_pos_slope >>= 4; -#endif if (linedef->special == HORIZONSPECIAL) // Horizon lines extend FOFs in contact with them too. { ffloor[i].f_step = 0; @@ -2832,13 +2561,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) } else { -#ifdef ESLOPE ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale); ffloor[i].f_step = ((centeryfrac>>4) - FixedMul(ffloor[i].f_pos_slope, ds_p->scale2) - ffloor[i].f_frac)/(range); -#else - ffloor[i].f_step = FixedMul(-rw_scalestep, ffloor[i].f_pos); - ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale); -#endif } } } @@ -2847,42 +2571,34 @@ void R_StoreWallRange(INT32 start, INT32 stop) { worldhigh >>= 4; worldlow >>= 4; -#ifdef ESLOPE worldhighslope >>= 4; worldlowslope >>= 4; -#endif if (toptexture) { pixhigh = (centeryfrac>>4) - FixedMul (worldhigh, rw_scale); pixhighstep = -FixedMul (rw_scalestep,worldhigh); -#ifdef ESLOPE if (backsector->c_slope) { fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldhighslope, ds_p->scale2); pixhighstep = (topfracend-pixhigh)/(range); } -#endif } if (bottomtexture) { pixlow = (centeryfrac>>4) - FixedMul (worldlow, rw_scale); pixlowstep = -FixedMul (rw_scalestep,worldlow); -#ifdef ESLOPE if (backsector->f_slope) { fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldlowslope, ds_p->scale2); pixlowstep = (bottomfracend-pixlow)/(range); } -#endif } { ffloor_t * rover; -#ifdef ESLOPE fixed_t roverleft, roverright; fixed_t planevistest; -#endif i = 0; if (backsector->ffloors) @@ -2894,7 +2610,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; -#ifdef ESLOPE // Let the renderer know this sector is sloped. if (*rover->b_slope || *rover->t_slope) backsector->hasslope = true; @@ -2941,34 +2656,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) ffloor[i].b_step = (ffloor[i].b_step-ffloor[i].b_frac)/(range); i++; } -#else - if (*rover->bottomheight <= backsector->ceilingheight && - *rover->bottomheight >= backsector->floorheight && - ((viewz < *rover->bottomheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz > *rover->bottomheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->bottomheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } - - if (i >= MAXFFLOORS) - break; - - if (*rover->topheight >= backsector->floorheight && - *rover->topheight <= backsector->ceilingheight && - ((viewz > *rover->topheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz < *rover->topheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->topheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } -#endif } } else if (frontsector && frontsector->ffloors) @@ -2980,8 +2667,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (rover->norender == leveltime) continue; - -#ifdef ESLOPE // Let the renderer know this sector is sloped. if (*rover->b_slope || *rover->t_slope) frontsector->hasslope = true; @@ -3028,32 +2713,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) ffloor[i].b_step = (ffloor[i].b_step-ffloor[i].b_frac)/(range); i++; } -#else - if (*rover->bottomheight <= frontsector->ceilingheight && - *rover->bottomheight >= frontsector->floorheight && - ((viewz < *rover->bottomheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz > *rover->bottomheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->bottomheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } - if (i >= MAXFFLOORS) - break; - if (*rover->topheight >= frontsector->floorheight && - *rover->topheight <= frontsector->ceilingheight && - ((viewz > *rover->topheight && !(rover->flags & FF_INVERTPLANES)) || - (viewz < *rover->topheight && (rover->flags & FF_BOTHPLANES)))) - { - ffloor[i].b_pos = *rover->topheight; - ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; - ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); - ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale); - i++; - } -#endif } } #ifdef POLYOBJECTS_PLANES @@ -3070,9 +2729,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (ffloor[i].plane->maxx < ds_p->x2) ffloor[i].plane->maxx = ds_p->x2; -#ifdef ESLOPE ffloor[i].slope = NULL; -#endif ffloor[i].b_pos = backsector->floorheight; ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); @@ -3089,9 +2746,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (ffloor[i].plane->maxx < ds_p->x2) ffloor[i].plane->maxx = ds_p->x2; -#ifdef ESLOPE ffloor[i].slope = NULL; -#endif ffloor[i].b_pos = backsector->ceilingheight; ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4; ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos); diff --git a/src/r_things.c b/src/r_things.c index 2fc44faf8..fc0469f4c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1030,10 +1030,8 @@ static void R_SplitSprite(vissprite_t *sprite) if (!(sector->lightlist[i].caster->flags & FF_CUTSPRITES)) continue; -#ifdef ESLOPE if (sector->lightlist[i].slope) testheight = P_GetZAt(sector->lightlist[i].slope, sprite->gx, sprite->gy); -#endif if (testheight >= sprite->gzt) continue; @@ -1321,9 +1319,9 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, if (thing->subsector->sector->numlights) { INT32 lightnum; -#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights! light = thing->subsector->sector->numlights - 1; + // R_GetPlaneLight won't work on sloped lights! for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) { fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y) : thing->subsector->sector->lightlist[lightnum].height; @@ -1332,9 +1330,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, break; } } -#else - light = R_GetPlaneLight(thing->subsector->sector, shadow->gzt, false); -#endif + //light = R_GetPlaneLight(thing->subsector->sector, shadow->gzt, false); } if (thing->subsector->sector->numlights) @@ -1730,9 +1726,9 @@ static void R_ProjectSprite(mobj_t *thing) if (thing->subsector->sector->numlights) { INT32 lightnum; -#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights! light = thing->subsector->sector->numlights - 1; + // R_GetPlaneLight won't work on sloped lights! for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) { fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y) : thing->subsector->sector->lightlist[lightnum].height; @@ -1741,9 +1737,7 @@ static void R_ProjectSprite(mobj_t *thing) break; } } -#else - light = R_GetPlaneLight(thing->subsector->sector, gzt, false); -#endif + //light = R_GetPlaneLight(thing->subsector->sector, gzt, false); lightnum = (*thing->subsector->sector->lightlist[light].lightlevel >> LIGHTSEGSHIFT); if (lightnum < 0) @@ -2393,13 +2387,12 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps if (rover->szt > r2->plane->low || rover->sz < r2->plane->high) continue; -#ifdef ESLOPE // Effective height may be different for each comparison in the case of slopes if (r2->plane->slope) { planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy); planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy); - } else -#endif + } + else planeobjectz = planecameraz = r2->plane->height; if (rover->mobjflags & MF_NOCLIPHEIGHT) @@ -2458,20 +2451,18 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps if (scale <= rover->sortscale) continue; -#ifdef ESLOPE if (*r2->ffloor->t_slope) { topplaneobjectz = P_GetZAt(*r2->ffloor->t_slope, rover->gx, rover->gy); topplanecameraz = P_GetZAt(*r2->ffloor->t_slope, viewx, viewy); - } else -#endif + } + else topplaneobjectz = topplanecameraz = *r2->ffloor->topheight; -#ifdef ESLOPE if (*r2->ffloor->b_slope) { botplaneobjectz = P_GetZAt(*r2->ffloor->b_slope, rover->gx, rover->gy); botplanecameraz = P_GetZAt(*r2->ffloor->b_slope, viewx, viewy); - } else -#endif + } + else botplaneobjectz = botplanecameraz = *r2->ffloor->bottomheight; if ((topplanecameraz > viewz && botplanecameraz < viewz) || diff --git a/src/screen.c b/src/screen.c index 7ebe34635..6bdf91ed8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -127,14 +127,12 @@ void SCR_SetDrawFuncs(void) #ifndef NOWATER spanfuncs[SPANDRAWFUNC_WATER] = R_DrawTranslucentWaterSpan_8; #endif -#ifdef ESLOPE spanfuncs[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_8; spanfuncs[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_8; #ifndef NOWATER spanfuncs[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_8; #endif spanfuncs[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_8; -#endif // Lactozilla: Non-powers-of-two spanfuncs_npo2[BASEDRAWFUNC] = R_DrawSpan_NPO2_8; @@ -145,14 +143,12 @@ void SCR_SetDrawFuncs(void) #ifndef NOWATER spanfuncs_npo2[SPANDRAWFUNC_WATER] = R_DrawTranslucentWaterSpan_NPO2_8; #endif -#ifdef ESLOPE spanfuncs_npo2[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_NPO2_8; spanfuncs_npo2[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_NPO2_8; #ifndef NOWATER spanfuncs_npo2[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_NPO2_8; #endif spanfuncs_npo2[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_NPO2_8; -#endif #ifdef RUSEASM if (R_ASM) diff --git a/src/screen.h b/src/screen.h index 717ce9adc..ddbd499bb 100644 --- a/src/screen.h +++ b/src/screen.h @@ -140,13 +140,11 @@ enum #ifndef NOWATER SPANDRAWFUNC_WATER, #endif -#ifdef ESLOPE SPANDRAWFUNC_TILTED, SPANDRAWFUNC_TILTEDTRANS, SPANDRAWFUNC_TILTEDSPLAT, #ifndef NOWATER SPANDRAWFUNC_TILTEDWATER, -#endif #endif SPANDRAWFUNC_MAX