From 63efb6be3c7ebadfed9c4cf2eed6ad4e05bcb592 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Fri, 5 Jul 2024 07:57:06 +0700 Subject: [PATCH] - [Preview Panel] Fix view range not apply to sdf shape. --- objects/o_dialog_add_node/Create_0.gml | 2 +- scripts/node_registry/node_registry.gml | 4 ++-- scripts/node_registry/node_registry.yy | 2 +- scripts/panel_preview/panel_preview.gml | 1 + scripts/panel_preview/panel_preview.yy | 2 +- scripts/string_functions/string_functions.gml | 14 ++++++++------ 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 9c02c0db5..98deafbe5 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -787,7 +787,7 @@ event_inherited(); if(match == -9999) continue; - ds_priority_add(pr_list, [_node, param], match); + ds_priority_add(pr_list, [ _node, param ], match); search_map[? _node] = 1; } } diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 103099190..08860ac1e 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -695,9 +695,9 @@ function __initNodes() { addNodeObject(d3d, "Point Affector", s_node_3d_point_affector, "Node_3D_Point_Affector", [1, Node_3D_Point_Affector],, "Generate array of 3D points interpolating between two values based on the distance.").setVersion(11570); ds_list_add(d3d, "Ray Marching"); - addNodeObject(d3d, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive], ["ray marching"]).setVersion(11720); + addNodeObject(d3d, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive], ["ray marching", "rm object"]).setVersion(11720); addNodeObject(d3d, "RM Terrain", s_node_rm_terrain, "Node_RM_Terrain", [1, Node_RM_Terrain], ["ray marching"]).setVersion(11720); - addNodeObject(d3d, "RM Combine", s_node_rm_combine, "Node_RM_Combine", [1, Node_RM_Combine], ["ray marching"]).setVersion(11740); + addNodeObject(d3d, "RM Combine", s_node_rm_combine, "Node_RM_Combine", [1, Node_RM_Combine], ["ray marching", "rm boolean"]).setVersion(11740); addNodeObject(d3d, "RM Render", s_node_rm_render, "Node_RM_Render", [1, Node_RM_Render], ["ray marching"]).setVersion(11740); #endregion diff --git a/scripts/node_registry/node_registry.yy b/scripts/node_registry/node_registry.yy index 9c9bf3792..89f8acbbc 100644 --- a/scripts/node_registry/node_registry.yy +++ b/scripts/node_registry/node_registry.yy @@ -1,5 +1,5 @@ { - "$GMScript":"v1", + "$GMScript":"", "%Name":"node_registry", "isCompatibility":false, "isDnD":false, diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 40ac0959e..3ecf9f853 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -1211,6 +1211,7 @@ function Panel_Preview() : PanelContent() constructor { shader_set_f("gridStep", _step); shader_set_f("gridScale", zm / 2); shader_set_f("axisBlend", 1.); + shader_set_f("viewRange", [ d3_view_camera.view_near, d3_view_camera.view_far ]); draw_sprite_stretched(s_fx_pixel, 0, 0, 0, w, h); shader_reset(); diff --git a/scripts/panel_preview/panel_preview.yy b/scripts/panel_preview/panel_preview.yy index 344b4701d..0b6e98075 100644 --- a/scripts/panel_preview/panel_preview.yy +++ b/scripts/panel_preview/panel_preview.yy @@ -1,5 +1,5 @@ { - "$GMScript":"v1", + "$GMScript":"", "%Name":"panel_preview", "isCompatibility":false, "isDnD":false, diff --git a/scripts/string_functions/string_functions.gml b/scripts/string_functions/string_functions.gml index 964fb3481..181183e97 100644 --- a/scripts/string_functions/string_functions.gml +++ b/scripts/string_functions/string_functions.gml @@ -7,21 +7,23 @@ function string_to_array(str) { #region } #endregion function string_partial_match(str, key) { #region - var amo = string_length(str); - var run = 1; - var consec = 0; - var conMax = 0; + var amo = string_length(str); + var run = 1; + var consec = 0; + var conMax = 0; var misMatch = 0; - var kchr = string_char_at(key, run); + var kchr = string_char_at(key, run); + var ch; for( var i = 1; i <= amo; i++ ) { - var ch = string_char_at(str, i); + ch = string_char_at(str, i); if(ch == kchr) { consec++; conMax = max(conMax, consec); run++; if(run > string_length(key)) return conMax - (misMatch + (amo - i)); kchr = string_char_at(key, run); + } else { consec = 0; misMatch += amo - i;