diff options
author | Willem Jan Palenstijn | 2016-08-26 21:50:26 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2016-08-26 22:26:32 +0200 |
commit | cfdbe40a5b163f7106e5bf06f3d23bb24ad6ff4f (patch) | |
tree | 9ec0d1d6ba2e290369518f3ee3d5505b30da967b /engines/director/images.cpp | |
parent | 444fe0e64df11b26ba6d281c00ad365750550079 (diff) | |
download | scummvm-rg350-cfdbe40a5b163f7106e5bf06f3d23bb24ad6ff4f.tar.gz scummvm-rg350-cfdbe40a5b163f7106e5bf06f3d23bb24ad6ff4f.tar.bz2 scummvm-rg350-cfdbe40a5b163f7106e5bf06f3d23bb24ad6ff4f.zip |
DIRECTOR: Clean up BITDDecoder compression check
Diffstat (limited to 'engines/director/images.cpp')
-rw-r--r-- | engines/director/images.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/director/images.cpp b/engines/director/images.cpp index af35224067..cd8223ae8e 100644 --- a/engines/director/images.cpp +++ b/engines/director/images.cpp @@ -104,9 +104,10 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) { * BITD ****************************/ -BITDDecoder::BITDDecoder(int w, int h, bool comp) { +BITDDecoder::BITDDecoder(int w, int h) { _surface = new Graphics::Surface(); + // We make the surface pitch a multiple of 16. int pitch = w; if (w % 16) pitch += 16 - (w % 16); @@ -121,8 +122,6 @@ BITDDecoder::BITDDecoder(int w, int h, bool comp) { _palette[255 * 3 + 0] = _palette[255 * 3 + 1] = _palette[255 * 3 + 2] = 0xff; _paletteColorCount = 2; - - _comp = comp; } BITDDecoder::~BITDDecoder() { @@ -144,7 +143,9 @@ void BITDDecoder::loadPalette(Common::SeekableReadStream &stream) { bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) { int x = 0, y = 0; - if (!_comp) { + // If the stream has exactly the required number of bits for this image, + // we assume it is uncompressed. + if (stream.size() * 8 == _surface->pitch * _surface->h) { debugC(3, kDebugImages, "Skipping compression"); for (y = 0; y < _surface->h; y++) { for (x = 0; x < _surface->pitch; ) { |