diff --git a/engines/dragons/actorresource.cpp b/engines/dragons/actorresource.cpp
index aac5875d26..9faedd6b6a 100644
a
|
b
|
bool ActorResource::load(uint32 id, byte *dataStart, Common::SeekableReadStream
|
67 | 67 | // } |
68 | 68 | // } |
69 | 69 | |
| 70 | #ifdef SCUMM_BIG_ENDIAN |
| 71 | for (int i = 2; i < 0x100; i++) { |
| 72 | uint c = READ_LE_INT16(&_palette[i * 2]); |
| 73 | WRITE_BE_UINT16(&_palette[i * 2], c); |
| 74 | } |
| 75 | #endif |
| 76 | |
70 | 77 | stream.seek(frameOffset); |
71 | 78 | |
72 | 79 | _framesCount = (paletteOffset - stream.readUint16LE()) / 0xe; |
diff --git a/engines/dragons/background.cpp b/engines/dragons/background.cpp
index d1a4b12eab..bbeb9bd75d 100644
a
|
b
|
bool Background::load(byte *dataStart, uint32 size) {
|
120 | 120 | _palette[0] = 0x00; //FIXME update palette |
121 | 121 | _palette[1] = 0x00; |
122 | 122 | |
| 123 | #ifdef SCUMM_BIG_ENDIAN |
| 124 | for (int i = 2; i < 0x100; i++) { |
| 125 | uint c = READ_LE_INT16(&_palette[i * 2]); |
| 126 | WRITE_BE_UINT16(&_palette[i * 2], c); |
| 127 | } |
| 128 | #endif |
| 129 | |
123 | 130 | _scaleLayer.load(stream); // 0x200 |
124 | 131 | _points2 = loadPoints(stream); // 0x280 |
125 | 132 | stream.seek(0x305); |
diff --git a/engines/dragons/bag.cpp b/engines/dragons/bag.cpp
index 73d625647f..5229990b7a 100644
a
|
b
|
void Bag::load(BigfileArchive *bigFileArchive) {
|
71 | 71 | } else { |
72 | 72 | //c = (uint16)(((uint)c & 0x1f) << 10) | (uint16)(((uint)c & 0x7c00) >> 10) | c & 0x3e0; |
73 | 73 | } |
| 74 | #ifdef SCUMM_BIG_ENDIAN |
| 75 | WRITE_BE_UINT16(&pal[i * 2], c); |
| 76 | #else |
74 | 77 | WRITE_LE_UINT16(&pal[i * 2], c); |
| 78 | #endif |
75 | 79 | } |
76 | 80 | |
77 | 81 | stream.seek(0x308); |
diff --git a/engines/dragons/cutscene.cpp b/engines/dragons/cutscene.cpp
index e7bc00bb6a..58be9df4bb 100644
a
|
b
|
void CutScene::loadPalettes() {
|
720 | 720 | |
721 | 721 | _palettes = (byte *)malloc(256 * 2 * 4); |
722 | 722 | fd.read(_palettes, 256 * 2 * 4); |
| 723 | |
| 724 | #ifdef SCUMM_BIG_ENDIAN |
| 725 | for (int paletteNum = 0; paletteNum < 4; paletteNum++) { |
| 726 | for (int i = 0; i < 0x100; i++) { |
| 727 | uint c = READ_LE_INT16(&_palettes[paletteNum + i * 2]); |
| 728 | WRITE_BE_UINT16(&_palettes[paletteNum + i * 2], c); |
| 729 | } |
| 730 | } |
| 731 | #endif |
723 | 732 | } |
724 | 733 | |
725 | 734 | void CutScene::flameReturnsCutScene() { |
diff --git a/engines/dragons/font.cpp b/engines/dragons/font.cpp
index a093ce462b..c656dc47c2 100644
a
|
b
|
Font *FontManager::loadFont(uint16 index, Common::SeekableReadStream &stream) {
|
160 | 160 | void updatePalEntry(uint16 *pal, uint16 index, uint16 newValue) { |
161 | 161 | newValue = (uint16)(((uint16)newValue & 0x1f) << 10) | (uint16)(((uint16)newValue & 0x7c00) >> 10) | |
162 | 162 | (newValue & 0x3e0) | (newValue & 0x8000); |
163 | | WRITE_LE_INT16(pal + index, newValue); |
| 163 | pal[index] = newValue; // XXX: really? |
164 | 164 | } |
165 | 165 | |
166 | 166 | void FontManager::updatePalette() { |
diff --git a/engines/dragons/screen.cpp b/engines/dragons/screen.cpp
index cca0a97ff5..f503bc6ec4 100644
a
|
b
|
void Screen::copyRectToSurface(const void *buffer, int srcPitch, int srcWidth, i
|
157 | 157 | for (int j = 0; j < width; j++) { |
158 | 158 | int32 srcIdx = flipX ? srcWidth - (srcXOffset * 2) - j - 1 : j; |
159 | 159 | if (src[srcIdx * 2] != 0 || src[srcIdx * 2 + 1] != 0) { |
160 | | if ((src[srcIdx * 2 + 1] & 0x80) == 0 || alpha == NONE) { |
| 160 | if (1 || (src[srcIdx * 2 + 1] & 0x80) == 0 || alpha == NONE) { |
161 | 161 | // only copy opaque pixels |
162 | 162 | dst[j * 2] = src[srcIdx * 2]; |
163 | 163 | dst[j * 2 + 1] = src[srcIdx * 2 + 1]; |
… |
… |
void Screen::copyRectToSurface8bpp(const void *buffer, const byte* palette, int
|
188 | 188 | int32 srcIdx = flipX ? srcWidth - (srcXOffset * 2) - j - 1 : j; |
189 | 189 | uint16 c = READ_LE_UINT16(&palette[src[srcIdx] * 2]); |
190 | 190 | if (c != 0) { |
191 | | if (!(c & 0x8000) || alpha == NONE) { |
| 191 | if (1 || !(c & 0x8000) || alpha == NONE) { |
192 | 192 | // only copy opaque pixels |
193 | 193 | WRITE_LE_UINT16(&dst[j * 2], c & ~0x8000); |
194 | 194 | } else { |
… |
… |
void Screen::drawScaledSprite(Graphics::Surface *destSurface, const byte *source
|
245 | 245 | byte colorIndex = *wsrc; |
246 | 246 | uint16 c = READ_LE_UINT16(&palette[colorIndex * 2]); |
247 | 247 | if (c != 0) { |
248 | | if (!(c & 0x8000u) || alpha == NONE) { |
| 248 | if (1 || !(c & 0x8000u) || alpha == NONE) { |
249 | 249 | // only copy opaque pixels |
250 | 250 | WRITE_LE_UINT16(wdst, c & ~0x8000); |
251 | 251 | } else { |