diff options
author | Paul Gilbert | 2014-03-26 22:58:24 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-26 22:58:24 -0400 |
commit | 0a4c4c8eda3500915372a6c9987e524016ec566f (patch) | |
tree | 31d43af5e69190b9786017fa4de3ab945187a997 | |
parent | fc03e5a4fadaa30efa98902f6650eb3a98651abb (diff) | |
download | scummvm-rg350-0a4c4c8eda3500915372a6c9987e524016ec566f.tar.gz scummvm-rg350-0a4c4c8eda3500915372a6c9987e524016ec566f.tar.bz2 scummvm-rg350-0a4c4c8eda3500915372a6c9987e524016ec566f.zip |
MADS: Walking is now sort of working
-rw-r--r-- | engines/mads/action.cpp | 5 | ||||
-rw-r--r-- | engines/mads/events.cpp | 26 | ||||
-rw-r--r-- | engines/mads/events.h | 2 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 3 |
4 files changed, 23 insertions, 13 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index 07af95e341..c13f65a96c 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -557,8 +557,11 @@ void MADSAction::leftClick() { _v86F4C = -1; _v86F4E = 0; - if (_vm->_events->currentPos().y < MADS_SCENE_HEIGHT) + if (_vm->_events->currentPos().y < MADS_SCENE_HEIGHT) { scene._customDest = _vm->_events->currentPos() + scene._posAdjust; + _selectedAction = -1; + _v86F4A = -1; + } break; case CAT_TALK_ENTRY: diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 70ca166aab..4b143ec0e2 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -177,9 +177,27 @@ void EventsManager::delay(int cycles) { } void EventsManager::waitForNextFrame() { + _mouseClicked = false; + _mouseReleased = false; + _mouseButtons = 0; + + bool mouseClicked = false; + bool mouseReleased = false; + int mouseButtons = 0; + uint32 frameCtr = getFrameCounter(); - while (!_vm->shouldQuit() && frameCtr == _frameCounter) + while (!_vm->shouldQuit() && frameCtr == _frameCounter) { delay(1); + + mouseClicked |= _mouseClicked; + mouseReleased |= _mouseReleased; + mouseButtons |= _mouseButtons; + } + + _mouseClicked = mouseClicked; + _mouseReleased = mouseReleased; + _mouseButtons = mouseButtons; + _mouseMoved = _mouseClicked || _mouseReleased; } void EventsManager::initVars() { @@ -188,10 +206,4 @@ void EventsManager::initVars() { _vD2 = _vD8 = 0; } -void EventsManager::resetMouseFlags() { - _mouseClicked = false; - _mouseReleased = false; - _mouseButtons = 0; -} - } // End of namespace MADS diff --git a/engines/mads/events.h b/engines/mads/events.h index b7af148e7e..219af20c2a 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -141,8 +141,6 @@ public: uint32 getFrameCounter() const { return _frameCounter; } void initVars(); - - void resetMouseFlags(); }; } // End of namespace MADS diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index c90a54c317..f16b2c3889 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -272,9 +272,6 @@ void Scene::loop() { // Handle drawing a game frame doFrame(); - // Reset mouse flags - _vm->_events->resetMouseFlags(); - // TODO: Verify correctness of frame wait _vm->_events->waitForNextFrame(); |