Planeshift
pscal3dcallback.h
Go to the documentation of this file.
1 /*
2  * Author: Andrew Robberts
3  *
4  * Copyright (C) 2005 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PS_CAL3D_CALLBACK_HEADER
21 #define PS_CAL3D_CALLBACK_HEADER
22 
23 // Cal3D includes
24 #include <cal3d/animcallback.h>
25 
26 // CS includes
27 #include <csutil/csstring.h>
28 #include <csutil/ref.h>
29 #include <imap/reader.h>
30 
31 class EEditApp;
32 
39 class psCal3DCallbackLoader : public scfImplementation1<psCal3DCallbackLoader, iLoaderPlugin>
40 {
41 private:
42  EEditApp * parentApp;
43 
44 public:
45  psCal3DCallbackLoader(iObjectRegistry * objreg, EEditApp * app);
46  virtual ~psCal3DCallbackLoader();
47 
48  // used to handle and parse the <addon> tags.
49  csPtr<iBase> Parse(iDocumentNode * node, iStreamSource*, iLoaderContext * ldr_context, iBase * context);
50 
51  bool IsThreadSafe() { return true; }
52 };
53 
58 {
59 public:
60  psCal3DCallbackEffect(iDocumentNode * node, EEditApp * app);
61  virtual ~psCal3DCallbackEffect();
62 
63  void AnimationUpdate(float anim_time, CalModel * model, void * userData);
64  void AnimationComplete(CalModel * model, void * userData);
65 
66 protected:
67 
69 
71  csString effectName;
72 
74  float triggerTime;
75 
77  float lastUpdateTime;
78 
80  bool hasTriggered;
81 
83  bool resetPerCycle;
84 
86  bool killWithAnimEnd;
87 
89  unsigned int effectID;
90 };
91 
94 #endif
95 
virtual ~psCal3DCallbackLoader()
A stripped version of the cal3d callback loader used only for eedit.
psCal3DCallbackLoader(iObjectRegistry *objreg)
csPtr< iBase > Parse(iDocumentNode *node, iStreamSource *, iLoaderContext *ldr_context, iBase *context)
A cal3d callback to handle displaying an effect.