Exposed more of the Ceiling thinker.

- Exposed the rest of the ceiling member fields and getters.
- Added an IsCrusher() method.
- Added getOldDirection() getter.
- Fixed Door direction enum.
- Forgot to make Plat readonly on previous commit.
This commit is contained in:
inkoalawetrust 2025-02-22 15:07:45 +02:00 committed by Ricardo Luís Vaz Silva
commit 5503ec052d
3 changed files with 68 additions and 20 deletions

View file

@ -72,6 +72,31 @@ void DCeiling::Serialize(FSerializer &arc)
.Enum("crushmode", m_CrushMode);
}
DEFINE_FIELD(DCeiling, m_Type)
DEFINE_FIELD(DCeiling, m_BottomHeight)
DEFINE_FIELD(DCeiling, m_TopHeight)
DEFINE_FIELD(DCeiling, m_Speed)
DEFINE_FIELD(DCeiling, m_Speed1)
DEFINE_FIELD(DCeiling, m_Speed2)
DEFINE_FIELD(DCeiling, m_Silent)
DEFINE_FIELD(DCeiling, m_CrushMode)
DEFINE_ACTION_FUNCTION(DCeiling, getCrush)
{
PARAM_SELF_PROLOGUE(DCeiling);
ACTION_RETURN_INT(self->getCrush());
}
DEFINE_ACTION_FUNCTION(DCeiling, getDirection)
{
PARAM_SELF_PROLOGUE(DCeiling);
ACTION_RETURN_INT(self->getDirection());
}
DEFINE_ACTION_FUNCTION(DCeiling, getOldDirection)
{
PARAM_SELF_PROLOGUE(DCeiling);
ACTION_RETURN_INT(self->getOldDirection());
}
//============================================================================
//
//

View file

@ -47,6 +47,14 @@ public:
crushSlowdown = 2
};
ECeiling m_Type;
double m_BottomHeight;
double m_TopHeight;
double m_Speed;
double m_Speed1; // [RH] dnspeed of crushers
double m_Speed2; // [RH] upspeed of crushers
ECrushMode m_CrushMode;
int m_Silent;
void Construct(sector_t *sec);
void Construct(sector_t *sec, double speed1, double speed2, int silent);
@ -56,17 +64,10 @@ public:
int getCrush() const { return m_Crush; }
int getDirection() const { return m_Direction; }
int getOldDirection() const { return m_OldDirection; }
protected:
ECeiling m_Type;
double m_BottomHeight;
double m_TopHeight;
double m_Speed;
double m_Speed1; // [RH] dnspeed of crushers
double m_Speed2; // [RH] upspeed of crushers
int m_Crush;
ECrushMode m_CrushMode;
int m_Silent;
int m_Direction; // 1 = up, 0 = waiting, -1 = down
// [RH] Need these for BOOM-ish transferring ceilings