mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
GNAP: Fix sprites display on big endian systems
This commit is contained in:
@@ -249,7 +249,11 @@ void GameSys::drawSpriteToBackground(int x, int y, int resourceId) {
|
||||
Graphics::Surface *GameSys::allocSurface(int width, int height) {
|
||||
Graphics::Surface *surface = new Graphics::Surface();
|
||||
surface->create(width, height, _backgroundSurface->format);
|
||||
#if defined(SCUMM_BIG_ENDIAN)
|
||||
surface->fillRect(Common::Rect(0, 0, surface->w, surface->h), 0x00FFFFFF);
|
||||
#else
|
||||
surface->fillRect(Common::Rect(0, 0, surface->w, surface->h), 0xFFFFFF00);
|
||||
#endif
|
||||
return surface;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,10 @@ SpriteResource::SpriteResource(byte *data, uint32 size) {
|
||||
_colorsCount = READ_LE_UINT16(_data + 10);
|
||||
_palette = (uint32 *)(_data + 12);
|
||||
_pixels = _data + 12 + _colorsCount * 4;
|
||||
#if defined(SCUMM_BIG_ENDIAN)
|
||||
for (uint16 c = 0; c < _colorsCount; ++c)
|
||||
_palette[c] = SWAP_BYTES_32(_palette[c]);
|
||||
#endif
|
||||
debugC(kDebugBasic, "SpriteResource() width: %d; height: %d; colorsCount: %d", _width, _height, _colorsCount);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user