ScummVM API documentation
engine.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 HOLLYWOOD_RUNAWAY_ENGINE_H
23#define HOLLYWOOD_RUNAWAY_ENGINE_H
24
25#include "common/array.h"
26#include "common/language.h"
27#include "common/ptr.h"
28#include "engines/engine.h"
29#include "hollywood/runaway/audio.h"
30#include "hollywood/runaway/intro.h"
31#include "hollywood/runaway/menu.h"
32#include "hollywood/runaway/saveload.h"
33
34namespace Common {
35class Keymap;
36}
37
38namespace Graphics {
39class ManagedSurface;
40}
41
42namespace Hollywood {
43
44class RunawayMenu;
45class RunawayInventory;
46class RunawayScene;
47class RunawayUI;
48
49// Runaway shares the archive and text formats with Hollywood Monsters, but
50// has its own RGB565 renderer, scene state and audio formats.
51class RunawayEngine : public Engine {
52 friend class RunawayConsole;
53
54public:
55 enum RunawayAction {
56 kScrollLeft,
57 kScrollRight,
58 kScrollStart,
59 kScrollEnd,
60 kCancelAction,
61 kSkip,
62 kToggleInventory,
63 kCycleAction,
64 kPauseMenu
65 };
66
67 RunawayEngine(OSystem *syst, Common::Language language, RunawayGameType game);
68 ~RunawayEngine() override;
69
70 Common::Error run() override;
71 void initializePath(const Common::FSNode &gamePath) override;
72 bool hasFeature(EngineFeature feature) const override;
73 void syncSoundSettings() override;
74 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
75 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
77 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
78 bool copySaveThumbnail(Graphics::Surface &thumbnail) const;
80 Graphics::HotspotRenderer *createHotspotRenderer() override;
81 bool hideCursorForHotspots() const override { return false; }
82
83 static Common::Array<Common::Keymap *> initKeymaps();
84 static void registerDefaultSettings();
85
86private:
87 RunawayScene *createScene(uint16 entryScene);
88 Common::Error changeScene();
89 bool sceneBusy() const;
90 Common::Error playIntro(RunawayMenu &menu, byte chapter = 0, RunawayIntro::Mode mode = RunawayIntro::kCompleteIntro);
91 Common::Error startChapter(RunawayMenu &menu, byte chapter);
92 Common::Error selectChapter(RunawayMenu &menu);
93 byte unlockedChapter() const;
94 void unlockChapter(byte chapter);
95 Common::Error playEnding(RunawayMenu &menu);
96 int pauseMenu(RunawayMenu &menu, Graphics::ManagedSurface &screen, byte chapters = 0);
97 RunawayMenu::Settings readSettings() const;
98 void applySettings(const RunawayMenu::Settings &settings, bool restoreDefaults = false);
99 void present(const Graphics::ManagedSurface &screen);
100 void updateSoundListener();
101 Common::Point updateUI(uint32 now);
102 Common::Language _language;
103 const RunawayGameType _game;
104 const bool _museum;
105 RunawayStrings _strings;
106 RunawayAudio _audio;
107 RunawaySaveState _state;
111 RunawayPresentation::MouseState _presentationMouse;
112 bool _inPresentation = false, _gameStarted = false, _loadedGame = false;
113 bool _pendingDoorClose = false;
114};
115
116} // End of namespace Hollywood
117
118#endif // HOLLYWOOD_RUNAWAY_ENGINE_H
Definition: error.h:81
Definition: fs.h:69
Definition: ptr.h:572
Definition: stream.h:745
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:155
EngineFeature
Definition: engine.h:293
Definition: hotspot_renderer.h:97
Definition: managed_surface.h:51
Definition: audio.h:29
Definition: console.h:31
Definition: engine.h:51
void syncSoundSettings() override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Common::Error run() override
void initializePath(const Common::FSNode &gamePath) override
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
bool hasFeature(EngineFeature feature) const override
void getHotspotPositions(Common::Array< Graphics::HotspotInfo > &hotspots) override
Definition: menu.h:35
Definition: presentation.h:50
Definition: scene.h:41
Definition: strings.h:37
Definition: system.h:166
Language
Definition: language.h:45
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: rect.h:144
Definition: surface.h:67
Definition: saveload.h:32