Removing reliance on floorf and ceilf CRT functions.

This commit is contained in:
Branimir Karadžić
2018-01-04 21:50:31 -08:00
parent ae8fd89b62
commit fd8cc08fdb
4 changed files with 40 additions and 13 deletions

View File

@@ -67,14 +67,20 @@ namespace bx
return ::sqrtf(_a);
}
float ffloor(float _f)
float ffloor(float _a)
{
return ::floorf(_f);
}
if (_a < 0.0f)
{
const float fr = ffract(-_a);
float result = -_a - fr;
float fceil(float _f)
{
return ::ceilf(_f);
return -(0.0f != fr
? result + 1.0f
: result)
;
}
return _a - ffract(_a);
}
void mtxLookAtImpl(float* _result, const float* _eye, const float* _view, const float* _up)