From 945a0e56033cc0b5312fcc790f84716065c57041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 17 Dec 2023 19:23:19 +0100 Subject: [PATCH] Fixed Half --- GlitchyEngine/src/Scripting/ScriptGlue.bf | 38 +++++++++++------------ ScriptCore/Math/Half.cs | 3 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/GlitchyEngine/src/Scripting/ScriptGlue.bf b/GlitchyEngine/src/Scripting/ScriptGlue.bf index 03d5df0..a32527d 100644 --- a/GlitchyEngine/src/Scripting/ScriptGlue.bf +++ b/GlitchyEngine/src/Scripting/ScriptGlue.bf @@ -471,28 +471,28 @@ static class ScriptGlue private static void RegisterHalfFunctions() { - RegisterCall("Math.MyHalf::FromFloat32", (value, halfValue) => halfValue = GlitchyEngine.Math.half.FromFloat32(value)); - RegisterCall("Math.MyHalf::ToFloat32", (value, floatValue) => floatValue = GlitchyEngine.Math.half.ToFloat32(value)); + RegisterCall("Math.Half::FromFloat32", (value, halfValue) => halfValue = GlitchyEngine.Math.half.FromFloat32(value)); + RegisterCall("Math.Half::ToFloat32", (value, floatValue) => floatValue = GlitchyEngine.Math.half.ToFloat32(value)); - RegisterCall("Math.MyHalf::LessThan_Impl", (left, right, result) => result = left < right); - RegisterCall("Math.MyHalf::LessThanOrEqual_Impl", (left, right, result) => result = left <= right); - RegisterCall("Math.MyHalf::GreaterThan_Impl", (left, right, result) => result = left > right); - RegisterCall("Math.MyHalf::GreaterThanOrEqual_Impl", (left, right, result) => result = left >= right); + RegisterCall("Math.Half::LessThan_Impl", (left, right, result) => result = left < right); + RegisterCall("Math.Half::LessThanOrEqual_Impl", (left, right, result) => result = left <= right); + RegisterCall("Math.Half::GreaterThan_Impl", (left, right, result) => result = left > right); + RegisterCall("Math.Half::GreaterThanOrEqual_Impl", (left, right, result) => result = left >= right); - RegisterCall("Math.MyHalf::Add_Impl", (left, right, result) => result = left + right); - RegisterCall("Math.MyHalf::Subtract_Impl", (left, right, result) => result = left - right); - RegisterCall("Math.MyHalf::Multiply_Impl", (left, right, result) => result = left * right); - RegisterCall("Math.MyHalf::Divide_Impl", (left, right, result) => result = left / right); - RegisterCall("Math.MyHalf::Modulo_Impl", (left, right, result) => result = left % right); - RegisterCall("Math.MyHalf::Negate_Impl", (value, result) => result = -value); - RegisterCall("Math.MyHalf::Increment_Impl", (value, result) => result = ++value); - RegisterCall("Math.MyHalf::Decrement_Impl", (value, result) => result = --value); + RegisterCall("Math.Half::Add_Impl", (left, right, result) => result = left + right); + RegisterCall("Math.Half::Subtract_Impl", (left, right, result) => result = left - right); + RegisterCall("Math.Half::Multiply_Impl", (left, right, result) => result = left * right); + RegisterCall("Math.Half::Divide_Impl", (left, right, result) => result = left / right); + RegisterCall("Math.Half::Modulo_Impl", (left, right, result) => result = left % right); + RegisterCall("Math.Half::Negate_Impl", (value, result) => result = -value); + RegisterCall("Math.Half::Increment_Impl", (value, result) => result = ++value); + RegisterCall("Math.Half::Decrement_Impl", (value, result) => result = --value); - RegisterCall("Math.MyHalf::IsNegative_Impl", (value) => value.IsNegative); - RegisterCall("Math.MyHalf::IsFinite_Impl", (value) => value.IsFinite); - RegisterCall("Math.MyHalf::IsInfinity_Impl", (value) => value.IsInfinity); - RegisterCall("Math.MyHalf::IsNan_Impl", (value) => value.IsNaN); - RegisterCall("Math.MyHalf::IsSubnormal_Impl", (value) => value.IsSubnormal); + RegisterCall("Math.Half::IsNegative_Impl", (value) => value.IsNegative); + RegisterCall("Math.Half::IsFinite_Impl", (value) => value.IsFinite); + RegisterCall("Math.Half::IsInfinity_Impl", (value) => value.IsInfinity); + RegisterCall("Math.Half::IsNan_Impl", (value) => value.IsNaN); + RegisterCall("Math.Half::IsSubnormal_Impl", (value) => value.IsSubnormal); } #endregion diff --git a/ScriptCore/Math/Half.cs b/ScriptCore/Math/Half.cs index 63e77ca..1643696 100644 --- a/ScriptCore/Math/Half.cs +++ b/ScriptCore/Math/Half.cs @@ -38,7 +38,8 @@ public struct Half : IComparable , IComparable, IConvertible, IEquatable