mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
Loop related bug fixes
This commit is contained in:
parent
591314ab8e
commit
04668a107d
20 changed files with 208 additions and 128 deletions
Binary file not shown.
|
@ -25,10 +25,10 @@
|
|||
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
|
||||
|
||||
LATEST_VERSION = 11500;
|
||||
VERSION = 11589;
|
||||
VERSION = 11590;
|
||||
SAVE_VERSION = 11600.1;
|
||||
VERSION_STRING = "1.16rc9";
|
||||
BUILD_NUMBER = 11589;
|
||||
VERSION_STRING = "1.16rc10";
|
||||
BUILD_NUMBER = 11590;
|
||||
|
||||
globalvar APPEND_MAP;
|
||||
APPEND_MAP = ds_map_create();
|
||||
|
@ -48,11 +48,14 @@
|
|||
|
||||
DOUBLE_CLICK_POS = [ 0, 0 ];
|
||||
DOUBLE_CLICK = false;
|
||||
FOCUS = noone;
|
||||
|
||||
FOCUS = noone;
|
||||
FOCUS_STR = "";
|
||||
HOVER = noone;
|
||||
|
||||
HOVER = noone;
|
||||
HOVERING_ELEMENT = noone;
|
||||
_HOVERING_ELEMENT = noone;
|
||||
|
||||
DIALOG_CLICK = true;
|
||||
|
||||
globalvar ADD_NODE_PAGE;
|
||||
|
|
|
@ -118,7 +118,11 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
|
||||
static updateType = function(resetVal = false) { #region
|
||||
var _typ = getType();
|
||||
outputs[| 0].setType(_typ);
|
||||
|
||||
if(_typ == VALUE_TYPE.any && inputs[| input_fix_len].value_from)
|
||||
outputs[| 0].setType(inputs[| input_fix_len].value_from.type);
|
||||
else
|
||||
outputs[| 0].setType(_typ);
|
||||
|
||||
for( var i = ds_list_size(inputs) - 1; i >= input_fix_len; i-- ) {
|
||||
if(resetVal) inputs[| i].resetValue();
|
||||
|
|
|
@ -1643,7 +1643,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return;
|
||||
return noone;
|
||||
}
|
||||
|
||||
return outputs[| preview_channel].getValue();
|
||||
|
|
|
@ -22,13 +22,11 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Iterator(_x, _y, _grou
|
|||
} #endregion
|
||||
|
||||
static doInitLoop = function() { #region
|
||||
var arrIn = getInputData(0);
|
||||
var arrIn = getInputData(0);
|
||||
var arrOut = outputs[| 0].getValue();
|
||||
|
||||
if(array_length(arrOut) != array_length(arrIn)) {
|
||||
surface_array_free(arrOut);
|
||||
outputs[| 0].setValue([])
|
||||
}
|
||||
if(array_length(arrOut) != array_length(arrIn))
|
||||
outputs[| 0].setValue([]);
|
||||
} #endregion
|
||||
|
||||
static getIterationCount = function() { #region
|
||||
|
|
|
@ -25,7 +25,32 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Iterator(_x, _y, _gr
|
|||
var arrIn = getInputData(0);
|
||||
var arrOut = outputs[| 0].getValue();
|
||||
|
||||
surface_array_free(arrOut);
|
||||
var _int = noone;
|
||||
var _oup = noone;
|
||||
|
||||
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
|
||||
var _n = nodes[| i];
|
||||
|
||||
if(is_instanceof(_n, Node_Iterator_Filter_Input))
|
||||
_int = _n;
|
||||
if(is_instanceof(_n, Node_Iterator_Filter_Output))
|
||||
_oup = _n;
|
||||
}
|
||||
|
||||
if(_int == noone) {
|
||||
noti_warning("Filter Array: Input node not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(_oup == noone) {
|
||||
noti_warning("Filter Array: Output node not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
var _ofr = _oup.inputs[| 0].value_from;
|
||||
var _imm = _ofr && is_instanceof(_ofr.node, Node_Iterator_Filter_Input);
|
||||
|
||||
if(!_imm) surface_array_free(arrOut);
|
||||
outputs[| 0].setValue([])
|
||||
} #endregion
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ function Node_Iterate_Sort(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr
|
|||
icon = THEME.loop;
|
||||
|
||||
reset_all_child = true;
|
||||
combine_render_time = false;
|
||||
managedRenderOrder = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, [] )
|
||||
|
@ -24,12 +23,15 @@ function Node_Iterate_Sort(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr
|
|||
|
||||
if(!LOADING && !APPENDING && !CLONING) { #region
|
||||
var input0 = nodeBuild("Node_Iterator_Sort_Input", -256, -64, self);
|
||||
input0.display_name = "Value 1";
|
||||
input0.setDisplayName("Value 1");
|
||||
input0.attributes.sort_inputs = 1;
|
||||
|
||||
var input1 = nodeBuild("Node_Iterator_Sort_Input", -256, 64, self);
|
||||
input1.display_name = "Value 2";
|
||||
input1.setDisplayName("Value 2");
|
||||
input1.attributes.sort_inputs = 2;
|
||||
|
||||
var output = nodeBuild("Node_Iterator_Sort_Output", 256, -32, self);
|
||||
output.attributes.sort_inputs = 9;
|
||||
} #endregion
|
||||
|
||||
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
|
||||
|
@ -47,31 +49,49 @@ function Node_Iterate_Sort(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr
|
|||
} #endregion
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
if(frame == 0) {
|
||||
if(frame == 0 || !IS_PLAYING) {
|
||||
NodeListSort(topoList, nodes);
|
||||
|
||||
inputNodes = [ noone, noone ];
|
||||
outputNode = noone;
|
||||
var inputReady = 0;
|
||||
|
||||
if(inputs[| 0].value_from) {
|
||||
inputs[| 0].setType(inputs[| 0].value_from.type);
|
||||
outputs[| 0].setType(inputs[| 0].value_from.type);
|
||||
}
|
||||
|
||||
var _typ = inputs[| 0].type;
|
||||
|
||||
for( var i = 0; i < ds_list_size(nodes); i++ ) {
|
||||
if(nodes[| i].display_name == "Value 1") {
|
||||
inputNodes[0] = nodes[| i].inputs[| 0];
|
||||
inputNodes[0].setType(inputs[| 0].type);
|
||||
inputReady++;
|
||||
} else if(nodes[| i].display_name == "Value 2") {
|
||||
inputNodes[1] = nodes[| i].inputs[| 0];
|
||||
inputNodes[1].setType(inputs[| 0].type);
|
||||
inputReady++;
|
||||
} else if(nodes[| i].name == "Swap result") {
|
||||
outputNode = nodes[| i].inputs[| 0];
|
||||
inputReady++;
|
||||
var _n = nodes[| i];
|
||||
if(!struct_has(_n.attributes, "sort_inputs")) continue;
|
||||
|
||||
switch(_n.attributes.sort_inputs) {
|
||||
case 1 :
|
||||
inputNodes[0] = _n.inputs[| 0];
|
||||
|
||||
_n.inputs[| 0].setType( _typ);
|
||||
_n.outputs[| 0].setType(_typ);
|
||||
inputReady += 1;
|
||||
break;
|
||||
case 2 :
|
||||
inputNodes[1] = _n.inputs[| 0];
|
||||
|
||||
_n.inputs[| 0].setType( _typ);
|
||||
_n.outputs[| 0].setType(_typ);
|
||||
inputReady += 2;
|
||||
break;
|
||||
case 9 :
|
||||
outputNode = nodes[| i].inputs[| 0];
|
||||
inputReady += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nodeValid = inputReady == 3;
|
||||
nodeValid = inputReady == 0b111;
|
||||
if(!nodeValid) {
|
||||
noti_warning("Sort: Missing inputs or output, need 2 inputs and 1 output for comparison.");
|
||||
noti_warning($"Array sort: Missing inputs or output, need 2 inputs and 1 output for comparison [{inputReady}].");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -123,11 +143,6 @@ function Node_Iterate_Sort(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr
|
|||
} #endregion
|
||||
|
||||
static sortArray = function() { #region
|
||||
if(inputs[| 0].value_from) {
|
||||
inputs[| 0].setType(inputs[| 0].value_from.type);
|
||||
outputs[| 0].setType(inputs[| 0].value_from.type);
|
||||
}
|
||||
|
||||
iterated = 0;
|
||||
loop_start_time = get_timer();
|
||||
|
||||
|
|
|
@ -6,23 +6,51 @@ function Node_Iterator_Each_Input(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
manual_deletable = false;
|
||||
|
||||
outputs[| 0] = nodeValue("Value in", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 );
|
||||
|
||||
outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); //Get value from outside loop
|
||||
|
||||
outputs[| 0].getValueRecursive = function() {
|
||||
if(!variable_struct_exists(group, "iterated"))
|
||||
return outputs[| 0].getValueDefault();
|
||||
|
||||
var ind = group.iterated;
|
||||
var val = group.getInputData(0);
|
||||
var ivl = array_safe_get(val, ind);
|
||||
|
||||
return [ array_safe_get(val, ind), group.inputs[| 0] ];
|
||||
return [ ivl, group.inputs[| 0] ];
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
|
||||
outputs[| 0].setType(group.inputs[| 0].type);
|
||||
if(outputs[| 0].setType(group.inputs[| 0].type))
|
||||
will_setHeight = true;
|
||||
}
|
||||
|
||||
static getPreviewValues = function() { #region
|
||||
switch(group.inputs[| 0].type) {
|
||||
case VALUE_TYPE.surface :
|
||||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return noone;
|
||||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
|
||||
static getGraphPreviewSurface = function() { #region
|
||||
switch(group.inputs[| 0].type) {
|
||||
case VALUE_TYPE.surface :
|
||||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return noone;
|
||||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
|
||||
static onLoadGroup = function() { #region
|
||||
if(group == noone) nodeDelete(self);
|
||||
} #endregion
|
||||
|
|
|
@ -20,9 +20,12 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
|
||||
var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type;
|
||||
|
||||
inputs[| 0].setType(type);
|
||||
group.outputs[| 0].setType(type);
|
||||
outputs[| 0].setType(type);
|
||||
|
||||
if(outputs[| 0].setType(type))
|
||||
will_setHeight = true;
|
||||
} #endregion
|
||||
|
||||
static cloneValue = function(_prev_val, _val) { #region
|
||||
|
@ -31,7 +34,9 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
var is_surf = inputs[| 0].value_from.type == VALUE_TYPE.surface;
|
||||
var _new_val = [];
|
||||
|
||||
surface_array_free(_prev_val);
|
||||
if(!is_instanceof(inputs[| 0].value_from.node, Node_Iterator_Each_Input))
|
||||
surface_array_free(_prev_val);
|
||||
|
||||
if(is_surf) _new_val = surface_array_clone(_val);
|
||||
else _new_val = array_clone(_val);
|
||||
|
||||
|
@ -44,7 +49,7 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
return;
|
||||
}
|
||||
|
||||
var ind = group.iterated;
|
||||
var ind = group.iterated;
|
||||
var _val = group.outputs[| 0].getValue();
|
||||
if(!is_array(_val)) {
|
||||
group.iterationUpdate();
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_Iterator_Filter_Input(_x, _y, _group = noone) : Node(_x, _y, _grou
|
|||
|
||||
outputs[| 0] = nodeValue("Value in", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 );
|
||||
outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); //Get value from outside loop
|
||||
outputs[| 0].getValueRecursive = function() {
|
||||
outputs[| 0].getValueRecursive = function() { #region
|
||||
if(!variable_struct_exists(group, "iterated"))
|
||||
return outputs[| 0].getValueDefault();
|
||||
|
||||
|
@ -15,12 +15,37 @@ function Node_Iterator_Filter_Input(_x, _y, _group = noone) : Node(_x, _y, _grou
|
|||
var val = group.getInputData(0);
|
||||
|
||||
return [ array_safe_get(val, ind), group.inputs[| 0] ];
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static step = function() {
|
||||
static step = function() { #region
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
|
||||
outputs[| 0].setType(group.inputs[| 0].type);
|
||||
}
|
||||
if(outputs[| 0].setType(group.inputs[| 0].type))
|
||||
will_setHeight = true;
|
||||
} #endregion
|
||||
|
||||
static getPreviewValues = function() { #region
|
||||
switch(group.inputs[| 0].type) {
|
||||
case VALUE_TYPE.surface :
|
||||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return noone;
|
||||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
|
||||
static getGraphPreviewSurface = function() { #region
|
||||
switch(group.inputs[| 0].type) {
|
||||
case VALUE_TYPE.surface :
|
||||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return noone;
|
||||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
|
||||
}
|
|
@ -20,7 +20,7 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro
|
|||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
|
||||
var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type;
|
||||
inputs[| 0].setType(type);
|
||||
inputs[| 0].setType(type)
|
||||
group.outputs[| 0].setType(type);
|
||||
}
|
||||
|
||||
|
@ -42,12 +42,13 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro
|
|||
if(res) {
|
||||
var is_surf = inputs[| 0].value_from.type == VALUE_TYPE.surface;
|
||||
var _new_val = val;
|
||||
|
||||
if(is_surf) _new_val = surface_array_clone(val);
|
||||
else _new_val = array_clone(val);
|
||||
array_push(_val, _new_val);
|
||||
}
|
||||
|
||||
LOG_IF(global.FLAG.render == 1, "Value " + string(val) + " filter result " + string(res) + " to array " + string(_val));
|
||||
LOG_IF(global.FLAG.render == 1, $"Value {val} filter result {res} to array {_val}");
|
||||
|
||||
group.outputs[| 0].setValue(_val);
|
||||
group.iterationUpdate();
|
||||
|
|
|
@ -14,19 +14,22 @@ function Node_Iterator_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y,
|
|||
outputs[| 0].getValueRecursive = function() {
|
||||
if(!struct_has(group, "iterated"))
|
||||
return outputs[| 0].getValueDefault();
|
||||
|
||||
var _node_output = noone;
|
||||
|
||||
var _to = outputs[| 1].getJunctionTo();
|
||||
|
||||
if(array_empty(_to))
|
||||
// Not connect to any loop output
|
||||
if(array_empty(_to))
|
||||
return [ noone, inParent ];
|
||||
|
||||
_node_output = _to[0];
|
||||
var _node_output = _to[0];
|
||||
|
||||
if(_node_output == noone || group.iterated == 0)
|
||||
return outputs[| 0].getValueDefault();
|
||||
// First iteration, get value from outside
|
||||
if(_node_output == noone || group.iterated == 0) {
|
||||
var _def = outputs[| 0].getValueDefault();
|
||||
return [ variable_clone(_def[0]), _def[1] ];
|
||||
}
|
||||
|
||||
//print($"Iteration {group.iterated} got {_node_output.node.cache_value}")
|
||||
// Later iteration, get value from output
|
||||
return [ _node_output.node.cache_value, inParent ];
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
h = 32 + 24 * 2;
|
||||
min_h = h;
|
||||
|
||||
inputs[| 0].setFrom_condition = function(_valueFrom) {
|
||||
inputs[| 0].setFrom_condition = function(_valueFrom) { #region
|
||||
if(instanceof(_valueFrom.node) != "Node_Iterator_Input") return true;
|
||||
if(inputs[| 1].isLeaf()) return true;
|
||||
if(inputs[| 1].value_from.node == _valueFrom.node) {
|
||||
|
@ -15,13 +15,13 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
inputs[| 1] = nodeValue("Loop exit", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, -1)
|
||||
.uncache()
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1].setFrom_condition = function(_valueFrom) {
|
||||
inputs[| 1].setFrom_condition = function(_valueFrom) { #region
|
||||
if(instanceof(_valueFrom.node) != "Node_Iterator_Input") return true;
|
||||
if(inputs[| 0].isLeaf()) return true;
|
||||
if(inputs[| 0].value_from.node == _valueFrom.node) {
|
||||
|
@ -29,20 +29,20 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
cache_value = -1;
|
||||
|
||||
static getNextNodes = function() {
|
||||
static getNextNodes = function() { #region
|
||||
if(!struct_has(group, "outputNextNode")) return [];
|
||||
return group.outputNextNode();
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static initLoop = function() {
|
||||
static initLoop = function() { #region
|
||||
cache_value = noone;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static cloneValue = function(_prev_val, _val) {
|
||||
static cloneValue = function(_prev_val, _val) { #region
|
||||
if(inputs[| 0].isLeaf()) return _prev_val;
|
||||
|
||||
var is_surf = inputs[| 0].value_from.type == VALUE_TYPE.surface;
|
||||
|
@ -52,9 +52,9 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
_new_val = is_surf? surface_array_clone(_val) : array_clone(_val);
|
||||
|
||||
return _new_val;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
if(inputs[| 0].isLeaf()) {
|
||||
group.iterationUpdate();
|
||||
return;
|
||||
|
@ -63,5 +63,5 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
var _val = getInputData(0);
|
||||
cache_value = cloneValue(cache_value, _val);
|
||||
group.iterationUpdate();
|
||||
}
|
||||
} #endregion
|
||||
}
|
|
@ -9,9 +9,9 @@ function Node_Iterator_Sort_Input(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue("Value in", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 );
|
||||
|
||||
attributes.sort_inputs = 0;
|
||||
|
||||
static update = function() {
|
||||
outputs[| 0].setType(inputs[| 0].type);
|
||||
|
||||
var val = getInputData(0);
|
||||
outputs[| 0].setValue(val);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,9 @@ function Node_Iterator_Sort_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
|
||||
inputs[| 0] = nodeValue("Result", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false )
|
||||
.setVisible(true, true);
|
||||
|
||||
|
||||
attributes.sort_inputs = 0;
|
||||
|
||||
static getNextNodes = function() { return []; }
|
||||
|
||||
static step = function() {}
|
||||
|
|
|
@ -176,19 +176,15 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
var ins = _data[0];
|
||||
|
||||
var out_type = _data[9];
|
||||
var out = _data[1];
|
||||
|
||||
var out_type = _data[9];
|
||||
var out = _data[1];
|
||||
var pos = [ _data[2][0], _data[2][1] ];
|
||||
var pos_exact = _data[10];
|
||||
|
||||
var anc = [ _data[3][0], _data[3][1] ];
|
||||
|
||||
var rot_vel = vel * _data[8];
|
||||
var rot = _data[5] + rot_vel;
|
||||
|
||||
var sca = _data[6];
|
||||
var mode = _data[7];
|
||||
var anc = [ _data[3][0], _data[3][1] ];
|
||||
var rot_vel = vel * _data[8];
|
||||
var rot = _data[5] + rot_vel;
|
||||
var sca = _data[6];
|
||||
var mode = _data[7];
|
||||
|
||||
var cDep = attrDepth();
|
||||
|
||||
|
@ -198,7 +194,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _hh = hh;
|
||||
if(_ww <= 1 && _hh <= 1) return _outSurf;
|
||||
|
||||
switch(out_type) {
|
||||
switch(out_type) { #region output dimension
|
||||
case OUTPUT_SCALING.same_as_input :
|
||||
inputs[| 1].setVisible(false);
|
||||
break;
|
||||
|
@ -230,7 +226,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
_ww = maxx - minx;
|
||||
_hh = maxy - miny;
|
||||
break;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
if(_ww <= 0 || _hh <= 0) return;
|
||||
_outSurf = surface_verify(_outSurf, _ww, _hh, cDep);
|
||||
|
||||
|
|
|
@ -1222,13 +1222,17 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
for( var i = 0, n = array_length(nodes_selecting_jun); i < n; i++ ) {
|
||||
var _node = nodes_selecting_jun[i];
|
||||
|
||||
for( var j = 0, m = ds_list_size(_node.outputs); j < m; j++ ) {
|
||||
var _junction = _node.outputs[| j];
|
||||
if(!_junction.visible) continue;
|
||||
if(value_bit(_junction.type) & value_bit(value_dragging.type) == 0) continue;
|
||||
if(_node == value_focus.node) {
|
||||
ds_priority_add(_jlist, value_focus, value_focus.y);
|
||||
} else {
|
||||
for( var j = 0, m = ds_list_size(_node.outputs); j < m; j++ ) {
|
||||
var _junction = _node.outputs[| j];
|
||||
if(!_junction.visible) continue;
|
||||
if(value_bit(_junction.type) & value_bit(value_dragging.type) == 0) continue;
|
||||
|
||||
ds_priority_add(_jlist, _junction, _junction.y);
|
||||
break;
|
||||
ds_priority_add(_jlist, _junction, _junction.y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -328,6 +328,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
}
|
||||
|
||||
var prevS = getNodePreviewSurface();
|
||||
|
||||
if(is_surface(prevS)) {
|
||||
canvas_w = surface_get_width_safe(prevS);
|
||||
canvas_h = surface_get_height_safe(prevS);
|
||||
|
|
|
@ -204,12 +204,8 @@ function Render(partial = false, runAction = false) { #region
|
|||
|
||||
var nextNodes = rendering.getNextNodes();
|
||||
for( var i = 0, n = array_length(nextNodes); i < n; i++ ) {
|
||||
if(nextNodes[i].isRenderable()) {
|
||||
//LOG($"push {nextNodes[i].internalName} to render stack.");
|
||||
if(nextNodes[i].isRenderable())
|
||||
RENDER_QUEUE.enqueue(nextNodes[i]);
|
||||
} else {
|
||||
//LOG($"skip {nextNodes[i].internalName}.");
|
||||
}
|
||||
}
|
||||
|
||||
if(runAction && rendering.hasInspector1Update())
|
||||
|
@ -274,28 +270,8 @@ function RenderList(list, skipInLoop = true) { #region
|
|||
for( var i = 0, n = ds_list_size(list); i < n; i++ ) {
|
||||
var _node = list[| i];
|
||||
|
||||
if(is_undefined(_node)) { LOG_IF(global.FLAG.render == 1, $"Skip undefiend {_node}"); continue; }
|
||||
if(!is_instanceof(_node, Node)) { LOG_IF(global.FLAG.render == 1, $"Skip non-node {_node}"); continue; }
|
||||
_node.render_time = 0;
|
||||
|
||||
if(_node.is_group_io) { LOG_IF(global.FLAG.render == 1, $"Skip group IO {_node.internalName}"); continue; }
|
||||
|
||||
if(!_node.active) { LOG_IF(global.FLAG.render == 1, $"Skip inactive {_node.internalName}"); continue; }
|
||||
if(!_node.isRenderActive()) { LOG_IF(global.FLAG.render == 1, $"Skip non-renderActive {_node.internalName}"); continue; }
|
||||
if(!_node.attributes.update_graph) { LOG_IF(global.FLAG.render == 1, $"Skip non-auto update {_node.internalName}"); continue; }
|
||||
|
||||
if(skipInLoop && __nodeManualManaged(_node)) { LOG_IF(global.FLAG.render == 1, $"Skip in-loop {_node.internalName}"); continue; }
|
||||
|
||||
if(_node.passiveDynamic) {
|
||||
_node.forwardPassiveDynamic();
|
||||
LOG_IF(global.FLAG.render == 1, $"Skip passive dynamic {_node.internalName}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(_node.rendered && !_node.isActiveDynamic()) { LOG_IF(global.FLAG.render == 1, $"Skip rendered static {_node.internalName}"); continue; }
|
||||
//if() { LOG_IF(global.FLAG.render == 1, $"Skip static {_node.internalName}"); continue; }
|
||||
|
||||
LOG_BLOCK_START();
|
||||
if(!__nodeIsRenderLeaf(_node))
|
||||
continue;
|
||||
|
||||
LOG_IF(global.FLAG.render == 1, $"Found leaf {_node.internalName}");
|
||||
ds_queue_enqueue(queue, _node);
|
||||
|
@ -321,7 +297,8 @@ function RenderList(list, skipInLoop = true) { #region
|
|||
|
||||
var nextNodes = rendering.getNextNodes();
|
||||
for( var i = 0, n = array_length(nextNodes); i < n; i++ )
|
||||
ds_queue_enqueue(queue, nextNodes[i]);
|
||||
if(nextNodes[i].isRenderable())
|
||||
ds_queue_enqueue(queue, nextNodes[i]);
|
||||
}
|
||||
|
||||
LOG_BLOCK_END();
|
||||
|
|
|
@ -87,10 +87,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
tb_value.setRange(curr_minn, curr_maxx);
|
||||
}
|
||||
|
||||
if(THEME_VALUE.slider_type == "full_height")
|
||||
draw_sprite_stretched_ext(spr, 0, _x, _y, sw, _h, blend, 1);
|
||||
else if(THEME_VALUE.slider_type == "stem")
|
||||
draw_sprite_stretched_ext(spr, 0, _x - ui(4), _y + _h / 2 - ui(4), sw + ui(8), ui(8), blend, 1);
|
||||
draw_sprite_stretched_ext(spr, 0, _x - ui(4), _y + _h / 2 - ui(4), sw + ui(8), ui(8), blend, 1);
|
||||
|
||||
if(stepSize >= 1 && sw / ((curr_maxx - curr_minn) / stepSize) > ui(8)) {
|
||||
for( var i = curr_minn; i <= curr_maxx; i += stepSize ) {
|
||||
|
@ -102,14 +99,10 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
|
||||
var _pg = clamp((current_value - curr_minn) / (curr_maxx - curr_minn), 0, 1) * sw;
|
||||
var _kx = _x + _pg;
|
||||
if(THEME_VALUE.slider_type == "full_height")
|
||||
draw_sprite_stretched_ext(spr, 1, _x, _y, _pg, _h, blend, 1);
|
||||
else if(THEME_VALUE.slider_type == "stem")
|
||||
draw_sprite_stretched_ext(spr, 1, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
|
||||
draw_sprite_stretched_ext(spr, 1, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
|
||||
|
||||
if(dragging) {
|
||||
if(THEME_VALUE.slider_type == "stem")
|
||||
draw_sprite_stretched_ext(spr, 3, _kx - handle_w / 2, _y, handle_w, _h, COLORS._main_accent, 1);
|
||||
draw_sprite_stretched_ext(spr, 3, _kx - handle_w / 2, _y, handle_w, _h, COLORS._main_accent, 1);
|
||||
|
||||
var val = (dragging.drag_sx - dragging.drag_msx) / dragging.drag_sw * (curr_maxx - curr_minn) + curr_minn;
|
||||
val = round(val / stepSize) * stepSize;
|
||||
|
@ -133,8 +126,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
}
|
||||
} else {
|
||||
if(hover && (point_in_rectangle(_m[0], _m[1], _x, _y, _x + sw, _y + _h) || point_in_rectangle(_m[0], _m[1], _kx - handle_w / 2, _y, _kx + handle_w / 2, _y + _h))) {
|
||||
if(THEME_VALUE.slider_type == "stem")
|
||||
draw_sprite_stretched_ext(spr, 2, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
|
||||
draw_sprite_stretched_ext(spr, 2, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
|
||||
|
||||
if(mouse_press(mb_left, active)) {
|
||||
dragging = instance_create(0, 0, slider_Slider);
|
||||
|
|
Loading…
Reference in a new issue