gzdoom-last-svn/src/dsectoreffect.h
Christoph Oelckers 2cba83663a Update to ZDoom r1229:
- Separated low level sound code from all high level dependencies.
- Separated low level sound channel class from high level class which now
  is just a subclass of the low level class.
- Moved some more high level sound logic out of FMODSoundRenderer:
  The rolloff and channel ended callbacks now call functions in s_sound.cpp
  instead of working on the data itself and GSnd->StopSound has been replaced
  with S_StopChannel.
- Changed compilation for g_doom, g_heretic, g_hexen and g_strife folders so 
  that all files are included by a central one instead of compiling each one 
  separately. This speeds up the compilation process by 25% when doing a 
  complete rebuild in Visual C.
- Cleaned up some include dependencies.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@179 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-15 23:47:00 +00:00

76 lines
1.9 KiB
C++

#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);
void Destroy();
sector_t *GetSector() const { return m_Sector; }
protected:
DSectorEffect ();
sector_t *m_Sector;
};
class DMover : public DSectorEffect
{
DECLARE_CLASS (DMover, DSectorEffect)
HAS_OBJECT_POINTERS
public:
DMover (sector_t *sector);
protected:
enum EResult { ok, crushed, pastdest };
TObjPtr<DInterpolation> interpolation;
private:
bool MoveAttached(int crush, fixed_t move, int floorOrCeiling, bool resetfailed);
EResult MovePlane (fixed_t speed, fixed_t dest, int crush, int floorOrCeiling, int direction, bool hexencrush);
protected:
DMover ();
void Serialize (FArchive &arc);
void Destroy();
void StopInterpolation();
inline EResult MoveFloor (fixed_t speed, fixed_t dest, int crush, int direction, bool hexencrush)
{
return MovePlane (speed, dest, crush, 0, direction, hexencrush);
}
inline EResult MoveFloor (fixed_t speed, fixed_t dest, int direction)
{
return MovePlane (speed, dest, -1, 0, direction, false);
}
inline EResult MoveCeiling (fixed_t speed, fixed_t dest, int crush, int direction, bool hexencrush)
{
return MovePlane (speed, dest, crush, 1, direction, hexencrush);
}
inline EResult MoveCeiling (fixed_t speed, fixed_t dest, int direction)
{
return MovePlane (speed, dest, -1, 1, direction, false);
}
};
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__