diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/sci/engine/kevent.cpp | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-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/engine/kevent.cpp')
-rw-r--r-- | engines/sci/engine/kevent.cpp | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 3395811700..9d48174078 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -23,6 +23,8 @@ * */ +#include "common/system.h" + #include "sci/sci.h" #include "sci/engine/features.h" #include "sci/engine/state.h" @@ -42,7 +44,6 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { int mask = argv[0].toUint16(); reg_t obj = argv[1]; SciEvent curEvent; - int oldx, oldy; int modifier_mask = getSciVersion() <= SCI_VERSION_01 ? SCI_KEYMOD_ALL : SCI_KEYMOD_NO_FOOLOCK; SegManager *segMan = s->_segMan; Common::Point mousePos; @@ -67,13 +68,24 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { return make_reg(0, 1); } - oldx = mousePos.x; - oldy = mousePos.y; curEvent = g_sci->getEventManager()->getSciEvent(mask); if (g_sci->getVocabulary()) g_sci->getVocabulary()->parser_event = NULL_REG; // Invalidate parser event + if (s->_cursorWorkaroundActive) { + // ffs: GfxCursor::setPosition() + // we check, if actual cursor position is inside given rect + // if that's the case, we switch ourself off. Otherwise + // we simulate the original set position to the scripts + if (s->_cursorWorkaroundRect.contains(mousePos.x, mousePos.y)) { + s->_cursorWorkaroundActive = false; + } else { + mousePos.x = s->_cursorWorkaroundPoint.x; + mousePos.y = s->_cursorWorkaroundPoint.y; + } + } + writeSelectorValue(segMan, obj, SELECTOR(x), mousePos.x); writeSelectorValue(segMan, obj, SELECTOR(y), mousePos.y); @@ -162,6 +174,21 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { g_sci->_soundCmd->updateSci0Cues(); } + // Wait a bit here, so that the CPU isn't maxed out when the game + // is waiting for user input (e.g. when showing text boxes) - bug + // #3037874. This works when games do benchmarking at the beginning, + // because most of them call kAnimate for benchmarking without + // calling kGetEvent in between (rightly so). + if (g_sci->getGameId() == GID_JONES && g_sci->getEngineState()->currentRoomNumber() == 764) { + // Jones CD is an exception, as it incorrectly calls GetEvent + // while benchmarking. Thus, don't delay here for room 764 in + // Jones (the speed test room), otherwise speed testing will + // fail and the game won't show any views, as it will think that + // the user has a slow machine - bug #3058865 + } else { + g_system->delayMillis(10); + } + return s->r_acc; } |