diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 185c797e3..f13f056d4 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -553,7 +553,6 @@ {"name":"d3d_plane_bend_mesh","order":16,"path":"scripts/d3d_plane_bend_mesh/d3d_plane_bend_mesh.yy",}, {"name":"d3d_plane_mesh","order":14,"path":"scripts/d3d_plane_mesh/d3d_plane_mesh.yy",}, {"name":"d3d_plane","order":2,"path":"scripts/d3d_plane/d3d_plane.yy",}, - {"name":"panel_hlsl_libraries","order":3,"path":"scripts/panel_hlsl_libraries/panel_hlsl_libraries.yy",}, {"name":"d3d_ray","order":9,"path":"scripts/d3d_ray/d3d_ray.yy",}, {"name":"d3d_rot3","order":3,"path":"scripts/d3d_rot3/d3d_rot3.yy",}, {"name":"d3d_scene","order":3,"path":"scripts/d3d_scene/d3d_scene.yy",}, @@ -1340,6 +1339,7 @@ {"name":"panel_graph_grid_settings","order":7,"path":"scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy",}, {"name":"panel_graph_view_settings","order":8,"path":"scripts/panel_graph_view_settings/panel_graph_view_settings.yy",}, {"name":"panel_history","order":8,"path":"scripts/panel_history/panel_history.yy",}, + {"name":"panel_hlsl_libraries","order":3,"path":"scripts/panel_hlsl_libraries/panel_hlsl_libraries.yy",}, {"name":"panel_image_array_editor","order":1,"path":"scripts/panel_image_array_editor/panel_image_array_editor.yy",}, {"name":"panel_inspector","order":1,"path":"scripts/panel_inspector/panel_inspector.yy",}, {"name":"panel_keyframe_driver","order":2,"path":"scripts/panel_keyframe_driver/panel_keyframe_driver.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index f9eccc293..d28f5dfb7 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1308,7 +1308,11 @@ {"$GMIncludedFile":"","%Name":"Canvas.png","CopyToMask":-1,"filePath":"datafiles/data/Welcome files/Templates","name":"Canvas.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"Canvas.pxc","CopyToMask":-1,"filePath":"datafiles/data/Welcome files/Templates","name":"Canvas.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"Welcome files.zip","CopyToMask":-1,"filePath":"datafiles/data/Welcome files","name":"Welcome files.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, - {"$GMIncludedFile":"","%Name":"dllcredits.txt","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":0,"filePath":"datafiles","name":"dllcredits.txt","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"dllcredits.txt","ConfigValues":{ + "Itch":{ + "CopyToMask":"0", + }, + },"CopyToMask":0,"filePath":"datafiles","name":"dllcredits.txt","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"dlltest1.dll","CopyToMask":-1,"filePath":"datafiles","name":"dlltest1.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"ffmpeg.exe","CopyToMask":-1,"filePath":"datafiles/ffmpeg/bin","name":"ffmpeg.exe","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"LICENSE","CopyToMask":-1,"filePath":"datafiles/ffmpeg","name":"LICENSE","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -1327,7 +1331,11 @@ {"$GMIncludedFile":"","%Name":"mf.dll","CopyToMask":-1,"filePath":"datafiles","name":"mf.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles","name":"mfcore.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles","name":"mfplat.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, - {"$GMIncludedFile":"","%Name":"PixelComposer_profile-2.provisionprofile","ConfigValues":{"Itch":{"CopyToMask":"2",},},"CopyToMask":-1,"filePath":"datafiles","name":"PixelComposer_profile-2.provisionprofile","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"PixelComposer_profile-2.provisionprofile","ConfigValues":{ + "Itch":{ + "CopyToMask":"2", + }, + },"CopyToMask":-1,"filePath":"datafiles","name":"PixelComposer_profile-2.provisionprofile","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"data.win","CopyToMask":-1,"filePath":"datafiles/report","name":"data.win","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"execute_shell_simple_ext_x64.dll","CopyToMask":-1,"filePath":"datafiles/report","name":"execute_shell_simple_ext_x64.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"options.ini","CopyToMask":-1,"filePath":"datafiles/report","name":"options.ini","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -2563,6 +2571,7 @@ {"id":{"name":"panel_graph_view_settings","path":"scripts/panel_graph_view_settings/panel_graph_view_settings.yy",},}, {"id":{"name":"panel_graph","path":"scripts/panel_graph/panel_graph.yy",},}, {"id":{"name":"panel_history","path":"scripts/panel_history/panel_history.yy",},}, + {"id":{"name":"panel_hlsl_libraries","path":"scripts/panel_hlsl_libraries/panel_hlsl_libraries.yy",},}, {"id":{"name":"panel_image_array_editor","path":"scripts/panel_image_array_editor/panel_image_array_editor.yy",},}, {"id":{"name":"panel_inspector","path":"scripts/panel_inspector/panel_inspector.yy",},}, {"id":{"name":"panel_keyframe_driver","path":"scripts/panel_keyframe_driver/panel_keyframe_driver.yy",},}, @@ -2650,7 +2659,6 @@ {"id":{"name":"sprite_add_functions","path":"scripts/sprite_add_functions/sprite_add_functions.yy",},}, {"id":{"name":"sprite_loader","path":"scripts/sprite_loader/sprite_loader.yy",},}, {"id":{"name":"stack_functions","path":"scripts/stack_functions/stack_functions.yy",},}, - {"id":{"name":"panel_hlsl_libraries","path":"scripts/panel_hlsl_libraries/panel_hlsl_libraries.yy",},}, {"id":{"name":"steam_ugc_collection","path":"scripts/steam_ugc_collection/steam_ugc_collection.yy",},}, {"id":{"name":"steam_ugc_functions","path":"scripts/steam_ugc_functions/steam_ugc_functions.yy",},}, {"id":{"name":"steam_ugc_project","path":"scripts/steam_ugc_project/steam_ugc_project.yy",},}, diff --git a/datafiles/data/Nodes/Internal.zip b/datafiles/data/Nodes/Internal.zip index 26206c923..2eab9fb46 100644 Binary files a/datafiles/data/Nodes/Internal.zip and b/datafiles/data/Nodes/Internal.zip differ diff --git a/scripts/color_selector/color_selector.gml b/scripts/color_selector/color_selector.gml index c1f6d58ef..fd11101ef 100644 --- a/scripts/color_selector/color_selector.gml +++ b/scripts/color_selector/color_selector.gml @@ -159,7 +159,7 @@ function colorSelector(onApply = noone) constructor { DROPPER_SURFACE = surface_verify(DROPPER_SURFACE, _ww, _ww); surface_set_target(DROPPER_SURFACE); - DRAW_CLEAR; + DRAW_CLEAR gpu_set_colorwriteenable(0, 0, 0, 1); draw_set_color(c_white); diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 3b6339ae5..9a41c22de 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -43,7 +43,7 @@ LATEST_VERSION = 1_18_00_0; VERSION = 1_18_07_2; SAVE_VERSION = 1_18_05_0; - VERSION_STRING = MAC? "1.18.003m" : "1.18.8.007"; + VERSION_STRING = MAC? "1.18.003m" : "1.18.8.008"; BUILD_NUMBER = 118072; PREF_VERSION = 1_17_1; diff --git a/scripts/hlsl_server/hlsl_server.gml b/scripts/hlsl_server/hlsl_server.gml index c51bca1f4..2c89f1bdf 100644 --- a/scripts/hlsl_server/hlsl_server.gml +++ b/scripts/hlsl_server/hlsl_server.gml @@ -65,7 +65,9 @@ global.HLSL_FUNCTIONS[? "trunc"] = ["x"]; #endregion -global.HLSL_VAR = [ "float", "int", "float2", "float3", "float4", "float3x3", "float4x4", "sampler" ]; +global.HLSL_VAR_ARR = [ "float", "int", "float2", "float3", "float4", "float3x3", "float4x4", "sampler" ]; +global.HLSL_VAR = {}; +for( var i = 0, n = array_length(global.HLSL_VAR_ARR); i < n; i++ ) global.HLSL_VAR[$ global.HLSL_VAR_ARR[i]] = 1; function hlsl_document_parser(prompt, node = noone) { var params = []; @@ -79,28 +81,32 @@ function hlsl_document_parser(prompt, node = noone) { if(_arg_type == 7) { array_push(params, [ _arg_name + "Object", "Texture2D" ]); array_push(params, [ _arg_name, "SamplerState" ]); - } else array_push(params, [ _arg_name, array_safe_get_fast(global.HLSL_VAR, _arg_type) ]); + } else array_push(params, [ _arg_name, array_safe_get_fast(global.HLSL_VAR_ARR, _arg_type) ]); } for( var i = 0, n = array_length(lines); i < n; i++ ) { - var line = string_trim(lines[i]); + var line = string_trim(lines[i], [ "\n", "\t", "\r", " ", ";", "{", "}" ]); + line = string_replace_all(line, "(", " ("); + line = string_replace_all(line, ")", ") "); + var _token = string_split(line, " "); - var _vari = false; - var _vart = ""; - var _vars = ""; + if(!struct_has(global.HLSL_VAR, _token[0])) continue; - for( var j = 0, m = array_length(_token); j < m; j++ ) { - if(_vari) - _vars += _token[j]; + var _vart = _token[0]; + var _vars = ""; + var _eld = 0; + + for( var j = 1, m = array_length(_token); j < m; j++ ) { + var _t = string_trim(_token[j]); - if(array_exists(global.HLSL_VAR, _token[j])) { - _vart = _token[j]; - _vari = true; - } + if(struct_has(global.HLSL_VAR, _t)) continue; + + if(string_char_at(_t, 1) == "(") { _eld++; continue; } + if(string_char_at(_t, string_length(_t)) == ")") { _eld--; continue; } + + if(_eld == 0) _vars += _t; } - _vars = string_replace_all(_vars, ";", ""); - _vars = string_replace_all(_vars, " ", ""); _vars = string_splice(_vars, ","); var _varType = []; @@ -140,8 +146,8 @@ function hlsl_autocomplete_server(prompt, params = []) { ////////////////////////////////// ds_priority_clear(pr_list); - for( var i = 0, n = array_length(global.HLSL_VAR); i < n; i++ ) { - var gl = global.HLSL_VAR[i]; + for( var i = 0, n = array_length(global.HLSL_VAR_ARR); i < n; i++ ) { + var gl = global.HLSL_VAR_ARR[i]; var match = string_partial_match(string_lower(gl), string_lower(prompt)); if(match == -9999) continue; diff --git a/scripts/node_hlsl/node_hlsl.gml b/scripts/node_hlsl/node_hlsl.gml index debdcd5e9..4780750fb 100644 --- a/scripts/node_hlsl/node_hlsl.gml +++ b/scripts/node_hlsl/node_hlsl.gml @@ -78,8 +78,9 @@ output.color = surfaceColor;")) argumentRenderer(); - vs_string = "#define MATRIX_WORLD 0\n#define MATRIX_WORLD_VIEW 1\n#define MATRIX_WORLD_VIEW_PROJECTION 2"; - vs_string += @" + #region Template + vs_string = "#define MATRIX_WORLD 0\n#define MATRIX_WORLD_VIEW 1\n#define MATRIX_WORLD_VIEW_PROJECTION 2"; + vs_string += @" cbuffer Matrices : register(b0) { float4x4 gm_Matrices[3]; @@ -101,7 +102,7 @@ void main(in VertexShaderInput input, out VertexShaderOutput output) { output.uv = input.uv; }"; - fs_preMain = @"Texture2D gm_BaseTextureObject : register(t0); + fs_preMain = @"Texture2D gm_BaseTextureObject : register(t0); SamplerState gm_BaseTexture : register(s0); struct VertexShaderOutput { @@ -114,12 +115,15 @@ struct PixelShaderOutput { }; "; - fs_postMain = @"void main(in VertexShaderOutput _input, out PixelShaderOutput output) { + fs_postMain = @"void main(in VertexShaderOutput _input, out PixelShaderOutput output) { VertexShaderOutput input = _input; "; - fs_postString = "}"; + fs_postString = "}"; + #endregion + libraries = []; + libraryParams = []; preMainLabel = new Inspector_Label(fs_preMain, _f_code_s); postMainLabel = new Inspector_Label(fs_postMain, _f_code_s); @@ -311,7 +315,10 @@ struct PixelShaderOutput { if(project.data[$ "hlsl"] == undefined) project.data[$ "hlsl"] = {}; - var fs_lib = "\n"; + libraries = []; + libraryParams = []; + var fs_lib = "\n"; + for( var i = 0, n = array_length(_libs); i < n; i++ ) { var _l = _libs[i]; var _ll = _l; @@ -327,6 +334,9 @@ struct PixelShaderOutput { project.data.hlsl[$ _ll] = file_read_all(HLSL_LIBRARIES[$ _ll]) } + array_push(libraries, _ll); + array_append(libraryParams, hlsl_document_parser(project.data.hlsl[$ _ll])); + fs_lib += $"{project.data.hlsl[$ _ll]}\n"; } fs_lib += "\n"; @@ -355,7 +365,19 @@ struct PixelShaderOutput { } } + static onCodeEdited = function() { + var _global_edit = inputs[4].editWidget; + var _fsmain_edit = inputs[1].editWidget; + var _globalParams = array_clone(_global_edit.localParams); + array_append(_globalParams, libraryParams); + + _global_edit.globalParams = libraryParams; + _fsmain_edit.globalParams = _globalParams; + } + static processData = function(_output, _data, _output_index, _array_index = 0) { + onCodeEdited(); + var _surf = _data[2]; if(!is_surface(_surf)) return noone; if(!d3d11_shader_exists(shader.vs)) return noone; diff --git a/scripts/panel_hlsl_libraries/panel_hlsl_libraries.gml b/scripts/panel_hlsl_libraries/panel_hlsl_libraries.gml index 63c2637f9..c777d1463 100644 --- a/scripts/panel_hlsl_libraries/panel_hlsl_libraries.gml +++ b/scripts/panel_hlsl_libraries/panel_hlsl_libraries.gml @@ -22,10 +22,8 @@ Libraries in the global scope will be add to project automatically."; if(curr_lib == "") { blank_text = s; return; } curr_content = s; - if(curr_type == 0) - file_text_write_all(curr_file, s); - else if(curr_type == 1) - libData[$ curr_lib] = curr_content; + if(curr_type == 0) file_text_write_all(curr_file, s); + else if(curr_type == 1) libData[$ curr_lib] = curr_content; }); editor.font = f_code; diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index ba1ec7259..aec873f21 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -137,12 +137,14 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor var crop = string_copy(_input_text, 1, cursor); var slp = string_splice(crop, [" ", "(", "[", "{", ",", "\n"]); var pmt = array_safe_get(slp, -1,, ARRAY_OVERFLOW.loop); + var _vars = []; - var localParams = []; - if(parser_server != noone) + if(parser_server != noone) { localParams = parser_server(crop, autocomplete_object); + _vars = array_append(localParams, globalParams); + } - var data = autocomplete_server(pmt, localParams, autocomplete_context); + var data = autocomplete_server(pmt, _vars, autocomplete_context); o_dialog_textbox_autocomplete.data = data; if(array_length(data)) { diff --git a/scripts/textInput/textInput.gml b/scripts/textInput/textInput.gml index 73966a4ac..6fd26fe59 100644 --- a/scripts/textInput/textInput.gml +++ b/scripts/textInput/textInput.gml @@ -9,6 +9,8 @@ function textInput(_input, _onModify) : widget() constructor { select_on_click = true; parser_server = noone; + globalParams = []; + localParams = []; autocomplete_delay = 0; autocomplete_modi = false;