Is there a way or method to round floating point values without converting them to integers? Other than by doing this:
IntToFloat(FloatToInt(var1, eRoundUp))
Unless this isn't inefficient, or if it's the most efficient way. This is rounding the float value and then using it again in a function.
I can't imagine that AGS would be performing a data type conversion inefficiently. And seeing as there's no other way to strip out the whole number part of a floating-point number in AGS, then I don't see any way of doing it more efficiently. If you really wanted to simplify your own code:
// Script.ash
import float RoundFloat(float value, RoundDirection=eRoundNearest);
// Script.asc
float RoundFloat(float value, RoundDirection dir)
{
return IntToFloat(FloatToInt(value, dir));
}
Awesome, thanks!