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