From 0927b8ccface4afb766017674d64f26769fee14a Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 8 Nov 2023 14:38:04 +0700 Subject: [PATCH] Textbox performance --- objects/_p_dialog/Create_0.gml | 1 - .../Create_0.gml | 17 +++- .../o_dialog_textbox_autocomplete/Draw_64.gml | 3 +- .../Create_0.gml | 13 ++- .../Draw_64.gml | 3 +- objects/o_main/Create_0.gml | 2 + objects/o_main/Step_0.gml | 22 ++--- objects/o_main/Step_1.gml | 14 +--- .../BBMOD_DualQuaternion.gml | 48 +++++------ scripts/BBMOD_Matrix/BBMOD_Matrix.gml | 82 +++++++++---------- scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml | 58 ++++++------- scripts/BBMOD_Vec2/BBMOD_Vec2.gml | 60 +++++++------- scripts/BBMOD_Vec3/BBMOD_Vec3.gml | 64 +++++++-------- scripts/BBMOD_Vec4/BBMOD_Vec4.gml | 60 +++++++------- scripts/__VFX/__VFX.gml | 22 ++--- scripts/__d3d11/__d3d11.gml | 14 ++-- scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml | 24 +++--- scripts/__d3d11_shader/__d3d11_shader.gml | 12 +-- scripts/__matrix4/__matrix4.gml | 2 +- .../__panel_linear_setting.gml | 6 +- scripts/__surface/__surface.gml | 26 +++--- scripts/__vec2/__vec2.gml | 60 +++++++------- scripts/__vec3/__vec3.gml | 48 +++++------ scripts/__vec4/__vec4.gml | 38 ++++----- .../__vertex_function/__vertex_function.gml | 16 ++-- scripts/array_functions/array_functions.gml | 38 ++++----- .../bbmod_lerp_delta_time.gml | 2 +- scripts/color_function/color_function.gml | 2 +- .../contextMenu_controller.gml | 12 +-- scripts/control_function/control_function.gml | 10 +-- .../curve_bezier_function.gml | 2 +- scripts/d3d_bbox/d3d_bbox.gml | 4 +- scripts/d3d_group/d3d_group.gml | 2 +- scripts/d3d_ray/d3d_ray.gml | 2 +- scripts/d3d_rot3/d3d_rot3.gml | 6 +- .../d3d_surface_extrude.gml | 2 +- scripts/d3d_vertex/d3d_vertex.gml | 6 +- scripts/debug/debug.gml | 2 +- scripts/distance_to_line/distance_to_line.gml | 4 +- scripts/draw_UI_scale/draw_UI_scale.gml | 2 +- .../draw_sprite_ext_override.gml | 20 ++--- scripts/file_functions/file_functions.gml | 2 +- scripts/globals/globals.gml | 8 +- scripts/hotkey_data/hotkey_data.gml | 2 +- scripts/locale_data/locale_data.gml | 14 ++-- scripts/logger/logger.gml | 14 ++-- scripts/nodeValue_drawer/nodeValue_drawer.gml | 5 +- scripts/node_canvas/node_canvas.gml | 4 +- scripts/node_collection/node_collection.gml | 46 +++-------- scripts/node_data/node_data.gml | 43 +++++----- scripts/node_processor/node_processor.gml | 2 +- scripts/node_tool/node_tool.gml | 2 +- scripts/node_value/node_value.gml | 7 +- scripts/panel_graph/panel_graph.gml | 4 +- .../panel_text_editor/panel_text_editor.gml | 2 +- scripts/point_rotate/point_rotate.gml | 2 +- scripts/project_data/project_data.gml | 1 + scripts/random_function/random_function.gml | 6 +- scripts/safe_operation/safe_operation.gml | 2 +- scripts/scrollPane/scrollPane.gml | 2 +- scripts/shader_functions/shader_functions.gml | 26 +++--- scripts/shell_functions/shell_functions.gml | 4 +- scripts/sprite_loader/sprite_loader.gml | 6 +- scripts/string_decimal/string_decimal.gml | 4 +- scripts/string_functions/string_functions.gml | 6 +- scripts/struct_functions/struct_functions.gml | 4 +- .../surface_functions/surface_functions.gml | 58 ++++++------- scripts/textArea/textArea.gml | 50 +++++------ scripts/var_comparison/var_comparison.gml | 6 +- 69 files changed, 572 insertions(+), 591 deletions(-) diff --git a/objects/_p_dialog/Create_0.gml b/objects/_p_dialog/Create_0.gml index 864b3b4aa..4c32242f2 100644 --- a/objects/_p_dialog/Create_0.gml +++ b/objects/_p_dialog/Create_0.gml @@ -1,7 +1,6 @@ /// @description init #region data with(_p_dialog) other.depth = min(depth - 1, other.depth); - //print($"{object_get_name(object_index)}: {depth}"); ds_list_add(DIALOGS, self); diff --git a/objects/o_dialog_textbox_autocomplete/Create_0.gml b/objects/o_dialog_textbox_autocomplete/Create_0.gml index 9269ef223..3793acc92 100644 --- a/objects/o_dialog_textbox_autocomplete/Create_0.gml +++ b/objects/o_dialog_textbox_autocomplete/Create_0.gml @@ -4,7 +4,6 @@ event_inherited(); #region data depth = -9999; - active = false; dialog_x = 0; dialog_y = 0; dialog_w = 300; @@ -18,6 +17,19 @@ event_inherited(); destroy_on_escape = false; destroy_on_click_out = false; + function activate(textbox) { + INLINE + self.textbox = textbox; + self.selecting = 0; + } + + function deactivate(textbox) { + INLINE + if(textbox != self.textbox) return; + + self.textbox = noone; + } + sc_content = new scrollPane(dialog_w, dialog_h, function(_y, _m) { draw_clear_alpha(COLORS.panel_bg_clear, 0); var hght = line_get_height(f_p0, 8); @@ -85,8 +97,7 @@ event_inherited(); textbox._input_text = $"{_sPreC}{rep}{_sPosC}"; textbox.cursor += _repAmo - _prmAmo; textbox.cut_line(); - - active = false; + textbox = noone; } #endregion diff --git a/objects/o_dialog_textbox_autocomplete/Draw_64.gml b/objects/o_dialog_textbox_autocomplete/Draw_64.gml index a4202319f..c4f2ea7ed 100644 --- a/objects/o_dialog_textbox_autocomplete/Draw_64.gml +++ b/objects/o_dialog_textbox_autocomplete/Draw_64.gml @@ -1,5 +1,4 @@ /// @description -if(!active) exit; if(textbox == noone) exit; if(textbox != WIDGET_CURRENT) exit; @@ -38,4 +37,4 @@ if(textbox != WIDGET_CURRENT) exit; if(keyboard_check_pressed(vk_escape)) - active = false; \ No newline at end of file + textbox = noone; \ No newline at end of file diff --git a/objects/o_dialog_textbox_function_guide/Create_0.gml b/objects/o_dialog_textbox_function_guide/Create_0.gml index c9ecbd711..e705e181a 100644 --- a/objects/o_dialog_textbox_function_guide/Create_0.gml +++ b/objects/o_dialog_textbox_function_guide/Create_0.gml @@ -2,7 +2,6 @@ #region data depth = -9999; - active = false; dialog_x = 0; dialog_y = 0; dialog_w = 280; @@ -11,5 +10,17 @@ textbox = noone; prompt = ""; index = 0; + + function activate(textbox) { + INLINE + self.textbox = textbox; + } + + function deactivate(textbox) { + INLINE + if(textbox != self.textbox) return; + + self.textbox = noone; + } #endregion diff --git a/objects/o_dialog_textbox_function_guide/Draw_64.gml b/objects/o_dialog_textbox_function_guide/Draw_64.gml index d78a3a259..dad06d3be 100644 --- a/objects/o_dialog_textbox_function_guide/Draw_64.gml +++ b/objects/o_dialog_textbox_function_guide/Draw_64.gml @@ -1,5 +1,4 @@ /// @description -if(!active) exit; if(textbox == noone) exit; if(textbox != WIDGET_CURRENT) exit; @@ -59,4 +58,4 @@ if(textbox != WIDGET_CURRENT) exit; if(keyboard_check_pressed(vk_escape)) - active = false; \ No newline at end of file + textbox = noone; \ No newline at end of file diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index a83f606da..7ed9b8db2 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -248,6 +248,8 @@ WIDGET_TAB_BLOCK = false; instance_create(0, 0, o_dialog_textbox_slider); + instance_create(0, 0, o_dialog_textbox_autocomplete); + instance_create(0, 0, o_dialog_textbox_function_guide); #endregion #region async diff --git a/objects/o_main/Step_0.gml b/objects/o_main/Step_0.gml index 49e52a473..48cc51f80 100644 --- a/objects/o_main/Step_0.gml +++ b/objects/o_main/Step_0.gml @@ -4,22 +4,14 @@ if(OS == os_windows && gameframe_is_minimized()) exit; //print("===== Step start ====="); if(PROJECT.active && !PROJECT.safeMode) { PROJECT.animator.step(); - - #region step - PROJECT.globalNode.step(); + PROJECT.globalNode.step(); - try { - if(PANEL_MAIN != 0) - PANEL_MAIN.step(); - - for(var i = 0; i < ds_list_size(PROJECT.nodes); i++) { - PROJECT.nodes[| i].triggerCheck(); - PROJECT.nodes[| i].step(); - } - } catch(e) { - noti_warning("Step error: " + exception_print(e)); - } - #endregion + try { + if(PANEL_MAIN != 0) PANEL_MAIN.step(); + array_foreach(PROJECT.nodeArray, function(_node) { if(!_node.active) return; _node.triggerCheck(); _node.step(); }); + } catch(e) { + noti_warning("Step error: " + exception_print(e)); + } } #region hotkey diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index d9604fb51..10c18fa54 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -43,8 +43,7 @@ _HOVERING_ELEMENT = noone; HOVER = noone; with(_p_dialog) checkMouse(); - if(PANEL_MAIN != 0) - PANEL_MAIN.stepBegin(); + if(PANEL_MAIN != 0) PANEL_MAIN.stepBegin(); DIALOG_DEPTH_HOVER = 0; @@ -87,15 +86,10 @@ _HOVERING_ELEMENT = noone; NodeTopoSort(); } UPDATE_RENDER_ORDER = false; - + if(PROJECT.active) { - var _k = ds_map_find_first(PROJECT.nodeMap); - var _a = ds_map_size(PROJECT.nodeMap); - repeat(_a) { - PROJECT.nodeMap[? _k].stepBegin(); - _k = ds_map_find_next(PROJECT.nodeMap, _k); - } - + array_foreach(PROJECT.nodeArray, function(_node) { if(!_node.active) return; _node.stepBegin(); }); + if(IS_PLAYING || IS_RENDERING) { if(PROJECT.animator.frame_progress) { __addon_preAnim(); diff --git a/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml b/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml index ff0b793f6..a98223e2b 100644 --- a/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml +++ b/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml @@ -42,7 +42,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Add = function (_dq) { - gml_pragma("forceinline"); + INLINE return new BBMOD_DualQuaternion() .FromRealDual( Real.Add(_dq.Real), @@ -55,7 +55,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Clone = function () { - gml_pragma("forceinline"); + INLINE var _dq = new BBMOD_DualQuaternion(); _dq.Real = Real; _dq.Dual = Dual; @@ -69,7 +69,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Conjugate = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_DualQuaternion() .FromRealDual( Real.Conjugate(), @@ -86,7 +86,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} Returns `self`. static Copy = function (_dest) { - gml_pragma("forceinline"); + INLINE _dest.Real = Real; _dest.Dual = Dual; return self; @@ -100,7 +100,7 @@ function BBMOD_DualQuaternion( /// /// @return {Real} The dot product of the dual quaternions. static Dot = function (_dq) { - gml_pragma("forceinline"); + INLINE return Real.Dot(_dq.Real); }; @@ -111,7 +111,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Exp = function () { - gml_pragma("forceinline"); + INLINE var _real = Real.Exp(); return new BBMOD_DualQuaternion() .FromRealDual( @@ -131,7 +131,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} Returns `self`. static FromArray = function (_array, _index=0) { - gml_pragma("forceinline"); + INLINE Real = Real.FromArray(_array, _index); Dual = Dual.FromArray(_array, _index + 4); return self; @@ -149,7 +149,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} Returns `self`. static FromBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE Real = Real.FromBuffer(_buffer, _type); Dual = Dual.FromBuffer(_buffer, _type); return self; @@ -166,7 +166,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} Returns `self`. static FromRealDual = function (_real, _dual) { - gml_pragma("forceinline"); + INLINE Real = _real.Normalize(); Dual = _dual; return self; @@ -183,7 +183,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} Returns `self`. static FromTranslationRotation = function (_t, _r) { - gml_pragma("forceinline"); + INLINE Real = _r.Normalize(); @@ -216,7 +216,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static GetRotation = function () { - gml_pragma("forceinline"); + INLINE return Real.Clone(); }; @@ -226,7 +226,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_Vec3} The created vector. static GetTranslation = function () { - gml_pragma("forceinline"); + INLINE // Dual.Scale(2.0) var _q10 = Dual.X * 2.0; @@ -255,7 +255,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Log = function () { - gml_pragma("forceinline"); + INLINE var _scale = 1.0 / Real.Length(); return new BBMOD_DualQuaternion() .FromRealDual( @@ -272,7 +272,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Mul = function (_dq) { - gml_pragma("forceinline"); + INLINE var _dq1r0 = Real.X; var _dq1r1 = Real.Y; @@ -317,7 +317,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Normalize = function () { - gml_pragma("forceinline"); + INLINE var _dq = Clone(); var _mag = Real.Dot(Real); if (_mag > math_get_epsilon()) @@ -337,7 +337,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Pow = function (_p) { - gml_pragma("forceinline"); + INLINE return Log().Scale(_p).Exp(); }; @@ -350,7 +350,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_Vec3} The created vector. static Rotate = function (_v) { - gml_pragma("forceinline"); + INLINE return Real.Rotate(_v); }; @@ -363,7 +363,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Scale = function (_s) { - gml_pragma("forceinline"); + INLINE var _dq = new BBMOD_DualQuaternion(); _dq.Real = Real.Scale(_s); _dq.Dual = Dual.Scale(_s); @@ -380,7 +380,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} The created dual quaternion. static Sclerp = function (_dq, _s) { - gml_pragma("forceinline"); + INLINE return _dq.Mul(Conjugate()).Pow(_s).Mul(self).Normalize(); }; @@ -396,7 +396,7 @@ function BBMOD_DualQuaternion( /// /// @return {Array} Returns the destination array. static ToArray = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(8, 0.0); Real.ToArray(_array, _index); Dual.ToArray(_array, _index + 4); @@ -413,7 +413,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_DualQuaternion} Returns `self`. static ToBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE Real.ToBuffer(_buffer, _type); Dual.ToBuffer(_buffer, _type); return self; @@ -430,7 +430,7 @@ function BBMOD_DualQuaternion( /// /// @return {Array} Returns the destination array. static ToMatrix = function (_dest=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _dest ??= array_create(16, 0.0); @@ -459,7 +459,7 @@ function BBMOD_DualQuaternion( /// /// @return {Struct.BBMOD_Vec3} The created vector. static Transform = function (_v) { - gml_pragma("forceinline"); + INLINE return GetTranslation().Add(Real.Rotate(_v)); }; } @@ -484,7 +484,7 @@ function BBMOD_DualQuaternion( function __bbmod_dual_quaternion_array_multiply( _dq1, _dq1Index, _dq2, _dq2Index, _dest, _destIndex) { - gml_pragma("forceinline"); + INLINE var _dq1r0 = _dq1[_dq1Index + 0]; var _dq1r1 = _dq1[_dq1Index + 1]; diff --git a/scripts/BBMOD_Matrix/BBMOD_Matrix.gml b/scripts/BBMOD_Matrix/BBMOD_Matrix.gml index 4a08bab48..1c46654a5 100644 --- a/scripts/BBMOD_Matrix/BBMOD_Matrix.gml +++ b/scripts/BBMOD_Matrix/BBMOD_Matrix.gml @@ -17,7 +17,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static Copy = function (_dest) { - gml_pragma("forceinline"); + INLINE array_copy(_dest.Raw, 0, Raw, 0, 16); return self; }; @@ -42,7 +42,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static Set = function (_index, _value) { - gml_pragma("forceinline"); + INLINE Raw[@ _index] = _value; return self; }; @@ -57,7 +57,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromArray = function (_array, _index=0) { - gml_pragma("forceinline"); + INLINE array_copy(Raw, 0, _array, _index, 16); return self; }; @@ -72,7 +72,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Array} The destination array. static ToArray = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(16, 0.0); array_copy(_array, _index, Raw, 0, 16); return _array; @@ -88,7 +88,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE var _index = 0; repeat (16) { @@ -106,7 +106,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static ToBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE var _index = 0; repeat (16) { @@ -126,7 +126,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromColumns = function (_c1, _c2, _c3, _c4) { - gml_pragma("forceinline"); + INLINE Raw = [ _c1.X, _c2.X, _c3.X, _c4.X, _c1.Y, _c2.Y, _c3.Y, _c4.Y, @@ -147,7 +147,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromRows = function (_r1, _r2, _r3, _r4) { - gml_pragma("forceinline"); + INLINE Raw = [ _r1.X, _r1.Y, _r1.Z, _r1.W, _r2.X, _r2.Y, _r2.Z, _r2.W, @@ -167,7 +167,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromLookAt = function (_from, _to, _up) { - gml_pragma("forceinline"); + INLINE Raw = matrix_build_lookat( _from.X, _from.Y, _from.Z, _to.X, _to.Y, _to.Z, @@ -181,7 +181,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromWorld = function () { - gml_pragma("forceinline"); + INLINE Raw = matrix_get(matrix_world); return self; }; @@ -192,7 +192,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromView = function () { - gml_pragma("forceinline"); + INLINE Raw = matrix_get(matrix_view); return self; }; @@ -203,7 +203,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromProjection = function () { - gml_pragma("forceinline"); + INLINE Raw = matrix_get(matrix_projection); return self; }; @@ -215,7 +215,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static FromWorldViewProjection = function () { - gml_pragma("forceinline"); + INLINE Raw = matrix_multiply( matrix_multiply(matrix_get(matrix_world), matrix_get(matrix_view)), matrix_get(matrix_projection)); @@ -228,7 +228,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static PushMatrix = function () { - gml_pragma("forceinline"); + INLINE matrix_stack_push(Raw); return self; }; @@ -240,7 +240,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static ApplyWorld = function () { - gml_pragma("forceinline"); + INLINE matrix_set(matrix_world, Raw); return self; }; @@ -251,7 +251,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static ApplyView = function () { - gml_pragma("forceinline"); + INLINE matrix_set(matrix_view, Raw); return self; }; @@ -262,7 +262,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} Returns `self`. static ApplyProjection = function () { - gml_pragma("forceinline"); + INLINE matrix_set(matrix_projection, Raw); return self; }; @@ -278,7 +278,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Array} The destination array. static ToEuler = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(3, 0.0); @@ -321,7 +321,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Real} The determinant. static Determinant = function () { - gml_pragma("forceinline"); + INLINE var _m = Raw; var _m0 = _m[ 0]; var _m1 = _m[ 1]; @@ -354,7 +354,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The inverse matrix. static Inverse = function () { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _m = Raw; @@ -427,7 +427,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// `world * view * projection` matrix, you can simply call /// {@link BBMOD_Matrix.FromWorldViewProjection}. static Mul = function (_matrix) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _raw = matrix_multiply(Raw, _matrix.Raw); var _index = 1; @@ -449,7 +449,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static MulComponentwise = function (_matrix) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _selfRaw = Raw; var _otherRaw = _matrix.Raw; @@ -471,7 +471,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static AddComponentwise = function (_matrix) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _selfRaw = Raw; var _otherRaw = _matrix.Raw; @@ -494,7 +494,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static SubComponentwise = function (_matrix) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _selfRaw = Raw; var _otherRaw = _matrix.Raw; @@ -516,7 +516,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Vec4} The tranformed vector. static Transform = function (_vector) { - gml_pragma("forceinline"); + INLINE return _vector.Transform(Raw); }; @@ -526,7 +526,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The transposed matrix. static Transpose = function () { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _m = Raw; _res.Raw = [ @@ -551,7 +551,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static Translate = function (_x, _y=undefined, _z=undefined) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, is_struct(_x) @@ -568,7 +568,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static TranslateX = function (_x) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(_x, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); @@ -583,7 +583,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static TranslateY = function (_y) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, _y, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); @@ -598,7 +598,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static TranslateZ = function (_z) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, _z, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); @@ -620,7 +620,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @note The order of rotations is YXZ, same as in `matrix_build`. static RotateEuler = function (_x, _y=undefined, _z=undefined) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, is_struct(_x) @@ -638,7 +638,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static RotateQuat = function (_quat) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, _quat.ToMatrix()); return _res; @@ -652,7 +652,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static RotateX = function (_x) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, 0.0, _x, 0.0, 0.0, 1.0, 1.0, 1.0)); @@ -667,7 +667,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static RotateY = function (_y) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, 0.0, 0.0, _y, 0.0, 1.0, 1.0, 1.0)); @@ -682,7 +682,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static RotateZ = function (_z) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, 0.0, 0.0, 0.0, _z, 1.0, 1.0, 1.0)); @@ -702,7 +702,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static Scale = function (_x, _y=undefined, _z=undefined) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, is_struct(_x) @@ -719,7 +719,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static ScaleComponentwise = function (_s) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); var _selfRaw = Raw; var _index = 0; @@ -739,7 +739,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static ScaleX = function (_x) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, _x, 1.0, 1.0)); @@ -754,7 +754,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static ScaleY = function (_y) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, _y, 1.0)); @@ -769,7 +769,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// /// @return {Struct.BBMOD_Matrix} The resulting matrix. static ScaleZ = function (_z) { - gml_pragma("forceinline"); + INLINE var _res = new BBMOD_Matrix(); _res.Raw = matrix_multiply(Raw, matrix_build(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, _z)); @@ -790,7 +790,7 @@ function BBMOD_Matrix(_raw=undefined) constructor /// @return {Array} The destination array. function bbmod_matrix_build_normalmatrix(_m, _dest=[], _index=0) { - gml_pragma("forceinline"); + INLINE var _m0 = _m[ 0]; var _m1 = _m[ 1]; diff --git a/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml b/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml index 8333b4946..0d1deb3dc 100644 --- a/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml +++ b/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml @@ -26,7 +26,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor W = _w; static set = function(x, y, z, w) { - gml_pragma("forceinline"); + INLINE X = x; Y = y; Z = z; @@ -42,7 +42,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Add = function (_q) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Quaternion( X + _q.X, Y + _q.Y, @@ -57,7 +57,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Clone = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Quaternion(X, Y, Z, W); }; @@ -67,7 +67,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Conjugate = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Quaternion(-X, -Y, -Z, W); }; @@ -79,7 +79,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} Returns `self`. static Copy = function (_dest) { - gml_pragma("forceinline"); + INLINE _dest.X = X; _dest.Y = Y; _dest.Z = Z; @@ -95,7 +95,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Real} The dot product of the quaternions. static Dot = function (_q) { - gml_pragma("forceinline"); + INLINE return ( X * _q.X + Y * _q.Y @@ -111,7 +111,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Exp = function () { - gml_pragma("forceinline"); + INLINE var _length = Length(); if (_length >= math_get_epsilon()) { @@ -137,7 +137,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} Returns `self`. static FromArray = function (_array, _index=0) { - gml_pragma("forceinline"); + INLINE X = _array[_index]; Y = _array[_index + 1]; Z = _array[_index + 2]; @@ -155,7 +155,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} Returns `self`. static FromAxisAngle = function (_axis, _angle) { - gml_pragma("forceinline"); + INLINE _angle = -_angle; var _sinHalfAngle = dsin(_angle * 0.5); X = is_nan(_axis.X)? 0 : _axis.X * _sinHalfAngle; @@ -176,7 +176,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} Returns `self`. static FromBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE X = buffer_read(_buffer, _type); Y = buffer_read(_buffer, _type); Z = buffer_read(_buffer, _type); @@ -197,7 +197,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// @note The order of rotations is YXZ, same as in the `matrix_build` /// function. static FromEuler = function (_x, _y, _z) { - gml_pragma("forceinline"); + INLINE _x = -_x * 0.5; _y = -_y * 0.5; @@ -241,7 +241,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} Returns `self`. static FromLookRotation = function (_forward, _up) { - gml_pragma("forceinline"); + INLINE _forward = new BBMOD_Vec3(_forward); _up = new BBMOD_Vec3(_up); @@ -267,7 +267,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor }; static FromMatrix = function(rotMatrix) { - gml_pragma("forceinline"); + INLINE W = sqrt(1 + rotMatrix[0] + rotMatrix[5] + rotMatrix[10]) / 2; X = (rotMatrix[9] - rotMatrix[6]) / (4 * W); @@ -282,7 +282,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Real} The rotation angle. static GetAngle = function () { - gml_pragma("forceinline"); + INLINE return radtodeg(arccos(W) * 2.0); }; @@ -292,7 +292,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Vec3} The axis of rotation. static GetAxis = function () { - gml_pragma("forceinline"); + INLINE var _sinThetaInv = 1.0 / sin(arccos(W)); return new BBMOD_Vec3( X * _sinThetaInv, @@ -308,7 +308,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Inverse = function () { - gml_pragma("forceinline"); + INLINE return Conjugate().Scale(1.0 / Length()); }; @@ -318,7 +318,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Real} The length of the quaternion. static Length = function () { - gml_pragma("forceinline"); + INLINE return sqrt( X * X + Y * Y @@ -333,7 +333,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Real} The squared length of the quaternion. static LengthSqr = function () { - gml_pragma("forceinline"); + INLINE return ( X * X + Y * Y @@ -352,7 +352,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Lerp = function (_q, _s) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Quaternion( lerp(X, _q.X, _s), lerp(Y, _q.Y, _s), @@ -368,7 +368,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Log = function () { - gml_pragma("forceinline"); + INLINE var _length = Length(); var _w = logn(2.71828, _length); var _a = arccos(W / _length); @@ -394,7 +394,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Mul = function (_q) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Quaternion( W * _q.X + X * _q.W + Y * _q.Z - Z * _q.Y, W * _q.Y + Y * _q.W + Z * _q.X - X * _q.Z, @@ -410,7 +410,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Normalize = function () { - gml_pragma("forceinline"); + INLINE var _lengthSqr = LengthSqr(); if(_lengthSqr == 0) return new BBMOD_Quaternion(); @@ -429,7 +429,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Vec3} The created vector. static Rotate = function (_v) { - gml_pragma("forceinline"); + INLINE var _tovec = is_instanceof(_v, __vec3); if(_tovec) _v = new BBMOD_Vec3(_v.x, _v.y, _v.z); @@ -454,7 +454,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Scale = function (_s) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Quaternion( X * _s, Y * _s, @@ -464,7 +464,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor }; static Sinc = function (_x) { - gml_pragma("forceinline"); + INLINE return (_x >= math_get_epsilon()) ? (sin(_x) / _x) : 1.0; }; @@ -478,7 +478,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} The created quaternion. static Slerp = function (_q, _s) { - gml_pragma("forceinline"); + INLINE var _q10 = X; var _q11 = Y; @@ -561,7 +561,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Array} Returns the destination array. static ToArray = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(4, 0.0); _array[@ _index] = X; _array[@ _index + 1] = Y; @@ -579,7 +579,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Struct.BBMOD_Quaternion} Returns `self`. static ToBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE buffer_write(_buffer, _type, X); buffer_write(_buffer, _type, Y); buffer_write(_buffer, _type, Z); @@ -624,7 +624,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor /// /// @return {Array} Returns the destination array. static ToMatrix = function (_dest=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _dest ??= matrix_build_identity(); diff --git a/scripts/BBMOD_Vec2/BBMOD_Vec2.gml b/scripts/BBMOD_Vec2/BBMOD_Vec2.gml index 79caa0503..82b4e8aa0 100644 --- a/scripts/BBMOD_Vec2/BBMOD_Vec2.gml +++ b/scripts/BBMOD_Vec2/BBMOD_Vec2.gml @@ -27,7 +27,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// new BBMOD_Vec2(-1.0, 2.0).Abs() // => BBMOD_Vec2(1.0, 2.0) /// ``` static Abs = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( abs(X), abs(Y) @@ -42,7 +42,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} The created vector. static Add = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( X + _v.X, Y + _v.Y @@ -61,7 +61,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// new BBMOD_Vec2(0.2, 1.6).Ceil() // => BBMOD_Vec2(1.0, 2.0) /// ``` static Ceil = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( ceil(X), ceil(Y) @@ -78,7 +78,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} The resulting vector. static Clamp = function (_min, _max) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( clamp(X, _min.X, _max.X), clamp(Y, _min.Y, _max.Y) @@ -102,7 +102,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// new BBMOD_Vec2(3.0, 0.0).ClampLength(1.0, 2.0) // => BBMOD_Vec2(2.0, 0.0) /// ``` static ClampLength = function (_min, _max) { - gml_pragma("forceinline"); + INLINE var _length = sqrt( X * X + Y * Y @@ -120,7 +120,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} The creted vector. static Clone = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( X, Y @@ -144,7 +144,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// show_debug_message(_v2) // Prints { X: 1.0, Y: 2.0 } /// ``` static Copy = function (_dest) { - gml_pragma("forceinline"); + INLINE _dest.X = X; _dest.Y = Y; return self; @@ -158,7 +158,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Real} The dot product of this vector and vector `_v`. static Dot = function (_v) { - gml_pragma("forceinline"); + INLINE return ( X * _v.X + Y * _v.Y @@ -173,7 +173,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Bool} Returns `true` if the two vectors are equal. static Equals = function (_v) { - gml_pragma("forceinline"); + INLINE return ( X == _v.X && Y == _v.Y @@ -192,7 +192,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// new BBMOD_Vec2(0.2, 1.6).Floor() // => BBMOD_Vec2(0.0, 1.0) /// ``` static Floor = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( floor(X), floor(Y) @@ -211,7 +211,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// new BBMOD_Vec2(0.2, 1.6).Frac() // => BBMOD_Vec2(0.2, 0.6) /// ``` static Frac = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( frac(X), frac(Y) @@ -228,7 +228,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} Returns `self`. static FromArray = function (_array, _index=0) { - gml_pragma("forceinline"); + INLINE X = _array[_index]; Y = _array[_index + 1]; return self; @@ -247,7 +247,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} Returns `self`. static FromBarycentric = function (_v1, _v2, _v3, _f, _g) { - gml_pragma("forceinline"); + INLINE var _v1X = _v1.X; var _v1Y = _v1.Y; X = _v1X + _f * (_v2.X - _v1X) + _g * (_v3.X - _v1X); @@ -264,7 +264,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} Returns `self`. static FromBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE X = buffer_read(_buffer, _type); Y = buffer_read(_buffer, _type); return self; @@ -276,7 +276,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Real} The length of the vector. static Length = function () { - gml_pragma("forceinline"); + INLINE return sqrt( X * X + Y * Y @@ -289,7 +289,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Real} The squared length of the vector. static LengthSqr = function () { - gml_pragma("forceinline"); + INLINE return ( X * X + Y * Y @@ -303,7 +303,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// @param {Struct.BBMOD_Vec2} _v The vector to interpolate with. /// @param {Real} _amount The interpolation factor. static Lerp = function (_v, _amount) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( lerp(X, _v.X, _amount), lerp(Y, _v.Y, _amount) @@ -316,7 +316,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Real} The greates component of the vector. static MaxComponent = function () { - gml_pragma("forceinline"); + INLINE return max( X, Y, @@ -339,7 +339,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// var _vMax = _v1.Maximize(_v2); // Equals to BBMOD_Vec2(2.0, 4.0) /// ``` static Maximize = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( max(X, _v.X), max(Y, _v.Y) @@ -352,7 +352,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Real} The smallest component of the vector. static MinComponent = function () { - gml_pragma("forceinline"); + INLINE return min( X, Y, @@ -375,7 +375,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// var _vMin = _v1.Minimize(_v2); // Equals to BBMOD_Vec2(1.0, 3.0) /// ``` static Minimize = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( min(X, _v.X), min(Y, _v.Y) @@ -391,7 +391,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} The created vector. static Mul = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( X * _v.X, Y * _v.Y @@ -404,7 +404,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} The created vector. static Normalize = function () { - gml_pragma("forceinline"); + INLINE var _lengthSqr = ( X * X + Y * Y @@ -432,7 +432,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} The created vector. static Reflect = function (_v) { - gml_pragma("forceinline"); + INLINE var _dot2 = ( X * _v.X + Y * _v.Y @@ -455,7 +455,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// new BBMOD_Vec2(0.2, 1.6).Round() // => BBMOD_Vec2(0.0, 2.0) /// ``` static Round = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec2( round(X), round(Y) @@ -493,7 +493,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @throws {BBMOD_OutOfRangeException} If an invalid index is passed. static Get = function (_index) { - gml_pragma("forceinline"); + INLINE switch (_index) { case 0: @@ -514,7 +514,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} Returns `self`. static Set = function (_x=0.0, _y=undefined) { - gml_pragma("forceinline"); + INLINE X = _x; Y = _y ?? X; return self; @@ -532,7 +532,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// @throws {BBMOD_OutOfRangeException} If the given index is out of range /// of possible values. static SetIndex = function (_index, _value) { - gml_pragma("forceinline"); + INLINE switch (_index) { case 0: @@ -584,7 +584,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Array} The target array. static ToArray = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(2, 0.0); _array[@ _index] = X; _array[@ _index + 1] = Y; @@ -600,7 +600,7 @@ function BBMOD_Vec2(_x=0.0, _y=_x) constructor /// /// @return {Struct.BBMOD_Vec2} Returns `self`. static ToBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE buffer_write(_buffer, _type, X); buffer_write(_buffer, _type, Y); return self; diff --git a/scripts/BBMOD_Vec3/BBMOD_Vec3.gml b/scripts/BBMOD_Vec3/BBMOD_Vec3.gml index 7d874ac69..7bd1d8540 100644 --- a/scripts/BBMOD_Vec3/BBMOD_Vec3.gml +++ b/scripts/BBMOD_Vec3/BBMOD_Vec3.gml @@ -57,7 +57,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// new BBMOD_Vec3(-1.0, 2.0, -3.0).Abs() // => BBMOD_Vec3(1.0, 2.0, 3.0) /// ``` static Abs = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( abs(X), abs(Y), @@ -73,7 +73,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The created vector. static Add = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( X + _v.X, Y + _v.Y, @@ -93,7 +93,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// new BBMOD_Vec3(0.2, 1.6, 2.4).Ceil() // => BBMOD_Vec3(1.0, 2.0, 3.0) /// ``` static Ceil = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( ceil(X), ceil(Y), @@ -111,7 +111,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The resulting vector. static Clamp = function (_min, _max) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( clamp(X, _min.X, _max.X), clamp(Y, _min.Y, _max.Y), @@ -139,7 +139,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// new BBMOD_Vec3(3.0, 0.0, 0.0).ClampLength(1.0, 2.0) /// ``` static ClampLength = function (_min, _max) { - gml_pragma("forceinline"); + INLINE var _length = sqrt( X * X + Y * Y @@ -159,7 +159,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The creted vector. static Clone = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( X, Y, @@ -184,7 +184,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// show_debug_message(_v2) // Prints { X: 1.0, Y: 2.0, Z: 3.0 } /// ``` static Copy = function (_dest) { - gml_pragma("forceinline"); + INLINE _dest.X = X; _dest.Y = Y; _dest.Z = Z; @@ -200,7 +200,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The created vector. static Cross = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( Y * _v.Z - Z * _v.Y, Z * _v.X - X * _v.Z, @@ -216,7 +216,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Real} The dot product of this vector and vector `_v`. static Dot = function (_v) { - gml_pragma("forceinline"); + INLINE return ( X * _v.X + Y * _v.Y @@ -232,7 +232,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Bool} Returns `true` if the two vectors are equal. static Equals = function (_v) { - gml_pragma("forceinline"); + INLINE return ( X == _v.X && Y == _v.Y @@ -252,7 +252,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// new BBMOD_Vec3(0.2, 1.6, 2.4).Floor() // => BBMOD_Vec3(0.0, 1.0, 2.0) /// ``` static Floor = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( floor(X), floor(Y), @@ -272,7 +272,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// new BBMOD_Vec3(0.2, 1.6, 2.4).Frac() // => BBMOD_Vec3(0.2, 0.6, 0.4) /// ``` static Frac = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( frac(X), frac(Y), @@ -290,7 +290,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} Returns `self`. static FromArray = function (_array, _index=0) { - gml_pragma("forceinline"); + INLINE X = _array[_index]; Y = _array[_index + 1]; Z = _array[_index + 2]; @@ -310,7 +310,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} Returns `self`. static FromBarycentric = function (_v1, _v2, _v3, _f, _g) { - gml_pragma("forceinline"); + INLINE var _v1X = _v1.X; var _v1Y = _v1.Y; var _v1Z = _v1.Z; @@ -329,7 +329,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} Returns `self`. static FromBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE X = buffer_read(_buffer, _type); Y = buffer_read(_buffer, _type); Z = buffer_read(_buffer, _type); @@ -342,7 +342,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Real} The length of the vector. static Length = function () { - gml_pragma("forceinline"); + INLINE return sqrt( X * X + Y * Y @@ -356,7 +356,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Real} The squared length of the vector. static LengthSqr = function () { - gml_pragma("forceinline"); + INLINE return ( X * X + Y * Y @@ -371,7 +371,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// @param {Struct.BBMOD_Vec3} _v The vector to interpolate with. /// @param {Real} _amount The interpolation factor. static Lerp = function (_v, _amount) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( lerp(X, _v.X, _amount), lerp(Y, _v.Y, _amount), @@ -385,7 +385,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Real} The greates component of the vector. static MaxComponent = function () { - gml_pragma("forceinline"); + INLINE return max( X, Y, @@ -409,7 +409,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// var _vMax = _v1.Maximize(_v2); // Equals to BBMOD_Vec3(2.0, 4.0, 6.0) /// ``` static Maximize = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( max(X, _v.X), max(Y, _v.Y), @@ -423,7 +423,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Real} The smallest component of the vector. static MinComponent = function () { - gml_pragma("forceinline"); + INLINE return min( X, Y, @@ -447,7 +447,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// var _vMin = _v1.Minimize(_v2); // Equals to BBMOD_Vec3(1.0, 3.0, 5.0) /// ``` static Minimize = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( min(X, _v.X), min(Y, _v.Y), @@ -464,7 +464,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The created vector. static Mul = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( X * _v.X, Y * _v.Y, @@ -478,7 +478,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The created vector. static Normalize = function () { - gml_pragma("forceinline"); + INLINE var _lengthSqr = ( X * X + Y * Y @@ -508,7 +508,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Bool} Returns `true` if the vectors were orthonormalized. static Orthonormalize = function (_v) { - gml_pragma("forceinline"); + INLINE var _v1 = Normalize(); var _proj = _v1.Scale(_v.Dot(_v1)); @@ -534,7 +534,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} The created vector. static Reflect = function (_v) { - gml_pragma("forceinline"); + INLINE var _dot2 = ( X * _v.X + Y * _v.Y @@ -559,7 +559,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// new BBMOD_Vec3(0.2, 1.6, 2.4).Round() // => BBMOD_Vec3(0.0, 2.0, 2.0) /// ``` static Round = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec3( round(X), round(Y), @@ -599,7 +599,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @throws {BBMOD_OutOfRangeException} If an invalid index is passed. static Get = function (_index) { - gml_pragma("forceinline"); + INLINE switch (_index) { case 0: @@ -624,7 +624,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} Returns `self`. static Set = function (_x=0.0, _y=_x, _z=_x) { - gml_pragma("forceinline"); + INLINE X = _x; Y = _y; Z = _z; @@ -643,7 +643,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// @throws {BBMOD_OutOfRangeException} If the given index is out of range /// of possible values. static SetIndex = function (_index, _value) { - gml_pragma("forceinline"); + INLINE switch (_index) { case 0: @@ -701,7 +701,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Array} The target array. static ToArray = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(3, 0.0); _array[@ _index] = X; _array[@ _index + 1] = Y; @@ -718,7 +718,7 @@ function BBMOD_Vec3(_x=0.0, _y=_x, _z=_x) constructor { /// /// @return {Struct.BBMOD_Vec3} Returns `self`. static ToBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE buffer_write(_buffer, _type, X); buffer_write(_buffer, _type, Y); buffer_write(_buffer, _type, Z); diff --git a/scripts/BBMOD_Vec4/BBMOD_Vec4.gml b/scripts/BBMOD_Vec4/BBMOD_Vec4.gml index 610651a26..af0f0b1a8 100644 --- a/scripts/BBMOD_Vec4/BBMOD_Vec4.gml +++ b/scripts/BBMOD_Vec4/BBMOD_Vec4.gml @@ -36,7 +36,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// new BBMOD_Vec4(-1.0, 2.0, -3.0, 4.0).Abs() /// ``` static Abs = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( abs(X), abs(Y), @@ -53,7 +53,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} The created vector. static Add = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( X + _v.X, Y + _v.Y, @@ -75,7 +75,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// new BBMOD_Vec4(0.2, 1.6, 2.4, 3.1).Ceil() /// ``` static Ceil = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( ceil(X), ceil(Y), @@ -94,7 +94,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} The resulting vector. static Clamp = function (_min, _max) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( clamp(X, _min.X, _max.X), clamp(Y, _min.Y, _max.Y), @@ -123,7 +123,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// new BBMOD_Vec4(3.0, 0.0, 0.0, 0.0).ClampLength(1.0, 2.0) /// ``` static ClampLength = function (_min, _max) { - gml_pragma("forceinline"); + INLINE var _length = sqrt( X * X + Y * Y @@ -145,7 +145,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} The creted vector. static Clone = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( X, Y, @@ -171,7 +171,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// show_debug_message(_v2) // Prints { X: 1.0, Y: 2.0, Z: 3.0, W: 4.0 } /// ``` static Copy = function (_dest) { - gml_pragma("forceinline"); + INLINE _dest.X = X; _dest.Y = Y; _dest.Z = Z; @@ -187,7 +187,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Real} The dot product of this vector and vector `_v`. static Dot = function (_v) { - gml_pragma("forceinline"); + INLINE return ( X * _v.X + Y * _v.Y @@ -204,7 +204,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Bool} Returns `true` if the two vectors are equal. static Equals = function (_v) { - gml_pragma("forceinline"); + INLINE return ( X == _v.X && Y == _v.Y @@ -226,7 +226,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// new BBMOD_Vec4(0.2, 1.6, 2.4, 3.1).Floor() /// ``` static Floor = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( floor(X), floor(Y), @@ -248,7 +248,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// new BBMOD_Vec4(0.2, 1.6, 2.4, 3.1).Frac() /// ``` static Frac = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( frac(X), frac(Y), @@ -268,7 +268,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} Returns `self`. static FromArray = function (_array, _index=0) { - gml_pragma("forceinline"); + INLINE X = _array[_index]; Y = _array[_index + 1]; Z = _array[_index + 2]; @@ -289,7 +289,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} Returns `self`. static FromBarycentric = function (_v1, _v2, _v3, _f, _g) { - gml_pragma("forceinline"); + INLINE var _v1X = _v1.X; var _v1Y = _v1.Y; var _v1Z = _v1.Z; @@ -310,7 +310,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} Returns `self`. static FromBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE X = buffer_read(_buffer, _type); Y = buffer_read(_buffer, _type); Z = buffer_read(_buffer, _type); @@ -324,7 +324,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Real} The length of the vector. static Length = function () { - gml_pragma("forceinline"); + INLINE return sqrt( X * X + Y * Y @@ -339,7 +339,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Real} The squared length of the vector. static LengthSqr = function () { - gml_pragma("forceinline"); + INLINE return ( X * X + Y * Y @@ -355,7 +355,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// @param {Struct.BBMOD_Vec4} _v The vector to interpolate with. /// @param {Real} _amount The interpolation factor. static Lerp = function (_v, _amount) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( lerp(X, _v.X, _amount), lerp(Y, _v.Y, _amount), @@ -370,7 +370,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Real} The greates component of the vector. static MaxComponent = function () { - gml_pragma("forceinline"); + INLINE return max( X, Y, @@ -395,7 +395,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// var _vMax = _v1.Maximize(_v2); // Equals to BBMOD_Vec4(2.0, 4.0, 6.0, 8.0) /// ``` static Maximize = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( max(X, _v.X), max(Y, _v.Y), @@ -410,7 +410,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Real} The smallest component of the vector. static MinComponent = function () { - gml_pragma("forceinline"); + INLINE return min( X, Y, @@ -435,7 +435,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// var _vMin = _v1.Minimize(_v2); // Equals to BBMOD_Vec4(1.0, 3.0, 5.0, 7.0) /// ``` static Minimize = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( min(X, _v.X), min(Y, _v.Y), @@ -453,7 +453,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} The created vector. static Mul = function (_v) { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( X * _v.X, Y * _v.Y, @@ -468,7 +468,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} The created vector. static Normalize = function () { - gml_pragma("forceinline"); + INLINE var _lengthSqr = ( X * X + Y * Y @@ -502,7 +502,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} The created vector. static Reflect = function (_v) { - gml_pragma("forceinline"); + INLINE var _dot2 = ( X * _v.X + Y * _v.Y @@ -530,7 +530,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// new BBMOD_Vec4(0.2, 1.6, 2.4, 3.1).Round() /// ``` static Round = function () { - gml_pragma("forceinline"); + INLINE return new BBMOD_Vec4( round(X), round(Y), @@ -573,7 +573,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @throws {BBMOD_OutOfRangeException} If an invalid index is passed. static Get = function (_index) { - gml_pragma("forceinline"); + INLINE switch (_index) { case 0: @@ -602,7 +602,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} Returns `self`. static Set = function (_x=0.0, _y=_x, _z=_x, _w=_x) { - gml_pragma("forceinline"); + INLINE X = _x; Y = _y; Z = _z; @@ -622,7 +622,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// @throws {BBMOD_OutOfRangeException} If the given index is out of range /// of possible values. static SetIndex = function (_index, _value) { - gml_pragma("forceinline"); + INLINE switch (_index) { case 0: @@ -684,7 +684,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Array} The target array. static ToArray = function (_array=undefined, _index=0) { - gml_pragma("forceinline"); + INLINE _array ??= array_create(4, 0.0); _array[@ _index] = X; _array[@ _index + 1] = Y; @@ -702,7 +702,7 @@ function BBMOD_Vec4(_x=0.0, _y=_x, _z=_x, _w=_x) constructor /// /// @return {Struct.BBMOD_Vec4} Returns `self`. static ToBuffer = function (_buffer, _type) { - gml_pragma("forceinline"); + INLINE buffer_write(_buffer, _type, X); buffer_write(_buffer, _type, Y); buffer_write(_buffer, _type, Z); diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index 5d4e4a4d5..714710d3e 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -76,7 +76,7 @@ function __part(_node) constructor { frame = 0; static reset = function() { #region - gml_pragma("forceinline"); + INLINE surf = noone; @@ -85,7 +85,7 @@ function __part(_node) constructor { } #endregion static create = function(_surf, _x, _y, _life) { #region - gml_pragma("forceinline"); + INLINE active = true; surf = _surf; @@ -106,7 +106,7 @@ function __part(_node) constructor { } #endregion static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) { #region - gml_pragma("forceinline"); + INLINE speedx = _sx; speedy = _sy; @@ -124,7 +124,7 @@ function __part(_node) constructor { } #endregion static setWiggle = function(wiggle_maps) { #region - gml_pragma("forceinline"); + INLINE wig_psx = wiggle_maps.wig_psx; wig_psy = wiggle_maps.wig_psy; @@ -135,7 +135,7 @@ function __part(_node) constructor { } #endregion static setGround = function(_ground, _ground_offset, _ground_bounce, _ground_frict) { #region - gml_pragma("forceinline"); + INLINE ground = _ground; ground_y = y + _ground_offset; @@ -144,7 +144,7 @@ function __part(_node) constructor { } #endregion static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) { #region - gml_pragma("forceinline"); + INLINE sc_sx = _scx; sc_sy = _scy; @@ -156,7 +156,7 @@ function __part(_node) constructor { } #endregion static setDraw = function(_col, _blend, _alp, _fade) { #region - gml_pragma("forceinline"); + INLINE col = _col; blend = _blend; @@ -166,7 +166,7 @@ function __part(_node) constructor { } #endregion static kill = function(callDestroy = true) { #region - gml_pragma("forceinline"); + INLINE active = false; if(callDestroy && node.onPartDestroy != noone) @@ -174,7 +174,7 @@ function __part(_node) constructor { } #endregion static step = function(frame = 0) { #region - gml_pragma("forceinline"); + INLINE //if(life_total > 0) print($"Step {seed}: {trailLife}"); trailLife++; @@ -247,7 +247,7 @@ function __part(_node) constructor { } #endregion static draw = function(exact, surf_w, surf_h) { #region - gml_pragma("forceinline"); + INLINE var ss = surf; @@ -318,7 +318,7 @@ function __part(_node) constructor { } #endregion static getPivot = function() { #region - gml_pragma("forceinline"); + INLINE return [x, y]; } #endregion diff --git a/scripts/__d3d11/__d3d11.gml b/scripts/__d3d11/__d3d11.gml index 754d95a39..6c08c15ee 100644 --- a/scripts/__d3d11/__d3d11.gml +++ b/scripts/__d3d11/__d3d11.gml @@ -13,7 +13,7 @@ /// @return {String} The last error message. function d3d11_get_error_string() { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define(GMD3D11_PATH, "d3d11_get_error_string", dll_cdecl, ty_string, 0); return external_call(_fn); } @@ -29,7 +29,7 @@ function d3d11_get_error_string() { /// @return {Real} Returns 1 on success or 0 on fail. function d3d11_texture_set_stage_vs(_slot, _texture) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_vs", dll_cdecl, ty_real, 1, ty_real); texture_set_stage(0, _texture); return external_call(_fn, _slot); @@ -46,7 +46,7 @@ function d3d11_texture_set_stage_vs(_slot, _texture) { /// /// @see GMD3D11_IS_SUPPORTED function texture_set_stage_vs(_slot, _texture) { - gml_pragma("forceinline"); + INLINE if (GMD3D11_IS_SUPPORTED) { d3d11_texture_set_stage_vs(_slot, _texture); return; @@ -65,7 +65,7 @@ function texture_set_stage_vs(_slot, _texture) { /// @return {Real} Returns 1 on success or 0 on fail. function d3d11_texture_set_stage_ps(_slot, _texture) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_ps", dll_cdecl, ty_real, 1, ty_real); texture_set_stage(0, _texture); return external_call(_fn, _slot); @@ -79,7 +79,7 @@ function d3d11_texture_set_stage_ps(_slot, _texture) { /// @param {Real} _count Number of instances to draw. Use 0 to disable instanced rendering. function d3d11_draw_instanced(_count) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define(GMD3D11_PATH, "d3d11_draw_instanced", dll_cdecl, ty_real, 1, ty_real); return external_call(_fn, _count); } @@ -94,7 +94,7 @@ function d3d11_draw_instanced(_count) { /// @param {Real} _count The number of instances to draw. function vertex_submit_instanced(_vbuff, _prim, _texture, _count) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE if (!d3d11_draw_instanced(_count)) return false; @@ -104,7 +104,7 @@ function vertex_submit_instanced(_vbuff, _prim, _texture, _count) { function vertex_buffer_load(_filename, _vformat) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE var _buffer = buffer_load(_filename); var _vbuffer = vertex_create_buffer_from_buffer(_buffer, _vformat); buffer_delete(_buffer); diff --git a/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml b/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml index d51d5dffc..689dac5b6 100644 --- a/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml +++ b/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml @@ -5,7 +5,7 @@ /// @see d3d11_cbuffer_end function d3d11_cbuffer_begin() { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_begin", dll_cdecl, ty_real, 0); @@ -22,7 +22,7 @@ function d3d11_cbuffer_begin() { /// @see d3d11_cbuffer_update function d3d11_cbuffer_end() { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_end", dll_cdecl, ty_real, 0); @@ -38,7 +38,7 @@ function d3d11_cbuffer_end() { /// @see d3d11_cbuffer_begin function d3d11_cbuffer_add_bool(_count) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_bool", dll_cdecl, ty_real, 1, ty_real); @@ -54,7 +54,7 @@ function d3d11_cbuffer_add_bool(_count) { /// @see d3d11_cbuffer_begin function d3d11_cbuffer_add_int(_count) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_int", dll_cdecl, ty_real, 1, ty_real); @@ -70,7 +70,7 @@ function d3d11_cbuffer_add_int(_count) { /// @see d3d11_cbuffer_begin function d3d11_cbuffer_add_uint(_count) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_uint", dll_cdecl, ty_real, 1, ty_real); @@ -86,7 +86,7 @@ function d3d11_cbuffer_add_uint(_count) { /// @see d3d11_cbuffer_begin function d3d11_cbuffer_add_float(_count) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_float", dll_cdecl, ty_real, 1, ty_real); @@ -100,7 +100,7 @@ function d3d11_cbuffer_add_float(_count) { /// @param {Real} The size of the constant buffer in bytes. function d3d11_cbuffer_get_size(_cbuffer) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_get_size", dll_cdecl, ty_real, 1, ty_real); @@ -115,7 +115,7 @@ function d3d11_cbuffer_get_size(_cbuffer) { /// @param {Id.Buffer} _buffer A buffer with new data. function d3d11_cbuffer_update(_cbuffer, _buffer) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_update", dll_cdecl, ty_real, 2, ty_real, ty_string); @@ -130,7 +130,7 @@ function d3d11_cbuffer_update(_cbuffer, _buffer) { /// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot. function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_set_cbuffer_ps", dll_cdecl, ty_real, 2, ty_real, ty_real); @@ -145,7 +145,7 @@ function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer) { /// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot. function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_set_cbuffer_vs", dll_cdecl, ty_real, 2, ty_real, ty_real); @@ -161,7 +161,7 @@ function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer) { /// @return {Bool} Returns true if the constant buffer exists. function d3d11_cbuffer_exists(_cbuffer) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_exists", dll_cdecl, ty_real, 1, ty_real); @@ -175,7 +175,7 @@ function d3d11_cbuffer_exists(_cbuffer) { /// @param {Real} _cbuffer The ID of the constant buffer to destroy. function d3d11_cbuffer_destroy(_cbuffer) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_destroy", dll_cdecl, ty_real, 1, ty_real); diff --git a/scripts/__d3d11_shader/__d3d11_shader.gml b/scripts/__d3d11_shader/__d3d11_shader.gml index 4e77079e1..9610fc248 100644 --- a/scripts/__d3d11_shader/__d3d11_shader.gml +++ b/scripts/__d3d11_shader/__d3d11_shader.gml @@ -14,7 +14,7 @@ /// @see d3d11_get_error_string function d3d11_shader_compile_ps(_file, _entryPoint, _profile) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_compile_ps", dll_cdecl, ty_real, 3, ty_string, ty_string, ty_string); @@ -34,7 +34,7 @@ function d3d11_shader_compile_ps(_file, _entryPoint, _profile) { /// @see d3d11_get_error_string function d3d11_shader_compile_vs(_file, _entryPoint, _profile) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_compile_vs", dll_cdecl, ty_real, 3, ty_string, ty_string, ty_string); @@ -49,7 +49,7 @@ function d3d11_shader_compile_vs(_file, _entryPoint, _profile) { /// @param {Real} _ps The ID of the shader or -1 to disable the override. function d3d11_shader_override_ps(_ps) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_override_ps", dll_cdecl, ty_real, 1, ty_real); @@ -66,7 +66,7 @@ function d3d11_shader_override_ps(_ps) { /// shader! function d3d11_shader_override_vs(_vs) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_override_vs", dll_cdecl, ty_real, 1, ty_real); @@ -82,7 +82,7 @@ function d3d11_shader_override_vs(_vs) { /// @return {Bool} Returns true if the shader exists. function d3d11_shader_exists(_shader) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_exists", dll_cdecl, ty_real, 1, ty_real); @@ -96,7 +96,7 @@ function d3d11_shader_exists(_shader) { /// @param {Real} _shader The ID of the shader to destroy. function d3d11_shader_destroy(_shader) { if(!GMD3D11_IS_SUPPORTED) return; - gml_pragma("forceinline"); + INLINE static _fn = external_define( GMD3D11_PATH, "d3d11_shader_destroy", dll_cdecl, ty_real, 1, ty_real); diff --git a/scripts/__matrix4/__matrix4.gml b/scripts/__matrix4/__matrix4.gml index 738be4428..0590a0e4a 100644 --- a/scripts/__matrix4/__matrix4.gml +++ b/scripts/__matrix4/__matrix4.gml @@ -5,7 +5,7 @@ function __mat4() constructor { 0, 0, 0, 0 ]; static setRaw = function(raw) { - gml_pragma("forceinline"); + INLINE self.raw = raw; return self; } diff --git a/scripts/__panel_linear_setting/__panel_linear_setting.gml b/scripts/__panel_linear_setting/__panel_linear_setting.gml index c9f114f1f..489c7a388 100644 --- a/scripts/__panel_linear_setting/__panel_linear_setting.gml +++ b/scripts/__panel_linear_setting/__panel_linear_setting.gml @@ -11,18 +11,18 @@ function __Panel_Linear_Setting_Item_Preference(name, key, editWidget, _data = n self.key = key; data = function() { - gml_pragma("forceinline"); + INLINE return PREFERENCES[$ key]; } onEdit = function(val) { - gml_pragma("forceinline"); + INLINE PREFERENCES[$ key] = val; PREF_SAVE(); } getDefault = function() { - gml_pragma("forceinline"); + INLINE return PREFERENCES_DEF[$ key]; } } #endregion diff --git a/scripts/__surface/__surface.gml b/scripts/__surface/__surface.gml index 3d1126a4d..01726fb46 100644 --- a/scripts/__surface/__surface.gml +++ b/scripts/__surface/__surface.gml @@ -16,7 +16,7 @@ function SurfaceAtlas(surface, _x = 0, _y = 0, rot = 0, sx = 1, sy = 1, blend = oriSurf_h = h; static setOrginalSurface = function(surf) { - gml_pragma("forceinline"); + INLINE oriSurf = surf; oriSurf_w = surface_get_width_safe(surf); @@ -25,13 +25,13 @@ function SurfaceAtlas(surface, _x = 0, _y = 0, rot = 0, sx = 1, sy = 1, blend = } static getSurface = function() { - gml_pragma("forceinline"); + INLINE return surface.get(); } static setSurface = function(surface) { - gml_pragma("forceinline"); + INLINE self.surface.set(surface); @@ -40,14 +40,14 @@ function SurfaceAtlas(surface, _x = 0, _y = 0, rot = 0, sx = 1, sy = 1, blend = } static draw = function() { - gml_pragma("forceinline"); + INLINE draw_surface_ext_safe(surface.get(), x, y, sx, sy, rotation, blend, alpha); return self; } static clone = function(_surface = false) { - gml_pragma("forceinline"); + INLINE var _surf = getSurface(); if(_surface) _surf = surface_clone(_surf); @@ -58,7 +58,7 @@ function SurfaceAtlas(surface, _x = 0, _y = 0, rot = 0, sx = 1, sy = 1, blend = function Surface(surface) constructor { static set = function(surface) { - gml_pragma("forceinline"); + INLINE self.surface = surface; w = surface_get_width_safe(surface); @@ -67,12 +67,12 @@ function Surface(surface) constructor { } set(surface); - static get = function() { gml_pragma("forceinline"); return surface; } + static get = function() { INLINE return surface; } - static isValid = function() { gml_pragma("forceinline"); return is_surface(surface); } + static isValid = function() { INLINE return is_surface(surface); } static resize = function(w, h) { - gml_pragma("forceinline"); + INLINE surface_resize(surface, w, h); self.w = w; @@ -81,21 +81,21 @@ function Surface(surface) constructor { } static draw = function(x, y, xs = 1, ys = 1, rot = 0, col = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE draw_surface_ext_safe(surface, x, y, xs, ys, rot, col, alpha); return self; } static drawStretch = function(x, y, w = 1, h = 1, rot = 0, col = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE draw_surface_stretched_ext(surface, x, y, w, h, col, alpha); return self; } static destroy = function() { - gml_pragma("forceinline"); + INLINE if(!isValid()) return; surface_free(surface); @@ -103,7 +103,7 @@ function Surface(surface) constructor { } function Surface_get(surface) { - gml_pragma("forceinline"); + INLINE if(is_real(surface)) return surface; diff --git a/scripts/__vec2/__vec2.gml b/scripts/__vec2/__vec2.gml index f7f893ccb..b0c992135 100644 --- a/scripts/__vec2/__vec2.gml +++ b/scripts/__vec2/__vec2.gml @@ -24,7 +24,7 @@ function __vec2(_x = 0, _y = _x) constructor { } set(_x, _y); #endregion static setIndex = function(index, value) { #region - gml_pragma("forceinline"); + INLINE switch(index) { case 0 : x = value; break; case 1 : y = value; break; @@ -41,102 +41,102 @@ function __vec2(_x = 0, _y = _x) constructor { } #endregion static addElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x + _x, y + _y); } #endregion static _addElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE x += _x; y += _y; return self; } #endregion static add = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x + _vec2.x, y + _vec2.y); } #endregion static _add = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE x += _vec2.x; y += _vec2.y; return self; } #endregion static addElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x + _x, y + _y); } #endregion static _addElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE x += _x; y += _y; return self; } #endregion static subtract = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x - _vec2.x, y - _vec2.y); } #endregion static _subtract = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE x -= _vec2.x; y -= _vec2.y; return self; } #endregion static subtractElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x - _x, y - _y); } #endregion static _subtractElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE x -= _x; y -= _y; return self; } #endregion static multiply = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x * _scalar, y * _scalar); } #endregion static _multiply = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE x *= _scalar; y *= _scalar; return self; } #endregion static multiplyVec = function(_vec) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x * _vec.x, y * _vec.y); } #endregion static _multiplyVec = function(_vec) { #region - gml_pragma("forceinline"); + INLINE x *= _vec.x; y *= _vec.y; return self; } #endregion static multiplyElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x * _x, y * _y); } #endregion static _multiplyElement = function(_x, _y) { #region - gml_pragma("forceinline"); + INLINE x *= _x; y *= _y; return self; } #endregion static divide = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE if (_scalar != 0) return new __vec2(x / _scalar, y / _scalar); return new __vec2(x, y, z); // Avoid division by zero } #endregion static _divide = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE if (_scalar != 0) { x /= _scalar; y /= _scalar; @@ -145,33 +145,33 @@ function __vec2(_x = 0, _y = _x) constructor { } #endregion static dot = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE return x * _vec2.x + y * _vec2.y; } #endregion static distance = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE var dx = _vec2.x - x; var dy = _vec2.y - y; return sqrt(dx * dx + dy * dy); } #endregion static directionTo = function(_vec2) { #region - gml_pragma("forceinline"); + INLINE return point_direction(x, y, _vec2.x, _vec2.y); } #endregion static length = function() { #region - gml_pragma("forceinline"); + INLINE return sqrt(x * x + y * y); } #endregion static normalize = function() { #region - gml_pragma("forceinline"); + INLINE return clone()._normalize(); } #endregion static _normalize = function() { #region - gml_pragma("forceinline"); + INLINE var _length = length(); if (_length != 0) { x /= _length; @@ -181,28 +181,28 @@ function __vec2(_x = 0, _y = _x) constructor { } #endregion static lerpTo = function(to, speed = 0.3) { #region - gml_pragma("forceinline"); + INLINE return new __vec2(lerp(x, to.x, speed), lerp(y, to.y, speed)); } #endregion static _lerpTo = function(to, speed = 0.3) { #region - gml_pragma("forceinline"); + INLINE x = lerp(x, to.x, speed); y = lerp(y, to.y, speed); } #endregion static _lerp_float = function(to, speed = 5, pre = 0.01) { #region - gml_pragma("forceinline"); + INLINE x = lerp_float(x, to.x, speed, pre); y = lerp_float(y, to.y, speed, pre); } #endregion static equal = function(to) { #region - gml_pragma("forceinline"); + INLINE return x == to.x && y == to.y; } #endregion static clone = function() { #region - gml_pragma("forceinline"); + INLINE return new __vec2(x, y); } #endregion diff --git a/scripts/__vec3/__vec3.gml b/scripts/__vec3/__vec3.gml index c5c59ab46..adf925fd4 100644 --- a/scripts/__vec3/__vec3.gml +++ b/scripts/__vec3/__vec3.gml @@ -32,12 +32,12 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } set(_x, _y, _z); #endregion static isZero = function() { #region - gml_pragma("forceinline"); + INLINE return x == 0 && y == 0 && z == 0; } #endregion static setIndex = function(index, value) { #region - gml_pragma("forceinline"); + INLINE switch(index) { case 0 : x = value; break; case 1 : y = value; break; @@ -56,11 +56,11 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static add = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE return new __vec3(x + _vec3.x, y + _vec3.y, z + _vec3.z); } #endregion static _add = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE x += _vec3.x; y += _vec3.y; z += _vec3.z; @@ -68,11 +68,11 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static subtract = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE return new __vec3(x - _vec3.x, y - _vec3.y, z - _vec3.z); } #endregion static _subtract = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE x -= _vec3.x; y -= _vec3.y; z -= _vec3.z; @@ -80,11 +80,11 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static multiply = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE return new __vec3(x * _scalar, y * _scalar, z * _scalar); } #endregion static _multiply = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE x *= _scalar; y *= _scalar; z *= _scalar; @@ -92,11 +92,11 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static multiplyVec = function(_vec) { #region - gml_pragma("forceinline"); + INLINE return new __vec3(x * _vec.x, y * _vec.y, z * _vec.z); } #endregion static _multiplyVec = function(_vec) { #region - gml_pragma("forceinline"); + INLINE x *= _vec.x; y *= _vec.y; z *= _vec.z; @@ -104,14 +104,14 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static divide = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE if (_scalar != 0) return new __vec3(x / _scalar, y / _scalar, z / _scalar); return new __vec3(x, y, z); // Avoid division by zero } #endregion static _divide = function(_scalar) { #region - gml_pragma("forceinline"); + INLINE if (_scalar != 0) { x /= _scalar; y /= _scalar; @@ -121,12 +121,12 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static dot = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE return x * _vec3.x + y * _vec3.y + z * _vec3.z; } #endregion static cross = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE var cross_x = y * _vec3.z - z * _vec3.y; var cross_y = z * _vec3.x - x * _vec3.z; var cross_z = x * _vec3.y - y * _vec3.x; @@ -134,7 +134,7 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static distance = function(_vec3) { #region - gml_pragma("forceinline"); + INLINE var dx = _vec3.x - x; var dy = _vec3.y - y; var dz = _vec3.z - z; @@ -142,16 +142,16 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static length = function() { #region - gml_pragma("forceinline"); + INLINE return sqrt(x * x + y * y + z * z); } #endregion static normalize = function() { #region - gml_pragma("forceinline"); + INLINE return clone()._normalize(); } #endregion static _normalize = function() { #region - gml_pragma("forceinline"); + INLINE var _length = length(); if (_length != 0) { x /= _length; @@ -162,26 +162,26 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static _lerpTo = function(to, speed = 0.3) { #region - gml_pragma("forceinline"); + INLINE x = lerp(x, to.x, speed); y = lerp(y, to.y, speed); z = lerp(z, to.z, speed); } #endregion static _lerp_float = function(to, speed = 5, pre = 0.01) { #region - gml_pragma("forceinline"); + INLINE x = lerp_float(x, to.x, speed, pre); y = lerp_float(y, to.y, speed, pre); z = lerp_float(z, to.z, speed, pre); } #endregion static equal = function(to) { #region - gml_pragma("forceinline"); + INLINE return x == to.x && y == to.y && z == to.z; } #endregion static minVal = function(vec) { #region - gml_pragma("forceinline"); + INLINE return new __vec3( min(x, vec.x), min(y, vec.y), @@ -190,7 +190,7 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static maxVal = function(vec) { #region - gml_pragma("forceinline"); + INLINE return new __vec3( max(x, vec.x), max(y, vec.y), @@ -199,7 +199,7 @@ function __vec3(_x = 0, _y = _x, _z = _x) constructor { } #endregion static clone = function() { #region - gml_pragma("forceinline"); + INLINE return new __vec3(x, y, z); } #endregion diff --git a/scripts/__vec4/__vec4.gml b/scripts/__vec4/__vec4.gml index f02abafb5..838248e1a 100644 --- a/scripts/__vec4/__vec4.gml +++ b/scripts/__vec4/__vec4.gml @@ -31,7 +31,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } set(_x, _y, _z, _w); static setIndex = function(index, value) { - gml_pragma("forceinline"); + INLINE switch(index) { case 0 : x = value; break; case 1 : y = value; break; @@ -53,22 +53,22 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static add = function(_vec4) { - gml_pragma("forceinline"); + INLINE return new __vec4(x + _vec4.x, y + _vec4.y, z + _vec4.z, w + _vec4.w); } static subtract = function(_vec4) { - gml_pragma("forceinline"); + INLINE return new __vec4(x - _vec4.x, y - _vec4.y, z - _vec4.z, w - _vec4.w); } static multiply = function(_scalar) { - gml_pragma("forceinline"); + INLINE return new __vec4(x * _scalar, y * _scalar, z * _scalar, w * _scalar); } static divide = function(_scalar) { - gml_pragma("forceinline"); + INLINE if (_scalar != 0) return new __vec4(x / _scalar, y / _scalar, z / _scalar, w / _scalar); @@ -76,13 +76,13 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static dot = function(_vec4) { - gml_pragma("forceinline"); + INLINE return x * _vec4.x + y * _vec4.y + z * _vec4.z + w * _vec4.w; } // In-place computation functions static _add = function(_vec4) { - gml_pragma("forceinline"); + INLINE x += _vec4.x; y += _vec4.y; z += _vec4.z; @@ -91,7 +91,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static _subtract = function(_vec4) { - gml_pragma("forceinline"); + INLINE x -= _vec4.x; y -= _vec4.y; z -= _vec4.z; @@ -100,7 +100,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static _multiply = function(_scalar) { - gml_pragma("forceinline"); + INLINE x *= _scalar; y *= _scalar; z *= _scalar; @@ -109,7 +109,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static _divide = function(_scalar) { - gml_pragma("forceinline"); + INLINE if (_scalar != 0) { x /= _scalar; y /= _scalar; @@ -120,7 +120,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static distance = function(_vec4) { - gml_pragma("forceinline"); + INLINE var dx = _vec4.x - x; var dy = _vec4.y - y; var dz = _vec4.z - z; @@ -129,12 +129,12 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static length = function() { - gml_pragma("forceinline"); + INLINE return sqrt(x * x + y * y + z * z + w * w); } static _normalize = function() { - gml_pragma("forceinline"); + INLINE var _length = length(); if (_length != 0) { x /= _length; @@ -146,7 +146,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static _lerpTo = function(to, speed = 0.3) { - gml_pragma("forceinline"); + INLINE x = lerp(x, to.x, speed); y = lerp(y, to.y, speed); z = lerp(z, to.z, speed); @@ -154,7 +154,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static _lerp_float = function(to, speed = 5, pre = 0.01) { - gml_pragma("forceinline"); + INLINE x = lerp_float(x, to.x, speed, pre); y = lerp_float(y, to.y, speed, pre); z = lerp_float(z, to.z, speed, pre); @@ -162,12 +162,12 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static equal = function(to) { - gml_pragma("forceinline"); + INLINE return x == to.x && y == to.y && z == to.z && w == to.w; } static minVal = function(vec) { - gml_pragma("forceinline"); + INLINE return new __vec4( min(x, vec.x), min(y, vec.y), @@ -177,7 +177,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static maxVal = function(vec) { - gml_pragma("forceinline"); + INLINE return new __vec4( max(x, vec.x), max(y, vec.y), @@ -187,7 +187,7 @@ function __vec4(_x = 0, _y = _x, _z = _x, _w = _x) constructor { } static clone = function() { - gml_pragma("forceinline"); + INLINE return new __vec4(x, y, z, w); } diff --git a/scripts/__vertex_function/__vertex_function.gml b/scripts/__vertex_function/__vertex_function.gml index 53bcaa5a6..4776888f3 100644 --- a/scripts/__vertex_function/__vertex_function.gml +++ b/scripts/__vertex_function/__vertex_function.gml @@ -10,20 +10,20 @@ MATRIX_IDENTITY = matrix_build_identity(); #endregion function vertex_add_pt(buffer, position, texture) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, position[0], position[1], position[2]); vertex_texcoord(buffer, texture[0], texture[1]); } function vertex_add_pnt(buffer, position, normal, texture) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, position[0], position[1], position[2]); vertex_normal(buffer, normal[0], normal[1], normal[2]); vertex_texcoord(buffer, texture[0], texture[1]); } function vertex_add_pntc(buffer, position, normal, texture, color = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, position[0], position[1], position[2]); vertex_normal(buffer, normal[0], normal[1], normal[2]); vertex_texcoord(buffer, texture[0], texture[1]); @@ -31,31 +31,31 @@ function vertex_add_pntc(buffer, position, normal, texture, color = c_white, alp } function vertex_add_2pc(buffer, _x, _y, color, alpha = 1) { - gml_pragma("forceinline"); + INLINE vertex_position(buffer, _x, _y); vertex_color(buffer, color, alpha); } function vertex_add_v(buffer, vertex) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); } function vertex_add_vc(buffer, vertex) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); vertex_color(buffer, vertex.color, vertex.alpha); } function vertex_add_vnt(buffer, vertex) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); vertex_normal(buffer, vertex.nx, vertex.ny, vertex.nz); vertex_texcoord(buffer, vertex.u, vertex.v); } function vertex_add_vntc(buffer, vertex) { - gml_pragma("forceinline"); + INLINE vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); vertex_normal(buffer, vertex.nx, vertex.ny, vertex.nz); vertex_texcoord(buffer, vertex.u, vertex.v); diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index 405b22e01..078e7d15c 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -43,7 +43,7 @@ enum ARRAY_OVERFLOW { } function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return def; if(is_array(index)) return def; @@ -60,7 +60,7 @@ function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) } function array_push_create(arr, val) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return [ val ]; array_push(arr, val); @@ -68,7 +68,7 @@ function array_push_create(arr, val) { } function array_get_decimal(arr, index, color = false) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return 0; if(frac(index) == 0) return array_safe_get(arr, index); @@ -82,7 +82,7 @@ function array_get_decimal(arr, index, color = false) { } function array_exists(arr, val) { - gml_pragma("forceinline"); + INLINE self.__temp_val = val; if(!is_array(arr)) return false; @@ -92,7 +92,7 @@ function array_exists(arr, val) { } function array_overlap(arr0, arr1) { - gml_pragma("forceinline"); + INLINE self.__temp_arr = arr1; if(!is_array(arr0)) return false; @@ -104,12 +104,12 @@ function array_overlap(arr0, arr1) { } function array_empty(arr) { - gml_pragma("forceinline"); + INLINE return is_array(arr) && array_length(arr) == 0; } function array_find(arr, val) { - gml_pragma("forceinline"); + INLINE self.__temp_val = val; if(!is_array(arr)) return -1; @@ -119,7 +119,7 @@ function array_find(arr, val) { } function array_remove(arr, val) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return; if(!array_exists(arr, val)) return; @@ -128,7 +128,7 @@ function array_remove(arr, val) { } function array_push_unique(arr, val) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return; if(array_exists(arr, val)) return; @@ -137,7 +137,7 @@ function array_push_unique(arr, val) { function array_insert_unique(arr, ind, val) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return; if(array_exists(arr, val)) return; @@ -145,7 +145,7 @@ function array_insert_unique(arr, ind, val) { } function array_append(arr, arr0) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return arr; if(!is_array(arr0)) return arr; @@ -156,7 +156,7 @@ function array_append(arr, arr0) { } function array_merge() { - gml_pragma("forceinline"); + INLINE var arr = []; for( var i = 0; i < argument_count; i++ ) @@ -166,7 +166,7 @@ function array_merge() { } function array_clone(arr) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return arr; @@ -177,7 +177,7 @@ function array_clone(arr) { } function array_min(arr) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr) || array_length(arr) == 0) return 0; @@ -188,7 +188,7 @@ function array_min(arr) { } function array_max(arr) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr) || array_length(arr) == 0) return 0; @@ -199,7 +199,7 @@ function array_max(arr) { } function array_get_dimension(arr) { - gml_pragma("forceinline"); + INLINE return is_array(arr)? array_length(arr) : 1; } @@ -220,7 +220,7 @@ function array_shape(arr, first = true, isSurface = false) { } function array_get_depth(arr) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return 0; var d = 0; @@ -235,7 +235,7 @@ function array_get_depth(arr) { } function array_spread(arr, _arr = [], _minDepth = 0) { - gml_pragma("forceinline"); + INLINE if(array_get_depth(arr) == _minDepth) { array_push(_arr, arr); @@ -249,7 +249,7 @@ function array_spread(arr, _arr = [], _minDepth = 0) { } function array_verify(arr, length) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) return array_create(length); if(array_length(arr) == length) return arr; diff --git a/scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.gml b/scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.gml index 545d35d3f..e42b841e2 100644 --- a/scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.gml +++ b/scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.gml @@ -10,7 +10,7 @@ /// @return {Real} The resulting value. function bbmod_lerp_delta_time(_from, _to, _factor, _deltaTime) { - gml_pragma("forceinline"); + INLINE return lerp( _from, _to, diff --git a/scripts/color_function/color_function.gml b/scripts/color_function/color_function.gml index 879ad57a8..c3cfbaabb 100644 --- a/scripts/color_function/color_function.gml +++ b/scripts/color_function/color_function.gml @@ -77,7 +77,7 @@ function color_diff(c1, c2, fast = false, alpha = false) { } function color_get_brightness(col) { - gml_pragma("forceinline"); + INLINE return (0.299 * color_get_red(col) + 0.587 * color_get_green(col) + 0.114 * color_get_blue(col)) / 255; } diff --git a/scripts/contextMenu_controller/contextMenu_controller.gml b/scripts/contextMenu_controller/contextMenu_controller.gml index 05b4b4ee4..d7bc9bc08 100644 --- a/scripts/contextMenu_controller/contextMenu_controller.gml +++ b/scripts/contextMenu_controller/contextMenu_controller.gml @@ -29,7 +29,7 @@ } function menuItem(name, func, spr = noone, hotkey = noone, toggle = noone) { - gml_pragma("forceinline"); + INLINE return new MenuItem(name, func, spr, hotkey, toggle); } @@ -46,31 +46,31 @@ shiftMenu = noone; static setIsShelf = function() { - gml_pragma("forceinline"); + INLINE isShelf = true; return self; } static setActive = function(active) { - gml_pragma("forceinline"); + INLINE self.active = active; return self; } static setColor = function(color) { - gml_pragma("forceinline"); + INLINE self.color = color; return self; } static setShiftMenu = function(shiftMenu) { - gml_pragma("forceinline"); + INLINE self.shiftMenu = shiftMenu; return self; } static deactivate = function() { - gml_pragma("forceinline"); + INLINE active = false; return self; } diff --git a/scripts/control_function/control_function.gml b/scripts/control_function/control_function.gml index 48c494882..f34de8602 100644 --- a/scripts/control_function/control_function.gml +++ b/scripts/control_function/control_function.gml @@ -24,7 +24,7 @@ SHIFT = KEYBOARD_STATUS.idle; function key_release() { - gml_pragma("forceinline"); + INLINE CTRL = KEYBOARD_STATUS.up; ALT = KEYBOARD_STATUS.up; @@ -36,13 +36,13 @@ } function key_mod_press(key) { - gml_pragma("forceinline"); + INLINE return key == KEYBOARD_STATUS.pressing; } function key_mod_press_index(keyindex) { - gml_pragma("forceinline"); + INLINE switch(keyindex) { case MOD_KEY.alt : return ALT == KEYBOARD_STATUS.pressing; @@ -60,14 +60,14 @@ WIDGET_CURRENT_SCROLL = noone; function widget_start() { - gml_pragma("forceinline"); + INLINE if(array_length(WIDGET_ACTIVE) == 0) return; WIDGET_ACTIVE[0].activate(); } function widget_next() { - gml_pragma("forceinline"); + INLINE if(array_length(WIDGET_ACTIVE) == 0) return; if(WIDGET_CURRENT == noone) { diff --git a/scripts/curve_bezier_function/curve_bezier_function.gml b/scripts/curve_bezier_function/curve_bezier_function.gml index 1122dc940..dadc03578 100644 --- a/scripts/curve_bezier_function/curve_bezier_function.gml +++ b/scripts/curve_bezier_function/curve_bezier_function.gml @@ -177,7 +177,7 @@ function curveMap(_bz, _prec = 32, _tolr = 0.00001) constructor { map[i] = eval_curve_x(bz, i * size, tolr); static get = function(i) { #region - gml_pragma("forceinline"); + INLINE var _ind = clamp(i, 0, 1) * (prec - 1); var _indL = floor(_ind); diff --git a/scripts/d3d_bbox/d3d_bbox.gml b/scripts/d3d_bbox/d3d_bbox.gml index 089403585..ddc8c7bdb 100644 --- a/scripts/d3d_bbox/d3d_bbox.gml +++ b/scripts/d3d_bbox/d3d_bbox.gml @@ -3,7 +3,7 @@ function __bbox3D(first, second) constructor { self.second = second; static getScale = function() { - gml_pragma("forceinline"); + INLINE return sqrt( sqr(first.x - second.x) + sqr(first.y - second.y) + @@ -12,7 +12,7 @@ function __bbox3D(first, second) constructor { } static getMaximumScale = function() { - gml_pragma("forceinline"); + INLINE return max( abs(first.x - second.x), abs(first.y - second.y), diff --git a/scripts/d3d_group/d3d_group.gml b/scripts/d3d_group/d3d_group.gml index b1020c540..3555161f3 100644 --- a/scripts/d3d_group/d3d_group.gml +++ b/scripts/d3d_group/d3d_group.gml @@ -51,7 +51,7 @@ function __3dGroup() constructor { } #endregion static addObject = function(_obj) { #region - gml_pragma("forceinline"); + INLINE array_push(objects, _obj); } #endregion diff --git a/scripts/d3d_ray/d3d_ray.gml b/scripts/d3d_ray/d3d_ray.gml index 98e9aa61c..1a64e9916 100644 --- a/scripts/d3d_ray/d3d_ray.gml +++ b/scripts/d3d_ray/d3d_ray.gml @@ -3,7 +3,7 @@ function __ray(origin, direction) constructor { self.direction = direction.normalize(); static sampleDistance = function(t) { - gml_pragma("forceinline"); + INLINE return origin.add(direction.multiply(t)); } } \ No newline at end of file diff --git a/scripts/d3d_rot3/d3d_rot3.gml b/scripts/d3d_rot3/d3d_rot3.gml index 7d4b1ca81..404ac252f 100644 --- a/scripts/d3d_rot3/d3d_rot3.gml +++ b/scripts/d3d_rot3/d3d_rot3.gml @@ -4,7 +4,7 @@ function __rot3(_x = 0, _y = 0, _z = 0) constructor { z = _z; static set = function(_x, _y, _z) { - gml_pragma("forceinline"); + INLINE x = _x; y = _y; z = _z; @@ -63,12 +63,12 @@ function __rot3(_x = 0, _y = 0, _z = 0) constructor { } static equal = function(to) { - gml_pragma("forceinline"); + INLINE return x == to.x && y == to.y && z == to.z; } static clone = function() { - gml_pragma("forceinline"); + INLINE return new __rot3(x, y, z); } diff --git a/scripts/d3d_surface_extrude/d3d_surface_extrude.gml b/scripts/d3d_surface_extrude/d3d_surface_extrude.gml index 4c26e5ca1..102d26413 100644 --- a/scripts/d3d_surface_extrude/d3d_surface_extrude.gml +++ b/scripts/d3d_surface_extrude/d3d_surface_extrude.gml @@ -12,7 +12,7 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ normal_draw_size = 0.05; static getHeight = function(h, gw, gh, i, j) { - gml_pragma("forceinline"); + INLINE var _i = round(i * gw); var _j = round(j * gh); diff --git a/scripts/d3d_vertex/d3d_vertex.gml b/scripts/d3d_vertex/d3d_vertex.gml index 2dfb18526..4b32f4f45 100644 --- a/scripts/d3d_vertex/d3d_vertex.gml +++ b/scripts/d3d_vertex/d3d_vertex.gml @@ -14,7 +14,7 @@ function __vertex(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) construc self.alpha = alpha; static setNormal = function(_nx = 0, _ny = _nx, _nz = _nx) { - gml_pragma("forceinline"); + INLINE nx = _nx; ny = _ny; @@ -24,7 +24,7 @@ function __vertex(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) construc } static setUV = function(_u = 0, _v = _u) { - gml_pragma("forceinline"); + INLINE u = _u; v = _v; @@ -35,7 +35,7 @@ function __vertex(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) construc static toString = function() { return $"[__vertex] ( pos: ({x}, {y}, {z}), nor: ({nx}, {ny}, {nz}), uv: ({u}, {v}), {color}, {alpha} )"; } static clone = function() { - gml_pragma("forceinline"); + INLINE var _v = new __vertex(x, y, z, color, alpha); _v.nx = nx; diff --git a/scripts/debug/debug.gml b/scripts/debug/debug.gml index 826f6a08d..35add112a 100644 --- a/scripts/debug/debug.gml +++ b/scripts/debug/debug.gml @@ -12,7 +12,7 @@ #endregion function _log_template() { - gml_pragma("forceinline"); + INLINE return $"{current_year}/{current_month}/{current_day} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > "; } diff --git a/scripts/distance_to_line/distance_to_line.gml b/scripts/distance_to_line/distance_to_line.gml index f85b59dd0..eb4186cff 100644 --- a/scripts/distance_to_line/distance_to_line.gml +++ b/scripts/distance_to_line/distance_to_line.gml @@ -1,5 +1,5 @@ function distance_to_line(_px, _py, _x0, _y0, _x1, _y1, log = false) { - gml_pragma("forceinline"); + INLINE var l2 = sqr(_x0 - _x1) + sqr(_y0 - _y1); if (l2 == 0) return point_distance(_px, _py, _x0, _y0); @@ -11,7 +11,7 @@ function distance_to_line(_px, _py, _x0, _y0, _x1, _y1, log = false) { } function distance_to_line_infinite(px, py, x0, y0, x1, y1) { - gml_pragma("forceinline"); + INLINE return abs((x1 - x0) * (y0 - py) - (x0 - px) * (y1 - y0)) / sqrt(sqr(x1 - x0) + sqr(y1 - y0)); } diff --git a/scripts/draw_UI_scale/draw_UI_scale.gml b/scripts/draw_UI_scale/draw_UI_scale.gml index 5ce6da930..06c4896b1 100644 --- a/scripts/draw_UI_scale/draw_UI_scale.gml +++ b/scripts/draw_UI_scale/draw_UI_scale.gml @@ -25,7 +25,7 @@ function line_get_width(txt, font = noone, offset = 0) { #macro BUTTON_HEIGHT line_get_height(f_p0, 12) function ui(val) { - gml_pragma("forceinline"); + INLINE return val * UI_SCALE; } diff --git a/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml b/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml index 81d3bac33..2aa50cd1f 100644 --- a/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml +++ b/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml @@ -2,7 +2,7 @@ #macro __draw_sprite_ext draw_sprite_ext function draw_sprite_ext_override(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE __draw_sprite_ext(spr, ind, round(_x), round(_y), xscale, yscale, rot, color, alpha); } @@ -10,7 +10,7 @@ function draw_sprite_ext_override(spr, ind, _x, _y, xscale = 1, yscale = 1, rot #macro __draw_sprite_stretched_ext draw_sprite_stretched_ext function draw_sprite_stretched_ext_override(spr, ind, _x, _y, w = 1, h = 1, color = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE __draw_sprite_stretched_ext(spr, ind, round(_x), round(_y), round(w), round(h), color, alpha); } @@ -18,19 +18,19 @@ function draw_sprite_stretched_ext_override(spr, ind, _x, _y, w = 1, h = 1, colo #macro __draw_sprite_stretched draw_sprite_stretched function draw_sprite_stretched_override(spr, ind, _x, _y, w = 1, h = 1) { - gml_pragma("forceinline"); + INLINE __draw_sprite_stretched(spr, ind, round(_x), round(_y), round(w), round(h)); } function draw_sprite_ext_add(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE BLEND_ADD __draw_sprite_ext(spr, ind, round(_x), round(_y), xscale, yscale, rot, color, alpha); BLEND_NORMAL } function draw_sprite_stretched_points(spr, ind, _x0, _y0, _x1, _y1, color = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE var _xs = round(min(_x0, _x1)); var _ys = round(min(_y0, _y1)); @@ -41,18 +41,18 @@ function draw_sprite_stretched_points(spr, ind, _x0, _y0, _x1, _y1, color = c_wh } function draw_sprite_bbox(spr, ind, _bbox) { - gml_pragma("forceinline"); + INLINE if(_bbox == noone) return; __draw_sprite_stretched(spr, ind, _bbox.x0, _bbox.y0, _bbox.w, _bbox.h); } function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white) { - gml_pragma("forceinline"); + INLINE draw_sprite_ext(spr, ind, round(_x), round(_y), scale, scale, 0, color, 1); } function draw_sprite_ui(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color = c_white, alpha = 1) { - gml_pragma("forceinline"); + INLINE static UI_SPRITE_SCALE = 1; var xscale_ui = ui(xscale) / UI_SPRITE_SCALE; @@ -62,12 +62,12 @@ function draw_sprite_ui(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color } function draw_sprite_ui_uniform(spr, ind, _x, _y, scale = 1, color = c_white, alpha = 1, rot = 0) { - gml_pragma("forceinline"); + INLINE draw_sprite_ui(spr, ind, round(_x), round(_y), scale, scale, rot, color, alpha); } function draw_sprite_colored(spr, ind, _x, _y, scale = 1, rot = 0) { - gml_pragma("forceinline"); + INLINE var num = sprite_get_number(spr); draw_sprite_ui(spr, ind, _x, _y, scale, scale, rot, c_white); diff --git a/scripts/file_functions/file_functions.gml b/scripts/file_functions/file_functions.gml index f38192eca..5bf6aec5b 100644 --- a/scripts/file_functions/file_functions.gml +++ b/scripts/file_functions/file_functions.gml @@ -4,7 +4,7 @@ function file_copy_override(src, dest) { } function filepath_resolve(path) { - gml_pragma("forceinline"); + INLINE var _path = path; _path = string_replace_all(_path, "%DIR%/", DIRECTORY); diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 4cdf68662..387979481 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -25,10 +25,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; - VERSION = 11561; + VERSION = 11562; SAVE_VERSION = 11560; - VERSION_STRING = "1.15.6.1"; - BUILD_NUMBER = 11561; + VERSION_STRING = "1.15.6.2"; + BUILD_NUMBER = 11562; globalvar APPEND_MAP; APPEND_MAP = ds_map_create(); @@ -83,6 +83,8 @@ #macro DELTA_TIME delta_time / 1_000_000 + #macro INLINE gml_pragma("forceinline"); + #macro CONF_TESTING false globalvar TESTING, TEST_ERROR; TESTING = CONF_TESTING; diff --git a/scripts/hotkey_data/hotkey_data.gml b/scripts/hotkey_data/hotkey_data.gml index 0c5130b70..05450f888 100644 --- a/scripts/hotkey_data/hotkey_data.gml +++ b/scripts/hotkey_data/hotkey_data.gml @@ -112,7 +112,7 @@ #region functions function getHotkey(_group, _key, _def = "") { - gml_pragma("forceinline"); + INLINE if(!struct_has(HOTKEYS_CUSTOM, _group)) return _def; diff --git a/scripts/locale_data/locale_data.gml b/scripts/locale_data/locale_data.gml index 1e8d33eed..5fbdbf7b1 100644 --- a/scripts/locale_data/locale_data.gml +++ b/scripts/locale_data/locale_data.gml @@ -35,7 +35,7 @@ } function __txtx(key, def = "") { - gml_pragma("forceinline"); + INLINE if(key == "") return ""; if(TEST_LOCALE) { @@ -55,7 +55,7 @@ } function __txt(txt, prefix = "") { - gml_pragma("forceinline"); + INLINE if(txt == "") return ""; var key = string_lower(txt); @@ -81,7 +81,7 @@ } function __txt_node_name(node, def = "") { - gml_pragma("forceinline"); + INLINE if(LOCALE_USE_DEFAULT) return def; @@ -93,7 +93,7 @@ } function __txt_node_tooltip(node, def = "") { - gml_pragma("forceinline"); + INLINE if(LOCALE_USE_DEFAULT) return def; @@ -105,7 +105,7 @@ } function __txt_junction_name(node, type, index, def = "") { - gml_pragma("forceinline"); + INLINE if(LOCALE_USE_DEFAULT) return def; @@ -121,7 +121,7 @@ } function __txt_junction_tooltip(node, type, index, def = "") { - gml_pragma("forceinline"); + INLINE if(LOCALE_USE_DEFAULT) return def; @@ -137,7 +137,7 @@ } function __txt_junction_data(node, type, index, def = []) { - gml_pragma("forceinline"); + INLINE return def; diff --git a/scripts/logger/logger.gml b/scripts/logger/logger.gml index a3ea58e59..08e6fa15d 100644 --- a/scripts/logger/logger.gml +++ b/scripts/logger/logger.gml @@ -2,12 +2,12 @@ global.LOG_LEVEL = 0; function LOG_BLOCK_START() { - gml_pragma("forceinline"); + INLINE global.LOG_LEVEL++; } function LOG(text) { - gml_pragma("forceinline"); + INLINE var s = ""; repeat(global.LOG_LEVEL - 1) s += " "; @@ -17,29 +17,29 @@ } function LOG_LINE(text) { - gml_pragma("forceinline"); + INLINE LOG_BLOCK_START(); LOG(text); LOG_BLOCK_END(); } function LOG_IF(cond, text) { - gml_pragma("forceinline"); + INLINE if(cond) LOG(text); } function LOG_LINE_IF(cond, text) { - gml_pragma("forceinline"); + INLINE if(cond) LOG_LINE(text); } function LOG_BLOCK_END() { - gml_pragma("forceinline"); + INLINE global.LOG_LEVEL--; } function LOG_END() { - gml_pragma("forceinline"); + INLINE global.LOG_LEVEL = 0; } #endregion \ No newline at end of file diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 9e3355a06..ac5732c21 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -50,8 +50,10 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc index = jun.visible; draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 0.8); if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) { - if(visi_hold != noone) + if(visi_hold != noone && jun.visible != visi_hold) { jun.visible = visi_hold; + jun.node.setHeight(); + } draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 1); TOOLTIP = __txt("Visibility"); @@ -59,6 +61,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc if(mouse_press(mb_left, _focus)) { jun.visible = !jun.visible; visi_hold = jun.visible; + jun.node.setHeight(); } } #endregion diff --git a/scripts/node_canvas/node_canvas.gml b/scripts/node_canvas/node_canvas.gml index 747bd3d7c..48a5c0653 100644 --- a/scripts/node_canvas/node_canvas.gml +++ b/scripts/node_canvas/node_canvas.gml @@ -269,13 +269,13 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor } #endregion function getCanvasSurface(index = preview_index) { #region - gml_pragma("forceinline"); + INLINE return array_safe_get(canvas_surface, index); } #endregion function setCanvasSurface(surface, index = preview_index) { #region - gml_pragma("forceinline"); + INLINE canvas_surface[index] = surface; } #endregion diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index f037dc32f..4186aeaee 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -64,6 +64,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc ungroupable = true; auto_render_time = false; combine_render_time = true; + previewable = true; + + w = 128; + h = 128; + min_h = 128; reset_all_child = false; isInstancer = false; @@ -141,6 +146,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc } #endregion static getNodeList = function() { #region + INLINE if(instanceBase == noone) return nodes; return instanceBase.getNodeList(); } #endregion @@ -275,8 +281,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc static add = function(_node) { #region ds_list_add(getNodeList(), _node); var list = _node.group == noone? PANEL_GRAPH.nodes_list : _node.group.getNodeList(); - var _pos = ds_list_find_index(list, _node); - ds_list_delete(list, _pos); + ds_list_remove(list, _node); recordAction(ACTION_TYPE.group_added, self, _node); _node.group = self; @@ -309,13 +314,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc static stepBegin = function() { #region use_cache = CACHE_USE.none; - array_safe_set(cache_result, CURRENT_FRAME, true); var node_list = getNodeList(); for(var i = 0; i < ds_list_size(node_list); i++) { var _node = node_list[| i]; - _node.stepBegin(); if(!_node.use_cache) continue; use_cache = CACHE_USE.manual; @@ -323,32 +326,14 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc array_safe_set(cache_result, CURRENT_FRAME, false); } - var out_surf = false; - - for( var i = 0; i < ds_list_size(outputs); i++) { - if(outputs[| i].type == VALUE_TYPE.surface) - out_surf = true; - } - - if(out_surf) { - w = 128; - min_h = 128; - } else { - w = 96; - - } - - setHeight(); doStepBegin(); } #endregion static step = function() { #region - if(combine_render_time) render_time = 0; - - var node_list = getNodeList(); - for(var i = 0; i < ds_list_size(node_list); i++) { - node_list[| i].step(); - if(combine_render_time) + if(combine_render_time) { + render_time = 0; + var node_list = getNodeList(); + for(var i = 0; i < ds_list_size(node_list); i++) render_time += node_list[| i].render_time; } @@ -357,13 +342,6 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc onStep(); } #endregion - static triggerCheck = function() { #region - _triggerCheck(); - var node_list = getNodeList(); - for(var i = 0; i < ds_list_size(node_list); i++) - node_list[| i].triggerCheck(); - } #endregion - static onStep = function() {} PATCH_STATIC @@ -478,6 +456,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc } ds_priority_destroy(ar); + + setHeight(); } #endregion static getTool = function() { #region diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index b88826fed..d90aa2007 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -19,14 +19,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x renderActive = true; node_id = UUID_generate(); - + group = _group; manual_deletable = true; destroy_when_upgroup = false; ds_list_add(PANEL_GRAPH.getNodeList(_group), self); - + active_index = -1; active_range = [ 0, TOTAL_FRAMES - 1 ]; + + array_push(PROJECT.nodeArray, self); #endregion static resetInternalName = function() { #region @@ -289,6 +291,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x } #endregion static setHeight = function() { #region + if(!auto_height) return; + var _hi = ui(junction_draw_pad_y); var _ho = ui(junction_draw_pad_y); @@ -304,8 +308,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x for( var i = 0; i < ds_list_size(outputs); i++ ) if(outputs[| i].isVisible()) _ho += 24; - h = max(min_h, (preview_surface && previewable)? 128 : 0, _hi, _ho); - } #endregion + h = max(min_h, previewable * 128, _hi, _ho); + } run_in(1, function() { setHeight(); }); #endregion static setDisplayName = function(_name) { #region renamed = true; @@ -440,22 +444,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static stepBegin = function() { #region if(use_cache) cacheArrayCheck(); - if(auto_height) - setHeight(); - doStepBegin(); if(hasInspector1Update()) inspectInput1.name = insp1UpdateTooltip; if(hasInspector2Update()) inspectInput2.name = insp2UpdateTooltip; - if(updatedInTrigger.getValue()) { - getInputs(); - update(); + if(attributes.show_update_trigger) { + if(updatedInTrigger.getValue()) { + getInputs(); + update(); - updatedInTrigger.setValue(false); + updatedInTrigger.setValue(false); + } + updatedOutTrigger.setValue(false); } - - updatedOutTrigger.setValue(false); } #endregion static doStepBegin = function() {} @@ -499,13 +501,13 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static inspectorStep = function() {} static getInputData = function(index, def = 0) { #region - gml_pragma("forceinline"); + INLINE return array_safe_get(inputs_data, index, def); } #endregion static setInputData = function(index, value) { #region - gml_pragma("forceinline"); + INLINE inputs_data[index] = value; input_value_map[$ inputs[| index].internalName] = value; @@ -719,7 +721,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static onInspect = function() {} static setRenderStatus = function(result) { #region - gml_pragma("forceinline"); + INLINE if(rendered == result) return; LOG_LINE_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}"); @@ -808,7 +810,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x } #endregion static getColor = function() { #region - gml_pragma("forceinline"); + INLINE return attributes.color == -1? color : attributes.color; } #endregion @@ -1256,8 +1258,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static getAnimationCacheExist = function(frame) { return cacheExist(frame); } - static enable = function() { active = true; } - static disable = function() { active = false; } + static enable = function() { INLINE active = true; } + static disable = function() { INLINE active = false; } static destroy = function(_merge = false) { #region if(!active) return; @@ -1816,8 +1818,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static loadGroup = function(context = PANEL_GRAPH.getCurrentContext()) { #region if(_group == noone) { - var c = context; - if(c != noone) c.add(self); + if(context != noone) context.add(self); } else { if(APPENDING) _group = GetAppendID(_group); diff --git a/scripts/node_processor/node_processor.gml b/scripts/node_processor/node_processor.gml index 778e899b5..b2691d142 100644 --- a/scripts/node_processor/node_processor.gml +++ b/scripts/node_processor/node_processor.gml @@ -33,7 +33,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct triggerRender(); }, false) ]); - static getInputData = function(index, def = 0) { gml_pragma("forceinline"); return array_safe_get(inputs_data, index, def); } + static getInputData = function(index, def = 0) { INLINE return array_safe_get(inputs_data, index, def); } static processData_prebatch = function() {} static processData_postbatch = function() {} diff --git a/scripts/node_tool/node_tool.gml b/scripts/node_tool/node_tool.gml index 99fd318ae..880215da7 100644 --- a/scripts/node_tool/node_tool.gml +++ b/scripts/node_tool/node_tool.gml @@ -9,7 +9,7 @@ function NodeTool(name, spr, context = instanceof(other)) constructor { attribute = {}; static checkHotkey = function() { - gml_pragma("forceinline"); + INLINE return getHotkey(ctx, name); } diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 05489e65b..3cd39058b 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -701,7 +701,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru visible = argument_count > 1? argument[1] : visible; } else visible = inspector; - return self; } #endregion @@ -1580,7 +1579,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } #endregion static isActiveDynamic = function() { #region - gml_pragma("forceinline"); + INLINE if(value_from != noone) return false; @@ -1805,7 +1804,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return true; } #endregion - static isLeaf = function() { gml_pragma("forceinline"); return value_from == noone; } + static isLeaf = function() { INLINE return value_from == noone; } static isRendered = function() { #region if(type == VALUE_TYPE.node) return true; @@ -2333,7 +2332,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru ext.doUpdate(); } #endregion - static hasJunctionFrom = function() { gml_pragma("forceinline"); return value_from != noone; } + static hasJunctionFrom = function() { INLINE return value_from != noone; } static getJunctionTo = function() { #region var to = []; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 9d04306bd..83fd68528 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -512,7 +512,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { #endregion #endregion - function getFocusingNode() { gml_pragma("forceinline"); return array_empty(nodes_selecting)? noone : nodes_selecting[0]; } + function getFocusingNode() { INLINE return array_empty(nodes_selecting)? noone : nodes_selecting[0]; } function getCurrentContext() { #region if(ds_list_empty(node_context)) return noone; @@ -551,7 +551,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } #endregion function fullView() { #region - gml_pragma("forceinline"); + INLINE var _l = ds_list_create_from_array(nodes_selecting); toCenterNode(array_empty(nodes_selecting)? nodes_list : _l); ds_list_destroy(_l); diff --git a/scripts/panel_text_editor/panel_text_editor.gml b/scripts/panel_text_editor/panel_text_editor.gml index 18b8c4f59..3bde26269 100644 --- a/scripts/panel_text_editor/panel_text_editor.gml +++ b/scripts/panel_text_editor/panel_text_editor.gml @@ -64,7 +64,7 @@ function Panel_Text_Editor(_textArea, _inputFunc, _context) : PanelContent() con } static checkClosable = function() { - return !_textArea.autocomplete_box.active; + return o_dialog_textbox_autocomplete.textbox != _textArea; } static onClose = function() { diff --git a/scripts/point_rotate/point_rotate.gml b/scripts/point_rotate/point_rotate.gml index 6051a54b9..7cef0cb9d 100644 --- a/scripts/point_rotate/point_rotate.gml +++ b/scripts/point_rotate/point_rotate.gml @@ -1,5 +1,5 @@ function point_rotate(px, py, ox, oy, a) { - gml_pragma("forceinline"); + INLINE a = angle_difference(a, 0); if(a == 0) return [ px, py ]; diff --git a/scripts/project_data/project_data.gml b/scripts/project_data/project_data.gml index 6e557d868..0c4c04f9e 100644 --- a/scripts/project_data/project_data.gml +++ b/scripts/project_data/project_data.gml @@ -15,6 +15,7 @@ safeMode = false; nodes = ds_list_create(); + nodeArray = []; nodeMap = ds_map_create(); nodeNameMap = ds_map_create(); nodeTopo = ds_list_create(); diff --git a/scripts/random_function/random_function.gml b/scripts/random_function/random_function.gml index 3fb61c8a2..174cb67fd 100644 --- a/scripts/random_function/random_function.gml +++ b/scripts/random_function/random_function.gml @@ -117,13 +117,13 @@ function wiggleMap(_seed, _freq, _length) constructor { #region map = array_create(_length); static generate = function() { - gml_pragma("forceinline"); + INLINE for(var i = 0; i < len; i++) map[i] = wiggle(-1, 1, freq, i, seed); } static check = function(_amp, _freq, _seed) { - gml_pragma("forceinline"); + INLINE amp = _amp; if(seed == _seed && freq == _freq) return; @@ -135,7 +135,7 @@ function wiggleMap(_seed, _freq, _length) constructor { #region } static get = function(i) { - gml_pragma("forceinline"); + INLINE if(amp == 0) return 0; return map[abs(i) % len] * amp; diff --git a/scripts/safe_operation/safe_operation.gml b/scripts/safe_operation/safe_operation.gml index 4db76a1b9..02084e2c8 100644 --- a/scripts/safe_operation/safe_operation.gml +++ b/scripts/safe_operation/safe_operation.gml @@ -4,7 +4,7 @@ enum MOD_NEG { } function safe_mod(numb, modd, _neg = MOD_NEG._default) { - gml_pragma("forceinline"); + INLINE var _md = modd == 0? 0 : numb % modd; if(_md < 0) diff --git a/scripts/scrollPane/scrollPane.gml b/scripts/scrollPane/scrollPane.gml index e2a03bc22..4fde11a2b 100644 --- a/scripts/scrollPane/scrollPane.gml +++ b/scripts/scrollPane/scrollPane.gml @@ -32,7 +32,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { } static setScroll = function(_scroll_y) { #region - gml_pragma("forceinline"); + INLINE scroll_y_to = clamp(_scroll_y, -content_h, 0); } #endregion diff --git a/scripts/shader_functions/shader_functions.gml b/scripts/shader_functions/shader_functions.gml index 386493e59..04263ff39 100644 --- a/scripts/shader_functions/shader_functions.gml +++ b/scripts/shader_functions/shader_functions.gml @@ -1,5 +1,5 @@ function shader_set_i(uniform, value) { - gml_pragma("forceinline"); + INLINE var shader = shader_current(); if(shader == -1) return; @@ -22,13 +22,13 @@ function shader_set_i(uniform, value) { } function shader_set_i_array(shader, uniform, array) { - gml_pragma("forceinline"); + INLINE shader_set_uniform_i_array(shader_get_uniform(shader, uniform), array); } function shader_set_f(uniform, value) { - gml_pragma("forceinline"); + INLINE var shader = shader_current(); if(shader == -1) return; @@ -65,7 +65,7 @@ function shader_set_f(uniform, value) { } function shader_set_uniform_f_array_safe(uniform, array, max_length = 128) { - gml_pragma("forceinline"); + INLINE if(!is_array(array)) return; @@ -78,7 +78,7 @@ function shader_set_uniform_f_array_safe(uniform, array, max_length = 128) { } function shader_set_surface(sampler, surface, linear = false, _repeat = false) { - gml_pragma("forceinline"); + INLINE var shader = shader_current(); if(shader == -1) return; @@ -111,7 +111,7 @@ function shader_set_surface(sampler, surface, linear = false, _repeat = false) { //} function shader_set_surface_dimension(uniform, surface) { - gml_pragma("forceinline"); + INLINE var shader = shader_current(); if(!is_surface(surface)) return; @@ -128,7 +128,7 @@ function shader_set_surface_dimension(uniform, surface) { } function shader_set_dim(uniform = "dimension", surf = noone) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surf)) return; @@ -136,13 +136,13 @@ function shader_set_dim(uniform = "dimension", surf = noone) { } function shader_set_color(uniform, col, alpha = 1) { - gml_pragma("forceinline"); + INLINE shader_set_f(uniform, colToVec4(col, alpha)); } function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount", max_length = 128) { - gml_pragma("forceinline"); + INLINE shader_set_i(amo_uni, min(max_length, array_length(pal))); @@ -164,7 +164,7 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount", } function shader_preset_interpolation(shader = sh_sample) { - gml_pragma("forceinline"); + INLINE var intp = attributes.interpolate; @@ -174,19 +174,19 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount", } function shader_postset_interpolation() { - gml_pragma("forceinline"); + INLINE gpu_set_tex_filter(false); } function shader_set_interpolation_surface(surface) { - gml_pragma("forceinline"); + INLINE shader_set_f("sampleDimension", surface_get_width_safe(surface), surface_get_height_safe(surface)); } function shader_set_interpolation(surface) { - gml_pragma("forceinline"); + INLINE var intp = attributes.interpolate; diff --git a/scripts/shell_functions/shell_functions.gml b/scripts/shell_functions/shell_functions.gml index e639a3ba9..b1060bffa 100644 --- a/scripts/shell_functions/shell_functions.gml +++ b/scripts/shell_functions/shell_functions.gml @@ -5,7 +5,7 @@ function shellOpenExplorer(path) { } function shell_execute(path, command, ref = noone) { - gml_pragma("forceinline"); + INLINE var txt = $"{path} {command}"; @@ -20,7 +20,7 @@ function shell_execute(path, command, ref = noone) { } function shell_execute_async(path, command, ref = noone) { - gml_pragma("forceinline"); + INLINE var txt = $"{path} {command}"; diff --git a/scripts/sprite_loader/sprite_loader.gml b/scripts/sprite_loader/sprite_loader.gml index 88ebf2c86..94a5f4985 100644 --- a/scripts/sprite_loader/sprite_loader.gml +++ b/scripts/sprite_loader/sprite_loader.gml @@ -16,13 +16,13 @@ function __initTheme() { } function _sprite_path(rel, theme) { - gml_pragma("forceinline"); + INLINE return $"{DIRECTORY}themes/{theme}/graphics/{string_replace_all(rel, "./", "")}"; } function _sprite_load_from_struct(str, theme, key) { - gml_pragma("forceinline"); + INLINE var path = _sprite_path(str.path, theme); var s = sprite_add(path, str.subimages, false, true, str.xorigin, str.yorigin); @@ -45,7 +45,7 @@ function _sprite_load_from_struct(str, theme, key) { } function __getGraphicList() { - gml_pragma("forceinline"); + INLINE var path = _sprite_path("./graphics.json", "default"); var s = file_text_read_all(path); diff --git a/scripts/string_decimal/string_decimal.gml b/scripts/string_decimal/string_decimal.gml index 2f40d99ea..ecd87559a 100644 --- a/scripts/string_decimal/string_decimal.gml +++ b/scripts/string_decimal/string_decimal.gml @@ -23,7 +23,7 @@ function string_decimal(str) { } function toNumberFast(str) { - gml_pragma("forceinline"); + INLINE var r = real(str); if(is_real(r)) return r; @@ -31,7 +31,7 @@ function toNumberFast(str) { } function toNumber(str) { - gml_pragma("forceinline"); + INLINE if(is_real(str)) return str; if(!isNumber(str)) return 0; diff --git a/scripts/string_functions/string_functions.gml b/scripts/string_functions/string_functions.gml index 733a2b25a..91f17d6ba 100644 --- a/scripts/string_functions/string_functions.gml +++ b/scripts/string_functions/string_functions.gml @@ -56,7 +56,7 @@ function string_real(val, digMax = 999) { #region } #endregion function string_char_last(str, shift = 0) { #region - gml_pragma("forceinline"); + INLINE return string_char_at(str, string_length(str) - shift); } #endregion @@ -66,11 +66,11 @@ function filename_name_only(name) { #region } #endregion function string_to_var(str) { #region - gml_pragma("forceinline"); + INLINE return string_replace_all(string_lower(str), " ", "_"); } #endregion function string_quote(str) { #region - gml_pragma("forceinline"); + INLINE return $"\"{str}\""; } #endregion \ No newline at end of file diff --git a/scripts/struct_functions/struct_functions.gml b/scripts/struct_functions/struct_functions.gml index 2297c9153..54a250feb 100644 --- a/scripts/struct_functions/struct_functions.gml +++ b/scripts/struct_functions/struct_functions.gml @@ -24,7 +24,7 @@ function struct_append(original, append) { } function struct_try_get(struct, key, def = 0) { - gml_pragma("forceinline"); + INLINE if(struct[$ key] != undefined) return struct[$ key]; @@ -33,7 +33,7 @@ function struct_try_get(struct, key, def = 0) { } function struct_try_override(original, override, key) { - gml_pragma("forceinline"); + INLINE if(!is_struct(original) || !is_struct(override)) return; if(!struct_has(override, key)) return; diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index 96d8ebce9..c9677db41 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -1,6 +1,6 @@ //draw function draw_surface_safe(surface, _x = 0, _y = 0) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface)) { if(is_instanceof(surface, dynaSurf)) { @@ -17,7 +17,7 @@ function draw_surface_safe(surface, _x = 0, _y = 0) { } function draw_surface_stretched_safe(surface, _x, _y, _w, _h) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface)) { if(is_instanceof(surface, dynaSurf)) { @@ -34,7 +34,7 @@ function draw_surface_stretched_safe(surface, _x, _y, _w, _h) { } function draw_surface_ext_safe(surface, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface)) { if(is_instanceof(surface, dynaSurf)) { @@ -52,7 +52,7 @@ function draw_surface_ext_safe(surface, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col } function draw_surface_tiled_safe(surface, _x, _y) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface)) { if(is_instanceof(surface, dynaSurf)) { @@ -69,7 +69,7 @@ function draw_surface_tiled_safe(surface, _x, _y) { } function draw_surface_tiled_ext_safe(surface, _x, _y, _xs = 1, _ys = 1, _col = c_white, _alpha = 1) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface)) { if(is_instanceof(surface, dynaSurf)) { @@ -86,7 +86,7 @@ function draw_surface_tiled_ext_safe(surface, _x, _y, _xs = 1, _ys = 1, _col = c } function draw_surface_part_ext_safe(surface, _l, _t, _w, _h, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface)) { if(is_instanceof(surface, dynaSurf)) { @@ -106,7 +106,7 @@ function draw_surface_part_ext_safe(surface, _l, _t, _w, _h, _x, _y, _xs = 1, _y #macro __surface_free surface_free function surface_free_safe(surface) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surface)) return; __surface_free(surface); @@ -151,7 +151,7 @@ function surface_save_safe(surface, path) { } function surface_get_width_safe(s, crop = true) { - gml_pragma("forceinline"); + INLINE if(is_struct(s)) { if(is_instanceof(s, dynaSurf)) return s.getWidth(); @@ -163,7 +163,7 @@ function surface_get_width_safe(s, crop = true) { } function surface_get_height_safe(s, crop = true) { - gml_pragma("forceinline"); + INLINE if(is_struct(s)) { if(is_instanceof(s, dynaSurf)) return s.getHeight(); @@ -176,7 +176,7 @@ function surface_get_height_safe(s, crop = true) { //check function is_surface(s) { - gml_pragma("forceinline"); + INLINE if(is_instanceof(s, dynaSurf) || is_instanceof(s, SurfaceAtlas)) return true; if(is_real(s) && s > 0 && surface_exists(s)) return true; @@ -184,7 +184,7 @@ function is_surface(s) { } function surface_verify(surf, w, h, format = surface_rgba8unorm) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surf)) return surface_create_valid(w, h, format); return surface_size_to(surf, w, h, format, true); @@ -192,7 +192,7 @@ function surface_verify(surf, w, h, format = surface_rgba8unorm) { //get function surface_get_pixel(surface, _x, _y) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surface)) return; var f = surface_get_format(surface); @@ -203,7 +203,7 @@ function surface_get_pixel(surface, _x, _y) { } function surface_get_pixel_ext(surface, _x, _y) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surface)) return; var px = surface_getpixel_ext(surface, _x, _y); @@ -214,7 +214,7 @@ function surface_get_pixel_ext(surface, _x, _y) { //create function surface_create_empty(w, h, format = surface_rgba8unorm) { - gml_pragma("forceinline"); + INLINE var s = surface_create(w, h, format); surface_clear(s); @@ -222,19 +222,19 @@ function surface_create_empty(w, h, format = surface_rgba8unorm) { } function surface_create_size(surface, format = surface_rgba8unorm) { - gml_pragma("forceinline"); + INLINE return surface_create_valid(surface_get_width_safe(surface), surface_get_height_safe(surface), format); } function surface_create_valid(w, h, format = surface_rgba8unorm) { - gml_pragma("forceinline"); + INLINE return surface_create_empty(surface_valid_size(w), surface_valid_size(h), format); } function surface_create_from_buffer(w, h, buff, format = surface_rgba8unorm) { - gml_pragma("forceinline"); + INLINE if(buff < 0) return; var s = surface_create_valid(surface_valid_size(w), surface_valid_size(h), format); @@ -330,7 +330,7 @@ function surface_size_to(surface, width, height, format = noone, skipCheck = fal } function surface_clear(surface) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surface)) return; surface_set_target(surface); @@ -339,7 +339,7 @@ function surface_clear(surface) { } function surface_copy_from(dst, src, format = noone) { - gml_pragma("forceinline"); + INLINE surface_set_target(dst); DRAW_CLEAR @@ -350,7 +350,7 @@ function surface_copy_from(dst, src, format = noone) { } function surface_clone(surface, destination = noone, format = noone) { - gml_pragma("forceinline"); + INLINE if(is_struct(surface) && is_instanceof(surface, dynaSurf)) return surface.clone(); @@ -370,7 +370,7 @@ function surface_clone(surface, destination = noone, format = noone) { //in-place modification function surface_stretch(surf, _w, _h) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surf)) return noone; @@ -388,7 +388,7 @@ function surface_stretch(surf, _w, _h) { } function surface_mirror(surf, _h, _v) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surf)) return noone; var _surf = surface_create_size(surf); @@ -408,7 +408,7 @@ function surface_mirror(surf, _h, _v) { //others function surface_copy_size(dest, source, format = noone) { - gml_pragma("forceinline"); + INLINE if(!is_surface(dest)) return; if(!is_surface(source)) return; @@ -422,7 +422,7 @@ function surface_copy_size(dest, source, format = noone) { } function surface_valid_size(s) { - gml_pragma("forceinline"); + INLINE if(!is_real(s)) return 1; if(is_infinity(s)) return 1; @@ -430,7 +430,7 @@ function surface_valid_size(s) { } function surface_array_free(arr) { - gml_pragma("forceinline"); + INLINE if(!is_array(arr)) { if(is_surface(arr)) surface_free(arr); @@ -458,7 +458,7 @@ function surface_array_clone(arr) { } function surface_array_serialize(arr) { - gml_pragma("forceinline"); + INLINE var _arr = __surface_array_serialize(arr); return json_stringify(_arr); @@ -486,7 +486,7 @@ function __surface_array_serialize(arr) { } function surface_array_deserialize(arr, index = -1) { - gml_pragma("forceinline"); + INLINE var _arr = json_try_parse(arr); return index == -1? __surface_array_deserialize(_arr) : __surface_array_deserialize(_arr[index]); @@ -543,7 +543,7 @@ function surface_format_get_bytes(format) { } function surface_get_size(surface) { - gml_pragma("forceinline"); + INLINE var sw = surface_get_width_safe(surface); var sh = surface_get_height_safe(surface); @@ -552,7 +552,7 @@ function surface_get_size(surface) { } function surface_texture(surface) { - gml_pragma("forceinline"); + INLINE if(!is_surface(surface)) return -1; return surface_get_texture(surface); diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index 69be431b6..94ee70c8b 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -47,14 +47,10 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor parser_server = noone; use_autocomplete = true; - autocomplete_box = instance_create(0, 0, o_dialog_textbox_autocomplete); - autocomplete_box.textbox = self; autocomplete_server = noone; autocomplete_object = noone; autocomplete_context = {}; - function_guide_box = instance_create(0, 0, o_dialog_textbox_function_guide); - function_guide_box.textbox = self; function_guide_server = noone; shift_new_line = true; @@ -96,7 +92,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor if(!isCodeFormat()) return; if(autocomplete_server == noone) return; if(!use_autocomplete) { - autocomplete_box.active = false; + o_dialog_textbox_autocomplete.deactivate(self); return; } @@ -111,13 +107,9 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor var data = autocomplete_server(pmt, localParams, autocomplete_context); if(array_length(data)) { - autocomplete_box.data = data; - - autocomplete_box.active = true; - autocomplete_box.prompt = pmt; - autocomplete_box.selecting= 0; - } else - autocomplete_box.active = false; + o_dialog_textbox_autocomplete.data = data; + o_dialog_textbox_autocomplete.activate(self); + } var _c = cursor; var _v = false; @@ -147,13 +139,13 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor var guide = function_guide_server(_fn); if(guide != "") { - function_guide_box.active = true; - function_guide_box.dialog_x = rx + cursor_pos_x + 1; - function_guide_box.dialog_y = ry + cursor_pos_y - 12; - function_guide_box.prompt = guide; - function_guide_box.index = amo; + o_dialog_textbox_function_guide.activate(self); + o_dialog_textbox_function_guide.dialog_x = rx + cursor_pos_x + 1; + o_dialog_textbox_function_guide.dialog_y = ry + cursor_pos_y - 12; + o_dialog_textbox_function_guide.prompt = guide; + o_dialog_textbox_function_guide.index = amo; } else - function_guide_box.active = false; + o_dialog_textbox_function_guide.deactivate(self); } #endregion static breakCharacter = function(ch) { #region @@ -166,7 +158,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor if(!keyboard_check_pressed(vk_enter)) return 0; - if(use_autocomplete && autocomplete_box.active) + if(use_autocomplete && o_dialog_textbox_autocomplete.textbox == self) return 0; return 1 + ((shift_new_line && key_mod_press(SHIFT)) || (!shift_new_line && !key_mod_press(SHIFT))); @@ -206,7 +198,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor } } - if(!(isCodeFormat() && autocomplete_box.active)) { + if(!(isCodeFormat() && o_dialog_textbox_autocomplete.textbox == self)) { if(key == vk_up) { var _target; @@ -527,7 +519,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor while(string_char_at(_input_text, cursor + 1) != "\n" && cursor < string_length(_input_text)) { cursor++; } - } else if(keyboard_check_pressed(vk_escape) && !autocomplete_box.active) { + } else if(keyboard_check_pressed(vk_escape) && o_dialog_textbox_autocomplete.textbox != self) { _input_text = _last_value; cut_line(); deactivate(); @@ -633,16 +625,12 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor } } - if(target != -999 && HOVER != autocomplete_box.id) { + if(target != -999 && HOVER != o_dialog_textbox_autocomplete.id) { if(mouse_press(mb_left, active) && !click_block) { cursor_select = target; cursor = target; - - autocomplete_box.active = true; } else if(mouse_click(mb_left, active) && cursor != target) { cursor = target; - - autocomplete_box.active = false; } if(mouse_press(mb_left, active)) @@ -797,13 +785,13 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor draw_line_width(cursor_pos_x, cursor_pos_y, cursor_pos_x, cursor_pos_y + c_h, 2); } - if(autocomplete_box.active) { - autocomplete_box.dialog_x = rx + cursor_pos_x + 1; - autocomplete_box.dialog_y = ry + cursor_pos_y + line_get_height() + 1; + if(o_dialog_textbox_autocomplete.textbox == self) { + o_dialog_textbox_autocomplete.dialog_x = rx + cursor_pos_x + 1; + o_dialog_textbox_autocomplete.dialog_y = ry + cursor_pos_y + line_get_height() + 1; } #endregion - if(!point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + hh) && mouse_press(mb_left) && HOVER != autocomplete_box.id) { + if(!point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + hh) && mouse_press(mb_left) && HOVER != o_dialog_textbox_autocomplete.id) { deactivate(); } } else { @@ -819,7 +807,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor display_text(tx, _y + ui(7), _text); - autocomplete_box.active = 0; + o_dialog_textbox_autocomplete.deactivate(self); } if(DRAGGING && (DRAGGING.type == "Text" || DRAGGING.type == "Number") && hover && hoverRect) { diff --git a/scripts/var_comparison/var_comparison.gml b/scripts/var_comparison/var_comparison.gml index 58627d0e5..adcd14b4d 100644 --- a/scripts/var_comparison/var_comparison.gml +++ b/scripts/var_comparison/var_comparison.gml @@ -1,5 +1,5 @@ function isEqual(val1, val2, struct_expand = false) { - gml_pragma("forceinline"); + INLINE if(is_array(val1) && is_array(val2)) return array_member_equal(val1, val2); if(struct_expand && is_struct(val1) && is_struct(val2)) return struct_equal(val1, val2); @@ -8,7 +8,7 @@ function isEqual(val1, val2, struct_expand = false) { } function array_member_equal(arr1, arr2) { - gml_pragma("forceinline"); + INLINE if(array_length(arr1) != array_length(arr2)) return false; @@ -19,7 +19,7 @@ function array_member_equal(arr1, arr2) { } function struct_equal(str1, str2) { - gml_pragma("forceinline"); + INLINE //return json_stringify(str1) == json_stringify(str2);