2006-02-24 04:48:15 +00:00
|
|
|
#ifndef __DSECTOREFFECT_H__
|
|
|
|
#define __DSECTOREFFECT_H__
|
|
|
|
|
|
|
|
#include "dthinker.h"
|
|
|
|
#include "r_defs.h"
|
|
|
|
|
|
|
|
class DSectorEffect : public DThinker
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DSectorEffect, DThinker)
|
|
|
|
public:
|
|
|
|
DSectorEffect (sector_t *sector);
|
|
|
|
|
|
|
|
void Serialize (FArchive &arc);
|
2008-03-12 02:56:11 +00:00
|
|
|
void Destroy();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
sector_t *GetSector() const { return m_Sector; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
DSectorEffect ();
|
|
|
|
sector_t *m_Sector;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DMover : public DSectorEffect
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DMover, DSectorEffect)
|
2008-06-04 17:53:15 +00:00
|
|
|
HAS_OBJECT_POINTERS
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
DMover (sector_t *sector);
|
|
|
|
protected:
|
|
|
|
enum EResult { ok, crushed, pastdest };
|
2008-06-04 17:53:15 +00:00
|
|
|
TObjPtr<DInterpolation> interpolation;
|
2006-02-24 04:48:15 +00:00
|
|
|
private:
|
2008-03-18 18:18:18 +00:00
|
|
|
bool MoveAttached(int crush, fixed_t move, int floorOrCeiling, bool resetfailed);
|
2008-03-19 22:47:04 +00:00
|
|
|
EResult MovePlane (fixed_t speed, fixed_t dest, int crush, int floorOrCeiling, int direction, bool hexencrush);
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
DMover ();
|
2008-06-04 17:53:15 +00:00
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
void Destroy();
|
|
|
|
void StopInterpolation();
|
2008-03-19 22:47:04 +00:00
|
|
|
inline EResult MoveFloor (fixed_t speed, fixed_t dest, int crush, int direction, bool hexencrush)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-03-19 22:47:04 +00:00
|
|
|
return MovePlane (speed, dest, crush, 0, direction, hexencrush);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
inline EResult MoveFloor (fixed_t speed, fixed_t dest, int direction)
|
|
|
|
{
|
2008-03-19 22:47:04 +00:00
|
|
|
return MovePlane (speed, dest, -1, 0, direction, false);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
2008-03-19 22:47:04 +00:00
|
|
|
inline EResult MoveCeiling (fixed_t speed, fixed_t dest, int crush, int direction, bool hexencrush)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-03-19 22:47:04 +00:00
|
|
|
return MovePlane (speed, dest, crush, 1, direction, hexencrush);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
inline EResult MoveCeiling (fixed_t speed, fixed_t dest, int direction)
|
|
|
|
{
|
2008-03-19 22:47:04 +00:00
|
|
|
return MovePlane (speed, dest, -1, 1, direction, false);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class DMovingFloor : public DMover
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DMovingFloor, DMover)
|
|
|
|
public:
|
|
|
|
DMovingFloor (sector_t *sector);
|
|
|
|
protected:
|
|
|
|
DMovingFloor ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class DMovingCeiling : public DMover
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DMovingCeiling, DMover)
|
|
|
|
public:
|
|
|
|
DMovingCeiling (sector_t *sector);
|
|
|
|
protected:
|
|
|
|
DMovingCeiling ();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__DSECTOREFFECT_H__
|