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.
This commit is contained in:
Donovan Watteau 2021-04-25 11:37:03 +02:00 committed by David Turner
parent 8b816cf0ea
commit 77cad3b5d6
3 changed files with 8 additions and 6 deletions

View File

@ -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() {

View File

@ -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.
}
}

View File

@ -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 {