From 40d6119fd5c8a61ffb11c7744dc60f4a07388d6d Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sun, 30 Aug 2009 01:38:14 +0000 Subject: SCI: Add support for SetCursor with 4 args. svn-id: r43813 --- engines/sci/engine/kgraphics.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 89fed9d2d8..16818a9f4d 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -326,9 +326,23 @@ static reg_t kSetCursorSci11(EngineState *s, int funct_nr, int argc, reg_t *argv CursorMan.showMouse(argv[0].toSint16() != 0); break; case 2: - GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, - Common::Point(argv[0].toUint16(), argv[1].toUint16()))); + GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, + Common::Point(argv[0].toUint16() + s->port->_bounds.x, argv[1].toUint16() + s->port->_bounds.y))); break; + case 4: { + int16 top = argv[0].toSint16(); + int16 left = argv[1].toSint16(); + int16 bottom = argv[2].toSint16(); + int16 right = argv[3].toSint16(); + + if ((right >= left) && (bottom >= top)) { + Common::Rect rect = Common::Rect(left, top, right + 1, bottom + 1); + GFX_ASSERT(gfxop_set_pointer_zone(s->gfx_state, rect)); + } else { + warning("kSetCursor: Ignoring invalid mouse zone (%i, %i)-(%i, %i)", left, top, right, bottom); + } + break; + } case 5: case 9: hotspot = new Common::Point(argv[3].toSint16(), argv[4].toSint16()); -- cgit v1.2.3