diff options
author | Eugene Sandulenko | 2017-01-13 08:32:31 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-13 08:32:31 +0100 |
commit | 72c676b0be361b96df2a606d463e8e5f0dfc5a6d (patch) | |
tree | 3f34dc39462c3228cb203b35a78c59dd4498b6fe /engines/director | |
parent | ef295bfd1d133d71b2e368669490421885f0499b (diff) | |
download | scummvm-rg350-72c676b0be361b96df2a606d463e8e5f0dfc5a6d.tar.gz scummvm-rg350-72c676b0be361b96df2a606d463e8e5f0dfc5a6d.tar.bz2 scummvm-rg350-72c676b0be361b96df2a606d463e8e5f0dfc5a6d.zip |
DIRECTOR: Fix compiler warnings
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/images.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/engines/director/images.cpp b/engines/director/images.cpp index 9e9b699b3a..c2a3c4add8 100644 --- a/engines/director/images.cpp +++ b/engines/director/images.cpp @@ -227,7 +227,7 @@ BITDDecoderV4::BITDDecoderV4(int w, int h, uint16 bitsPerPixel) { //pf = Graphics::PixelFormat::PixelFormat(bitsPerPixel / 8, 8, 8, 8, 8, 24, 16, 8, 0); break; } - + // HACK: Create a padded surface by adjusting w after create() _surface->create(pitch, h, pf); @@ -305,29 +305,32 @@ bool BITDDecoderV4::loadStream(Common::SeekableReadStream &stream) { for (x = 0; x < _surface->w;) { switch (_bitsPerPixel) { case 1: { - for (int c = 0; c < 8; c++) - *((byte *)_surface->getBasePtr(x++, y)) = (pixels[(((y * _surface->w) + x) / 8) + y] & (1 << (7 - c))) ? 0 : 0xff; + for (int c = 0; c < 8; c++, x++) + *((byte *)_surface->getBasePtr(x, y)) = (pixels[(((y * _surface->w) + x) / 8) + y] & (1 << (7 - c))) ? 0 : 0xff; break; } case 8: //this calculation is wrong.. need a demo with colours. - *((byte *)_surface->getBasePtr(x++, y)) = 0xff - pixels[(y * _surface->w) + x]; + *((byte *)_surface->getBasePtr(x, y)) = 0xff - pixels[(y * _surface->w) + x]; + x++; break; case 16: - *((uint16*)_surface->getBasePtr(x++, y)) = _surface->format.RGBToColor( + *((uint16*)_surface->getBasePtr(x, y)) = _surface->format.RGBToColor( (pixels[((y * _surface->w) * 2) + x] & 0x7c) << 1, (pixels[((y * _surface->w) * 2) + x] & 0x03) << 6 | (pixels[((y * _surface->w) * 2) + (_surface->w) + x] & 0xe0) >> 2, (pixels[((y * _surface->w) * 2) + (_surface->w) + x] & 0x1f) << 3); + x++; break; case 32: - *((uint32*)_surface->getBasePtr(x++, y)) = _surface->format.RGBToColor( + *((uint32*)_surface->getBasePtr(x, y)) = _surface->format.RGBToColor( pixels[((y * _surface->w) * 3) + x], pixels[(((y * _surface->w) * 3) + (_surface->w)) + x], pixels[(((y * _surface->w) * 3) + (2 * _surface->w)) + x]); + x++; break; default: |