aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2010-08-31 15:50:46 +0000
committerMartin Kiewitz2010-08-31 15:50:46 +0000
commitfa7c6a9969806d2163d81153a3b3610b65ea12e4 (patch)
tree2fd4bee487ecd37a154b3c83db5ce4c52b8bd8ba /engines/sci/engine
parentb5a17ca628e984fa13190c64fb5caef6108369ca (diff)
downloadscummvm-rg350-fa7c6a9969806d2163d81153a3b3610b65ea12e4.tar.gz
scummvm-rg350-fa7c6a9969806d2163d81153a3b3610b65ea12e4.tar.bz2
scummvm-rg350-fa7c6a9969806d2163d81153a3b3610b65ea12e4.zip
SCI: adding workaround for platform-specific
incompatibility with some sierra games. Some games open a new menu, set mouse cursor within that menu and expect the mouse cursor to be in there and will close it, if it's outside. In case of Wiimote/touch interfaces this logic won't work of course. Fixes island of dr. brain and QfG1VGA on Wii and touch-interface platforms svn-id: r52474
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kevent.cpp16
-rw-r--r--engines/sci/engine/state.cpp2
-rw-r--r--engines/sci/engine/state.h4
3 files changed, 19 insertions, 3 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 29447d99a1..5fb2948a4b 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -44,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;
@@ -69,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);
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index bbdab6f7f0..732f075257 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -112,6 +112,8 @@ void EngineState::reset(bool isRestoring) {
_chosenQfGImportItem = 0;
+ _cursorWorkaroundActive = false;
+
scriptStepCounter = 0;
scriptGCInterval = GC_INTERVAL;
}
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 42294fa08c..d0ddd5ca06 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -147,6 +147,10 @@ public:
uint _chosenQfGImportItem; // Remembers the item selected in QfG import rooms
+ bool _cursorWorkaroundActive; // ffs. GfxCursor::setPosition()
+ Common::Point _cursorWorkaroundPoint;
+ Common::Rect _cursorWorkaroundRect;
+
public:
/* VM Information */