[Scummvm-git-logs] scummvm master -> ca0e7c4a7928d0e83c9de0d8c5741ee6bf94b4e8
ysj1173886760
42030331+ysj1173886760 at users.noreply.github.com
Fri Aug 13 13:05:40 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ca0e7c4a79 DIRECTOR: fix BITD decoder.
Commit: ca0e7c4a7928d0e83c9de0d8c5741ee6bf94b4e8
https://github.com/scummvm/scummvm/commit/ca0e7c4a7928d0e83c9de0d8c5741ee6bf94b4e8
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-13T21:05:28+08:00
Commit Message:
DIRECTOR: fix BITD decoder.
Changed paths:
engines/director/images.cpp
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index b299fb066c..771d1568ed 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -149,20 +149,11 @@ void BITDDecoder::convertPixelIntoSurface(void* surfacePointer, uint fromBpp, ui
case 4:
switch (toBpp) {
case 1:
- // maybe this parts should also calculated by wm->findBestColor
- if (red == 255 && blue == 255 && green == 255) {
- *((byte*)surfacePointer) = 255;
- } else if (red == 0 && blue == 0 && green == 0) {
- *((byte*)surfacePointer) = 0;
- } else {
- for (byte p = 0; p < _paletteColorCount; p++) {
- if (_palette[p * 3 + 0] == red &&
- _palette[p * 3 + 1] == green &&
- _palette[p * 3 + 2] == blue) {
- *((byte*)surfacePointer) = p;
- }
- }
- }
+ *((byte*)surfacePointer) = g_director->_wm->findBestColor(red, blue, green);
+ break;
+
+ case 4:
+ *((uint32 *)surfacePointer) = g_director->_wm->findBestColor(red, blue, green);
break;
default:
@@ -177,6 +168,10 @@ void BITDDecoder::convertPixelIntoSurface(void* surfacePointer, uint fromBpp, ui
*((byte*)surfacePointer) = g_director->_wm->findBestColor(red, blue, green);
break;
+ case 4:
+ *((uint32 *)surfacePointer) = g_director->_wm->findBestColor(red, blue, green);
+ break;
+
default:
warning("BITDDecoder::convertPixelIntoSurface(): conversion from %d to %d not implemented",
fromBpp, toBpp);
More information about the Scummvm-git-logs
mailing list