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

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Fri Aug 20 14:37:16 UTC 2021


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

Summary:
458713d65a DIRECTOR: fix color channel in BITD decoder.
a77da4dc37 DIRECTOR: fix BITD decoder for different behaviour in D3 and D4
dbdec32b7d DIRECTOR: add comments for BITD decoder.


Commit: 458713d65ab6890047d682e920f203a64f9ece89
    https://github.com/scummvm/scummvm/commit/458713d65ab6890047d682e920f203a64f9ece89
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-20T22:37:03+08:00

Commit Message:
DIRECTOR: fix color channel in BITD decoder.

Changed paths:
    engines/director/images.cpp


diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 9fe125f621..34ad63934a 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -147,16 +147,15 @@ void BITDDecoder::convertPixelIntoSurface(void* surfacePointer, uint fromBpp, ui
 	if (_version < kFileVer400) {
 		switch (toBpp) {
 		case 1:
-			*((byte*)surfacePointer) = g_director->_wm->findBestColor(red, blue, green);
+			*((byte*)surfacePointer) = g_director->_wm->findBestColor(red, green, blue);
 			return;
 
 		case 4:
-			*((uint32 *)surfacePointer) = g_director->_wm->findBestColor(red, blue, green);
+			*((uint32 *)surfacePointer) = g_director->_wm->findBestColor(red, green, blue);
 			return;
 
 		}
 	} else {
-		// it looks like the blue channel and green channel are reversed in D4
 		switch (toBpp) {
 		case 1:
 			*((byte*)surfacePointer) = g_director->_wm->findBestColor(red, green, blue);


Commit: a77da4dc37c2863b539650109a4ef14a0c99215b
    https://github.com/scummvm/scummvm/commit/a77da4dc37c2863b539650109a4ef14a0c99215b
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-20T22:37:03+08:00

Commit Message:
DIRECTOR: fix BITD decoder for different behaviour in D3 and D4

Changed paths:
    engines/director/images.cpp


diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 34ad63934a..611854a84a 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -267,13 +267,23 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 					break;
 
 				case 16:
-					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);
+					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);
+					} 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);
+					}
 					x++;
 					break;
 


Commit: dbdec32b7dbdc7acac080932db91ff0fdb73af09
    https://github.com/scummvm/scummvm/commit/dbdec32b7dbdc7acac080932db91ff0fdb73af09
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-20T22:37:03+08:00

Commit Message:
DIRECTOR: add comments for BITD decoder.

Changed paths:
    engines/director/images.cpp


diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 611854a84a..779016f03c 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -288,6 +288,8 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 					break;
 
 				case 32:
+					// 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.
 					convertPixelIntoSurface(_surface->getBasePtr(x, y),
 						(_bitsPerPixel / 8),
 						_surface->format.bytesPerPixel,




More information about the Scummvm-git-logs mailing list