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

sev- noreply at scummvm.org
Sat Nov 11 21:58:47 UTC 2023


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:
cac7b0f527 DIRECTOR: Add Windows version of Lingo Expo
ccff1f8655 DIRECTOR: Rework BITDDecoder to store the original data


Commit: cac7b0f5275d68a8be7d3b0cb1f9d73a6dfa3030
    https://github.com/scummvm/scummvm/commit/cac7b0f5275d68a8be7d3b0cb1f9d73a6dfa3030
Author: Scott Percival (code at moral.net.au)
Date: 2023-11-11T22:58:43+01:00

Commit Message:
DIRECTOR: Add Windows version of Lingo Expo

Changed paths:
    engines/director/detection_tables.h


diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 5eee00f47c2..6a3fe563dae 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -2575,6 +2575,7 @@ static const DirectorGameDescription gameDescriptions[] = {
 									 "DEMO37.BMP",	"6be5fb3f1aa30dfa6db320a2a8c484c8", 17518, 310),
 
 	MACGAME1("lingoexpo", "", "Navigator", "4dacf23c1bb75093a882c4fd89dededb", 38, 400),
+	WINGAME1("lingoexpo", "", "NAVIGATR.DIR", "c7bfbd3e1224a1e82a8a98e8edb9f959", 1335612, 400),
 
 	MACGAME1_l("lvi", "Nº1", "xn--LVI8Mo-ka28a", "7f443f2e63fd497a9ad85b10dc880a91", 384206, Common::FR_FRA, 310),
 	WINGAME1_l("lvi", "Nº1", "LVI.EXE", "65d06b5fef155a2473434571aff5bc29", 634203, Common::FR_FRA, 310),


Commit: ccff1f8655f9fc165cd0f2ab8f28643c825e4f90
    https://github.com/scummvm/scummvm/commit/ccff1f8655f9fc165cd0f2ab8f28643c825e4f90
Author: Scott Percival (code at moral.net.au)
Date: 2023-11-11T22:58:43+01:00

Commit Message:
DIRECTOR: Rework BITDDecoder to store the original data

Previously, BITD bitmaps were pre-converted to match the ScummVM colour
depth. This caused issues in 32-bit mode; you are allowed to change the
palette of an 8-bit image at any time, so pre-converting all 8-bit
images to 32-bit leaves you frozen to whatever palette was in use when
the image was loaded.

The correct way to deal with this is to keep the original bitmap
pixel format, and perform the conversion at widget creation time.

Changed paths:
    engines/director/castmember/bitmap.cpp
    engines/director/castmember/bitmap.h
    engines/director/graphics.cpp
    engines/director/images.cpp
    engines/director/images.h


diff --git a/engines/director/castmember/bitmap.cpp b/engines/director/castmember/bitmap.cpp
index dd632ebf908..6a8ee43dd55 100644
--- a/engines/director/castmember/bitmap.cpp
+++ b/engines/director/castmember/bitmap.cpp
@@ -213,6 +213,8 @@ Graphics::MacWidget *BitmapCastMember::createWidget(Common::Rect &bbox, Channel
 	}
 
 	if (dstBpp == 1) {
+		// ScummVM using 8-bit video
+
 		if (srcBpp > 1
 		// At least early directors were not remapping 8bpp images. But in case it is
 		// needed, here is the code
@@ -222,100 +224,32 @@ Graphics::MacWidget *BitmapCastMember::createWidget(Common::Rect &bbox, Channel
 #endif
 			) {
 
-			_ditheredImg = _picture->_surface.convertTo(g_director->_wm->_pixelformat, _picture->_palette, _picture->_paletteColors, g_director->_wm->getPalette(), g_director->_wm->getPaletteSize());
+			_ditheredImg = _picture->_surface.convertTo(g_director->_wm->_pixelformat, nullptr, 0, g_director->_wm->getPalette(), g_director->_wm->getPaletteSize());
 
 			pal = g_director->_wm->getPalette();
-		} else {
-			// Convert indexed image to indexed palette
-			Movie *movie = g_director->getCurrentMovie();
-			Cast *cast = movie->getCast();
-			Score *score = movie->getScore();
-			// Get the current score palette. Note that this is the ID of the palette in the list, not the cast member!
-			CastMemberID currentPaletteId = score->getCurrentPalette();
-			if (currentPaletteId.isNull())
-				currentPaletteId = cast->_defaultPalette;
-			PaletteV4 *currentPalette = g_director->getPalette(currentPaletteId);
-			if (!currentPalette) {
-				currentPaletteId = CastMemberID(kClutSystemMac, -1);
-				currentPalette = g_director->getPalette(currentPaletteId);
-			}
-			CastMemberID castPaletteId = _clut;
-			// It is possible for Director to have saved an invalid ID in _clut;
-			// if this is the case, do no dithering.
-			if (castPaletteId.isNull())
-				castPaletteId = currentPaletteId;
-
-			// Check if the palette is in the middle of a color fade event
-			bool isColorCycling = score->isPaletteColorCycling();
-
-			// First, check if the palettes are different
-			switch (_bitsPerPixel) {
-			// 1bpp - this is preconverted to 0x00 and 0xff, change nothing.
-			case 1:
-				break;
-			// 2bpp - convert to nearest using the standard 2-bit palette.
-			case 2:
-				{
-					const PaletteV4 &srcPal = g_director->getLoaded4Palette();
-					_ditheredImg = _picture->_surface.convertTo(g_director->_wm->_pixelformat, srcPal.palette, srcPal.length, currentPalette->palette, currentPalette->length, Graphics::kDitherNaive);
-				}
-				break;
-			// 4bpp - if using a builtin palette, use one of the corresponding 4-bit ones.
-			case 4:
-				{
-					const auto pals = g_director->getLoaded16Palettes();
-					// in D4 you aren't allowed to use custom palettes for 4-bit images, so uh...
-					// I guess default to the mac palette?
-					CastMemberID palIndex = pals.contains(castPaletteId) ? castPaletteId : CastMemberID(kClutSystemMac, -1);
-					const PaletteV4 &srcPal = pals.getVal(palIndex);
-					_ditheredImg = _picture->_surface.convertTo(g_director->_wm->_pixelformat, srcPal.palette, srcPal.length, currentPalette->palette, currentPalette->length, Graphics::kDitherNaive);
-				}
-				break;
-			// 8bpp - if using a different palette, and we're not doing a color cycling operation, convert using nearest colour matching
-			case 8:
-				// Only redither 8-bit images if we have the flag set, or it is external
-				if (!movie->_remapPalettesWhenNeeded && !_external)
-					break;
-				if (_external || (castPaletteId != currentPaletteId && !isColorCycling)) {
-					const auto pals = g_director->getLoadedPalettes();
-					CastMemberID palIndex = pals.contains(castPaletteId) ? castPaletteId : CastMemberID(kClutSystemMac, -1);
-					const PaletteV4 &srcPal = pals.getVal(palIndex);
-
-					// If it is an external image, use the included palette.
-					// For BMP images especially, they'll often have the right colors
-					// but in the wrong palette order.
-					const byte *palPtr = _external ? pal : srcPal.palette;
-					int palLength = _external ? _picture->getPaletteSize() : srcPal.length;
-					_ditheredImg = _picture->_surface.convertTo(g_director->_wm->_pixelformat, palPtr, palLength, currentPalette->palette, currentPalette->length, Graphics::kDitherNaive);
-				}
-				break;
-			default:
-				break;
-			}
+		} else if (srcBpp == 1) {
+			_ditheredImg = getDitherImg();
+		}
+	} else {
+		// ScummVM using 32-bit video
+		//if (srcBpp > 1 && srcBpp != 4) {
+			// non-indexed surface, convert to 32-bit
+		//	_ditheredImg = _picture->_surface.convertTo(g_director->_wm->_pixelformat, nullptr, 0, g_director->_wm->getPalette(), g_director->_wm->getPaletteSize());
+
+		//} else
+		if (srcBpp == 1) {
+			_ditheredImg = getDitherImg();
+		}
+	}
 
-			if (_ditheredImg) {
-				debugC(4, kDebugImages, "BitmapCastMember::createWidget(): Dithering image from source palette %s to target palette %s", _clut.asString().c_str(), score->getCurrentPalette().asString().c_str());
-				// Save the palette ID so we can check if a redraw is required
-				_ditheredTargetClut = currentPaletteId;
-
-				if (!_external) {
-					// Finally, the first and last colours in the palette are special. No matter what the palette remap
-					// does, we need to scrub those to be the same.
-					const Graphics::Surface *src = &_picture->_surface;
-					for (int y = 0; y < src->h; y++) {
-						for (int x = 0; x < src->w; x++) {
-							const int test = *(const byte *)src->getBasePtr(x, y);
-							if (test == 0 || test == (1 << _bitsPerPixel) - 1) {
-								*(byte *)_ditheredImg->getBasePtr(x, y) = test == 0 ? 0x00 : 0xff;
-							}
-						}
-					}
-				}
-			} else if (previouslyDithered) {
-				debugC(4, kDebugImages, "BitmapCastMember::createWidget(): Removed dithered image, score palette %s matches cast member", score->getCurrentPalette().asString().c_str());
-			}
+	Movie *movie = g_director->getCurrentMovie();
+	Score *score = movie->getScore();
+
+	if (_ditheredImg) {
+		debugC(4, kDebugImages, "BitmapCastMember::createWidget(): Dithering image from source palette %s to target palette %s", _clut.asString().c_str(), score->getCurrentPalette().asString().c_str());
+	} else if (previouslyDithered) {
+		debugC(4, kDebugImages, "BitmapCastMember::createWidget(): Removed dithered image, score palette %s matches cast member", score->getCurrentPalette().asString().c_str());
 
-		}
 	}
 
 	Graphics::MacWidget *widget = new Graphics::MacWidget(g_director->getCurrentWindow(), bbox.left, bbox.top, bbox.width(), bbox.height(), g_director->_wm, false);
@@ -326,6 +260,98 @@ Graphics::MacWidget *BitmapCastMember::createWidget(Common::Rect &bbox, Channel
 	return widget;
 }
 
+Graphics::Surface *BitmapCastMember::getDitherImg() {
+	Graphics::Surface *dither = nullptr;
+
+	// Convert indexed image to indexed palette
+	Movie *movie = g_director->getCurrentMovie();
+	Cast *cast = movie->getCast();
+	Score *score = movie->getScore();
+	// Get the current score palette. Note that this is the ID of the palette in the list, not the cast member!
+	CastMemberID currentPaletteId = score->getCurrentPalette();
+	if (currentPaletteId.isNull())
+		currentPaletteId = cast->_defaultPalette;
+	PaletteV4 *currentPalette = g_director->getPalette(currentPaletteId);
+	if (!currentPalette) {
+		currentPaletteId = CastMemberID(kClutSystemMac, -1);
+		currentPalette = g_director->getPalette(currentPaletteId);
+	}
+	CastMemberID castPaletteId = _clut;
+	// It is possible for Director to have saved an invalid ID in _clut;
+	// if this is the case, do no dithering.
+	if (castPaletteId.isNull())
+		castPaletteId = currentPaletteId;
+
+	// Check if the palette is in the middle of a color fade event
+	bool isColorCycling = score->isPaletteColorCycling();
+
+	// First, check if the palettes are different
+	switch (_bitsPerPixel) {
+	// 1bpp - this is preconverted to 0x00 and 0xff, change nothing.
+	case 1:
+		break;
+	// 2bpp - convert to nearest using the standard 2-bit palette.
+	case 2:
+		{
+			const PaletteV4 &srcPal = g_director->getLoaded4Palette();
+			dither = _picture->_surface.convertTo(g_director->_wm->_pixelformat, srcPal.palette, srcPal.length, currentPalette->palette, currentPalette->length, Graphics::kDitherNaive);
+		}
+		break;
+	// 4bpp - if using a builtin palette, use one of the corresponding 4-bit ones.
+	case 4:
+		{
+			const auto pals = g_director->getLoaded16Palettes();
+			// in D4 you aren't allowed to use custom palettes for 4-bit images, so uh...
+			// I guess default to the mac palette?
+			CastMemberID palIndex = pals.contains(castPaletteId) ? castPaletteId : CastMemberID(kClutSystemMac, -1);
+			const PaletteV4 &srcPal = pals.getVal(palIndex);
+			dither = _picture->_surface.convertTo(g_director->_wm->_pixelformat, srcPal.palette, srcPal.length, currentPalette->palette, currentPalette->length, Graphics::kDitherNaive);
+		}
+		break;
+	// 8bpp - if using a different palette, and we're not doing a color cycling operation, convert using nearest colour matching
+	case 8:
+		// Only redither 8-bit images if we have the flag set, or it is external
+		if (!movie->_remapPalettesWhenNeeded && !_external)
+			break;
+		if (_external || (castPaletteId != currentPaletteId && !isColorCycling)) {
+			const auto pals = g_director->getLoadedPalettes();
+			CastMemberID palIndex = pals.contains(castPaletteId) ? castPaletteId : CastMemberID(kClutSystemMac, -1);
+			const PaletteV4 &srcPal = pals.getVal(palIndex);
+
+			// If it is an external image, use the included palette.
+			// For BMP images especially, they'll often have the right colors
+			// but in the wrong palette order.
+			const byte *palPtr = _external ? _picture->_palette : srcPal.palette;
+			int palLength = _external ? _picture->getPaletteSize() : srcPal.length;
+			dither = _picture->_surface.convertTo(g_director->_wm->_pixelformat, palPtr, palLength, currentPalette->palette, currentPalette->length, Graphics::kDitherNaive);
+		}
+		break;
+	default:
+		break;
+	}
+
+	if (dither) {
+		// Save the palette ID so we can check if a redraw is required
+		_ditheredTargetClut = currentPaletteId;
+
+		if (!_external) {
+			// Finally, the first and last colours in the palette are special. No matter what the palette remap
+			// does, we need to scrub those to be the same.
+			const Graphics::Surface *src = &_picture->_surface;
+			for (int y = 0; y < src->h; y++) {
+				for (int x = 0; x < src->w; x++) {
+					const int test = *(const byte *)src->getBasePtr(x, y);
+					if (test == 0 || test == (1 << _bitsPerPixel) - 1) {
+						*(byte *)dither->getBasePtr(x, y) = test == 0 ? 0x00 : 0xff;
+					}
+				}
+			}
+		}
+	}
+	return dither;
+
+}
+
 void BitmapCastMember::copyStretchImg(Graphics::Surface *surface, const Common::Rect &bbox, const byte *pal) {
 	const Graphics::Surface *srcSurf;
 
@@ -368,8 +394,12 @@ void BitmapCastMember::copyStretchImg(Graphics::Surface *surface, const Common::
 				}
 			}
 		}
-	} else {
+	} else if (srcSurf->format.bytesPerPixel == g_director->_wm->_pixelformat.bytesPerPixel) {
 		surface->copyFrom(*srcSurf);
+	} else {
+		Graphics::Surface *temp = srcSurf->convertTo(g_director->_wm->_pixelformat, g_director->_wm->getPalette(), g_director->_wm->getPaletteSize(), g_director->_wm->getPalette(), g_director->_wm->getPaletteSize());
+		surface->copyFrom(*temp);
+		delete temp;
 	}
 }
 
diff --git a/engines/director/castmember/bitmap.h b/engines/director/castmember/bitmap.h
index 9da0882bff5..5c10a3ef183 100644
--- a/engines/director/castmember/bitmap.h
+++ b/engines/director/castmember/bitmap.h
@@ -40,6 +40,7 @@ public:
 	bool isModified() override;
 	void createMatte(Common::Rect &bbox);
 	Graphics::Surface *getMatte(Common::Rect &bbox);
+	Graphics::Surface *getDitherImg();
 	void copyStretchImg(Graphics::Surface *surface, const Common::Rect &bbox, const byte *pal = 0);
 
 	bool hasField(int field) override;
diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index 8b7d918972d..2a26755d383 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -633,6 +633,10 @@ void DirectorPlotData::inkBlitSurface(Common::Rect &srcRect, const Graphics::Sur
 	Common::Rect srfClip = srf->getBounds();
 	bool failedBoundsCheck = false;
 
+	// For blit efficiency, surfaces passed here need to be the same
+	// format as the window manager. Most of the time this is
+	// the job of BitmapCastMember::createWidget.
+
 	srcPoint.y = abs(srcRect.top - destRect.top);
 	for (int i = 0; i < destRect.height(); i++, srcPoint.y++) {
 		if (d->_wm->_pixelformat.bytesPerPixel == 1) {
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index a0fc42746ba..01124d08624 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -21,6 +21,7 @@
 
 #include "common/substream.h"
 #include "graphics/macgui/macwindowmanager.h"
+#include "graphics/pixelformat.h"
 #include "image/codecs/bmp_raw.h"
 
 #include "director/director.h"
@@ -128,8 +129,28 @@ BITDDecoder::BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const
 
 		_pitch = minPitch;
 	}
+	byte Bpp = bitsPerPixel >> 3;
+	Graphics::PixelFormat format;
+	switch (Bpp) {
+	case 0:
+	case 1:
+		// 8-bit palette
+		format = Graphics::PixelFormat::createFormatCLUT8();
+		break;
+	case 2:
+		// RGB555
+		format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
+		break;
+	case 4:
+		// RGB888
+		format = Graphics::PixelFormat(4, 8, 8, 8, 0, 16, 8, 0, 0);
+		break;
+	default:
+		warning("BITDDecoder::BITDDecoder(): unsupported bpp %d", bitsPerPixel);
+		break;
+	}
 
-	_surface->create(w, h, g_director->_pixelformat);
+	_surface->create(w, h, format);
 
 	_palette = palette;
 
@@ -155,22 +176,6 @@ void BITDDecoder::loadPalette(Common::SeekableReadStream &stream) {
 	// no op
 }
 
-void BITDDecoder::convertPixelIntoSurface(void* surfacePointer, uint fromBpp, uint toBpp, int red, int green, int blue) {
-	switch (toBpp) {
-	case 1:
-		*((byte*)surfacePointer) = g_director->_wm->findBestColor(red, green, blue);
-		break;
-
-	case 4:
-		*((uint32 *)surfacePointer) = g_director->_wm->findBestColor(red, green, blue);
-		break;
-
-	default:
-		warning("BITDDecoder::convertPixelIntoSurface(): conversion from %d to %d not implemented", fromBpp, toBpp);
-		break;
-	}
-}
-
 bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 	int x = 0, y = 0;
 
@@ -247,7 +252,6 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 		offset = _surface->w % 2;
 
 	uint32 color;
-	bool paletted = (g_director->_pixelformat.bytesPerPixel == 1);
 
 	if (pixels.size() > 0) {
 		for (y = 0; y < _surface->h; y++) {
@@ -256,62 +260,35 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 				case 1:
 					for (int c = 0; c < 8 && x < _surface->w; c++, x++) {
 						color = (pixels[(y * _pitch) + (x >> 3)] & (1 << (7 - c))) ? 0xff : 0x00;
-						if (paletted) {
-							*((byte *)_surface->getBasePtr(x, y)) = color;
-						} else {
-							*((uint32 *)_surface->getBasePtr(x, y)) = color ? g_director->_wm->_colorWhite : g_director->_wm->_colorBlack;
-						}
+						*((byte *)_surface->getBasePtr(x, y)) = color;
 					}
 					break;
 				case 2:
 					for (int c = 0; c < 4 && x < _surface->w; c++, x++) {
 						color = (pixels[(y * _pitch) + (x >> 2)] & (0x3 << (2 * (3 - c)))) >> (2 * (3 - c));
-						if (paletted) {
-							*((byte *)_surface->getBasePtr(x, y)) = color;
-						} else {
-							*((uint32 *)_surface->getBasePtr(x, y)) = g_director->transformColor(color);
-						}
+						*((byte *)_surface->getBasePtr(x, y)) = color;
 					}
 					break;
 				case 4:
 					for (int c = 0; c < 2 && x < _surface->w; c++, x++) {
 						color = (pixels[(y * _pitch) + (x >> 1)] & (0xf << (4 * (1 - c)))) >> (4 * (1 - c));
-						if (paletted) {
-							*((byte *)_surface->getBasePtr(x, y)) = color;
-						} else {
-							*((uint32 *)_surface->getBasePtr(x, y)) = g_director->transformColor(color);
-						}
+						*((byte *)_surface->getBasePtr(x, y)) = color;
 					}
 					break;
 				case 8:
-					// this calculation is wrong.. need a demo with colours.
-					if (paletted) {
-						*((byte *)_surface->getBasePtr(x, y)) = pixels[(y * _surface->w) + x + (y * offset)];
-					} else {
-						// FIXME: this won't work if the palette for the image is not the current screen one
-						*((uint32 *)_surface->getBasePtr(x, y)) = g_director->transformColor(pixels[(y * _surface->w) + x + (y * offset)]);
-					}
+					*((byte *)_surface->getBasePtr(x, y)) = pixels[(y * _surface->w) + x + (y * offset)];
 					x++;
 					break;
 
 				case 16:
 					if (_version < kFileVer400) {
-						convertPixelIntoSurface(_surface->getBasePtr(x, y),
-							(_bitsPerPixel / 8),
-							_surface->format.bytesPerPixel,
-							(pixels[((y * _surface->w) * 2) + x * 2] & 0x7c) << 1,
-							(pixels[((y * _surface->w) * 2) + x * 2] & 0x03) << 6 |
-							(pixels[((y * _surface->w) * 2) + x * 2 + 1] & 0xe0) >> 2,
-							(pixels[((y * _surface->w) * 2) + x * 2 + 1] & 0x1f) << 3);
+						color = (pixels[((y * _surface->w) * 2) + x * 2]) << 8 |
+							(pixels[((y * _surface->w) * 2) + x * 2 + 1]);
 					} else {
-						convertPixelIntoSurface(_surface->getBasePtr(x, y),
-							(_bitsPerPixel / 8),
-							_surface->format.bytesPerPixel,
-							(pixels[((y * _surface->w) * 2) + x] & 0x7c) << 1,
-							(pixels[((y * _surface->w) * 2) + x] & 0x03) << 6 |
-							(pixels[((y * _surface->w) * 2) + (_surface->w) + x] & 0xe0) >> 2,
-							(pixels[((y * _surface->w) * 2) + (_surface->w) + x] & 0x1f) << 3);
+						color =	(pixels[((y * _surface->w) * 2) + x]) << 8 |
+							(pixels[((y * _surface->w) * 2) + (_surface->w) + x]);
 					}
+					*((uint16 *)_surface->getBasePtr(x, y)) = color;
 					x++;
 					break;
 
@@ -319,20 +296,15 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 					// if we have the issue in D3 32bpp images, then the way to fix it should be the same as 16bpp images.
 					// check the code above, there is different behaviour between in D4 and D3. Currently we are only using D4.
 					if (_version < kFileVer400) {
-						convertPixelIntoSurface(_surface->getBasePtr(x, y),
-							(_bitsPerPixel / 8),
-							_surface->format.bytesPerPixel,
-							pixels[(((y * _surface->w * 4)) + (x * 4 + 1))],
-							pixels[(((y * _surface->w * 4)) + (x * 4 + 2))],
-							pixels[(((y * _surface->w * 4)) + (x * 4 + 3))]);
+						color = pixels[(((y * _surface->w * 4)) + (x * 4 + 1))] << 16 |
+							pixels[(((y * _surface->w * 4)) + (x * 4 + 2))] << 8 |
+							pixels[(((y * _surface->w * 4)) + (x * 4 + 3))];
 					} else {
-						convertPixelIntoSurface(_surface->getBasePtr(x, y),
-							(_bitsPerPixel / 8),
-							_surface->format.bytesPerPixel,
-							pixels[(((y * _surface->w * 4)) + (x + _surface->w))],
-							pixels[(((y * _surface->w * 4)) + (x + 2 * _surface->w))],
-							pixels[(((y * _surface->w * 4)) + (x + 3 * _surface->w))]);
+						color = pixels[(((y * _surface->w * 4)) + (x + _surface->w))] << 16 |
+							pixels[(((y * _surface->w * 4)) + (x + 2 * _surface->w))] << 8 |
+							pixels[(((y * _surface->w * 4)) + (x + 3 * _surface->w))];
 					}
+					*((uint32 *)_surface->getBasePtr(x, y)) = color;
 					x++;
 					break;
 
diff --git a/engines/director/images.h b/engines/director/images.h
index d9d7533d8dd..8e815bbaea4 100644
--- a/engines/director/images.h
+++ b/engines/director/images.h
@@ -70,7 +70,6 @@ public:
 	const byte *getPalette() const override { return _palette; }
 	void loadPalette(Common::SeekableReadStream &stream);
 	uint16 getPaletteColorCount() const override { return _paletteColorCount; }
-	void convertPixelIntoSurface(void *surfacePointer, uint fromBpp, uint toBpp, int red, int green, int blue);
 
 private:
 	Graphics::Surface *_surface;




More information about the Scummvm-git-logs mailing list