Skip to content

Commit

Permalink
GRAPHICS: Small formatting fixes in iff.cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Jul 25, 2012
1 parent 31f9e96 commit 50a93c2
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions graphics/iff.cpp
Expand Up @@ -68,7 +68,7 @@ void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stre
Graphics::PackBitsReadStream packStream(*stream);

// setup a buffer to hold enough data to build a line in the output
uint32 scanlineWidth = ((_header.width + 15)/16) << 1;
uint32 scanlineWidth = ((_header.width + 15) / 16) << 1;
byte *scanline = new byte[scanlineWidth * _header.depth];

for (uint i = 0; i < _header.height; ++i) {
Expand All @@ -82,7 +82,7 @@ void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stre
out += outPitch;
}

delete []scanline;
delete[] scanline;
break;
}

Expand Down Expand Up @@ -121,15 +121,12 @@ void ILBMDecoder::planarToChunky(byte *out, uint32 outPitch, byte *in, uint32 in
// then output the pixel according to the requested packing
if (!packPlanes) {
out[x] = pix;
} else
if (nPlanes == 1) {
out[x/8] |= (pix << (x & 7));
} else
if (nPlanes == 2) {
out[x/4] |= (pix << ((x & 3) << 1));
} else
if (nPlanes == 4) {
out[x/2] |= (pix << ((x & 1) << 2));
} else if (nPlanes == 1) {
out[x / 8] |= (pix << (x & 7));
} else if (nPlanes == 2) {
out[x / 4] |= (pix << ((x & 3) << 1));
} else if (nPlanes == 4) {
out[x / 2] |= (pix << ((x & 1) << 2));
}
}

Expand Down Expand Up @@ -187,7 +184,7 @@ struct PBMLoader {
_surface = &surface;
_colors = colors;
Common::IFFParser parser(&input);
Common::Functor1Mem< Common::IFFChunk&, bool, PBMLoader > c(this, &PBMLoader::callback);
Common::Functor1Mem<Common::IFFChunk &, bool, PBMLoader> c(this, &PBMLoader::callback);
parser.parse(c);
}

Expand Down Expand Up @@ -251,7 +248,7 @@ uint32 PackBitsReadStream::read(void *dataPtr, uint32 dataSize) {
for (uint32 j = 0; j < lenW; j++) {
*out++ = _input->readByte();
}
for ( ; lenR > lenW; lenR--) {
for (; lenR > lenW; lenR--) {
_input->readByte();
}
} else { // len > 128
Expand Down

0 comments on commit 50a93c2

Please sign in to comment.