aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kevent.cpp
diff options
context:
space:
mode:
authorColin Snover2016-08-20 21:02:07 -0500
committerColin Snover2016-09-29 19:39:16 -0500
commit44dd029cb17160316b2015321a0a53f8854b6dd3 (patch)
treeb6975dd6bf0f1bc7723345273abdecf034a667a5 /engines/sci/engine/kevent.cpp
parent2be2629a3b2b43a0c86cfb7ea26cf979b91251bd (diff)
downloadscummvm-rg350-44dd029cb17160316b2015321a0a53f8854b6dd3.tar.gz
scummvm-rg350-44dd029cb17160316b2015321a0a53f8854b6dd3.tar.bz2
scummvm-rg350-44dd029cb17160316b2015321a0a53f8854b6dd3.zip
SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
Diffstat (limited to 'engines/sci/engine/kevent.cpp')
-rw-r--r--engines/sci/engine/kevent.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 600dce3014..8dcafe0f38 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -369,6 +369,30 @@ reg_t kLocalToGlobal32(EngineState *s, int argc, reg_t *argv) {
return make_reg(0, visible);
}
+
+reg_t kSetHotRectangles(EngineState *s, int argc, reg_t *argv) {
+ if (argc == 1) {
+ g_sci->getEventManager()->setHotRectanglesActive((bool)argv[0].toUint16());
+ return s->r_acc;
+ }
+
+ const int16 numRects = argv[0].toSint16();
+ SciArray &hotRects = *s->_segMan->lookupArray(argv[1]);
+
+ Common::Array<Common::Rect> rects;
+ rects.resize(numRects);
+
+ for (int16 i = 0; i < numRects; ++i) {
+ rects[i].left = hotRects.int16At(i * 4);
+ rects[i].top = hotRects.int16At(i * 4 + 1);
+ rects[i].right = hotRects.int16At(i * 4 + 2) + 1;
+ rects[i].bottom = hotRects.int16At(i * 4 + 3) + 1;
+ }
+
+ g_sci->getEventManager()->setHotRectanglesActive(true);
+ g_sci->getEventManager()->setHotRectangles(rects);
+ return s->r_acc;
+}
#endif
} // End of namespace Sci