[Scummvm-git-logs] scummvm master -> f216ee38c7204b05aad37c2a7caf83371611471b

AndywinXp noreply at scummvm.org
Sat Jun 15 09:53:19 UTC 2024


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

Summary:
8c72225477 SCUMM: Relabel drawObject() argument
f216ee38c7 SCUMM: HE: Fix TMSK ZPlanes handling


Commit: 8c722254774660d2ded62650b135641255abed13
    https://github.com/scummvm/scummvm/commit/8c722254774660d2ded62650b135641255abed13
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-06-15T11:47:53+02:00

Commit Message:
SCUMM: Relabel drawObject() argument

Changed paths:
    engines/scumm/object.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index da6e288cb9d..dc208ecb423 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -637,7 +637,7 @@ void ScummEngine::drawRoomObjects(int arg) {
 	}
 }
 
-void ScummEngine::drawObject(int obj, int arg) {
+void ScummEngine::drawObject(int obj, int scrollType) {
 	if (_skipDrawObject)
 		return;
 
@@ -648,7 +648,7 @@ void ScummEngine::drawObject(int obj, int arg) {
 	int tmp;
 
 	if (_bgNeedsRedraw)
-		arg = 0;
+		scrollType = 0;
 
 	if (od.obj_nr == 0)
 		return;
@@ -687,9 +687,9 @@ void ScummEngine::drawObject(int obj, int arg) {
 		tmp = xpos + a;
 		if (tmp < _screenStartStrip || _screenEndStrip < tmp)
 			continue;
-		if (arg > 0 && _screenStartStrip + arg <= tmp)
+		if (scrollType > 0 && _screenStartStrip + scrollType <= tmp)
 			continue;
-		if (arg < 0 && tmp <= _screenEndStrip + arg)
+		if (scrollType < 0 && tmp <= _screenEndStrip + scrollType)
 			continue;
 		setGfxUsageBit(tmp, USAGE_BIT_DIRTY); // FIXME: HE70 onwards seems to use USAGE_BIT_RESTORED instead?
 		if (tmp < x)
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 2558fe969cb..1368deaeec5 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1340,7 +1340,7 @@ protected:
 
 	void decodeNESBaseTiles();
 
-	void drawObject(int obj, int arg);
+	void drawObject(int obj, int scrollType);
 	void drawRoomObjects(int arg);
 	void drawRoomObject(int i, int arg);
 	void drawBox(int x, int y, int x2, int y2, int color);


Commit: f216ee38c7204b05aad37c2a7caf83371611471b
    https://github.com/scummvm/scummvm/commit/f216ee38c7204b05aad37c2a7caf83371611471b
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-06-15T11:53:12+02:00

Commit Message:
SCUMM: HE: Fix TMSK ZPlanes handling

This closes ticket 13420:
"SCUMM: PUTTZOO Animation overlap bug
with final iceberg in Putt-Putt Saves the Zoo"

Not only this now works correctly, but now in updated versions
of the game the hair of the lower left penguin is not masked
anymore, so the iceberg piece will be drawn on top of said hair.
I have verified that this is 100% accurate, the code for TMSK
decompression is the same in every HE version, and the original
executable shows exactly the same behavior.

So refrain from filing a bug for that, thanks :P

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 75b102b8c2b..e00ea6e0e8f 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -2196,7 +2196,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
 		for (int i = 0; i < numzbuf; i++) {
 			byte *dst1, *dst2;
 
-			dst1 = dst2 = (byte *)vs->pixels + y * vs->pitch + x * 8;
+			dst1 = dst2 = (byte *)vs->getPixels(0,0) + y * vs->pitch + x * 8;
 			if (vs->hasTwoBuffers)
 				dst2 = vs->backBuf + y * vs->pitch + x * 8;
 			byte *mask_ptr = getMaskBuffer(x, y, i);
@@ -2960,8 +2960,7 @@ void GdiHE::decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int hei
 
 		maskCount--;
 
-		*dst |= srcbits;
-		*dst &= ~maskbits;
+		*dst = (*dst & (~maskbits)) | (srcbits & maskbits);
 
 		dst += _numStrips;
 		height--;




More information about the Scummvm-git-logs mailing list