[Scummvm-git-logs] scummvm branch-2-7 -> a8bbb5f07f3cff8cd233de155f616e2db731508a

tag2015 noreply at scummvm.org
Sat Feb 4 11:08:27 UTC 2023


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d9177e8870 HUGO: Use slot 99 as the fallback save
13b04ba874 HUGO: Disable overwriting slot 99
a8bbb5f07f AGS: Check sound stream isn't null before playing


Commit: d9177e8870385425eb7f1b3aa687b9c19d9f24b2
    https://github.com/scummvm/scummvm/commit/d9177e8870385425eb7f1b3aa687b9c19d9f24b2
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-02-04T12:05:17+01:00

Commit Message:
HUGO: Use slot 99 as the fallback save

Use slot 99 as fallback instead of slot 0,
which is normally used for autosaves

Changed paths:
    engines/hugo/hugo.cpp
    engines/hugo/parser.cpp


diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index cd425194ace..b158d4927e6 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -298,7 +298,7 @@ Common::Error HugoEngine::run() {
 			_status._skipIntroFl = true;
 			_file->restoreGame(loadSlot);
 		} else {
-			_file->saveGame(0, "New Game");
+			_file->saveGame(99, "New Game [reserved]");
 		}
 	}
 
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 375b1f50c98..c7e096dae3d 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -290,7 +290,7 @@ void Parser::keyHandler(Common::Event event) {
 			break;
 		case Common::KEYCODE_n:
 			if (Utils::yesNoBox("Are you sure you want to start a new game?"))
-				_vm->_file->restoreGame(0);
+				_vm->_file->restoreGame(99);
 			break;
 		case Common::KEYCODE_s:
 			if (gameStatus._viewState == kViewPlay) {


Commit: 13b04ba874e106b720a254fbb7ed3118cc2cb1e9
    https://github.com/scummvm/scummvm/commit/13b04ba874e106b720a254fbb7ed3118cc2cb1e9
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-02-04T12:05:40+01:00

Commit Message:
HUGO: Disable overwriting slot 99

Changed paths:
    engines/hugo/metaengine.cpp


diff --git a/engines/hugo/metaengine.cpp b/engines/hugo/metaengine.cpp
index 4bbcee9eb63..d7169aa8dfd 100644
--- a/engines/hugo/metaengine.cpp
+++ b/engines/hugo/metaengine.cpp
@@ -147,6 +147,12 @@ SaveStateDescriptor HugoMetaEngine::querySaveMetaInfos(const char *target, int s
 
 		SaveStateDescriptor desc(this, slot, saveName);
 
+		// Protect slot 99 (used for 'restart game')
+		if (slot == 99) {
+			desc.setDeletableFlag(false);
+			desc.setWriteProtectedFlag(true);
+		}
+
 		Graphics::Surface *thumbnail;
 		if (!Graphics::loadThumbnail(*file, thumbnail)) {
 			warning("Missing or broken savegame thumbnail");
@@ -172,7 +178,13 @@ SaveStateDescriptor HugoMetaEngine::querySaveMetaInfos(const char *target, int s
 		delete file;
 		return desc;
 	}
-	return SaveStateDescriptor();
+
+	SaveStateDescriptor desc(this, slot, Common::String());
+	// Protect slot 99 (used for 'restart game')
+	if (slot == 99)
+		desc.setWriteProtectedFlag(true);
+
+	return desc;
 }
 
 void HugoMetaEngine::removeSaveState(const char *target, int slot) const {


Commit: a8bbb5f07f3cff8cd233de155f616e2db731508a
    https://github.com/scummvm/scummvm/commit/a8bbb5f07f3cff8cd233de155f616e2db731508a
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-02-04T12:06:22+01:00

Commit Message:
AGS: Check sound stream isn't null before playing

Changed paths:
    engines/ags/engine/media/audio/sound_clip.cpp


diff --git a/engines/ags/engine/media/audio/sound_clip.cpp b/engines/ags/engine/media/audio/sound_clip.cpp
index e14604a75d5..9b72896ce47 100644
--- a/engines/ags/engine/media/audio/sound_clip.cpp
+++ b/engines/ags/engine/media/audio/sound_clip.cpp
@@ -147,11 +147,15 @@ void SoundClipWaveBase::poll() {
 
 int SoundClipWaveBase::play() {
 	if (_soundType != Audio::Mixer::kPlainSoundType) {
+		if (!_stream) {
+			warning("Sound stream is null");
+			return 0;
+		}
 		if (_stream->getRate() < 131072)  // maximum accepted value in audio/rate.cpp
 			_mixer->playStream(_soundType, &_soundHandle, _stream,
 							   -1, _vol255, 0, DisposeAfterUse::NO);
 		else
-			warning("Invalid sound clip sample ratio: %d! Skipping", _stream->getRate());
+			warning("Invalid sound clip sample rate: %d! Skipping", _stream->getRate());
 	} else {
 		_waitingToPlay = true;
 	}




More information about the Scummvm-git-logs mailing list