ScummVM API documentation
game.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 WATCHMAKER_GAME_H
23#define WATCHMAKER_GAME_H
24
25#include "common/random.h"
26#include "watchmaker/3d/loader.h"
27#include "watchmaker/fonts.h"
28#include "watchmaker/game_options.h"
29#include "watchmaker/ll/ll_ffile.h"
30#include "watchmaker/saveload.h"
31#include "watchmaker/schedule.h"
32#include "watchmaker/work_dirs.h"
33
34namespace Watchmaker {
35
36class sdl_wrapper;
37class Renderer;
38
39struct GameVars {
40private:
41 int32 CurRoom = 0;
42
43public:
44 void setCurRoomId(int32 room) {
45 CurRoom = room;
46 }
47 int32 getCurRoomId() const {
48 return CurRoom;
49 }
50};
51
52class MeshModifiers;
53class RoomManager;
54class CameraMan;
55
56class WGame {
57 bool g_bReady = false, g_bActive = false;
58 //bool g_bSkipActive = false;
59 const char *CharName[32] = {};
60 uint32 LoadChar;
61 MeshModifiers *_meshModifiers;
62
63public:
65 Renderer *_renderer;
66 WorkDirs workDirs;
67 GameOptions gameOptions;
68 Init init;
69 sdl_wrapper *sdl;
70 GameVars _gameVars;
71 GameRect _gameRect;
72 Fonts _fonts;
73 MessageSystem _messageSystem;
74 RoomManager *_roomManager;
75 CameraMan *_cameraMan;
76 WGame();
77 ~WGame();
78
79 SRoom &getCurRoom() {
80 return init.Room[_gameVars.getCurRoomId()];
81 }
82
83 Common::SharedPtr<Common::SeekableReadStream> resolveFile(const char *path, bool noFastFile = false);
84
85 void configLoaderFlags(bool debugMode) {
86 // TODO: Add back some of the configurability from the argument parsing.
87 LoadChar = 3;
88 LoaderFlags = T3D_STATIC_SET0;
89 LoaderFlags |= T3D_OUTDOORLIGHTS;
90 LoaderFlags |= T3D_PRELOADBASE;
91 LoaderFlags |= T3D_STATIC_SET1;
92 if (debugMode) {
93 LoaderFlags |= T3D_DEBUGMODE;
94 }
95
96 if (!(LoaderFlags & T3D_DEBUGMODE)) {
97 LoadChar = 3;
98 LoadChar |= 16777212;
99 }
100 }
101
102 int StartPlayingGame(const Common::String &LoaderName_override);
103 bool LoadAndSetup(const Common::String &name, uint8 lite);
104 void LoadMisc();
105 void UpdateAll();
106 void initCharNames();
107 void CleanUpAndPostQuit();
108
109 bool CheckAndLoadMoglieSupervisoreModel(int32 c);
110
111 void GameLoop();
112
113 // TODO: These might belong elsewhere after some refactoring:
114 void addMeshModifier(const Common::String &name, int16 com, void *p);
115 void loadMeshModifiers(Common::SeekableReadStream &stream);
116};
117
118extern WGame *_vm;
119
120} // End of namespace Watchmaker
121
122#endif // WATCHMAKER_GAME_H
Definition: random.h:44
Definition: stream.h:745
Definition: str.h:59
Definition: do_camera.h:31
Definition: fonts.h:37
Definition: game_options.h:31
Definition: ll_mesh.h:73
Definition: schedule.h:38
Definition: renderer.h:45
Definition: loader.h:79
Definition: game.h:56
Definition: work_dirs.h:30
Definition: sdl_wrapper.h:32
Definition: globvar.h:33
Definition: game.h:39
Definition: globvar.h:199
Definition: struct.h:121