aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kevent.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-03 20:49:18 +0000
committerWillem Jan Palenstijn2009-10-03 20:49:18 +0000
commitb9cdb1abb76c94723c24ca66eb8d47d96c8c5ebd (patch)
treed4f40b3f6a8f55aef1e24506bd3771f8269d64a1 /engines/sci/engine/kevent.cpp
parentf6de0b4ec9fcc240cdc0c46aedb2e2089e07bd5c (diff)
downloadscummvm-rg350-b9cdb1abb76c94723c24ca66eb8d47d96c8c5ebd.tar.gz
scummvm-rg350-b9cdb1abb76c94723c24ca66eb8d47d96c8c5ebd.tar.bz2
scummvm-rg350-b9cdb1abb76c94723c24ca66eb8d47d96c8c5ebd.zip
SCI: Merge new GUI code written by m_kiewitz.
This is a major rewrite of the graphics code. A slightly adapted version of the old code is still available and currently the default. The new code is selectable in sci.cpp, but is not yet finished. svn-id: r44565
Diffstat (limited to 'engines/sci/engine/kevent.cpp')
-rw-r--r--engines/sci/engine/kevent.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index d86fcdd073..728dad0df7 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -206,11 +206,13 @@ reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) {
SegManager *segMan = s->segMan;
if (obj.segment) {
- int x = GET_SEL32V(obj, x);
- int y = GET_SEL32V(obj, y);
+ int16 x = GET_SEL32V(obj, x);
+ int16 y = GET_SEL32V(obj, y);
- PUT_SEL32V(obj, x, x - s->port->zone.x);
- PUT_SEL32V(obj, y, y - s->port->zone.y);
+ s->gui->globalToLocal(&x, &y);
+
+ PUT_SEL32V(obj, x, x);
+ PUT_SEL32V(obj, y, y);
}
return s->r_acc;
@@ -222,11 +224,13 @@ reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv) {
SegManager *segMan = s->segMan;
if (obj.segment) {
- int x = GET_SEL32V(obj, x);
- int y = GET_SEL32V(obj, y);
+ int16 x = GET_SEL32V(obj, x);
+ int16 y = GET_SEL32V(obj, y);
+
+ s->gui->localToGlobal(&x, &y);
- PUT_SEL32V(obj, x, x + s->port->zone.x);
- PUT_SEL32V(obj, y, y + s->port->zone.y);
+ PUT_SEL32V(obj, x, x);
+ PUT_SEL32V(obj, y, y);
}
return s->r_acc;