[Scummvm-cvs-logs] SF.net SVN: scummvm: [26207] scummvm/trunk/engines/agos/input.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Mar 18 14:53:51 CET 2007
Revision: 26207
http://scummvm.svn.sourceforge.net/scummvm/?rev=26207&view=rev
Author: fingolfin
Date: 2007-03-18 06:53:51 -0700 (Sun, 18 Mar 2007)
Log Message:
-----------
Refactoring AGOSEngine::waitForInput a bit (by resolving gotos)
Modified Paths:
--------------
scummvm/trunk/engines/agos/input.cpp
Modified: scummvm/trunk/engines/agos/input.cpp
===================================================================
--- scummvm/trunk/engines/agos/input.cpp 2007-03-18 13:29:12 UTC (rev 26206)
+++ scummvm/trunk/engines/agos/input.cpp 2007-03-18 13:53:51 UTC (rev 26207)
@@ -202,8 +202,51 @@
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 @@
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() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list