[Scummvm-cvs-logs] SF.net SVN: scummvm:[51202] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Fri Jul 23 12:58:06 CEST 2010
Revision: 51202
http://scummvm.svn.sourceforge.net/scummvm/?rev=51202&view=rev
Author: m_kiewitz
Date: 2010-07-23 10:58:06 +0000 (Fri, 23 Jul 2010)
Log Message:
-----------
SCI: support kSetCursorSci11(-2)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/graphics/cursor.cpp
scummvm/trunk/engines/sci/graphics/cursor.h
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-23 10:53:21 UTC (rev 51201)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-23 10:58:06 UTC (rev 51202)
@@ -129,9 +129,10 @@
break;
case -1:
// TODO: Special case at least in kq6, check disassembly
+ // Does something with magCursor, which is set on argc = 10, which we don't support
break;
case -2:
- // TODO: Special case at least in kq6, check disassembly
+ g_sci->_gfxCursor->kernelResetMoveZone();
break;
default:
g_sci->_gfxCursor->kernelShow();
Modified: scummvm/trunk/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.cpp 2010-07-23 10:53:21 UTC (rev 51201)
+++ scummvm/trunk/engines/sci/graphics/cursor.cpp 2010-07-23 10:58:06 UTC (rev 51202)
@@ -47,7 +47,7 @@
// center mouse cursor
setPosition(Common::Point(_screen->getWidth() / 2, _screen->getHeight() / 2));
- kernelSetMoveZone(Common::Rect(0, 0, _screen->getDisplayWidth(), _screen->getDisplayHeight()));
+ _moveZoneActive = false;
}
GfxCursor::~GfxCursor() {
@@ -283,32 +283,39 @@
}
void GfxCursor::refreshPosition() {
- bool clipped = false;
- Common::Point mousePoint = getPosition();
+ if (_moveZoneActive) {
+ bool clipped = false;
+ Common::Point mousePoint = getPosition();
- if (mousePoint.x < _moveZone.left) {
- mousePoint.x = _moveZone.left;
- clipped = true;
- } else if (mousePoint.x >= _moveZone.right) {
- mousePoint.x = _moveZone.right - 1;
- clipped = true;
- }
+ if (mousePoint.x < _moveZone.left) {
+ mousePoint.x = _moveZone.left;
+ clipped = true;
+ } else if (mousePoint.x >= _moveZone.right) {
+ mousePoint.x = _moveZone.right - 1;
+ clipped = true;
+ }
- if (mousePoint.y < _moveZone.top) {
- mousePoint.y = _moveZone.top;
- clipped = true;
- } else if (mousePoint.y >= _moveZone.bottom) {
- mousePoint.y = _moveZone.bottom - 1;
- clipped = true;
+ if (mousePoint.y < _moveZone.top) {
+ mousePoint.y = _moveZone.top;
+ clipped = true;
+ } else if (mousePoint.y >= _moveZone.bottom) {
+ mousePoint.y = _moveZone.bottom - 1;
+ clipped = true;
+ }
+
+ // FIXME: Do this only when mouse is grabbed?
+ if (clipped)
+ setPosition(mousePoint);
}
+}
- // FIXME: Do this only when mouse is grabbed?
- if (clipped)
- setPosition(mousePoint);
+void GfxCursor::kernelResetMoveZone() {
+ _moveZoneActive = false;
}
void GfxCursor::kernelSetMoveZone(Common::Rect zone) {
- _moveZone = zone;
+ _moveZone = zone;
+ _moveZoneActive = true;
}
void GfxCursor::kernelSetPos(Common::Point pos) {
Modified: scummvm/trunk/engines/sci/graphics/cursor.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.h 2010-07-23 10:53:21 UTC (rev 51201)
+++ scummvm/trunk/engines/sci/graphics/cursor.h 2010-07-23 10:58:06 UTC (rev 51202)
@@ -58,6 +58,11 @@
void refreshPosition();
/**
+ * Removes limit for mouse movement
+ */
+ void kernelResetMoveZone();
+
+ /**
* Limits the mouse movement to a given rectangle.
*
* @param[in] rect The rectangle
@@ -78,6 +83,7 @@
int _upscaledHires;
+ bool _moveZoneActive;
Common::Rect _moveZone; // Rectangle in which the pointer can move
CursorCache _cachedCursors;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list