mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-26 14:21:03 +00:00
Merge branch 'movement-refactor' into udmf-fofs-mkii
This commit is contained in:
commit
4dd25721f6
21 changed files with 429 additions and 592 deletions
|
@ -578,9 +578,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
/// Dumps the contents of a network save game upon consistency failure for debugging.
|
/// Dumps the contents of a network save game upon consistency failure for debugging.
|
||||||
//#define DUMPCONSISTENCY
|
//#define DUMPCONSISTENCY
|
||||||
|
|
||||||
/// Polyobject fake flat code
|
|
||||||
#define POLYOBJECTS_PLANES
|
|
||||||
|
|
||||||
/// See name of player in your crosshair
|
/// See name of player in your crosshair
|
||||||
#define SEENAMES
|
#define SEENAMES
|
||||||
|
|
||||||
|
|
|
@ -887,12 +887,10 @@ static void AdjustSegs(void)
|
||||||
float distv1,distv2,tmp;
|
float distv1,distv2,tmp;
|
||||||
nearv1 = nearv2 = MYMAX;
|
nearv1 = nearv2 = MYMAX;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// Don't touch polyobject segs. We'll compensate
|
// Don't touch polyobject segs. We'll compensate
|
||||||
// for this when we go about drawing them.
|
// for this when we go about drawing them.
|
||||||
if (lseg->polyseg)
|
if (lseg->polyseg)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
for (j = 0; j < p->numpts; j++)
|
for (j = 0; j < p->numpts; j++)
|
||||||
|
|
|
@ -1603,7 +1603,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
// heights of the polygon, and h & l, are the final (clipped)
|
// heights of the polygon, and h & l, are the final (clipped)
|
||||||
// poly coords.
|
// poly coords.
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
||||||
// you must use the linedef's backsector to be correct
|
// you must use the linedef's backsector to be correct
|
||||||
// From CB
|
// From CB
|
||||||
|
@ -1613,7 +1612,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
popenbottom = back->floorheight;
|
popenbottom = back->floorheight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
popentop = min(worldtop, worldhigh);
|
popentop = min(worldtop, worldhigh);
|
||||||
popenbottom = max(worldbottom, worldlow);
|
popenbottom = max(worldbottom, worldlow);
|
||||||
|
@ -1643,7 +1641,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
polybottom = polytop - textureheight[gr_midtexture]*repeats;
|
polybottom = polytop - textureheight[gr_midtexture]*repeats;
|
||||||
}
|
}
|
||||||
// CB
|
// CB
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
||||||
// you must use the linedef's backsector to be correct
|
// you must use the linedef's backsector to be correct
|
||||||
if (gr_curline->polyseg)
|
if (gr_curline->polyseg)
|
||||||
|
@ -1651,7 +1648,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
lowcut = polybottom;
|
lowcut = polybottom;
|
||||||
highcut = polytop;
|
highcut = polytop;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The cut-off values of a linedef can always be constant, since every line has an absoulute front and or back sector
|
// The cut-off values of a linedef can always be constant, since every line has an absoulute front and or back sector
|
||||||
|
@ -1757,7 +1753,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (gr_curline->polyseg && gr_curline->polyseg->translucency > 0)
|
if (gr_curline->polyseg && gr_curline->polyseg->translucency > 0)
|
||||||
{
|
{
|
||||||
if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
|
if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
|
||||||
|
@ -1768,7 +1763,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
else
|
else
|
||||||
blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, &Surf);
|
blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, &Surf);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (gr_frontsector->numlights)
|
if (gr_frontsector->numlights)
|
||||||
{
|
{
|
||||||
|
@ -2564,10 +2558,8 @@ static void HWR_AddLine(seg_t * line)
|
||||||
static sector_t tempsec;
|
static sector_t tempsec;
|
||||||
|
|
||||||
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
|
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
gr_curline = line;
|
gr_curline = line;
|
||||||
|
|
||||||
|
@ -2694,10 +2686,7 @@ static void HWR_AddLine(seg_t * line)
|
||||||
|
|
||||||
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
||||||
{
|
{
|
||||||
if (
|
if (!line->polyseg &&
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
!line->polyseg &&
|
|
||||||
#endif
|
|
||||||
!line->sidedef->midtexture
|
!line->sidedef->midtexture
|
||||||
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
||||||
|| (gr_frontsector->tag == gr_backsector->tag)))
|
|| (gr_frontsector->tag == gr_backsector->tag)))
|
||||||
|
@ -2736,10 +2725,7 @@ static void HWR_AddLine(seg_t * line)
|
||||||
|
|
||||||
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
||||||
{
|
{
|
||||||
if (
|
if (!line->polyseg &&
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
!line->polyseg &&
|
|
||||||
#endif
|
|
||||||
!line->sidedef->midtexture
|
!line->sidedef->midtexture
|
||||||
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
||||||
|| (gr_frontsector->tag == gr_backsector->tag)))
|
|| (gr_frontsector->tag == gr_backsector->tag)))
|
||||||
|
@ -2934,8 +2920,6 @@ static boolean HWR_CheckBBox(fixed_t *bspcoord)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// HWR_AddPolyObjectSegs
|
// HWR_AddPolyObjectSegs
|
||||||
//
|
//
|
||||||
|
@ -2978,7 +2962,6 @@ static inline void HWR_AddPolyObjectSegs(void)
|
||||||
Z_Free(gr_fakeline);
|
Z_Free(gr_fakeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
||||||
FBITFIELD blendmode, UINT8 lightlevel, levelflat_t *levelflat, sector_t *FOFsector,
|
FBITFIELD blendmode, UINT8 lightlevel, levelflat_t *levelflat, sector_t *FOFsector,
|
||||||
UINT8 alpha, extracolormap_t *planecolormap)
|
UINT8 alpha, extracolormap_t *planecolormap)
|
||||||
|
@ -3233,8 +3216,6 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
// HWR_Subsector : Determine floor/ceiling planes.
|
// HWR_Subsector : Determine floor/ceiling planes.
|
||||||
|
@ -3562,7 +3543,6 @@ static void HWR_Subsector(size_t num)
|
||||||
#endif
|
#endif
|
||||||
#endif //doplanes
|
#endif //doplanes
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// Draw all the polyobjects in this subsector
|
// Draw all the polyobjects in this subsector
|
||||||
if (sub->polyList)
|
if (sub->polyList)
|
||||||
{
|
{
|
||||||
|
@ -3583,15 +3563,12 @@ static void HWR_Subsector(size_t num)
|
||||||
// Draw polyobject lines.
|
// Draw polyobject lines.
|
||||||
HWR_AddPolyObjectSegs();
|
HWR_AddPolyObjectSegs();
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (sub->validcount != validcount) // This validcount situation seems to let us know that the floors have already been drawn.
|
if (sub->validcount != validcount) // This validcount situation seems to let us know that the floors have already been drawn.
|
||||||
{
|
{
|
||||||
// Draw polyobject planes
|
// Draw polyobject planes
|
||||||
HWR_AddPolyObjectPlanes();
|
HWR_AddPolyObjectPlanes();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Hurder ici se passe les choses INT32<33>essantes!
|
// Hurder ici se passe les choses INT32<33>essantes!
|
||||||
// on vient de tracer le sol et le plafond
|
// on vient de tracer le sol et le plafond
|
||||||
|
@ -3614,14 +3591,8 @@ static void HWR_Subsector(size_t num)
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!line->glseg
|
if (!line->glseg && !line->polyseg) // ignore segs that belong to polyobjects
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
&& !line->polyseg // ignore segs that belong to polyobjects
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
|
||||||
HWR_AddLine(line);
|
HWR_AddLine(line);
|
||||||
}
|
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,9 +80,7 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
||||||
{
|
{
|
||||||
INT32 offset;
|
INT32 offset;
|
||||||
const INT32 *list; // Big blockmap
|
const INT32 *list; // Big blockmap
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
polymaplink_t *plink; // haleyjd 02/22/06
|
polymaplink_t *plink; // haleyjd 02/22/06
|
||||||
#endif
|
|
||||||
line_t *ld;
|
line_t *ld;
|
||||||
|
|
||||||
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
||||||
|
@ -90,7 +88,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
||||||
|
|
||||||
offset = y*bmapwidth + x;
|
offset = y*bmapwidth + x;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 02/22/06: consider polyobject lines
|
// haleyjd 02/22/06: consider polyobject lines
|
||||||
plink = polyblocklinks[offset];
|
plink = polyblocklinks[offset];
|
||||||
|
|
||||||
|
@ -133,7 +130,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
||||||
}
|
}
|
||||||
plink = (polymaplink_t *)(plink->link.next);
|
plink = (polymaplink_t *)(plink->link.next);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
||||||
|
|
||||||
|
|
|
@ -2157,7 +2157,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||||
|
|
||||||
BMBOUNDFIX(xl, xh, yl, yh);
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||||
{
|
{
|
||||||
validcount++;
|
validcount++;
|
||||||
|
@ -2229,7 +2228,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 is set when tmfloorz comes from a thing's top
|
||||||
tmfloorthing = NULL;
|
tmfloorthing = NULL;
|
||||||
|
@ -2387,7 +2385,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||||
|
|
||||||
BMBOUNDFIX(xl, xh, yl, yh);
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||||
{
|
{
|
||||||
validcount++;
|
validcount++;
|
||||||
|
@ -2458,7 +2455,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// check lines
|
// check lines
|
||||||
for (bx = xl; bx <= xh; bx++)
|
for (bx = xl; bx <= xh; bx++)
|
||||||
|
|
|
@ -451,7 +451,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
I_Assert(back != NULL);
|
I_Assert(back != NULL);
|
||||||
|
|
||||||
openfloorrover = openceilingrover = NULL;
|
openfloorrover = openceilingrover = NULL;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (linedef->polyobj)
|
if (linedef->polyobj)
|
||||||
{
|
{
|
||||||
// set these defaults so that polyobjects don't interfere with collision above or below them
|
// set these defaults so that polyobjects don't interfere with collision above or below them
|
||||||
|
@ -462,7 +461,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
opentopslope = openbottomslope = NULL;
|
opentopslope = openbottomslope = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{ // Set open and high/low values here
|
{ // Set open and high/low values here
|
||||||
fixed_t frontheight, backheight;
|
fixed_t frontheight, backheight;
|
||||||
|
|
||||||
|
@ -517,7 +515,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
texheight = textures[texnum]->height << FRACBITS;
|
texheight = textures[texnum]->height << FRACBITS;
|
||||||
|
|
||||||
// Set texbottom and textop to the Z coordinates of the texture's boundaries
|
// Set texbottom and textop to the Z coordinates of the texture's boundaries
|
||||||
#if 0 // #ifdef POLYOBJECTS
|
#if 0
|
||||||
// don't remove this code unless solid midtextures
|
// don't remove this code unless solid midtextures
|
||||||
// on non-solid polyobjects should NEVER happen in the future
|
// on non-solid polyobjects should NEVER happen in the future
|
||||||
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
|
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
|
||||||
|
@ -560,7 +558,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (linedef->polyobj)
|
if (linedef->polyobj)
|
||||||
{
|
{
|
||||||
// Treat polyobj's backsector like a 3D Floor
|
// Treat polyobj's backsector like a 3D Floor
|
||||||
|
@ -597,7 +594,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
// otherwise don't do anything special, pretend there's nothing else there
|
// otherwise don't do anything special, pretend there's nothing else there
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
{
|
||||||
// Check for fake floors in the sector.
|
// Check for fake floors in the sector.
|
||||||
if (front->ffloors || back->ffloors)
|
if (front->ffloors || back->ffloors)
|
||||||
{
|
{
|
||||||
|
@ -689,6 +686,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
openrange = opentop - openbottom;
|
openrange = opentop - openbottom;
|
||||||
}
|
}
|
||||||
|
@ -934,9 +932,7 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
||||||
{
|
{
|
||||||
INT32 offset;
|
INT32 offset;
|
||||||
const INT32 *list; // Big blockmap
|
const INT32 *list; // Big blockmap
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
polymaplink_t *plink; // haleyjd 02/22/06
|
polymaplink_t *plink; // haleyjd 02/22/06
|
||||||
#endif
|
|
||||||
line_t *ld;
|
line_t *ld;
|
||||||
|
|
||||||
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
||||||
|
@ -944,7 +940,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
||||||
|
|
||||||
offset = y*bmapwidth + x;
|
offset = y*bmapwidth + x;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 02/22/06: consider polyobject lines
|
// haleyjd 02/22/06: consider polyobject lines
|
||||||
plink = polyblocklinks[offset];
|
plink = polyblocklinks[offset];
|
||||||
|
|
||||||
|
@ -968,7 +963,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
||||||
}
|
}
|
||||||
plink = (polymaplink_t *)(plink->link.next);
|
plink = (polymaplink_t *)(plink->link.next);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
||||||
|
|
||||||
|
|
366
src/p_mobj.c
366
src/p_mobj.c
|
@ -2798,6 +2798,94 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for "Mario" blocks to hit and bounce them
|
||||||
|
static void P_CheckMarioBlocks(mobj_t *mo)
|
||||||
|
{
|
||||||
|
msecnode_t *node;
|
||||||
|
|
||||||
|
if (netgame && mo->player->spectator)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||||
|
{
|
||||||
|
ffloor_t *rover;
|
||||||
|
|
||||||
|
if (!node->m_sector->ffloors)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (!(rover->flags & FF_EXISTS))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(rover->flags & FF_MARIO))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
continue; // if you were flipped, your head isn't actually hitting your ceilingz is it?
|
||||||
|
|
||||||
|
if (*rover->bottomheight != mo->ceilingz)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (rover->flags & FF_SHATTERBOTTOM) // Brick block!
|
||||||
|
EV_CrumbleChain(node->m_sector, rover);
|
||||||
|
else // Question block!
|
||||||
|
EV_MarioBlock(rover, node->m_sector, mo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if we're on a polyobject that triggers a linedef executor.
|
||||||
|
static boolean P_PlayerPolyObjectZMovement(mobj_t *mo)
|
||||||
|
{
|
||||||
|
msecnode_t *node;
|
||||||
|
boolean stopmovecut = false;
|
||||||
|
|
||||||
|
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||||
|
{
|
||||||
|
sector_t *sec = node->m_sector;
|
||||||
|
subsector_t *newsubsec;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < numsubsectors; i++)
|
||||||
|
{
|
||||||
|
polyobj_t *po;
|
||||||
|
sector_t *polysec;
|
||||||
|
newsubsec = &subsectors[i];
|
||||||
|
|
||||||
|
if (newsubsec->sector != sec)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (po = newsubsec->polyList; po; po = (polyobj_t *)(po->link.next))
|
||||||
|
{
|
||||||
|
if (!(po->flags & POF_SOLID))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!P_MobjInsidePolyobj(po, mo))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
polysec = po->lines[0]->backsector;
|
||||||
|
|
||||||
|
// Moving polyobjects should act like conveyors if the player lands on one. (I.E. none of the momentum cut thing below) -Red
|
||||||
|
if ((mo->z == polysec->ceilingheight || mo->z + mo->height == polysec->floorheight) && po->thinker)
|
||||||
|
stopmovecut = true;
|
||||||
|
|
||||||
|
if (!(po->flags & POF_LDEXEC))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (mo->z != polysec->ceilingheight)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// We're landing on a PO, so check for a linedef executor.
|
||||||
|
// Trigger tags are 32000 + the PO's ID number.
|
||||||
|
P_LinedefExecute((INT16)(32000 + po->id), mo, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return stopmovecut;
|
||||||
|
}
|
||||||
|
|
||||||
static void P_PlayerZMovement(mobj_t *mo)
|
static void P_PlayerZMovement(mobj_t *mo)
|
||||||
{
|
{
|
||||||
boolean onground;
|
boolean onground;
|
||||||
|
@ -2894,69 +2982,8 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||||
|
|
||||||
mo->eflags |= MFE_JUSTHITFLOOR; // Spin Attack
|
mo->eflags |= MFE_JUSTHITFLOOR; // Spin Attack
|
||||||
|
|
||||||
|
if (!P_PlayerPolyObjectZMovement(mo))
|
||||||
{
|
{
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// Check if we're on a polyobject
|
|
||||||
// that triggers a linedef executor.
|
|
||||||
msecnode_t *node;
|
|
||||||
boolean stopmovecut = false;
|
|
||||||
|
|
||||||
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
|
||||||
{
|
|
||||||
sector_t *sec = node->m_sector;
|
|
||||||
subsector_t *newsubsec;
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for (i = 0; i < numsubsectors; i++)
|
|
||||||
{
|
|
||||||
newsubsec = &subsectors[i];
|
|
||||||
|
|
||||||
if (newsubsec->sector != sec)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (newsubsec->polyList)
|
|
||||||
{
|
|
||||||
polyobj_t *po = newsubsec->polyList;
|
|
||||||
sector_t *polysec;
|
|
||||||
|
|
||||||
while(po)
|
|
||||||
{
|
|
||||||
if (!P_MobjInsidePolyobj(po, mo) || !(po->flags & POF_SOLID))
|
|
||||||
{
|
|
||||||
po = (polyobj_t *)(po->link.next);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We're inside it! Yess...
|
|
||||||
polysec = po->lines[0]->backsector;
|
|
||||||
|
|
||||||
// Moving polyobjects should act like conveyors if the player lands on one. (I.E. none of the momentum cut thing below) -Red
|
|
||||||
if ((mo->z == polysec->ceilingheight || mo->z+mo->height == polysec->floorheight) && po->thinker)
|
|
||||||
stopmovecut = true;
|
|
||||||
|
|
||||||
if (!(po->flags & POF_LDEXEC))
|
|
||||||
{
|
|
||||||
po = (polyobj_t *)(po->link.next);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mo->z == polysec->ceilingheight)
|
|
||||||
{
|
|
||||||
// We're landing on a PO, so check for
|
|
||||||
// a linedef executor.
|
|
||||||
// Trigger tags are 32000 + the PO's ID number.
|
|
||||||
P_LinedefExecute((INT16)(32000 + po->id), mo, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
po = (polyobj_t *)(po->link.next);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!stopmovecut)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Cut momentum in half when you hit the ground and
|
// Cut momentum in half when you hit the ground and
|
||||||
// aren't pressing any controls.
|
// aren't pressing any controls.
|
||||||
if (!(mo->player->cmd.forwardmove || mo->player->cmd.sidemove) && !mo->player->cmomx && !mo->player->cmomy && !(mo->player->pflags & PF_SPINNING))
|
if (!(mo->player->cmd.forwardmove || mo->player->cmd.sidemove) && !mo->player->cmomx && !mo->player->cmomy && !(mo->player->pflags & PF_SPINNING))
|
||||||
|
@ -3022,39 +3049,10 @@ nightsdone:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for "Mario" blocks to hit and bounce them
|
|
||||||
if (P_MobjFlip(mo)*mo->momz > 0)
|
if (P_MobjFlip(mo)*mo->momz > 0)
|
||||||
{
|
{
|
||||||
msecnode_t *node;
|
if (CheckForMarioBlocks)
|
||||||
|
P_CheckMarioBlocks(mo);
|
||||||
if (CheckForMarioBlocks && !(netgame && mo->player->spectator)) // Only let the player punch
|
|
||||||
{
|
|
||||||
// Search the touching sectors, from side-to-side...
|
|
||||||
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
|
||||||
{
|
|
||||||
ffloor_t *rover;
|
|
||||||
if (!node->m_sector->ffloors)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
|
||||||
{
|
|
||||||
if (!(rover->flags & FF_EXISTS))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Come on, it's time to go...
|
|
||||||
if (rover->flags & FF_MARIO
|
|
||||||
&& !(mo->eflags & MFE_VERTICALFLIP) // if you were flipped, your head isn't actually hitting your ceilingz is it?
|
|
||||||
&& *rover->bottomheight == mo->ceilingz) // The player's head hit the bottom!
|
|
||||||
{
|
|
||||||
// DO THE MARIO!
|
|
||||||
if (rover->flags & FF_SHATTERBOTTOM) // Brick block!
|
|
||||||
EV_CrumbleChain(node->m_sector, rover);
|
|
||||||
else // Question block!
|
|
||||||
EV_MarioBlock(rover, node->m_sector, mo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // Ugly ugly billions of braces! Argh!
|
|
||||||
}
|
|
||||||
|
|
||||||
// hit the ceiling
|
// hit the ceiling
|
||||||
if (mariomode)
|
if (mariomode)
|
||||||
|
@ -3780,13 +3778,114 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
static void P_CheckCrumblingPlatforms(mobj_t *mobj)
|
||||||
// P_PlayerMobjThinker
|
|
||||||
//
|
|
||||||
static void P_PlayerMobjThinker(mobj_t *mobj)
|
|
||||||
{
|
{
|
||||||
msecnode_t *node;
|
msecnode_t *node;
|
||||||
|
|
||||||
|
if (netgame && mobj->player->spectator)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (node = mobj->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||||
|
{
|
||||||
|
ffloor_t *rover;
|
||||||
|
|
||||||
|
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (!(rover->flags & FF_EXISTS))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(rover->flags & FF_CRUMBLE))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||||
|
{
|
||||||
|
if (P_GetSpecialBottomZ(mobj, sectors + rover->secnum, node->m_sector) != mobj->z + mobj->height)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (P_GetSpecialTopZ(mobj, sectors + rover->secnum, node->m_sector) != mobj->z)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), mobj->player, rover->alpha, !(rover->flags & FF_NORETURN));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean P_MobjTouchesSectorWithWater(mobj_t *mobj)
|
||||||
|
{
|
||||||
|
msecnode_t *node;
|
||||||
|
|
||||||
|
for (node = mobj->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||||
|
{
|
||||||
|
ffloor_t *rover;
|
||||||
|
|
||||||
|
if (!node->m_sector->ffloors)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (!(rover->flags & FF_EXISTS))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(rover->flags & FF_SWIMMABLE))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for floating water platforms and bounce them
|
||||||
|
static void P_CheckFloatbobPlatforms(mobj_t *mobj)
|
||||||
|
{
|
||||||
|
msecnode_t *node;
|
||||||
|
|
||||||
|
// Can't land on anything if you're not moving downwards
|
||||||
|
if (P_MobjFlip(mobj)*mobj->momz >= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!P_MobjTouchesSectorWithWater(mobj))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (node = mobj->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||||
|
{
|
||||||
|
ffloor_t *rover;
|
||||||
|
|
||||||
|
if (!node->m_sector->ffloors)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (!(rover->flags & FF_EXISTS))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(rover->flags & FF_FLOATBOB))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||||
|
{
|
||||||
|
if (abs(*rover->bottomheight - (mobj->z + mobj->height)) > abs(mobj->momz))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (abs(*rover->topheight - mobj->z) > abs(mobj->momz))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initiate a 'bouncy' elevator function which slowly diminishes.
|
||||||
|
EV_BounceSector(rover->master->frontsector, -mobj->momz, rover->master);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void P_PlayerMobjThinker(mobj_t *mobj)
|
||||||
|
{
|
||||||
I_Assert(mobj != NULL);
|
I_Assert(mobj != NULL);
|
||||||
I_Assert(mobj->player != NULL);
|
I_Assert(mobj->player != NULL);
|
||||||
I_Assert(!P_MobjWasRemoved(mobj));
|
I_Assert(!P_MobjWasRemoved(mobj));
|
||||||
|
@ -3839,77 +3938,10 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
||||||
else
|
else
|
||||||
P_TryMove(mobj, mobj->x, mobj->y, true);
|
P_TryMove(mobj, mobj->x, mobj->y, true);
|
||||||
|
|
||||||
if (!(netgame && mobj->player->spectator))
|
P_CheckCrumblingPlatforms(mobj);
|
||||||
{
|
|
||||||
// Crumbling platforms
|
|
||||||
for (node = mobj->touching_sectorlist; node; node = node->m_sectorlist_next)
|
|
||||||
{
|
|
||||||
fixed_t topheight, bottomheight;
|
|
||||||
ffloor_t *rover;
|
|
||||||
|
|
||||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
if (CheckForFloatBob)
|
||||||
{
|
P_CheckFloatbobPlatforms(mobj);
|
||||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_CRUMBLE))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
topheight = P_GetSpecialTopZ(mobj, sectors + rover->secnum, node->m_sector);
|
|
||||||
bottomheight = P_GetSpecialBottomZ(mobj, sectors + rover->secnum, node->m_sector);
|
|
||||||
|
|
||||||
if ((topheight == mobj->z && !(mobj->eflags & MFE_VERTICALFLIP))
|
|
||||||
|| (bottomheight == mobj->z + mobj->height && mobj->eflags & MFE_VERTICALFLIP)) // You nut.
|
|
||||||
EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), mobj->player, rover->alpha, !(rover->flags & FF_NORETURN));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for floating water platforms and bounce them
|
|
||||||
if (CheckForFloatBob && P_MobjFlip(mobj)*mobj->momz < 0)
|
|
||||||
{
|
|
||||||
boolean thereiswater = false;
|
|
||||||
|
|
||||||
for (node = mobj->touching_sectorlist; node; node = node->m_sectorlist_next)
|
|
||||||
{
|
|
||||||
if (node->m_sector->ffloors)
|
|
||||||
{
|
|
||||||
ffloor_t *rover;
|
|
||||||
// Get water boundaries first
|
|
||||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
|
||||||
{
|
|
||||||
if (!(rover->flags & FF_EXISTS))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (rover->flags & FF_SWIMMABLE) // Is there water?
|
|
||||||
{
|
|
||||||
thereiswater = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (thereiswater)
|
|
||||||
{
|
|
||||||
for (node = mobj->touching_sectorlist; node; node = node->m_sectorlist_next)
|
|
||||||
{
|
|
||||||
if (node->m_sector->ffloors)
|
|
||||||
{
|
|
||||||
ffloor_t *rover;
|
|
||||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
|
||||||
{
|
|
||||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_FLOATBOB))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((!(mobj->eflags & MFE_VERTICALFLIP) && abs(*rover->topheight-mobj->z) <= abs(mobj->momz)) // The player is landing on the cheese!
|
|
||||||
|| (mobj->eflags & MFE_VERTICALFLIP && abs(*rover->bottomheight-(mobj->z+mobj->height)) <= abs(mobj->momz)))
|
|
||||||
{
|
|
||||||
// Initiate a 'bouncy' elevator function
|
|
||||||
// which slowly diminishes.
|
|
||||||
EV_BounceSector(rover->master->frontsector, -mobj->momz, rover->master);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // Ugly ugly billions of braces! Argh!
|
|
||||||
}
|
|
||||||
|
|
||||||
// always do the gravity bit now, that's simpler
|
// always do the gravity bit now, that's simpler
|
||||||
// BUT CheckPosition only if wasn't done before.
|
// BUT CheckPosition only if wasn't done before.
|
||||||
|
|
|
@ -28,12 +28,6 @@
|
||||||
#include "r_state.h"
|
#include "r_state.h"
|
||||||
#include "r_defs.h"
|
#include "r_defs.h"
|
||||||
|
|
||||||
|
|
||||||
#define POLYOBJECTS
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Theory behind Polyobjects:
|
Theory behind Polyobjects:
|
||||||
|
|
||||||
|
@ -3152,6 +3146,4 @@ INT32 EV_DoPolyObjFade(polyfadedata_t *pfdata)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
#include "p_mobj.h"
|
#include "p_mobj.h"
|
||||||
#include "r_defs.h"
|
#include "r_defs.h"
|
||||||
|
|
||||||
// haleyjd: temporary define
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
//
|
//
|
||||||
// Defines
|
// Defines
|
||||||
//
|
//
|
||||||
|
@ -353,8 +351,6 @@ extern polyobj_t *PolyObjects;
|
||||||
extern INT32 numPolyObjects;
|
extern INT32 numPolyObjects;
|
||||||
extern polymaplink_t **polyblocklinks; // polyobject blockmap
|
extern polymaplink_t **polyblocklinks; // polyobject blockmap
|
||||||
|
|
||||||
#endif // ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -1386,7 +1386,6 @@ typedef enum
|
||||||
tc_planedisplace,
|
tc_planedisplace,
|
||||||
tc_dynslopeline,
|
tc_dynslopeline,
|
||||||
tc_dynslopevert,
|
tc_dynslopevert,
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
tc_polyrotate, // haleyjd 03/26/06: polyobjects
|
tc_polyrotate, // haleyjd 03/26/06: polyobjects
|
||||||
tc_polymove,
|
tc_polymove,
|
||||||
tc_polywaypoint,
|
tc_polywaypoint,
|
||||||
|
@ -1396,7 +1395,6 @@ typedef enum
|
||||||
tc_polydisplace,
|
tc_polydisplace,
|
||||||
tc_polyrotdisplace,
|
tc_polyrotdisplace,
|
||||||
tc_polyfade,
|
tc_polyfade,
|
||||||
#endif
|
|
||||||
tc_end
|
tc_end
|
||||||
} specials_e;
|
} specials_e;
|
||||||
|
|
||||||
|
@ -2080,7 +2078,6 @@ static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type
|
||||||
WRITEMEM(save_p, ht->vex, sizeof(ht->vex));
|
WRITEMEM(save_p, ht->vex, sizeof(ht->vex));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
static inline void SavePolyrotatetThinker(const thinker_t *th, const UINT8 type)
|
static inline void SavePolyrotatetThinker(const thinker_t *th, const UINT8 type)
|
||||||
{
|
{
|
||||||
const polyrotate_t *ht = (const void *)th;
|
const polyrotate_t *ht = (const void *)th;
|
||||||
|
@ -2189,7 +2186,6 @@ static void SavePolyfadeThinker(const thinker_t *th, const UINT8 type)
|
||||||
WRITEINT32(save_p, ht->duration);
|
WRITEINT32(save_p, ht->duration);
|
||||||
WRITEINT32(save_p, ht->timer);
|
WRITEINT32(save_p, ht->timer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void P_NetArchiveThinkers(void)
|
static void P_NetArchiveThinkers(void)
|
||||||
{
|
{
|
||||||
|
@ -2361,7 +2357,6 @@ static void P_NetArchiveThinkers(void)
|
||||||
SavePlaneDisplaceThinker(th, tc_planedisplace);
|
SavePlaneDisplaceThinker(th, tc_planedisplace);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
|
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
|
||||||
{
|
{
|
||||||
SavePolyrotatetThinker(th, tc_polyrotate);
|
SavePolyrotatetThinker(th, tc_polyrotate);
|
||||||
|
@ -2407,7 +2402,6 @@ static void P_NetArchiveThinkers(void)
|
||||||
SavePolyfadeThinker(th, tc_polyfade);
|
SavePolyfadeThinker(th, tc_polyfade);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeLine)
|
else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeLine)
|
||||||
{
|
{
|
||||||
SaveDynamicSlopeThinker(th, tc_dynslopeline);
|
SaveDynamicSlopeThinker(th, tc_dynslopeline);
|
||||||
|
@ -3225,7 +3219,6 @@ static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker)
|
||||||
return &ht->thinker;
|
return &ht->thinker;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
static inline thinker_t* LoadPolyrotatetThinker(actionf_p1 thinker)
|
static inline thinker_t* LoadPolyrotatetThinker(actionf_p1 thinker)
|
||||||
{
|
{
|
||||||
polyrotate_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
polyrotate_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||||
|
@ -3342,7 +3335,6 @@ static thinker_t* LoadPolyfadeThinker(actionf_p1 thinker)
|
||||||
ht->timer = READINT32(save_p);
|
ht->timer = READINT32(save_p);
|
||||||
return &ht->thinker;
|
return &ht->thinker;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void P_NetUnArchiveThinkers(void)
|
static void P_NetUnArchiveThinkers(void)
|
||||||
{
|
{
|
||||||
|
@ -3503,7 +3495,6 @@ static void P_NetUnArchiveThinkers(void)
|
||||||
case tc_planedisplace:
|
case tc_planedisplace:
|
||||||
th = LoadPlaneDisplaceThinker((actionf_p1)T_PlaneDisplace);
|
th = LoadPlaneDisplaceThinker((actionf_p1)T_PlaneDisplace);
|
||||||
break;
|
break;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
case tc_polyrotate:
|
case tc_polyrotate:
|
||||||
th = LoadPolyrotatetThinker((actionf_p1)T_PolyObjRotate);
|
th = LoadPolyrotatetThinker((actionf_p1)T_PolyObjRotate);
|
||||||
break;
|
break;
|
||||||
|
@ -3540,7 +3531,6 @@ static void P_NetUnArchiveThinkers(void)
|
||||||
case tc_polyfade:
|
case tc_polyfade:
|
||||||
th = LoadPolyfadeThinker((actionf_p1)T_PolyObjFade);
|
th = LoadPolyfadeThinker((actionf_p1)T_PolyObjFade);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case tc_dynslopeline:
|
case tc_dynslopeline:
|
||||||
th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeLine);
|
th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeLine);
|
||||||
|
@ -3602,7 +3592,6 @@ static void P_NetUnArchiveThinkers(void)
|
||||||
//
|
//
|
||||||
// haleyjd 03/26/06: PolyObject saving code
|
// haleyjd 03/26/06: PolyObject saving code
|
||||||
//
|
//
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
#define PD_FLAGS 0x01
|
#define PD_FLAGS 0x01
|
||||||
#define PD_TRANS 0x02
|
#define PD_TRANS 0x02
|
||||||
|
|
||||||
|
@ -3691,7 +3680,6 @@ static inline void P_UnArchivePolyObjects(void)
|
||||||
for (i = 0; i < numSavedPolys; ++i)
|
for (i = 0; i < numSavedPolys; ++i)
|
||||||
P_UnArchivePolyObj(&PolyObjects[i]);
|
P_UnArchivePolyObj(&PolyObjects[i]);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline void P_FinishMobjs(void)
|
static inline void P_FinishMobjs(void)
|
||||||
{
|
{
|
||||||
|
@ -4165,9 +4153,7 @@ void P_SaveNetGame(void)
|
||||||
if (gamestate == GS_LEVEL)
|
if (gamestate == GS_LEVEL)
|
||||||
{
|
{
|
||||||
P_NetArchiveWorld();
|
P_NetArchiveWorld();
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
P_ArchivePolyObjects();
|
P_ArchivePolyObjects();
|
||||||
#endif
|
|
||||||
P_NetArchiveThinkers();
|
P_NetArchiveThinkers();
|
||||||
P_NetArchiveSpecials();
|
P_NetArchiveSpecials();
|
||||||
P_NetArchiveColormaps();
|
P_NetArchiveColormaps();
|
||||||
|
@ -4205,9 +4191,7 @@ boolean P_LoadNetGame(void)
|
||||||
if (gamestate == GS_LEVEL)
|
if (gamestate == GS_LEVEL)
|
||||||
{
|
{
|
||||||
P_NetUnArchiveWorld();
|
P_NetUnArchiveWorld();
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
P_UnArchivePolyObjects();
|
P_UnArchivePolyObjects();
|
||||||
#endif
|
|
||||||
P_NetUnArchiveThinkers();
|
P_NetUnArchiveThinkers();
|
||||||
P_NetUnArchiveSpecials();
|
P_NetUnArchiveSpecials();
|
||||||
P_NetUnArchiveColormaps();
|
P_NetUnArchiveColormaps();
|
||||||
|
|
|
@ -956,9 +956,7 @@ static void P_InitializeLinedef(line_t *ld)
|
||||||
ld->splats = NULL;
|
ld->splats = NULL;
|
||||||
#endif
|
#endif
|
||||||
ld->firsttag = ld->nexttag = -1;
|
ld->firsttag = ld->nexttag = -1;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
ld->polyobj = NULL;
|
ld->polyobj = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
ld->text = NULL;
|
ld->text = NULL;
|
||||||
ld->callcount = 0;
|
ld->callcount = 0;
|
||||||
|
@ -2043,10 +2041,8 @@ static void P_InitializeSeg(seg_t *seg)
|
||||||
|
|
||||||
seg->numlights = 0;
|
seg->numlights = 0;
|
||||||
seg->rlights = NULL;
|
seg->rlights = NULL;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
seg->polyseg = NULL;
|
seg->polyseg = NULL;
|
||||||
seg->dontrenderme = false;
|
seg->dontrenderme = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_LoadSegs(UINT8 *data)
|
static void P_LoadSegs(UINT8 *data)
|
||||||
|
@ -2409,11 +2405,9 @@ static boolean P_LoadBlockMap(UINT8 *data, size_t count)
|
||||||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||||
blockmap = blockmaplump+4;
|
blockmap = blockmaplump+4;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 2/22/06: setup polyobject blockmap
|
// haleyjd 2/22/06: setup polyobject blockmap
|
||||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2664,11 +2658,9 @@ static void P_CreateBlockMap(void)
|
||||||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||||
blockmap = blockmaplump + 4;
|
blockmap = blockmaplump + 4;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 2/22/06: setup polyobject blockmap
|
// haleyjd 2/22/06: setup polyobject blockmap
|
||||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ static fixed_t P_InterceptVector2(divline_t *v2, divline_t *v1)
|
||||||
return frac;
|
return frac;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -169,7 +168,6 @@ static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_CrossSubsector
|
// P_CrossSubsector
|
||||||
|
@ -180,9 +178,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
{
|
{
|
||||||
seg_t *seg;
|
seg_t *seg;
|
||||||
INT32 count;
|
INT32 count;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
polyobj_t *po; // haleyjd 02/23/06
|
polyobj_t *po; // haleyjd 02/23/06
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
if (num >= numsubsectors)
|
if (num >= numsubsectors)
|
||||||
|
@ -192,7 +188,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
// haleyjd 02/23/06: this assignment should be after the above check
|
// haleyjd 02/23/06: this assignment should be after the above check
|
||||||
seg = segs + subsectors[num].firstline;
|
seg = segs + subsectors[num].firstline;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 02/23/06: check polyobject lines
|
// haleyjd 02/23/06: check polyobject lines
|
||||||
if ((po = subsectors[num].polyList))
|
if ((po = subsectors[num].polyList))
|
||||||
{
|
{
|
||||||
|
@ -207,7 +202,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
po = (polyobj_t *)(po->link.next);
|
po = (polyobj_t *)(po->link.next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (count = subsectors[num].numlines; --count >= 0; seg++) // check lines
|
for (count = subsectors[num].numlines; --count >= 0; seg++) // check lines
|
||||||
{
|
{
|
||||||
|
@ -413,15 +407,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
|
||||||
|
|
||||||
// killough 11/98: shortcut for melee situations
|
// killough 11/98: shortcut for melee situations
|
||||||
// same subsector? obviously visible
|
// 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
|
// haleyjd 02/23/06: can't do this if there are polyobjects in the subsec
|
||||||
if (!t1->subsector->polyList &&
|
if (!t1->subsector->polyList &&
|
||||||
t1->subsector == t2->subsector)
|
t1->subsector == t2->subsector)
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
|
|
||||||
// An unobstructed LOS is possible.
|
// An unobstructed LOS is possible.
|
||||||
// Now look from eyes of t1 to any part of t2.
|
// Now look from eyes of t1 to any part of t2.
|
||||||
|
|
|
@ -1077,9 +1077,6 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// haleyjd: temporary define
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// PolyDoor
|
// PolyDoor
|
||||||
//
|
//
|
||||||
|
@ -1402,8 +1399,6 @@ static boolean PolyRotDisplace(line_t *line)
|
||||||
return EV_DoPolyObjRotDisplace(&pdd);
|
return EV_DoPolyObjRotDisplace(&pdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
/** Changes a sector's tag.
|
/** Changes a sector's tag.
|
||||||
* Used by the linedef executor tag changer and by crumblers.
|
* Used by the linedef executor tag changer and by crumblers.
|
||||||
*
|
*
|
||||||
|
@ -4029,7 +4024,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
case 480: // Polyobj_DoorSlide
|
case 480: // Polyobj_DoorSlide
|
||||||
case 481: // Polyobj_DoorSwing
|
case 481: // Polyobj_DoorSwing
|
||||||
PolyDoor(line);
|
PolyDoor(line);
|
||||||
|
@ -4059,7 +4053,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
case 492:
|
case 492:
|
||||||
PolyFade(line);
|
PolyFade(line);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -7264,7 +7257,6 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
|
|
||||||
Z_Free(secthinkers);
|
Z_Free(secthinkers);
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 02/20/06: spawn polyobjects
|
// haleyjd 02/20/06: spawn polyobjects
|
||||||
Polyobj_InitLevel();
|
Polyobj_InitLevel();
|
||||||
|
|
||||||
|
@ -7285,7 +7277,6 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
P_RunLevelLoadExecutors();
|
P_RunLevelLoadExecutors();
|
||||||
}
|
}
|
||||||
|
|
22
src/p_user.c
22
src/p_user.c
|
@ -3847,7 +3847,6 @@ static void P_DoTeeter(player_t *player)
|
||||||
BMBOUNDFIX(xl, xh, yl, yh);
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
// Polyobjects
|
// Polyobjects
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
validcount++;
|
validcount++;
|
||||||
|
|
||||||
for (by = yl; by <= yh; by++)
|
for (by = yl; by <= yh; by++)
|
||||||
|
@ -3941,7 +3940,6 @@ static void P_DoTeeter(player_t *player)
|
||||||
plink = (polymaplink_t *)(plink->link.next);
|
plink = (polymaplink_t *)(plink->link.next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (teeter) // only bother with objects as a last resort if you were already teetering
|
if (teeter) // only bother with objects as a last resort if you were already teetering
|
||||||
{
|
{
|
||||||
mobj_t *oldtmthing = tmthing;
|
mobj_t *oldtmthing = tmthing;
|
||||||
|
@ -5702,11 +5700,7 @@ static void P_2dMovement(player_t *player)
|
||||||
}
|
}
|
||||||
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
||||||
player->cmomx = player->cmomy = 0;
|
player->cmomx = player->cmomy = 0;
|
||||||
else if (player->onconveyor != 2 && player->onconveyor != 4
|
else if (player->onconveyor != 2 && player->onconveyor != 4 && player->onconveyor != 1)
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
&& player->onconveyor != 1
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
player->cmomx = player->cmomy = 0;
|
player->cmomx = player->cmomy = 0;
|
||||||
|
|
||||||
player->rmomx = player->mo->momx - player->cmomx;
|
player->rmomx = player->mo->momx - player->cmomx;
|
||||||
|
@ -5901,11 +5895,7 @@ static void P_3dMovement(player_t *player)
|
||||||
}
|
}
|
||||||
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
||||||
player->cmomx = player->cmomy = 0;
|
player->cmomx = player->cmomy = 0;
|
||||||
else if (player->onconveyor != 2 && player->onconveyor != 4
|
else if (player->onconveyor != 2 && player->onconveyor != 4 && player->onconveyor != 1)
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
&& player->onconveyor != 1
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
player->cmomx = player->cmomy = 0;
|
player->cmomx = player->cmomy = 0;
|
||||||
|
|
||||||
player->rmomx = player->mo->momx - player->cmomx;
|
player->rmomx = player->mo->momx - player->cmomx;
|
||||||
|
@ -10235,7 +10225,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
|
// Check polyobjects and see if floorz/ceilingz need to be altered
|
||||||
{
|
{
|
||||||
INT32 xl, xh, yl, yh, bx, by;
|
INT32 xl, xh, yl, yh, bx, by;
|
||||||
|
@ -10314,7 +10303,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// crushed camera
|
// crushed camera
|
||||||
if (myceilingz <= myfloorz + thiscam->height && !resetcalled && !cameranoclip)
|
if (myceilingz <= myfloorz + thiscam->height && !resetcalled && !cameranoclip)
|
||||||
|
@ -11725,9 +11713,7 @@ void P_PlayerThink(player_t *player)
|
||||||
P_MobjCheckWater(player->mo);
|
P_MobjCheckWater(player->mo);
|
||||||
|
|
||||||
#ifndef SECTORSPECIALSAFTERTHINK
|
#ifndef SECTORSPECIALSAFTERTHINK
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||||
#endif
|
|
||||||
player->onconveyor = 0;
|
player->onconveyor = 0;
|
||||||
// check special sectors : damage & secrets
|
// check special sectors : damage & secrets
|
||||||
|
|
||||||
|
@ -12086,12 +12072,10 @@ void P_PlayerThink(player_t *player)
|
||||||
// it lasts for one tic.
|
// it lasts for one tic.
|
||||||
player->pflags &= ~PF_FULLSTASIS;
|
player->pflags &= ~PF_FULLSTASIS;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (player->onconveyor == 1)
|
if (player->onconveyor == 1)
|
||||||
player->onconveyor = 3;
|
player->onconveyor = 3;
|
||||||
else if (player->onconveyor == 3)
|
else if (player->onconveyor == 3)
|
||||||
player->cmomy = player->cmomx = 0;
|
player->cmomy = player->cmomx = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
P_DoSuperStuff(player);
|
P_DoSuperStuff(player);
|
||||||
P_CheckSneakerAndLivesTimer(player);
|
P_CheckSneakerAndLivesTimer(player);
|
||||||
|
@ -12424,9 +12408,7 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
cmd = &player->cmd;
|
cmd = &player->cmd;
|
||||||
|
|
||||||
#ifdef SECTORSPECIALSAFTERTHINK
|
#ifdef SECTORSPECIALSAFTERTHINK
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||||
#endif
|
|
||||||
player->onconveyor = 0;
|
player->onconveyor = 0;
|
||||||
// check special sectors : damage & secrets
|
// check special sectors : damage & secrets
|
||||||
|
|
||||||
|
|
44
src/r_bsp.c
44
src/r_bsp.c
|
@ -354,9 +354,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)
|
boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back)
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
!line->polyseg &&
|
!line->polyseg &&
|
||||||
#endif
|
|
||||||
back->ceilingpic == front->ceilingpic
|
back->ceilingpic == front->ceilingpic
|
||||||
&& back->floorpic == front->floorpic
|
&& back->floorpic == front->floorpic
|
||||||
&& back->f_slope == front->f_slope
|
&& back->f_slope == front->f_slope
|
||||||
|
@ -482,10 +480,7 @@ static void R_AddLine(seg_t *line)
|
||||||
|
|
||||||
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
||||||
{
|
{
|
||||||
if (
|
if (!line->polyseg &&
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
!line->polyseg &&
|
|
||||||
#endif
|
|
||||||
!line->sidedef->midtexture
|
!line->sidedef->midtexture
|
||||||
&& ((!frontsector->ffloors && !backsector->ffloors)
|
&& ((!frontsector->ffloors && !backsector->ffloors)
|
||||||
|| (frontsector->tag == backsector->tag)))
|
|| (frontsector->tag == backsector->tag)))
|
||||||
|
@ -654,8 +649,6 @@ static boolean R_CheckBBox(const fixed_t *bspcoord)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
|
|
||||||
size_t numpolys; // number of polyobjects in current subsector
|
size_t numpolys; // number of polyobjects in current subsector
|
||||||
size_t num_po_ptrs; // number of polyobject pointers allocated
|
size_t num_po_ptrs; // number of polyobject pointers allocated
|
||||||
polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
|
polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
|
||||||
|
@ -819,7 +812,6 @@ static void R_AddPolyObjects(subsector_t *sub)
|
||||||
R_AddLine(po_ptrs[i]->segs[j]);
|
R_AddLine(po_ptrs[i]->segs[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_Subsector
|
// R_Subsector
|
||||||
|
@ -896,11 +888,7 @@ static void R_Subsector(size_t num)
|
||||||
|| (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum))
|
|| (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum))
|
||||||
{
|
{
|
||||||
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
|
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
|
||||||
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL
|
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL, NULL, frontsector->f_slope);
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
, NULL
|
|
||||||
#endif
|
|
||||||
, frontsector->f_slope);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
floorplane = NULL;
|
floorplane = NULL;
|
||||||
|
@ -911,11 +899,7 @@ static void R_Subsector(size_t num)
|
||||||
{
|
{
|
||||||
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
|
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
|
||||||
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
|
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
|
||||||
ceilingcolormap, NULL
|
ceilingcolormap, NULL, NULL, frontsector->c_slope);
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
, NULL
|
|
||||||
#endif
|
|
||||||
, frontsector->c_slope);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ceilingplane = NULL;
|
ceilingplane = NULL;
|
||||||
|
@ -963,11 +947,7 @@ static void R_Subsector(size_t num)
|
||||||
|
|
||||||
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
|
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
|
||||||
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
|
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
|
||||||
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover
|
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->b_slope);
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
, NULL
|
|
||||||
#endif
|
|
||||||
, *rover->b_slope);
|
|
||||||
|
|
||||||
ffloor[numffloors].slope = *rover->b_slope;
|
ffloor[numffloors].slope = *rover->b_slope;
|
||||||
|
|
||||||
|
@ -1000,11 +980,7 @@ static void R_Subsector(size_t num)
|
||||||
|
|
||||||
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
|
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
|
||||||
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
|
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
|
||||||
*frontsector->lightlist[light].extra_colormap, rover
|
*frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->t_slope);
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
, NULL
|
|
||||||
#endif
|
|
||||||
, *rover->t_slope);
|
|
||||||
|
|
||||||
ffloor[numffloors].slope = *rover->t_slope;
|
ffloor[numffloors].slope = *rover->t_slope;
|
||||||
|
|
||||||
|
@ -1019,7 +995,6 @@ static void R_Subsector(size_t num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// Polyobjects have planes, too!
|
// Polyobjects have planes, too!
|
||||||
if (sub->polyList)
|
if (sub->polyList)
|
||||||
{
|
{
|
||||||
|
@ -1085,7 +1060,6 @@ static void R_Subsector(size_t num)
|
||||||
po = (polyobj_t *)(po->link.next);
|
po = (polyobj_t *)(po->link.next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FLOORSPLATS
|
#ifdef FLOORSPLATS
|
||||||
if (sub->splats)
|
if (sub->splats)
|
||||||
|
@ -1108,20 +1082,14 @@ static void R_Subsector(size_t num)
|
||||||
|
|
||||||
firstseg = NULL;
|
firstseg = NULL;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
// haleyjd 02/19/06: draw polyobjects before static lines
|
// haleyjd 02/19/06: draw polyobjects before static lines
|
||||||
if (sub->polyList)
|
if (sub->polyList)
|
||||||
R_AddPolyObjects(sub);
|
R_AddPolyObjects(sub);
|
||||||
#endif
|
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
// CONS_Debug(DBG_GAMELOGIC, "Adding normal line %d...(%d)\n", line->linedef-lines, leveltime);
|
// CONS_Debug(DBG_GAMELOGIC, "Adding normal line %d...(%d)\n", line->linedef-lines, leveltime);
|
||||||
if (!line->glseg
|
if (!line->glseg && !line->polyseg) // ignore segs that belong to polyobjects
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
&& !line->polyseg // ignore segs that belong to polyobjects
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
R_AddLine(line);
|
R_AddLine(line);
|
||||||
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 */
|
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 */
|
||||||
|
|
|
@ -40,13 +40,11 @@ void R_PortalClearClipSegs(INT32 start, INT32 end);
|
||||||
void R_ClearDrawSegs(void);
|
void R_ClearDrawSegs(void);
|
||||||
void R_RenderBSPNode(INT32 bspnum);
|
void R_RenderBSPNode(INT32 bspnum);
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
void R_SortPolyObjects(subsector_t *sub);
|
void R_SortPolyObjects(subsector_t *sub);
|
||||||
|
|
||||||
extern size_t numpolys; // number of polyobjects in current subsector
|
extern size_t numpolys; // number of polyobjects in current subsector
|
||||||
extern size_t num_po_ptrs; // number of polyobject pointers allocated
|
extern size_t num_po_ptrs; // number of polyobject pointers allocated
|
||||||
extern polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
|
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,
|
sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||||
INT32 *ceilinglightlevel, boolean back);
|
INT32 *ceilinglightlevel, boolean back);
|
||||||
|
|
10
src/r_defs.h
10
src/r_defs.h
|
@ -28,8 +28,6 @@
|
||||||
#include "m_aatree.h"
|
#include "m_aatree.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define POLYOBJECTS
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// ClipWallSegment
|
// ClipWallSegment
|
||||||
// Clips the given range of columns
|
// Clips the given range of columns
|
||||||
|
@ -107,9 +105,7 @@ typedef struct
|
||||||
fixed_t z; ///< Z coordinate.
|
fixed_t z; ///< Z coordinate.
|
||||||
} degenmobj_t;
|
} degenmobj_t;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
#include "p_polyobj.h"
|
#include "p_polyobj.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
// Store fake planes in a resizable array insted of just by
|
// Store fake planes in a resizable array insted of just by
|
||||||
// heightsec. Allows for multiple fake planes.
|
// heightsec. Allows for multiple fake planes.
|
||||||
|
@ -441,9 +437,7 @@ typedef struct line_s
|
||||||
void *splats; // wallsplat_t list
|
void *splats; // wallsplat_t list
|
||||||
#endif
|
#endif
|
||||||
INT32 firsttag, nexttag; // improves searches for tags.
|
INT32 firsttag, nexttag; // improves searches for tags.
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
polyobj_t *polyobj; // Belongs to a polyobject?
|
polyobj_t *polyobj; // Belongs to a polyobject?
|
||||||
#endif
|
|
||||||
|
|
||||||
char *text; // a concatenation of all front and back texture names, for linedef specials that require a string.
|
char *text; // a concatenation 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
|
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
||||||
|
@ -486,9 +480,7 @@ typedef struct subsector_s
|
||||||
sector_t *sector;
|
sector_t *sector;
|
||||||
INT16 numlines;
|
INT16 numlines;
|
||||||
UINT16 firstline;
|
UINT16 firstline;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
struct polyobj_s *polyList; // haleyjd 02/19/06: list of polyobjects
|
struct polyobj_s *polyList; // haleyjd 02/19/06: list of polyobjects
|
||||||
#endif
|
|
||||||
#if 1//#ifdef FLOORSPLATS
|
#if 1//#ifdef FLOORSPLATS
|
||||||
void *splats; // floorsplat_t list
|
void *splats; // floorsplat_t list
|
||||||
#endif
|
#endif
|
||||||
|
@ -591,10 +583,8 @@ typedef struct seg_s
|
||||||
// Why slow things down by calculating lightlists for every thick side?
|
// Why slow things down by calculating lightlists for every thick side?
|
||||||
size_t numlights;
|
size_t numlights;
|
||||||
r_lightlist_t *rlights;
|
r_lightlist_t *rlights;
|
||||||
#ifdef POLYOBJECTS
|
|
||||||
polyobj_t *polyseg;
|
polyobj_t *polyseg;
|
||||||
boolean dontrenderme;
|
boolean dontrenderme;
|
||||||
#endif
|
|
||||||
boolean glseg;
|
boolean glseg;
|
||||||
} seg_t;
|
} seg_t;
|
||||||
|
|
||||||
|
|
|
@ -337,11 +337,7 @@ static visplane_t *new_visplane(unsigned hash)
|
||||||
//
|
//
|
||||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
|
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
|
||||||
ffloor_t *pfloor
|
ffloor_t *pfloor, polyobj_t *polyobj, pslope_t *slope)
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
, polyobj_t *polyobj
|
|
||||||
#endif
|
|
||||||
, pslope_t *slope)
|
|
||||||
{
|
{
|
||||||
visplane_t *check;
|
visplane_t *check;
|
||||||
unsigned hash;
|
unsigned hash;
|
||||||
|
@ -361,7 +357,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (polyobj)
|
if (polyobj)
|
||||||
{
|
{
|
||||||
if (polyobj->angle != 0)
|
if (polyobj->angle != 0)
|
||||||
|
@ -376,7 +371,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
yoff += polyobj->centerPt.y;
|
yoff += polyobj->centerPt.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// This appears to fix the Nimbus Ruins sky bug.
|
// This appears to fix the Nimbus Ruins sky bug.
|
||||||
if (picnum == skyflatnum && pfloor)
|
if (picnum == skyflatnum && pfloor)
|
||||||
|
@ -390,12 +384,10 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
|
|
||||||
for (check = visplanes[hash]; check; check = check->next)
|
for (check = visplanes[hash]; check; check = check->next)
|
||||||
{
|
{
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (check->polyobj && pfloor)
|
if (check->polyobj && pfloor)
|
||||||
continue;
|
continue;
|
||||||
if (polyobj != check->polyobj)
|
if (polyobj != check->polyobj)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
if (height == check->height && picnum == check->picnum
|
if (height == check->height && picnum == check->picnum
|
||||||
&& lightlevel == check->lightlevel
|
&& lightlevel == check->lightlevel
|
||||||
&& xoff == check->xoffs && yoff == check->yoffs
|
&& xoff == check->xoffs && yoff == check->yoffs
|
||||||
|
@ -426,9 +418,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
check->viewz = viewz;
|
check->viewz = viewz;
|
||||||
check->viewangle = viewangle;
|
check->viewangle = viewangle;
|
||||||
check->plangle = plangle;
|
check->plangle = plangle;
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
check->polyobj = polyobj;
|
check->polyobj = polyobj;
|
||||||
#endif
|
|
||||||
check->slope = slope;
|
check->slope = slope;
|
||||||
|
|
||||||
memset(check->top, 0xff, sizeof (check->top));
|
memset(check->top, 0xff, sizeof (check->top));
|
||||||
|
@ -496,9 +486,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
|
||||||
new_pl->viewz = pl->viewz;
|
new_pl->viewz = pl->viewz;
|
||||||
new_pl->viewangle = pl->viewangle;
|
new_pl->viewangle = pl->viewangle;
|
||||||
new_pl->plangle = pl->plangle;
|
new_pl->plangle = pl->plangle;
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
new_pl->polyobj = pl->polyobj;
|
new_pl->polyobj = pl->polyobj;
|
||||||
#endif
|
|
||||||
new_pl->slope = pl->slope;
|
new_pl->slope = pl->slope;
|
||||||
pl = new_pl;
|
pl = new_pl;
|
||||||
pl->minx = start;
|
pl->minx = start;
|
||||||
|
@ -523,11 +511,9 @@ void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop)
|
||||||
// INT32 unionl, unionh;
|
// INT32 unionl, unionh;
|
||||||
// INT32 x;
|
// INT32 x;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// Don't expand polyobject planes here - we do that on our own.
|
// Don't expand polyobject planes here - we do that on our own.
|
||||||
if (pl->polyobj)
|
if (pl->polyobj)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (pl->minx > start) pl->minx = start;
|
if (pl->minx > start) pl->minx = start;
|
||||||
if (pl->maxx < stop) pl->maxx = stop;
|
if (pl->maxx < stop) pl->maxx = stop;
|
||||||
|
@ -603,11 +589,7 @@ void R_DrawPlanes(void)
|
||||||
{
|
{
|
||||||
for (pl = visplanes[i]; pl; pl = pl->next)
|
for (pl = visplanes[i]; pl; pl = pl->next)
|
||||||
{
|
{
|
||||||
if (pl->ffloor != NULL
|
if (pl->ffloor != NULL || pl->polyobj != NULL)
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
|| pl->polyobj != NULL
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
R_DrawSinglePlane(pl);
|
R_DrawSinglePlane(pl);
|
||||||
|
@ -961,7 +943,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
#endif
|
#endif
|
||||||
spanfunc = spanfuncs[BASEDRAWFUNC];
|
spanfunc = spanfuncs[BASEDRAWFUNC];
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (pl->polyobj && pl->polyobj->translucency != 0)
|
if (pl->polyobj && pl->polyobj->translucency != 0)
|
||||||
{
|
{
|
||||||
spanfunctype = SPANDRAWFUNC_TRANS;
|
spanfunctype = SPANDRAWFUNC_TRANS;
|
||||||
|
@ -979,8 +960,9 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
else
|
else
|
||||||
light = LIGHTLEVELS-1;
|
light = LIGHTLEVELS-1;
|
||||||
|
|
||||||
} else
|
}
|
||||||
#endif
|
else
|
||||||
|
{
|
||||||
if (pl->ffloor)
|
if (pl->ffloor)
|
||||||
{
|
{
|
||||||
// Don't draw planes that shouldn't be drawn.
|
// Don't draw planes that shouldn't be drawn.
|
||||||
|
@ -1040,7 +1022,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
}
|
}
|
||||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
|
|
||||||
#ifndef NOWATER
|
#ifndef NOWATER
|
||||||
if (pl->ffloor->flags & FF_RIPPLE)
|
if (pl->ffloor->flags & FF_RIPPLE)
|
||||||
{
|
{
|
||||||
INT32 top, bottom;
|
INT32 top, bottom;
|
||||||
|
@ -1065,9 +1047,11 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
vid.width, vid.width);
|
vid.width, vid.width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
}
|
}
|
||||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
|
||||||
|
|
||||||
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
||||||
&& viewangle != pl->viewangle+pl->plangle)
|
&& viewangle != pl->viewangle+pl->plangle)
|
||||||
|
|
|
@ -47,9 +47,7 @@ typedef struct visplane_s
|
||||||
fixed_t xoffs, yoffs; // Scrolling flats.
|
fixed_t xoffs, yoffs; // Scrolling flats.
|
||||||
|
|
||||||
struct ffloor_s *ffloor;
|
struct ffloor_s *ffloor;
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
polyobj_t *polyobj;
|
polyobj_t *polyobj;
|
||||||
#endif
|
|
||||||
pslope_t *slope;
|
pslope_t *slope;
|
||||||
} visplane_t;
|
} visplane_t;
|
||||||
|
|
||||||
|
@ -80,11 +78,7 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2);
|
||||||
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
|
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
|
||||||
void R_DrawPlanes(void);
|
void R_DrawPlanes(void);
|
||||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
|
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
|
extracolormap_t *planecolormap, ffloor_t *ffloor, polyobj_t *polyobj, pslope_t *slope);
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
, polyobj_t *polyobj
|
|
||||||
#endif
|
|
||||||
, pslope_t *slope);
|
|
||||||
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
|
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||||
void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
|
void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||||
void R_PlaneBounds(visplane_t *plane);
|
void R_PlaneBounds(visplane_t *plane);
|
||||||
|
@ -112,9 +106,7 @@ typedef struct planemgr_s
|
||||||
struct pslope_s *slope;
|
struct pslope_s *slope;
|
||||||
|
|
||||||
struct ffloor_s *ffloor;
|
struct ffloor_s *ffloor;
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
polyobj_t *polyobj;
|
polyobj_t *polyobj;
|
||||||
#endif
|
|
||||||
} visffloor_t;
|
} visffloor_t;
|
||||||
|
|
||||||
extern visffloor_t ffloor[MAXFFLOORS];
|
extern visffloor_t ffloor[MAXFFLOORS];
|
||||||
|
|
52
src/r_segs.c
52
src/r_segs.c
|
@ -608,7 +608,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
// draw the texture
|
// draw the texture
|
||||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, maskedtexturecol[dc_x]) - 3);
|
col = (column_t *)((UINT8 *)R_GetColumn(texnum, maskedtexturecol[dc_x]) - 3);
|
||||||
|
|
||||||
//#ifdef POLYOBJECTS_PLANES
|
|
||||||
#if 0 // Disabling this allows inside edges to render below the planes, for until the clipping is fixed to work right when POs are near the camera. -Red
|
#if 0 // Disabling this allows inside edges to render below the planes, for until the clipping is fixed to work right when POs are near the camera. -Red
|
||||||
if (curline->dontrenderme && curline->polyseg && (curline->polyseg->flags & POF_RENDERPLANES))
|
if (curline->dontrenderme && curline->polyseg && (curline->polyseg->flags & POF_RENDERPLANES))
|
||||||
{
|
{
|
||||||
|
@ -1307,10 +1306,8 @@ static void R_RenderSegLoop (void)
|
||||||
|
|
||||||
for (i = 0; i < numffloors; i++)
|
for (i = 0; i < numffloors; i++)
|
||||||
{
|
{
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
|
if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ffloor[i].height < viewz)
|
if (ffloor[i].height < viewz)
|
||||||
{
|
{
|
||||||
|
@ -1323,20 +1320,21 @@ static void R_RenderSegLoop (void)
|
||||||
if (bottom_w > bottom)
|
if (bottom_w > bottom)
|
||||||
bottom_w = bottom;
|
bottom_w = bottom;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// Polyobject-specific hack to fix plane leaking -Red
|
// Polyobject-specific hack to fix plane leaking -Red
|
||||||
if (ffloor[i].polyobj && top_w >= bottom_w) {
|
if (ffloor[i].polyobj && top_w >= bottom_w)
|
||||||
|
{
|
||||||
ffloor[i].plane->top[rw_x] = 0xFFFF;
|
ffloor[i].plane->top[rw_x] = 0xFFFF;
|
||||||
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
|
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
|
||||||
} else
|
}
|
||||||
#endif
|
else
|
||||||
|
{
|
||||||
if (top_w <= bottom_w)
|
if (top_w <= bottom_w)
|
||||||
{
|
{
|
||||||
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
||||||
ffloor[i].plane->bottom[rw_x] = (INT16)bottom_w;
|
ffloor[i].plane->bottom[rw_x] = (INT16)bottom_w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (ffloor[i].height > viewz)
|
else if (ffloor[i].height > viewz)
|
||||||
{
|
{
|
||||||
INT32 top_w = ffloor[i].c_clip[rw_x] + 1;
|
INT32 top_w = ffloor[i].c_clip[rw_x] + 1;
|
||||||
|
@ -1348,14 +1346,14 @@ static void R_RenderSegLoop (void)
|
||||||
if (bottom_w > bottom)
|
if (bottom_w > bottom)
|
||||||
bottom_w = bottom;
|
bottom_w = bottom;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// Polyobject-specific hack to fix plane leaking -Red
|
// Polyobject-specific hack to fix plane leaking -Red
|
||||||
if (ffloor[i].polyobj && top_w >= bottom_w) {
|
if (ffloor[i].polyobj && top_w >= bottom_w)
|
||||||
|
{
|
||||||
ffloor[i].plane->top[rw_x] = 0xFFFF;
|
ffloor[i].plane->top[rw_x] = 0xFFFF;
|
||||||
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
|
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
|
||||||
} else
|
}
|
||||||
#endif
|
else
|
||||||
|
{
|
||||||
if (top_w <= bottom_w)
|
if (top_w <= bottom_w)
|
||||||
{
|
{
|
||||||
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
||||||
|
@ -1364,6 +1362,7 @@ static void R_RenderSegLoop (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//SoM: Calculate offsets for Thick fake floors.
|
//SoM: Calculate offsets for Thick fake floors.
|
||||||
// calculate texture offset
|
// calculate texture offset
|
||||||
|
@ -1816,10 +1815,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
{
|
{
|
||||||
for (i = 0; i < numffloors; i++)
|
for (i = 0; i < numffloors; i++)
|
||||||
{
|
{
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (ffloor[i].polyobj && (!ds_p->curline->polyseg || ffloor[i].polyobj != ds_p->curline->polyseg))
|
if (ffloor[i].polyobj && (!ds_p->curline->polyseg || ffloor[i].polyobj != ds_p->curline->polyseg))
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ffloor[i].slope) {
|
if (ffloor[i].slope) {
|
||||||
ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz;
|
ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz;
|
||||||
|
@ -2326,34 +2323,41 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
|
|
||||||
maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0])
|
maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0])
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
if (curline->polyseg)
|
||||||
if (curline->polyseg) { // use REAL front and back floors please, so midtexture rendering isn't mucked up
|
{ // use REAL front and back floors please, so midtexture rendering isn't mucked up
|
||||||
rw_midtextureslide = rw_midtexturebackslide = 0;
|
rw_midtextureslide = rw_midtexturebackslide = 0;
|
||||||
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||||
rw_midtexturemid = rw_midtextureback = max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz;
|
rw_midtexturemid = rw_midtextureback = max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz;
|
||||||
else
|
else
|
||||||
rw_midtexturemid = rw_midtextureback = min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz;
|
rw_midtexturemid = rw_midtextureback = min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz;
|
||||||
} else
|
}
|
||||||
#endif
|
else
|
||||||
|
{
|
||||||
// Set midtexture starting height
|
// Set midtexture starting height
|
||||||
if (linedef->flags & ML_EFFECT2) { // Ignore slopes when texturing
|
if (linedef->flags & ML_EFFECT2)
|
||||||
|
{ // Ignore slopes when texturing
|
||||||
rw_midtextureslide = rw_midtexturebackslide = 0;
|
rw_midtextureslide = rw_midtexturebackslide = 0;
|
||||||
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||||
rw_midtexturemid = rw_midtextureback = max(frontsector->floorheight, backsector->floorheight) - viewz;
|
rw_midtexturemid = rw_midtextureback = max(frontsector->floorheight, backsector->floorheight) - viewz;
|
||||||
else
|
else
|
||||||
rw_midtexturemid = rw_midtextureback = min(frontsector->ceilingheight, backsector->ceilingheight) - viewz;
|
rw_midtexturemid = rw_midtextureback = min(frontsector->ceilingheight, backsector->ceilingheight) - viewz;
|
||||||
|
|
||||||
} else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) {
|
}
|
||||||
|
else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||||
|
{
|
||||||
rw_midtexturemid = worldbottom;
|
rw_midtexturemid = worldbottom;
|
||||||
rw_midtextureslide = floorfrontslide;
|
rw_midtextureslide = floorfrontslide;
|
||||||
rw_midtextureback = worldlow;
|
rw_midtextureback = worldlow;
|
||||||
rw_midtexturebackslide = floorbackslide;
|
rw_midtexturebackslide = floorbackslide;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
rw_midtexturemid = worldtop;
|
rw_midtexturemid = worldtop;
|
||||||
rw_midtextureslide = ceilingfrontslide;
|
rw_midtextureslide = ceilingfrontslide;
|
||||||
rw_midtextureback = worldhigh;
|
rw_midtextureback = worldhigh;
|
||||||
rw_midtexturebackslide = ceilingbackslide;
|
rw_midtexturebackslide = ceilingbackslide;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rw_midtexturemid += sidedef->rowoffset;
|
rw_midtexturemid += sidedef->rowoffset;
|
||||||
rw_midtextureback += sidedef->rowoffset;
|
rw_midtextureback += sidedef->rowoffset;
|
||||||
|
|
||||||
|
@ -2709,7 +2713,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
if (curline->polyseg && frontsector && (curline->polyseg->flags & POF_RENDERPLANES))
|
if (curline->polyseg && frontsector && (curline->polyseg->flags & POF_RENDERPLANES))
|
||||||
{
|
{
|
||||||
while (i < numffloors && ffloor[i].polyobj != curline->polyseg) i++;
|
while (i < numffloors && ffloor[i].polyobj != curline->polyseg) i++;
|
||||||
|
@ -2748,7 +2751,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
numbackffloors = i;
|
numbackffloors = i;
|
||||||
}
|
}
|
||||||
|
@ -2802,7 +2804,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
for (i = 0; i < numffloors; i++)
|
for (i = 0; i < numffloors; i++)
|
||||||
R_ExpandPlane(ffloor[i].plane, rw_x, rw_stopx - 1);
|
R_ExpandPlane(ffloor[i].plane, rw_x, rw_stopx - 1);
|
||||||
}
|
}
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// FIXME hack to fix planes disappearing when a seg goes behind the camera. This NEEDS to be changed to be done properly. -Red
|
// FIXME hack to fix planes disappearing when a seg goes behind the camera. This NEEDS to be changed to be done properly. -Red
|
||||||
if (curline->polyseg)
|
if (curline->polyseg)
|
||||||
{
|
{
|
||||||
|
@ -2817,7 +2818,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
ffloor[i].plane->maxx = rw_stopx - 1;
|
ffloor[i].plane->maxx = rw_stopx - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WALLSPLATS
|
#ifdef WALLSPLATS
|
||||||
|
|
|
@ -1140,7 +1140,6 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // Unfortunately, this drops CEZ2 down to sub-17 FPS on my i7.
|
#if 0 // Unfortunately, this drops CEZ2 down to sub-17 FPS on my i7.
|
||||||
//#ifdef POLYOBJECTS
|
|
||||||
// Check polyobjects and see if floorz needs to be altered, for rings only because they don't update floorz
|
// Check polyobjects and see if floorz needs to be altered, for rings only because they don't update floorz
|
||||||
if (thing->type == MT_RING)
|
if (thing->type == MT_RING)
|
||||||
{
|
{
|
||||||
|
@ -2271,7 +2270,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
||||||
entry->ffloor = ds->thicksides[i];
|
entry->ffloor = ds->thicksides[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// Check for a polyobject plane, but only if this is a front line
|
// Check for a polyobject plane, but only if this is a front line
|
||||||
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
|
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
|
||||||
plane = ds->curline->polyseg->visplane;
|
plane = ds->curline->polyseg->visplane;
|
||||||
|
@ -2287,7 +2285,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
||||||
}
|
}
|
||||||
ds->curline->polyseg->visplane = NULL;
|
ds->curline->polyseg->visplane = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (ds->maskedtexturecol)
|
if (ds->maskedtexturecol)
|
||||||
{
|
{
|
||||||
entry = R_CreateDrawNode(head);
|
entry = R_CreateDrawNode(head);
|
||||||
|
@ -2335,7 +2332,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
||||||
if (tempskip)
|
if (tempskip)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
|
||||||
// find all the remaining polyobject planes and add them on the end of the list
|
// 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
|
// probably this is a terrible idea if we wanted them to be sorted properly
|
||||||
// but it works getting them in for now
|
// but it works getting them in for now
|
||||||
|
@ -2356,7 +2352,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
||||||
// note: no seg is set, for what should be obvious reasons
|
// note: no seg is set, for what should be obvious reasons
|
||||||
PolyObjects[i].visplane = NULL;
|
PolyObjects[i].visplane = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// No vissprites in this mask?
|
// No vissprites in this mask?
|
||||||
if (mask->vissprites[1] - mask->vissprites[0] == 0)
|
if (mask->vissprites[1] - mask->vissprites[0] == 0)
|
||||||
|
|
Loading…
Reference in a new issue