aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-20 05:38:22 +0100
committerMartin Kiewitz2016-02-20 05:38:22 +0100
commit19283b94a975d778f4882dedabe07be68cf1822e (patch)
treefe75f74e4d1e809ce09f21add1dfc0b58d7892dc /engines/sci/engine
parent8706f8c28836b171886e5f0092a773863a2fedd3 (diff)
downloadscummvm-rg350-19283b94a975d778f4882dedabe07be68cf1822e.tar.gz
scummvm-rg350-19283b94a975d778f4882dedabe07be68cf1822e.tar.bz2
scummvm-rg350-19283b94a975d778f4882dedabe07be68cf1822e.zip
SCI32: Some work on kIsOnMe
Plenty of hotspots seem to work now Not fully done yet
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics32.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 85518bae99..c3eb0b520f 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -148,31 +148,9 @@ reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) {
uint16 x = argv[0].toUint16();
uint16 y = argv[1].toUint16();
reg_t targetObject = argv[2];
- uint16 illegalBits = argv[3].getOffset();
- Common::Rect nsRect = g_sci->_gfxCompare->getNSRect(targetObject);
-
- uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x));
- uint16 itemY = readSelectorValue(s->_segMan, targetObject, SELECTOR(y));
- // If top and left are negative, we need to adjust coordinates by the item's x and y
- if (nsRect.left < 0)
- nsRect.translate(itemX, 0);
- if (nsRect.top < 0)
- nsRect.translate(0, itemY);
-
- // we assume that x, y are local coordinates
-
- bool contained = nsRect.contains(x, y);
- if (contained && illegalBits) {
- // If illegalbits are set, we check the color of the pixel that got clicked on
- // for now, we return false if the pixel is transparent
- // although illegalBits may get differently set, don't know yet how this really works out
- uint16 viewId = readSelectorValue(s->_segMan, targetObject, SELECTOR(view));
- int16 loopNo = readSelectorValue(s->_segMan, targetObject, SELECTOR(loop));
- int16 celNo = readSelectorValue(s->_segMan, targetObject, SELECTOR(cel));
- if (g_sci->_gfxCompare->kernelIsItSkip(viewId, loopNo, celNo, Common::Point(x - nsRect.left, y - nsRect.top)))
- contained = false;
- }
- return make_reg(0, contained);
+ uint16 checkPixels = argv[3].getOffset();
+
+ return make_reg(0, g_sci->_gfxFrameout->kernelIsOnMe(x, y, checkPixels, targetObject));
}
reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {