diff options
Diffstat (limited to 'engines/access')
-rw-r--r-- | engines/access/amazon/amazon_room.cpp | 9 | ||||
-rw-r--r-- | engines/access/events.cpp | 1 | ||||
-rw-r--r-- | engines/access/events.h | 1 | ||||
-rw-r--r-- | engines/access/player.cpp | 29 | ||||
-rw-r--r-- | engines/access/player.h | 3 |
5 files changed, 23 insertions, 20 deletions
diff --git a/engines/access/amazon/amazon_room.cpp b/engines/access/amazon/amazon_room.cpp index bf3c2501bb..79c70c0b33 100644 --- a/engines/access/amazon/amazon_room.cpp +++ b/engines/access/amazon/amazon_room.cpp @@ -148,14 +148,17 @@ void AmazonRoom::mainAreaClick() { switch (checkBoxes1(_vm->_events->_mousePos)) { case 0: _game->_jasMayaFlag = 0; - break; + return; case 1: _game->_jasMayaFlag = 1; - break; + return; default: break; } - } + } + + _vm->_player->_moveTo = _vm->_events->_mousePos; + _vm->_player->_playerMove = true; } else if (_vm->_events->_mousePos.x >= _vm->_screen->_windowXAdd && _vm->_events->_mousePos.x <= _vm->_screen->_vWindowBytesWide && _vm->_events->_mousePos.y >= _vm->_screen->_windowYAdd && diff --git a/engines/access/events.cpp b/engines/access/events.cpp index 25a77f82de..1afc5515b0 100644 --- a/engines/access/events.cpp +++ b/engines/access/events.cpp @@ -40,7 +40,6 @@ EventsManager::EventsManager(AccessEngine *vm): _vm(vm) { _frameCounter = 10; _priorFrameTime = 0; _leftButton = _rightButton = false; - _mouseMove = false; _mouseCol = _mouseRow = 0; _mouseMode = 0; _cursorExitFlag = false; diff --git a/engines/access/events.h b/engines/access/events.h index c6702ec7af..4c052f96f0 100644 --- a/engines/access/events.h +++ b/engines/access/events.h @@ -55,7 +55,6 @@ public: bool _leftButton, _rightButton; Common::Point _mousePos; int _mouseCol, _mouseRow; - bool _mouseMove; int _mouseMode; bool _cursorExitFlag; Common::FixedStack<Common::KeyState> _keypresses; diff --git a/engines/access/player.cpp b/engines/access/player.cpp index dfbee48134..cde1a74de2 100644 --- a/engines/access/player.cpp +++ b/engines/access/player.cpp @@ -49,6 +49,7 @@ Player::Player(AccessEngine *vm): Manager(vm), ImageEntry() { _playerY = 0; _frame = 0; _playerOff = false; + _playerMove = false; _leftDelta = _rightDelta = 0; _upDelta = _downDelta = 0; _scrollConst = 0; @@ -193,35 +194,35 @@ void Player::walk() { _vm->_timers[0]._flag = true; switch (_move) { case UP: - _vm->_events->_mouseMove = false; + _playerMove = false; walkUp(); break; case DOWN: - _vm->_events->_mouseMove = false; + _playerMove = false; walkDown(); break; case LEFT: - _vm->_events->_mouseMove = false; + _playerMove = false; walkLeft(); break; case RIGHT: - _vm->_events->_mouseMove = false; + _playerMove = false; walkRight(); break; case UPLEFT: - _vm->_events->_mouseMove = false; + _playerMove = false; walkUpLeft(); break; case DOWNLEFT: - _vm->_events->_mouseMove = false; + _playerMove = false; walkDownLeft(); break; case UPRIGHT: - _vm->_events->_mouseMove = false; + _playerMove = false; walkUpRight(); break; case DOWNRIGHT: - _vm->_events->_mouseMove = false; + _playerMove = false; walkDownRight(); break; default: @@ -562,7 +563,7 @@ void Player::walkDownRight() { } void Player::checkMove() { - if (_vm->_events->_mouseMove) { + if (_playerMove) { if (_xFlag == 0 && _yFlag == 0) { int xp = (_playerOffset.x / 2) + _rawPlayer.x - _moveTo.x; if (xp < 0) @@ -582,7 +583,7 @@ void Player::checkMove() { if ((yd >= 0 && yd <= _upDelta) || (yd < 0 && -yd <= _upDelta)) { ++_yFlag; if (_xFlag) { - _vm->_events->_mouseMove = false; + _playerMove = false; _xFlag = _yFlag = 0; } else { ++_xFlag; @@ -594,7 +595,7 @@ void Player::checkMove() { walkDown(); if (_collideFlag) { - _vm->_events->_mouseMove = false; + _playerMove = false; _xFlag = _yFlag = 0; } } @@ -604,7 +605,7 @@ void Player::checkMove() { ++_xFlag; if (_yFlag) { - _vm->_events->_mouseMove = false; + _playerMove = false; _xFlag = _yFlag = 0; } } else { @@ -614,14 +615,14 @@ void Player::checkMove() { walkRight(); if (_collideFlag) { - _vm->_events->_mouseMove = false; + _playerMove = false; _xFlag = _yFlag = 0; } } } else if (!_yFlag) { ++_yFlag; } else { - _vm->_events->_mouseMove = false; + _playerMove = false; _xFlag = _yFlag = 0; } } diff --git a/engines/access/player.h b/engines/access/player.h index b904e46170..b11cc4a826 100644 --- a/engines/access/player.h +++ b/engines/access/player.h @@ -51,7 +51,6 @@ private: bool _collideFlag; Direction _move; int _xFlag, _yFlag; - Common::Point _moveTo; SpriteResource *_playerSprites1; byte *_manPal1; int _scrollEnd; @@ -102,6 +101,8 @@ public: // Additional public globals we've added to new Player class bool _playerOff; + bool _playerMove; + Common::Point _moveTo; bool _scrollFlag; int _scrollThreshold; int _scrollAmount; |