diff options
Diffstat (limited to 'engines/sludge/event.cpp')
-rw-r--r-- | engines/sludge/event.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/sludge/event.cpp b/engines/sludge/event.cpp index d5c453bdc1..b553702710 100644 --- a/engines/sludge/event.cpp +++ b/engines/sludge/event.cpp @@ -36,8 +36,6 @@ namespace Sludge { extern Variable *launchResult; extern VariableStack *noStack; -extern ScreenRegion *overRegion; -extern ScreenRegion *lastRegion; EventManager::EventManager(SludgeEngine *vm) { _vm = vm; @@ -152,14 +150,14 @@ void EventManager::checkInput() { bool EventManager::handleInput() { static int l = 0; - if (!g_sludge->launchMe.empty()) { + if (!_vm->launchMe.empty()) { if (l) { // Still paused because of spawned thingy... } else { l = 1; setVariable(*launchResult, SVT_INT, 0/*launch(launchMe) > 31*/); //TODO:false value - g_sludge->launchMe.clear(); + _vm->launchMe.clear(); launchResult = nullptr; } return true; @@ -167,8 +165,8 @@ bool EventManager::handleInput() { l = 0; } - if (!overRegion) - getOverRegion(); + if (!_vm->_regionMan->getOverRegion()) + _vm->_regionMan->updateOverRegion(); if (_input.justMoved) { if (_currentEvents->func[kMoveMouse]) { @@ -178,12 +176,13 @@ bool EventManager::handleInput() { } _input.justMoved = false; - if (lastRegion != overRegion && _currentEvents->func[kFocus]) { + if (_vm-> _regionMan->isRegionChanged()&& _currentEvents->func[kFocus]) { VariableStack *tempStack = new VariableStack; if (!checkNew(tempStack)) return false; initVarNew(tempStack->thisVar); + ScreenRegion *overRegion = _vm->_regionMan->getOverRegion(); if (overRegion) { setVariable(tempStack->thisVar, SVT_OBJTYPE, overRegion->thisType->objectNum); } else { @@ -333,7 +332,7 @@ bool EventManager::handleInput() { _input.rightRelease = false; _input.leftRelease = false; _input.keyPressed = 0; - lastRegion = overRegion; + _vm->_regionMan->updateLastRegion(); return true; } |