From 47ad2487b4bd46fcb3ad249710b7bfca01744e3e Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 23 Mar 2008 23:18:43 +0000 Subject: Fix name locking in Waxworks, and cleanup. svn-id: r31229 --- engines/agos/agos.h | 4 ++++ engines/agos/input.cpp | 2 +- engines/agos/verb.cpp | 43 +++++++++++++++++++++++-------------------- 3 files changed, 28 insertions(+), 21 deletions(-) (limited to 'engines') 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); -- cgit v1.2.3