diff options
| -rw-r--r-- | engines/access/player.cpp | 32 | ||||
| -rw-r--r-- | engines/access/player.h | 8 | ||||
| -rw-r--r-- | engines/access/room.cpp | 8 | 
3 files changed, 32 insertions, 16 deletions
| diff --git a/engines/access/player.cpp b/engines/access/player.cpp index e7a7b3f3c0..b4af672a7c 100644 --- a/engines/access/player.cpp +++ b/engines/access/player.cpp @@ -735,8 +735,12 @@ void Player::checkScroll() {  	}  } -bool Player::scrollUp() { -	_scrollAmount = -(_vm->_screen->_clipHeight - _playerY - _scrollThreshold); +bool Player::scrollUp(int forcedAmount) { +	if (forcedAmount == -1) +		_scrollAmount = -(_vm->_screen->_clipHeight - _playerY - _scrollThreshold); +	else +		_scrollAmount = forcedAmount; +  	if ((_vm->_scrollRow + _vm->_screen->_vWindowHeight) >=  			_vm->_room->_playFieldHeight)  		return true; @@ -763,8 +767,12 @@ bool Player::scrollUp() {  	return false;  } -bool Player::scrollDown() { -	_scrollAmount = -(_playerY - _scrollThreshold); +bool Player::scrollDown(int forcedAmount) { +	if (forcedAmount == -1) +		_scrollAmount = -(_playerY - _scrollThreshold); +	else +		_scrollAmount = forcedAmount; +  	_scrollFlag = true;  	_vm->_scrollY -= _scrollAmount;  	if (_vm->_scrollY >= 0) @@ -788,9 +796,13 @@ bool Player::scrollDown() {  	return true;  } -bool Player::scrollLeft() { +bool Player::scrollLeft(int forcedAmount) {  	Screen &screen = *_vm->_screen; -	_scrollAmount = -(_vm->_screen->_clipWidth - _playerX - _scrollThreshold); +	if (forcedAmount == -1) +		_scrollAmount = -(_vm->_screen->_clipWidth - _playerX - _scrollThreshold); +	else +		_scrollAmount = forcedAmount; +  	if ((_vm->_scrollCol + screen._vWindowWidth) == _vm->_room->_playFieldWidth) {  		_scrollEnd = 2;  		_vm->_scrollX = 0; @@ -815,8 +827,12 @@ bool Player::scrollLeft() {  	}  } -bool Player::scrollRight() { -	_scrollAmount = -(_playerX - _scrollThreshold); +bool Player::scrollRight(int forcedAmount) { +	if (forcedAmount == -1) +		_scrollAmount = -(_playerX - _scrollThreshold); +	else +		_scrollAmount = forcedAmount; +  	_scrollFlag = true;  	_vm->_scrollX -= _scrollAmount; diff --git a/engines/access/player.h b/engines/access/player.h index 62c5e2750a..f3df2d027a 100644 --- a/engines/access/player.h +++ b/engines/access/player.h @@ -135,10 +135,10 @@ public:  	void calcPlayer(); -	bool scrollUp(); -	bool scrollDown(); -	bool scrollLeft(); -	bool scrollRight(); +	bool scrollUp(int forcedAmount = -1); +	bool scrollDown(int forcedAmount = -1); +	bool scrollLeft(int forcedAmount = -1); +	bool scrollRight(int forcedAmount = -1);  	void checkScroll();  	void checkMove(); diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 3960277643..6e0a4aa6db 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -148,13 +148,13 @@ void Room::takePicture() {  	_vm->_player->_scrollFlag = false;  	if (_vm->_player->_move == UP) -		_vm->_player->scrollDown(); +		_vm->_player->scrollDown(2);  	else if (_vm->_player->_move == DOWN) -		_vm->_player->scrollUp(); +		_vm->_player->scrollUp(2);  	else if (_vm->_player->_move == LEFT) -		_vm->_player->scrollRight(); +		_vm->_player->scrollRight(2);  	else if (_vm->_player->_move == RIGHT) -		_vm->_player->scrollLeft(); +		_vm->_player->scrollLeft(2);  }  void Room::doRoom() { | 
