[Scummvm-git-logs] scummvm master -> cdb33c9d19054fa58b19875d26cdb1003f5bdfb3
Die4Ever
noreply at scummvm.org
Wed Feb 16 20:53:57 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
cdb33c9d19 GROOVIE: fix autosave for demos
Commit: cdb33c9d19054fa58b19875d26cdb1003f5bdfb3
https://github.com/scummvm/scummvm/commit/cdb33c9d19054fa58b19875d26cdb1003f5bdfb3
Author: Die4Ever (die4ever2005 at gmail.com)
Date: 2022-02-16T14:49:37-06:00
Commit Message:
GROOVIE: fix autosave for demos
Changed paths:
engines/groovie/detection.cpp
engines/groovie/groovie.cpp
engines/groovie/groovie.h
engines/groovie/script.cpp
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index 125d4ff1476..264591e3349 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -404,7 +404,7 @@ static const GroovieGameDescription gameDescriptions[] = {
AD_ENTRY2s("tlcmain.grv", "6ec818f595eedca6570280af0c681642", 17361,
"tlcnav.gjd", nullptr, -1),
Common::DE_DEU, Common::kPlatformWindows, ADGF_DEMO | ADGF_TESTING,
- GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
+ GUIO3(GUIO_NOMIDI, GUIO_NOASPECT, GUIO_NOLAUNCHLOAD)
},
kGroovieTLC
},
@@ -416,7 +416,7 @@ static const GroovieGameDescription gameDescriptions[] = {
AD_ENTRY2s("preview.grv", "d95401509a0ef251e8c340737edf728c", 19,
"drama1.gjd", nullptr, -1),
Common::UNK_LANG, Common::kPlatformWindows, ADGF_DEMO | ADGF_TESTING,
- GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
+ GUIO3(GUIO_NOMIDI, GUIO_NOASPECT, GUIO_NOLAUNCHLOAD)
},
kGroovieTLC
},
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index efae4689727..00634ee769e 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -370,6 +370,16 @@ bool GroovieEngine::hasFeature(EngineFeature f) const {
(f == kSupportsLoadingDuringRuntime);
}
+bool GroovieEngine::canLaunchLoad() const {
+ if (_gameDescription->desc.guiOptions == nullptr)
+ return false;
+ return strstr(_gameDescription->desc.guiOptions, GUIO_NOLAUNCHLOAD) != nullptr;
+}
+
+bool GroovieEngine::isDemo() const {
+ return _gameDescription->desc.flags & ADGF_DEMO;
+}
+
void GroovieEngine::syncSoundSettings() {
Engine::syncSoundSettings();
@@ -389,6 +399,8 @@ void GroovieEngine::syncSoundSettings() {
bool GroovieEngine::canLoadGameStateCurrently() {
// TODO: verify the engine has been initialized
+ if (isDemo())
+ return false;
if (_script)
return true;
else
@@ -397,6 +409,8 @@ bool GroovieEngine::canLoadGameStateCurrently() {
bool GroovieEngine::canSaveGameStateCurrently() {
// TODO: verify the engine has been initialized
+ if (isDemo())
+ return false;
if (_script)
return _script->canDirectSave();
else
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index 1cd4f1ba787..b22864830e3 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -121,6 +121,8 @@ public:
EngineVersion getEngineVersion() const;
int getAutosaveSlot() const override;
+ bool canLaunchLoad() const;
+ bool isDemo() const;
protected:
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index b5eca39578b..ed75361d775 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -600,6 +600,9 @@ bool Script::preview_loadgame(uint slot) { // used by Clandestiny for the photos
}
bool Script::canDirectSave() const {
+ if (this->_vm->isDemo())
+ return false;
+
// Disallow when running a subscript (puzzle)
if (_savedCode == nullptr) {
// UHP appears not to use "room" variables(?)
@@ -1186,8 +1189,8 @@ void Script::o_inputloopend() {
}
if (_wantAutosave && canDirectSave()) {
- _vm->saveAutosaveIfEnabled();
_wantAutosave = false;
+ _vm->saveAutosaveIfEnabled();
}
}
More information about the Scummvm-git-logs
mailing list