aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2013-09-21 12:10:16 +0200
committeruruk2013-09-21 12:10:16 +0200
commit39b4d8b71c7293f95442560680a6f2a64b62dbd2 (patch)
tree03786c00e513c99dd60e200e8c801a292c3663c8
parentc7f888de7c903a959df29440594888bc9caed4b7 (diff)
downloadscummvm-rg350-39b4d8b71c7293f95442560680a6f2a64b62dbd2.tar.gz
scummvm-rg350-39b4d8b71c7293f95442560680a6f2a64b62dbd2.tar.bz2
scummvm-rg350-39b4d8b71c7293f95442560680a6f2a64b62dbd2.zip
AVALANCHE: Some cleanup and comment modifications.
-rw-r--r--engines/avalanche/acci.cpp20
-rw-r--r--engines/avalanche/animation.cpp61
2 files changed, 20 insertions, 61 deletions
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 3301d474f4..28f05a9ca8 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -444,11 +444,6 @@ Common::String Acci::totalTime() {
}
void Acci::cheatParse(Common::String codes) {
-// uint16 num;
-// int16 e;
-// char cmd;
-// int16 se, sx, sy;
-
warning("STUB: Acci::cheatParse()");
}
@@ -804,12 +799,12 @@ void Acci::examineObject() {
break;
case Gyro::kObjectOnion:
if (_vm->_gyro->_rottenOnion)
- _vm->_scrolls->displayScrollChain('q', 21); // Yucky onion.
+ _vm->_scrolls->displayScrollChain('q', 21); // Yucky onion
else
- _vm->_scrolls->displayScrollChain('t', 18); // Normal onion scroll
+ _vm->_scrolls->displayScrollChain('t', 18); // Normal onion
break;
default:
- _vm->_scrolls->displayScrollChain('t', _thing); // <<< Ordinarily
+ _vm->_scrolls->displayScrollChain('t', _thing); // Ordinarily
}
}
@@ -837,7 +832,7 @@ void Acci::exampers() {
if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
- _vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
+ _vm->_scrolls->displayScrollChain('Q', 65); // He's asleep.
else
_vm->_scrolls->displayScrollChain('p', newPerson);
@@ -891,7 +886,7 @@ void Acci::examine() {
// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
if ((_person == kPardon) && (_thing != kPardon)) {
if (isHolding()) {
- // Remember: it's been Slipped! Ie subtract 49.
+ // Remember: it's been slipped! Ie subtract 49.
if ((1 <= _thing) && (_thing <= 49)) // Standard object
examineObject();
else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
@@ -934,7 +929,7 @@ void Acci::inventory() {
_vm->_scrolls->displayText(tmpStr);
}
-void Acci::swallow() { // Eat something.
+void Acci::swallow() { // Eat something.
switch (_thing) {
case Gyro::kObjectWine:
switch (_vm->_gyro->_wineState) { // 4 is perfect
@@ -1120,8 +1115,6 @@ void Acci::openDoor() {
_vm->_scrolls->displayText("Door? What door?");
}
-
-
void Acci::silly() {
_vm->_scrolls->displayText("Don't be silly!");
}
@@ -1469,6 +1462,7 @@ Common::String Acci::personSpeaks() {
return tmpStr;
}
+
void Acci::heyThanks() {
Common::String tmpStr = personSpeaks();
tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 90966c4cf9..4b129e2047 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -197,11 +197,11 @@ void AnimationType::walk() {
return;
}
- byte tc = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+ byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_gyro->_cp], _y, _info._yLength) - 1;
// -1 is because the modified array indexes of magics[] compared to Pascal .
- if ((tc != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
- MagicType *magic = &_anim->_vm->_gyro->_magics[tc];
+ if ((magicColor != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
+ MagicType *magic = &_anim->_vm->_gyro->_magics[magicColor];
switch (magic->_operation) {
case Gyro::kMagicExclaim:
bounce();
@@ -224,7 +224,7 @@ void AnimationType::walk() {
_anim->callSpecial(magic->_data);
break;
case Gyro::kMagicOpenDoor:
- _anim->openDoor(magic->_data >> 8, magic->_data & 0xff, tc);
+ _anim->openDoor(magic->_data >> 8, magic->_data & 0xff, magicColor);
break;
}
}
@@ -370,8 +370,7 @@ void Animation::loadAnims() {
}
byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
- // if not alive then begin checkfeet:=0; exit; end;
- byte a = 0;
+ byte returnColor = 0;
if (x1 < 0)
x1 = 0;
@@ -380,22 +379,22 @@ byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
if (oy < y) {
for (int16 i = x1; i <= x2; i++) {
for (int16 j = oy + yl; j <= y + yl; j++) {
- byte c = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
- if (c > a)
- a = c;
+ byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+ if (actColor > returnColor)
+ returnColor = actColor;
}
}
} else {
for (int16 i = x1; i <= x2; i++) {
for (int16 j = y + yl; j <= oy + yl; j++) {
- byte c = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
- if (c > a)
- a = c;
+ byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+ if (actColor > returnColor)
+ returnColor = actColor;
}
}
}
- return a;
+ return returnColor;
}
byte Animation::geidaPed(byte which) {
@@ -421,9 +420,6 @@ void Animation::catacombMove(byte ped) {
// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
// catacombs has a different number for it.
-
-
-
xy_uint16 = _vm->_gyro->_catacombX + _vm->_gyro->_catacombY * 256;
_vm->_gyro->_geidaSpin = 0;
@@ -572,8 +568,6 @@ void Animation::catacombMove(byte ped) {
break;
}
- /* ---- */
-
switch ((here & 0xf00) >> 8) { // South
case 0: // No connection.
_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
@@ -993,7 +987,6 @@ void Animation::appearPed(byte sprNum, byte pedNum) {
changeDirection(sprNum, curPed->_direction);
}
-// Eachstep procedures:
void Animation::followAvalotY(byte tripnum) {
if (_sprites[0]._facingDir == kDirLeft)
return;
@@ -1048,17 +1041,7 @@ void Animation::arrowProcs(byte tripnum) {
_sprites[1]._callEachStepFl = false; // prevent recursion.
_vm->_scrolls->displayScrollChain('Q', 47); // Complaint!
_sprites[tripnum].remove(); // Deallocate the arrow.
-#if 0
- tr[1].done; { Deallocate normal pic of Avvy. }
-
- CursorMan.showMouse(false);
- for byte fv:=0 to 1 do
- begin
- cp:=1-cp;
- getback;
- end;
- CursorMan.showMouse(true);
-#endif
+
_vm->_lucerna->gameOver();
_vm->_gyro->_userMovesAvvy = false; // Stop the user from moving him.
@@ -1072,22 +1055,6 @@ void Animation::arrowProcs(byte tripnum) {
}
-#if 0
-procedure Spludwick_procs(tripnum:byte);
-var fv:byte;
-begin
- with tr[tripnum] do
- if not homing then { We only need to do anything if Spludwick *stops*
- walking. }
- with _vm->_gyro->dna do
- begin
- inc(DogfoodPos);
- if DogfoodPos=8 then DogfoodPos:=1;
- walkto(DogfoodPos);
- end;
-end;
-#endif
-
void Animation::grabAvvy(byte tripnum) { // For Friar Tuck, in Nottingham.
int16 tox = _sprites[0]._x + 17;
int16 toy = _sprites[0]._y - 1;
@@ -1203,7 +1170,6 @@ void Animation::drawSprites() {
}
} while (!ok);
-
_vm->_graphics->refreshBackground();
for (int i = 0; i < 5; i++) {
@@ -1437,5 +1403,4 @@ void Animation::handleMoveKey(const Common::Event &event) {
}
}
-
} // End of namespace Avalanche.