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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jan 11 17:28:47 CET 2010


Revision: 47253
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47253&view=rev
Author:   thebluegr
Date:     2010-01-11 16:28:46 +0000 (Mon, 11 Jan 2010)

Log Message:
-----------
Changed all kGraph calls which handle rectangles to use kGraphCreateRect(). Also, changed kGraphCreateRect() to return a rect, rather than update a rect pointer

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

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-11 14:26:13 UTC (rev 47252)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-11 16:28:46 UTC (rev 47253)
@@ -184,10 +184,10 @@
 	return make_reg(0, s->_gui->picNotValid(newPicNotValid));
 }
 
-void kGraphCreateRect(int16 x, int16 y, int16 x1, int16 y1, Common::Rect *destRect) {
+Common::Rect kGraphCreateRect(int16 x, int16 y, int16 x1, int16 y1) {
 	if (x > x1) SWAP(x, x1);
 	if (y > y1) SWAP(y, y1);
-	*destRect = Common::Rect(x, y, x1, y1);
+	return Common::Rect(x, y, x1, y1);
 }
 
 // Graph subfunctions
@@ -235,7 +235,7 @@
 		break;
 
 	case K_GRAPH_SAVE_BOX:
-		kGraphCreateRect(x, y, x1, y1, &rect);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		screenMask = (argc > 5) ? argv[5].toUint16() : 0;
 		return s->_gui->graphSaveBox(rect, screenMask);
 
@@ -245,12 +245,12 @@
 		break;
 
 	case K_GRAPH_FILL_BOX_BACKGROUND:
-		kGraphCreateRect(x, y, x1, y1, &rect);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		s->_gui->graphFillBoxBackground(rect);
 		break;
 
 	case K_GRAPH_FILL_BOX_FOREGROUND:
-		kGraphCreateRect(x, y, x1, y1, &rect);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		s->_gui->graphFillBoxForeground(rect);
 		break;
 
@@ -260,12 +260,12 @@
 		color = argv[6].toSint16();
 		colorMask = argv[5].toUint16();
 
-		rect = Common::Rect(x, y, x1, y1);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		s->_gui->graphFillBox(rect, colorMask, color, priority, control);
 		break;
 
 	case K_GRAPH_UPDATE_BOX: {
-		kGraphCreateRect(x, y, x1, y1, &rect);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		bool hiresMode = (argc > 6) ? true : false;
 		// argc == 7 on upscaled hires
 		s->_gui->graphUpdateBox(rect, hiresMode);
@@ -273,7 +273,7 @@
 	}
 
 	case K_GRAPH_REDRAW_BOX:
-		kGraphCreateRect(x, y, x1, y1, &rect);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		s->_gui->graphRedrawBox(rect);
 		break;
 
@@ -284,7 +284,7 @@
 		break;
 
 	case K_GRAPH_SAVE_UPSCALEDHIRES_BOX:
-		kGraphCreateRect(x, y, x1, y1, &rect);
+		rect = kGraphCreateRect(x, y, x1, y1);
 		return s->_gui->graphSaveUpscaledHiresBox(rect);
 
 	default:
@@ -708,7 +708,7 @@
 	const char **listEntries = NULL;
 	bool isAlias = false;
 
-	kGraphCreateRect(x, y, GET_SEL32V(s->_segMan, controlObject, nsRight), GET_SEL32V(s->_segMan, controlObject, nsBottom), &rect);
+	rect = kGraphCreateRect(x, y, GET_SEL32V(s->_segMan, controlObject, nsRight), GET_SEL32V(s->_segMan, controlObject, nsBottom));
 
 	if (!textReference.isNull())
 		text = s->_segMan->getString(textReference);


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