aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/event.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-13 03:57:44 +0000
committerJohannes Schickel2010-10-13 03:57:44 +0000
commit75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch)
treef29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/sci/event.cpp
parent48ee83b88957dab86bc763e9ef21a70179fa8679 (diff)
parente9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff)
downloadscummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend changes into the branch. I suppose the gp2x backend and probably all new backends, i.e. gph, dingux etc., might not compile anymore. Since I have no way of testing those it would be nice if porters could look into getting those up to speed in this branch. svn-id: r53399
Diffstat (limited to 'engines/sci/event.cpp')
-rw-r--r--engines/sci/event.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index 5923e501cf..5d469eda7b 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
@@ -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;
@@ -346,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;
}
}