mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- moved the door thinkers into g_shared.
This commit is contained in:
parent
77f8dfeabf
commit
65a812e316
4 changed files with 89 additions and 88 deletions
|
@ -952,7 +952,6 @@ set (PCH_SOURCES
|
|||
p_ceiling.cpp
|
||||
p_conversation.cpp
|
||||
p_destructible.cpp
|
||||
p_doors.cpp
|
||||
p_effect.cpp
|
||||
p_enemy.cpp
|
||||
p_floor.cpp
|
||||
|
@ -1024,6 +1023,7 @@ set (PCH_SOURCES
|
|||
g_inventory/a_weapons.cpp
|
||||
g_shared/a_action.cpp
|
||||
g_shared/a_decals.cpp
|
||||
g_shared/a_doors.cpp
|
||||
g_shared/a_dynlight.cpp
|
||||
g_shared/a_flashfader.cpp
|
||||
g_shared/a_lightning.cpp
|
||||
|
|
87
src/g_shared/a_doors.h
Normal file
87
src/g_shared/a_doors.h
Normal file
|
@ -0,0 +1,87 @@
|
|||
#pragma once
|
||||
|
||||
//
|
||||
// P_DOORS
|
||||
//
|
||||
class DDoor : public DMovingCeiling
|
||||
{
|
||||
DECLARE_CLASS (DDoor, DMovingCeiling)
|
||||
public:
|
||||
enum EVlDoor
|
||||
{
|
||||
doorClose,
|
||||
doorOpen,
|
||||
doorRaise,
|
||||
doorWaitRaise,
|
||||
doorCloseWaitOpen,
|
||||
doorWaitClose,
|
||||
};
|
||||
|
||||
void Construct(sector_t *sector);
|
||||
void Construct(sector_t *sec, EVlDoor type, double speed, int delay, int lightTag, int topcountdown);
|
||||
|
||||
void Serialize(FSerializer &arc);
|
||||
void Tick ();
|
||||
protected:
|
||||
EVlDoor m_Type;
|
||||
double m_TopDist;
|
||||
double m_BotDist, m_OldFloorDist;
|
||||
vertex_t *m_BotSpot;
|
||||
double m_Speed;
|
||||
|
||||
// 1 = up, 0 = waiting at top, -1 = down
|
||||
int m_Direction;
|
||||
|
||||
// tics to wait at the top
|
||||
int m_TopWait;
|
||||
// (keep in case a door going down is reset)
|
||||
// when it reaches 0, start going down
|
||||
int m_TopCountdown;
|
||||
|
||||
int m_LightTag;
|
||||
|
||||
void DoorSound (bool raise, class DSeqNode *curseq=NULL) const;
|
||||
|
||||
private:
|
||||
friend struct FLevelLocals;
|
||||
};
|
||||
|
||||
class DAnimatedDoor : public DMovingCeiling
|
||||
{
|
||||
DECLARE_CLASS (DAnimatedDoor, DMovingCeiling)
|
||||
public:
|
||||
|
||||
enum EADType
|
||||
{
|
||||
adOpenClose,
|
||||
adClose
|
||||
};
|
||||
|
||||
void Construct(sector_t *sector);
|
||||
void Construct(sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, EADType type);
|
||||
|
||||
void Serialize(FSerializer &arc);
|
||||
void Tick ();
|
||||
|
||||
bool StartClosing ();
|
||||
protected:
|
||||
line_t *m_Line1, *m_Line2;
|
||||
int m_Frame;
|
||||
FDoorAnimation *m_DoorAnim;
|
||||
int m_Timer;
|
||||
double m_BotDist;
|
||||
int m_Status;
|
||||
int m_Type;
|
||||
enum
|
||||
{
|
||||
Opening,
|
||||
Waiting,
|
||||
Closing,
|
||||
Dead
|
||||
};
|
||||
int m_Speed;
|
||||
int m_Delay;
|
||||
bool m_SetBlocking1, m_SetBlocking2;
|
||||
|
||||
friend struct FLevelLocals;
|
||||
};
|
88
src/p_spec.h
88
src/p_spec.h
|
@ -224,93 +224,7 @@ protected:
|
|||
TObjPtr<DInterpolation*> m_Interp_Floor;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// P_DOORS
|
||||
//
|
||||
class DDoor : public DMovingCeiling
|
||||
{
|
||||
DECLARE_CLASS (DDoor, DMovingCeiling)
|
||||
public:
|
||||
enum EVlDoor
|
||||
{
|
||||
doorClose,
|
||||
doorOpen,
|
||||
doorRaise,
|
||||
doorWaitRaise,
|
||||
doorCloseWaitOpen,
|
||||
doorWaitClose,
|
||||
};
|
||||
|
||||
void Construct(sector_t *sector);
|
||||
void Construct(sector_t *sec, EVlDoor type, double speed, int delay, int lightTag, int topcountdown);
|
||||
|
||||
void Serialize(FSerializer &arc);
|
||||
void Tick ();
|
||||
protected:
|
||||
EVlDoor m_Type;
|
||||
double m_TopDist;
|
||||
double m_BotDist, m_OldFloorDist;
|
||||
vertex_t *m_BotSpot;
|
||||
double m_Speed;
|
||||
|
||||
// 1 = up, 0 = waiting at top, -1 = down
|
||||
int m_Direction;
|
||||
|
||||
// tics to wait at the top
|
||||
int m_TopWait;
|
||||
// (keep in case a door going down is reset)
|
||||
// when it reaches 0, start going down
|
||||
int m_TopCountdown;
|
||||
|
||||
int m_LightTag;
|
||||
|
||||
void DoorSound (bool raise, class DSeqNode *curseq=NULL) const;
|
||||
|
||||
private:
|
||||
friend struct FLevelLocals;
|
||||
};
|
||||
|
||||
class DAnimatedDoor : public DMovingCeiling
|
||||
{
|
||||
DECLARE_CLASS (DAnimatedDoor, DMovingCeiling)
|
||||
public:
|
||||
|
||||
enum EADType
|
||||
{
|
||||
adOpenClose,
|
||||
adClose
|
||||
};
|
||||
|
||||
void Construct(sector_t *sector);
|
||||
void Construct(sector_t *sec, line_t *line, int speed, int delay, FDoorAnimation *anim, EADType type);
|
||||
|
||||
void Serialize(FSerializer &arc);
|
||||
void Tick ();
|
||||
|
||||
bool StartClosing ();
|
||||
protected:
|
||||
line_t *m_Line1, *m_Line2;
|
||||
int m_Frame;
|
||||
FDoorAnimation *m_DoorAnim;
|
||||
int m_Timer;
|
||||
double m_BotDist;
|
||||
int m_Status;
|
||||
int m_Type;
|
||||
enum
|
||||
{
|
||||
Opening,
|
||||
Waiting,
|
||||
Closing,
|
||||
Dead
|
||||
};
|
||||
int m_Speed;
|
||||
int m_Delay;
|
||||
bool m_SetBlocking1, m_SetBlocking2;
|
||||
|
||||
friend struct FLevelLocals;
|
||||
};
|
||||
|
||||
#include "a_doors.h"
|
||||
//
|
||||
// P_CEILING
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue