diff options
author | Bastien Bouclet | 2010-11-29 20:53:14 +0000 |
---|---|---|
committer | Bastien Bouclet | 2010-11-29 20:53:14 +0000 |
commit | 8da42b4221bd4763abc80397307b5807d14c89f0 (patch) | |
tree | edd4475c555ea5fb928762089882b778aed39aef | |
parent | b4913548d0b4e9e510653bf72aadd1e856663788 (diff) | |
download | scummvm-rg350-8da42b4221bd4763abc80397307b5807d14c89f0.tar.gz scummvm-rg350-8da42b4221bd4763abc80397307b5807d14c89f0.tar.bz2 scummvm-rg350-8da42b4221bd4763abc80397307b5807d14c89f0.zip |
MOHAWK: Don't change current resource when dragging
svn-id: r54607
-rw-r--r-- | engines/mohawk/myst.cpp | 7 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 1 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 448334492c..ee010e5d80 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -67,6 +67,7 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription _curCard = 0; _needsUpdate = false; _curResource = -1; + _dragResource = 0; _gfx = NULL; _console = NULL; @@ -294,7 +295,10 @@ Common::Error MohawkEngine_Myst::run() { switch (event.type) { case Common::EVENT_MOUSEMOVE: _needsUpdate = true; - checkCurrentResource(); + // Keep the same resource when dragging + if (!_dragResource) { + checkCurrentResource(); + } if (_curResource >= 0 && _mouseClicked) { debug(2, "Sending mouse move event to resource %d\n", _curResource); _resources[_curResource]->handleMouseDrag(&event.mouse); @@ -482,6 +486,7 @@ void MohawkEngine_Myst::changeToCard(uint16 card) { // TODO: Handle Script Resources // Make sure we have the right cursor showing + _dragResource = 0; _curResource = -1; checkCurrentResource(); diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 8fe06e6be3..2a8c1e6a24 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -190,6 +190,7 @@ public: MystSaveLoad *_saveLoad; MystScriptParser *_scriptParser; Common::Array<MystResource*> _resources; + MystResource *_dragResource; bool _showResourceRects; MystResource *loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent); diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 122fe6e537..7e4fb17c84 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -527,6 +527,9 @@ void MystResourceType10::drawDataToScreen() { } void MystResourceType10::handleMouseDown(Common::Point *mouse) { + // Tell the engine we are dragging a resource + _vm->_dragResource = this; + updatePosition(mouse); MystResourceType8::handleMouseDown(mouse); @@ -550,6 +553,9 @@ void MystResourceType10::handleMouseUp(Common::Point *mouse) { // Draw slider drawConditionalDataToScreen(1); + + // No longer in drag mode + _vm->_dragResource = 0; } void MystResourceType10::handleMouseDrag(Common::Point *mouse) { |