aboutsummaryrefslogtreecommitdiff
path: root/engines/director/dib.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-06-16 15:31:46 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commit7607ba926ce5d31bb877e8f4ca6fdceac7f492a4 (patch)
treea95edbeaf19ed5612933c3d3bb03f3a83d7bbd6f /engines/director/dib.cpp
parent4b56951d3038836c32d8a1a0db3da856a720f1fc (diff)
downloadscummvm-rg350-7607ba926ce5d31bb877e8f4ca6fdceac7f492a4.tar.gz
scummvm-rg350-7607ba926ce5d31bb877e8f4ca6fdceac7f492a4.tar.bz2
scummvm-rg350-7607ba926ce5d31bb877e8f4ca6fdceac7f492a4.zip
DIRECTOR: Whitespace fixes
Diffstat (limited to 'engines/director/dib.cpp')
-rw-r--r--engines/director/dib.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/director/dib.cpp b/engines/director/dib.cpp
index 912f083569..8c54ba5363 100644
--- a/engines/director/dib.cpp
+++ b/engines/director/dib.cpp
@@ -59,10 +59,11 @@ void DIBDecoder::destroy() {
}
void DIBDecoder::loadPalette(Common::SeekableReadStream &stream) {
- uint16 steps = stream.size()/6;
+ uint16 steps = stream.size() / 6;
uint16 index = (steps * 3) - 1;
_paletteColorCount = steps;
_palette = new byte[index];
+
for (uint8 i = 0; i < steps; i++) {
_palette[index - 2] = stream.readByte();
stream.readByte();
@@ -98,9 +99,12 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) {
Common::SeekableSubReadStream subStream(&stream, 40, stream.size());
_codec = Image::createBitmapCodec(compression, width, height, bitsPerPixel);
+
if (!_codec)
return false;
+
_surface = _codec->decodeFrame(subStream);
+
return true;
}