From 0303b83ead46346cd74a9649384d8a2dde0e145b Mon Sep 17 00:00:00 2001 From: Eric Fry Date: Sat, 16 Jun 2018 14:41:37 +1000 Subject: ILLUSIONS: Pause actors when entering menu --- engines/illusions/actor.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'engines/illusions/actor.cpp') diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp index 74d57d32b7..10f57446b0 100644 --- a/engines/illusions/actor.cpp +++ b/engines/illusions/actor.cpp @@ -1305,7 +1305,7 @@ bool Controls::getOverlappedObject(Control *control, Common::Point pt, Control * foundControl = testControl; foundPriority = testPriority; } - } + } } } @@ -1504,4 +1504,49 @@ void Controls::destroyControlInternal(Control *control) { delete control; } +void Controls::disappearActors() { + for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) { + Control *control = *it; + if (control->_flags & 4 && control->_pauseCtr == 0) { + control->disappearActor(); + } + } + Control *control = _vm->_dict->getObjectControl(0x40148); + if (control) { + control->disappearActor(); + } +} + +void Controls::appearActors() { + for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) { + Control *control = *it; + if (control->_flags & 4 && control->_pauseCtr == 0) { + control->appearActor(); + } + } + Control *control = _vm->_dict->getObjectControl(0x40148); + if (control) { + control->appearActor(); + } +} + +void Controls::pauseActors(uint32 objectId) { + for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) { + Control *control = *it; + if (control->_actor && control->_objectId != objectId) { + control->_actor->pause(); + } + } +} + +void Controls::unpauseActors(uint32 objectId) { + for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) { + Control *control = *it; + if (control->_actor && control->_objectId != objectId) { + control->_actor->unpause(); + } + } +} + + } // End of namespace Illusions -- cgit v1.2.3