ScummVM API documentation
game_manager.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 TITANIC_GAME_MANAGER_H
23#define TITANIC_GAME_MANAGER_H
24
25#include "common/scummsys.h"
26#include "titanic/game_state.h"
27#include "titanic/input_handler.h"
28#include "titanic/input_translator.h"
29#include "titanic/support/time_event_info.h"
30#include "titanic/true_talk/true_talk_manager.h"
31#include "titanic/sound/music_room.h"
32#include "titanic/sound/sound.h"
33
34namespace Titanic {
35
36class CBackgroundSoundMaker;
37class CGameView;
38class CMovie;
39class CMovieClip;
40class CProjectItem;
41class CRoomItem;
42class CScreenManager;
43class CTreeItem;
44class CViewItem;
45class CVideoSurface;
46class SimpleFile;
47
49private:
50 CTrueTalkManager _trueTalkManager;
51 CTimeEventInfoList _timers;
52 CTreeItem *_treeItem;
53 CBackgroundSoundMaker *_soundMaker;
54 CMovie *_movie;
55 CRoomItem *_movieRoom;
56 int _transitionCtr;
57 CVideoSurface *_movieSurface;
58 uint _lastDiskTicksCount;
59 uint _tickCount2;
60private:
64 void frameMessage(CRoomItem *room);
65
69 void updateMovies();
70
74 void roomTransition(CRoomItem *oldRoom, CRoomItem *newRoom);
75public:
76 CProjectItem *_project;
77 CGameView *_gameView;
78 CGameState _gameState;
79 Rect _bounds;
80 CInputHandler _inputHandler;
81 CInputTranslator _inputTranslator;
82 CTreeItem *_dragItem;
83 CSound _sound;
84 CMusicRoom _musicRoom;
85public:
86 CGameManager(CProjectItem *project, CGameView *gameView, Audio::Mixer *mixer);
88
93
97 void save(SimpleFile *file);
98
102 void load(SimpleFile *file);
103
107 void preLoad();
108
112 void postLoad(CProjectItem *project);
113
117 void preSave(CProjectItem *project);
118
122 void postSave();
123
128
132 CViewItem *getView() { return _gameState._gameLocation.getView(); }
133
137 CNodeItem *getNode() { return _gameState._gameLocation.getNode(); }
138
142 CRoomItem *getRoom() { return _gameState._gameLocation.getRoom(); }
143
147 void lockInputHandler() { _inputHandler.incLockCount(); }
148
152 void unlockInputHandler() { _inputHandler.decLockCount(); }
153
157 void playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom);
158
162 void update();
163
168
172 bool isntTransitioning() const { return !_transitionCtr; }
173
177 void incTransitions() { ++_transitionCtr; }
178
182 void decTransitions() { --_transitionCtr; }
183
188 void addDirtyRect(const Rect &r);
189
194
199
203 void addTimer(CTimeEventInfo *timer) { _timers.push_back(timer); }
204
208 void stopTimer(uint id) { _timers.stop(id); }
209
213 void setTimerPersisent(uint id, bool flag) {
214 _timers.setPersisent(id, flag);
215 }
216
220 CTrueTalkManager *getTalkManager() { return &_trueTalkManager; }
221
227};
228
229} // End of namespace Titanic
230
231#endif /* TITANIC_GAME_MANAGER_H */
Definition: mixer.h:70
void push_back(const t_T &element)
Definition: list.h:174
Definition: background_sound_maker.h:29
CNodeItem * getNode()
CRoomItem * getRoom()
CViewItem * getView()
Definition: game_manager.h:48
void incTransitions()
Definition: game_manager.h:177
CViewItem * getView()
Definition: game_manager.h:132
void addTimer(CTimeEventInfo *timer)
Definition: game_manager.h:203
CRoomItem * getRoom()
Definition: game_manager.h:142
void addDirtyRect(const Rect &r)
CScreenManager * setScreenManager() const
CTrueTalkManager * getTalkManager()
Definition: game_manager.h:220
void unlockInputHandler()
Definition: game_manager.h:152
void setTimerPersisent(uint id, bool flag)
Definition: game_manager.h:213
void playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom)
void stopTimer(uint id)
Definition: game_manager.h:208
CNodeItem * getNode()
Definition: game_manager.h:137
void lockInputHandler()
Definition: game_manager.h:147
void postLoad(CProjectItem *project)
void save(SimpleFile *file)
void load(SimpleFile *file)
void preSave(CProjectItem *project)
bool isntTransitioning() const
Definition: game_manager.h:172
void decTransitions()
Definition: game_manager.h:182
Definition: game_state.h:60
Definition: game_view.h:36
Definition: input_handler.h:35
Definition: input_translator.h:33
Definition: movie_clip.h:41
Definition: movie.h:43
Definition: music_room.h:33
Definition: node_item.h:29
Definition: project_item.h:84
Definition: room_item.h:33
Definition: screen_manager.h:49
Definition: sound.h:60
Definition: string.h:40
Definition: time_event_info.h:33
Definition: time_event_info.h:102
void setPersisent(uint id, bool flag)
Definition: tree_item.h:37
Definition: true_talk_manager.h:44
Definition: video_surface.h:43
Definition: view_item.h:32
Definition: rect.h:35
Definition: simple_file.h:49