mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +01:00
- [Image Array] Fix node always update if one of the path is not a valid image.
This commit is contained in:
parent
fd42355a29
commit
f8d04e0b75
5 changed files with 22 additions and 11 deletions
|
@ -1567,6 +1567,16 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
return _s > 0.5? drawJunctions(xx, yy, _mx, _my, _s) : drawJunctions_fast(xx, yy, _mx, _my, _s);
|
||||
} #endregion
|
||||
|
||||
static drawNodeBehind = function(_x, _y, _mx, _my, _s) { #region
|
||||
if(draw_graph_culled) return;
|
||||
if(!active) return;
|
||||
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
onDrawNodeBehind(_x, _y, _mx, _my, _s);
|
||||
} #endregion
|
||||
|
||||
static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) {}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) {}
|
||||
|
|
|
@ -113,6 +113,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
|
||||
var ext = string_lower(filename_ext(path));
|
||||
setDisplayName(filename_name_only(path));
|
||||
edit_time = max(edit_time, file_get_modify_s(path));
|
||||
|
||||
switch(ext) {
|
||||
case ".png" :
|
||||
|
@ -125,7 +126,6 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
return false;
|
||||
}
|
||||
|
||||
edit_time = max(edit_time, file_get_modify_s(path));
|
||||
array_push(spr, _spr);
|
||||
break;
|
||||
}
|
||||
|
@ -139,7 +139,9 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
static step = function() { #region
|
||||
if(attributes.file_checker)
|
||||
for( var i = 0, n = array_length(path_current); i < n; i++ ) {
|
||||
if(file_get_modify_s(path_current[i]) > edit_time) {
|
||||
var _ed = file_get_modify_s(path_current[i]);
|
||||
|
||||
if(_ed > edit_time) {
|
||||
updatePaths();
|
||||
triggerRender();
|
||||
break;
|
||||
|
|
|
@ -50,22 +50,21 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _alp = _data[6];
|
||||
|
||||
if(_use_gra) {
|
||||
var _colors = paletteToArray(_gra);
|
||||
|
||||
surface_set_shader(_outSurf, sh_posterize_palette);
|
||||
shader_set_f("palette", _colors);
|
||||
shader_set_f("palette", paletteToArray(_gra));
|
||||
shader_set_i("keys", array_length(_gra));
|
||||
shader_set_i("alpha", _alp);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
draw_surface_safe(_data[0]);
|
||||
surface_reset_shader();
|
||||
|
||||
} else {
|
||||
surface_set_shader(_outSurf, sh_posterize);
|
||||
shader_set_i("colors", _data[3]);
|
||||
shader_set_f_map("gamma", _data[4], _data[7], inputs[| 4]);
|
||||
shader_set_i("alpha", _alp);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
draw_surface_safe(_data[0]);
|
||||
surface_reset_shader();
|
||||
}
|
||||
|
||||
|
|
|
@ -1200,7 +1200,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
#region draw node
|
||||
var t = get_timer();
|
||||
for(var i = 0; i < ds_list_size(nodes_list); i++)
|
||||
nodes_list[| i].onDrawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
||||
nodes_list[| i].drawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
||||
|
||||
for(var i = 0; i < ds_list_size(nodes_list); i++) {
|
||||
var _node = nodes_list[| i];
|
||||
|
@ -1376,7 +1376,10 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
} #endregion
|
||||
|
||||
function drawJunctionConnect() { #region
|
||||
|
||||
if(value_dragging) {
|
||||
if(!value_dragging.node.active) { value_dragging = noone; return; }
|
||||
|
||||
var xx = value_dragging.x;
|
||||
var yy = value_dragging.y;
|
||||
var _mx = mx;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
|
|
Loading…
Reference in a new issue