aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/animation.cpp
diff options
context:
space:
mode:
authorStrangerke2013-09-08 10:29:38 +0200
committerStrangerke2013-09-08 10:31:54 +0200
commitf783f2c28a13e9513ec6a0fc0fccac22d3502d2d (patch)
treeb8c79664cc973380053b99ffe6b0a89c22060c5f /engines/avalanche/animation.cpp
parent3f2ed1c803d36842b01320da28d4e68592317781 (diff)
downloadscummvm-rg350-f783f2c28a13e9513ec6a0fc0fccac22d3502d2d.tar.gz
scummvm-rg350-f783f2c28a13e9513ec6a0fc0fccac22d3502d2d.tar.bz2
scummvm-rg350-f783f2c28a13e9513ec6a0fc0fccac22d3502d2d.zip
AVALANCHE: Silent some CppCheck warnings, rename some loop variables
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 127fbf9178..6b6138ca02 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;
}