ScummVM API documentation
hopkins.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 HOPKINS_HOPKINS_H
23#define HOPKINS_HOPKINS_H
24
25#include "hopkins/anim.h"
26#include "hopkins/computer.h"
27#include "hopkins/debugger.h"
28#include "hopkins/dialogs.h"
29#include "hopkins/events.h"
30#include "hopkins/files.h"
31#include "hopkins/font.h"
32#include "hopkins/globals.h"
33#include "hopkins/graphics.h"
34#include "hopkins/lines.h"
35#include "hopkins/menu.h"
36#include "hopkins/objects.h"
37#include "hopkins/saveload.h"
38#include "hopkins/script.h"
39#include "hopkins/sound.h"
40#include "hopkins/talk.h"
41
42#include "common/scummsys.h"
43#include "common/system.h"
44#include "common/error.h"
45#include "common/random.h"
46#include "common/hash-str.h"
47#include "common/util.h"
48#include "engines/engine.h"
49#include "graphics/surface.h"
50
59namespace Hopkins {
60
61#define SCREEN_WIDTH 640
62#define SCREEN_HEIGHT 480
63
64enum HOPKINSAction {
65 kActionNone,
66 kActionEscape,
67 kActionInventory,
68 kActionSave,
69 kActionLoad,
70 kActionOptions,
71 kActionBaseForward,
72 kActionBaseBackward,
73 kActionBaseTurnLeft,
74 kActionBaseTurnRight,
75 kActionBaseFire,
76 kActionBaseUse,
77 kActionBaseToggleTextures,
78 kActionBaseMenu,
79 kActionWBASEEnhancementsNavigationMap,
80 kActionWBASEEnhancementsAutoplay
81};
82
83enum HopkinsDebugChannels {
84 kDebugPath = 1,
85 kDebugGraphics,
86};
87
92#define MKTAG24(a0,a1,a2) ((uint32)((a2) | (a1) << 8 | ((a0) << 16)))
93
94struct HopkinsGameDescription;
95class BaseGame;
96
97class HopkinsEngine : public Engine {
98private:
99 friend class BaseGame;
100 friend class Debugger;
101
102 const HopkinsGameDescription *_gameDescription;
103 Common::RandomSource _randomSource;
104 bool _inBaseGame;
105
106 void initializeSystem();
107 bool canTeleportToRoom(int roomId) const;
108
109 void displayNotAvailable();
110 void restoreSystem();
111 void endLinuxDemo();
112 void displayEndDemo();
113 void bombExplosion();
114 void handleConflagration();
115 void playSubmarineCutscene();
116 void playUnderwaterBaseCutscene();
117 void playPlaneCutscene();
118 void playEnding();
119 bool isUnderwaterSubScene();
120
124 int handleBaseMap();
125
129 void loadBaseMap();
130
135 void drawBaseMap();
136
137 void handleOceanMouseEvents();
138 void setSubmarineSprites();
139 void handleOceanMaze(int16 curExitId, const Common::Path &backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId);
140 void loadCredits();
141 void displayCredits(int startPosY, byte *buffer, char color);
142 void displayCredits();
143 void handleNotAvailable(int nextScreen);
144
145 bool runWin95Demo();
146 bool runLinuxDemo();
147 bool runFull();
148
152 bool displayAdultDisclaimer();
153protected:
154 // Engine APIs
155 Common::Error run() override;
156 bool hasFeature(EngineFeature f) const override;
157
158public:
159 AnimationManager *_animMan;
160 ComputerManager *_computer;
161 DialogsManager *_dialog;
162 EventsManager *_events;
163 FileManager *_fileIO;
164 FontManager *_fontMan;
165 Globals *_globals;
166 GraphicsManager *_graphicsMan;
167 LinesManager *_linesMan;
168 MenuManager *_menuMan;
169 ObjectsManager *_objectsMan;
170 SaveLoadManager *_saveLoad;
171 ScriptManager *_script;
172 SoundManager *_soundMan;
173 TalkManager *_talkMan;
174
175public:
176 HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc);
177 ~HopkinsEngine() override;
178 void GUIError(const Common::String &msg);
179
180 uint32 getFeatures() const;
181 Common::Language getLanguage() const;
182 Common::Platform getPlatform() const;
183 uint16 getVersion() const;
184 bool getIsDemo() const;
185 const Common::String &getTargetName() const;
186
187 int getRandomNumber(int maxNumber);
188 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
189 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
190 Common::Error loadGameState(int slot) override;
191 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
192
193 int _startGameSlot;
194
198 void playIntro();
199
203 void syncSoundSettings() override;
204};
205
206} // End of namespace Hopkins
207
208#endif /* HOPKINS_HOPKINS_H */
Definition: error.h:81
Definition: path.h:52
Definition: random.h:44
Definition: str.h:59
Definition: ustr.h:57
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: anim.h:47
Definition: base.h:56
Definition: computer.h:35
Definition: debugger.h:32
Definition: dialogs.h:39
Definition: events.h:38
Definition: files.h:40
Definition: font.h:58
Definition: globals.h:182
Definition: graphics.h:51
Definition: hopkins.h:97
Common::Error run() override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Common::Error loadGameState(int slot) override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
bool hasFeature(EngineFeature f) const override
void syncSoundSettings() override
Definition: lines.h:106
Definition: menu.h:33
Definition: objects.h:147
Definition: saveload.h:48
Definition: script.h:33
Definition: sound.h:77
Definition: talk.h:34
Definition: system.h:166
Language
Definition: language.h:45
Platform
Definition: platform.h:93
Definition: anim.h:30
Definition: detection.h:27