diff options
author | Bastien Bouclet | 2018-05-19 18:23:45 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-05-19 18:23:45 +0200 |
commit | 4396b011ac307e69fb76581704b719cdc2afd4ee (patch) | |
tree | 53f0a5fbbc848cb117d534aa50f1587260dfd6d0 | |
parent | 719c2b83742495f1619d62088d14f8b63fd50aaa (diff) | |
download | scummvm-rg350-4396b011ac307e69fb76581704b719cdc2afd4ee.tar.gz scummvm-rg350-4396b011ac307e69fb76581704b719cdc2afd4ee.tar.bz2 scummvm-rg350-4396b011ac307e69fb76581704b719cdc2afd4ee.zip |
MOHAWK: MYST: Fix the Wii/GameCube build
-rw-r--r-- | engines/mohawk/myst.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 4 | ||||
-rw-r--r-- | engines/mohawk/myst_state.cpp | 8 | ||||
-rw-r--r-- | engines/mohawk/myst_state.h | 2 |
4 files changed, 10 insertions, 8 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 7171373846..1355b86069 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -264,6 +264,8 @@ void MohawkEngine_Myst::playMovieBlocking(const Common::String &name, MystStack } void MohawkEngine_Myst::playFlybyMovie(uint16 stack, uint16 card) { + static const uint16 kMasterpieceOnly = 0xFFFF; + // Play Flyby Entry Movie on Masterpiece Edition. const char *flyby = nullptr; @@ -1180,7 +1182,7 @@ Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &d } void MohawkEngine_Myst::autoSave() { - if (!_gameState->save(Mohawk::kAutoSaveSlot, Mohawk::kAutoSaveName, true)) + if (!_gameState->save(MystGameState::kAutoSaveSlot, "Autosave", true)) warning("Attempt to autosave has failed."); } diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index beefdb0394..5c238701d0 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -95,10 +95,6 @@ enum TransitionType { kNoTransition = 999 }; -const uint16 kMasterpieceOnly = 0xFFFF; -const int kAutoSaveSlot = 0; -const Common::String kAutoSaveName = "Autosave"; - struct MystCondition { uint16 var; Common::Array<uint16> values; diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp index 5de336ac49..efc5025de5 100644 --- a/engines/mohawk/myst_state.cpp +++ b/engines/mohawk/myst_state.cpp @@ -63,6 +63,8 @@ bool MystSaveMetadata::sync(Common::Serializer &s) { return true; } +const int MystGameState::kAutoSaveSlot = 0; + MystGameState::MystGameState(MohawkEngine_Myst *vm, Common::SaveFileManager *saveFileMan) : _vm(vm), _saveFileMan(saveFileMan) { // Most of the variables are zero at game start. memset(&_globals, 0, sizeof(_globals)); @@ -257,7 +259,7 @@ bool MystGameState::saveMetadata(int slot) { bool MystGameState::isAutoSaveAllowed() { // Open autosave slot and see if it an autosave // Autosaving will be enabled if it is an autosave or if there is no save in that slot - Common::String filename = buildMetadataFilename(Mohawk::kAutoSaveSlot); + Common::String filename = buildMetadataFilename(kAutoSaveSlot); Common::ScopedPtr<Common::InSaveFile> metadataFile(g_system->getSavefileManager()->openForLoading(filename)); if (!metadataFile) { // There is no save in the autosave slot, enable autosave return true; @@ -280,7 +282,7 @@ SaveStateDescriptor MystGameState::querySaveMetaInfos(int slot) { Common::InSaveFile *metadataFile = g_system->getSavefileManager()->openForLoading(filename); SaveStateDescriptor desc; - desc.setWriteProtectedFlag(slot == Mohawk::kAutoSaveSlot); + desc.setWriteProtectedFlag(slot == kAutoSaveSlot); if (!metadataFile) { return desc; @@ -300,7 +302,7 @@ SaveStateDescriptor MystGameState::querySaveMetaInfos(int slot) { desc.setSaveDate(metadata.saveYear, metadata.saveMonth, metadata.saveDay); desc.setSaveTime(metadata.saveHour, metadata.saveMinute); desc.setPlayTime(metadata.totalPlayTime); - desc.setDeletableFlag(slot != Mohawk::kAutoSaveSlot); + desc.setDeletableFlag(slot != kAutoSaveSlot); Graphics::Surface *thumbnail; if (!Graphics::loadThumbnail(*metadataFile, thumbnail)) { diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h index 8ff87d1bbc..28bbf60d63 100644 --- a/engines/mohawk/myst_state.h +++ b/engines/mohawk/myst_state.h @@ -100,6 +100,8 @@ enum DniEnding { class MystGameState { public: + static const int kAutoSaveSlot; + MystGameState(MohawkEngine_Myst*, Common::SaveFileManager*); ~MystGameState(); |