[Scummvm-git-logs] scummvm master -> 1985bbce8bb63698789a0412bf1e367ad2968291

somaen noreply at scummvm.org
Sat May 7 23:07:34 UTC 2022


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:
3675462951 TINSEL: Implement constant rendering for Noir
1985bbce8b TINSEL: Map the correct colors for menus in Noir


Commit: 3675462951989b0228f353871ee680ddfb78eba7
    https://github.com/scummvm/scummvm/commit/3675462951989b0228f353871ee680ddfb78eba7
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2022-05-08T01:07:15+02:00

Commit Message:
TINSEL: Implement constant rendering for Noir

(This needs to take 16 bpp into account)

Changed paths:
    engines/tinsel/graphics.cpp


diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index 220da291f39..de596d4ee48 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -715,6 +715,26 @@ static void t3WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP) {
 	}
 }
 
+/**
+ * Fill the destination area with a constant color (Noir)
+ */
+static void t3WrtConst(DRAWOBJECT *pObj, bool applyClipping) {
+	if (applyClipping) {
+		pObj->height -= pObj->topClip + pObj->botClip;
+		pObj->width -= pObj->leftClip + pObj->rightClip;
+
+		if (pObj->width <= 0)
+			return;
+	}
+
+	Common::Rect rect;
+	rect.top = pObj->yPos;
+	rect.bottom = pObj->yPos + pObj->height;
+	rect.left = pObj->xPos;
+	rect.right = pObj->xPos + pObj->width;
+	_vm->screen().fillRect(rect, pObj->constant);
+}
+
 /**
  * Fill the destination area with a constant color
  */
@@ -801,6 +821,35 @@ static void t3TransWNZ(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP) {
 	}
 }
 
+/**
+ * Translates the destination surface within the object's bounds giving it a slightly
+ * green tint (Noir)
+ */
+static void t3WrtTrans(DRAWOBJECT *pObj, bool applyClipping) {
+	if (applyClipping) {
+		pObj->height -= pObj->topClip + pObj->botClip;
+		pObj->width -= pObj->leftClip + pObj->rightClip;
+
+		if (pObj->width <= 0)
+			return;
+	}
+
+	auto &surface = _vm->screen();
+	for (int yOffset = 0; yOffset < pObj->height; ++yOffset) {
+		for (int xOffset = 0; xOffset < pObj->width; ++xOffset) {
+			int x = pObj->xPos + xOffset;
+			int y = pObj->yPos + yOffset;
+			uint8 r,g,b;
+			surface.format.colorToRGB(surface.getPixel(x, y), r, g, b);
+			r >>= 2;
+			g >>= 1;
+			b >>= 2;
+			surface.setPixel(x, y, surface.format.RGBToColor(r,g,b));
+		}
+	}
+
+}
+
 /**
  * Translates the destination surface within the object's bounds using the transparency
  * lookup table from transpal.cpp (the contents of which have been moved into palette.cpp)
@@ -1191,7 +1240,10 @@ void DrawObject(DRAWOBJECT *pObj) {
 			break;
 		case 0x04:	// fill with constant color without clipping
 		case 0x44:	// fill with constant color with clipping
-			WrtConst(pObj, destPtr, typeId == 0x44);
+			if (TinselVersion == 3)
+				t3WrtConst(pObj, typeId == 0x44);
+			else
+				WrtConst(pObj, destPtr, typeId == 0x44);
 			break;
 		case 0x81:	// TinselV3, draw sprite with transparency
 		case 0xC1:	// TinselV3, draw sprite with transparency & clipping
@@ -1202,7 +1254,10 @@ void DrawObject(DRAWOBJECT *pObj) {
 			break;
 		case 0x84:	// draw transparent surface without clipping
 		case 0xC4:	// draw transparent surface with clipping
-			WrtTrans(pObj, destPtr, typeId == 0xC4);
+			if (TinselVersion == 3)
+				t3WrtTrans(pObj, typeId == 0xC4);
+			else
+				WrtTrans(pObj, destPtr, typeId == 0xC4);
 			break;
 		case 0x05:	// TinselV3, draw text with color replacement without clipping
 		case 0x45:	// TinselV3, draw text with color replacement with clipping


Commit: 1985bbce8bb63698789a0412bf1e367ad2968291
    https://github.com/scummvm/scummvm/commit/1985bbce8bb63698789a0412bf1e367ad2968291
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2022-05-08T01:07:25+02:00

Commit Message:
TINSEL: Map the correct colors for menus in Noir

Changed paths:
    engines/tinsel/palette.cpp
    engines/tinsel/palette.h


diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index b4ba25c3522..4d236282581 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -637,11 +637,18 @@ void DimPartPalette(SCNHANDLE hDimPal, int startColor, int length, int brightnes
 	}
 }
 
+int32 DarkGreen() {
+	return _vm->screen().format.RGBToColor(0x00, 0x40, 0x00);
+}
+
 int TranslucentColor() {
 	return g_translucentIndex;
 }
 
 int HighlightColor() {
+	if (TinselVersion == 3) {
+		return _vm->screen().format.RGBToColor(0x00, 0x80, 0x00);
+	}
 	UpdateDACqueue(g_talkIndex, (COLORREF)SysVar(SYS_HighlightRGB));
 
 	return g_talkIndex;
diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h
index da8b3b449bb..29d7b1cc75b 100644
--- a/engines/tinsel/palette.h
+++ b/engines/tinsel/palette.h
@@ -144,8 +144,9 @@ void DimPartPalette(
 
 
 int TranslucentColor();
+int32 DarkGreen();
 
-#define BoxColor TranslucentColor
+#define BoxColor (TinselVersion == 3 ? DarkGreen : TranslucentColor)
 
 int HighlightColor();
 




More information about the Scummvm-git-logs mailing list