Remove POLYOBJECTS POLYOBJECTS_PLANES #ifdefs(backport from srb2 2.2)

This commit is contained in:
FlykeSpice 2020-08-20 13:00:54 -04:00
parent 00137ef4ea
commit c09cb6d762
18 changed files with 0 additions and 145 deletions

View file

@ -79,9 +79,7 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
{
INT32 offset;
const INT32 *list; // Big blockmap
#ifdef POLYOBJECTS
polymaplink_t *plink; // haleyjd 02/22/06
#endif
line_t *ld;
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
@ -89,7 +87,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
offset = y*bmapwidth + x;
#ifdef POLYOBJECTS
// haleyjd 02/22/06: consider polyobject lines
plink = polyblocklinks[offset];
@ -132,7 +129,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
}
plink = (polymaplink_t *)(plink->link.next);
}
#endif
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];

View file

@ -2139,7 +2139,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
BMBOUNDFIX(xl, xh, yl, yh);
#ifdef POLYOBJECTS
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
{
validcount++;
@ -2209,7 +2208,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
}
}
}
#endif
// tmfloorthing is set when tmfloorz comes from a thing's top
tmfloorthing = NULL;
@ -2367,7 +2365,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
BMBOUNDFIX(xl, xh, yl, yh);
#ifdef POLYOBJECTS
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
{
validcount++;
@ -2438,7 +2435,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
}
}
}
#endif
// check lines
for (bx = xl; bx <= xh; bx++)

View file

@ -491,14 +491,12 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
}
// Treat polyobjects kind of like 3D Floors
#ifdef POLYOBJECTS
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
front = linedef->frontsector;
back = linedef->frontsector;
}
else
#endif
{
front = linedef->frontsector;
back = linedef->backsector;
@ -607,9 +605,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
// Check for fake floors in the sector.
if (front->ffloors || back->ffloors
#ifdef POLYOBJECTS
|| linedef->polyobj
#endif
)
{
ffloor_t *rover;
@ -702,7 +698,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
}
}
#ifdef POLYOBJECTS
// Treat polyobj's backsector like a 3D Floor
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
@ -724,7 +719,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
else if (polysec->ceilingheight > lowestfloor && delta1 < delta2)
lowestfloor = polysec->ceilingheight;
}
#endif
if (highestceiling < highceiling)
highceiling = highestceiling;
@ -987,9 +981,7 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
{
INT32 offset;
const INT32 *list; // Big blockmap
#ifdef POLYOBJECTS
polymaplink_t *plink; // haleyjd 02/22/06
#endif
line_t *ld;
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
@ -997,7 +989,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
offset = y*bmapwidth + x;
#ifdef POLYOBJECTS
// haleyjd 02/22/06: consider polyobject lines
plink = polyblocklinks[offset];
@ -1021,7 +1012,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
}
plink = (polymaplink_t *)(plink->link.next);
}
#endif
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];

View file

@ -2652,7 +2652,6 @@ static void P_PlayerZMovement(mobj_t *mo)
if (mo->eflags & MFE_JUSTHITFLOOR)
{
#ifdef POLYOBJECTS
// Check if we're on a polyobject
// that triggers a linedef executor.
msecnode_t *node;
@ -2712,7 +2711,6 @@ static void P_PlayerZMovement(mobj_t *mo)
}
if (!stopmovecut)
#endif
// Cut momentum in half when you hit the ground and
// aren't pressing any controls.

View file

@ -28,7 +28,6 @@
#include "r_state.h"
#include "r_defs.h"
#ifdef POLYOBJECTS
/*
Theory behind Polyobjects:
@ -2864,6 +2863,5 @@ INT32 EV_DoPolyObjFlag(line_t *pfdata)
return 1;
}
#endif // ifdef POLYOBJECTS
// EOF

View file

@ -19,7 +19,6 @@
#include "r_defs.h"
// haleyjd: temporary define
#ifdef POLYOBJECTS
//
// Defines
//
@ -303,7 +302,6 @@ extern polyobj_t *PolyObjects;
extern INT32 numPolyObjects;
extern polymaplink_t **polyblocklinks; // polyobject blockmap
#endif // ifdef POLYOBJECTS
#endif

View file

@ -981,7 +981,6 @@ typedef enum
tc_noenemies,
tc_eachtime,
tc_disappear,
#ifdef POLYOBJECTS
tc_polyrotate, // haleyjd 03/26/06: polyobjects
tc_polymove,
tc_polywaypoint,
@ -989,7 +988,6 @@ typedef enum
tc_polyswingdoor,
tc_polyflag,
tc_polydisplace,
#endif
tc_end
} specials_e;
@ -1544,7 +1542,6 @@ static void SaveDisappearThinker(const thinker_t *th, const UINT8 type)
WRITEINT32(save_p, ht->exists);
}
#ifdef POLYOBJECTS
//
// SavePolyrotateThinker
@ -1654,7 +1651,6 @@ static void SavePolydisplaceThinker(const thinker_t *th, const UINT8 type)
WRITEFIXED(save_p, ht->oldHeights);
}
#endif
/*
//
// SaveWhatThinker
@ -1834,7 +1830,6 @@ static void P_NetArchiveThinkers(void)
SaveDisappearThinker(th, tc_disappear);
continue;
}
#ifdef POLYOBJECTS
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
{
SavePolyrotatetThinker(th, tc_polyrotate);
@ -1870,7 +1865,6 @@ static void P_NetArchiveThinkers(void)
SavePolydisplaceThinker(th, tc_polydisplace);
continue;
}
#endif
#ifdef PARANOIA
else if (th->function.acv != P_RemoveThinkerDelayed) // wait garbage collection
I_Error("unknown thinker type %p", th->function.acp1);
@ -2507,7 +2501,6 @@ static inline void LoadDisappearThinker(actionf_p1 thinker)
P_AddThinker(&ht->thinker);
}
#ifdef POLYOBJECTS
//
// LoadPolyrotateThinker
@ -2627,7 +2620,6 @@ static inline void LoadPolydisplaceThinker(actionf_p1 thinker)
ht->oldHeights = READFIXED(save_p);
P_AddThinker(&ht->thinker);
}
#endif
/*
//
@ -2796,7 +2788,6 @@ static void P_NetUnArchiveThinkers(void)
case tc_disappear:
LoadDisappearThinker((actionf_p1)T_Disappear);
break;
#ifdef POLYOBJECTS
case tc_polyrotate:
LoadPolyrotatetThinker((actionf_p1)T_PolyObjRotate);
break;
@ -2824,7 +2815,6 @@ static void P_NetUnArchiveThinkers(void)
case tc_polydisplace:
LoadPolydisplaceThinker((actionf_p1)T_PolyObjDisplace);
break;
#endif
case tc_scroll:
LoadScrollThinker((actionf_p1)T_Scroll);
break;
@ -2865,7 +2855,6 @@ static void P_NetUnArchiveThinkers(void)
//
// haleyjd 03/26/06: PolyObject saving code
//
#ifdef POLYOBJECTS
#define PD_FLAGS 0x01
#define PD_TRANS 0x02
@ -2954,7 +2943,6 @@ static inline void P_UnArchivePolyObjects(void)
for (i = 0; i < numSavedPolys; ++i)
P_UnArchivePolyObj(&PolyObjects[i]);
}
#endif
//
// P_FinishMobjs
//
@ -3435,9 +3423,7 @@ void P_SaveNetGame(void)
if (gamestate == GS_LEVEL)
{
P_NetArchiveWorld();
#ifdef POLYOBJECTS
P_ArchivePolyObjects();
#endif
P_NetArchiveThinkers();
P_NetArchiveSpecials();
}
@ -3479,9 +3465,7 @@ boolean P_LoadNetGame(void)
if (gamestate == GS_LEVEL)
{
P_NetUnArchiveWorld();
#ifdef POLYOBJECTS
P_UnArchivePolyObjects();
#endif
P_NetUnArchiveThinkers();
P_NetUnArchiveSpecials();
P_RelinkPointers();

View file

@ -1273,9 +1273,7 @@ static void P_LoadRawLineDefs(UINT8 *data, size_t i)
if (ld->sidenum[1] != 0xffff && ld->special)
sides[ld->sidenum[1]].special = ld->special;
#ifdef POLYOBJECTS
ld->polyobj = NULL;
#endif
}
}
@ -1945,11 +1943,9 @@ static void P_CreateBlockMap(void)
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
blockmap = blockmaplump + 4;
#ifdef POLYOBJECTS
// haleyjd 2/22/06: setup polyobject blockmap
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
#endif
}
}
@ -2022,11 +2018,9 @@ static boolean P_LoadBlockMap(lumpnum_t lumpnum)
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
blockmap = blockmaplump+4;
#ifdef POLYOBJECTS
// haleyjd 2/22/06: setup polyobject blockmap
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
#endif
return true;
/* Original
blockmaplump = W_CacheLumpNum(lump, PU_LEVEL);
@ -2088,11 +2082,9 @@ static boolean P_LoadRawBlockMap(UINT8 *data, size_t count, const char *lumpname
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
blockmap = blockmaplump+4;
#ifdef POLYOBJECTS
// haleyjd 2/22/06: setup polyobject blockmap
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
#endif
return true;
#endif
}

View file

@ -99,7 +99,6 @@ static fixed_t P_InterceptVector2(divline_t *v2, divline_t *v1)
return frac;
}
#ifdef POLYOBJECTS
static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
{
size_t i;
@ -145,7 +144,6 @@ static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
return true;
}
#endif
//
// P_CrossSubsector
@ -156,9 +154,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
{
seg_t *seg;
INT32 count;
#ifdef POLYOBJECTS
polyobj_t *po; // haleyjd 02/23/06
#endif
#ifdef RANGECHECK
if (num >= numsubsectors)
@ -168,7 +164,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
// haleyjd 02/23/06: this assignment should be after the above check
seg = segs + subsectors[num].firstline;
#ifdef POLYOBJECTS
// haleyjd 02/23/06: check polyobject lines
if ((po = subsectors[num].polyList))
{
@ -183,7 +178,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
po = (polyobj_t *)(po->link.next);
}
}
#endif
for (count = subsectors[num].numlines; --count >= 0; seg++) // check lines
{
@ -334,15 +328,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
// killough 11/98: shortcut for melee situations
// same subsector? obviously visible
#ifndef POLYOBJECTS
if (t1->subsector == t2->subsector)
return true;
#else
// haleyjd 02/23/06: can't do this if there are polyobjects in the subsec
if (!t1->subsector->polyList &&
t1->subsector == t2->subsector)
return true;
#endif
// An unobstructed LOS is possible.
// Now look from eyes of t1 to any part of t2.

View file

@ -1242,7 +1242,6 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
}
// haleyjd: temporary define
#ifdef POLYOBJECTS
//
// PolyDoor
@ -1451,7 +1450,6 @@ static boolean PolyDisplace(line_t *line)
return EV_DoPolyObjDisplace(&pdd);
}
#endif // ifdef POLYOBJECTS
/** Changes a sector's tag.
* Used by the linedef executor tag changer and by crumblers.
@ -3200,7 +3198,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
break;
}
#ifdef POLYOBJECTS
case 480: // Polyobj_DoorSlide
case 481: // Polyobj_DoorSwing
PolyDoor(line);
@ -3227,7 +3224,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
case 491:
PolyTranslucency(line);
break;
#endif
default:
break;
@ -6698,7 +6694,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
Z_Free(secthinkers);
#ifdef POLYOBJECTS
// haleyjd 02/20/06: spawn polyobjects
Polyobj_InitLevel();
@ -6715,7 +6710,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
break;
}
}
#endif
P_RunLevelLoadExecutors();
}

View file

@ -3138,7 +3138,6 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
BMBOUNDFIX(xl, xh, yl, yh);
// Polyobjects
#ifdef POLYOBJECTS
validcount++;
for (by = yl; by <= yh; by++)
@ -3232,7 +3231,6 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
plink = (polymaplink_t *)(plink->link.next);
}
}
#endif
if (teeter) // only bother with objects as a last resort if you were already teetering
{
mobj_t *oldtmthing = tmthing;
@ -3809,9 +3807,7 @@ static void P_2dMovement(player_t *player)
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
player->cmomx = player->cmomy = 0;
else if (player->onconveyor != 2 && player->onconveyor != 4
#ifdef POLYOBJECTS
&& player->onconveyor != 1
#endif
)
player->cmomx = player->cmomy = 0;
@ -4006,9 +4002,7 @@ static void P_3dMovement(player_t *player)
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
player->cmomx = player->cmomy = 0;
else if (player->onconveyor != 2 && player->onconveyor != 4
#ifdef POLYOBJECTS
&& player->onconveyor != 1
#endif
)
player->cmomx = player->cmomy = 0;
@ -7767,7 +7761,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
}
}
#ifdef POLYOBJECTS
// Check polyobjects and see if floorz/ceilingz need to be altered
{
INT32 xl, xh, yl, yh, bx, by;
@ -7846,7 +7839,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
}
}
}
#endif
// crushed camera
if (myceilingz <= myfloorz + thiscam->height && !resetcalled && !cameranoclip)
@ -8425,9 +8417,7 @@ void P_PlayerThink(player_t *player)
P_MobjCheckWater(player->mo);
#ifndef SECTORSPECIALSAFTERTHINK
#ifdef POLYOBJECTS
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
#endif
player->onconveyor = 0;
// check special sectors : damage & secrets
@ -8585,10 +8575,8 @@ void P_PlayerThink(player_t *player)
// it lasts for one tic.
player->pflags &= ~PF_FULLSTASIS;
#ifdef POLYOBJECTS
if (player->onconveyor == 1)
player->cmomy = player->cmomx = 0;
#endif
//P_DoSuperStuff(player);
//P_CheckSneakerAndLivesTimer(player);
@ -8836,9 +8824,7 @@ void P_PlayerAfterThink(player_t *player)
cmd = &player->cmd;
#ifdef SECTORSPECIALSAFTERTHINK
#ifdef POLYOBJECTS
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
#endif
player->onconveyor = 0;
// check special sectors : damage & secrets

View file

@ -371,9 +371,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back)
{
return (
#ifdef POLYOBJECTS
!line->polyseg &&
#endif
back->ceilingpic == front->ceilingpic
&& back->floorpic == front->floorpic
&& back->f_slope == front->f_slope
@ -650,7 +648,6 @@ static boolean R_CheckBBox(const fixed_t *bspcoord)
return true;
}
#ifdef POLYOBJECTS
size_t numpolys; // number of polyobjects in current subsector
size_t num_po_ptrs; // number of polyobject pointers allocated
@ -815,7 +812,6 @@ static void R_AddPolyObjects(subsector_t *sub)
R_AddLine(po_ptrs[i]->segs[j]);
}
}
#endif
//
// R_Subsector
@ -894,9 +890,7 @@ static void R_Subsector(size_t num)
{
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL
#ifdef POLYOBJECTS_PLANES
, NULL
#endif
, frontsector->f_slope
, R_NoEncore(frontsector, false));
}
@ -912,9 +906,7 @@ static void R_Subsector(size_t num)
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
ceilingcolormap, NULL
#ifdef POLYOBJECTS_PLANES
, NULL
#endif
, frontsector->c_slope
, R_NoEncore(frontsector, true));
}
@ -965,9 +957,7 @@ static void R_Subsector(size_t num)
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
*rover->bottomyoffs, *rover->bottomangle, frontsector->lightlist[light].extra_colormap, rover
#ifdef POLYOBJECTS_PLANES
, NULL
#endif
, *rover->b_slope
, R_NoEncore(rover->master->frontsector, true));
@ -1003,9 +993,7 @@ static void R_Subsector(size_t num)
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
frontsector->lightlist[light].extra_colormap, rover
#ifdef POLYOBJECTS_PLANES
, NULL
#endif
, *rover->t_slope
, R_NoEncore(rover->master->frontsector, false));
@ -1022,7 +1010,6 @@ static void R_Subsector(size_t num)
}
}
#ifdef POLYOBJECTS_PLANES
// Polyobjects have planes, too!
if (sub->polyList)
{
@ -1091,7 +1078,6 @@ static void R_Subsector(size_t num)
po = (polyobj_t *)(po->link.next);
}
}
#endif
#ifdef FLOORSPLATS
if (sub->splats)
@ -1114,18 +1100,14 @@ static void R_Subsector(size_t num)
firstseg = NULL;
#ifdef POLYOBJECTS
// haleyjd 02/19/06: draw polyobjects before static lines
if (sub->polyList)
R_AddPolyObjects(sub);
#endif
while (count--)
{
// CONS_Debug(DBG_GAMELOGIC, "Adding normal line %d...(%d)\n", line->linedef-lines, leveltime);
#ifdef POLYOBJECTS
if (!line->polyseg) // ignore segs that belong to polyobjects
#endif
R_AddLine(line);
line++;
curline = NULL; /* cph 2001/11/18 - must clear curline now we're done with it, so stuff doesn't try using it for other things */

View file

@ -44,13 +44,11 @@ void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2);
// no longer a static since this is used for encore in hw_main.c as well now:
boolean R_NoEncore(sector_t *sector, boolean ceiling);
#ifdef POLYOBJECTS
void R_SortPolyObjects(subsector_t *sub);
extern size_t numpolys; // number of polyobjects in current subsector
extern size_t num_po_ptrs; // number of polyobject pointers allocated
extern polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
#endif
sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
INT32 *ceilinglightlevel, boolean back);

View file

@ -91,9 +91,7 @@ typedef struct
fixed_t z; ///< Z coordinate.
} degenmobj_t;
#ifdef POLYOBJECTS
#include "p_polyobj.h"
#endif
// Store fake planes in a resizable array insted of just by
// heightsec. Allows for multiple fake planes.
@ -429,9 +427,7 @@ typedef struct line_s
void *splats; // wallsplat_t list
#endif
INT32 firsttag, nexttag; // improves searches for tags.
#ifdef POLYOBJECTS
polyobj_t *polyobj; // Belongs to a polyobject?
#endif
char *text; // a concatination of all front and back texture names, for linedef specials that require a string.
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
@ -473,9 +469,7 @@ typedef struct subsector_s
sector_t *sector;
INT16 numlines;
UINT16 firstline;
#ifdef POLYOBJECTS
struct polyobj_s *polyList; // haleyjd 02/19/06: list of polyobjects
#endif
#if 1//#ifdef FLOORSPLATS
void *splats; // floorsplat_t list
#endif
@ -551,10 +545,8 @@ typedef struct seg_s
// Why slow things down by calculating lightlists for every thick side?
size_t numlights;
r_lightlist_t *rlights;
#ifdef POLYOBJECTS
polyobj_t *polyseg;
boolean dontrenderme;
#endif
} seg_t;
//

View file

@ -422,9 +422,7 @@ static visplane_t *new_visplane(unsigned hash)
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
ffloor_t *pfloor
#ifdef POLYOBJECTS_PLANES
, polyobj_t *polyobj
#endif
, pslope_t *slope
, boolean noencore)
{
@ -446,7 +444,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
}
}
#ifdef POLYOBJECTS_PLANES
if (polyobj)
{
if (polyobj->angle != 0)
@ -461,7 +458,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
yoff += polyobj->centerPt.y;
}
}
#endif
// This appears to fix the Nimbus Ruins sky bug.
if (picnum == skyflatnum && pfloor)
@ -475,12 +471,10 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
for (check = visplanes[hash]; check; check = check->next)
{
#ifdef POLYOBJECTS_PLANES
if (check->polyobj && pfloor)
continue;
if (polyobj != check->polyobj)
continue;
#endif
if (height == check->height && picnum == check->picnum
&& lightlevel == check->lightlevel
&& xoff == check->xoffs && yoff == check->yoffs
@ -512,9 +506,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
check->viewz = viewz;
check->viewangle = viewangle;
check->plangle = plangle;
#ifdef POLYOBJECTS_PLANES
check->polyobj = polyobj;
#endif
check->slope = slope;
check->noencore = noencore;
@ -583,9 +575,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
new_pl->viewz = pl->viewz;
new_pl->viewangle = pl->viewangle;
new_pl->plangle = pl->plangle;
#ifdef POLYOBJECTS_PLANES
new_pl->polyobj = pl->polyobj;
#endif
new_pl->slope = pl->slope;
new_pl->noencore = pl->noencore;
pl = new_pl;
@ -611,11 +601,9 @@ void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop)
INT32 unionl, unionh;
// INT32 x;
#ifdef POLYOBJECTS_PLANES
// Don't expand polyobject planes here - we do that on our own.
if (pl->polyobj)
return;
#endif
if (start < pl->minx)
{
@ -730,9 +718,7 @@ void R_DrawPlanes(void)
}
if (pl->ffloor != NULL
#ifdef POLYOBJECTS_PLANES
|| pl->polyobj != NULL
#endif
)
continue;
@ -761,7 +747,6 @@ void R_DrawSinglePlane(visplane_t *pl)
#endif
spanfunc = basespanfunc;
#ifdef POLYOBJECTS_PLANES
if (pl->polyobj && pl->polyobj->translucency != 0) {
spanfunc = R_DrawTranslucentSpan_8;
@ -783,7 +768,6 @@ void R_DrawSinglePlane(visplane_t *pl)
light = LIGHTLEVELS-1;
} else
#endif
if (pl->ffloor)
{
// Don't draw planes that shouldn't be drawn.

View file

@ -45,9 +45,7 @@ typedef struct visplane_s
fixed_t xoffs, yoffs; // Scrolling flats.
struct ffloor_s *ffloor;
#ifdef POLYOBJECTS_PLANES
polyobj_t *polyobj;
#endif
pslope_t *slope;
boolean noencore;
@ -81,9 +79,7 @@ void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
void R_DrawPlanes(void);
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
extracolormap_t *planecolormap, ffloor_t *ffloor
#ifdef POLYOBJECTS_PLANES
, polyobj_t *polyobj
#endif
, pslope_t *slope
, boolean noencore);
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
@ -111,9 +107,7 @@ typedef struct planemgr_s
struct pslope_s *slope;
struct ffloor_s *ffloor;
#ifdef POLYOBJECTS_PLANES
polyobj_t *polyobj;
#endif
} visffloor_t;
extern visffloor_t ffloor[MAXFFLOORS];

View file

@ -1297,7 +1297,6 @@ static void R_RenderSegLoop (void)
for (i = 0; i < numffloors; i++)
{
#ifdef POLYOBJECTS_PLANES
if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
continue;
@ -1308,7 +1307,6 @@ static void R_RenderSegLoop (void)
else if (ffloor[i].plane->maxx < rw_x)
ffloor[i].plane->maxx = rw_x;
}
#endif
if (ffloor[i].height < viewz)
{
@ -1321,12 +1319,10 @@ static void R_RenderSegLoop (void)
if (bottom_w > bottom)
bottom_w = bottom;
#ifdef POLYOBJECTS_PLANES
// Polyobject-specific hack to fix plane leaking -Red
if (curline->polyseg && ffloor[i].polyobj && ffloor[i].polyobj == curline->polyseg && top_w >= bottom_w) {
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF;
} else
#endif
if (top_w <= bottom_w)
{
@ -1345,12 +1341,10 @@ static void R_RenderSegLoop (void)
if (bottom_w > bottom)
bottom_w = bottom;
#ifdef POLYOBJECTS_PLANES
// Polyobject-specific hack to fix plane leaking -Red
if (curline->polyseg && ffloor[i].polyobj && ffloor[i].polyobj == curline->polyseg && top_w >= bottom_w) {
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF;
} else
#endif
if (top_w <= bottom_w)
{
@ -1810,10 +1804,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (i = 0; i < numffloors; i++)
{
#ifdef POLYOBJECTS_PLANES
if (ffloor[i].polyobj && (!ds_p->curline->polyseg || ffloor[i].polyobj != ds_p->curline->polyseg))
continue;
#endif
if (ffloor[i].slope) {
ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz;
@ -2334,7 +2326,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0])
#ifdef POLYOBJECTS
if (curline->polyseg) { // use REAL front and back floors please, so midtexture rendering isn't mucked up
rw_midtextureslide = rw_midtexturebackslide = 0;
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
@ -2363,7 +2354,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
}
rw_midtexturemid += sidedef->rowoffset;
rw_midtextureback += sidedef->rowoffset;
#endif
maskedtexture = true;
}
@ -2710,7 +2700,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
}
}
}
#ifdef POLYOBJECTS_PLANES
if (curline->polyseg && frontsector && (curline->polyseg->flags & POF_RENDERPLANES))
{
while (i < numffloors && ffloor[i].polyobj != curline->polyseg) i++;
@ -2749,7 +2738,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
i++;
}
}
#endif
numbackffloors = i;
}

View file

@ -1941,7 +1941,6 @@ static void R_CreateDrawNodes(void)
entry->ffloor = ds->thicksides[i];
}
}
#ifdef POLYOBJECTS_PLANES
// Check for a polyobject plane, but only if this is a front line
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
plane = ds->curline->polyseg->visplane;
@ -1957,7 +1956,6 @@ static void R_CreateDrawNodes(void)
}
ds->curline->polyseg->visplane = NULL;
}
#endif
if (ds->maskedtexturecol)
{
entry = R_CreateDrawNode(&nodehead);
@ -2002,7 +2000,6 @@ static void R_CreateDrawNodes(void)
}
}
#ifdef POLYOBJECTS_PLANES
// find all the remaining polyobject planes and add them on the end of the list
// probably this is a terrible idea if we wanted them to be sorted properly
// but it works getting them in for now
@ -2023,7 +2020,6 @@ static void R_CreateDrawNodes(void)
// note: no seg is set, for what should be obvious reasons
PolyObjects[i].visplane = NULL;
}
#endif
if (visspritecount == 0)
return;