diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/common_types.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/common/common_types.h b/src/common/common_types.h index c74c74f0f..94e1406b1 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | #include <cmath> | 27 | #include <cmath> |
| 28 | #include <cstdint> | 28 | #include <cstdint> |
| 29 | #include <xmmintrin.h> // data_types__m128.cpp | 29 | #include <cstdlib> |
| 30 | 30 | ||
| 31 | typedef std::uint8_t u8; ///< 8-bit unsigned byte | 31 | typedef std::uint8_t u8; ///< 8-bit unsigned byte |
| 32 | typedef std::uint16_t u16; ///< 16-bit unsigned short | 32 | typedef std::uint16_t u16; ///< 16-bit unsigned short |
| @@ -67,16 +67,6 @@ union t64 { | |||
| 67 | u8 _u8[8]; ///< 8-bit unsigned char(s) | 67 | u8 _u8[8]; ///< 8-bit unsigned char(s) |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | /// Union for fast 128-bit type casting | ||
| 71 | union t128 { | ||
| 72 | struct | ||
| 73 | { | ||
| 74 | t64 ps0; ///< 64-bit paired single 0 | ||
| 75 | t64 ps1; ///< 64-bit paired single 1 | ||
| 76 | }; | ||
| 77 | __m128 a; ///< 128-bit floating point (__m128 maps to the XMM[0-7] registers) | ||
| 78 | }; | ||
| 79 | |||
| 80 | namespace Common { | 70 | namespace Common { |
| 81 | /// Rectangle data structure | 71 | /// Rectangle data structure |
| 82 | class Rect { | 72 | class Rect { |
| @@ -94,8 +84,8 @@ public: | |||
| 94 | int x1_; ///< Rect bottom left X-coordinate | 84 | int x1_; ///< Rect bottom left X-coordinate |
| 95 | int y1_; ///< Rect bottom right Y-coordinate | 85 | int y1_; ///< Rect bottom right Y-coordinate |
| 96 | 86 | ||
| 97 | inline u32 width() const { return abs(x1_ - x0_); } | 87 | inline u32 width() const { return std::abs(x1_ - x0_); } |
| 98 | inline u32 height() const { return abs(y1_ - y0_); } | 88 | inline u32 height() const { return std::abs(y1_ - y0_); } |
| 99 | 89 | ||
| 100 | inline bool operator == (const Rect& val) const { | 90 | inline bool operator == (const Rect& val) const { |
| 101 | return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); | 91 | return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); |