From 8ba75fc522f16844524dd4d6f88c3851e2402969 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 30 Sep 2009 16:16:53 +0000 Subject: Fix code formatting (esp. 'if(' -> 'if (' etc., but also indention and other things) svn-id: r44495 --- engines/sword2/maketext.cpp | 4 ++-- engines/sword2/palette.cpp | 2 +- engines/sword2/protocol.cpp | 2 +- engines/sword2/render.cpp | 8 ++++---- engines/sword2/router.cpp | 6 +++--- engines/sword2/sprite.cpp | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'engines/sword2') diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp index 0c29e5719c..35f0924404 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -325,7 +325,7 @@ uint16 FontRenderer::charWidth(byte ch, uint32 fontRes) { frame_head.read(charBuf); - if(Sword2Engine::isPsx()) + if (Sword2Engine::isPsx()) free(charBuf); _vm->_resman->closeResource(fontRes); @@ -353,7 +353,7 @@ uint16 FontRenderer::charHeight(uint32 fontRes) { frame_head.read(charbuf); - if(Sword2Engine::isPsx()) + if (Sword2Engine::isPsx()) free(charbuf); _vm->_resman->closeResource(fontRes); diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index aa569689ff..84ebd142ca 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -50,7 +50,7 @@ void Screen::startNewPalette() { // Don't fetch palette match table while using PSX version, // because it is not present. - if(!Sword2Engine::isPsx()) + if (!Sword2Engine::isPsx()) memcpy(_paletteMatch, _vm->fetchPaletteMatchTable(screenFile), PALTABLESIZE); setPalette(0, 256, _vm->fetchPalette(screenFile), RDPAL_FADE); diff --git a/engines/sword2/protocol.cpp b/engines/sword2/protocol.cpp index dcb5b5f5b0..bb5f68fd5f 100644 --- a/engines/sword2/protocol.cpp +++ b/engines/sword2/protocol.cpp @@ -43,7 +43,7 @@ namespace Sword2 { byte *Sword2Engine::fetchPalette(byte *screenFile) { byte *palette; - if(isPsx()) { // PSX version doesn't have a "MultiScreenHeader", instead there's a ScreenHeader and a tag + if (isPsx()) { // PSX version doesn't have a "MultiScreenHeader", instead there's a ScreenHeader and a tag palette = screenFile + ResHeader::size() + ScreenHeader::size() + 2; } else { MultiScreenHeader mscreenHeader; diff --git a/engines/sword2/render.cpp b/engines/sword2/render.cpp index 7d41ccd207..6123986367 100644 --- a/engines/sword2/render.cpp +++ b/engines/sword2/render.cpp @@ -618,7 +618,7 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { if (!(remLines && posY == _yBlocks[_layer] - 1)) remLines = 32; - for(j = 0; j < remLines; j++) { + for (j = 0; j < remLines; j++) { memcpy(tileChunk + j * BLOCKWIDTH * 2, parallax + stripeOffset + j * BLOCKWIDTH, BLOCKWIDTH); memcpy(tileChunk + j * BLOCKWIDTH * 2 + BLOCKWIDTH, parallax + stripeOffset + j * BLOCKWIDTH, BLOCKWIDTH); } @@ -728,7 +728,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { block_has_data = true; // If one of the two grouped blocks is without data, then we also have transparency - if(!firstTilePresent || !secondTilePresent) + if (!firstTilePresent || !secondTilePresent) block_is_transparent = true; } @@ -737,7 +737,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { byte *block = data; if (firstTilePresent) { for (k = 0; k < 0x400; k++) { - if ( *(block + k) == 0) { + if (*(block + k) == 0) { block_is_transparent = true; break; } @@ -749,7 +749,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { // a second tile, check it if (secondTilePresent && !block_is_transparent) { for (k = 0; k < 0x400; k++) { - if ( *(block + k) == 0) { + if (*(block + k) == 0) { block_is_transparent = true; break; } diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp index 2fc5c9efd5..d8789d00fb 100644 --- a/engines/sword2/router.cpp +++ b/engines/sword2/router.cpp @@ -945,11 +945,11 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // new frames for turn frames 29oct95jps if (turnDir < 0) { - if ( lastDir < 0) + if (lastDir < 0) lastDir += NO_DIRECTIONS; module = _firstStandingTurnLeftFrame + lastDir; } else { - if ( lastDir > 7) + if (lastDir > 7) lastDir -= NO_DIRECTIONS; module = _firstStandingTurnRightFrame + lastDir; } @@ -1208,7 +1208,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } else if (_targetDir != lastRealDir) { // rotate to target direction turnDir = _targetDir - lastRealDir; - if ( turnDir < 0) + if (turnDir < 0) turnDir += NO_DIRECTIONS; if (turnDir > 4) diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index 39abb8efe9..3d40c2b858 100644 --- a/engines/sword2/sprite.cpp +++ b/engines/sword2/sprite.cpp @@ -279,7 +279,7 @@ uint32 Screen::decompressHIF(byte *src, byte *dst, uint32 *skipData) { } int32 repeat_count = (info_word >> 12) + 2; // How many time data needs to be refetched - while(repeat_count >= 0) { + while (repeat_count >= 0) { uint16 refetchData = (info_word & 0xFFF) + 1; if (refetchData > decompSize) return 0; // We have a problem here... uint8 *old_data_src = dst - refetchData; @@ -498,7 +498,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { // Decompression and mirroring // ----------------------------------------------------------------- if (s->type & RDSPR_NOCOMPRESSION) { - if(Sword2Engine::isPsx()) { // PSX Uncompressed sprites + if (Sword2Engine::isPsx()) { // PSX Uncompressed sprites if (s->w > 254 && !s->isText) { // We need to recompose these frames recomposePsxSprite(s); } @@ -528,7 +528,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { decompData = decompressHIF(s->data, tempBuf); // Check that we correctly decompressed data - if(!decompData) + if (!decompData) return RDERR_DECOMPRESSION; s->w = (decompData / (s->h / 2)) * 2; @@ -568,7 +568,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { uint32 decompData = decompressHIF(s->data, tempBuf); // Check that we correctly decompressed data - if(!decompData) + if (!decompData) return RDERR_DECOMPRESSION; s->w = (decompData / (s->h / 2)); -- cgit v1.2.3