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 HopkinsDebugChannels {
65  kDebugPath = 1 << 0,
66  kDebugGraphics = 1 << 1
67 };
68 
73 #define MKTAG24(a0,a1,a2) ((uint32)((a2) | (a1) << 8 | ((a0) << 16)))
74 
75 struct HopkinsGameDescription;
76 
77 class HopkinsEngine : public Engine {
78 private:
79  const HopkinsGameDescription *_gameDescription;
80  Common::RandomSource _randomSource;
81 
82  void initializeSystem();
83 
84  void displayNotAvailable();
85  void restoreSystem();
86  void endLinuxDemo();
87  void displayEndDemo();
88  void bombExplosion();
89  void handleConflagration();
90  void playSubmarineCutscene();
91  void playUnderwaterBaseCutscene();
92  void playPlaneCutscene();
93  void playEnding();
94  bool isUnderwaterSubScene();
95 
99  int handleBaseMap();
100 
104  void loadBaseMap();
105 
110  void drawBaseMap();
111 
112  void handleOceanMouseEvents();
113  void setSubmarineSprites();
114  void handleOceanMaze(int16 curExitId, const Common::Path &backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId);
115  void loadCredits();
116  void displayCredits(int startPosY, byte *buffer, char color);
117  void displayCredits();
118  void handleNotAvailable(int nextScreen);
119 
120  bool runWin95Demo();
121  bool runLinuxDemo();
122  bool runFull();
123 
127  bool displayAdultDisclaimer();
128 protected:
129  // Engine APIs
130  Common::Error run() override;
131  bool hasFeature(EngineFeature f) const override;
132 
133 public:
134  AnimationManager *_animMan;
135  ComputerManager *_computer;
136  DialogsManager *_dialog;
137  EventsManager *_events;
138  FileManager *_fileIO;
139  FontManager *_fontMan;
140  Globals *_globals;
141  GraphicsManager *_graphicsMan;
142  LinesManager *_linesMan;
143  MenuManager *_menuMan;
144  ObjectsManager *_objectsMan;
145  SaveLoadManager *_saveLoad;
146  ScriptManager *_script;
147  SoundManager *_soundMan;
148  TalkManager *_talkMan;
149 
150 public:
151  HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc);
152  ~HopkinsEngine() override;
153  void GUIError(const Common::String &msg);
154 
155  uint32 getFeatures() const;
156  Common::Language getLanguage() const;
157  Common::Platform getPlatform() const;
158  uint16 getVersion() const;
159  bool getIsDemo() const;
160  const Common::String &getTargetName() const;
161 
162  int getRandomNumber(int maxNumber);
163  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
164  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
165  Common::Error loadGameState(int slot) override;
166  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
167 
168  int _startGameSlot;
169 
173  void playIntro();
174 
178  void syncSoundSettings() override;
179 };
180 
181 } // End of namespace Hopkins
182 
183 #endif /* HOPKINS_HOPKINS_H */
Definition: lines.h:106
Definition: dialogs.h:39
Definition: str.h:59
EngineFeature
Definition: engine.h:250
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:50
Definition: files.h:40
Definition: font.h:58
Definition: saveload.h:48
Definition: menu.h:33
Definition: hopkins.h:77
Definition: system.h:167
Definition: engine.h:143
Common::Error run() override
void syncSoundSettings() override
Definition: computer.h:35
Platform
Definition: platform.h:46
Language
Definition: language.h:45