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
|
2018-11-25 12:35:38 +00:00
|
|
|
// Copyright (C) 2015-2018 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
|
|
|
|
|
2014-11-19 00:45:57 +00:00
|
|
|
#ifdef ESLOPE
|
2019-04-19 12:14:43 +00:00
|
|
|
|
|
|
|
extern pslope_t *slopelist;
|
|
|
|
extern UINT16 slopecount;
|
|
|
|
|
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);
|
2019-04-19 12:14:43 +00:00
|
|
|
void P_ResetDynamicSlopes(const UINT32 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
|
|
|
|
fixed_t P_GetZAt(pslope_t *slope, fixed_t x, fixed_t y);
|
|
|
|
|
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);
|
2014-11-19 00:45:57 +00:00
|
|
|
#endif // #ifdef ESLOPE
|
2019-04-21 16:05:16 +00:00
|
|
|
#endif // #ifndef P_SLOPES_H__
|