aboutsummaryrefslogtreecommitdiff
path: root/engines/access
diff options
context:
space:
mode:
authorStrangerke2014-12-17 22:49:01 +0100
committerStrangerke2014-12-17 22:49:01 +0100
commit223038924b226b67e93081a5b1c7ed18310c9834 (patch)
tree81eed16662be6d9a0c0be35fa00b698b3932b00d /engines/access
parentc57f1919603c6a7223cb02c637f3682dfb96975f (diff)
downloadscummvm-rg350-223038924b226b67e93081a5b1c7ed18310c9834.tar.gz
scummvm-rg350-223038924b226b67e93081a5b1c7ed18310c9834.tar.bz2
scummvm-rg350-223038924b226b67e93081a5b1c7ed18310c9834.zip
ACCESS: Get rid of a goto
Diffstat (limited to 'engines/access')
-rw-r--r--engines/access/player.cpp29
-rw-r--r--engines/access/player.h1
2 files changed, 17 insertions, 13 deletions
diff --git a/engines/access/player.cpp b/engines/access/player.cpp
index 828be0135d..83f075e3d8 100644
--- a/engines/access/player.cpp
+++ b/engines/access/player.cpp
@@ -657,6 +657,19 @@ void Player::plotCom3() {
plotCom2();
}
+void Player::checkScrollUp() {
+ if ((_playerDirection == DOWNRIGHT || _playerDirection == DOWNLEFT ||
+ _playerDirection == DOWN) && (_vm->_screen->_clipHeight -
+ _playerY - _scrollThreshold) <= 0) {
+ // Scroll up
+ if (scrollUp()) {
+ _scrollEnd = 4;
+ _vm->_screen->_scrollY &= TILE_HEIGHT;
+ _scrollFlag = true;
+ }
+ }
+}
+
void Player::checkScroll() {
_scrollFlag = false;
if (_playerDirection == NONE)
@@ -667,7 +680,7 @@ void Player::checkScroll() {
// Scroll right
if (!scrollRight()) {
if (_playerDirection == DOWNLEFT)
- goto scrollUp;
+ checkScrollUp();
return;
}
@@ -677,7 +690,7 @@ void Player::checkScroll() {
// Scroll left
if (!scrollLeft()) {
if (_playerDirection == DOWNRIGHT)
- goto scrollUp;
+ checkScrollUp();
return;
}
@@ -687,17 +700,7 @@ void Player::checkScroll() {
_playerDirection == UP) && _playerY <= _scrollThreshold) {
scrollDown();
} else {
-scrollUp:
- if ((_playerDirection == DOWNRIGHT || _playerDirection == DOWNLEFT ||
- _playerDirection == DOWN) && (_vm->_screen->_clipHeight -
- _playerY - _scrollThreshold) <= 0) {
- // Scroll up
- if (scrollUp()) {
- _scrollEnd = 4;
- _vm->_screen->_scrollY &= TILE_HEIGHT;
- _scrollFlag = true;
- }
- }
+ checkScrollUp();
}
}
diff --git a/engines/access/player.h b/engines/access/player.h
index 7c8e9a2e86..e3cf5c5433 100644
--- a/engines/access/player.h
+++ b/engines/access/player.h
@@ -66,6 +66,7 @@ protected:
void walkDownLeft();
void walkUpRight();
void walkDownRight();
+ void checkScrollUp();
bool scrollUp();
bool scrollDown();
bool scrollLeft();