diff options
author | Thierry Crozat | 2016-05-30 22:21:49 +0100 |
---|---|---|
committer | Thierry Crozat | 2016-05-30 22:21:49 +0100 |
commit | 39cbfbb03fc9fbef1402738df3ed8f79faadccaf (patch) | |
tree | 7a78f47bc78878ef92be30b70fa039988060cf80 | |
parent | 7b4ab3c42655207e4d7cf2174703c56b22fc27c3 (diff) | |
download | scummvm-rg350-39cbfbb03fc9fbef1402738df3ed8f79faadccaf.tar.gz scummvm-rg350-39cbfbb03fc9fbef1402738df3ed8f79faadccaf.tar.bz2 scummvm-rg350-39cbfbb03fc9fbef1402738df3ed8f79faadccaf.zip |
GNAP: Fix sprites display on big endian systems
-rw-r--r-- | engines/gnap/gamesys.cpp | 4 | ||||
-rw-r--r-- | engines/gnap/resource.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/gnap/gamesys.cpp b/engines/gnap/gamesys.cpp index d1f2c8944f..f56974fda6 100644 --- a/engines/gnap/gamesys.cpp +++ b/engines/gnap/gamesys.cpp @@ -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; } diff --git a/engines/gnap/resource.cpp b/engines/gnap/resource.cpp index 8244213a7f..c6390082b1 100644 --- a/engines/gnap/resource.cpp +++ b/engines/gnap/resource.cpp @@ -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); } |