25 #include "common/system.h" 26 #include "common/error.h" 27 #include "common/fs.h" 28 #include "common/hash-str.h" 29 #include "common/random.h" 30 #include "common/serializer.h" 31 #include "common/util.h" 32 #include "engines/engine.h" 33 #include "engines/savestate.h" 34 #include "graphics/screen.h" 36 #include "alcachofa/detection.h" 37 #include "alcachofa/camera.h" 38 #include "alcachofa/input.h" 39 #include "alcachofa/sounds.h" 40 #include "alcachofa/player.h" 41 #include "alcachofa/scheduler.h" 42 #include "alcachofa/console.h" 43 #include "alcachofa/game.h" 55 struct AlcachofaGameDescription;
57 constexpr int16 kSmallThumbnailWidth = 160;
58 constexpr int16 kSmallThumbnailHeight = 120;
61 namespace SaveVersion {
62 static constexpr
const Common::Serializer::Version kInitial = 0;
63 static constexpr
const Common::Serializer::Version kWithEngineV10 = 1;
65 static constexpr
const Common::Serializer::Version kCurrentSaveVersion = SaveVersion::kWithEngineV10;
72 assert(isLoading() && _loadStream !=
nullptr);
77 assert(isSaving() && _saveStream !=
nullptr);
84 static constexpr
const uint8 kMaxCursor = 3;
86 inline bool &subtitles() {
return _subtitles; }
87 inline bool &highQuality() {
return _highQuality; }
88 inline bool &bits32() {
return _bits32; }
89 inline bool &texFilter() {
return _texFilter; }
90 inline uint8 &musicVolume() {
return _musicVolume; }
91 inline uint8 &speechVolume() {
return _speechVolume; }
92 inline uint8 &cursor() {
return _cursor; }
94 static void registerDefaults();
95 void loadFromScummVM();
118 inline EngineVersion version()
const {
return gameDescription().engineVersion; }
119 inline bool isV1()
const {
return gameDescription().isVersionBetween(10, 19); }
120 inline bool isV2()
const {
return gameDescription().isVersionBetween(20, 29); }
121 inline bool isV3()
const {
return gameDescription().isVersionBetween(30, 39); }
124 inline IRenderer &renderer() {
return *_renderer; }
125 inline DrawQueue &drawQueue() {
return *_drawQueue; }
126 inline Camera &camera() {
return *_camera; }
127 inline Input &input() {
return _input; }
128 inline Sounds &sounds() {
return _sounds; }
129 inline Player &player() {
return *_player; }
130 inline World &world() {
return _world; }
131 inline Script &script() {
return *_script; }
132 inline GlobalUI &globalUI() {
return *_globalUI; }
133 inline Menu &menu() {
return *_menu; }
134 inline Scheduler &scheduler() {
return _scheduler; }
135 inline Console &console() {
return *_console; }
136 inline Game &game() {
return *_game; }
137 inline Config &config() {
return _config; }
138 inline bool isDebugModeActive()
const {
return _debugHandler !=
nullptr; }
140 template<
class T>
inline T &cameraAs() {
141 auto result =
dynamic_cast<T *
>(_camera.get());
142 scumm_assert(result !=
nullptr);
145 inline CameraV1 &cameraV1() {
return cameraAs<CameraV1>(); }
146 inline CameraV3 &cameraV3() {
return cameraAs<CameraV3>(); }
148 uint32 getMillis()
const;
149 void setMillis(uint32 newMillis);
150 void pauseEngineIntern(
bool pause)
override;
151 void playVideo(int32 videoId);
153 void setDebugMode(DebugMode debugMode, int32 param);
155 uint32 getFeatures()
const;
160 (f == kSupportsLoadingDuringRuntime) ||
161 (f == kSupportsSavingDuringRuntime) ||
162 (f == kSupportsReturnToLauncher);
165 bool isInSpecialGameLoop()
const {
return !_eventLoopSemaphore.isReleased(); }
168 return canLoadGameStateCurrently(msg);
174 assert(stream !=
nullptr);
179 assert(stream !=
nullptr);
187 bool tryLoadFromLauncher();
207 uint32 _timeNegOffset = 0, _timePosOffset = 0;
208 uint32 _timeBeforePause = 0;
212 #define SHOULD_QUIT ::Alcachofa::g_engine->shouldQuit() 216 #endif // ALCACHOFA_H Definition: managed_surface.h:51
Definition: alcachofa.h:45
Definition: alcachofa.h:67
EngineFeature
Definition: engine.h:258
Definition: alcachofa.h:110
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: alcachofa.h:167
Definition: serializer.h:80
Definition: graphics.h:74
Definition: global-ui.h:29
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Definition: alcachofa.h:173
Definition: graphics.h:498
Provides functionality specific to a game title / engine version. Also includes all exemptions to inc...
Definition: game.h:47
bool hasFeature(EngineFeature f) const override
Definition: alcachofa.h:158
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
Definition: alcachofa.h:178
Definition: scheduler.h:193
This fake semaphore does not work in multi-threaded scenarios It is used as a safer option for a simp...
Definition: common.h:93
Definition: detection.h:45
Definition: alcachofa.h:82