mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-26 11:44:52 +01:00
Fix array on write bugs. Get value now copy array before sending.
This commit is contained in:
parent
1efeb7067a
commit
244b6bf4b3
18 changed files with 128 additions and 57 deletions
|
@ -112,7 +112,11 @@
|
||||||
{"name":"lua","order":16,"path":"folders/nodes/data/lua.yy",},
|
{"name":"lua","order":16,"path":"folders/nodes/data/lua.yy",},
|
||||||
{"name":"node","order":11,"path":"folders/nodes/data/node.yy",},
|
{"name":"node","order":11,"path":"folders/nodes/data/node.yy",},
|
||||||
{"name":"PCX","order":22,"path":"folders/nodes/data/PCX.yy",},
|
{"name":"PCX","order":22,"path":"folders/nodes/data/PCX.yy",},
|
||||||
|
{"name":"array","order":6,"path":"folders/nodes/data/PCX/array.yy",},
|
||||||
|
{"name":"flow control","order":7,"path":"folders/nodes/data/PCX/flow control.yy",},
|
||||||
{"name":"fn","order":2,"path":"folders/nodes/data/PCX/fn.yy",},
|
{"name":"fn","order":2,"path":"folders/nodes/data/PCX/fn.yy",},
|
||||||
|
{"name":"surface","order":3,"path":"folders/nodes/data/PCX/surface.yy",},
|
||||||
|
{"name":"value","order":4,"path":"folders/nodes/data/PCX/value.yy",},
|
||||||
{"name":"pixel builder","order":20,"path":"folders/nodes/data/pixel builder.yy",},
|
{"name":"pixel builder","order":20,"path":"folders/nodes/data/pixel builder.yy",},
|
||||||
{"name":"box","order":2,"path":"folders/nodes/data/pixel builder/box.yy",},
|
{"name":"box","order":2,"path":"folders/nodes/data/pixel builder/box.yy",},
|
||||||
{"name":"draw","order":3,"path":"folders/nodes/data/pixel builder/draw.yy",},
|
{"name":"draw","order":3,"path":"folders/nodes/data/pixel builder/draw.yy",},
|
||||||
|
@ -202,10 +206,7 @@
|
||||||
{"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",},
|
{"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",},
|
||||||
{"name":"widget","order":3,"path":"folders/VCT/widget.yy",},
|
{"name":"widget","order":3,"path":"folders/VCT/widget.yy",},
|
||||||
{"name":"widgets","order":5,"path":"folders/widgets.yy",},
|
{"name":"widgets","order":5,"path":"folders/widgets.yy",},
|
||||||
{"name":"surface","order":3,"path":"folders/nodes/data/PCX/surface.yy",},
|
{"name":"what?","order":10,"path":"folders/panels/what?.yy",},
|
||||||
{"name":"value","order":4,"path":"folders/nodes/data/PCX/value.yy",},
|
|
||||||
{"name":"array","order":6,"path":"folders/nodes/data/PCX/array.yy",},
|
|
||||||
{"name":"flow control","order":7,"path":"folders/nodes/data/PCX/flow control.yy",},
|
|
||||||
],
|
],
|
||||||
"ResourceOrderSettings": [
|
"ResourceOrderSettings": [
|
||||||
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
|
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
|
||||||
|
|
|
@ -138,7 +138,11 @@
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"lua","folderPath":"folders/nodes/data/lua.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"lua","folderPath":"folders/nodes/data/lua.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"node","folderPath":"folders/nodes/data/node.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"node","folderPath":"folders/nodes/data/node.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"PCX","folderPath":"folders/nodes/data/PCX.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"PCX","folderPath":"folders/nodes/data/PCX.yy",},
|
||||||
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/data/PCX/array.yy",},
|
||||||
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"flow control","folderPath":"folders/nodes/data/PCX/flow control.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"fn","folderPath":"folders/nodes/data/PCX/fn.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"fn","folderPath":"folders/nodes/data/PCX/fn.yy",},
|
||||||
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/nodes/data/PCX/surface.yy",},
|
||||||
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/data/PCX/value.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"pixel builder","folderPath":"folders/nodes/data/pixel builder.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"pixel builder","folderPath":"folders/nodes/data/pixel builder.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"box","folderPath":"folders/nodes/data/pixel builder/box.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"box","folderPath":"folders/nodes/data/pixel builder/box.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"draw","folderPath":"folders/nodes/data/pixel builder/draw.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"draw","folderPath":"folders/nodes/data/pixel builder/draw.yy",},
|
||||||
|
@ -239,10 +243,7 @@
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/nodes/data/PCX/surface.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"what?","folderPath":"folders/panels/what?.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/data/PCX/value.yy",},
|
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/data/PCX/array.yy",},
|
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"flow control","folderPath":"folders/nodes/data/PCX/flow control.yy",},
|
|
||||||
],
|
],
|
||||||
"IncludedFiles": [
|
"IncludedFiles": [
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
|
||||||
|
|
|
@ -80,7 +80,13 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
|
||||||
draw_tooltip_buffer(content);
|
draw_tooltip_buffer(content);
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
draw_tooltip_text(string(content));
|
var tt = "";
|
||||||
|
if(is_struct(content))
|
||||||
|
tt = $"[{instanceof(content)}] {content}";
|
||||||
|
else
|
||||||
|
tt = string(content);
|
||||||
|
|
||||||
|
draw_tooltip_text(tt);
|
||||||
}
|
}
|
||||||
} else if(TOOLTIP != "")
|
} else if(TOOLTIP != "")
|
||||||
draw_tooltip_text(TOOLTIP);
|
draw_tooltip_text(TOOLTIP);
|
||||||
|
|
|
@ -36,7 +36,8 @@ function Compute_DynaSurf() : DynaSurf() constructor {
|
||||||
|
|
||||||
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {
|
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {
|
||||||
if(drawFn == noone) return;
|
if(drawFn == noone) return;
|
||||||
drawFn.evalFn({
|
|
||||||
|
var params = {
|
||||||
x: _x,
|
x: _x,
|
||||||
y: _y,
|
y: _y,
|
||||||
sx: _sx,
|
sx: _sx,
|
||||||
|
@ -44,6 +45,8 @@ function Compute_DynaSurf() : DynaSurf() constructor {
|
||||||
angle: _ang,
|
angle: _ang,
|
||||||
color: _col,
|
color: _col,
|
||||||
alpha: _alp
|
alpha: _alp
|
||||||
});
|
};
|
||||||
|
|
||||||
|
drawFn.eval(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ function Node_PCX_fn_Math(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) con
|
||||||
var _opr = inputs[| 0].getValue();
|
var _opr = inputs[| 0].getValue();
|
||||||
var _x = inputs[| 1].getValue();
|
var _x = inputs[| 1].getValue();
|
||||||
var _y = inputs[| 2].getValue();
|
var _y = inputs[| 2].getValue();
|
||||||
|
var _z = inputs[| 3].getValue();
|
||||||
var _sym = syms[_opr];
|
var _sym = syms[_opr];
|
||||||
|
|
||||||
switch(_sym) {
|
switch(_sym) {
|
||||||
|
@ -46,6 +47,27 @@ function Node_PCX_fn_Math(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) con
|
||||||
default: inputs[| 3].setVisible(false, false);
|
default: inputs[| 3].setVisible(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch(_sym) {
|
||||||
|
case "abs" :
|
||||||
|
case "round" :
|
||||||
|
case "floor" :
|
||||||
|
case "ceil" :
|
||||||
|
case "sin" :
|
||||||
|
case "cos" :
|
||||||
|
case "tan" :
|
||||||
|
case "arcsin" :
|
||||||
|
case "arccos" :
|
||||||
|
case "arctan" :
|
||||||
|
case "min" :
|
||||||
|
case "max" :
|
||||||
|
case "clamp" :
|
||||||
|
case "lerp" :
|
||||||
|
outputs[| 0].setValue(new __funcTree(_sym, [ _x, _y, _z ]));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
outputs[| 0].setValue(new __funcTree(_sym, _x, _y));
|
outputs[| 0].setValue(new __funcTree(_sym, _x, _y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -16,6 +16,6 @@ function Node_PCX_fn_Random(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) c
|
||||||
var _max = inputs[| 1].getValue();
|
var _max = inputs[| 1].getValue();
|
||||||
var _int = inputs[| 2].getValue();
|
var _int = inputs[| 2].getValue();
|
||||||
|
|
||||||
outputs[| 0].setValue(new __funcTree(_int? "irandom" : "random", _min, _max));
|
outputs[| 0].setValue(new __funcTree(_int? "irandom" : "random", [ _min, _max ]));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,6 +7,6 @@ function Node_PCX_fn_Surface_Height(_x, _y, _group = noone) : Node_PCX(_x, _y, _
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
var _surf = inputs[| 0].getValue();
|
var _surf = inputs[| 0].getValue();
|
||||||
outputs[| 0].setValue(new __funcTree("surface_get_height", _surf));
|
outputs[| 0].setValue(new __funcTree("surface_get_height", [ _surf ]));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,6 +7,6 @@ function Node_PCX_fn_Surface_Width(_x, _y, _group = noone) : Node_PCX(_x, _y, _g
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
var _surf = inputs[| 0].getValue();
|
var _surf = inputs[| 0].getValue();
|
||||||
outputs[| 0].setValue(new __funcTree("surface_get_width", _surf));
|
outputs[| 0].setValue(new __funcTree("surface_get_width", [ _surf ]));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
function Node_DynaSurf(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor {
|
function Node_DynaSurf(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor {
|
||||||
name = "Dynamic Surface";
|
name = "Dynamic Surface";
|
||||||
color = COLORS.node_blend_dynaSurf;
|
color = COLORS.node_blend_dynaSurf;
|
||||||
icon = THEME.pixel_builder;
|
|
||||||
|
|
||||||
reset_all_child = true;
|
reset_all_child = true;
|
||||||
draw_input_overlay = false;
|
draw_input_overlay = false;
|
||||||
|
@ -15,6 +14,8 @@ function Node_DynaSurf(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
||||||
var _input = nodeBuild("Node_DynaSurf_In", -256, -32, self);
|
var _input = nodeBuild("Node_DynaSurf_In", -256, -32, self);
|
||||||
var _output = nodeBuild("Node_DynaSurf_Out", 256, -32, self);
|
var _output = nodeBuild("Node_DynaSurf_Out", 256, -32, self);
|
||||||
|
|
||||||
|
_output.inputs[| 0].setFrom(_input.outputs[| 0]);
|
||||||
|
|
||||||
var _yy = -32 + 24;
|
var _yy = -32 + 24;
|
||||||
var _nx = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("x"); _output.inputs[| 1].setFrom(_nx .outputs[| 0]); _yy += 24;
|
var _nx = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("x"); _output.inputs[| 1].setFrom(_nx .outputs[| 0]); _yy += 24;
|
||||||
var _ny = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("y"); _output.inputs[| 2].setFrom(_ny .outputs[| 0]); _yy += 24;
|
var _ny = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("y"); _output.inputs[| 2].setFrom(_ny .outputs[| 0]); _yy += 24;
|
||||||
|
@ -24,14 +25,31 @@ function Node_DynaSurf(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
||||||
var _nclr = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("color"); _output.inputs[| 6].setFrom(_nclr.outputs[| 0]); _yy += 24;
|
var _nclr = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("color"); _output.inputs[| 6].setFrom(_nclr.outputs[| 0]); _yy += 24;
|
||||||
var _nalp = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("alpha"); _output.inputs[| 7].setFrom(_nalp.outputs[| 0]); _yy += 24;
|
var _nalp = nodeBuild("Node_PCX_fn_var", 128, _yy, self).setDisplayName("alpha"); _output.inputs[| 7].setFrom(_nalp.outputs[| 0]); _yy += 24;
|
||||||
|
|
||||||
|
_nsx.inputs[| 0].setValue(1);
|
||||||
|
_nsy.inputs[| 0].setValue(1);
|
||||||
|
_nclr.inputs[| 0].setValue(c_white);
|
||||||
|
_nalp.inputs[| 0].setValue(1);
|
||||||
|
|
||||||
_yy += 64;
|
_yy += 64;
|
||||||
var _outW = nodeBuild("Node_DynaSurf_Out_Width", 256, _yy, self) _yy += 64;
|
var _outW = nodeBuild("Node_DynaSurf_Out_Width", 256, _yy, self)
|
||||||
var _outH = nodeBuild("Node_DynaSurf_Out_Height", 256, _yy, self) _yy += 64;
|
var _surW = nodeBuild("Node_PCX_fn_Surface_Width", 128, _yy, self)
|
||||||
|
|
||||||
|
_surW.inputs[| 0].setFrom(_input.outputs[| 0]);
|
||||||
|
_outW.inputs[| 0].setFrom(_surW.outputs[| 0]);
|
||||||
|
|
||||||
|
_yy += 64;
|
||||||
|
var _outH = nodeBuild("Node_DynaSurf_Out_Height", 256, _yy, self)
|
||||||
|
var _surH = nodeBuild("Node_PCX_fn_Surface_Height", 128, _yy, self)
|
||||||
|
|
||||||
|
_surH.inputs[| 0].setFrom(_input.outputs[| 0]);
|
||||||
|
_outH.inputs[| 0].setFrom(_surH.outputs[| 0]);
|
||||||
|
|
||||||
UPDATE |= RENDER_TYPE.full;
|
UPDATE |= RENDER_TYPE.full;
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function() {
|
static setDynamicSurface = function() {
|
||||||
var _dyna = new Compute_DynaSurf();
|
var _dyna = new Compute_DynaSurf();
|
||||||
|
|
||||||
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
|
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
|
||||||
var _n = nodes[| i];
|
var _n = nodes[| i];
|
||||||
|
|
||||||
|
@ -45,4 +63,6 @@ function Node_DynaSurf(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
||||||
|
|
||||||
outputs[| 0].setValue(_dyna);
|
outputs[| 0].setValue(_dyna);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static update = function() {}
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Input";
|
name = "Input";
|
||||||
|
color = COLORS.node_blend_dynaSurf;
|
||||||
w = 96;
|
w = 96;
|
||||||
|
|
||||||
manual_deletable = false;
|
manual_deletable = false;
|
||||||
destroy_when_upgroup = true;
|
destroy_when_upgroup = true;
|
||||||
color = COLORS.node_blend_collection;
|
|
||||||
|
|
||||||
inParent = undefined;
|
inParent = undefined;
|
||||||
|
|
||||||
|
@ -54,6 +54,11 @@ function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
static update = function(frame = PROJECT.animator.current_frame) {
|
static update = function(frame = PROJECT.animator.current_frame) {
|
||||||
if(is_undefined(inParent)) return;
|
if(is_undefined(inParent)) return;
|
||||||
var _val = inParent.getValue();
|
var _val = inParent.getValue();
|
||||||
|
|
||||||
outputs[| 0].setValue(new __funcTree("", _val));
|
outputs[| 0].setValue(new __funcTree("", _val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static postDeserialize = function() { #region
|
||||||
|
createInput(false);
|
||||||
|
} #endregion
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
function Node_DynaSurf_Out(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
function Node_DynaSurf_Out(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
||||||
name = "Output";
|
name = "Output";
|
||||||
|
color = COLORS.node_blend_dynaSurf;
|
||||||
|
|
||||||
manual_deletable = false;
|
manual_deletable = false;
|
||||||
destroy_when_upgroup = true;
|
destroy_when_upgroup = true;
|
||||||
|
@ -20,7 +21,8 @@ function Node_DynaSurf_Out(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
||||||
|
|
||||||
inputs[| 7] = nodeValue("alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
inputs[| 7] = nodeValue("alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("PCX", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone);
|
outputs[| 0] = nodeValue("PCX", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone)
|
||||||
|
.setVisible(false);
|
||||||
|
|
||||||
input_display_list = [ 0,
|
input_display_list = [ 0,
|
||||||
["Transform", false], 1, 2, 3, 4, 5,
|
["Transform", false], 1, 2, 3, 4, 5,
|
||||||
|
@ -38,5 +40,7 @@ function Node_DynaSurf_Out(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
||||||
var _alp = inputs[| 7].getValue();
|
var _alp = inputs[| 7].getValue();
|
||||||
|
|
||||||
outputs[| 0].setValue(new __funcTree("draw", [ _surf, _x, _y, _sx, _sy, _ang, _clr, _alp ]));
|
outputs[| 0].setValue(new __funcTree("draw", [ _surf, _x, _y, _sx, _sy, _ang, _clr, _alp ]));
|
||||||
|
|
||||||
|
if(group) group.setDynamicSurface();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,17 +1,21 @@
|
||||||
function Node_DynaSurf_Out_Height(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
function Node_DynaSurf_Out_Height(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
||||||
name = "getHeight";
|
name = "getHeight";
|
||||||
|
color = COLORS.node_blend_dynaSurf;
|
||||||
|
|
||||||
manual_deletable = false;
|
manual_deletable = false;
|
||||||
destroy_when_upgroup = true;
|
destroy_when_upgroup = true;
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Height", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
inputs[| 0] = nodeValue("Height", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("PCX", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone);
|
outputs[| 0] = nodeValue("PCX", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone)
|
||||||
|
.setVisible(false);
|
||||||
|
|
||||||
input_display_list = [ 0 ];
|
input_display_list = [ 0 ];
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
var _h = inputs[| 0].getValue();
|
var _h = inputs[| 0].getValue();
|
||||||
outputs[| 0].setValue(_h);
|
outputs[| 0].setValue(_h);
|
||||||
|
|
||||||
|
if(group) group.setDynamicSurface();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,17 +1,21 @@
|
||||||
function Node_DynaSurf_Out_Width(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
function Node_DynaSurf_Out_Width(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
||||||
name = "getWidth";
|
name = "getWidth";
|
||||||
|
color = COLORS.node_blend_dynaSurf;
|
||||||
|
|
||||||
manual_deletable = false;
|
manual_deletable = false;
|
||||||
destroy_when_upgroup = true;
|
destroy_when_upgroup = true;
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
inputs[| 0] = nodeValue("Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("PCX", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone);
|
outputs[| 0] = nodeValue("PCX", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone)
|
||||||
|
.setVisible(false);
|
||||||
|
|
||||||
input_display_list = [ 0 ];
|
input_display_list = [ 0 ];
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
var _w = inputs[| 0].getValue();
|
var _w = inputs[| 0].getValue();
|
||||||
outputs[| 0].setValue(_w);
|
outputs[| 0].setValue(_w);
|
||||||
|
|
||||||
|
if(group) group.setDynamicSurface();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -265,7 +265,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static processValue = function(_val) { #region
|
static processValue = function(_val) { #region
|
||||||
if(is_array(_val)) return _val;
|
if(is_array(_val)) return array_clone(_val);
|
||||||
if(is_struct(_val)) return _val;
|
if(is_struct(_val)) return _val;
|
||||||
if(is_undefined(_val)) return 0;
|
if(is_undefined(_val)) return 0;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
triggerRender();
|
triggerRender();
|
||||||
}, false) ]);
|
}, false) ]);
|
||||||
|
|
||||||
static getInputData = function(index) { return array_safe_get(current_data, index, 0); }
|
static getInputData = function(index, def = 0) { return array_safe_get(inputs_data, index, def); }
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index = 0) { return _outSurf; }
|
static processData = function(_outSurf, _data, _output_index, _array_index = 0) { return _outSurf; }
|
||||||
|
|
||||||
|
|
|
@ -268,14 +268,14 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
_surf_out = _surf_out[preview_index];
|
_surf_out = _surf_out[preview_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
var pos = current_data[2];
|
var pos = getInputData(2);
|
||||||
var _pos = [ pos[0], pos[1] ];
|
var _pos = [ pos[0], pos[1] ];
|
||||||
|
|
||||||
var anc = current_data[3];
|
var anc = getInputData(3);
|
||||||
var _anc = [ anc[0], anc[1] ];
|
var _anc = [ anc[0], anc[1] ];
|
||||||
|
|
||||||
var rot = current_data[5];
|
var rot = getInputData(5);
|
||||||
var sca = current_data[6];
|
var sca = getInputData(6);
|
||||||
|
|
||||||
var srw = surface_get_width_safe(_surf);
|
var srw = surface_get_width_safe(_surf);
|
||||||
var srh = surface_get_height_safe(_surf);
|
var srh = surface_get_height_safe(_surf);
|
||||||
|
|
|
@ -346,7 +346,7 @@ function nodeValueUnit(_nodeValue) constructor { #region
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static invApply = function(value, index = 0) { #region
|
static invApply = function(value, index = 0) { #region
|
||||||
//value = variable_clone(value);
|
value = array_clone(value);
|
||||||
|
|
||||||
if(mode == VALUE_UNIT.constant)
|
if(mode == VALUE_UNIT.constant)
|
||||||
return value;
|
return value;
|
||||||
|
@ -357,7 +357,7 @@ function nodeValueUnit(_nodeValue) constructor { #region
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static apply = function(value, index = 0) { #region
|
static apply = function(value, index = 0) { #region
|
||||||
//value = variable_clone(value);
|
value = array_clone(value);
|
||||||
|
|
||||||
if(mode == VALUE_UNIT.constant) return value;
|
if(mode == VALUE_UNIT.constant) return value;
|
||||||
if(reference == noone) return value;
|
if(reference == noone) return value;
|
||||||
|
@ -366,8 +366,6 @@ function nodeValueUnit(_nodeValue) constructor { #region
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static convertUnit = function(value, unitTo, index = 0) { #region
|
static convertUnit = function(value, unitTo, index = 0) { #region
|
||||||
//value = variable_clone(value);
|
|
||||||
|
|
||||||
var disp = _nodeValue.display_type;
|
var disp = _nodeValue.display_type;
|
||||||
var base = reference(index);
|
var base = reference(index);
|
||||||
var inv = unitTo == VALUE_UNIT.reference;
|
var inv = unitTo == VALUE_UNIT.reference;
|
||||||
|
@ -1225,7 +1223,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
|
|
||||||
if(cache_hit) {
|
if(cache_hit) {
|
||||||
global.cache_hit++;
|
global.cache_hit++;
|
||||||
return cache_value[2];
|
return array_clone(cache_value[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1240,7 +1238,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
cache_value[2] = val;
|
cache_value[2] = val;
|
||||||
cache_value[3] = applyUnit;
|
cache_value[3] = applyUnit;
|
||||||
|
|
||||||
return val;
|
return array_clone(val);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static __getAnimValue = function(_time = PROJECT.animator.current_frame) { #region
|
static __getAnimValue = function(_time = PROJECT.animator.current_frame) { #region
|
||||||
|
|
|
@ -67,9 +67,19 @@
|
||||||
global.FUNCTIONS[? "ord"] = [ ["char"], function(val) { return ord(array_safe_get(val, 0)); } ];
|
global.FUNCTIONS[? "ord"] = [ ["char"], function(val) { return ord(array_safe_get(val, 0)); } ];
|
||||||
|
|
||||||
global.FUNCTIONS[? "draw"] = [ ["surface", "x = 0", "y = 0", "xs = 1", "ys = 1", "rot = 0", "color = white", "alpha = 1"],
|
global.FUNCTIONS[? "draw"] = [ ["surface", "x = 0", "y = 0", "xs = 1", "ys = 1", "rot = 0", "color = white", "alpha = 1"],
|
||||||
function(val) { return draw_surface_ext_safe(array_safe_get(val, 0, -1), array_safe_get(val, 1, 0), array_safe_get(val, 2, 0),
|
function(val) {
|
||||||
array_safe_get(val, 3, 1), array_safe_get(val, 4, 1), array_safe_get(val, 5, 0),
|
var _surface = array_safe_get(val, 0, -1);
|
||||||
array_safe_get(val, 6, c_white), array_safe_get(val, 7, 1));
|
if(!is_surface(_surface)) return false;
|
||||||
|
|
||||||
|
var _x = array_safe_get(val, 1, 0);
|
||||||
|
var _y = array_safe_get(val, 2, 0);
|
||||||
|
var _xs = array_safe_get(val, 3, 1);
|
||||||
|
var _ys = array_safe_get(val, 4, 1);
|
||||||
|
var _rot = array_safe_get(val, 5, 0);
|
||||||
|
var _col = array_safe_get(val, 6, c_white);
|
||||||
|
var _alp = array_safe_get(val, 7, 1);
|
||||||
|
draw_surface_ext_safe(_surface, _x, _y, _xs, _ys, _rot, _col, _alp);
|
||||||
|
return true;
|
||||||
} ];
|
} ];
|
||||||
|
|
||||||
global.FUNCTIONS[? "surface_get_width"] = [ ["surface"], function(val) { return surface_get_width_safe(array_safe_get(val, 0)); } ];
|
global.FUNCTIONS[? "surface_get_width"] = [ ["surface"], function(val) { return surface_get_width_safe(array_safe_get(val, 0)); } ];
|
||||||
|
@ -329,6 +339,9 @@
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static eval = function(params = {}, isLeft = false) { #region
|
static eval = function(params = {}, isLeft = false) { #region
|
||||||
|
//print($"{symbol}, {l} | {r}")
|
||||||
|
//print(params);
|
||||||
|
|
||||||
if(ds_map_exists(global.FUNCTIONS, symbol)) {
|
if(ds_map_exists(global.FUNCTIONS, symbol)) {
|
||||||
if(!is_array(l)) return 0;
|
if(!is_array(l)) return 0;
|
||||||
|
|
||||||
|
@ -349,6 +362,7 @@
|
||||||
var getRaw = false;
|
var getRaw = false;
|
||||||
switch(symbol) {
|
switch(symbol) {
|
||||||
case "=":
|
case "=":
|
||||||
|
case "≔":
|
||||||
case "【":
|
case "【":
|
||||||
getRaw = true;
|
getRaw = true;
|
||||||
}
|
}
|
||||||
|
@ -436,17 +450,6 @@
|
||||||
return res;
|
return res;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static evalFn = function(params) { #region
|
|
||||||
if(!ds_map_exists(global.FUNCTIONS, symbol)) return;
|
|
||||||
|
|
||||||
if(!is_array(params)) return 0;
|
|
||||||
|
|
||||||
var _fn = global.FUNCTIONS[? symbol];
|
|
||||||
var _ev = _fn[1];
|
|
||||||
var res = _ev(params);
|
|
||||||
return res;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
static eval_real = function(v1, v2, _symbol = symbol) { #region
|
static eval_real = function(v1, v2, _symbol = symbol) { #region
|
||||||
switch(_symbol) {
|
switch(_symbol) {
|
||||||
case "+":
|
case "+":
|
||||||
|
|
Loading…
Add table
Reference in a new issue