aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-17 23:08:14 -0400
committerPaul Gilbert2014-08-17 23:08:14 -0400
commit5ec8c445bd21e9b7fd592bf1cc8785a0d44bde23 (patch)
tree56160fd9a0e18533b04fe9dc5b4083181e16801e /engines
parentd31b27ba1b26a38401387f85ca2ce46be455d0a2 (diff)
downloadscummvm-rg350-5ec8c445bd21e9b7fd592bf1cc8785a0d44bde23.tar.gz
scummvm-rg350-5ec8c445bd21e9b7fd592bf1cc8785a0d44bde23.tar.bz2
scummvm-rg350-5ec8c445bd21e9b7fd592bf1cc8785a0d44bde23.zip
ACCESS: Fix player flickering
Diffstat (limited to 'engines')
-rw-r--r--engines/access/player.cpp113
1 files changed, 56 insertions, 57 deletions
diff --git a/engines/access/player.cpp b/engines/access/player.cpp
index 79ce2190f3..dfbee48134 100644
--- a/engines/access/player.cpp
+++ b/engines/access/player.cpp
@@ -562,71 +562,70 @@ void Player::walkDownRight() {
}
void Player::checkMove() {
- if (!_vm->_events->_mouseMove)
- return;
-
- if (_xFlag == 0 && _yFlag == 0) {
- int xp = (_playerOffset.x / 2) + _rawPlayer.x - _moveTo.x;
- if (xp < 0)
- xp = -xp;
- int yp = _rawPlayer.y - _moveTo.y;
- if (yp < 0)
- yp = -yp;
-
- if (xp < yp)
- _xFlag = 1;
- else
- _yFlag = 1;
- }
+ if (_vm->_events->_mouseMove) {
+ if (_xFlag == 0 && _yFlag == 0) {
+ int xp = (_playerOffset.x / 2) + _rawPlayer.x - _moveTo.x;
+ if (xp < 0)
+ xp = -xp;
+ int yp = _rawPlayer.y - _moveTo.y;
+ if (yp < 0)
+ yp = -yp;
+
+ if (xp < yp)
+ _xFlag = 1;
+ else
+ _yFlag = 1;
+ }
- if (_yFlag == 1) {
- int yd = _rawPlayer.y - _moveTo.y;
- if ((yd >= 0 && yd <= _upDelta) || (yd < 0 && -yd <= _upDelta)) {
- ++_yFlag;
- if (_xFlag) {
- _vm->_events->_mouseMove = false;
- _xFlag = _yFlag = 0;
+ if (_yFlag == 1) {
+ int yd = _rawPlayer.y - _moveTo.y;
+ if ((yd >= 0 && yd <= _upDelta) || (yd < 0 && -yd <= _upDelta)) {
+ ++_yFlag;
+ if (_xFlag) {
+ _vm->_events->_mouseMove = false;
+ _xFlag = _yFlag = 0;
+ } else {
+ ++_xFlag;
+ }
} else {
- ++_xFlag;
+ if (yd >= 0)
+ walkUp();
+ else
+ walkDown();
+
+ if (_collideFlag) {
+ _vm->_events->_mouseMove = false;
+ _xFlag = _yFlag = 0;
+ }
}
- } else {
- if (yd >= 0)
- walkUp();
- else
- walkDown();
+ } else if (_xFlag == 1) {
+ int xd = _rawPlayer.x - _moveTo.x;
+ if ((xd >= 0 && xd <= -_leftDelta) || (xd < 0 && -xd <= -_leftDelta)) {
+ ++_xFlag;
- if (_collideFlag) {
- _vm->_events->_mouseMove = false;
- _xFlag = _yFlag = 0;
- }
- }
- } else if (_xFlag == 1) {
- int xd = _rawPlayer.x - _moveTo.x;
- if ((xd >= 0 && xd <= -_leftDelta) || (xd < 0 && -xd <= -_leftDelta)) {
- ++_xFlag;
-
- if (_yFlag) {
- _vm->_events->_mouseMove = false;
- _xFlag = _yFlag = 0;
+ if (_yFlag) {
+ _vm->_events->_mouseMove = false;
+ _xFlag = _yFlag = 0;
+ }
+ } else {
+ if (xd >= 0)
+ walkLeft();
+ else
+ walkRight();
+
+ if (_collideFlag) {
+ _vm->_events->_mouseMove = false;
+ _xFlag = _yFlag = 0;
+ }
}
+ } else if (!_yFlag) {
+ ++_yFlag;
} else {
- if (xd >= 0)
- walkLeft();
- else
- walkRight();
-
- if (_collideFlag) {
- _vm->_events->_mouseMove = false;
- _xFlag = _yFlag = 0;
- }
+ _vm->_events->_mouseMove = false;
+ _xFlag = _yFlag = 0;
}
- } else if (!_yFlag) {
- ++_yFlag;
- } else {
- _vm->_events->_mouseMove = false;
- _xFlag = _yFlag = 0;
}
-
+
plotCom3();
}