aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/input.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-05-17 09:00:14 +0000
committerTravis Howell2007-05-17 09:00:14 +0000
commitd4191508f6a036169498037e00000e026d528632 (patch)
tree9c79fb9cd79217d6b643bbbbf89464101b7a1673 /engines/agos/input.cpp
parent565d0d0a7d4b4f87ed402bb1c237afc7f8d85ca7 (diff)
downloadscummvm-rg350-d4191508f6a036169498037e00000e026d528632.tar.gz
scummvm-rg350-d4191508f6a036169498037e00000e026d528632.tar.bz2
scummvm-rg350-d4191508f6a036169498037e00000e026d528632.zip
Cleanup.
svn-id: r26858
Diffstat (limited to 'engines/agos/input.cpp')
-rw-r--r--engines/agos/input.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index efe7eb2d24..3c02018421 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -40,7 +40,7 @@ uint AGOSEngine::setVerbText(HitArea *ha) {
if (ha->flags & kBFTextBox) {
if (getGameType() == GType_PP)
id = ha->id;
- else if (getGameType() == GType_FF && (_lastHitArea->flags & kBFHyperBox))
+ else if (getGameType() == GType_FF && (ha->flags & kBFHyperBox))
id = ha->data;
else
id = ha->flags / 256;
@@ -160,6 +160,7 @@ out_of_here:
_lastHitArea3 = 0;
_lastHitArea = 0;
_lastNameOn = NULL;
+
_mouseCursor = 0;
_noRightClick = 0;
}
@@ -191,9 +192,9 @@ void AGOSEngine::waitForInput() {
_dragAccept = 1;
for (;;) {
- if (getGameType() != GType_FF && getGameType() != GType_PP && _keyPressed == 35)
+ if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) && _keyPressed == 35)
displayBoxStars();
- if (processSpecialKeys() != 0) {
+ if (processSpecialKeys()) {
if ((getGameType() == GType_PP && getGameId() != GID_DIMP) ||
getGameType() == GType_WW)
goto out_of_here;
@@ -203,14 +204,14 @@ void AGOSEngine::waitForInput() {
_lastHitArea3 = NULL;
_dragAccept = 1;
} else {
- if (_lastHitArea3 != 0 || _dragMode != 0)
+ if (_lastHitArea3 || _dragMode)
break;
hitarea_stuff_helper();
delay(100);
}
}
- if (_lastHitArea3 == 0 && _dragMode != 0) {
+ if (!_lastHitArea3 && _dragMode) {
ha = _lastClickRem;
if (ha == 0 || ha->item_ptr == NULL || !(ha->flags & kBFDragBox)) {
@@ -254,11 +255,8 @@ void AGOSEngine::waitForInput() {
}
ha = _lastHitArea;
- if (_lastHitArea == NULL) {
- continue;
- }
-
- if (ha->id == 0x7FFB) {
+ if (ha == NULL) {
+ } else if (ha->id == 0x7FFB) {
inventoryUp(ha->window);
} else if (ha->id == 0x7FFC) {
inventoryDown(ha->window);
@@ -298,7 +296,7 @@ void AGOSEngine::waitForInput() {
waitForSync(34);
}
}
- if (ha->item_ptr && (ha->verb == 0 || _verbHitArea != 0 ||
+ if (ha->item_ptr && (!ha->verb || _verbHitArea ||
(_hitAreaSubjectItem != ha->item_ptr && (ha->flags & kBFBoxItem)))
) {
_hitAreaSubjectItem = ha->item_ptr;
@@ -307,7 +305,7 @@ void AGOSEngine::waitForInput() {
displayName(ha);
_nameLocked = 1;
- if (_verbHitArea != 0) {
+ if (_verbHitArea) {
break;
}
@@ -318,8 +316,8 @@ void AGOSEngine::waitForInput() {
else if (getGameType() == GType_ELVIRA1)
lightMenuStrip(getUserFlag1(ha->item_ptr, 6));
} else {
- if (ha->verb != 0) {
- if (getGameType() == GType_WW && _mouseCursor != 0 && _mouseCursor < 4) {
+ if (ha->verb) {
+ if (getGameType() == GType_WW && _mouseCursor && _mouseCursor < 4) {
_hitAreaSubjectItem = ha->item_ptr;
break;
}
@@ -371,7 +369,7 @@ void AGOSEngine::hitarea_stuff_helper() {
} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW ||
getGameType() == GType_SIMON1) {
uint subr_id = (uint16)_variableArray[254];
- if (subr_id != 0) {
+ if (subr_id) {
Subroutine *sub = getSubroutineByID(subr_id);
if (sub != NULL) {
startSubroutineEx(sub);
@@ -398,7 +396,7 @@ void AGOSEngine::hitarea_stuff_helper_2() {
Subroutine *sub;
subr_id = (uint16)_variableArray[249];
- if (subr_id != 0) {
+ if (subr_id) {
sub = getSubroutineByID(subr_id);
if (sub != NULL) {
_variableArray[249] = 0;
@@ -409,7 +407,7 @@ void AGOSEngine::hitarea_stuff_helper_2() {
}
subr_id = (uint16)_variableArray[254];
- if (subr_id != 0) {
+ if (subr_id) {
sub = getSubroutineByID(subr_id);
if (sub != NULL) {
_variableArray[254] = 0;
@@ -446,7 +444,7 @@ void AGOSEngine::permitInput() {
}
_curWindow = 0;
- if (_windowArray[0] != 0) {
+ if (_windowArray[0]) {
_textWindow = _windowArray[0];
justifyStart();
}