aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-21 12:05:10 +0000
committerMartin Kiewitz2010-07-21 12:05:10 +0000
commit15fc39589d109245fd66d5cee6319ee19bb8e4d2 (patch)
treecde6cc5cdf22f703f76005f107365537517d66e6
parentd53e5fbfb7a3cafff6f21a6d656428f670256e9f (diff)
downloadscummvm-rg350-15fc39589d109245fd66d5cee6319ee19bb8e4d2.tar.gz
scummvm-rg350-15fc39589d109245fd66d5cee6319ee19bb8e4d2.tar.bz2
scummvm-rg350-15fc39589d109245fd66d5cee6319ee19bb8e4d2.zip
SCI: more work on coordadjustment sci32
svn-id: r51084
-rw-r--r--engines/sci/engine/kernel32.cpp3
-rw-r--r--engines/sci/engine/kevent.cpp4
-rw-r--r--engines/sci/graphics/coordadjuster.cpp14
3 files changed, 8 insertions, 13 deletions
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp
index c0e6a56b5e..f5a50f3fcf 100644
--- a/engines/sci/engine/kernel32.cpp
+++ b/engines/sci/engine/kernel32.cpp
@@ -859,6 +859,7 @@ reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) {
nsRect.bottom = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsBottom));
// Get the object's plane
+#if 0
reg_t planeObject = readSelector(s->_segMan, targetObject, SELECTOR(plane));
if (!planeObject.isNull()) {
//uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x));
@@ -879,7 +880,7 @@ reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) {
nsRect.translate(planeLeft, planeTop);
}
-
+#endif
//warning("kIsOnMe: (%d, %d) on object %04x:%04x, parameter %d", argv[0].toUint16(), argv[1].toUint16(), PRINT_REG(argv[2]), argv[3].toUint16());
return make_reg(0, nsRect.contains(x, y));
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 635dd7653a..e752f1e8bb 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -215,7 +215,7 @@ reg_t kMapKeyToDir(EngineState *s, int argc, reg_t *argv) {
}
reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) {
- reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
+ reg_t obj = argv[0];
reg_t planeObject = argc > 1 ? argv[1] : NULL_REG; // SCI32
SegManager *segMan = s->_segMan;
@@ -234,7 +234,7 @@ reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) {
}
reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv) {
- reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
+ reg_t obj = argv[0];
reg_t planeObject = argc > 1 ? argv[1] : NULL_REG; // SCI32
SegManager *segMan = s->_segMan;
diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp
index fbeffa7cd2..69f89aa656 100644
--- a/engines/sci/graphics/coordadjuster.cpp
+++ b/engines/sci/graphics/coordadjuster.cpp
@@ -101,14 +101,11 @@ void GfxCoordAdjuster32::kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObje
uint16 planeTop = readSelectorValue(s->_segMan, planeObject, SELECTOR(top));
uint16 planeLeft = readSelectorValue(s->_segMan, planeObject, SELECTOR(left));
- planeTop = (planeTop * g_sci->_gfxScreen->getHeight()) / planeResY;
- planeLeft = (planeLeft * g_sci->_gfxScreen->getWidth()) / planeResX;
+ y = ((y * planeResY) / g_sci->_gfxScreen->getHeight());
+ x = ((x * planeResX) / g_sci->_gfxScreen->getWidth());
y -= planeTop;
x -= planeLeft;
-
- y = ((y * planeResY) / g_sci->_gfxScreen->getHeight());
- x = ((x * planeResX) / g_sci->_gfxScreen->getWidth());
}
void GfxCoordAdjuster32::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject) {
EngineState *s = g_sci->getEngineState();
@@ -117,14 +114,11 @@ void GfxCoordAdjuster32::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObje
uint16 planeTop = readSelectorValue(s->_segMan, planeObject, SELECTOR(top));
uint16 planeLeft = readSelectorValue(s->_segMan, planeObject, SELECTOR(left));
- planeTop = (planeTop * g_sci->_gfxScreen->getHeight()) / planeResY;
- planeLeft = (planeLeft * g_sci->_gfxScreen->getWidth()) / planeResX;
+ x += planeLeft;
+ y += planeTop;
y = ((y * g_sci->_gfxScreen->getHeight()) / planeResY);
x = ((x * g_sci->_gfxScreen->getWidth()) / planeResX);
-
- x += planeLeft;
- y += planeTop;
}
Common::Rect GfxCoordAdjuster32::onControl(Common::Rect rect) {