diff options
author | Nicola Mettifogo | 2007-01-15 20:46:06 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-01-15 20:46:06 +0000 |
commit | a90529c3230ad609b2956aa46027619a7f7239fe (patch) | |
tree | 19cfeaaf5461c8ce6a32bb85e264af8182ba4379 /engines | |
parent | 3545af0275459b1bebd32dc1405fc3d3dd4395be (diff) | |
download | scummvm-rg350-a90529c3230ad609b2956aa46027619a7f7239fe.tar.gz scummvm-rg350-a90529c3230ad609b2956aa46027619a7f7239fe.tar.bz2 scummvm-rg350-a90529c3230ad609b2956aa46027619a7f7239fe.zip |
enforced MemoryReadStream usage instead of custom byte swapping in background loading
svn-id: r25094
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/graphics.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 15237b5c54..33548bbb5e 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -1108,15 +1108,6 @@ void Graphics::freeStaticCnv(StaticCnv *cnv) { // * path data [bit 8] (walkable areas) // -uint16 _swap_16(uint16 *v) { - - uint16 v2 = *v; - uint16 v3 = *v & 0xFF; - *v = (v3 << 8) | ((v2 >> 8) & 0xFF); - - return *v; -} - void unpackBackgroundScanline(byte *src, byte *screen, byte *mask, byte *path) { @@ -1143,7 +1134,9 @@ void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) { byte v150[4]; readArchivedFile(file, _palette, PALETTE_SIZE); readArchivedFile(file, &v150, 4); - readArchivedFile(file, _palettefx, sizeof(PaletteFxRange)*6); + + byte tempfx[sizeof(PaletteFxRange)*6]; + readArchivedFile(file, &tempfx, sizeof(PaletteFxRange)*6); // setPalette(palette); @@ -1153,10 +1146,13 @@ void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) { _bgLayers[_si] = _al; } + Common::MemoryReadStream sread(tempfx, sizeof(PaletteFxRange)*6); for (_si = 0; _si < 6; _si++) { - _swap_16(&_palettefx[_si]._timer); - _swap_16(&_palettefx[_si]._step); - _swap_16(&_palettefx[_si]._flags); + _palettefx[_si]._timer = sread.readUint16BE(); + _palettefx[_si]._step = sread.readUint16BE(); + _palettefx[_si]._flags = sread.readUint16BE(); + _palettefx[_si]._first = sread.readByte(); + _palettefx[_si]._last = sread.readByte(); } #if 0 |