doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Fx.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #ifndef __GAME_FX_H__
30 #define __GAME_FX_H__
31 
32 /*
33 ===============================================================================
34 
35  Special effects.
36 
37 ===============================================================================
38 */
39 
40 typedef struct {
41  renderLight_t renderLight; // light presented to the renderer
42  qhandle_t lightDefHandle; // handle to renderer light def
43  renderEntity_t renderEntity; // used to present a model to the renderer
44  int modelDefHandle; // handle to static renderer model
45  float delay;
47  int start;
51  bool launched;
53 
54 class idEntityFx : public idEntity {
55 public:
57 
58  idEntityFx();
59  virtual ~idEntityFx();
60 
61  void Spawn( void );
62 
63  void Save( idSaveGame *savefile ) const;
64  void Restore( idRestoreGame *savefile );
65 
66  virtual void Think();
67  void Setup( const char *fx );
68  void Run( int time );
69  void Start( int time );
70  void Stop( void );
71  const int Duration( void );
72  const char * EffectName( void );
73  const char * Joint( void );
74  const bool Done();
75 
76  virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
77  virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
78  virtual void ClientPredictionThink( void );
79 
80  static idEntityFx * StartFx( const char *fx, const idVec3 *useOrigin, const idMat3 *useAxis, idEntity *ent, bool bind );
81 
82 protected:
83  void Event_Trigger( idEntity *activator );
84  void Event_ClearFx( void );
85 
86  void CleanUp( void );
87  void CleanUpSingleAction( const idFXSingleAction& fxaction, idFXLocalAction& laction );
88  void ApplyFade( const idFXSingleAction& fxaction, idFXLocalAction& laction, const int time, const int actualStart );
89 
90  int started;
92  const idDeclFX * fxEffect; // GetFX() should be called before using fxEffect as a pointer
95 };
96 
97 class idTeleporter : public idEntityFx {
98 public:
100 
101 private:
102  // teleporters to this location
103  void Event_DoAction( idEntity *activator );
104 };
105 
106 #endif /* !__GAME_FX_H__ */
renderLight_t renderLight
Definition: Fx.h:41
idStr systemName
Definition: Fx.h:94
int qhandle_t
Definition: Lib.h:81
const idDeclFX * fxEffect
Definition: Fx.h:92
void Stop(void)
Definition: Fx.cpp:267
int modelDefHandle
Definition: Fx.h:44
CLASS_PROTOTYPE(idEntityFx)
void Event_ClearFx(void)
Definition: Fx.cpp:650
void Setup(const char *fx)
Definition: Fx.cpp:147
virtual void ReadFromSnapshot(const idBitMsgDelta &msg)
Definition: Fx.cpp:761
int nextTriggerTime
Definition: Fx.h:91
bool soundStarted
Definition: Fx.h:48
virtual void Think()
Definition: Fx.cpp:630
Definition: Vector.h:316
qhandle_t lightDefHandle
Definition: Fx.h:42
void ApplyFade(const idFXSingleAction &fxaction, idFXLocalAction &laction, const int time, const int actualStart)
Definition: Fx.cpp:312
int particleSystem
Definition: Fx.h:46
const int Duration(void)
Definition: Fx.cpp:277
void Save(idSaveGame *savefile) const
Definition: Fx.cpp:56
int start
Definition: Fx.h:47
void Start(int time)
Definition: Fx.cpp:246
void Spawn(void)
Definition: Fx.cpp:603
CLASS_PROTOTYPE(idTeleporter)
Definition: Fx.h:54
bool launched
Definition: Fx.h:51
void Event_Trigger(idEntity *activator)
Definition: Fx.cpp:680
bool decalDropped
Definition: Fx.h:50
const char * EffectName(void)
Definition: Fx.cpp:195
Definition: Matrix.h:333
idList< idFXLocalAction > actions
Definition: Fx.h:93
virtual ~idEntityFx()
Definition: Fx.cpp:593
Definition: Str.h:116
void CleanUpSingleAction(const idFXSingleAction &fxaction, idFXLocalAction &laction)
Definition: Fx.cpp:229
const char * Joint(void)
Definition: Fx.cpp:204
virtual void ClientPredictionThink(void)
Definition: Fx.cpp:791
void Event_DoAction(idEntity *activator)
Definition: Fx.cpp:816
const bool Done()
Definition: Fx.cpp:300
renderEntity_t renderEntity
Definition: Fx.h:43
int started
Definition: Fx.h:90
float delay
Definition: Fx.h:45
void Run(int time)
Definition: Fx.cpp:340
virtual void WriteToSnapshot(idBitMsgDelta &msg) const
Definition: Fx.cpp:749
void Restore(idRestoreGame *savefile)
Definition: Fx.cpp:96
idEntityFx()
Definition: Fx.cpp:581
static idEntityFx * StartFx(const char *fx, const idVec3 *useOrigin, const idMat3 *useAxis, idEntity *ent, bool bind)
Definition: Fx.cpp:716
bool shakeStarted
Definition: Fx.h:49
void CleanUp(void)
Definition: Fx.cpp:213