From aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 25 Jan 2010 01:39:44 +0000 Subject: Strip trailing spaces/tabs. svn-id: r47541 --- graphics/conversion.cpp | 2 +- graphics/conversion.h | 6 +-- graphics/cursorman.cpp | 2 +- graphics/cursorman.h | 2 +- graphics/jpeg.cpp | 20 +++++----- graphics/jpeg.h | 4 +- graphics/pixelformat.h | 8 ++-- graphics/scaler.cpp | 2 +- graphics/scaler/thumbnail_intern.cpp | 2 +- graphics/sjis.cpp | 4 +- graphics/video/avi_decoder.cpp | 72 ++++++++++++++++++------------------ graphics/video/avi_decoder.h | 18 ++++----- graphics/video/codecs/codec.h | 2 +- graphics/video/codecs/msvideo1.cpp | 6 +-- graphics/video/codecs/msvideo1.h | 12 +++--- 15 files changed, 81 insertions(+), 81 deletions(-) (limited to 'graphics') diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp index f262a60ef1..1fd10a65dc 100644 --- a/graphics/conversion.cpp +++ b/graphics/conversion.cpp @@ -39,7 +39,7 @@ bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch, // Don't perform unnecessary conversion if (srcFmt == dstFmt) { - if (dst == src) + if (dst == src) return true; if (dstpitch == srcpitch && ((w * dstFmt.bytesPerPixel) == dstpitch)) { memcpy(dst,src,dstpitch * h); diff --git a/graphics/conversion.h b/graphics/conversion.h index 262dcd6f5a..149d7204c6 100644 --- a/graphics/conversion.h +++ b/graphics/conversion.h @@ -68,10 +68,10 @@ inline static void CPYUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) * @return true if conversion completes successfully, * false if there is an error. * - * @note This implementation currently arbitrarily requires that the - * destination's format have at least as high a bytedepth as + * @note This implementation currently arbitrarily requires that the + * destination's format have at least as high a bytedepth as * the source's. - * @note This can convert a rectangle in place, if the source and + * @note This can convert a rectangle in place, if the source and * destination format have the same bytedepth. * */ diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp index f056cf86d4..fe90545280 100644 --- a/graphics/cursorman.cpp +++ b/graphics/cursorman.cpp @@ -230,7 +230,7 @@ CursorManager::Cursor::Cursor(const byte *data, uint w, uint h, int hotspotX, in #ifdef USE_RGB_COLOR if (!format) _format = Graphics::PixelFormat::createFormatCLUT8(); - else + else _format = *format; _size = w * h * _format.bytesPerPixel; _keycolor = keycolor & ((1 << (_format.bytesPerPixel << 3)) - 1); diff --git a/graphics/cursorman.h b/graphics/cursorman.h index 6b84be9f60..c041beb957 100644 --- a/graphics/cursorman.h +++ b/graphics/cursorman.h @@ -67,7 +67,7 @@ public: * @param keycolor the color value for the transparent color. This may not exceed * the maximum color value as defined by format. * @param targetScale the scale for which the cursor is designed - * @param format a pointer to the pixel format which the cursor graphic uses, + * @param format a pointer to the pixel format which the cursor graphic uses, * CLUT8 will be used if this is NULL or not specified. * @note It is ok for the buffer to be a NULL pointer. It is sometimes * useful to push a "dummy" cursor and modify it later. The diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp index 8ff253fda7..1c7ad64646 100644 --- a/graphics/jpeg.cpp +++ b/graphics/jpeg.cpp @@ -137,7 +137,7 @@ bool JPEG::read(Common::SeekableReadStream *str) { ok = false; break; } - + while (marker == 0xFF && !_str->eos()) marker = _str->readByte(); @@ -309,7 +309,7 @@ bool JPEG::readDHT() { cur++; } } - + return true; } @@ -349,7 +349,7 @@ bool JPEG::readSOS() { _scanComp[c] = &_components[i]; } } - + if (!found) { warning("JPEG: Invalid component"); return false; @@ -427,12 +427,12 @@ bool JPEG::readDQT() { debug(5, "JPEG: readDQT"); uint16 size = _str->readUint16BE() - 2; uint32 pos = _str->pos(); - - while ((uint32)_str->pos() < (pos + size)) { + + while ((uint32)_str->pos() < (pos + size)) { // Read the table precision and id uint8 tableId = _str->readByte(); bool highPrecision = (tableId & 0xF0) != 0; - + // Validate the table id tableId &= 0xF; if (tableId > JPEG_MAX_QUANT_TABLES) { @@ -448,7 +448,7 @@ bool JPEG::readDQT() { for (int i = 0; i < 64; i++) _quant[tableId][i] = highPrecision ? _str->readUint16BE() : _str->readByte(); } - + return true; } @@ -471,10 +471,10 @@ float JPEG::idct(int x, int y, int weight, int fx, int fy) { byte vx_in = ((int32)((2 * x) + 1) * fx) % 32; byte vy_in = ((int32)((2 * y) + 1) * fy) % 32; float ret = (float)weight * _cosine_32[vx_in] * _cosine_32[vy_in]; - + if (fx == 0) ret /= _sqrt_2; - + if (fy == 0) ret /= _sqrt_2; @@ -523,7 +523,7 @@ bool JPEG::readDataUnit(uint16 x, uint16 y) { // Divide by 4 is final part of IDCT for (int i = 0; i < 64; i++) { result[i] = result[i] / 4 + 128; - + if (result[i] < 0) result[i] = 0; diff --git a/graphics/jpeg.h b/graphics/jpeg.h index 65c908c164..ae4ed22f04 100644 --- a/graphics/jpeg.h +++ b/graphics/jpeg.h @@ -61,7 +61,7 @@ private: uint8 DCentropyTableSelector; uint8 ACentropyTableSelector; int16 DCpredictor; - + // Result image for this component Surface surface; } *_components; @@ -105,7 +105,7 @@ private: uint8 readBit(); uint8 _bitsData; uint8 _bitsNumber; - + float _sqrt_2; float _cosine_32[32]; // Discrete Cosine Transformation diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index 7b95eabd35..fa45738650 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -51,13 +51,13 @@ struct PixelFormat { byte rShift, gShift, bShift, aShift; /**< Binary left shift of each color component in the pixel value. */ inline PixelFormat() { - bytesPerPixel = - rLoss = gLoss = bLoss = aLoss = + bytesPerPixel = + rLoss = gLoss = bLoss = aLoss = rShift = gShift = bShift = aShift = 0; } - inline PixelFormat(byte BytesPerPixel, - byte RBits, byte GBits, byte BBits, byte ABits, + inline PixelFormat(byte BytesPerPixel, + byte RBits, byte GBits, byte BBits, byte ABits, byte RShift, byte GShift, byte BShift, byte AShift) { bytesPerPixel = BytesPerPixel; rLoss = 8 - RBits, gLoss = 8 - GBits, bLoss = 8 - BBits, aLoss = 8 - ABits; diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp index 9f70c6e076..6ad95d0bc3 100644 --- a/graphics/scaler.cpp +++ b/graphics/scaler.cpp @@ -181,7 +181,7 @@ extern "C" void Normal2xAspectMask(const uint8 *srcPtr, int width, int height, uint32 mask); - + void Normal2xAspect(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp index 9b6d7d1593..54252892b6 100644 --- a/graphics/scaler/thumbnail_intern.cpp +++ b/graphics/scaler/thumbnail_intern.cpp @@ -99,7 +99,7 @@ static bool grabScreen565(Graphics::Surface *surf) { if (!screen) return false; - assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2); + assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2); assert(screen->pixels != 0); byte palette[256 * 4]; diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp index d72523a471..af286346ca 100644 --- a/graphics/sjis.cpp +++ b/graphics/sjis.cpp @@ -282,7 +282,7 @@ bool FontSjisSVM::loadData() { Common::SeekableReadStream *data = SearchMan.createReadStreamForMember("SJIS.FNT"); if (!data) return false; - + uint32 magic1 = data->readUint32BE(); uint32 magic2 = data->readUint32BE(); @@ -314,7 +314,7 @@ bool FontSjisSVM::loadData() { delete data; return retValue; } - + const uint8 *FontSjisSVM::getCharData(uint16 c) const { const uint8 fB = c & 0xFF; const uint8 sB = c >> 8; diff --git a/graphics/video/avi_decoder.cpp b/graphics/video/avi_decoder.cpp index 61cd8553d4..5d310749d9 100644 --- a/graphics/video/avi_decoder.cpp +++ b/graphics/video/avi_decoder.cpp @@ -60,14 +60,14 @@ AviDecoder::~AviDecoder() { closeFile(); delete _audHandle; } - + void AviDecoder::runHandle(uint32 tag) { assert (_fileStream); if (_fileStream->eos()) return; debug (3, "Decoding tag %s", tag2str(tag)); - + switch (tag) { case ID_RIFF: /*_filesize = */_fileStream->readUint32LE(); @@ -118,24 +118,24 @@ void AviDecoder::runHandle(uint32 tag) { error ("Unknown tag \'%s\' found", tag2str(tag)); } } - + void AviDecoder::handleList() { uint32 listSize = _fileStream->readUint32LE() - 4; // Subtract away listType's 4 bytes uint32 listType = _fileStream->readUint32BE(); uint32 curPos = _fileStream->pos(); - + debug (0, "Found LIST of type %s", tag2str(listType)); - + while ((_fileStream->pos() - curPos) < listSize) runHandle(_fileStream->readUint32BE()); - + // We now have all the header data if (listType == ID_HDRL) _decodedHeader = true; } - + void AviDecoder::handleStreamHeader() { - AVIStreamHeader sHeader; + AVIStreamHeader sHeader; sHeader.size = _fileStream->readUint32LE(); sHeader.streamType = _fileStream->readUint32BE(); if (sHeader.streamType == ID_MIDS || sHeader.streamType == ID_TXTS) @@ -156,19 +156,19 @@ void AviDecoder::handleStreamHeader() { sHeader.frame.top = _fileStream->readSint16LE(); sHeader.frame.right = _fileStream->readSint16LE(); sHeader.frame.bottom = _fileStream->readSint16LE(); - + if (_fileStream->readUint32BE() != ID_STRF) error("Could not find STRF tag"); /* uint32 strfSize = */ _fileStream->readUint32LE(); - + if (sHeader.streamType == ID_VIDS) { _vidsHeader = sHeader; - + _bmInfo.size = _fileStream->readUint32LE(); _bmInfo.width = _fileStream->readUint32LE(); assert (_header.width == _bmInfo.width); _bmInfo.height = _fileStream->readUint32LE(); - assert (_header.height == _bmInfo.height); + assert (_header.height == _bmInfo.height); _bmInfo.planes = _fileStream->readUint16LE(); _bmInfo.bitCount = _fileStream->readUint16LE(); _bmInfo.compression = _fileStream->readUint32BE(); @@ -177,23 +177,23 @@ void AviDecoder::handleStreamHeader() { _bmInfo.yPelsPerMeter = _fileStream->readUint32LE(); _bmInfo.clrUsed = _fileStream->readUint32LE(); _bmInfo.clrImportant = _fileStream->readUint32LE(); - + if (_bmInfo.bitCount == 8) { if (_bmInfo.clrUsed == 0) _bmInfo.clrUsed = 256; - + for (uint32 i = 0; i < _bmInfo.clrUsed; i++) { _palette[i * 3 + 2] = _fileStream->readByte(); _palette[i * 3 + 1] = _fileStream->readByte(); _palette[i * 3] = _fileStream->readByte(); /*_palette[i * 4 + 3] = */_fileStream->readByte(); } - + setPalette(_palette); } } else if (sHeader.streamType == ID_AUDS) { _audsHeader = sHeader; - + _wvInfo.tag = _fileStream->readUint16LE(); _wvInfo.channels = _fileStream->readUint16LE(); _wvInfo.samplesPerSec = _fileStream->readUint32LE(); @@ -209,27 +209,27 @@ bool AviDecoder::loadFile(const char *fileName) { _fileStream = SearchMan.createReadStreamForMember(fileName); if (!_fileStream) return false; - + _decodedHeader = false; // Seek to the first frame _videoInfo.currentFrame = 0; - + // Read chunks until we have decoded the header while (!_decodedHeader) runHandle(_fileStream->readUint32BE()); - + _videoFrameBuffer = new byte[_header.width * _header.height]; memset(_videoFrameBuffer, 0, _header.width * _header.height); uint32 nextTag = _fileStream->readUint32BE(); - + // Throw out any JUNK section if (nextTag == ID_JUNK) { runHandle(ID_JUNK); nextTag = _fileStream->readUint32BE(); } - + // Ignore the 'movi' LIST if (nextTag == ID_LIST) { _fileStream->readUint32BE(); // Skip size @@ -237,7 +237,7 @@ bool AviDecoder::loadFile(const char *fileName) { error ("Expected 'movi' LIST"); } else error ("Expected 'movi' LIST"); - + // Now, create the codec _videoCodec = createCodec(); @@ -245,7 +245,7 @@ bool AviDecoder::loadFile(const char *fileName) { _audStream = createAudioStream(); if (_audStream) _mixer->playInputStream(_soundType, _audHandle, _audStream); - + debug (0, "Frames = %d, Dimensions = %d x %d", _header.totalFrames, _header.width, _header.height); debug (0, "Frame Rate = %d", getFrameRate()); if ((_audsHeader.scale != 0) && (_header.flags & AVIF_ISINTERLEAVED)) @@ -308,7 +308,7 @@ Surface *AviDecoder::getNextFrame() { if (_fileStream->readUint32BE() != ID_REC) error ("Expected 'rec ' LIST"); - + // Decode chunks in the list and see if we get a frame Surface *frame = NULL; while (_fileStream->pos() < startPos + (int32)listSize) { @@ -332,14 +332,14 @@ Surface *AviDecoder::getNextFrame() { _audStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, flags); _fileStream->skip(chunkSize & 1); // Alignment - } else if (getStreamType(nextTag) == 'dc' || getStreamType(nextTag) == 'id' || getStreamType(nextTag) == 'AM') { + } else if (getStreamType(nextTag) == 'dc' || getStreamType(nextTag) == 'id' || getStreamType(nextTag) == 'AM') { // Compressed Frame _videoInfo.currentFrame++; uint32 chunkSize = _fileStream->readUint32LE(); if (chunkSize == 0) // Keep last frame on screen return NULL; - + Common::SeekableReadStream *frameData = _fileStream->readStream(chunkSize); Graphics::Surface *surface = _videoCodec->decodeImage(frameData); delete frameData; @@ -351,18 +351,18 @@ Surface *AviDecoder::getNextFrame() { byte firstEntry = _fileStream->readByte(); uint16 numEntries = _fileStream->readByte(); _fileStream->readUint16LE(); // Reserved - + // 0 entries means all colors are going to be changed if (numEntries == 0) numEntries = 256; - + for (uint16 i = firstEntry; i < numEntries + firstEntry; i++) { _palette[i * 3] = _fileStream->readByte(); _palette[i * 3 + 1] = _fileStream->readByte(); _palette[i * 3 + 2] = _fileStream->readByte(); _fileStream->readByte(); // Flags that don't serve us any purpose } - + setPalette(_palette); // No alignment necessary. It's always even. @@ -376,17 +376,17 @@ Surface *AviDecoder::getNextFrame() { return NULL; } -bool AviDecoder::decodeNextFrame() { +bool AviDecoder::decodeNextFrame() { if (_videoInfo.currentFrame == 0) _videoInfo.startTime = g_system->getMillis(); Surface *surface = NULL; - + uint32 curFrame = _videoInfo.currentFrame; while (!surface && _videoInfo.currentFrame < _videoInfo.frameCount && !_fileStream->eos()) surface = getNextFrame(); - + if (curFrame == _videoInfo.currentFrame) { warning("No video frame found"); _videoInfo.currentFrame++; @@ -430,7 +430,7 @@ Codec *AviDecoder::createCodec() { default: warning ("Unknown/Unhandled compression format \'%s\'", tag2str(_vidsHeader.streamHandler)); } - + return NULL; } @@ -439,17 +439,17 @@ Audio::QueuingAudioStream *AviDecoder::createAudioStream() { if (_wvInfo.tag == AVI_WAVE_FORMAT_PCM) { return Audio::makeQueuingAudioStream(AUDIO_RATE, false); } - + if (_wvInfo.tag != 0) // No sound warning ("Unsupported AVI audio format %d", _wvInfo.tag); return NULL; } - + byte AviDecoder::char2num(char c) { return (c >= 48 && c <= 57) ? c - 48 : 0; } - + byte AviDecoder::getStreamNum(uint32 tag) { return char2num((char)(tag >> 24)) * 16 + char2num((char)(tag >> 16)); } diff --git a/graphics/video/avi_decoder.h b/graphics/video/avi_decoder.h index e8d38fefb7..0f0431c70b 100644 --- a/graphics/video/avi_decoder.h +++ b/graphics/video/avi_decoder.h @@ -32,10 +32,10 @@ #include "sound/mixer.h" namespace Graphics { - + #define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a)) #define AUDIO_RATE (_audsHeader.rate / _audsHeader.scale) - + // IDs used throughout the AVI files // that will be handled by this player #define ID_RIFF MKID_BE('RIFF') @@ -107,7 +107,7 @@ struct AVIOLDINDEX { uint32 size; } *indices; }; - + // Index Flags enum IndexFlags { AVIIF_INDEX = 0x10 @@ -143,7 +143,7 @@ struct AVIHeader { uint32 width; uint32 height; }; - + // Flags from the AVIHeader enum AviFlags { AVIF_HASINDEX = 0x00000010, @@ -153,7 +153,7 @@ enum AviFlags { AVIF_WASCAPTUREFILE = 0x00010000, AVIF_WASCOPYRIGHTED = 0x00020000 }; - + struct AVIStreamHeader { uint32 size; uint32 streamType; @@ -202,19 +202,19 @@ private: AVIStreamHeader _vidsHeader; AVIStreamHeader _audsHeader; byte _palette[3 * 256]; - + bool _decodedHeader; - + Codec *_videoCodec; Codec *createCodec(); - + Audio::Mixer::SoundType _soundType; void runHandle(uint32 tag); void handleList(); void handleStreamHeader(); void handlePalChange(); - + Audio::SoundHandle *_audHandle; Audio::QueuingAudioStream *_audStream; Audio::QueuingAudioStream *createAudioStream(); diff --git a/graphics/video/codecs/codec.h b/graphics/video/codecs/codec.h index 2b8fd796dd..124d1bc49d 100644 --- a/graphics/video/codecs/codec.h +++ b/graphics/video/codecs/codec.h @@ -30,7 +30,7 @@ #include "graphics/surface.h" namespace Graphics { - + class Codec { public: Codec() {} diff --git a/graphics/video/codecs/msvideo1.cpp b/graphics/video/codecs/msvideo1.cpp index 3717487c4f..16596926fd 100644 --- a/graphics/video/codecs/msvideo1.cpp +++ b/graphics/video/codecs/msvideo1.cpp @@ -22,9 +22,9 @@ * $Id$ * */ - + // Based off ffmpeg's msvideo.cpp - + #include "graphics/video/codecs/msvideo1.h" namespace Graphics { @@ -34,7 +34,7 @@ namespace Graphics { warning ("MS Video-1: Stream out of bounds (%d >= %d)", stream->pos() + n, stream->size()); \ return; \ } - + MSVideo1Decoder::MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() { _surface = new Graphics::Surface(); _surface->create(width, height, (bitsPerPixel == 8) ? 1 : 2); diff --git a/graphics/video/codecs/msvideo1.h b/graphics/video/codecs/msvideo1.h index 7950ceb1f1..ff6ffc6549 100644 --- a/graphics/video/codecs/msvideo1.h +++ b/graphics/video/codecs/msvideo1.h @@ -22,14 +22,14 @@ * $Id$ * */ - + #ifndef GRAPHICS_MSVIDEO1_H #define GRAPHICS_MSVIDEO1_H - + #include "graphics/video/codecs/codec.h" - + namespace Graphics { - + class MSVideo1Decoder : public Codec { public: MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel); @@ -39,9 +39,9 @@ public: private: byte _bitsPerPixel; - + Surface *_surface; - + void decode8(Common::SeekableReadStream *stream); //void decode16(Common::SeekableReadStream *stream); }; -- cgit v1.2.3