aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorMax Horn2007-03-18 13:53:51 +0000
committerMax Horn2007-03-18 13:53:51 +0000
commit612e7a3eeb1b1e4b6c0500b8801544e19f2d7d55 (patch)
treea70ba1ad5ed2af9266743ec00b42893361e34f4a /engines/agos
parent72ee9ee86a39c3edc4bcec9f283307d7dbd5e12d (diff)
downloadscummvm-rg350-612e7a3eeb1b1e4b6c0500b8801544e19f2d7d55.tar.gz
scummvm-rg350-612e7a3eeb1b1e4b6c0500b8801544e19f2d7d55.tar.bz2
scummvm-rg350-612e7a3eeb1b1e4b6c0500b8801544e19f2d7d55.zip
Refactoring AGOSEngine::waitForInput a bit (by resolving gotos)
svn-id: r26207
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/input.cpp97
1 files changed, 45 insertions, 52 deletions
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index 08ab14fea1..54ad8af05e 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -202,8 +202,51 @@ startOver:
goto startOver;
if (_lastHitArea3 != 0)
break;
- if (_dragMode != 0)
- goto dragMode;
+ if (_dragMode != 0) {
+ ha = _lastClickRem;
+
+ if (ha == 0 || ha->item_ptr == NULL || !(ha->flags & kBFDragBox)) {
+ _dragFlag = 0;
+ _dragMode = 0;
+ _dragCount = 0;
+ _dragEnd = 0;
+ goto startOver;
+ }
+
+ _hitAreaSubjectItem = ha->item_ptr;
+ _verbHitArea = 500;
+
+ for (;;) {
+ processSpecialKeys();
+ hitarea_stuff_helper();
+ delay(100);
+
+ if (_dragFlag == 0) {
+ _dragFlag = 0;
+ _dragMode = 0;
+ _dragCount = 0;
+ _dragEnd = 0;
+ goto startOver;
+ }
+
+ if (_dragEnd != 0)
+ break;
+ }
+
+ _dragFlag = 0;
+ _dragMode = 0;
+ _dragCount = 0;
+ _dragEnd = 0;
+
+ boxController(_mouse.x, _mouse.y, 1);
+
+ if (_currentBox != NULL) {
+ _hitAreaObjectItem = _currentBox->item_ptr;
+ setVerbText(ha);
+ }
+
+ goto out_of_here;
+ }
hitarea_stuff_helper();
delay(100);
}
@@ -315,56 +358,6 @@ out_of_here:
if (getGameType() == GType_WW && _mouseCursor < 3)
_mouseCursor = 0;
-
- return;
-
-resetDrag:
-
- _dragFlag = 0;
- _dragMode = 0;
- _dragCount = 0;
- _dragEnd = 0;
- goto startOver;
-
-dragMode:
- if (_lastClickRem == 0)
- goto resetDrag;
-
- ha = _lastClickRem;
- if (!(ha->flags & kBFDragBox))
- goto resetDrag;
-
- if (ha->item_ptr == NULL)
- goto resetDrag;
-
- _hitAreaSubjectItem = ha->item_ptr;
- _verbHitArea = 500;
-
- for (;;) {
- processSpecialKeys();
- hitarea_stuff_helper();
- delay(100);
-
- if (_dragFlag == 0)
- goto resetDrag;
-
- if (_dragEnd != 0)
- break;
- }
-
- _dragFlag = 0;
- _dragMode = 0;
- _dragCount = 0;
- _dragEnd = 0;
-
- boxController(_mouse.x, _mouse.y, 1);
-
- if (_currentBox != NULL) {
- _hitAreaObjectItem = _currentBox->item_ptr;
- setVerbText(ha);
- }
-
- goto out_of_here;
}
void AGOSEngine::hitarea_stuff_helper() {