diff options
author | Bastien Bouclet | 2010-11-29 20:57:11 +0000 |
---|---|---|
committer | Bastien Bouclet | 2010-11-29 20:57:11 +0000 |
commit | d3289529eb329fe3d97ae61bca52e279655121fa (patch) | |
tree | 3466b2b22234b8925b6409d591d32f78e6923abe /engines | |
parent | 3b1440b0d4abac36ec121267b5dc9da0df6b60d0 (diff) | |
download | scummvm-rg350-d3289529eb329fe3d97ae61bca52e279655121fa.tar.gz scummvm-rg350-d3289529eb329fe3d97ae61bca52e279655121fa.tar.bz2 scummvm-rg350-d3289529eb329fe3d97ae61bca52e279655121fa.zip |
MOHAWK: Fix flag values used to dertermine if an area can become active.
svn-id: r54622
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/myst.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 67fb868992..6e24101331 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -501,7 +501,7 @@ void MohawkEngine_Myst::drawResourceRects() { for (uint16 i = 0; i < _resources.size(); i++) { _resources[i]->getRect().debugPrint(0); if (_resources[i]->getRect().isValidRect()) { - if (_resources[i]->unreachableZipDest()) + if (!_resources[i]->canBecomeActive()) _gfx->drawRect(_resources[i]->getRect(), kRectUnreachable); else if (_resources[i]->isEnabled()) _gfx->drawRect(_resources[i]->getRect(), kRectEnabled); @@ -518,7 +518,7 @@ void MohawkEngine_Myst::checkCurrentResource() { bool foundResource = false; for (uint16 i = 0; i < _resources.size(); i++) - if (!_resources[i]->unreachableZipDest() && + if (_resources[i]->canBecomeActive() && _resources[i]->contains(_system->getEventManager()->getMousePos())) { if (_curResource != i) { if (_curResource != -1 && _resources[_curResource]->isEnabled()) diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 0950786a86..27df1c69a8 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -75,6 +75,10 @@ void MystResource::handleMouseUp(Common::Point *mouse) { warning("Movement type resource with null destination at position (%d, %d), (%d, %d)", _rect.left, _rect.top, _rect.right, _rect.bottom); } +bool MystResource::canBecomeActive() { + return !unreachableZipDest() && (isEnabled() || (_flags & kMystUnknownFlag)); +} + bool MystResource::unreachableZipDest() { return (_flags & kMystZipModeEnableFlag) && !_vm->_zipMode; } diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index af889f1f90..34b454f47a 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -49,6 +49,7 @@ public: uint16 getDest() { return _dest; } virtual uint16 getType8Var() { return 0xFFFF; } bool unreachableZipDest(); + bool canBecomeActive(); // Mouse interface virtual void handleMouseUp(Common::Point *mouse); |