[Scummvm-cvs-logs] SF.net SVN: scummvm:[40120] scummvm/trunk/engines/sci/engine/kgraphics.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Apr 24 18:47:56 CEST 2009


Revision: 40120
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40120&view=rev
Author:   thebluegr
Date:     2009-04-24 16:47:56 +0000 (Fri, 24 Apr 2009)

Log Message:
-----------
Merged kSetCursor and kSetCursorNew, and changed KQ5 CD to use the newer kSetCursor version

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-04-24 15:14:26 UTC (rev 40119)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-04-24 16:47:56 UTC (rev 40120)
@@ -292,7 +292,7 @@
 	return retval;
 }
 
-reg_t kSetCursorNew(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	switch (argc) {
 	case 1 :
 		if (UKPV(0) == 0) {
@@ -306,14 +306,29 @@
 			s->mouse_pointer_loop = s->save_mouse_pointer_loop;
 			s->mouse_pointer_cel = s->save_mouse_pointer_cel;
 		}
-	case 2 : {
-		Common::Point pt;
-		pt.x = UKPV(0);
-		pt.y = UKPV(1);
+	case 2 : 
+	case 4 :
+		if (s->version >= SCI_VERSION(1, 1, 0) ||
+			s->_gameName.equalsIgnoreCase("eco") ||
+			(s->_gameName.equalsIgnoreCase("KQ5") && s->version == SCI_VERSION(1, 000, 784))	// KQ5 CD
+			) {
+			GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, Common::Point(UKPV(0), UKPV(1))));
+		} else {
+			if (SKPV_OR_ALT(1, 1)) {
+				s->mouse_pointer_view = SKPV(0);
+			} else
+				s->mouse_pointer_view = GFXOP_NO_POINTER;
 
-		GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, pt));
+			s->mouse_pointer_loop = s->mouse_pointer_cel = 0; // Not used with cursor-format pointers
+
+			GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, s->mouse_pointer_view));
+
+			if (argc > 2) {
+				Common::Point newpos = Common::Point(SKPV(2) + s->port->_bounds.x, SKPV(3) + s->port->_bounds.y);
+				GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, newpos));
+			}
+		}
 		break;
-	}
 	case 3 : {
 		GFX_ASSERT(gfxop_set_pointer_view(s->gfx_state, UKPV(0), UKPV(1), UKPV(2), NULL));
 		s->mouse_pointer_view = UKPV(0);
@@ -336,29 +351,6 @@
 	return s->r_acc;
 }
 
-reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {
-	if (s->version >= SCI_VERSION(1, 001, 000) ||
-		s->_gameName.equalsIgnoreCase("eco")) {    // Eco Quest 1 needs kSetCursorNew
-		return kSetCursorNew(s, funct_nr, argc, argv);
-	}
-
-	if (SKPV_OR_ALT(1, 1)) {
-		s->mouse_pointer_view = SKPV(0);
-	} else
-		s->mouse_pointer_view = GFXOP_NO_POINTER;
-
-	s->mouse_pointer_loop = s->mouse_pointer_cel = 0; // Not used with cursor-format pointers
-
-	GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, s->mouse_pointer_view));
-
-	if (argc > 2) {
-		Common::Point newpos = Common::Point(SKPV(2) + s->port->_bounds.x, SKPV(3) + s->port->_bounds.y);
-		GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, newpos));
-	}
-
-	return s->r_acc;
-}
-
 extern int oldx, oldy;
 
 reg_t kMoveCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {


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