diff options
author | Eugene Sandulenko | 2005-09-02 08:51:58 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-09-02 08:51:58 +0000 |
commit | 636dd6e6d6d27227067f3787148e725f9d091da4 (patch) | |
tree | 5da359f282cbbe3e88c1b546143a30024843337c /common | |
parent | a33603e0ebab1966395f440dbd98e11b82be6e51 (diff) | |
download | scummvm-rg350-636dd6e6d6d27227067f3787148e725f9d091da4.tar.gz scummvm-rg350-636dd6e6d6d27227067f3787148e725f9d091da4.tar.bz2 scummvm-rg350-636dd6e6d6d27227067f3787148e725f9d091da4.zip |
Add debuggins method. Whitespace fixes.
svn-id: r18729
Diffstat (limited to 'common')
-rw-r--r-- | common/rect.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/common/rect.h b/common/rect.h index afa1aa09cf..55cbaec566 100644 --- a/common/rect.h +++ b/common/rect.h @@ -36,7 +36,7 @@ struct Point { 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 @@ struct Rect { @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 @@ struct Rect { @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 @@ struct Rect { @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 @@ struct Rect { right += offset; } - void clip(const Rect & r) { + void clip(const Rect &r) { assert(isValidRect()); assert(r.isValidRect()); @@ -166,9 +166,13 @@ struct Rect { 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 |