aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2010-08-21 08:17:06 +0000
committerPaul Gilbert2010-08-21 08:17:06 +0000
commit5c30303794da71a4f48704d2b4e7e04e7ddce178 (patch)
tree4a3a208352cfb2b2867e19c6dfbed1fefe624777
parent10066443b06cb0f47f0f3b4bb107ee94439e030a (diff)
downloadscummvm-rg350-5c30303794da71a4f48704d2b4e7e04e7ddce178.tar.gz
scummvm-rg350-5c30303794da71a4f48704d2b4e7e04e7ddce178.tar.bz2
scummvm-rg350-5c30303794da71a4f48704d2b4e7e04e7ddce178.zip
COMMON: Added equality operators to Common::Rect
svn-id: r52249
-rw-r--r--common/rect.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/rect.h b/common/rect.h
index dc97dcceec..326f481f3b 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -90,6 +90,9 @@ struct Rect {
Rect(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) {
assert(isValidRect());
}
+ bool operator==(const Rect &rhs) const { return equals(rhs); }
+ bool operator!=(const Rect &rhs) const { return !equals(rhs); }
+
int16 width() const { return right - left; }
int16 height() const { return bottom - top; }