[Scummvm-git-logs] scummvm master -> 900a623cead64fed15be368a9b5e090677985e64

neuromancer noreply at scummvm.org
Wed Dec 21 11:53:32 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:
03ddc824a7 FREESCAPE: refactored CGA palette selection for Driller (DOS)
900a623cea FREESCAPE: properly set the isAccelerated flag for the OpenGL renderer


Commit: 03ddc824a74cce2ce130b896b4bf53a0d363b567
    https://github.com/scummvm/scummvm/commit/03ddc824a74cce2ce130b896b4bf53a0d363b567
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-21T08:10:27-03:00

Commit Message:
FREESCAPE: refactored CGA palette selection for Driller (DOS)

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index fa2cbb6393f..1eb8aa9ea75 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -29,14 +29,28 @@
 
 namespace Freescape {
 
-byte dos_CGA_palette[4][3] = {
+enum {
+	kDrillerCGAPalettePinkBlue = 0,
+	kDrillerCGAPaletteRedGreen = 1,
+};
+
+static const struct CGAPalettteEntry {
+	int areaId;
+	int palette;
+} rawCGAPaletteTable[] {
+	{1, kDrillerCGAPaletteRedGreen},
+	{2, kDrillerCGAPalettePinkBlue},
+	{0, 0}   // This marks the end
+};
+
+byte kDrillerCGAPalettePinkBlueData[4][3] = {
 	{0x00, 0x00, 0x00},
 	{0x00, 0xaa, 0xaa},
 	{0xaa, 0x00, 0xaa},
 	{0xaa, 0xaa, 0xaa},
 };
 
-byte dos_CGA_palette_alt[4][3] = {
+byte kDrillerCGAPaletteRedGreenData[4][3] = {
 	{0x00, 0x00, 0x00},
 	{0x00, 0xaa, 0x00},
 	{0xaa, 0x00, 0x00},
@@ -438,30 +452,36 @@ void DrillerEngine::prepareBorder() {
 		uint32 colorX = _border->format.ARGBToColor(0xFF, 0xAA, 0xAA, 0xAA);
 		uint32 colorY = _border->format.ARGBToColor(0xFF, 0xAA, 0x00, 0x00);
 
-		Graphics::Surface *borderCopy = new Graphics::Surface();
-		borderCopy->create(1, 1, _border->format);
-		borderCopy->copyFrom(*_border);
+		Graphics::Surface *borderRedGreen = new Graphics::Surface();
+		borderRedGreen->create(1, 1, _border->format);
+		borderRedGreen->copyFrom(*_border);
 
 		for (int i = 0; i < _border->w; i++) {
 			for (int j = 0; j < _border->h; j++) {
-				if (borderCopy->getPixel(i, j) == color1)
-					borderCopy->setPixel(i, j, color2);
-				else if (borderCopy->getPixel(i, j) == colorA)
-					borderCopy->setPixel(i, j, colorB);
-				else if (borderCopy->getPixel(i, j) == colorX)
-					borderCopy->setPixel(i, j, colorY);
+				if (borderRedGreen->getPixel(i, j) == color1)
+					borderRedGreen->setPixel(i, j, color2);
+				else if (borderRedGreen->getPixel(i, j) == colorA)
+					borderRedGreen->setPixel(i, j, colorB);
+				else if (borderRedGreen->getPixel(i, j) == colorX)
+					borderRedGreen->setPixel(i, j, colorY);
 
 			}
 		}
-		Texture *borderTextureAlterative = _gfx->createTexture(borderCopy);
-		_borderCGAByArea[1] = borderTextureAlterative; 
-		_paletteCGAByArea[1] = (byte *)dos_CGA_palette_alt;
-
-		_borderCGAByArea[2] = _borderTexture; 
-		_paletteCGAByArea[2] = (byte *)dos_CGA_palette;
-
-		_borderCGAByArea[8] = _borderTexture; 
-		_borderCGAByArea[14] = _borderTexture; 
+		Texture *borderTextureRedGreen = _gfx->createTexture(borderRedGreen);
+
+		const CGAPalettteEntry *entry = rawCGAPaletteTable;
+		while (entry->areaId) {
+
+			if (entry->palette == kDrillerCGAPaletteRedGreen) {
+				_borderCGAByArea[entry->areaId] = borderTextureRedGreen; 
+				_paletteCGAByArea[entry->areaId] = (byte *)kDrillerCGAPaletteRedGreenData;
+			} else if (entry->palette == kDrillerCGAPalettePinkBlue) {
+				_borderCGAByArea[entry->areaId] = _borderTexture; 
+				_paletteCGAByArea[entry->areaId] = (byte *)kDrillerCGAPalettePinkBlueData;
+			} else
+				error("Invalid CGA palette to use");
+			entry++;
+		}
 	}
 }
 


Commit: 900a623cead64fed15be368a9b5e090677985e64
    https://github.com/scummvm/scummvm/commit/900a623cead64fed15be368a9b5e090677985e64
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-21T08:51:07-03:00

Commit Message:
FREESCAPE: properly set the isAccelerated flag for the OpenGL renderer

Changed paths:
    engines/freescape/gfx_opengl.cpp


diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index 5c2b35d6f05..245ffa02193 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -41,6 +41,7 @@ OpenGLRenderer::OpenGLRenderer(int screenW, int screenH, Common::RenderMode rend
 	_verts = (Vertex *)malloc(sizeof(Vertex) * kVertexArraySize);
 	_coords = (Coord *)malloc(sizeof(Coord) * kCoordsArraySize);
 	_texturePixelFormat = OpenGLTexture::getRGBAPixelFormat();
+	_isAccelerated = true;
 }
 
 OpenGLRenderer::~OpenGLRenderer() {




More information about the Scummvm-git-logs mailing list