aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2
diff options
context:
space:
mode:
authorMax Horn2009-09-30 16:16:53 +0000
committerMax Horn2009-09-30 16:16:53 +0000
commit8ba75fc522f16844524dd4d6f88c3851e2402969 (patch)
treedf25c20389e3e706d508f37914dedc73c6479f00 /engines/sword2
parent25dde91c7c6c7da52636e3daa34bd9eee5d9dcb9 (diff)
downloadscummvm-rg350-8ba75fc522f16844524dd4d6f88c3851e2402969.tar.gz
scummvm-rg350-8ba75fc522f16844524dd4d6f88c3851e2402969.tar.bz2
scummvm-rg350-8ba75fc522f16844524dd4d6f88c3851e2402969.zip
Fix code formatting (esp. 'if(' -> 'if (' etc., but also indention and other things)
svn-id: r44495
Diffstat (limited to 'engines/sword2')
-rw-r--r--engines/sword2/maketext.cpp4
-rw-r--r--engines/sword2/palette.cpp2
-rw-r--r--engines/sword2/protocol.cpp2
-rw-r--r--engines/sword2/render.cpp8
-rw-r--r--engines/sword2/router.cpp6
-rw-r--r--engines/sword2/sprite.cpp8
6 files changed, 15 insertions, 15 deletions
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));