ScummVM API documentation
scripting_effect.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCRIPTING_EFFECT_H_INCLUDED
23 #define SCRIPTING_EFFECT_H_INCLUDED
24 
25 namespace Common {
26 class SeekableReadStream;
27 struct Point;
28 class WriteStream;
29 }
30 
31 namespace ZVision {
32 
33 class ZVision;
34 
46 public:
47 
48  enum ScriptingEffectType {
49  SCRIPTING_EFFECT_ANIM = 1,
50  SCRIPTING_EFFECT_AUDIO = 2,
51  SCRIPTING_EFFECT_DISTORT = 4,
52  SCRIPTING_EFFECT_PANTRACK = 8,
53  SCRIPTING_EFFECT_REGION = 16,
54  SCRIPTING_EFFECT_TIMER = 32,
55  SCRIPTING_EFFECT_TTYTXT = 64,
56  SCRIPTING_EFFECT_UNKNOWN = 128,
57  SCRIPTING_EFFECT_ALL = 255
58  };
59 
60  ScriptingEffect() : _engine(0), _key(0), _type(SCRIPTING_EFFECT_UNKNOWN) {}
61  ScriptingEffect(ZVision *engine, uint32 key, ScriptingEffectType type) : _engine(engine), _key(key), _type(type) {}
62  virtual ~ScriptingEffect() {}
63 
64  uint32 getKey() {
65  return _key;
66  }
67  ScriptingEffectType getType() {
68  return _type;
69  }
70 
71  virtual bool process(uint32 deltaTimeInMillis) {
72  return false;
73  }
85  virtual void serialize(Common::WriteStream *stream) {}
97  virtual void deserialize(Common::SeekableReadStream *stream) {}
103  virtual inline bool needsSerialization() {
104  return false;
105  }
106 
107  virtual bool stop() {
108  return true;
109  }
110  virtual void kill() {}
111 
112 protected:
113  ZVision *_engine;
114  uint32 _key;
115  ScriptingEffectType _type;
116 
117 // Static member functions
118 public:
119 
120 };
121 } // End of namespace ZVision
122 
123 #endif // SCRIPTING_EFFECT_H_INCLUDED
Definition: stream.h:77
Definition: display_client.h:58
virtual bool needsSerialization()
Definition: scripting_effect.h:103
Definition: stream.h:745
Definition: clock.h:29
virtual void deserialize(Common::SeekableReadStream *stream)
Definition: scripting_effect.h:97
Definition: scripting_effect.h:45
Definition: algorithm.h:29
virtual void serialize(Common::WriteStream *stream)
Definition: scripting_effect.h:85