From 89abab97e3124fa25eb4c7d3e8b38501747a8d17 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 26 Sep 2012 04:17:31 +0200 Subject: JANITORIAL: Remove trailing whitespaces. Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//' --- graphics/decoders/bmp.cpp | 6 +++--- graphics/decoders/jpeg.cpp | 2 +- graphics/decoders/pcx.cpp | 34 +++++++++++++++++----------------- graphics/decoders/pcx.h | 2 +- graphics/decoders/pict.cpp | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) (limited to 'graphics/decoders') diff --git a/graphics/decoders/bmp.cpp b/graphics/decoders/bmp.cpp index 0d2165643d..bcfd0abbda 100644 --- a/graphics/decoders/bmp.cpp +++ b/graphics/decoders/bmp.cpp @@ -155,7 +155,7 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) { } } else { // 32 bpp byte *dst = (byte *)_surface->pixels + (height - 1) * _surface->pitch; - + for (int32 i = 0; i < height; i++) { for (uint32 j = 0; j < width; j++) { byte b = stream.readByte(); @@ -166,11 +166,11 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) { // ref: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183376%28v=vs.85%29.aspx stream.readByte(); uint32 color = format.RGBToColor(r, g, b); - + *((uint32 *)dst) = color; dst += format.bytesPerPixel; } - + stream.skip(extraDataLength); dst -= _surface->pitch * 2; } diff --git a/graphics/decoders/jpeg.cpp b/graphics/decoders/jpeg.cpp index 748275b84b..08bc1f7a3d 100644 --- a/graphics/decoders/jpeg.cpp +++ b/graphics/decoders/jpeg.cpp @@ -452,7 +452,7 @@ bool JPEGDecoder::readSOS() { _bitsNumber = 0; for (byte i = 0; i < _numScanComp; i++) - _scanComp[i]->DCpredictor = 0; + _scanComp[i]->DCpredictor = 0; } } } diff --git a/graphics/decoders/pcx.cpp b/graphics/decoders/pcx.cpp index f5c1c24bb0..1250398c73 100644 --- a/graphics/decoders/pcx.cpp +++ b/graphics/decoders/pcx.cpp @@ -59,33 +59,33 @@ void PCXDecoder::destroy() { bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) { destroy(); - + if (stream.readByte() != 0x0a) // ZSoft PCX return false; - + byte version = stream.readByte(); // 0 - 5 if (version > 5) return false; - + bool compressed = stream.readByte(); // encoding, 1 = run length encoding byte bitsPerPixel = stream.readByte(); // 1, 2, 4 or 8 - + // Window uint16 xMin = stream.readUint16LE(); uint16 yMin = stream.readUint16LE(); uint16 xMax = stream.readUint16LE(); uint16 yMax = stream.readUint16LE(); - + uint16 width = xMax - xMin + 1; uint16 height = yMax - yMin + 1; - + if (xMax < xMin || yMax < yMin) { warning("Invalid PCX image dimensions"); return false; } - + stream.skip(4); // HDpi, VDpi - + // Read the EGA palette (colormap) _palette = new byte[16 * 3]; for (uint16 i = 0; i < 16; i++) { @@ -96,24 +96,24 @@ bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) { if (stream.readByte() != 0) // reserved, should be set to 0 return false; - + byte nPlanes = stream.readByte(); uint16 bytesPerLine = stream.readUint16LE(); uint16 bytesPerscanLine = nPlanes * bytesPerLine; - + if (bytesPerscanLine < width * bitsPerPixel * nPlanes / 8) { warning("PCX data is corrupted"); return false; } - + stream.skip(60); // PaletteInfo, HscreenSize, VscreenSize, Filler - + _surface = new Graphics::Surface(); - + byte *scanLine = new byte[bytesPerscanLine]; byte *dst; int x, y; - + if (nPlanes == 3 && bitsPerPixel == 8) { // 24bpp Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); _surface->create(width, height, format); @@ -142,14 +142,14 @@ bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) { decodeRLE(stream, scanLine, bytesPerscanLine, compressed); memcpy(dst, scanLine, width); } - + if (version == 5) { if (stream.readByte() != 12) { warning("Expected a palette after the PCX image data"); delete[] scanLine; return false; } - + // Read the VGA palette delete[] _palette; _palette = new byte[256 * 3]; @@ -186,7 +186,7 @@ bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) { } delete[] scanLine; - + return true; } diff --git a/graphics/decoders/pcx.h b/graphics/decoders/pcx.h index bcff754a2d..b25166b3d9 100644 --- a/graphics/decoders/pcx.h +++ b/graphics/decoders/pcx.h @@ -57,7 +57,7 @@ public: private: void decodeRLE(Common::SeekableReadStream &stream, byte *dst, uint32 bytesPerScanline, bool compressed); - + Surface *_surface; byte *_palette; uint16 _paletteColorCount; diff --git a/graphics/decoders/pict.cpp b/graphics/decoders/pict.cpp index 9e619df208..d35e5c3064 100644 --- a/graphics/decoders/pict.cpp +++ b/graphics/decoders/pict.cpp @@ -543,7 +543,7 @@ void PICTDecoder::decodeCompressedQuickTime(Common::SeekableReadStream &stream) // Skip the matte and mask stream.skip(matteSize + maskSize); - + // Now we've reached the image descriptor, so read the relevant data from that uint32 idStart = stream.pos(); uint32 idSize = stream.readUint32BE(); -- cgit v1.2.3