mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 08:30:49 +00:00
66d28a24b8
Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going. It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
59 lines
1.1 KiB
C++
59 lines
1.1 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(FSerializer &arc);
|
|
void Destroy() override;
|
|
|
|
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);
|
|
void StopInterpolation(bool force = false);
|
|
protected:
|
|
TObjPtr<DInterpolation> interpolation;
|
|
private:
|
|
protected:
|
|
DMover ();
|
|
|
|
void Serialize(FSerializer &arc);
|
|
void Destroy() override;
|
|
};
|
|
|
|
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, bool interpolate = true);
|
|
protected:
|
|
DMovingCeiling ();
|
|
};
|
|
|
|
#endif //__DSECTOREFFECT_H__
|