simplified FTOC for aarch64
this isn't actually a good solution, really RageVColor shouldn't be doing this conversion at all and should be refactored/removed. this gets gameplay running a bit smoother, much closer to holding 60fps
This commit is contained in:
@@ -264,6 +264,13 @@ public:
|
|||||||
*
|
*
|
||||||
* should output the same value (+-1) 256 times. If this function is
|
* should output the same value (+-1) 256 times. If this function is
|
||||||
* incorrect, the first and/or last values may be biased. */
|
* incorrect, the first and/or last values may be biased. */
|
||||||
|
#ifdef CPU_AARCH64
|
||||||
|
inline unsigned char FTOC(float a)
|
||||||
|
{
|
||||||
|
const float v = a < 0.0f ? 0.0f : (a > 1.0f ? 1.0f : a);
|
||||||
|
return static_cast<unsigned char>(v * 255.0f);
|
||||||
|
}
|
||||||
|
#else
|
||||||
inline unsigned char FTOC(float a)
|
inline unsigned char FTOC(float a)
|
||||||
{
|
{
|
||||||
//This value is 2^52 * 1.5.
|
//This value is 2^52 * 1.5.
|
||||||
@@ -292,6 +299,7 @@ inline unsigned char FTOC(float a)
|
|||||||
|
|
||||||
return static_cast<unsigned char>(ret);
|
return static_cast<unsigned char>(ret);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Color type used only in vertex lists. OpenGL expects colors in
|
/* Color type used only in vertex lists. OpenGL expects colors in
|
||||||
* r, g, b, a order, independent of endianness, so storing them this
|
* r, g, b, a order, independent of endianness, so storing them this
|
||||||
|
|||||||
Reference in New Issue
Block a user