From dcd6c9eaf0129fe804f50534aed7dc6eafdaf2bd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 21 Aug 2010 10:46:35 +0000 Subject: SCI: Fixed bug #3048911 - "Keyboard discrepancies in all SCI games" by handling synthetic (keyboard repeat) events and adding support for Control-C svn-id: r52252 --- engines/sci/event.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sci/event.cpp') diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 5923e501cf..3234ab68ff 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -149,7 +149,7 @@ SciEvent EventManager::getScummVMEvent() { found = em->pollEvent(ev); } - if (found && !ev.synthetic && ev.type != Common::EVENT_MOUSEMOVE) { + if (found && ev.type != Common::EVENT_MOUSEMOVE) { int modifiers = em->getModifierState(); // We add the modifier key status to buckybits -- cgit v1.2.3 From f9d9fe8f1295f557fdf51f48b5e9f806c8190ca2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 21 Aug 2010 11:34:19 +0000 Subject: SCI: Added support for the DEL key svn-id: r52255 --- engines/sci/event.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/sci/event.cpp') diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 3234ab68ff..acd2e9f735 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -215,6 +215,11 @@ SciEvent EventManager::getScummVMEvent() { else input.character = SCI_KEY_TAB; } + if (input.data == Common::KEYCODE_DELETE) { + // Delete key + input.type = SCI_EVENT_KEYBOARD; + input.data = input.character = SCI_KEY_DELETE; + } } else if ((input.data >= Common::KEYCODE_F1) && input.data <= Common::KEYCODE_F10) { // F1-F10 input.type = SCI_EVENT_KEYBOARD; -- cgit v1.2.3 From 9096848e4b0411daa3cd54a677bafc13e2312082 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 29 Aug 2010 00:39:33 +0000 Subject: SCI: Throttle the invocations of Engine::shouldQuit() SCI constantly invoked Engine::shouldQuit(), which in turn called 2 virtual functions. This added a significant overhead, as this was called constantly without any throttling whatsoever. Now, the invocation of shouldQuit() is throttled to be on each frame update (i.e. at a rate of 60fps). Thanks to wjp for profiling this. svn-id: r52431 --- engines/sci/event.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/sci/event.cpp') diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index acd2e9f735..5d469eda7b 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -351,9 +351,17 @@ SciEvent EventManager::getScummVMEvent() { void EventManager::updateScreen() { // Update the screen here, since it's called very often. // Throttle the screen update rate to 60fps. - if (g_system->getMillis() - g_sci->getEngineState()->_screenUpdateTime >= 1000 / 60) { + EngineState *s = g_sci->getEngineState(); + if (g_system->getMillis() - s->_screenUpdateTime >= 1000 / 60) { g_system->updateScreen(); - g_sci->getEngineState()->_screenUpdateTime = g_system->getMillis(); + s->_screenUpdateTime = g_system->getMillis(); + // Throttle the checking of shouldQuit() to 60fps as well, since + // Engine::shouldQuit() invokes 2 virtual functions + // (EventManager::shouldQuit() and EventManager::shouldRTL()), + // which is very expensive to invoke constantly without any + // throttling at all. + if (g_engine->shouldQuit()) + s->abortScriptProcessing = kAbortQuitGame; } } -- cgit v1.2.3