mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Merge branch 'next' into discord-rpc-support
This commit is contained in:
commit
e2f3e76db8
40 changed files with 78 additions and 1129 deletions
32
src/am_map.c
32
src/am_map.c
|
@ -862,10 +862,8 @@ static inline void AM_drawWalls(void)
|
|||
{
|
||||
size_t i;
|
||||
static mline_t l;
|
||||
#ifdef ESLOPE
|
||||
fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
|
||||
fixed_t backf1 = 0, backf2 = 0, backc1 = 0, backc2 = 0; // back floor ceiling ends
|
||||
#endif
|
||||
|
||||
for (i = 0; i < numlines; i++)
|
||||
{
|
||||
|
@ -873,7 +871,6 @@ static inline void AM_drawWalls(void)
|
|||
l.a.y = lines[i].v1->y >> FRACTOMAPBITS;
|
||||
l.b.x = lines[i].v2->x >> FRACTOMAPBITS;
|
||||
l.b.y = lines[i].v2->y >> FRACTOMAPBITS;
|
||||
#ifdef ESLOPE
|
||||
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
|
||||
if (slope) { \
|
||||
end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y); \
|
||||
|
@ -888,7 +885,6 @@ static inline void AM_drawWalls(void)
|
|||
SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight)
|
||||
}
|
||||
#undef SLOPEPARAMS
|
||||
#endif
|
||||
|
||||
if (!lines[i].backsector) // 1-sided
|
||||
{
|
||||
|
@ -897,19 +893,11 @@ static inline void AM_drawWalls(void)
|
|||
else
|
||||
AM_drawMline(&l, WALLCOLORS);
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier
|
||||
|| (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier
|
||||
{
|
||||
if (backf1 == backc1 && backf2 == backc2
|
||||
&& frontf1 == frontc1 && frontf2 == frontc2) // BOTH are thok barriers
|
||||
#else
|
||||
else if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight // Back is thok barrier
|
||||
|| lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // Front is thok barrier
|
||||
{
|
||||
if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight
|
||||
&& lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // BOTH are thok barriers
|
||||
#endif
|
||||
{
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
AM_drawMline(&l, NOCLIMBTSWALLCOLORS);
|
||||
|
@ -927,20 +915,10 @@ static inline void AM_drawWalls(void)
|
|||
else
|
||||
{
|
||||
if (lines[i].flags & ML_NOCLIMB) {
|
||||
#ifdef ESLOPE
|
||||
if (backf1 != frontf1 || backf2 != frontf2) {
|
||||
#else
|
||||
if (lines[i].backsector->floorheight
|
||||
!= lines[i].frontsector->floorheight) {
|
||||
#endif
|
||||
AM_drawMline(&l, NOCLIMBFDWALLCOLORS); // floor level change
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
else if (backc1 != frontc1 || backc2 != frontc2) {
|
||||
#else
|
||||
else if (lines[i].backsector->ceilingheight
|
||||
!= lines[i].frontsector->ceilingheight) {
|
||||
#endif
|
||||
AM_drawMline(&l, NOCLIMBCDWALLCOLORS); // ceiling level change
|
||||
}
|
||||
else
|
||||
|
@ -948,20 +926,10 @@ static inline void AM_drawWalls(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
if (backf1 != frontf1 || backf2 != frontf2) {
|
||||
#else
|
||||
if (lines[i].backsector->floorheight
|
||||
!= lines[i].frontsector->floorheight) {
|
||||
#endif
|
||||
AM_drawMline(&l, FDWALLCOLORS); // floor level change
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
else if (backc1 != frontc1 || backc2 != frontc2) {
|
||||
#else
|
||||
else if (lines[i].backsector->ceilingheight
|
||||
!= lines[i].frontsector->ceilingheight) {
|
||||
#endif
|
||||
AM_drawMline(&l, CDWALLCOLORS); // ceiling level change
|
||||
}
|
||||
else
|
||||
|
|
|
@ -7766,7 +7766,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_TWINKLECARTAMBIENCE",
|
||||
"MT_EXPLODINGBARREL",
|
||||
"MT_MERRYHORSE",
|
||||
"MT_ARIDTOAD",
|
||||
"MT_BLUEFRUIT",
|
||||
"MT_ORANGEFRUIT",
|
||||
"MT_REDFRUIT",
|
||||
|
@ -7777,6 +7776,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_BOOSTPROMPT",
|
||||
"MT_BOOSTOFF",
|
||||
"MT_BOOSTON",
|
||||
"MT_ARIDTOAD",
|
||||
"MT_LIZARDMAN",
|
||||
"MT_LIONMAN",
|
||||
|
||||
|
@ -8624,13 +8624,11 @@ struct {
|
|||
{"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
|
||||
{"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Slope flags
|
||||
{"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_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
|
||||
#endif
|
||||
|
||||
// Angles
|
||||
{"ANG1",ANG1},
|
||||
|
|
|
@ -155,8 +155,8 @@ extern char logfilename[1024];
|
|||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 2 // more precise version number
|
||||
#define VERSIONSTRING "v1.2 (HTTP MS)"
|
||||
#define VERSIONSTRINGW L"v1.2 (HTTP MS)"
|
||||
#define VERSIONSTRING "v1.2"
|
||||
#define VERSIONSTRINGW L"v1.2"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||
// And change CMakeLists.txt, for CMake users!
|
||||
// AND appveyor.yml, for the build bots!
|
||||
|
@ -606,11 +606,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
/// Kalaron/Eternity Engine slope code (SRB2CB ported)
|
||||
#define ESLOPE
|
||||
|
||||
#ifdef ESLOPE
|
||||
/// Backwards compatibility with SRB2CB's slope linedef types.
|
||||
/// \note A simple shim that prints a warning.
|
||||
#define ESLOPE_TYPESHIM
|
||||
#endif
|
||||
|
||||
/// Delete file while the game is running.
|
||||
/// \note EXTREMELY buggy, tends to crash game.
|
||||
|
|
17
src/g_game.c
17
src/g_game.c
|
@ -6334,8 +6334,8 @@ void G_RecordDemo(const char *name)
|
|||
maxsize = 1024*1024*2;
|
||||
if (M_CheckParm("-maxdemo") && M_IsNextParm())
|
||||
maxsize = atoi(M_GetNextParm()) * 1024;
|
||||
// if (demobuffer)
|
||||
// free(demobuffer);
|
||||
if (demobuffer)
|
||||
free(demobuffer);
|
||||
demo_p = NULL;
|
||||
demobuffer = malloc(maxsize);
|
||||
demoend = demobuffer + maxsize;
|
||||
|
@ -7164,6 +7164,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7192,6 +7193,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7204,6 +7206,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7223,6 +7226,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7283,6 +7287,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7353,6 +7358,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7366,6 +7372,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7390,6 +7397,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7433,6 +7441,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7488,6 +7497,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -7502,6 +7512,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
return;
|
||||
|
@ -8152,6 +8163,7 @@ ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(void)
|
|||
saved = FIL_WriteFile(va("%sMS.LMP", G_BuildMapName(gamemap)), demobuffer, demo_p - demobuffer); // finally output the file.
|
||||
}
|
||||
free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
metalrecording = false;
|
||||
if (saved)
|
||||
I_Error("Saved to %sMS.LMP", G_BuildMapName(gamemap));
|
||||
|
@ -8332,6 +8344,7 @@ void G_SaveDemo(void)
|
|||
if (FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer)) // finally output the file.
|
||||
demo.savemode = DSM_SAVED;
|
||||
free(demobuffer);
|
||||
demobuffer = NULL;
|
||||
demo.recording = false;
|
||||
|
||||
if (modeattacking != ATTACKING_RECORD)
|
||||
|
|
|
@ -4733,6 +4733,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
|
|||
}
|
||||
|
||||
R_SetupFrame(player, false); // This can stay false because it is only used to set viewsky in r_main.c, which isn't used here
|
||||
framecount++; // for timedemo
|
||||
HWR_RenderFrame(viewnumber, player, false);
|
||||
}
|
||||
|
||||
|
|
76
src/k_kart.c
76
src/k_kart.c
|
@ -1377,30 +1377,72 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
}
|
||||
}
|
||||
|
||||
/** \brief Checks that the player is on an offroad subsector for realsies
|
||||
/** \brief Checks that the player is on an offroad subsector for realsies. Also accounts for line riding to prevent cheese.
|
||||
|
||||
\param mo player mobj object
|
||||
|
||||
\return boolean
|
||||
*/
|
||||
static UINT8 K_CheckOffroadCollide(mobj_t *mo, sector_t *sec)
|
||||
static UINT8 K_CheckOffroadCollide(mobj_t *mo)
|
||||
{
|
||||
UINT8 i;
|
||||
sector_t *sec2;
|
||||
// Check for sectors in touching_sectorlist
|
||||
UINT8 i; // special type iter
|
||||
msecnode_t *node; // touching_sectorlist iter
|
||||
sector_t *s; // main sector shortcut
|
||||
sector_t *s2; // FOF sector shortcut
|
||||
ffloor_t *rover; // FOF
|
||||
|
||||
fixed_t flr;
|
||||
fixed_t cel; // floor & ceiling for height checks to make sure we're touching the offroad sector.
|
||||
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
||||
sec2 = P_ThingOnSpecial3DFloor(mo);
|
||||
|
||||
for (i = 2; i < 5; i++)
|
||||
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||
{
|
||||
if ((sec2 && GETSECSPECIAL(sec2->special, 1) == i)
|
||||
|| (P_IsObjectOnRealGround(mo, sec) && GETSECSPECIAL(sec->special, 1) == i))
|
||||
return i-1;
|
||||
}
|
||||
if (!node->m_sector)
|
||||
break; // shouldn't happen.
|
||||
|
||||
return 0;
|
||||
s = node->m_sector;
|
||||
// 1: Check for the main sector, make sure we're on the floor of that sector and see if we can apply offroad.
|
||||
// Make arbitrary Z checks because we want to check for 1 sector in particular, we don't want to affect the player if the offroad sector is way below them and they're lineriding a normal sector above.
|
||||
|
||||
flr = P_MobjFloorZ(mo, s, s, mo->x, mo->y, NULL, false, true);
|
||||
cel = P_MobjCeilingZ(mo, s, s, mo->x, mo->y, NULL, true, true); // get Z coords of both floors and ceilings for this sector (this accounts for slopes properly.)
|
||||
// NOTE: we don't use P_GetZAt with our x/y directly because the mobj won't have the same height because of its hitbox on the slope. Complex garbage but tldr it doesn't work.
|
||||
|
||||
if ( ((s->flags & SF_FLIPSPECIAL_FLOOR) && mo->z == flr) // floor check
|
||||
|| ((mo->eflags & MFE_VERTICALFLIP && (s->flags & SF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == cel)) ) // ceiling check.
|
||||
|
||||
for (i = 2; i < 5; i++) // check for sector special
|
||||
|
||||
if (GETSECSPECIAL(s->special, 1) == i)
|
||||
return i-1; // return offroad type
|
||||
|
||||
// 2: If we're here, we haven't found anything. So let's try looking for FOFs in the sectors using the same logic.
|
||||
for (rover = s->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS)) // This FOF doesn't exist anymore.
|
||||
continue;
|
||||
|
||||
s2 = §ors[rover->secnum]; // makes things easier for us
|
||||
|
||||
flr = P_GetFOFBottomZ(mo, s, rover, mo->x, mo->y, NULL);
|
||||
cel = P_GetFOFTopZ(mo, s, rover, mo->x, mo->y, NULL); // Z coords for fof top/bottom.
|
||||
|
||||
// we will do essentially the same checks as above instead of bothering with top/bottom height of the FOF.
|
||||
// Reminder that an FOF's floor is its bottom, silly!
|
||||
if ( ((s2->flags & SF_FLIPSPECIAL_FLOOR) && mo->z == cel) // "floor" check
|
||||
|| ((s2->flags & SF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == flr) ) // "ceiling" check.
|
||||
|
||||
for (i = 2; i < 5; i++) // check for sector special
|
||||
|
||||
if (GETSECSPECIAL(s2->special, 1) == i)
|
||||
return i-1; // return offroad type
|
||||
|
||||
}
|
||||
}
|
||||
return 0; // couldn't find any offroad
|
||||
}
|
||||
|
||||
/** \brief Updates the Player's offroad value once per frame
|
||||
|
@ -1412,14 +1454,12 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo, sector_t *sec)
|
|||
static void K_UpdateOffroad(player_t *player)
|
||||
{
|
||||
fixed_t offroad;
|
||||
sector_t *nextsector = R_PointInSubsector(
|
||||
player->mo->x + player->mo->momx*2, player->mo->y + player->mo->momy*2)->sector;
|
||||
UINT8 offroadstrength = K_CheckOffroadCollide(player->mo, nextsector);
|
||||
UINT8 offroadstrength = K_CheckOffroadCollide(player->mo);
|
||||
|
||||
// If you are in offroad, a timer starts.
|
||||
if (offroadstrength)
|
||||
{
|
||||
if (K_CheckOffroadCollide(player->mo, player->mo->subsector->sector) && player->kartstuff[k_offroad] == 0)
|
||||
if (/*K_CheckOffroadCollide(player->mo) &&*/ player->kartstuff[k_offroad] == 0) // With the way offroad is detected now that first check is no longer necessary. -Lat'
|
||||
player->kartstuff[k_offroad] = (TICRATE/2);
|
||||
|
||||
if (player->kartstuff[k_offroad] > 0)
|
||||
|
@ -2898,14 +2938,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));
|
||||
newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale));
|
||||
#ifdef ESLOPE
|
||||
if (player->mo->standingslope)
|
||||
{
|
||||
ground = P_GetZAt(player->mo->standingslope, newx, newy);
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
ground -= FixedMul(mobjinfo[MT_SNEAKERTRAIL].height, player->mo->scale);
|
||||
}
|
||||
#endif
|
||||
flame = P_SpawnMobj(newx, newy, ground, MT_SNEAKERTRAIL);
|
||||
|
||||
P_SetTarget(&flame->target, player->mo);
|
||||
|
@ -3622,9 +3660,7 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound)
|
|||
if (mo->eflags & MFE_SPRUNG)
|
||||
return;
|
||||
|
||||
#ifdef ESLOPE
|
||||
mo->standingslope = NULL;
|
||||
#endif
|
||||
|
||||
mo->eflags |= MFE_SPRUNG;
|
||||
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
#ifdef HAVE_BLUA
|
||||
#include "p_local.h"
|
||||
#include "p_setup.h" // So we can have P_SetupLevelSky
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h" // P_GetZAt
|
||||
#endif
|
||||
#include "z_zone.h"
|
||||
#include "r_main.h"
|
||||
#include "r_things.h"
|
||||
|
@ -1575,7 +1573,6 @@ static int lib_evCrumbleChain(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
// P_SLOPES
|
||||
////////////
|
||||
|
||||
|
@ -1591,7 +1588,6 @@ static int lib_pGetZAt(lua_State *L)
|
|||
lua_pushfixed(L, P_GetZAt(slope, x, y));
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// R_DEFS
|
||||
////////////
|
||||
|
@ -3083,10 +3079,8 @@ static luaL_Reg lib[] = {
|
|||
{"P_StartQuake",lib_pStartQuake},
|
||||
{"EV_CrumbleChain",lib_evCrumbleChain},
|
||||
|
||||
#ifdef ESLOPE
|
||||
// p_slopes
|
||||
{"P_GetZAt",lib_pGetZAt},
|
||||
#endif
|
||||
|
||||
// r_defs
|
||||
{"R_PointToAngle",lib_rPointToAngle},
|
||||
|
|
|
@ -79,9 +79,7 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
|||
{
|
||||
INT32 offset;
|
||||
const INT32 *list; // Big blockmap
|
||||
#ifdef POLYOBJECTS
|
||||
polymaplink_t *plink; // haleyjd 02/22/06
|
||||
#endif
|
||||
line_t *ld;
|
||||
|
||||
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
||||
|
@ -89,7 +87,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
|||
|
||||
offset = y*bmapwidth + x;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/22/06: consider polyobject lines
|
||||
plink = polyblocklinks[offset];
|
||||
|
||||
|
@ -132,7 +129,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
|||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
#endif
|
||||
|
||||
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
||||
|
||||
|
|
|
@ -40,11 +40,9 @@ extern lua_State *gL;
|
|||
#define META_SUBSECTOR "SUBSECTOR_T*"
|
||||
#define META_SECTOR "SECTOR_T*"
|
||||
#define META_FFLOOR "FFLOOR_T*"
|
||||
#ifdef ESLOPE
|
||||
#define META_SLOPE "PSLOPE_T*"
|
||||
#define META_VECTOR2 "VECTOR2_T"
|
||||
#define META_VECTOR3 "VECTOR3_T"
|
||||
#endif
|
||||
#define META_MAPHEADER "MAPHEADER_T*"
|
||||
|
||||
#define META_CVAR "CONSVAR_T*"
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
#include "p_local.h"
|
||||
#include "p_setup.h"
|
||||
#include "z_zone.h"
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h"
|
||||
#endif
|
||||
#include "r_main.h"
|
||||
|
||||
#include "lua_script.h"
|
||||
|
@ -43,13 +41,9 @@ enum sector_e {
|
|||
sector_heightsec,
|
||||
sector_camsec,
|
||||
sector_lines,
|
||||
#ifdef ESLOPE
|
||||
sector_ffloors,
|
||||
sector_fslope,
|
||||
sector_cslope
|
||||
#else
|
||||
sector_ffloors
|
||||
#endif
|
||||
};
|
||||
|
||||
static const char *const sector_opt[] = {
|
||||
|
@ -66,10 +60,8 @@ static const char *const sector_opt[] = {
|
|||
"camsec",
|
||||
"lines",
|
||||
"ffloors",
|
||||
#ifdef ESLOPE
|
||||
"f_slope",
|
||||
"c_slope",
|
||||
#endif
|
||||
NULL};
|
||||
|
||||
enum subsector_e {
|
||||
|
@ -175,10 +167,8 @@ enum ffloor_e {
|
|||
ffloor_toplightlevel,
|
||||
ffloor_bottomheight,
|
||||
ffloor_bottompic,
|
||||
#ifdef ESLOPE
|
||||
ffloor_tslope,
|
||||
ffloor_bslope,
|
||||
#endif
|
||||
ffloor_sector,
|
||||
ffloor_flags,
|
||||
ffloor_master,
|
||||
|
@ -195,10 +185,8 @@ static const char *const ffloor_opt[] = {
|
|||
"toplightlevel",
|
||||
"bottomheight",
|
||||
"bottompic",
|
||||
#ifdef ESLOPE
|
||||
"t_slope",
|
||||
"b_slope",
|
||||
#endif
|
||||
"sector", // secnum pushed as control sector userdata
|
||||
"flags",
|
||||
"master", // control linedef
|
||||
|
@ -208,7 +196,6 @@ static const char *const ffloor_opt[] = {
|
|||
"alpha",
|
||||
NULL};
|
||||
|
||||
#ifdef ESLOPE
|
||||
enum slope_e {
|
||||
slope_valid = 0,
|
||||
slope_o,
|
||||
|
@ -247,7 +234,6 @@ static const char *const vector_opt[] = {
|
|||
"y",
|
||||
"z",
|
||||
NULL};
|
||||
#endif
|
||||
|
||||
static const char *const array_opt[] ={"iterate",NULL};
|
||||
static const char *const valid_opt[] ={"valid",NULL};
|
||||
|
@ -463,14 +449,12 @@ static int sector_get(lua_State *L)
|
|||
LUA_PushUserdata(L, sector->ffloors, META_FFLOOR);
|
||||
lua_pushcclosure(L, sector_iterate, 2); // push lib_iterateFFloors and sector->ffloors as upvalues for the function
|
||||
return 1;
|
||||
#ifdef ESLOPE
|
||||
case sector_fslope: // f_slope
|
||||
LUA_PushUserdata(L, sector->f_slope, META_SLOPE);
|
||||
return 1;
|
||||
case sector_cslope: // c_slope
|
||||
LUA_PushUserdata(L, sector->c_slope, META_SLOPE);
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -495,10 +479,8 @@ static int sector_set(lua_State *L)
|
|||
case sector_heightsec: // heightsec
|
||||
case sector_camsec: // camsec
|
||||
case sector_ffloors: // ffloors
|
||||
#ifdef ESLOPE
|
||||
case sector_fslope: // f_slope
|
||||
case sector_cslope: // c_slope
|
||||
#endif
|
||||
default:
|
||||
return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]);
|
||||
case sector_floorheight: { // floorheight
|
||||
|
@ -1134,14 +1116,12 @@ static int ffloor_get(lua_State *L)
|
|||
lua_pushlstring(L, levelflat->name, i);
|
||||
return 1;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
case ffloor_tslope:
|
||||
LUA_PushUserdata(L, *ffloor->t_slope, META_SLOPE);
|
||||
return 1;
|
||||
case ffloor_bslope:
|
||||
LUA_PushUserdata(L, *ffloor->b_slope, META_SLOPE);
|
||||
return 1;
|
||||
#endif
|
||||
case ffloor_sector:
|
||||
LUA_PushUserdata(L, §ors[ffloor->secnum], META_SECTOR);
|
||||
return 1;
|
||||
|
@ -1183,10 +1163,8 @@ static int ffloor_set(lua_State *L)
|
|||
switch(field)
|
||||
{
|
||||
case ffloor_valid: // valid
|
||||
#ifdef ESLOPE
|
||||
case ffloor_tslope: // t_slope
|
||||
case ffloor_bslope: // b_slope
|
||||
#endif
|
||||
case ffloor_sector: // sector
|
||||
case ffloor_master: // master
|
||||
case ffloor_target: // target
|
||||
|
@ -1247,7 +1225,6 @@ static int ffloor_set(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
static int slope_get(lua_State *L)
|
||||
{
|
||||
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
||||
|
@ -1422,7 +1399,6 @@ static int vector3_get(lua_State *L)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int lib_getMapheaderinfo(lua_State *L)
|
||||
{
|
||||
|
@ -1614,7 +1590,6 @@ int LUA_MapLib(lua_State *L)
|
|||
lua_setfield(L, -2, "__newindex");
|
||||
lua_pop(L, 1);
|
||||
|
||||
#ifdef ESLOPE
|
||||
luaL_newmetatable(L, META_SLOPE);
|
||||
lua_pushcfunction(L, slope_get);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
@ -1632,7 +1607,6 @@ int LUA_MapLib(lua_State *L)
|
|||
lua_pushcfunction(L, vector3_get);
|
||||
lua_setfield(L, -2, "__index");
|
||||
lua_pop(L, 1);
|
||||
#endif
|
||||
|
||||
luaL_newmetatable(L, META_MAPHEADER);
|
||||
lua_pushcfunction(L, mapheaderinfo_get);
|
||||
|
|
|
@ -82,9 +82,7 @@ enum mobj_e {
|
|||
mobj_extravalue2,
|
||||
mobj_cusval,
|
||||
mobj_cvmem,
|
||||
#ifdef ESLOPE
|
||||
mobj_standingslope,
|
||||
#endif
|
||||
mobj_colorized
|
||||
};
|
||||
|
||||
|
@ -145,9 +143,7 @@ static const char *const mobj_opt[] = {
|
|||
"extravalue2",
|
||||
"cusval",
|
||||
"cvmem",
|
||||
#ifdef ESLOPE
|
||||
"standingslope",
|
||||
#endif
|
||||
"colorized",
|
||||
NULL};
|
||||
|
||||
|
@ -352,11 +348,9 @@ static int mobj_get(lua_State *L)
|
|||
case mobj_cvmem:
|
||||
lua_pushinteger(L, mo->cvmem);
|
||||
break;
|
||||
#ifdef ESLOPE
|
||||
case mobj_standingslope:
|
||||
LUA_PushUserdata(L, mo->standingslope, META_SLOPE);
|
||||
break;
|
||||
#endif
|
||||
case mobj_colorized:
|
||||
lua_pushboolean(L, mo->colorized);
|
||||
break;
|
||||
|
@ -670,10 +664,8 @@ static int mobj_set(lua_State *L)
|
|||
case mobj_cvmem:
|
||||
mo->cvmem = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
#ifdef ESLOPE
|
||||
case mobj_standingslope:
|
||||
return NOSET;
|
||||
#endif
|
||||
case mobj_colorized:
|
||||
mo->colorized = luaL_checkboolean(L, 3);
|
||||
break;
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
#include "byteptr.h"
|
||||
#include "p_saveg.h"
|
||||
#include "p_local.h"
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h" // for P_SlopeById
|
||||
#endif
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
#include "d_netfil.h" // for LUA_DumpFile
|
||||
#endif
|
||||
|
@ -472,9 +470,7 @@ enum
|
|||
ARCH_SIDE,
|
||||
ARCH_SUBSECTOR,
|
||||
ARCH_SECTOR,
|
||||
#ifdef ESLOPE
|
||||
ARCH_SLOPE,
|
||||
#endif
|
||||
ARCH_MAPHEADER,
|
||||
|
||||
ARCH_TEND=0xFF,
|
||||
|
@ -494,9 +490,7 @@ static const struct {
|
|||
{META_SIDE, ARCH_SIDE},
|
||||
{META_SUBSECTOR,ARCH_SUBSECTOR},
|
||||
{META_SECTOR, ARCH_SECTOR},
|
||||
#ifdef ESLOPE
|
||||
{META_SLOPE, ARCH_SLOPE},
|
||||
#endif
|
||||
{META_MAPHEADER, ARCH_MAPHEADER},
|
||||
{NULL, ARCH_NULL}
|
||||
};
|
||||
|
@ -701,7 +695,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
}
|
||||
break;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
case ARCH_SLOPE:
|
||||
{
|
||||
pslope_t *slope = *((pslope_t **)lua_touserdata(gL, myindex));
|
||||
|
@ -713,7 +706,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case ARCH_MAPHEADER:
|
||||
{
|
||||
mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex));
|
||||
|
@ -915,7 +907,6 @@ static UINT8 ArchiveValueDemo(int TABLESINDEX, int myindex)
|
|||
}
|
||||
break;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
case ARCH_SLOPE:
|
||||
{
|
||||
pslope_t *slope = *((pslope_t **)lua_touserdata(gL, myindex));
|
||||
|
@ -927,7 +918,6 @@ static UINT8 ArchiveValueDemo(int TABLESINDEX, int myindex)
|
|||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case ARCH_MAPHEADER:
|
||||
{
|
||||
mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex));
|
||||
|
@ -1233,11 +1223,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
|
|||
case ARCH_SECTOR:
|
||||
LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_SECTOR);
|
||||
break;
|
||||
#ifdef ESLOPE
|
||||
case ARCH_SLOPE:
|
||||
LUA_PushUserdata(gL, P_SlopeById(READUINT16(save_p)), META_SLOPE);
|
||||
break;
|
||||
#endif
|
||||
case ARCH_MAPHEADER:
|
||||
LUA_PushUserdata(gL, mapheaderinfo[READUINT16(save_p)], META_MAPHEADER);
|
||||
break;
|
||||
|
@ -1336,11 +1324,9 @@ static UINT8 UnArchiveValueDemo(int TABLESINDEX, char field[1024])
|
|||
case ARCH_SECTOR:
|
||||
LUA_PushUserdata(gL, §ors[READUINT16(demo_p)], META_SECTOR);
|
||||
break;
|
||||
#ifdef ESLOPE
|
||||
case ARCH_SLOPE:
|
||||
LUA_PushUserdata(gL, P_SlopeById(READUINT16(demo_p)), META_SLOPE);
|
||||
break;
|
||||
#endif
|
||||
case ARCH_MAPHEADER:
|
||||
LUA_PushUserdata(gL, mapheaderinfo[READUINT16(demo_p)], META_MAPHEADER);
|
||||
break;
|
||||
|
|
|
@ -862,13 +862,9 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
|
|||
|
||||
if (ceiling)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
// Truncate position to match where mapthing would be when spawned
|
||||
// (this applies to every further P_GetZAt call as well)
|
||||
fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight;
|
||||
#else
|
||||
fixed_t cheight = sec->ceilingheight;
|
||||
#endif
|
||||
|
||||
if (((cheight - player->mo->z - player->mo->height)>>FRACBITS) >= (1 << (16-ZSHIFT)))
|
||||
{
|
||||
|
@ -879,11 +875,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
|
||||
#else
|
||||
fixed_t fheight = sec->floorheight;
|
||||
#endif
|
||||
if (((player->mo->z - fheight)>>FRACBITS) >= (1 << (16-ZSHIFT)))
|
||||
{
|
||||
CONS_Printf(M_GetText("Sorry, you're too %s to place this object (max: %d %s).\n"), M_GetText("high"),
|
||||
|
@ -931,20 +923,12 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
|
|||
mt->y = (INT16)(player->mo->y>>FRACBITS);
|
||||
if (ceiling)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->ceilingheight;
|
||||
#else
|
||||
fixed_t cheight = sec->ceilingheight;
|
||||
#endif
|
||||
mt->options = (UINT16)((cheight - player->mo->z - player->mo->height)>>FRACBITS);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->floorheight;
|
||||
#else
|
||||
fixed_t fheight = sec->floorheight;
|
||||
#endif
|
||||
mt->options = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
||||
}
|
||||
mt->options <<= ZSHIFT;
|
||||
|
@ -1001,11 +985,7 @@ void OP_NightsObjectplace(player_t *player)
|
|||
UINT16 angle = (UINT16)(player->anotherflyangle % 360);
|
||||
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
|
||||
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;
|
||||
#else
|
||||
fixed_t fheight = sec->floorheight;
|
||||
#endif
|
||||
|
||||
|
||||
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))
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight;
|
||||
#else
|
||||
fixed_t cheight = sec->ceilingheight;
|
||||
#endif
|
||||
op_displayflags = (UINT16)((cheight - player->mo->z - mobjinfo[op_currentthing].height)>>FRACBITS);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
|
||||
#else
|
||||
fixed_t fheight = sec->floorheight;
|
||||
#endif
|
||||
op_displayflags = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
||||
}
|
||||
op_displayflags <<= ZSHIFT;
|
||||
|
|
|
@ -5795,13 +5795,8 @@ void A_MixUp(mobj_t *actor)
|
|||
|
||||
P_SetThingPosition(players[i].mo);
|
||||
|
||||
#ifdef ESLOPE
|
||||
players[i].mo->floorz = P_GetFloorZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL);
|
||||
players[i].mo->ceilingz = P_GetCeilingZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL);
|
||||
#else
|
||||
players[i].mo->floorz = players[i].mo->subsector->sector->floorheight;
|
||||
players[i].mo->ceilingz = players[i].mo->subsector->sector->ceilingheight;
|
||||
#endif
|
||||
|
||||
P_CheckPosition(players[i].mo, players[i].mo->x, players[i].mo->y);
|
||||
}
|
||||
|
|
|
@ -328,9 +328,7 @@ extern mobj_t *tmfloorthing, *tmhitthing, *tmthing;
|
|||
extern camera_t *mapcampointer;
|
||||
extern fixed_t tmx;
|
||||
extern fixed_t tmy;
|
||||
#ifdef ESLOPE
|
||||
extern pslope_t *tmfloorslope, *tmceilingslope;
|
||||
#endif
|
||||
|
||||
/* cphipps 2004/08/30 */
|
||||
extern void P_MapStart(void);
|
||||
|
|
60
src/p_map.c
60
src/p_map.c
|
@ -31,9 +31,7 @@
|
|||
|
||||
#include "r_splats.h"
|
||||
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h"
|
||||
#endif
|
||||
|
||||
#include "z_zone.h"
|
||||
|
||||
|
@ -56,9 +54,7 @@ fixed_t tmfloorz, tmceilingz;
|
|||
static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights
|
||||
mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector
|
||||
mobj_t *tmhitthing; // the solid thing you bumped into (for collisions)
|
||||
#ifdef ESLOPE
|
||||
pslope_t *tmfloorslope, *tmceilingslope;
|
||||
#endif
|
||||
|
||||
// keep track of the line that lowers the ceiling,
|
||||
// so missiles don't explode against sky hack walls
|
||||
|
@ -135,9 +131,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
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!
|
||||
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;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
object->standingslope = NULL; // No launching off at silly angles for you.
|
||||
#endif
|
||||
|
||||
switch (spring->type)
|
||||
{
|
||||
|
@ -1758,9 +1750,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (thing->z + thing->height > tmfloorz)
|
||||
{
|
||||
tmfloorz = thing->z + thing->height;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1777,17 +1767,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
||||
{
|
||||
tmfloorz = tmceilingz = topz; // block while in air
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
tmfloorthing = thing; // needed for side collision
|
||||
}
|
||||
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
||||
{
|
||||
tmceilingz = topz;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
tmfloorthing = thing; // thing we may stand on
|
||||
}
|
||||
}
|
||||
|
@ -1801,9 +1787,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (thing->z < tmceilingz)
|
||||
{
|
||||
tmceilingz = thing->z;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1820,17 +1804,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
&& tmthing->z > tmthing->floorz)
|
||||
{
|
||||
tmfloorz = tmceilingz = topz; // block while in air
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
tmfloorthing = thing; // needed for side collision
|
||||
}
|
||||
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
||||
{
|
||||
tmfloorz = topz;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
tmfloorthing = thing; // thing we may stand on
|
||||
}
|
||||
}
|
||||
|
@ -1964,17 +1944,13 @@ if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a
|
|||
{
|
||||
tmceilingz = opentop;
|
||||
ceilingline = ld;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = opentopslope;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (openbottom > tmfloorz)
|
||||
{
|
||||
tmfloorz = openbottom;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = openbottomslope;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (highceiling > tmdrpoffceilz)
|
||||
|
@ -2053,10 +2029,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
// will adjust them.
|
||||
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;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = newsubsec->sector->f_slope;
|
||||
tmceilingslope = newsubsec->sector->c_slope;
|
||||
#endif
|
||||
|
||||
// Check list of fake floors and see if tmfloorz/tmceilingz need to be altered.
|
||||
if (newsubsec->sector->ffloors)
|
||||
|
@ -2096,18 +2070,14 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
{
|
||||
if (tmfloorz < topheight - sinklevel) {
|
||||
tmfloorz = topheight - sinklevel;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = *rover->t_slope;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (thing->eflags & MFE_VERTICALFLIP && thingtop <= bottomheight + sinklevel && thing->momz >= 0)
|
||||
{
|
||||
if (tmceilingz > bottomheight + sinklevel) {
|
||||
tmceilingz = bottomheight + sinklevel;
|
||||
#ifdef ESLOPE
|
||||
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) {
|
||||
tmfloorz = thing->z;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// 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))
|
||||
{
|
||||
tmfloorz = tmdropoffz = topheight;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = *rover->t_slope;
|
||||
#endif
|
||||
}
|
||||
if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2)
|
||||
&& !(rover->flags & FF_PLATFORM)
|
||||
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
|
||||
{
|
||||
tmceilingz = tmdrpoffceilz = bottomheight;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = *rover->b_slope;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2175,7 +2139,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
|
||||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||
{
|
||||
validcount++;
|
||||
|
@ -2233,23 +2196,18 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
|
||||
if (polytop > tmfloorz && abs(delta1) < abs(delta2)) {
|
||||
tmfloorz = tmdropoffz = polytop;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (polybottom < tmceilingz && abs(delta1) >= abs(delta2)) {
|
||||
tmceilingz = tmdrpoffceilz = polybottom;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// tmfloorthing is set when tmfloorz comes from a thing's top
|
||||
tmfloorthing = NULL;
|
||||
|
@ -2407,7 +2365,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
|||
|
||||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||
{
|
||||
validcount++;
|
||||
|
@ -2478,7 +2435,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// check lines
|
||||
for (bx = xl; bx <= xh; bx++)
|
||||
|
@ -2657,10 +2613,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
|||
mobj_t *oldthing = tmthing;
|
||||
line_t *oldceilline = ceilingline;
|
||||
line_t *oldblockline = blockingline;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *oldfslope = tmfloorslope;
|
||||
pslope_t *oldcslope = tmceilingslope;
|
||||
#endif
|
||||
|
||||
// Move the player
|
||||
P_TryMove(thing, thing->x+stand->momx, thing->y+stand->momy, true);
|
||||
|
@ -2673,10 +2627,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
|||
P_SetTarget(&tmthing, oldthing);
|
||||
ceilingline = oldceilline;
|
||||
blockingline = oldblockline;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = oldfslope;
|
||||
tmceilingslope = oldcslope;
|
||||
#endif
|
||||
thing->momz = stand->momz;
|
||||
}
|
||||
else
|
||||
|
@ -2698,9 +2650,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
fixed_t tryy = thing->y;
|
||||
fixed_t radius = thing->radius;
|
||||
fixed_t thingtop = thing->z + thing->height;
|
||||
#ifdef ESLOPE
|
||||
fixed_t startingonground = P_IsObjectOnGround(thing);
|
||||
#endif
|
||||
floatok = false;
|
||||
|
||||
if (radius < MAXRADIUS/2)
|
||||
|
@ -2791,26 +2741,22 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
else if (tmceilingz < thingtop && thingtop - tmceilingz <= maxstep)
|
||||
{
|
||||
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->z - tmfloorz <= maxstep)
|
||||
{
|
||||
thing->z = thing->floorz = tmfloorz;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
else if (tmfloorz > thing->z && tmfloorz - thing->z <= maxstep)
|
||||
{
|
||||
thing->z = thing->floorz = tmfloorz;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
|
@ -2872,7 +2818,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
thing->floorz = tmfloorz;
|
||||
thing->ceilingz = tmceilingz;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (!(thing->flags & MF_NOCLIPHEIGHT))
|
||||
{
|
||||
// Assign thing's standingslope if needed
|
||||
|
@ -2893,7 +2838,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
}
|
||||
else // don't set standingslope if you're not going to clip against it
|
||||
thing->standingslope = NULL;
|
||||
#endif
|
||||
|
||||
thing->x = x;
|
||||
thing->y = y;
|
||||
|
@ -4674,10 +4618,8 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
|
|||
sector_t *sec = R_PointInSubsector(x, y)->sector;
|
||||
fixed_t floorz = sec->floorheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (sec->f_slope)
|
||||
floorz = P_GetZAt(sec->f_slope, x, y);
|
||||
#endif
|
||||
|
||||
// Intercept the stupid 'fall through 3dfloors' bug Tails 03-17-2002
|
||||
if (sec->ffloors)
|
||||
|
@ -4697,12 +4639,10 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
|
|||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, x, y);
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, x, y);
|
||||
#endif
|
||||
|
||||
if (rover->flags & FF_QUICKSAND)
|
||||
{
|
||||
|
|
|
@ -308,9 +308,7 @@ fixed_t P_InterceptVector(divline_t *v2, divline_t *v1)
|
|||
// OPTIMIZE: keep this precalculated
|
||||
//
|
||||
fixed_t opentop, openbottom, openrange, lowfloor, highceiling;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *opentopslope, *openbottomslope;
|
||||
#endif
|
||||
|
||||
// P_CameraLineOpening
|
||||
// P_LineOpening, but for camera
|
||||
|
@ -337,24 +335,20 @@ void P_CameraLineOpening(line_t *linedef)
|
|||
{
|
||||
frontfloor = sectors[front->camsec].floorheight;
|
||||
frontceiling = sectors[front->camsec].ceilingheight;
|
||||
#ifdef ESLOPE
|
||||
if (sectors[front->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[front->camsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera[0].x, camera[0].y);
|
||||
#endif
|
||||
|
||||
}
|
||||
else if (front->heightsec >= 0)
|
||||
{
|
||||
frontfloor = sectors[front->heightsec].floorheight;
|
||||
frontceiling = sectors[front->heightsec].ceilingheight;
|
||||
#ifdef ESLOPE
|
||||
if (sectors[front->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[front->heightsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera[0].x, camera[0].y);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -365,23 +359,19 @@ void P_CameraLineOpening(line_t *linedef)
|
|||
{
|
||||
backfloor = sectors[back->camsec].floorheight;
|
||||
backceiling = sectors[back->camsec].ceilingheight;
|
||||
#ifdef ESLOPE
|
||||
if (sectors[back->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[back->camsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera[0].x, camera[0].y);
|
||||
#endif
|
||||
}
|
||||
else if (back->heightsec >= 0)
|
||||
{
|
||||
backfloor = sectors[back->heightsec].floorheight;
|
||||
backceiling = sectors[back->heightsec].ceilingheight;
|
||||
#ifdef ESLOPE
|
||||
if (sectors[back->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[back->heightsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera[0].x, camera[0].y);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -501,14 +491,12 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
}
|
||||
|
||||
// Treat polyobjects kind of like 3D Floors
|
||||
#ifdef POLYOBJECTS
|
||||
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
|
||||
{
|
||||
front = linedef->frontsector;
|
||||
back = linedef->frontsector;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
front = linedef->frontsector;
|
||||
back = linedef->backsector;
|
||||
|
@ -527,17 +515,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
{
|
||||
opentop = frontheight;
|
||||
highceiling = backheight;
|
||||
#ifdef ESLOPE
|
||||
opentopslope = front->c_slope;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
opentop = backheight;
|
||||
highceiling = frontheight;
|
||||
#ifdef ESLOPE
|
||||
opentopslope = back->c_slope;
|
||||
#endif
|
||||
}
|
||||
|
||||
frontheight = P_GetFloorZ(mobj, front, tmx, tmy, linedef);
|
||||
|
@ -547,17 +531,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
{
|
||||
openbottom = frontheight;
|
||||
lowfloor = backheight;
|
||||
#ifdef ESLOPE
|
||||
openbottomslope = front->f_slope;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
openbottom = backheight;
|
||||
lowfloor = frontheight;
|
||||
#ifdef ESLOPE
|
||||
openbottomslope = back->f_slope;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -625,9 +605,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
|
||||
// Check for fake floors in the sector.
|
||||
if (front->ffloors || back->ffloors
|
||||
#ifdef POLYOBJECTS
|
||||
|| linedef->polyobj
|
||||
#endif
|
||||
)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
|
@ -637,10 +615,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
fixed_t highestfloor = openbottom;
|
||||
fixed_t lowestfloor = lowfloor;
|
||||
fixed_t delta1, delta2;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *ceilingslope = opentopslope;
|
||||
pslope_t *floorslope = openbottomslope;
|
||||
#endif
|
||||
|
||||
// Check for frontsector's fake floors
|
||||
for (rover = front->ffloors; rover; rover = rover->next)
|
||||
|
@ -665,9 +641,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
{
|
||||
if (bottomheight < lowestceiling) {
|
||||
lowestceiling = bottomheight;
|
||||
#ifdef ESLOPE
|
||||
ceilingslope = *rover->b_slope;
|
||||
#endif
|
||||
}
|
||||
else if (bottomheight < highestceiling)
|
||||
highestceiling = bottomheight;
|
||||
|
@ -677,9 +651,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
{
|
||||
if (topheight > highestfloor) {
|
||||
highestfloor = topheight;
|
||||
#ifdef ESLOPE
|
||||
floorslope = *rover->t_slope;
|
||||
#endif
|
||||
}
|
||||
else if (topheight > lowestfloor)
|
||||
lowestfloor = topheight;
|
||||
|
@ -709,9 +681,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
{
|
||||
if (bottomheight < lowestceiling) {
|
||||
lowestceiling = bottomheight;
|
||||
#ifdef ESLOPE
|
||||
ceilingslope = *rover->b_slope;
|
||||
#endif
|
||||
}
|
||||
else if (bottomheight < highestceiling)
|
||||
highestceiling = bottomheight;
|
||||
|
@ -721,16 +691,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
{
|
||||
if (topheight > highestfloor) {
|
||||
highestfloor = topheight;
|
||||
#ifdef ESLOPE
|
||||
floorslope = *rover->t_slope;
|
||||
#endif
|
||||
}
|
||||
else if (topheight > lowestfloor)
|
||||
lowestfloor = topheight;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Treat polyobj's backsector like a 3D Floor
|
||||
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
|
||||
{
|
||||
|
@ -740,38 +707,29 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
|
||||
if (polysec->floorheight < lowestceiling && delta1 >= delta2) {
|
||||
lowestceiling = polysec->floorheight;
|
||||
#ifdef ESLOPE
|
||||
ceilingslope = NULL;
|
||||
#endif
|
||||
}
|
||||
else if (polysec->floorheight < highestceiling && delta1 >= delta2)
|
||||
highestceiling = polysec->floorheight;
|
||||
|
||||
if (polysec->ceilingheight > highestfloor && delta1 < delta2) {
|
||||
highestfloor = polysec->ceilingheight;
|
||||
#ifdef ESLOPE
|
||||
floorslope = NULL;
|
||||
#endif
|
||||
}
|
||||
else if (polysec->ceilingheight > lowestfloor && delta1 < delta2)
|
||||
lowestfloor = polysec->ceilingheight;
|
||||
}
|
||||
#endif
|
||||
if (highestceiling < highceiling)
|
||||
highceiling = highestceiling;
|
||||
|
||||
if (highestfloor > openbottom) {
|
||||
openbottom = highestfloor;
|
||||
#ifdef ESLOPE
|
||||
openbottomslope = floorslope;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (lowestceiling < opentop) {
|
||||
opentop = lowestceiling;
|
||||
#ifdef ESLOPE
|
||||
opentopslope = ceilingslope;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (lowestfloor > lowfloor)
|
||||
|
@ -1023,9 +981,7 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
|||
{
|
||||
INT32 offset;
|
||||
const INT32 *list; // Big blockmap
|
||||
#ifdef POLYOBJECTS
|
||||
polymaplink_t *plink; // haleyjd 02/22/06
|
||||
#endif
|
||||
line_t *ld;
|
||||
|
||||
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
||||
|
@ -1033,7 +989,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
|||
|
||||
offset = y*bmapwidth + x;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/22/06: consider polyobject lines
|
||||
plink = polyblocklinks[offset];
|
||||
|
||||
|
@ -1057,7 +1012,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
|||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
#endif
|
||||
|
||||
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
||||
|
||||
|
|
|
@ -55,9 +55,7 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y);
|
|||
boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y);
|
||||
|
||||
extern fixed_t opentop, openbottom, openrange, lowfloor, highceiling;
|
||||
#ifdef ESLOPE
|
||||
extern pslope_t *opentopslope, *openbottomslope;
|
||||
#endif
|
||||
|
||||
void P_LineOpening(line_t *plinedef, mobj_t *mobj);
|
||||
|
||||
|
|
156
src/p_mobj.c
156
src/p_mobj.c
|
@ -31,9 +31,7 @@
|
|||
#include "i_video.h"
|
||||
#include "lua_hook.h"
|
||||
#include "b_bot.h"
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h"
|
||||
#endif
|
||||
|
||||
#include "k_kart.h"
|
||||
|
||||
|
@ -646,12 +644,10 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover)
|
|||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
|
||||
#endif
|
||||
|
||||
if (mobj->z > topheight)
|
||||
return false;
|
||||
|
@ -662,7 +658,6 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
// P_GetFloorZ (and its ceiling counterpart)
|
||||
// Gets the floor height (or ceiling height) of the mobj's contact point in sector, assuming object's center if moved to [x, y]
|
||||
// If line is supplied, it's a divider line on the sector. Set it to NULL if you're not checking for collision with a line
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
I_Assert(mobj != NULL);
|
||||
#endif
|
||||
I_Assert(sector != NULL);
|
||||
#ifdef ESLOPE
|
||||
if (sector->f_slope) {
|
||||
fixed_t testx, testy;
|
||||
pslope_t *slope = sector->f_slope;
|
||||
|
@ -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);
|
||||
} else // Well, that makes it easy. Just get the floor height
|
||||
#else
|
||||
(void)mobj;
|
||||
(void)boundsec;
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)line;
|
||||
(void)lowest;
|
||||
(void)perfect;
|
||||
#endif
|
||||
return sector->floorheight;
|
||||
}
|
||||
|
||||
fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
I_Assert(mobj != NULL);
|
||||
#endif
|
||||
I_Assert(sector != NULL);
|
||||
#ifdef ESLOPE
|
||||
if (sector->c_slope) {
|
||||
fixed_t testx, testy;
|
||||
pslope_t *slope = sector->c_slope;
|
||||
|
@ -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);
|
||||
} else // Well, that makes it easy. Just get the ceiling height
|
||||
#else
|
||||
(void)mobj;
|
||||
(void)boundsec;
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)line;
|
||||
(void)lowest;
|
||||
(void)perfect;
|
||||
#endif
|
||||
return sector->ceilingheight;
|
||||
}
|
||||
|
||||
// Now do the same as all above, but for cameras because apparently cameras are special?
|
||||
fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
I_Assert(mobj != NULL);
|
||||
#endif
|
||||
I_Assert(sector != NULL);
|
||||
#ifdef ESLOPE
|
||||
if (sector->f_slope) {
|
||||
fixed_t testx, testy;
|
||||
pslope_t *slope = sector->f_slope;
|
||||
|
@ -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);
|
||||
} else // Well, that makes it easy. Just get the floor height
|
||||
#else
|
||||
(void)mobj;
|
||||
(void)boundsec;
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)line;
|
||||
(void)lowest;
|
||||
(void)perfect;
|
||||
#endif
|
||||
return sector->floorheight;
|
||||
}
|
||||
|
||||
fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
I_Assert(mobj != NULL);
|
||||
#endif
|
||||
I_Assert(sector != NULL);
|
||||
#ifdef ESLOPE
|
||||
if (sector->c_slope) {
|
||||
fixed_t testx, testy;
|
||||
pslope_t *slope = sector->c_slope;
|
||||
|
@ -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);
|
||||
} else // Well, that makes it easy. Just get the ceiling height
|
||||
#else
|
||||
(void)mobj;
|
||||
(void)boundsec;
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)line;
|
||||
(void)lowest;
|
||||
(void)perfect;
|
||||
#endif
|
||||
return sector->ceilingheight;
|
||||
}
|
||||
static void P_PlayerFlip(mobj_t *mo)
|
||||
|
@ -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)
|
||||
&& abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale)
|
||||
&& (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING))
|
||||
#ifdef ESLOPE
|
||||
&& !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
// if in a walking frame, stop moving
|
||||
|
@ -1556,11 +1500,9 @@ void P_XYMovement(mobj_t *mo)
|
|||
fixed_t xmove, ymove;
|
||||
fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls
|
||||
boolean moved;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *oldslope = NULL;
|
||||
vector3_t slopemom;
|
||||
fixed_t predictedz = 0;
|
||||
#endif
|
||||
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
@ -1590,7 +1532,6 @@ void P_XYMovement(mobj_t *mo)
|
|||
oldx = mo->x;
|
||||
oldy = mo->y;
|
||||
|
||||
#ifdef ESLOPE
|
||||
// adjust various things based on slope
|
||||
if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8) {
|
||||
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)
|
||||
predictedz = mo->z;
|
||||
#endif
|
||||
|
||||
// Pushables can break some blocks
|
||||
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;;
|
||||
return;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (moved && oldslope) { // Check to see if we ran off
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check the gravity status.
|
||||
P_CheckGravity(mo, false);
|
||||
|
@ -1898,11 +1836,9 @@ void P_XYMovement(mobj_t *mo)
|
|||
if (player && player->pflags & PF_NIGHTSMODE)
|
||||
return; // no friction for NiGHTS players
|
||||
|
||||
#ifdef ESLOPE
|
||||
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
|
||||
&& (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes
|
||||
return;
|
||||
#endif
|
||||
|
||||
//{ 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))
|
||||
|
@ -2140,9 +2076,7 @@ boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
|
|||
|
||||
{
|
||||
fixed_t topheight =
|
||||
#ifdef ESLOPE
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) :
|
||||
#endif
|
||||
*rover->topheight;
|
||||
|
||||
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;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (mo->standingslope)
|
||||
{
|
||||
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||
|
@ -2187,7 +2120,6 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
else if (!P_IsObjectOnGround(mo))
|
||||
P_SlopeLaunch(mo);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (mo->type)
|
||||
{
|
||||
|
@ -2378,7 +2310,6 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
else
|
||||
mo->z = mo->floorz;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (!(mo->flags & MF_MISSILE) && mo->standingslope) // You're still on the ground; why are we here?
|
||||
{
|
||||
mo->momz = 0;
|
||||
|
@ -2391,7 +2322,6 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;
|
||||
P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
|
||||
}
|
||||
#endif
|
||||
|
||||
// hit the floor
|
||||
if (mo->type == MT_FIREBALL) // special case for the fireball
|
||||
|
@ -2491,13 +2421,11 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
else
|
||||
mom.y -= FixedMul(6*FRACUNIT, mo->scale);
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
else if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)
|
||||
{
|
||||
// Pop the object up a bit to encourage bounciness
|
||||
//mom.z = P_MobjFlip(mo)*mo->scale;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
mom.x = mom.y = mom.z = 0;
|
||||
|
@ -2543,11 +2471,9 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
|| tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER))
|
||||
mom.z = tmfloorthing->momz;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (mo->standingslope) { // MT_STEAM will never have a standingslope, see above.
|
||||
P_QuantizeMomentumToSlope(&mom, mo->standingslope);
|
||||
}
|
||||
#endif
|
||||
|
||||
mo->momx = mom.x;
|
||||
mo->momy = mom.y;
|
||||
|
@ -2665,7 +2591,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
|| mo->player->playerstate == PST_REBORN)
|
||||
return;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (mo->standingslope)
|
||||
{
|
||||
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||
|
@ -2673,7 +2598,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
else if (!P_IsObjectOnGround(mo))
|
||||
P_SlopeLaunch(mo);
|
||||
}
|
||||
#endif
|
||||
|
||||
// clip movement
|
||||
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
|
||||
P_SetPlayerMobjState(mo, S_KART_STND1);
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) {
|
||||
// Handle landing on slope during Z movement
|
||||
P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) {
|
||||
// Handle landing on slope during Z movement
|
||||
P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (P_MobjFlip(mo)*mo->momz < 0) // falling
|
||||
{
|
||||
|
@ -2732,7 +2652,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
|
||||
if (mo->eflags & MFE_JUSTHITFLOOR)
|
||||
{
|
||||
#ifdef POLYOBJECTS
|
||||
// Check if we're on a polyobject
|
||||
// that triggers a linedef executor.
|
||||
msecnode_t *node;
|
||||
|
@ -2792,7 +2711,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
}
|
||||
|
||||
if (!stopmovecut)
|
||||
#endif
|
||||
|
||||
// Cut momentum in half when you hit the ground and
|
||||
// aren't pressing any controls.
|
||||
|
@ -2961,7 +2879,6 @@ static boolean P_SceneryZMovement(mobj_t *mo)
|
|||
// set standingslope
|
||||
P_TryMove(mo, mo->x, mo->y, true);
|
||||
mo->momz = -mo->momz;
|
||||
#ifdef ESLOPE
|
||||
if (mo->standingslope)
|
||||
{
|
||||
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||
|
@ -2969,7 +2886,6 @@ static boolean P_SceneryZMovement(mobj_t *mo)
|
|||
else if (!P_IsObjectOnGround(mo))
|
||||
P_SlopeLaunch(mo);
|
||||
}
|
||||
#endif
|
||||
S_StartSound(mo, mo->info->activesound);
|
||||
}
|
||||
break;
|
||||
|
@ -3138,13 +3054,11 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
|
||||
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
|
||||
#endif
|
||||
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
|
@ -3387,13 +3301,11 @@ static void P_SceneryCheckWater(mobj_t *mobj)
|
|||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
|
||||
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
|
||||
#endif
|
||||
|
||||
if (topheight <= mobj->z
|
||||
|| bottomheight > (mobj->z + FixedMul(mobj->info->height >> 1, mobj->scale)))
|
||||
|
@ -3439,13 +3351,9 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
|
|||
continue;
|
||||
|
||||
if (halfheight >= (
|
||||
#ifdef ESLOPE
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
|
||||
#endif
|
||||
*rover->topheight) || halfheight <= (
|
||||
#ifdef ESLOPE
|
||||
*rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) :
|
||||
#endif
|
||||
*rover->bottomheight))
|
||||
continue;
|
||||
|
||||
|
@ -3475,13 +3383,9 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
|
|||
continue;
|
||||
|
||||
if (halfheight >= (
|
||||
#ifdef ESLOPE
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
|
||||
#endif
|
||||
*rover->topheight) || halfheight <= (
|
||||
#ifdef ESLOPE
|
||||
*rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) :
|
||||
#endif
|
||||
*rover->bottomheight))
|
||||
continue;
|
||||
|
||||
|
@ -3681,9 +3585,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
|||
|
||||
P_MobjCheckWater(mobj);
|
||||
|
||||
#ifdef ESLOPE
|
||||
P_ButteredSlope(mobj);
|
||||
#endif
|
||||
|
||||
// momentum movement
|
||||
mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN;
|
||||
|
@ -3840,9 +3742,7 @@ static void CalculatePrecipFloor(precipmobj_t *mobj)
|
|||
else
|
||||
return;
|
||||
mobj->floorz =
|
||||
#ifdef ESLOPE
|
||||
mobjsecsubsec->f_slope ? P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) :
|
||||
#endif
|
||||
mobjsecsubsec->floorheight;
|
||||
if (mobjsecsubsec->ffloors)
|
||||
{
|
||||
|
@ -3858,11 +3758,9 @@ static void CalculatePrecipFloor(precipmobj_t *mobj)
|
|||
if (!(rover->flags & FF_BLOCKOTHERS) && !(rover->flags & FF_SWIMMABLE))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
|
||||
else
|
||||
#endif
|
||||
topheight = *rover->topheight;
|
||||
|
||||
if (topheight > mobj->floorz)
|
||||
|
@ -9332,7 +9230,6 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
|||
mobj->eflags &= ~MFE_JUSTHITFLOOR;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE // Sliding physics for slidey mobjs!
|
||||
if (mobj->type == MT_FLINGRING
|
||||
|| mobj->type == MT_FLINGCOIN
|
||||
|| P_WeaponOrPanel(mobj->type)
|
||||
|
@ -9345,7 +9242,6 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
|||
//if (mobj->standingslope) CONS_Printf("slope physics on mobj\n");
|
||||
P_ButteredSlope(mobj);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
|
||||
&& P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz
|
||||
|
@ -9649,14 +9545,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
P_SetScale(mobj, mobj->destscale);
|
||||
|
||||
mobj->floorz =
|
||||
#ifdef ESLOPE
|
||||
mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
|
||||
#endif
|
||||
mobj->subsector->sector->floorheight;
|
||||
mobj->ceilingz =
|
||||
#ifdef ESLOPE
|
||||
mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
|
||||
#endif
|
||||
mobj->subsector->sector->ceilingheight;
|
||||
|
||||
// Tells MobjCheckWater that the water height was not set.
|
||||
|
@ -10173,14 +10065,10 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
|
|||
P_SetPrecipitationThingPosition(mobj);
|
||||
|
||||
mobj->floorz = starting_floorz =
|
||||
#ifdef ESLOPE
|
||||
mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
|
||||
#endif
|
||||
mobj->subsector->sector->floorheight;
|
||||
mobj->ceilingz =
|
||||
#ifdef ESLOPE
|
||||
mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
|
||||
#endif
|
||||
mobj->subsector->sector->ceilingheight;
|
||||
|
||||
mobj->z = z;
|
||||
|
@ -10699,9 +10587,7 @@ void P_RespawnSpecials(void)
|
|||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->ceilingheight) - (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||
if (mthing->options & MTF_AMBUSH
|
||||
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
||||
|
@ -10711,9 +10597,7 @@ void P_RespawnSpecials(void)
|
|||
else
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->floorheight) + (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||
if (mthing->options & MTF_AMBUSH
|
||||
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
||||
|
@ -10970,14 +10854,10 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
|||
sector = R_PointInSubsector(x, y)->sector;
|
||||
|
||||
floor =
|
||||
#ifdef ESLOPE
|
||||
sector->f_slope ? P_GetZAt(sector->f_slope, x, y) :
|
||||
#endif
|
||||
sector->floorheight;
|
||||
ceiling =
|
||||
#ifdef ESLOPE
|
||||
sector->c_slope ? P_GetZAt(sector->c_slope, x, y) :
|
||||
#endif
|
||||
sector->ceilingheight;
|
||||
|
||||
if (mthing)
|
||||
|
@ -11049,14 +10929,10 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
|||
sector = R_PointInSubsector(mobj->x, mobj->y)->sector;
|
||||
|
||||
floor =
|
||||
#ifdef ESLOPE
|
||||
sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) :
|
||||
#endif
|
||||
sector->floorheight;
|
||||
ceiling =
|
||||
#ifdef ESLOPE
|
||||
sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) :
|
||||
#endif
|
||||
sector->ceilingheight;
|
||||
|
||||
if (mobj->player->kartstuff[k_starpostflip])
|
||||
|
@ -11231,9 +11107,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
|
||||
ss = R_PointInSubsector(mthing->x << FRACBITS, mthing->y << FRACBITS);
|
||||
mthing->z = (INT16)(((
|
||||
#ifdef ESLOPE
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, mthing->x << FRACBITS, mthing->y << FRACBITS) :
|
||||
#endif
|
||||
ss->sector->floorheight)>>FRACBITS) + (mthing->options >> ZSHIFT));
|
||||
|
||||
if (numhuntemeralds < MAXHUNTEMERALDS)
|
||||
|
@ -11349,9 +11223,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
|
||||
if (i == MT_NIGHTSBUMPER)
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->floorheight) + ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
else if (i == MT_AXIS || i == MT_AXISTRANSFER || i == MT_AXISTRANSFERLINE)
|
||||
z = ONFLOORZ;
|
||||
|
@ -11360,9 +11232,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->ceilingheight);
|
||||
|
||||
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
||||
|
@ -11375,9 +11245,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
else
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->floorheight);
|
||||
|
||||
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
||||
|
@ -11399,15 +11267,11 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
// base positions
|
||||
if (flip)
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->ceilingheight) - mobjinfo[i].height;
|
||||
else
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
#endif
|
||||
ss->sector->floorheight);
|
||||
|
||||
// offsetting
|
||||
|
@ -11974,9 +11838,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
//hoopcenter->flags |= MF_NOTHINK;
|
||||
|
||||
z +=
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight;
|
||||
|
||||
hoopcenter->z = z - hoopcenter->height/2;
|
||||
|
@ -12117,9 +11979,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
hoopcenter->spawnpoint = mthing;
|
||||
|
||||
z +=
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight;
|
||||
hoopcenter->z = z - hoopcenter->height/2;
|
||||
|
||||
|
@ -12239,9 +12099,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
else if (mthing->type == mobjinfo[MT_NIGHTSWING].doomednum)
|
||||
{
|
||||
z =
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12293,9 +12151,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
||||
#endif
|
||||
sec->ceilingheight) - mobjinfo[ringthing].height;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12303,9 +12159,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
else
|
||||
{
|
||||
z =
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12359,9 +12213,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
||||
#endif
|
||||
sec->ceilingheight) - mobjinfo[ringthing].height - dist*r;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12369,9 +12221,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
else
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight) + dist*r;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12417,9 +12267,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
sec->c_slope ? P_GetZAt(sec->c_slope, x, y) :
|
||||
#endif
|
||||
sec->ceilingheight) - mobjinfo[ringthing].height - 64*FRACUNIT*r;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12427,9 +12275,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
else
|
||||
{
|
||||
z = (
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight) + 64*FRACUNIT*r;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
@ -12462,9 +12308,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
|||
}
|
||||
|
||||
z =
|
||||
#ifdef ESLOPE
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
#endif
|
||||
sec->floorheight;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
|
|
|
@ -368,9 +368,7 @@ typedef struct mobj_s
|
|||
INT32 cusval;
|
||||
INT32 cvmem;
|
||||
|
||||
#ifdef ESLOPE
|
||||
struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?)
|
||||
#endif
|
||||
|
||||
boolean colorized; // Whether the mobj uses the rainbow colormap
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "r_state.h"
|
||||
#include "r_defs.h"
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
/*
|
||||
Theory behind Polyobjects:
|
||||
|
@ -2864,6 +2863,5 @@ INT32 EV_DoPolyObjFlag(line_t *pfdata)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#endif // ifdef POLYOBJECTS
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "r_defs.h"
|
||||
|
||||
// haleyjd: temporary define
|
||||
#ifdef POLYOBJECTS
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
|
@ -303,7 +302,6 @@ extern polyobj_t *PolyObjects;
|
|||
extern INT32 numPolyObjects;
|
||||
extern polymaplink_t **polyblocklinks; // polyobject blockmap
|
||||
|
||||
#endif // ifdef POLYOBJECTS
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,9 +30,7 @@
|
|||
#include "r_sky.h"
|
||||
#include "p_polyobj.h"
|
||||
#include "lua_script.h"
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h"
|
||||
#endif
|
||||
|
||||
savedata_t savedata;
|
||||
UINT8 *save_p;
|
||||
|
@ -949,9 +947,7 @@ typedef enum
|
|||
MD2_HPREV = 1<<8,
|
||||
MD2_COLORIZED = 1<<9,
|
||||
MD2_WAYPOINTCAP = 1<<10
|
||||
#ifdef ESLOPE
|
||||
, MD2_SLOPE = 1<<11
|
||||
#endif
|
||||
} mobj_diff2_t;
|
||||
|
||||
typedef enum
|
||||
|
@ -985,7 +981,6 @@ typedef enum
|
|||
tc_noenemies,
|
||||
tc_eachtime,
|
||||
tc_disappear,
|
||||
#ifdef POLYOBJECTS
|
||||
tc_polyrotate, // haleyjd 03/26/06: polyobjects
|
||||
tc_polymove,
|
||||
tc_polywaypoint,
|
||||
|
@ -993,7 +988,6 @@ typedef enum
|
|||
tc_polyswingdoor,
|
||||
tc_polyflag,
|
||||
tc_polydisplace,
|
||||
#endif
|
||||
tc_end
|
||||
} specials_e;
|
||||
|
||||
|
@ -1142,10 +1136,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
diff2 |= MD2_HNEXT;
|
||||
if (mobj->hprev)
|
||||
diff2 |= MD2_HPREV;
|
||||
#ifdef ESLOPE
|
||||
if (mobj->standingslope)
|
||||
diff2 |= MD2_SLOPE;
|
||||
#endif
|
||||
if (mobj->colorized)
|
||||
diff2 |= MD2_COLORIZED;
|
||||
if (mobj == waypointcap)
|
||||
|
@ -1265,10 +1257,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
WRITEUINT32(save_p, mobj->hnext->mobjnum);
|
||||
if (diff2 & MD2_HPREV)
|
||||
WRITEUINT32(save_p, mobj->hprev->mobjnum);
|
||||
#ifdef ESLOPE
|
||||
if (diff2 & MD2_SLOPE)
|
||||
WRITEUINT16(save_p, mobj->standingslope->id);
|
||||
#endif
|
||||
if (diff2 & MD2_COLORIZED)
|
||||
WRITEUINT8(save_p, mobj->colorized);
|
||||
|
||||
|
@ -1552,7 +1542,6 @@ static void SaveDisappearThinker(const thinker_t *th, const UINT8 type)
|
|||
WRITEINT32(save_p, ht->exists);
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
//
|
||||
// SavePolyrotateThinker
|
||||
|
@ -1662,7 +1651,6 @@ static void SavePolydisplaceThinker(const thinker_t *th, const UINT8 type)
|
|||
WRITEFIXED(save_p, ht->oldHeights);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
//
|
||||
// SaveWhatThinker
|
||||
|
@ -1842,7 +1830,6 @@ static void P_NetArchiveThinkers(void)
|
|||
SaveDisappearThinker(th, tc_disappear);
|
||||
continue;
|
||||
}
|
||||
#ifdef POLYOBJECTS
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
|
||||
{
|
||||
SavePolyrotatetThinker(th, tc_polyrotate);
|
||||
|
@ -1878,7 +1865,6 @@ static void P_NetArchiveThinkers(void)
|
|||
SavePolydisplaceThinker(th, tc_polydisplace);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef PARANOIA
|
||||
else if (th->function.acv != P_RemoveThinkerDelayed) // wait garbage collection
|
||||
I_Error("unknown thinker type %p", th->function.acp1);
|
||||
|
@ -2142,10 +2128,8 @@ static void LoadMobjThinker(actionf_p1 thinker)
|
|||
mobj->hnext = (mobj_t *)(size_t)READUINT32(save_p);
|
||||
if (diff2 & MD2_HPREV)
|
||||
mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p);
|
||||
#ifdef ESLOPE
|
||||
if (diff2 & MD2_SLOPE)
|
||||
mobj->standingslope = P_SlopeById(READUINT16(save_p));
|
||||
#endif
|
||||
if (diff2 & MD2_COLORIZED)
|
||||
mobj->colorized = READUINT8(save_p);
|
||||
|
||||
|
@ -2517,7 +2501,6 @@ static inline void LoadDisappearThinker(actionf_p1 thinker)
|
|||
P_AddThinker(&ht->thinker);
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
//
|
||||
// LoadPolyrotateThinker
|
||||
|
@ -2637,7 +2620,6 @@ static inline void LoadPolydisplaceThinker(actionf_p1 thinker)
|
|||
ht->oldHeights = READFIXED(save_p);
|
||||
P_AddThinker(&ht->thinker);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
//
|
||||
|
@ -2806,7 +2788,6 @@ static void P_NetUnArchiveThinkers(void)
|
|||
case tc_disappear:
|
||||
LoadDisappearThinker((actionf_p1)T_Disappear);
|
||||
break;
|
||||
#ifdef POLYOBJECTS
|
||||
case tc_polyrotate:
|
||||
LoadPolyrotatetThinker((actionf_p1)T_PolyObjRotate);
|
||||
break;
|
||||
|
@ -2834,7 +2815,6 @@ static void P_NetUnArchiveThinkers(void)
|
|||
case tc_polydisplace:
|
||||
LoadPolydisplaceThinker((actionf_p1)T_PolyObjDisplace);
|
||||
break;
|
||||
#endif
|
||||
case tc_scroll:
|
||||
LoadScrollThinker((actionf_p1)T_Scroll);
|
||||
break;
|
||||
|
@ -2875,7 +2855,6 @@ static void P_NetUnArchiveThinkers(void)
|
|||
//
|
||||
// haleyjd 03/26/06: PolyObject saving code
|
||||
//
|
||||
#ifdef POLYOBJECTS
|
||||
#define PD_FLAGS 0x01
|
||||
#define PD_TRANS 0x02
|
||||
|
||||
|
@ -2964,7 +2943,6 @@ static inline void P_UnArchivePolyObjects(void)
|
|||
for (i = 0; i < numSavedPolys; ++i)
|
||||
P_UnArchivePolyObj(&PolyObjects[i]);
|
||||
}
|
||||
#endif
|
||||
//
|
||||
// P_FinishMobjs
|
||||
//
|
||||
|
@ -3445,9 +3423,7 @@ void P_SaveNetGame(void)
|
|||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
P_NetArchiveWorld();
|
||||
#ifdef POLYOBJECTS
|
||||
P_ArchivePolyObjects();
|
||||
#endif
|
||||
P_NetArchiveThinkers();
|
||||
P_NetArchiveSpecials();
|
||||
}
|
||||
|
@ -3489,9 +3465,7 @@ boolean P_LoadNetGame(void)
|
|||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
P_NetUnArchiveWorld();
|
||||
#ifdef POLYOBJECTS
|
||||
P_UnArchivePolyObjects();
|
||||
#endif
|
||||
P_NetUnArchiveThinkers();
|
||||
P_NetUnArchiveSpecials();
|
||||
P_RelinkPointers();
|
||||
|
|
|
@ -78,9 +78,7 @@
|
|||
#include "hardware/hw_light.h"
|
||||
#endif
|
||||
|
||||
#ifdef ESLOPE
|
||||
#include "p_slopes.h"
|
||||
#endif
|
||||
|
||||
// SRB2Kart
|
||||
#include "k_kart.h"
|
||||
|
@ -1004,9 +1002,7 @@ static void P_LoadThings(void)
|
|||
|
||||
// Z for objects
|
||||
mt->z = (INT16)(
|
||||
#ifdef ESLOPE
|
||||
mtsector->f_slope ? P_GetZAt(mtsector->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) :
|
||||
#endif
|
||||
mtsector->floorheight)>>FRACBITS;
|
||||
|
||||
if (mt->type == 1700 // MT_AXIS
|
||||
|
@ -1277,9 +1273,7 @@ static void P_LoadRawLineDefs(UINT8 *data, size_t i)
|
|||
if (ld->sidenum[1] != 0xffff && ld->special)
|
||||
sides[ld->sidenum[1]].special = ld->special;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
ld->polyobj = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1949,11 +1943,9 @@ static void P_CreateBlockMap(void)
|
|||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
blockmap = blockmaplump + 4;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 2/22/06: setup polyobject blockmap
|
||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2026,11 +2018,9 @@ static boolean P_LoadBlockMap(lumpnum_t lumpnum)
|
|||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
blockmap = blockmaplump+4;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 2/22/06: setup polyobject blockmap
|
||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
#endif
|
||||
return true;
|
||||
/* Original
|
||||
blockmaplump = W_CacheLumpNum(lump, PU_LEVEL);
|
||||
|
@ -2092,11 +2082,9 @@ static boolean P_LoadRawBlockMap(UINT8 *data, size_t count, const char *lumpname
|
|||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
blockmap = blockmaplump+4;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 2/22/06: setup polyobject blockmap
|
||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
#endif
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
@ -3116,9 +3104,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
P_ResetDynamicSlopes();
|
||||
#endif
|
||||
|
||||
P_LoadThings();
|
||||
|
||||
|
|
|
@ -99,7 +99,6 @@ static fixed_t P_InterceptVector2(divline_t *v2, divline_t *v1)
|
|||
return frac;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -145,7 +144,6 @@ static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_CrossSubsector
|
||||
|
@ -156,9 +154,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
|||
{
|
||||
seg_t *seg;
|
||||
INT32 count;
|
||||
#ifdef POLYOBJECTS
|
||||
polyobj_t *po; // haleyjd 02/23/06
|
||||
#endif
|
||||
|
||||
#ifdef RANGECHECK
|
||||
if (num >= numsubsectors)
|
||||
|
@ -168,7 +164,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
|||
// haleyjd 02/23/06: this assignment should be after the above check
|
||||
seg = segs + subsectors[num].firstline;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/23/06: check polyobject lines
|
||||
if ((po = subsectors[num].polyList))
|
||||
{
|
||||
|
@ -183,7 +178,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
|||
po = (polyobj_t *)(po->link.next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (count = subsectors[num].numlines; --count >= 0; seg++) // check lines
|
||||
{
|
||||
|
@ -334,15 +328,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
|
|||
|
||||
// killough 11/98: shortcut for melee situations
|
||||
// same subsector? obviously visible
|
||||
#ifndef POLYOBJECTS
|
||||
if (t1->subsector == t2->subsector)
|
||||
return true;
|
||||
#else
|
||||
// haleyjd 02/23/06: can't do this if there are polyobjects in the subsec
|
||||
if (!t1->subsector->polyList &&
|
||||
t1->subsector == t2->subsector)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
// An unobstructed LOS is possible.
|
||||
// Now look from eyes of t1 to any part of t2.
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "p_maputl.h"
|
||||
#include "w_wad.h"
|
||||
|
||||
#ifdef ESLOPE
|
||||
|
||||
static pslope_t *slopelist = NULL;
|
||||
static UINT16 slopecount = 0;
|
||||
|
@ -620,7 +619,6 @@ void P_ResetDynamicSlopes(void) {
|
|||
size_t i;
|
||||
#ifdef ESLOPE_TYPESHIM // Rewrite old specials to new ones, and give a console warning
|
||||
boolean warned = false;
|
||||
#endif
|
||||
|
||||
slopelist = NULL;
|
||||
slopecount = 0;
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#ifndef P_SLOPES_H__
|
||||
#define P_SLOPES_H__
|
||||
|
||||
#ifdef ESLOPE
|
||||
void P_CalculateSlopeNormal(pslope_t *slope);
|
||||
void P_ResetDynamicSlopes(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_ButteredSlope(mobj_t *mo);
|
||||
|
||||
#endif
|
||||
|
||||
// EOF
|
||||
#endif // #ifdef ESLOPE
|
||||
|
|
18
src/p_spec.c
18
src/p_spec.c
|
@ -1242,7 +1242,6 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
|
|||
}
|
||||
|
||||
// haleyjd: temporary define
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
//
|
||||
// PolyDoor
|
||||
|
@ -1451,7 +1450,6 @@ static boolean PolyDisplace(line_t *line)
|
|||
return EV_DoPolyObjDisplace(&pdd);
|
||||
}
|
||||
|
||||
#endif // ifdef POLYOBJECTS
|
||||
|
||||
/** Changes a sector's tag.
|
||||
* Used by the linedef executor tag changer and by crumblers.
|
||||
|
@ -3200,7 +3198,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
break;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
case 480: // Polyobj_DoorSlide
|
||||
case 481: // Polyobj_DoorSwing
|
||||
PolyDoor(line);
|
||||
|
@ -3227,7 +3224,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
case 491:
|
||||
PolyTranslucency(line);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -4984,10 +4980,8 @@ void P_UpdateSpecials(void)
|
|||
// POINT LIMIT
|
||||
P_CheckPointLimit();
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Dynamic slopeness
|
||||
P_RunDynamicSlopes();
|
||||
#endif
|
||||
|
||||
// ANIMATE TEXTURES
|
||||
for (anim = anims; anim < lastanim; anim++)
|
||||
|
@ -5132,11 +5126,9 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
|||
ffloor->topyoffs = &sec2->ceiling_yoffs;
|
||||
ffloor->topangle = &sec2->ceilingpic_angle;
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Add slopes
|
||||
ffloor->t_slope = &sec2->c_slope;
|
||||
ffloor->b_slope = &sec2->f_slope;
|
||||
#endif
|
||||
|
||||
if ((flags & FF_SOLID) && (master->flags & ML_EFFECT1)) // Block player only
|
||||
flags &= ~FF_BLOCKOTHERS;
|
||||
|
@ -5583,15 +5575,11 @@ void T_LaserFlash(laserthink_t *flash)
|
|||
|
||||
sourcesec = ffloor->master->frontsector; // Less to type!
|
||||
|
||||
#ifdef ESLOPE
|
||||
top = (*ffloor->t_slope) ? P_GetZAt(*ffloor->t_slope, sector->soundorg.x, sector->soundorg.y)
|
||||
: *ffloor->topheight;
|
||||
bottom = (*ffloor->b_slope) ? P_GetZAt(*ffloor->b_slope, sector->soundorg.x, sector->soundorg.y)
|
||||
: *ffloor->bottomheight;
|
||||
sector->soundorg.z = (top + bottom)/2;
|
||||
#else
|
||||
sector->soundorg.z = (*ffloor->topheight + *ffloor->bottomheight)/2;
|
||||
#endif
|
||||
S_StartSound(§or->soundorg, sfx_laser);
|
||||
|
||||
// Seek out objects to DESTROY! MUAHAHHAHAHAA!!!*cough*
|
||||
|
@ -6688,13 +6676,11 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
sectors[s].midmap = lines[i].frontsector->midmap;
|
||||
break;
|
||||
|
||||
#ifdef ESLOPE // Slope copy specials. Handled here for sanity.
|
||||
case 720:
|
||||
case 721:
|
||||
case 722:
|
||||
P_CopySectorSlope(&lines[i]);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -6708,7 +6694,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
|
||||
Z_Free(secthinkers);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/20/06: spawn polyobjects
|
||||
Polyobj_InitLevel();
|
||||
|
||||
|
@ -6725,7 +6710,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
P_RunLevelLoadExecutors();
|
||||
}
|
||||
|
@ -7246,11 +7230,9 @@ void T_Disappear(disappear_t *d)
|
|||
|
||||
if (!(lines[d->sourceline].flags & ML_NOCLIMB))
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
sectors[s].soundorg.z = P_GetZAt(*rover->t_slope, sectors[s].soundorg.x, sectors[s].soundorg.y);
|
||||
else
|
||||
#endif
|
||||
sectors[s].soundorg.z = *rover->topheight;
|
||||
S_StartSound(§ors[s].soundorg, sfx_appear);
|
||||
}
|
||||
|
|
102
src/p_user.c
102
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)
|
||||
continue;
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (mo->z + (mo->height/2) > topheight)
|
||||
continue;
|
||||
|
@ -1821,13 +1816,8 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
|
|||
if (!(rover->flags & FF_QUICKSAND))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (mo->z + flipoffset > topheight)
|
||||
continue;
|
||||
|
@ -1966,9 +1956,7 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
fixed_t oldx;
|
||||
fixed_t oldy;
|
||||
fixed_t oldz;
|
||||
#ifdef ESLOPE
|
||||
vector3_t momentum;
|
||||
#endif
|
||||
|
||||
oldx = player->mo->x;
|
||||
oldy = player->mo->y;
|
||||
|
@ -2023,7 +2011,6 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
{
|
||||
fixed_t newmom;
|
||||
|
||||
#ifdef ESLOPE
|
||||
pslope_t *slope;
|
||||
if (abs(oldz - topheight) < abs(oldz + player->mo->height - bottomheight)) { // Hit top
|
||||
slope = *rover->t_slope;
|
||||
|
@ -2039,9 +2026,6 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
P_ReverseQuantizeMomentumToSlope(&momentum, slope);
|
||||
|
||||
newmom = momentum.z = -FixedMul(momentum.z,linedist)/2;
|
||||
#else
|
||||
newmom = -FixedMul(player->mo->momz,linedist);
|
||||
#endif
|
||||
|
||||
if (abs(newmom) < (linedist*2))
|
||||
{
|
||||
|
@ -2064,7 +2048,6 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
else if (newmom < -P_GetPlayerHeight(player)/2)
|
||||
newmom = -P_GetPlayerHeight(player)/2;
|
||||
|
||||
#ifdef ESLOPE
|
||||
momentum.z = newmom*2;
|
||||
|
||||
if (slope)
|
||||
|
@ -2073,9 +2056,6 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
player->mo->momx = momentum.x;
|
||||
player->mo->momy = momentum.y;
|
||||
player->mo->momz = momentum.z/2;
|
||||
#else
|
||||
player->mo->momz = newmom;
|
||||
#endif
|
||||
|
||||
if (player->pflags & PF_SPINNING)
|
||||
{
|
||||
|
@ -2132,13 +2112,8 @@ static void P_CheckQuicksand(player_t *player)
|
|||
if (!(rover->flags & FF_QUICKSAND))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height)
|
||||
{
|
||||
|
@ -2506,15 +2481,10 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
|||
floorclimb = true;
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y)
|
||||
: glidesector->sector->floorheight;
|
||||
ceilingheight = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y)
|
||||
: glidesector->sector->ceilingheight;
|
||||
#else
|
||||
floorheight = glidesector->sector->floorheight;
|
||||
ceilingheight = glidesector->sector->ceilingheight;
|
||||
#endif
|
||||
|
||||
if (glidesector->sector->ffloors)
|
||||
{
|
||||
|
@ -2528,13 +2498,8 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
|||
|
||||
floorclimb = true;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
// Only supports rovers that are moving like an 'elevator', not just the top or bottom.
|
||||
if (rover->master->frontsector->floorspeed && rover->master->frontsector->ceilspeed == 42)
|
||||
|
@ -2575,11 +2540,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
|||
if (roverbelow == rover)
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
bottomheight2 = *roverbelow->b_slope ? P_GetZAt(*roverbelow->b_slope, player->mo->x, player->mo->y) : *roverbelow->bottomheight;
|
||||
#else
|
||||
bottomheight2 = *roverbelow->bottomheight;
|
||||
#endif
|
||||
|
||||
if (bottomheight2 < topheight + FixedMul(16*FRACUNIT, player->mo->scale))
|
||||
foundfof = true;
|
||||
|
@ -2625,11 +2586,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
|||
if (roverbelow == rover)
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight2 = *roverbelow->t_slope ? P_GetZAt(*roverbelow->t_slope, player->mo->x, player->mo->y) : *roverbelow->topheight;
|
||||
#else
|
||||
topheight2 = *roverbelow->topheight;
|
||||
#endif
|
||||
|
||||
if (topheight2 > bottomheight - FixedMul(16*FRACUNIT, player->mo->scale))
|
||||
foundfof = true;
|
||||
|
@ -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))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (bottomheight < floorheight + FixedMul(16*FRACUNIT, player->mo->scale))
|
||||
{
|
||||
|
@ -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))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
#endif
|
||||
|
||||
if (topheight > ceilingheight - FixedMul(16*FRACUNIT, player->mo->scale))
|
||||
{
|
||||
|
@ -3102,12 +3051,10 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
|
|||
|
||||
ceilingheight = sec->ceilingheight;
|
||||
floorheight = sec->floorheight;
|
||||
#ifdef ESLOPE
|
||||
if (sec->c_slope)
|
||||
ceilingheight = P_GetZAt(sec->c_slope, checkx, checky);
|
||||
if (sec->f_slope)
|
||||
floorheight = P_GetZAt(sec->f_slope, checkx, checky);
|
||||
#endif
|
||||
highestceilingheight = (ceilingheight > highestceilingheight) ? ceilingheight : highestceilingheight;
|
||||
lowestfloorheight = (floorheight < lowestfloorheight) ? floorheight : lowestfloorheight;
|
||||
|
||||
|
@ -3118,13 +3065,8 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
|
|||
{
|
||||
if (!(rover->flags & FF_EXISTS)) continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (P_CheckSolidLava(player->mo, rover))
|
||||
;
|
||||
|
@ -3196,7 +3138,6 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
|
|||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
// Polyobjects
|
||||
#ifdef POLYOBJECTS
|
||||
validcount++;
|
||||
|
||||
for (by = yl; by <= yh; by++)
|
||||
|
@ -3290,7 +3231,6 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused.
|
|||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (teeter) // only bother with objects as a last resort if you were already teetering
|
||||
{
|
||||
mobj_t *oldtmthing = tmthing;
|
||||
|
@ -3583,9 +3523,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
|||
&& !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)
|
||||
#ifdef ESLOPE
|
||||
&& (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
player->mo->momx = player->cmomx;
|
||||
|
@ -3616,9 +3554,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
|||
// 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))
|
||||
&& !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)
|
||||
#endif
|
||||
) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING))
|
||||
{
|
||||
player->pflags |= PF_SPINNING;
|
||||
|
@ -3632,9 +3568,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
|||
// Rolling normally
|
||||
if (onground && player->pflags & PF_SPINNING && !(player->pflags & PF_STARTDASH)
|
||||
&& 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)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (GETSECSPECIAL(player->mo->subsector->sector->special, 4) == 7 || (player->mo->ceilingz - player->mo->floorz < P_GetPlayerHeight(player)))
|
||||
|
@ -3873,9 +3807,7 @@ static void P_2dMovement(player_t *player)
|
|||
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
||||
player->cmomx = player->cmomy = 0;
|
||||
else if (player->onconveyor != 2 && player->onconveyor != 4
|
||||
#ifdef POLYOBJECTS
|
||||
&& player->onconveyor != 1
|
||||
#endif
|
||||
)
|
||||
player->cmomx = player->cmomy = 0;
|
||||
|
||||
|
@ -4023,12 +3955,10 @@ static void P_3dMovement(player_t *player)
|
|||
//fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
||||
boolean analogmove = false;
|
||||
fixed_t oldMagnitude, newMagnitude;
|
||||
#ifdef ESLOPE
|
||||
vector3_t totalthrust;
|
||||
|
||||
totalthrust.x = totalthrust.y = 0; // I forget if this is needed
|
||||
totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes
|
||||
#endif // ESLOPE
|
||||
|
||||
// Get the old momentum; this will be needed at the end of the function! -SH
|
||||
oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
||||
|
@ -4072,9 +4002,7 @@ static void P_3dMovement(player_t *player)
|
|||
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
||||
player->cmomx = player->cmomy = 0;
|
||||
else if (player->onconveyor != 2 && player->onconveyor != 4
|
||||
#ifdef POLYOBJECTS
|
||||
&& player->onconveyor != 1
|
||||
#endif
|
||||
)
|
||||
player->cmomx = player->cmomy = 0;
|
||||
|
||||
|
@ -4152,12 +4080,8 @@ static void P_3dMovement(player_t *player)
|
|||
movepushforward = 0;
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
|
||||
totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward);
|
||||
#else
|
||||
P_Thrust(player->mo, movepushangle, movepushforward);
|
||||
#endif
|
||||
}
|
||||
else if (!(player->kartstuff[k_spinouttimer]))
|
||||
{
|
||||
|
@ -4172,15 +4096,10 @@ static void P_3dMovement(player_t *player)
|
|||
else
|
||||
movepushside = (cmd->sidemove * FRACUNIT/128) - FixedDiv(player->speed, K_GetKartSpeed(player, true));
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, movepushsideangle, movepushside);
|
||||
totalthrust.y += P_ReturnThrustY(player->mo, movepushsideangle, movepushside);
|
||||
#else
|
||||
P_Thrust(player->mo, movepushsideangle, movepushside);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
if ((totalthrust.x || totalthrust.y)
|
||||
&& player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) {
|
||||
// Factor thrust to slope, but only for the part pushing up it!
|
||||
|
@ -4200,7 +4119,6 @@ static void P_3dMovement(player_t *player)
|
|||
|
||||
player->mo->momx += totalthrust.x;
|
||||
player->mo->momy += totalthrust.y;
|
||||
#endif
|
||||
|
||||
// Time to ask three questions:
|
||||
// 1) Are we over topspeed?
|
||||
|
@ -5601,14 +5519,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));
|
||||
newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale));
|
||||
#ifdef ESLOPE
|
||||
if (player->mo->standingslope)
|
||||
{
|
||||
ground = P_GetZAt(player->mo->standingslope, newx, newy);
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale);
|
||||
}
|
||||
#endif
|
||||
flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE);
|
||||
P_SetTarget(&flame->target, player->mo);
|
||||
flame->angle = travelangle;
|
||||
|
@ -7845,7 +7761,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if floorz/ceilingz need to be altered
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
|
@ -7924,7 +7839,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// crushed camera
|
||||
if (myceilingz <= myfloorz + thiscam->height && !resetcalled && !cameranoclip)
|
||||
|
@ -8204,13 +8118,8 @@ static void P_CalcPostImg(player_t *player)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (pviewheight >= topheight || pviewheight <= bottomheight)
|
||||
continue;
|
||||
|
@ -8232,13 +8141,8 @@ static void P_CalcPostImg(player_t *player)
|
|||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER)
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
|
||||
bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
|
||||
#else
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (pviewheight >= topheight || pviewheight <= bottomheight)
|
||||
continue;
|
||||
|
@ -8513,9 +8417,7 @@ void P_PlayerThink(player_t *player)
|
|||
P_MobjCheckWater(player->mo);
|
||||
|
||||
#ifndef SECTORSPECIALSAFTERTHINK
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||
#endif
|
||||
player->onconveyor = 0;
|
||||
// check special sectors : damage & secrets
|
||||
|
||||
|
@ -8673,10 +8575,8 @@ void P_PlayerThink(player_t *player)
|
|||
// it lasts for one tic.
|
||||
player->pflags &= ~PF_FULLSTASIS;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor == 1)
|
||||
player->cmomy = player->cmomx = 0;
|
||||
#endif
|
||||
|
||||
//P_DoSuperStuff(player);
|
||||
//P_CheckSneakerAndLivesTimer(player);
|
||||
|
@ -8924,9 +8824,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
cmd = &player->cmd;
|
||||
|
||||
#ifdef SECTORSPECIALSAFTERTHINK
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||
#endif
|
||||
player->onconveyor = 0;
|
||||
// check special sectors : damage & secrets
|
||||
|
||||
|
|
88
src/r_bsp.c
88
src/r_bsp.c
|
@ -371,15 +371,11 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
|||
boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back)
|
||||
{
|
||||
return (
|
||||
#ifdef POLYOBJECTS
|
||||
!line->polyseg &&
|
||||
#endif
|
||||
back->ceilingpic == front->ceilingpic
|
||||
&& back->floorpic == front->floorpic
|
||||
#ifdef ESLOPE
|
||||
&& back->f_slope == front->f_slope
|
||||
&& back->c_slope == front->c_slope
|
||||
#endif
|
||||
&& back->lightlevel == front->lightlevel
|
||||
&& !line->sidedef->midtexture
|
||||
// Check offsets too!
|
||||
|
@ -494,7 +490,6 @@ static void R_AddLine(seg_t *line)
|
|||
doorclosed = 0;
|
||||
|
||||
// Closed door.
|
||||
#ifdef ESLOPE
|
||||
if (frontsector->f_slope || frontsector->c_slope || backsector->f_slope || backsector->c_slope)
|
||||
{
|
||||
fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
|
||||
|
@ -537,7 +532,6 @@ static void R_AddLine(seg_t *line)
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (viewsector != backsector && viewsector != frontsector)
|
||||
{
|
||||
|
@ -654,7 +648,6 @@ static boolean R_CheckBBox(const fixed_t *bspcoord)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
size_t numpolys; // number of polyobjects in current subsector
|
||||
size_t num_po_ptrs; // number of polyobject pointers allocated
|
||||
|
@ -819,7 +812,6 @@ static void R_AddPolyObjects(subsector_t *sub)
|
|||
R_AddLine(po_ptrs[i]->segs[j]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// R_Subsector
|
||||
|
@ -860,15 +852,11 @@ static void R_Subsector(size_t num)
|
|||
floorcolormap = ceilingcolormap = frontsector->extra_colormap;
|
||||
|
||||
floorcenterz =
|
||||
#ifdef ESLOPE
|
||||
frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
|
||||
#endif
|
||||
frontsector->floorheight;
|
||||
|
||||
ceilingcenterz =
|
||||
#ifdef ESLOPE
|
||||
frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
|
||||
#endif
|
||||
frontsector->ceilingheight;
|
||||
|
||||
// Check and prep all 3D floors. Set the sector floor/ceiling light levels and colormaps.
|
||||
|
@ -896,29 +884,21 @@ static void R_Subsector(size_t num)
|
|||
sub->sector->extra_colormap = frontsector->extra_colormap;
|
||||
|
||||
if (((
|
||||
#ifdef ESLOPE
|
||||
frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) :
|
||||
#endif
|
||||
frontsector->floorheight) < viewz || (frontsector->heightsec != -1
|
||||
&& sectors[frontsector->heightsec].ceilingpic == skyflatnum)))
|
||||
{
|
||||
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
|
||||
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
, frontsector->f_slope
|
||||
#endif
|
||||
, R_NoEncore(frontsector, false));
|
||||
}
|
||||
else
|
||||
floorplane = NULL;
|
||||
|
||||
if (((
|
||||
#ifdef ESLOPE
|
||||
frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) :
|
||||
#endif
|
||||
frontsector->ceilingheight) > viewz || frontsector->ceilingpic == skyflatnum
|
||||
|| (frontsector->heightsec != -1
|
||||
&& sectors[frontsector->heightsec].floorpic == skyflatnum)))
|
||||
|
@ -926,21 +906,15 @@ static void R_Subsector(size_t num)
|
|||
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
|
||||
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
|
||||
ceilingcolormap, NULL
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
, frontsector->c_slope
|
||||
#endif
|
||||
, R_NoEncore(frontsector, true));
|
||||
}
|
||||
else
|
||||
ceilingplane = NULL;
|
||||
|
||||
numffloors = 0;
|
||||
#ifdef ESLOPE
|
||||
ffloor[numffloors].slope = NULL;
|
||||
#endif
|
||||
ffloor[numffloors].plane = NULL;
|
||||
ffloor[numffloors].polyobj = NULL;
|
||||
if (frontsector->ffloors)
|
||||
|
@ -966,15 +940,11 @@ static void R_Subsector(size_t num)
|
|||
ffloor[numffloors].polyobj = NULL;
|
||||
|
||||
heightcheck =
|
||||
#ifdef ESLOPE
|
||||
*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) :
|
||||
#endif
|
||||
*rover->bottomheight;
|
||||
|
||||
planecenterz =
|
||||
#ifdef ESLOPE
|
||||
*rover->b_slope ? P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
|
||||
#endif
|
||||
*rover->bottomheight;
|
||||
if (planecenterz <= ceilingcenterz
|
||||
&& planecenterz >= floorcenterz
|
||||
|
@ -987,21 +957,15 @@ static void R_Subsector(size_t num)
|
|||
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
|
||||
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
|
||||
*rover->bottomyoffs, *rover->bottomangle, frontsector->lightlist[light].extra_colormap, rover
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
, *rover->b_slope
|
||||
#endif
|
||||
, R_NoEncore(rover->master->frontsector, true));
|
||||
|
||||
#ifdef ESLOPE
|
||||
ffloor[numffloors].slope = *rover->b_slope;
|
||||
|
||||
// Tell the renderer this sector has slopes in it.
|
||||
if (ffloor[numffloors].slope)
|
||||
frontsector->hasslope = true;
|
||||
#endif
|
||||
|
||||
ffloor[numffloors].height = heightcheck;
|
||||
ffloor[numffloors].ffloor = rover;
|
||||
|
@ -1013,15 +977,11 @@ static void R_Subsector(size_t num)
|
|||
ffloor[numffloors].polyobj = NULL;
|
||||
|
||||
heightcheck =
|
||||
#ifdef ESLOPE
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) :
|
||||
#endif
|
||||
*rover->topheight;
|
||||
|
||||
planecenterz =
|
||||
#ifdef ESLOPE
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
|
||||
#endif
|
||||
*rover->topheight;
|
||||
if (planecenterz >= floorcenterz
|
||||
&& planecenterz <= ceilingcenterz
|
||||
|
@ -1033,21 +993,15 @@ static void R_Subsector(size_t num)
|
|||
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
|
||||
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
|
||||
frontsector->lightlist[light].extra_colormap, rover
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
, *rover->t_slope
|
||||
#endif
|
||||
, R_NoEncore(rover->master->frontsector, false));
|
||||
|
||||
#ifdef ESLOPE
|
||||
ffloor[numffloors].slope = *rover->t_slope;
|
||||
|
||||
// Tell the renderer this sector has slopes in it.
|
||||
if (ffloor[numffloors].slope)
|
||||
frontsector->hasslope = true;
|
||||
#endif
|
||||
|
||||
ffloor[numffloors].height = heightcheck;
|
||||
ffloor[numffloors].ffloor = rover;
|
||||
|
@ -1056,7 +1010,6 @@ static void R_Subsector(size_t num)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Polyobjects have planes, too!
|
||||
if (sub->polyList)
|
||||
{
|
||||
|
@ -1086,16 +1039,12 @@ static void R_Subsector(size_t num)
|
|||
polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
|
||||
polysec->floorpic_angle-po->angle,
|
||||
NULL, NULL, po
|
||||
#ifdef ESLOPE
|
||||
, NULL // will ffloors be slopable eventually?
|
||||
#endif
|
||||
, R_NoEncore(polysec, false));
|
||||
|
||||
ffloor[numffloors].height = polysec->floorheight;
|
||||
ffloor[numffloors].polyobj = po;
|
||||
#ifdef ESLOPE
|
||||
ffloor[numffloors].slope = NULL;
|
||||
#endif
|
||||
// ffloor[numffloors].ffloor = rover;
|
||||
po->visplane = ffloor[numffloors].plane;
|
||||
numffloors++;
|
||||
|
@ -1115,16 +1064,12 @@ static void R_Subsector(size_t num)
|
|||
polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs,
|
||||
polysec->ceilingpic_angle-po->angle,
|
||||
NULL, NULL, po
|
||||
#ifdef ESLOPE
|
||||
, NULL // will ffloors be slopable eventually?
|
||||
#endif
|
||||
, R_NoEncore(polysec, true));
|
||||
|
||||
ffloor[numffloors].polyobj = po;
|
||||
ffloor[numffloors].height = polysec->ceilingheight;
|
||||
#ifdef ESLOPE
|
||||
ffloor[numffloors].slope = NULL;
|
||||
#endif
|
||||
// ffloor[numffloors].ffloor = rover;
|
||||
po->visplane = ffloor[numffloors].plane;
|
||||
numffloors++;
|
||||
|
@ -1133,7 +1078,6 @@ static void R_Subsector(size_t num)
|
|||
po = (polyobj_t *)(po->link.next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FLOORSPLATS
|
||||
if (sub->splats)
|
||||
|
@ -1156,18 +1100,14 @@ static void R_Subsector(size_t num)
|
|||
|
||||
firstseg = NULL;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/19/06: draw polyobjects before static lines
|
||||
if (sub->polyList)
|
||||
R_AddPolyObjects(sub);
|
||||
#endif
|
||||
|
||||
while (count--)
|
||||
{
|
||||
// CONS_Debug(DBG_GAMELOGIC, "Adding normal line %d...(%d)\n", line->linedef-lines, leveltime);
|
||||
#ifdef POLYOBJECTS
|
||||
if (!line->polyseg) // ignore segs that belong to polyobjects
|
||||
#endif
|
||||
R_AddLine(line);
|
||||
line++;
|
||||
curline = NULL; /* cph 2001/11/18 - must clear curline now we're done with it, so stuff doesn't try using it for other things */
|
||||
|
@ -1186,11 +1126,9 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
fixed_t bestheight, maxheight;
|
||||
INT32 count, i, mapnum;
|
||||
sector_t *sec;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *bestslope = NULL;
|
||||
fixed_t heighttest; // I think it's better to check the Z height at the sector's center
|
||||
// than assume unsloped heights are accurate indicators of order in sloped sectors. -Red
|
||||
#endif
|
||||
|
||||
count = 1;
|
||||
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||
|
@ -1213,14 +1151,10 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
else
|
||||
memset(sector->lightlist, 0, sizeof (lightlist_t) * count);
|
||||
|
||||
#ifdef ESLOPE
|
||||
heighttest = sector->c_slope ? P_GetZAt(sector->c_slope, sector->soundorg.x, sector->soundorg.y) : sector->ceilingheight;
|
||||
|
||||
sector->lightlist[0].height = heighttest + 1;
|
||||
sector->lightlist[0].slope = sector->c_slope;
|
||||
#else
|
||||
sector->lightlist[0].height = sector->ceilingheight + 1;
|
||||
#endif
|
||||
sector->lightlist[0].lightlevel = §or->lightlevel;
|
||||
sector->lightlist[0].caster = NULL;
|
||||
sector->lightlist[0].extra_colormap = sector->extra_colormap;
|
||||
|
@ -1238,7 +1172,6 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
&& !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES)))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
heighttest = *rover->t_slope ? P_GetZAt(*rover->t_slope, sector->soundorg.x, sector->soundorg.y) : *rover->topheight;
|
||||
|
||||
if (heighttest > bestheight && heighttest < maxheight)
|
||||
|
@ -1260,21 +1193,6 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (*rover->topheight > bestheight && *rover->topheight < maxheight)
|
||||
{
|
||||
best = rover;
|
||||
bestheight = *rover->topheight;
|
||||
continue;
|
||||
}
|
||||
if (rover->flags & FF_DOUBLESHADOW && *rover->bottomheight > bestheight
|
||||
&& *rover->bottomheight < maxheight)
|
||||
{
|
||||
best = rover;
|
||||
bestheight = *rover->bottomheight;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (!best)
|
||||
{
|
||||
|
@ -1285,9 +1203,7 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
sector->lightlist[i].height = maxheight = bestheight;
|
||||
sector->lightlist[i].caster = best;
|
||||
sector->lightlist[i].flags = best->flags;
|
||||
#ifdef ESLOPE
|
||||
sector->lightlist[i].slope = bestslope;
|
||||
#endif
|
||||
sec = §ors[best->secnum];
|
||||
mapnum = sec->midmap;
|
||||
if (mapnum >= 0 && (size_t)mapnum < num_extra_colormaps)
|
||||
|
@ -1313,12 +1229,8 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
|
||||
if (best->flags & FF_DOUBLESHADOW)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
heighttest = *best->b_slope ? P_GetZAt(*best->b_slope, sector->soundorg.x, sector->soundorg.y) : *best->bottomheight;
|
||||
if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red
|
||||
#else
|
||||
if (bestheight == *best->bottomheight)
|
||||
#endif
|
||||
{
|
||||
sector->lightlist[i].lightlevel = sector->lightlist[best->lastlight].lightlevel;
|
||||
sector->lightlist[i].extra_colormap =
|
||||
|
|
|
@ -44,13 +44,11 @@ void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2);
|
|||
// no longer a static since this is used for encore in hw_main.c as well now:
|
||||
boolean R_NoEncore(sector_t *sector, boolean ceiling);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
void R_SortPolyObjects(subsector_t *sub);
|
||||
|
||||
extern size_t numpolys; // number of polyobjects in current subsector
|
||||
extern size_t num_po_ptrs; // number of polyobject pointers allocated
|
||||
extern polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
|
||||
#endif
|
||||
|
||||
sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
INT32 *ceilinglightlevel, boolean back);
|
||||
|
|
18
src/r_defs.h
18
src/r_defs.h
|
@ -91,9 +91,7 @@ typedef struct
|
|||
fixed_t z; ///< Z coordinate.
|
||||
} degenmobj_t;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
#include "p_polyobj.h"
|
||||
#endif
|
||||
|
||||
// Store fake planes in a resizable array insted of just by
|
||||
// heightsec. Allows for multiple fake planes.
|
||||
|
@ -155,11 +153,9 @@ typedef struct ffloor_s
|
|||
fixed_t *bottomyoffs;
|
||||
angle_t *bottomangle;
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Pointers to pointers. Yup.
|
||||
struct pslope_s **t_slope;
|
||||
struct pslope_s **b_slope;
|
||||
#endif
|
||||
|
||||
size_t secnum;
|
||||
ffloortype_e flags;
|
||||
|
@ -190,9 +186,7 @@ typedef struct lightlist_s
|
|||
extracolormap_t *extra_colormap;
|
||||
INT32 flags;
|
||||
ffloor_t *caster;
|
||||
#ifdef ESLOPE
|
||||
struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh.
|
||||
#endif
|
||||
} lightlist_t;
|
||||
|
||||
|
||||
|
@ -226,7 +220,6 @@ typedef struct linechain_s
|
|||
|
||||
|
||||
// Slopes
|
||||
#ifdef ESLOPE
|
||||
typedef enum {
|
||||
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
|
||||
|
@ -269,7 +262,6 @@ typedef struct pslope_s
|
|||
|
||||
struct pslope_s *next; // Make a linked list of dynamic slopes, for easy reference later
|
||||
} pslope_t;
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -376,12 +368,10 @@ typedef struct sector_s
|
|||
precipmobj_t *preciplist;
|
||||
struct mprecipsecnode_s *touching_preciplist;
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Eternity engine slope
|
||||
pslope_t *f_slope; // floor slope
|
||||
pslope_t *c_slope; // ceiling slope
|
||||
boolean hasslope; // The sector, or one of its visible FOFs, contains a slope
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
@ -437,9 +427,7 @@ typedef struct line_s
|
|||
void *splats; // wallsplat_t list
|
||||
#endif
|
||||
INT32 firsttag, nexttag; // improves searches for tags.
|
||||
#ifdef POLYOBJECTS
|
||||
polyobj_t *polyobj; // Belongs to a polyobject?
|
||||
#endif
|
||||
|
||||
char *text; // a concatination of all front and back texture names, for linedef specials that require a string.
|
||||
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
||||
|
@ -481,9 +469,7 @@ typedef struct subsector_s
|
|||
sector_t *sector;
|
||||
INT16 numlines;
|
||||
UINT16 firstline;
|
||||
#ifdef POLYOBJECTS
|
||||
struct polyobj_s *polyList; // haleyjd 02/19/06: list of polyobjects
|
||||
#endif
|
||||
#if 1//#ifdef FLOORSPLATS
|
||||
void *splats; // floorsplat_t list
|
||||
#endif
|
||||
|
@ -559,10 +545,8 @@ typedef struct seg_s
|
|||
// Why slow things down by calculating lightlists for every thick side?
|
||||
size_t numlights;
|
||||
r_lightlist_t *rlights;
|
||||
#ifdef POLYOBJECTS
|
||||
polyobj_t *polyseg;
|
||||
boolean dontrenderme;
|
||||
#endif
|
||||
} seg_t;
|
||||
|
||||
//
|
||||
|
@ -639,11 +623,9 @@ typedef struct drawseg_s
|
|||
|
||||
UINT8 portalpass; // if > 0 and <= portalrender, do not affect sprite clipping
|
||||
|
||||
#ifdef ESLOPE
|
||||
fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures
|
||||
|
||||
vertex_t leftpos, rightpos; // Used for rendering FOF walls with slopes
|
||||
#endif
|
||||
} drawseg_t;
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -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_transmap; // one of the translucency tables
|
||||
|
||||
#ifdef ESLOPE
|
||||
pslope_t *ds_slope; // Current slope being used
|
||||
floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
||||
float focallengthf, zeroheight;
|
||||
#endif
|
||||
|
||||
/** \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_transmap;
|
||||
|
||||
#ifdef ESLOPE
|
||||
typedef struct {
|
||||
float x, y, z;
|
||||
} floatv3_t;
|
||||
|
@ -70,7 +69,6 @@ typedef struct {
|
|||
extern pslope_t *ds_slope; // Current slope being used
|
||||
extern floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
||||
extern float focallengthf, zeroheight;
|
||||
#endif
|
||||
|
||||
// Variable flat sizes
|
||||
extern UINT32 nflatxshift;
|
||||
|
@ -157,12 +155,10 @@ void ASMCALL R_DrawSpan_8_MMX(void);
|
|||
void R_DrawTranslatedColumn_8(void);
|
||||
void R_DrawTranslatedTranslucentColumn_8(void);
|
||||
void R_DrawSpan_8(void);
|
||||
#ifdef ESLOPE
|
||||
void R_CalcTiltedLighting(fixed_t start, fixed_t end);
|
||||
void R_DrawTiltedSpan_8(void);
|
||||
void R_DrawTiltedTranslucentSpan_8(void);
|
||||
void R_DrawTiltedSplat_8(void);
|
||||
#endif
|
||||
void R_DrawSplat_8(void);
|
||||
void R_DrawTranslucentSplat_8(void);
|
||||
void R_DrawTranslucentSpan_8(void);
|
||||
|
|
|
@ -620,7 +620,6 @@ void R_DrawSpan_8 (void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef ESLOPE
|
||||
// R_CalcTiltedLighting
|
||||
// Exactly what it says on the tin. I wish I wasn't too lazy to explain things properly.
|
||||
static INT32 tiltlighting[MAXVIDWIDTH];
|
||||
|
@ -1058,7 +1057,6 @@ void R_DrawTiltedSplat_8(void)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif // ESLOPE
|
||||
|
||||
/** \brief The R_DrawSplat_8 function
|
||||
Just like R_DrawSpan_8, but skips transparent pixels.
|
||||
|
|
|
@ -536,9 +536,7 @@ static void R_InitTextureMapping(void)
|
|||
focallength = FixedDiv(projection,
|
||||
FINETANGENT(FINEANGLES/4+/*cv_fov.value*/ FIELDOFVIEW/2));
|
||||
|
||||
#ifdef ESLOPE
|
||||
focallengthf = FIXED_TO_FLOAT(focallength);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < FINEANGLES/2; i++)
|
||||
{
|
||||
|
|
|
@ -322,11 +322,9 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
|||
if (pindex >= MAXLIGHTZ)
|
||||
pindex = MAXLIGHTZ - 1;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (currentplane->slope)
|
||||
ds_colormap = colormaps;
|
||||
else
|
||||
#endif
|
||||
ds_colormap = planezlight[pindex];
|
||||
if (encoremap && !currentplane->noencore)
|
||||
ds_colormap += (256*32);
|
||||
|
@ -424,20 +422,14 @@ static visplane_t *new_visplane(unsigned hash)
|
|||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
|
||||
ffloor_t *pfloor
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, polyobj_t *polyobj
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
, pslope_t *slope
|
||||
#endif
|
||||
, boolean noencore)
|
||||
{
|
||||
visplane_t *check;
|
||||
unsigned hash;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (slope); else // Don't mess with this right now if a slope is involved
|
||||
#endif
|
||||
{
|
||||
xoff += viewx;
|
||||
yoff -= viewy;
|
||||
|
@ -452,7 +444,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (polyobj)
|
||||
{
|
||||
if (polyobj->angle != 0)
|
||||
|
@ -467,7 +458,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
yoff += polyobj->centerPt.y;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// This appears to fix the Nimbus Ruins sky bug.
|
||||
if (picnum == skyflatnum && pfloor)
|
||||
|
@ -481,12 +471,10 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
|
||||
for (check = visplanes[hash]; check; check = check->next)
|
||||
{
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (check->polyobj && pfloor)
|
||||
continue;
|
||||
if (polyobj != check->polyobj)
|
||||
continue;
|
||||
#endif
|
||||
if (height == check->height && picnum == check->picnum
|
||||
&& lightlevel == check->lightlevel
|
||||
&& xoff == check->xoffs && yoff == check->yoffs
|
||||
|
@ -495,9 +483,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
&& check->viewx == viewx && check->viewy == viewy && check->viewz == viewz
|
||||
&& check->viewangle == viewangle
|
||||
&& check->plangle == plangle
|
||||
#ifdef ESLOPE
|
||||
&& check->slope == slope
|
||||
#endif
|
||||
&& check->noencore == noencore)
|
||||
{
|
||||
return check;
|
||||
|
@ -520,12 +506,8 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
check->viewz = viewz;
|
||||
check->viewangle = viewangle;
|
||||
check->plangle = plangle;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
check->polyobj = polyobj;
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
check->slope = slope;
|
||||
#endif
|
||||
check->noencore = noencore;
|
||||
|
||||
memset(check->top, 0xff, sizeof (check->top));
|
||||
|
@ -593,12 +575,8 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
|
|||
new_pl->viewz = pl->viewz;
|
||||
new_pl->viewangle = pl->viewangle;
|
||||
new_pl->plangle = pl->plangle;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
new_pl->polyobj = pl->polyobj;
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
new_pl->slope = pl->slope;
|
||||
#endif
|
||||
new_pl->noencore = pl->noencore;
|
||||
pl = new_pl;
|
||||
pl->minx = start;
|
||||
|
@ -623,11 +601,9 @@ void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop)
|
|||
INT32 unionl, unionh;
|
||||
// INT32 x;
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Don't expand polyobject planes here - we do that on our own.
|
||||
if (pl->polyobj)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (start < pl->minx)
|
||||
{
|
||||
|
@ -742,9 +718,7 @@ void R_DrawPlanes(void)
|
|||
}
|
||||
|
||||
if (pl->ffloor != NULL
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
|| pl->polyobj != NULL
|
||||
#endif
|
||||
)
|
||||
continue;
|
||||
|
||||
|
@ -773,7 +747,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
#endif
|
||||
spanfunc = basespanfunc;
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (pl->polyobj && pl->polyobj->translucency != 0) {
|
||||
spanfunc = R_DrawTranslucentSpan_8;
|
||||
|
||||
|
@ -795,7 +768,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
light = LIGHTLEVELS-1;
|
||||
|
||||
} else
|
||||
#endif
|
||||
if (pl->ffloor)
|
||||
{
|
||||
// Don't draw planes that shouldn't be drawn.
|
||||
|
@ -861,9 +833,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
|
||||
#ifndef NOWATER
|
||||
if (pl->ffloor->flags & FF_RIPPLE
|
||||
#ifdef ESLOPE
|
||||
&& !pl->slope
|
||||
#endif
|
||||
)
|
||||
{
|
||||
INT32 top, bottom;
|
||||
|
@ -902,9 +872,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
}
|
||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (!pl->slope) // Don't mess with angle on slopes! We'll handle this ourselves later
|
||||
#endif
|
||||
if (viewangle != pl->viewangle+pl->plangle)
|
||||
{
|
||||
memset(cachedheight, 0, sizeof (cachedheight));
|
||||
|
@ -978,7 +946,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
if (light < 0)
|
||||
light = 0;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (pl->slope) {
|
||||
// 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
|
||||
|
@ -1118,7 +1085,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
|
||||
planezlight = scalelight[light];
|
||||
} else
|
||||
#endif // ESLOPE
|
||||
|
||||
planezlight = zlight[light];
|
||||
|
||||
|
|
|
@ -45,12 +45,8 @@ typedef struct visplane_s
|
|||
fixed_t xoffs, yoffs; // Scrolling flats.
|
||||
|
||||
struct ffloor_s *ffloor;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
polyobj_t *polyobj;
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
pslope_t *slope;
|
||||
#endif
|
||||
|
||||
boolean noencore;
|
||||
} visplane_t;
|
||||
|
@ -83,12 +79,8 @@ void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
|
|||
void R_DrawPlanes(void);
|
||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
|
||||
extracolormap_t *planecolormap, ffloor_t *ffloor
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, polyobj_t *polyobj
|
||||
#endif
|
||||
#ifdef ESLOPE
|
||||
, pslope_t *slope
|
||||
#endif
|
||||
, boolean noencore);
|
||||
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||
void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||
|
@ -108,18 +100,14 @@ typedef struct planemgr_s
|
|||
INT16 f_clip[MAXVIDWIDTH];
|
||||
INT16 c_clip[MAXVIDWIDTH];
|
||||
|
||||
#ifdef ESLOPE
|
||||
// For slope rendering; the height at the other end
|
||||
fixed_t f_pos_slope;
|
||||
fixed_t b_pos_slope;
|
||||
|
||||
struct pslope_s *slope;
|
||||
#endif
|
||||
|
||||
struct ffloor_s *ffloor;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
polyobj_t *polyobj;
|
||||
#endif
|
||||
} visffloor_t;
|
||||
|
||||
extern visffloor_t ffloor[MAXFFLOORS];
|
||||
|
|
345
src/r_segs.c
345
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))
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (sector->lightlist[i].slope)
|
||||
testheight = P_GetZAt(sector->lightlist[i].slope, sprite->gx, sprite->gy);
|
||||
#endif
|
||||
|
||||
if (testheight >= sprite->gzt)
|
||||
continue;
|
||||
|
@ -1373,7 +1371,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
if (thing->subsector->sector->numlights)
|
||||
{
|
||||
INT32 lightnum;
|
||||
#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights!
|
||||
light = thing->subsector->sector->numlights - 1;
|
||||
|
||||
for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
|
||||
|
@ -1384,9 +1381,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
light = R_GetPlaneLight(thing->subsector->sector, gzt, false);
|
||||
#endif
|
||||
lightnum = (*thing->subsector->sector->lightlist[light].lightlevel >> LIGHTSEGSHIFT);
|
||||
|
||||
if (lightnum < 0)
|
||||
|
@ -1947,7 +1941,6 @@ static void R_CreateDrawNodes(void)
|
|||
entry->ffloor = ds->thicksides[i];
|
||||
}
|
||||
}
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Check for a polyobject plane, but only if this is a front line
|
||||
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
|
||||
plane = ds->curline->polyseg->visplane;
|
||||
|
@ -1963,7 +1956,6 @@ static void R_CreateDrawNodes(void)
|
|||
}
|
||||
ds->curline->polyseg->visplane = NULL;
|
||||
}
|
||||
#endif
|
||||
if (ds->maskedtexturecol)
|
||||
{
|
||||
entry = R_CreateDrawNode(&nodehead);
|
||||
|
@ -2008,7 +2000,6 @@ static void R_CreateDrawNodes(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// find all the remaining polyobject planes and add them on the end of the list
|
||||
// probably this is a terrible idea if we wanted them to be sorted properly
|
||||
// but it works getting them in for now
|
||||
|
@ -2029,7 +2020,6 @@ static void R_CreateDrawNodes(void)
|
|||
// note: no seg is set, for what should be obvious reasons
|
||||
PolyObjects[i].visplane = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (visspritecount == 0)
|
||||
return;
|
||||
|
@ -2052,13 +2042,11 @@ static void R_CreateDrawNodes(void)
|
|||
if (rover->szt > r2->plane->low || rover->sz < r2->plane->high)
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Effective height may be different for each comparison in the case of slopes
|
||||
if (r2->plane->slope) {
|
||||
planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy);
|
||||
planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy);
|
||||
} else
|
||||
#endif
|
||||
planeobjectz = planecameraz = r2->plane->height;
|
||||
|
||||
if (rover->mobjflags & MF_NOCLIPHEIGHT)
|
||||
|
@ -2117,20 +2105,16 @@ static void R_CreateDrawNodes(void)
|
|||
if (scale <= rover->sortscale)
|
||||
continue;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*r2->ffloor->t_slope) {
|
||||
topplaneobjectz = P_GetZAt(*r2->ffloor->t_slope, rover->gx, rover->gy);
|
||||
topplanecameraz = P_GetZAt(*r2->ffloor->t_slope, viewx, viewy);
|
||||
} else
|
||||
#endif
|
||||
topplaneobjectz = topplanecameraz = *r2->ffloor->topheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*r2->ffloor->b_slope) {
|
||||
botplaneobjectz = P_GetZAt(*r2->ffloor->b_slope, rover->gx, rover->gy);
|
||||
botplanecameraz = P_GetZAt(*r2->ffloor->b_slope, viewx, viewy);
|
||||
} else
|
||||
#endif
|
||||
botplaneobjectz = botplanecameraz = *r2->ffloor->bottomheight;
|
||||
|
||||
if ((topplanecameraz > viewz && botplanecameraz < viewz) ||
|
||||
|
|
Loading…
Reference in a new issue