aboutsummaryrefslogtreecommitdiff
path: root/engines
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
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')
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/input.cpp2
-rw-r--r--engines/agos/verb.cpp43
3 files changed, 28 insertions, 21 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index d2b4b73f43..284c61fdaf 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1487,6 +1487,8 @@ protected:
void drawMaskedImage(VC10_state *state);
void draw32ColorImage(VC10_state *state);
+ virtual void clearName();
+
virtual void drawIcon(WindowBlock *window, uint icon, uint x, uint y);
virtual void handleMouseMoved();
@@ -1537,6 +1539,8 @@ protected:
const OpcodeEntrySimon2 *_opcodesSimon2;
+ virtual void clearName();
+
virtual void drawIcon(WindowBlock *window, uint icon, uint x, uint y);
virtual void addArrows(WindowBlock *window, uint8 num);
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index 2ddb9811c3..add7eb96f0 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -304,7 +304,7 @@ void AGOSEngine::waitForInput() {
) {
_hitAreaSubjectItem = ha->item_ptr;
id = setVerbText(ha);
- _nameLocked = 2;
+ _nameLocked = 0;
displayName(ha);
_nameLocked = 1;
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);