mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-14 00:21:38 +00:00
Flesh out Fix16 with some operators we need to work with it from CON
git-svn-id: https://svn.eduke32.com/eduke32@6726 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a76750df55
commit
5f13160dd6
1 changed files with 141 additions and 115 deletions
|
@ -49,6 +49,32 @@ class Fix16 {
|
||||||
Fix16 & operator/=(const float rhs) { value = fix16_div(value, fix16_from_float(rhs)); return *this; }
|
Fix16 & operator/=(const float rhs) { value = fix16_div(value, fix16_from_float(rhs)); return *this; }
|
||||||
Fix16 & operator/=(const int16_t rhs) { value /= rhs; return *this; }
|
Fix16 & operator/=(const int16_t rhs) { value /= rhs; return *this; }
|
||||||
|
|
||||||
|
Fix16 & operator%=(const Fix16 &rhs) { value = fix16_mod(value, rhs.value); return *this; }
|
||||||
|
Fix16 & operator%=(const fix16_t rhs) { value = fix16_mod(value, rhs); return *this; }
|
||||||
|
Fix16 & operator%=(const double rhs) { value = fix16_mod(value, fix16_from_dbl(rhs)); return *this; }
|
||||||
|
Fix16 & operator%=(const float rhs) { value = fix16_mod(value, fix16_from_float(rhs)); return *this; }
|
||||||
|
Fix16 & operator%=(const int16_t rhs) { value %= rhs; return *this; }
|
||||||
|
|
||||||
|
Fix16 & operator&=(const Fix16 &rhs) { value = fix16_from_int(fix16_to_int(value) & fix16_to_int(rhs.value)); return *this; }
|
||||||
|
Fix16 & operator&=(const fix16_t rhs) { value = fix16_from_int(fix16_to_int(value) & fix16_to_int(rhs)); return *this; }
|
||||||
|
Fix16 & operator&=(const int16_t rhs) { value = fix16_from_int(fix16_to_int(value) & rhs); return *this; }
|
||||||
|
|
||||||
|
Fix16 & operator^=(const Fix16 &rhs) { value = fix16_from_int(fix16_to_int(value) ^ fix16_to_int(rhs.value)); return *this; }
|
||||||
|
Fix16 & operator^=(const fix16_t rhs) { value = fix16_from_int(fix16_to_int(value) ^ fix16_to_int(rhs)); return *this; }
|
||||||
|
Fix16 & operator^=(const int16_t rhs) { value = fix16_from_int(fix16_to_int(value) ^ rhs); return *this; }
|
||||||
|
|
||||||
|
Fix16 & operator|=(const Fix16 &rhs) { value = fix16_from_int(fix16_to_int(value) | fix16_to_int(rhs.value)); return *this; }
|
||||||
|
Fix16 & operator|=(const fix16_t rhs) { value = fix16_from_int(fix16_to_int(value) | fix16_to_int(rhs)); return *this; }
|
||||||
|
Fix16 & operator|=(const int16_t rhs) { value = fix16_from_int(fix16_to_int(value) | rhs); return *this; }
|
||||||
|
|
||||||
|
Fix16 & operator<<=(const Fix16 &rhs) { value <<= rhs.value; return *this; }
|
||||||
|
Fix16 & operator<<=(const fix16_t rhs) { value <<= rhs; return *this; }
|
||||||
|
Fix16 & operator<<=(const int16_t rhs) { value <<= fix16_from_int(rhs); return *this; }
|
||||||
|
|
||||||
|
Fix16 & operator>>=(const Fix16 &rhs) { value >>= rhs.value; return *this; }
|
||||||
|
Fix16 & operator>>=(const fix16_t rhs) { value >>= rhs; return *this; }
|
||||||
|
Fix16 & operator>>=(const int16_t rhs) { value >>= fix16_from_int(rhs); return *this; }
|
||||||
|
|
||||||
const Fix16 operator+(const Fix16 &other) const { Fix16 ret = *this; ret += other; return ret; }
|
const Fix16 operator+(const Fix16 &other) const { Fix16 ret = *this; ret += other; return ret; }
|
||||||
const Fix16 operator+(const fix16_t other) const { Fix16 ret = *this; ret += other; return ret; }
|
const Fix16 operator+(const fix16_t other) const { Fix16 ret = *this; ret += other; return ret; }
|
||||||
const Fix16 operator+(const double other) const { Fix16 ret = *this; ret += other; return ret; }
|
const Fix16 operator+(const double other) const { Fix16 ret = *this; ret += other; return ret; }
|
||||||
|
|
Loading…
Reference in a new issue