From ec4a31d19f69843bbb3106ba375804a4ff7e9c22 Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:23:24 +0200 Subject: [PATCH] Unfreeze vertex buffer --- PixelComposer.resource_order | 2 +- PixelComposer.yyp | 2 +- datafiles/data/themes/default.zip | Bin 4045707 -> 4045712 bytes objects/o_dialog_about/Create_0.gml | 1 + objects/o_dialog_release_note/Create_0.gml | 13 +- scripts/argumentRenderer/argumentRenderer.gml | 12 +- scripts/d3d_object/d3d_object.gml | 2 +- scripts/d3d_scene/d3d_scene.gml | 4 +- .../d3d_surface_extrude.gml | 211 ++++-------------- scripts/d3d_vertex/d3d_vertex.gml | 2 +- scripts/hlsl_draw/hlsl_draw.gml | 36 ++- scripts/luaHighlight/luaHighlight.gml | 4 +- scripts/node_registry/node_registry.gml | 24 +- scripts/node_value/node_value.gml | 2 +- .../panel_text_editor/panel_text_editor.gml | 2 +- scripts/quarternionBox/quarternionBox.gml | 15 +- .../string_functions.gml} | 21 +- .../string_functions.yy} | 2 +- scripts/textArea/textArea.gml | 8 +- 19 files changed, 145 insertions(+), 218 deletions(-) rename scripts/{string_function/string_function.gml => string_functions/string_functions.gml} (75%) rename scripts/{string_function/string_function.yy => string_functions/string_functions.yy} (86%) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 4b893adc7..dc223cd90 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -628,7 +628,7 @@ {"name":"__vertex_function","order":1,"path":"scripts/__vertex_function/__vertex_function.yy",}, {"name":"node_path_anchor","order":13,"path":"scripts/node_path_anchor/node_path_anchor.yy",}, {"name":"s_node_path_wave","order":7,"path":"sprites/s_node_path_wave/s_node_path_wave.yy",}, - {"name":"string_function","order":6,"path":"scripts/string_function/string_function.yy",}, + {"name":"string_functions","order":6,"path":"scripts/string_functions/string_functions.yy",}, {"name":"o_dialog_palette","order":2,"path":"objects/o_dialog_palette/o_dialog_palette.yy",}, {"name":"sh_blend_hue","order":17,"path":"shaders/sh_blend_hue/sh_blend_hue.yy",}, {"name":"s_node_threshold","order":47,"path":"sprites/s_node_threshold/s_node_threshold.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index ebec19c73..f7c698434 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1219,7 +1219,7 @@ {"id":{"name":"__vertex_function","path":"scripts/__vertex_function/__vertex_function.yy",},}, {"id":{"name":"node_path_anchor","path":"scripts/node_path_anchor/node_path_anchor.yy",},}, {"id":{"name":"s_node_path_wave","path":"sprites/s_node_path_wave/s_node_path_wave.yy",},}, - {"id":{"name":"string_function","path":"scripts/string_function/string_function.yy",},}, + {"id":{"name":"string_functions","path":"scripts/string_functions/string_functions.yy",},}, {"id":{"name":"o_dialog_palette","path":"objects/o_dialog_palette/o_dialog_palette.yy",},}, {"id":{"name":"sh_blend_hue","path":"shaders/sh_blend_hue/sh_blend_hue.yy",},}, {"id":{"name":"_f_p0","path":"fonts/_f_p0/_f_p0.yy",},}, diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index fdeaed05fbc2462004cb89d3fc6dcf1007b76baf..56d061ea0ccd06199e963992a3e780ab3242d777 100644 GIT binary patch delta 1567 zcmV+)2H^RN_x1sh_x1sRgaL#Cgad>Ggaw2Kga?EOgb9QSgbRcWgbjoagb#!egb{=i zgcF1mgcXDqgcpPugc*bygd2n$gdKz)gdc<;gdv0?gd>C`ge8O~geQb3gein7ge!zB zge`e*Ny+)4j*AfZ%G6iXo5jr_U?Uf*-R`;a)&|mlEQ{5vzc}%M8nJJO-3~u{tCV!}VSi2yh8OHp zrAxwGRYaLljT=`Ki&N#gAgAKOXlM5YmV{_2aEtS1CiNPhr;nJkD+? zFf^oxAfUDXZm#r|DfQQ=uAvtSHQV|zf(ZE10HZ>By(E1Pd=qu&ZZmEXx{hY;Ha%p2H!mATG4K+)L0oTUo-_7wmD01` zXC(r}VF_7Yq~CQW-?Phr#J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S za4Cy4P4=*|;OTku2EJXYW^iy|{aPFTH*0zAtQnV0T}C7(x>cM!SzzB1L)dY(vLcMl z6Y3$(=0Fbdmh|bhRb>psd(Bz|?Gj}}wrCj;X39DEp==vuDA3bsr0VulitC`Ga}>~d zQP;@(Vu_Gk6MTZ%?0^0I^FOzjJ3X#{4GLB;R~RgLfFA|`07#coyFEAtk~=*B006CA B<*@(& diff --git a/objects/o_dialog_about/Create_0.gml b/objects/o_dialog_about/Create_0.gml index 731671ffe..3f7d9f13c 100644 --- a/objects/o_dialog_about/Create_0.gml +++ b/objects/o_dialog_about/Create_0.gml @@ -21,6 +21,7 @@ event_inherited(); [ "Triangle grid", "Farini" ], [ "Pixel sort", "Ciphrd" ], [ "Simplex noise", "Ian McEwan" ], + [ "BBMOD", "BlueBurn" ], [ "Additional help", "ChatGPT by OpenAI" ], ] diff --git a/objects/o_dialog_release_note/Create_0.gml b/objects/o_dialog_release_note/Create_0.gml index a5390ee51..27ef4b0da 100644 --- a/objects/o_dialog_release_note/Create_0.gml +++ b/objects/o_dialog_release_note/Create_0.gml @@ -68,6 +68,7 @@ event_inherited(); draw_sprite_ui_uniform(THEME.text_bullet, 0, _x - ui(12), _y + yy + ui(18), 1, COLORS._main_icon); var _lx = _x; + var _topic = false; draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); for( var j = 1, m = array_length(_stx); j < m; j++ ) { @@ -79,12 +80,14 @@ event_inherited(); } if(string_char_at(_word, 1) == "[") - draw_set_color(COLORS._main_text_accent); - else - draw_set_color(COLORS._main_text); - - draw_text(_x, _y + yy, _word); + _topic = true; + + draw_set_color(_topic? COLORS._main_text_accent : COLORS._main_text); + draw_text_add(_x, _y + yy, _word); _x += string_width(_word); + + if(string_char_last(_word) == "]") + _topic = false; } yy += line_get_height(); diff --git a/scripts/argumentRenderer/argumentRenderer.gml b/scripts/argumentRenderer/argumentRenderer.gml index 3fdc508ad..9a5075152 100644 --- a/scripts/argumentRenderer/argumentRenderer.gml +++ b/scripts/argumentRenderer/argumentRenderer.gml @@ -20,19 +20,23 @@ function argumentRenderer(_typeArray = []) { _jName.editWidget.setFocusHover(_focus, _hover); _jName.editWidget.draw(tx + ui(128 + 8), ty, _w - ui(128 + 8), _th, _jName.showValue(), _m, _jName.display_type); - _h += _th + ui(6); + _h += _th + ui(8); draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); - draw_text_add(tx + ui(8), ty + _th + ui(6) + ui(6), "Value"); + draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), "Value"); var _jValue = inputs[| i + 2]; if(_jValue.editWidget != noone) { - var params = new widgetParam(tx + ui(64), ty + _th + ui(6), _w - ui(64), TEXTBOX_HEIGHT, _jValue.showValue(), -1, _m, argument_renderer.rx, argument_renderer.ry); + var params = new widgetParam(tx + ui(64), ty + _th + ui(10), _w - ui(64), TEXTBOX_HEIGHT, _jValue.showValue(), -1, _m, argument_renderer.rx, argument_renderer.ry); _jValue.editWidget.setFocusHover(_focus, _hover); - _h += _jValue.editWidget.drawParam(params) + ui(8); + _h += _jValue.editWidget.drawParam(params) + ui(10); } + //var _ly = ty + _h - ui(9); + //draw_set_color(COLORS.panel_separator); + //draw_line_width(_x + ui(16), _ly, _x + _w - ui(16 * 2), _ly, 2); + hh += _h; ty += _h; } diff --git a/scripts/d3d_object/d3d_object.gml b/scripts/d3d_object/d3d_object.gml index 8fdc6a972..1827ed523 100644 --- a/scripts/d3d_object/d3d_object.gml +++ b/scripts/d3d_object/d3d_object.gml @@ -82,7 +82,7 @@ function __3dObject() constructor { } } vertex_end(_buffer); - vertex_freeze(_buffer); + //vertex_freeze(_buffer); return _buffer; } #endregion diff --git a/scripts/d3d_scene/d3d_scene.gml b/scripts/d3d_scene/d3d_scene.gml index d2ddde884..1e5169049 100644 --- a/scripts/d3d_scene/d3d_scene.gml +++ b/scripts/d3d_scene/d3d_scene.gml @@ -85,7 +85,9 @@ function __3dScene(camera) constructor { lightPnt_shadowBias = []; } reset(); #endregion - static _submit = function(callback, object, shader = noone) { + static _submit = function(callback, object = noone, shader = noone) { + if(object == noone) return; + matrix_stack_clear(); if(apply_transform) custom_transform.submitMatrix(); callback(object, shader); diff --git a/scripts/d3d_surface_extrude/d3d_surface_extrude.gml b/scripts/d3d_surface_extrude/d3d_surface_extrude.gml index 2421e1de4..440a2db7a 100644 --- a/scripts/d3d_surface_extrude/d3d_surface_extrude.gml +++ b/scripts/d3d_surface_extrude/d3d_surface_extrude.gml @@ -23,7 +23,7 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ return h[_i][_j]; } - static initModel = function() { + static initModel = function() { if(!is_surface(surface)) return; var _surface = surface; @@ -113,183 +113,60 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ var dep = (useH? getHeight(hei, hgtW, hgtH, i, j) : 1) * 0.5; - if(smooth) { #region - var d0, d1, d2, d3; - var d00, d10, d01, d11; - var a, a0, a1, a2, a3; - - // d00 | a0 | d10 - // a1 | a | a2 - // d01 | a3 | d11 - - if(useH) { - d00 = (i > 0 && j > 0)? getHeight(hei, hgtW, hgtH, i - 1, j - 1) * 0.5 : 0; - d10 = (i < ww - 1 && j > 0)? getHeight(hei, hgtW, hgtH, i + 1, j - 1) * 0.5 : 0; - d01 = (i > 0 && j < hh - 1)? getHeight(hei, hgtW, hgtH, i - 1, j + 1) * 0.5 : 0; - d11 = (i < ww - 1 && j < hh - 1)? getHeight(hei, hgtW, hgtH, i + 1, j + 1) * 0.5 : 0; - - d0 = (j > 0)? getHeight(hei, hgtW, hgtH, i, j - 1) * 0.5 : 0; - d1 = (i > 0)? getHeight(hei, hgtW, hgtH, i - 1, j) * 0.5 : 0; - d2 = (i < ww - 1)? getHeight(hei, hgtW, hgtH, i + 1, j) * 0.5 : 0; - d3 = (j < hh - 1)? getHeight(hei, hgtW, hgtH, i, j + 1) * 0.5 : 0; - } else { - d00 = (i > 0 && j > 0)? bool(ap[i - 1][j - 1]) * 0.5 : 0; - d10 = (i < ww - 1 && j > 0)? bool(ap[i + 1][j - 1]) * 0.5 : 0; - d01 = (i > 0 && j < hh - 1)? bool(ap[i - 1][j + 1]) * 0.5 : 0; - d11 = (i < ww - 1 && j < hh - 1)? bool(ap[i + 1][j + 1]) * 0.5 : 0; - - d0 = (j > 0)? bool(ap[i][j - 1]) * 0.5 : 0; - d1 = (i > 0)? bool(ap[i - 1][j]) * 0.5 : 0; - d2 = (i < ww - 1)? bool(ap[i + 1][j]) * 0.5 : 0; - d3 = (j < hh - 1)? bool(ap[i][j + 1]) * 0.5 : 0; - } - - a = ap[i][j]; - a0 = (j > 0)? ap[i][j - 1] : 0; - a1 = (i > 0)? ap[i - 1][j] : 0; - a2 = (i < ww - 1)? ap[i + 1][j] : 0; - a3 = (j < hh - 1)? ap[i][j + 1] : 0; - - if(a1 && a0) d00 = (d1 + d0) / 2; - if(a0 && a2) d10 = (d0 + d2) / 2; - if(a2 && a3) d11 = (d2 + d3) / 2; - if(a3 && a1) d01 = (d3 + d1) / 2; - - if(a) { - ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - - ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - - ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - - ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); - } else if(!a0 && !a1 && a2 && a3) { - //var _tx0 = tw * (i + 1), _tx1 = _tx0 + tw; - //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; - - d00 *= d0 * d1; - d10 *= d1 * d2; - d01 *= d1 * d3; - - ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - - ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); - } else if(!a0 && a1 && !a2 && a3) { - //var _tx0 = tw * (i - 1), _tx1 = _tx0 + tw; - //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; - - d00 *= d0 * d1; - d10 *= d1 * d2; - d11 *= d2 * d3; - - ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - - ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - } else if(a0 && a1 && !a2 && !a3) { - //var _tx0 = tw * (i - 1), _tx1 = _tx0 + tw; - //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; - - d10 *= d1 * d2; - d01 *= d1 * d3; - d11 *= d2 * d3; - - ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - - ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); - } else if(a0 && !a1 && a2 && !a3) { - //var _tx0 = tw * (i + 1), _tx1 = _tx0 + tw; - //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; - - d00 *= d0 * d1; - d01 *= d1 * d3; - d11 *= d2 * d3; - - ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - - ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - } - #endregion - } else { #region - ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(0, 0, -1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, 0, -1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 0, 1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j1, dep).setNormal(0, 0, 1).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(0, 0, 1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); - if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i, j - 1)) || (j == 0 || ap[i][j - 1] == 0)) { //y side - ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty1)); + if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i, j - 1)) || (j == 0 || ap[i][j - 1] == 0)) { //y side + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 1, 0).setUV(tx0, ty1)); - } + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 1, 0).setUV(tx0, ty1)); + } - if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i, j + 1)) || (j == hh - 1 || ap[i][j + 1] == 0)) { //y side - ds_list_add(v, new __vertex(i0, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); + if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i, j + 1)) || (j == hh - 1 || ap[i][j + 1] == 0)) { //y side + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, -1, 0).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); - } + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, -1, 0).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); + } - if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i - 1, j)) || (i == 0 || ap[i - 1][j] == 0)) { //x side - ds_list_add(v, new __vertex(i0, j0, dep).setNormal(-1, 0, 0).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); + if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i - 1, j)) || (i == 0 || ap[i - 1][j] == 0)) { //x side + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(-1, 0, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx0, ty1)); - ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); - } + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); + } - if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i + 1, j)) || (i == ww - 1 || ap[i + 1][j] == 0)) { //x side - ds_list_add(v, new __vertex(i1, j0, dep).setNormal(1, 0, 0).setUV(tx1, ty0)); - ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i1, j1, dep).setNormal(1, 0, 0).setUV(tx1, ty1)); + if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i + 1, j)) || (i == ww - 1 || ap[i + 1][j] == 0)) { //x side + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(1, 0, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); - ds_list_add(v, new __vertex(i1, j1, dep).setNormal(1, 0, 0).setUV(tx0, ty1)); - } - #endregion + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(1, 0, 0).setUV(tx0, ty1)); } } diff --git a/scripts/d3d_vertex/d3d_vertex.gml b/scripts/d3d_vertex/d3d_vertex.gml index 341ddb3f3..6d11d64aa 100644 --- a/scripts/d3d_vertex/d3d_vertex.gml +++ b/scripts/d3d_vertex/d3d_vertex.gml @@ -32,7 +32,7 @@ function __vertex(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) construc return self; } - static toString = function() { return $"[ pos: {position}, nor: {normal}, uv: {uv}, {color}, {alpha} ]"; } + static toString = function() { return $"[ pos: ({x}, {y}, {z}), nor: ({nx}, {ny}, {nz}), uv: ({u}, {v}), {color}, {alpha} ]"; } static clone = function() { gml_pragma("forceinline"); diff --git a/scripts/hlsl_draw/hlsl_draw.gml b/scripts/hlsl_draw/hlsl_draw.gml index 7c8cc4473..aec34cfe9 100644 --- a/scripts/hlsl_draw/hlsl_draw.gml +++ b/scripts/hlsl_draw/hlsl_draw.gml @@ -15,10 +15,42 @@ var constant = ["MATRIX_VIEW", "MATRIX_PROJECTION", "MATRIX_WORLD", "MATRIX_WORL for( var i = 0, n = array_length(constant); i < n; i++ ) global.glsl_constant[? constant[i]] = 1; -function draw_code_glsl(_x, _y, str) { +global.HLSL_BREAK_TOKEN = [" ", "(", ")", "[", "]", "{", "}", ".", ",", ";", "+", "-", "*", "/", "^", "="]; + +function hlsl_token_splice(str) { + var st = []; + var ss = str; + var sp; + var cc; + + do { + sp = 999999; + for( var i = 0, n = array_length(global.HLSL_BREAK_TOKEN); i < n; i++ ) { + var _pos = string_pos(global.HLSL_BREAK_TOKEN[i], ss); + if(_pos != 0) sp = min(sp, _pos); + } + + if(sp == 999999) { //no delim left + array_push(st, ss); + break; + } + + var _ss = string_copy(ss, 1, sp - 1); + array_push(st, _ss); + + cc = string_char_at(ss, sp); + array_push(st, cc); + + ss = string_copy(ss, sp + 1, string_length(ss) - sp); + } until(sp == 0); + + return st; +} + +function draw_code_hlsl(_x, _y, str) { var tx = _x; var ty = _y; - var words = token_splice(str); + var words = hlsl_token_splice(str); for( var j = 0; j < array_length(words); j++ ) { var word = words[j]; diff --git a/scripts/luaHighlight/luaHighlight.gml b/scripts/luaHighlight/luaHighlight.gml index a0e367aa9..fafb6ba72 100644 --- a/scripts/luaHighlight/luaHighlight.gml +++ b/scripts/luaHighlight/luaHighlight.gml @@ -10,7 +10,7 @@ for( var i = 0, n = array_length(reserved); i < n; i++ ) global.CODE_BREAK_TOKEN = [" ", "(", ")", "[", "]", "{", "}", ",", ";", "+", "-", "*", "/", "^", "="]; -function token_splice(str) { +function lua_token_splice(str) { var st = []; var ss = str; var sp; @@ -65,7 +65,7 @@ function draw_code_lua(_x, _y, str) { continue; } - var words = token_splice(_w); + var words = lua_token_splice(_w); for( var j = 0; j < array_length(words); j++ ) { word = words[j]; diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 99ed5035a..3e2b9f5a5 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -1,4 +1,4 @@ -function NodeObject(_name, _spr, _node, _create, tags = []) constructor { +function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #region name = _name; spr = _spr; node = _node; @@ -43,7 +43,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { _node.doUpdate(); return _node; } -} +} #endregion #region nodes globalvar ALL_NODES, ALL_NODE_LIST, NODE_CATEGORY, NODE_PAGE_DEFAULT, NODE_PB_CATEGORY, NODE_PCX_CATEGORY; @@ -53,7 +53,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { NODE_PB_CATEGORY = ds_list_create(); NODE_PCX_CATEGORY = ds_list_create(); - function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) { + function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) { #region if(!ds_map_exists(ALL_NODES, _name)) { log_warning("LOAD", $"Node type {_name} not found"); return noone; @@ -61,9 +61,9 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { var _node = ALL_NODES[? _name]; return _node.build(_x, _y, _group); - } + } #endregion - function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "") { + function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "") { #region var _n; if(ds_map_exists(ALL_NODES, _node)) @@ -78,19 +78,19 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { if(tooltip != "") _n.tooltip = tooltip; ds_list_add(_list, _n); return _n; - } + } #endregion - function addNodeCatagory(name, list, filter = []) { + function addNodeCatagory(name, list, filter = []) { #region ds_list_add(NODE_CATEGORY, { name: name, list: list, filter: filter }); - } + } #endregion - function addNodePBCatagory(name, list, filter = []) { + function addNodePBCatagory(name, list, filter = []) { #region ds_list_add(NODE_PB_CATEGORY, { name: name, list: list, filter: filter }); - } + } #endregion - function addNodePCXCatagory(name, list, filter = []) { + function addNodePCXCatagory(name, list, filter = []) { #region ds_list_add(NODE_PCX_CATEGORY, { name: name, list: list, filter: filter }); - } + } #endregion function __initNodes() { var favPath = DIRECTORY + "Nodes/fav.json"; diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 46c91a0c2..c47880545 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -1576,7 +1576,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } #endregion static setFrom = function(_valueFrom, _update = true, checkRecur = true, log = false) { #region - print($"Connecting {_valueFrom.name} to {name}"); + //print($"Connecting {_valueFrom.name} to {name}"); if(_valueFrom == noone) return removeFrom(); diff --git a/scripts/panel_text_editor/panel_text_editor.gml b/scripts/panel_text_editor/panel_text_editor.gml index fbe58c41b..18b8c4f59 100644 --- a/scripts/panel_text_editor/panel_text_editor.gml +++ b/scripts/panel_text_editor/panel_text_editor.gml @@ -17,7 +17,7 @@ function Panel_Text_Editor(_textArea, _inputFunc, _context) : PanelContent() con self.inputFunc = method(self, _inputFunc); self.context = _context; - shift_new_line = false; + shift_new_line = true; function drawContent(panel) { draw_clear_alpha(COLORS.panel_bg_clear, 0); diff --git a/scripts/quarternionBox/quarternionBox.gml b/scripts/quarternionBox/quarternionBox.gml index 298a33d6d..392adb2c4 100644 --- a/scripts/quarternionBox/quarternionBox.gml +++ b/scripts/quarternionBox/quarternionBox.gml @@ -65,18 +65,19 @@ function quarternionBox(_onModify) : widget() constructor { current_value = _data; - var bs = ui(32); - var bx = _x + _w - bs; - var by = _y + _h / 2 - bs / 2; - tooltip.index = _extra_data.angle_display; + var bs = ui(32); + var bx = _x + _w - bs; + var by = _y + _h / 2 - bs / 2; + var _disp = struct_try_get(_extra_data, "angle_display"); + tooltip.index = _disp; - if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, active, hover, tooltip, THEME.unit_angle, _extra_data.angle_display, c_white) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, active, hover, tooltip, THEME.unit_angle, _disp, c_white) == 2) { clickable = false; - _extra_data.angle_display = (_extra_data.angle_display + 1) % 2; + _extra_data.angle_display = (_disp + 1) % 2; } _w -= ui(40); - size = _extra_data.angle_display? 3 : 4; + size = _disp? 3 : 4; var ww = _w / size; var bx = _x; disp_w = disp_w == noone? ww : lerp_float(disp_w, ww, 3); diff --git a/scripts/string_function/string_function.gml b/scripts/string_functions/string_functions.gml similarity index 75% rename from scripts/string_function/string_function.gml rename to scripts/string_functions/string_functions.gml index 3742346ac..afff0757c 100644 --- a/scripts/string_function/string_function.gml +++ b/scripts/string_functions/string_functions.gml @@ -1,12 +1,12 @@ -function string_to_array(str) { +function string_to_array(str) { #region var amo = string_length(str); var arr = array_create(amo); for( var i = 0; i < amo; i++ ) arr[i] = string_char_at(str, i + 1); return arr; -} +} #endregion -function string_partial_match(str, key) { +function string_partial_match(str, key) { #region var amo = string_length(str); var run = 1; var consec = 0; @@ -29,9 +29,9 @@ function string_partial_match(str, key) { } return -9999; -} +} #endregion -function string_real(val, digMax = 999) { +function string_real(val, digMax = 999) { #region if(is_string(val)) return val; if(is_struct(val)) return string(val); @@ -53,9 +53,14 @@ function string_real(val, digMax = 999) { } return string_format(val, -1, pres); -} +} #endregion -function filename_name_only(name) { +function string_char_last(str, shift = 0) { #region + gml_pragma("forceinline"); + return string_char_at(str, string_length(str) - shift); +} #region + +function filename_name_only(name) { #region name = filename_name(name); return string_replace(name, filename_ext(name), "") -} \ No newline at end of file +} #endregion \ No newline at end of file diff --git a/scripts/string_function/string_function.yy b/scripts/string_functions/string_functions.yy similarity index 86% rename from scripts/string_function/string_function.yy rename to scripts/string_functions/string_functions.yy index 1e97be644..483663c4d 100644 --- a/scripts/string_function/string_function.yy +++ b/scripts/string_functions/string_functions.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "string_function", + "name": "string_functions", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index f7dd2fe45..730404bad 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -292,8 +292,10 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod var _txt = _txtLines[i] + (i < array_length(_txtLines)? "\n" : ""); var words; - if(_code) - words = token_splice(_txt); + if(format == TEXT_AREA_FORMAT.codeLUA) + words = lua_token_splice(_txt); + else if(format == TEXT_AREA_FORMAT.codeHLSL) + words = hlsl_token_splice(_txt); else words = string_splice(_txt, " "); @@ -576,7 +578,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod break; case TEXT_AREA_FORMAT.codeHLSL : if(syntax_highlight) - draw_code_glsl(ch_x, ch_y, _str); + draw_code_hlsl(ch_x, ch_y, _str); else draw_text_add(ch_x, ch_y, _str); break;