X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmath%2FFixed.h;h=7fe099cee57ea789f0cc631f9397c89da6165e94;hb=c49d46cbfbd7720627af2414e94963850fe8eed6;hp=a3982755dea86c8d147229fe0e19c33fb1caf2e4;hpb=5d1a76ae7725af998c6ee46adfe492c68ee1d34f;p=l2e.git diff --git a/src/math/Fixed.h b/src/math/Fixed.h index a398275..7fe099c 100644 --- a/src/math/Fixed.h +++ b/src/math/Fixed.h @@ -96,7 +96,8 @@ public: } return *this; } - Fixed &operator +=(int i) { + template + Fixed &operator +=(Scalar i) { Sint32 temp = SignedInt() + (i << IntShift()); if (temp < 0) { rep = (temp * -1) | SignMask(); @@ -114,7 +115,8 @@ public: } return *this; } - Fixed &operator -=(int i) { + template + Fixed &operator -=(Scalar i) { Sint32 temp = SignedInt() - (i << IntShift()); if (temp < 0) { rep = (temp * -1) | SignMask(); @@ -134,7 +136,8 @@ public: } return *this; } - Fixed &operator *=(int i) { + template + Fixed &operator *=(Scalar i) { Sint32 temp = SignedInt() * i; if (temp < 0) { rep = (temp * -1) | SignMask(); @@ -154,7 +157,8 @@ public: } return *this; } - Fixed &operator /=(int i) { + template + Fixed &operator /=(Scalar i) { Sint32 temp = SignedInt() / i; if (temp < 0) { rep = (temp * -1) | SignMask();