Changeset 1150
- Timestamp:
- Mar 2, 2012, 6:48:55 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/half.h
r1146 r1150 67 67 68 68 /* Operations */ 69 inline half operator -() { return makebits(bits ^ 0x8000u); } 69 bool operator ==(half x) const { return (float)*this == (float)x; } 70 bool operator !=(half x) const { return (float)*this != (float)x; } 71 bool operator <(half x) const { return (float)*this < (float)x; } 72 bool operator >(half x) const { return (float)*this > (float)x; } 73 bool operator <=(half x) const { return (float)*this <= (float)x; } 74 bool operator >=(half x) const { return (float)*this >= (float)x; } 75 76 bool operator !() const { return !(bool)*this; } 77 operator bool() const { return bits & 0x7fffu; } 78 79 inline half operator -() const { return makebits(bits ^ 0x8000u); } 80 inline half operator +() const { return *this; } 70 81 inline half &operator +=(float f) { return (*this = (half)(*this + f)); } 71 82 inline half &operator -=(float f) { return (*this = (half)(*this - f)); } -
trunk/src/lol/math/vector.h
r1149 r1150 1053 1053 DECLARE_BOOL_OP(tname, >, >, true, tprefix, T) 1054 1054 1055 /* FIXME: a few problems need to be fixed before we can use "half" here. It1056 * will probably never work until we switch to C++11 because it's not really1057 * a POD class. */1058 1055 #define DECLARE_GLOBAL_TYPED_OPS(tname) \ 1056 DECLARE_ALL_GLOBAL_OPS(tname, /* empty */, half) \ 1059 1057 DECLARE_ALL_GLOBAL_OPS(tname, /* empty */, float) \ 1060 1058 DECLARE_ALL_GLOBAL_OPS(tname, /* empty */, double) \
Note: See TracChangeset
for help on using the changeset viewer.