[Scummvm-git-logs] scummvm master -> 9102a2f0ec8e6b5dd99b1ee53cc14489da0bbe2e

AndywinXp noreply at scummvm.org
Mon Nov 28 20:29:27 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:
9102a2f0ec SCUMM: DIG: Fix palette artifacts on cursor change


Commit: 9102a2f0ec8e6b5dd99b1ee53cc14489da0bbe2e
    https://github.com/scummvm/scummvm/commit/9102a2f0ec8e6b5dd99b1ee53cc14489da0bbe2e
Author: AndywinXp (andywinxp at gmail.com)
Date: 2022-11-28T21:28:32+01:00

Commit Message:
SCUMM: DIG: Fix palette artifacts on cursor change

Interestingly, but unsurprisingly, this was caused by 20 years old code which now produces no effects
at all, other than causing the bug that this commit fixes :-P I have checked the disasm of every version
of SCUMM, and there is no sign of updatePalette() ever being called at the end of the fadeOut() function.
Removing it fixes the issue. I have tested every game I have for this change, but I'm sure that whatever
that updatePalette() call was trying to fix 20 years ago, it has probably been fixed properly now, so there's
no need for it.

Also, removed _fullRedraw toggles in o_LoadRoom for DIG and COMI, which, judging by the disasm, don't
force the redraw after changing the scene.

Changed paths:
    engines/scumm/cursor.cpp
    engines/scumm/gfx.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/scumm_v7.h


diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 8dbe49783df..857cdd42271 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -515,15 +515,20 @@ void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
 		useBompCursor(bomp, w, h);
 	else
 		useIm01Cursor(dataptr, w, h);
+}
+
+#ifdef ENABLE_SCUMM_7_8
+void ScummEngine_v7::setCursorFromImg(uint img, uint room, uint imgindex) {
+	ScummEngine_v6::setCursorFromImg(img, room, imgindex);
 
 	// There are several occasions in which the screen is not updated
 	// between subsequent cursor changes, and as a result we would never
 	// be able to see some of those updates (i.e. the loading cursors in
 	// The Dig and The Curse of Monkey Island). This forced screen update
 	// addresses that.
-	if (_game.version > 6)
-		_system->updateScreen();
+	_system->updateScreen();
 }
+#endif
 
 void ScummEngine_v6::useIm01Cursor(const byte *im, int w, int h) {
 	VirtScreen *vs = &_virtscr[kMainVirtScreen];
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 7ef9e5d51e9..0d899742557 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4178,10 +4178,6 @@ void ScummEngine::fadeOut(int effect) {
 		}
 	}
 
-	// Update the palette at the end (once we faded to black) to avoid
-	// some nasty effects when the palette is changed
-	updatePalette();
-
 	_screenEffectFlag = false;
 }
 
@@ -4623,7 +4619,7 @@ byte MajMinCodec::readBits(byte n) {
 	MAJMIN_FILL_BITS();
 	byte _value = _majMinData.bits & ((1 << n) - 1);
 	MAJMIN_EAT_BITS(n);
-	return _value;   
+	return _value;
 }
 
 void MajMinCodec::skipData(int32 numbytes) {
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 6505938e5a0..03f2221ac8d 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1790,7 +1790,9 @@ void ScummEngine_v5::o5_loadRoom() {
 	if (!(_game.features & GF_SMALL_HEADER) || room != _currentRoom)
 		startScene(room, nullptr, 0);
 
-	_fullRedraw = true;
+	// DIG and COMI don't flag a full redraw after starting the scene.
+	if (_game.version < 7 || _game.id == GID_FT)
+		_fullRedraw = true;
 }
 
 void ScummEngine_v5::o5_loadRoomWithEgo() {
diff --git a/engines/scumm/scumm_v7.h b/engines/scumm/scumm_v7.h
index 56d65fe2a21..58f13c0e7fa 100644
--- a/engines/scumm/scumm_v7.h
+++ b/engines/scumm/scumm_v7.h
@@ -162,6 +162,7 @@ protected:
 	void setDefaultCursor() override;
 	void updateCursor() override;
 	void setCursorTransparency(int a) override;
+	void setCursorFromImg(uint img, uint room, uint imgindex) override;
 
 	void drawVerb(int verb, int mode) override;
 




More information about the Scummvm-git-logs mailing list