diff --git a/Backends/HTML5/kha/SystemImpl.hx b/Backends/HTML5/kha/SystemImpl.hx index 86eeaf17f..cbe352987 100644 --- a/Backends/HTML5/kha/SystemImpl.hx +++ b/Backends/HTML5/kha/SystemImpl.hx @@ -1,22 +1,23 @@ package kha; -import js.Syntax; -import js.html.webgl.GL; -import js.html.WheelEvent; import js.Browser; -import js.html.WebSocket; +import js.Syntax; import js.html.CanvasElement; +import js.html.ClipboardEvent; +import js.html.DeviceMotionEvent; +import js.html.DeviceOrientationEvent; import js.html.KeyboardEvent; import js.html.MouseEvent; import js.html.Touch; import js.html.TouchEvent; -import js.html.ClipboardEvent; -import js.html.DeviceMotionEvent; -import js.html.DeviceOrientationEvent; +import js.html.WebSocket; +import js.html.WheelEvent; +import js.html.webgl.GL; +import kha.System; import kha.graphics4.TextureFormat; import kha.input.Gamepad; -import kha.input.Keyboard; import kha.input.KeyCode; +import kha.input.Keyboard; import kha.input.Mouse; import kha.input.Sensor; import kha.input.Surface; @@ -24,7 +25,6 @@ import kha.js.AudioElementAudio; import kha.js.CanvasGraphics; import kha.js.MobileWebAudio; import kha.js.vr.VrInterface; -import kha.System; using StringTools; diff --git a/Sources/kha/WindowMode.hx b/Sources/kha/WindowMode.hx index 5f826243d..a58b08715 100644 --- a/Sources/kha/WindowMode.hx +++ b/Sources/kha/WindowMode.hx @@ -1,7 +1,6 @@ package kha; -@:enum -abstract WindowMode(Int) { +enum abstract WindowMode(Int) { var Windowed = 0; // Use an ordinary window var Fullscreen = 1; // Regular fullscreen mode var ExclusiveFullscreen = 2; // Exclusive fullscreen mode (switches monitor resolution, Windows only) diff --git a/Sources/kha/WindowOptions.hx b/Sources/kha/WindowOptions.hx index 3b0c2acd1..a2b125126 100644 --- a/Sources/kha/WindowOptions.hx +++ b/Sources/kha/WindowOptions.hx @@ -1,6 +1,6 @@ package kha; -@:enum abstract WindowFeatures(Int) to Int { +enum abstract WindowFeatures(Int) to Int { var None = 0; var FeatureResizable = 1; var FeatureMinimizable = 2; diff --git a/Sources/kha/graphics4/BlendingFactor.hx b/Sources/kha/graphics4/BlendingFactor.hx index 197562147..ff824b90d 100644 --- a/Sources/kha/graphics4/BlendingFactor.hx +++ b/Sources/kha/graphics4/BlendingFactor.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract BlendingFactor(Int) to Int { +enum abstract BlendingFactor(Int) to Int { var Undefined = 0; var BlendOne = 1; var BlendZero = 2; diff --git a/Sources/kha/graphics4/BlendingOperation.hx b/Sources/kha/graphics4/BlendingOperation.hx index aaaaaf363..84aad22fe 100644 --- a/Sources/kha/graphics4/BlendingOperation.hx +++ b/Sources/kha/graphics4/BlendingOperation.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract BlendingOperation(Int) to Int { +enum abstract BlendingOperation(Int) to Int { var Add = 0; var Subtract = 1; var ReverseSubtract = 2; diff --git a/Sources/kha/graphics4/CompareMode.hx b/Sources/kha/graphics4/CompareMode.hx index 2886e283f..364a04228 100644 --- a/Sources/kha/graphics4/CompareMode.hx +++ b/Sources/kha/graphics4/CompareMode.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract CompareMode(Int) to Int { +enum abstract CompareMode(Int) to Int { var Always = 0; var Never = 1; var Equal = 2; diff --git a/Sources/kha/graphics4/CullMode.hx b/Sources/kha/graphics4/CullMode.hx index 5e717d1c6..8002908fd 100644 --- a/Sources/kha/graphics4/CullMode.hx +++ b/Sources/kha/graphics4/CullMode.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract CullMode(Int) to Int { +enum abstract CullMode(Int) to Int { var Clockwise = 0; var CounterClockwise = 1; var None = 2; diff --git a/Sources/kha/graphics4/DepthStencilFormat.hx b/Sources/kha/graphics4/DepthStencilFormat.hx index b2e8d53db..c4909f856 100644 --- a/Sources/kha/graphics4/DepthStencilFormat.hx +++ b/Sources/kha/graphics4/DepthStencilFormat.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract DepthStencilFormat(Int) to Int { +enum abstract DepthStencilFormat(Int) to Int { var NoDepthAndStencil = 0; var DepthOnly = 1; var DepthAutoStencilAuto = 2; diff --git a/Sources/kha/graphics4/MipMapFilter.hx b/Sources/kha/graphics4/MipMapFilter.hx index 884cbc148..82eb6f0f4 100644 --- a/Sources/kha/graphics4/MipMapFilter.hx +++ b/Sources/kha/graphics4/MipMapFilter.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract MipMapFilter(Int) to Int { +enum abstract MipMapFilter(Int) to Int { var NoMipFilter = 0; var PointMipFilter = 1; var LinearMipFilter = 2; // linear texture filter + linear mip filter -> trilinear filter diff --git a/Sources/kha/graphics4/StencilAction.hx b/Sources/kha/graphics4/StencilAction.hx index d2b58cb08..b70c3f2fa 100644 --- a/Sources/kha/graphics4/StencilAction.hx +++ b/Sources/kha/graphics4/StencilAction.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract StencilAction(Int) to Int { +enum abstract StencilAction(Int) to Int { var Keep = 0; var Zero = 1; var Replace = 2; diff --git a/Sources/kha/graphics4/TexDir.hx b/Sources/kha/graphics4/TexDir.hx index 9b94508ff..6e7fb5b3e 100644 --- a/Sources/kha/graphics4/TexDir.hx +++ b/Sources/kha/graphics4/TexDir.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract TexDir(Int) to Int { +enum abstract TexDir(Int) to Int { var U = 0; var V = 1; } diff --git a/Sources/kha/graphics4/TextureAddressing.hx b/Sources/kha/graphics4/TextureAddressing.hx index 95373e5cb..65060ea84 100644 --- a/Sources/kha/graphics4/TextureAddressing.hx +++ b/Sources/kha/graphics4/TextureAddressing.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract TextureAddressing(Int) to Int { +enum abstract TextureAddressing(Int) to Int { var Repeat = 0; var Mirror = 1; var Clamp = 2; diff --git a/Sources/kha/graphics4/TextureFilter.hx b/Sources/kha/graphics4/TextureFilter.hx index cd3d97208..61ee9cea8 100644 --- a/Sources/kha/graphics4/TextureFilter.hx +++ b/Sources/kha/graphics4/TextureFilter.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract TextureFilter(Int) to Int { +enum abstract TextureFilter(Int) to Int { var PointFilter = 0; var LinearFilter = 1; var AnisotropicFilter = 2; diff --git a/Sources/kha/graphics4/TextureFormat.hx b/Sources/kha/graphics4/TextureFormat.hx index 9dff8b968..ce2db7479 100644 --- a/Sources/kha/graphics4/TextureFormat.hx +++ b/Sources/kha/graphics4/TextureFormat.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract TextureFormat(Int) to Int { +enum abstract TextureFormat(Int) to Int { var RGBA32 = 0; var L8 = 1; var RGBA128 = 2; // Floats diff --git a/Sources/kha/graphics4/Usage.hx b/Sources/kha/graphics4/Usage.hx index 63a79546c..52d58aac0 100644 --- a/Sources/kha/graphics4/Usage.hx +++ b/Sources/kha/graphics4/Usage.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract Usage(Int) to Int { +enum abstract Usage(Int) to Int { var StaticUsage = 0; var DynamicUsage = 1; // Just calling it Dynamic causes problems in C++ var ReadableUsage = 2; diff --git a/Sources/kha/graphics4/VertexData.hx b/Sources/kha/graphics4/VertexData.hx index 0e98edbc2..15b5ad735 100644 --- a/Sources/kha/graphics4/VertexData.hx +++ b/Sources/kha/graphics4/VertexData.hx @@ -1,6 +1,6 @@ package kha.graphics4; -@:enum abstract VertexData(Int) { +enum abstract VertexData(Int) { var Float32_1X = 0; var Float32_2X = 1; var Float32_3X = 2; diff --git a/Sources/kha/input/KeyCode.hx b/Sources/kha/input/KeyCode.hx index 59030bcac..df3a4af76 100644 --- a/Sources/kha/input/KeyCode.hx +++ b/Sources/kha/input/KeyCode.hx @@ -1,6 +1,6 @@ package kha.input; -@:enum abstract KeyCode(Int) to Int { +enum abstract KeyCode(Int) to Int { var Unknown = 0; var Back = 1; // Android var Cancel = 3; diff --git a/Sources/kha/math/FastMatrix2.hx b/Sources/kha/math/FastMatrix2.hx index 0b7cefcd8..5faafaf2a 100644 --- a/Sources/kha/math/FastMatrix2.hx +++ b/Sources/kha/math/FastMatrix2.hx @@ -28,54 +28,54 @@ class FastMatrix2 { public static function index(x: Int, y: Int): Int { return y * width + x; }*/ - @:extern public inline function setFrom(m: FastMatrix2): Void { + extern public inline function setFrom(m: FastMatrix2): Void { this._00 = m._00; this._10 = m._10; this._01 = m._01; this._11 = m._11; } - @:extern public static inline function empty(): FastMatrix2 { + extern public static inline function empty(): FastMatrix2 { return new FastMatrix2(0, 0, 0, 0); } - @:extern public static inline function identity(): FastMatrix2 { + extern public static inline function identity(): FastMatrix2 { return new FastMatrix2(1, 0, 0, 1); } - @:extern public static inline function scale(x: FastFloat, y: FastFloat): FastMatrix2 { + extern public static inline function scale(x: FastFloat, y: FastFloat): FastMatrix2 { return new FastMatrix2(x, 0, 0, y); } - @:extern public static inline function rotation(alpha: FastFloat): FastMatrix2 { + extern public static inline function rotation(alpha: FastFloat): FastMatrix2 { return new FastMatrix2(Math.cos(alpha), -Math.sin(alpha), Math.sin(alpha), Math.cos(alpha)); } - @:extern public inline function add(m: FastMatrix2): FastMatrix2 { + extern public inline function add(m: FastMatrix2): FastMatrix2 { return new FastMatrix2(_00 + m._00, _10 + m._10, _01 + m._01, _11 + m._11); } - @:extern public inline function sub(m: FastMatrix2): FastMatrix2 { + extern public inline function sub(m: FastMatrix2): FastMatrix2 { return new FastMatrix2(_00 - m._00, _10 - m._10, _01 - m._01, _11 - m._11); } - @:extern public inline function mult(value: FastFloat): FastMatrix2 { + extern public inline function mult(value: FastFloat): FastMatrix2 { return new FastMatrix2(_00 * value, _10 * value, _01 * value, _11 * value); } - @:extern public inline function transpose(): FastMatrix2 { + extern public inline function transpose(): FastMatrix2 { return new FastMatrix2(_00, _01, _10, _11); } - @:extern public inline function trace(): FastFloat { + extern public inline function trace(): FastFloat { return _00 + _11; } - @:extern public inline function multmat(m: FastMatrix2): FastMatrix2 { + extern public inline function multmat(m: FastMatrix2): FastMatrix2 { return new FastMatrix2(_00 * m._00 + _10 * m._01, _00 * m._10 + _10 * m._11, _01 * m._00 + _11 * m._01, _01 * m._10 + _11 * m._11); } - @:extern public inline function multvec(value: FastVector2): FastVector2 { + extern public inline function multvec(value: FastVector2): FastVector2 { var x = _00 * value.x + _10 * value.y; var y = _01 * value.x + _11 * value.y; return new FastVector2(x, y); diff --git a/Sources/kha/math/FastMatrix3.hx b/Sources/kha/math/FastMatrix3.hx index 6bf8a8ef3..47f375d41 100644 --- a/Sources/kha/math/FastMatrix3.hx +++ b/Sources/kha/math/FastMatrix3.hx @@ -55,7 +55,7 @@ class FastMatrix3 { public static function index(x: Int, y: Int): Int { return y * width + x; }*/ - @:extern public inline function setFrom(m: FastMatrix3): Void { + extern public inline function setFrom(m: FastMatrix3): Void { this._00 = m._00; this._10 = m._10; this._20 = m._20; @@ -67,47 +67,47 @@ class FastMatrix3 { this._22 = m._22; } - @:extern public static inline function translation(x: FastFloat, y: FastFloat): FastMatrix3 { + extern public static inline function translation(x: FastFloat, y: FastFloat): FastMatrix3 { return new FastMatrix3(1, 0, x, 0, 1, y, 0, 0, 1); } - @:extern public static inline function empty(): FastMatrix3 { + extern public static inline function empty(): FastMatrix3 { return new FastMatrix3(0, 0, 0, 0, 0, 0, 0, 0, 0); } - @:extern public static inline function identity(): FastMatrix3 { + extern public static inline function identity(): FastMatrix3 { return new FastMatrix3(1, 0, 0, 0, 1, 0, 0, 0, 1); } - @:extern public static inline function scale(x: FastFloat, y: FastFloat): FastMatrix3 { + extern public static inline function scale(x: FastFloat, y: FastFloat): FastMatrix3 { return new FastMatrix3(x, 0, 0, 0, y, 0, 0, 0, 1); } - @:extern public static inline function rotation(alpha: FastFloat): FastMatrix3 { + extern public static inline function rotation(alpha: FastFloat): FastMatrix3 { return new FastMatrix3(Math.cos(alpha), -Math.sin(alpha), 0, Math.sin(alpha), Math.cos(alpha), 0, 0, 0, 1); } - @:extern public inline function add(m: FastMatrix3): FastMatrix3 { + extern public inline function add(m: FastMatrix3): FastMatrix3 { return new FastMatrix3(_00 + m._00, _10 + m._10, _20 + m._20, _01 + m._01, _11 + m._11, _21 + m._21, _02 + m._02, _12 + m._12, _22 + m._22); } - @:extern public inline function sub(m: FastMatrix3): FastMatrix3 { + extern public inline function sub(m: FastMatrix3): FastMatrix3 { return new FastMatrix3(_00 - m._00, _10 - m._10, _20 - m._20, _01 - m._01, _11 - m._11, _21 - m._21, _02 - m._02, _12 - m._12, _22 - m._22); } - @:extern public inline function mult(value: FastFloat): FastMatrix3 { + extern public inline function mult(value: FastFloat): FastMatrix3 { return new FastMatrix3(_00 * value, _10 * value, _20 * value, _01 * value, _11 * value, _21 * value, _02 * value, _12 * value, _22 * value); } - @:extern public inline function transpose(): FastMatrix3 { + extern public inline function transpose(): FastMatrix3 { return new FastMatrix3(_00, _01, _02, _10, _11, _12, _20, _21, _22); } - @:extern public inline function trace(): FastFloat { + extern public inline function trace(): FastFloat { return _00 + _11 + _22; } - @:extern public inline function multmat(m: FastMatrix3): FastMatrix3 { + extern public inline function multmat(m: FastMatrix3): FastMatrix3 { return new FastMatrix3(_00 * m._00 + _10 * m._01 + _20 * m._02, _00 * m._10 @@ -131,7 +131,7 @@ class FastMatrix3 { + _22 * m._22); } - @:extern public inline function multvec(value: FastVector2): FastVector2 { + extern public inline function multvec(value: FastVector2): FastVector2 { // var product = new Vector2(0, 0); var w = _02 * value.x + _12 * value.y + _22 * 1; var x = (_00 * value.x + _10 * value.y + _20 * 1) / w; @@ -140,18 +140,18 @@ class FastMatrix3 { return new FastVector2(x, y); } - @:extern public inline function cofactor(m0: FastFloat, m1: FastFloat, m2: FastFloat, m3: FastFloat): Float { + extern public inline function cofactor(m0: FastFloat, m1: FastFloat, m2: FastFloat, m3: FastFloat): Float { return m0 * m3 - m1 * m2; } - @:extern public inline function determinant(): FastFloat { + extern public inline function determinant(): FastFloat { var c00 = cofactor(_11, _21, _12, _22); var c01 = cofactor(_10, _20, _12, _22); var c02 = cofactor(_10, _20, _11, _21); return _00 * c00 - _01 * c01 + _02 * c02; } - @:extern public inline function inverse(): FastMatrix3 { + extern public inline function inverse(): FastMatrix3 { var c00 = cofactor(_11, _21, _12, _22); var c01 = cofactor(_10, _20, _12, _22); var c02 = cofactor(_10, _20, _11, _21); diff --git a/Sources/kha/math/FastMatrix4.hx b/Sources/kha/math/FastMatrix4.hx index 20fe8dcac..6470e356c 100644 --- a/Sources/kha/math/FastMatrix4.hx +++ b/Sources/kha/math/FastMatrix4.hx @@ -45,7 +45,7 @@ class FastMatrix4 { return new FastMatrix4(m._00, m._10, m._20, m._30, m._01, m._11, m._21, m._31, m._02, m._12, m._22, m._32, m._03, m._13, m._23, m._33); } - @:extern public inline function setFrom(m: FastMatrix4): Void { + extern public inline function setFrom(m: FastMatrix4): Void { this._00 = m._00; this._10 = m._10; this._20 = m._20; @@ -64,41 +64,41 @@ class FastMatrix4 { this._33 = m._33; } - @:extern public static inline function translation(x: FastFloat, y: FastFloat, z: FastFloat): FastMatrix4 { + extern public static inline function translation(x: FastFloat, y: FastFloat, z: FastFloat): FastMatrix4 { return new FastMatrix4(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1); } - @:extern public static inline function empty(): FastMatrix4 { + extern public static inline function empty(): FastMatrix4 { return new FastMatrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - @:extern public static inline function identity(): FastMatrix4 { + extern public static inline function identity(): FastMatrix4 { return new FastMatrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } - @:extern public static inline function scale(x: FastFloat, y: FastFloat, z: FastFloat): FastMatrix4 { + extern public static inline function scale(x: FastFloat, y: FastFloat, z: FastFloat): FastMatrix4 { return new FastMatrix4(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1); } - @:extern public static inline function rotationX(alpha: FastFloat): FastMatrix4 { + extern public static inline function rotationX(alpha: FastFloat): FastMatrix4 { var ca = Math.cos(alpha); var sa = Math.sin(alpha); return new FastMatrix4(1, 0, 0, 0, 0, ca, -sa, 0, 0, sa, ca, 0, 0, 0, 0, 1); } - @:extern public static inline function rotationY(alpha: FastFloat): FastMatrix4 { + extern public static inline function rotationY(alpha: FastFloat): FastMatrix4 { var ca = Math.cos(alpha); var sa = Math.sin(alpha); return new FastMatrix4(ca, 0, sa, 0, 0, 1, 0, 0, -sa, 0, ca, 0, 0, 0, 0, 1); } - @:extern public static inline function rotationZ(alpha: FastFloat): FastMatrix4 { + extern public static inline function rotationZ(alpha: FastFloat): FastMatrix4 { var ca = Math.cos(alpha); var sa = Math.sin(alpha); return new FastMatrix4(ca, -sa, 0, 0, sa, ca, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } - @:extern public static inline function rotation(yaw: FastFloat, pitch: FastFloat, roll: FastFloat): FastMatrix4 { + extern public static inline function rotation(yaw: FastFloat, pitch: FastFloat, roll: FastFloat): FastMatrix4 { var sy = Math.sin(yaw); var cy = Math.cos(yaw); var sx = Math.sin(pitch); @@ -138,7 +138,7 @@ class FastMatrix4 { zaxis.dot(eye), 0, 0, 0, 1); } - @:extern public inline function add(m: FastMatrix4): FastMatrix4 { + extern public inline function add(m: FastMatrix4): FastMatrix4 { return new FastMatrix4(_00 + m._00, _10 + m._10, _20 @@ -159,7 +159,7 @@ class FastMatrix4 { + m._33); } - @:extern public inline function sub(m: FastMatrix4): FastMatrix4 { + extern public inline function sub(m: FastMatrix4): FastMatrix4 { return new FastMatrix4(_00 - m._00, _10 - m._10, _20 @@ -180,24 +180,24 @@ class FastMatrix4 { - m._33); } - @:extern public inline function mult(value: FastFloat): FastMatrix4 { + extern public inline function mult(value: FastFloat): FastMatrix4 { return new FastMatrix4(_00 * value, _10 * value, _20 * value, _30 * value, _01 * value, _11 * value, _21 * value, _31 * value, _02 * value, _12 * value, _22 * value, _32 * value, _03 * value, _13 * value, _23 * value, _33 * value); } - @:extern public inline function transpose(): FastMatrix4 { + extern public inline function transpose(): FastMatrix4 { return new FastMatrix4(_00, _01, _02, _03, _10, _11, _12, _13, _20, _21, _22, _23, _30, _31, _32, _33); } - @:extern public inline function transpose3x3(): FastMatrix4 { + extern public inline function transpose3x3(): FastMatrix4 { return new FastMatrix4(_00, _01, _02, _30, _10, _11, _12, _31, _20, _21, _22, _32, _03, _13, _23, _33); } - @:extern public inline function trace(): FastFloat { + extern public inline function trace(): FastFloat { return _00 + _11 + _22 + _33; } - @:extern public inline function multmat(m: FastMatrix4): FastMatrix4 { + extern public inline function multmat(m: FastMatrix4): FastMatrix4 { return new FastMatrix4(_00 * m._00 + _10 * m._01 + _20 * m._02 @@ -256,7 +256,7 @@ class FastMatrix4 { + _33 * m._33); } - @:extern public inline function multvec(value: FastVector4): FastVector4 { + extern public inline function multvec(value: FastVector4): FastVector4 { var product = new FastVector4(); product.x = _00 * value.x + _10 * value.y + _20 * value.z + _30 * value.w; product.y = _01 * value.x + _11 * value.y + _21 * value.z + _31 * value.w; @@ -265,12 +265,12 @@ class FastMatrix4 { return product; } - @:extern public inline function cofactor(m0: FastFloat, m1: FastFloat, m2: FastFloat, m3: FastFloat, m4: FastFloat, m5: FastFloat, m6: FastFloat, + extern public inline function cofactor(m0: FastFloat, m1: FastFloat, m2: FastFloat, m3: FastFloat, m4: FastFloat, m5: FastFloat, m6: FastFloat, m7: FastFloat, m8: FastFloat): FastFloat { return m0 * (m4 * m8 - m5 * m7) - m1 * (m3 * m8 - m5 * m6) + m2 * (m3 * m7 - m4 * m6); } - @:extern public inline function determinant(): FastFloat { + extern public inline function determinant(): FastFloat { var c00 = cofactor(_11, _21, _31, _12, _22, _32, _13, _23, _33); var c01 = cofactor(_10, _20, _30, _12, _22, _32, _13, _23, _33); var c02 = cofactor(_10, _20, _30, _11, _21, _31, _13, _23, _33); @@ -278,7 +278,7 @@ class FastMatrix4 { return _00 * c00 - _01 * c01 + _02 * c02 - _03 * c03; } - @:extern public inline function inverse(): FastMatrix4 { + extern public inline function inverse(): FastMatrix4 { var c00 = cofactor(_11, _21, _31, _12, _22, _32, _13, _23, _33); var c01 = cofactor(_10, _20, _30, _12, _22, _32, _13, _23, _33); var c02 = cofactor(_10, _20, _30, _11, _21, _31, _13, _23, _33); diff --git a/Sources/kha/math/FastVector2.hx b/Sources/kha/math/FastVector2.hx index fcca87386..1c8949fed 100644 --- a/Sources/kha/math/FastVector2.hx +++ b/Sources/kha/math/FastVector2.hx @@ -15,7 +15,7 @@ class FastVector2 { public var y: FastFloat; public var length(get, set): FastFloat; - @:extern public inline function setFrom(v: FastVector2): Void { + extern public inline function setFrom(v: FastVector2): Void { this.x = v.x; this.y = v.y; } @@ -34,38 +34,38 @@ class FastVector2 { return length; } - @:extern public inline function add(vec: FastVector2): FastVector2 { + extern public inline function add(vec: FastVector2): FastVector2 { return new FastVector2(x + vec.x, y + vec.y); } - @:extern public inline function sub(vec: FastVector2): FastVector2 { + extern public inline function sub(vec: FastVector2): FastVector2 { return new FastVector2(x - vec.x, y - vec.y); } - @:extern public inline function mult(value: FastFloat): FastVector2 { + extern public inline function mult(value: FastFloat): FastVector2 { return new FastVector2(x * value, y * value); } - @:extern public inline function div(value: FastFloat): FastVector2 { + extern public inline function div(value: FastFloat): FastVector2 { return mult(1 / value); } - @:extern public inline function dot(v: FastVector2): FastFloat { + extern public inline function dot(v: FastVector2): FastFloat { return x * v.x + y * v.y; } @:deprecated("normalize() will be deprecated soon, use the immutable normalized() instead") - @:extern public inline function normalize(): Void { + extern public inline function normalize(): Void { #if haxe4 inline #end set_length(1); } - @:extern public inline function normalized(): FastVector2 { + extern public inline function normalized(): FastVector2 { var v = new FastVector2(x, y); #if haxe4 inline #end v.set_length(1); return v; } - @:extern public inline function angle(v: FastVector2): FastFloat { + extern public inline function angle(v: FastVector2): FastFloat { return Math.atan2(x * v.y - y * v.x, x * v.x + y * v.y); } diff --git a/Sources/kha/math/FastVector3.hx b/Sources/kha/math/FastVector3.hx index e7222db95..7f98c4bb2 100644 --- a/Sources/kha/math/FastVector3.hx +++ b/Sources/kha/math/FastVector3.hx @@ -17,7 +17,7 @@ class FastVector3 { public var z: FastFloat; public var length(get, set): FastFloat; - @:extern public inline function setFrom(v: FastVector3): Void { + extern public inline function setFrom(v: FastVector3): Void { this.x = v.x; this.y = v.y; this.z = v.z; @@ -38,23 +38,23 @@ class FastVector3 { return length; } - @:extern public inline function add(vec: FastVector3): FastVector3 { + extern public inline function add(vec: FastVector3): FastVector3 { return new FastVector3(x + vec.x, y + vec.y, z + vec.z); } - @:extern public inline function sub(vec: FastVector3): FastVector3 { + extern public inline function sub(vec: FastVector3): FastVector3 { return new FastVector3(x - vec.x, y - vec.y, z - vec.z); } - @:extern public inline function mult(value: FastFloat): FastVector3 { + extern public inline function mult(value: FastFloat): FastVector3 { return new FastVector3(x * value, y * value, z * value); } - @:extern public inline function dot(v: FastVector3): FastFloat { + extern public inline function dot(v: FastVector3): FastFloat { return x * v.x + y * v.y + z * v.z; } - @:extern public inline function cross(v: FastVector3): FastVector3 { + extern public inline function cross(v: FastVector3): FastVector3 { var _x = y * v.z - z * v.y; var _y = z * v.x - x * v.z; var _z = x * v.y - y * v.x; @@ -62,11 +62,11 @@ class FastVector3 { } @:deprecated("normalize() will be deprecated soon, use the immutable normalized() instead") - @:extern public inline function normalize(): Void { + extern public inline function normalize(): Void { #if haxe4 inline #end set_length(1); } - @:extern public inline function normalized(): FastVector3 { + extern public inline function normalized(): FastVector3 { var v = new FastVector3(x, y, z); #if haxe4 inline #end v.set_length(1); return v; diff --git a/Sources/kha/math/FastVector4.hx b/Sources/kha/math/FastVector4.hx index af9ab6132..a98ca7ca3 100644 --- a/Sources/kha/math/FastVector4.hx +++ b/Sources/kha/math/FastVector4.hx @@ -19,7 +19,7 @@ class FastVector4 { public var w: FastFloat; public var length(get, set): FastFloat; - @:extern public inline function setFrom(v: FastVector4): Void { + extern public inline function setFrom(v: FastVector4): Void { this.x = v.x; this.y = v.y; this.z = v.z; @@ -42,24 +42,24 @@ class FastVector4 { return length; } - @:extern public inline function add(vec: FastVector4): FastVector4 { + extern public inline function add(vec: FastVector4): FastVector4 { return new FastVector4(x + vec.x, y + vec.y, z + vec.z, w + vec.w); } - @:extern public inline function sub(vec: FastVector4): FastVector4 { + extern public inline function sub(vec: FastVector4): FastVector4 { return new FastVector4(x - vec.x, y - vec.y, z - vec.z, w - vec.w); } - @:extern public inline function mult(value: FastFloat): FastVector4 { + extern public inline function mult(value: FastFloat): FastVector4 { return new FastVector4(x * value, y * value, z * value, w * value); } @:deprecated("normalize() will be deprecated soon, use the immutable normalized() instead") - @:extern public inline function normalize(): Void { + extern public inline function normalize(): Void { #if haxe4 inline #end set_length(1); } - @:extern public inline function normalized(): FastVector4 { + extern public inline function normalized(): FastVector4 { var v = new FastVector4(x, y, z, w); #if haxe4 inline #end v.set_length(1); return v; diff --git a/Sources/kha/math/Matrix2.hx b/Sources/kha/math/Matrix2.hx index 74a331815..eadc9b155 100644 --- a/Sources/kha/math/Matrix2.hx +++ b/Sources/kha/math/Matrix2.hx @@ -28,54 +28,54 @@ class Matrix2 { public static function index(x: Int, y: Int): Int { return y * width + x; }*/ - @:extern public inline function setFrom(m: Matrix2): Void { + extern public inline function setFrom(m: Matrix2): Void { this._00 = m._00; this._10 = m._10; this._01 = m._01; this._11 = m._11; } - @:extern public static inline function empty(): Matrix2 { + extern public static inline function empty(): Matrix2 { return new Matrix2(0, 0, 0, 0); } - @:extern public static inline function identity(): Matrix2 { + extern public static inline function identity(): Matrix2 { return new Matrix2(1, 0, 0, 1); } - @:extern public static inline function scale(x: Float, y: Float): Matrix2 { + extern public static inline function scale(x: Float, y: Float): Matrix2 { return new Matrix2(x, 0, 0, y); } - @:extern public static inline function rotation(alpha: Float): Matrix2 { + extern public static inline function rotation(alpha: Float): Matrix2 { return new Matrix2(Math.cos(alpha), -Math.sin(alpha), Math.sin(alpha), Math.cos(alpha)); } - @:extern public inline function add(m: Matrix2): Matrix2 { + extern public inline function add(m: Matrix2): Matrix2 { return new Matrix2(_00 + m._00, _10 + m._10, _01 + m._01, _11 + m._11); } - @:extern public inline function sub(m: Matrix2): Matrix2 { + extern public inline function sub(m: Matrix2): Matrix2 { return new Matrix2(_00 - m._00, _10 - m._10, _01 - m._01, _11 - m._11); } - @:extern public inline function mult(value: Float): Matrix2 { + extern public inline function mult(value: Float): Matrix2 { return new Matrix2(_00 * value, _10 * value, _01 * value, _11 * value); } - @:extern public inline function transpose(): Matrix2 { + extern public inline function transpose(): Matrix2 { return new Matrix2(_00, _01, _10, _11); } - @:extern public inline function trace(): Float { + extern public inline function trace(): Float { return _00 + _11; } - @:extern public inline function multmat(m: Matrix2): Matrix2 { + extern public inline function multmat(m: Matrix2): Matrix2 { return new Matrix2(_00 * m._00 + _10 * m._01, _00 * m._10 + _10 * m._11, _01 * m._00 + _11 * m._01, _01 * m._10 + _11 * m._11); } - @:extern public inline function multvec(value: Vector2): Vector2 { + extern public inline function multvec(value: Vector2): Vector2 { var x = _00 * value.x + _10 * value.y; var y = _01 * value.x + _11 * value.y; return new Vector2(x, y); diff --git a/Sources/kha/math/Matrix3.hx b/Sources/kha/math/Matrix3.hx index 5b42b038f..78e845065 100644 --- a/Sources/kha/math/Matrix3.hx +++ b/Sources/kha/math/Matrix3.hx @@ -54,7 +54,7 @@ class Matrix3 { public static function index(x: Int, y: Int): Int { return y * width + x; }*/ - @:extern public inline function setFrom(m: Matrix3): Void { + extern public inline function setFrom(m: Matrix3): Void { this._00 = m._00; this._10 = m._10; this._20 = m._20; @@ -66,47 +66,47 @@ class Matrix3 { this._22 = m._22; } - @:extern public static inline function translation(x: Float, y: Float): Matrix3 { + extern public static inline function translation(x: Float, y: Float): Matrix3 { return new Matrix3(1, 0, x, 0, 1, y, 0, 0, 1); } - @:extern public static inline function empty(): Matrix3 { + extern public static inline function empty(): Matrix3 { return new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0); } - @:extern public static inline function identity(): Matrix3 { + extern public static inline function identity(): Matrix3 { return new Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1); } - @:extern public static inline function scale(x: Float, y: Float): Matrix3 { + extern public static inline function scale(x: Float, y: Float): Matrix3 { return new Matrix3(x, 0, 0, 0, y, 0, 0, 0, 1); } - @:extern public static inline function rotation(alpha: Float): Matrix3 { + extern public static inline function rotation(alpha: Float): Matrix3 { return new Matrix3(Math.cos(alpha), -Math.sin(alpha), 0, Math.sin(alpha), Math.cos(alpha), 0, 0, 0, 1); } - @:extern public inline function add(m: Matrix3): Matrix3 { + extern public inline function add(m: Matrix3): Matrix3 { return new Matrix3(_00 + m._00, _10 + m._10, _20 + m._20, _01 + m._01, _11 + m._11, _21 + m._21, _02 + m._02, _12 + m._12, _22 + m._22); } - @:extern public inline function sub(m: Matrix3): Matrix3 { + extern public inline function sub(m: Matrix3): Matrix3 { return new Matrix3(_00 - m._00, _10 - m._10, _20 - m._20, _01 - m._01, _11 - m._11, _21 - m._21, _02 - m._02, _12 - m._12, _22 - m._22); } - @:extern public inline function mult(value: Float): Matrix3 { + extern public inline function mult(value: Float): Matrix3 { return new Matrix3(_00 * value, _10 * value, _20 * value, _01 * value, _11 * value, _21 * value, _02 * value, _12 * value, _22 * value); } - @:extern public inline function transpose(): Matrix3 { + extern public inline function transpose(): Matrix3 { return new Matrix3(_00, _01, _02, _10, _11, _12, _20, _21, _22); } - @:extern public inline function trace(): Float { + extern public inline function trace(): Float { return _00 + _11 + _22; } - @:extern public inline function multmat(m: Matrix3): Matrix3 { + extern public inline function multmat(m: Matrix3): Matrix3 { return new Matrix3(_00 * m._00 + _10 * m._01 + _20 * m._02, _00 * m._10 @@ -130,7 +130,7 @@ class Matrix3 { + _22 * m._22); } - @:extern public inline function multvec(value: Vector2): Vector2 { + extern public inline function multvec(value: Vector2): Vector2 { // var product = new Vector2(0, 0); var w = _02 * value.x + _12 * value.y + _22 * 1; var x = (_00 * value.x + _10 * value.y + _20 * 1) / w; @@ -138,18 +138,18 @@ class Matrix3 { return new Vector2(x, y); } - @:extern public inline function cofactor(m0: Float, m1: Float, m2: Float, m3: Float): Float { + extern public inline function cofactor(m0: Float, m1: Float, m2: Float, m3: Float): Float { return m0 * m3 - m1 * m2; } - @:extern public inline function determinant(): Float { + extern public inline function determinant(): Float { var c00 = cofactor(_11, _21, _12, _22); var c01 = cofactor(_10, _20, _12, _22); var c02 = cofactor(_10, _20, _11, _21); return _00 * c00 - _01 * c01 + _02 * c02; } - @:extern public inline function inverse(): Matrix3 { + extern public inline function inverse(): Matrix3 { var c00 = cofactor(_11, _21, _12, _22); var c01 = cofactor(_10, _20, _12, _22); var c02 = cofactor(_10, _20, _11, _21); diff --git a/Sources/kha/math/Matrix4.hx b/Sources/kha/math/Matrix4.hx index bc7cc4c3d..baaf2e30c 100644 --- a/Sources/kha/math/Matrix4.hx +++ b/Sources/kha/math/Matrix4.hx @@ -45,7 +45,7 @@ class Matrix4 { return new Matrix4(m._00, m._10, m._20, m._30, m._01, m._11, m._21, m._31, m._02, m._12, m._22, m._32, m._03, m._13, m._23, m._33); } - @:extern public inline function setFrom(m: Matrix4): Void { + extern public inline function setFrom(m: Matrix4): Void { this._00 = m._00; this._10 = m._10; this._20 = m._20; @@ -64,41 +64,41 @@ class Matrix4 { this._33 = m._33; } - @:extern public static inline function translation(x: Float, y: Float, z: Float): Matrix4 { + extern public static inline function translation(x: Float, y: Float, z: Float): Matrix4 { return new Matrix4(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1); } - @:extern public static inline function empty(): Matrix4 { + extern public static inline function empty(): Matrix4 { return new Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - @:extern public static inline function identity(): Matrix4 { + extern public static inline function identity(): Matrix4 { return new Matrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } - @:extern public static inline function scale(x: Float, y: Float, z: Float): Matrix4 { + extern public static inline function scale(x: Float, y: Float, z: Float): Matrix4 { return new Matrix4(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1); } - @:extern public static inline function rotationX(alpha: Float): Matrix4 { + extern public static inline function rotationX(alpha: Float): Matrix4 { var ca = Math.cos(alpha); var sa = Math.sin(alpha); return new Matrix4(1, 0, 0, 0, 0, ca, -sa, 0, 0, sa, ca, 0, 0, 0, 0, 1); } - @:extern public static inline function rotationY(alpha: Float): Matrix4 { + extern public static inline function rotationY(alpha: Float): Matrix4 { var ca = Math.cos(alpha); var sa = Math.sin(alpha); return new Matrix4(ca, 0, sa, 0, 0, 1, 0, 0, -sa, 0, ca, 0, 0, 0, 0, 1); } - @:extern public static inline function rotationZ(alpha: Float): Matrix4 { + extern public static inline function rotationZ(alpha: Float): Matrix4 { var ca = Math.cos(alpha); var sa = Math.sin(alpha); return new Matrix4(ca, -sa, 0, 0, sa, ca, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } - @:extern public static inline function rotation(yaw: Float, pitch: Float, roll: Float): Matrix4 { + extern public static inline function rotation(yaw: Float, pitch: Float, roll: Float): Matrix4 { var sy = Math.sin(yaw); var cy = Math.cos(yaw); var sx = Math.sin(pitch); @@ -137,7 +137,7 @@ class Matrix4 { zaxis.dot(eye), 0, 0, 0, 1); } - @:extern public inline function add(m: Matrix4): Matrix4 { + extern public inline function add(m: Matrix4): Matrix4 { return new Matrix4(_00 + m._00, _10 + m._10, _20 @@ -158,7 +158,7 @@ class Matrix4 { + m._33); } - @:extern public inline function sub(m: Matrix4): Matrix4 { + extern public inline function sub(m: Matrix4): Matrix4 { return new Matrix4(_00 - m._00, _10 - m._10, _20 @@ -179,24 +179,24 @@ class Matrix4 { - m._33); } - @:extern public inline function mult(value: Float): Matrix4 { + extern public inline function mult(value: Float): Matrix4 { return new Matrix4(_00 * value, _10 * value, _20 * value, _30 * value, _01 * value, _11 * value, _21 * value, _31 * value, _02 * value, _12 * value, _22 * value, _32 * value, _03 * value, _13 * value, _23 * value, _33 * value); } - @:extern public inline function transpose(): Matrix4 { + extern public inline function transpose(): Matrix4 { return new Matrix4(_00, _01, _02, _03, _10, _11, _12, _13, _20, _21, _22, _23, _30, _31, _32, _33); } - @:extern public inline function transpose3x3(): Matrix4 { + extern public inline function transpose3x3(): Matrix4 { return new Matrix4(_00, _01, _02, _30, _10, _11, _12, _31, _20, _21, _22, _32, _03, _13, _23, _33); } - @:extern public inline function trace(): Float { + extern public inline function trace(): Float { return _00 + _11 + _22 + _33; } - @:extern public inline function multmat(m: Matrix4): Matrix4 { + extern public inline function multmat(m: Matrix4): Matrix4 { return new Matrix4(_00 * m._00 + _10 * m._01 + _20 * m._02 @@ -255,7 +255,7 @@ class Matrix4 { + _33 * m._33); } - @:extern public inline function multvec(value: Vector4): Vector4 { + extern public inline function multvec(value: Vector4): Vector4 { var product = new Vector4(); product.x = _00 * value.x + _10 * value.y + _20 * value.z + _30 * value.w; product.y = _01 * value.x + _11 * value.y + _21 * value.z + _31 * value.w; @@ -264,11 +264,11 @@ class Matrix4 { return product; } - @:extern public inline function cofactor(m0: Float, m1: Float, m2: Float, m3: Float, m4: Float, m5: Float, m6: Float, m7: Float, m8: Float): Float { + extern public inline function cofactor(m0: Float, m1: Float, m2: Float, m3: Float, m4: Float, m5: Float, m6: Float, m7: Float, m8: Float): Float { return m0 * (m4 * m8 - m5 * m7) - m1 * (m3 * m8 - m5 * m6) + m2 * (m3 * m7 - m4 * m6); } - @:extern public inline function determinant(): Float { + extern public inline function determinant(): Float { var c00 = cofactor(_11, _21, _31, _12, _22, _32, _13, _23, _33); var c01 = cofactor(_10, _20, _30, _12, _22, _32, _13, _23, _33); var c02 = cofactor(_10, _20, _30, _11, _21, _31, _13, _23, _33); @@ -276,7 +276,7 @@ class Matrix4 { return _00 * c00 - _01 * c01 + _02 * c02 - _03 * c03; } - @:extern public inline function inverse(): Matrix4 { + extern public inline function inverse(): Matrix4 { var c00 = cofactor(_11, _21, _31, _12, _22, _32, _13, _23, _33); var c01 = cofactor(_10, _20, _30, _12, _22, _32, _13, _23, _33); var c02 = cofactor(_10, _20, _30, _11, _21, _31, _13, _23, _33); diff --git a/Sources/kha/math/Vector2.hx b/Sources/kha/math/Vector2.hx index 176824601..d2dde82d3 100644 --- a/Sources/kha/math/Vector2.hx +++ b/Sources/kha/math/Vector2.hx @@ -11,7 +11,7 @@ class Vector2 { public var y: Float; public var length(get, set): Float; - @:extern public inline function setFrom(v: Vector2): Void { + extern public inline function setFrom(v: Vector2): Void { this.x = v.x; this.y = v.y; } @@ -30,42 +30,42 @@ class Vector2 { return length; } - @:extern public inline function add(vec: Vector2): Vector2 { + extern public inline function add(vec: Vector2): Vector2 { return new Vector2(x + vec.x, y + vec.y); } - @:extern public inline function sub(vec: Vector2): Vector2 { + extern public inline function sub(vec: Vector2): Vector2 { return new Vector2(x - vec.x, y - vec.y); } - @:extern public inline function mult(value: Float): Vector2 { + extern public inline function mult(value: Float): Vector2 { return new Vector2(x * value, y * value); } - @:extern public inline function div(value: Float): Vector2 { + extern public inline function div(value: Float): Vector2 { return mult(1 / value); } - @:extern public inline function dot(v: Vector2): Float { + extern public inline function dot(v: Vector2): Float { return x * v.x + y * v.y; } @:deprecated("normalize() will be deprecated soon, use the immutable normalized() instead") - @:extern public inline function normalize(): Void { + extern public inline function normalize(): Void { #if haxe4 inline #end set_length(1); } - @:extern public inline function normalized(): Vector2 { + extern public inline function normalized(): Vector2 { var v = new Vector2(x, y); #if haxe4 inline #end v.set_length(1); return v; } - @:extern public inline function angle(v: Vector2): Float { + extern public inline function angle(v: Vector2): Float { return Math.atan2(x * v.y - y * v.x, x * v.x + y * v.y); } - @:extern public inline function fast(): FastVector2 { + extern public inline function fast(): FastVector2 { return new FastVector2(x, y); } } diff --git a/Sources/kha/math/Vector2i.hx b/Sources/kha/math/Vector2i.hx index 8072b7c42..4a7c18ead 100644 --- a/Sources/kha/math/Vector2i.hx +++ b/Sources/kha/math/Vector2i.hx @@ -10,28 +10,28 @@ class Vector2i { public var x: Int; public var y: Int; - @:extern public inline function setFrom(v: Vector2i): Void { + extern public inline function setFrom(v: Vector2i): Void { this.x = v.x; this.y = v.y; } - @:extern public inline function add(vec: Vector2i): Vector2i { + extern public inline function add(vec: Vector2i): Vector2i { return new Vector2i(x + vec.x, y + vec.y); } - @:extern public inline function sub(vec: Vector2i): Vector2i { + extern public inline function sub(vec: Vector2i): Vector2i { return new Vector2i(x - vec.x, y - vec.y); } - @:extern public inline function mult(value: Int): Vector2i { + extern public inline function mult(value: Int): Vector2i { return new Vector2i(x * value, y * value); } - @:extern public inline function div(value: Int): Vector2i { + extern public inline function div(value: Int): Vector2i { return new Vector2i(Std.int(x / value), Std.int(y / value)); } - @:extern public inline function dot(v: Vector2i): Float { + extern public inline function dot(v: Vector2i): Float { return x * v.x + y * v.y; } } diff --git a/Sources/kha/math/Vector3.hx b/Sources/kha/math/Vector3.hx index 81ed651bc..b96cc0de8 100644 --- a/Sources/kha/math/Vector3.hx +++ b/Sources/kha/math/Vector3.hx @@ -13,7 +13,7 @@ class Vector3 { public var z: Float; public var length(get, set): Float; - @:extern public inline function setFrom(v: Vector3): Void { + extern public inline function setFrom(v: Vector3): Void { this.x = v.x; this.y = v.y; this.z = v.z; @@ -34,23 +34,23 @@ class Vector3 { return length; } - @:extern public inline function add(vec: Vector3): Vector3 { + extern public inline function add(vec: Vector3): Vector3 { return new Vector3(x + vec.x, y + vec.y, z + vec.z); } - @:extern public inline function sub(vec: Vector3): Vector3 { + extern public inline function sub(vec: Vector3): Vector3 { return new Vector3(x - vec.x, y - vec.y, z - vec.z); } - @:extern public inline function mult(value: Float): Vector3 { + extern public inline function mult(value: Float): Vector3 { return new Vector3(x * value, y * value, z * value); } - @:extern public inline function dot(v: Vector3): Float { + extern public inline function dot(v: Vector3): Float { return x * v.x + y * v.y + z * v.z; } - @:extern public inline function cross(v: Vector3): Vector3 { + extern public inline function cross(v: Vector3): Vector3 { var _x = y * v.z - z * v.y; var _y = z * v.x - x * v.z; var _z = x * v.y - y * v.x; @@ -58,17 +58,17 @@ class Vector3 { } @:deprecated("normalize() will be deprecated soon, use the immutable normalized() instead") - @:extern public inline function normalize(): Void { + extern public inline function normalize(): Void { #if haxe4 inline #end set_length(1); } - @:extern public inline function normalized(): Vector3 { + extern public inline function normalized(): Vector3 { var v = new Vector3(x, y, z); #if haxe4 inline #end v.set_length(1); return v; } - @:extern public inline function fast(): FastVector3 { + extern public inline function fast(): FastVector3 { return new FastVector3(x, y, z); } } diff --git a/Sources/kha/math/Vector4.hx b/Sources/kha/math/Vector4.hx index 8b0246112..f904d9f7a 100644 --- a/Sources/kha/math/Vector4.hx +++ b/Sources/kha/math/Vector4.hx @@ -15,7 +15,7 @@ class Vector4 { public var w: Float; public var length(get, set): Float; - @:extern public inline function setFrom(v: Vector4): Void { + extern public inline function setFrom(v: Vector4): Void { this.x = v.x; this.y = v.y; this.z = v.z; @@ -38,30 +38,30 @@ class Vector4 { return length; } - @:extern public inline function add(vec: Vector4): Vector4 { + extern public inline function add(vec: Vector4): Vector4 { return new Vector4(x + vec.x, y + vec.y, z + vec.z, w + vec.w); } - @:extern public inline function sub(vec: Vector4): Vector4 { + extern public inline function sub(vec: Vector4): Vector4 { return new Vector4(x - vec.x, y - vec.y, z - vec.z, w - vec.w); } - @:extern public inline function mult(value: Float): Vector4 { + extern public inline function mult(value: Float): Vector4 { return new Vector4(x * value, y * value, z * value, w * value); } @:deprecated("Use the immutable normalized() instead") - @:extern public inline function normalize(): Void { + extern public inline function normalize(): Void { #if haxe4 inline #end set_length(1); } - @:extern public inline function normalized(): Vector4 { + extern public inline function normalized(): Vector4 { var v = new Vector4(x, y, z, w); #if haxe4 inline #end v.set_length(1); return v; } - @:extern public inline function fast(): FastVector4 { + extern public inline function fast(): FastVector4 { return new FastVector4(x, y, z, w); } }