mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-13 05:11:01 +00:00
Remove ESLOPE #ifdef(backport from srb2 2.2)
This commit is contained in:
parent
79c299bf31
commit
00137ef4ea
33 changed files with 0 additions and 960 deletions
32
src/am_map.c
32
src/am_map.c
|
@ -862,10 +862,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++)
|
||||||
{
|
{
|
||||||
|
@ -873,7 +871,6 @@ 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); \
|
||||||
|
@ -888,7 +885,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
|
||||||
{
|
{
|
||||||
|
@ -897,19 +893,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);
|
||||||
|
@ -927,20 +915,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
|
||||||
|
@ -948,20 +926,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
|
||||||
|
|
|
@ -8622,13 +8622,11 @@ struct {
|
||||||
{"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
|
{"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
|
||||||
{"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
|
{"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
// Slope flags
|
// Slope flags
|
||||||
{"SL_NOPHYSICS",SL_NOPHYSICS}, // Don't do momentum adjustment with this slope
|
{"SL_NOPHYSICS",SL_NOPHYSICS}, // Don't do momentum adjustment with this slope
|
||||||
{"SL_NODYNAMIC",SL_NODYNAMIC}, // Slope will never need to move during the level, so don't fuss with recalculating it
|
{"SL_NODYNAMIC",SL_NODYNAMIC}, // Slope will never need to move during the level, so don't fuss with recalculating it
|
||||||
{"SL_ANCHORVERTEX",SL_ANCHORVERTEX},// Slope is using a Slope Vertex Thing to anchor its position
|
{"SL_ANCHORVERTEX",SL_ANCHORVERTEX},// Slope is using a Slope Vertex Thing to anchor its position
|
||||||
{"SL_VERTEXSLOPE",SL_VERTEXSLOPE}, // Slope is built from three Slope Vertex Things
|
{"SL_VERTEXSLOPE",SL_VERTEXSLOPE}, // Slope is built from three Slope Vertex Things
|
||||||
#endif
|
|
||||||
|
|
||||||
// Angles
|
// Angles
|
||||||
{"ANG1",ANG1},
|
{"ANG1",ANG1},
|
||||||
|
|
|
@ -606,11 +606,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
/// Kalaron/Eternity Engine slope code (SRB2CB ported)
|
/// Kalaron/Eternity Engine slope code (SRB2CB ported)
|
||||||
#define ESLOPE
|
#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
|
|
||||||
|
|
||||||
/// Delete file while the game is running.
|
/// Delete file while the game is running.
|
||||||
/// \note EXTREMELY buggy, tends to crash game.
|
/// \note EXTREMELY buggy, tends to crash game.
|
||||||
|
|
|
@ -2893,14 +2893,12 @@ void K_SpawnBoostTrail(player_t *player)
|
||||||
{
|
{
|
||||||
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_SNEAKERTRAIL].height, player->mo->scale);
|
ground -= FixedMul(mobjinfo[MT_SNEAKERTRAIL].height, player->mo->scale);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
flame = P_SpawnMobj(newx, newy, ground, MT_SNEAKERTRAIL);
|
flame = P_SpawnMobj(newx, newy, ground, MT_SNEAKERTRAIL);
|
||||||
|
|
||||||
P_SetTarget(&flame->target, player->mo);
|
P_SetTarget(&flame->target, player->mo);
|
||||||
|
@ -3604,9 +3602,7 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound)
|
||||||
if (mo->eflags & MFE_SPRUNG)
|
if (mo->eflags & MFE_SPRUNG)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
mo->standingslope = NULL;
|
mo->standingslope = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
mo->eflags |= MFE_SPRUNG;
|
mo->eflags |= MFE_SPRUNG;
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,7 @@
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
#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_things.h"
|
#include "r_things.h"
|
||||||
|
@ -1575,7 +1573,6 @@ static int lib_evCrumbleChain(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
// P_SLOPES
|
// P_SLOPES
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
|
@ -1591,7 +1588,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
|
||||||
////////////
|
////////////
|
||||||
|
@ -3083,10 +3079,8 @@ static luaL_Reg lib[] = {
|
||||||
{"P_StartQuake",lib_pStartQuake},
|
{"P_StartQuake",lib_pStartQuake},
|
||||||
{"EV_CrumbleChain",lib_evCrumbleChain},
|
{"EV_CrumbleChain",lib_evCrumbleChain},
|
||||||
|
|
||||||
#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},
|
||||||
|
|
|
@ -40,11 +40,9 @@ extern lua_State *gL;
|
||||||
#define META_SUBSECTOR "SUBSECTOR_T*"
|
#define META_SUBSECTOR "SUBSECTOR_T*"
|
||||||
#define META_SECTOR "SECTOR_T*"
|
#define META_SECTOR "SECTOR_T*"
|
||||||
#define META_FFLOOR "FFLOOR_T*"
|
#define META_FFLOOR "FFLOOR_T*"
|
||||||
#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*"
|
||||||
|
|
|
@ -16,9 +16,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"
|
||||||
|
@ -43,13 +41,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[] = {
|
||||||
|
@ -66,10 +60,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 {
|
||||||
|
@ -175,10 +167,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,
|
||||||
|
@ -195,10 +185,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
|
||||||
|
@ -208,7 +196,6 @@ static const char *const ffloor_opt[] = {
|
||||||
"alpha",
|
"alpha",
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
enum slope_e {
|
enum slope_e {
|
||||||
slope_valid = 0,
|
slope_valid = 0,
|
||||||
slope_o,
|
slope_o,
|
||||||
|
@ -247,7 +234,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};
|
||||||
|
@ -463,14 +449,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;
|
||||||
}
|
}
|
||||||
|
@ -495,10 +479,8 @@ static int sector_set(lua_State *L)
|
||||||
case sector_heightsec: // heightsec
|
case sector_heightsec: // heightsec
|
||||||
case sector_camsec: // camsec
|
case sector_camsec: // camsec
|
||||||
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
|
||||||
|
@ -1134,14 +1116,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;
|
||||||
|
@ -1183,10 +1163,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
|
||||||
|
@ -1247,7 +1225,6 @@ static int ffloor_set(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
static int slope_get(lua_State *L)
|
static int slope_get(lua_State *L)
|
||||||
{
|
{
|
||||||
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
||||||
|
@ -1422,7 +1399,6 @@ static int vector3_get(lua_State *L)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int lib_getMapheaderinfo(lua_State *L)
|
static int lib_getMapheaderinfo(lua_State *L)
|
||||||
{
|
{
|
||||||
|
@ -1614,7 +1590,6 @@ int LUA_MapLib(lua_State *L)
|
||||||
lua_setfield(L, -2, "__newindex");
|
lua_setfield(L, -2, "__newindex");
|
||||||
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");
|
||||||
|
@ -1632,7 +1607,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);
|
||||||
|
|
|
@ -82,9 +82,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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -145,9 +143,7 @@ static const char *const mobj_opt[] = {
|
||||||
"extravalue2",
|
"extravalue2",
|
||||||
"cusval",
|
"cusval",
|
||||||
"cvmem",
|
"cvmem",
|
||||||
#ifdef ESLOPE
|
|
||||||
"standingslope",
|
"standingslope",
|
||||||
#endif
|
|
||||||
"colorized",
|
"colorized",
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
|
@ -352,11 +348,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;
|
||||||
|
@ -670,10 +664,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;
|
||||||
|
|
|
@ -22,9 +22,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
|
||||||
|
@ -472,9 +470,7 @@ enum
|
||||||
ARCH_SIDE,
|
ARCH_SIDE,
|
||||||
ARCH_SUBSECTOR,
|
ARCH_SUBSECTOR,
|
||||||
ARCH_SECTOR,
|
ARCH_SECTOR,
|
||||||
#ifdef ESLOPE
|
|
||||||
ARCH_SLOPE,
|
ARCH_SLOPE,
|
||||||
#endif
|
|
||||||
ARCH_MAPHEADER,
|
ARCH_MAPHEADER,
|
||||||
|
|
||||||
ARCH_TEND=0xFF,
|
ARCH_TEND=0xFF,
|
||||||
|
@ -494,9 +490,7 @@ static const struct {
|
||||||
{META_SIDE, ARCH_SIDE},
|
{META_SIDE, ARCH_SIDE},
|
||||||
{META_SUBSECTOR,ARCH_SUBSECTOR},
|
{META_SUBSECTOR,ARCH_SUBSECTOR},
|
||||||
{META_SECTOR, ARCH_SECTOR},
|
{META_SECTOR, ARCH_SECTOR},
|
||||||
#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}
|
||||||
};
|
};
|
||||||
|
@ -701,7 +695,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));
|
||||||
|
@ -713,7 +706,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));
|
||||||
|
@ -915,7 +907,6 @@ static UINT8 ArchiveValueDemo(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));
|
||||||
|
@ -927,7 +918,6 @@ static UINT8 ArchiveValueDemo(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));
|
||||||
|
@ -1233,11 +1223,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
|
||||||
case ARCH_SECTOR:
|
case ARCH_SECTOR:
|
||||||
LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_SECTOR);
|
LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_SECTOR);
|
||||||
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;
|
||||||
|
@ -1336,11 +1324,9 @@ static UINT8 UnArchiveValueDemo(int TABLESINDEX, char field[1024])
|
||||||
case ARCH_SECTOR:
|
case ARCH_SECTOR:
|
||||||
LUA_PushUserdata(gL, §ors[READUINT16(demo_p)], META_SECTOR);
|
LUA_PushUserdata(gL, §ors[READUINT16(demo_p)], META_SECTOR);
|
||||||
break;
|
break;
|
||||||
#ifdef ESLOPE
|
|
||||||
case ARCH_SLOPE:
|
case ARCH_SLOPE:
|
||||||
LUA_PushUserdata(gL, P_SlopeById(READUINT16(demo_p)), META_SLOPE);
|
LUA_PushUserdata(gL, P_SlopeById(READUINT16(demo_p)), META_SLOPE);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case ARCH_MAPHEADER:
|
case ARCH_MAPHEADER:
|
||||||
LUA_PushUserdata(gL, mapheaderinfo[READUINT16(demo_p)], META_MAPHEADER);
|
LUA_PushUserdata(gL, mapheaderinfo[READUINT16(demo_p)], META_MAPHEADER);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -862,13 +862,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)))
|
||||||
{
|
{
|
||||||
|
@ -879,11 +875,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"),
|
||||||
|
@ -931,20 +923,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->options = (UINT16)((cheight - player->mo->z - player->mo->height)>>FRACBITS);
|
mt->options = (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->options = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
mt->options = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
||||||
}
|
}
|
||||||
mt->options <<= ZSHIFT;
|
mt->options <<= ZSHIFT;
|
||||||
|
@ -1001,11 +985,7 @@ void OP_NightsObjectplace(player_t *player)
|
||||||
UINT16 angle = (UINT16)(player->anotherflyangle % 360);
|
UINT16 angle = (UINT16)(player->anotherflyangle % 360);
|
||||||
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
|
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
|
||||||
sector_t *sec = player->mo->subsector->sector;
|
sector_t *sec = player->mo->subsector->sector;
|
||||||
#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
|
|
||||||
|
|
||||||
|
|
||||||
player->pflags |= PF_ATTACKDOWN;
|
player->pflags |= PF_ATTACKDOWN;
|
||||||
|
@ -1162,20 +1142,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;
|
||||||
|
|
|
@ -5795,13 +5795,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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -328,9 +328,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);
|
||||||
|
|
56
src/p_map.c
56
src/p_map.c
|
@ -31,9 +31,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"
|
||||||
|
|
||||||
|
@ -56,9 +54,7 @@ fixed_t tmfloorz, tmceilingz;
|
||||||
static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights
|
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)
|
||||||
#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
|
||||||
|
@ -135,9 +131,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
object->standingslope = NULL; // Okay, now we can't return - no launching off at silly angles for you.
|
object->standingslope = NULL; // Okay, now we can't return - no launching off at silly angles for you.
|
||||||
#endif
|
|
||||||
|
|
||||||
object->eflags |= MFE_SPRUNG; // apply this flag asap!
|
object->eflags |= MFE_SPRUNG; // apply this flag asap!
|
||||||
spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify
|
spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify
|
||||||
|
@ -275,9 +269,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)
|
||||||
{
|
{
|
||||||
|
@ -1758,9 +1750,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (thing->z + thing->height > tmfloorz)
|
if (thing->z + thing->height > tmfloorz)
|
||||||
{
|
{
|
||||||
tmfloorz = thing->z + thing->height;
|
tmfloorz = thing->z + thing->height;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmfloorslope = NULL;
|
tmfloorslope = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1777,17 +1767,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
||||||
{
|
{
|
||||||
tmfloorz = tmceilingz = topz; // block while in air
|
tmfloorz = tmceilingz = topz; // block while in air
|
||||||
#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;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmceilingslope = NULL;
|
tmceilingslope = NULL;
|
||||||
#endif
|
|
||||||
tmfloorthing = thing; // thing we may stand on
|
tmfloorthing = thing; // thing we may stand on
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1801,9 +1787,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (thing->z < tmceilingz)
|
if (thing->z < tmceilingz)
|
||||||
{
|
{
|
||||||
tmceilingz = thing->z;
|
tmceilingz = thing->z;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmceilingslope = NULL;
|
tmceilingslope = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1820,17 +1804,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
&& tmthing->z > tmthing->floorz)
|
&& tmthing->z > tmthing->floorz)
|
||||||
{
|
{
|
||||||
tmfloorz = tmceilingz = topz; // block while in air
|
tmfloorz = tmceilingz = topz; // block while in air
|
||||||
#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;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmfloorslope = NULL;
|
tmfloorslope = NULL;
|
||||||
#endif
|
|
||||||
tmfloorthing = thing; // thing we may stand on
|
tmfloorthing = thing; // thing we may stand on
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1964,17 +1944,13 @@ if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a
|
||||||
{
|
{
|
||||||
tmceilingz = opentop;
|
tmceilingz = opentop;
|
||||||
ceilingline = ld;
|
ceilingline = ld;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmceilingslope = opentopslope;
|
tmceilingslope = opentopslope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (openbottom > tmfloorz)
|
if (openbottom > tmfloorz)
|
||||||
{
|
{
|
||||||
tmfloorz = openbottom;
|
tmfloorz = openbottom;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmfloorslope = openbottomslope;
|
tmfloorslope = openbottomslope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highceiling > tmdrpoffceilz)
|
if (highceiling > tmdrpoffceilz)
|
||||||
|
@ -2053,10 +2029,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||||
// will adjust them.
|
// will adjust them.
|
||||||
tmfloorz = tmdropoffz = P_GetFloorZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->floorheight;
|
tmfloorz = tmdropoffz = P_GetFloorZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->floorheight;
|
||||||
tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight;
|
tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight;
|
||||||
#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)
|
||||||
|
@ -2096,18 +2070,14 @@ 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;
|
||||||
#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)
|
||||||
{
|
{
|
||||||
if (tmceilingz > bottomheight + sinklevel) {
|
if (tmceilingz > bottomheight + sinklevel) {
|
||||||
tmceilingz = bottomheight + sinklevel;
|
tmceilingz = bottomheight + sinklevel;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmceilingslope = *rover->b_slope;
|
tmceilingslope = *rover->b_slope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2129,9 +2099,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;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmfloorslope = NULL;
|
tmfloorslope = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Quicksand blocks never change heights otherwise.
|
// Quicksand blocks never change heights otherwise.
|
||||||
|
@ -2147,18 +2115,14 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||||
&& !(rover->flags & FF_REVERSEPLATFORM))
|
&& !(rover->flags & FF_REVERSEPLATFORM))
|
||||||
{
|
{
|
||||||
tmfloorz = tmdropoffz = topheight;
|
tmfloorz = tmdropoffz = topheight;
|
||||||
#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)
|
||||||
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
|
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
|
||||||
{
|
{
|
||||||
tmceilingz = tmdrpoffceilz = bottomheight;
|
tmceilingz = tmdrpoffceilz = bottomheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmceilingslope = *rover->b_slope;
|
tmceilingslope = *rover->b_slope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2233,16 +2197,12 @@ 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
plink = (polymaplink_t *)(plink->link.next);
|
plink = (polymaplink_t *)(plink->link.next);
|
||||||
|
@ -2657,10 +2617,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
||||||
mobj_t *oldthing = tmthing;
|
mobj_t *oldthing = tmthing;
|
||||||
line_t *oldceilline = ceilingline;
|
line_t *oldceilline = ceilingline;
|
||||||
line_t *oldblockline = blockingline;
|
line_t *oldblockline = blockingline;
|
||||||
#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);
|
||||||
|
@ -2673,10 +2631,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
||||||
P_SetTarget(&tmthing, oldthing);
|
P_SetTarget(&tmthing, oldthing);
|
||||||
ceilingline = oldceilline;
|
ceilingline = oldceilline;
|
||||||
blockingline = oldblockline;
|
blockingline = oldblockline;
|
||||||
#ifdef ESLOPE
|
|
||||||
tmfloorslope = oldfslope;
|
tmfloorslope = oldfslope;
|
||||||
tmceilingslope = oldcslope;
|
tmceilingslope = oldcslope;
|
||||||
#endif
|
|
||||||
thing->momz = stand->momz;
|
thing->momz = stand->momz;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2698,9 +2654,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)
|
||||||
|
@ -2791,26 +2745,22 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
|
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
|
||||||
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->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)
|
||||||
{
|
{
|
||||||
thing->z = thing->floorz = tmfloorz;
|
thing->z = thing->floorz = tmfloorz;
|
||||||
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->eflags |= MFE_JUSTSTEPPEDDOWN;
|
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thing->eflags & MFE_VERTICALFLIP)
|
if (thing->eflags & MFE_VERTICALFLIP)
|
||||||
|
@ -2872,7 +2822,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
thing->floorz = tmfloorz;
|
thing->floorz = tmfloorz;
|
||||||
thing->ceilingz = tmceilingz;
|
thing->ceilingz = tmceilingz;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
if (!(thing->flags & MF_NOCLIPHEIGHT))
|
if (!(thing->flags & MF_NOCLIPHEIGHT))
|
||||||
{
|
{
|
||||||
// Assign thing's standingslope if needed
|
// Assign thing's standingslope if needed
|
||||||
|
@ -2893,7 +2842,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;
|
||||||
|
@ -4674,10 +4622,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)
|
||||||
|
@ -4697,12 +4643,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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -308,9 +308,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
|
|
||||||
|
|
||||||
// P_CameraLineOpening
|
// P_CameraLineOpening
|
||||||
// P_LineOpening, but for camera
|
// P_LineOpening, but for camera
|
||||||
|
@ -337,24 +335,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[0].x, camera[0].y);
|
frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera[0].x, camera[0].y);
|
||||||
if (sectors[front->camsec].c_slope)
|
if (sectors[front->camsec].c_slope)
|
||||||
frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera[0].x, camera[0].y);
|
frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera[0].x, camera[0].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[0].x, camera[0].y);
|
frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera[0].x, camera[0].y);
|
||||||
if (sectors[front->heightsec].c_slope)
|
if (sectors[front->heightsec].c_slope)
|
||||||
frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera[0].x, camera[0].y);
|
frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera[0].x, camera[0].y);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -365,23 +359,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[0].x, camera[0].y);
|
frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera[0].x, camera[0].y);
|
||||||
if (sectors[back->camsec].c_slope)
|
if (sectors[back->camsec].c_slope)
|
||||||
frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera[0].x, camera[0].y);
|
frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera[0].x, camera[0].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[0].x, camera[0].y);
|
frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera[0].x, camera[0].y);
|
||||||
if (sectors[back->heightsec].c_slope)
|
if (sectors[back->heightsec].c_slope)
|
||||||
frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera[0].x, camera[0].y);
|
frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera[0].x, camera[0].y);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -527,17 +517,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);
|
||||||
|
@ -547,17 +533,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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,10 +619,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
fixed_t highestfloor = openbottom;
|
fixed_t highestfloor = openbottom;
|
||||||
fixed_t lowestfloor = lowfloor;
|
fixed_t lowestfloor = lowfloor;
|
||||||
fixed_t delta1, delta2;
|
fixed_t delta1, delta2;
|
||||||
#ifdef ESLOPE
|
|
||||||
pslope_t *ceilingslope = opentopslope;
|
pslope_t *ceilingslope = opentopslope;
|
||||||
pslope_t *floorslope = openbottomslope;
|
pslope_t *floorslope = openbottomslope;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check for frontsector's fake floors
|
// Check for frontsector's fake floors
|
||||||
for (rover = front->ffloors; rover; rover = rover->next)
|
for (rover = front->ffloors; rover; rover = rover->next)
|
||||||
|
@ -665,9 +645,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
{
|
{
|
||||||
if (bottomheight < lowestceiling) {
|
if (bottomheight < lowestceiling) {
|
||||||
lowestceiling = bottomheight;
|
lowestceiling = bottomheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
ceilingslope = *rover->b_slope;
|
ceilingslope = *rover->b_slope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (bottomheight < highestceiling)
|
else if (bottomheight < highestceiling)
|
||||||
highestceiling = bottomheight;
|
highestceiling = bottomheight;
|
||||||
|
@ -677,9 +655,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
{
|
{
|
||||||
if (topheight > highestfloor) {
|
if (topheight > highestfloor) {
|
||||||
highestfloor = topheight;
|
highestfloor = topheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
floorslope = *rover->t_slope;
|
floorslope = *rover->t_slope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (topheight > lowestfloor)
|
else if (topheight > lowestfloor)
|
||||||
lowestfloor = topheight;
|
lowestfloor = topheight;
|
||||||
|
@ -709,9 +685,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
{
|
{
|
||||||
if (bottomheight < lowestceiling) {
|
if (bottomheight < lowestceiling) {
|
||||||
lowestceiling = bottomheight;
|
lowestceiling = bottomheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
ceilingslope = *rover->b_slope;
|
ceilingslope = *rover->b_slope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (bottomheight < highestceiling)
|
else if (bottomheight < highestceiling)
|
||||||
highestceiling = bottomheight;
|
highestceiling = bottomheight;
|
||||||
|
@ -721,9 +695,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
{
|
{
|
||||||
if (topheight > highestfloor) {
|
if (topheight > highestfloor) {
|
||||||
highestfloor = topheight;
|
highestfloor = topheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
floorslope = *rover->t_slope;
|
floorslope = *rover->t_slope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (topheight > lowestfloor)
|
else if (topheight > lowestfloor)
|
||||||
lowestfloor = topheight;
|
lowestfloor = topheight;
|
||||||
|
@ -740,18 +712,14 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
|
delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
|
||||||
if (polysec->floorheight < lowestceiling && delta1 >= delta2) {
|
if (polysec->floorheight < lowestceiling && delta1 >= delta2) {
|
||||||
lowestceiling = polysec->floorheight;
|
lowestceiling = polysec->floorheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
ceilingslope = NULL;
|
ceilingslope = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (polysec->floorheight < highestceiling && delta1 >= delta2)
|
else if (polysec->floorheight < highestceiling && delta1 >= delta2)
|
||||||
highestceiling = polysec->floorheight;
|
highestceiling = polysec->floorheight;
|
||||||
|
|
||||||
if (polysec->ceilingheight > highestfloor && delta1 < delta2) {
|
if (polysec->ceilingheight > highestfloor && delta1 < delta2) {
|
||||||
highestfloor = polysec->ceilingheight;
|
highestfloor = polysec->ceilingheight;
|
||||||
#ifdef ESLOPE
|
|
||||||
floorslope = NULL;
|
floorslope = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (polysec->ceilingheight > lowestfloor && delta1 < delta2)
|
else if (polysec->ceilingheight > lowestfloor && delta1 < delta2)
|
||||||
lowestfloor = polysec->ceilingheight;
|
lowestfloor = polysec->ceilingheight;
|
||||||
|
@ -762,16 +730,12 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
|
|
||||||
if (highestfloor > openbottom) {
|
if (highestfloor > openbottom) {
|
||||||
openbottom = highestfloor;
|
openbottom = highestfloor;
|
||||||
#ifdef ESLOPE
|
|
||||||
openbottomslope = floorslope;
|
openbottomslope = floorslope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lowestceiling < opentop) {
|
if (lowestceiling < opentop) {
|
||||||
opentop = lowestceiling;
|
opentop = lowestceiling;
|
||||||
#ifdef ESLOPE
|
|
||||||
opentopslope = ceilingslope;
|
opentopslope = ceilingslope;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lowestfloor > lowfloor)
|
if (lowestfloor > 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
|
|
||||||
|
|
||||||
void P_LineOpening(line_t *plinedef, mobj_t *mobj);
|
void P_LineOpening(line_t *plinedef, mobj_t *mobj);
|
||||||
|
|
||||||
|
|
154
src/p_mobj.c
154
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 "k_kart.h"
|
#include "k_kart.h"
|
||||||
|
|
||||||
|
@ -646,12 +644,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;
|
||||||
|
@ -662,7 +658,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
|
||||||
|
@ -766,15 +761,11 @@ 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;
|
||||||
|
@ -844,25 +835,13 @@ 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;
|
||||||
|
@ -932,26 +911,14 @@ 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;
|
||||||
|
@ -1021,25 +988,13 @@ 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;
|
||||||
|
@ -1109,15 +1064,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)
|
||||||
|
@ -1406,9 +1352,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
|
||||||
|
@ -1556,11 +1500,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));
|
||||||
|
@ -1590,7 +1532,6 @@ void P_XYMovement(mobj_t *mo)
|
||||||
oldx = mo->x;
|
oldx = mo->x;
|
||||||
oldy = mo->y;
|
oldy = mo->y;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
// adjust various things based on slope
|
// adjust various things based on slope
|
||||||
if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8) {
|
if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8) {
|
||||||
if (!P_IsObjectOnGround(mo)) { // We fell off at some point? Do the twisty thing!
|
if (!P_IsObjectOnGround(mo)) { // We fell off at some point? Do the twisty thing!
|
||||||
|
@ -1612,7 +1553,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)
|
if (CheckForBustableBlocks && mo->flags & MF_PUSHABLE)
|
||||||
|
@ -1799,7 +1739,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) { // Check to see if we ran off
|
if (moved && oldslope) { // Check to see if we ran off
|
||||||
|
|
||||||
if (oldslope != mo->standingslope) { // First, compare different slopes
|
if (oldslope != mo->standingslope) { // First, compare different slopes
|
||||||
|
@ -1847,7 +1786,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);
|
||||||
|
@ -1898,11 +1836,9 @@ void P_XYMovement(mobj_t *mo)
|
||||||
if (player && player->pflags & PF_NIGHTSMODE)
|
if (player && player->pflags & PF_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
|
|
||||||
|
|
||||||
//{ SRB2kart stuff
|
//{ SRB2kart stuff
|
||||||
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
|
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
|
||||||
|
@ -2140,9 +2076,7 @@ boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
|
||||||
|
|
||||||
{
|
{
|
||||||
fixed_t topheight =
|
fixed_t topheight =
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->t_slope ? 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 (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
||||||
|
@ -2179,7 +2113,6 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
}
|
}
|
||||||
mo->z += mo->momz;
|
mo->z += mo->momz;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
if (mo->standingslope)
|
if (mo->standingslope)
|
||||||
{
|
{
|
||||||
if (mo->flags & MF_NOCLIPHEIGHT)
|
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||||
|
@ -2187,7 +2120,6 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
else if (!P_IsObjectOnGround(mo))
|
else if (!P_IsObjectOnGround(mo))
|
||||||
P_SlopeLaunch(mo);
|
P_SlopeLaunch(mo);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (mo->type)
|
switch (mo->type)
|
||||||
{
|
{
|
||||||
|
@ -2378,7 +2310,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;
|
||||||
|
@ -2391,7 +2322,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
|
||||||
|
@ -2491,13 +2421,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;
|
||||||
|
@ -2543,11 +2471,9 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
|| tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER))
|
|| tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER))
|
||||||
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;
|
||||||
|
@ -2665,7 +2591,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)
|
||||||
|
@ -2673,7 +2598,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||||
else if (!P_IsObjectOnGround(mo))
|
else if (!P_IsObjectOnGround(mo))
|
||||||
P_SlopeLaunch(mo);
|
P_SlopeLaunch(mo);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// clip movement
|
// clip movement
|
||||||
if (P_IsObjectOnGround(mo) && !(mo->flags & MF_NOCLIPHEIGHT))
|
if (P_IsObjectOnGround(mo) && !(mo->flags & MF_NOCLIPHEIGHT))
|
||||||
|
@ -2702,19 +2626,15 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||||
&& mo->player->kartstuff[k_spinouttimer] == 0 && mo->player->kartstuff[k_squishedtimer] == 0) // SRB2kart
|
&& mo->player->kartstuff[k_spinouttimer] == 0 && mo->player->kartstuff[k_squishedtimer] == 0) // SRB2kart
|
||||||
P_SetPlayerMobjState(mo, S_KART_STND1);
|
P_SetPlayerMobjState(mo, S_KART_STND1);
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
#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
|
||||||
{
|
{
|
||||||
|
@ -2961,7 +2881,6 @@ static boolean P_SceneryZMovement(mobj_t *mo)
|
||||||
// set standingslope
|
// set standingslope
|
||||||
P_TryMove(mo, mo->x, mo->y, true);
|
P_TryMove(mo, mo->x, mo->y, true);
|
||||||
mo->momz = -mo->momz;
|
mo->momz = -mo->momz;
|
||||||
#ifdef ESLOPE
|
|
||||||
if (mo->standingslope)
|
if (mo->standingslope)
|
||||||
{
|
{
|
||||||
if (mo->flags & MF_NOCLIPHEIGHT)
|
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||||
|
@ -2969,7 +2888,6 @@ static boolean P_SceneryZMovement(mobj_t *mo)
|
||||||
else if (!P_IsObjectOnGround(mo))
|
else if (!P_IsObjectOnGround(mo))
|
||||||
P_SlopeLaunch(mo);
|
P_SlopeLaunch(mo);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
S_StartSound(mo, mo->info->activesound);
|
S_StartSound(mo, mo->info->activesound);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3138,13 +3056,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)
|
||||||
{
|
{
|
||||||
|
@ -3387,13 +3303,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 + FixedMul(mobj->info->height >> 1, mobj->scale)))
|
|| bottomheight > (mobj->z + FixedMul(mobj->info->height >> 1, mobj->scale)))
|
||||||
|
@ -3439,13 +3353,9 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (halfheight >= (
|
if (halfheight >= (
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
|
*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
|
||||||
#endif
|
|
||||||
*rover->topheight) || halfheight <= (
|
*rover->topheight) || 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;
|
||||||
|
|
||||||
|
@ -3475,13 +3385,9 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (halfheight >= (
|
if (halfheight >= (
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
|
*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
|
||||||
#endif
|
|
||||||
*rover->topheight) || halfheight <= (
|
*rover->topheight) || 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;
|
||||||
|
|
||||||
|
@ -3681,9 +3587,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;
|
||||||
|
@ -3840,9 +3744,7 @@ static void CalculatePrecipFloor(precipmobj_t *mobj)
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
mobj->floorz =
|
mobj->floorz =
|
||||||
#ifdef ESLOPE
|
|
||||||
mobjsecsubsec->f_slope ? 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)
|
||||||
{
|
{
|
||||||
|
@ -3858,11 +3760,9 @@ 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)
|
||||||
|
@ -9343,7 +9243,6 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
||||||
mobj->eflags &= ~MFE_JUSTHITFLOOR;
|
mobj->eflags &= ~MFE_JUSTHITFLOOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESLOPE // Sliding physics for slidey mobjs!
|
|
||||||
if (mobj->type == MT_FLINGRING
|
if (mobj->type == MT_FLINGRING
|
||||||
|| mobj->type == MT_FLINGCOIN
|
|| mobj->type == MT_FLINGCOIN
|
||||||
|| P_WeaponOrPanel(mobj->type)
|
|| P_WeaponOrPanel(mobj->type)
|
||||||
|
@ -9356,7 +9255,6 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
||||||
//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
|
||||||
|
@ -9660,14 +9558,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
P_SetScale(mobj, mobj->destscale);
|
P_SetScale(mobj, mobj->destscale);
|
||||||
|
|
||||||
mobj->floorz =
|
mobj->floorz =
|
||||||
#ifdef ESLOPE
|
|
||||||
mobj->subsector->sector->f_slope ? 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 =
|
||||||
#ifdef ESLOPE
|
|
||||||
mobj->subsector->sector->c_slope ? 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;
|
||||||
|
|
||||||
// Tells MobjCheckWater that the water height was not set.
|
// Tells MobjCheckWater that the water height was not set.
|
||||||
|
@ -10184,14 +10078,10 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
|
||||||
P_SetPrecipitationThingPosition(mobj);
|
P_SetPrecipitationThingPosition(mobj);
|
||||||
|
|
||||||
mobj->floorz = starting_floorz =
|
mobj->floorz = starting_floorz =
|
||||||
#ifdef ESLOPE
|
|
||||||
mobj->subsector->sector->f_slope ? 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 =
|
||||||
#ifdef ESLOPE
|
|
||||||
mobj->subsector->sector->c_slope ? 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->z = z;
|
mobj->z = z;
|
||||||
|
@ -10710,9 +10600,7 @@ void P_RespawnSpecials(void)
|
||||||
if (mthing->options & MTF_OBJECTFLIP)
|
if (mthing->options & MTF_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->ceilingheight) - (mthing->options >> ZSHIFT) * FRACUNIT;
|
ss->sector->ceilingheight) - (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||||
if (mthing->options & MTF_AMBUSH
|
if (mthing->options & MTF_AMBUSH
|
||||||
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
||||||
|
@ -10722,9 +10610,7 @@ void P_RespawnSpecials(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->floorheight) + (mthing->options >> ZSHIFT) * FRACUNIT;
|
ss->sector->floorheight) + (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||||
if (mthing->options & MTF_AMBUSH
|
if (mthing->options & MTF_AMBUSH
|
||||||
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
||||||
|
@ -10981,14 +10867,10 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
||||||
sector = R_PointInSubsector(x, y)->sector;
|
sector = R_PointInSubsector(x, y)->sector;
|
||||||
|
|
||||||
floor =
|
floor =
|
||||||
#ifdef ESLOPE
|
|
||||||
sector->f_slope ? P_GetZAt(sector->f_slope, x, y) :
|
sector->f_slope ? P_GetZAt(sector->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sector->floorheight;
|
sector->floorheight;
|
||||||
ceiling =
|
ceiling =
|
||||||
#ifdef ESLOPE
|
|
||||||
sector->c_slope ? P_GetZAt(sector->c_slope, x, y) :
|
sector->c_slope ? P_GetZAt(sector->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
sector->ceilingheight;
|
sector->ceilingheight;
|
||||||
|
|
||||||
if (mthing)
|
if (mthing)
|
||||||
|
@ -11060,14 +10942,10 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
||||||
sector = R_PointInSubsector(mobj->x, mobj->y)->sector;
|
sector = R_PointInSubsector(mobj->x, mobj->y)->sector;
|
||||||
|
|
||||||
floor =
|
floor =
|
||||||
#ifdef ESLOPE
|
|
||||||
sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) :
|
sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) :
|
||||||
#endif
|
|
||||||
sector->floorheight;
|
sector->floorheight;
|
||||||
ceiling =
|
ceiling =
|
||||||
#ifdef ESLOPE
|
|
||||||
sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) :
|
sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) :
|
||||||
#endif
|
|
||||||
sector->ceilingheight;
|
sector->ceilingheight;
|
||||||
|
|
||||||
if (mobj->player->kartstuff[k_starpostflip])
|
if (mobj->player->kartstuff[k_starpostflip])
|
||||||
|
@ -11242,9 +11120,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
|
|
||||||
ss = R_PointInSubsector(mthing->x << FRACBITS, mthing->y << FRACBITS);
|
ss = R_PointInSubsector(mthing->x << FRACBITS, mthing->y << FRACBITS);
|
||||||
mthing->z = (INT16)(((
|
mthing->z = (INT16)(((
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, mthing->x << FRACBITS, mthing->y << FRACBITS) :
|
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, mthing->x << FRACBITS, mthing->y << FRACBITS) :
|
||||||
#endif
|
|
||||||
ss->sector->floorheight)>>FRACBITS) + (mthing->options >> ZSHIFT));
|
ss->sector->floorheight)>>FRACBITS) + (mthing->options >> ZSHIFT));
|
||||||
|
|
||||||
if (numhuntemeralds < MAXHUNTEMERALDS)
|
if (numhuntemeralds < MAXHUNTEMERALDS)
|
||||||
|
@ -11360,9 +11236,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
|
|
||||||
if (i == MT_NIGHTSBUMPER)
|
if (i == MT_NIGHTSBUMPER)
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->floorheight) + ((mthing->options >> ZSHIFT) << FRACBITS);
|
ss->sector->floorheight) + ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
else if (i == MT_AXIS || i == MT_AXISTRANSFER || i == MT_AXISTRANSFERLINE)
|
else if (i == MT_AXIS || i == MT_AXISTRANSFER || i == MT_AXISTRANSFERLINE)
|
||||||
z = ONFLOORZ;
|
z = ONFLOORZ;
|
||||||
|
@ -11371,9 +11245,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
if (mthing->options & MTF_OBJECTFLIP)
|
if (mthing->options & MTF_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->ceilingheight);
|
ss->sector->ceilingheight);
|
||||||
|
|
||||||
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
||||||
|
@ -11386,9 +11258,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->floorheight);
|
ss->sector->floorheight);
|
||||||
|
|
||||||
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
||||||
|
@ -11410,15 +11280,11 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
// base positions
|
// base positions
|
||||||
if (flip)
|
if (flip)
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->ceilingheight) - mobjinfo[i].height;
|
ss->sector->ceilingheight) - mobjinfo[i].height;
|
||||||
else
|
else
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
ss->sector->floorheight);
|
ss->sector->floorheight);
|
||||||
|
|
||||||
// offsetting
|
// offsetting
|
||||||
|
@ -11985,9 +11851,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
//hoopcenter->flags |= MF_NOTHINK;
|
//hoopcenter->flags |= MF_NOTHINK;
|
||||||
|
|
||||||
z +=
|
z +=
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight;
|
sec->floorheight;
|
||||||
|
|
||||||
hoopcenter->z = z - hoopcenter->height/2;
|
hoopcenter->z = z - hoopcenter->height/2;
|
||||||
|
@ -12128,9 +11992,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
hoopcenter->spawnpoint = mthing;
|
hoopcenter->spawnpoint = mthing;
|
||||||
|
|
||||||
z +=
|
z +=
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight;
|
sec->floorheight;
|
||||||
hoopcenter->z = z - hoopcenter->height/2;
|
hoopcenter->z = z - hoopcenter->height/2;
|
||||||
|
|
||||||
|
@ -12250,9 +12112,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
else if (mthing->type == mobjinfo[MT_NIGHTSWING].doomednum)
|
else if (mthing->type == mobjinfo[MT_NIGHTSWING].doomednum)
|
||||||
{
|
{
|
||||||
z =
|
z =
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight;
|
sec->floorheight;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12304,9 +12164,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
if (mthing->options & MTF_OBJECTFLIP)
|
if (mthing->options & MTF_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->ceilingheight) - mobjinfo[ringthing].height;
|
sec->ceilingheight) - mobjinfo[ringthing].height;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12314,9 +12172,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
z =
|
z =
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight;
|
sec->floorheight;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12370,9 +12226,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
if (mthing->options & MTF_OBJECTFLIP)
|
if (mthing->options & MTF_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->ceilingheight) - mobjinfo[ringthing].height - dist*r;
|
sec->ceilingheight) - mobjinfo[ringthing].height - dist*r;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12380,9 +12234,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight) + dist*r;
|
sec->floorheight) + dist*r;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12428,9 +12280,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
if (mthing->options & MTF_OBJECTFLIP)
|
if (mthing->options & MTF_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->ceilingheight) - mobjinfo[ringthing].height - 64*FRACUNIT*r;
|
sec->ceilingheight) - mobjinfo[ringthing].height - 64*FRACUNIT*r;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12438,9 +12288,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
z = (
|
z = (
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight) + 64*FRACUNIT*r;
|
sec->floorheight) + 64*FRACUNIT*r;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
@ -12473,9 +12321,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||||
}
|
}
|
||||||
|
|
||||||
z =
|
z =
|
||||||
#ifdef ESLOPE
|
|
||||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||||
#endif
|
|
||||||
sec->floorheight;
|
sec->floorheight;
|
||||||
if (mthing->options >> ZSHIFT)
|
if (mthing->options >> ZSHIFT)
|
||||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||||
|
|
|
@ -368,9 +368,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
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,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;
|
||||||
|
@ -949,9 +947,7 @@ typedef enum
|
||||||
MD2_HPREV = 1<<8,
|
MD2_HPREV = 1<<8,
|
||||||
MD2_COLORIZED = 1<<9,
|
MD2_COLORIZED = 1<<9,
|
||||||
MD2_WAYPOINTCAP = 1<<10
|
MD2_WAYPOINTCAP = 1<<10
|
||||||
#ifdef ESLOPE
|
|
||||||
, MD2_SLOPE = 1<<11
|
, MD2_SLOPE = 1<<11
|
||||||
#endif
|
|
||||||
} mobj_diff2_t;
|
} mobj_diff2_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -1142,10 +1138,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
diff2 |= MD2_HNEXT;
|
diff2 |= MD2_HNEXT;
|
||||||
if (mobj->hprev)
|
if (mobj->hprev)
|
||||||
diff2 |= MD2_HPREV;
|
diff2 |= MD2_HPREV;
|
||||||
#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 == waypointcap)
|
if (mobj == waypointcap)
|
||||||
|
@ -1265,10 +1259,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);
|
||||||
|
|
||||||
|
@ -2142,10 +2134,8 @@ static void 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);
|
||||||
|
|
||||||
|
|
|
@ -78,9 +78,7 @@
|
||||||
#include "hardware/hw_light.h"
|
#include "hardware/hw_light.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
#include "p_slopes.h"
|
#include "p_slopes.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
// SRB2Kart
|
// SRB2Kart
|
||||||
#include "k_kart.h"
|
#include "k_kart.h"
|
||||||
|
@ -1004,9 +1002,7 @@ static void P_LoadThings(void)
|
||||||
|
|
||||||
// Z for objects
|
// Z for objects
|
||||||
mt->z = (INT16)(
|
mt->z = (INT16)(
|
||||||
#ifdef ESLOPE
|
|
||||||
mtsector->f_slope ? P_GetZAt(mtsector->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) :
|
mtsector->f_slope ? P_GetZAt(mtsector->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) :
|
||||||
#endif
|
|
||||||
mtsector->floorheight)>>FRACBITS;
|
mtsector->floorheight)>>FRACBITS;
|
||||||
|
|
||||||
if (mt->type == 1700 // MT_AXIS
|
if (mt->type == 1700 // MT_AXIS
|
||||||
|
@ -3116,9 +3112,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
P_ResetDynamicSlopes();
|
P_ResetDynamicSlopes();
|
||||||
#endif
|
|
||||||
|
|
||||||
P_LoadThings();
|
P_LoadThings();
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "p_maputl.h"
|
#include "p_maputl.h"
|
||||||
#include "w_wad.h"
|
#include "w_wad.h"
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
|
|
||||||
static pslope_t *slopelist = NULL;
|
static pslope_t *slopelist = NULL;
|
||||||
static UINT16 slopecount = 0;
|
static UINT16 slopecount = 0;
|
||||||
|
@ -620,7 +619,6 @@ void P_ResetDynamicSlopes(void) {
|
||||||
size_t i;
|
size_t i;
|
||||||
#ifdef ESLOPE_TYPESHIM // Rewrite old specials to new ones, and give a console warning
|
#ifdef ESLOPE_TYPESHIM // Rewrite old specials to new ones, and give a console warning
|
||||||
boolean warned = false;
|
boolean warned = false;
|
||||||
#endif
|
|
||||||
|
|
||||||
slopelist = NULL;
|
slopelist = NULL;
|
||||||
slopecount = 0;
|
slopecount = 0;
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#ifndef P_SLOPES_H__
|
#ifndef P_SLOPES_H__
|
||||||
#define P_SLOPES_H__
|
#define P_SLOPES_H__
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
void P_CalculateSlopeNormal(pslope_t *slope);
|
void P_CalculateSlopeNormal(pslope_t *slope);
|
||||||
void P_ResetDynamicSlopes(void);
|
void P_ResetDynamicSlopes(void);
|
||||||
void P_RunDynamicSlopes(void);
|
void P_RunDynamicSlopes(void);
|
||||||
|
@ -41,7 +40,6 @@ void P_SlopeLaunch(mobj_t *mo);
|
||||||
void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope);
|
void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope);
|
||||||
void P_ButteredSlope(mobj_t *mo);
|
void P_ButteredSlope(mobj_t *mo);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
#endif // #ifdef ESLOPE
|
#endif // #ifdef ESLOPE
|
||||||
|
|
12
src/p_spec.c
12
src/p_spec.c
|
@ -4984,10 +4984,8 @@ void P_UpdateSpecials(void)
|
||||||
// POINT LIMIT
|
// POINT LIMIT
|
||||||
P_CheckPointLimit();
|
P_CheckPointLimit();
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
// Dynamic slopeness
|
// Dynamic slopeness
|
||||||
P_RunDynamicSlopes();
|
P_RunDynamicSlopes();
|
||||||
#endif
|
|
||||||
|
|
||||||
// ANIMATE TEXTURES
|
// ANIMATE TEXTURES
|
||||||
for (anim = anims; anim < lastanim; anim++)
|
for (anim = anims; anim < lastanim; anim++)
|
||||||
|
@ -5132,11 +5130,9 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
ffloor->topyoffs = &sec2->ceiling_yoffs;
|
ffloor->topyoffs = &sec2->ceiling_yoffs;
|
||||||
ffloor->topangle = &sec2->ceilingpic_angle;
|
ffloor->topangle = &sec2->ceilingpic_angle;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
// Add slopes
|
// Add slopes
|
||||||
ffloor->t_slope = &sec2->c_slope;
|
ffloor->t_slope = &sec2->c_slope;
|
||||||
ffloor->b_slope = &sec2->f_slope;
|
ffloor->b_slope = &sec2->f_slope;
|
||||||
#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;
|
||||||
|
@ -5583,15 +5579,11 @@ void T_LaserFlash(laserthink_t *flash)
|
||||||
|
|
||||||
sourcesec = ffloor->master->frontsector; // Less to type!
|
sourcesec = ffloor->master->frontsector; // Less to type!
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
top = (*ffloor->t_slope) ? P_GetZAt(*ffloor->t_slope, sector->soundorg.x, sector->soundorg.y)
|
top = (*ffloor->t_slope) ? P_GetZAt(*ffloor->t_slope, sector->soundorg.x, sector->soundorg.y)
|
||||||
: *ffloor->topheight;
|
: *ffloor->topheight;
|
||||||
bottom = (*ffloor->b_slope) ? P_GetZAt(*ffloor->b_slope, sector->soundorg.x, sector->soundorg.y)
|
bottom = (*ffloor->b_slope) ? P_GetZAt(*ffloor->b_slope, sector->soundorg.x, sector->soundorg.y)
|
||||||
: *ffloor->bottomheight;
|
: *ffloor->bottomheight;
|
||||||
sector->soundorg.z = (top + bottom)/2;
|
sector->soundorg.z = (top + bottom)/2;
|
||||||
#else
|
|
||||||
sector->soundorg.z = (*ffloor->topheight + *ffloor->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*
|
||||||
|
@ -6688,13 +6680,11 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
sectors[s].midmap = lines[i].frontsector->midmap;
|
sectors[s].midmap = lines[i].frontsector->midmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef ESLOPE // Slope copy specials. Handled here for sanity.
|
|
||||||
case 720:
|
case 720:
|
||||||
case 721:
|
case 721:
|
||||||
case 722:
|
case 722:
|
||||||
P_CopySectorSlope(&lines[i]);
|
P_CopySectorSlope(&lines[i]);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -7246,11 +7236,9 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
88
src/p_user.c
88
src/p_user.c
|
@ -1781,13 +1781,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;
|
||||||
|
@ -1821,13 +1816,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;
|
||||||
|
@ -1966,9 +1956,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;
|
||||||
|
@ -2023,7 +2011,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;
|
||||||
|
@ -2039,9 +2026,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))
|
||||||
{
|
{
|
||||||
|
@ -2064,7 +2048,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)
|
||||||
|
@ -2073,9 +2056,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)
|
||||||
{
|
{
|
||||||
|
@ -2132,13 +2112,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)
|
||||||
{
|
{
|
||||||
|
@ -2506,15 +2481,10 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -2528,13 +2498,8 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
||||||
|
|
||||||
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)
|
||||||
|
@ -2575,11 +2540,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
||||||
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;
|
||||||
|
@ -2625,11 +2586,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
||||||
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;
|
||||||
|
@ -2684,11 +2641,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
||||||
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))
|
||||||
{
|
{
|
||||||
|
@ -2729,11 +2682,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
||||||
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))
|
||||||
{
|
{
|
||||||
|
@ -3102,12 +3051,10 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -3118,13 +3065,8 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
|
||||||
{
|
{
|
||||||
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(player->mo, rover))
|
if (P_CheckSolidLava(player->mo, rover))
|
||||||
;
|
;
|
||||||
|
@ -3583,9 +3525,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
||||||
&& !P_PlayerInPain(player)) // subsequent revs
|
&& !P_PlayerInPain(player)) // subsequent revs
|
||||||
{
|
{
|
||||||
if ((cmd->buttons & BT_BRAKE) && player->speed < FixedMul(5<<FRACBITS, player->mo->scale) && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING)
|
if ((cmd->buttons & BT_BRAKE) && player->speed < FixedMul(5<<FRACBITS, player->mo->scale) && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) && !(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
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
player->mo->momx = player->cmomx;
|
player->mo->momx = player->cmomx;
|
||||||
|
@ -3616,9 +3556,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
||||||
// AKA Just go into a spin on the ground, you idiot. ;)
|
// AKA Just go into a spin on the ground, you idiot. ;)
|
||||||
else if ((cmd->buttons & BT_BRAKE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20))
|
else if ((cmd->buttons & BT_BRAKE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20))
|
||||||
&& !player->climbing && !player->mo->momz && onground && (player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
|
&& !player->climbing && !player->mo->momz && onground && (player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
|
||||||
#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
|
|
||||||
) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING))
|
) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING))
|
||||||
{
|
{
|
||||||
player->pflags |= PF_SPINNING;
|
player->pflags |= PF_SPINNING;
|
||||||
|
@ -3632,9 +3570,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
||||||
// Rolling normally
|
// Rolling normally
|
||||||
if (onground && player->pflags & PF_SPINNING && !(player->pflags & PF_STARTDASH)
|
if (onground && player->pflags & PF_SPINNING && !(player->pflags & PF_STARTDASH)
|
||||||
&& player->speed < FixedMul(5*FRACUNIT,player->mo->scale)
|
&& player->speed < FixedMul(5*FRACUNIT,player->mo->scale)
|
||||||
#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 (GETSECSPECIAL(player->mo->subsector->sector->special, 4) == 7 || (player->mo->ceilingz - player->mo->floorz < P_GetPlayerHeight(player)))
|
if (GETSECSPECIAL(player->mo->subsector->sector->special, 4) == 7 || (player->mo->ceilingz - player->mo->floorz < P_GetPlayerHeight(player)))
|
||||||
|
@ -4023,12 +3959,10 @@ static void P_3dMovement(player_t *player)
|
||||||
//fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
//fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
||||||
boolean analogmove = false;
|
boolean analogmove = false;
|
||||||
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);
|
||||||
|
@ -4152,12 +4086,8 @@ static void P_3dMovement(player_t *player)
|
||||||
movepushforward = 0;
|
movepushforward = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#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
|
|
||||||
}
|
}
|
||||||
else if (!(player->kartstuff[k_spinouttimer]))
|
else if (!(player->kartstuff[k_spinouttimer]))
|
||||||
{
|
{
|
||||||
|
@ -4172,15 +4102,10 @@ static void P_3dMovement(player_t *player)
|
||||||
else
|
else
|
||||||
movepushside = (cmd->sidemove * FRACUNIT/128) - FixedDiv(player->speed, K_GetKartSpeed(player, true));
|
movepushside = (cmd->sidemove * FRACUNIT/128) - FixedDiv(player->speed, K_GetKartSpeed(player, true));
|
||||||
|
|
||||||
#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!
|
||||||
|
@ -4200,7 +4125,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?
|
||||||
|
@ -5601,14 +5525,12 @@ void P_ElementalFireTrail(player_t *player)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
@ -8204,13 +8126,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;
|
||||||
|
@ -8232,13 +8149,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;
|
||||||
|
|
70
src/r_bsp.c
70
src/r_bsp.c
|
@ -376,10 +376,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!
|
||||||
|
@ -494,7 +492,6 @@ static void R_AddLine(seg_t *line)
|
||||||
doorclosed = 0;
|
doorclosed = 0;
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -537,7 +534,6 @@ static void R_AddLine(seg_t *line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (viewsector != backsector && viewsector != frontsector)
|
if (viewsector != backsector && viewsector != frontsector)
|
||||||
{
|
{
|
||||||
|
@ -860,15 +856,11 @@ static void R_Subsector(size_t num)
|
||||||
floorcolormap = ceilingcolormap = frontsector->extra_colormap;
|
floorcolormap = ceilingcolormap = frontsector->extra_colormap;
|
||||||
|
|
||||||
floorcenterz =
|
floorcenterz =
|
||||||
#ifdef ESLOPE
|
|
||||||
frontsector->f_slope ? 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 =
|
||||||
#ifdef ESLOPE
|
|
||||||
frontsector->c_slope ? 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.
|
||||||
|
@ -896,9 +888,7 @@ static void R_Subsector(size_t num)
|
||||||
sub->sector->extra_colormap = frontsector->extra_colormap;
|
sub->sector->extra_colormap = frontsector->extra_colormap;
|
||||||
|
|
||||||
if (((
|
if (((
|
||||||
#ifdef ESLOPE
|
|
||||||
frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) :
|
frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) :
|
||||||
#endif
|
|
||||||
frontsector->floorheight) < viewz || (frontsector->heightsec != -1
|
frontsector->floorheight) < viewz || (frontsector->heightsec != -1
|
||||||
&& sectors[frontsector->heightsec].ceilingpic == skyflatnum)))
|
&& sectors[frontsector->heightsec].ceilingpic == skyflatnum)))
|
||||||
{
|
{
|
||||||
|
@ -907,18 +897,14 @@ static void R_Subsector(size_t num)
|
||||||
#ifdef POLYOBJECTS_PLANES
|
#ifdef POLYOBJECTS_PLANES
|
||||||
, NULL
|
, NULL
|
||||||
#endif
|
#endif
|
||||||
#ifdef ESLOPE
|
|
||||||
, frontsector->f_slope
|
, frontsector->f_slope
|
||||||
#endif
|
|
||||||
, R_NoEncore(frontsector, false));
|
, R_NoEncore(frontsector, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
floorplane = NULL;
|
floorplane = NULL;
|
||||||
|
|
||||||
if (((
|
if (((
|
||||||
#ifdef ESLOPE
|
|
||||||
frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) :
|
frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) :
|
||||||
#endif
|
|
||||||
frontsector->ceilingheight) > viewz || frontsector->ceilingpic == skyflatnum
|
frontsector->ceilingheight) > viewz || frontsector->ceilingpic == skyflatnum
|
||||||
|| (frontsector->heightsec != -1
|
|| (frontsector->heightsec != -1
|
||||||
&& sectors[frontsector->heightsec].floorpic == skyflatnum)))
|
&& sectors[frontsector->heightsec].floorpic == skyflatnum)))
|
||||||
|
@ -929,18 +915,14 @@ 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
|
|
||||||
, R_NoEncore(frontsector, true));
|
, R_NoEncore(frontsector, true));
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
@ -966,15 +948,11 @@ static void R_Subsector(size_t num)
|
||||||
ffloor[numffloors].polyobj = NULL;
|
ffloor[numffloors].polyobj = NULL;
|
||||||
|
|
||||||
heightcheck =
|
heightcheck =
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) :
|
*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) :
|
||||||
#endif
|
|
||||||
*rover->bottomheight;
|
*rover->bottomheight;
|
||||||
|
|
||||||
planecenterz =
|
planecenterz =
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->b_slope ? 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
|
||||||
|
@ -990,18 +968,14 @@ 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
|
|
||||||
, R_NoEncore(rover->master->frontsector, true));
|
, R_NoEncore(rover->master->frontsector, true));
|
||||||
|
|
||||||
#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;
|
||||||
|
@ -1013,15 +987,11 @@ static void R_Subsector(size_t num)
|
||||||
ffloor[numffloors].polyobj = NULL;
|
ffloor[numffloors].polyobj = NULL;
|
||||||
|
|
||||||
heightcheck =
|
heightcheck =
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) :
|
*rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) :
|
||||||
#endif
|
|
||||||
*rover->topheight;
|
*rover->topheight;
|
||||||
|
|
||||||
planecenterz =
|
planecenterz =
|
||||||
#ifdef ESLOPE
|
|
||||||
*rover->t_slope ? 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
|
||||||
|
@ -1036,18 +1006,14 @@ 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
|
|
||||||
, R_NoEncore(rover->master->frontsector, false));
|
, R_NoEncore(rover->master->frontsector, false));
|
||||||
|
|
||||||
#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;
|
||||||
|
@ -1086,16 +1052,12 @@ static void R_Subsector(size_t num)
|
||||||
polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
|
polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
|
||||||
polysec->floorpic_angle-po->angle,
|
polysec->floorpic_angle-po->angle,
|
||||||
NULL, NULL, po
|
NULL, NULL, po
|
||||||
#ifdef ESLOPE
|
|
||||||
, NULL // will ffloors be slopable eventually?
|
, NULL // will ffloors be slopable eventually?
|
||||||
#endif
|
|
||||||
, R_NoEncore(polysec, false));
|
, R_NoEncore(polysec, false));
|
||||||
|
|
||||||
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++;
|
||||||
|
@ -1115,16 +1077,12 @@ static void R_Subsector(size_t num)
|
||||||
polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs,
|
polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs,
|
||||||
polysec->ceilingpic_angle-po->angle,
|
polysec->ceilingpic_angle-po->angle,
|
||||||
NULL, NULL, po
|
NULL, NULL, po
|
||||||
#ifdef ESLOPE
|
|
||||||
, NULL // will ffloors be slopable eventually?
|
, NULL // will ffloors be slopable eventually?
|
||||||
#endif
|
|
||||||
, R_NoEncore(polysec, true));
|
, R_NoEncore(polysec, true));
|
||||||
|
|
||||||
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++;
|
||||||
|
@ -1186,11 +1144,9 @@ void R_Prep3DFloors(sector_t *sector)
|
||||||
fixed_t bestheight, maxheight;
|
fixed_t bestheight, maxheight;
|
||||||
INT32 count, i, mapnum;
|
INT32 count, i, mapnum;
|
||||||
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)
|
||||||
|
@ -1213,14 +1169,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 = sector->extra_colormap;
|
sector->lightlist[0].extra_colormap = sector->extra_colormap;
|
||||||
|
@ -1238,7 +1190,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)
|
||||||
|
@ -1260,21 +1211,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)
|
||||||
{
|
{
|
||||||
|
@ -1285,9 +1221,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];
|
||||||
mapnum = sec->midmap;
|
mapnum = sec->midmap;
|
||||||
if (mapnum >= 0 && (size_t)mapnum < num_extra_colormaps)
|
if (mapnum >= 0 && (size_t)mapnum < num_extra_colormaps)
|
||||||
|
@ -1313,12 +1247,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
|
@ -155,11 +155,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;
|
||||||
|
@ -190,9 +188,7 @@ typedef struct lightlist_s
|
||||||
extracolormap_t *extra_colormap;
|
extracolormap_t *extra_colormap;
|
||||||
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;
|
||||||
|
|
||||||
|
|
||||||
|
@ -226,7 +222,6 @@ typedef struct linechain_s
|
||||||
|
|
||||||
|
|
||||||
// Slopes
|
// Slopes
|
||||||
#ifdef ESLOPE
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SL_NOPHYSICS = 1, // Don't do momentum adjustment with this slope
|
SL_NOPHYSICS = 1, // Don't do momentum adjustment with this slope
|
||||||
SL_NODYNAMIC = 1<<1, // Slope will never need to move during the level, so don't fuss with recalculating it
|
SL_NODYNAMIC = 1<<1, // Slope will never need to move during the level, so don't fuss with recalculating it
|
||||||
|
@ -269,7 +264,6 @@ typedef struct pslope_s
|
||||||
|
|
||||||
struct pslope_s *next; // Make a linked list of dynamic slopes, for easy reference later
|
struct pslope_s *next; // Make a linked list of dynamic slopes, for easy reference later
|
||||||
} pslope_t;
|
} pslope_t;
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -376,12 +370,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
|
|
||||||
|
|
||||||
// these are saved for netgames, so do not let Lua touch these!
|
// these are saved for netgames, so do not let Lua touch these!
|
||||||
INT32 spawn_nexttag, spawn_firsttag; // the actual nexttag/firsttag values may differ if the sector's tag was changed
|
INT32 spawn_nexttag, spawn_firsttag; // the actual nexttag/firsttag values may differ if the sector's tag was changed
|
||||||
|
@ -639,11 +631,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
|
||||||
|
|
|
@ -112,11 +112,9 @@ fixed_t ds_xfrac, ds_yfrac, ds_xstep, ds_ystep;
|
||||||
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, ds_sv, ds_sz; // Vectors for... stuff?
|
floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
||||||
float focallengthf, zeroheight;
|
float focallengthf, zeroheight;
|
||||||
#endif
|
|
||||||
|
|
||||||
/** \brief Variable flat sizes
|
/** \brief Variable flat sizes
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -62,7 +62,6 @@ extern fixed_t ds_xfrac, ds_yfrac, ds_xstep, ds_ystep;
|
||||||
extern UINT8 *ds_source; // start of a 64*64 tile image
|
extern UINT8 *ds_source; // start of a 64*64 tile image
|
||||||
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;
|
||||||
|
@ -70,7 +69,6 @@ typedef struct {
|
||||||
extern pslope_t *ds_slope; // Current slope being used
|
extern pslope_t *ds_slope; // Current slope being used
|
||||||
extern floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
extern floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
||||||
extern float focallengthf, zeroheight;
|
extern float focallengthf, zeroheight;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Variable flat sizes
|
// Variable flat sizes
|
||||||
extern UINT32 nflatxshift;
|
extern UINT32 nflatxshift;
|
||||||
|
@ -157,12 +155,10 @@ void ASMCALL R_DrawSpan_8_MMX(void);
|
||||||
void R_DrawTranslatedColumn_8(void);
|
void R_DrawTranslatedColumn_8(void);
|
||||||
void R_DrawTranslatedTranslucentColumn_8(void);
|
void R_DrawTranslatedTranslucentColumn_8(void);
|
||||||
void R_DrawSpan_8(void);
|
void R_DrawSpan_8(void);
|
||||||
#ifdef ESLOPE
|
|
||||||
void R_CalcTiltedLighting(fixed_t start, fixed_t end);
|
void R_CalcTiltedLighting(fixed_t start, fixed_t end);
|
||||||
void R_DrawTiltedSpan_8(void);
|
void R_DrawTiltedSpan_8(void);
|
||||||
void R_DrawTiltedTranslucentSpan_8(void);
|
void R_DrawTiltedTranslucentSpan_8(void);
|
||||||
void R_DrawTiltedSplat_8(void);
|
void R_DrawTiltedSplat_8(void);
|
||||||
#endif
|
|
||||||
void R_DrawSplat_8(void);
|
void R_DrawSplat_8(void);
|
||||||
void R_DrawTranslucentSplat_8(void);
|
void R_DrawTranslucentSplat_8(void);
|
||||||
void R_DrawTranslucentSpan_8(void);
|
void R_DrawTranslucentSpan_8(void);
|
||||||
|
|
|
@ -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.
|
||||||
static INT32 tiltlighting[MAXVIDWIDTH];
|
static INT32 tiltlighting[MAXVIDWIDTH];
|
||||||
|
@ -1058,7 +1057,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.
|
||||||
|
|
|
@ -536,9 +536,7 @@ static void R_InitTextureMapping(void)
|
||||||
focallength = FixedDiv(projection,
|
focallength = FixedDiv(projection,
|
||||||
FINETANGENT(FINEANGLES/4+/*cv_fov.value*/ FIELDOFVIEW/2));
|
FINETANGENT(FINEANGLES/4+/*cv_fov.value*/ 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++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -322,11 +322,9 @@ 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 (encoremap && !currentplane->noencore)
|
if (encoremap && !currentplane->noencore)
|
||||||
ds_colormap += (256*32);
|
ds_colormap += (256*32);
|
||||||
|
@ -427,17 +425,13 @@ 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
|
|
||||||
, boolean noencore)
|
, boolean noencore)
|
||||||
{
|
{
|
||||||
visplane_t *check;
|
visplane_t *check;
|
||||||
unsigned hash;
|
unsigned hash;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
|
||||||
if (slope); else // 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;
|
||||||
|
@ -495,9 +489,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
|
|
||||||
&& check->noencore == noencore)
|
&& check->noencore == noencore)
|
||||||
{
|
{
|
||||||
return check;
|
return check;
|
||||||
|
@ -523,9 +515,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
|
|
||||||
check->noencore = noencore;
|
check->noencore = noencore;
|
||||||
|
|
||||||
memset(check->top, 0xff, sizeof (check->top));
|
memset(check->top, 0xff, sizeof (check->top));
|
||||||
|
@ -596,9 +586,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
|
|
||||||
new_pl->noencore = pl->noencore;
|
new_pl->noencore = pl->noencore;
|
||||||
pl = new_pl;
|
pl = new_pl;
|
||||||
pl->minx = start;
|
pl->minx = start;
|
||||||
|
@ -861,9 +849,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
|
|
||||||
#ifndef NOWATER
|
#ifndef NOWATER
|
||||||
if (pl->ffloor->flags & FF_RIPPLE
|
if (pl->ffloor->flags & FF_RIPPLE
|
||||||
#ifdef ESLOPE
|
|
||||||
&& !pl->slope
|
&& !pl->slope
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
INT32 top, bottom;
|
INT32 top, bottom;
|
||||||
|
@ -902,9 +888,7 @@ 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
|
||||||
#endif
|
|
||||||
if (viewangle != pl->viewangle+pl->plangle)
|
if (viewangle != pl->viewangle+pl->plangle)
|
||||||
{
|
{
|
||||||
memset(cachedheight, 0, sizeof (cachedheight));
|
memset(cachedheight, 0, sizeof (cachedheight));
|
||||||
|
@ -978,7 +962,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) {
|
||||||
// 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!
|
||||||
// I copied ZDoom's code and adapted it to SRB2... -fickle
|
// I copied ZDoom's code and adapted it to SRB2... -fickle
|
||||||
|
@ -1118,7 +1101,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
|
|
||||||
planezlight = scalelight[light];
|
planezlight = scalelight[light];
|
||||||
} else
|
} else
|
||||||
#endif // ESLOPE
|
|
||||||
|
|
||||||
planezlight = zlight[light];
|
planezlight = zlight[light];
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,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
|
|
||||||
|
|
||||||
boolean noencore;
|
boolean noencore;
|
||||||
} visplane_t;
|
} visplane_t;
|
||||||
|
@ -86,9 +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
|
|
||||||
, boolean noencore);
|
, boolean noencore);
|
||||||
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);
|
||||||
|
@ -108,13 +104,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
|
||||||
|
|
333
src/r_segs.c
333
src/r_segs.c
File diff suppressed because it is too large
Load diff
|
@ -1052,10 +1052,8 @@ static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing)
|
||||||
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;
|
||||||
|
@ -1373,7 +1371,6 @@ 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;
|
||||||
|
|
||||||
for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
|
for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
|
||||||
|
@ -1384,9 +1381,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
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)
|
||||||
|
@ -2052,13 +2046,11 @@ static void R_CreateDrawNodes(void)
|
||||||
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
|
} else
|
||||||
#endif
|
|
||||||
planeobjectz = planecameraz = r2->plane->height;
|
planeobjectz = planecameraz = r2->plane->height;
|
||||||
|
|
||||||
if (rover->mobjflags & MF_NOCLIPHEIGHT)
|
if (rover->mobjflags & MF_NOCLIPHEIGHT)
|
||||||
|
@ -2117,20 +2109,16 @@ static void R_CreateDrawNodes(void)
|
||||||
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
|
} else
|
||||||
#endif
|
|
||||||
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
|
} else
|
||||||
#endif
|
|
||||||
botplaneobjectz = botplanecameraz = *r2->ffloor->bottomheight;
|
botplaneobjectz = botplanecameraz = *r2->ffloor->bottomheight;
|
||||||
|
|
||||||
if ((topplanecameraz > viewz && botplanecameraz < viewz) ||
|
if ((topplanecameraz > viewz && botplanecameraz < viewz) ||
|
||||||
|
|
Loading…
Reference in a new issue