aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-09-05 08:02:25 +0200
committerStrangerke2013-09-05 08:02:25 +0200
commit31bd1369d977e626713baa095359e43b2f1518f7 (patch)
treeebc974b1bbd442fde14cf1c6633ef2e4a4f4210c
parentb690c9ad31730d63cc121e38d3496c2a5f0c34d4 (diff)
downloadscummvm-rg350-31bd1369d977e626713baa095359e43b2f1518f7.tar.gz
scummvm-rg350-31bd1369d977e626713baa095359e43b2f1518f7.tar.bz2
scummvm-rg350-31bd1369d977e626713baa095359e43b2f1518f7.zip
AVALANCHE: Add some brackets to improve readability
-rw-r--r--engines/avalanche/acci2.cpp7
-rw-r--r--engines/avalanche/scrolls2.cpp85
-rw-r--r--engines/avalanche/trip6.cpp14
3 files changed, 56 insertions, 50 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 386ce221d7..9bf400fe2c 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -517,10 +517,9 @@ void Acci::parse() {
if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1)
_unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
- else {
- if (!_unknown.empty())
- _unknown.clear();
- }
+ else if (!_unknown.empty())
+ _unknown.clear();
+
// Replace words' codes that mean the same.
replace(Common::String('\xFF'), 0); // zap noise words
replace(Common::String('\xD') + '\xE2', 1); // "look at" = "examine"
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 5a893a6b37..0d578c727e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -145,40 +145,42 @@ void Scrolls::normscroll() {
-// char r;
-// bool oktoexit;
-// do {
-// do {
-// _vm->_gyro->check(); // was "checkclick;"
-//
+#if 0
+ char r;
+ bool oktoexit;
+ do {
+ do {
+ _vm->_gyro->check(); // was "checkclick;"
+
//#ifdef RECORD slowdown(); basher::count += 1; #endif
-//
-// if (_vm->_gyro->demo) {
-// if (_vm->_basher->demo_ready())
-// break;
-// if (_vm->_enhanced->keypressede())
-// return;
-// } else if (_vm->_enhanced->keypressede())
-// break;
-// } while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
-//
-//
-// if (mrelease == 0) {
-// inkey();
-// if (aboutscroll) {
-// move(e[2 - 1], e[1 - 1], 7);
-// e[8 - 1] = inchar;
-// if (egg == e) easteregg();
-// }
-// oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
-// if (! oktoexit) errorled();
-// }
-//
-// } while (!((oktoexit) || (mrelease > 0)));
-//
+
+ if (_vm->_gyro->demo) {
+ if (_vm->_basher->demo_ready())
+ break;
+ if (_vm->_enhanced->keypressede())
+ return;
+ } else if (_vm->_enhanced->keypressede())
+ break;
+ } while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
+
+
+ if (mrelease == 0) {
+ inkey();
+ if (aboutscroll) {
+ move(e[2 - 1], e[1 - 1], 7);
+ e[8 - 1] = inchar;
+ if (egg == e) easteregg();
+ }
+ oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
+ if (! oktoexit) errorled();
+ }
+
+ } while (!((oktoexit) || (mrelease > 0)));
+
//#ifdef RECORD record_one(); #endif
-//
-// _vm->_gyro->screturn = r == '#'; // "back door"
+
+ _vm->_gyro->screturn = r == '#'; // "back door"
+#endif
state(0);
_vm->_gyro->seescroll = false;
@@ -647,18 +649,17 @@ void Scrolls::calldrivers() {
uint16 size = _vm->_gyro->bufsize;
- for (fv = 0; fv < size; fv++)
+ for (fv = 0; fv < size; fv++) {
if (mouthnext) {
if (_vm->_gyro->buffer[fv] == kControlRegister)
param = 0;
- else
- if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
- param = _vm->_gyro->buffer[fv] - 48;
- else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
- param = _vm->_gyro->buffer[fv] - 55;
+ else if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
+ param = _vm->_gyro->buffer[fv] - 48;
+ else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
+ param = _vm->_gyro->buffer[fv] - 55;
mouthnext = false;
- } else
+ } else {
switch (_vm->_gyro->buffer[fv]) {
case kControlParagraph: {
if ((_vm->_gyro->scrolln == 1) && (_vm->_gyro->scroll[0].empty()))
@@ -689,13 +690,13 @@ void Scrolls::calldrivers() {
if (param == 0)
natural();
- else if ((1 <= param) && (param <= 9))
+ else if ((1 <= param) && (param <= 9)) {
if ((param > _vm->_trip->numtr) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
_vm->_lucerna->errorled();
natural();
} else
_vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine.
- else if ((10 <= param) && (param <= 36)) {
+ } else if ((10 <= param) && (param <= 36)) {
// Quasi-peds. (This routine performs the same
// thing with QPs as triptype.chatter does with the
// sprites.)
@@ -802,6 +803,8 @@ void Scrolls::calldrivers() {
_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] += _vm->_gyro->buffer[fv];
}
}
+ }
+ }
}
void Scrolls::display(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index ed8cd13324..0c320dd186 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -480,20 +480,23 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
x1 = 0;
if (x2 > 639)
x2 = 639;
- if (oy < y)
- for (fv = x1; fv <= x2; fv++)
+ if (oy < y) {
+ for (fv = x1; fv <= x2; fv++) {
for (ff = oy + yl; ff <= y + yl; ff++) {
c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
if (c > a)
a = c;
}
- else
- for (fv = x1; fv <= x2; fv++)
+ }
+ } else {
+ for (fv = x1; fv <= x2; fv++) {
for (ff = y + yl; ff <= oy + yl; ff++) {
c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
if (c > a)
a = c;
}
+ }
+ }
//setactivepage(1 - cp);
return a;
@@ -1581,7 +1584,7 @@ void Trip::handleMoveKey(const Common::Event &event) {
if (_vm->_dropdown->_activeMenuItem._activeNow)
_vm->_parser->tryDropdown();
- else
+ else {
switch (event.kbd.keycode) {
case Common::KEYCODE_UP:
if (_vm->_gyro->dna.rw != up) {
@@ -1645,6 +1648,7 @@ void Trip::handleMoveKey(const Common::Event &event) {
default:
break;
}
+ }
}