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