save load append

This commit is contained in:
MakhamDev 2022-01-18 11:31:19 +07:00
parent 90dde88646
commit 1971cb7660
119 changed files with 557 additions and 380 deletions

View file

@ -277,11 +277,12 @@
{"id":{"name":"areaBox","path":"scripts/areaBox/areaBox.yy",},"order":1,},
{"id":{"name":"s_node_noise_aniso","path":"sprites/s_node_noise_aniso/s_node_noise_aniso.yy",},"order":39,},
{"id":{"name":"node_particle","path":"scripts/node_particle/node_particle.yy",},"order":0,},
{"id":{"name":"append","path":"scripts/append/append.yy",},"order":1,},
{"id":{"name":"s_node_particle_effector","path":"sprites/s_node_particle_effector/s_node_particle_effector.yy",},"order":37,},
{"id":{"name":"s_dialog_active","path":"sprites/s_dialog_active/s_dialog_active.yy",},"order":0,},
{"id":{"name":"obj_reader","path":"scripts/obj_reader/obj_reader.yy",},"order":2,},
{"id":{"name":"sh_invert","path":"shaders/sh_invert/sh_invert.yy",},"order":30,},
{"id":{"name":"save_load","path":"scripts/save_load/save_load.yy",},"order":3,},
{"id":{"name":"save_load","path":"scripts/save_load/save_load.yy",},"order":0,},
{"id":{"name":"node_perlin_smear","path":"scripts/node_perlin_smear/node_perlin_smear.yy",},"order":10,},
{"id":{"name":"node_alpha_cutoff","path":"scripts/node_alpha_cutoff/node_alpha_cutoff.yy",},"order":37,},
{"id":{"name":"sh_channel_R","path":"shaders/sh_channel_R/sh_channel_R.yy",},"order":12,},
@ -642,6 +643,7 @@
{"folderPath":"folders/sprites/preview.yy","order":9,"resourceVersion":"1.0","name":"preview","tags":[],"resourceType":"GMFolder",},
{"folderPath":"folders/sprites/preview/path.yy","order":8,"resourceVersion":"1.0","name":"path","tags":[],"resourceType":"GMFolder",},
{"folderPath":"folders/functions/debug.yy","order":15,"resourceVersion":"1.0","name":"debug","tags":[],"resourceType":"GMFolder",},
{"folderPath":"folders/functions/save load.yy","order":16,"resourceVersion":"1.0","name":"save load","tags":[],"resourceType":"GMFolder",},
],
"AudioGroups": [
{"targets":-1,"resourceVersion":"1.3","name":"audiogroup_default","resourceType":"GMAudioGroup",},

View file

@ -13,6 +13,9 @@ event_inherited();
destroy_on_click_out = true;
node_selecting = 0;
node_focusing = -1;
anchor = ANCHOR.left | ANCHOR.top;
if(PANEL_GRAPH.getCurrentContext() == -1 && ADD_NODE_PAGE == "Group")
@ -89,6 +92,7 @@ event_inherited();
var hh = grid_space;
var yy = _y + grid_space;
var name_height = 0;
var amo = 0;
for(var i = 0; i < row; i++) {
name_height = 0;
@ -116,13 +120,14 @@ event_inherited();
draw_set_text(f_p1, fa_center, fa_top, c_white);
name_height = max(name_height, string_height_ext(_node.name, -1, grid_size) + 8);
draw_text_ext(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
amo++;
}
}
var hght = grid_size + grid_space + name_height;
hh += hght;
yy += hght;
}
return hh;
});
#endregion
@ -157,16 +162,19 @@ event_inherited();
search_pane = new scrollPane(dialog_w - 32, dialog_h - 52 - 14, function(_y, _m) {
draw_clear_alpha(c_ui_blue_black, 0);
var grid_size = 64;
var grid_size = 64;
var grid_width = 80;
var grid_space = 16;
var col = floor(search_pane.surface_w / (grid_width + grid_space));
var hh = (grid_space + grid_size) * 2;
var yy = _y + grid_space;
var index = 0;
var col = floor(search_pane.surface_w / (grid_width + grid_space));
var hh = (grid_space + grid_size) * 2;
var yy = _y + grid_space;
var index = 0;
var name_height = 0;
var amo = 0;
var use_mouse = false;
var search_lower = string_lower(search_string);
for(var i = 0; i < ds_list_size(NODE_CATAGORY); i++) {
var _page = ALL_NODES[? NODE_CATAGORY[| i]];
@ -194,11 +202,21 @@ event_inherited();
draw_text_ext(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
if(point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
draw_sprite_stretched(s_node_active, 0, _boxx, yy, grid_size, grid_size);
node_selecting = amo;
if(mouse_check_button_pressed(mb_left))
buildNode(_node);
}
if(node_selecting == amo) {
draw_sprite_stretched(s_node_active, 0, _boxx, yy, grid_size, grid_size);
if(keyboard_check_pressed(vk_enter))
buildNode(_node);
}
if(node_focusing == amo) {
search_pane.scroll_y_to = -max(0, hh - search_pane.h);
}
if(++index >= col) {
index = 0;
var hght = grid_size + grid_space + name_height;
@ -206,10 +224,24 @@ event_inherited();
hh += hght;
yy += hght;
}
amo++;
}
}
}
node_focusing = -1;
if(keyboard_check_pressed(vk_up)) {
node_selecting = safe_mod(node_selecting - 1 + amo, amo);
node_focusing = node_selecting;
}
if(keyboard_check_pressed(vk_down)) {
node_selecting = safe_mod(node_selecting + 1, amo);
node_focusing = node_selecting;
}
return hh;
});
#endregion

View file

@ -21,6 +21,8 @@ if !ready exit;
draw_sprite_stretched(s_ui_panel_bg, 0, dialog_x + 120, dialog_y + 14, dialog_w - 120 - 14, dialog_h - 28);
content_pane.active = FOCUS == self;
content_pane.draw(dialog_x + 120, dialog_y + 14);
node_selecting = 0;
} else {
tb_search.draw(dialog_x + 14, dialog_y + 14, dialog_w - 28, 32, search_string, [mouse_mx, mouse_my]);

93
scripts/append/append.gml Normal file
View file

@ -0,0 +1,93 @@
function APPEND(_path) {
APPEND_ID = NODE_ID + 1;
APPENDING = true;
if(_path == "") return;
var file = file_text_open_read(_path);
var load_str = "";
while(!file_text_eof(file)) {
load_str += file_text_readln(file);
}
var _map = json_decode(load_str);
if(ds_map_exists(_map, "version")) {
var _v = _map[? "version"];
if(_v != SAVEFILE_VERSION) {
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
log_warning("FILE", warn)
PANEL_MENU.addNotiExtra(warn);
}
} else {
var warn = "File version mismatch : loading old format to Pixel Composer " + string(SAVEFILE_VERSION);
log_warning("FILE", warn)
PANEL_MENU.addNotiExtra(warn);
}
var _node_list = _map[? "nodes"];
var appended_list = ds_list_create();
var node_create = ds_list_create();
ds_queue_clear(CONNECTION_CONFLICT);
for(var i = 0; i < ds_list_size(_node_list); i++) {
var _node = nodeLoad(_node_list[| i], true);
if(_node) ds_list_add(appended_list, _node);
}
ds_map_destroy(_map);
file_text_close(file);
for(var i = 0; i < ds_list_size(appended_list); i++) {
var _node = appended_list[| i];
_node.loadGroup();
if(_node.group == PANEL_GRAPH.getCurrentContext())
ds_list_add(node_create, _node);
}
for(var i = 0; i < ds_list_size(appended_list); i++) {
appended_list[| i].postDeserialize();
}
for(var i = 0; i < ds_list_size(appended_list); i++) {
appended_list[| i].preConnect();
}
for(var i = 0; i < ds_list_size(appended_list); i++) {
appended_list[| i].connect();
}
for(var i = 0; i < ds_list_size(appended_list); i++) {
appended_list[| i].postConnect();
}
for(var i = 0; i < ds_list_size(appended_list); i++) {
appended_list[| i].doUpdate();
}
ds_list_destroy(appended_list);
renderAll();
if(!ds_queue_empty(CONNECTION_CONFLICT)) {
var pass = 0;
while(++pass < 2 && !ds_queue_empty(CONNECTION_CONFLICT)) {
var size = ds_queue_size(CONNECTION_CONFLICT);
log_message("LOAD", "[Connect] " + string(size) + " Connection conflict(s) detected ( pass: " + string(pass) + " )");
repeat(size) {
ds_queue_dequeue(CONNECTION_CONFLICT).connect();
}
renderAll();
}
if(!ds_queue_empty(CONNECTION_CONFLICT))
PANEL_MENU.addNotiExtra("Some connection(s) is unsolved. This may caused by render node not being update properly, or image path is broken.");
}
APPENDING = false;
PANEL_ANIMATION.updatePropertyList();
log_message("FILE", "append file " + _path);
return node_create;
}

12
scripts/append/append.yy Normal file
View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "save load",
"path": "folders/functions/save load.yy",
},
"resourceVersion": "1.0",
"name": "append",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -32,7 +32,7 @@ function log_newline() {
exception_unhandled_handler(function(ex) {
var tt = "\n-------------------------- OH NO --------------------------\n\n";
tt += ex.longMessage;
tt += "\n-------------------------- STACK TRACE --------------------------\n";
tt += "\n-------------------------- STACK TRACE --------------------------\n\n";
for( var i = 0; i < array_length(ex.stacktrace); i++ ) {
tt += ex.stacktrace[i] + "\n";
}

View file

@ -82,7 +82,7 @@ function Node_2D_light(_x, _y) : Node_Processor(_x, _y) constructor {
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _shape = _data[1];
switch(_shape) {

View file

@ -135,7 +135,7 @@ function Node_3D_Cube(_x, _y) : Node(_x, _y) constructor {
}
}
function update() {
static update = function() {
var _inSurf = inputs[| 0].getValue();
var _ww = surface_get_width(_inSurf);

View file

@ -185,7 +185,7 @@ function Node_3D_Cylinder(_x, _y) : Node(_x, _y) constructor {
camera_set_view_mat(cam, cam_proj);
#endregion
function update() {
static update = function() {
var _sides = inputs[| 0].getValue();
var _thick = inputs[| 1].getValue();

View file

@ -135,7 +135,7 @@ function Node_3D_Transform(_x, _y) : Node_Processor(_x, _y) constructor {
}
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _out_type = inputs[| 4].getValue();
var _out = inputs[| 5].getValue();

View file

@ -106,7 +106,7 @@ function Node_9Slice(_x, _y) : Node_Processor(_x, _y) constructor {
}
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _inSurf = _data[0];
var _dim = _data[1];
var _splice = _data[2];

View file

@ -13,7 +13,7 @@ function Node_Alpha_Cutoff(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -11,7 +11,7 @@ function Node_Alpha_Grey(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -20,7 +20,7 @@ function Node_Array(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []);
function update() {
static update = function() {
var res = array_create(input_size);
input_size = 0;

View file

@ -16,7 +16,7 @@ function Node_Array_Length(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
function update() {
static update = function() {
var _arr = inputs[| 0].getValue();
if(!is_array(_arr)) return;
outputs[| 0].setValue(array_length(_arr));

View file

@ -13,7 +13,7 @@ function Node_Atlas(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -23,7 +23,7 @@ function Node_Bevel(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _hei = _data[1];
var _shf = _data[2];
var _sca = _data[3];

View file

@ -25,7 +25,7 @@ function Node_Blend(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _fore = _data[1];
var _type = _data[2];
var _opacity = _data[3];

View file

@ -22,7 +22,7 @@ function Node_Bloom(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _size = _data[1];
var _tole = _data[2];
var _stre = _data[3];

View file

@ -15,7 +15,7 @@ function Node_Blur(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _size = _data[1];
var _clamp = _data[2];

View file

@ -23,7 +23,7 @@ function Node_Blur_Contrast(_x, _y) : Node_Processor(_x, _y) constructor {
pass = surface_create(1, 1);
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _surf = _data[0];
var _size = _data[1];
var _tres = _data[2];

View file

@ -32,7 +32,7 @@ function Node_Blur_Directional(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 2].drawOverlay(_active, _x + ww / 2 * _s, _y + hh / 2 * _s, _s, _mx, _my);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _str = _data[1];
var _dir = _data[2];
surface_set_target(_outSurf);

View file

@ -27,7 +27,7 @@ function Node_Blur_Radial(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 2].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _str = _data[1];
var _cen = _data[2];
_cen[0] /= surface_get_width(_outSurf);

View file

@ -19,7 +19,7 @@ function Node_BW(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _exp = _data[1];
var _con = _data[2];
surface_set_target(_outSurf);

View file

@ -497,7 +497,7 @@ function Node_Canvas(_x, _y) : Node(_x, _y) constructor {
#endregion
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _outSurf = outputs[| 0].getValue();
@ -527,9 +527,9 @@ function Node_Canvas(_x, _y) : Node(_x, _y) constructor {
_map[? "surface"] = buffer_base64_encode(surface_buffer, 0, buffer_get_size(surface_buffer));
}
static doDeserialize = function(_map) {
if(!ds_map_exists(_map, "surface")) return;
surface_buffer = buffer_base64_decode(_map[? "surface"]);
static postDeserialize = function() {
if(!ds_map_exists(load_map, "surface")) return;
surface_buffer = buffer_base64_decode(load_map[? "surface"]);
var _outSurf = outputs[| 0].getValue();
buffer_set_surface(surface_buffer, _outSurf, 0);
}

View file

@ -13,7 +13,7 @@ function Node_RGB_Channel(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 1] = nodeValue(1, "Surface green", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
outputs[| 2] = nodeValue(2, "Surface blue", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, output_index) {
static process_data = function(_outSurf, _data, output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -34,7 +34,7 @@ function Node_Checker(_x, _y) : Node(_x, _y) constructor {
inputs[| 2].drawOverlay(_active, px, py, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _ang = inputs[| 2].getValue();

View file

@ -27,7 +27,7 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor {
}
}
function step() {
static step = function() {
render_time = 0;
for(var i = 0; i < ds_list_size(nodes); i++) {
nodes[| i].step();
@ -40,15 +40,48 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor {
}
}
load_map = -1;
function doDeserialize(map) {
load_map = ds_map_create();
ds_map_copy(load_map, map);
static preConnect = function() {
sortIO();
deserialize(keyframe_scale);
}
static doConnect = function() {
deserialize(load_map, keyframe_scale);
ds_map_destroy(load_map);
static sortIO = function() {
var siz = ds_list_size(inputs);
var ar = ds_priority_create();
for( var i = 0; i < siz; i++ ) {
var _in = inputs[| i];
var _or = _in.from.inputs[| 5].getValue();
ds_priority_add(ar, _in, _or);
}
ds_list_clear(inputs);
for( var i = 0; i < siz; i++ ) {
var _jin = ds_priority_delete_min(ar);
_jin.index = i;
ds_list_add(inputs, _jin);
}
ds_priority_destroy(ar);
var siz = ds_list_size(outputs);
var ar = ds_priority_create();
for( var i = 0; i < siz; i++ ) {
var _out = outputs[| i];
var _or = _out.from.inputs[| 1].getValue();
ds_priority_add(ar, _out, _or);
}
ds_list_clear(outputs);
for( var i = 0; i < siz; i++ ) {
var _jout = ds_priority_delete_min(ar);
_jout.index = i;
ds_list_add(outputs, _jout);
}
ds_priority_destroy(ar);
}
}

View file

@ -16,7 +16,7 @@ function Node_Color(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, []);
function update() {
static update = function() {
outputs[| 0].setValue(inputs[| 0].getValue());
}

View file

@ -63,7 +63,7 @@ function Node_Color_adjust(_x, _y) : Node_Processor(_x, _y) constructor {
["Color blend", false], 6, 7, 9
];
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _exp = _data[1];
var _con = _data[2];
var _hue = _data[3];

View file

@ -22,7 +22,7 @@ function Node_Color_HSV(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
function update() {
static update = function() {
outputs[| 0].setValue(make_color_hsv(inputs[| 0].getValue() * 255, inputs[| 1].getValue() * 255, inputs[| 2].getValue() * 255));
}
doUpdate();

View file

@ -22,7 +22,7 @@ function Node_Color_RGB(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
function update() {
static update = function() {
outputs[| 0].setValue(make_color_rgb(inputs[| 0].getValue() * 255, inputs[| 1].getValue() * 255, inputs[| 2].getValue() * 255));
}
doUpdate();

View file

@ -21,7 +21,7 @@ function Node_Color_Remove(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var fr = _data[1];
var tr = _data[2];

View file

@ -42,7 +42,7 @@ function Node_Color_replace(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var fr = _data[1];
var to = _data[2];
var tr = _data[3];

View file

@ -20,7 +20,7 @@ function Node_Sampler(_x, _y) : Node(_x, _y) constructor {
}
_input = -1;
function update() {
static update = function() {
var _surf = inputs[| 0].getValue();
if(!is_surface(_surf)) return;
if(_input != _surf) {

View file

@ -10,17 +10,22 @@ function Node_Colorize(_x, _y) : Node_Processor(_x, _y) constructor {
uniform_grad_blend = shader_get_uniform(sh_colorize, "gradient_blend");
uniform_color = shader_get_uniform(sh_colorize, "gradient_color");
uniform_time = shader_get_uniform(sh_colorize, "gradient_time");
uniform_shift = shader_get_uniform(sh_colorize, "gradient_shift");
uniform_key = shader_get_uniform(sh_colorize, "keys");
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue(1, "Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
.setDisplay(VALUE_DISPLAY.gradient);
inputs[| 2] = nodeValue(2, "Gradient shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider, [ -1, 1, .01 ]);
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _gra = _data[1];
var _gra_data = inputs[| 1].getExtraData();
var _gra_shift = _data[2];
var _grad_color = [];
var _grad_time = [];
@ -41,6 +46,7 @@ function Node_Colorize(_x, _y) : Node_Processor(_x, _y) constructor {
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
shader_set_uniform_f_array(uniform_color, _grad_color);
shader_set_uniform_f_array(uniform_time, _grad_time);
shader_set_uniform_f(uniform_shift, _gra_shift);
shader_set_uniform_i(uniform_key, ds_list_size(_gra));
draw_surface_safe(_data[0], 0, 0);

View file

@ -247,7 +247,7 @@ function Node_Composite(_x, _y) : Node_Processor(_x, _y) constructor {
}
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _pad = _data[0];
var _dim_type = _data[1];
var _dim = _data[2];
@ -325,8 +325,8 @@ function Node_Composite(_x, _y) : Node_Processor(_x, _y) constructor {
surface_reset_target();
}
static doDeserialize = function(_map) {
var _inputs = _map[? "inputs"];
static postDeserialize = function() {
var _inputs = load_map[? "inputs"];
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length) {
createNewSurface();

View file

@ -30,7 +30,7 @@ function Node_Corner(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var wd = _data[1];
var temp = surface_create(surface_get_width(_data[0]), surface_get_height(_data[0]));

View file

@ -95,7 +95,7 @@ function Node_Crop(_x, _y) : Node_Processor(_x, _y) constructor {
}
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _inSurf = _data[0];
var _crop = _data[1];
var _dim = [ surface_get_width(_inSurf) - _crop[0] - _crop[2], surface_get_height(_inSurf) - _crop[1] - _crop[3] ];

View file

@ -172,20 +172,16 @@ function Node(_x, _y) constructor {
jun = inputs[| input_display_list[i]];
}
if(jun.isVisible()) {
jun.y = _in;
_in += 24 * _s;
}
jun.y = _in;
_in += 24 * _s * jun.isVisible();
}
var _in = yy + junction_shift_y * _s;
for(var i = 0; i < ds_list_size(outputs); i++) {
var jun = outputs[| i];
if(jun.isVisible()) {
jun.y = _in;
_in += 24 * _s;
}
jun.y = _in;
_in += 24 * _s * jun.isVisible();
}
}
@ -470,7 +466,7 @@ function Node(_x, _y) constructor {
ds_list_add(group.nodes, input_node);
input_node._inParent.setFrom(_in.value_from);
input_node.inParent.setFrom(_in.value_from);
input_node.onValueUpdate(0);
_in.setFrom(input_node.outputs[| 0]);
}
@ -483,7 +479,7 @@ function Node(_x, _y) constructor {
var output_node = new Node_Group_Output(x + w + 64, y, group);
ds_list_add(group.nodes, output_node);
_to.setFrom(output_node._outParent);
_to.setFrom(output_node.outParent);
output_node.inputs[| 0].setFrom(_ou);
}
}
@ -518,22 +514,23 @@ function Node(_x, _y) constructor {
static doSerialize = function(_map) {}
keyframe_scale = false;
static deserialize = function(_map, scale = false) {
load_map = -1;
static deserialize = function(scale = false) {
keyframe_scale = scale;
node_id = _map[? "id"] + APPEND_ID;
node_id = load_map[? "id"] + APPEND_ID;
NODE_MAP[? node_id] = self;
NODE_ID = max(NODE_ID, node_id + 1);
name = _map[? "name"];
_group = _map[? "group"];
name = load_map[? "name"];
_group = load_map[? "group"];
x = _map[? "x"];
y = _map[? "y"];
x = load_map[? "x"];
y = load_map[? "y"];
if(ds_map_exists(_map, "attri"))
ds_map_override(attributes, _map[? "attri"]);
if(ds_map_exists(load_map, "attri"))
ds_map_override(attributes, load_map[? "attri"]);
var _inputs = _map[? "inputs"];
var _inputs = load_map[? "inputs"];
if(!ds_list_empty(_inputs) && !ds_list_empty(inputs)) {
var _siz = min(ds_list_size(_inputs), ds_list_size(inputs));
@ -541,34 +538,29 @@ function Node(_x, _y) constructor {
inputs[| i].deserialize(_inputs[| i], scale);
}
}
doDeserialize(_map);
}
static doDeserialize = function(_map) {}
static postDeserialize = function() {}
static connect = function() {
static loadGroup = function() {
if(_group == -1) {
var c = PANEL_GRAPH.getCurrentContext();
if(c != -1) c.add(self);
} else {
if(ds_map_exists(NODE_MAP, _group + APPEND_ID))
if(ds_map_exists(NODE_MAP, _group + APPEND_ID)) {
NODE_MAP[? _group + APPEND_ID].add(self);
}
}
preConnect();
}
static connect = function() {
var connected = true;
for(var i = 0; i < ds_list_size(inputs); i++) {
connected &= inputs[| i].connect();
}
if(!connected) ds_queue_enqueue(CONNECTION_CONFLICT, self);
doConnect();
}
static preConnect = function() {}
static doConnect = function() {}
static postConnect = function() {}
}

View file

@ -15,7 +15,7 @@ function Node_De_Corner(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -16,7 +16,7 @@ function Node_De_Stray(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -32,7 +32,7 @@ function Node_Dilate(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 3].drawOverlay(_active, px, py, _s, _mx, _my, 0, 1, s_anchor_scale_hori);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -45,7 +45,7 @@ function Node_Displace(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
switch(_data[5]) {
case 0 :
inputs[| 2].show_in_inspector = true;

View file

@ -53,7 +53,7 @@ function Node_Dither(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _pal = _data[1];
var _typ = _data[2];
var _map = _data[3];

View file

@ -17,7 +17,7 @@ function Node_Erode(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var wd = _data[1];
surface_set_target(_outSurf);

View file

@ -27,7 +27,7 @@ function Node_Frame(_x, _y) : Node(_x, _y) constructor {
inputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white )
.setVisible(false);
function step() {
static step = function() {
var si = inputs[| 0].getValue();
w = si[0];
h = si[1];

View file

@ -25,7 +25,7 @@ function Node_Glow(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _border = _data[1];
var _size = _data[2];
var _stre = _data[3];

View file

@ -11,6 +11,7 @@ function Node_Gradient(_x, _y) : Node(_x, _y) constructor {
uniform_grad = shader_get_uniform(sh_gradient, "gradient_color");
uniform_grad_time = shader_get_uniform(sh_gradient, "gradient_time");
uniform_grad_key = shader_get_uniform(sh_gradient, "gradient_keys");
uniform_grad_loop = shader_get_uniform(sh_gradient, "gradient_loop");
uniform_type = shader_get_uniform(sh_gradient, "type");
uniform_center = shader_get_uniform(sh_gradient, "center");
@ -23,33 +24,43 @@ function Node_Gradient(_x, _y) : Node(_x, _y) constructor {
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 1] = nodeValue(1, "Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
.setDisplay(VALUE_DISPLAY.gradient);
.setDisplay(VALUE_DISPLAY.gradient)
inputs[| 2] = nodeValue(2, "Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Circular", "Radial" ]);
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Circular", "Radial" ])
.setVisible(false);
inputs[| 3] = nodeValue(3, "Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 4] = nodeValue(4, "Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, .5);
.setDisplay(VALUE_DISPLAY.rotation)
.setVisible(false);
inputs[| 4] = nodeValue(4, "Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, .5)
.setVisible(false);
inputs[| 5] = nodeValue(5, "Shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider, [-2, 2, 0.01]);
.setDisplay(VALUE_DISPLAY.slider, [-2, 2, 0.01])
.setVisible(false);
inputs[| 6] = nodeValue(6, "Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [def_surf_size / 2, def_surf_size / 2])
.setDisplay(VALUE_DISPLAY.vector);
.setDisplay(VALUE_DISPLAY.vector)
.setVisible(false);
inputs[| 7] = nodeValue(7, "Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
.setVisible(false);
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
input_display_list = [
["Output", true], 0,
["Gradient", false], 1, 2, 3, 4, 5, 6
["Gradient", false], 1, 5, 7,
["Shape", false], 2, 3, 4, 6
];
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
inputs[| 6].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _outSurf = outputs[| 0].getValue();
@ -67,6 +78,7 @@ function Node_Gradient(_x, _y) : Node(_x, _y) constructor {
var _rad = inputs[| 4].getValue();
var _shf = inputs[| 5].getValue();
var _cnt = inputs[| 6].getValue();
var _lop = inputs[| 7].getValue();
var _grad_color = [];
var _grad_time = [];
@ -92,6 +104,7 @@ function Node_Gradient(_x, _y) : Node(_x, _y) constructor {
shader_set_uniform_f_array(uniform_grad, _grad_color);
shader_set_uniform_f_array(uniform_grad_time, _grad_time);
shader_set_uniform_i(uniform_grad_key, ds_list_size(_gra));
shader_set_uniform_i(uniform_grad_loop, _lop);
shader_set_uniform_f_array(uniform_center, [_cnt[0] / _dim[0], _cnt[1] / _dim[1]]);
shader_set_uniform_i(uniform_type, _typ);

View file

@ -23,7 +23,7 @@ function Node_Gradient_Out(_x, _y) : Node(_x, _y) constructor {
outputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
_pal = -1;
function update() {
static update = function() {
var pal = inputs[| 0].getValue();
var pos = inputs[| 1].getValue();

View file

@ -11,7 +11,7 @@ function Node_Grey_Alpha(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -19,7 +19,7 @@ function Node_Greyscale(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _exp = _data[1];
var _con = _data[2];
surface_set_target(_outSurf);

View file

@ -34,7 +34,7 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
inputs[| 1].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();
var _sca = inputs[| 2].getValue();

View file

@ -12,7 +12,8 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor {
auto_height = false;
input_index = -1;
self.group = _group;
group = _group;
inParent = undefined;
w = 96;
h = 32 + 24;
@ -38,11 +39,19 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor {
.setDisplay(VALUE_DISPLAY.enum_button, [ "2", "3", "4" ])
.setVisible(false, false);
input_display_list = [ 2, 0, 1, 3, 4 ];
inputs[| 5] = nodeValue(5, "Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setVisible(false);
input_display_list = [
["Data", false], 2, 4,
["Display", false], 5, 0, 1, 3
];
outputs[| 0] = nodeValue(0, "Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
function onValueUpdate(index) {
static onValueUpdate = function(index) {
if(is_undefined(inParent)) return;
var _dtype = inputs[| 0].getValue();
var _range = inputs[| 1].getValue();
var _val_type = inputs[| 2].getValue();
@ -58,36 +67,36 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor {
}
}
_inParent.type = _val_type;
inParent.type = _val_type;
outputs[| 0].type = _val_type;
var _val = _inParent.getValue();
var _val = inParent.getValue();
switch(_dtype) {
case VALUE_DISPLAY.range :
case VALUE_DISPLAY.slider :
_inParent.setDisplay(_dtype, [_range[0], _range[1], 0.01]);
inParent.setDisplay(_dtype, [_range[0], _range[1], 0.01]);
break;
case VALUE_DISPLAY.slider_range :
_inParent.setDisplay(_dtype, [_range[0], _range[1], 0.01]);
inParent.setDisplay(_dtype, [_range[0], _range[1], 0.01]);
case VALUE_DISPLAY.rotation_range :
if(!is_array(_val) || array_length(_val) != 2)
_inParent.value = new animValue([0, 0], _inParent);
inParent.value = new animValue([0, 0], inParent);
break;
case VALUE_DISPLAY.enum_button :
case VALUE_DISPLAY.enum_scroll :
_inParent.setDisplay(_dtype, string_splice(_enum_label, ","));
inParent.setDisplay(_dtype, string_splice(_enum_label, ","));
break;
case VALUE_DISPLAY.padding :
if(!is_array(_val) || array_length(_val) != 4)
_inParent.value = new animValue([0, 0, 0, 0], _inParent);
inParent.value = new animValue([0, 0, 0, 0], inParent);
break;
case VALUE_DISPLAY.area :
if(!is_array(_val) || array_length(_val) != 5)
_inParent.value = new animValue([0, 0, 0, 0, 5], _inParent);
inParent.value = new animValue([0, 0, 0, 0, 5], inParent);
break;
case VALUE_DISPLAY.vector :
@ -95,40 +104,53 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor {
switch(_vec_size) {
case 0 :
if(!is_array(_val) || array_length(_val) != 2)
_inParent.value = new animValue([0, 0], _inParent);
inParent.value = new animValue([0, 0], inParent);
break;
case 1 :
if(!is_array(_val) || array_length(_val) != 3)
_inParent.value = new animValue([0, 0, 0], _inParent);
inParent.value = new animValue([0, 0, 0], inParent);
break;
case 2 :
if(!is_array(_val) || array_length(_val) != 4)
_inParent.value = new animValue([0, 0, 0, 0], _inParent);
inParent.value = new animValue([0, 0, 0, 0], inParent);
break;
}
_inParent.setDisplay(_dtype);
inParent.setDisplay(_dtype);
break;
case VALUE_DISPLAY.palette :
if(!is_array(_val))
_inParent.value = new animValue([c_black], _inParent);
inParent.value = new animValue([c_black], inParent);
break;
default :
_inParent.setDisplay(_dtype);
inParent.setDisplay(_dtype);
break;
}
group.sortIO();
}
function createInput() {
input_index = ds_list_size(group.inputs);
_inParent = nodeValue(ds_list_size(group.inputs), "Value", group, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1);
ds_list_add(group.inputs, _inParent);
outputs[| 0].setFrom(_inParent, false, false);
group.setHeight();
onValueUpdate(0);
function createInput(override_order = false) {
if(group && is_struct(group)) {
if(override_order) {
input_index = ds_list_size(group.inputs);
inputs[| 5].setValue(input_index);
} else {
input_index = inputs[| 5].getValue();
}
inParent = nodeValue(ds_list_size(group.inputs), "Value", group, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1);
inParent.from = self;
ds_list_add(group.inputs, inParent);
outputs[| 0].setFrom(inParent, false, false);
group.setHeight();
group.sortIO();
onValueUpdate(0);
}
}
if(!LOADING && !APPENDING)
@ -137,8 +159,14 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor {
dtype = -1;
range = 0;
function update() {
_inParent.name = name;
static step = function() {
if(is_undefined(inParent)) return;
inParent.name = name;
}
static update = function() {
if(is_undefined(inParent)) return;
var _dtype = inputs[| 0].getValue();
@ -163,12 +191,14 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor {
}
}
static preConnect = function() {
createInput();
static postDeserialize = function() {
createInput(false);
onValueUpdate(0);
}
function onDestroy() {
ds_list_remove(group.inputs, _inParent);
if(is_undefined(inParent)) return;
ds_list_remove(group.inputs, inParent);
}
}

View file

@ -19,43 +19,67 @@ function Node_Group_Output(_x, _y, _group) : Node(_x, _y) constructor {
inputs[| 0] = nodeValue(0, "Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1);
_outParent = -1;
inputs[| 1] = nodeValue(1, "Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setVisible(false);
function createOutput() {
_outParent = nodeValue(ds_list_size(group.outputs), "Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1);
ds_list_add(group.outputs, _outParent);
group.setHeight();
outParent = undefined;
output_index = -1;
static onValueUpdate = function(index) {
if(is_undefined(outParent)) return;
_outParent.setFrom(inputs[| 0]);
group.sortIO();
}
function createOutput(override_order = true) {
if(group && is_struct(group)) {
if(override_order) {
output_index = ds_list_size(group.outputs);
inputs[| 1].setValue(output_index);
} else {
output_index = inputs[| 1].getValue();
}
outParent = nodeValue(ds_list_size(group.outputs), "Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1);
outParent.from = self;
ds_list_add(group.outputs, outParent);
group.setHeight();
group.sortIO();
outParent.setFrom(inputs[| 0]);
}
}
if(!LOADING && !APPENDING)
createOutput();
function step() {
_outParent.name = name;
static step = function() {
if(is_undefined(outParent)) return;
outParent.name = name;
if(inputs[| 0].value_from) {
_outParent.type = inputs[| 0].value_from.type;
outParent.type = inputs[| 0].value_from.type;
inputs[| 0].type = inputs[| 0].value_from.type;
} else {
inputs[| 0].type = VALUE_TYPE.any;
}
}
function doUpdateForward() {
if(_outParent == -1) return;
if(is_undefined(outParent)) return;
for(var j = 0; j < ds_list_size(_outParent.value_to); j++) {
if(_outParent.value_to[| j].value_from == _outParent) {
_outParent.value_to[| j].node.updateForward();
for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
if(outParent.value_to[| j].value_from == outParent) {
outParent.value_to[| j].node.updateForward();
}
}
}
function doConnect() {
createOutput();
static postDeserialize = function() {
createOutput(false);
}
function onDestroy() {
ds_list_delete(group.outputs, ds_list_find_index(group.outputs, _outParent));
if(is_undefined(outParent)) return;
ds_list_delete(group.outputs, ds_list_find_index(group.outputs, outParent));
}
}

View file

@ -83,7 +83,7 @@ function Node_Image(_x, _y) : Node(_x, _y) constructor {
return false;
}
function update() {
static update = function() {
var path = inputs[| 0].getValue();
var pad = inputs[| 1].getValue();
if(path == "") return;

View file

@ -110,7 +110,7 @@ function Node_Image_Animated(_x, _y) : Node(_x, _y) constructor {
return true;
}
function update() {
static update = function() {
var path = inputs[| 0].getValue();
if(path == "") return;
if(is_array(path) && !array_equals(path, path_loaded))

View file

@ -103,7 +103,7 @@ function Node_Image_gif(_x, _y) : Node(_x, _y) constructor {
}
}
function update() {
static update = function() {
var path = inputs[| 0].getValue();
if(path == "") return;
updatePaths(path);

View file

@ -113,7 +113,7 @@ function Node_Image_Sequence(_x, _y) : Node(_x, _y) constructor {
return true;
}
function update() {
static update = function() {
var path = inputs[| 0].getValue();
if(path == "") return;
if(!array_equals(path, path_loaded))

View file

@ -223,7 +223,7 @@ function Node_Image_Sheet(_x, _y) : Node(_x, _y) constructor {
}
}
function update() {
static update = function() {
if(inputs[| 0].value_from == noone) return;
var _inSurf = inputs[| 0].getValue();

View file

@ -11,7 +11,7 @@ function Node_Invert(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -39,7 +39,6 @@ function animValue(_val, _node) constructor {
static getValue = function() {
if(node.display_type == VALUE_DISPLAY.gradient) return processType(values);
if(node.type == VALUE_TYPE.path) return processType(values[| 0].value);
if(!is_anim) return processType(values[| 0].value);

View file

@ -20,7 +20,7 @@ function Node_Level(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _black = _data[1];
var _white = _data[2];

View file

@ -20,7 +20,7 @@ function Node_Level_Selector(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _middle = _data[1];
var _range = _data[2];

View file

@ -50,7 +50,7 @@ function Node_Line(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _bg = inputs[| 1].getValue();
var _seg = inputs[| 2].getValue();

View file

@ -38,7 +38,7 @@ function Node_Mirror(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 2].drawOverlay(_active, _posx, _posy, _s, _mx, _my);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _dim = [ surface_get_width(_data[0]), surface_get_height(_data[0]) ];
var _pos = _data[1];
var _ang = _data[2];

View file

@ -34,7 +34,7 @@ function Node_Noise_Aniso(_x, _y) : Node(_x, _y) constructor {
inputs[| 3].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _sed = inputs[| 2].getValue();

View file

@ -56,7 +56,7 @@ function Node_Cellular(_x, _y) : Node(_x, _y) constructor {
inputs[| 1].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();
var _sca = inputs[| 2].getValue();

View file

@ -38,7 +38,7 @@ function Node_Grid_Noise(_x, _y) : Node(_x, _y) constructor {
inputs[| 1].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();
var _sca = inputs[| 2].getValue();

View file

@ -15,7 +15,7 @@ function Node_Normal(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _hei = _data[1];
surface_set_target(_outSurf);

View file

@ -50,7 +50,7 @@ function Node_Normal_Light(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 5].drawOverlay(_active, px, py, _s, _mx, _my);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _map = _data[1];
var _hei = _data[2];
var _amb = _data[3];

View file

@ -38,7 +38,7 @@ function Node_Outline(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
outputs[| 1] = nodeValue(1, "Outline", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var ww = surface_get_width(_data[0]);
var hh = surface_get_height(_data[0]);
var wd = _data[1];
@ -73,7 +73,7 @@ function Node_Outline(_x, _y) : Node_Processor(_x, _y) constructor {
return _outSurf;
}
function step() {
static step = function() {
var blend = inputs[| 3].getValue();
inputs[| 4].show_in_inspector = blend;
}

View file

@ -14,7 +14,7 @@ function Node_Padding(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var padding = _data[1];
var ww = surface_get_width(_data[0]);

View file

@ -27,7 +27,7 @@ function Node_Palette(_x, _y) : Node(_x, _y) constructor {
_pal = -1;
_ran = [0, 1];
function update() {
static update = function() {
var pal = inputs[| 0].getValue();
var ran = inputs[| 1].getValue();

View file

@ -83,7 +83,7 @@ function __part() constructor {
active = false;
}
function step() {
static step = function() {
if(!active) return;
var xp = x, yp = y;
x += sx;
@ -444,7 +444,7 @@ function Node_Particle(_x, _y) : Node(_x, _y) constructor {
}
}
function step() {
static step = function() {
var _inSurf = inputs[| 0].getValue();
var _scatt = inputs[| 27].getValue();
@ -535,7 +535,7 @@ function Node_Particle(_x, _y) : Node(_x, _y) constructor {
cacheCurrentFrame(_outSurf);
}
function update() {
static update = function() {
reset();
}
doUpdate();

View file

@ -72,7 +72,7 @@ function Node_Particle_Effector(_x, _y) : Node(_x, _y) constructor {
inputs[| 2].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function step() {
static step = function() {
var _type = inputs[| 5].getValue();
switch(_type) {
case FORCE_TYPE.Wind :
@ -205,7 +205,7 @@ function Node_Particle_Effector(_x, _y) : Node(_x, _y) constructor {
}
}
function update() {
static update = function() {
var jun = outputs[| 0];
for(var j = 0; j < ds_list_size(jun.value_to); j++) {
if(jun.value_to[| j].value_from == jun) {

View file

@ -306,8 +306,8 @@ function Node_Path(_x, _y) : Node(_x, _y) constructor {
draw_sprite_ext(s_node_draw_path, 0, xx + w * _s / 2, yy + 10 + (h - 10) * _s / 2, _s, _s, 0, c_white, 1);
}
static doDeserialize = function(_map) {
var _inputs = _map[? "inputs"];
static postDeserialize = function() {
var _inputs = load_map[? "inputs"];
for(var i = list_start; i < ds_list_size(_inputs); i++) {
createAnchor(0, 0).deserialize(_inputs[| i]);

View file

@ -30,7 +30,7 @@ function Node_Perlin(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();
var _sca = inputs[| 2].getValue();

View file

@ -30,7 +30,7 @@ function Node_Perlin_Smear(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _pos = inputs[| 1].getValue();
var _sca = inputs[| 2].getValue();

View file

@ -20,7 +20,7 @@ function Node_Pin(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Out", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
function update() {
static update = function() {
if(inputs[| 0].value_from != noone) {
outputs[| 0].value_from = inputs[| 0].value_from;
}

View file

@ -48,7 +48,7 @@ function Node_Pixel_Cloud(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _sed = _data[1];
var _str = _data[2];
var _map = _data[3];

View file

@ -11,7 +11,7 @@ function Node_Polar(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -32,7 +32,7 @@ function Node_Posterize(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function step() {
static step = function() {
var _use_pal = inputs[| 2].getValue();
inputs[| 1].show_in_inspector = _use_pal;
@ -40,7 +40,7 @@ function Node_Posterize(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 4].show_in_inspector = !_use_pal;
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _gra = _data[1];
var _use_gra = _data[2];

View file

@ -9,9 +9,9 @@ function Node_Processor(_x, _y) : Node(_x, _y) constructor {
icon = s_node_processor;
function process_data(_outSurf, _data, _output_index) { return _outSurf; }
static process_data = function(_outSurf, _data, _output_index) { return _outSurf; }
function update() {
static update = function() {
var len = 0;
for(var i = 0; i < ds_list_size(inputs); i++) {
var _in = inputs[| i].getValue();

View file

@ -209,8 +209,11 @@ function NodeObject(_name, _spr, _create, tags = []) constructor {
var _node = NODE_CREATE_FUCTION[? _type](_x, _y);
if(_node)
_node.deserialize(_data, scale);
if(_node) {
_node.load_map = ds_map_create();
ds_map_copy(_node.load_map, _data);
_node.deserialize(scale);
}
return _node;
}

View file

@ -16,7 +16,7 @@ function Node_Scale(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var scale = _data[1];
var keep = _data[2];

View file

@ -19,7 +19,7 @@ function Node_Scale_Algo(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var inSurf = _data[0];
var algo = _data[1];
var ww = surface_get_width(inSurf);

View file

@ -59,7 +59,7 @@ function Node_Scatter(_x, _y) : Node(_x, _y) constructor {
inputs[| 5].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function update() {
static update = function() {
var _inSurf = inputs[| 0].getValue(), surf;
if(_inSurf == 0)
return;

View file

@ -39,7 +39,7 @@ function Node_Seperate_Shape(_x, _y) : Node(_x, _y) constructor {
_prev_type = -1;
function update() {
static update = function() {
var _inSurf = inputs[| 0].getValue();
var _out_type = inputs[| 1].getValue();
var t = current_time;

View file

@ -13,7 +13,7 @@ function Node_Sequence_Anim(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function update() {
static update = function() {
var seq = inputs[| 0].getValue();
var spd = inputs[| 1].getValue();

View file

@ -41,7 +41,7 @@ function Node_Shadow(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 3].drawOverlay(_active, _x + ww / 2, _y + hh / 2, _s, _mx, _my);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var cl = _data[1];
var _stre = _data[2];
var _shf = _data[3];

View file

@ -73,7 +73,7 @@ function Node_Shape(_x, _y) : Node_Processor(_x, _y) constructor {
inputs[| 3].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var _dim = _data[0];
var _bg = _data[1];
var _shape = _data[2];

View file

@ -14,7 +14,7 @@ function Node_Solid(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _col = inputs[| 1].getValue();

View file

@ -43,7 +43,7 @@ function Node_Render_Sprite_Sheet(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function step() {
static step = function() {
var inpt = inputs[| 0].getValue();
var oupt = outputs[| 0].getValue();
@ -136,7 +136,7 @@ function Node_Render_Sprite_Sheet(_x, _y) : Node(_x, _y) constructor {
if(drawn) anim_drawn[ANIMATOR.current_frame] = true;
}
function update() {
static update = function() {
for(var i = 0; i < array_length(anim_drawn); i++) anim_drawn[i] = false;
var inpt = inputs[| 0].getValue();

View file

@ -37,7 +37,7 @@ function Node_Sprite_Stack(_x, _y) : Node(_x, _y) constructor {
inputs[| 5].drawOverlay(_active, px, py, _s, _mx, _my);
}
function update() {
static update = function() {
var _in = inputs[| 0].getValue();
var _dim = inputs[| 1].getValue();
var _amo = inputs[| 2].getValue();

View file

@ -37,7 +37,7 @@ function Node_Stripe(_x, _y) : Node(_x, _y) constructor {
inputs[| 2].drawOverlay(_active, px, py, _s, _mx, _my);
}
function update() {
static update = function() {
var _dim = inputs[| 0].getValue();
var _amo = inputs[| 1].getValue();
var _ang = inputs[| 2].getValue();

View file

@ -18,7 +18,7 @@ function Node_Surface_data(_x, _y) : Node(_x, _y) constructor {
min_h = 0;
w = 96;
function update() {
static update = function() {
var _insurf = inputs[| 0].getValue();
if(is_array(_insurf)) {
var len = array_length(_insurf);

View file

@ -72,7 +72,7 @@ function Node_Text(_x, _y) : Node_Processor(_x, _y) constructor {
}
}
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
var str = _data[0];
var _font = _data[1];
var _size = _data[2];

View file

@ -14,7 +14,7 @@ function Node_Texture_Remap(_x, _y) : Node_Processor(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function process_data(_outSurf, _data, _output_index) {
static process_data = function(_outSurf, _data, _output_index) {
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD

View file

@ -18,7 +18,7 @@ function Node_Time_Remap(_x, _y) : Node(_x, _y) constructor {
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
function update() {
static update = function() {
if(array_length(cached_output) != ANIMATOR.frames_total + 1)
return;

Some files were not shown because too many files have changed in this diff Show more