mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-26 13:10:59 +00:00
- changed thinker initialization to occur in a Construct function instead of the constructor itself.
This was done to ensure that this code only runs when the thinker itself is fully set up. With a constructor there is no control about such things, if some common initialization needs to be done it has to be in the base constructor, but that makes the entire approach chosen here to ensure proper linking into the thinker chains impossible. ZDoom originally did it that way, which resulted in a very inflexible system and required some awful hacks to let the serializer work with it - the corresponding bSerialOverride flag is now gone. The only thinker class still having a constructor is DFraggleThinker, because it contains non-serializable data that needs to be initialized in a piece of code that always runs, regardless of whether the object is created explicitly or from a savegame.
This commit is contained in:
parent
22939aade7
commit
e7aa10b5c8
37 changed files with 235 additions and 327 deletions
|
@ -63,7 +63,7 @@ IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DEFINE_FIELD(DBot, dest)
|
DEFINE_FIELD(DBot, dest)
|
||||||
|
|
||||||
DBot::DBot ()
|
void DBot::Construct()
|
||||||
{
|
{
|
||||||
Clear ();
|
Clear ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ class DBot : public DThinker
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_BOT;
|
static const int DEFAULT_STAT = STAT_BOT;
|
||||||
DBot ();
|
void Construct ();
|
||||||
|
|
||||||
void Clear ();
|
void Clear ();
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
|
|
@ -110,11 +110,12 @@ struct DDecalThinker : public DThinker
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_DECALTHINKER;
|
static const int DEFAULT_STAT = STAT_DECALTHINKER;
|
||||||
DDecalThinker (DBaseDecal *decal) : TheDecal (decal) {}
|
void Construct(DBaseDecal *decal)
|
||||||
|
{
|
||||||
|
TheDecal = decal;
|
||||||
|
}
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
TObjPtr<DBaseDecal*> TheDecal;
|
TObjPtr<DBaseDecal*> TheDecal;
|
||||||
protected:
|
|
||||||
DDecalThinker() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DDecalThinker, false, true)
|
IMPLEMENT_CLASS(DDecalThinker, false, true)
|
||||||
|
@ -142,15 +143,16 @@ class DDecalFader : public DDecalThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DDecalFader, DDecalThinker)
|
DECLARE_CLASS (DDecalFader, DDecalThinker)
|
||||||
public:
|
public:
|
||||||
DDecalFader (DBaseDecal *decal) : DDecalThinker (decal) {}
|
void Construct(DBaseDecal *decal)
|
||||||
|
{
|
||||||
|
Super::Construct(decal);
|
||||||
|
}
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
int TimeToStartDecay;
|
int TimeToStartDecay;
|
||||||
int TimeToEndDecay;
|
int TimeToEndDecay;
|
||||||
double StartTrans;
|
double StartTrans;
|
||||||
private:
|
|
||||||
DDecalFader () {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FDecalColorerAnim : public FDecalAnimator
|
struct FDecalColorerAnim : public FDecalAnimator
|
||||||
|
@ -167,7 +169,10 @@ class DDecalColorer : public DDecalThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DDecalColorer, DDecalThinker)
|
DECLARE_CLASS (DDecalColorer, DDecalThinker)
|
||||||
public:
|
public:
|
||||||
DDecalColorer (DBaseDecal *decal) : DDecalThinker (decal) {}
|
void Construct(DBaseDecal *decal)
|
||||||
|
{
|
||||||
|
Super::Construct(decal);
|
||||||
|
}
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
|
@ -175,8 +180,6 @@ public:
|
||||||
int TimeToEndDecay;
|
int TimeToEndDecay;
|
||||||
PalEntry StartColor;
|
PalEntry StartColor;
|
||||||
PalEntry GoalColor;
|
PalEntry GoalColor;
|
||||||
private:
|
|
||||||
DDecalColorer () {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FDecalStretcherAnim : public FDecalAnimator
|
struct FDecalStretcherAnim : public FDecalAnimator
|
||||||
|
@ -193,7 +196,10 @@ class DDecalStretcher : public DDecalThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DDecalStretcher, DDecalThinker)
|
DECLARE_CLASS (DDecalStretcher, DDecalThinker)
|
||||||
public:
|
public:
|
||||||
DDecalStretcher (DBaseDecal *decal) : DDecalThinker (decal) {}
|
void Construct(DBaseDecal *decal)
|
||||||
|
{
|
||||||
|
Super::Construct(decal);
|
||||||
|
}
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
|
@ -206,8 +212,6 @@ public:
|
||||||
bool bStretchX;
|
bool bStretchX;
|
||||||
bool bStretchY;
|
bool bStretchY;
|
||||||
bool bStarted;
|
bool bStarted;
|
||||||
private:
|
|
||||||
DDecalStretcher () {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FDecalSliderAnim : public FDecalAnimator
|
struct FDecalSliderAnim : public FDecalAnimator
|
||||||
|
@ -224,7 +228,10 @@ class DDecalSlider : public DDecalThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DDecalSlider, DDecalThinker)
|
DECLARE_CLASS (DDecalSlider, DDecalThinker)
|
||||||
public:
|
public:
|
||||||
DDecalSlider (DBaseDecal *decal) : DDecalThinker (decal) {}
|
void Construct(DBaseDecal *decal)
|
||||||
|
{
|
||||||
|
Super::Construct(decal);
|
||||||
|
}
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
|
@ -235,8 +242,6 @@ public:
|
||||||
double StartX;
|
double StartX;
|
||||||
double StartY;
|
double StartY;
|
||||||
bool bStarted;
|
bool bStarted;
|
||||||
private:
|
|
||||||
DDecalSlider () {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FDecalCombinerAnim : public FDecalAnimator
|
struct FDecalCombinerAnim : public FDecalAnimator
|
||||||
|
|
|
@ -562,12 +562,7 @@ void PClass::InitializeDefaults()
|
||||||
assert(Defaults == nullptr);
|
assert(Defaults == nullptr);
|
||||||
Defaults = (uint8_t *)M_Malloc(Size);
|
Defaults = (uint8_t *)M_Malloc(Size);
|
||||||
|
|
||||||
// run the constructor on the defaults to set the vtbl pointer which is needed to run class-aware functions on them.
|
|
||||||
// Temporarily setting bSerialOverride prevents linking into the thinker chains.
|
|
||||||
auto s = DThinker::bSerialOverride;
|
|
||||||
DThinker::bSerialOverride = true;
|
|
||||||
ConstructNative(Defaults);
|
ConstructNative(Defaults);
|
||||||
DThinker::bSerialOverride = s;
|
|
||||||
// We must unlink the defaults from the class list because it's just a static block of data to the engine.
|
// We must unlink the defaults from the class list because it's just a static block of data to the engine.
|
||||||
DObject *optr = (DObject*)Defaults;
|
DObject *optr = (DObject*)Defaults;
|
||||||
GC::Root = optr->ObjNext;
|
GC::Root = optr->ObjNext;
|
||||||
|
|
|
@ -56,7 +56,7 @@ void DSectorEffect::OnDestroy()
|
||||||
Super::OnDestroy();
|
Super::OnDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
DSectorEffect::DSectorEffect (sector_t *sector)
|
void DSectorEffect::Construct(sector_t *sector)
|
||||||
{
|
{
|
||||||
m_Sector = sector;
|
m_Sector = sector;
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,9 @@ IMPLEMENT_POINTERS_START(DMover)
|
||||||
IMPLEMENT_POINTER(interpolation)
|
IMPLEMENT_POINTER(interpolation)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DMover::DMover (sector_t *sector)
|
void DMover::Construct (sector_t *sector)
|
||||||
: DSectorEffect (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
interpolation = nullptr;
|
interpolation = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,9 +111,9 @@ void DMover::StopInterpolation(bool force)
|
||||||
IMPLEMENT_CLASS(DMovingFloor, true, false)
|
IMPLEMENT_CLASS(DMovingFloor, true, false)
|
||||||
|
|
||||||
|
|
||||||
DMovingFloor::DMovingFloor (sector_t *sector)
|
void DMovingFloor::Construct(sector_t *sector)
|
||||||
: DMover (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
sector->floordata = this;
|
sector->floordata = this;
|
||||||
interpolation = sector->SetInterpolation(sector_t::FloorMove, true);
|
interpolation = sector->SetInterpolation(sector_t::FloorMove, true);
|
||||||
}
|
}
|
||||||
|
@ -121,9 +121,9 @@ DMovingFloor::DMovingFloor (sector_t *sector)
|
||||||
IMPLEMENT_CLASS(DMovingCeiling, true, false)
|
IMPLEMENT_CLASS(DMovingCeiling, true, false)
|
||||||
|
|
||||||
|
|
||||||
DMovingCeiling::DMovingCeiling (sector_t *sector, bool interpolate)
|
void DMovingCeiling::Construct(sector_t *sector, bool interpolate)
|
||||||
: DMover (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
sector->ceilingdata = this;
|
sector->ceilingdata = this;
|
||||||
if (interpolate) interpolation = sector->SetInterpolation(sector_t::CeilingMove, true);
|
if (interpolate) interpolation = sector->SetInterpolation(sector_t::CeilingMove, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class DSectorEffect : public DThinker
|
||||||
DECLARE_CLASS (DSectorEffect, DThinker)
|
DECLARE_CLASS (DSectorEffect, DThinker)
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_SECTOREFFECT;
|
static const int DEFAULT_STAT = STAT_SECTOREFFECT;
|
||||||
DSectorEffect (sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
|
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
@ -18,10 +18,6 @@ public:
|
||||||
sector_t *GetSector() const { return m_Sector; }
|
sector_t *GetSector() const { return m_Sector; }
|
||||||
|
|
||||||
sector_t *m_Sector;
|
sector_t *m_Sector;
|
||||||
|
|
||||||
protected:
|
|
||||||
DSectorEffect() = default;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DMover : public DSectorEffect
|
class DMover : public DSectorEffect
|
||||||
|
@ -29,15 +25,14 @@ class DMover : public DSectorEffect
|
||||||
DECLARE_ABSTRACT_CLASS (DMover, DSectorEffect)
|
DECLARE_ABSTRACT_CLASS (DMover, DSectorEffect)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
protected:
|
protected:
|
||||||
DMover (sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
|
|
||||||
TObjPtr<DInterpolation*> interpolation;
|
TObjPtr<DInterpolation*> interpolation;
|
||||||
public:
|
public:
|
||||||
void StopInterpolation(bool force = false);
|
void StopInterpolation(bool force = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DMover () {}
|
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
};
|
};
|
||||||
|
@ -46,16 +41,14 @@ class DMovingFloor : public DMover
|
||||||
{
|
{
|
||||||
DECLARE_ABSTRACT_CLASS (DMovingFloor, DMover)
|
DECLARE_ABSTRACT_CLASS (DMovingFloor, DMover)
|
||||||
protected:
|
protected:
|
||||||
DMovingFloor (sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
DMovingFloor() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DMovingCeiling : public DMover
|
class DMovingCeiling : public DMover
|
||||||
{
|
{
|
||||||
DECLARE_ABSTRACT_CLASS (DMovingCeiling, DMover)
|
DECLARE_ABSTRACT_CLASS (DMovingCeiling, DMover)
|
||||||
protected:
|
protected:
|
||||||
DMovingCeiling (sector_t *sector, bool interpolate = true);
|
void Construct(sector_t *sector, bool interpolate = true);
|
||||||
DMovingCeiling () {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__DSECTOREFFECT_H__
|
#endif //__DSECTOREFFECT_H__
|
||||||
|
|
|
@ -56,7 +56,6 @@ DThinker *NextToThink;
|
||||||
|
|
||||||
FThinkerList DThinker::Thinkers[MAX_STATNUM+2];
|
FThinkerList DThinker::Thinkers[MAX_STATNUM+2];
|
||||||
FThinkerList DThinker::FreshThinkers[MAX_STATNUM+1];
|
FThinkerList DThinker::FreshThinkers[MAX_STATNUM+1];
|
||||||
bool DThinker::bSerialOverride = false;
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -232,17 +231,6 @@ void DThinker::SerializeThinkers(FSerializer &arc, bool hubLoad)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
DThinker::DThinker () throw()
|
|
||||||
{
|
|
||||||
NextThinker = nullptr;
|
|
||||||
PrevThinker = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
DThinker::DThinker(no_link_type foo) throw()
|
|
||||||
{
|
|
||||||
foo; // Avoid unused argument warnings.
|
|
||||||
}
|
|
||||||
|
|
||||||
DThinker::~DThinker ()
|
DThinker::~DThinker ()
|
||||||
{
|
{
|
||||||
assert(NextThinker == nullptr && PrevThinker == nullptr);
|
assert(NextThinker == nullptr && PrevThinker == nullptr);
|
||||||
|
|
|
@ -67,7 +67,6 @@ class DThinker : public DObject
|
||||||
DECLARE_CLASS (DThinker, DObject)
|
DECLARE_CLASS (DThinker, DObject)
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_DEFAULT;
|
static const int DEFAULT_STAT = STAT_DEFAULT;
|
||||||
DThinker () throw();
|
|
||||||
void OnDestroy () override;
|
void OnDestroy () override;
|
||||||
virtual ~DThinker ();
|
virtual ~DThinker ();
|
||||||
virtual void Tick ();
|
virtual void Tick ();
|
||||||
|
@ -92,11 +91,6 @@ public:
|
||||||
static void MarkRoots();
|
static void MarkRoots();
|
||||||
|
|
||||||
static DThinker *FirstThinker (int statnum);
|
static DThinker *FirstThinker (int statnum);
|
||||||
static bool bSerialOverride;
|
|
||||||
|
|
||||||
// only used internally but Create needs access.
|
|
||||||
enum no_link_type { NO_LINK };
|
|
||||||
DThinker(no_link_type) throw();
|
|
||||||
private:
|
private:
|
||||||
static void DestroyThinkersInList (FThinkerList &list);
|
static void DestroyThinkersInList (FThinkerList &list);
|
||||||
static bool DoDestroyThinkersInList(FThinkerList &list);
|
static bool DoDestroyThinkersInList(FThinkerList &list);
|
||||||
|
@ -113,7 +107,7 @@ private:
|
||||||
friend class DObject;
|
friend class DObject;
|
||||||
friend class FSerializer;
|
friend class FSerializer;
|
||||||
|
|
||||||
DThinker *NextThinker, *PrevThinker;
|
DThinker *NextThinker = nullptr, *PrevThinker = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FLevelLocals *Level;
|
FLevelLocals *Level;
|
||||||
|
|
|
@ -1741,11 +1741,9 @@ class DLightLevel : public DLighting
|
||||||
unsigned char destlevel;
|
unsigned char destlevel;
|
||||||
unsigned char speed;
|
unsigned char speed;
|
||||||
|
|
||||||
DLightLevel() = default;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DLightLevel(sector_t * s,int destlevel,int speed);
|
void Construct(sector_t * s,int destlevel,int speed);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
void OnDestroy() { Super::OnDestroy(); m_Sector->lightingdata = nullptr; }
|
void OnDestroy() { Super::OnDestroy(); m_Sector->lightingdata = nullptr; }
|
||||||
|
@ -1806,8 +1804,9 @@ void DLightLevel::Tick()
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
DLightLevel::DLightLevel(sector_t * s,int _destlevel,int _speed) : DLighting(s)
|
void DLightLevel::Construct(sector_t * s,int _destlevel,int _speed)
|
||||||
{
|
{
|
||||||
|
Super::Construct(s);
|
||||||
destlevel=_destlevel;
|
destlevel=_destlevel;
|
||||||
speed=_speed;
|
speed=_speed;
|
||||||
s->lightingdata=this;
|
s->lightingdata=this;
|
||||||
|
|
|
@ -361,7 +361,11 @@ IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
// This thinker is a little unusual from all the rest, because it
|
||||||
|
// needs to construct some non-serializable data.
|
||||||
//
|
//
|
||||||
|
// This cannot be done in Construct, but requires an actual constructor,
|
||||||
|
// so that even a deserialized ionstance is fully set up.
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
@ -369,15 +373,6 @@ DFraggleThinker::DFraggleThinker()
|
||||||
{
|
{
|
||||||
GlobalScript = Create<DFsScript>();
|
GlobalScript = Create<DFsScript>();
|
||||||
GC::WriteBarrier(this, GlobalScript);
|
GC::WriteBarrier(this, GlobalScript);
|
||||||
// do not create resources which will be filled in by the serializer if being called from there.
|
|
||||||
if (!bSerialOverride)
|
|
||||||
{
|
|
||||||
RunningScripts = Create<DRunningScript>();
|
|
||||||
GC::WriteBarrier(this, RunningScripts);
|
|
||||||
LevelScript = Create<DFsScript>();
|
|
||||||
LevelScript->parent = GlobalScript;
|
|
||||||
GC::WriteBarrier(this, LevelScript);
|
|
||||||
}
|
|
||||||
InitFunctions();
|
InitFunctions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,6 +382,21 @@ DFraggleThinker::DFraggleThinker()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
void DFraggleThinker::Construct()
|
||||||
|
{
|
||||||
|
RunningScripts = Create<DRunningScript>();
|
||||||
|
GC::WriteBarrier(this, RunningScripts);
|
||||||
|
LevelScript = Create<DFsScript>();
|
||||||
|
LevelScript->parent = GlobalScript;
|
||||||
|
GC::WriteBarrier(this, LevelScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
void DFraggleThinker::OnDestroy()
|
void DFraggleThinker::OnDestroy()
|
||||||
{
|
{
|
||||||
DRunningScript *p = RunningScripts;
|
DRunningScript *p = RunningScripts;
|
||||||
|
|
|
@ -696,7 +696,8 @@ public:
|
||||||
TObjPtr<DRunningScript*> RunningScripts;
|
TObjPtr<DRunningScript*> RunningScripts;
|
||||||
TArray<TObjPtr<AActor*> > SpawnedThings;
|
TArray<TObjPtr<AActor*> > SpawnedThings;
|
||||||
|
|
||||||
DFraggleThinker();
|
DFraggleThinker(); // This class needs a real constructor because it has non-serializable content.
|
||||||
|
void Construct();
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -909,6 +909,7 @@ class DAutosaver : public DThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DAutosaver, DThinker)
|
DECLARE_CLASS (DAutosaver, DThinker)
|
||||||
public:
|
public:
|
||||||
|
void Construct() {}
|
||||||
void Tick ();
|
void Tick ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -353,17 +353,6 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename... Args>
|
|
||||||
T* CreateThinker(Args&&... args)
|
|
||||||
{
|
|
||||||
auto thinker = Create<T>(std::forward<Args>(args)...);
|
|
||||||
auto statnum = T::DEFAULT_STAT;
|
|
||||||
thinker->ObjectFlags |= OF_JustSpawned;
|
|
||||||
DThinker::FreshThinkers[statnum].AddTail(thinker);
|
|
||||||
thinker->Level = this;
|
|
||||||
return thinker;
|
|
||||||
}
|
|
||||||
|
|
||||||
DThinker *CreateThinker(PClass *cls, int statnum = STAT_DEFAULT)
|
DThinker *CreateThinker(PClass *cls, int statnum = STAT_DEFAULT)
|
||||||
{
|
{
|
||||||
DThinker *thinker = static_cast<DThinker*>(cls->CreateNew());
|
DThinker *thinker = static_cast<DThinker*>(cls->CreateNew());
|
||||||
|
@ -374,6 +363,14 @@ public:
|
||||||
return thinker;
|
return thinker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, typename... Args>
|
||||||
|
T* CreateThinker(Args&&... args)
|
||||||
|
{
|
||||||
|
auto thinker = static_cast<T*>(CreateThinker(RUNTIME_CLASS(T), T::DEFAULT_STAT));
|
||||||
|
thinker->Construct(std::forward<Args>(args)...);
|
||||||
|
return thinker;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint8_t md5[16]; // for savegame validation. If the MD5 does not match the savegame won't be loaded.
|
uint8_t md5[16]; // for savegame validation. If the MD5 does not match the savegame won't be loaded.
|
||||||
int time; // time in the hub
|
int time; // time in the hub
|
||||||
|
|
|
@ -67,26 +67,39 @@ IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DImpactDecal, false, false)
|
IMPLEMENT_CLASS(DImpactDecal, false, false)
|
||||||
|
|
||||||
DBaseDecal::DBaseDecal (double z)
|
void DBaseDecal::Construct(double z)
|
||||||
: WallNext(0), WallPrev(0), LeftDistance(0), Z(z), ScaleX(1.), ScaleY(1.), Alpha(1.),
|
|
||||||
AlphaColor(0), Translation(0), RenderFlags(0), Side(nullptr), Sector(nullptr)
|
|
||||||
{
|
{
|
||||||
|
Z = z;
|
||||||
RenderStyle = STYLE_None;
|
RenderStyle = STYLE_None;
|
||||||
PicNum.SetInvalid();
|
PicNum.SetInvalid();
|
||||||
}
|
}
|
||||||
|
|
||||||
DBaseDecal::DBaseDecal (const AActor *basis)
|
void DBaseDecal::Construct(const AActor *basis)
|
||||||
: WallNext(nullptr), WallPrev(nullptr), LeftDistance(0), Z(basis->Z()), ScaleX(basis->Scale.X), ScaleY(basis->Scale.Y),
|
|
||||||
Alpha(basis->Alpha), AlphaColor(basis->fillcolor), Translation(basis->Translation), PicNum(basis->picnum),
|
|
||||||
RenderFlags(basis->renderflags), RenderStyle(basis->RenderStyle), Side(nullptr), Sector(nullptr)
|
|
||||||
{
|
{
|
||||||
|
Z = basis->Z();
|
||||||
|
ScaleX = basis->Scale.X;
|
||||||
|
ScaleY = basis->Scale.Y;
|
||||||
|
Alpha = basis->Alpha;
|
||||||
|
AlphaColor = basis->fillcolor;
|
||||||
|
Translation = basis->Translation;
|
||||||
|
PicNum = basis->picnum;
|
||||||
|
RenderFlags = basis->renderflags;
|
||||||
|
RenderStyle = basis->RenderStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBaseDecal::DBaseDecal (const DBaseDecal *basis)
|
void DBaseDecal::Construct(const DBaseDecal *basis)
|
||||||
: WallNext(nullptr), WallPrev(nullptr), LeftDistance(basis->LeftDistance), Z(basis->Z), ScaleX(basis->ScaleX),
|
|
||||||
ScaleY(basis->ScaleY), Alpha(basis->Alpha), AlphaColor(basis->AlphaColor), Translation(basis->Translation),
|
|
||||||
PicNum(basis->PicNum), RenderFlags(basis->RenderFlags), RenderStyle(basis->RenderStyle), Side(nullptr), Sector(nullptr)
|
|
||||||
{
|
{
|
||||||
|
LeftDistance = basis->LeftDistance;
|
||||||
|
Z = basis->Z;
|
||||||
|
ScaleX = basis->ScaleX;
|
||||||
|
ScaleY = basis->ScaleY;
|
||||||
|
Alpha = basis->Alpha;
|
||||||
|
AlphaColor = basis->AlphaColor;
|
||||||
|
Translation = basis->Translation;
|
||||||
|
PicNum = basis->PicNum;
|
||||||
|
RenderFlags = basis->RenderFlags;
|
||||||
|
RenderStyle = basis->RenderStyle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBaseDecal::OnDestroy ()
|
void DBaseDecal::OnDestroy ()
|
||||||
|
|
|
@ -43,11 +43,13 @@ IMPLEMENT_POINTERS_START(DFlashFader)
|
||||||
IMPLEMENT_POINTER(ForWho)
|
IMPLEMENT_POINTER(ForWho)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DFlashFader::DFlashFader (float r1, float g1, float b1, float a1,
|
void DFlashFader::Construct (float r1, float g1, float b1, float a1,
|
||||||
float r2, float g2, float b2, float a2,
|
float r2, float g2, float b2, float a2,
|
||||||
float time, AActor *who, bool terminate)
|
float time, AActor *who, bool terminate)
|
||||||
: TotalTics ((int)(time*TICRATE)), RemainingTics(TotalTics), ForWho (who)
|
|
||||||
{
|
{
|
||||||
|
TotalTics = (int)(time*TICRATE);
|
||||||
|
RemainingTics = TotalTics;
|
||||||
|
ForWho = who;
|
||||||
Blends[0][0]=r1; Blends[0][1]=g1; Blends[0][2]=b1; Blends[0][3]=a1;
|
Blends[0][0]=r1; Blends[0][1]=g1; Blends[0][2]=b1; Blends[0][3]=a1;
|
||||||
Blends[1][0]=r2; Blends[1][1]=g2; Blends[1][2]=b2; Blends[1][3]=a2;
|
Blends[1][0]=r2; Blends[1][1]=g2; Blends[1][2]=b2; Blends[1][3]=a2;
|
||||||
Terminate = terminate;
|
Terminate = terminate;
|
||||||
|
|
|
@ -41,7 +41,7 @@ static FRandom pr_lightning ("Lightning");
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DLightningThinker, false, false)
|
IMPLEMENT_CLASS(DLightningThinker, false, false)
|
||||||
|
|
||||||
DLightningThinker::DLightningThinker ()
|
void DLightningThinker::Construct()
|
||||||
{
|
{
|
||||||
Stopped = false;
|
Stopped = false;
|
||||||
LightningFlashCount = 0;
|
LightningFlashCount = 0;
|
||||||
|
|
|
@ -12,7 +12,7 @@ class DLightningThinker : public DThinker
|
||||||
DECLARE_CLASS (DLightningThinker, DThinker);
|
DECLARE_CLASS (DLightningThinker, DThinker);
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_LIGHTNING;
|
static const int DEFAULT_STAT = STAT_LIGHTNING;
|
||||||
DLightningThinker ();
|
void Construct();
|
||||||
~DLightningThinker ();
|
~DLightningThinker ();
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
|
@ -47,7 +47,7 @@ IMPLEMENT_POINTERS_END
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
DEarthquake::DEarthquake(AActor *center, int intensityX, int intensityY, int intensityZ, int duration,
|
void DEarthquake::Construct(AActor *center, int intensityX, int intensityY, int intensityZ, int duration,
|
||||||
int damrad, int tremrad, FSoundID quakesound, int flags,
|
int damrad, int tremrad, FSoundID quakesound, int flags,
|
||||||
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint,
|
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint,
|
||||||
double rollIntensity, double rollWave)
|
double rollIntensity, double rollWave)
|
||||||
|
|
|
@ -20,9 +20,9 @@ class DBaseDecal : public DThinker
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_DECAL;
|
static const int DEFAULT_STAT = STAT_DECAL;
|
||||||
DBaseDecal(double z = 0);
|
void Construct(double z = 0);
|
||||||
DBaseDecal (const AActor *actor);
|
void Construct(const AActor *actor);
|
||||||
DBaseDecal (const DBaseDecal *basis);
|
void Construct(const DBaseDecal *basis);
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
|
@ -33,19 +33,19 @@ public:
|
||||||
void Spread (const FDecalTemplate *tpl, side_t *wall, double x, double y, double z, F3DFloor * ffloor);
|
void Spread (const FDecalTemplate *tpl, side_t *wall, double x, double y, double z, F3DFloor * ffloor);
|
||||||
void GetXY (side_t *side, double &x, double &y) const;
|
void GetXY (side_t *side, double &x, double &y) const;
|
||||||
|
|
||||||
DBaseDecal *WallNext, *WallPrev;
|
DBaseDecal *WallNext = nullptr, *WallPrev = nullptr;
|
||||||
|
|
||||||
double LeftDistance;
|
double LeftDistance = 0;
|
||||||
double Z;
|
double Z;
|
||||||
double ScaleX, ScaleY;
|
double ScaleX = 1, ScaleY = 1;
|
||||||
double Alpha;
|
double Alpha = 1;
|
||||||
uint32_t AlphaColor;
|
uint32_t AlphaColor = 0;
|
||||||
int Translation;
|
int Translation = 0;
|
||||||
FTextureID PicNum;
|
FTextureID PicNum;
|
||||||
uint32_t RenderFlags;
|
uint32_t RenderFlags = 0;
|
||||||
FRenderStyle RenderStyle;
|
FRenderStyle RenderStyle;
|
||||||
side_t *Side;
|
side_t *Side = nullptr;
|
||||||
sector_t *Sector;
|
sector_t *Sector = nullptr;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual DBaseDecal *CloneSelf(const FDecalTemplate *tpl, double x, double y, double z, side_t *wall, F3DFloor * ffloor) const;
|
virtual DBaseDecal *CloneSelf(const FDecalTemplate *tpl, double x, double y, double z, side_t *wall, F3DFloor * ffloor) const;
|
||||||
|
@ -61,8 +61,11 @@ class DImpactDecal : public DBaseDecal
|
||||||
DECLARE_CLASS (DImpactDecal, DBaseDecal)
|
DECLARE_CLASS (DImpactDecal, DBaseDecal)
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_AUTODECAL;
|
static const int DEFAULT_STAT = STAT_AUTODECAL;
|
||||||
DImpactDecal(double z = 0) : DBaseDecal(z) {}
|
void Construct(double z = 0)
|
||||||
DImpactDecal (side_t *wall, const FDecalTemplate *templ);
|
{
|
||||||
|
Super::Construct(z);
|
||||||
|
}
|
||||||
|
void Construct(side_t *wall, const FDecalTemplate *templ);
|
||||||
|
|
||||||
static DImpactDecal *StaticCreate(FLevelLocals *Level, const char *name, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color = 0);
|
static DImpactDecal *StaticCreate(FLevelLocals *Level, const char *name, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color = 0);
|
||||||
static DImpactDecal *StaticCreate(FLevelLocals *Level, const FDecalTemplate *tpl, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color = 0);
|
static DImpactDecal *StaticCreate(FLevelLocals *Level, const FDecalTemplate *tpl, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color = 0);
|
||||||
|
@ -79,7 +82,7 @@ class DFlashFader : public DThinker
|
||||||
DECLARE_CLASS (DFlashFader, DThinker)
|
DECLARE_CLASS (DFlashFader, DThinker)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
DFlashFader (float r1, float g1, float b1, float a1,
|
void Construct(float r1, float g1, float b1, float a1,
|
||||||
float r2, float g2, float b2, float a2,
|
float r2, float g2, float b2, float a2,
|
||||||
float time, AActor *who, bool terminate = false);
|
float time, AActor *who, bool terminate = false);
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
|
@ -96,7 +99,6 @@ protected:
|
||||||
TObjPtr<AActor*> ForWho;
|
TObjPtr<AActor*> ForWho;
|
||||||
bool Terminate;
|
bool Terminate;
|
||||||
void SetBlend (float time);
|
void SetBlend (float time);
|
||||||
DFlashFader() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -124,7 +126,7 @@ class DEarthquake : public DThinker
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_EARTHQUAKE;
|
static const int DEFAULT_STAT = STAT_EARTHQUAKE;
|
||||||
DEarthquake(AActor *center, int intensityX, int intensityY, int intensityZ, int duration,
|
void Construct(AActor *center, int intensityX, int intensityY, int intensityZ, int duration,
|
||||||
int damrad, int tremrad, FSoundID quakesfx, int flags,
|
int damrad, int tremrad, FSoundID quakesfx, int flags,
|
||||||
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double rollIntensity, double rollWave);
|
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double rollIntensity, double rollWave);
|
||||||
|
|
||||||
|
@ -147,9 +149,6 @@ public:
|
||||||
double GetFalloff(double dist) const;
|
double GetFalloff(double dist) const;
|
||||||
|
|
||||||
static int StaticGetQuakeIntensities(double ticFrac, AActor *viewer, FQuakeJiggers &jiggers);
|
static int StaticGetQuakeIntensities(double ticFrac, AActor *viewer, FQuakeJiggers &jiggers);
|
||||||
|
|
||||||
private:
|
|
||||||
DEarthquake() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__A_SHAREDGLOBAL_H__
|
#endif //__A_SHAREDGLOBAL_H__
|
||||||
|
|
|
@ -597,6 +597,7 @@ class DSuicider : public DThinker
|
||||||
public:
|
public:
|
||||||
TObjPtr<AActor*> Pawn;
|
TObjPtr<AActor*> Pawn;
|
||||||
|
|
||||||
|
void Construct() {}
|
||||||
void Tick()
|
void Tick()
|
||||||
{
|
{
|
||||||
Pawn->flags |= MF_SHOOTABLE;
|
Pawn->flags |= MF_SHOOTABLE;
|
||||||
|
|
|
@ -1813,7 +1813,7 @@ class DPlaneWatcher : public DThinker
|
||||||
DECLARE_CLASS (DPlaneWatcher, DThinker)
|
DECLARE_CLASS (DPlaneWatcher, DThinker)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceiling,
|
void Construct(AActor *it, line_t *line, int lineSide, bool ceiling,
|
||||||
sector_t *sec, int height, int special,
|
sector_t *sec, int height, int special,
|
||||||
int arg0, int arg1, int arg2, int arg3, int arg4);
|
int arg0, int arg1, int arg2, int arg3, int arg4);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -1837,13 +1837,17 @@ IMPLEMENT_POINTERS_START(DPlaneWatcher)
|
||||||
IMPLEMENT_POINTER(Activator)
|
IMPLEMENT_POINTER(Activator)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DPlaneWatcher::DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceiling,
|
void DPlaneWatcher::Construct(AActor *it, line_t *line, int lineSide, bool ceiling,
|
||||||
sector_t *sec, int height, int special, int arg0, int arg1, int arg2, int arg3, int arg4)
|
sector_t *sec, int height, int special, int arg0, int arg1, int arg2, int arg3, int arg4)
|
||||||
: Special (special),
|
|
||||||
Activator (it), Line (line), LineSide (!!lineSide), bCeiling (ceiling)
|
|
||||||
{
|
{
|
||||||
secplane_t plane;
|
secplane_t plane;
|
||||||
|
|
||||||
|
Special = special;
|
||||||
|
Activator = it;
|
||||||
|
Line = line;
|
||||||
|
LineSide = !!lineSide;
|
||||||
|
bCeiling = ceiling;
|
||||||
|
|
||||||
Args[0] = arg0;
|
Args[0] = arg0;
|
||||||
Args[1] = arg1;
|
Args[1] = arg1;
|
||||||
Args[2] = arg2;
|
Args[2] = arg2;
|
||||||
|
@ -3299,13 +3303,6 @@ IMPLEMENT_POINTERS_START(DACSThinker)
|
||||||
IMPLEMENT_POINTER(Scripts)
|
IMPLEMENT_POINTER(Scripts)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DACSThinker::DACSThinker ()
|
|
||||||
{
|
|
||||||
Scripts = nullptr;
|
|
||||||
LastScript = nullptr;
|
|
||||||
RunningScripts.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
DACSThinker::~DACSThinker ()
|
DACSThinker::~DACSThinker ()
|
||||||
{
|
{
|
||||||
Scripts = nullptr;
|
Scripts = nullptr;
|
||||||
|
|
|
@ -454,7 +454,7 @@ class DACSThinker : public DThinker
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_SCRIPTS;
|
static const int DEFAULT_STAT = STAT_SCRIPTS;
|
||||||
DACSThinker();
|
void Construct() {}
|
||||||
~DACSThinker();
|
~DACSThinker();
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
@ -467,8 +467,8 @@ public:
|
||||||
void StopScriptsFor(AActor *actor);
|
void StopScriptsFor(AActor *actor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DLevelScript *LastScript;
|
DLevelScript *LastScript = nullptr;
|
||||||
DLevelScript *Scripts; // List of all running scripts
|
DLevelScript *Scripts = nullptr; // List of all running scripts
|
||||||
|
|
||||||
friend class DLevelScript;
|
friend class DLevelScript;
|
||||||
friend class FBehavior;
|
friend class FBehavior;
|
||||||
|
|
|
@ -204,14 +204,14 @@ void DCeiling::Tick ()
|
||||||
//
|
//
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
DCeiling::DCeiling (sector_t *sec)
|
void DCeiling::Construct(sector_t *sec)
|
||||||
: DMovingCeiling (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
DCeiling::DCeiling (sector_t *sec, double speed1, double speed2, int silent)
|
void DCeiling::Construct(sector_t *sec, double speed1, double speed2, int silent)
|
||||||
: DMovingCeiling (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
m_Crush = -1;
|
m_Crush = -1;
|
||||||
m_CrushMode = ECrushMode::crushDoom;
|
m_CrushMode = ECrushMode::crushDoom;
|
||||||
m_Speed = m_Speed1 = speed1;
|
m_Speed = m_Speed1 = speed1;
|
||||||
|
|
|
@ -328,9 +328,9 @@ void DDoor::DoorSound(bool raise, DSeqNode *curseq) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DDoor::DDoor (sector_t *sector)
|
void DDoor::Construct(sector_t *sector)
|
||||||
: DMovingCeiling (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
@ -339,13 +339,19 @@ DDoor::DDoor (sector_t *sector)
|
||||||
//
|
//
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
DDoor::DDoor (sector_t *sec, EVlDoor type, double speed, int delay, int lightTag, int topcountdown)
|
void DDoor::Construct(sector_t *sec, EVlDoor type, double speed, int delay, int lightTag, int topcountdown)
|
||||||
: DMovingCeiling (sec),
|
|
||||||
m_Type (type), m_Speed (speed), m_TopWait (delay), m_TopCountdown(topcountdown), m_LightTag (lightTag)
|
|
||||||
{
|
{
|
||||||
vertex_t *spot;
|
vertex_t *spot;
|
||||||
double height;
|
double height;
|
||||||
|
|
||||||
|
Super::Construct(sec);
|
||||||
|
|
||||||
|
m_Type = type;
|
||||||
|
m_Speed = speed;
|
||||||
|
m_TopWait = delay;
|
||||||
|
m_TopCountdown = topcountdown;
|
||||||
|
m_LightTag = lightTag;
|
||||||
|
|
||||||
if (i_compatflags & COMPATF_NODOORLIGHT)
|
if (i_compatflags & COMPATF_NODOORLIGHT)
|
||||||
{
|
{
|
||||||
m_LightTag = 0;
|
m_LightTag = 0;
|
||||||
|
@ -510,9 +516,9 @@ bool FLevelLocals::EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DAnimatedDoor, false, false)
|
IMPLEMENT_CLASS(DAnimatedDoor, false, false)
|
||||||
|
|
||||||
DAnimatedDoor::DAnimatedDoor (sector_t *sec)
|
void DAnimatedDoor::Construct(sector_t *sec)
|
||||||
: DMovingCeiling (sec, false)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DAnimatedDoor::Serialize(FSerializer &arc)
|
void DAnimatedDoor::Serialize(FSerializer &arc)
|
||||||
|
@ -675,12 +681,13 @@ void DAnimatedDoor::Tick ()
|
||||||
//
|
//
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, DAnimatedDoor::EADType type)
|
void DAnimatedDoor::Construct(sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, DAnimatedDoor::EADType type)
|
||||||
: DMovingCeiling (sec, false)
|
|
||||||
{
|
{
|
||||||
double topdist;
|
double topdist;
|
||||||
FTextureID picnum;
|
FTextureID picnum;
|
||||||
|
|
||||||
|
Super::Construct(sec, false);
|
||||||
|
|
||||||
m_DoorAnim = anim;
|
m_DoorAnim = anim;
|
||||||
|
|
||||||
m_Line1 = line;
|
m_Line1 = line;
|
||||||
|
|
|
@ -255,9 +255,9 @@ void DFloor::StartFloorSound ()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
DFloor::DFloor (sector_t *sec)
|
void DFloor::Construct(sector_t *sec)
|
||||||
: DMovingFloor (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -858,9 +858,9 @@ IMPLEMENT_POINTERS_START(DElevator)
|
||||||
IMPLEMENT_POINTER(m_Interp_Ceiling)
|
IMPLEMENT_POINTER(m_Interp_Ceiling)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DElevator::DElevator (sector_t *sec)
|
void DElevator::Construct(sector_t *sec)
|
||||||
: Super (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
sec->floordata = this;
|
sec->floordata = this;
|
||||||
sec->ceilingdata = this;
|
sec->ceilingdata = this;
|
||||||
m_Interp_Floor = sec->SetInterpolation(sector_t::FloorMove, true);
|
m_Interp_Floor = sec->SetInterpolation(sector_t::FloorMove, true);
|
||||||
|
@ -1164,9 +1164,9 @@ void DWaggleBase::Serialize(FSerializer &arc)
|
||||||
#define WGLSTATE_STABLE 2
|
#define WGLSTATE_STABLE 2
|
||||||
#define WGLSTATE_REDUCE 3
|
#define WGLSTATE_REDUCE 3
|
||||||
|
|
||||||
DWaggleBase::DWaggleBase (sector_t *sec)
|
void DWaggleBase::Construct(sector_t *sec)
|
||||||
: Super (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -1252,9 +1252,9 @@ void DWaggleBase::DoWaggle (bool ceiling)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
DFloorWaggle::DFloorWaggle (sector_t *sec)
|
void DFloorWaggle::Construct(sector_t *sec)
|
||||||
: Super (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
sec->floordata = this;
|
sec->floordata = this;
|
||||||
interpolation = sec->SetInterpolation(sector_t::FloorMove, true);
|
interpolation = sec->SetInterpolation(sector_t::FloorMove, true);
|
||||||
}
|
}
|
||||||
|
@ -1270,9 +1270,9 @@ void DFloorWaggle::Tick ()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
DCeilingWaggle::DCeilingWaggle (sector_t *sec)
|
void DCeilingWaggle::Construct(sector_t *sec)
|
||||||
: Super (sec)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sec);
|
||||||
sec->ceilingdata = this;
|
sec->ceilingdata = this;
|
||||||
interpolation = sec->SetInterpolation(sector_t::CeilingMove, true);
|
interpolation = sec->SetInterpolation(sector_t::CeilingMove, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,11 +57,6 @@ static FRandom pr_fireflicker ("FireFlicker");
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DLighting, false, false)
|
IMPLEMENT_CLASS(DLighting, false, false)
|
||||||
|
|
||||||
DLighting::DLighting (sector_t *sector)
|
|
||||||
: DSectorEffect (sector)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// FIRELIGHT FLICKER
|
// FIRELIGHT FLICKER
|
||||||
|
@ -109,17 +104,17 @@ void DFireFlicker::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DFireFlicker::DFireFlicker (sector_t *sector)
|
void DFireFlicker::Construct(sector_t *sector)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_MaxLight = sector->lightlevel;
|
m_MaxLight = sector->lightlevel;
|
||||||
m_MinLight = sector_t::ClampLight(FindMinSurroundingLight(sector, sector->lightlevel) + 16);
|
m_MinLight = sector_t::ClampLight(FindMinSurroundingLight(sector, sector->lightlevel) + 16);
|
||||||
m_Count = 4;
|
m_Count = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
DFireFlicker::DFireFlicker (sector_t *sector, int upper, int lower)
|
void DFireFlicker::Construct(sector_t *sector, int upper, int lower)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_MaxLight = sector_t::ClampLight(upper);
|
m_MaxLight = sector_t::ClampLight(upper);
|
||||||
m_MinLight = sector_t::ClampLight(lower);
|
m_MinLight = sector_t::ClampLight(lower);
|
||||||
m_Count = 4;
|
m_Count = 4;
|
||||||
|
@ -171,9 +166,9 @@ void DFlicker::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DFlicker::DFlicker (sector_t *sector, int upper, int lower)
|
void DFlicker::Construct(sector_t *sector, int upper, int lower)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_MaxLight = sector_t::ClampLight(upper);
|
m_MaxLight = sector_t::ClampLight(upper);
|
||||||
m_MinLight = sector_t::ClampLight(lower);
|
m_MinLight = sector_t::ClampLight(lower);
|
||||||
sector->lightlevel = m_MaxLight;
|
sector->lightlevel = m_MaxLight;
|
||||||
|
@ -228,9 +223,9 @@ void DLightFlash::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DLightFlash::DLightFlash (sector_t *sector)
|
void DLightFlash::Construct(sector_t *sector)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
// Find light levels like Doom.
|
// Find light levels like Doom.
|
||||||
m_MaxLight = sector->lightlevel;
|
m_MaxLight = sector->lightlevel;
|
||||||
m_MinLight = FindMinSurroundingLight (sector, sector->lightlevel);
|
m_MinLight = FindMinSurroundingLight (sector, sector->lightlevel);
|
||||||
|
@ -239,9 +234,9 @@ DLightFlash::DLightFlash (sector_t *sector)
|
||||||
m_Count = (pr_lightflash() & m_MaxTime) + 1;
|
m_Count = (pr_lightflash() & m_MaxTime) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLightFlash::DLightFlash (sector_t *sector, int min, int max)
|
void DLightFlash::Construct (sector_t *sector, int min, int max)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
// Use specified light levels.
|
// Use specified light levels.
|
||||||
m_MaxLight = sector_t::ClampLight(max);
|
m_MaxLight = sector_t::ClampLight(max);
|
||||||
m_MinLight = sector_t::ClampLight(min);
|
m_MinLight = sector_t::ClampLight(min);
|
||||||
|
@ -298,9 +293,9 @@ void DStrobe::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DStrobe::DStrobe (sector_t *sector, int upper, int lower, int utics, int ltics)
|
void DStrobe::Construct(sector_t *sector, int upper, int lower, int utics, int ltics)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_DarkTime = ltics;
|
m_DarkTime = ltics;
|
||||||
m_BrightTime = utics;
|
m_BrightTime = utics;
|
||||||
m_MaxLight = sector_t::ClampLight(upper);
|
m_MaxLight = sector_t::ClampLight(upper);
|
||||||
|
@ -314,9 +309,9 @@ DStrobe::DStrobe (sector_t *sector, int upper, int lower, int utics, int ltics)
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DStrobe::DStrobe (sector_t *sector, int utics, int ltics, bool inSync)
|
void DStrobe::Construct(sector_t *sector, int utics, int ltics, bool inSync)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_DarkTime = ltics;
|
m_DarkTime = ltics;
|
||||||
m_BrightTime = utics;
|
m_BrightTime = utics;
|
||||||
|
|
||||||
|
@ -390,9 +385,9 @@ void DGlow::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DGlow::DGlow (sector_t *sector)
|
void DGlow::Construct(sector_t *sector)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_MinLight = FindMinSurroundingLight (sector, sector->lightlevel);
|
m_MinLight = FindMinSurroundingLight (sector, sector->lightlevel);
|
||||||
m_MaxLight = sector->lightlevel;
|
m_MaxLight = sector->lightlevel;
|
||||||
m_Direction = -1;
|
m_Direction = -1;
|
||||||
|
@ -450,9 +445,9 @@ void DGlow2::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DGlow2::DGlow2 (sector_t *sector, int start, int end, int tics, bool oneshot)
|
void DGlow2::Construct(sector_t *sector, int start, int end, int tics, bool oneshot)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_Start = sector_t::ClampLight(start);
|
m_Start = sector_t::ClampLight(start);
|
||||||
m_End = sector_t::ClampLight(end);
|
m_End = sector_t::ClampLight(end);
|
||||||
m_MaxTics = tics;
|
m_MaxTics = tics;
|
||||||
|
@ -550,9 +545,9 @@ void DPhased::Propagate()
|
||||||
PhaseHelper (m_Sector, 0, 0, nullptr);
|
PhaseHelper (m_Sector, 0, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPhased::DPhased (sector_t *sector, int baselevel, int phase)
|
void DPhased::Construct (sector_t *sector, int baselevel, int phase)
|
||||||
: DLighting (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
m_BaseLevel = baselevel;
|
m_BaseLevel = baselevel;
|
||||||
m_Phase = phase;
|
m_Phase = phase;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,10 +114,9 @@ void DPillar::Tick ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPillar::DPillar (sector_t *sector, EPillar type, double speed,
|
void DPillar::Construct(sector_t *sector, EPillar type, double speed, double floordist, double ceilingdist, int crush, bool hexencrush)
|
||||||
double floordist, double ceilingdist, int crush, bool hexencrush)
|
|
||||||
: DMover (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
double newheight;
|
double newheight;
|
||||||
vertex_t *spot;
|
vertex_t *spot;
|
||||||
|
|
||||||
|
|
|
@ -215,9 +215,9 @@ void DPlat::Stop()
|
||||||
m_Status = in_stasis;
|
m_Status = in_stasis;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPlat::DPlat (sector_t *sector)
|
void DPlat::Construct (sector_t *sector)
|
||||||
: DMovingFloor (sector)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(sector);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -110,7 +110,7 @@ void DPusher::Serialize(FSerializer &arc)
|
||||||
//
|
//
|
||||||
// Add a push thinker to the thinker list
|
// Add a push thinker to the thinker list
|
||||||
|
|
||||||
DPusher::DPusher (DPusher::EPusher type, line_t *l, int magnitude, int angle,
|
void DPusher::Construct (DPusher::EPusher type, line_t *l, int magnitude, int angle,
|
||||||
AActor *source, int affectee)
|
AActor *source, int affectee)
|
||||||
{
|
{
|
||||||
m_Source = source;
|
m_Source = source;
|
||||||
|
|
|
@ -246,7 +246,7 @@ void DScroller::Tick ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DScroller::DScroller (EScroll type, double dx, double dy, sector_t *ctrl, sector_t *sec, side_t *side, int accel, EScrollPos scrollpos)
|
void DScroller::Construct (EScroll type, double dx, double dy, sector_t *ctrl, sector_t *sec, side_t *side, int accel, EScrollPos scrollpos)
|
||||||
{
|
{
|
||||||
m_Type = type;
|
m_Type = type;
|
||||||
m_dx = dx;
|
m_dx = dx;
|
||||||
|
@ -327,7 +327,7 @@ void DScroller::OnDestroy ()
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DScroller::DScroller (double dx, double dy, const line_t *l, sector_t * control, int accel, EScrollPos scrollpos)
|
void DScroller::Construct(double dx, double dy, const line_t *l, sector_t * control, int accel, EScrollPos scrollpos)
|
||||||
{
|
{
|
||||||
double x = fabs(l->Delta().X), y = fabs(l->Delta().Y), d;
|
double x = fabs(l->Delta().X), y = fabs(l->Delta().Y), d;
|
||||||
if (y > x) d = x, x = y, y = d;
|
if (y > x) d = x, x = y, y = d;
|
||||||
|
|
|
@ -696,7 +696,7 @@ void DLightTransfer::Serialize(FSerializer &arc)
|
||||||
("copyfloor", CopyFloor);
|
("copyfloor", CopyFloor);
|
||||||
}
|
}
|
||||||
|
|
||||||
DLightTransfer::DLightTransfer (sector_t *srcSec, int target, bool copyFloor)
|
void DLightTransfer::Construct(sector_t *srcSec, int target, bool copyFloor)
|
||||||
{
|
{
|
||||||
int secnum;
|
int secnum;
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ void DWallLightTransfer::Serialize(FSerializer &arc)
|
||||||
("flags", Flags);
|
("flags", Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWallLightTransfer::DWallLightTransfer (sector_t *srcSec, int target, uint8_t flags)
|
void DWallLightTransfer::Construct(sector_t *srcSec, int target, uint8_t flags)
|
||||||
{
|
{
|
||||||
int linenum;
|
int linenum;
|
||||||
int wallflags;
|
int wallflags;
|
||||||
|
|
53
src/p_spec.h
53
src/p_spec.h
|
@ -126,9 +126,6 @@ class DLighting : public DSectorEffect
|
||||||
DECLARE_CLASS(DLighting, DSectorEffect)
|
DECLARE_CLASS(DLighting, DSectorEffect)
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_LIGHT;
|
static const int DEFAULT_STAT = STAT_LIGHT;
|
||||||
DLighting(sector_t *sector);
|
|
||||||
protected:
|
|
||||||
DLighting() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -176,7 +173,7 @@ public:
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
bool IsLift() const { return m_Type == platDownWaitUpStay || m_Type == platDownWaitUpStayStone; }
|
bool IsLift() const { return m_Type == platDownWaitUpStay || m_Type == platDownWaitUpStayStone; }
|
||||||
DPlat(sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -195,9 +192,6 @@ protected:
|
||||||
void Reactivate ();
|
void Reactivate ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
|
|
||||||
private:
|
|
||||||
DPlat() = default;
|
|
||||||
|
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -218,8 +212,7 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DPillar (sector_t *sector, EPillar type, double speed, double height,
|
void Construct (sector_t *sector, EPillar type, double speed, double height, double height2, int crush, bool hexencrush);
|
||||||
double height2, int crush, bool hexencrush);
|
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -235,9 +228,6 @@ protected:
|
||||||
bool m_Hexencrush;
|
bool m_Hexencrush;
|
||||||
TObjPtr<DInterpolation*> m_Interp_Ceiling;
|
TObjPtr<DInterpolation*> m_Interp_Ceiling;
|
||||||
TObjPtr<DInterpolation*> m_Interp_Floor;
|
TObjPtr<DInterpolation*> m_Interp_Floor;
|
||||||
|
|
||||||
private:
|
|
||||||
DPillar() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,8 +248,8 @@ public:
|
||||||
doorWaitClose,
|
doorWaitClose,
|
||||||
};
|
};
|
||||||
|
|
||||||
DDoor (sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
DDoor (sector_t *sec, EVlDoor type, double speed, int delay, int lightTag, int topcountdown);
|
void Construct(sector_t *sec, EVlDoor type, double speed, int delay, int lightTag, int topcountdown);
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -285,8 +275,6 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
DDoor() = default;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DAnimatedDoor : public DMovingCeiling
|
class DAnimatedDoor : public DMovingCeiling
|
||||||
|
@ -300,8 +288,8 @@ public:
|
||||||
adClose
|
adClose
|
||||||
};
|
};
|
||||||
|
|
||||||
DAnimatedDoor (sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, EADType type);
|
void Construct(sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, EADType type);
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -327,8 +315,6 @@ protected:
|
||||||
bool m_SetBlocking1, m_SetBlocking2;
|
bool m_SetBlocking1, m_SetBlocking2;
|
||||||
|
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
private:
|
|
||||||
DAnimatedDoor() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -379,8 +365,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
DCeiling (sector_t *sec);
|
void Construct(sector_t *sec);
|
||||||
DCeiling (sector_t *sec, double speed1, double speed2, int silent);
|
void Construct(sector_t *sec, double speed1, double speed2, int silent);
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -407,10 +393,7 @@ protected:
|
||||||
|
|
||||||
void PlayCeilingSound ();
|
void PlayCeilingSound ();
|
||||||
|
|
||||||
private:
|
|
||||||
DCeiling() = default;
|
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -474,7 +457,7 @@ public:
|
||||||
stairCrush = 4,
|
stairCrush = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
DFloor (sector_t *sec);
|
void Construct(sector_t *sec);
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -501,9 +484,6 @@ public:
|
||||||
void StartFloorSound ();
|
void StartFloorSound ();
|
||||||
void SetFloorChangeType (sector_t *sec, int change);
|
void SetFloorChangeType (sector_t *sec, int change);
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
|
|
||||||
private:
|
|
||||||
DFloor() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DElevator : public DMover
|
class DElevator : public DMover
|
||||||
|
@ -521,7 +501,7 @@ public:
|
||||||
elevateLower
|
elevateLower
|
||||||
};
|
};
|
||||||
|
|
||||||
DElevator (sector_t *sec);
|
void Construct(sector_t *sec);
|
||||||
|
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
@ -538,8 +518,6 @@ protected:
|
||||||
|
|
||||||
void StartFloorSound ();
|
void StartFloorSound ();
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
private:
|
|
||||||
DElevator() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -548,7 +526,7 @@ class DWaggleBase : public DMover
|
||||||
DECLARE_CLASS (DWaggleBase, DMover)
|
DECLARE_CLASS (DWaggleBase, DMover)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
DWaggleBase (sector_t *sec);
|
void Construct(sector_t *sec);
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
|
||||||
|
@ -564,27 +542,22 @@ protected:
|
||||||
|
|
||||||
friend struct FLevelLocals;
|
friend struct FLevelLocals;
|
||||||
void DoWaggle (bool ceiling);
|
void DoWaggle (bool ceiling);
|
||||||
DWaggleBase() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DFloorWaggle : public DWaggleBase
|
class DFloorWaggle : public DWaggleBase
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DFloorWaggle, DWaggleBase)
|
DECLARE_CLASS (DFloorWaggle, DWaggleBase)
|
||||||
public:
|
public:
|
||||||
DFloorWaggle (sector_t *sec);
|
void Construct(sector_t *sec);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
private:
|
|
||||||
DFloorWaggle() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DCeilingWaggle : public DWaggleBase
|
class DCeilingWaggle : public DWaggleBase
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DCeilingWaggle, DWaggleBase)
|
DECLARE_CLASS (DCeilingWaggle, DWaggleBase)
|
||||||
public:
|
public:
|
||||||
DCeilingWaggle (sector_t *sec);
|
void Construct(sector_t *sec);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
private:
|
|
||||||
DCeilingWaggle() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//jff 3/15/98 pure texture/type change for better generalized support
|
//jff 3/15/98 pure texture/type change for better generalized support
|
||||||
|
|
|
@ -7,10 +7,9 @@ class DLightTransfer : public DThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DLightTransfer, DThinker)
|
DECLARE_CLASS (DLightTransfer, DThinker)
|
||||||
|
|
||||||
DLightTransfer() = default;
|
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_LIGHTTRANSFER;
|
static const int DEFAULT_STAT = STAT_LIGHTTRANSFER;
|
||||||
DLightTransfer (sector_t *srcSec, int target, bool copyFloor);
|
void Construct(sector_t *srcSec, int target, bool copyFloor);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
|
@ -33,10 +32,9 @@ class DWallLightTransfer : public DThinker
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_CLASS (DWallLightTransfer, DThinker)
|
DECLARE_CLASS (DWallLightTransfer, DThinker)
|
||||||
DWallLightTransfer() = default;
|
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_LIGHTTRANSFER;
|
static const int DEFAULT_STAT = STAT_LIGHTTRANSFER;
|
||||||
DWallLightTransfer (sector_t *srcSec, int target, uint8_t flags);
|
void Construct(sector_t *srcSec, int target, uint8_t flags);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
|
||||||
|
@ -54,39 +52,35 @@ class DFireFlicker : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DFireFlicker, DLighting)
|
DECLARE_CLASS(DFireFlicker, DLighting)
|
||||||
public:
|
public:
|
||||||
DFireFlicker(sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
DFireFlicker(sector_t *sector, int upper, int lower);
|
void Construct(sector_t *sector, int upper, int lower);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
int m_Count;
|
int m_Count;
|
||||||
int m_MaxLight;
|
int m_MaxLight;
|
||||||
int m_MinLight;
|
int m_MinLight;
|
||||||
private:
|
|
||||||
DFireFlicker() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DFlicker : public DLighting
|
class DFlicker : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DFlicker, DLighting)
|
DECLARE_CLASS(DFlicker, DLighting)
|
||||||
public:
|
public:
|
||||||
DFlicker(sector_t *sector, int upper, int lower);
|
void Construct(sector_t *sector, int upper, int lower);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
int m_Count;
|
int m_Count;
|
||||||
int m_MaxLight;
|
int m_MaxLight;
|
||||||
int m_MinLight;
|
int m_MinLight;
|
||||||
private:
|
|
||||||
DFlicker() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLightFlash : public DLighting
|
class DLightFlash : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DLightFlash, DLighting)
|
DECLARE_CLASS(DLightFlash, DLighting)
|
||||||
public:
|
public:
|
||||||
DLightFlash(sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
DLightFlash(sector_t *sector, int min, int max);
|
void Construct(sector_t *sector, int min, int max);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
|
@ -95,16 +89,14 @@ protected:
|
||||||
int m_MinLight;
|
int m_MinLight;
|
||||||
int m_MaxTime;
|
int m_MaxTime;
|
||||||
int m_MinTime;
|
int m_MinTime;
|
||||||
private:
|
|
||||||
DLightFlash() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DStrobe : public DLighting
|
class DStrobe : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DStrobe, DLighting)
|
DECLARE_CLASS(DStrobe, DLighting)
|
||||||
public:
|
public:
|
||||||
DStrobe(sector_t *sector, int utics, int ltics, bool inSync);
|
void Construct(sector_t *sector, int utics, int ltics, bool inSync);
|
||||||
DStrobe(sector_t *sector, int upper, int lower, int utics, int ltics);
|
void Construct(sector_t *sector, int upper, int lower, int utics, int ltics);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
|
@ -113,23 +105,19 @@ protected:
|
||||||
int m_MaxLight;
|
int m_MaxLight;
|
||||||
int m_DarkTime;
|
int m_DarkTime;
|
||||||
int m_BrightTime;
|
int m_BrightTime;
|
||||||
private:
|
|
||||||
DStrobe() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DGlow : public DLighting
|
class DGlow : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DGlow, DLighting)
|
DECLARE_CLASS(DGlow, DLighting)
|
||||||
public:
|
public:
|
||||||
DGlow(sector_t *sector);
|
void Construct(sector_t *sector);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
int m_MinLight;
|
int m_MinLight;
|
||||||
int m_MaxLight;
|
int m_MaxLight;
|
||||||
int m_Direction;
|
int m_Direction;
|
||||||
private:
|
|
||||||
DGlow() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// [RH] Glow from Light_Glow and Light_Fade specials
|
// [RH] Glow from Light_Glow and Light_Fade specials
|
||||||
|
@ -137,7 +125,7 @@ class DGlow2 : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DGlow2, DLighting)
|
DECLARE_CLASS(DGlow2, DLighting)
|
||||||
public:
|
public:
|
||||||
DGlow2(sector_t *sector, int start, int end, int tics, bool oneshot);
|
void Construct(sector_t *sector, int start, int end, int tics, bool oneshot);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
|
@ -146,8 +134,6 @@ protected:
|
||||||
int m_MaxTics;
|
int m_MaxTics;
|
||||||
int m_Tics;
|
int m_Tics;
|
||||||
bool m_OneShot;
|
bool m_OneShot;
|
||||||
private:
|
|
||||||
DGlow2() = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// [RH] Phased light thinker
|
// [RH] Phased light thinker
|
||||||
|
@ -155,9 +141,9 @@ class DPhased : public DLighting
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DPhased, DLighting)
|
DECLARE_CLASS(DPhased, DLighting)
|
||||||
public:
|
public:
|
||||||
DPhased(sector_t *sector, int baselevel = 0, int phase = 0);
|
void Construct(sector_t *sector, int baselevel = 0, int phase = 0);
|
||||||
// These are for internal use only but the Create template needs access to them.
|
// These are for internal use only but the Create template needs access to them.
|
||||||
DPhased() = default;
|
void Construct();
|
||||||
void Propagate();
|
void Propagate();
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
@ -184,8 +170,7 @@ public:
|
||||||
p_current
|
p_current
|
||||||
};
|
};
|
||||||
|
|
||||||
DPusher () = default;
|
void Construct(EPusher type, line_t *l, int magnitude, int angle, AActor *source, int affectee);
|
||||||
DPusher (EPusher type, line_t *l, int magnitude, int angle, AActor *source, int affectee);
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
int CheckForSectorMatch (EPusher type, int tag);
|
int CheckForSectorMatch (EPusher type, int tag);
|
||||||
void ChangeValues (int magnitude, int angle)
|
void ChangeValues (int magnitude, int angle)
|
||||||
|
@ -221,8 +206,8 @@ class DScroller : public DThinker
|
||||||
public:
|
public:
|
||||||
static const int DEFAULT_STAT = STAT_SCROLLER;
|
static const int DEFAULT_STAT = STAT_SCROLLER;
|
||||||
|
|
||||||
DScroller(EScroll type, double dx, double dy, sector_t *control, sector_t *sec, side_t *side, int accel, EScrollPos scrollpos = EScrollPos::scw_all);
|
void Construct(EScroll type, double dx, double dy, sector_t *control, sector_t *sec, side_t *side, int accel, EScrollPos scrollpos = EScrollPos::scw_all);
|
||||||
DScroller (double dx, double dy, const line_t *l, sector_t *control, int accel, EScrollPos scrollpos = EScrollPos::scw_all);
|
void Construct(double dx, double dy, const line_t *l, sector_t *control, int accel, EScrollPos scrollpos = EScrollPos::scw_all);
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
|
@ -246,8 +231,5 @@ protected:
|
||||||
int m_Accel; // Whether it's accelerative
|
int m_Accel; // Whether it's accelerative
|
||||||
EScrollPos m_Parts; // Which parts of a sidedef are being scrolled?
|
EScrollPos m_Parts; // Which parts of a sidedef are being scrolled?
|
||||||
TObjPtr<DInterpolation*> m_Interpolations[3];
|
TObjPtr<DInterpolation*> m_Interpolations[3];
|
||||||
|
|
||||||
private:
|
|
||||||
DScroller () = default;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,7 @@ class DActiveButton : public DThinker
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DActiveButton, DThinker)
|
DECLARE_CLASS (DActiveButton, DThinker)
|
||||||
public:
|
public:
|
||||||
DActiveButton ();
|
void Construct(side_t *, int, FSwitchDef *, const DVector2 &pos, bool flippable);
|
||||||
DActiveButton (side_t *, int, FSwitchDef *, const DVector2 &pos, bool flippable);
|
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
|
@ -320,20 +319,7 @@ bool P_ChangeSwitchTexture (side_t *side, int useAgain, uint8_t special, bool *q
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DActiveButton, false, false)
|
IMPLEMENT_CLASS(DActiveButton, false, false)
|
||||||
|
|
||||||
DActiveButton::DActiveButton ()
|
void DActiveButton::Construct (side_t *side, int Where, FSwitchDef *Switch, const DVector2 &pos, bool useagain)
|
||||||
{
|
|
||||||
m_Side = NULL;
|
|
||||||
m_Part = -1;
|
|
||||||
m_SwitchDef = 0;
|
|
||||||
m_Timer = 0;
|
|
||||||
m_Pos = { 0,0 };
|
|
||||||
bFlippable = false;
|
|
||||||
bReturning = false;
|
|
||||||
m_Frame = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DActiveButton::DActiveButton (side_t *side, int Where, FSwitchDef *Switch,
|
|
||||||
const DVector2 &pos, bool useagain)
|
|
||||||
{
|
{
|
||||||
m_Side = side;
|
m_Side = side;
|
||||||
m_Part = int8_t(Where);
|
m_Part = int8_t(Where);
|
||||||
|
|
|
@ -46,10 +46,8 @@ class DRotatePoly : public DPolyAction
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DRotatePoly, DPolyAction)
|
DECLARE_CLASS (DRotatePoly, DPolyAction)
|
||||||
public:
|
public:
|
||||||
DRotatePoly (FPolyObj *polyNum);
|
void Construct(FPolyObj *polyNum);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
private:
|
|
||||||
DRotatePoly ();
|
|
||||||
|
|
||||||
friend bool EV_RotatePoly (FLevelLocals *Level, line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide);
|
friend bool EV_RotatePoly (FLevelLocals *Level, line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide);
|
||||||
};
|
};
|
||||||
|
@ -59,11 +57,10 @@ class DMovePoly : public DPolyAction
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DMovePoly, DPolyAction)
|
DECLARE_CLASS (DMovePoly, DPolyAction)
|
||||||
public:
|
public:
|
||||||
DMovePoly (FPolyObj *polyNum);
|
void Construct(FPolyObj *polyNum);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
protected:
|
protected:
|
||||||
DMovePoly ();
|
|
||||||
DAngle m_Angle;
|
DAngle m_Angle;
|
||||||
DVector2 m_Speedv;
|
DVector2 m_Speedv;
|
||||||
|
|
||||||
|
@ -74,11 +71,10 @@ class DMovePolyTo : public DPolyAction
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DMovePolyTo, DPolyAction)
|
DECLARE_CLASS(DMovePolyTo, DPolyAction)
|
||||||
public:
|
public:
|
||||||
DMovePolyTo(FPolyObj *polyNum);
|
void Construct(FPolyObj *polyNum);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick();
|
void Tick();
|
||||||
protected:
|
protected:
|
||||||
DMovePolyTo();
|
|
||||||
DVector2 m_Speedv;
|
DVector2 m_Speedv;
|
||||||
DVector2 m_Target;
|
DVector2 m_Target;
|
||||||
|
|
||||||
|
@ -90,7 +86,7 @@ class DPolyDoor : public DMovePoly
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DPolyDoor, DMovePoly)
|
DECLARE_CLASS (DPolyDoor, DMovePoly)
|
||||||
public:
|
public:
|
||||||
DPolyDoor (FPolyObj *polyNum, podoortype_t type);
|
void Construct(FPolyObj *polyNum, podoortype_t type);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void Tick ();
|
void Tick ();
|
||||||
protected:
|
protected:
|
||||||
|
@ -102,8 +98,6 @@ protected:
|
||||||
bool m_Close;
|
bool m_Close;
|
||||||
|
|
||||||
friend bool EV_OpenPolyDoor(FLevelLocals *Level, line_t *line, int polyNum, double speed, DAngle angle, int delay, double distance, podoortype_t type);
|
friend bool EV_OpenPolyDoor(FLevelLocals *Level, line_t *line, int polyNum, double speed, DAngle angle, int delay, double distance, podoortype_t type);
|
||||||
private:
|
|
||||||
DPolyDoor ();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class FPolyMirrorIterator
|
class FPolyMirrorIterator
|
||||||
|
@ -152,10 +146,6 @@ IMPLEMENT_POINTERS_START(DPolyAction)
|
||||||
IMPLEMENT_POINTER(m_Interpolation)
|
IMPLEMENT_POINTER(m_Interpolation)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
||||||
DPolyAction::DPolyAction ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DPolyAction::Serialize(FSerializer &arc)
|
void DPolyAction::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
|
@ -165,7 +155,7 @@ void DPolyAction::Serialize(FSerializer &arc)
|
||||||
("interpolation", m_Interpolation);
|
("interpolation", m_Interpolation);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPolyAction::DPolyAction (FPolyObj *polyNum)
|
void DPolyAction::Construct(FPolyObj *polyNum)
|
||||||
{
|
{
|
||||||
m_PolyObj = polyNum;
|
m_PolyObj = polyNum;
|
||||||
m_Speed = 0;
|
m_Speed = 0;
|
||||||
|
@ -212,13 +202,9 @@ void DPolyAction::StopInterpolation ()
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DRotatePoly, false, false)
|
IMPLEMENT_CLASS(DRotatePoly, false, false)
|
||||||
|
|
||||||
DRotatePoly::DRotatePoly ()
|
void DRotatePoly::Construct(FPolyObj *polyNum)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
DRotatePoly::DRotatePoly (FPolyObj *polyNum)
|
|
||||||
: Super (polyNum)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(polyNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -229,10 +215,6 @@ DRotatePoly::DRotatePoly (FPolyObj *polyNum)
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DMovePoly, false, false)
|
IMPLEMENT_CLASS(DMovePoly, false, false)
|
||||||
|
|
||||||
DMovePoly::DMovePoly ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DMovePoly::Serialize(FSerializer &arc)
|
void DMovePoly::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
|
@ -240,9 +222,9 @@ void DMovePoly::Serialize(FSerializer &arc)
|
||||||
("speedv", m_Speedv);
|
("speedv", m_Speedv);
|
||||||
}
|
}
|
||||||
|
|
||||||
DMovePoly::DMovePoly (FPolyObj *polyNum)
|
void DMovePoly::Construct(FPolyObj *polyNum)
|
||||||
: Super (polyNum)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(polyNum);
|
||||||
m_Angle = 0.;
|
m_Angle = 0.;
|
||||||
m_Speedv = { 0,0 };
|
m_Speedv = { 0,0 };
|
||||||
}
|
}
|
||||||
|
@ -256,10 +238,6 @@ DMovePoly::DMovePoly (FPolyObj *polyNum)
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DMovePolyTo, false, false)
|
IMPLEMENT_CLASS(DMovePolyTo, false, false)
|
||||||
|
|
||||||
DMovePolyTo::DMovePolyTo()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DMovePolyTo::Serialize(FSerializer &arc)
|
void DMovePolyTo::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize(arc);
|
Super::Serialize(arc);
|
||||||
|
@ -267,9 +245,9 @@ void DMovePolyTo::Serialize(FSerializer &arc)
|
||||||
("target", m_Target);
|
("target", m_Target);
|
||||||
}
|
}
|
||||||
|
|
||||||
DMovePolyTo::DMovePolyTo(FPolyObj *polyNum)
|
void DMovePolyTo::Construct(FPolyObj *polyNum)
|
||||||
: Super(polyNum)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(polyNum);
|
||||||
m_Speedv = m_Target = { 0,0 };
|
m_Speedv = m_Target = { 0,0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,10 +259,6 @@ DMovePolyTo::DMovePolyTo(FPolyObj *polyNum)
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DPolyDoor, false, false)
|
IMPLEMENT_CLASS(DPolyDoor, false, false)
|
||||||
|
|
||||||
DPolyDoor::DPolyDoor ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DPolyDoor::Serialize(FSerializer &arc)
|
void DPolyDoor::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
|
@ -296,9 +270,10 @@ void DPolyDoor::Serialize(FSerializer &arc)
|
||||||
("close", m_Close);
|
("close", m_Close);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPolyDoor::DPolyDoor (FPolyObj * polyNum, podoortype_t type)
|
void DPolyDoor::Construct (FPolyObj * polyNum, podoortype_t type)
|
||||||
: Super (polyNum), m_Type (type)
|
|
||||||
{
|
{
|
||||||
|
Super::Construct(polyNum);
|
||||||
|
m_Type = type;
|
||||||
m_Direction = 0.;
|
m_Direction = 0.;
|
||||||
m_TotalDist = 0;
|
m_TotalDist = 0;
|
||||||
m_Tics = 0;
|
m_Tics = 0;
|
||||||
|
|
|
@ -13,7 +13,7 @@ class DPolyAction : public DThinker
|
||||||
DECLARE_CLASS(DPolyAction, DThinker)
|
DECLARE_CLASS(DPolyAction, DThinker)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
DPolyAction(FPolyObj *polyNum);
|
void Construct(FPolyObj *polyNum);
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
void Stop();
|
void Stop();
|
||||||
|
@ -21,7 +21,6 @@ public:
|
||||||
|
|
||||||
void StopInterpolation();
|
void StopInterpolation();
|
||||||
protected:
|
protected:
|
||||||
DPolyAction();
|
|
||||||
FPolyObj *m_PolyObj;
|
FPolyObj *m_PolyObj;
|
||||||
double m_Speed;
|
double m_Speed;
|
||||||
double m_Dist;
|
double m_Dist;
|
||||||
|
|
|
@ -987,7 +987,6 @@ void FSerializer::ReadObjects(bool hubtravel)
|
||||||
// Do not link any thinker that's being created here. This will be done by deserializing the thinker list later.
|
// Do not link any thinker that's being created here. This will be done by deserializing the thinker list later.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DThinker::bSerialOverride = true;
|
|
||||||
r->mDObjects.Resize(ArraySize());
|
r->mDObjects.Resize(ArraySize());
|
||||||
for (auto &p : r->mDObjects)
|
for (auto &p : r->mDObjects)
|
||||||
{
|
{
|
||||||
|
@ -1052,7 +1051,6 @@ void FSerializer::ReadObjects(bool hubtravel)
|
||||||
}
|
}
|
||||||
EndArray();
|
EndArray();
|
||||||
|
|
||||||
DThinker::bSerialOverride = false;
|
|
||||||
assert(!founderrors);
|
assert(!founderrors);
|
||||||
if (founderrors)
|
if (founderrors)
|
||||||
{
|
{
|
||||||
|
@ -1070,7 +1068,6 @@ void FSerializer::ReadObjects(bool hubtravel)
|
||||||
r->mDObjects.Clear();
|
r->mDObjects.Clear();
|
||||||
|
|
||||||
// make sure this flag gets unset, even if something in here throws an error.
|
// make sure this flag gets unset, even if something in here throws an error.
|
||||||
DThinker::bSerialOverride = false;
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue