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:
parent
0dc4c7db90
commit
5503ec052d
3 changed files with 68 additions and 20 deletions
|
|
@ -72,6 +72,31 @@ void DCeiling::Serialize(FSerializer &arc)
|
||||||
.Enum("crushmode", m_CrushMode);
|
.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());
|
||||||
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,14 @@ public:
|
||||||
crushSlowdown = 2
|
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);
|
||||||
void Construct(sector_t *sec, double speed1, double speed2, int silent);
|
void Construct(sector_t *sec, double speed1, double speed2, int silent);
|
||||||
|
|
@ -56,17 +64,10 @@ public:
|
||||||
|
|
||||||
int getCrush() const { return m_Crush; }
|
int getCrush() const { return m_Crush; }
|
||||||
int getDirection() const { return m_Direction; }
|
int getDirection() const { return m_Direction; }
|
||||||
|
int getOldDirection() const { return m_OldDirection; }
|
||||||
|
|
||||||
protected:
|
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;
|
int m_Crush;
|
||||||
ECrushMode m_CrushMode;
|
|
||||||
int m_Silent;
|
|
||||||
int m_Direction; // 1 = up, 0 = waiting, -1 = down
|
int m_Direction; // 1 = up, 0 = waiting, -1 = down
|
||||||
|
|
||||||
// [RH] Need these for BOOM-ish transferring ceilings
|
// [RH] Need these for BOOM-ish transferring ceilings
|
||||||
|
|
|
||||||
|
|
@ -675,16 +675,16 @@ class Plat : MovingFloor native
|
||||||
|
|
||||||
bool IsLift() const { return m_Type == platDownWaitUpStay || m_Type == platDownWaitUpStayStone; }
|
bool IsLift() const { return m_Type == platDownWaitUpStay || m_Type == platDownWaitUpStayStone; }
|
||||||
|
|
||||||
native double m_Speed;
|
native readonly double m_Speed;
|
||||||
native double m_Low;
|
native readonly double m_Low;
|
||||||
native double m_High;
|
native readonly double m_High;
|
||||||
native int m_Wait;
|
native readonly int m_Wait;
|
||||||
native int m_Count;
|
native readonly int m_Count;
|
||||||
native EPlatState m_Status;
|
native readonly EPlatState m_Status;
|
||||||
native readonly EPlatState m_OldStatus;
|
native readonly EPlatState m_OldStatus;
|
||||||
native int m_Crush;
|
native readonly int m_Crush;
|
||||||
native int m_Tag;
|
native readonly int m_Tag;
|
||||||
native EPlatType m_Type;
|
native readonly EPlatType m_Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MovingCeiling : Mover native
|
class MovingCeiling : Mover native
|
||||||
|
|
@ -711,9 +711,9 @@ class Door : MovingCeiling native
|
||||||
// 1 = up, 0 = waiting at top, -1 = down
|
// 1 = up, 0 = waiting at top, -1 = down
|
||||||
enum EDirection
|
enum EDirection
|
||||||
{
|
{
|
||||||
dirUp,
|
dirDown = -1,
|
||||||
dirWait,
|
dirWait,
|
||||||
dirDown
|
dirUp,
|
||||||
}
|
}
|
||||||
native readonly int m_Direction;
|
native readonly int m_Direction;
|
||||||
|
|
||||||
|
|
@ -813,7 +813,29 @@ class Ceiling : MovingCeiling native
|
||||||
crushHexen = 1,
|
crushHexen = 1,
|
||||||
crushSlowdown = 2
|
crushSlowdown = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1 = up, 0 = waiting, -1 = down
|
||||||
|
enum EDirection
|
||||||
|
{
|
||||||
|
dirDown = -1,
|
||||||
|
dirWait,
|
||||||
|
dirUp,
|
||||||
|
}
|
||||||
|
|
||||||
|
native readonly ECeiling m_Type;
|
||||||
|
native readonly double m_BottomHeight;
|
||||||
|
native readonly double m_TopHeight;
|
||||||
|
native readonly double m_Speed;
|
||||||
|
native readonly double m_Speed1; // [RH] dnspeed of crushers
|
||||||
|
native readonly double m_Speed2; // [RH] upspeed of crushers
|
||||||
|
native readonly ECrushMode m_CrushMode;
|
||||||
|
native readonly int m_Silent;
|
||||||
|
|
||||||
|
bool IsCrusher() const { return m_Type == ceilCrushAndRaise || m_Type == ceilLowerAndCrush || m_Type == ceilCrushRaiseAndStay; }
|
||||||
|
native int getCrush() const;
|
||||||
|
native int getDirection() const;
|
||||||
|
native int getOldDirection() const;
|
||||||
|
|
||||||
deprecated("3.8", "Use Level.CreateCeiling() instead") static bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = crushDoom)
|
deprecated("3.8", "Use Level.CreateCeiling() instead") static bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = crushDoom)
|
||||||
{
|
{
|
||||||
return level.CreateCeiling(sec, type, ln, speed, speed2, height, crush, silent, change, crushmode);
|
return level.CreateCeiling(sec, type, ln, speed, speed2, height, crush, silent, change, crushmode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue