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 
59 namespace Hopkins {
60 
61 #define SCREEN_WIDTH 640
62 #define SCREEN_HEIGHT 480
63 
64 enum HOPKINSAction {
65  kActionNone,
66  kActionEscape,
67  kActionInventory,
68  kActionSave,
69  kActionLoad,
70  kActionOptions
71 };
72 
73 enum HopkinsDebugChannels {
74  kDebugPath = 1 << 0,
75  kDebugGraphics = 1 << 1
76 };
77 
82 #define MKTAG24(a0,a1,a2) ((uint32)((a2) | (a1) << 8 | ((a0) << 16)))
83 
84 struct HopkinsGameDescription;
85 
86 class HopkinsEngine : public Engine {
87 private:
88  const HopkinsGameDescription *_gameDescription;
89  Common::RandomSource _randomSource;
90 
91  void initializeSystem();
92 
93  void displayNotAvailable();
94  void restoreSystem();
95  void endLinuxDemo();
96  void displayEndDemo();
97  void bombExplosion();
98  void handleConflagration();
99  void playSubmarineCutscene();
100  void playUnderwaterBaseCutscene();
101  void playPlaneCutscene();
102  void playEnding();
103  bool isUnderwaterSubScene();
104 
108  int handleBaseMap();
109 
113  void loadBaseMap();
114 
119  void drawBaseMap();
120 
121  void handleOceanMouseEvents();
122  void setSubmarineSprites();
123  void handleOceanMaze(int16 curExitId, const Common::Path &backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId);
124  void loadCredits();
125  void displayCredits(int startPosY, byte *buffer, char color);
126  void displayCredits();
127  void handleNotAvailable(int nextScreen);
128 
129  bool runWin95Demo();
130  bool runLinuxDemo();
131  bool runFull();
132 
136  bool displayAdultDisclaimer();
137 protected:
138  // Engine APIs
139  Common::Error run() override;
140  bool hasFeature(EngineFeature f) const override;
141 
142 public:
143  AnimationManager *_animMan;
144  ComputerManager *_computer;
145  DialogsManager *_dialog;
146  EventsManager *_events;
147  FileManager *_fileIO;
148  FontManager *_fontMan;
149  Globals *_globals;
150  GraphicsManager *_graphicsMan;
151  LinesManager *_linesMan;
152  MenuManager *_menuMan;
153  ObjectsManager *_objectsMan;
154  SaveLoadManager *_saveLoad;
155  ScriptManager *_script;
156  SoundManager *_soundMan;
157  TalkManager *_talkMan;
158 
159 public:
160  HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc);
161  ~HopkinsEngine() override;
162  void GUIError(const Common::String &msg);
163 
164  uint32 getFeatures() const;
165  Common::Language getLanguage() const;
166  Common::Platform getPlatform() const;
167  uint16 getVersion() const;
168  bool getIsDemo() const;
169  const Common::String &getTargetName() const;
170 
171  int getRandomNumber(int maxNumber);
172  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
173  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
174  Common::Error loadGameState(int slot) override;
175  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
176 
177  int _startGameSlot;
178 
182  void playIntro();
183 
187  void syncSoundSettings() override;
188 };
189 
190 } // End of namespace Hopkins
191 
192 #endif /* HOPKINS_HOPKINS_H */
Definition: lines.h:106
Definition: dialogs.h:39
Definition: str.h:59
EngineFeature
Definition: engine.h:253
bool hasFeature(EngineFeature f) const override
Definition: error.h:84
Definition: detection.h:27
Definition: random.h:44
Common::Error loadGameState(int slot) override
Definition: path.h:52
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: anim.h:47
Definition: script.h:33
Definition: talk.h:34
Definition: globals.h:182
Definition: ustr.h:57
Definition: sound.h:77
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: objects.h:147
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: events.h:38
Definition: anim.h:30
Definition: graphics.h:51
Definition: files.h:40
Definition: font.h:58
Definition: saveload.h:48
Definition: menu.h:33
Definition: hopkins.h:86
Definition: system.h:161
Definition: engine.h:144
Common::Error run() override
void syncSoundSettings() override
Definition: computer.h:35
Platform
Definition: platform.h:46
Language
Definition: language.h:45