20 #include "../basic_types.h"
32 template<
typename rtype, const
int precision,
typename optype>
36 inline static rtype
clamp(
const float val,
const rtype
min,
const rtype
max) {
61 this->value = ((optype)
value) << precision;
82 operator float()
const {
83 return (
float)
value / (float)(1 << precision);
88 const optype
v = (((optype)
value) * 255) >> precision;
89 return v <= 0 ? 0 : v >= 255 ? 255 : (uint8_t)
v;
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
Fixed operator/(const Fixed &another) const
Fixed operator+(const Fixed &another) const
Fixed & operator=(const rtype value)
Fixed & operator=(const float value)
Fixed(const Fixed &another)
Fixed operator-(const Fixed &another) const
Fixed operator*(const Fixed &another) const
static rtype fromFloat(const float val)
static rtype clamp(const float val, const rtype min, const rtype max)
static Fixed interpret(const underlying_type value)
uint8_t asTexture() const
#define roundf_fast(X)
rounding (nearest integer)
return(jlong) new Beatmup jlong jstring jint val
JNIEnv jlong jfloat jfloat jfloat v