aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2012-05-16 20:58:41 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commitc914fdb0b76999c350159e881e53769990cc4149 (patch)
tree27cedeb69e041c10bb153db2719943b340de3eff /engines/lilliput
parent9752da62dfc86edb1d02599754034b5b33bf4465 (diff)
downloadscummvm-rg350-c914fdb0b76999c350159e881e53769990cc4149.tar.gz
scummvm-rg350-c914fdb0b76999c350159e881e53769990cc4149.tar.bz2
scummvm-rg350-c914fdb0b76999c350159e881e53769990cc4149.zip
LILLIPUT: Janitorial: fix some code formatting
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp38
-rw-r--r--engines/lilliput/script.cpp58
2 files changed, 48 insertions, 48 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index e10a6289bb..ceff413a74 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -244,7 +244,7 @@ GUI::Debugger *LilliputEngine::getDebugger() {
void LilliputEngine::update() {
// update every 20 ms.
int currentTime = _system->getMillis();
- if(currentTime - _lastTime > 20) {
+ if (currentTime - _lastTime > 20) {
_lastTime += ((currentTime - _lastTime) / 20) * 20;
newInt8();
pollEvent();
@@ -316,7 +316,7 @@ void LilliputEngine::displayCharacter(int index, Common::Point pos, int flags) {
src += ((index & 0xFF) << 8) + (index >> 8);
- if ( (flags & 2) == 0 ) {
+ if ((flags & 2) == 0) {
for (int y = 0; y < 16; y++) {
for (int x = 0; x < 16; x++) {
if (src[x] != 0)
@@ -617,7 +617,7 @@ void LilliputEngine::displayIsometricBlock(byte *buf, int var1, int var2, int va
debugC(1, kDebugEngine, "displayIsometricBlock(buf, %d, %d, %d)", var1, var2, var3);
byte tmpByte1 = ((7 + (var2 >> 8) - (var2 & 0xFF)) << 4) & 0xFF;
- byte tmpByte2 = ((4 + (var2 >> 8) + (var2 & 0xFF) - (var3 >> 7) ) << 3) & 0xFF;
+ byte tmpByte2 = ((4 + (var2 >> 8) + (var2 & 0xFF) - (var3 >> 7)) << 3) & 0xFF;
int index = (tmpByte2 << 8) + tmpByte1;
int index2 = var1 << 10;
@@ -751,7 +751,7 @@ void LilliputEngine::setNextDisplayCharacter(int var1) {
debugC(2, kDebugEngine, "setNextDisplayCharacter(%d)", var1);
byte charNum = var1 & 0xFF;
- if ( charNum < _numCharactersToDisplay) {
+ if (charNum < _numCharactersToDisplay) {
int index = _charactersToDisplay[charNum];
_nextDisplayCharacterPos = Common::Point(_characterRelativePositionX[index], _characterRelativePositionY[index]);
} else {
@@ -912,21 +912,21 @@ int LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) {
byte byte16DD4 = 0;
byte byte16DD3 = 0;
- if(dx < 0) {
+ if (dx < 0) {
dx = -dx;
word16DCB = -4;
} else {
word16DCB = 4;
}
- if(dy < 0) {
+ if (dy < 0) {
dy = -dy;
word16DCD = -256;
} else {
word16DCD = 256;
}
- if(dy > dx) {
+ if (dy > dx) {
word16DD1 = 0;
word16DCF = word16DCB;
} else {
@@ -945,7 +945,7 @@ int LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) {
int var1 = byte16DD4;
int count = 0;
- while ( *isoMap == 0xFF ) {
+ while (*isoMap == 0xFF) {
if (var1 > 0) {
isoMap += word16DCB;
var1 += byte16DD3;
@@ -1025,7 +1025,7 @@ void LilliputEngine::sub16CA0() {
for (int index2 = _numCharacters - 1; index2 >= 0; index2--) {
_byte16C9F = 0;
- if ((index != index2 ) &&
+ if ((index != index2) &&
(_rulesBuffer2_5[index] != index2) &&
(_rulesBuffer2_5[index2] != index) &&
(_rulesBuffer2_11[index2] & 2) == 0) {
@@ -1041,7 +1041,7 @@ void LilliputEngine::sub16CA0() {
if ((c1 == d1) && (c2 == d2)) {
_byte16C9F = 4;
- } else if((_rulesBuffer2_11[index] & 4) != 0) {
+ } else if ((_rulesBuffer2_11[index] & 4) != 0) {
_byte16C9F = 0;
} else {
if (_characterDirectionArray[index] == 0) {
@@ -1058,7 +1058,7 @@ void LilliputEngine::sub16CA0() {
if (d2 < c2) {
_byte16C9F = 2;
- if(d1 == c1)
+ if (d1 == c1)
_byte16C9F = 3;
if (sub16DD5(c1, d1, c2, d2) != 0)
@@ -1068,7 +1068,7 @@ void LilliputEngine::sub16CA0() {
if (d2 > c2) {
_byte16C9F = 2;
- if(d1 == c1)
+ if (d1 == c1)
_byte16C9F = 3;
if (sub16DD5(c1, d1, c2, d2) != 0)
@@ -1093,7 +1093,7 @@ void LilliputEngine::sub16CA0() {
int val = _scriptHandler->_array10B51[index2 + index * 40];
val = (val & 0xFF) + ((val & 0xFF) << 8);
- if( (val & 0xFF) != _byte16C9F ) {
+ if ((val & 0xFF) != _byte16C9F) {
_scriptHandler->_characterScriptEnabled[index] = 1;
val = (val & 0xFF00) | _byte16C9F;
}
@@ -1455,7 +1455,7 @@ void LilliputEngine::sub167EF(int index) {
(_array10999PosX[index] >= (_rectXMinMax[word167EB] >> 8)) &&
(_array10999PosX[index] <= (_rectXMinMax[word167EB] & 0xFF)) &&
(_array109C1PosY[index] >= (_rectYMinMax[word167EB] >> 8)) &&
- (_array109C1PosY[index] <= (_rectYMinMax[word167EB] & 0xFF)) ) {
+ (_array109C1PosY[index] <= (_rectYMinMax[word167EB] & 0xFF))) {
_array109E9PosX[index] = _rulesBuffer12Pos4[word167ED].x;
_array10A11PosY[index] = _rulesBuffer12Pos4[word167ED].y;
return;
@@ -1845,7 +1845,7 @@ void LilliputEngine::sub12F37() {
for (int i = 0; i < _numCharacters; i++) {
byte *varPtr = getCharacterVariablesPtr(index1);
- if (varPtr[0] != 0 ) {
+ if (varPtr[0] != 0) {
if (varPtr[0] == 1) {
varPtr[0] = 0;
} else {
@@ -2592,7 +2592,7 @@ void LilliputEngine::displayVGAFile(Common::String fileName) {
void LilliputEngine::fixPaletteEntries(uint8 *palette, int num) {
debugC(1, kDebugEngine, "fixPaletteEntries(palette, %d)", num);
- // Color values are coded on 6bits ( for old 6bits DAC )
+ // Color values are coded on 6bits (for old 6bits DAC)
for (int32 i = 0; i < num * 3; i++) {
int32 a = palette[i];
assert(a < 64);
@@ -2700,7 +2700,7 @@ void LilliputEngine::handleGameScripts() {
debugC(1, kDebugEngineTBC, "============= End Game Script %d ==================", i);
}
- while(1);
+ while (1);
*/
i = index;
@@ -2749,7 +2749,7 @@ Common::Error LilliputEngine::run() {
// Hack, see above
_int8installed = true;
- while(!_shouldQuit) {
+ while (!_shouldQuit) {
handleMenu();
handleGameScripts();
// To be removed when handled in the previous fonctions
@@ -2778,7 +2778,7 @@ byte *LilliputEngine::getCharacterVariablesPtr(int16 index) {
debugC(1, kDebugEngineTBC, "getCharacterVariablesPtr(%d)", index);
/* used to debug
- if(index == 96 + 22) {
+ if (index == 96 + 22) {
int a = 0;
}
*/
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index db976000db..588223c750 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -718,23 +718,23 @@ static const OpCode opCodes2[] = {
Common::String LilliputScript::getArgumentString(KValueType type, ScriptStream& script) {
Common::String str;
- if(type == kImmediateValue) {
+ if (type == kImmediateValue) {
str = Common::String::format("0x%x", script.readUint16LE());
} else if (type == kGetValue1) {
int val = script.readUint16LE();
- if(val < 1000) {
+ if (val < 1000) {
str = Common::String::format("0x%x", val);
} else if (val > 1004) {
str = Common::String::format("getValue1(0x%x)", val);
- } else if ( val == 1000 ) {
+ } else if (val == 1000) {
str = Common::String("_byte129A0");
- } else if( val == 1001 ) {
+ } else if (val == 1001) {
str = Common::String("characterIndex");
- } else if( val == 1002 ) {
+ } else if (val == 1002) {
str = Common::String("_word16F00");
- } else if( val == 1003 ) {
+ } else if (val == 1003) {
str = Common::String("_currentCharacterVariables[6]");
- } else if( val == 1004 ) {
+ } else if (val == 1004) {
str = Common::String("_word10804");
}
} else if (type == kgetPosFromScript) {
@@ -787,20 +787,20 @@ Common::String LilliputScript::getArgumentString(KValueType type, ScriptStream&
}
} else if (type == kCompareOperation) {
int comp = script.readUint16LE();
- if(comp != '<' && comp != '>')
+ if (comp != '<' && comp != '>')
comp = '=';
- str = Common::String::format("%c", comp );
+ str = Common::String::format("%c", comp);
}
else if (type == kComputeOperation) {
int comp = script.readUint16LE();
- str = Common::String::format("%c", comp );
+ str = Common::String::format("%c", comp);
}
return str;
}
-void LilliputScript::disasmScript( ScriptStream script) {
+void LilliputScript::disasmScript(ScriptStream script) {
- while(!script.eos()) {
+ while (!script.eos()) {
uint16 val = script.readUint16LE();
if (val == 0xFFF6) // end of script
return;
@@ -887,7 +887,7 @@ void LilliputScript::disasmScript( ScriptStream script) {
if (p != opCode->_numArgs - 1)
str += ", ";
- if ( p < 4 )
+ if (p < 4)
opArgType++;
}
str += ");";
@@ -1415,7 +1415,7 @@ byte LilliputScript::OC_sub1740A() {
int var3 = _currScript->readUint16LE();
int var4 = 8 >> var3;
- if( var2 & var4 ) {
+ if (var2 & var4) {
return 1;
} else {
return 0;
@@ -2491,7 +2491,7 @@ void LilliputScript::OC_sub17C8B() {
int var1 = 2 << 8;
int var4 = _currScript->readUint16LE();
int var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8 ) + _vm->_currentScriptCharacter;
+ var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
sub171AF(var1, var2, var4);
}
@@ -2502,7 +2502,7 @@ void LilliputScript::OC_sub17CA2() {
int var1 = 1 << 8;
int var4 = _currScript->readUint16LE();
int var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8 ) + _vm->_currentScriptCharacter;
+ var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
sub171AF(var1, var2, var4);
}
@@ -2513,7 +2513,7 @@ void LilliputScript::OC_sub17CB9() {
int var4 = _currScript->readUint16LE();
int var1 = getValue1();
int var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8 ) + _vm->_currentScriptCharacter;
+ var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
sub171AF(var1, var2, var4);
}
@@ -2524,7 +2524,7 @@ void LilliputScript::OC_sub17CD1() {
int var1 = 3 << 8;
int var4 = _currScript->readUint16LE();
int var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8 ) + _vm->_currentScriptCharacter;
+ var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
sub171AF(var1, var2, var4);
}
@@ -2811,16 +2811,16 @@ void LilliputScript::OC_sub180C3() {
int x = _viewportPos.x + _byte180B3[var1];
int y = _viewportPos.y + _byte180BB[var1];
- if ( x < 0 )
+ if (x < 0)
x = 0;
- if ( y < 0 )
+ if (y < 0)
y = 0;
- if ( x > 56 )
+ if (x > 56)
x = 56;
- if ( y > 56 )
+ if (y > 56)
y = 56;
_byte12A09 = 1;
@@ -2883,17 +2883,17 @@ void LilliputScript::OC_sub181BB() {
int c = _vm->_currentCharacterVariables[s];
int c2 = 0;
- if ( d == 0x2D ) {
+ if (d == 0x2D) {
c = - 1 - c;
- } else if ( d == 0x3E ) {
+ } else if (d == 0x3E) {
c = c - 0x80;
- if ( c < 0 )
+ if (c < 0)
c = 0;
c = c * 2;
- } else if ( d == 0x3C ) {
+ } else if (d == 0x3C) {
c = -1 - c;
c = c - 0x80;
- if ( c < 0 )
+ if (c < 0)
c = 0;
c = c * 2;
}
@@ -3147,7 +3147,7 @@ void LilliputScript::OC_displayTitleScreen() {
_vm->_mouseButton = 0;
_vm->_byte16F09 = 0;
- while(!_vm->_shouldQuit) {
+ while (!_vm->_shouldQuit) {
_vm->displaySmallAnims();
_vm->update();
if (_vm->_keyboard_nextIndex != _vm->_keyboard_oldIndex) {
@@ -3243,7 +3243,7 @@ void LilliputScript::OC_sub186A1() {
frame -= 0xF0;
}
- _vm->display16x16IndexedBuf(buf, frame, Common::Point(var2, var3) );
+ _vm->display16x16IndexedBuf(buf, frame, Common::Point(var2, var3));
}
void LilliputScript::OC_sub186E5_snd() {