[Scummvm-cvs-logs] CVS: scummvm/common rect.h,1.27,1.28

Eugene Sandulenko sev at users.sourceforge.net
Fri Sep 2 01:53:02 CEST 2005


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25121

Modified Files:
	rect.h 
Log Message:
Add debuggins method. Whitespace fixes.


Index: rect.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/rect.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- rect.h	30 Jul 2005 21:10:57 -0000	1.27
+++ rect.h	2 Sep 2005 08:51:58 -0000	1.28
@@ -36,7 +36,7 @@
 	int16 y;	//!< The vertical part of the point
 
 	Point() : x(0), y(0) {};
-	Point(const Point & p) : x(p.x), y(p.y) {};
+	Point(const Point &p) : x(p.x), y(p.y) {};
 	explicit Point(int16 x1, int16 y1) : x(x1), y(y1) {};
 	Point & operator=(const Point & p) { x = p.x; y = p.y; return *this; };
 	bool operator==(const Point & p) const { return x == p.x && y == p.y; };
@@ -98,7 +98,7 @@
 
 		@return true if the given point is inside this rectangle, false otherwise
 	*/
-	bool contains(const Point & p) const {
+	bool contains(const Point &p) const {
 		return contains(p.x, p.y);
 	}
 
@@ -108,7 +108,7 @@
 
 		@return true if the given rectangle is inside the rectangle, false otherwise
 	*/
-	bool intersects(const Rect & r) const {
+	bool intersects(const Rect &r) const {
 		return (left < r.right) && (r.left < right) && (top < r.bottom) && (r.top < bottom);
 	}
 
@@ -116,7 +116,7 @@
 
 		@param r the rectangle to extend by
 	*/
-	void extend(const Rect & r) {
+	void extend(const Rect &r) {
 		left = MIN(left, r.left);
 		right = MAX(right, r.right);
 		top = MIN(top, r.top);
@@ -134,7 +134,7 @@
 		right += offset;
 	}
 
-	void clip(const Rect & r) {
+	void clip(const Rect &r) {
 		assert(isValidRect());
 		assert(r.isValidRect());
 
@@ -166,9 +166,13 @@
 		left = x;
 	}
 
-	void moveTo(const Point & p) {
+	void moveTo(const Point &p) {
 		moveTo(p.x, p.y);
 	}
+
+	void debugPrint(int debuglevel = 0, const char *caption = "Rect:") const {
+		debug(debuglevel, "%s %d, %d, %d, %d", caption, left, top, right, bottom);
+	}
 };
 
 }	// End of namespace Common





More information about the Scummvm-git-logs mailing list