From 9e957c5cd6f2fdfe42e6d01d2981d51e7356b69c Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Tue, 25 Jul 2023 20:12:40 +0200 Subject: [PATCH] Junction caching --- PixelComposer.resource_order | 2 +- PixelComposer.yyp | 2 +- datafiles/data/locale/en.zip | Bin 26862 -> 26866 bytes datafiles/data/locale/en/UI.json | 2 +- objects/_addon_custom/Create_0.gml | 4 +- objects/_addon_custom/Destroy_0.gml | 2 +- objects/_p_dialog/Create_0.gml | 2 +- objects/addon_key_displayer/Draw_75.gml | 4 +- objects/o_dialog_about/Create_0.gml | 2 +- .../o_dialog_add_multiple_images/Draw_64.gml | 2 +- objects/o_dialog_add_node/Create_0.gml | 12 +- .../o_dialog_anim_time_scaler/Create_0.gml | 8 +- objects/o_dialog_color_quick_pick/Draw_64.gml | 2 +- objects/o_dialog_color_selector/Create_0.gml | 11 +- objects/o_dialog_gradient/Create_0.gml | 11 +- .../o_dialog_group_input_order/Create_0.gml | 2 +- objects/o_dialog_image_array_edit/Draw_64.gml | 2 +- objects/o_dialog_l_system/Create_0.gml | 2 +- objects/o_dialog_migration/Draw_64.gml | 10 +- objects/o_dialog_preference/Create_0.gml | 2 +- objects/o_dialog_preview_window/Draw_64.gml | 2 +- objects/o_dialog_scrollbox/Create_0.gml | 4 +- objects/o_dialog_splash/Create_0.gml | 2 +- objects/o_dialog_splash/Draw_64.gml | 2 +- objects/o_dialog_splash/Other_62.gml | 8 +- .../Create_0.gml | 2 +- .../o_dialog_textbox_autocomplete/Draw_64.gml | 2 +- objects/o_dialog_tunnels/Create_0.gml | 8 +- objects/o_main/Create_0.gml | 8 +- objects/o_main/Other_68.gml | 2 +- objects/o_main/Step_0.gml | 15 +- objects/o_main/Step_1.gml | 3 +- scripts/GmlLua/GmlLua.gml | 2 +- scripts/VCT/VCT.gml | 4 +- scripts/_3D/_3D.gml | 9 +- scripts/__VFX/__VFX.gml | 45 +++- scripts/__bone/__bone.gml | 44 ++-- scripts/__initAddon/__initAddon.gml | 2 +- scripts/__mesh/__mesh.gml | 12 +- scripts/__node_iterator/__node_iterator.gml | 9 +- scripts/__path/__path.gml | 4 +- scripts/__polygon/__polygon.gml | 2 +- scripts/__shapes/__shapes.gml | 2 +- scripts/__strandSim/__strandSim.gml | 32 +-- .../_node_VFX_spawner/_node_VFX_spawner.gml | 44 +++- .../_node_strand_affector.gml | 2 +- scripts/addon_function/addon_function.gml | 2 +- scripts/addon_lua/addon_lua.gml | 6 +- .../animation_controller.gml | 28 ++- scripts/append_function/append_function.gml | 3 +- scripts/array_functions/array_functions.gml | 43 ++-- scripts/ase_reader/ase_reader.gml | 2 +- scripts/assets_data/assets_data.gml | 2 +- scripts/buttonGroup/buttonGroup.gml | 4 +- scripts/buttonPalette/buttonPalette.gml | 18 +- scripts/color_loader/color_loader.gml | 8 +- .../contextMenu_controller.gml | 2 +- scripts/controlPointBox/controlPointBox.gml | 6 +- scripts/debug/debug.gml | 6 +- .../dialog_management/dialog_management.gml | 2 +- scripts/draw_corner/draw_corner.gml | 33 ++- .../draw_line_width_vertex.gml | 18 +- .../draw_text_function/draw_text_function.gml | 2 +- scripts/ds_list/ds_list.gml | 2 +- scripts/ds_list_queue/ds_list_queue.gml | 8 +- scripts/event_recorder/event_recorder.gml | 4 +- scripts/fft_functions/fft_functions.gml | 10 +- scripts/globals/globals.gml | 2 +- .../gradients_function/gradients_function.gml | 10 +- scripts/histogram_drawer/histogram_drawer.gml | 2 +- scripts/load_function/load_function.gml | 16 +- scripts/logger/logger.gml | 13 +- scripts/luaHighlight/luaHighlight.gml | 4 +- scripts/meta_data/meta_data.gml | 4 +- scripts/node_3d_combine/node_3d_combine.gml | 4 +- scripts/node_3d_displace/node_3d_displace.gml | 8 +- scripts/node_3d_export/node_3d_export.gml | 2 +- scripts/node_3d_extrude/node_3d_extrude.gml | 2 +- scripts/node_3d_obj/node_3D_obj.gml | 2 +- scripts/node_3d_plane/node_3d_plane.gml | 2 +- .../node_3d_prim_cone/node_3d_prim_cone.gml | 2 +- .../node_3d_prim_cylinder.gml | 2 +- .../node_3d_prim_sphere.gml | 2 +- scripts/node_3d_render/node_3d_render.gml | 2 +- scripts/node_3d_repeat/node_3d_repeat.gml | 2 +- .../node_3d_transform/node_3d_transform.gml | 2 +- scripts/node_9slice/node_9slice.gml | 2 +- scripts/node_FFT/node_FFT.gml | 2 +- .../node_VFX_effector/node_VFX_effector.gml | 2 +- .../node_VFX_override/node_VFX_override.gml | 2 +- scripts/node_VFX_spawner/node_VFX_spawner.gml | 2 +- .../node_VFX_variable/node_VFX_variable.gml | 2 +- .../node_align_functions.gml | 8 +- scripts/node_armature/node_armature.gml | 16 +- .../node_armature_bind/node_armature_bind.gml | 6 +- .../node_armature_pose/node_armature_pose.gml | 8 +- .../node_armature_to_path.gml | 2 +- scripts/node_array_get/node_array_get.gml | 2 +- .../node_array_insert/node_array_insert.gml | 4 +- .../node_array_remove/node_array_remove.gml | 4 +- scripts/node_array_set/node_array_set.gml | 2 +- scripts/node_array_shift/node_array_shift.gml | 2 +- scripts/node_array_sort/node_array_sort.gml | 4 +- .../node_ase_file_read/node_ase_file_read.gml | 12 +- scripts/node_ase_layer/node_ase_layer.gml | 2 +- scripts/node_atlas_draw/node_atlas_draw.gml | 2 +- scripts/node_atlas_get/node_atlas_get.gml | 2 +- scripts/node_atlas_set/node_atlas_set.gml | 2 +- scripts/node_attributes/node_attributes.gml | 2 +- .../node_audio_window/node_audio_window.gml | 2 +- scripts/node_canvas/node_canvas.gml | 13 +- scripts/node_collection/node_collection.gml | 8 +- .../node_color_adjustment.gml | 2 +- scripts/node_color_data/node_color_data.gml | 24 +- .../node_color_replacement.gml | 2 +- scripts/node_crop/node_crop.gml | 2 +- .../node_crop_content/node_crop_content.gml | 2 +- .../node_csv_file_read/node_csv_file_read.gml | 2 +- .../node_csv_file_write.gml | 2 +- scripts/node_data/node_data.gml | 158 +++---------- scripts/node_de_stray/node_de_stray.gml | 2 +- .../node_display_text/node_display_text.gml | 2 +- scripts/node_dust/node_dust.gml | 6 +- scripts/node_equation/node_equation.gml | 2 +- scripts/node_export/node_export.gml | 6 +- scripts/node_feedback/node_feedback.yy | 2 +- .../node_feedback_input.yy | 2 +- .../node_feedback_output.gml | 2 +- .../node_feedback_output.yy | 2 +- scripts/node_flood_fill/node_flood_fill.gml | 2 +- scripts/node_gradient/node_gradient.gml | 2 +- .../node_gradient_extract.gml | 4 +- .../node_gradient_palette.gml | 2 +- .../node_gradient_replace.gml | 2 +- .../node_gradient_shift.gml | 2 +- scripts/node_group_input/node_group_input.gml | 13 +- .../node_group_output/node_group_output.gml | 3 + .../node_image_animated.gml | 2 +- .../node_image_sequence.gml | 2 +- .../node_image_splice_sheet.gml | 2 +- scripts/node_iterate/node_iterate.gml | 3 +- .../node_iterator_input.gml | 20 +- .../node_iterator_output.gml | 1 + scripts/node_line/node_line.gml | 4 +- scripts/node_lua_compute/node_lua_compute.gml | 2 +- scripts/node_lua_surface/node_lua_surface.gml | 2 +- .../node_mesh_to_path/node_mesh_to_path.gml | 4 +- .../node_mesh_transform.gml | 2 +- scripts/node_number/node_number.gml | 6 +- .../node_pack_sprites/node_pack_sprites.gml | 6 +- .../node_palette_extract.gml | 6 +- .../node_palette_replacement.gml | 2 +- scripts/node_particle/node_particle.gml | 11 +- scripts/node_path/node_path.gml | 16 +- .../node_path_builder/node_path_builder.gml | 2 +- .../node_path_l_system/node_path_l_system.gml | 6 +- .../node_polygonal_shape.gml | 6 +- scripts/node_processor/node_processor.gml | 2 +- scripts/node_region_fill/node_region_fill.gml | 2 +- scripts/node_repeat/node_repeat.gml | 4 +- .../node_rigid_activation.gml | 2 +- .../node_rigid_force_apply.gml | 2 +- scripts/node_rigid_group/node_rigid_group.gml | 6 +- .../node_rigid_object/node_rigid_object.gml | 20 +- .../node_rigid_override.gml | 2 +- .../node_rigid_variable.gml | 2 +- .../node_scatter_points.gml | 2 +- scripts/node_sdf/node_sdf.gml | 10 +- .../node_sequence_to_anim.gml | 6 +- .../node_simple_shape/node_simple_shape.gml | 2 +- .../node_strand_collision.gml | 2 +- .../node_strand_create/node_strand_create.gml | 10 +- .../node_strand_gravity.gml | 2 +- .../node_strand_render/node_strand_render.gml | 4 +- .../node_strand_render_texture.gml | 2 +- .../node_strand_update/node_strand_update.gml | 2 +- scripts/node_string_join/node_string_join.gml | 2 +- .../node_surface_from_color.gml | 2 +- scripts/node_trail/node_trail.gml | 2 +- scripts/node_tunnel_in/node_tunnel_in.gml | 4 +- scripts/node_value/node_value.gml | 218 ++++++++++++++---- scripts/node_wrap_mesh/node_wrap_mesh.gml | 2 +- scripts/obj_reader/obj_reader.gml | 2 +- scripts/pack_corner/pack_corner.gml | 2 +- scripts/panel_addon/panel_addon.gml | 6 +- scripts/panel_animation/panel_animation.gml | 70 +++--- .../panel_array_sequence.gml | 6 +- scripts/panel_collection/panel_collection.gml | 2 +- scripts/panel_console/panel_console.gml | 2 +- scripts/panel_data/panel_data.gml | 24 +- scripts/panel_function/panel_function.gml | 10 +- scripts/panel_graph/panel_graph.gml | 69 +++--- .../panel_graph_export_image.gml | 6 +- .../panel_graph_export_image_dialog.gml | 2 +- scripts/panel_inspector/panel_inspector.gml | 13 +- scripts/panel_menu/panel_menu.gml | 4 +- .../panel_node_data_gen.gml | 4 +- scripts/panel_preview/panel_preview.gml | 8 +- .../panel_preview_window.gml | 6 +- scripts/panel_test/panel_test.gml | 4 +- scripts/panel_tunnels/panel_tunnels.gml | 8 +- scripts/pathArrayBox/pathArrayBox.gml | 2 +- scripts/path_reader/path_reader.gml | 2 +- scripts/printer/printer.gml | 2 +- scripts/project_function/project_function.gml | 23 +- scripts/pxl_server/pxl_server.gml | 10 +- scripts/random_function/random_function.gml | 16 +- scripts/real_comparison/real_comparison.gml | 2 +- scripts/render_data/render_data.gml | 9 +- scripts/save_function/save_function.gml | 3 +- scripts/shader_functions/shader_functions.gml | 2 +- scripts/sprite_loader/sprite_loader.gml | 2 +- scripts/string_eval/string_eval.gml | 24 +- scripts/string_function/string_function.gml | 2 +- scripts/string_splice/string_splice.gml | 2 +- scripts/struct_functions/struct_functions.gml | 2 +- .../surface_functions/surface_functions.gml | 8 +- scripts/textArea/textArea.gml | 8 +- scripts/textArrayBox/textArrayBox.gml | 4 +- scripts/transformBox/transformBox.gml | 2 +- scripts/vertex_function/vertex_function.gml | 5 + scripts/window_functions/window_functions.gml | 2 +- shaders/sh_de_stray/sh_de_stray.fsh | 47 ++-- .../9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png | Bin 108 -> 298 bytes .../5c2034af-3f49-45f4-b2e7-9a4e627c2da7.png | Bin 108 -> 298 bytes sprites/s_menu_black/s_menu_black.yy | 12 +- .../9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png | Bin 138 -> 315 bytes .../5c2034af-3f49-45f4-b2e7-9a4e627c2da7.png | Bin 138 -> 315 bytes .../s_menu_transparent/s_menu_transparent.yy | 12 +- .../9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png | Bin 107 -> 298 bytes .../5c2034af-3f49-45f4-b2e7-9a4e627c2da7.png | Bin 107 -> 298 bytes sprites/s_menu_white/s_menu_white.yy | 12 +- 232 files changed, 1030 insertions(+), 864 deletions(-) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 1b3129e2a..d2dc8e146 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -75,7 +75,7 @@ {"name":"audio","order":19,"path":"folders/nodes/data/audio.yy",}, {"name":"compose","order":14,"path":"folders/nodes/data/compose.yy",}, {"name":"armature","order":5,"path":"folders/nodes/data/compose/armature.yy",}, - {"name":"feedback","order":13,"path":"folders/nodes/data/feedback.yy",}, + {"name":"feedback","order":7,"path":"folders/nodes/data/iterate/feedback.yy",}, {"name":"filter","order":1,"path":"folders/nodes/data/filter.yy",}, {"name":"colors","order":4,"path":"folders/nodes/data/filter/colors.yy",}, {"name":"combine","order":1,"path":"folders/nodes/data/filter/combine.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index cecdae5a5..3408ab22f 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -98,7 +98,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"audio","folderPath":"folders/nodes/data/audio.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"armature","folderPath":"folders/nodes/data/compose/armature.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/feedback.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/iterate/feedback.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"filter","folderPath":"folders/nodes/data/filter.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/nodes/data/filter/blur.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"colors","folderPath":"folders/nodes/data/filter/colors.yy",}, diff --git a/datafiles/data/locale/en.zip b/datafiles/data/locale/en.zip index 0469063f570d26e581e1fc9314dd5ef50cadab3a..3074cf8a230fd6e2914363c8653a65a57a7c542e 100644 GIT binary patch delta 792 zcmV+z1Lyqi(E;+&0k8y74G5R{R%v?6H;)hi0E4p;QO*s2>b*O@f$i`3TQctKa0{lm z58`nSplK)H@RiKDr_Ti*l_BjwO7WF`;uyK;{$1KUMTol}>&}m!C;=~qfa$@zq|UX` zeSv_MniM+SrTqnJ)||*5DZic{V2>^Iiwtt%#{2B~S=2ChB}bX@-LubghiSdPbSBUv zECIaH-NU}SmF<%}jkIkM>{WJG-_jnV*AKj?xpu0V&9_ZZ9&wl==@9|1f za(S1u{b+PIO0qRh_81-$x-*>%_f-k}+RJA>@N;MBzn<*Ws1B%fpe{FKM_ zSk#|;!k2i~}&XE5;vx%<%jyIj7vYD=vw?Tv3zDc7l#d zT@-aCDnb#L?`71y2Q^7ba>Xa1WdWmYn>s$}FRqcMUaSxJBjkedd2F#@)Mb>#Mo2kA z53dKf6ZGhIKmblXlCLHf%*WN26XC$@ke)RZFPL_webhH;f39zW3VY{J zLGL1e6F_$-Gs)taY;l@9il6vH8-C(<$)^fJ%Az{Eiab783_Mmn^Cyy#7bo|9l0(S= zbJx`Pp{Rx)xcbpG$dP_=>FDo@NEaDMs^cpK4;xQ+w(M=w$%PBBJ$F_KA=e%(KD+7NXG3vWY(pCJUb z>s1z)fd&_;s4|neJGDlk@pX4~;e|s7Yb3N)Kl${6^*iWj@wUU5Cf-RINT5QJnDiR# zu+2?qc=c;M$QKw_ z;5L%C^LH3bPh628DTkg8^YNzBO>ozka_EJgpeSF?peW1TMA7Kn^@VhJnQIMhYq($x z@u{H_bUrEz1@w4FRT5)&rHyx2lpZ_I@_LNHisHu~{`Y^gtzpCl4G5R{R%v?6H;)hi W0E3f$Xh{LFlgMZw2J&YB0001y=Y@Fy delta 788 zcmV+v1MB?q(E;w!0k8y74Q*HNR-A_c7K;!70D7|#QO*s2xa%Ex3wmdVTd=@=5QcNy zOdI%yZ(`0peI@Xy3~2{aim&t&hsL$`@6zTeLfo}jcWm@T33wj_EDl~Fbsmkb2?Vs% zlF*?pZ7a~O=0s*l`DOe7TWg_TWRMFt-d@koqK3IEIk=3koPC}<%;x=FGl3pq3Fu9D z;zpxVNK!(7l1(9v`OZjrZ1#NEpShO1#|sGl#70#I-R(i+K-GSJ_VYh|k5`hCJG-Rh zN29w@a;$N($MAH}9pzlOk4fOyUcTmmpF2zc^<x0@DsmFzEBWS7S-8R!12Liys_$;KZuN+H+k)ooJ9thyQaqP zLpAikm5r`Jj`WKwMt@gCy2wCM9bYMU*m%0LWpA5K?pc8CxwA?Lx%OZIT6Z^=_UbDP z{v9DfpdCs-JruKmto0|KVi;lH8&Cl}wZTt+52R0u_>cq}O1FZDt}f zUyl%b^9zy?7ds_lXFn#XT05FwgO?L diff --git a/datafiles/data/locale/en/UI.json b/datafiles/data/locale/en/UI.json index 5dc5570e9..57f5531c3 100644 --- a/datafiles/data/locale/en/UI.json +++ b/datafiles/data/locale/en/UI.json @@ -258,7 +258,7 @@ "panel_inspector_out_visible": "Outputs visibility", "panel_inspector_execute": "Execute node", "panel_inspector_cache_desp": "This node cache output for performance.\nClick to clear all cached frames in this node.", - "panel_inspector_set_default": "Set as default", + "panel_inspector_set_default": "Set Metadata as default", "panel_inspector_workshop_save": "Save file before upload", "panel_inspector_workshop_upload": "Upload to Steam Workshop", "panel_inspector_workshop_update": "Update Steam Workshop", diff --git a/objects/_addon_custom/Create_0.gml b/objects/_addon_custom/Create_0.gml index 05693af58..350ed0e45 100644 --- a/objects/_addon_custom/Create_0.gml +++ b/objects/_addon_custom/Create_0.gml @@ -27,7 +27,7 @@ event_inherited(); if(_openDialog) { var arr = variable_struct_get_names(panels); - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { var _key = arr[i]; var pane = panels[$ _key]; @@ -41,7 +41,7 @@ event_inherited(); context_menus = meta.context_menu_callbacks; var arr = variable_struct_get_names(context_menus); - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { var _call = ds_map_try_get(CONTEXT_MENU_CALLBACK, arr[i], []); var _fnk = context_menus[$ arr[i]]; var _generator = new addonContextGenerator(self, _fnk); diff --git a/objects/_addon_custom/Destroy_0.gml b/objects/_addon_custom/Destroy_0.gml index eb02f562e..f4b011b3d 100644 --- a/objects/_addon_custom/Destroy_0.gml +++ b/objects/_addon_custom/Destroy_0.gml @@ -6,7 +6,7 @@ array_remove(ANIMATION_PRE, animationPreStep); array_remove(ANIMATION_POST, animationPostStep); var arr = variable_struct_get_names(context_menus); -for( var i = 0; i < array_length(arr); i++ ) { +for( var i = 0, n = array_length(arr); i < n; i++ ) { var _call = ds_map_try_get(CONTEXT_MENU_CALLBACK, arr[i], []); for( var j = array_length(_call) - 1; j >= 0; j-- ) { diff --git a/objects/_p_dialog/Create_0.gml b/objects/_p_dialog/Create_0.gml index 079ed6d48..906360ed1 100644 --- a/objects/_p_dialog/Create_0.gml +++ b/objects/_p_dialog/Create_0.gml @@ -162,7 +162,7 @@ function checkMouse() { if(!DIALOG_CLICK) return; - for( var i = 0; i < array_length(children); i++ ) + for( var i = 0, n = array_length(children); i < n; i++ ) if(instance_exists(children[i])) return; var x0 = dialog_x - dialog_resizable * 6; diff --git a/objects/addon_key_displayer/Draw_75.gml b/objects/addon_key_displayer/Draw_75.gml index bbd3c631d..5da700157 100644 --- a/objects/addon_key_displayer/Draw_75.gml +++ b/objects/addon_key_displayer/Draw_75.gml @@ -2,7 +2,7 @@ #region draw var key = ""; - for( var i = 0; i < array_length(extra_keys); i++ ) { + for( var i = 0, n = array_length(extra_keys); i < n; i++ ) { if(keyboard_check(extra_keys[i][0])) key += key == ""? extra_keys[i][1] : (" + " + extra_keys[i][1]); } @@ -39,7 +39,7 @@ var mlx = WIN_W - array_length(mouse_left); var ox, oy, nx, ny; - for( var i = 0; i < array_length(mouse_left); i++ ) { + for( var i = 0, n = array_length(mouse_left); i < n; i++ ) { nx = mlx + i; ny = WIN_H - 4 - mouse_left[i] * 24; diff --git a/objects/o_dialog_about/Create_0.gml b/objects/o_dialog_about/Create_0.gml index 36d0b6884..731671ffe 100644 --- a/objects/o_dialog_about/Create_0.gml +++ b/objects/o_dialog_about/Create_0.gml @@ -36,7 +36,7 @@ event_inherited(); draw_set_color(COLORS._main_text_sub); draw_text(cx, yy, "Special Thanks"); - for( var i = 0; i < array_length(credits); i++ ) { + for( var i = 0, n = array_length(credits); i < n; i++ ) { yy += line_get_height(, 8); draw_set_font(f_p2); draw_set_color(COLORS._main_text_sub); diff --git a/objects/o_dialog_add_multiple_images/Draw_64.gml b/objects/o_dialog_add_multiple_images/Draw_64.gml index e1891d97d..369b84863 100644 --- a/objects/o_dialog_add_multiple_images/Draw_64.gml +++ b/objects/o_dialog_add_multiple_images/Draw_64.gml @@ -32,7 +32,7 @@ if !ready exit; var path_arr = path_search(paths, dir_recursive, dir_filter); switch(i) { case 0 : - for( var i = 0; i < array_length(path_arr); i++ ) { + for( var i = 0, n = array_length(path_arr); i < n; i++ ) { var path = path_arr[i]; Node_create_Image_path(nx, ny, path); ny += 160; diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index ae8401776..5c156e42c 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -75,7 +75,7 @@ event_inherited(); var ar = call_in? io.outputs : io.inputs; var typ = node_called.type; - for( var i = 0; i < array_length(ar); i++ ) { + for( var i = 0, n = array_length(ar); i < n; i++ ) { if(!ar[i].visible) continue; var _in = call_in? node_called.type : ar[i].type; @@ -89,7 +89,7 @@ event_inherited(); var to = junction_hovering.type; var fr = junction_hovering.value_from.type; - for( var i = 0; i < array_length(io.inputs); i++ ) { + for( var i = 0, n = array_length(io.inputs); i < n; i++ ) { var _in = fr; var _ot = io.inputs[i].type; if(!io.inputs[i].visible) continue; @@ -97,7 +97,7 @@ event_inherited(); if(typeCompatible(_in, _ot, false)) return true; } - for( var i = 0; i < array_length(io.outputs); i++ ) { + for( var i = 0, n = array_length(io.outputs); i < n; i++ ) { var _in = io.outputs[i].type; var _ot = to; @@ -303,13 +303,13 @@ event_inherited(); var sug = ds_map_try_get(global.VALUE_SUGGESTION, node_called.type, []); if(array_length(sug)) { ds_list_add(_list, "Related"); - for( var i = 0; i < array_length(sug); i++ ) + for( var i = 0, n = array_length(sug); i < n; i++ ) ds_list_add(_list, ALL_NODES[? sug[i]]); } } ds_list_add(_list, "Favourites"); - for( var i = 0; i < array_length(global.FAV_NODES); i++ ) { + for( var i = 0, n = array_length(global.FAV_NODES); i < n; i++ ) { var _nodeIndex = global.FAV_NODES[i]; if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue; @@ -317,7 +317,7 @@ event_inherited(); } ds_list_add(_list, "Recents"); - for( var i = 0; i < array_length(global.RECENT_NODES); i++ ) { + for( var i = 0, n = array_length(global.RECENT_NODES); i < n; i++ ) { var _nodeIndex = global.RECENT_NODES[i]; if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue; diff --git a/objects/o_dialog_anim_time_scaler/Create_0.gml b/objects/o_dialog_anim_time_scaler/Create_0.gml index 17268dad1..d257ce464 100644 --- a/objects/o_dialog_anim_time_scaler/Create_0.gml +++ b/objects/o_dialog_anim_time_scaler/Create_0.gml @@ -18,12 +18,12 @@ event_inherited(); var fac = scale_to / PROJECT.animator.frames_total; var key = ds_map_find_first(PROJECT.nodeMap); repeat(ds_map_size(PROJECT.nodeMap)) { - var n = PROJECT.nodeMap[? key]; + var _node = PROJECT.nodeMap[? key]; key = ds_map_find_next(PROJECT.nodeMap, key); - if(!n || !n.active) continue; + if(!_node || !_node.active) continue; - for(var i = 0; i < ds_list_size(n.inputs); i++) { - var in = n.inputs[| i]; + for(var i = 0; i < ds_list_size(_node.inputs); i++) { + var in = _node.inputs[| i]; if(!in.is_anim) continue; for(var j = 0; j < ds_list_size(in.animator.values); j++) { var t = in.animator.values[| j]; diff --git a/objects/o_dialog_color_quick_pick/Draw_64.gml b/objects/o_dialog_color_quick_pick/Draw_64.gml index d9a2dd879..b05694e82 100644 --- a/objects/o_dialog_color_quick_pick/Draw_64.gml +++ b/objects/o_dialog_color_quick_pick/Draw_64.gml @@ -16,7 +16,7 @@ draw_sprite_stretched(THEME.dialog_bg, 0, x0, y0, ww, hh); - for( var i = 0; i < array_length(pal); i++ ) { + for( var i = 0, n = array_length(pal); i < n; i++ ) { var r = floor(i / col); var c = i % col; diff --git a/objects/o_dialog_color_selector/Create_0.gml b/objects/o_dialog_color_selector/Create_0.gml index 4a32dc16e..167089804 100644 --- a/objects/o_dialog_color_selector/Create_0.gml +++ b/objects/o_dialog_color_selector/Create_0.gml @@ -85,8 +85,15 @@ event_inherited(); if(isHover) draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), _height, COLORS._main_accent, 1); - draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); - draw_text(ui(16), yy + ui(8), preset_name[| i]); + var x0 = ui(16) + (i == 0) * ui(8 + 6); + var cc = i == preset_selecting? COLORS._main_accent : COLORS._main_text_sub; + draw_set_text(f_p2, fa_left, fa_top, cc); + draw_text(x0, yy + ui(8), preset_name[| i]); + if(i == 0) { + draw_set_color(cc); + draw_circle_prec(ui(16) + ui(4), yy + ui(16), ui(4), false); + } + if(preset_selecting == i) drawPaletteGrid(presets[| i], ui(16), yy + ui(28), ww, _gs, selector.current_color); else diff --git a/objects/o_dialog_gradient/Create_0.gml b/objects/o_dialog_gradient/Create_0.gml index 0b0653703..f061a9985 100644 --- a/objects/o_dialog_gradient/Create_0.gml +++ b/objects/o_dialog_gradient/Create_0.gml @@ -198,8 +198,15 @@ event_inherited(); if(isHover) draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_palette_w - ui(16), _height, COLORS._main_accent, 1); - draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); - draw_text(ui(16), yy + ui(8), filename_name_only(palette_name[| i])); + var x0 = ui(16) + (i == 0) * ui(8 + 6); + var cc = i == palette_selecting? COLORS._main_accent : COLORS._main_text_sub; + draw_set_text(f_p2, fa_left, fa_top, cc); + draw_text(x0, yy + ui(8), filename_name_only(palette_name[| i])); + if(i == 0) { + draw_set_color(cc); + draw_circle_prec(ui(16) + ui(4), yy + ui(16), ui(4), false); + } + if(palette_selecting == i) drawPaletteGrid(palettes[| i], ui(16), yy + ui(28), ww, _gs); else diff --git a/objects/o_dialog_group_input_order/Create_0.gml b/objects/o_dialog_group_input_order/Create_0.gml index d8b96c167..43dd25e5d 100644 --- a/objects/o_dialog_group_input_order/Create_0.gml +++ b/objects/o_dialog_group_input_order/Create_0.gml @@ -33,7 +33,7 @@ event_inherited(); var inpt = 0; var hovr = -1; - for( var i = 0; i < array_length(node.input_display_list); i++ ) { + for( var i = 0, n = array_length(node.input_display_list); i < n; i++ ) { var disp = node.input_display_list[i]; if(is_array(disp)) { if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _y, hg, _y + hg)) { diff --git a/objects/o_dialog_image_array_edit/Draw_64.gml b/objects/o_dialog_image_array_edit/Draw_64.gml index 38b76d3a4..4e3c278b5 100644 --- a/objects/o_dialog_image_array_edit/Draw_64.gml +++ b/objects/o_dialog_image_array_edit/Draw_64.gml @@ -35,7 +35,7 @@ if !target exit; var paths = paths_to_array(path); var arr = target.inputs[| 0].getValue(); - for( var i = 0; i < array_length(paths); i++ ) + for( var i = 0, n = array_length(paths); i < n; i++ ) array_push(arr, paths[i]); target.inputs[| 0].setValue(arr); diff --git a/objects/o_dialog_l_system/Create_0.gml b/objects/o_dialog_l_system/Create_0.gml index db727a8f2..834f87b3b 100644 --- a/objects/o_dialog_l_system/Create_0.gml +++ b/objects/o_dialog_l_system/Create_0.gml @@ -57,7 +57,7 @@ event_inherited(); var _h = 0; var ind = 0; - for( var i = 0; i < array_length(ref); i++ ) { + for( var i = 0, n = array_length(ref); i < n; i++ ) { var _f = ref[i]; if(is_string(_f)) { if(i) { diff --git a/objects/o_dialog_migration/Draw_64.gml b/objects/o_dialog_migration/Draw_64.gml index 4fb4c06b3..4a432c299 100644 --- a/objects/o_dialog_migration/Draw_64.gml +++ b/objects/o_dialog_migration/Draw_64.gml @@ -39,12 +39,12 @@ draw_set_alpha(1); if(b == 2) { var oldDir = environment_get_variable("userprofile") + "/AppData/Local/Pixels_Composer/"; var folders = [ "Assets", "Collections", "Fonts", "Gradients", "Palettes", "Presets", "Themes"]; - for( var i = 0; i < array_length(folders); i++ ) { - var o = oldDir + folders[i] + "/"; - var n = DIRECTORY + folders[i] + "/"; + for( var i = 0, n = array_length(folders); i < n; i++ ) { + var _o = oldDir + folders[i] + "/"; + var _n = DIRECTORY + folders[i] + "/"; - if(directory_exists(o)) { - var shell = "/E /I " + o + " " + n; + if(directory_exists(_o)) { + var shell = "/E /I " + _o + " " + _n; execute_shell("Xcopy", shell); } } diff --git a/objects/o_dialog_preference/Create_0.gml b/objects/o_dialog_preference/Create_0.gml index 5f851a18f..8b48851a9 100644 --- a/objects/o_dialog_preference/Create_0.gml +++ b/objects/o_dialog_preference/Create_0.gml @@ -332,7 +332,7 @@ event_inherited(); var cx = x1 - cw - ui(8); var category = ""; - for( var i = 0; i < array_length(COLOR_KEYS); i++ ) { + for( var i = 0, n = array_length(COLOR_KEYS); i < n; i++ ) { var key = COLOR_KEYS[i]; var val = variable_struct_get(COLORS, key); diff --git a/objects/o_dialog_preview_window/Draw_64.gml b/objects/o_dialog_preview_window/Draw_64.gml index 4712e0395..c0a97357c 100644 --- a/objects/o_dialog_preview_window/Draw_64.gml +++ b/objects/o_dialog_preview_window/Draw_64.gml @@ -32,7 +32,7 @@ if(node_target == noone) { var ind = 0; var col = round(sqrt(array_length(surf))); - for( var i = 0; i < array_length(surf); i++ ) { + for( var i = 0, n = array_length(surf); i < n; i++ ) { var s = surf[i]; var sw = surface_get_width(s); var sh = surface_get_height(s); diff --git a/objects/o_dialog_scrollbox/Create_0.gml b/objects/o_dialog_scrollbox/Create_0.gml index 8598a1dce..ef11233dc 100644 --- a/objects/o_dialog_scrollbox/Create_0.gml +++ b/objects/o_dialog_scrollbox/Create_0.gml @@ -42,7 +42,7 @@ event_inherited(); } data = []; - for( var i = 0; i < array_length(scrollbox.data); i++ ) { + for( var i = 0, n = array_length(scrollbox.data); i < n; i++ ) { var val = scrollbox.data[i]; if(val == -1) continue; @@ -57,7 +57,7 @@ event_inherited(); var hght = line_get_height(f_p0, 8); var hh = ui(16 + 24); - for( var i = 0; i < array_length(data); i++ ) + for( var i = 0, n = array_length(data); i < n; i++ ) hh += data[i] == -1? ui(8) : hght; dialog_h = min(max_h, hh); diff --git a/objects/o_dialog_splash/Create_0.gml b/objects/o_dialog_splash/Create_0.gml index e25073c03..c93313ffa 100644 --- a/objects/o_dialog_splash/Create_0.gml +++ b/objects/o_dialog_splash/Create_0.gml @@ -401,7 +401,7 @@ event_inherited(); var grid_ys = [ _yy, _yy ]; - for( var i = 0; i < array_length(submissions) - 1; i++ ) { + for( var i = 0, n = array_length(submissions) - 1; i < n; i++ ) { var _sub = submissions[i]; var _att = _sub.attachments; diff --git a/objects/o_dialog_splash/Draw_64.gml b/objects/o_dialog_splash/Draw_64.gml index 006232688..02eff2d1f 100644 --- a/objects/o_dialog_splash/Draw_64.gml +++ b/objects/o_dialog_splash/Draw_64.gml @@ -85,7 +85,7 @@ if !ready exit; var tab_cover = noone; var th = ui(36) + THEME_VALUE.panel_tab_extend; - for( var i = 0; i < array_length(pages); i++ ) { + for( var i = 0, n = array_length(pages); i < n; i++ ) { draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub); var txt = pages[i]; var dtxt = __txt(txt); diff --git a/objects/o_dialog_splash/Other_62.gml b/objects/o_dialog_splash/Other_62.gml index 55ccfc195..2f1adf90c 100644 --- a/objects/o_dialog_splash/Other_62.gml +++ b/objects/o_dialog_splash/Other_62.gml @@ -8,7 +8,7 @@ if(async_load[? "id"] == contest_req) { //get contests if(struct_has(thr_str, "threads")) { var thrs = thr_str.threads; - for( var i = 0; i < array_length(thrs); i++ ) { + for( var i = 0, n = array_length(thrs); i < n; i++ ) { var thr = thrs[i]; if(thr.parent_id != "1113080578351312906") continue; //not in contest channel @@ -29,7 +29,7 @@ if(async_load[? "id"] == contest_req) { //get contests return; } -for( var i = 0; i < array_length(contest_message_req); i++ ) { +for( var i = 0, n = array_length(contest_message_req); i < n; i++ ) { if(async_load[? "id"] != contest_message_req[i][0]) continue; var r_str = async_load[? "result"]; @@ -83,7 +83,7 @@ for( var i = 0; i < array_length(contest_message_req); i++ ) { } var keys = ds_map_keys_to_array(nicknames); -for( var i = 0; i < array_length(keys); i++ ) { +for( var i = 0, n = array_length(keys); i < n; i++ ) { var nick = nicknames[? keys[i]]; if(!is_array(nick)) continue; @@ -99,7 +99,7 @@ for( var i = 0; i < array_length(keys); i++ ) { } var keys = ds_map_keys_to_array(attachment); -for( var i = 0; i < array_length(keys); i++ ) { +for( var i = 0, n = array_length(keys); i < n; i++ ) { var att = attachment[? keys[i]]; if(!is_array(att)) continue; diff --git a/objects/o_dialog_textbox_autocomplete/Create_0.gml b/objects/o_dialog_textbox_autocomplete/Create_0.gml index 1f2693902..ec1099eea 100644 --- a/objects/o_dialog_textbox_autocomplete/Create_0.gml +++ b/objects/o_dialog_textbox_autocomplete/Create_0.gml @@ -75,7 +75,7 @@ slp[array_length(slp) - 1] = rep; var txt = ""; - for( var i = 0; i < array_length(textbox._input_text_line); i++ ) { + for( var i = 0, n = array_length(textbox._input_text_line); i < n; i++ ) { if(i == textbox.cursor_line) { for( var j = 0; j < array_length(slp); j++ ) txt += slp[j]; diff --git a/objects/o_dialog_textbox_autocomplete/Draw_64.gml b/objects/o_dialog_textbox_autocomplete/Draw_64.gml index 92090bcf9..758998ffc 100644 --- a/objects/o_dialog_textbox_autocomplete/Draw_64.gml +++ b/objects/o_dialog_textbox_autocomplete/Draw_64.gml @@ -9,7 +9,7 @@ if(textbox == noone) exit; var _w = 300; var _h = array_length(data) * line_get_height(f_p0, 8); - for( var i = 0; i < array_length(data); i++ ) { + for( var i = 0, n = array_length(data); i < n; i++ ) { var _dat = data[i]; var __w = ui(40 + 32); diff --git a/objects/o_dialog_tunnels/Create_0.gml b/objects/o_dialog_tunnels/Create_0.gml index 6cc32bfe4..e5bc7fb8a 100644 --- a/objects/o_dialog_tunnels/Create_0.gml +++ b/objects/o_dialog_tunnels/Create_0.gml @@ -42,7 +42,7 @@ event_inherited(); function searchNodes() { search_res = []; - for( var i = 0; i < array_length(tunnel_ins); i++ ) { + for( var i = 0, n = array_length(tunnel_ins); i < n; i++ ) { var node = tunnel_ins[i]; var key = node.inputs[| 0].getValue(0); @@ -63,7 +63,7 @@ event_inherited(); var arr = search_string == ""? tunnel_ins : search_res; tunnel_hover = noone; - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { var node = arr[i]; if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) { @@ -89,8 +89,8 @@ event_inherited(); txt = __txtx("panel_tunnel_create_tunnel", "Create tunnel"); if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, txt, THEME.tunnel) == 2) { - var n = nodeBuild("Node_Tunnel_Out", build_x, build_y); - n.inputs[| 0].setValue(key); + var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y); + _node.inputs[| 0].setValue(key); instance_destroy(); } diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index 8d2ae5515..0aeef832c 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -110,12 +110,12 @@ ANIMATION_POST = []; function __addon_preAnim() { - for( var i = 0; i < array_length(ANIMATION_PRE); i++ ) + for( var i = 0, n = array_length(ANIMATION_PRE); i < n; i++ ) ANIMATION_PRE[i](); } function __addon_postAnim() { - for( var i = 0; i < array_length(ANIMATION_POST); i++ ) + for( var i = 0, n = array_length(ANIMATION_POST); i < n; i++ ) ANIMATION_POST[i](); } #endregion @@ -146,7 +146,7 @@ if(array_length(path) == 1 && directory_exists(path[0])) type = "image"; - for( var i = 0; i < array_length(path); i++ ) { + for( var i = 0, n = array_length(path); i < n; i++ ) { var p = path[i]; var ext = string_lower(filename_ext(p)); @@ -168,7 +168,7 @@ PANEL_GRAPH.onStepBegin(); var node = noone; - for( var i = 0; i < array_length(path); i++ ) { + for( var i = 0, n = array_length(path); i < n; i++ ) { var p = path[i]; var ext = string_lower(filename_ext(p)); diff --git a/objects/o_main/Other_68.gml b/objects/o_main/Other_68.gml index ee28d65cc..12e1b70ae 100644 --- a/objects/o_main/Other_68.gml +++ b/objects/o_main/Other_68.gml @@ -3,7 +3,7 @@ var port = async_load[? "port"]; if(!ds_map_exists(PORT_MAP, port)) exit; var nodeTarget = PORT_MAP[? port]; -for( var i = 0; i < array_length(nodeTarget); i++ ) { +for( var i = 0, n = array_length(nodeTarget); i < n; i++ ) { if(is_struct(nodeTarget[i]) && nodeTarget[i].active) nodeTarget[i].asyncPackets(async_load); } \ No newline at end of file diff --git a/objects/o_main/Step_0.gml b/objects/o_main/Step_0.gml index a2e20aef7..4d1477d96 100644 --- a/objects/o_main/Step_0.gml +++ b/objects/o_main/Step_0.gml @@ -3,20 +3,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit; //print("===== Step start ====="); if(PROJECT.active) { - #region animation - if(PROJECT.animator.is_playing && PROJECT.animator.play_freeze == 0) { - PROJECT.animator.time_since_last_frame += PROJECT.animator.framerate * (delta_time / 1000000); - - if(PROJECT.animator.time_since_last_frame >= 1) - PROJECT.animator.setFrame(PROJECT.animator.real_frame + 1); - } else { - PROJECT.animator.frame_progress = false; - PROJECT.animator.setFrame(PROJECT.animator.real_frame); - PROJECT.animator.time_since_last_frame = 0; - } - - PROJECT.animator.play_freeze = max(0, PROJECT.animator.play_freeze - 1); - #endregion + PROJECT.animator.step(); #region step PROJECT.globalNode.step(); diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index c964bd827..c195d13f0 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -1,5 +1,4 @@ /// @description init -//print(PROJECT.path); global.cache_call = 0; global.cache_hit = 0; @@ -199,4 +198,4 @@ _HOVERING_ELEMENT = noone; MOUSE_WRAP = false; #endregion -//if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call}%)"); \ No newline at end of file +//if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call * 100}%)"); \ No newline at end of file diff --git a/scripts/GmlLua/GmlLua.gml b/scripts/GmlLua/GmlLua.gml index 7bf5fbcdf..1fbd6cb0e 100644 --- a/scripts/GmlLua/GmlLua.gml +++ b/scripts/GmlLua/GmlLua.gml @@ -284,7 +284,7 @@ function __initLua() { globalvar LUA_API; LUA_API = ds_map_create(); - for( var i = 0; i < array_length(global.lua_functions); i++ ) { + for( var i = 0, n = array_length(global.lua_functions); i < n; i++ ) { if(is_string(global.lua_functions[i])) continue; if(global.lua_functions[i][1] == noone) continue; LUA_API[? global.lua_functions[i][0]] = global.lua_functions[i][1]; diff --git a/scripts/VCT/VCT.gml b/scripts/VCT/VCT.gml index 50f77de09..a6ac163b1 100644 --- a/scripts/VCT/VCT.gml +++ b/scripts/VCT/VCT.gml @@ -4,7 +4,7 @@ function VCT(node) constructor { vars = []; static reset = function() { - for( var i = 0; i < array_length(vars); i++ ) + for( var i = 0, n = array_length(vars); i < n; i++ ) vars[i].set(vars[i].def_val); } @@ -19,7 +19,7 @@ function VCT(node) constructor { var s = {}; s.variables = []; - for( var i = 0; i < array_length(vars); i++ ) + for( var i = 0, n = array_length(vars); i < n; i++ ) s.variables[i] = vars[i].get(); doSerialize(s); diff --git a/scripts/_3D/_3D.gml b/scripts/_3D/_3D.gml index 00ac9ed3f..bb739082f 100644 --- a/scripts/_3D/_3D.gml +++ b/scripts/_3D/_3D.gml @@ -4,7 +4,7 @@ enum CAMERA_PROJ { } #region setup - globalvar PRIMITIVES, FORMAT_P, FORMAT_PT, FORMAT_PNT; + globalvar PRIMITIVES, FORMAT_P, FORMAT_PT, FORMAT_PNT, FORMAT_2PC; PRIMITIVES = ds_map_create(); vertex_format_begin(); @@ -21,6 +21,11 @@ enum CAMERA_PROJ { vertex_format_add_normal(); vertex_format_add_texcoord(); FORMAT_PNT = vertex_format_end(); + + vertex_format_begin(); + vertex_format_add_position(); + vertex_format_add_color(); + FORMAT_2PC = vertex_format_end(); #endregion #region 3d obj @@ -110,7 +115,7 @@ enum CAMERA_PROJ { var VB = vertex_create_buffer(); vertex_begin(VB, FORMAT_PNT); - for( var i = 0; i < array_length(faces); i++ ) { + for( var i = 0, n = array_length(faces); i < n; i++ ) { var face = faces[i]; var _pos = positions[face[0]]; var _nor = normals [face[1]]; diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index 7adeecc57..9d433084e 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -60,6 +60,10 @@ function __part(_node) constructor { anim_speed = 1; anim_end = ANIM_END_ACTION.loop; + ground = false; + ground_y = 0; + ground_bounce = 0; + static create = function(_surf, _x, _y, _life) { active = true; surf = _surf; @@ -68,6 +72,9 @@ function __part(_node) constructor { gx = 0; gy = 0; + prevx = undefined; + prevy = undefined; + life = _life; life_total = life; node.onPartCreate(self); @@ -86,6 +93,15 @@ function __part(_node) constructor { turnSpd = _turnSpd; wig = _wig; + + spVec[0] = point_distance(0, 0, speedx, speedy); + spVec[1] = point_direction(0, 0, speedx, speedy); + } + + static setGround = function(_ground, _ground_offset, _ground_bounce) { + ground = _ground; + ground_y = y + _ground_offset; + ground_bounce = _ground_bounce; } static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) { @@ -114,7 +130,12 @@ function __part(_node) constructor { static step = function() { if(!active) return; x += speedx; - y += speedy; + + if(ground && y + speedy > ground_y) { + y = ground_y; + speedy = -speedy * ground_bounce; + } else + y += speedy; var dirr = point_direction(0, 0, speedx, speedy); var diss = point_distance(0, 0, speedx, speedy); @@ -130,15 +151,15 @@ function __part(_node) constructor { } } - speedx = lengthdir_x(diss, dirr); - speedy = lengthdir_y(diss, dirr); + speedx = lengthdir_x(diss, dirr) + _gx; + speedy = lengthdir_y(diss, dirr) + _gy; - if(_gx != 0 || _gy != 0) { - gx += _gx; - gy += _gy; - x += gx; - y += gy; - } + //if(_gx != 0 || _gy != 0) { + // gx += _gx; + // gy += _gy; + // x += gx; + // y += gy; + //} if(follow) rot = spVec[1]; else rot += rot_s; @@ -147,8 +168,10 @@ function __part(_node) constructor { node.onPartStep(self); if(life-- < 0) kill(); - spVec[0] = point_distance(prevx, prevy, x, y); - spVec[1] = point_direction(prevx, prevy, x, y); + if(prevx != undefined) { + spVec[0] = point_distance(prevx, prevy, x, y); + spVec[1] = point_direction(prevx, prevy, x, y); + } prevx = x; prevy = y; diff --git a/scripts/__bone/__bone.gml b/scripts/__bone/__bone.gml index 2bd06bc49..5e8f768a1 100644 --- a/scripts/__bone/__bone.gml +++ b/scripts/__bone/__bone.gml @@ -47,7 +47,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = static childCount = function() { var amo = array_length(childs); - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) amo += childs[i].childCount(); return amo; } @@ -60,7 +60,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = direction: direction } - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].freeze(); } @@ -68,7 +68,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = if(ID == _id) return self; - for( var i = 0; i < array_length(childs); i++ ) { + for( var i = 0, n = array_length(childs); i < n; i++ ) { var b = childs[i].findBone(_id); if(b != noone) return b; @@ -82,7 +82,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = if(string_trim(name) == string_trim(_name)) return self; - for( var i = 0; i < array_length(childs); i++ ) { + for( var i = 0, n = array_length(childs); i < n; i++ ) { var b = childs[i].findBoneByName(_name); if(b != noone) return b; @@ -209,13 +209,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } } - //draw_set_color(c_red); - //for( var i = 0; i < array_length(FABRIK_result); i++ ) { - // var pt = FABRIK_result[i]; - // draw_circle(_x + pt.x * _s, _y + pt.y * _s, 16, false); - //} - - for( var i = 0; i < array_length(childs); i++ ) { + for( var i = 0, n = array_length(childs); i < n; i++ ) { var h = childs[i]._drawBone(attributes, edit, _x, _y, _s, _mx, _my, hovering, selecting); if(hover == noone && h != noone) hover = h; @@ -238,7 +232,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } } - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].drawControl(attributes); } @@ -247,7 +241,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = pose_scale = 1; pose_posit = [ 0, 0 ]; - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].resetPose(); } @@ -258,7 +252,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = static setPoseTransform = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { if(is_main) { - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].setPoseTransform(_position, _angle, _scale); return; } @@ -281,7 +275,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = angle += pose_angle; length *= pose_scale; - for( var i = 0; i < array_length(childs); i++ ) { + for( var i = 0, n = array_length(childs); i < n; i++ ) { if(childs[i].parent_anchor) childs[i].setPoseTransform(_position, pose_angle, pose_scale); else @@ -326,7 +320,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = FABRIK(bones, points, lengths, p.x, p.y); } - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].setIKconstrain(); } @@ -334,7 +328,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = static FABRIK = function(bones, points, lengths, dx, dy) { var threshold = 0.1; var _bo = array_create(array_length(points)); - for( var i = 0; i < array_length(points); i++ ) + for( var i = 0, n = array_length(points); i < n; i++ ) _bo[i] = { x: points[i].x, y: points[i].y }; var sx = points[0].x; var sy = points[0].y; @@ -346,7 +340,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = var delta = 0; var _bn = array_create(array_length(points)); - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { _bn[i] = { x: points[i].x, y: points[i].y }; delta += point_distance(_bo[i].x, _bo[i].y, _bn[i].x, _bn[i].y); } @@ -355,7 +349,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = if(++itr >= 32) break; } until(delta <= threshold); - for( var i = 0; i < array_length(points) - 1; i++ ) { + for( var i = 0, n = array_length(points) - 1; i < n; i++ ) { var bone = bones[i]; var p0 = points[i]; var p1 = points[i + 1]; @@ -394,7 +388,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = var tx = sx; var ty = sy; - for( var i = 0; i < array_length(points) - 1; i++ ) { + for( var i = 0, n = array_length(points) - 1; i < n; i++ ) { var p0 = points[i]; var p1 = points[i + 1]; var len = lengths[i]; @@ -427,7 +421,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = var _bbox = __getBBOX(); //print($"BBOX: {_bbox}") - for( var i = 0; i < array_length(childs); i++ ) { + for( var i = 0, n = array_length(childs); i < n; i++ ) { var _bbox_ch = childs[i].bbox(); //print($"BBOX ch: {_bbox_ch}") @@ -457,7 +451,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = bone.IKTarget = IKTarget == noone? "" : IKTarget.ID; bone.childs = []; - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) bone.childs[i] = childs[i].serialize(); return bone; @@ -480,7 +474,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = IKTarget = bone.IKTarget; childs = []; - for( var i = 0; i < array_length(bone.childs); i++ ) { + for( var i = 0, n = array_length(bone.childs); i < n; i++ ) { var _b = new __Bone().deserialize(bone.childs[i], node); addChild(_b); } @@ -494,7 +488,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = else if(is_string(IKTarget)) IKTarget = parent.findBone(IKTarget); - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].connect(); } @@ -507,7 +501,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = _b.IKlength = IKlength; _b.IKTarget = IKTarget == noone? "" : IKTarget.ID; - for( var i = 0; i < array_length(childs); i++ ) + for( var i = 0, n = array_length(childs); i < n; i++ ) _b.addChild(childs[i].clone()); return _b; diff --git a/scripts/__initAddon/__initAddon.gml b/scripts/__initAddon/__initAddon.gml index 221b2753f..95cf29f66 100644 --- a/scripts/__initAddon/__initAddon.gml +++ b/scripts/__initAddon/__initAddon.gml @@ -57,6 +57,6 @@ function loadAddon() { if(!file_exists(_path)) return; ADDONS_ON_START = json_load_struct(_path); - for( var i = 0; i < array_length(ADDONS_ON_START); i++ ) + for( var i = 0, n = array_length(ADDONS_ON_START); i < n; i++ ) addonTrigger(ADDONS_ON_START[i], false); } \ No newline at end of file diff --git a/scripts/__mesh/__mesh.gml b/scripts/__mesh/__mesh.gml index f66d2c47d..c81a63d7d 100644 --- a/scripts/__mesh/__mesh.gml +++ b/scripts/__mesh/__mesh.gml @@ -20,7 +20,7 @@ function Mesh() constructor { } static draw = function(_x, _y, _s) { - for( var i = 0; i < array_length(triangles); i++ ) { + for( var i = 0, n = array_length(triangles); i < n; i++ ) { var t = triangles[i]; draw_line(_x + t[0].x * _s, _y + t[0].y * _s, _x + t[1].x * _s, _y + t[1].y * _s); @@ -30,7 +30,7 @@ function Mesh() constructor { } static pointIn = function(_x, _y) { - for( var i = 0; i < array_length(triangles); i++ ) { + for( var i = 0, n = array_length(triangles); i < n; i++ ) { var t = triangles[i]; if(point_in_triangle(_x, _y, t[0].x, t[0].y, t[1].x, t[1].y, t[2].x, t[2].y)) @@ -46,7 +46,7 @@ function Mesh() constructor { var segments = []; var pointsPairs = ds_map_create(); - for( var i = 0; i < array_length(triangles); i++ ) { + for( var i = 0, n = array_length(triangles); i < n; i++ ) { var t = triangles[i]; for( var j = 0; j < 3; j++ ) { @@ -72,7 +72,7 @@ function Mesh() constructor { } } - for( var i = 0; i < array_length(segments); i++ ) { + for( var i = 0, n = array_length(segments); i < n; i++ ) { var s0 = string(segments[i][0]); var s1 = string(segments[i][1]); @@ -85,7 +85,7 @@ function Mesh() constructor { var path = [ segments[0][0], segments[0][1] ]; - for( var i = 0; i < array_length(segments); i++ ) { + for( var i = 0, n = array_length(segments); i < n; i++ ) { var end_point = path[array_length(path) - 1]; var next_point = array_pop(pointsPairs[? string(end_point) ]); @@ -100,7 +100,7 @@ function Mesh() constructor { static clone = function() { var msh = new Mesh(); - for( var i = 0; i < array_length(triangles); i++ ) { + for( var i = 0, n = array_length(triangles); i < n; i++ ) { msh.triangles[i] = [ triangles[i][0].clone(), triangles[i][1].clone(), diff --git a/scripts/__node_iterator/__node_iterator.gml b/scripts/__node_iterator/__node_iterator.gml index e329a14bc..0f3a3f360 100644 --- a/scripts/__node_iterator/__node_iterator.gml +++ b/scripts/__node_iterator/__node_iterator.gml @@ -15,9 +15,9 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) var node_list = getNodeList(); for( var i = 0; i < ds_list_size(node_list); i++ ) { - var n = node_list[| i]; - if(variable_struct_exists(n, "initLoop")) - n.initLoop(); + var _node = node_list[| i]; + if(variable_struct_exists(_node, "initLoop")) + _node.initLoop(); } doInitLoop(); @@ -79,6 +79,9 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) var maxIter = getIterationCount(); iterated++; + for( var i = 0; i < ds_list_size(nodes); i++ ) + nodes[| i].clearInputCache(); + if(iterated == maxIter) { LOG_LINE_IF(global.FLAG.render, $"------------------< Iteration update: {iterated} / {maxIter} [COMPLETE] >------------------"); render_time = get_timer() - loop_start_time; diff --git a/scripts/__path/__path.gml b/scripts/__path/__path.gml index c7dc5e371..3563bd56b 100644 --- a/scripts/__path/__path.gml +++ b/scripts/__path/__path.gml @@ -26,7 +26,7 @@ function PathSegment() : Path() constructor { var minx = segments[0].x, maxx = segments[0].x; var miny = segments[0].y, maxy = segments[0].y; - for( var i = 0; i < array_length(segments); i++ ) { + for( var i = 0, n = array_length(segments); i < n; i++ ) { var s = segments[i]; minx = min(minx, s.x); @@ -46,7 +46,7 @@ function PathSegment() : Path() constructor { lengthTotal = 0; var op, np; - for( var i = 0; i < array_length(segment); i++ ) { + for( var i = 0, n = array_length(segment); i < n; i++ ) { np = segment[i]; if(i) { diff --git a/scripts/__polygon/__polygon.gml b/scripts/__polygon/__polygon.gml index 3673b2aae..4ecff566a 100644 --- a/scripts/__polygon/__polygon.gml +++ b/scripts/__polygon/__polygon.gml @@ -94,7 +94,7 @@ function polygon_triangulate(points, tolerance = 4) { if(array_length(reflected) == 0) return polygon_triangulate_convex(points); - for( var i = 0; i < array_length(points); i++ ) + for( var i = 0, n = array_length(points); i < n; i++ ) pointInd[i] = i; var triangles = []; diff --git a/scripts/__shapes/__shapes.gml b/scripts/__shapes/__shapes.gml index f803c7999..fb40985b6 100644 --- a/scripts/__shapes/__shapes.gml +++ b/scripts/__shapes/__shapes.gml @@ -134,7 +134,7 @@ oy = ny; } - for( var i = 0; i < array_length(_seg); i++ ) + for( var i = 0, n = array_length(_seg); i < n; i++ ) array_push(segment, _seg[array_length(_seg) - i - 1]); shapes[2] = { type: SHAPE_TYPE.triangles, triangles: triangles }; diff --git a/scripts/__strandSim/__strandSim.gml b/scripts/__strandSim/__strandSim.gml index 0bbdbc73a..a19170aa7 100644 --- a/scripts/__strandSim/__strandSim.gml +++ b/scripts/__strandSim/__strandSim.gml @@ -195,7 +195,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 static store = function() { var op, np; - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { np = points[i]; if(i) { @@ -213,7 +213,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 var aa = 0; var ox, oy, nx, ny; - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { aa += restAngle[i]; if(i) { @@ -233,7 +233,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 //draw_set_color(c_lime); //var ox, oy, nx, ny; - //for( var i = 0; i < array_length(points); i++ ) { + //for( var i = 0, n = array_length(points); i < n; i++ ) { // nx = points[i].px; // ny = points[i].py; @@ -248,7 +248,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 draw_set_color(baked? c_aqua : c_blue); var ox, oy, nx, ny; - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { nx = points[i].x; ny = points[i].y; @@ -261,7 +261,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 oy = ny; } - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { nx = points[i].x; ny = points[i].y; @@ -275,7 +275,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 static set = function(sx = points[0].x, sy = points[0].y) { var ox, oy, aa = 0; - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { aa += restAngle[i]; if(i) { @@ -290,7 +290,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 oy = points[i].y; } - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { points[i].px = points[i].x; points[i].py = points[i].y; } @@ -359,7 +359,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4 set(); var s = new Strand(points[0].x, points[0].y, array_length(points), length[0], direct, curl_freq, curl_size); - for( var i = 0; i < array_length(points); i++ ) + for( var i = 0, n = array_length(points); i < n; i++ ) s.points[i] = points[i].clone(); s.restAngle = array_clone(restAngle); s.length = array_clone(length); @@ -389,22 +389,22 @@ function StrandMesh() constructor { mesh = noone; static step = function(iteration = 4) { - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) hairs[i].step(iteration); } static draw = function(_x, _y, _s, drawAngle = false, baked = false) { - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) hairs[i].draw(_x, _y, _s, drawAngle, baked); } static store = function() { - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) hairs[i].store(); } static freeze = function(fixLength = false) { - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) hairs[i].freeze(fixLength); } @@ -426,7 +426,7 @@ function StrandMesh() constructor { } static set = function() { - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) hairs[i].set(); return self; @@ -437,7 +437,7 @@ function StrandMesh() constructor { s.loop = loop; s.mesh = mesh; - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) s.hairs[i] = hairs[i].clone(); return s; @@ -445,7 +445,7 @@ function StrandMesh() constructor { static serialize = function() { var _h = []; - for( var i = 0; i < array_length(hairs); i++ ) + for( var i = 0, n = array_length(hairs); i < n; i++ ) _h[i] = hairs[i].serialize(); return json_stringify(_h); } @@ -453,7 +453,7 @@ function StrandMesh() constructor { static deserialize = function(s) { var j = json_parse(s); - for( var i = 0; i < array_length(j); i++ ) + for( var i = 0, n = array_length(j); i < n; i++ ) hairs[i] = new Strand().deserialize(j[i]); return self; } diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index 16c7eaba7..ae5d9b97e 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -97,6 +97,13 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." ); inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); + + inputs[| 37] = nodeValue("Collide ground", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); + + inputs[| 38] = nodeValue("Ground offset", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 ); + + inputs[| 39] = nodeValue("Bounce amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5 ) + .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); input_len = ds_list_size(inputs); @@ -105,6 +112,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co ["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5, ["Movement", true], 29, 6, 18, ["Physics", true], 7, 19, 33, 20, 34, 35, 36, + ["Ground", true], 37, 38, 39, ["Rotation", true], 15, 8, 9, ["Scale", true], 10, 17, 11, ["Color", true], 12, 28, 13, 14, @@ -175,6 +183,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co var _anim_speed = current_data[23]; var _anim_end = current_data[26]; + var _ground = current_data[37]; + var _ground_offset = current_data[38]; + var _ground_bounce = current_data[39]; + if(_rotation[1] < _rotation[0]) _rotation[1] += 360; var _posDist = []; @@ -266,8 +278,9 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co var _trn = random_range(_turn[0], _turn[1]); if(_turnBi) _trn *= choose(-1, 1); - + part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc); + part.setGround(_ground, _ground_offset, _ground_bounce); part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow); part.setDraw(_color, _bld, _alp, _fade); spawn_index = safe_mod(spawn_index + 1, attributes.part_amount); @@ -349,15 +362,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co static step = function() {} - static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { - inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); - if(onDrawOverlay != -1) - onDrawOverlay(active, _x, _y, _s, _mx, _my); - } - - static onDrawOverlay = -1; - - static update = function(frame = PROJECT.animator.current_frame) { + static inspectorStep = function() { var _inSurf = inputs[| 0].getValue(); var _dist = inputs[| 4].getValue(); var _scatt = inputs[| 24].getValue(); @@ -379,7 +384,17 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co inputs[| 26].setVisible(true); } } - + } + + static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { + inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); + if(onDrawOverlay != -1) + onDrawOverlay(active, _x, _y, _s, _mx, _my); + } + + static onDrawOverlay = -1; + + static update = function(frame = PROJECT.animator.current_frame) { checkPartPool(); var _spawn_type = inputs[| 16].getValue(); if(_spawn_type == 0) inputs[| 1].name = "Spawn delay"; @@ -395,4 +410,11 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co static onPartCreate = function(part) {} static onPartStep = function(part) {} static onPartDestroy = function(part) {} + + static postDeserialize = function() { + if(PROJECT.version < SAVE_VERSION) { + for( var i = 37; i <= 39; i++ ) + array_insert(load_map.inputs, i, noone); + } + } } \ No newline at end of file diff --git a/scripts/_node_strand_affector/_node_strand_affector.gml b/scripts/_node_strand_affector/_node_strand_affector.gml index 1721d43af..5c0af8b47 100644 --- a/scripts/_node_strand_affector/_node_strand_affector.gml +++ b/scripts/_node_strand_affector/_node_strand_affector.gml @@ -11,7 +11,7 @@ if(!is_array(_str)) __str = [ _str ]; \ \ for( var k = 0; k < array_length(__str); k++ ) \ - for( var i = 0; i < array_length(__str[k].hairs); i++ ) { \ + for( var i = 0, n = array_length(__str[k].hairs); i < n; i++ ) { \ var h = __str[k].hairs[i]; \ \ for( var j = 1; j < array_length(h.points); j++ ) { \ diff --git a/scripts/addon_function/addon_function.gml b/scripts/addon_function/addon_function.gml index c31c67b12..37c50bd9c 100644 --- a/scripts/addon_function/addon_function.gml +++ b/scripts/addon_function/addon_function.gml @@ -6,7 +6,7 @@ function addonContextGenerator(_addon, _function) constructor { var _items = lua_call(_addon.thread, _function); var arr = []; - for( var i = 0; i < array_length(_items); i++ ) { + for( var i = 0, n = array_length(_items); i < n; i++ ) { var _item = _items[i]; if(_item == -1) array_push(arr, -1); diff --git a/scripts/addon_lua/addon_lua.gml b/scripts/addon_lua/addon_lua.gml index 5c40a58b0..a09ab9e37 100644 --- a/scripts/addon_lua/addon_lua.gml +++ b/scripts/addon_lua/addon_lua.gml @@ -10,7 +10,7 @@ #region API function __addon_lua_setup_functions(lua) { - for( var i = 0; i < array_length(global.__lua_functions); i++ ) { + for( var i = 0, n = array_length(global.__lua_functions); i < n; i++ ) { var _func = global.__lua_functions[i]; if(is_string(_func)) @@ -864,7 +864,7 @@ var arr = variable_struct_get_names(_addon.panels); - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { if(arr[i] != panel) continue; var pane = _addon.panels[$ arr[i]]; @@ -1040,7 +1040,7 @@ end", ]; function __addon_lua_setup_widget(lua, context) { - for( var i = 0; i < array_length(global.__lua_widget_functions); i++ ) { + for( var i = 0, n = array_length(global.__lua_widget_functions); i < n; i++ ) { var _func = global.__lua_widget_functions[i]; if(is_string(_func)) diff --git a/scripts/animation_controller/animation_controller.gml b/scripts/animation_controller/animation_controller.gml index 59164e928..fa9593097 100644 --- a/scripts/animation_controller/animation_controller.gml +++ b/scripts/animation_controller/animation_controller.gml @@ -5,6 +5,8 @@ loop, stop } + + #macro ANIMATION_STATIC !(PROJECT.animator.is_playing || PROJECT.animator.frame_progress) #endregion #region animation class @@ -61,35 +63,57 @@ } static render = function() { - setFrame(-1); + setFrame(0); is_playing = true; rendering = true; frame_progress = true; + time_since_last_frame = 0; } static toggle = function() { is_playing = !is_playing; frame_progress = true; + time_since_last_frame = 0; } static pause = function() { is_playing = false; frame_progress = true; + time_since_last_frame = 0; } static play = function() { + setFrame(0); is_playing = true; frame_progress = true; + time_since_last_frame = 0; } static resume = function() { is_playing = true; frame_progress = true; + time_since_last_frame = 0; } static stop = function() { - is_playing = false; setFrame(0); + is_playing = false; + time_since_last_frame = 0; + } + + static step = function() { + if(is_playing && play_freeze == 0) { + time_since_last_frame += framerate * (delta_time / 1000000); + + if(time_since_last_frame >= 1) + setFrame(real_frame + 1); + } else { + frame_progress = false; + //setFrame(real_frame); + time_since_last_frame = 0; + } + + play_freeze = max(0, play_freeze - 1); } } #endregion \ No newline at end of file diff --git a/scripts/append_function/append_function.gml b/scripts/append_function/append_function.gml index d9f4f0490..55b8bf15c 100644 --- a/scripts/append_function/append_function.gml +++ b/scripts/append_function/append_function.gml @@ -16,7 +16,6 @@ function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) { function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) { static log = false; - APPENDING = true; UNDO_HOLDING = true; if(struct_has(_map, "version")) { @@ -33,6 +32,8 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) { var appended_list = ds_list_create(); var node_create = ds_list_create(); + APPENDING = true; + ds_queue_clear(CONNECTION_CONFLICT); ds_map_clear(APPEND_MAP); var t = current_time; diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index 60690a9b4..91f8e9bed 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -74,21 +74,26 @@ function array_get_decimal(arr, index, color = false) { } function array_exists(arr, val) { - for( var i = 0; i < array_length(arr); i++ ) { - if(isEqual(arr[i], val)) return true; - } - return false; + gml_pragma("forceinline"); + self.__temp_val = val; + + return array_any(arr, function(_val, _ind) { + return isEqual(_val, self.__temp_val); + }); } function array_empty(arr) { + gml_pragma("forceinline"); return array_length(arr) == 0; } function array_find(arr, val) { - for( var i = 0; i < array_length(arr); i++ ) { - if(isEqual(arr[i], val)) return i; - } - return -1; + gml_pragma("forceinline"); + self.__temp_val = val; + + return array_find_index(arr, function(_val, _ind) { + return isEqual(_val, self.__temp_val); + }); } function array_remove(arr, val) { @@ -109,23 +114,11 @@ function array_insert_unique(arr, ind, val) { } function array_append(arr, arr0) { - for( var i = 0; i < array_length(arr0); i++ ) + for( var i = 0, n = array_length(arr0); i < n; i++ ) array_push(arr, arr0[i]); return arr; } -function array_shuffle(arr) { - var r = array_length(arr) - 1; - for(var i = 0; i < r; i += 1) { - var j = irandom_range(i,r); - temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - - return arr; -} - function array_merge() { var arr = []; for( var i = 0; i < argument_count; i++ ) { @@ -140,7 +133,7 @@ function array_clone(arr) { return arr; var _res = []; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) _res[i] = array_clone(arr[i]); return _res; } @@ -149,7 +142,7 @@ function array_min(arr) { if(array_length(arr) == 0) return 0; var mn = arr[0]; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) mn = min(mn, arr[i]); return mn; } @@ -158,7 +151,7 @@ function array_max(arr) { if(array_length(arr) == 0) return 0; var mx = arr[0]; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) mx = max(mx, arr[i]); return mx; } @@ -188,7 +181,7 @@ function array_spread(arr, _arr = []) { return _arr; } - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) array_spread(arr[i], _arr); return _arr; diff --git a/scripts/ase_reader/ase_reader.gml b/scripts/ase_reader/ase_reader.gml index 5e6354f5e..f62bfc5e6 100644 --- a/scripts/ase_reader/ase_reader.gml +++ b/scripts/ase_reader/ase_reader.gml @@ -338,7 +338,7 @@ function read_format(bin, format, outMap) { } function read_format_array(bin, formatArr, outMap) { - for( var i = 0; i < array_length(formatArr); i++ ) { + for( var i = 0, n = array_length(formatArr); i < n; i++ ) { if(array_length(formatArr[i]) >= 4 && !formatArr[i][3](outMap)) continue; var pos = file_bin_position(bin); diff --git a/scripts/assets_data/assets_data.gml b/scripts/assets_data/assets_data.gml index c6e1bbb04..ed3e49617 100644 --- a/scripts/assets_data/assets_data.gml +++ b/scripts/assets_data/assets_data.gml @@ -47,7 +47,7 @@ var s = global.ASSET_CACHE[? key]; var valid = true; if(is_array(s)) { - for( var i = 0; i < array_length(s); i++ ) + for( var i = 0, n = array_length(s); i < n; i++ ) valid &= is_surface(s[i]); } else valid = is_surface(s); diff --git a/scripts/buttonGroup/buttonGroup.gml b/scripts/buttonGroup/buttonGroup.gml index 06129714c..60723dbc6 100644 --- a/scripts/buttonGroup/buttonGroup.gml +++ b/scripts/buttonGroup/buttonGroup.gml @@ -66,8 +66,8 @@ function buttonGroupClass(_data, _onClick) : widget() constructor { var spr = i == 0 ? buttonSpr[0] : (i == amo - 1? buttonSpr[2] : buttonSpr[1]); if(_selecting == i) { - draw_sprite_stretched(spr, 2, bx, _y, ww, _h); - draw_sprite_stretched_ext(spr, 3, bx, _y, ww, _h, COLORS._main_accent, 1); + draw_sprite_stretched(spr, 2, bx, _y, ww - !!i, _h); + draw_sprite_stretched_ext(spr, 3, bx, _y, ww - !!i, _h, COLORS._main_accent, 1); } else { buttons[i].draw(bx, _y, ww, _h, _m, spr); if(buttons[i].clicked) onClick(i); diff --git a/scripts/buttonPalette/buttonPalette.gml b/scripts/buttonPalette/buttonPalette.gml index 98112497a..536485314 100644 --- a/scripts/buttonPalette/buttonPalette.gml +++ b/scripts/buttonPalette/buttonPalette.gml @@ -86,15 +86,15 @@ function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) { draw_rectangle(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, false); } - if(c_color > -1) { - for(var i = 0; i < array_length(_pal); i++) { - if(c_color == _pal[i]) { - var _x0 = _x + safe_mod(i, col) * _gs; - var _y0 = _y + floor(i / col) * _gs; + if(c_color == -1) return; + + for(var i = 0; i < array_length(_pal); i++) { + if(c_color != _pal[i]) continue; + + var _x0 = _x + safe_mod(i, col) * _gs; + var _y0 = _y + floor(i / col) * _gs; - draw_set_color(c_white); - draw_rectangle_border(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, 2); - } - } + draw_set_color(c_white); + draw_rectangle_border(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, 2); } } diff --git a/scripts/color_loader/color_loader.gml b/scripts/color_loader/color_loader.gml index ccbc45778..97083d9b5 100644 --- a/scripts/color_loader/color_loader.gml +++ b/scripts/color_loader/color_loader.gml @@ -44,7 +44,7 @@ function _loadColor(theme = "default", replace = false) { var clrkeys = variable_struct_get_names(clrs.colors); - for( var i = 0; i < array_length(clrkeys); i++ ) { + for( var i = 0, n = array_length(clrkeys); i < n; i++ ) { var key = clrkeys[i]; var str = variable_struct_get(clrs.colors, key); @@ -52,7 +52,7 @@ function _loadColor(theme = "default", replace = false) { variable_struct_set(CDEF, key, c); } - for( var i = 0; i < array_length(defkeys); i++ ) { + for( var i = 0, n = array_length(defkeys); i < n; i++ ) { var key = defkeys[i]; var c = c_white; @@ -75,7 +75,7 @@ function _loadColor(theme = "default", replace = false) { variable_struct_set(COLORS, key, c); } - for( var i = 0; i < array_length(valkeys); i++ ) { + for( var i = 0, n = array_length(valkeys); i < n; i++ ) { var key = valkeys[i]; if(variable_struct_exists(oclr, key)) { var c = variable_struct_get(oclr, key); @@ -84,7 +84,7 @@ function _loadColor(theme = "default", replace = false) { } var arrkeys = variable_struct_get_names(clrs.array); - for( var i = 0; i < array_length(arrkeys); i++ ) { + for( var i = 0, n = array_length(arrkeys); i < n; i++ ) { var key = arrkeys[i]; var def = variable_struct_get(clrs.array, key); diff --git a/scripts/contextMenu_controller/contextMenu_controller.gml b/scripts/contextMenu_controller/contextMenu_controller.gml index a65578b55..111fae536 100644 --- a/scripts/contextMenu_controller/contextMenu_controller.gml +++ b/scripts/contextMenu_controller/contextMenu_controller.gml @@ -7,7 +7,7 @@ if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) { var callbacks = CONTEXT_MENU_CALLBACK[? menu_id]; - for( var i = 0; i < array_length(callbacks); i++ ) + for( var i = 0, n = array_length(callbacks); i < n; i++ ) array_append(menu, callbacks[i].populate()); } diff --git a/scripts/controlPointBox/controlPointBox.gml b/scripts/controlPointBox/controlPointBox.gml index 9578f093d..9224dd1d6 100644 --- a/scripts/controlPointBox/controlPointBox.gml +++ b/scripts/controlPointBox/controlPointBox.gml @@ -42,12 +42,12 @@ function controlPointBox(_onModify) : widget() constructor { static setInteract = function(interactable = noone) { self.interactable = interactable; - for( var i = 0; i < array_length(widgets); i++ ) + for( var i = 0, n = array_length(widgets); i < n; i++ ) widgets[i].setInteract(interactable); } static register = function(parent = noone) { - for( var i = 0; i < array_length(widgets); i++ ) + for( var i = 0, n = array_length(widgets); i < n; i++ ) widgets[i].register(parent); } @@ -55,7 +55,7 @@ function controlPointBox(_onModify) : widget() constructor { x = _x; y = _y; - for( var i = 0; i < array_length(widgets); i++ ) + for( var i = 0, n = array_length(widgets); i < n; i++ ) widgets[i].setFocusHover(active, hover); var yy = _y; diff --git a/scripts/debug/debug.gml b/scripts/debug/debug.gml index e4c3e5bcd..ba1d4069d 100644 --- a/scripts/debug/debug.gml +++ b/scripts/debug/debug.gml @@ -12,7 +12,7 @@ #endregion function _log_template() { - return $"{string(current_year)}/{string(current_month)}/{string(current_day)} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > "; + 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)} > "; } function __log(title, str, fname = "log/log.txt") { @@ -63,7 +63,7 @@ function exception_print(e) { var str = "\n\n========== Crash log ==========\n\n" + e.longMessage; str += "\n\n========== Stack trace ==========\n\n"; - for( var i = 0; i < array_length(e.stacktrace); i++ ) + for( var i = 0, n = array_length(e.stacktrace); i < n; i++ ) str += e.stacktrace[i] + "\n" str += "\n\n========= Crash log end =========\n"; @@ -80,7 +80,7 @@ function setException() { tt += "\n" + ex.longMessage; tt += "\n" + ex.script; tt += "\n-------------------------- STACK TRACE --------------------------\n\n"; - for( var i = 0; i < array_length(ex.stacktrace); i++ ) { + for( var i = 0, n = array_length(ex.stacktrace); i < n; i++ ) { tt += ex.stacktrace[i] + "\n"; } tt += "\n---------------------------- :( ----------------------------\n"; diff --git a/scripts/dialog_management/dialog_management.gml b/scripts/dialog_management/dialog_management.gml index 34a0954fa..e1b44d100 100644 --- a/scripts/dialog_management/dialog_management.gml +++ b/scripts/dialog_management/dialog_management.gml @@ -11,7 +11,7 @@ function dialogCall(_dia, _x = noone, _y = noone, param = {}, create = false) { dia.resetPosition(); var args = variable_struct_get_names(param); - for( var i = 0; i < array_length(args); i++ ) + for( var i = 0, n = array_length(args); i < n; i++ ) variable_instance_set(dia, args[i], variable_struct_get(param, args[i])); setFocus(dia.id, "Dialog"); diff --git a/scripts/draw_corner/draw_corner.gml b/scripts/draw_corner/draw_corner.gml index 83b6e08e7..17a2f274d 100644 --- a/scripts/draw_corner/draw_corner.gml +++ b/scripts/draw_corner/draw_corner.gml @@ -1,7 +1,14 @@ -function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = 10) { +function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = 10) { var dir0 = point_direction(x1, y1, xc, yc); var dir1 = point_direction(x3, y3, xc, yc); + var dis = point_distance(x1, y1, x3, y3); + if(dis < 8) { + draw_set_color(col); + draw_line_width(x1, y1, x3, y3, thick); + return; + } + var p2 = point_rotate(xc, yc, x1, y1, -90); var x2 = p2[0]; var y2 = p2[1]; @@ -25,16 +32,22 @@ function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = var d1 = point_direction(px, py, x3, y3); draw_set_color(col); + draw_primitive_begin(pr_trianglestrip); + var ox, oy, nx, ny; - var st = 1 / round(sample); - for( var i = 0; i <= 1; i += st ) { - var a = d0 + angle_difference(d1, d0) * i; - nx = px + lengthdir_x(r, a); - ny = py + lengthdir_y(r, a); + var aa = angle_difference(d1, d0); + sample = round(sample); + + for( var i = 0; i <= sample; i++ ) { + var a = d0 + aa * (i / sample); + nx = px + lengthdir_x(r - thick / 2, a) + 1; + ny = py + lengthdir_y(r - thick / 2, a) + 1; + ox = px + lengthdir_x(r + thick / 2, a) + 1; + oy = py + lengthdir_y(r + thick / 2, a) + 1; - if(i > 0) draw_line_round(ox, oy, nx, ny, thick, i == st, i == 1, sample); - - ox = nx; - oy = ny; + draw_vertex(nx, ny); + draw_vertex(ox, oy); } + + draw_primitive_end(); } \ No newline at end of file diff --git a/scripts/draw_line_width_vertex/draw_line_width_vertex.gml b/scripts/draw_line_width_vertex/draw_line_width_vertex.gml index facf3591b..2ac59bdae 100644 --- a/scripts/draw_line_width_vertex/draw_line_width_vertex.gml +++ b/scripts/draw_line_width_vertex/draw_line_width_vertex.gml @@ -1,6 +1,7 @@ function draw_line_width_vertex(xs, ys, xe, ye, thick, c0, c1) { - draw_primitive_begin(pr_trianglestrip); - + var vb = vertex_create_buffer(); + vertex_begin(vb, FORMAT_2PC); + // Calculate the direction and perpendicular vector of the line var dx = xe - xs; var dy = ye - ys; @@ -19,10 +20,13 @@ function draw_line_width_vertex(xs, ys, xe, ye, thick, c0, c1) { var y3 = ye - py; // Draw vertices - draw_vertex_color(x0, y0, c0, 1); - draw_vertex_color(x1, y1, c0, 1); - draw_vertex_color(x2, y2, c1, 1); - draw_vertex_color(x3, y3, c1, 1); + vertex_add_2pc(vb, x0, y0, c0); + vertex_add_2pc(vb, x1, y1, c0); + vertex_add_2pc(vb, x2, y2, c1); + vertex_add_2pc(vb, x3, y3, c1); - draw_primitive_end(); + vertex_end(vb); + vertex_freeze(vb); + + return vb; } diff --git a/scripts/draw_text_function/draw_text_function.gml b/scripts/draw_text_function/draw_text_function.gml index 064218d4e..9f418d0e5 100644 --- a/scripts/draw_text_function/draw_text_function.gml +++ b/scripts/draw_text_function/draw_text_function.gml @@ -72,7 +72,7 @@ function __draw_text_ext_transformed(_x, _y, _text, _sep, _w, sx, sy, rotation) case fa_bottom : yy = _y - hh; break; } - for( var i = 0; i < array_length(lines); i++ ) { + for( var i = 0, n = array_length(lines); i < n; i++ ) { var lw = string_width(lines[i]) * sx; switch(ha) { diff --git a/scripts/ds_list/ds_list.gml b/scripts/ds_list/ds_list.gml index 6b11e7374..de40c2862 100644 --- a/scripts/ds_list/ds_list.gml +++ b/scripts/ds_list/ds_list.gml @@ -1,6 +1,6 @@ function ds_list_create_from_array(array) { var l = ds_list_create(); - for( var i = 0; i < array_length(array); i++ ) { + for( var i = 0, n = array_length(array); i < n; i++ ) { l[| i] = array[i]; } return l; diff --git a/scripts/ds_list_queue/ds_list_queue.gml b/scripts/ds_list_queue/ds_list_queue.gml index e165e93ba..cbb30d6e9 100644 --- a/scripts/ds_list_queue/ds_list_queue.gml +++ b/scripts/ds_list_queue/ds_list_queue.gml @@ -2,7 +2,7 @@ function Queue() constructor { data = []; static enqueue = function(val) { - if(array_exists(data, val)) return self; + if(array_contains(data, val)) return self; //array_remove(data, val); array_push(data, val); @@ -25,10 +25,10 @@ function Queue() constructor { static size = function() { return array_length(data); } static empty = function() { return size() == 0; } - static toString = function() { + static toString = function() { return ""; var ss = "["; - for( var i = 0; i < array_length(data); i++ ) - ss += (i? ", " : "") + string(data[i].internalName); + for( var i = 0, n = array_length(data); i < n; i++ ) + ss += (i? ", " : "") + data[i].internalName; ss += "]" return ss; } diff --git a/scripts/event_recorder/event_recorder.gml b/scripts/event_recorder/event_recorder.gml index 4664924cf..1ab6a456c 100644 --- a/scripts/event_recorder/event_recorder.gml +++ b/scripts/event_recorder/event_recorder.gml @@ -94,7 +94,7 @@ function Action(_type, _object, _data) constructor { groupNodes(data.content, obj, false); break; case ACTION_TYPE.collection_loaded : - for( var i = 0; i < array_length(obj); i++ ) + for( var i = 0, n = array_length(obj); i < n; i++ ) nodeDelete(obj[i]); break; } @@ -156,7 +156,7 @@ function Action(_type, _object, _data) constructor { upgroupNode(obj, false); break; case ACTION_TYPE.collection_loaded : - for( var i = 0; i < array_length(obj); i++ ) + for( var i = 0, n = array_length(obj); i < n; i++ ) obj[i].restore(); break; } diff --git a/scripts/fft_functions/fft_functions.gml b/scripts/fft_functions/fft_functions.gml index e15dab283..b2b2ad302 100644 --- a/scripts/fft_functions/fft_functions.gml +++ b/scripts/fft_functions/fft_functions.gml @@ -14,11 +14,11 @@ function FFT(array_in) { } function _FFT(array_in) { - var n = array_length(array_in); - var nh = n div 2; - var theta = (2 * pi) / n; + var _n = array_length(array_in); + var nh = _n div 2; + var theta = (2 * pi) / _n; - if (n == 1) + if (_n == 1) return array_in; var even = array_create(nh, 0); @@ -34,7 +34,7 @@ function _FFT(array_in) { //print($"> {evenFFT}, {oddFFT}"); - var array_out = array_create(n); + var array_out = array_create(_n); for (var i = 0; i < nh; i++) { var t = new Complex( diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index e376443b0..bba7178f2 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -90,7 +90,7 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; VERSION = 1147; - SAVE_VERSION = 1448; + SAVE_VERSION = 1448.1; VERSION_STRING = "1.14.7"; BUILD_NUMBER = 114600; diff --git a/scripts/gradients_function/gradients_function.gml b/scripts/gradients_function/gradients_function.gml index 7ac493aee..e98e8c5c9 100644 --- a/scripts/gradients_function/gradients_function.gml +++ b/scripts/gradients_function/gradients_function.gml @@ -22,7 +22,7 @@ function gradientObject(color = c_black) constructor { static clone = function() { var g = new gradientObject(); - for( var i = 0; i < array_length(keys); i++ ) { + for( var i = 0, n = array_length(keys); i < n; i++ ) { g.keys[i] = keys[i].clone(); } g.type = type; @@ -153,7 +153,7 @@ function gradientObject(color = c_black) constructor { g.keys = []; g.type = type; - for( var i = 0; i < array_length(keys); i++ ) + for( var i = 0, n = array_length(keys); i < n; i++ ) g.keys[i] = keys[i].clone(); return g; @@ -162,7 +162,7 @@ function gradientObject(color = c_black) constructor { static serialize = function() { var s = {type}; s.keys = []; - for( var i = 0; i < array_length(keys); i++ ) + for( var i = 0, n = array_length(keys); i < n; i++ ) s.keys[i] = keys[i].serialize(); return json_stringify(s, false); @@ -177,7 +177,7 @@ function gradientObject(color = c_black) constructor { s = str; else if(is_array(str)) { keys = []; - for( var i = 0; i < array_length(str); i++ ) + for( var i = 0, n = array_length(str); i < n; i++ ) keys[i] = new gradientKey(str[i].time, str[i].value); return self; @@ -185,7 +185,7 @@ function gradientObject(color = c_black) constructor { type = s.type; keys = []; - for( var i = 0; i < array_length(s.keys); i++ ) + for( var i = 0, n = array_length(s.keys); i < n; i++ ) keys[i] = new gradientKey(s.keys[i].time, s.keys[i].value); return self; diff --git a/scripts/histogram_drawer/histogram_drawer.gml b/scripts/histogram_drawer/histogram_drawer.gml index ec95abd4d..d9ad0a883 100644 --- a/scripts/histogram_drawer/histogram_drawer.gml +++ b/scripts/histogram_drawer/histogram_drawer.gml @@ -62,7 +62,7 @@ function histogramUpdate(surface) { var sth = max(1, sh / attributes.preview_sample); for( var j = 0; j < 4; j++ ) - for( var i = 0; i < array_length(hist[0]); i++ ) { + for( var i = 0, n = array_length(hist[0]); i < n; i++ ) { hist[j][i] = 0; } diff --git a/scripts/load_function/load_function.gml b/scripts/load_function/load_function.gml index 53b3771a1..155521ed1 100644 --- a/scripts/load_function/load_function.gml +++ b/scripts/load_function/load_function.gml @@ -22,23 +22,26 @@ function TEST_PATH(path) { } function LOAD_PATH(path, readonly = false, safe_mode = false) { - for( var i = 0; i < array_length(PROJECTS); i++ ) + for( var i = 0, n = array_length(PROJECTS); i < n; i++ ) if(PROJECTS[i].path == path) return; var _PROJECT = PROJECT; PROJECT = new Project(); if(PANEL_GRAPH.project.path == "" && !PANEL_GRAPH.project.modified) { + var ind = array_find(PROJECTS, PANEL_GRAPH.project); + PROJECTS[ind] = PROJECT; + PANEL_GRAPH.setProject(PROJECT); } else { var graph = new Panel_Graph(PROJECT); PANEL_GRAPH.panel.setContent(graph, true); PANEL_GRAPH = graph; + array_push(PROJECTS, PROJECT); } var res = __LOAD_PATH(path, readonly, safe_mode); if(!res) return false; - array_push(PROJECTS, PROJECT); PANEL_ANIMATION.updatePropertyList(); setFocus(PANEL_GRAPH.panel); @@ -93,7 +96,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false log_warning("LOAD", warn); } } else { - var warn = $"File version mismatch : loading old format to Pixel Composer {string(SAVE_VERSION)}"; + var warn = $"File version mismatch : loading old format to Pixel Composer {SAVE_VERSION}"; log_warning("LOAD", warn); } @@ -220,6 +223,13 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false log_warning("LOAD, connect", exception_print(e)); } + try { + for(var i = 0; i < ds_list_size(create_list); i++) + create_list[| i].clearInputCache(); + } catch(e) { + log_warning("LOAD, connect", exception_print(e)); + } + Render(); LOADING = false; diff --git a/scripts/logger/logger.gml b/scripts/logger/logger.gml index 1c8dbc43b..a3ea58e59 100644 --- a/scripts/logger/logger.gml +++ b/scripts/logger/logger.gml @@ -2,10 +2,12 @@ global.LOG_LEVEL = 0; function LOG_BLOCK_START() { + gml_pragma("forceinline"); global.LOG_LEVEL++; } function LOG(text) { + gml_pragma("forceinline"); var s = ""; repeat(global.LOG_LEVEL - 1) s += " "; @@ -15,26 +17,29 @@ } function LOG_LINE(text) { + gml_pragma("forceinline"); LOG_BLOCK_START(); LOG(text); LOG_BLOCK_END(); } function LOG_IF(cond, text) { - if(!cond) return; - LOG(text); + gml_pragma("forceinline"); + if(cond) LOG(text); } function LOG_LINE_IF(cond, text) { - if(!cond) return; - LOG_LINE(text); + gml_pragma("forceinline"); + if(cond) LOG_LINE(text); } function LOG_BLOCK_END() { + gml_pragma("forceinline"); global.LOG_LEVEL--; } function LOG_END() { + gml_pragma("forceinline"); global.LOG_LEVEL = 0; } #endregion \ No newline at end of file diff --git a/scripts/luaHighlight/luaHighlight.gml b/scripts/luaHighlight/luaHighlight.gml index 7ea5e9689..f875810fb 100644 --- a/scripts/luaHighlight/luaHighlight.gml +++ b/scripts/luaHighlight/luaHighlight.gml @@ -3,7 +3,7 @@ var reserved = ["and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while"]; -for( var i = 0; i < array_length(reserved); i++ ) +for( var i = 0, n = array_length(reserved); i < n; i++ ) global.lua_reserved[? reserved[i]] = 1; function token_splice(str) { @@ -15,7 +15,7 @@ function token_splice(str) { do { sp = 999999; - for( var i = 0; i < array_length(tk); i++ ) { + for( var i = 0, n = array_length(tk); i < n; i++ ) { var _pos = string_pos(tk[i], ss); if(_pos != 0) sp = min(sp, _pos); } diff --git a/scripts/meta_data/meta_data.gml b/scripts/meta_data/meta_data.gml index 6c326ac52..547cb981c 100644 --- a/scripts/meta_data/meta_data.gml +++ b/scripts/meta_data/meta_data.gml @@ -129,7 +129,7 @@ function MetaDataManager() constructor { var tx = 0; var hh = line_get_height(f_p0, ui(4)); var th = hh; - for( var i = 0; i < array_length(tags); i++ ) { + for( var i = 0, n = array_length(tags); i < n; i++ ) { var ww = string_width(tags[i]) + ui(16); if(tx + ww + ui(2) > _w - ui(16)) { tx = 0; @@ -190,7 +190,7 @@ function MetaDataManager() constructor { var tx = 0; var hh = line_get_height(f_p0, ui(4)); - for( var i = 0; i < array_length(tags); i++ ) { + for( var i = 0, n = array_length(tags); i < n; i++ ) { var ww = string_width(tags[i]) + ui(16); if(tx + ww + ui(2) > _w - ui(16)) { tx = 0; diff --git a/scripts/node_3d_combine/node_3d_combine.gml b/scripts/node_3d_combine/node_3d_combine.gml index 6ad0f4392..b2ed06c5e 100644 --- a/scripts/node_3d_combine/node_3d_combine.gml +++ b/scripts/node_3d_combine/node_3d_combine.gml @@ -103,7 +103,7 @@ function Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) construc inputs = _l; var _d = []; - for( var i = 0; i < array_length(input_display_list); i++ ) { + for( var i = 0, n = array_length(input_display_list); i < n; i++ ) { var ind = input_display_list[i]; if(i < input_display_len || ind < ds_list_size(inputs)) @@ -168,7 +168,7 @@ function Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) construc inputs[| 12].setVisible(_proj); - for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { + for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) { var ind = output_display_list[i]; var _outSurf = outputs[| ind].getValue(); outputs[| ind].setValue(surface_verify(_outSurf, _dim[0], _dim[1])); diff --git a/scripts/node_3d_displace/node_3d_displace.gml b/scripts/node_3d_displace/node_3d_displace.gml index 11ed326d2..f7ebacfc7 100644 --- a/scripts/node_3d_displace/node_3d_displace.gml +++ b/scripts/node_3d_displace/node_3d_displace.gml @@ -91,7 +91,7 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou _3d_local_transform(_lpos, _lrot, _lsca); - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].submit(); _3d_clear_local_transform(); @@ -130,11 +130,11 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou if(_output_index == 0 && attributes.auto_update) { var _vert = _data[11]; - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].destroy(); vertexObjects = []; - for( var i = 0; i < array_length(_vert); i++ ) { + for( var i = 0, n = array_length(_vert); i < n; i++ ) { var v = _vert[i].clone(false); for( var j = 0; j < array_length(v.faces); j++ ) { @@ -175,7 +175,7 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou var _cam = new __3d_camera(_proj, _fov); _outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass); - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].submit(); _3d_post_setup(); diff --git a/scripts/node_3d_export/node_3d_export.gml b/scripts/node_3d_export/node_3d_export.gml index 4df5c2f5f..e65d76a77 100644 --- a/scripts/node_3d_export/node_3d_export.gml +++ b/scripts/node_3d_export/node_3d_export.gml @@ -37,7 +37,7 @@ function Node_3D_Export(_x, _y, _group = noone) : Node(_x, _y, _group) construct file_text_write_string(fObj, "mtllib " + filename_name(mPath) + "\n"); - for( var i = 0; i < array_length(vert); i++ ) { + for( var i = 0, n = array_length(vert); i < n; i++ ) { file_text_write_string(fObj, "\n"); var v = vert[i]; diff --git a/scripts/node_3d_extrude/node_3d_extrude.gml b/scripts/node_3d_extrude/node_3d_extrude.gml index 0a811be4b..94b4caef7 100644 --- a/scripts/node_3d_extrude/node_3d_extrude.gml +++ b/scripts/node_3d_extrude/node_3d_extrude.gml @@ -111,7 +111,7 @@ function Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group var _ins = inputs[| 0].getValue(); if(!is_array(_ins)) _ins = [ _ins ]; - for( var i = 0; i < array_length(vertexObjects); i++ ) { + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) { if(vertexObjects[i] == noone) continue; vertexObjects[i].destroy(); } diff --git a/scripts/node_3d_obj/node_3D_obj.gml b/scripts/node_3d_obj/node_3D_obj.gml index 8d65f0ac7..32772d04a 100644 --- a/scripts/node_3d_obj/node_3D_obj.gml +++ b/scripts/node_3d_obj/node_3D_obj.gml @@ -250,7 +250,7 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor inputs[| 16].setVisible(_proj == 1); - for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { + for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) { var ind = output_display_list[i]; var _outSurf = outputs[| ind].getValue(); diff --git a/scripts/node_3d_plane/node_3d_plane.gml b/scripts/node_3d_plane/node_3d_plane.gml index 9e5e2a147..a4fea0cc1 100644 --- a/scripts/node_3d_plane/node_3d_plane.gml +++ b/scripts/node_3d_plane/node_3d_plane.gml @@ -69,7 +69,7 @@ function Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) _3d_node_init(0, /*Transform*/ 1, 3, 6, 2, 7); static generate_vb = function() { - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].destroy(); vertexObjects = []; diff --git a/scripts/node_3d_prim_cone/node_3d_prim_cone.gml b/scripts/node_3d_prim_cone/node_3d_prim_cone.gml index f70d0e522..70fe5ec27 100644 --- a/scripts/node_3d_prim_cone/node_3d_prim_cone.gml +++ b/scripts/node_3d_prim_cone/node_3d_prim_cone.gml @@ -79,7 +79,7 @@ function Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c static generate_vb = function() { var _ox, _oy, _nx, _ny, _ou, _nu; - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].destroy(); vertexObjects = []; diff --git a/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml b/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml index c9d256f74..c7fe02425 100644 --- a/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml +++ b/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml @@ -87,7 +87,7 @@ function Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou static generate_vb = function() { var _ox, _oy, _nx, _ny, _ou, _nu; - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].destroy(); vertexObjects = []; diff --git a/scripts/node_3d_prim_sphere/node_3d_prim_sphere.gml b/scripts/node_3d_prim_sphere/node_3d_prim_sphere.gml index e81314f9f..4a5f31267 100644 --- a/scripts/node_3d_prim_sphere/node_3d_prim_sphere.gml +++ b/scripts/node_3d_prim_sphere/node_3d_prim_sphere.gml @@ -78,7 +78,7 @@ function Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) static generate_vb = function() { var _ox, _oy, _nx, _ny, _ou, _nu; - for( var i = 0; i < array_length(vertexObjects); i++ ) + for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) vertexObjects[i].destroy(); vertexObjects = []; diff --git a/scripts/node_3d_render/node_3d_render.gml b/scripts/node_3d_render/node_3d_render.gml index d377adfda..741561db3 100644 --- a/scripts/node_3d_render/node_3d_render.gml +++ b/scripts/node_3d_render/node_3d_render.gml @@ -205,7 +205,7 @@ // inputs[| 16].setVisible(_proj == 1); -// for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { +// for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) { // var ind = output_display_list[i]; // var _outSurf = outputs[| ind].getValue(); diff --git a/scripts/node_3d_repeat/node_3d_repeat.gml b/scripts/node_3d_repeat/node_3d_repeat.gml index 396e7097f..c837c11ba 100644 --- a/scripts/node_3d_repeat/node_3d_repeat.gml +++ b/scripts/node_3d_repeat/node_3d_repeat.gml @@ -183,7 +183,7 @@ function Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) construct var _patt = inputs[| 16].getValue(); - for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { + for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) { var ind = output_display_list[i]; var _outSurf = outputs[| ind].getValue(); diff --git a/scripts/node_3d_transform/node_3d_transform.gml b/scripts/node_3d_transform/node_3d_transform.gml index 40d8d7534..969cef3c8 100644 --- a/scripts/node_3d_transform/node_3d_transform.gml +++ b/scripts/node_3d_transform/node_3d_transform.gml @@ -78,7 +78,7 @@ function Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro _3d_local_transform(_lpos, _lrot, _lsca); if(is_array(sv)) { - for( var i = 0; i < array_length(sv); i++ ) + for( var i = 0, n = array_length(sv); i < n; i++ ) sv[i](i); } else sv(); diff --git a/scripts/node_9slice/node_9slice.gml b/scripts/node_9slice/node_9slice.gml index 7e919d35b..a9dc98362 100644 --- a/scripts/node_9slice/node_9slice.gml +++ b/scripts/node_9slice/node_9slice.gml @@ -36,7 +36,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co var _dim = current_data[1]; var _splice = current_data[2]; - for( var i = 0; i < array_length(_splice); i++ ) + for( var i = 0, n = array_length(_splice); i < n; i++ ) _splice[i] = round(_splice[i]); var sp_r = _x + (_dim[0] - _splice[0]) * _s; diff --git a/scripts/node_FFT/node_FFT.gml b/scripts/node_FFT/node_FFT.gml index 0dee47820..0c3280f8b 100644 --- a/scripts/node_FFT/node_FFT.gml +++ b/scripts/node_FFT/node_FFT.gml @@ -34,7 +34,7 @@ function Node_FFT(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const var _res = FFT(_cmp); var _r = array_create(array_length(_res)); - for( var i = 0; i < array_length(_res); i++ ) + for( var i = 0, n = array_length(_res); i < n; i++ ) _r[i] = sqrt(sqr(_res[i].re) + sqr(_res[i].im)); return _r; diff --git a/scripts/node_VFX_effector/node_VFX_effector.gml b/scripts/node_VFX_effector/node_VFX_effector.gml index 20e3c927a..28a49be32 100644 --- a/scripts/node_VFX_effector/node_VFX_effector.gml +++ b/scripts/node_VFX_effector/node_VFX_effector.gml @@ -151,7 +151,7 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(!is_array(val) || array_length(val) == 0) return; if(!is_array(val[0])) val = [ val ]; - for( var i = 0; i < array_length(val); i++ ) + for( var i = 0, n = array_length(val); i < n; i++ ) for( var j = 0; j < array_length(val[i]); j++ ) { affect(val[i][j]); } diff --git a/scripts/node_VFX_override/node_VFX_override.gml b/scripts/node_VFX_override/node_VFX_override.gml index 8bf391317..6a6476962 100644 --- a/scripts/node_VFX_override/node_VFX_override.gml +++ b/scripts/node_VFX_override/node_VFX_override.gml @@ -40,7 +40,7 @@ function Node_VFX_Override(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _alp = inputs[| 5].getValue(); var _srf = inputs[| 6].getValue(); - for( var i = 0; i < array_length(parts); i++ ) { + for( var i = 0, n = array_length(parts); i < n; i++ ) { var part = parts[i]; if(is_array(_pos) && array_length(_pos) > i && is_array(_pos[i])) { diff --git a/scripts/node_VFX_spawner/node_VFX_spawner.gml b/scripts/node_VFX_spawner/node_VFX_spawner.gml index bbc4fd8dd..6380c28ef 100644 --- a/scripts/node_VFX_spawner/node_VFX_spawner.gml +++ b/scripts/node_VFX_spawner/node_VFX_spawner.gml @@ -31,7 +31,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y return; } else { var _parts = []; - for( var i = 0; i < array_length(parts); i++ ) { + for( var i = 0, n = array_length(parts); i < n; i++ ) { if(!parts[i].active) continue; array_push(_parts, parts[i]); } diff --git a/scripts/node_VFX_variable/node_VFX_variable.gml b/scripts/node_VFX_variable/node_VFX_variable.gml index 418540068..c18ec3460 100644 --- a/scripts/node_VFX_variable/node_VFX_variable.gml +++ b/scripts/node_VFX_variable/node_VFX_variable.gml @@ -53,7 +53,7 @@ function Node_VFX_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) constr for( var i = 0; i < ds_list_size(outputs); i++ ) _val[i] = array_create(array_length(parts)); - for( var i = 0; i < array_length(parts); i++ ) { + for( var i = 0, n = array_length(parts); i < n; i++ ) { var part = parts[i]; if(outputs[| 0].visible) _val[0][i] = [part.x, part.y]; diff --git a/scripts/node_align_functions/node_align_functions.gml b/scripts/node_align_functions/node_align_functions.gml index 9f08f2509..a3937d40b 100644 --- a/scripts/node_align_functions/node_align_functions.gml +++ b/scripts/node_align_functions/node_align_functions.gml @@ -79,8 +79,8 @@ function node_hdistribute(nodeList) { var sp = (x1 - x0) / (amo - 1); for( var i = 0; i < amo; i++ ) { - var n = ds_priority_delete_min(nodes); - n.x = x0 + sp * i - n.w / 2; + var _node = ds_priority_delete_min(nodes); + _node.x = x0 + sp * i - _node.w / 2; } ds_priority_destroy(nodes); @@ -103,8 +103,8 @@ function node_vdistribute(nodeList) { var sp = (y1 - y0) / (amo - 1); for( var i = 0; i < amo; i++ ) { - var n = ds_priority_delete_min(nodes); - n.y = y0 + sp * i - n.h / 2; + var _node = ds_priority_delete_min(nodes); + _node.y = y0 + sp * i - _node.h / 2; } ds_priority_destroy(nodes); diff --git a/scripts/node_armature/node_armature.gml b/scripts/node_armature/node_armature.gml index a6b91c48a..c4371941f 100644 --- a/scripts/node_armature/node_armature.gml +++ b/scripts/node_armature/node_armature.gml @@ -38,7 +38,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo var __x = _st[1]; var __w = _st[2]; - for( var i = 0; i < array_length(bone.childs); i++ ) + for( var i = 0, n = array_length(bone.childs); i < n; i++ ) ds_stack_push(_bst, [ bone.childs[i], __x + 16, __w - 16 ]); if(bone.is_main) continue; @@ -88,7 +88,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo var _par = bone_remove.parent; array_remove(_par.childs, bone_remove); - for( var i = 0; i < array_length(bone_remove.childs); i++ ) { + for( var i = 0, n = array_length(bone_remove.childs); i < n; i++ ) { var _ch = bone_remove.childs[i]; _par.addChild(_ch); @@ -193,7 +193,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_bone.length = point_distance( bn.x, bn.y, bo.x, bo.y); } else if(builder_type == 1) { var chs = []; - for( var i = 0; i < array_length(builder_bone.childs); i++ ) { + for( var i = 0, n = array_length(builder_bone.childs); i < n; i++ ) { var ch = builder_bone.childs[i]; chs[i] = ch.getPoint(1); } @@ -201,7 +201,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_bone.angle = dir; builder_bone.length = dis; - for( var i = 0; i < array_length(builder_bone.childs); i++ ) { + for( var i = 0, n = array_length(builder_bone.childs); i < n; i++ ) { var ch = builder_bone.childs[i]; var c0 = ch.getPoint(0); @@ -357,7 +357,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo while(!ds_stack_empty(_bst)) { var __b = ds_stack_pop(_bst); - for( var i = 0; i < array_length(__b.childs); i++ ) + for( var i = 0, n = array_length(__b.childs); i < n; i++ ) ds_stack_push(_bst, __b.childs[i]); __b.distance *= _ss; @@ -406,7 +406,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo var _md = new __Bone(noone, 0, 0, _pr.angle, _pr.length / 2, self); _pr.length = _md.length; - for( var i = 0; i < array_length(_pr.childs); i++ ) + for( var i = 0, n = array_length(_pr.childs); i < n; i++ ) _md.addChild(_pr.childs[i]); _pr.childs = []; @@ -432,7 +432,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo array_remove(_par.childs, _bone); - for( var i = 0; i < array_length(_bone.childs); i++ ) { + for( var i = 0, n = array_length(_bone.childs); i < n; i++ ) { var _ch = _bone.childs[i]; _par.addChild(_ch); @@ -523,7 +523,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo while(!ds_stack_empty(_bst)) { var __b = ds_stack_pop(_bst); - for( var i = 0; i < array_length(__b.childs); i++ ) { + for( var i = 0, n = array_length(__b.childs); i < n; i++ ) { var p0 = __b.childs[i].getPoint(0); var p1 = __b.childs[i].getPoint(1); diff --git a/scripts/node_armature_bind/node_armature_bind.gml b/scripts/node_armature_bind/node_armature_bind.gml index a7b994bd9..6e92a3deb 100644 --- a/scripts/node_armature_bind/node_armature_bind.gml +++ b/scripts/node_armature_bind/node_armature_bind.gml @@ -109,7 +109,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var __x = _st[1]; var __w = _st[2]; - for( var i = 0; i < array_length(_bone.childs); i++ ) + for( var i = 0, n = array_length(_bone.childs); i < n; i++ ) ds_stack_push(_bst, [ _bone.childs[i], __x + 16, __w - 16 ]); if(_bone.is_main) continue; @@ -130,7 +130,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var _sx = __x + 24 + string_width(_bone.name) + 8; var _sy = ty + 4; - for( var i = 0; i < array_length(_sdata); i++ ) { + for( var i = 0, n = array_length(_sdata); i < n; i++ ) { var _sid = _sdata[i][0]; var _surf = _sdata[i][1]; var _sw = surface_get_width(_surf); @@ -461,7 +461,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr while(!ds_stack_empty(_bst)) { var _bone = ds_stack_pop(_bst); - for( var i = 0; i < array_length(_bone.childs); i++ ) { + for( var i = 0, n = array_length(_bone.childs); i < n; i++ ) { var child_bone = _bone.childs[i]; boneMap[? child_bone.ID] = child_bone; ds_stack_push(_bst, child_bone); diff --git a/scripts/node_armature_pose/node_armature_pose.gml b/scripts/node_armature_pose/node_armature_pose.gml index 0b9d178b4..5d469da66 100644 --- a/scripts/node_armature_pose/node_armature_pose.gml +++ b/scripts/node_armature_pose/node_armature_pose.gml @@ -59,7 +59,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const while(!ds_stack_empty(_bst)) { var __b = ds_stack_pop(_bst); - for( var i = 0; i < array_length(__b.childs); i++ ) { + for( var i = 0, n = array_length(__b.childs); i < n; i++ ) { array_push(_bones, __b.childs[i]); ds_stack_push(_bst, __b.childs[i]); } @@ -76,7 +76,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const input_display_list[1] ]; - for( var i = 0; i < array_length(_bones); i++ ) { + for( var i = 0, n = array_length(_bones); i < n; i++ ) { var bone = _bones[i]; var _idx = ds_list_size(_inputs); array_push(_input_display_list, _idx); @@ -264,7 +264,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const bone.pose_scale = _trn[TRANSFORM.sca_x]; } - for( var i = 0; i < array_length(bone.childs); i++ ) + for( var i = 0, n = array_length(bone.childs); i < n; i++ ) ds_stack_push(_bst, bone.childs[i]); } @@ -287,7 +287,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const while(!ds_stack_empty(_bst)) { var __b = ds_stack_pop(_bst); - for( var i = 0; i < array_length(__b.childs); i++ ) { + for( var i = 0, n = array_length(__b.childs); i < n; i++ ) { var p0 = __b.childs[i].getPoint(0); var p1 = __b.childs[i].getPoint(1); diff --git a/scripts/node_armature_to_path/node_armature_to_path.gml b/scripts/node_armature_to_path/node_armature_to_path.gml index 2f59eaff3..703796660 100644 --- a/scripts/node_armature_to_path/node_armature_to_path.gml +++ b/scripts/node_armature_to_path/node_armature_to_path.gml @@ -100,7 +100,7 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const current_length += point_distance(_p0.x, _p0.y, _p1.x, _p1.y); } - for( var i = 0; i < array_length(bone.childs); i++ ) { + for( var i = 0, n = array_length(bone.childs); i < n; i++ ) { var child_bone = bone.childs[i]; ds_stack_push(_bst, child_bone); } diff --git a/scripts/node_array_get/node_array_get.gml b/scripts/node_array_get/node_array_get.gml index ccecc7eaa..4e5d4ee27 100644 --- a/scripts/node_array_get/node_array_get.gml +++ b/scripts/node_array_get/node_array_get.gml @@ -64,7 +64,7 @@ function Node_Array_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construct var res = is_array(index)? array_create(array_length(index)) : 0; if(is_array(index)) { - for( var i = 0; i < array_length(index); i++ ) + for( var i = 0, n = array_length(index); i < n; i++ ) res[i] = getArray(_arr, index[i], _ovf); } else res = getArray(_arr, index, _ovf); diff --git a/scripts/node_array_insert/node_array_insert.gml b/scripts/node_array_insert/node_array_insert.gml index 2527d8619..417ebe549 100644 --- a/scripts/node_array_insert/node_array_insert.gml +++ b/scripts/node_array_insert/node_array_insert.gml @@ -43,7 +43,7 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constr var arr = array_clone(_arr); if(is_array(index)) { if(!is_array(value)) value = [ value ]; - for( var i = 0; i < array_length(index); i++ ) { + for( var i = 0, n = array_length(index); i < n; i++ ) { if(index[i] < 0) index[i] = array_length(arr) - 1 + index[i]; array_insert(arr, index[i], array_safe_get(value, i,, ARRAY_OVERFLOW.loop)); } @@ -51,7 +51,7 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(index < 0) index = array_length(arr) + index; if(is_array(value) && spred) { - for( var i = 0; i < array_length(value); i++ ) + for( var i = 0, n = array_length(value); i < n; i++ ) array_insert(arr, index + i, value[i]); } else { array_insert(arr, index, value); diff --git a/scripts/node_array_remove/node_array_remove.gml b/scripts/node_array_remove/node_array_remove.gml index 57a1ce15b..3c47f40ad 100644 --- a/scripts/node_array_remove/node_array_remove.gml +++ b/scripts/node_array_remove/node_array_remove.gml @@ -58,14 +58,14 @@ function Node_Array_Remove(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(!is_array(index)) index = [ index ]; array_sort(index, false); - for( var i = 0; i < array_length(index); i++ ) { + for( var i = 0, n = array_length(index); i < n; i++ ) { if(index[i] < 0) index[i] = array_length(arr) + index[i]; array_delete(arr, index[i], 1); } } else { if(!spred || !is_array(value)) value = [ value ]; - for( var i = 0; i < array_length(value); i++ ) + for( var i = 0, n = array_length(value); i < n; i++ ) array_remove(arr, value[i]); } diff --git a/scripts/node_array_set/node_array_set.gml b/scripts/node_array_set/node_array_set.gml index a24deb309..d09427f81 100644 --- a/scripts/node_array_set/node_array_set.gml +++ b/scripts/node_array_set/node_array_set.gml @@ -39,7 +39,7 @@ function Node_Array_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct var arr = array_clone(_arr); if(is_array(index)) { if(!is_array(value)) value = [ value ]; - for( var i = 0; i < array_length(index); i++ ) { + for( var i = 0, n = array_length(index); i < n; i++ ) { if(index[i] < 0) index[i] = array_length(arr) + index[i]; array_safe_set(arr, index[i], array_safe_get(value, i,, ARRAY_OVERFLOW.loop)); } diff --git a/scripts/node_array_shift/node_array_shift.gml b/scripts/node_array_shift/node_array_shift.gml index 47140e5e4..5884e6355 100644 --- a/scripts/node_array_shift/node_array_shift.gml +++ b/scripts/node_array_shift/node_array_shift.gml @@ -29,7 +29,7 @@ function Node_Array_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) constru } var arr = []; - for( var i = 0; i < array_length(_arr); i++ ) + for( var i = 0, n = array_length(_arr); i < n; i++ ) arr[i] = array_safe_get(_arr, i - _shf,, ARRAY_OVERFLOW.loop); outputs[| 0].setValue(arr); diff --git a/scripts/node_array_sort/node_array_sort.gml b/scripts/node_array_sort/node_array_sort.gml index e6dd16562..b57b292fb 100644 --- a/scripts/node_array_sort/node_array_sort.gml +++ b/scripts/node_array_sort/node_array_sort.gml @@ -33,13 +33,13 @@ function Node_Array_Sort(_x, _y, _group = noone) : Node(_x, _y, _group) construc } var _arr = []; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) _arr[i] = [ i, arr[i] ]; array_sort(_arr, asc? sortAcs : sortDes); var res = [ [], [] ]; - for( var i = 0; i < array_length(_arr); i++ ) { + for( var i = 0, n = array_length(_arr); i < n; i++ ) { res[0][i] = _arr[i][0]; res[1][i] = _arr[i][1]; } diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index 42ce821ea..fd1e6555e 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -54,7 +54,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const var _vis = attributes.layer_visible; draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1); - for( var i = 0; i < array_length(layers); i++ ) { + for( var i = 0, n = array_length(layers); i < n; i++ ) { var _yy = _y + 8 + i * hh; var _layer = layers[i]; @@ -113,7 +113,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const } } - for( var i = 0; i < array_length(tags); i++ ) { + for( var i = 0, n = array_length(tags); i < n; i++ ) { var _yy = by + lb_h + 8 + i * hh; var tag = tags[i]; @@ -184,7 +184,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const var ny = y - nh; var lvs = []; - for( var i = 0; i < array_length(layers); i++ ) { + for( var i = 0, n = array_length(layers); i < n; i++ ) { var _layer = layers[i]; var _name = _layer.name; var _node = noone; @@ -227,7 +227,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const var vis = attributes.layer_visible; var frames = content[? "Frames"]; - for( var i = 0; i < array_length(frames); i++ ) { + for( var i = 0, n = array_length(frames); i < n; i++ ) { var frame = frames[i]; var chunks = frame[? "Chunks"]; @@ -301,7 +301,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const if(ds_map_empty(content)) return; var tag = noone; - for( var i = 0; i < array_length(tags); i++ ) { + for( var i = 0, n = array_length(tags); i < n; i++ ) { if(tags[i][? "Name"] == current_tag) { tag = tags[i]; break; @@ -326,7 +326,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const surface_set_target(surf); DRAW_CLEAR - for( var i = 0; i < array_length(layers); i++ ) { + for( var i = 0, n = array_length(layers); i < n; i++ ) { layers[i].tag = tag; var cel = layers[i].getCel(PROJECT.animator.current_frame - _tag_delay); if(!cel) continue; diff --git a/scripts/node_ase_layer/node_ase_layer.gml b/scripts/node_ase_layer/node_ase_layer.gml index d7094429b..d9390a526 100644 --- a/scripts/node_ase_layer/node_ase_layer.gml +++ b/scripts/node_ase_layer/node_ase_layer.gml @@ -26,7 +26,7 @@ function Node_ASE_layer(_x, _y, _group = noone) : Node(_x, _y, _group) construct var layer_index = 0; layer_object = noone; - for( var i = 0; i < array_length(data.layers); i++ ) { + for( var i = 0, n = array_length(data.layers); i < n; i++ ) { if(data.layers[i].name != display_name) continue; layer_object = data.layers[i]; diff --git a/scripts/node_atlas_draw/node_atlas_draw.gml b/scripts/node_atlas_draw/node_atlas_draw.gml index 40453073e..074e319b4 100644 --- a/scripts/node_atlas_draw/node_atlas_draw.gml +++ b/scripts/node_atlas_draw/node_atlas_draw.gml @@ -27,7 +27,7 @@ function Node_Atlas_Draw(_x, _y, _group = noone) : Node(_x, _y, _group) construc outputs[| 0].setValue(outSurf); surface_set_shader(outSurf,,, BLEND.alpha); - for( var i = 0; i < array_length(atl); i++ ) { + for( var i = 0, n = array_length(atl); i < n; i++ ) { shader_set_interpolation(atl[i].surface.get()) atl[i].draw(); } diff --git a/scripts/node_atlas_get/node_atlas_get.gml b/scripts/node_atlas_get/node_atlas_get.gml index c1fd6e617..475a85b81 100644 --- a/scripts/node_atlas_get/node_atlas_get.gml +++ b/scripts/node_atlas_get/node_atlas_get.gml @@ -41,7 +41,7 @@ function Node_Atlas_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construct var blns = []; var alph = []; - for( var i = 0; i < array_length(atl); i++ ) { + for( var i = 0, n = array_length(atl); i < n; i++ ) { surf[i] = atl[i].surface.get(); posi[i] = atl[i].position; rota[i] = atl[i].rotation; diff --git a/scripts/node_atlas_set/node_atlas_set.gml b/scripts/node_atlas_set/node_atlas_set.gml index 35f0277d2..c4d2ef46f 100644 --- a/scripts/node_atlas_set/node_atlas_set.gml +++ b/scripts/node_atlas_set/node_atlas_set.gml @@ -48,7 +48,7 @@ function Node_Atlas_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct var natl = []; - for( var i = 0; i < array_length(atl); i++ ) { + for( var i = 0, n = array_length(atl); i < n; i++ ) { natl[i] = atl[i].clone(); if(use[1]) natl[i].surface.set(array_safe_get(surf, i)); diff --git a/scripts/node_attributes/node_attributes.gml b/scripts/node_attributes/node_attributes.gml index 3ef7ac17f..9ece0aa3b 100644 --- a/scripts/node_attributes/node_attributes.gml +++ b/scripts/node_attributes/node_attributes.gml @@ -36,7 +36,7 @@ global.SURFACE_FORMAT = []; global.SURFACE_FORMAT_NAME = []; - for( var i = 0; i < array_length(surface_format); i++ ) { + for( var i = 0, n = array_length(surface_format); i < n; i++ ) { var sup = surface_format_is_supported(surface_format[i]); array_push(global.SURFACE_FORMAT, surface_format[i]); array_push(global.SURFACE_FORMAT_NAME, (sup? "" : "-") + surface_format_name[i]); diff --git a/scripts/node_audio_window/node_audio_window.gml b/scripts/node_audio_window/node_audio_window.gml index 9513eb9e9..a71cafa94 100644 --- a/scripts/node_audio_window/node_audio_window.gml +++ b/scripts/node_audio_window/node_audio_window.gml @@ -28,7 +28,7 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr var res = []; var off = frame / PROJECT.animator.framerate * sam; - for( var i = 0; i < array_length(_arr); i++ ) { + for( var i = 0, n = array_length(_arr); i < n; i++ ) { var _dat = _arr[i]; res[i] = []; array_copy(res[i], 0, _dat, off, siz); diff --git a/scripts/node_canvas/node_canvas.gml b/scripts/node_canvas/node_canvas.gml index 05c285a0e..1890c6ccf 100644 --- a/scripts/node_canvas/node_canvas.gml +++ b/scripts/node_canvas/node_canvas.gml @@ -675,11 +675,18 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor if(key_mod_press(SHIFT)) draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush); else draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush); - } + } else + draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush); } else if(isUsingTool("Rectangle")) { - if(mouse_holding) draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool("Rectangle", 1), _brush); + if(mouse_holding) + draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool("Rectangle", 1), _brush); + else + draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush); } else if(isUsingTool("Ellipse")) { - if(mouse_holding) draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool("Ellipse", 1), _brush); + if(mouse_holding) + draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool("Ellipse", 1), _brush); + else + draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush); } surface_reset_shader(); diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 2401ea27b..d8fa6be7f 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -264,12 +264,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc var node_list = getNodeList(); for(var i = 0; i < ds_list_size(node_list); i++) { - var n = node_list[| i]; - n.stepBegin(); - if(!n.use_cache) continue; + var _node = node_list[| i]; + _node.stepBegin(); + if(!_node.use_cache) continue; use_cache = true; - if(!array_safe_get(n.cache_result, PROJECT.animator.current_frame)) + if(!array_safe_get(_node.cache_result, PROJECT.animator.current_frame)) array_safe_set(cache_result, PROJECT.animator.current_frame, false); } diff --git a/scripts/node_color_adjustment/node_color_adjustment.gml b/scripts/node_color_adjustment/node_color_adjustment.gml index 02ee38128..e3747e4ed 100644 --- a/scripts/node_color_adjustment/node_color_adjustment.gml +++ b/scripts/node_color_adjustment/node_color_adjustment.gml @@ -107,7 +107,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro if(_type == 1) { if(!is_array(_col)) _col = [ _col ]; - for( var i = 0; i < array_length(_col); i++ ) { + for( var i = 0, n = array_length(_col); i < n; i++ ) { var _c = _col[i]; var r = color_get_red(_c) / 255; diff --git a/scripts/node_color_data/node_color_data.gml b/scripts/node_color_data/node_color_data.gml index 9ea5b29db..0aea0502e 100644 --- a/scripts/node_color_data/node_color_data.gml +++ b/scripts/node_color_data/node_color_data.gml @@ -20,28 +20,28 @@ function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group outputs[| 6] = nodeValue("Brightness", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0); function process_data(_output, _data, _output_index, _array_index = 0) { - var c = _data[0]; - var n = _data[1]; + var _c = _data[0]; + var _n = _data[1]; var val = 0; switch(_output_index) { - case 0 : val = color_get_red(c); break; - case 1 : val = color_get_green(c); break; - case 2 : val = color_get_blue(c); break; + case 0 : val = color_get_red(_c); break; + case 1 : val = color_get_green(_c); break; + case 2 : val = color_get_blue(_c); break; - case 3 : val = color_get_hue(c); break; - case 4 : val = color_get_saturation(c); break; - case 5 : val = color_get_value(c); break; + case 3 : val = color_get_hue(_c); break; + case 4 : val = color_get_saturation(_c); break; + case 5 : val = color_get_value(_c); break; case 6 : - var r = color_get_red(c); - var g = color_get_green(c); - var b = color_get_blue(c); + var r = color_get_red(_c); + var g = color_get_green(_c); + var b = color_get_blue(_c); val = 0.2126 * r + 0.7152 * g + 0.0722 * b; break; } - return n? val / 255 : val; + return _n? val / 255 : val; } PATCH_STATIC diff --git a/scripts/node_color_replacement/node_color_replacement.gml b/scripts/node_color_replacement/node_color_replacement.gml index 2f84827cc..53f004c1d 100644 --- a/scripts/node_color_replacement/node_color_replacement.gml +++ b/scripts/node_color_replacement/node_color_replacement.gml @@ -137,7 +137,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g var _pall = ds_map_create(); - for( var i = 0; i < array_length(_surf); i++ ) { + for( var i = 0, n = array_length(_surf); i < n; i++ ) { var ww = surface_get_width(_surf[i]); var hh = surface_get_height(_surf[i]); diff --git a/scripts/node_crop/node_crop.gml b/scripts/node_crop/node_crop.gml index b07d1a650..238e94a73 100644 --- a/scripts/node_crop/node_crop.gml +++ b/scripts/node_crop/node_crop.gml @@ -31,7 +31,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons var _inSurf = current_data[0]; var _splice = current_data[1]; - for( var i = 0; i < array_length(_splice); i++ ) + for( var i = 0, n = array_length(_splice); i < n; i++ ) _splice[i] = round(_splice[i]); var dim = [ surface_get_width(_inSurf), surface_get_height(_inSurf) ] diff --git a/scripts/node_crop_content/node_crop_content.gml b/scripts/node_crop_content/node_crop_content.gml index a594897bb..088575fc1 100644 --- a/scripts/node_crop_content/node_crop_content.gml +++ b/scripts/node_crop_content/node_crop_content.gml @@ -170,7 +170,7 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr var res = []; - for( var i = 0; i < array_length(_inSurf); i++ ) { + for( var i = 0, n = array_length(_inSurf); i < n; i++ ) { var _surf = _inSurf[i]; if(_array == 0) { diff --git a/scripts/node_csv_file_read/node_csv_file_read.gml b/scripts/node_csv_file_read/node_csv_file_read.gml index 75aa1e8d3..1f988f78d 100644 --- a/scripts/node_csv_file_read/node_csv_file_read.gml +++ b/scripts/node_csv_file_read/node_csv_file_read.gml @@ -72,7 +72,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const var convert = inputs[| 1].getValue(); outputs[| 0].type = convert? VALUE_TYPE.float : VALUE_TYPE.text; if(convert) { - for( var i = 0; i < array_length(content); i++ ) { + for( var i = 0, n = array_length(content); i < n; i++ ) { var c = content[i]; if(is_array(c)) { diff --git a/scripts/node_csv_file_write/node_csv_file_write.gml b/scripts/node_csv_file_write/node_csv_file_write.gml index 4ee7bc81a..ba52804bd 100644 --- a/scripts/node_csv_file_write/node_csv_file_write.gml +++ b/scripts/node_csv_file_write/node_csv_file_write.gml @@ -32,7 +32,7 @@ function Node_CSV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) cons var str = ""; if(is_array(_val)) { - for( var i = 0; i < array_length(_val); i++ ) { + for( var i = 0, n = array_length(_val); i < n; i++ ) { if(is_array(_val[i])) { for( var j = 0; j < array_length(_val[i]); j++ ) str += (j? ", " : "") + string(_val[i][j]) diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index b03f66826..db8f0e70b 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -5,6 +5,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x renderActive = true; node_id = UUID_generate(); + group = _group; destroy_when_upgroup = false; ds_list_add(PANEL_GRAPH.getNodeList(_group), self); @@ -31,13 +32,15 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x recordAction(ACTION_TYPE.node_added, self); PROJECT.nodeMap[? node_id] = self; PROJECT.modified = true; - + + //print($"Adding node {node_id} to {PROJECT.path} [{ds_map_size(PROJECT.nodeMap)}]"); + run_in(1, function() { if(display_name != "") return; resetInternalName(); display_name = name; //__txt_node_name(instanceof(self), name); }); - } + } name = ""; display_name = ""; @@ -155,7 +158,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(!ds_map_exists(global.PRESETS_MAP, folder)) return; var pres = global.PRESETS_MAP[? folder]; - for( var i = 0; i < array_length(pres); i++ ) { + for( var i = 0, n = array_length(pres); i < n; i++ ) { var preset = pres[i]; if(preset.name != "_default") continue; @@ -339,6 +342,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static step = function() {} static focusStep = function() {} + static inspectorStep = function() {} static doUpdate = function() { if(SAFE_MODE) return; @@ -487,7 +491,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static onInspect = function() {} static setRenderStatus = function(result) { - LOG_LINE_IF(global.FLAG.render, $"Set render status for {internalName} : {string(result)}"); + LOG_LINE_IF(global.FLAG.render, $"Set render status for {internalName} : {result}"); rendered = result; } @@ -738,130 +742,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x else if(i == -2) jun = inspectInput2; else jun = inputs[| i]; - var jx = jun.x; - var jy = jun.y; - - if(jun.value_from == noone) continue; - if(!jun.value_from.node.active) continue; - if(!jun.isVisible()) continue; - - var frx = jun.value_from.x; - var fry = jun.value_from.y; - - if(!is_undefined(minx)) { - if(jx < minx && frx < minx) continue; - if(jx > maxx && frx > maxx) continue; - - if(jy < miny && fry < miny) continue; - if(jy > maxy && fry > maxy) continue; - } - - var c0 = value_color(jun.value_from.type); - var c1 = value_color(jun.type); - - var shx = jun.draw_line_shift_x * _s; - var shy = jun.draw_line_shift_y * _s; - - var cx = round((frx + jx) / 2 + shx); - var cy = round((fry + jy) / 2 + shy); - - var hover = false; - var th = max(1, PREF_MAP[? "connection_line_width"] * _s); - jun.draw_line_shift_hover = false; - - var downDirection = jun.type == VALUE_TYPE.action || jun.value_from.type == VALUE_TYPE.action; - - if(PANEL_GRAPH.pHOVER) - switch(PREF_MAP[? "curve_connection_line"]) { - case 0 : - hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6); - break; - case 1 : - if(downDirection) - hover = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s) < max(th * 2, 6); - else - hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6); - - if(PANEL_GRAPH._junction_hovering == noone) - jun.draw_line_shift_hover = hover; - break; - case 2 : - if(downDirection) - hover = distance_to_elbow_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6); - else - hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6); - - if(PANEL_GRAPH._junction_hovering == noone) - jun.draw_line_shift_hover = hover; - break; - case 3 : - if(downDirection) - hover = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6); - else - hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6); - - if(PANEL_GRAPH._junction_hovering == noone) - jun.draw_line_shift_hover = hover; - break; - } - - if(_active && hover) - hovering = jun; - - var thicken = false; - thicken |= PANEL_GRAPH.nodes_junction_d == jun; - thicken |= _active && PANEL_GRAPH.junction_hovering == jun && PANEL_GRAPH._junction_hovering == noone; - thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == jun; - - th *= thicken? 2 : 1; - - var corner = PREF_MAP[? "connection_line_corner"] * _s; - var ty = LINE_STYLE.solid; - if(jun.type == VALUE_TYPE.node) - ty = LINE_STYLE.dashed; - - var ss = _s * aa; - jx *= aa; - jy *= aa; - frx *= aa; - fry *= aa; - th *= aa; - cx *= aa; - cy *= aa; - corner *= aa; - th = max(1, round(th)); - - draw_set_color(c0); - - var fromIndex = jun.value_from.drawLineIndex; - var toIndex = jun.drawLineIndex; - - switch(PREF_MAP[? "curve_connection_line"]) { - case 0 : - if(ty == LINE_STYLE.solid) - draw_line_width_vertex(jx, jy, frx, fry, th, c1, c0); - else - draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * ss); - break; - case 1 : - if(downDirection) - draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1); - else - draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); - break; - case 2 : - if(downDirection) - draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); - else - draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); - break; - case 3 : - if(downDirection) - draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); - else - draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); - break; - } + var hov = jun.drawConnections(_x, _y, _s, mx, my, _active, aa, minx, miny, maxx, maxy); + if(hov) hovering = hov; } return hovering; @@ -1194,6 +1076,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x return true; } static clearCache = function() { + clearInputCache(); + if(!use_cache) return; if(!isRenderActive()) return; @@ -1217,9 +1101,18 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(!isRenderActive()) return; clearCache(); - for( var i = 0; i < ds_list_size(outputs); i++ ) - for( var j = 0; j < ds_list_size(outputs[| i].value_to); j++ ) - outputs[| i].value_to[| j].node._clearCacheForward(); + var arr = getNextNodesRaw(); + for( var i = 0, n = array_length(arr); i < n; i++ ) + arr[i]._clearCacheForward(); + + //for( var i = 0; i < ds_list_size(outputs); i++ ) + //for( var j = 0; j < ds_list_size(outputs[| i].value_to); j++ ) + // outputs[| i].value_to[| j].node._clearCacheForward(); + } + + static clearInputCache = function() { + for( var i = 0; i < ds_list_size(inputs); i++ ) + inputs[| i].resetCache(); } static checkConnectGroup = function(_type = "group") { @@ -1434,6 +1327,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x else node_id = load_map.id; PROJECT.nodeMap[? node_id] = self; + //print($"D Adding node {node_id} to {PROJECT.path} [{ds_map_size(PROJECT.nodeMap)}]"); if(struct_has(load_map, "name")) setDisplayName(load_map.name); @@ -1558,7 +1452,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x ds_map_destroy(inputMap); ds_map_destroy(outputMap); - for( var i = 0; i < array_length(temp_surface); i++ ) + for( var i = 0, n = array_length(temp_surface); i < n; i++ ) surface_free(temp_surface[i]); onCleanUp(); diff --git a/scripts/node_de_stray/node_de_stray.gml b/scripts/node_de_stray/node_de_stray.gml index ed6b4ab5c..765c28546 100644 --- a/scripts/node_de_stray/node_de_stray.gml +++ b/scripts/node_de_stray/node_de_stray.gml @@ -19,7 +19,7 @@ function Node_De_Stray(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) static process_data = function(_outSurf, _data, _output_index, _array_index) { surface_set_shader(_outSurf, sh_de_stray); - shader_set_f("dimension", [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]); + shader_set_dim("dimension", _data[0]); shader_set_f("tolerance", _data[1]); draw_surface_safe(_data[0], 0, 0); diff --git a/scripts/node_display_text/node_display_text.gml b/scripts/node_display_text/node_display_text.gml index 0a121b336..6b4ffc780 100644 --- a/scripts/node_display_text/node_display_text.gml +++ b/scripts/node_display_text/node_display_text.gml @@ -232,7 +232,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr draw_set_alpha(alp); draw_set_text(font, fa_left, fa_top, color); - for( var i = 0; i < array_length(_lines); i++ ) { + for( var i = 0, n = array_length(_lines); i < n; i++ ) { var _line = _lines[i]; var _h = line_get_height(font); var _w = draw_text_style(tx, ty, _line, _s); diff --git a/scripts/node_dust/node_dust.gml b/scripts/node_dust/node_dust.gml index e0b95f840..a0353f20c 100644 --- a/scripts/node_dust/node_dust.gml +++ b/scripts/node_dust/node_dust.gml @@ -55,7 +55,7 @@ function __Dust(x, y, size = 8) constructor { static draw = function() { draw_set_color(c_grey); - for( var i = 0; i < array_length(px) - 1; i++ ) { + for( var i = 0, n = array_length(px) - 1; i < n; i++ ) { var dist = ceil(point_distance(px[i], py[i], px[i + 1], px[i + 1])); for( var j = 0; j < dist; j++ ) { var _x = lerp(px[i], px[i + 1], j / dist); @@ -103,14 +103,14 @@ function Node_Dust(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { if(PROJECT.animator.current_frame == 0) { dusts = [ new __Dust( 0, _dim[1] / 2 ) ]; } else { - for( var i = 0; i < array_length(dusts); i++ ) + for( var i = 0, n = array_length(dusts); i < n; i++ ) dusts[i].step(); } surface_set_target(_outSurf); DRAW_CLEAR - for( var i = 0; i < array_length(dusts); i++ ) + for( var i = 0, n = array_length(dusts); i < n; i++ ) dusts[i].draw(); surface_reset_target(); } diff --git a/scripts/node_equation/node_equation.gml b/scripts/node_equation/node_equation.gml index c7b2d04c9..fa0781708 100644 --- a/scripts/node_equation/node_equation.gml +++ b/scripts/node_equation/node_equation.gml @@ -22,7 +22,7 @@ function Node_create_Equation(_x, _y, _group = noone, _param = "") { if(str != "" && str != toNumber(str)) array_push_unique(vars, str); - for( var i = 0; i < array_length(vars); i++ ) + for( var i = 0, n = array_length(vars); i < n; i++ ) node.inputs[| 1 + i * 2].setValue(vars[i]); return node; diff --git a/scripts/node_export/node_export.gml b/scripts/node_export/node_export.gml index cf49c5d15..9650801fd 100644 --- a/scripts/node_export/node_export.gml +++ b/scripts/node_export/node_export.gml @@ -206,7 +206,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor var cmd = ""; - for( var i = 0; i < array_length(frames); i++ ) + for( var i = 0, n = array_length(frames); i < n; i++ ) cmd += "-frame " + frames[i] + " +" + string(framerate) + "+0+0+1 "; cmd += "-bgcolor 0,0,0,0 "; @@ -241,8 +241,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor //print($"{gifski} {shell_cmd}"); execute_shell(gifski, shell_cmd); } else { - var shell_cmd = $"-delay {string(framerate)} -alpha set -dispose previous -loop {string(loop_str)}"; - if(opti) shell_cmd += $" -fuzz {string(fuzz * 100)}% -layers OptimizeFrame -layers OptimizeTransparency"; + var shell_cmd = $"-delay {framerate} -alpha set -dispose previous -loop {loop_str}"; + if(opti) shell_cmd += $" -fuzz {fuzz * 100}% -layers OptimizeFrame -layers OptimizeTransparency"; shell_cmd += " " + temp_path + " " + target_path; //print($"{converter} {shell_cmd}"); diff --git a/scripts/node_feedback/node_feedback.yy b/scripts/node_feedback/node_feedback.yy index d3831a70d..fedafeb79 100644 --- a/scripts/node_feedback/node_feedback.yy +++ b/scripts/node_feedback/node_feedback.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "feedback", - "path": "folders/nodes/data/feedback.yy", + "path": "folders/nodes/data/iterate/feedback.yy", }, } \ No newline at end of file diff --git a/scripts/node_feedback_input/node_feedback_input.yy b/scripts/node_feedback_input/node_feedback_input.yy index ebf7e2d89..2a80dd04a 100644 --- a/scripts/node_feedback_input/node_feedback_input.yy +++ b/scripts/node_feedback_input/node_feedback_input.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "feedback", - "path": "folders/nodes/data/feedback.yy", + "path": "folders/nodes/data/iterate/feedback.yy", }, } \ No newline at end of file diff --git a/scripts/node_feedback_output/node_feedback_output.gml b/scripts/node_feedback_output/node_feedback_output.gml index 687171c51..026534e11 100644 --- a/scripts/node_feedback_output/node_feedback_output.gml +++ b/scripts/node_feedback_output/node_feedback_output.gml @@ -23,7 +23,7 @@ function Node_Feedback_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y var is_surf = inputs[| 0].type == VALUE_TYPE.surface; if(is_array(cache_value)) { - for( var i = 0; i < array_length(cache_value); i++ ) { + for( var i = 0, n = array_length(cache_value); i < n; i++ ) { if(is_surface(cache_value[i])) surface_free(cache_value[i]); } diff --git a/scripts/node_feedback_output/node_feedback_output.yy b/scripts/node_feedback_output/node_feedback_output.yy index 3659653b5..06cbad7d2 100644 --- a/scripts/node_feedback_output/node_feedback_output.yy +++ b/scripts/node_feedback_output/node_feedback_output.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "feedback", - "path": "folders/nodes/data/feedback.yy", + "path": "folders/nodes/data/iterate/feedback.yy", }, } \ No newline at end of file diff --git a/scripts/node_flood_fill/node_flood_fill.gml b/scripts/node_flood_fill/node_flood_fill.gml index 0be2881fb..e2658ddea 100644 --- a/scripts/node_flood_fill/node_flood_fill.gml +++ b/scripts/node_flood_fill/node_flood_fill.gml @@ -59,7 +59,7 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group var sw = surface_get_width(inSurf); var sh = surface_get_height(inSurf); - for( var i = 0; i < array_length(temp_surface); i++ ) + for( var i = 0, n = array_length(temp_surface); i < n; i++ ) temp_surface[i] = surface_verify(temp_surface[i], sw, sh, attrDepth()); surface_set_target(temp_surface[0]); diff --git a/scripts/node_gradient/node_gradient.gml b/scripts/node_gradient/node_gradient.gml index cd80d14a3..5b4702693 100644 --- a/scripts/node_gradient/node_gradient.gml +++ b/scripts/node_gradient/node_gradient.gml @@ -77,7 +77,7 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _grad_color = _grad[0]; var _grad_time = _grad[1]; - for( var i = 0; i < array_length(_grad_time); i++ ) + for( var i = 0, n = array_length(_grad_time); i < n; i++ ) _grad_time[i] = 0.5 + (_grad_time[i] - 0.5) * _sca; if(_typ == 0 || _typ == 2) { diff --git a/scripts/node_gradient_extract/node_gradient_extract.gml b/scripts/node_gradient_extract/node_gradient_extract.gml index 129dc29e8..3cbae5d8d 100644 --- a/scripts/node_gradient_extract/node_gradient_extract.gml +++ b/scripts/node_gradient_extract/node_gradient_extract.gml @@ -21,12 +21,12 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, switch(_output_index) { case 0 : var pal = []; - for( var i = 0; i < array_length(gra.keys); i++ ) + for( var i = 0, n = array_length(gra.keys); i < n; i++ ) pal[i] = gra.keys[i].value; return pal; case 1 : var pos = []; - for( var i = 0; i < array_length(gra.keys); i++ ) + for( var i = 0, n = array_length(gra.keys); i < n; i++ ) pos[i] = gra.keys[i].time; return pos; case 2 : diff --git a/scripts/node_gradient_palette/node_gradient_palette.gml b/scripts/node_gradient_palette/node_gradient_palette.gml index dfa59c626..af2fe94ab 100644 --- a/scripts/node_gradient_palette/node_gradient_palette.gml +++ b/scripts/node_gradient_palette/node_gradient_palette.gml @@ -35,7 +35,7 @@ function Node_Gradient_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y, var grad = new gradientObject(); grad.keys = []; - for( var i = 0; i < array_length(pal); i++ ) { + for( var i = 0, n = array_length(pal); i < n; i++ ) { var clr = pal[i]; var pos = pos_use? array_safe_get(_pos, i, 0) : i / array_length(pal); diff --git a/scripts/node_gradient_replace/node_gradient_replace.gml b/scripts/node_gradient_replace/node_gradient_replace.gml index ff6703174..3e1ecfbfd 100644 --- a/scripts/node_gradient_replace/node_gradient_replace.gml +++ b/scripts/node_gradient_replace/node_gradient_replace.gml @@ -25,7 +25,7 @@ function Node_Gradient_Replace_Color(_x, _y, _group = noone) : Node_Processor(_x var thr = _data[3]; var graO = new gradientObject(); - for( var i = 0; i < array_length(gra.keys); i++ ) { + for( var i = 0, n = array_length(gra.keys); i < n; i++ ) { var k = gra.keys[i]; var fromValue = 999; diff --git a/scripts/node_gradient_shift/node_gradient_shift.gml b/scripts/node_gradient_shift/node_gradient_shift.gml index a341d3dfe..749a46487 100644 --- a/scripts/node_gradient_shift/node_gradient_shift.gml +++ b/scripts/node_gradient_shift/node_gradient_shift.gml @@ -28,7 +28,7 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g _outSurf = new gradientObject(); _outSurf.keys = []; - for( var i = 0; i < array_length(pal.keys); i++ ) { + for( var i = 0, n = array_length(pal.keys); i < n; i++ ) { var k = pal.keys[i]; var key = new gradientKey((0.5 + (k.time - 0.5) * sca) + sft, k.value); diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index 60db87a2a..f59a5caef 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -49,40 +49,49 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru inputs[| 0] = nodeValue("Display type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, display_list[0]) + .uncache() .rejectArray(); inputs[| 0].editWidget.update_hover = false; inputs[| 1] = nodeValue("Range", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 1]) .setDisplay(VALUE_DISPLAY.vector_range) + .uncache() .setVisible(false) .rejectArray(); inputs[| 2] = nodeValue("Input type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, data_type_list, { update_hover: false }) + .uncache() .rejectArray(); inputs[| 2].editWidget.update_hover = false; inputs[| 3] = nodeValue("Enum label", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "") .setVisible(false) + .uncache() .rejectArray(); inputs[| 4] = nodeValue("Vector size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_button, [ "2", "3", "4" ], { update_hover: false }) .setVisible(false) + .uncache() .rejectArray(); inputs[| 5] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .uncache() .rejectArray(); inputs[| 6] = nodeValue("Display preview gizmo", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true) + .uncache() .rejectArray(); inputs[| 7] = nodeValue("Step", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.01) .setVisible(false) + .uncache() .rejectArray(); inputs[| 8] = nodeValue("Button Label", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "Trigger") .setVisible(false) + .uncache() .rejectArray(); input_display_list = [ @@ -90,7 +99,8 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru ["Data", false], 2, 0, 4, 1, 7, 3, 8, ]; - outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); + outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0) + .uncache(); attributes.inherit_name = true; doTrigger = 0; @@ -238,6 +248,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru ds_list_remove(group.inputs, inParent); inParent = nodeValue("Value", group, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1) + .uncache() .setVisible(true, true); inParent.from = self; diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index 030aca695..28f6659a7 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -10,9 +10,11 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr min_h = h; inputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1) + .uncache() .setVisible(true, true); inputs[| 1] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .uncache() .rejectArray(); attributes.inherit_name = true; @@ -83,6 +85,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr ds_list_remove(group.outputs, outParent); outParent = nodeValue("Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1) + .uncache() .setVisible(true, true); outParent.from = self; diff --git a/scripts/node_image_animated/node_image_animated.gml b/scripts/node_image_animated/node_image_animated.gml index 372405d5e..8e4b54bc4 100644 --- a/scripts/node_image_animated/node_image_animated.gml +++ b/scripts/node_image_animated/node_image_animated.gml @@ -103,7 +103,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons path_loaded = array_create(array_length(paths)); - for( var i = 0; i < array_length(paths); i++ ) { + for( var i = 0, n = array_length(paths); i < n; i++ ) { path_loaded[i] = paths[i]; var path = try_get_path(paths[i]); if(path == -1) continue; diff --git a/scripts/node_image_sequence/node_image_sequence.gml b/scripts/node_image_sequence/node_image_sequence.gml index 9c1cd1f6b..ca258c17f 100644 --- a/scripts/node_image_sequence/node_image_sequence.gml +++ b/scripts/node_image_sequence/node_image_sequence.gml @@ -100,7 +100,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons path_loaded = array_create(array_length(paths)); - for( var i = 0; i < array_length(paths); i++ ) { + for( var i = 0, n = array_length(paths); i < n; i++ ) { path_loaded[i] = paths[i]; var path = try_get_path(paths[i]); if(path == -1) continue; diff --git a/scripts/node_image_splice_sheet/node_image_splice_sheet.gml b/scripts/node_image_splice_sheet/node_image_splice_sheet.gml index 49774141b..a69aafdb8 100644 --- a/scripts/node_image_splice_sheet/node_image_splice_sheet.gml +++ b/scripts/node_image_splice_sheet/node_image_splice_sheet.gml @@ -308,7 +308,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _buff = buffer_create(filSize * filSize * surface_format_get_bytes(cDep), buffer_fixed, 2); surf_array = []; - for( var i = 0; i < array_length(surf_array); i++ ) { + for( var i = 0, n = array_length(surf_array); i < n; i++ ) { if(is_surface(surf_array[i])) surface_free(surf_array[i]); } diff --git a/scripts/node_iterate/node_iterate.gml b/scripts/node_iterate/node_iterate.gml index 07122d969..cb56e489d 100644 --- a/scripts/node_iterate/node_iterate.gml +++ b/scripts/node_iterate/node_iterate.gml @@ -7,7 +7,8 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Iterator(_x, _y, _group) co combine_render_time = false; iterated = 0; - inputs[| 0] = nodeValue("Repeat", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1 ); + inputs[| 0] = nodeValue("Repeat", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1 ) + .uncache(); custom_input_index = ds_list_size(inputs); loop_start_time = 0; diff --git a/scripts/node_iterator_input/node_iterator_input.gml b/scripts/node_iterator_input/node_iterator_input.gml index 03869b170..8de56c4ca 100644 --- a/scripts/node_iterator_input/node_iterator_input.gml +++ b/scripts/node_iterator_input/node_iterator_input.gml @@ -8,30 +8,30 @@ function Node_Iterator_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y, h = 32 + 24 * 2; min_h = h; - cache_value = -1; - - PATCH_STATIC - outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); //Get value from outside loop + outputs[| 0].getValueRecursive = function() { //show_debug_message("iteration " + string(group.iterated)); if(!variable_struct_exists(group, "iterated")) return outputs[| 0].getValueDefault(); var _node_output = noone; - for( var i = 0; i < ds_list_size(outputs[| 1].value_to); i++ ) { - var vt = outputs[| 1].value_to[| i]; - if(vt.value_from == outputs[| 1]) - _node_output = vt; - } + var _to = outputs[| 1].getJunctionTo(); + + if(array_empty(_to)) + return [ noone, inParent ]; + + _node_output = _to[0]; if(_node_output == noone || group.iterated == 0) return outputs[| 0].getValueDefault(); + //print($"Iteration {group.iterated} got {_node_output.node.cache_value}") return [ _node_output.node.cache_value, inParent ]; } - outputs[| 1] = nodeValue("Loop entrance", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, 0).nonForward(); + outputs[| 1] = nodeValue("Loop entrance", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, 0) + .nonForward(); PATCH_STATIC } \ No newline at end of file diff --git a/scripts/node_iterator_output/node_iterator_output.gml b/scripts/node_iterator_output/node_iterator_output.gml index 5da054dae..5d81f9b4e 100644 --- a/scripts/node_iterator_output/node_iterator_output.gml +++ b/scripts/node_iterator_output/node_iterator_output.gml @@ -17,6 +17,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y } inputs[| 2] = nodeValue("Loop exit", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, -1) + .uncache() .setVisible(true, true); inputs[| 2].setFrom_condition = function(_valueFrom) { diff --git a/scripts/node_line/node_line.gml b/scripts/node_line/node_line.gml index d2d4835d0..67a9a5198 100644 --- a/scripts/node_line/node_line.gml +++ b/scripts/node_line/node_line.gml @@ -80,7 +80,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { draw_set_color(COLORS._main_accent); - for( var i = 0; i < array_length(lines); i++ ) { + for( var i = 0, n = array_length(lines); i < n; i++ ) { var points = lines[i]; if(array_length(points) < 2) continue; @@ -342,7 +342,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons draw_primitive_begin_texture(pr_trianglestrip, tex); } - for( var i = 0; i < array_length(lines); i++ ) { + for( var i = 0, n = array_length(lines); i < n; i++ ) { var points = lines[i]; if(array_length(points) < 2) continue; diff --git a/scripts/node_lua_compute/node_lua_compute.gml b/scripts/node_lua_compute/node_lua_compute.gml index 6d44ebe27..a0035b2be 100644 --- a/scripts/node_lua_compute/node_lua_compute.gml +++ b/scripts/node_lua_compute/node_lua_compute.gml @@ -203,7 +203,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru } var lua_code = "function " + _func + "("; - for( var i = 0; i < array_length(argument_name); i++ ) { + for( var i = 0, n = array_length(argument_name); i < n; i++ ) { if(i) lua_code += ", " lua_code += argument_name[i]; } diff --git a/scripts/node_lua_surface/node_lua_surface.gml b/scripts/node_lua_surface/node_lua_surface.gml index 1ec8788c4..34349c51a 100644 --- a/scripts/node_lua_surface/node_lua_surface.gml +++ b/scripts/node_lua_surface/node_lua_surface.gml @@ -199,7 +199,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru } var lua_code = "function " + _func + "("; - for( var i = 0; i < array_length(argument_name); i++ ) { + for( var i = 0, n = array_length(argument_name); i < n; i++ ) { if(i) lua_code += ", " lua_code += argument_name[i]; } diff --git a/scripts/node_mesh_to_path/node_mesh_to_path.gml b/scripts/node_mesh_to_path/node_mesh_to_path.gml index 9528b1473..b1c68824a 100644 --- a/scripts/node_mesh_to_path/node_mesh_to_path.gml +++ b/scripts/node_mesh_to_path/node_mesh_to_path.gml @@ -23,7 +23,7 @@ function Node_Mesh_To_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constr draw_set_color(COLORS._main_accent); var op, np; - for( var i = 0; i < array_length(segments); i += 1 ) { + for( var i = 0, n = array_length(segments); i < n; i += 1 ) { np = segments[i]; if(i) draw_line_round(_x + op.x * _s, _y + op.y * _s, _x + np.x * _s, _y + np.y * _s, 2); op = np; @@ -58,7 +58,7 @@ function Node_Mesh_To_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constr lengths = []; var op, np; - for( var i = 0; i < array_length(segments); i += 1 ) { + for( var i = 0, n = array_length(segments); i < n; i += 1 ) { np = segments[i]; if(i) { lengths[i] = point_distance(op.x, op.y, np.x, np.y); diff --git a/scripts/node_mesh_transform/node_mesh_transform.gml b/scripts/node_mesh_transform/node_mesh_transform.gml index 14b36f6ba..1760ca0de 100644 --- a/scripts/node_mesh_transform/node_mesh_transform.gml +++ b/scripts/node_mesh_transform/node_mesh_transform.gml @@ -58,7 +58,7 @@ function Node_Mesh_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons if(_msh == noone) return; var mesh = _msh.clone(); - for( var i = 0; i < array_length(mesh.triangles); i++ ) { + for( var i = 0, n = array_length(mesh.triangles); i < n; i++ ) { var t = mesh.triangles[i]; pointTransform(t[0], _pos, _rot, _sca, _anc); diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index d2da2cc94..946fd5fc7 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -248,7 +248,7 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c function process_data(_output, _data, _output_index, _array_index = 0) { var vec = [ _data[0], _data[1] ]; - for( var i = 0; i < array_length(vec); i++ ) + for( var i = 0, n = array_length(vec); i < n; i++ ) vec[i] = _data[2]? round(vec[i]) : vec[i]; return vec; @@ -421,7 +421,7 @@ function Node_Vector3(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c function process_data(_output, _data, _output_index, _array_index = 0) { var vec = [ _data[0], _data[1], _data[2] ]; - for( var i = 0; i < array_length(vec); i++ ) + for( var i = 0, n = array_length(vec); i < n; i++ ) vec[i] = _data[3]? round(vec[i]) : vec[i]; return vec; @@ -476,7 +476,7 @@ function Node_Vector4(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c function process_data(_output, _data, _output_index, _array_index = 0) { var vec = [ _data[0], _data[1], _data[2], _data[3] ]; - for( var i = 0; i < array_length(vec); i++ ) + for( var i = 0, n = array_length(vec); i < n; i++ ) vec[i] = _data[4]? round(vec[i]) : vec[i]; return vec; diff --git a/scripts/node_pack_sprites/node_pack_sprites.gml b/scripts/node_pack_sprites/node_pack_sprites.gml index 24e078aac..b32b2be1e 100644 --- a/scripts/node_pack_sprites/node_pack_sprites.gml +++ b/scripts/node_pack_sprites/node_pack_sprites.gml @@ -26,7 +26,7 @@ function Node_Pack_Sprites(_x, _y, _group = noone) : Node(_x, _y, _group) constr draw_set_color(COLORS._main_accent); - for( var i = 0; i < array_length(rect); i++ ) { + for( var i = 0, n = array_length(rect); i < n; i++ ) { var r = rect[i]; draw_rectangle( _x + _s * (r.x + spac), @@ -52,7 +52,7 @@ function Node_Pack_Sprites(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _rects = []; - for( var i = 0; i < array_length(_inpt); i++ ) { + for( var i = 0, n = array_length(_inpt); i < n; i++ ) { var s = _inpt[i]; if(!is_surface(s)) continue; @@ -96,7 +96,7 @@ function Node_Pack_Sprites(_x, _y, _group = noone) : Node(_x, _y, _group) constr DRAW_CLEAR BLEND_OVERRIDE - for( var i = 0; i < array_length(rect); i++ ) { + for( var i = 0, n = array_length(rect); i < n; i++ ) { var r = rect[i]; array_push(atlas, new SurfaceAtlas(r.surface, [ r.x + _spac, r.y + _spac ])); diff --git a/scripts/node_palette_extract/node_palette_extract.gml b/scripts/node_palette_extract/node_palette_extract.gml index d4fc110e3..930937e8c 100644 --- a/scripts/node_palette_extract/node_palette_extract.gml +++ b/scripts/node_palette_extract/node_palette_extract.gml @@ -113,7 +113,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con _cnt[i][2] = cnt[i][2]; } - for( var i = 0; i < array_length(colors); i++ ) { + for( var i = 0, n = array_length(colors); i < n; i++ ) { var ind = 0; var dist = 999; var _cl = colors[i]; @@ -133,7 +133,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con for( var i = 0; i < _size; i++ ) cnt[i] = [ 0, 0, 0, 0 ]; - for( var i = 0; i < array_length(colors); i++ ) { + for( var i = 0, n = array_length(colors); i < n; i++ ) { var _cl = colors[i]; cnt[_cl[3]][0] += _cl[0]; cnt[_cl[3]][1] += _cl[1]; @@ -295,7 +295,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con res = extractPalette(_surf, _algo, _size, _seed); } else if(is_array(_surf)) { res = array_create(array_length(_surf)); - for( var i = 0; i < array_length(_surf); i++ ) + for( var i = 0, n = array_length(_surf); i < n; i++ ) res[i] = extractPalette(_surf[i], _algo, _size, _seed); } diff --git a/scripts/node_palette_replacement/node_palette_replacement.gml b/scripts/node_palette_replacement/node_palette_replacement.gml index 80c9af113..eb85eb83a 100644 --- a/scripts/node_palette_replacement/node_palette_replacement.gml +++ b/scripts/node_palette_replacement/node_palette_replacement.gml @@ -30,7 +30,7 @@ function Node_Palette_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _ var thr = _data[3]; var palo = []; - for( var i = 0; i < array_length(pal); i++ ) { + for( var i = 0, n = array_length(pal); i < n; i++ ) { var c = pal[i]; var fromValue = 999; diff --git a/scripts/node_particle/node_particle.gml b/scripts/node_particle/node_particle.gml index 0ad850ae2..5ace3888a 100644 --- a/scripts/node_particle/node_particle.gml +++ b/scripts/node_particle/node_particle.gml @@ -49,20 +49,21 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _ } static onUpdate = function() { - if(!PROJECT.animator.is_playing && !PROJECT.animator.frame_progress) { + if(ANIMATION_STATIC) { if(!recoverCache()) { var _dim = inputs[| input_len + 0].getValue(); var _outSurf = outputs[| 0].getValue(); _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); outputs[| 0].setValue(_outSurf); } - return; } + if(recoverCache()) + return; + if(PROJECT.animator.current_frame == 0) reset(); - runVFX(PROJECT.animator.current_frame); } @@ -93,7 +94,9 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _ BLEND_NORMAL; surface_reset_shader(); - if(PROJECT.animator.is_playing) + if(PROJECT.animator.is_playing) { + //print($"Cache frame {PROJECT.animator.current_frame}"); cacheCurrentFrame(_outSurf); + } } } \ No newline at end of file diff --git a/scripts/node_path/node_path.gml b/scripts/node_path/node_path.gml index 0d3fd6141..301ae49a0 100644 --- a/scripts/node_path/node_path.gml +++ b/scripts/node_path/node_path.gml @@ -338,7 +338,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { var pxy = (_my - _y) / _s; draw_set_color(COLORS._main_accent); - for( var i = 0; i < array_length(drag_points); i++ ) { + for( var i = 0, n = array_length(drag_points); i < n; i++ ) { var _p = drag_points[i]; nx = _x + _p[_ANCHOR.x] * _s; ny = _y + _p[_ANCHOR.y] * _s; @@ -444,9 +444,9 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { maxy = value_snap(maxy, _sny); if(key_mod_press(SHIFT)) { - var n = max(maxx - minx, maxy - miny); - maxx = minx + n; - maxy = miny + n; + var _n = max(maxx - minx, maxy - miny); + maxx = minx + _n; + maxy = miny + _n; } var a = []; @@ -482,9 +482,9 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { maxy = value_snap(maxy, _sny); if(key_mod_press(SHIFT)) { - var n = max(maxx - minx, maxy - miny); - maxx = minx + n; - maxy = miny + n; + var _n = max(maxx - minx, maxy - miny); + maxx = minx + _n; + maxy = miny + _n; } var a = []; @@ -966,7 +966,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { if(is_array(_rat)) { var _out = array_create(array_length(_rat)); - for( var i = 0; i < array_length(_rat); i++ ) { + for( var i = 0, n = array_length(_rat); i < n; i++ ) { if(_typ == 0) _out[i] = getPointRatio(_rat[i]); else if(_typ == 1) _out[i] = getPointSegment(_rat[i]); } diff --git a/scripts/node_path_builder/node_path_builder.gml b/scripts/node_path_builder/node_path_builder.gml index 4cbeaf5f9..f292fec2f 100644 --- a/scripts/node_path_builder/node_path_builder.gml +++ b/scripts/node_path_builder/node_path_builder.gml @@ -22,7 +22,7 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr static getBoundary = function() { var boundary = new BoundingBox(); var _lines = inputs[| 0].getValue(); - for( var i = 0; i < array_length(_lines); i++ ) + for( var i = 0, n = array_length(_lines); i < n; i++ ) boundary.addPoint(_lines[i][0], _lines[i][1]); return boundary; diff --git a/scripts/node_path_l_system/node_path_l_system.gml b/scripts/node_path_l_system/node_path_l_system.gml index eafdc4931..ffbbf1116 100644 --- a/scripts/node_path_l_system/node_path_l_system.gml +++ b/scripts/node_path_l_system/node_path_l_system.gml @@ -123,7 +123,7 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node(_x, _y, _group) const inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); draw_set_color(COLORS._main_accent); - for( var i = 0; i < array_length(lines); i++ ) { + for( var i = 0, n = array_length(lines); i < n; i++ ) { var p0 = lines[i][0]; var p1 = lines[i][1]; @@ -226,7 +226,7 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node(_x, _y, _group) const var _end = inputs[| 5].getValue(); var _es = string_splice(_end, ","); - for( var i = 0; i < array_length(_es); i++ ) { + for( var i = 0, n = array_length(_es); i < n; i++ ) { var _sp = string_splice(_es[i], "="); if(array_length(_sp) == 2) l = string_replace_all(l, _sp[0], _sp[1]); @@ -274,7 +274,7 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node(_x, _y, _group) const ds_stack_destroy(st); boundary = new BoundingBox(); - for( var i = 0; i < array_length(lines); i++ ) + for( var i = 0, n = array_length(lines); i < n; i++ ) boundary.addPoint(lines[i][0][0], lines[i][0][1], lines[i][1][0], lines[i][1][1]); outputs[| 0].setValue(self); diff --git a/scripts/node_polygonal_shape/node_polygonal_shape.gml b/scripts/node_polygonal_shape/node_polygonal_shape.gml index 8f6568064..8274038e6 100644 --- a/scripts/node_polygonal_shape/node_polygonal_shape.gml +++ b/scripts/node_polygonal_shape/node_polygonal_shape.gml @@ -174,7 +174,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var points = shapeData[0]; var segment = shapeData[1]; - for( var i = 0; i < array_length(segment); i++ ) { + for( var i = 0, n = array_length(segment); i < n; i++ ) { var _p = segment[i]; var p = point_rotate(_p.x, _p.y, 0, 0, _rot); _p.x = _pos[0] + p[0]; @@ -183,7 +183,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr path.setSegment(segment); var shapes = []; - for( var i = 0; i < array_length(points); i++ ) { + for( var i = 0, n = array_length(points); i < n; i++ ) { if(points[i].type == SHAPE_TYPE.points) shapes[i] = polygon_triangulate(points[i].points); else if(points[i].type == SHAPE_TYPE.triangles) @@ -191,7 +191,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } mesh.triangles = []; - for( var i = 0; i < array_length(shapes); i++ ) { + for( var i = 0, n = array_length(shapes); i < n; i++ ) { var triangles = shapes[i]; for( var j = 0; j < array_length(triangles); j++ ) { diff --git a/scripts/node_processor/node_processor.gml b/scripts/node_processor/node_processor.gml index 7657e056e..bd1a89314 100644 --- a/scripts/node_processor/node_processor.gml +++ b/scripts/node_processor/node_processor.gml @@ -200,7 +200,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct } var amoMax = process_amount; - for( var i = 0; i < array_length(process_length); i++ ) { + for( var i = 0, n = array_length(process_length); i < n; i++ ) { amoMax /= process_length[i][0]; process_length[i][1] = amoMax; } diff --git a/scripts/node_region_fill/node_region_fill.gml b/scripts/node_region_fill/node_region_fill.gml index 8959fc391..1f6c59f1e 100644 --- a/scripts/node_region_fill/node_region_fill.gml +++ b/scripts/node_region_fill/node_region_fill.gml @@ -65,7 +65,7 @@ function Node_Region_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou if(_fill) { var _pal = []; - for( var i = 0; i < array_length(_colr); i++ ) + for( var i = 0, n = array_length(_colr); i < n; i++ ) array_append(_pal, colToVec4(_colr[i])); surface_set_shader(_outSurf, sh_region_fill_color); diff --git a/scripts/node_repeat/node_repeat.gml b/scripts/node_repeat/node_repeat.gml index 645692dea..1ee1ce37f 100644 --- a/scripts/node_repeat/node_repeat.gml +++ b/scripts/node_repeat/node_repeat.gml @@ -275,11 +275,11 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor if(is_array(_inSurf) && _arr == 2) { if(!is_array(_outSurf)) surface_free(_outSurf); else { - for( var i = 0; i < array_length(_outSurf); i++ ) + for( var i = 0, n = array_length(_outSurf); i < n; i++ ) surface_free(_outSurf[i]); } - for( var i = 0; i < array_length(_inSurf); i++ ) { + for( var i = 0, n = array_length(_inSurf); i < n; i++ ) { var _out = surface_create(_dim[0], _dim[1], cDep); _outSurf[i] = _out; doRepeat(_out, _inSurf[i]); diff --git a/scripts/node_rigid_activation/node_rigid_activation.gml b/scripts/node_rigid_activation/node_rigid_activation.gml index 750786870..1b346e2cc 100644 --- a/scripts/node_rigid_activation/node_rigid_activation.gml +++ b/scripts/node_rigid_activation/node_rigid_activation.gml @@ -28,7 +28,7 @@ function Node_Rigid_Activate(_x, _y, _group = noone) : Node(_x, _y, _group) cons if(!is_array(_obj)) _obj = [ _obj ]; - for( var i = 0; i < array_length(_obj); i++ ) { + for( var i = 0, n = array_length(_obj); i < n; i++ ) { var _o = _obj[i].object; if(!is_array(_o)) _o = [ _o ]; diff --git a/scripts/node_rigid_force_apply/node_rigid_force_apply.gml b/scripts/node_rigid_force_apply/node_rigid_force_apply.gml index 21258ac08..a394de480 100644 --- a/scripts/node_rigid_force_apply/node_rigid_force_apply.gml +++ b/scripts/node_rigid_force_apply/node_rigid_force_apply.gml @@ -109,7 +109,7 @@ function Node_Rigid_Force_Apply(_x, _y, _group = noone) : Node(_x, _y, _group) c if(!is_array(_obj)) _obj = [ _obj ]; - for( var i = 0; i < array_length(_obj); i++ ) { + for( var i = 0, n = array_length(_obj); i < n; i++ ) { var _o = _obj[i].object; if(!is_array(_o)) _o = [ _o ]; diff --git a/scripts/node_rigid_group/node_rigid_group.gml b/scripts/node_rigid_group/node_rigid_group.gml index cfa8d3ea4..b3dc1ca7a 100644 --- a/scripts/node_rigid_group/node_rigid_group.gml +++ b/scripts/node_rigid_group/node_rigid_group.gml @@ -22,9 +22,9 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro var node_list = getNodeList(); for( var i = 0; i < ds_list_size(node_list); i++ ) { - var n = node_list[| i]; - if(variable_struct_exists(n, "reset")) - n.reset(); + var _node = node_list[| i]; + if(variable_struct_exists(_node, "reset")) + _node.reset(); } physics_pause_enable(false); diff --git a/scripts/node_rigid_object/node_rigid_object.gml b/scripts/node_rigid_object/node_rigid_object.gml index 089857088..820bc14da 100644 --- a/scripts/node_rigid_object/node_rigid_object.gml +++ b/scripts/node_rigid_object/node_rigid_object.gml @@ -43,7 +43,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr .setDisplay(VALUE_DISPLAY.button, [ function() { var _tex = inputs[| 6].getValue(); if(is_array(_tex)) { - for( var i = 0; i < array_length(_tex); i++ ) + for( var i = 0, n = array_length(_tex); i < n; i++ ) generateMesh(i); } else generateMesh(); @@ -322,7 +322,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr var keys = ds_map_keys_to_array(_pm); array_sort(keys, false); - for( var i = 0; i < array_length(keys); i++ ) { + for( var i = 0, n = array_length(keys); i < n; i++ ) { var px = _pm[? keys[i]][0]; var py = _pm[? keys[i]][1]; @@ -345,7 +345,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _sm = ds_map_create(); - for( var i = 0; i < array_length(mesh); i++ ) + for( var i = 0, n = array_length(mesh); i < n; i++ ) _sm[? point_direction_positive(cmX, cmY, mesh[i][0], mesh[i][1])] = [ mesh[i][0], mesh[i][1] ]; var keys = ds_map_keys_to_array(_sm); @@ -354,7 +354,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(array_length(keys)) { array_sort(keys, false); - for( var i = 0; i < array_length(keys); i++ ) { + for( var i = 0, n = array_length(keys); i < n; i++ ) { var k = keys[i]; array_push( mesh, [_sm[? k][0], _sm[? k][1]] ); } @@ -392,7 +392,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr } array_sort(remSt, false); - for( var i = 0; i < array_length(remSt); i++ ) { + for( var i = 0, n = array_length(remSt); i < n; i++ ) { var ind = remSt[i]; array_delete(mesh, ind, 1); } @@ -459,7 +459,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr array_sort(remSt, false); - for( var i = 0; i < array_length(remSt); i++ ) { + for( var i = 0, n = array_length(remSt); i < n; i++ ) { var ind = remSt[i]; array_delete(mesh, ind, 1); } @@ -526,7 +526,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr object.yscale = _spos[3] / hh * 2; object.surface = _tex; } else if(instance_exists(object)) { - for( var i = 0; i < array_length(object.fixture); i++ ) + for( var i = 0, n = array_length(object.fixture); i < n; i++ ) physics_remove_fixture(object, object.fixture[i]); object.fixture = []; } else @@ -641,7 +641,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr static update = function(frame = PROJECT.animator.current_frame) { if(!isAnimated()) return; - //for( var i = 0; i < array_length(object); i++ ) + //for( var i = 0, n = array_length(object); i < n; i++ ) // spawn(noone, i, object[i]); } @@ -661,7 +661,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr static reset = function() { var _tex = inputs[| 6].getValue(); - for( var i = 0; i < array_length(object); i++ ) { + for( var i = 0, n = array_length(object); i < n; i++ ) { if(instance_exists(object[i])) instance_destroy(object[i]); } @@ -671,7 +671,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(!_spwn) return; if(is_array(_tex)) { - for( var i = 0; i < array_length(_tex); i++ ) + for( var i = 0, n = array_length(_tex); i < n; i++ ) object[i] = spawn(noone, i); } else object = [ spawn() ]; diff --git a/scripts/node_rigid_override/node_rigid_override.gml b/scripts/node_rigid_override/node_rigid_override.gml index e9d9db7b1..b47bd34ac 100644 --- a/scripts/node_rigid_override/node_rigid_override.gml +++ b/scripts/node_rigid_override/node_rigid_override.gml @@ -42,7 +42,7 @@ function Node_Rigid_Override(_x, _y, _group = noone) : Node(_x, _y, _group) cons var _alp = inputs[| 5].getValue(); var _vel = inputs[| 6].getValue(); - for( var i = 0; i < array_length(objs); i++ ) { + for( var i = 0, n = array_length(objs); i < n; i++ ) { var obj = objs[i]; if(obj == noone || !instance_exists(obj)) continue; if(is_undefined(obj.phy_active)) continue; diff --git a/scripts/node_rigid_variable/node_rigid_variable.gml b/scripts/node_rigid_variable/node_rigid_variable.gml index d034019f6..5880c265a 100644 --- a/scripts/node_rigid_variable/node_rigid_variable.gml +++ b/scripts/node_rigid_variable/node_rigid_variable.gml @@ -55,7 +55,7 @@ function Node_Rigid_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) cons if(_get[i]) _val[i] = array_create(array_length(objs)); } - for( var i = 0; i < array_length(objs); i++ ) { + for( var i = 0, n = array_length(objs); i < n; i++ ) { var obj = objs[i]; if(obj == noone || !instance_exists(obj)) continue; if(is_undefined(obj.phy_active)) continue; diff --git a/scripts/node_scatter_points/node_scatter_points.gml b/scripts/node_scatter_points/node_scatter_points.gml index e971d3d84..541647ac0 100644 --- a/scripts/node_scatter_points/node_scatter_points.gml +++ b/scripts/node_scatter_points/node_scatter_points.gml @@ -87,7 +87,7 @@ function Node_Scatter_Points(_x, _y, _group = noone) : Node(_x, _y, _group) cons } else { pos = []; var p = get_points_from_dist(_distMap, _amo, _seed, 8); - for( var i = 0; i < array_length(p); i++ ) { + for( var i = 0, n = array_length(p); i < n; i++ ) { if(p[i] == 0) continue; if(_fix) { p[i][0] *= _fixRef[0]; diff --git a/scripts/node_sdf/node_sdf.gml b/scripts/node_sdf/node_sdf.gml index 9b93a5bc2..a7d2637d3 100644 --- a/scripts/node_sdf/node_sdf.gml +++ b/scripts/node_sdf/node_sdf.gml @@ -36,11 +36,11 @@ function Node_SDF(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const var _dist = _data[3]; var sw = surface_get_width(inSurf); var sh = surface_get_height(inSurf); - var n = max(sw, sh); + var _n = max(sw, sh); var cDep = attrDepth(); - temp_surface[0] = surface_verify(temp_surface[0], n, n, cDep); - temp_surface[1] = surface_verify(temp_surface[1], n, n, cDep); + temp_surface[0] = surface_verify(temp_surface[0], _n, _n, cDep); + temp_surface[1] = surface_verify(temp_surface[1], _n, _n, cDep); _outSurf = surface_verify(_outSurf, sw, sh, cDep); surface_set_target(temp_surface[0]); @@ -54,7 +54,7 @@ function Node_SDF(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const BLEND_NORMAL; surface_reset_target(); - var step = ceil(log2(n)); + var step = ceil(log2(_n)); var stepSize = power(2, step); var bg = 0; //step = 2; @@ -68,7 +68,7 @@ function Node_SDF(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const BLEND_OVERRIDE; shader_set(sh_sdf); - shader_set_uniform_f(uniform_sdf_dim, n, n ); + shader_set_uniform_f(uniform_sdf_dim, _n, _n ); shader_set_uniform_f(uniform_sdf_stp, stepSize); shader_set_uniform_i(uniform_sdf_sid, _side); draw_surface_safe(temp_surface[!bg], 0, 0); diff --git a/scripts/node_sequence_to_anim/node_sequence_to_anim.gml b/scripts/node_sequence_to_anim/node_sequence_to_anim.gml index 77bce5e95..3c5e44021 100644 --- a/scripts/node_sequence_to_anim/node_sequence_to_anim.gml +++ b/scripts/node_sequence_to_anim/node_sequence_to_anim.gml @@ -25,7 +25,7 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const if(array_length(_ord) == 0) { _ord = array_create(array_length(_seq)); - for( var i = 0; i < array_length(_seq); i++ ) + for( var i = 0, n = array_length(_seq); i < n; i++ ) _ord[i] = i; } @@ -49,7 +49,7 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const sequence_surface = surface_verify(sequence_surface, sw, sh - ui(8)); surface_set_target(sequence_surface); DRAW_CLEAR - for( var i = 0; i < array_length(_ord); i++ ) { + for( var i = 0, n = array_length(_ord); i < n; i++ ) { var o = _ord[i]; if(o == noone) continue; var s = array_safe_get(_seq, o); @@ -99,7 +99,7 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const if(array_length(_seq) == 0) { _seq = array_create(array_length(_sur)); - for( var i = 0; i < array_length(_sur); i++ ) + for( var i = 0, n = array_length(_sur); i < n; i++ ) _seq[i] = i; } diff --git a/scripts/node_simple_shape/node_simple_shape.gml b/scripts/node_simple_shape/node_simple_shape.gml index f05a7594f..da0802351 100644 --- a/scripts/node_simple_shape/node_simple_shape.gml +++ b/scripts/node_simple_shape/node_simple_shape.gml @@ -142,7 +142,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con draw_set_color(_color); draw_primitive_begin(pr_trianglelist); - for( var i = 0; i < array_length(triangles); i++ ) { + for( var i = 0, n = array_length(triangles); i < n; i++ ) { var tri = triangles[i]; var p0 = tri[0]; var p1 = tri[1]; diff --git a/scripts/node_strand_collision/node_strand_collision.gml b/scripts/node_strand_collision/node_strand_collision.gml index bfc7464c6..04c64e9e9 100644 --- a/scripts/node_strand_collision/node_strand_collision.gml +++ b/scripts/node_strand_collision/node_strand_collision.gml @@ -31,7 +31,7 @@ function Node_Strand_Collision(_x, _y, _group = noone) : Node(_x, _y, _group) co if(instanceof(_msh) != "Mesh") return; for( var k = 0; k < array_length(__str); k++ ) - for( var i = 0; i < array_length(__str[k].hairs); i++ ) { + for( var i = 0, n = array_length(__str[k].hairs); i < n; i++ ) { var h = __str[k].hairs[i]; for( var j = 1; j < array_length(h.points); j++ ) { diff --git a/scripts/node_strand_create/node_strand_create.gml b/scripts/node_strand_create/node_strand_create.gml index c954ebe29..05bf4aa1f 100644 --- a/scripts/node_strand_create/node_strand_create.gml +++ b/scripts/node_strand_create/node_strand_create.gml @@ -174,7 +174,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const var dy = __my - tool_my; if(dx != 0 || dy != 0) - for( var i = 0; i < array_length(groomed.hairs); i++ ) { + for( var i = 0, n = array_length(groomed.hairs); i < n; i++ ) { var h = groomed.hairs[i]; for( var j = 1; j < array_length(h.points); j++ ) { var p = h.points[j]; @@ -208,7 +208,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const var p1y = __my + lengthdir_y(wid, tool_dir_fix - 90); if(tool_dmx != __mx || tool_dmy != __my) - for( var i = 0; i < array_length(groomed.hairs); i++ ) { + for( var i = 0, n = array_length(groomed.hairs); i < n; i++ ) { var h = groomed.hairs[i]; var op, np; @@ -242,7 +242,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const var stn = tool_dragging.attribute.strength; stn = tool_dragging == tool_stretch? stn / game_get_speed(gamespeed_fps) : stn / 10; - for( var i = 0; i < array_length(groomed.hairs); i++ ) { + for( var i = 0, n = array_length(groomed.hairs); i < n; i++ ) { var h = groomed.hairs[i]; var op, np; var amo = array_length(h.points); @@ -302,7 +302,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const var dy = __my - tool_my; if(dx != 0 || dy != 0) - for( var i = 0; i < array_length(tool_grabbing); i++ ) { + for( var i = 0, n = array_length(tool_grabbing); i < n; i++ ) { var h = tool_grabbing[i][0]; var p = tool_grabbing[i][1]; var inf = tool_grabbing[i][2]; @@ -402,7 +402,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const tool_my = (_my - _y) / _s; tool_grabbing = []; - for( var i = 0; i < array_length(groomed.hairs); i++ ) { + for( var i = 0, n = array_length(groomed.hairs); i < n; i++ ) { var h = groomed.hairs[i]; var p = h.points[array_length(h.points) - 1]; diff --git a/scripts/node_strand_gravity/node_strand_gravity.gml b/scripts/node_strand_gravity/node_strand_gravity.gml index 001ce4182..0d0fed1fc 100644 --- a/scripts/node_strand_gravity/node_strand_gravity.gml +++ b/scripts/node_strand_gravity/node_strand_gravity.gml @@ -27,7 +27,7 @@ function Node_Strand_Gravity(_x, _y, _group = noone) : Node(_x, _y, _group) cons var gy = lengthdir_y(_gra, _dir); for( var k = 0; k < array_length(__str); k++ ) - for( var i = 0; i < array_length(__str[k].hairs); i++ ) { + for( var i = 0, n = array_length(__str[k].hairs); i < n; i++ ) { var h = __str[k].hairs[i]; for( var j = 1; j < array_length(h.points); j++ ) { diff --git a/scripts/node_strand_render/node_strand_render.gml b/scripts/node_strand_render/node_strand_render.gml index b3b70fb64..1750059f0 100644 --- a/scripts/node_strand_render/node_strand_render.gml +++ b/scripts/node_strand_render/node_strand_render.gml @@ -41,7 +41,7 @@ function Node_Strand_Render(_x, _y, _group = noone) : Node(_x, _y, _group) const if(_str == noone) return; if(!is_array(_str)) _str = [ _str ]; - for( var i = 0; i < array_length(_str); i++ ) + for( var i = 0, n = array_length(_str); i < n; i++ ) _str[i].draw(_x, _y, _s); } @@ -76,7 +76,7 @@ function Node_Strand_Render(_x, _y, _group = noone) : Node(_x, _y, _group) const var _strand = _str[h]; var hairs = _strand.hairs; - for( var i = 0; i < array_length(hairs); i++ ) { + for( var i = 0, n = array_length(hairs); i < n; i++ ) { var hair = hairs[i]; var os, ns, ot, nt; diff --git a/scripts/node_strand_render_texture/node_strand_render_texture.gml b/scripts/node_strand_render_texture/node_strand_render_texture.gml index 484ab8d9d..090dd3139 100644 --- a/scripts/node_strand_render_texture/node_strand_render_texture.gml +++ b/scripts/node_strand_render_texture/node_strand_render_texture.gml @@ -72,7 +72,7 @@ function Node_Strand_Render_Texture(_x, _y, _group = noone) : Node(_x, _y, _grou for( var k = 0; k < array_length(_str); k++ ) { var hairs = _str[k].hairs; - for( var i = 0; i < array_length(hairs); i++ ) { + for( var i = 0, n = array_length(hairs); i < n; i++ ) { var hair = hairs[i]; var ox0, oy0, ox1, oy1; var nx0, ny0, nx1, ny1; diff --git a/scripts/node_strand_update/node_strand_update.gml b/scripts/node_strand_update/node_strand_update.gml index 2aa14a1f1..6b3626f20 100644 --- a/scripts/node_strand_update/node_strand_update.gml +++ b/scripts/node_strand_update/node_strand_update.gml @@ -19,7 +19,7 @@ function Node_Strand_Update(_x, _y, _group = noone) : Node(_x, _y, _group) const var __str = _str; if(!is_array(_str)) __str = [ _str ]; - for( var i = 0; i < array_length(__str); i++ ) + for( var i = 0, n = array_length(__str); i < n; i++ ) __str[i].step(_itr); outputs[| 0].setValue(_str); } diff --git a/scripts/node_string_join/node_string_join.gml b/scripts/node_string_join/node_string_join.gml index 4977da700..44d7f4edf 100644 --- a/scripts/node_string_join/node_string_join.gml +++ b/scripts/node_string_join/node_string_join.gml @@ -18,7 +18,7 @@ function Node_String_Join(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _div = inputs[| 1].getValue(); var str = ""; - for( var i = 0; i < array_length(_arr); i++ ) + for( var i = 0, n = array_length(_arr); i < n; i++ ) str += (i? _div : "") + string(_arr[i]); outputs[| 0].setValue(str); diff --git a/scripts/node_surface_from_color/node_surface_from_color.gml b/scripts/node_surface_from_color/node_surface_from_color.gml index 9613fc0cf..05137a1bc 100644 --- a/scripts/node_surface_from_color/node_surface_from_color.gml +++ b/scripts/node_surface_from_color/node_surface_from_color.gml @@ -16,7 +16,7 @@ function Node_Surface_From_Color(_x, _y, _group = noone) : Node_Processor(_x, _y _outSurf = surface_verify(_outSurf, w, 1); surface_set_target(_outSurf); - for( var i = 0; i < array_length(_col); i++ ) + for( var i = 0, n = array_length(_col); i < n; i++ ) draw_point_color(i, 0, _col[i]); surface_reset_target(); diff --git a/scripts/node_trail/node_trail.gml b/scripts/node_trail/node_trail.gml index 7d0a59e7a..30803a2f7 100644 --- a/scripts/node_trail/node_trail.gml +++ b/scripts/node_trail/node_trail.gml @@ -66,7 +66,7 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { if(!is_surface(_surf)) return; cacheCurrentFrame(_surf); - for( var i = 0; i < array_length(temp_surface); i++ ) { + for( var i = 0, n = array_length(temp_surface); i < n; i++ ) { temp_surface[i] = surface_verify(temp_surface[i], surface_get_width(_surf), surface_get_height(_surf), cDep); surface_set_target(temp_surface[i]); DRAW_CLEAR diff --git a/scripts/node_tunnel_in/node_tunnel_in.gml b/scripts/node_tunnel_in/node_tunnel_in.gml index 9c0ebb59c..614a139e8 100644 --- a/scripts/node_tunnel_in/node_tunnel_in.gml +++ b/scripts/node_tunnel_in/node_tunnel_in.gml @@ -17,8 +17,8 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct insp2UpdateIcon = [ THEME.tunnel, 0, c_white ]; static onInspector2Update = function() { - var n = nodeBuild("Node_Tunnel_Out", x + 128, y); - n.inputs[| 0].setValue(inputs[| 0].getValue()); + var _node = nodeBuild("Node_Tunnel_Out", x + 128, y); + _node.inputs[| 0].setValue(inputs[| 0].getValue()); } static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) { diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index ad9fb8544..6f0bb2abd 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -323,7 +323,7 @@ function nodeValueUnit(value) constructor { return inv? value / base : value * base; if(!is_array(base) && is_array(value)) { - for( var i = 0; i < array_length(value); i++ ) + for( var i = 0, n = array_length(value); i < n; i++ ) value[i] = inv? value[i] / base : value[i] * base; return value; } @@ -336,7 +336,7 @@ function nodeValueUnit(value) constructor { case VALUE_DISPLAY.padding : case VALUE_DISPLAY.vector : case VALUE_DISPLAY.vector_range : - for( var i = 0; i < array_length(value); i++ ) + for( var i = 0, n = array_length(value); i < n; i++ ) value[i] = inv? value[i] / base[i % 2] : value[i] * base[i % 2]; return value; case VALUE_DISPLAY.area : @@ -398,7 +398,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru animator = new valueAnimator(_value, self, false); animators = []; if(is_array(_value)) - for( var i = 0; i < array_length(_value); i++ ) { + for( var i = 0, n = array_length(_value); i < n; i++ ) { animators[i] = new valueAnimator(_value[i], self, true); animators[i].index = i; } @@ -416,6 +416,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru draw_line_thick = 1; draw_line_shift_hover = false; drawLineIndex = 1; + draw_line_vb = noone; show_graph = false; graph_h = ui(64); @@ -438,6 +439,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru is_changed = true; cache_value = [ false, false, undefined ]; cache_array = [ false, false ]; + use_cache = true; expUse = false; expression = ""; @@ -464,7 +466,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(LOADING || APPENDING) return self; ds_list_clear(animator.values); - for( var i = 0; i < array_length(vals); i++ ) + for( var i = 0, n = array_length(vals); i < n; i++ ) ds_list_add(animator.values, new valueKey(vals[i][0], vals[i][1], animator)); return self; @@ -504,6 +506,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return self; } + static uncache = function() { + use_cache = false; + return self; + } + static setArrayDepth = function(aDepth) { array_depth = aDepth; return self; @@ -593,7 +600,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); if(display_data != -1) editWidget.extras = display_data; - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + array_safe_get(global.displaySuffix_Range, i); extract_node = "Node_Number"; @@ -617,7 +624,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru extract_node = "Node_Vector4"; } - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + string(array_safe_get(global.displaySuffix_Axis, i)); break; @@ -639,7 +646,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru else if(array_length(val) == 4) extract_node = "Node_Vector4"; - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + string(array_safe_get(global.displaySuffix_VecRange, i)); break; @@ -657,7 +664,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return setValueDirect(val, index); } ); - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + array_safe_get(global.displaySuffix_Range, i); extract_node = "Node_Vector2"; @@ -678,7 +685,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } ); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + array_safe_get(global.displaySuffix_Range, i); extract_node = "Node_Vector2"; @@ -692,7 +699,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); if(display_data != -1) editWidget.onSurfaceSize = display_data; - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + array_safe_get(global.displaySuffix_Area, i, ""); extra_data.area_type = AREA_MODE.area; @@ -706,7 +713,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru }, unit); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + array_safe_get(global.displaySuffix_Padding, i); extract_node = "Node_Vector4"; @@ -717,7 +724,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru }, unit); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + array_safe_get(global.displaySuffix_Padding, i); extract_node = "Node_Vector4"; @@ -760,7 +767,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); if(display_data != -1) editWidget.extras = display_data; - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) animators[i].suffix = " " + string(i); extract_node = ""; @@ -923,7 +930,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_DISPLAY.path_array: var paths = animator.getValue(); if(is_array(paths)) { - for( var i = 0; i < array_length(paths); i++ ) { + for( var i = 0, n = array_length(paths); i < n; i++ ) { if(try_get_path(paths[i]) != -1) continue; value_validation = VALIDATION.error; str = "File not exist: " + string(paths[i]); @@ -1042,17 +1049,20 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return value; } + static resetCache = function() { + cache_value[0] = false; + } + static getValue = function(_time = PROJECT.animator.current_frame, applyUnit = true, arrIndex = 0, useCache = true) { if(type == VALUE_TYPE.trigger) useCache = false; global.cache_call++; - if(useCache) { + if(useCache && use_cache) { var cache_hit = cache_value[0]; - cache_hit &= cache_value[1] == _time; + cache_hit &= (!is_anim && value_from == noone) || cache_value[1] == _time; cache_hit &= cache_value[2] != undefined; cache_hit &= connect_type == JUNCTION_CONNECT.input; - cache_hit &= unit.reference == VALUE_UNIT.constant; if(cache_hit) { global.cache_hit++; @@ -1076,7 +1086,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static __getAnimValue = function(_time = PROJECT.animator.current_frame) { if(sep_axis) { var val = []; - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) val[i] = animators[i].getValue(_time); return val; } else @@ -1096,7 +1106,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var sArr = []; var _osZ = 0; - for( var i = 0; i < array_length(val); i++ ) { + for( var i = 0, n = array_length(val); i < n; i++ ) { if(!is_surface(val[i])) continue; var surfSz = [ surface_get_width(val[i]), surface_get_height(val[i]) ]; @@ -1126,7 +1136,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } if(isArray(val) && array_length(val) < 128) { //Process data - for( var i = 0; i < array_length(val); i++ ) + for( var i = 0, n = array_length(val); i < n; i++ ) val[i] = valueProcess(val[i], nod, applyUnit, arrIndex); } else val = valueProcess(val, nod, applyUnit, arrIndex); @@ -1193,8 +1203,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru else return value_from.isAnimated() || value_from.__anim(); } - static showValue = function() { - var val = getValue(, false); + static showValue = function() { + var val = getValue(, false,, false); if(isArray()) { if(array_length(val) == 0) return 0; var v = val[safe_mod(node.preview_index, array_length(val))]; @@ -1266,7 +1276,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(sep_axis) { if(index == noone) { - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) updated |= animators[i].setValue(val[i], connect_type == JUNCTION_CONNECT.input && record, time); } else updated = animators[index].setValue(val, connect_type == JUNCTION_CONNECT.input && record, time); @@ -1293,9 +1303,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru else UPDATE |= RENDER_TYPE.partial; } - cache_array[0] = false; - cache_value[0] = false; - if(!LOADING) { //print("setValueDirect"); PROJECT.modified = true; @@ -1327,7 +1334,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(!typeCompatible(_valueFrom.type, type)) { if(log) - noti_warning("setFrom: Type mismatch",, node); + noti_warning($"setFrom: Type mismatch {_valueFrom.type} to {type}",, node); return false; } @@ -1364,15 +1371,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return true; } - static setFrom = function(_valueFrom, _update = true, checkRecur = true) { + static setFrom = function(_valueFrom, _update = true, checkRecur = true, log = false) { if(_valueFrom == noone) return removeFrom(); - if(!isConnectable(_valueFrom, checkRecur, false)) - return false; + if(!isConnectable(_valueFrom, checkRecur, log)) + return -1; if(setFrom_condition != -1 && !setFrom_condition(_valueFrom)) - return false; + return -2; if(value_from != noone) ds_list_remove(value_from.value_to, self); @@ -1526,7 +1533,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s * sca)) { //var _to = getJunctionTo(); //var _ss = ""; - //for( var i = 0; i < array_length(_to); i++ ) + //for( var i = 0, n = array_length(_to); i < n; i++ ) // _ss += (i? ", " : "") + _to[i].internalName; //TOOLTIP = _ss; @@ -1588,6 +1595,136 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } } + static drawConnections = function(_x, _y, _s, mx, my, _active, aa = 1, minx = undefined, miny = undefined, maxx = undefined, maxy = undefined) { + if(value_from == noone) return noone; + if(!value_from.node.active) return noone; + if(!isVisible()) return noone; + + var hovering = noone; + var jx = x; + var jy = y; + + var frx = value_from.x; + var fry = value_from.y; + + if(!is_undefined(minx)) { + if(jx < minx && frx < minx) return noone; + if(jx > maxx && frx > maxx) return noone; + + if(jy < miny && fry < miny) return noone; + if(jy > maxy && fry > maxy) return noone; + } + + var c0 = value_color(value_from.type); + var c1 = value_color(type); + + var shx = draw_line_shift_x * _s; + var shy = draw_line_shift_y * _s; + + var cx = round((frx + jx) / 2 + shx); + var cy = round((fry + jy) / 2 + shy); + + var hover = false; + var th = max(1, PREF_MAP[? "connection_line_width"] * _s); + draw_line_shift_hover = false; + + var downDirection = type == VALUE_TYPE.action || value_from.type == VALUE_TYPE.action; + + if(PANEL_GRAPH.pHOVER) + switch(PREF_MAP[? "curve_connection_line"]) { + case 0 : + hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6); + break; + case 1 : + if(downDirection) + hover = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s) < max(th * 2, 6); + else + hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6); + + if(PANEL_GRAPH._junction_hovering == noone) + draw_line_shift_hover = hover; + break; + case 2 : + if(downDirection) + hover = distance_to_elbow_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6); + else + hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, value_from.drawLineIndex, drawLineIndex) < max(th * 2, 6); + + if(PANEL_GRAPH._junction_hovering == noone) + draw_line_shift_hover = hover; + break; + case 3 : + if(downDirection) + hover = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6); + else + hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, value_from.drawLineIndex, drawLineIndex) < max(th * 2, 6); + + if(PANEL_GRAPH._junction_hovering == noone) + draw_line_shift_hover = hover; + break; + } + + if(_active && hover) + hovering = self; + + var thicken = false; + thicken |= PANEL_GRAPH.nodes_junction_d == self; + thicken |= _active && PANEL_GRAPH.junction_hovering == self && PANEL_GRAPH._junction_hovering == noone; + thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == self; + + th *= thicken? 2 : 1; + + var corner = PREF_MAP[? "connection_line_corner"] * _s; + var ty = LINE_STYLE.solid; + if(type == VALUE_TYPE.node) + ty = LINE_STYLE.dashed; + + var ss = _s * aa; + jx *= aa; + jy *= aa; + frx *= aa; + fry *= aa; + th *= aa; + cx *= aa; + cy *= aa; + corner *= aa; + th = max(1, round(th)); + + draw_set_color(c0); + + var fromIndex = value_from.drawLineIndex; + var toIndex = drawLineIndex; + + switch(PREF_MAP[? "curve_connection_line"]) { + case 0 : + if(ty == LINE_STYLE.solid) + draw_line_width_color(jx, jy, frx, fry, th, c1, c0); + else + draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * ss); + break; + case 1 : + if(downDirection) + draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1); + else + draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); + break; + case 2 : + if(downDirection) + draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); + else + draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); + break; + case 3 : + if(downDirection) + draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); + else + draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); + break; + } + + return hovering; + } + static isVisible = function() { if(!node.active) return false; @@ -1714,7 +1851,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru _map.raw_value = animator.serialize(scale); var _anims = []; - for( var i = 0; i < array_length(animators); i++ ) + for( var i = 0, n = array_length(animators); i < n; i++ ) array_push(_anims, animators[i].serialize(scale)); _map.animators = _anims; _map.data = extra_data; @@ -1791,18 +1928,19 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _nd = PROJECT.nodeMap[? _node]; var _ol = ds_list_size(_nd.outputs); - if(log) - log_warning("LOAD", $"[Connect] Reconnecting {node.name} to {_nd.name}", node); - + if(log) log_warning("LOAD", $"[Connect] Reconnecting {node.name} to {_nd.name}", node); + if(con_index < _ol) { - if(setFrom(_nd.outputs[| con_index], false)) - return true; + var _set = setFrom(_nd.outputs[| con_index], false, true); + if(_set) return true; + + if(_set == -1) log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Not connectable.", node); + else if(_set == -2) log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Condition not met.", node); - log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Connection failed.", node); return false; } - log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Node not exist.", node); + log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Output not exist.", node); return false; } diff --git a/scripts/node_wrap_mesh/node_wrap_mesh.gml b/scripts/node_wrap_mesh/node_wrap_mesh.gml index cedec564c..19a69b416 100644 --- a/scripts/node_wrap_mesh/node_wrap_mesh.gml +++ b/scripts/node_wrap_mesh/node_wrap_mesh.gml @@ -524,7 +524,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(loadPin == noone) return; - for( var i = 0; i < array_length(loadPin); i++ ) { + for( var i = 0, n = array_length(loadPin); i < n; i++ ) { var ind = loadPin[i]; if(ind < array_length(points)) points[ind].pin = true; diff --git a/scripts/obj_reader/obj_reader.gml b/scripts/obj_reader/obj_reader.gml index a91f18e61..2b0dc8250 100644 --- a/scripts/obj_reader/obj_reader.gml +++ b/scripts/obj_reader/obj_reader.gml @@ -116,7 +116,7 @@ function readObj(path, flipUV = false) { cv[1] /= vertex; cv[2] /= vertex; - for( var i = 0; i < array_length(v); i++ ) { + for( var i = 0, n = array_length(v); i < n; i++ ) { v[i][0] -= cv[0]; v[i][1] -= cv[1]; v[i][2] -= cv[2]; diff --git a/scripts/pack_corner/pack_corner.gml b/scripts/pack_corner/pack_corner.gml index 865092b06..5b535d627 100644 --- a/scripts/pack_corner/pack_corner.gml +++ b/scripts/pack_corner/pack_corner.gml @@ -8,7 +8,7 @@ function sprite_pack_corner(rectangles) { var maxW = 0; var maxH = 0; - for( var i = 0; i < array_length(rectangles); i++ ) { + for( var i = 0, n = array_length(rectangles); i < n; i++ ) { var rect = rectangles[i]; var minScore = 99999; diff --git a/scripts/panel_addon/panel_addon.gml b/scripts/panel_addon/panel_addon.gml index 5f2b9c8ac..7f158bb7e 100644 --- a/scripts/panel_addon/panel_addon.gml +++ b/scripts/panel_addon/panel_addon.gml @@ -29,7 +29,7 @@ function Panel_Addon() : PanelContent() constructor { function searchAddons() { search_res = []; - for( var i = 0; i < array_length(ADDONS); i++ ) { + for( var i = 0, n = array_length(ADDONS); i < n; i++ ) { if(string_pos(search_string, ADDONS[i].name)) array_push(search_res, ADDONS[i]); } @@ -51,7 +51,7 @@ function Panel_Addon() : PanelContent() constructor { var arr = search_string == ""? ADDONS : search_res; - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { var _addon = arr[i]; var bw = ui(28); @@ -127,7 +127,7 @@ function Panel_Addon() : PanelContent() constructor { if(_addObj) { var arr = variable_struct_get_names(_addObj.panels); - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { var pane = _addObj.panels[$ arr[i]]; if(struct_has(pane, "main") && pane.main) dialogPanelCall(new addonPanel(_addObj, pane)); diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index 298bece0b..b7ea2c3a8 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -130,17 +130,7 @@ function Panel_Animation() : PanelContent() constructor { ], ]; - addHotkey("", "Play/Pause", vk_space, MOD_KEY.none, function() { - PROJECT.animator.is_playing = !PROJECT.animator.is_playing; - PROJECT.animator.current_frame = -1; - PROJECT.animator.time_since_last_frame = 0; - - if(PROJECT.animator.is_playing && PROJECT.animator.frames_total) { - PROJECT.animator.setFrame(0); - PROJECT.animator.frame_progress = true; - } - - }); + addHotkey("", "Play/Pause", vk_space, MOD_KEY.none, function() { if(PROJECT.animator.is_playing) PROJECT.animator.pause() else PROJECT.animator.play(); }); addHotkey("", "Resume/Pause", vk_space, MOD_KEY.shift, function() { if(PROJECT.animator.is_playing) PROJECT.animator.pause() else PROJECT.animator.resume(); }); @@ -158,7 +148,7 @@ function Panel_Animation() : PanelContent() constructor { addHotkey("Animation", "Paste", "V", MOD_KEY.ctrl, function() { PANEL_ANIMATION.doPaste(PANEL_ANIMATION.value_focusing); }); function deleteKeys() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.anim.removeKey(k); } @@ -174,23 +164,23 @@ function Panel_Animation() : PanelContent() constructor { switch(halign) { case fa_left : tt = 9999; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) tt = min(tt, keyframe_selecting[i].time); break; case fa_center : tt = 0; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) tt += keyframe_selecting[i].time; tt = round(tt / array_length(keyframe_selecting)); break; case fa_right : tt = -9999; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) tt = max(tt, keyframe_selecting[i].time); break; } - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.anim.setKeyTime(k, tt); } @@ -230,7 +220,7 @@ function Panel_Animation() : PanelContent() constructor { function staggerKeys(_index, _stag) { var t = keyframe_selecting[_index].time; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; var _t = t + abs(i - _index) * _stag; @@ -240,41 +230,41 @@ function Panel_Animation() : PanelContent() constructor { keyframe_menu = [ menuItem(__txtx("panel_animation_lock_y", "Lock/Unlock Y easing"), function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_y_lock = !k.ease_y_lock; } }), menuItemGroup(__txtx("panel_animation_ease_in", "Ease in"), [ [ [THEME.timeline_ease, 0], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.none; k.ease_in = [0, 1]; } }, __txtx("panel_animation_ease_linear", "Linear") ], [ [THEME.timeline_ease, 1], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.bezier; k.ease_in = [1, 1]; } }, __txtx("panel_animation_ease_smooth", "Smooth") ], [ [THEME.timeline_ease, 2], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.bezier; k.ease_in = [1, 2]; } }, __txtx("panel_animation_ease_overshoot", "Overshoot") ], [ [THEME.timeline_ease, 3], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.bezier; k.ease_in = [0, 0]; } }, __txtx("panel_animation_ease_sharp", "Sharp") ], [ [THEME.timeline_ease, 4], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.cut; k.ease_in = [0, 0]; @@ -283,28 +273,28 @@ function Panel_Animation() : PanelContent() constructor { ]), menuItemGroup(__txtx("panel_animation_ease_out", "Ease out"), [ [ [THEME.timeline_ease, 0], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.none; k.ease_out = [0, 0]; } }, __txtx("panel_animation_ease_linear", "Linear") ], [ [THEME.timeline_ease, 1], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.bezier; k.ease_out = [1, 0]; } }, __txtx("panel_animation_ease_smooth", "Smooth") ], [ [THEME.timeline_ease, 2], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.bezier; k.ease_out = [1, -1]; } }, __txtx("panel_animation_ease_overshoot", "Overshoot") ], [ [THEME.timeline_ease, 3], function() { - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.bezier; k.ease_out = [0, 1]; @@ -777,7 +767,7 @@ function Panel_Animation() : PanelContent() constructor { var _min = 999999; var _max = -999999; - for( var i = 0; i < array_length(prop.animators); i++ ) { + for( var i = 0, n = array_length(prop.animators); i < n; i++ ) { var animator = prop.animators[i]; for(var k = 0; k < ds_list_size(animator.values); k++) { var key_val = animator.values[| k].value; @@ -793,7 +783,7 @@ function Panel_Animation() : PanelContent() constructor { } } - for( var i = 0; i < array_length(prop.animators); i++ ) + for( var i = 0, n = array_length(prop.animators); i < n; i++ ) drawDopesheetLine(prop.animators[i], key_y, msx, msy, _min, _max); } else drawDopesheetLine(prop.animator, key_y, msx, msy); @@ -1116,7 +1106,7 @@ function Panel_Animation() : PanelContent() constructor { if(!prop.is_anim) continue; if(prop.sep_axis) { - for( var i = 0; i < array_length(prop.animators); i++ ) { + for( var i = 0, n = array_length(prop.animators); i < n; i++ ) { drawDopesheetLabelAnimator(_node, prop.animators[i], msx, msy); ty = prop.animators[i].dopesheet_y - 1; } @@ -1294,12 +1284,12 @@ function Panel_Animation() : PanelContent() constructor { if(_len != len) { var key = ds_map_find_first(PROJECT.nodeMap); repeat(ds_map_size(PROJECT.nodeMap)) { - var n = PROJECT.nodeMap[? key]; + var _node = PROJECT.nodeMap[? key]; key = ds_map_find_next(PROJECT.nodeMap, key); - if(!n || !n.active) continue; + if(!_node || !_node.active) continue; for(var i = 0; i < ds_list_size(n.inputs); i++) { - var in = n.inputs[| i]; + var in = _node.inputs[| i]; if(!in.is_anim) continue; for(var j = 0; j < ds_list_size(in.animator.values); j++) { @@ -1353,7 +1343,7 @@ function Panel_Animation() : PanelContent() constructor { tt = max(tt, 0); var sh = tt - keyframe_dragging.time; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; var kt = k.time + sh; @@ -1365,7 +1355,7 @@ function Panel_Animation() : PanelContent() constructor { if(mouse_release(mb_left) || mouse_press(mb_left)) { keyframe_dragging = noone; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.anim.setKeyTime(k, k.time); } @@ -1382,7 +1372,7 @@ function Panel_Animation() : PanelContent() constructor { switch(keyframe_drag_type) { case KEYFRAME_DRAG_TYPE.ease_in : - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; @@ -1393,7 +1383,7 @@ function Panel_Animation() : PanelContent() constructor { break; case KEYFRAME_DRAG_TYPE.ease_out : - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; @@ -1403,7 +1393,7 @@ function Panel_Animation() : PanelContent() constructor { } break; case KEYFRAME_DRAG_TYPE.ease_both : - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; @@ -1867,7 +1857,7 @@ function Panel_Animation() : PanelContent() constructor { if(array_empty(keyframe_selecting)) return; var clones = []; - for( var i = 0; i < array_length(keyframe_selecting); i++ ) { + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var cl = keyframe_selecting[i].cloneAnimator(,, false); if(cl == noone) continue; array_append(clones, cl); @@ -1883,7 +1873,7 @@ function Panel_Animation() : PanelContent() constructor { copy_clipboard = ds_list_create(); function doCopy() { ds_list_clear(copy_clipboard); - for( var i = 0; i < array_length(keyframe_selecting); i++ ) + for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) ds_list_add(copy_clipboard, keyframe_selecting[i]); } diff --git a/scripts/panel_array_sequence/panel_array_sequence.gml b/scripts/panel_array_sequence/panel_array_sequence.gml index 9eba68c79..d15ba85aa 100644 --- a/scripts/panel_array_sequence/panel_array_sequence.gml +++ b/scripts/panel_array_sequence/panel_array_sequence.gml @@ -36,7 +36,7 @@ function Panel_Array_Sequence(node) : PanelContent() constructor { surface_set_target(content_surface); DRAW_CLEAR - for( var i = 0; i < array_length(_seq); i++ ) { + for( var i = 0, n = array_length(_seq); i < n; i++ ) { var _s = _seq[i]; if(!is_surface(_s)) continue; @@ -112,11 +112,11 @@ function Panel_Array_Sequence(node) : PanelContent() constructor { var _def = array_length(_ord) == 0; if(_def) { __ord = array_create(array_length(_seq)); - for( var i = 0; i < array_length(_seq); i++ ) + for( var i = 0, n = array_length(_seq); i < n; i++ ) __ord[i] = i; } - for( var i = 0; i < array_length(__ord); i++ ) { + for( var i = 0, n = array_length(__ord); i < n; i++ ) { var _i = __ord[i]; if(_i == noone) continue; var _s = _seq[_i]; diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 7409d3119..0b3371c8d 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -378,7 +378,7 @@ function Panel_Collection() : PanelContent() constructor { var bh = line_get_height(f_p0b, 8); var rootx = 0; - for( var i = 0; i < array_length(roots); i++ ) { + for( var i = 0, n = array_length(roots); i < n; i++ ) { var r = roots[i]; var b = buttonInstant(THEME.button_hide_fill, _x - ui(8), _y - bh / 2, string_width(r[0]) + ui(20), bh, [mx, my], pFOCUS, pHOVER); if(b == 2) { diff --git a/scripts/panel_console/panel_console.gml b/scripts/panel_console/panel_console.gml index e81399e88..009442ac7 100644 --- a/scripts/panel_console/panel_console.gml +++ b/scripts/panel_console/panel_console.gml @@ -49,7 +49,7 @@ function Panel_Console() : PanelContent() constructor { draw_text(ui(8) + string_width(command), h - ui(4), "_"); var hy = h - ui(32); - for( var i = 0; i < array_length(history); i++ ) { + for( var i = 0, n = array_length(history); i < n; i++ ) { var his = history[array_length(history) - i - 1]; var txt = his.txt; diff --git a/scripts/panel_data/panel_data.gml b/scripts/panel_data/panel_data.gml index 0a03738b8..261b3426e 100644 --- a/scripts/panel_data/panel_data.gml +++ b/scripts/panel_data/panel_data.gml @@ -92,7 +92,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { function refresh() { resetMask(); - for( var i = 0; i < array_length(content); i++ ) + for( var i = 0, n = array_length(content); i < n; i++ ) content[i].refresh(); for( var i = 0; i < ds_list_size(childs); i++ ) @@ -108,7 +108,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { _panel.move(dx, dy); } - for( var i = 0; i < array_length(content); i++ ) { + for( var i = 0, n = array_length(content); i < n; i++ ) { content[i].x = x; content[i].y = y; } @@ -123,7 +123,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { if(hasContent()) { var res = true; - for( var i = 0; i < array_length(content); i++ ) + for( var i = 0, n = array_length(content); i < n; i++ ) res &= hori? tw + dw > content[i].min_w : th + dh > content[i].min_h; return res; } @@ -138,7 +138,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { tx = x; ty = y + tab * ui(tab_height); tw = w; th = h - tab * ui(tab_height); - for( var i = 0; i < array_length(content); i++ ) { + for( var i = 0, n = array_length(content); i < n; i++ ) { content[i].w = max(tw, content[i].min_w); content[i].h = max(th, content[i].min_h); content[i].onResize(); @@ -210,7 +210,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { else array_push(content, _content); - for( var i = 0; i < array_length(content); i++ ) + for( var i = 0, n = array_length(content); i < n; i++ ) content[i].onSetPanel(self); if(_switch) setTab(array_find(content, _content)); @@ -237,7 +237,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { var prev_w = w; w = _w; - for( var i = 0; i < array_length(content); i++ ) { + for( var i = 0, n = array_length(content); i < n; i++ ) { content[i].w = w; content[i].onResize(); } @@ -272,7 +272,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { var prev_h = h; h = _h; - for( var i = 0; i < array_length(content); i++ ) { + for( var i = 0, n = array_length(content); i < n; i++ ) { content[i].h = h; content[i].onResize(); } @@ -475,7 +475,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { var rem = -1; draw_set_text(f_p3, fa_left, fa_bottom, COLORS._main_text_sub); - for( var i = 0; i < array_length(content); i++ ) { + for( var i = 0, n = array_length(content); i < n; i++ ) { var txt = content[i].title; var icn = content[i].icon; @@ -614,6 +614,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { function setTab(tabIndex) { if(tabIndex < 0) return; if(tabIndex >= array_length(content)) return; + if(content_index == tabIndex) return; var prec = array_safe_get(content, content_index); if(prec) prec.onFocusEnd(); @@ -666,7 +667,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { draw_surface_safe(content_surface, tx, ty); draw_sprite_stretched(THEME.ui_panel_fg, 0, tx + padding, ty + padding, _tw, _th); - draw_sprite_bbox(THEME.ui_panel_tab, 3, tab_cover); + if(tab) draw_sprite_bbox(THEME.ui_panel_tab, 3, tab_cover); if(FOCUS == self && parent != noone) { draw_sprite_stretched_ext(THEME.ui_panel_active, 0, tx + padding, ty + padding, tw - padding * 2, th - padding * 2, COLORS._main_accent, 1); @@ -806,9 +807,12 @@ function Panel(_parent, _x, _y, _w, _h) constructor { } function remove(con = getContent()) { + var curr = getContent(); + array_remove(content, con); if(con) con.onClose(); - setTab(0); + if(con == curr) setTab(0); + else setTab(array_find(content, curr)); refresh(); if(hasContent()) return; diff --git a/scripts/panel_function/panel_function.gml b/scripts/panel_function/panel_function.gml index 5832f75f4..7a67f1012 100644 --- a/scripts/panel_function/panel_function.gml +++ b/scripts/panel_function/panel_function.gml @@ -85,7 +85,7 @@ } } else { if(!is_array(cont)) cont = [ cont ]; - for( var i = 0; i < array_length(cont); i++ ) { + for( var i = 0, n = array_length(cont); i < n; i++ ) { var _cont = getPanelFromName(cont[i]) if(_cont != noone) panel.setContent(_cont); } @@ -157,7 +157,7 @@ return _res; if(ds_list_size(_pane.childs) == 0) { - for( var i = 0; i < array_length(_pane.content); i++ ) + for( var i = 0, n = array_length(_pane.content); i < n; i++ ) if(instanceof(_pane.content[i]) == _type) return _pane.content[i]; } @@ -180,7 +180,7 @@ if(!ds_exists(_pane.childs, ds_type_list)) return _arr; - for( var i = 0; i < array_length(_pane.content); i++ ) { + for( var i = 0, n = array_length(_pane.content); i < n; i++ ) { var _cnt = instanceof(_pane.content[i]); //print($" - content {_cnt} \ {_cnt == _type}"); if(_cnt == _type) @@ -320,7 +320,7 @@ for( var i = 0; i < ds_list_size(panel.childs); i++ ) cont.content[i] = _panelSerialize(panel.childs[| (ind + i) % 2]); } else { - for( var i = 0; i < array_length(panel.content); i++ ) + for( var i = 0, n = array_length(panel.content); i < n; i++ ) cont.content[i] = instanceof(panel.content[i]); } @@ -338,7 +338,7 @@ for( var i = 0; i < ds_list_size(panel.childs); i++ ) cont[i] = _panelSerializeArray(panel.childs[| i] ); } else { - for( var i = 0; i < array_length(panel.content); i++ ) + for( var i = 0, n = array_length(panel.content); i < n; i++ ) cont[i] = instanceof(panel.content[i]); } diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 724503b27..af5925c21 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -111,12 +111,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var maxy = -99999; for(var i = 0; i < ds_list_size(nodes_list); i++) { - var n = nodes_list[| i]; - minx = min(n.x - 32, minx); - maxx = max(n.x + n.w + 32, maxx); + var _node = nodes_list[| i]; + minx = min(_node.x - 32, minx); + maxx = max(_node.x + _node.w + 32, maxx); - miny = min(n.y - 32, miny); - maxy = max(n.y + n.h + 32, maxy); + miny = min(_node.y - 32, miny); + maxy = max(_node.y + _node.h + 32, maxy); } graph_x = w / 2 / graph_s - (minx + maxx) / 2; @@ -256,8 +256,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { PANEL_GRAPH = self; PROJECT = project; PANEL_ANIMATION.updatePropertyList(); - - //print($"Focus {PROJECT.path}"); } function stepBegin() { @@ -422,9 +420,9 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { node_hovering = noone; if(pHOVER) for(var i = 0; i < ds_list_size(nodes_list); i++) { - var n = nodes_list[| i]; - if(n.pointIn(gr_x, gr_y, mx, my, graph_s)) - node_hovering = n; + var _node = nodes_list[| i]; + if(_node.pointIn(gr_x, gr_y, mx, my, graph_s)) + node_hovering = _node; } if(node_hovering != noone) @@ -713,9 +711,9 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { nodes_list[| i].onDrawNodeBehind(gr_x, gr_y, mx, my, graph_s); for(var i = 0; i < ds_list_size(nodes_list); i++) { - var n = nodes_list[| i]; - if(instanceof(n) == "Node_Frame") continue; - var val = n.drawNode(gr_x, gr_y, mx, my, graph_s); + var _node = nodes_list[| i]; + if(instanceof(_node) == "Node_Frame") continue; + var val = _node.drawNode(gr_x, gr_y, mx, my, graph_s); if(val) { if(key_mod_press(SHIFT)) @@ -990,12 +988,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { _node.setInstance(node_focus); } - var n = _node.clone(); + var _nodeNew = _node.clone(); - node_dragging = n; - node_drag_mx = n.x; node_drag_my = n.y; - node_drag_sx = n.x; node_drag_sy = n.y; - node_drag_ox = n.x; node_drag_oy = n.y; + node_dragging = _nodeNew; + node_drag_mx = _nodeNew.x; node_drag_my = _nodeNew.y; + node_drag_sx = _nodeNew.x; node_drag_sy = _nodeNew.y; + node_drag_ox = _nodeNew.x; node_drag_oy = _nodeNew.y; } function doCopy() { @@ -1049,7 +1047,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { x0 = min(x0, _node.x); y0 = min(y0, _node.y); } - APPENDING = false; node_dragging = _app[| 0]; node_drag_mx = x0; node_drag_my = y0; @@ -1223,11 +1220,11 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { return; } else { for( var i = 0; i < ds_list_size(nodes_select_list); i++ ) { - var n = nodes_select_list[| i]; - x0 = min(x0, n.x); - y0 = min(y0, n.y); - x1 = max(x1, n.x + n.w); - y1 = max(y1, n.y + n.h); + var _node = nodes_select_list[| i]; + x0 = min(x0, _node.x); + y0 = min(y0, _node.y); + x1 = max(x1, _node.x + _node.w); + y1 = max(y1, _node.y + _node.h); } } @@ -1561,7 +1558,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var tbx = w - toolbar_height / 2; var tby = ty + toolbar_height / 2; - for( var i = 0; i < array_length(toolbars); i++ ) { + for( var i = 0, n = array_length(toolbars); i < n; i++ ) { var tb = toolbars[i]; var tbSpr = tb[0]; var tbInd = tb[1](); @@ -1607,12 +1604,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var maxy = -99999; for(var i = 0; i < ds_list_size(nodes_list); i++) { - var n = nodes_list[| i]; - minx = min(n.x - 32, minx); - maxx = max(n.x + n.w + 32, maxx); + var _node = nodes_list[| i]; + minx = min(_node.x - 32, minx); + maxx = max(_node.x + _node.w + 32, maxx); - miny = min(n.y - 32, miny); - maxy = max(n.y + n.h + 32, maxy); + miny = min(_node.y - 32, miny); + maxy = max(_node.y + _node.h + 32, maxy); } var cx = (minx + maxx) / 2; @@ -1623,12 +1620,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { draw_set_alpha(0.4); for(var i = 0; i < ds_list_size(nodes_list); i++) { - var n = nodes_list[| i]; + var _node = nodes_list[| i]; - var nx = minimap_w / 2 + (n.x - cx) * ss; - var ny = minimap_h / 2 + (n.y - cy) * ss; - var nw = n.w * ss; - var nh = n.h * ss; + var nx = minimap_w / 2 + (_node.x - cx) * ss; + var ny = minimap_h / 2 + (_node.y - cy) * ss; + var nw = _node.w * ss; + var nh = _node.h * ss; draw_set_color(n.color); draw_roundrect_ext(nx, ny, nx + nw, ny + nh, THEME_VALUE.minimap_corner_radius, THEME_VALUE.minimap_corner_radius, false); @@ -1841,7 +1838,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { case 4 : node = nodeBuild("Node_Vector4", mouse_grid_x, mouse_grid_y, getCurrentContext()); break; } - for( var i = 0; i < array_length(DRAGGING.data); i++ ) + for( var i = 0, n = array_length(DRAGGING.data); i < n; i++ ) node.inputs[| i].setValue(DRAGGING.data[i]); } else { node = nodeBuild("Node_Number", mouse_grid_x, mouse_grid_y, getCurrentContext()); diff --git a/scripts/panel_graph_export_image/panel_graph_export_image.gml b/scripts/panel_graph_export_image/panel_graph_export_image.gml index c45c17230..bf1963c1b 100644 --- a/scripts/panel_graph_export_image/panel_graph_export_image.gml +++ b/scripts/panel_graph_export_image/panel_graph_export_image.gml @@ -106,9 +106,9 @@ function graph_export_image(allList, nodeList, settings = {}) { nodeList[| i].onDrawNodeBehind(gr_x, gr_y, mx, my, scale); for(var i = 0; i < ds_list_size(nodeList); i++) { - var n = nodeList[| i]; - if(instanceof(n) == "Node_Frame") continue; - var val = n.drawNode(gr_x, gr_y, mx, my, scale); + var _node = nodeList[| i]; + if(instanceof(_node) == "Node_Frame") continue; + var val = _node.drawNode(gr_x, gr_y, mx, my, scale); } #endregion diff --git a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml index 91411e118..997ffb3e4 100644 --- a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml +++ b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml @@ -71,7 +71,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor { var _tx = sc_settings.surface_w; var wh = ui(36); - for( var i = 0; i < array_length(widgets); i++ ) { + for( var i = 0, n = array_length(widgets); i < n; i++ ) { draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); draw_text_add(0, ty + wh * i, __txt(widgets[i][0], "graph_export_")); diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 8fbe9f07d..1cba9c71a 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -64,7 +64,7 @@ function Panel_Inspector() : PanelContent() constructor { meta_tb[2] = new textArea(TEXTBOX_INPUT.text, function(str) { current_meta.contact = str; }); meta_tb[3] = new textArea(TEXTBOX_INPUT.text, function(str) { current_meta.alias = str; }); meta_tb[4] = new textArrayBox(noone, META_TAGS); - for( var i = 0; i < array_length(meta_tb); i++ ) + for( var i = 0, n = array_length(meta_tb); i < n; i++ ) meta_tb[i].hide = true; meta_display = [ @@ -85,7 +85,7 @@ function Panel_Inspector() : PanelContent() constructor { if(inspecting.input_display_list == -1) return; var dlist = inspecting.input_display_list; - for( var i = 0; i < array_length(dlist); i++ ) { + for( var i = 0, n = array_length(dlist); i < n; i++ ) { if(!is_array(dlist[i])) continue; dlist[i][@ 1] = false; } @@ -95,7 +95,7 @@ function Panel_Inspector() : PanelContent() constructor { if(inspecting.input_display_list == -1) return; var dlist = inspecting.input_display_list; - for( var i = 0; i < array_length(dlist); i++ ) { + for( var i = 0, n = array_length(dlist); i < n; i++ ) { if(!is_array(dlist[i])) continue; dlist[i][@ 1] = true; } @@ -137,7 +137,7 @@ function Panel_Inspector() : PanelContent() constructor { var rx = x + ui(16); var ry = y + top_bar_h; - for( var i = 0; i < array_length(meta_display); i++ ) { + for( var i = 0, n = array_length(meta_display); i < n; i++ ) { var _meta = meta_display[i]; var _txt = array_safe_get(_meta, 0); var _b = array_safe_get(_meta, 2, noone); @@ -342,7 +342,7 @@ function Panel_Inspector() : PanelContent() constructor { var ww = max(ui(180), con_w / 3); var wx0 = wx1 - ww; - for( var i = 0; i < array_length(inspecting.attributeEditors); i++ ) { + for( var i = 0, n = array_length(inspecting.attributeEditors); i < n; i++ ) { var edt = inspecting.attributeEditors[i]; if(is_string(edt)) { @@ -690,6 +690,7 @@ function Panel_Inspector() : PanelContent() constructor { if(inspecting) { title = inspecting.display_name == ""? inspecting.name : inspecting.display_name; + inspecting.inspectorStep(); drawInspectingNode(); } else { title = __txt("Inspector"); @@ -708,7 +709,7 @@ function Panel_Inspector() : PanelContent() constructor { var bx = w - ui(44); var by = ui(12); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_set_default", "Set as default"), THEME.save, 0, COLORS._main_icon) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_set_default", "Set Metadata as default"), THEME.save, 0, COLORS._main_icon) == 2) { var path = DIRECTORY + "meta.json"; var f = file_text_open_write(path); file_text_write_string(f, json_encode_minify(METADATA.serialize())); diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 31ef727a3..14f1bf5ea 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -46,7 +46,7 @@ function Panel_Menu() : PanelContent() constructor { -1 ]; - for( var i = 0; i < array_length(ADDONS); i++ ) { + for( var i = 0, n = array_length(ADDONS); i < n; i++ ) { var _dir = ADDONS[i].name; array_push(arr, menuItem(_dir, function(_dat) { addonTrigger(_dat.name); } )); } @@ -506,7 +506,7 @@ function Panel_Menu() : PanelContent() constructor { #region actions var bs = ui(28); - for( var i = 0; i < array_length(action_buttons); i++ ) { + for( var i = 0, n = array_length(action_buttons); i < n; i++ ) { var action = action_buttons[i]; switch(action) { diff --git a/scripts/panel_node_data_gen/panel_node_data_gen.gml b/scripts/panel_node_data_gen/panel_node_data_gen.gml index 7dd16ffbc..46af3d6c4 100644 --- a/scripts/panel_node_data_gen/panel_node_data_gen.gml +++ b/scripts/panel_node_data_gen/panel_node_data_gen.gml @@ -4,14 +4,14 @@ var _filter = ["x", "y", "updated", "rendered", "show_output_name", "insp2Update "cache_value", "show_graph", "preview_x", "preview_y", "badgePreview", "data_list", "open_rx", "open_ry", "parent", "active", "cached_output", "current_data", "cache_result", "draw_graph_culled", "dopesheet_y", "render_time", "renderActive", "preview_speed", "preview_drop_x", "preview_drop_y", "inspecting", "value_to_arr", "draw_name" ]; global.node_data_filter = ds_map_create(); -for( var i = 0; i < array_length(_filter); i++ ) +for( var i = 0, n = array_length(_filter); i < n; i++ ) global.node_data_filter[? _filter[i]] = 1; function __node_data_clone(struct) { var _var = variable_struct_get_names(struct); var _str = {}; - for( var i = 0; i < array_length(_var); i++ ) { + for( var i = 0, n = array_length(_var); i < n; i++ ) { if(ds_map_exists(global.node_data_filter, _var[i])) continue; var val = struct[$ _var[i]]; diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 5925e76fb..ef8efe670 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -793,7 +793,7 @@ function Panel_Preview() : PanelContent() constructor { if(tool_current != noone) { //tool settings var settings = _node.tool_settings; var len = array_length(settings); - for( var i = 0; i < array_length(tool_current.settings); i++ ) + for( var i = 0, n = array_length(tool_current.settings); i < n; i++ ) settings[len + i] = tool_current.settings[i]; tool_x = lerp_float(tool_x, tool_x_to, 5); @@ -803,7 +803,7 @@ function Panel_Preview() : PanelContent() constructor { var tolh = toolbar_height - ui(20); var tol_max_w = ui(32); - for( var i = 0; i < array_length(settings); i++ ) { + for( var i = 0, n = array_length(settings); i < n; i++ ) { var sett = settings[i]; var nme = sett[0]; var wdg = sett[1]; @@ -868,7 +868,7 @@ function Panel_Preview() : PanelContent() constructor { var tbx = toolbar_height / 2; var tby = ty + toolbar_height / 2; - for( var i = 0; i < array_length(toolbars); i++ ) { + for( var i = 0, n = array_length(toolbars); i < n; i++ ) { var tb = toolbars[i]; var tbSpr = tb[0]; var tbInd = tb[1](); @@ -881,7 +881,7 @@ function Panel_Preview() : PanelContent() constructor { } tbx = w - toolbar_height / 2; - for( var i = 0; i < array_length(actions); i++ ) { + for( var i = 0, n = array_length(actions); i < n; i++ ) { var tb = actions[i]; var tbSpr = tb[0]; var tbTooltip = tb[1]; diff --git a/scripts/panel_preview_window/panel_preview_window.gml b/scripts/panel_preview_window/panel_preview_window.gml index 2ec4f00b8..8e53b417d 100644 --- a/scripts/panel_preview_window/panel_preview_window.gml +++ b/scripts/panel_preview_window/panel_preview_window.gml @@ -76,7 +76,7 @@ function Panel_Preview_Window() : PanelContent() constructor { var ind = 0; var col = round(sqrt(array_length(surf))); - for( var i = 0; i < array_length(surf); i++ ) { + for( var i = 0, n = array_length(surf); i < n; i++ ) { var s = surf[i]; var sw = surface_get_width(s); var sh = surface_get_height(s); @@ -126,7 +126,7 @@ function Panel_Preview_Window() : PanelContent() constructor { var s = scale; if(mouse_wheel_down()) { - for( var i = 0; i < array_length(scale_levels) - 1; i++ ) { + for( var i = 0, n = array_length(scale_levels) - 1; i < n; i++ ) { if(s > scale_levels[i] && s <= scale_levels[i + 1]) { scale = scale_levels[i]; break; @@ -135,7 +135,7 @@ function Panel_Preview_Window() : PanelContent() constructor { } if(mouse_wheel_up()) { - for( var i = 0; i < array_length(scale_levels) - 1; i++ ) { + for( var i = 0, n = array_length(scale_levels) - 1; i < n; i++ ) { if(s >= scale_levels[i] && s < scale_levels[i + 1]) { scale = scale_levels[i + 1]; break; diff --git a/scripts/panel_test/panel_test.gml b/scripts/panel_test/panel_test.gml index f4e79ece5..2967c4533 100644 --- a/scripts/panel_test/panel_test.gml +++ b/scripts/panel_test/panel_test.gml @@ -32,7 +32,7 @@ function Panel_Test() : PanelContent() constructor { } file_find_close(); - for( var i = 0; i < array_length(_dir); i++ ) + for( var i = 0, n = array_length(_dir); i < n; i++ ) scanDir(_dir[i]); } @@ -45,7 +45,7 @@ function Panel_Test() : PanelContent() constructor { test_files = []; scanDir(test_dir); - for( var i = 0; i < array_length(test_files); i++ ) { + for( var i = 0, n = array_length(test_files); i < n; i++ ) { run_in(i * 3, function(i) { print($"TESTING: {test_files[i]}"); TEST_PATH(test_files[i]); diff --git a/scripts/panel_tunnels/panel_tunnels.gml b/scripts/panel_tunnels/panel_tunnels.gml index 425281543..45ab49994 100644 --- a/scripts/panel_tunnels/panel_tunnels.gml +++ b/scripts/panel_tunnels/panel_tunnels.gml @@ -48,7 +48,7 @@ function Panel_Tunnels() : PanelContent() constructor { function searchNodes() { search_res = []; - for( var i = 0; i < array_length(tunnel_ins); i++ ) { + for( var i = 0, n = array_length(tunnel_ins); i < n; i++ ) { var node = tunnel_ins[i]; var key = node.inputs[| 0].getValue(0); @@ -75,7 +75,7 @@ function Panel_Tunnels() : PanelContent() constructor { var arr = search_string == ""? tunnel_ins : search_res; tunnel_hover = noone; - for( var i = 0; i < array_length(arr); i++ ) { + for( var i = 0, n = array_length(arr); i < n; i++ ) { var node = arr[i]; if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) { @@ -99,8 +99,8 @@ function Panel_Tunnels() : PanelContent() constructor { bx -= ui(32); if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, __txtx("panel_tunnel_create_tunnel", "Create tunnel out"), THEME.tunnel) == 2) { - var n = nodeBuild("Node_Tunnel_Out", build_x, build_y); - n.inputs[| 0].setValue(key); + var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y); + _node.inputs[| 0].setValue(key); if(in_dialog) instance_destroy(); } diff --git a/scripts/pathArrayBox/pathArrayBox.gml b/scripts/pathArrayBox/pathArrayBox.gml index 0dc8f8305..ff475357a 100644 --- a/scripts/pathArrayBox/pathArrayBox.gml +++ b/scripts/pathArrayBox/pathArrayBox.gml @@ -49,7 +49,7 @@ function pathArrayBox(_target, _data, _onClick) : widget() constructor { if(!is_array(_files)) _files = [ _files ]; var len = array_length(_files); var txt = "(" + string(len) + ") " + "["; - for( var i = 0; i < array_length(_files); i++ ) + for( var i = 0, n = array_length(_files); i < n; i++ ) txt += (i? ", " : "") + filename_name_only(_files[i]); txt += "]"; diff --git a/scripts/path_reader/path_reader.gml b/scripts/path_reader/path_reader.gml index ceaf101b8..4bd227de2 100644 --- a/scripts/path_reader/path_reader.gml +++ b/scripts/path_reader/path_reader.gml @@ -1,6 +1,6 @@ function path_search(paths, recur = false, _filter = "") { var _paths = []; - for( var i = 0; i < array_length(paths); i++ ) { + for( var i = 0, n = array_length(paths); i < n; i++ ) { array_append(_paths, paths_to_array(paths[i], recur, _filter)); } return _paths; diff --git a/scripts/printer/printer.gml b/scripts/printer/printer.gml index ae83bebf8..96d37f068 100644 --- a/scripts/printer/printer.gml +++ b/scripts/printer/printer.gml @@ -2,7 +2,7 @@ function printBool(val) { if(!is_array(val)) return val? __txt("True") : __txt("False"); var ss = "["; - for( var i = 0; i < array_length(val); i++ ) { + for( var i = 0, n = array_length(val); i < n; i++ ) { ss += (i? ", " : "") + printBool(val[i]); } diff --git a/scripts/project_function/project_function.gml b/scripts/project_function/project_function.gml index 50fb6e5fb..8cf1a7136 100644 --- a/scripts/project_function/project_function.gml +++ b/scripts/project_function/project_function.gml @@ -1,26 +1,29 @@ -/// @desc Function Description -/// @param {Struct.Project} project Description function closeProject(project) { //print($"Close {PROJECT.path}"); - PROJECT.active = false; + project.active = false; array_remove(PROJECTS, project); - if(array_length(PROJECTS) == 0) - PROJECT = new Project(); + if(array_length(PROJECTS) == 0) { + PROJECT = new Project(); + PROJECTS = [ PROJECT ]; + } var panels = findPanels("Panel_Graph"); for( var i = array_length(panels) - 1; i >= 0; i-- ) { var panel = panels[i]; //print($" Check {panel.project.path}"); - if(panel.project == project) { + if(panel.project != project) + continue; + + if(array_length(panels) == 1) { + panel.setProject(PROJECT); + panel.onFocusBegin(); + } else { panel.panel.remove(panel); - array_remove(panels, panel) + array_remove(panels, panel); } } - - if(array_length(panels) == 0) - setPanel(); project.cleanup(); } \ No newline at end of file diff --git a/scripts/pxl_server/pxl_server.gml b/scripts/pxl_server/pxl_server.gml index 13f9b7f7b..1bc117040 100644 --- a/scripts/pxl_server/pxl_server.gml +++ b/scripts/pxl_server/pxl_server.gml @@ -6,7 +6,7 @@ function pxl_document_parser(prompt) { var lines = string_split(prompt, "\n"); - for( var i = 0; i < array_length(lines); i++ ) { + for( var i = 0, n = array_length(lines); i < n; i++ ) { var line = lines[i]; line = functionStringClean(line); @@ -28,7 +28,7 @@ function pxl_autocomplete_server(prompt, params = []) { ////////////////////////////////// ds_priority_clear(pr_list); - for( var i = 0; i < array_length(params); i++ ) { + for( var i = 0, n = array_length(params); i < n; i++ ) { var gl = params[i]; var match = string_partial_match(string_lower(gl), string_lower(prompt)); @@ -43,7 +43,7 @@ function pxl_autocomplete_server(prompt, params = []) { ////////////////////////////////// ds_priority_clear(pr_list); - for( var i = 0; i < array_length(global.GLOBAL_VAR); i++ ) { + for( var i = 0, n = array_length(global.GLOBAL_VAR); i < n; i++ ) { var gl = global.GLOBAL_VAR[i]; var match = string_partial_match(string_lower(gl), string_lower(prompt)); @@ -98,7 +98,7 @@ function pxl_autocomplete_server(prompt, params = []) { } } else if(ds_map_exists(PROJECT.nodeNameMap, sp[0])) { if(array_length(sp) == 2) { - for( var i = 0; i < array_length(global.NODE_SUB_CATAG); i++ ) { + for( var i = 0, n = array_length(global.NODE_SUB_CATAG); i < n; i++ ) { var gl = global.NODE_SUB_CATAG[i]; var match = string_partial_match(string_lower(gl), string_lower(sp[1])); @@ -196,7 +196,7 @@ function pxl_function_guide_server(prompt) { var fn = global.FUNCTIONS[? prompt]; var guide = prompt + "("; - for( var i = 0; i < array_length(fn[0]); i++ ) + for( var i = 0, n = array_length(fn[0]); i < n; i++ ) guide += (i? ", " : "") + string(fn[0][i]); guide += ")"; diff --git a/scripts/random_function/random_function.gml b/scripts/random_function/random_function.gml index 3728b4a09..ace0b9917 100644 --- a/scripts/random_function/random_function.gml +++ b/scripts/random_function/random_function.gml @@ -91,10 +91,20 @@ function getWiggle(_min = 0, _max = 1, _freq = 1, _time = 0, _seed = 0, startTim return lerp(_min, _max, _lrp); } -function UUID_generate(length = 16) { - static str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +function UUID_generate(length = 32) { + randomize(); + static str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + static month = "JFRAMJYASOND" var _id = ""; - repeat(length) _id += string_char_at(str, irandom_range(1, string_length(str))); + _id += string_char_at(str, current_year % string_length(str) + 1); //1 + _id += string_char_at(month, current_month); //1 + _id += string_char_at(str, current_day); //1 + _id += string_char_at(str, current_hour); //1 + _id += string_char_at(str, current_minute); //1 + _id += string_char_at(str, current_second); //1 + _id += string_lead_zero(current_time, 6); //6 + + repeat(length - string_length(_id)) _id += string_char_at(str, irandom_range(1, string_length(str))); return _id; } \ No newline at end of file diff --git a/scripts/real_comparison/real_comparison.gml b/scripts/real_comparison/real_comparison.gml index 4f2f3ae7b..822860814 100644 --- a/scripts/real_comparison/real_comparison.gml +++ b/scripts/real_comparison/real_comparison.gml @@ -3,7 +3,7 @@ function isEqual(val1, val2) { if(is_array(val1) ^ is_array(val2)) return false; if(array_length(val1) != array_length(val2)) return false; - for( var i = 0; i < array_length(val1); i++ ) { + for( var i = 0, n = array_length(val1); i < n; i++ ) { if(val1[i] != val2[i]) return false; } diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 442d13de8..dfee235c5 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -52,8 +52,7 @@ function __nodeInLoop(_node) { function Render(partial = false, runAction = false) { var t = current_time; LOG_BLOCK_START(); - LOG_IF(global.FLAG.render, -$"============================== RENDER START [frame {string(PROJECT.animator.current_frame)}] =============================="); + LOG_IF(global.FLAG.render, $"============================== RENDER START [frame {PROJECT.animator.current_frame}] =============================="); try { var rendering = noone; @@ -123,7 +122,7 @@ $"============================== RENDER START [frame {string(PROJECT.animator.cu rendering.doUpdate(); var nextNodes = rendering.getNextNodes(); - for( var i = 0; i < array_length(nextNodes); i++ ) + for( var i = 0, n = array_length(nextNodes); i < n; i++ ) RENDER_QUEUE.enqueue(nextNodes[i]); if(runAction && rendering.hasInspector1Update()) @@ -193,7 +192,7 @@ function RenderList(list) { rendering.doUpdate(); var nextNodes = rendering.getNextNodes(); - for( var i = 0; i < array_length(nextNodes); i++ ) + for( var i = 0, n = array_length(nextNodes); i < n; i++ ) RENDER_QUEUE.enqueue(nextNodes[i]); if(runAction && rendering.hasInspector1Update()) @@ -257,7 +256,7 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { rendering.doUpdate(); var nextNodes = rendering.getNextNodes(); - for( var i = 0; i < array_length(nextNodes); i++ ) + for( var i = 0, n = array_length(nextNodes); i < n; i++ ) RENDER_QUEUE.enqueue(nextNodes[i]); if(runAction && rendering.hasInspector1Update()) diff --git a/scripts/save_function/save_function.gml b/scripts/save_function/save_function.gml index e66e7ed5c..ab91d4c31 100644 --- a/scripts/save_function/save_function.gml +++ b/scripts/save_function/save_function.gml @@ -66,9 +66,8 @@ function SET_PATH(project, path) { } function SAVE_ALL() { - for( var i = 0; i < array_length(PROJECTS); i++ ) { + for( var i = 0, n = array_length(PROJECTS); i < n; i++ ) SAVE(PROJECTS[i]); - } } function SAVE(project = PROJECT) { diff --git a/scripts/shader_functions/shader_functions.gml b/scripts/shader_functions/shader_functions.gml index a31042580..cf8c54acf 100644 --- a/scripts/shader_functions/shader_functions.gml +++ b/scripts/shader_functions/shader_functions.gml @@ -85,7 +85,7 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount") shader_set_i(amo_uni, array_length(pal)); var _pal = []; - for( var i = 0; i < array_length(pal); i++ ) + for( var i = 0, n = array_length(pal); i < n; i++ ) array_append(_pal, colToVec4(pal[i])); if(array_length(_pal)) diff --git a/scripts/sprite_loader/sprite_loader.gml b/scripts/sprite_loader/sprite_loader.gml index 1de28571d..98c6e7295 100644 --- a/scripts/sprite_loader/sprite_loader.gml +++ b/scripts/sprite_loader/sprite_loader.gml @@ -56,7 +56,7 @@ function loadGraphic(theme = "default") { var graphics = variable_struct_get_names(sprDef); var sprStr = json_try_parse(s); - for( var i = 0; i < array_length(graphics); i++ ) { + for( var i = 0, n = array_length(graphics); i < n; i++ ) { var key = graphics[i]; if(variable_struct_exists(sprStr, key)) { diff --git a/scripts/string_eval/string_eval.gml b/scripts/string_eval/string_eval.gml index 78b1ae45e..1acfd931f 100644 --- a/scripts/string_eval/string_eval.gml +++ b/scripts/string_eval/string_eval.gml @@ -57,7 +57,7 @@ global.FUNCTIONS[? "range"] = [ ["length", "start = 0", "step = 1"], function(val) { var arr = array_create(array_safe_get(val, 0, 0)); - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) arr[i] = array_safe_get(val, 1, 0) + i * array_safe_get(val, 2, 1); return arr; } ]; @@ -113,7 +113,7 @@ function functionStringClean(fx) { } static validate = function() { - for( var i = 0; i < array_length(funcTrees); i++ ) + for( var i = 0, n = array_length(funcTrees); i < n; i++ ) if(!funcTrees[i].validate()) return false; @@ -121,7 +121,7 @@ function functionStringClean(fx) { } static isAnimated = function() { - for( var i = 0; i < array_length(funcTrees); i++ ) + for( var i = 0, n = array_length(funcTrees); i < n; i++ ) if(!funcTrees[i].isAnimated()) return false; @@ -132,7 +132,7 @@ function functionStringClean(fx) { //var _params = variable_clone(params); var val = 0; - for( var i = 0; i < array_length(funcTrees); i++ ) + for( var i = 0, n = array_length(funcTrees); i < n; i++ ) val = funcTrees[i].eval(params); return val; @@ -211,7 +211,7 @@ function functionStringClean(fx) { if(itr_array) { var _arr = cond_arr.eval(params); printIf(global.FLAG.expression_debug, $"<<<<<< FOR EACH {_arr} >>>>>>"); - for( var i = 0; i < array_length(_arr); i++ ) { + for( var i = 0, n = array_length(_arr); i < n; i++ ) { var val = _arr[i]; params[$ cond_iter] = val; @@ -289,7 +289,7 @@ function functionStringClean(fx) { if(ds_map_exists(global.FUNCTIONS, symbol)) { if(!is_array(l)) return false; - for( var i = 0; i < array_length(l); i++ ) + for( var i = 0, n = array_length(l); i < n; i++ ) if(!_validate(l[i])) return false; return true; } @@ -333,7 +333,7 @@ function functionStringClean(fx) { var _ev = _fn[1]; var _l = array_create(array_length(l)); - for( var i = 0; i < array_length(l); i++ ) + for( var i = 0, n = array_length(l); i < n; i++ ) _l[i] = getVal(l[i], params); var res = _ev(_l); @@ -352,7 +352,7 @@ function functionStringClean(fx) { res = v1; } else if(symbol == "【") { //array builder res = array_create(array_length(v1)); - for( var i = 0; i < array_length(res); i++ ) + for( var i = 0, n = array_length(res); i < n; i++ ) res[i] = getVal(v1[i], params); } else if(symbol == "@") { if(isLeft) res = [ v1, v2 ]; @@ -369,15 +369,15 @@ function functionStringClean(fx) { } } else if(is_array(v1) && !is_array(v2)) { res = array_create(array_length(v1)); - for( var i = 0; i < array_length(res); i++ ) + for( var i = 0, n = array_length(res); i < n; i++ ) res[i] = eval_real(array_safe_get(v1, i), v2); } else if(!is_array(v1) && is_array(v2)) { res = array_create(array_length(v2)); - for( var i = 0; i < array_length(res); i++ ) + for( var i = 0, n = array_length(res); i < n; i++ ) res[i] = eval_real(v1, array_safe_get(v2, i)); } else if(is_array(v1) && is_array(v2)) { res = array_create(max(array_length(v1), array_length(v2))); - for( var i = 0; i < array_length(res); i++ ) + for( var i = 0, n = array_length(res); i < n; i++ ) res[i] = eval_real(array_safe_get(v1, i), array_safe_get(v2, i)); } else res = eval_real(v1, v2); @@ -463,7 +463,7 @@ function functionStringClean(fx) { var call_st = ds_stack_create(); ds_stack_push(call_st, flist); - for( var i = 0; i < array_length(fxs); i++ ) { + for( var i = 0, n = array_length(fxs); i < n; i++ ) { var _fx = functionStringClean(fxs[i]); if(_fx == "") continue; diff --git a/scripts/string_function/string_function.gml b/scripts/string_function/string_function.gml index 430064929..3742346ac 100644 --- a/scripts/string_function/string_function.gml +++ b/scripts/string_function/string_function.gml @@ -37,7 +37,7 @@ function string_real(val, digMax = 999) { if(is_array(val)) { var s = "["; - for( var i = 0; i < array_length(val); i++ ) + for( var i = 0, n = array_length(val); i < n; i++ ) s += (i? ", " : "") + string_real(val[i]); return s + "]"; } diff --git a/scripts/string_splice/string_splice.gml b/scripts/string_splice/string_splice.gml index b9381c65c..d44fd63e6 100644 --- a/scripts/string_splice/string_splice.gml +++ b/scripts/string_splice/string_splice.gml @@ -7,7 +7,7 @@ function string_splice(str, delim = " ", keep = false) { while(1) { sp = 99999; var found = false; - for( var i = 0; i < array_length(delim); i++ ) { + for( var i = 0, n = array_length(delim); i < n; i++ ) { var pos = string_pos(delim[i], ss); if(pos) { sp = min(sp, pos); diff --git a/scripts/struct_functions/struct_functions.gml b/scripts/struct_functions/struct_functions.gml index e9cdaf1ac..83d889b15 100644 --- a/scripts/struct_functions/struct_functions.gml +++ b/scripts/struct_functions/struct_functions.gml @@ -3,7 +3,7 @@ function struct_override(original, override) { var args = variable_struct_get_names(override); - for( var i = 0; i < array_length(args); i++ ) { + for( var i = 0, n = array_length(args); i < n; i++ ) { if(!struct_has(original, args[i])) continue; original[$ args[i]] = override[$ args[i]]; } diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index dcf0c29ab..96a8b4ad8 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -346,7 +346,7 @@ function surface_array_free(arr) { return; } - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) surface_array_free(arr[i]); } @@ -360,7 +360,7 @@ function surface_array_clone(arr) { var _arr = []; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) _arr[i] = surface_array_clone(arr[i]); return _arr; @@ -386,7 +386,7 @@ function __surface_array_serialize(arr) { var _arr = []; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) _arr[i] = __surface_array_serialize(arr[i]); return _arr; @@ -409,7 +409,7 @@ function __surface_array_deserialize(arr) { var _arr = []; - for( var i = 0; i < array_length(arr); i++ ) + for( var i = 0, n = array_length(arr); i < n; i++ ) _arr[i] = __surface_array_deserialize(arr[i]); return _arr; diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index 753bc8cf8..6ed06f05e 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -261,7 +261,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod var _txtLines = string_splice(_input_text, "\n"); var ss = ""; - for( var i = 0; i < array_length(_txtLines); i++ ) { + for( var i = 0, n = array_length(_txtLines); i < n; i++ ) { var _txt = _txtLines[i] + (i < array_length(_txtLines)? "\n" : ""); var words = string_splice(_txt, " "); var currW = 0; @@ -499,7 +499,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod cut_line(); } - for( var i = 0; i < array_length(_input_text_line); i++ ) { + for( var i = 0, n = array_length(_input_text_line); i < n; i++ ) { _str = _input_text_line[i]; if(format == TEXT_AREA_FORMAT._default) @@ -522,7 +522,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod var ch_cxn = sx; var ch_y = _y; - for( var i = 0; i < array_length(_input_text_line); i++ ) { + for( var i = 0, n = array_length(_input_text_line); i < n; i++ ) { _str = string_trim_end(_input_text_line[i]); _l = string_length(_str); _ch_h = line_get_height(); @@ -641,7 +641,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod ch_sel_max = max(cursor_select, cursor); } - for( var i = 0; i < array_length(_input_text_line); i++ ) { + for( var i = 0, n = array_length(_input_text_line); i < n; i++ ) { _str = _input_text_line[i]; _l = string_length(_str); diff --git a/scripts/textArrayBox/textArrayBox.gml b/scripts/textArrayBox/textArrayBox.gml index 57f8474d2..2a4484563 100644 --- a/scripts/textArrayBox/textArrayBox.gml +++ b/scripts/textArrayBox/textArrayBox.gml @@ -21,7 +21,7 @@ function textArrayBox(arraySet, data, onModify = noone) : widget() constructor { var th = hh + ui(8); draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - for( var i = 0; i < array_length(arraySet); i++ ) { + for( var i = 0, n = array_length(arraySet); i < n; i++ ) { var ww = string_width(arraySet[i]) + ui(16); if(tx + ww + ui(2) > _x + _w - ui(8)) { tx = _x + ui(4); @@ -55,7 +55,7 @@ function textArrayBox(arraySet, data, onModify = noone) : widget() constructor { var hh = line_get_height(f_p0, ui(4)); draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - for( var i = 0; i < array_length(arraySet); i++ ) { + for( var i = 0, n = array_length(arraySet); i < n; i++ ) { var ww = string_width(arraySet[i]) + ui(16); if(tx + ww + ui(2) > _x + _w - ui(8)) { tx = _x + ui(4); diff --git a/scripts/transformBox/transformBox.gml b/scripts/transformBox/transformBox.gml index 53a52b338..293c5e6b4 100644 --- a/scripts/transformBox/transformBox.gml +++ b/scripts/transformBox/transformBox.gml @@ -25,7 +25,7 @@ function transformBox(_onModify) : widget() constructor { static setInteract = function(interactable = noone) { self.interactable = interactable; - for( var i = 0; i < array_length(tb); i++ ) + for( var i = 0, n = array_length(tb); i < n; i++ ) tb[i].setInteract(interactable); rot.setInteract(interactable); } diff --git a/scripts/vertex_function/vertex_function.gml b/scripts/vertex_function/vertex_function.gml index 94c7afffe..a69aa0292 100644 --- a/scripts/vertex_function/vertex_function.gml +++ b/scripts/vertex_function/vertex_function.gml @@ -18,4 +18,9 @@ function vertex_add_pnt(vertex, position, normal, texture) { vertex_position_3d(vertex, position[0], position[1], position[2]); vertex_normal(vertex, normal[0], normal[1], normal[2]); vertex_texcoord(vertex, texture[0], texture[1]); +} + +function vertex_add_2pc(vertex, _x, _y, color, alpha = 1) { + vertex_position(vertex, _x, _y); + vertex_color(vertex, color, alpha); } \ No newline at end of file diff --git a/scripts/window_functions/window_functions.gml b/scripts/window_functions/window_functions.gml index 2dcfbf558..b59ef5797 100644 --- a/scripts/window_functions/window_functions.gml +++ b/scripts/window_functions/window_functions.gml @@ -1,7 +1,7 @@ function window_close() { var noSave = true; - for( var i = 0; i < array_length(PROJECTS); i++ ) { + for( var i = 0, n = array_length(PROJECTS); i < n; i++ ) { var project = PROJECTS[i]; //print($"Project {filename_name_only(project)} modified: {project.modified} readonly: {project.readonly}"); diff --git a/shaders/sh_de_stray/sh_de_stray.fsh b/shaders/sh_de_stray/sh_de_stray.fsh index 2ba5aabae..aba85bdf8 100644 --- a/shaders/sh_de_stray/sh_de_stray.fsh +++ b/shaders/sh_de_stray/sh_de_stray.fsh @@ -7,32 +7,35 @@ varying vec4 v_vColour; uniform vec2 dimension; uniform float tolerance; -bool sameColor(in vec4 c1, in vec4 c2) { - return length(c1 - c2) <= tolerance; -} +bool sameColor(in vec4 c1, in vec4 c2) { return length(c1.rgb * c1.a - c2.rgb * c2.a) <= tolerance; } +int sameColorInt(in vec4 c1, in vec4 c2) { return sameColor(c1, c2)? 1 : 0; } void main() { - vec4 curr_color = texture2D( gm_BaseTexture, v_vTexcoord ); - - vec2 _dim = 1. / dimension; + vec2 tx = 1. / dimension; - vec4 T = texture2D( gm_BaseTexture, v_vTexcoord + vec2(0., _dim.y)); - vec4 B = texture2D( gm_BaseTexture, v_vTexcoord + vec2(0., -_dim.y)); + vec4 a0 = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tx.x, -tx.y)); + vec4 a1 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., -tx.y)); + vec4 a2 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, -tx.y)); - vec4 L = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-_dim.x, 0.)); - vec4 R = texture2D( gm_BaseTexture, v_vTexcoord + vec2( _dim.x, 0.)); + vec4 a3 = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tx.x, 0.)); + vec4 a4 = texture2D( gm_BaseTexture, v_vTexcoord ); + vec4 a5 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, 0.)); - if(!sameColor(curr_color, T)) { - if(sameColor(T, B) && sameColor(B, L) && sameColor(L, R)) - curr_color = T; - else if(sameColor(T, L) && sameColor(T, R)) - curr_color = T; - else if(sameColor(T, B) && sameColor(T, R)) - curr_color = T; - else if(sameColor(T, B) && sameColor(T, L)) - curr_color = T; - } else if(!sameColor(curr_color, B) && sameColor(B, L) && sameColor(B, R)) - curr_color = B; + vec4 a6 = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tx.x, tx.y)); + vec4 a7 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., tx.y)); + vec4 a8 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, tx.y)); - gl_FragColor = curr_color; + gl_FragColor = a4; + if(sameColor(a1, a4)) return; + + bool sideEqual = sameColor(a1, a3) && sameColor(a1, a5) && sameColor(a1, a7); + if(!sideEqual) return; + + int cornerEqual = sameColorInt(a1, a0) + + sameColorInt(a1, a2) + + sameColorInt(a1, a6) + + sameColorInt(a1, a8); + + if(cornerEqual == 4) + gl_FragColor = a0; } diff --git a/sprites/s_menu_black/9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png b/sprites/s_menu_black/9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png index ec255e16672d81be9572a58ea48530ed6d55715a..d99a37d566ff76935c64a5880719d1c811d24979 100644 GIT binary patch literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`3dtTpz6=aiY77hwEes65fI|H(?C?f0W;uvCaIyogF;m3Ig z#)L&KpI0z0X6unMn8Cxq;OoFB|6)0_6HuXQiEBhjN@7W>RdP`(kYX@0Ff!IPFxNFQ z4KXygGBU6-w$L^(ure^Xa$d?AMMG|WN@iLmZVgK(E&31CpaHj`Br`X)xFj*R0Jok` S?ac~6Jq(_%elF{r5}E)EaZt1X literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzV^0^ykcv5PFKp*!VBldgX#4ZO z=#*$=&k>#?)t7IhUlreBWMbhEP;h8qfHEE!xfU=s#JDkU0cvOPboFyt=akR{0J29N ANB{r; diff --git a/sprites/s_menu_black/layers/9670b74a-f77e-43b6-88c5-ec7fdf6e7473/5c2034af-3f49-45f4-b2e7-9a4e627c2da7.png b/sprites/s_menu_black/layers/9670b74a-f77e-43b6-88c5-ec7fdf6e7473/5c2034af-3f49-45f4-b2e7-9a4e627c2da7.png index ec255e16672d81be9572a58ea48530ed6d55715a..d99a37d566ff76935c64a5880719d1c811d24979 100644 GIT binary patch literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`3dtTpz6=aiY77hwEes65fI|H(?C?f0W;uvCaIyogF;m3Ig z#)L&KpI0z0X6unMn8Cxq;OoFB|6)0_6HuXQiEBhjN@7W>RdP`(kYX@0Ff!IPFxNFQ z4KXygGBU6-w$L^(ure^Xa$d?AMMG|WN@iLmZVgK(E&31CpaHj`Br`X)xFj*R0Jok` S?ac~6Jq(_%elF{r5}E)EaZt1X literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzV^0^ykcv5PFKp*!VBldgX#4ZO z=#*$=&k>#?)t7IhUlreBWMbhEP;h8qfHEE!xfU=s#JDkU0cvOPboFyt=akR{0J29N ANB{r; diff --git a/sprites/s_menu_black/s_menu_black.yy b/sprites/s_menu_black/s_menu_black.yy index 835cad226..ca9ca1143 100644 --- a/sprites/s_menu_black/s_menu_black.yy +++ b/sprites/s_menu_black/s_menu_black.yy @@ -2,9 +2,9 @@ "resourceType": "GMSprite", "resourceVersion": "1.0", "name": "s_menu_black", - "bbox_bottom": 31, + "bbox_bottom": 15, "bbox_left": 0, - "bbox_right": 31, + "bbox_right": 15, "bbox_top": 0, "bboxMode": 0, "collisionKind": 1, @@ -17,7 +17,7 @@ ], "gridX": 0, "gridY": 0, - "height": 32, + "height": 16, "HTile": false, "layers": [ {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"5c2034af-3f49-45f4-b2e7-9a4e627c2da7","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,}, @@ -59,8 +59,8 @@ ], "visibleRange": null, "volume": 1.0, - "xorigin": 16, - "yorigin": 16, + "xorigin": 8, + "yorigin": 8, }, "swatchColours": null, "swfPrecision": 2.525, @@ -70,5 +70,5 @@ }, "type": 0, "VTile": false, - "width": 32, + "width": 16, } \ No newline at end of file diff --git a/sprites/s_menu_transparent/9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png b/sprites/s_menu_transparent/9670b74a-f77e-43b6-88c5-ec7fdf6e7473.png index 6ed6fc83d1351521ecd2e5fa81e4279467311780..7e69eee1347bc0d037f16332c55c59e877737a0d 100644 GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`3dtTpz6=aiY77hwEes65fI|H(?D5B@-;uvCaI@!d${O9=w zb`MX@hm+G1k`@T`NEt}*Bq)lUKR@rT^piLV(*`b}rACgdnwH+*#eq6iOI#yLQW8s2 zt&)pUffR$0fswJUfw``cX^5e@m63s!v4ysQft7*5mGe^0C>nC}Q!>*kacfvQY0-b6 j1`W6kC7HRY#U+Wk1-SKmYHwBm>S6G7^>bP0l+XkKO!`(| literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJKu;IPkcv5Pr*7nAP~c(N|3foq zR}1%!{~XgIo!dJET6X_?xI^UQoYyNHj;uKI^wKXzH;1zljHbyfS9$~kjNKHv{@WB6 lGjRnpFo`T+VEw08z!|H(?D5B@-;uvCaI@!d${O9=w zb`MX@hm+G1k`@T`NEt}*Bq)lUKR@rT^piLV(*`b}rACgdnwH+*#eq6iOI#yLQW8s2 zt&)pUffR$0fswJUfw``cX^5e@m63s!v4ysQft7*5mGe^0C>nC}Q!>*kacfvQY0-b6 j1`W6kC7HRY#U+Wk1-SKmYHwBm>S6G7^>bP0l+XkKO!`(| literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJKu;IPkcv5Pr*7nAP~c(N|3foq zR}1%!{~XgIo!dJET6X_?xI^UQoYyNHj;uKI^wKXzH;1zljHbyfS9$~kjNKHv{@WB6 lGjRnpFo`T+VEw08z!|H(?C?f0W;uvCaI{DB4|NraR zxEO?0XSwrAm?m6lIGDn~kbR0p=DdRdP`(kYX@0Ff!IPFxNFQ z4KXygGBU6-w$L^(ure^Xa$d?AMMG|WN@iLmZVgK(E&31CpaHj`Br`X)xFj*R0Jok` S?ac~6Jq(_%elF{r5}E+PwNbSI literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzBTpB{kcv5PFPIB5Fz_&M|H(?C?f0W;uvCaI{DB4|NraR zxEO?0XSwrAm?m6lIGDn~kbR0p=DdRdP`(kYX@0Ff!IPFxNFQ z4KXygGBU6-w$L^(ure^Xa$d?AMMG|WN@iLmZVgK(E&31CpaHj`Br`X)xFj*R0Jok` S?ac~6Jq(_%elF{r5}E+PwNbSI literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzBTpB{kcv5PFPIB5Fz_&M