diff --git a/source/Engine/Bytecode/StandardLibrary.cpp b/source/Engine/Bytecode/StandardLibrary.cpp index e30d843..1bfeaeb 100644 --- a/source/Engine/Bytecode/StandardLibrary.cpp +++ b/source/Engine/Bytecode/StandardLibrary.cpp @@ -7936,28 +7936,6 @@ VMValue Math_Clamp(int argCount, VMValue* args, Uint32 threadID) { else return DECIMAL_VAL(Math::Clamp(GET_ARG(0, GetDecimal), GET_ARG(1, GetDecimal), GET_ARG(2, GetDecimal))); } -/*** - * Math.ToFixed - * \desc Converts a decimal number to its fixed-point equivalent. - * \param n (Number): Number value. - * \return Returns the converted fixed-point Number value. - * \ns Math - */ -VMValue Math_ToFixed(int argCount, VMValue* args, Uint32 threadID) { - CHECK_ARGCOUNT(1); - return INTEGER_VAL((int)(GET_ARG(0, GetDecimal) * 65536.0f)); -} -/*** - * Math.FromFixed - * \desc Converts a fixed-point number to its decimal equivalent. - * \param n (Number): Number value. - * \return Returns the converted decimal Number value. - * \ns Math - */ -VMValue Math_FromFixed(int argCount, VMValue* args, Uint32 threadID) { - CHECK_ARGCOUNT(1); - return DECIMAL_VAL((float)GET_ARG(0, GetInteger) / 65536.0f); -} /*** * Math.Sign * \desc Gets the sign associated with a Decimal value. @@ -8384,6 +8362,28 @@ VMValue Math_IntegerToRadian(int argCount, VMValue* args, Uint32 threadID) { CHECK_ARGCOUNT(1); return DECIMAL_VAL((float)(GET_ARG(0, GetInteger) * M_PI / 256.0)); } +/*** + * RSDK.Math.ToFixed + * \desc Converts a decimal number to its fixed-point equivalent. + * \param n (Number): Number value. + * \return Returns the converted fixed-point Number value. + * \ns Math + */ +VMValue Math_ToFixed(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(1); + return INTEGER_VAL((int)(GET_ARG(0, GetDecimal) * 65536.0f)); +} +/*** + * RSDK.Math.FromFixed + * \desc Converts a fixed-point number to its decimal equivalent. + * \param n (Number): Number value. + * \return Returns the converted decimal Number value. + * \ns Math + */ +VMValue Math_FromFixed(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(1); + return DECIMAL_VAL((float)GET_ARG(0, GetInteger) / 65536.0f); +} // #endregion // #region Matrix @@ -17972,8 +17972,6 @@ void StandardLibrary::Link() { DEF_NATIVE(Math, Min); DEF_NATIVE(Math, Max); DEF_NATIVE(Math, Clamp); - DEF_NATIVE(Math, ToFixed); - DEF_NATIVE(Math, FromFixed); DEF_NATIVE(Math, Sign); DEF_NATIVE(Math, Uint8); DEF_NATIVE(Math, Uint16); @@ -18016,6 +18014,8 @@ void StandardLibrary::Link() { DEF_NAMESPACED_NATIVE(Math, SetRandSeed); DEF_NAMESPACED_NATIVE(Math, RandomInteger); DEF_NAMESPACED_NATIVE(Math, RandomIntegerSeeded); + DEF_NAMESPACED_NATIVE(Math, ToFixed); + DEF_NAMESPACED_NATIVE(Math, FromFixed); // #endregion // #region Matrix