[Scummvm-git-logs] scummvm master -> 502dc222115f801702996b386f3e416e7346c1e3

athrxx noreply at scummvm.org
Tue Nov 17 23:09:53 UTC 2026


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

Summary:
a5badc8903 SNATCHER: stop sound when loading a savegame
502dc22211 SNATCHER: fix palette glitch for certain savegames


Commit: a5badc890368793447e1f87b11091cf29846b5f0
    https://github.com/scummvm/scummvm/commit/a5badc890368793447e1f87b11091cf29846b5f0
Author: athrxx (athrxx at scummvm.org)
Date: 2026-11-18T00:08:42+01:00

Commit Message:
SNATCHER: stop sound when loading a savegame

Otherwise the engine will wait for certain sounds to finish
before resuming after the loading.

Changed paths:
    engines/snatcher/sound.cpp


diff --git a/engines/snatcher/sound.cpp b/engines/snatcher/sound.cpp
index 03ae7f82a1b..1c6d2090dc0 100644
--- a/engines/snatcher/sound.cpp
+++ b/engines/snatcher/sound.cpp
@@ -132,6 +132,12 @@ void SoundEngine::setSoundEffectVolume(int vol) {
 void SoundEngine::loadState(Common::SeekableReadStream *in, SaveFlags flags) {
 	if (in->readUint32BE() != MKTAG('S', 'N', 'A', 'T'))
 		error("%s(): Save file invalid or corrupt", __FUNCTION__);
+
+	if (!(flags & kFlagTempData)) {
+		_dev->pcmSendCommand(0xFF, 0);
+		_dev->fmSendCommand(0xFF, 0);
+	}
+
 	_pcmStatus.resourceId = _pcmStatus.resourceId2 = in->readSint16BE();
 	_pcmStatus.blocked = in->readByte();
 	_fmStatus.music = in->readByte();


Commit: 502dc222115f801702996b386f3e416e7346c1e3
    https://github.com/scummvm/scummvm/commit/502dc222115f801702996b386f3e416e7346c1e3
Author: athrxx (athrxx at scummvm.org)
Date: 2026-11-18T00:08:47+01:00

Commit Message:
SNATCHER: fix palette glitch for certain savegames

When saving in complete darkness the game would not recover
any palette after loading, not even the colors for the verb interface.

Changed paths:
    engines/snatcher/palette.cpp
    engines/snatcher/palette.h
    engines/snatcher/palette_scd.cpp


diff --git a/engines/snatcher/palette.cpp b/engines/snatcher/palette.cpp
index 550b22e2f8e..b9c3f48d9b3 100644
--- a/engines/snatcher/palette.cpp
+++ b/engines/snatcher/palette.cpp
@@ -43,10 +43,12 @@ void Palette::block() {
 
 void Palette::unblock() {
 	_blocked = false;
-	if (_restoreAfterUnblock) {
+	_refreshAfterLoad = 50;
+}
+
+void Palette::update() {
+	if (_refreshAfterLoad && !--_refreshAfterLoad)
 		updateSystemPalette();
-		_restoreAfterUnblock = false;
-	}
 }
 
 Palette *Palette::create(const Graphics::PixelFormat *pxf, PaletteManager *pm, Common::Platform platform, GraphicsEngine::GfxState &state) {
diff --git a/engines/snatcher/palette.h b/engines/snatcher/palette.h
index fd655a135e2..c30f416dd3c 100644
--- a/engines/snatcher/palette.h
+++ b/engines/snatcher/palette.h
@@ -52,7 +52,7 @@ public:
 	virtual void processEventQueue() {}
 	virtual void clearEvents() {}
 	virtual void setDefaults(int mode) {}
-	virtual void update() {}
+	virtual void update();
 	virtual void hINTCallback(void*) {}
 
 	virtual void selectPalettes(uint32) {}
@@ -70,7 +70,7 @@ protected:
 
 	uint8 *_sysPalette = nullptr;
 	bool _blocked = false;
-	bool _restoreAfterUnblock = false;
+	int _refreshAfterLoad = 0;
 	const Graphics::PixelFormat _pixelFormat = Graphics::PixelFormat();
 	PaletteManager *_palMan = nullptr;
 	GraphicsEngine::GfxState &_gfxState;
diff --git a/engines/snatcher/palette_scd.cpp b/engines/snatcher/palette_scd.cpp
index b7ee961d79e..ac2d7562524 100644
--- a/engines/snatcher/palette_scd.cpp
+++ b/engines/snatcher/palette_scd.cpp
@@ -160,6 +160,11 @@ bool SCDPalette::enqueueEvent(ResourcePointer &res) {
 					_eventQueue[ii].cmd = 0;
 			}
 		}
+
+		// If we have a postload timer set to restore the palette we cancel that if the script sets any relevant palette events first.
+		if (_refreshAfterLoad && (_eventCurPos->cmd == 1 || _eventCurPos->cmd == 2 || _eventCurPos->cmd == 4 || _eventCurPos->cmd == 7 || _eventCurPos->cmd == 9))
+			_refreshAfterLoad = 0;
+
 		return true;
 	}
 
@@ -182,6 +187,10 @@ void SCDPalette::processEventQueue() {
 		if (p->cmd > _eventProcs.size())
 			error("SCDPalette::processEventQueue(): Invalid opcode 0x%02x", p->cmd);
 
+		// If we have a postload timer set to restore the palette we cancel that if we encounter any relevant palette events first.
+		if (_refreshAfterLoad && (p->cmd == 1 || p->cmd == 2 || p->cmd == 4 || p->cmd == 7 || p->cmd == 9))
+			_refreshAfterLoad = 0;
+
 		if (_eventProcs[p->cmd]->isValid())
 			(*_eventProcs[p->cmd])(p);
 	}
@@ -289,8 +298,6 @@ void SCDPalette::loadState(Common::SeekableReadStream *in) {
 				Common::copy<const uint16*, uint16*>(&_restorePalette[i * 64], &_restorePalette[i * 64 + 64], &_restorePalette[i * 64 + 128]);
 		}
 	}
-
-	_restoreAfterUnblock = true;
 }
 
 void SCDPalette::saveState(Common::SeekableWriteStream *out) {
@@ -362,7 +369,6 @@ void SCDPalette::postLoadProcess() {
 			Common::copy<const uint16 *, uint16 *>(&_restorePalette[i * 64], &_restorePalette[i * 64 + 64], palettes[i]);
 	}
 
-	_restoreAfterUnblock = restorePal;
 	delete[] _restorePalette;
 	_restorePalette = nullptr;	
 }




More information about the Scummvm-git-logs mailing list