- Fix nodes in group render twice per frame.

This commit is contained in:
Tanasart 2023-11-30 14:55:33 +07:00
parent 9ac2861330
commit 12f185f3cd
14 changed files with 152 additions and 122 deletions

View file

@ -309,5 +309,6 @@
#region debug #region debug
//instance_create_depth(0, 0, 0, addon_key_displayer); //instance_create_depth(0, 0, 0, addon_key_displayer);
global.__debug_runner = 0;
__debug_animator_counter = 0; __debug_animator_counter = 0;
#endregion #endregion

View file

@ -1,4 +1,5 @@
/// @description init /// @description init
global.__debug_runner++;
global.cache_call = 0; global.cache_call = 0;
global.cache_hit = 0; global.cache_hit = 0;

View file

@ -26,17 +26,13 @@ function argumentRenderer(_typeArray = []) {
draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), __txt("Value")); draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), __txt("Value"));
var _jValue = inputs[| i + 2]; var _jValue = inputs[| i + 2];
if(_jValue.editWidget != noone) { if(argument_renderer.showValue && _jValue.editWidget != noone) {
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); var params = new widgetParam(tx + ui(64), ty + _th + ui(10), _w - ui(64), TEXTBOX_HEIGHT, _jValue.showValue(), {}, _m, argument_renderer.rx, argument_renderer.ry);
_jValue.editWidget.setFocusHover(_focus, _hover); _jValue.editWidget.setFocusHover(_focus, _hover);
_h += _jValue.editWidget.drawParam(params) + ui(10); _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; hh += _h;
ty += _h; ty += _h;
} }
@ -53,4 +49,6 @@ function argumentRenderer(_typeArray = []) {
inputs[| i + 2].editWidget.register(parent); inputs[| i + 2].editWidget.register(parent);
} }
} }
argument_renderer.showValue = true;
} }

View file

@ -25,10 +25,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION; globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11500; LATEST_VERSION = 11500;
VERSION = 11586; VERSION = 11587;
SAVE_VERSION = 11600; SAVE_VERSION = 11600;
VERSION_STRING = "1.16rc6"; VERSION_STRING = "1.16rc7";
BUILD_NUMBER = 11586; BUILD_NUMBER = 11587;
globalvar APPEND_MAP; globalvar APPEND_MAP;
APPEND_MAP = ds_map_create(); APPEND_MAP = ds_map_create();

View file

@ -52,25 +52,28 @@ function gradientObject(color = c_black) constructor { #region
} #endregion } #endregion
static eval = function(position) { #region static eval = function(position) { #region
if(array_length(keys) == 0) return c_black; var _len = array_length(keys);
if(array_length(keys) == 1) return keys[0].value; if(_len == 0) return c_black;
if(_len == 1) return keys[0].value;
for(var i = 0; i < array_length(keys); i++) { if(position <= keys[0].time) return keys[0].value;
if(position >= keys[_len - 1].time) return keys[_len - 1].value;
var _pkey = keys[0];
for(var i = 1; i < _len; i++) {
var _key = keys[i]; var _key = keys[i];
if(_key.time < position) continue; if(_key.time < position) continue;
if(_key.time == position) return keys[i].value; if(_key.time == position) return keys[i].value;
if(i == 0) //before first color
return keys[0].value;
var c0 = keys[i - 1].value;
if(type == GRADIENT_INTER.smooth) { if(type == GRADIENT_INTER.smooth) {
var rat = (position - keys[i - 1].time) / (keys[i].time - keys[i - 1].time); var rat = (position - _pkey.time) / (_key.time - _pkey.time);
var c1 = keys[i].value; return merge_color(_pkey.value, _key.value, rat);
return merge_color(c0, c1, rat);
} else if(type == GRADIENT_INTER.none) { } else if(type == GRADIENT_INTER.none) {
return c0; return _pkey.value;
} }
_pkey = _key;
} }
return keys[array_length(keys) - 1].value; //after last color return keys[array_length(keys) - 1].value; //after last color

View file

@ -8,7 +8,7 @@ var reserved = ["and", "break", "do", "else", "elseif", "end", "false",
for( var i = 0, n = array_length(reserved); i < n; i++ ) for( var i = 0, n = array_length(reserved); i < n; i++ )
global.lua_reserved[? reserved[i]] = 1; global.lua_reserved[? reserved[i]] = 1;
global.CODE_BREAK_TOKEN = [" ", "(", ")", "[", "]", "{", "}", ",", ";", "+", "-", "*", "/", "^", "=", "--"]; global.CODE_BREAK_TOKEN = [" ", "(", ")", "[", "]", "{", "}", ".", ",", ";", "+", "-", "*", "/", "^", "=", "--"];
function lua_token_splice(str) { function lua_token_splice(str) {
var st = []; var st = [];

View file

@ -53,8 +53,13 @@ function Node_VFX_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group
for( var i = 0; i < TOTAL_FRAMES; i++ ) for( var i = 0; i < TOTAL_FRAMES; i++ )
for( var j = 0, m = ds_list_size(topoList); j < m; j++ ) { for( var j = 0, m = ds_list_size(topoList); j < m; j++ ) {
var node = topoList[| j]; var node = topoList[| j];
if(is_instanceof(node, Node_VFX_Renderer_Output) || var _ins = instanceof(node);
is_instanceof(node, Node_VFX_Renderer)) continue;
if(!string_pos("Node_VFX", _ins))
continue;
if(_ins == "Node_VFX_Renderer" || _ins == "Node_VFX_Renderer_Output")
continue;
node.doUpdate(i); node.doUpdate(i);
} }

View file

@ -46,16 +46,18 @@ function Node_VFX_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _x, _y; var _x, _y;
var line = lines[_ind]; var line = lines[_ind];
var _st = _rat * (lineLength[_ind] - 1); var _len = lineLength[_ind] - 1;
var _st = _rat * _len;
var _fl = floor(_st);
var _fr = frac(_st);
_p0 = line[clamp(floor(_st) + 0, 0, array_length(line) - 1)]; _p0 = line[clamp(_fl + 0, 0, _len)];
_p1 = line[clamp(floor(_st) + 1, 0, array_length(line) - 1)]; _p1 = line[clamp(_fl + 1, 0, _len)];
if(!is_array(_p0)) return out; if(!is_array(_p0) || !is_array(_p1)) return out;
if(!is_array(_p1)) return out;
out.x = lerp(_p0[0], _p1[0], frac(_st)); out.x = lerp(_p0[0], _p1[0], _fr);
out.y = lerp(_p0[1], _p1[1], frac(_st)); out.y = lerp(_p0[1], _p1[1], _fr);
return out; return out;
} #endregion } #endregion
@ -83,13 +85,16 @@ function Node_VFX_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _life = getInputData(1); _life = max(_life, 1); var _life = getInputData(1); _life = max(_life, 1);
var _colr = getInputData(2); var _colr = getInputData(2);
lines = []; var _totlLen = array_length(_vfxs);
length = []; lines = array_verify(lines, _totlLen);
lengthAcc = []; length = array_verify(length, _totlLen);
lineLength = []; lengthAcc = array_verify(lengthAcc, _totlLen);
lineData = []; lineLength = array_verify(lineLength, _totlLen);
lineData = array_verify(lineData, _totlLen);
for( var i = 0; i < array_length(_vfxs); i++ ) { var _len = 0;
for( var i = 0; i < _totlLen; i++ ) {
var _vfx = _vfxs[i]; var _vfx = _vfxs[i];
var _posx = _vfx.x_history; var _posx = _vfx.x_history;
@ -99,14 +104,13 @@ function Node_VFX_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _trail_st = max(1, _vfx.trailLife - _life); var _trail_st = max(1, _vfx.trailLife - _life);
var _trail_len = _trail_ed - _trail_st; var _trail_len = _trail_ed - _trail_st;
//if(_vfx.life_total > 0) print($"{_vfx.active} | {_vfx.seed} : {_vfx.trailLife}")
if(_trail_len <= 0) continue; if(_trail_len <= 0) continue;
var _lngh = 0; var _lngh = 0;
var _ox = _posx[_trail_st], _nx; var _ox = _posx[_trail_st], _nx;
var _oy = _posy[_trail_st], _ny; var _oy = _posy[_trail_st], _ny;
var _line = array_create(_trail_len); var _line = array_verify(lines[_len], _trail_len);
var _lenA = array_create(_trail_len - 1); var _lenA = array_verify(lengthAcc[_len], _trail_len - 1);
_line[0] = [ _ox, _oy ]; _line[0] = [ _ox, _oy ];
for( var j = 0; j <= _trail_len; j++ ) { for( var j = 0; j <= _trail_len; j++ ) {
@ -127,17 +131,20 @@ function Node_VFX_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
_ox = _nx; _ox = _nx;
} }
array_push(lines, _line); lines[_len] = _line;
array_push(length, _lngh); length[_len] = _lngh;
array_push(lengthAcc, _lenA); lengthAcc[_len] = _lenA;
array_push(lineLength, array_length(_line)); lineLength[_len] = _trail_len;
lineData[_len] = { color: _vfx.blend, };
if(_colr) _len++;
array_push(lineData, {
color: _vfx.blend,
});
} }
array_resize(lines, _len);
array_resize(length, _len);
array_resize(lengthAcc, _len);
array_resize(lineLength, _len);
array_resize(lineData, _len);
outputs[| 0].setValue(self); outputs[| 0].setValue(self);
} #endregion } #endregion

View file

@ -219,7 +219,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static getNextNodesInternal = function() { #region //get node inside the group static getNextNodesInternal = function() { #region //get node inside the group
LOG_BLOCK_START(); LOG_BLOCK_START();
LOG_IF(global.FLAG.render == 1, $"→→→→→ Call get next node from group"); LOG_IF(global.FLAG.render == 1, $"→→→→→ Call get next node from group: {INAME}");
var nodes = []; var nodes = [];
if(isRenderActive()) { if(isRenderActive()) {

View file

@ -61,7 +61,7 @@ output.color = surfaceColor;")
input_display_list = [ 2, input_display_list = [ 2,
["Shader", false], 1, ["Shader", false], 1,
["Arguments", false], argument_renderer, ["Arguments", false], argument_renderer,
["Values", false], ["Values", true],
]; ];
setIsDynamicInput(3, false); setIsDynamicInput(3, false);
@ -171,6 +171,10 @@ output.color = surfaceColor;")
static onInspector1Update = function() { refreshShader(); } static onInspector1Update = function() { refreshShader(); }
static step = function() { #region
argument_renderer.showValue = input_display_list[5][1];
} #endregion
static refreshShader = function() { #region static refreshShader = function() { #region
var vs = getInputData(0); var vs = getInputData(0);
var fs = getInputData(1); var fs = getInputData(1);

View file

@ -81,10 +81,6 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
if(_prop.type != VALUE_TYPE.trigger) if(_prop.type != VALUE_TYPE.trigger)
ds_list_add(values, new valueKey(0, _val, self)); ds_list_add(values, new valueKey(0, _val, self));
process_cache = {};
process_cache_type = -1;
process_cache_disp = -1;
#endregion #endregion
static refreshAnimation = function() { #region static refreshAnimation = function() { #region
@ -329,18 +325,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
return 0; return 0;
} #endregion } #endregion
static clearProcessCache = function(_val) { process_cache = {}; }
static processType = function(_val) { #region static processType = function(_val) { #region
//if(process_cache_type != prop.type || process_cache_disp != prop.display_type) {
// clearProcessCache();
// process_cache_type = prop.type;
// process_cache_disp = prop.display_type;
//}
//if(struct_has(process_cache, _val))
// return process_cache[$ _val];
var _res = _val; var _res = _val;
if(!sep_axis && typeArray(prop.display_type) && is_array(_val)) { if(!sep_axis && typeArray(prop.display_type) && is_array(_val)) {
for(var i = 0; i < array_length(_val); i++) for(var i = 0; i < array_length(_val); i++)
@ -348,7 +333,6 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
} else } else
_res = processValue(_val); _res = processValue(_val);
//process_cache[$ _val] = _res;
return _res; return _res;
} #endregion } #endregion

View file

@ -163,6 +163,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
if(CURRENT_FRAME == 0 || inputs[| 11].is_anim) if(CURRENT_FRAME == 0 || inputs[| 11].is_anim)
ds_map_clear(widthMap); ds_map_clear(widthMap);
var __debug_timer = get_timer();
var _rangeMin = min(_ratio[0], _ratio[1]); var _rangeMin = min(_ratio[0], _ratio[1]);
var _rangeMax = max(_ratio[0], _ratio[1]); var _rangeMax = max(_ratio[0], _ratio[1]);
if(_rangeMax == 1) _rangeMax = 0.99999; if(_rangeMax == 1) _rangeMax = 0.99999;
@ -191,8 +193,6 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _ow, _nw, _oa, _na, _oc, _nc, _owg, _nwg; var _ow, _nw, _oa, _na, _oc, _nc, _owg, _nwg;
var _pathData = []; var _pathData = [];
lines = [];
if(_use_path) { #region if(_use_path) { #region
var lineLen = 1; var lineLen = 1;
if(struct_has(_pat, "getLineCount")) if(struct_has(_pat, "getLineCount"))
@ -200,6 +200,9 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
if(struct_has(_pat, "getPathData")) if(struct_has(_pat, "getPathData"))
_pathData = _pat.getPathData(); _pathData = _pat.getPathData();
lines = array_verify(lines, lineLen);
var _lineAmo = 0;
if(_rtMax > 0) if(_rtMax > 0)
for( var i = 0; i < lineLen; i++ ) { for( var i = 0; i < lineLen; i++ ) {
var _useDistance = _fixL && struct_has(_pat, "getLength"); var _useDistance = _fixL && struct_has(_pat, "getLength");
@ -207,6 +210,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
if(_pathLength == 0) continue; if(_pathLength == 0) continue;
var _segLength = struct_has(_pat, "getAccuLength")? _pat.getAccuLength(i) : []; var _segLength = struct_has(_pat, "getAccuLength")? _pat.getAccuLength(i) : [];
var _segLengthAmo = array_length(_segLength);
var _segIndex = 0; var _segIndex = 0;
var _pathStr = _rtStr; var _pathStr = _rtStr;
@ -223,7 +227,9 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _prog_next = 0; var _prog_next = 0;
var _prog = _prog_curr + 1; //Record previous position to delete from _total var _prog = _prog_curr + 1; //Record previous position to delete from _total
var _prog_total = 0; //Record how far the pointer have moved so far var _prog_total = 0; //Record how far the pointer have moved so far
var points = []; var points = is_array(lines[i])? lines[i] : [];
var pointArrLen = array_length(points);
var pointAmo = 0;
var wght; var wght;
var _pathPng; var _pathPng;
@ -240,13 +246,13 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
while(_total >= 0) { while(_total >= 0) {
if(_useDistance) { if(_useDistance) {
var segmentLength = array_safe_get(_segLength, _segIndex, 99999); var segmentLength = _segIndex < _segLengthAmo? _segLength[_segIndex] : 99999;
_prog_next = _prog_curr % _pathLength; //Wrap overflow path _prog_next = _prog_curr % _pathLength; //Wrap overflow path
_prog_next = min(_prog_curr + _stepLen, _pathLength, segmentLength); _prog_next = min(_prog_curr + _stepLen, _pathLength, segmentLength);
if(_prog_next == segmentLength) if(_prog_next == segmentLength)
_segIndex = (_segIndex + 1) % array_length(_segLength); _segIndex = (_segIndex + 1) % _segLengthAmo;
_pathPng = _ratInv? _pathLength - _prog_curr : _prog_curr; _pathPng = _ratInv? _pathLength - _prog_curr : _prog_curr;
} else { } else {
if(_prog_curr >= 1) //Wrap overflow path if(_prog_curr >= 1) //Wrap overflow path
@ -277,14 +283,28 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_ny += lengthdir_y(random1D(_sed + _sedIndex, -_wig, _wig), _d + 90); _sedIndex++; _ny += lengthdir_y(random1D(_sed + _sedIndex, -_wig, _wig), _d + 90); _sedIndex++;
} }
if(_prog_total >= _pathStr) //Do not add point before range start. Do this instead of starting at _rtStr to prevent wiggle. if(_prog_total >= _pathStr) { //Do not add point before range start. Do this instead of starting at _rtStr to prevent wiggle.
array_push(points, { var _pntData;
if(pointAmo < pointArrLen && is_struct(points[pointAmo])) {
_pntData = points[pointAmo];
_pntData.x = _nx;
_pntData.y = _ny;
_pntData.prog = _prog_total / _pathEnd;
_pntData.progCrop = _prog_curr / _pathLength;
_pntData.weight = wght;
} else {
_pntData = {
x: _nx, x: _nx,
y: _ny, y: _ny,
prog: _prog_total / _pathEnd, prog: _prog_total / _pathEnd,
progCrop: _prog_curr / _pathLength, progCrop: _prog_curr / _pathLength,
weight: wght weight: wght
}); }
points[pointAmo] = _pntData;
}
pointAmo++;
}
if(_prog_next > _prog_curr) { if(_prog_next > _prog_curr) {
_prog_total += _prog_next - _prog_curr; _prog_total += _prog_next - _prog_curr;
@ -300,8 +320,11 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_total_prev = _total; _total_prev = _total;
} }
array_push(lines, points); array_resize(points, pointAmo);
lines[_lineAmo++] = points;
} }
array_resize(lines, _lineAmo);
#endregion #endregion
} else { #region } else { #region
var x0, y0, x1, y1; var x0, y0, x1, y1;
@ -354,7 +377,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
if(_bg) draw_clear_alpha(0, 1); if(_bg) draw_clear_alpha(0, 1);
else DRAW_CLEAR else DRAW_CLEAR
if(_useTex) { if(_useTex) { #region
var tex = surface_get_texture(_tex); var tex = surface_get_texture(_tex);
shader_set(sh_draw_mapping); shader_set(sh_draw_mapping);
@ -363,7 +386,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
shader_set_f("scale", _texSca); shader_set_f("scale", _texSca);
shader_set_interpolation(_tex); shader_set_interpolation(_tex);
} } #endregion
for( var i = 0, n = array_length(lines); i < n; i++ ) { for( var i = 0, n = array_length(lines); i < n; i++ ) {
var points = lines[i]; var points = lines[i];
@ -380,15 +403,11 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
for( var j = 0; j < array_length(points); j++ ) { for( var j = 0; j < array_length(points); j++ ) {
var p0 = points[j]; var p0 = points[j];
var _nx = p0.x; var _nx = p0.x - 0.5 * _1px;
var _ny = p0.y; var _ny = p0.y - 0.5 * _1px;
var prog = p0.prog; var prog = p0.prog;
var prgc = p0.progCrop; var prgc = p0.progCrop;
var _dir = j? point_direction(_ox, _oy, _nx, _ny) : 0;
if(_1px) {
_nx = _nx - 0.5;
_ny = _ny - 0.5;
}
var widProg = value_snap_real(_widap? prog : prgc, 0.01); var widProg = value_snap_real(_widap? prog : prgc, 0.01);
@ -400,11 +419,11 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_nc = colorMultiply(_col_base, _color.eval(_colP? prog : prgc)); _nc = colorMultiply(_col_base, _color.eval(_colP? prog : prgc));
if(_cap) { if(_cap) { #region
if(j == 1) { if(j == 1) {
draw_set_color(_oc); draw_set_color(_oc);
_d = point_direction(_ox, _oy, _nx, _ny) + 180; _d = _dir + 180;
draw_circle_angle(_ox, _oy, _ow / 2, _d - 90, _d, _capP); draw_circle_angle(_ox, _oy, _ow / 2, _d - 90, _d, _capP);
draw_circle_angle(_ox, _oy, _ow / 2, _d, _d + 90, _capP); draw_circle_angle(_ox, _oy, _ow / 2, _d, _d + 90, _capP);
} }
@ -412,29 +431,26 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
if(j == array_length(points) - 1) { if(j == array_length(points) - 1) {
draw_set_color(_nc); draw_set_color(_nc);
_d = point_direction(_ox, _oy, _nx, _ny); _d = _dir;
draw_circle_angle(_nx, _ny, _nw / 2, _d - 90, _d, _capP); draw_circle_angle(_nx, _ny, _nw / 2, _d - 90, _d, _capP);
draw_circle_angle(_nx, _ny, _nw / 2, _d, _d + 90, _capP); draw_circle_angle(_nx, _ny, _nw / 2, _d, _d + 90, _capP);
} }
} } #endregion
if(_1px) { if(_1px) { #region
if(j) { if(j) {
var dst = point_distance(_ox, _oy, _nx, _ny); var dst = point_distance(_ox, _oy, _nx, _ny);
if(dst <= 1 && i < array_length(points) - 1) continue; if(dst <= 1 && i < array_length(points) - 1) continue;
//_nc = make_color_hsv(random(255), 255, 255);
//_oc = _nc;
//line_bresenham(pxs, _ox, _oy, _nx, _ny, _oc, _nc);
draw_line_color(_ox, _oy, _nx, _ny, _oc, _nc); draw_line_color(_ox, _oy, _nx, _ny, _oc, _nc);
} }
_ox = _nx; _ox = _nx;
_oy = _ny; _oy = _ny;
_oc = _nc; _oc = _nc;
} else { #endregion
} else { #region
if(j) { if(j) {
var _nd0 = point_direction(_ox, _oy, _nx, _ny); var _nd0 = _dir;
var _nd1 = _nd0; var _nd1 = _nd0;
if(j < array_length(points) - 1) { if(j < array_length(points) - 1) {
@ -445,7 +461,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_nd1 = point_direction(_nx, _ny, _nnx, _nny); _nd1 = point_direction(_nx, _ny, _nnx, _nny);
_nd = _nd0 + angle_difference(_nd1, _nd0) / 2; _nd = _nd0 + angle_difference(_nd1, _nd0) / 2;
} else } else
_nd = point_direction(_ox, _oy, _nx, _ny); _nd = _nd0;
if(_useTex) { if(_useTex) {
var _len = array_length(points) - 1; var _len = array_length(points) - 1;
@ -479,6 +495,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_ow = _nw; _ow = _nw;
_oc = _nc; _oc = _nc;
} }
#endregion
} }
draw_primitive_end(); draw_primitive_end();
@ -488,6 +505,9 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
surface_reset_target(); surface_reset_target();
#endregion #endregion
//print($"Processing line {global.__debug_runner} = {get_timer() - __debug_timer} ms");
//printCallStack();
return _outSurf; return _outSurf;
} }
} }

View file

@ -23,9 +23,9 @@ function __nodeLeafList(_list) { #region
var _node = _list[| i]; var _node = _list[| i];
if(!_node.active) continue; if(!_node.active) continue;
if(!_node.isRenderActive()) continue; if(!_node.isRenderActive()) continue;
if(!_node.isLeaf()) continue;
var _startNode = _node.isRenderable(); if(_node.isRenderable()) {
if(_startNode) {
array_push(nodes, _node); array_push(nodes, _node);
array_push(nodeNames, _node.internalName); array_push(nodeNames, _node.internalName);
} }
@ -195,7 +195,7 @@ function Render(partial = false, runAction = false) { #region
rendering = RENDER_QUEUE.dequeue(); rendering = RENDER_QUEUE.dequeue();
var renderable = rendering.isRenderable(); var renderable = rendering.isRenderable();
LOG_IF(global.FLAG.render == 1, $"Rendering {rendering.internalName} ({rendering.display_name}) : {renderable? "Update" : "Pass"}"); LOG_IF(global.FLAG.render == 1, $"Rendering {rendering.internalName} ({rendering.display_name}) : {renderable? "Update" : "Pass"} ({rendering.rendered})");
if(renderable) { if(renderable) {
var _render_pt = get_timer(); var _render_pt = get_timer();
@ -204,6 +204,7 @@ function Render(partial = false, runAction = false) { #region
var nextNodes = rendering.getNextNodes(); var nextNodes = rendering.getNextNodes();
for( var i = 0, n = array_length(nextNodes); i < n; i++ ) { for( var i = 0, n = array_length(nextNodes); i < n; i++ ) {
if(nextNodes[i].isRenderable())
RENDER_QUEUE.enqueue(nextNodes[i]); RENDER_QUEUE.enqueue(nextNodes[i]);
} }

View file

@ -103,12 +103,13 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
} #endregion } #endregion
static onModified = function() { #region static onModified = function() { #region
autocomplete_delay = 0;
o_dialog_textbox_autocomplete.deactivate(self);
o_dialog_textbox_function_guide.deactivate(self);
if(!isCodeFormat()) return; if(!isCodeFormat()) return;
if(autocomplete_server == noone) return; if(autocomplete_server == noone) return;
if(!use_autocomplete) { if(!use_autocomplete) return;
o_dialog_textbox_autocomplete.deactivate(self);
return;
}
var crop = string_copy(_input_text, 1, cursor); var crop = string_copy(_input_text, 1, cursor);
var slp = string_splice(crop, [" ", "(", "[", "{", ",", "\n"]); var slp = string_splice(crop, [" ", "(", "[", "{", ",", "\n"]);
@ -160,8 +161,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
o_dialog_textbox_function_guide.activate(self); o_dialog_textbox_function_guide.activate(self);
o_dialog_textbox_function_guide.prompt = guide; o_dialog_textbox_function_guide.prompt = guide;
o_dialog_textbox_function_guide.index = amo; o_dialog_textbox_function_guide.index = amo;
} else }
o_dialog_textbox_function_guide.deactivate(self);
} #endregion } #endregion
static keyboardEnter = function() { #region static keyboardEnter = function() { #region
@ -537,7 +537,6 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
undo_delay = 0; undo_delay = 0;
} }
onModified(); onModified();
autocomplete_delay = 0;
} }
if(auto_update && keyboard_check_pressed(vk_anykey)) if(auto_update && keyboard_check_pressed(vk_anykey))
@ -565,6 +564,9 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
} }
} }
autocomplete_delay = 0;
o_dialog_textbox_autocomplete.deactivate(self);
o_dialog_textbox_function_guide.deactivate(self);
} else if(keyboard_check_pressed(vk_end)) { } else if(keyboard_check_pressed(vk_end)) {
if(key_mod_press(SHIFT)) { if(key_mod_press(SHIFT)) {
if(cursor_select == -1) if(cursor_select == -1)
@ -576,6 +578,10 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
while(string_char_at(_input_text, cursor + 1) != "\n" && cursor < string_length(_input_text)) { while(string_char_at(_input_text, cursor + 1) != "\n" && cursor < string_length(_input_text)) {
cursor++; cursor++;
} }
autocomplete_delay = 0;
o_dialog_textbox_autocomplete.deactivate(self);
o_dialog_textbox_function_guide.deactivate(self);
} else if(keyboard_check_pressed(vk_escape) && o_dialog_textbox_autocomplete.textbox != self) { } else if(keyboard_check_pressed(vk_escape) && o_dialog_textbox_autocomplete.textbox != self) {
_input_text = _last_value; _input_text = _last_value;
cut_line(); cut_line();