aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/verb.cpp
diff options
context:
space:
mode:
authorTravis Howell2008-03-23 23:18:43 +0000
committerTravis Howell2008-03-23 23:18:43 +0000
commit47ad2487b4bd46fcb3ad249710b7bfca01744e3e (patch)
tree3c1c2e49ae72094daf053c3caf85362e2c74aae3 /engines/agos/verb.cpp
parent00033ff7470d2cb21c3ce8207e2deadacf63543e (diff)
downloadscummvm-rg350-47ad2487b4bd46fcb3ad249710b7bfca01744e3e.tar.gz
scummvm-rg350-47ad2487b4bd46fcb3ad249710b7bfca01744e3e.tar.bz2
scummvm-rg350-47ad2487b4bd46fcb3ad249710b7bfca01744e3e.zip
Fix name locking in Waxworks, and cleanup.
svn-id: r31229
Diffstat (limited to 'engines/agos/verb.cpp')
-rw-r--r--engines/agos/verb.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index faedabcb32..7938cec0ab 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -190,34 +190,37 @@ void AGOSEngine_Feeble::clearName() {
return;
}
-void AGOSEngine::clearName() {
- if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2)
+void AGOSEngine_Simon2::clearName() {
+ if (getBitFlag(79)) {
+ sendSync(202);
+ _lastNameOn = NULL;
return;
+ }
- //if (_nameLocked == 1)
- // return;
+ AGOSEngine_Simon1::clearName();
+}
- HitArea *last;
+void AGOSEngine_Simon1::clearName() {
HitArea *ha;
- if (getGameType() == GType_SIMON2) {
- if (getBitFlag(79)) {
- sendSync(202);
- _lastNameOn = NULL;
- return;
- }
- }
+ if (_currentVerbBox == _lastVerbOn)
+ return;
- last = _currentVerbBox;
+ resetNameWindow();
+ _lastVerbOn = _currentVerbBox;
+
+ if (_currentVerbBox != NULL && (ha = findBox(200)) && (ha->flags & kBFBoxDead) && !(_currentVerbBox->flags & kBFBoxDead))
+ printVerbOf(_currentVerbBox->id);
+}
- if (last == _lastVerbOn)
+void AGOSEngine::clearName() {
+ if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2)
return;
- resetNameWindow();
- _lastVerbOn = last;
+ if (_nameLocked == 1 || _lastNameOn == 0)
+ return;
- if (last != NULL && (ha = findBox(200)) && (ha->flags & kBFBoxDead) && !(last->flags & kBFBoxDead))
- printVerbOf(last->id);
+ resetNameWindow();
}
void AGOSEngine::printVerbOf(uint hitarea_id) {
@@ -733,13 +736,13 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
}
}
- //if (_nameLocked == 0) {
+ if (getGameType() != GType_WW || _nameLocked == 0) {
if (best_ha->flags & kBFNoTouchName) {
clearName();
} else if (best_ha != _lastNameOn) {
displayName(best_ha);
}
- //}
+ }
if (best_ha->flags & kBFInvertTouch && !(best_ha->flags & kBFBoxSelected)) {
hitarea_leave(best_ha, false);