- Made all the basic texture classes local to their implementation.
They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. SVN r1012 (trunk)
This commit is contained in:
parent
71b0d4d074
commit
47aacc45c8
34 changed files with 1723 additions and 1091 deletions
132
src/po_man.cpp
132
src/po_man.cpp
|
|
@ -31,6 +31,84 @@
|
|||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
inline FArchive &operator<< (FArchive &arc, podoortype_t &type)
|
||||
{
|
||||
BYTE val = (BYTE)type;
|
||||
arc << val;
|
||||
type = (podoortype_t)val;
|
||||
return arc;
|
||||
}
|
||||
|
||||
class DPolyAction : public DThinker
|
||||
{
|
||||
DECLARE_CLASS (DPolyAction, DThinker)
|
||||
public:
|
||||
DPolyAction (int polyNum);
|
||||
~DPolyAction ();
|
||||
void Serialize (FArchive &arc);
|
||||
|
||||
void StopInterpolation ();
|
||||
protected:
|
||||
DPolyAction ();
|
||||
int m_PolyObj;
|
||||
int m_Speed;
|
||||
int m_Dist;
|
||||
|
||||
void SetInterpolation ();
|
||||
|
||||
friend void ThrustMobj (AActor *actor, seg_t *seg, FPolyObj *po);
|
||||
};
|
||||
|
||||
class DRotatePoly : public DPolyAction
|
||||
{
|
||||
DECLARE_CLASS (DRotatePoly, DPolyAction)
|
||||
public:
|
||||
DRotatePoly (int polyNum);
|
||||
void Tick ();
|
||||
private:
|
||||
DRotatePoly ();
|
||||
|
||||
friend bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide);
|
||||
};
|
||||
|
||||
|
||||
class DMovePoly : public DPolyAction
|
||||
{
|
||||
DECLARE_CLASS (DMovePoly, DPolyAction)
|
||||
public:
|
||||
DMovePoly (int polyNum);
|
||||
void Serialize (FArchive &arc);
|
||||
void Tick ();
|
||||
protected:
|
||||
DMovePoly ();
|
||||
int m_Angle;
|
||||
fixed_t m_xSpeed; // for sliding walls
|
||||
fixed_t m_ySpeed;
|
||||
|
||||
friend bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle, fixed_t dist, bool overRide);
|
||||
};
|
||||
|
||||
|
||||
class DPolyDoor : public DMovePoly
|
||||
{
|
||||
DECLARE_CLASS (DPolyDoor, DMovePoly)
|
||||
public:
|
||||
DPolyDoor (int polyNum, podoortype_t type);
|
||||
void Serialize (FArchive &arc);
|
||||
void Tick ();
|
||||
protected:
|
||||
int m_Direction;
|
||||
int m_TotalDist;
|
||||
int m_Tics;
|
||||
int m_WaitTics;
|
||||
podoortype_t m_Type;
|
||||
bool m_Close;
|
||||
|
||||
friend bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle, int delay, int distance, podoortype_t type);
|
||||
private:
|
||||
DPolyDoor ();
|
||||
};
|
||||
|
||||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
|
||||
bool PO_RotatePolyobj (int num, angle_t angle);
|
||||
|
|
@ -38,19 +116,19 @@ void PO_Init (void);
|
|||
|
||||
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
|
||||
|
||||
static polyobj_t *GetPolyobj (int polyNum);
|
||||
static FPolyObj *GetPolyobj (int polyNum);
|
||||
static int GetPolyobjMirror (int poly);
|
||||
static void UpdateSegBBox (seg_t *seg);
|
||||
static void RotatePt (int an, fixed_t *x, fixed_t *y, fixed_t startSpotX,
|
||||
fixed_t startSpotY);
|
||||
static void UnLinkPolyobj (polyobj_t *po);
|
||||
static void LinkPolyobj (polyobj_t *po);
|
||||
static bool CheckMobjBlocking (seg_t *seg, polyobj_t *po);
|
||||
static void UnLinkPolyobj (FPolyObj *po);
|
||||
static void LinkPolyobj (FPolyObj *po);
|
||||
static bool CheckMobjBlocking (seg_t *seg, FPolyObj *po);
|
||||
static void InitBlockMap (void);
|
||||
static void IterFindPolySegs (vertex_t *v1, vertex_t *v2, seg_t **segList);
|
||||
static void SpawnPolyobj (int index, int tag, int type);
|
||||
static void TranslateToStartSpot (int tag, int originX, int originY);
|
||||
static void DoMovePolyobj (polyobj_t *po, int x, int y);
|
||||
static void DoMovePolyobj (FPolyObj *po, int x, int y);
|
||||
static void InitSegLists ();
|
||||
static void KillSegLists ();
|
||||
|
||||
|
|
@ -61,7 +139,7 @@ extern seg_t *segs;
|
|||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
polyblock_t **PolyBlockMap;
|
||||
polyobj_t *polyobjs; // list of all poly-objects on the level
|
||||
FPolyObj *polyobjs; // list of all poly-objects on the level
|
||||
int po_NumPolyobjs;
|
||||
polyspawns_t *polyspawns; // [RH] Let P_SpawnMapThings() find our thingies for us
|
||||
|
||||
|
|
@ -99,7 +177,7 @@ DPolyAction::DPolyAction (int polyNum)
|
|||
|
||||
DPolyAction::~DPolyAction ()
|
||||
{
|
||||
polyobj_t *poly = GetPolyobj (m_PolyObj);
|
||||
FPolyObj *poly = GetPolyobj (m_PolyObj);
|
||||
|
||||
if (poly->specialdata == NULL || poly->specialdata == this)
|
||||
{
|
||||
|
|
@ -110,7 +188,7 @@ DPolyAction::~DPolyAction ()
|
|||
|
||||
void DPolyAction::SetInterpolation ()
|
||||
{
|
||||
polyobj_t *poly = GetPolyobj (m_PolyObj);
|
||||
FPolyObj *poly = GetPolyobj (m_PolyObj);
|
||||
for (int i = 0; i < poly->numsegs; ++i)
|
||||
{
|
||||
setinterpolation (INTERP_Vertex, poly->segs[i]->v1);
|
||||
|
|
@ -120,7 +198,7 @@ void DPolyAction::SetInterpolation ()
|
|||
|
||||
void DPolyAction::StopInterpolation ()
|
||||
{
|
||||
polyobj_t *poly = GetPolyobj (m_PolyObj);
|
||||
FPolyObj *poly = GetPolyobj (m_PolyObj);
|
||||
for (int i = 0; i < poly->numsegs; ++i)
|
||||
{
|
||||
stopinterpolation (INTERP_Vertex, poly->segs[i]->v1);
|
||||
|
|
@ -196,7 +274,7 @@ void DRotatePoly::Tick ()
|
|||
m_Dist -= absSpeed;
|
||||
if (m_Dist == 0)
|
||||
{
|
||||
polyobj_t *poly = GetPolyobj (m_PolyObj);
|
||||
FPolyObj *poly = GetPolyobj (m_PolyObj);
|
||||
if (poly->specialdata == this)
|
||||
{
|
||||
poly->specialdata = NULL;
|
||||
|
|
@ -223,7 +301,7 @@ bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle,
|
|||
{
|
||||
int mirror;
|
||||
DRotatePoly *pe;
|
||||
polyobj_t *poly;
|
||||
FPolyObj *poly;
|
||||
|
||||
if ( (poly = GetPolyobj(polyNum)) )
|
||||
{
|
||||
|
|
@ -300,7 +378,7 @@ bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle,
|
|||
|
||||
void DMovePoly::Tick ()
|
||||
{
|
||||
polyobj_t *poly;
|
||||
FPolyObj *poly;
|
||||
|
||||
if (PO_MovePolyobj (m_PolyObj, m_xSpeed, m_ySpeed))
|
||||
{
|
||||
|
|
@ -336,7 +414,7 @@ bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle,
|
|||
{
|
||||
int mirror;
|
||||
DMovePoly *pe;
|
||||
polyobj_t *poly;
|
||||
FPolyObj *poly;
|
||||
angle_t an;
|
||||
|
||||
if ( (poly = GetPolyobj(polyNum)) )
|
||||
|
|
@ -405,7 +483,7 @@ bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle,
|
|||
void DPolyDoor::Tick ()
|
||||
{
|
||||
int absSpeed;
|
||||
polyobj_t *poly;
|
||||
FPolyObj *poly;
|
||||
|
||||
if (m_Tics)
|
||||
{
|
||||
|
|
@ -530,7 +608,7 @@ bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle,
|
|||
{
|
||||
int mirror;
|
||||
DPolyDoor *pd;
|
||||
polyobj_t *poly;
|
||||
FPolyObj *poly;
|
||||
|
||||
if( (poly = GetPolyobj(polyNum)) )
|
||||
{
|
||||
|
|
@ -605,7 +683,7 @@ bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle,
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static polyobj_t *GetPolyobj (int polyNum)
|
||||
static FPolyObj *GetPolyobj (int polyNum)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -645,7 +723,7 @@ static int GetPolyobjMirror(int poly)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void ThrustMobj (AActor *actor, seg_t *seg, polyobj_t *po)
|
||||
void ThrustMobj (AActor *actor, seg_t *seg, FPolyObj *po)
|
||||
{
|
||||
int thrustAngle;
|
||||
int thrustX;
|
||||
|
|
@ -759,7 +837,7 @@ static void UpdateSegBBox (seg_t *seg)
|
|||
|
||||
bool PO_MovePolyobj (int num, int x, int y, bool force)
|
||||
{
|
||||
polyobj_t *po;
|
||||
FPolyObj *po;
|
||||
|
||||
if (!(po = GetPolyobj (num)))
|
||||
{
|
||||
|
|
@ -801,7 +879,7 @@ bool PO_MovePolyobj (int num, int x, int y, bool force)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DoMovePolyobj (polyobj_t *po, int x, int y)
|
||||
void DoMovePolyobj (FPolyObj *po, int x, int y)
|
||||
{
|
||||
int count;
|
||||
seg_t **segList;
|
||||
|
|
@ -868,7 +946,7 @@ bool PO_RotatePolyobj (int num, angle_t angle)
|
|||
vertex_t *originalPts;
|
||||
vertex_t *prevPts;
|
||||
int an;
|
||||
polyobj_t *po;
|
||||
FPolyObj *po;
|
||||
bool blocked;
|
||||
|
||||
if(!(po = GetPolyobj(num)))
|
||||
|
|
@ -941,7 +1019,7 @@ bool PO_RotatePolyobj (int num, angle_t angle)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static void UnLinkPolyobj (polyobj_t *po)
|
||||
static void UnLinkPolyobj (FPolyObj *po)
|
||||
{
|
||||
polyblock_t *link;
|
||||
int i, j;
|
||||
|
|
@ -976,7 +1054,7 @@ static void UnLinkPolyobj (polyobj_t *po)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static void LinkPolyobj (polyobj_t *po)
|
||||
static void LinkPolyobj (FPolyObj *po)
|
||||
{
|
||||
int leftX, rightX;
|
||||
int topY, bottomY;
|
||||
|
|
@ -1062,7 +1140,7 @@ static void LinkPolyobj (polyobj_t *po)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static bool CheckMobjBlocking (seg_t *seg, polyobj_t *po)
|
||||
static bool CheckMobjBlocking (seg_t *seg, FPolyObj *po)
|
||||
{
|
||||
static TArray<AActor *> checker;
|
||||
FBlockNode *block;
|
||||
|
|
@ -1388,7 +1466,7 @@ static void TranslateToStartSpot (int tag, int originX, int originY)
|
|||
seg_t **veryTempSeg;
|
||||
vertex_t *tempPt;
|
||||
subsector_t *sub;
|
||||
polyobj_t *po;
|
||||
FPolyObj *po;
|
||||
int deltaX;
|
||||
int deltaY;
|
||||
vertex_t avg; // used to find a polyobj's center, and hence subsector
|
||||
|
|
@ -1480,8 +1558,8 @@ void PO_Init (void)
|
|||
// [RH] Make this faster
|
||||
InitSegLists ();
|
||||
|
||||
polyobjs = new polyobj_t[po_NumPolyobjs];
|
||||
memset (polyobjs, 0, po_NumPolyobjs*sizeof(polyobj_t));
|
||||
polyobjs = new FPolyObj[po_NumPolyobjs];
|
||||
memset (polyobjs, 0, po_NumPolyobjs*sizeof(FPolyObj));
|
||||
|
||||
polyIndex = 0; // index polyobj number
|
||||
// Find the startSpot points, and spawn each polyobj
|
||||
|
|
@ -1539,7 +1617,7 @@ void PO_Init (void)
|
|||
|
||||
bool PO_Busy (int polyobj)
|
||||
{
|
||||
polyobj_t *poly;
|
||||
FPolyObj *poly;
|
||||
|
||||
poly = GetPolyobj (polyobj);
|
||||
if (poly == NULL || poly->specialdata == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue