2016-05-18 00:42:11 +00:00
|
|
|
// SONIC ROBO BLAST 2
|
2014-11-19 00:45:57 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2016-05-18 00:42:11 +00:00
|
|
|
// Copyright (C) 2004 by Stephen McGranahan
|
2021-05-07 15:45:56 +00:00
|
|
|
// Copyright (C) 2015-2021 by Sonic Team Junior.
|
2014-11-19 00:45:57 +00:00
|
|
|
//
|
2016-05-18 00:42:11 +00:00
|
|
|
// This program is free software distributed under the
|
|
|
|
// terms of the GNU General Public License, version 2.
|
|
|
|
// See the 'LICENSE' file for more details.
|
2014-11-19 00:45:57 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2016-05-18 00:42:11 +00:00
|
|
|
/// \file p_slopes.c
|
|
|
|
/// \brief ZDoom + Eternity Engine Slopes, ported and enhanced by Kalaron
|
2014-11-19 00:45:57 +00:00
|
|
|
|
2019-04-21 16:05:16 +00:00
|
|
|
#ifndef P_SLOPES_H__
|
|
|
|
#define P_SLOPES_H__
|
|
|
|
|
2019-04-19 12:14:43 +00:00
|
|
|
#include "m_fixed.h" // Vectors
|
|
|
|
|
|
|
|
extern pslope_t *slopelist;
|
|
|
|
extern UINT16 slopecount;
|
|
|
|
|
2020-04-18 14:55:56 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TMSP_FRONTFLOOR,
|
|
|
|
TMSP_FRONTCEILING,
|
|
|
|
TMSP_BACKFLOOR,
|
|
|
|
TMSP_BACKCEILING,
|
|
|
|
} textmapslopeplane_t;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TMSC_FRONTTOBACKFLOOR = 1,
|
|
|
|
TMSC_BACKTOFRONTFLOOR = 1<<1,
|
|
|
|
TMSC_FRONTTOBACKCEILING = 1<<2,
|
|
|
|
TMSC_BACKTOFRONTCEILING = 1<<3,
|
|
|
|
} textmapslopecopy_t;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TMS_NONE,
|
|
|
|
TMS_FRONT,
|
|
|
|
TMS_BACK,
|
|
|
|
} textmapside_t;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TMSL_NOPHYSICS = 1,
|
|
|
|
TMSL_DYNAMIC = 2,
|
|
|
|
} textmapslopeflags_t;
|
|
|
|
|
2019-04-20 11:06:06 +00:00
|
|
|
void P_LinkSlopeThinkers (void);
|
|
|
|
|
2016-03-03 05:47:06 +00:00
|
|
|
void P_CalculateSlopeNormal(pslope_t *slope);
|
2020-01-04 09:39:45 +00:00
|
|
|
void P_SpawnSlopes(const boolean fromsave);
|
2014-11-19 00:45:57 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// P_CopySectorSlope
|
|
|
|
//
|
|
|
|
// Searches through tagged sectors and copies
|
|
|
|
//
|
|
|
|
void P_CopySectorSlope(line_t *line);
|
|
|
|
|
2015-08-03 23:06:42 +00:00
|
|
|
pslope_t *P_SlopeById(UINT16 id);
|
|
|
|
|
2014-11-19 00:45:57 +00:00
|
|
|
// Returns the height of the sloped plane at (x, y) as a fixed_t
|
2020-05-18 13:23:56 +00:00
|
|
|
fixed_t P_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y);
|
2020-03-22 14:17:16 +00:00
|
|
|
|
2020-05-18 13:23:56 +00:00
|
|
|
// Like P_GetSlopeZAt but falls back to z if slope is NULL
|
|
|
|
fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y, fixed_t z);
|
2020-03-22 14:17:16 +00:00
|
|
|
|
|
|
|
// Returns the height of the sector at (x, y)
|
|
|
|
fixed_t P_GetSectorFloorZAt (const sector_t *sector, fixed_t x, fixed_t y);
|
|
|
|
fixed_t P_GetSectorCeilingZAt(const sector_t *sector, fixed_t x, fixed_t y);
|
|
|
|
|
|
|
|
// Returns the height of the FOF at (x, y)
|
|
|
|
fixed_t P_GetFFloorTopZAt (const ffloor_t *ffloor, fixed_t x, fixed_t y);
|
|
|
|
fixed_t P_GetFFloorBottomZAt(const ffloor_t *ffloor, fixed_t x, fixed_t y);
|
|
|
|
|
|
|
|
// Returns the height of the light list at (x, y)
|
|
|
|
fixed_t P_GetLightZAt(const lightlist_t *light, fixed_t x, fixed_t y);
|
2014-11-19 00:45:57 +00:00
|
|
|
|
2015-04-29 05:35:54 +00:00
|
|
|
// Lots of physics-based bullshit
|
2015-05-23 03:07:07 +00:00
|
|
|
void P_QuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope);
|
2016-06-12 18:27:34 +00:00
|
|
|
void P_ReverseQuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope);
|
2015-04-29 05:35:54 +00:00
|
|
|
void P_SlopeLaunch(mobj_t *mo);
|
2017-01-23 01:39:12 +00:00
|
|
|
fixed_t P_GetWallTransferMomZ(mobj_t *mo, pslope_t *slope);
|
2015-05-13 21:15:32 +00:00
|
|
|
void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope);
|
2015-04-29 05:35:54 +00:00
|
|
|
void P_ButteredSlope(mobj_t *mo);
|
|
|
|
|
2019-04-19 12:14:43 +00:00
|
|
|
|
|
|
|
/// Dynamic plane type enum for the thinker. Will have a different functionality depending on this.
|
|
|
|
typedef enum {
|
|
|
|
DP_FRONTFLOOR,
|
|
|
|
DP_FRONTCEIL,
|
|
|
|
DP_BACKFLOOR,
|
|
|
|
DP_BACKCEIL,
|
|
|
|
DP_VERTEX
|
|
|
|
} dynplanetype_t;
|
|
|
|
|
|
|
|
/// Permit slopes to be dynamically altered through a thinker.
|
2019-04-18 12:43:34 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
thinker_t thinker;
|
2019-04-19 12:14:43 +00:00
|
|
|
|
2019-04-18 12:43:34 +00:00
|
|
|
pslope_t* slope;
|
2019-04-19 12:14:43 +00:00
|
|
|
dynplanetype_t type;
|
|
|
|
|
|
|
|
// Used by line slopes.
|
|
|
|
line_t* sourceline;
|
|
|
|
fixed_t extent;
|
|
|
|
|
|
|
|
// Used by mapthing vertex slopes.
|
|
|
|
INT16 tags[3];
|
|
|
|
vector3_t vex[3];
|
2019-04-18 12:43:34 +00:00
|
|
|
} dynplanethink_t;
|
2014-11-19 00:45:57 +00:00
|
|
|
|
2019-04-19 12:14:43 +00:00
|
|
|
void T_DynamicSlopeLine (dynplanethink_t* th);
|
|
|
|
void T_DynamicSlopeVert (dynplanethink_t* th);
|
2019-04-21 16:05:16 +00:00
|
|
|
#endif // #ifndef P_SLOPES_H__
|