[Scummvm-git-logs] scummvm master -> 77cad3b5d642a707de3e6bf5e3394da58cf52ede

digitall 547637+digitall at users.noreply.github.com
Tue Apr 27 03:01:47 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:
77cad3b5d6 DRAGONS: More visual fixes for big-endian systems


Commit: 77cad3b5d642a707de3e6bf5e3394da58cf52ede
    https://github.com/scummvm/scummvm/commit/77cad3b5d642a707de3e6bf5e3394da58cf52ede
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2021-04-27T04:01:44+01:00

Commit Message:
DRAGONS: More visual fixes for big-endian systems

Fix text and shadows so that graphics are now nearly the same between
little-endian and big-endian systems.

See https://bugs.scummvm.org/ticket/11710.

Changed paths:
    engines/dragons/font.cpp
    engines/dragons/screen.cpp
    engines/dragons/screen.h


diff --git a/engines/dragons/font.cpp b/engines/dragons/font.cpp
index 24e8d15b5d..a093ce462b 100644
--- a/engines/dragons/font.cpp
+++ b/engines/dragons/font.cpp
@@ -160,7 +160,7 @@ Font *FontManager::loadFont(uint16 index, Common::SeekableReadStream &stream) {
 void updatePalEntry(uint16 *pal, uint16 index, uint16 newValue) {
 	newValue = (uint16)(((uint16)newValue & 0x1f) << 10) | (uint16)(((uint16)newValue & 0x7c00) >> 10) |
 			(newValue & 0x3e0) | (newValue & 0x8000);
-	WRITE_SCREEN(pal + index, newValue);
+	WRITE_LE_INT16(pal + index, newValue);
 }
 
 void FontManager::updatePalette() {
diff --git a/engines/dragons/screen.cpp b/engines/dragons/screen.cpp
index 368e3e7e8b..31534f0089 100644
--- a/engines/dragons/screen.cpp
+++ b/engines/dragons/screen.cpp
@@ -162,7 +162,7 @@ void Screen::copyRectToSurface(const void *buffer, int srcPitch, int srcWidth, i
 					dst[j * 2] = src[srcIdx * 2];
 					dst[j * 2 + 1] = src[srcIdx * 2 + 1];
 				} else {
-					WRITE_SCREEN(&dst[j * 2], alphaBlendRGB555(READ_LE_INT16(&src[srcIdx * 2]), READ_LE_INT16(&dst[j * 2]), 128));
+					WRITE_SCREEN(&dst[j * 2], alphaBlendRGB555(READ_SCREEN(&src[srcIdx * 2]), READ_SCREEN(&dst[j * 2]), 128));
 					// semi-transparent pixels.
 				}
 			}
@@ -194,8 +194,8 @@ void Screen::copyRectToSurface8bpp(const void *buffer, const byte* palette, int
 				} else {
 					// semi-transparent pixels.
 					WRITE_SCREEN(&dst[j * 2], alpha == NORMAL
-						? alphaBlendRGB555(c & 0x7fff, READ_LE_INT16(&dst[j * 2]) & 0x7fff, 128)
-						: alphaBlendAdditiveRGB555(c & 0x7fff, READ_LE_INT16(&dst[j * 2]) & 0x7fff));
+						? alphaBlendRGB555(c & 0x7fff, READ_SCREEN(&dst[j * 2]) & 0x7fff, 128)
+						: alphaBlendAdditiveRGB555(c & 0x7fff, READ_SCREEN(&dst[j * 2]) & 0x7fff));
 				}
 			}
 		}
@@ -249,7 +249,7 @@ void Screen::drawScaledSprite(Graphics::Surface *destSurface, const byte *source
 						// only copy opaque pixels
 						WRITE_SCREEN(wdst, c & ~0x8000);
 					} else {
-						WRITE_SCREEN(wdst, alphaBlendRGB555(c & 0x7fffu, READ_LE_UINT16(wdst) & 0x7fffu, 128));
+						WRITE_SCREEN(wdst, alphaBlendRGB555(c & 0x7fffu, READ_SCREEN(wdst) & 0x7fffu, 128));
 						// semi-transparent pixels.
 					}
 				}
@@ -432,7 +432,7 @@ void Screen::copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface,
 					// only copy opaque pixels
 					WRITE_SCREEN(&dst[j * 2], c & ~0x8000);
 				} else {
-					WRITE_SCREEN(&dst[j * 2], alpha == NORMAL ? alphaBlendRGB555(c, READ_LE_INT16(&dst[j * 2]), 128) : alphaBlendAdditiveRGB555(c, READ_LE_INT16(&dst[j * 2])));
+					WRITE_SCREEN(&dst[j * 2], alpha == NORMAL ? alphaBlendRGB555(c, READ_SCREEN(&dst[j * 2]), 128) : alphaBlendAdditiveRGB555(c, READ_SCREEN(&dst[j * 2])));
 					// semi-transparent pixels.
 				}
 			}
diff --git a/engines/dragons/screen.h b/engines/dragons/screen.h
index 9e24be0221..97f3cbd54d 100644
--- a/engines/dragons/screen.h
+++ b/engines/dragons/screen.h
@@ -38,8 +38,10 @@ namespace Dragons {
 
 #ifdef SCUMM_BIG_ENDIAN
 	#define WRITE_SCREEN WRITE_BE_UINT16
+	#define READ_SCREEN READ_BE_INT16
 #else
 	#define WRITE_SCREEN WRITE_LE_UINT16
+	#define READ_SCREEN READ_LE_INT16
 #endif
 
 enum AlphaBlendMode {




More information about the Scummvm-git-logs mailing list