ScummVM API documentation
hollywood.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_MONSTERS_HOLLYWOOD_H
23#define HOLLYWOOD_MONSTERS_HOLLYWOOD_H
24
25#include "common/language.h"
26#include "common/platform.h"
27#include "engines/engine.h"
28#include "graphics/surface.h"
29
30#include "hollywood/monsters/gameplay/cursor.h"
31#include "hollywood/monsters/gameplay/game_state.h"
32#include "hollywood/monsters/game_strings.h"
33#include "hollywood/monsters/music.h"
34#include "hollywood/text_translation.h"
35
37
38namespace Common {
39class Serializer;
40}
41
42namespace Hollywood {
43
44class GameplayLoopDelegate;
45class HollywoodFont;
46
47class HollywoodEngine : public Engine {
48public:
49 HollywoodEngine(OSystem *syst, const ADGameDescription *gameDesc);
50 ~HollywoodEngine() override;
51
52 Common::Error run() override;
53 void initializePath(const Common::FSNode &gamePath) override;
54 bool hasFeature(EngineFeature f) const override;
55 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
56 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
58 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
59 void syncSoundSettings() override;
60 void syncSoundSettingsFromGameState();
61
62 const ADGameDescription *getGameDescription() const { return _gameDescription; }
63 const char *getGameId() const;
64 Common::Language getLanguage() const;
65 Common::Platform getPlatform() const;
66 bool isDemo() const;
67 bool isFirstEdition() const;
68 bool hasSpeechData() const;
69 const TextTranslation *textTranslation() const { return &_translation; }
70 const HollywoodGameStrings &gameStrings() const { return _gameStrings; }
71 bool setSubtitleLanguage(const Common::String &language);
72 void cycleSubtitleLanguage();
73 Common::String nextSubtitleLanguageName() const;
74
75 HollywoodFont *font() const { return _font; }
76 HollywoodCursor *cursor() { return &_cursor; }
77 MusicPlayer *introMusic() { return &_introMusic; }
78 MusicPlayer *gameplayMusic() { return &_gameplayMusic; }
79 GameplayState &gameState() { return _gameState; }
80 const GameplayState &gameState() const { return _gameState; }
81 bool subtitlesEnabled() const;
82 bool restoredContentEnabled() const;
83 void captureLastGameplayThumbnail();
84 bool copyLastGameplayThumbnail(Graphics::Surface &thumbnail) const;
85 bool isSceneRestartRequested() const { return _sceneRestartRequested; }
86 void requestSceneRestart() { _sceneRestartRequested = true; }
87 void clearSceneRestartRequest() { _sceneRestartRequested = false; }
88 void requestDebugSceneSolve(uint16 sceneNumber) { _debugSceneSolveRequest = sceneNumber; }
89 bool consumeDebugSceneSolveRequest(uint16 sceneNumber);
90 byte nextScene7100RescueFailureVariant() {
91 _scene7100RescueFailureVariant = !_scene7100RescueFailureVariant;
92 return _scene7100RescueFailureVariant ? 1 : 0;
93 }
94 bool canSave() const { return _canSave; }
95 void setCanSave(bool canSave) { _canSave = canSave; }
96 void drawSceneHotspots(const GameplayLoopDelegate *scene = nullptr);
97
98 enum {
99 kScreenWidth = 640,
100 kScreenHeight = 480,
101 kSceneBufferWidth = 1024,
102 kSceneBufferHeight = 480,
103 kSceneItemCount = 21
104 };
105
106protected:
108 Graphics::HotspotRenderer *createHotspotRenderer() override;
109 bool hideCursorForHotspots() const override { return false; }
110
111private:
112 uint nextSubtitleLanguageIndex() const;
113 Common::Error syncGameStream(Common::Serializer &s);
114 void normalizeLoadedGameState();
115
116 const ADGameDescription *_gameDescription;
117 TextTranslation _translation;
118 HollywoodGameStrings _gameStrings;
119 HollywoodFont *_font;
120 HollywoodCursor _cursor;
121 MusicPlayer _introMusic;
122 MusicPlayer _gameplayMusic;
123 GameplayState _gameState;
124 Graphics::Surface _lastGameplayThumbnail;
125 bool _lastGameplayThumbnailValid;
126 bool _sceneRestartRequested;
127 uint16 _debugSceneSolveRequest;
128 bool _scene7100RescueFailureVariant;
129 bool _canSave;
130 const GameplayLoopDelegate *_hotspotScene;
131};
132
133} // End of namespace Hollywood
134
135#endif // HOLLYWOOD_MONSTERS_HOLLYWOOD_H
Definition: error.h:81
Definition: fs.h:69
Definition: stream.h:745
Definition: serializer.h:80
Definition: str.h:59
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:155
EngineFeature
Definition: engine.h:293
Definition: hotspot_renderer.h:97
Definition: game_loop.h:82
Definition: cursor.h:38
Definition: hollywood.h:47
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
void getHotspotPositions(Common::Array< Graphics::HotspotInfo > &hotspots) override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
void syncSoundSettings() override
bool hasFeature(EngineFeature f) const override
void initializePath(const Common::FSNode &gamePath) override
Common::Error run() override
Definition: font.h:32
Definition: music.h:31
Definition: text_translation.h:40
Definition: system.h:166
Language
Definition: language.h:45
Platform
Definition: platform.h:93
Definition: algorithm.h:29
Definition: advancedDetector.h:164
Definition: surface.h:67
Definition: game_state.h:37
Definition: game_strings.h:40