|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // $Id: dsectoreffect.h 1788 2010-08-24 04:42:57Z russellrice $ 00005 // 00006 // Copyright (C) 1998-2006 by Randy Heit (ZDoom). 00007 // Copyright (C) 2006-2010 by The Odamex Team. 00008 // 00009 // This program is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public License 00011 // as published by the Free Software Foundation; either version 2 00012 // of the License, or (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // DESCRIPTION: 00020 // Separated Sector effects (?) 00021 // 00022 //----------------------------------------------------------------------------- 00023 00024 00025 #ifndef __DSECTOREFFECT_H__ 00026 #define __DSECTOREFFECT_H__ 00027 00028 #include "dobject.h" 00029 #include "dthinker.h" 00030 #include "r_defs.h" 00031 00032 class DSectorEffect : public DThinker 00033 { 00034 DECLARE_SERIAL (DSectorEffect, DThinker) 00035 public: 00036 DSectorEffect (sector_t *sector); 00037 ~DSectorEffect (); 00038 virtual void Destroy(); 00039 protected: 00040 DSectorEffect (); 00041 sector_t *m_Sector; 00042 }; 00043 00044 class DMover : public DSectorEffect 00045 { 00046 DECLARE_SERIAL (DMover, DSectorEffect); 00047 public: 00048 DMover (sector_t *sector); 00049 protected: 00050 enum EResult { ok, crushed, pastdest }; 00051 private: 00052 EResult MovePlane (fixed_t speed, fixed_t dest, bool crush, int floorOrCeiling, int direction); 00053 protected: 00054 DMover (); 00055 inline EResult MoveFloor (fixed_t speed, fixed_t dest, bool crush, int direction) 00056 { 00057 return MovePlane (speed, dest, crush, 0, direction); 00058 } 00059 inline EResult MoveFloor (fixed_t speed, fixed_t dest, int direction) 00060 { 00061 return MovePlane (speed, dest, false, 0, direction); 00062 } 00063 inline EResult MoveCeiling (fixed_t speed, fixed_t dest, bool crush, int direction) 00064 { 00065 return MovePlane (speed, dest, crush, 1, direction); 00066 } 00067 inline EResult MoveCeiling (fixed_t speed, fixed_t dest, int direction) 00068 { 00069 return MovePlane (speed, dest, false, 1, direction); 00070 } 00071 }; 00072 00073 class DMovingFloor : public DMover 00074 { 00075 DECLARE_SERIAL (DMovingFloor, DMover); 00076 public: 00077 DMovingFloor (sector_t *sector); 00078 protected: 00079 DMovingFloor (); 00080 }; 00081 00082 class DMovingCeiling : public DMover 00083 { 00084 DECLARE_SERIAL (DMovingCeiling, DMover); 00085 public: 00086 DMovingCeiling (sector_t *sector); 00087 protected: 00088 DMovingCeiling (); 00089 }; 00090 00091 #endif //__DSECTOREFFECT_H__ 00092