Fix wrapi to use int64_t instead int
This commit is contained in:
parent
88a36e20cb
commit
bc4d781277
|
@ -217,8 +217,8 @@ public:
|
||||||
static _ALWAYS_INLINE_ double round(double p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); }
|
static _ALWAYS_INLINE_ double round(double p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); }
|
||||||
static _ALWAYS_INLINE_ float round(float p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); }
|
static _ALWAYS_INLINE_ float round(float p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); }
|
||||||
|
|
||||||
static _ALWAYS_INLINE_ int wrapi(int value, int min, int max) {
|
static _ALWAYS_INLINE_ int64_t wrapi(int64_t value, int64_t min, int64_t max) {
|
||||||
int rng = max - min;
|
int64_t rng = max - min;
|
||||||
return (rng != 0) ? min + ((((value - min) % rng) + rng) % rng) : min;
|
return (rng != 0) ? min + ((((value - min) % rng) + rng) % rng) : min;
|
||||||
}
|
}
|
||||||
static _ALWAYS_INLINE_ double wrapf(double value, double min, double max) {
|
static _ALWAYS_INLINE_ double wrapf(double value, double min, double max) {
|
||||||
|
|
Loading…
Reference in New Issue