aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/animation.cpp
diff options
context:
space:
mode:
authoruruk2013-09-08 10:49:01 +0200
committeruruk2013-09-08 10:49:01 +0200
commitdb6fcd5e9b61af93e89d4147d9b75ac5bae3cdf9 (patch)
tree46135920fd9f776ad8828741c1129e240756a7f5 /engines/avalanche/animation.cpp
parent8a4a5b3c56d86e846617f03703a8003dba2936ef (diff)
parentf783f2c28a13e9513ec6a0fc0fccac22d3502d2d (diff)
downloadscummvm-rg350-db6fcd5e9b61af93e89d4147d9b75ac5bae3cdf9.tar.gz
scummvm-rg350-db6fcd5e9b61af93e89d4147d9b75ac5bae3cdf9.tar.bz2
scummvm-rg350-db6fcd5e9b61af93e89d4147d9b75ac5bae3cdf9.zip
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
Diffstat (limited to 'engines/avalanche/animation.cpp')
-rw-r--r--engines/avalanche/animation.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 7fbcf892c1..68f59deef5 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -184,11 +184,8 @@ bool AnimationType::checkCollision() {
}
void AnimationType::walk() {
- byte tc;
- ByteField r;
-
-
if (_visible) {
+ ByteField r;
r._x1 = (_x / 8) - 1;
if (r._x1 == 255)
r._x1 = 0;
@@ -204,8 +201,8 @@ void AnimationType::walk() {
_oldY[_tr->_vm->_gyro->_cp] = _y;
if (_homing)
homestep();
- _x = _x + _moveX;
- _y = _y + _moveY;
+ _x += _moveX;
+ _y += _moveY;
}
if (_doCheck) {
@@ -214,7 +211,7 @@ void AnimationType::walk() {
return;
}
- tc = _tr->checkfeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+ byte tc = _tr->checkfeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
// -1 is because the modified array indexes of magics[] compared to Pascal .
if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
@@ -475,11 +472,8 @@ void Animation::loadtrip() {
}
byte Animation::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
- byte a, c;
- int16 fv, ff;
-
// if not alive then begin checkfeet:=0; exit; end;
- a = 0;
+ byte a = 0;
//setactivepage(2);
if (x1 < 0)
@@ -487,17 +481,17 @@ byte Animation::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
if (x2 > 639)
x2 = 639;
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);
+ 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;
}
}
} else {
- for (fv = x1; fv <= x2; fv++) {
- for (ff = y + yl; ff <= oy + yl; ff++) {
- c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
+ 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;
}