diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/common_types.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/common_types.h b/src/common/common_types.h index 25dc912a9..402410507 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h | |||
| @@ -100,16 +100,17 @@ union t128 { | |||
| 100 | __m128 a; ///< 128-bit floating point (__m128 maps to the XMM[0-7] registers) | 100 | __m128 a; ///< 128-bit floating point (__m128 maps to the XMM[0-7] registers) |
| 101 | }; | 101 | }; |
| 102 | 102 | ||
| 103 | namespace common { | ||
| 103 | /// Rectangle data structure | 104 | /// Rectangle data structure |
| 104 | class BasicRect { | 105 | class Rect { |
| 105 | public: | 106 | public: |
| 106 | BasicRect(int x0=0, int y0=0, int x1=0, int y1=0) { | 107 | Rect(int x0=0, int y0=0, int x1=0, int y1=0) { |
| 107 | x0_ = x0; | 108 | x0_ = x0; |
| 108 | y0_ = y0; | 109 | y0_ = y0; |
| 109 | x1_ = x1; | 110 | x1_ = x1; |
| 110 | y1_ = y1; | 111 | y1_ = y1; |
| 111 | } | 112 | } |
| 112 | ~BasicRect() { } | 113 | ~Rect() { } |
| 113 | 114 | ||
| 114 | int x0_; ///< Rect top left X-coordinate | 115 | int x0_; ///< Rect top left X-coordinate |
| 115 | int y0_; ///< Rect top left Y-coordinate | 116 | int y0_; ///< Rect top left Y-coordinate |
| @@ -119,7 +120,8 @@ public: | |||
| 119 | inline u32 width() const { return abs(x1_ - x0_); } | 120 | inline u32 width() const { return abs(x1_ - x0_); } |
| 120 | inline u32 height() const { return abs(y1_ - y0_); } | 121 | inline u32 height() const { return abs(y1_ - y0_); } |
| 121 | 122 | ||
| 122 | inline bool operator == (const BasicRect& val) const { | 123 | inline bool operator == (const Rect& val) const { |
| 123 | return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); | 124 | return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); |
| 124 | } | 125 | } |
| 125 | }; | 126 | }; |
| 127 | } | ||