[Scummvm-git-logs] scummvm master -> 8b4be8eb5081b65ea1fe43fe8b5789dd2a6cc38b

mgerhardy noreply at scummvm.org
Sun May 24 20:03:54 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:
913f41934a TWINE: fixed plasmaEffectRenderFrame mask which reduced the stochasic variation
8b4be8eb50 TWINE: fixed menu plasma quality loss


Commit: 913f41934aff4082c1506a4d52dd3798a25a2f46
    https://github.com/scummvm/scummvm/commit/913f41934aff4082c1506a4d52dd3798a25a2f46
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2026-05-24T21:54:28+02:00

Commit Message:
TWINE: fixed plasmaEffectRenderFrame mask which reduced the stochasic variation

validated against original sources in FIRE.C. The bug https://bugs.scummvm.org/ticket/15396 is still not yet
fixed by this commit though

Changed paths:
    engines/twine/menu/menu.cpp


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 9529262e66d..e5211ca23a5 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -230,9 +230,9 @@ void Menu::plasmaEffectRenderFrame() {
 			c += _plasmaEffectPtr[(i + 0) + (j + 1) * PLASMA_WIDTH]; // bottom
 			c += _plasmaEffectPtr[(i + 1) + (j + 1) * PLASMA_WIDTH]; // bottom-right
 
-			/* And the 2 least significant bits are used as a
+			/* And the 3 least significant bits are used as a
 			 * randomizing parameter for statistically fading the flames */
-			c = (c >> 3) | ((c & 0x0003) << 13);
+			c = (c >> 3) | ((c & 0x0007) << 13);
 
 			if (!(c & 0x6500) &&
 				(j >= (PLASMA_HEIGHT - 4) || c > 0)) {


Commit: 8b4be8eb5081b65ea1fe43fe8b5789dd2a6cc38b
    https://github.com/scummvm/scummvm/commit/8b4be8eb5081b65ea1fe43fe8b5789dd2a6cc38b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2026-05-24T22:03:15+02:00

Commit Message:
TWINE: fixed menu plasma quality loss

the old code wrote 2x2 pixels - the fixed one doubles only on the y axis. this results in writing
320x50, not 640x50 - which in turn let the fire effect look less stretched

hopefully this was meant by the bug report...

https://bugs.scummvm.org/ticket/15396

Changed paths:
    engines/twine/menu/menu.cpp


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index e5211ca23a5..5874d03c19c 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -260,20 +260,19 @@ void Menu::processPlasmaEffect(const Common::Rect &rect, int32 color) {
 
 	const uint8 *in = _plasmaEffectPtr + 5 * PLASMA_WIDTH;
 	uint8 *out = (uint8 *)_engine->_imageBuffer.getBasePtr(0, 0);
+	const int32 bufWidth = _engine->_imageBuffer.w;
 
+	// Write plasma at native 320x25 resolution, each source row doubled vertically
+	// to produce 320x50 output matching the original DoFire rendering
 	for (int32 y = 0; y < PLASMA_HEIGHT / 2; y++) {
-		int32 yOffset = y * _engine->_imageBuffer.w;
 		const uint8 *colPtr = &in[y * PLASMA_WIDTH];
+		uint8 *row0 = out + (y * 2) * bufWidth;
+		uint8 *row1 = row0 + bufWidth;
 		for (int32 x = 0; x < PLASMA_WIDTH; x++) {
 			const uint8 c = MIN(*colPtr / 2 + color, max_value);
-			/* 2x2 squares sharing the same pixel color: */
-			const int32 target = 2 * yOffset;
-			out[target + 0] = c;
-			out[target + 1] = c;
-			out[target + _engine->_imageBuffer.w + 0] = c;
-			out[target + _engine->_imageBuffer.w + 1] = c;
+			row0[x] = c;
+			row1[x] = c;
 			++colPtr;
-			++yOffset;
 		}
 	}
 	const Common::Rect prect(0, 0, PLASMA_WIDTH, PLASMA_HEIGHT);




More information about the Scummvm-git-logs mailing list