Junction caching

This commit is contained in:
Tanasart 2023-07-25 20:12:40 +02:00
parent a0843b6aa7
commit 9e957c5cd6
232 changed files with 1030 additions and 864 deletions

View file

@ -75,7 +75,7 @@
{"name":"audio","order":19,"path":"folders/nodes/data/audio.yy",}, {"name":"audio","order":19,"path":"folders/nodes/data/audio.yy",},
{"name":"compose","order":14,"path":"folders/nodes/data/compose.yy",}, {"name":"compose","order":14,"path":"folders/nodes/data/compose.yy",},
{"name":"armature","order":5,"path":"folders/nodes/data/compose/armature.yy",}, {"name":"armature","order":5,"path":"folders/nodes/data/compose/armature.yy",},
{"name":"feedback","order":13,"path":"folders/nodes/data/feedback.yy",}, {"name":"feedback","order":7,"path":"folders/nodes/data/iterate/feedback.yy",},
{"name":"filter","order":1,"path":"folders/nodes/data/filter.yy",}, {"name":"filter","order":1,"path":"folders/nodes/data/filter.yy",},
{"name":"colors","order":4,"path":"folders/nodes/data/filter/colors.yy",}, {"name":"colors","order":4,"path":"folders/nodes/data/filter/colors.yy",},
{"name":"combine","order":1,"path":"folders/nodes/data/filter/combine.yy",}, {"name":"combine","order":1,"path":"folders/nodes/data/filter/combine.yy",},

View file

@ -98,7 +98,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"audio","folderPath":"folders/nodes/data/audio.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"audio","folderPath":"folders/nodes/data/audio.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"armature","folderPath":"folders/nodes/data/compose/armature.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"armature","folderPath":"folders/nodes/data/compose/armature.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/feedback.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/iterate/feedback.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"filter","folderPath":"folders/nodes/data/filter.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"filter","folderPath":"folders/nodes/data/filter.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/nodes/data/filter/blur.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/nodes/data/filter/blur.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"colors","folderPath":"folders/nodes/data/filter/colors.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"colors","folderPath":"folders/nodes/data/filter/colors.yy",},

Binary file not shown.

View file

@ -258,7 +258,7 @@
"panel_inspector_out_visible": "Outputs visibility", "panel_inspector_out_visible": "Outputs visibility",
"panel_inspector_execute": "Execute node", "panel_inspector_execute": "Execute node",
"panel_inspector_cache_desp": "This node cache output for performance.\nClick to clear all cached frames in this node.", "panel_inspector_cache_desp": "This node cache output for performance.\nClick to clear all cached frames in this node.",
"panel_inspector_set_default": "Set as default", "panel_inspector_set_default": "Set Metadata as default",
"panel_inspector_workshop_save": "Save file before upload", "panel_inspector_workshop_save": "Save file before upload",
"panel_inspector_workshop_upload": "Upload to Steam Workshop", "panel_inspector_workshop_upload": "Upload to Steam Workshop",
"panel_inspector_workshop_update": "Update Steam Workshop", "panel_inspector_workshop_update": "Update Steam Workshop",

View file

@ -27,7 +27,7 @@ event_inherited();
if(_openDialog) { if(_openDialog) {
var arr = variable_struct_get_names(panels); var arr = variable_struct_get_names(panels);
for( var i = 0; i < array_length(arr); i++ ) { for( var i = 0, n = array_length(arr); i < n; i++ ) {
var _key = arr[i]; var _key = arr[i];
var pane = panels[$ _key]; var pane = panels[$ _key];
@ -41,7 +41,7 @@ event_inherited();
context_menus = meta.context_menu_callbacks; context_menus = meta.context_menu_callbacks;
var arr = variable_struct_get_names(context_menus); var arr = variable_struct_get_names(context_menus);
for( var i = 0; i < array_length(arr); i++ ) { for( var i = 0, n = array_length(arr); i < n; i++ ) {
var _call = ds_map_try_get(CONTEXT_MENU_CALLBACK, arr[i], []); var _call = ds_map_try_get(CONTEXT_MENU_CALLBACK, arr[i], []);
var _fnk = context_menus[$ arr[i]]; var _fnk = context_menus[$ arr[i]];
var _generator = new addonContextGenerator(self, _fnk); var _generator = new addonContextGenerator(self, _fnk);

View file

@ -6,7 +6,7 @@ array_remove(ANIMATION_PRE, animationPreStep);
array_remove(ANIMATION_POST, animationPostStep); array_remove(ANIMATION_POST, animationPostStep);
var arr = variable_struct_get_names(context_menus); var arr = variable_struct_get_names(context_menus);
for( var i = 0; i < array_length(arr); i++ ) { for( var i = 0, n = array_length(arr); i < n; i++ ) {
var _call = ds_map_try_get(CONTEXT_MENU_CALLBACK, arr[i], []); var _call = ds_map_try_get(CONTEXT_MENU_CALLBACK, arr[i], []);
for( var j = array_length(_call) - 1; j >= 0; j-- ) { for( var j = array_length(_call) - 1; j >= 0; j-- ) {

View file

@ -162,7 +162,7 @@
function checkMouse() { function checkMouse() {
if(!DIALOG_CLICK) return; if(!DIALOG_CLICK) return;
for( var i = 0; i < array_length(children); i++ ) for( var i = 0, n = array_length(children); i < n; i++ )
if(instance_exists(children[i])) return; if(instance_exists(children[i])) return;
var x0 = dialog_x - dialog_resizable * 6; var x0 = dialog_x - dialog_resizable * 6;

View file

@ -2,7 +2,7 @@
#region draw #region draw
var key = ""; var key = "";
for( var i = 0; i < array_length(extra_keys); i++ ) { for( var i = 0, n = array_length(extra_keys); i < n; i++ ) {
if(keyboard_check(extra_keys[i][0])) if(keyboard_check(extra_keys[i][0]))
key += key == ""? extra_keys[i][1] : (" + " + extra_keys[i][1]); key += key == ""? extra_keys[i][1] : (" + " + extra_keys[i][1]);
} }
@ -39,7 +39,7 @@
var mlx = WIN_W - array_length(mouse_left); var mlx = WIN_W - array_length(mouse_left);
var ox, oy, nx, ny; var ox, oy, nx, ny;
for( var i = 0; i < array_length(mouse_left); i++ ) { for( var i = 0, n = array_length(mouse_left); i < n; i++ ) {
nx = mlx + i; nx = mlx + i;
ny = WIN_H - 4 - mouse_left[i] * 24; ny = WIN_H - 4 - mouse_left[i] * 24;

View file

@ -36,7 +36,7 @@ event_inherited();
draw_set_color(COLORS._main_text_sub); draw_set_color(COLORS._main_text_sub);
draw_text(cx, yy, "Special Thanks"); draw_text(cx, yy, "Special Thanks");
for( var i = 0; i < array_length(credits); i++ ) { for( var i = 0, n = array_length(credits); i < n; i++ ) {
yy += line_get_height(, 8); yy += line_get_height(, 8);
draw_set_font(f_p2); draw_set_font(f_p2);
draw_set_color(COLORS._main_text_sub); draw_set_color(COLORS._main_text_sub);

View file

@ -32,7 +32,7 @@ if !ready exit;
var path_arr = path_search(paths, dir_recursive, dir_filter); var path_arr = path_search(paths, dir_recursive, dir_filter);
switch(i) { switch(i) {
case 0 : case 0 :
for( var i = 0; i < array_length(path_arr); i++ ) { for( var i = 0, n = array_length(path_arr); i < n; i++ ) {
var path = path_arr[i]; var path = path_arr[i];
Node_create_Image_path(nx, ny, path); Node_create_Image_path(nx, ny, path);
ny += 160; ny += 160;

View file

@ -75,7 +75,7 @@ event_inherited();
var ar = call_in? io.outputs : io.inputs; var ar = call_in? io.outputs : io.inputs;
var typ = node_called.type; var typ = node_called.type;
for( var i = 0; i < array_length(ar); i++ ) { for( var i = 0, n = array_length(ar); i < n; i++ ) {
if(!ar[i].visible) continue; if(!ar[i].visible) continue;
var _in = call_in? node_called.type : ar[i].type; var _in = call_in? node_called.type : ar[i].type;
@ -89,7 +89,7 @@ event_inherited();
var to = junction_hovering.type; var to = junction_hovering.type;
var fr = junction_hovering.value_from.type; var fr = junction_hovering.value_from.type;
for( var i = 0; i < array_length(io.inputs); i++ ) { for( var i = 0, n = array_length(io.inputs); i < n; i++ ) {
var _in = fr; var _in = fr;
var _ot = io.inputs[i].type; var _ot = io.inputs[i].type;
if(!io.inputs[i].visible) continue; if(!io.inputs[i].visible) continue;
@ -97,7 +97,7 @@ event_inherited();
if(typeCompatible(_in, _ot, false)) return true; if(typeCompatible(_in, _ot, false)) return true;
} }
for( var i = 0; i < array_length(io.outputs); i++ ) { for( var i = 0, n = array_length(io.outputs); i < n; i++ ) {
var _in = io.outputs[i].type; var _in = io.outputs[i].type;
var _ot = to; var _ot = to;
@ -303,13 +303,13 @@ event_inherited();
var sug = ds_map_try_get(global.VALUE_SUGGESTION, node_called.type, []); var sug = ds_map_try_get(global.VALUE_SUGGESTION, node_called.type, []);
if(array_length(sug)) { if(array_length(sug)) {
ds_list_add(_list, "Related"); ds_list_add(_list, "Related");
for( var i = 0; i < array_length(sug); i++ ) for( var i = 0, n = array_length(sug); i < n; i++ )
ds_list_add(_list, ALL_NODES[? sug[i]]); ds_list_add(_list, ALL_NODES[? sug[i]]);
} }
} }
ds_list_add(_list, "Favourites"); ds_list_add(_list, "Favourites");
for( var i = 0; i < array_length(global.FAV_NODES); i++ ) { for( var i = 0, n = array_length(global.FAV_NODES); i < n; i++ ) {
var _nodeIndex = global.FAV_NODES[i]; var _nodeIndex = global.FAV_NODES[i];
if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue; if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue;
@ -317,7 +317,7 @@ event_inherited();
} }
ds_list_add(_list, "Recents"); ds_list_add(_list, "Recents");
for( var i = 0; i < array_length(global.RECENT_NODES); i++ ) { for( var i = 0, n = array_length(global.RECENT_NODES); i < n; i++ ) {
var _nodeIndex = global.RECENT_NODES[i]; var _nodeIndex = global.RECENT_NODES[i];
if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue; if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue;

View file

@ -18,12 +18,12 @@ event_inherited();
var fac = scale_to / PROJECT.animator.frames_total; var fac = scale_to / PROJECT.animator.frames_total;
var key = ds_map_find_first(PROJECT.nodeMap); var key = ds_map_find_first(PROJECT.nodeMap);
repeat(ds_map_size(PROJECT.nodeMap)) { repeat(ds_map_size(PROJECT.nodeMap)) {
var n = PROJECT.nodeMap[? key]; var _node = PROJECT.nodeMap[? key];
key = ds_map_find_next(PROJECT.nodeMap, key); key = ds_map_find_next(PROJECT.nodeMap, key);
if(!n || !n.active) continue; if(!_node || !_node.active) continue;
for(var i = 0; i < ds_list_size(n.inputs); i++) { for(var i = 0; i < ds_list_size(_node.inputs); i++) {
var in = n.inputs[| i]; var in = _node.inputs[| i];
if(!in.is_anim) continue; if(!in.is_anim) continue;
for(var j = 0; j < ds_list_size(in.animator.values); j++) { for(var j = 0; j < ds_list_size(in.animator.values); j++) {
var t = in.animator.values[| j]; var t = in.animator.values[| j];

View file

@ -16,7 +16,7 @@
draw_sprite_stretched(THEME.dialog_bg, 0, x0, y0, ww, hh); draw_sprite_stretched(THEME.dialog_bg, 0, x0, y0, ww, hh);
for( var i = 0; i < array_length(pal); i++ ) { for( var i = 0, n = array_length(pal); i < n; i++ ) {
var r = floor(i / col); var r = floor(i / col);
var c = i % col; var c = i % col;

View file

@ -85,8 +85,15 @@ event_inherited();
if(isHover) if(isHover)
draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), _height, COLORS._main_accent, 1); draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), _height, COLORS._main_accent, 1);
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); var x0 = ui(16) + (i == 0) * ui(8 + 6);
draw_text(ui(16), yy + ui(8), preset_name[| i]); var cc = i == preset_selecting? COLORS._main_accent : COLORS._main_text_sub;
draw_set_text(f_p2, fa_left, fa_top, cc);
draw_text(x0, yy + ui(8), preset_name[| i]);
if(i == 0) {
draw_set_color(cc);
draw_circle_prec(ui(16) + ui(4), yy + ui(16), ui(4), false);
}
if(preset_selecting == i) if(preset_selecting == i)
drawPaletteGrid(presets[| i], ui(16), yy + ui(28), ww, _gs, selector.current_color); drawPaletteGrid(presets[| i], ui(16), yy + ui(28), ww, _gs, selector.current_color);
else else

View file

@ -198,8 +198,15 @@ event_inherited();
if(isHover) if(isHover)
draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_palette_w - ui(16), _height, COLORS._main_accent, 1); draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_palette_w - ui(16), _height, COLORS._main_accent, 1);
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); var x0 = ui(16) + (i == 0) * ui(8 + 6);
draw_text(ui(16), yy + ui(8), filename_name_only(palette_name[| i])); var cc = i == palette_selecting? COLORS._main_accent : COLORS._main_text_sub;
draw_set_text(f_p2, fa_left, fa_top, cc);
draw_text(x0, yy + ui(8), filename_name_only(palette_name[| i]));
if(i == 0) {
draw_set_color(cc);
draw_circle_prec(ui(16) + ui(4), yy + ui(16), ui(4), false);
}
if(palette_selecting == i) if(palette_selecting == i)
drawPaletteGrid(palettes[| i], ui(16), yy + ui(28), ww, _gs); drawPaletteGrid(palettes[| i], ui(16), yy + ui(28), ww, _gs);
else else

View file

@ -33,7 +33,7 @@ event_inherited();
var inpt = 0; var inpt = 0;
var hovr = -1; var hovr = -1;
for( var i = 0; i < array_length(node.input_display_list); i++ ) { for( var i = 0, n = array_length(node.input_display_list); i < n; i++ ) {
var disp = node.input_display_list[i]; var disp = node.input_display_list[i];
if(is_array(disp)) { if(is_array(disp)) {
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _y, hg, _y + hg)) { if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _y, hg, _y + hg)) {

View file

@ -35,7 +35,7 @@ if !target exit;
var paths = paths_to_array(path); var paths = paths_to_array(path);
var arr = target.inputs[| 0].getValue(); var arr = target.inputs[| 0].getValue();
for( var i = 0; i < array_length(paths); i++ ) for( var i = 0, n = array_length(paths); i < n; i++ )
array_push(arr, paths[i]); array_push(arr, paths[i]);
target.inputs[| 0].setValue(arr); target.inputs[| 0].setValue(arr);

View file

@ -57,7 +57,7 @@ event_inherited();
var _h = 0; var _h = 0;
var ind = 0; var ind = 0;
for( var i = 0; i < array_length(ref); i++ ) { for( var i = 0, n = array_length(ref); i < n; i++ ) {
var _f = ref[i]; var _f = ref[i];
if(is_string(_f)) { if(is_string(_f)) {
if(i) { if(i) {

View file

@ -39,12 +39,12 @@ draw_set_alpha(1);
if(b == 2) { if(b == 2) {
var oldDir = environment_get_variable("userprofile") + "/AppData/Local/Pixels_Composer/"; var oldDir = environment_get_variable("userprofile") + "/AppData/Local/Pixels_Composer/";
var folders = [ "Assets", "Collections", "Fonts", "Gradients", "Palettes", "Presets", "Themes"]; var folders = [ "Assets", "Collections", "Fonts", "Gradients", "Palettes", "Presets", "Themes"];
for( var i = 0; i < array_length(folders); i++ ) { for( var i = 0, n = array_length(folders); i < n; i++ ) {
var o = oldDir + folders[i] + "/"; var _o = oldDir + folders[i] + "/";
var n = DIRECTORY + folders[i] + "/"; var _n = DIRECTORY + folders[i] + "/";
if(directory_exists(o)) { if(directory_exists(_o)) {
var shell = "/E /I " + o + " " + n; var shell = "/E /I " + _o + " " + _n;
execute_shell("Xcopy", shell); execute_shell("Xcopy", shell);
} }
} }

View file

@ -332,7 +332,7 @@ event_inherited();
var cx = x1 - cw - ui(8); var cx = x1 - cw - ui(8);
var category = ""; var category = "";
for( var i = 0; i < array_length(COLOR_KEYS); i++ ) { for( var i = 0, n = array_length(COLOR_KEYS); i < n; i++ ) {
var key = COLOR_KEYS[i]; var key = COLOR_KEYS[i];
var val = variable_struct_get(COLORS, key); var val = variable_struct_get(COLORS, key);

View file

@ -32,7 +32,7 @@ if(node_target == noone) {
var ind = 0; var ind = 0;
var col = round(sqrt(array_length(surf))); var col = round(sqrt(array_length(surf)));
for( var i = 0; i < array_length(surf); i++ ) { for( var i = 0, n = array_length(surf); i < n; i++ ) {
var s = surf[i]; var s = surf[i];
var sw = surface_get_width(s); var sw = surface_get_width(s);
var sh = surface_get_height(s); var sh = surface_get_height(s);

View file

@ -42,7 +42,7 @@ event_inherited();
} }
data = []; data = [];
for( var i = 0; i < array_length(scrollbox.data); i++ ) { for( var i = 0, n = array_length(scrollbox.data); i < n; i++ ) {
var val = scrollbox.data[i]; var val = scrollbox.data[i];
if(val == -1) continue; if(val == -1) continue;
@ -57,7 +57,7 @@ event_inherited();
var hght = line_get_height(f_p0, 8); var hght = line_get_height(f_p0, 8);
var hh = ui(16 + 24); var hh = ui(16 + 24);
for( var i = 0; i < array_length(data); i++ ) for( var i = 0, n = array_length(data); i < n; i++ )
hh += data[i] == -1? ui(8) : hght; hh += data[i] == -1? ui(8) : hght;
dialog_h = min(max_h, hh); dialog_h = min(max_h, hh);

View file

@ -401,7 +401,7 @@ event_inherited();
var grid_ys = [ _yy, _yy ]; var grid_ys = [ _yy, _yy ];
for( var i = 0; i < array_length(submissions) - 1; i++ ) { for( var i = 0, n = array_length(submissions) - 1; i < n; i++ ) {
var _sub = submissions[i]; var _sub = submissions[i];
var _att = _sub.attachments; var _att = _sub.attachments;

View file

@ -85,7 +85,7 @@ if !ready exit;
var tab_cover = noone; var tab_cover = noone;
var th = ui(36) + THEME_VALUE.panel_tab_extend; var th = ui(36) + THEME_VALUE.panel_tab_extend;
for( var i = 0; i < array_length(pages); i++ ) { for( var i = 0, n = array_length(pages); i < n; i++ ) {
draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub); draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub);
var txt = pages[i]; var txt = pages[i];
var dtxt = __txt(txt); var dtxt = __txt(txt);

View file

@ -8,7 +8,7 @@ if(async_load[? "id"] == contest_req) { //get contests
if(struct_has(thr_str, "threads")) { if(struct_has(thr_str, "threads")) {
var thrs = thr_str.threads; var thrs = thr_str.threads;
for( var i = 0; i < array_length(thrs); i++ ) { for( var i = 0, n = array_length(thrs); i < n; i++ ) {
var thr = thrs[i]; var thr = thrs[i];
if(thr.parent_id != "1113080578351312906") continue; //not in contest channel if(thr.parent_id != "1113080578351312906") continue; //not in contest channel
@ -29,7 +29,7 @@ if(async_load[? "id"] == contest_req) { //get contests
return; return;
} }
for( var i = 0; i < array_length(contest_message_req); i++ ) { for( var i = 0, n = array_length(contest_message_req); i < n; i++ ) {
if(async_load[? "id"] != contest_message_req[i][0]) continue; if(async_load[? "id"] != contest_message_req[i][0]) continue;
var r_str = async_load[? "result"]; var r_str = async_load[? "result"];
@ -83,7 +83,7 @@ for( var i = 0; i < array_length(contest_message_req); i++ ) {
} }
var keys = ds_map_keys_to_array(nicknames); var keys = ds_map_keys_to_array(nicknames);
for( var i = 0; i < array_length(keys); i++ ) { for( var i = 0, n = array_length(keys); i < n; i++ ) {
var nick = nicknames[? keys[i]]; var nick = nicknames[? keys[i]];
if(!is_array(nick)) continue; if(!is_array(nick)) continue;
@ -99,7 +99,7 @@ for( var i = 0; i < array_length(keys); i++ ) {
} }
var keys = ds_map_keys_to_array(attachment); var keys = ds_map_keys_to_array(attachment);
for( var i = 0; i < array_length(keys); i++ ) { for( var i = 0, n = array_length(keys); i < n; i++ ) {
var att = attachment[? keys[i]]; var att = attachment[? keys[i]];
if(!is_array(att)) continue; if(!is_array(att)) continue;

View file

@ -75,7 +75,7 @@
slp[array_length(slp) - 1] = rep; slp[array_length(slp) - 1] = rep;
var txt = ""; var txt = "";
for( var i = 0; i < array_length(textbox._input_text_line); i++ ) { for( var i = 0, n = array_length(textbox._input_text_line); i < n; i++ ) {
if(i == textbox.cursor_line) { if(i == textbox.cursor_line) {
for( var j = 0; j < array_length(slp); j++ ) for( var j = 0; j < array_length(slp); j++ )
txt += slp[j]; txt += slp[j];

View file

@ -9,7 +9,7 @@ if(textbox == noone) exit;
var _w = 300; var _w = 300;
var _h = array_length(data) * line_get_height(f_p0, 8); var _h = array_length(data) * line_get_height(f_p0, 8);
for( var i = 0; i < array_length(data); i++ ) { for( var i = 0, n = array_length(data); i < n; i++ ) {
var _dat = data[i]; var _dat = data[i];
var __w = ui(40 + 32); var __w = ui(40 + 32);

View file

@ -42,7 +42,7 @@ event_inherited();
function searchNodes() { function searchNodes() {
search_res = []; search_res = [];
for( var i = 0; i < array_length(tunnel_ins); i++ ) { for( var i = 0, n = array_length(tunnel_ins); i < n; i++ ) {
var node = tunnel_ins[i]; var node = tunnel_ins[i];
var key = node.inputs[| 0].getValue(0); var key = node.inputs[| 0].getValue(0);
@ -63,7 +63,7 @@ event_inherited();
var arr = search_string == ""? tunnel_ins : search_res; var arr = search_string == ""? tunnel_ins : search_res;
tunnel_hover = noone; tunnel_hover = noone;
for( var i = 0; i < array_length(arr); i++ ) { for( var i = 0, n = array_length(arr); i < n; i++ ) {
var node = arr[i]; var node = arr[i];
if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) { if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) {
@ -89,8 +89,8 @@ event_inherited();
txt = __txtx("panel_tunnel_create_tunnel", "Create tunnel"); txt = __txtx("panel_tunnel_create_tunnel", "Create tunnel");
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, txt, THEME.tunnel) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, txt, THEME.tunnel) == 2) {
var n = nodeBuild("Node_Tunnel_Out", build_x, build_y); var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y);
n.inputs[| 0].setValue(key); _node.inputs[| 0].setValue(key);
instance_destroy(); instance_destroy();
} }

View file

@ -110,12 +110,12 @@
ANIMATION_POST = []; ANIMATION_POST = [];
function __addon_preAnim() { function __addon_preAnim() {
for( var i = 0; i < array_length(ANIMATION_PRE); i++ ) for( var i = 0, n = array_length(ANIMATION_PRE); i < n; i++ )
ANIMATION_PRE[i](); ANIMATION_PRE[i]();
} }
function __addon_postAnim() { function __addon_postAnim() {
for( var i = 0; i < array_length(ANIMATION_POST); i++ ) for( var i = 0, n = array_length(ANIMATION_POST); i < n; i++ )
ANIMATION_POST[i](); ANIMATION_POST[i]();
} }
#endregion #endregion
@ -146,7 +146,7 @@
if(array_length(path) == 1 && directory_exists(path[0])) if(array_length(path) == 1 && directory_exists(path[0]))
type = "image"; type = "image";
for( var i = 0; i < array_length(path); i++ ) { for( var i = 0, n = array_length(path); i < n; i++ ) {
var p = path[i]; var p = path[i];
var ext = string_lower(filename_ext(p)); var ext = string_lower(filename_ext(p));
@ -168,7 +168,7 @@
PANEL_GRAPH.onStepBegin(); PANEL_GRAPH.onStepBegin();
var node = noone; var node = noone;
for( var i = 0; i < array_length(path); i++ ) { for( var i = 0, n = array_length(path); i < n; i++ ) {
var p = path[i]; var p = path[i];
var ext = string_lower(filename_ext(p)); var ext = string_lower(filename_ext(p));

View file

@ -3,7 +3,7 @@ var port = async_load[? "port"];
if(!ds_map_exists(PORT_MAP, port)) exit; if(!ds_map_exists(PORT_MAP, port)) exit;
var nodeTarget = PORT_MAP[? port]; var nodeTarget = PORT_MAP[? port];
for( var i = 0; i < array_length(nodeTarget); i++ ) { for( var i = 0, n = array_length(nodeTarget); i < n; i++ ) {
if(is_struct(nodeTarget[i]) && nodeTarget[i].active) if(is_struct(nodeTarget[i]) && nodeTarget[i].active)
nodeTarget[i].asyncPackets(async_load); nodeTarget[i].asyncPackets(async_load);
} }

View file

@ -3,20 +3,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
//print("===== Step start ====="); //print("===== Step start =====");
if(PROJECT.active) { if(PROJECT.active) {
#region animation PROJECT.animator.step();
if(PROJECT.animator.is_playing && PROJECT.animator.play_freeze == 0) {
PROJECT.animator.time_since_last_frame += PROJECT.animator.framerate * (delta_time / 1000000);
if(PROJECT.animator.time_since_last_frame >= 1)
PROJECT.animator.setFrame(PROJECT.animator.real_frame + 1);
} else {
PROJECT.animator.frame_progress = false;
PROJECT.animator.setFrame(PROJECT.animator.real_frame);
PROJECT.animator.time_since_last_frame = 0;
}
PROJECT.animator.play_freeze = max(0, PROJECT.animator.play_freeze - 1);
#endregion
#region step #region step
PROJECT.globalNode.step(); PROJECT.globalNode.step();

View file

@ -1,5 +1,4 @@
/// @description init /// @description init
//print(PROJECT.path);
global.cache_call = 0; global.cache_call = 0;
global.cache_hit = 0; global.cache_hit = 0;
@ -199,4 +198,4 @@ _HOVERING_ELEMENT = noone;
MOUSE_WRAP = false; MOUSE_WRAP = false;
#endregion #endregion
//if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call}%)"); //if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call * 100}%)");

View file

@ -284,7 +284,7 @@ function __initLua() {
globalvar LUA_API; globalvar LUA_API;
LUA_API = ds_map_create(); LUA_API = ds_map_create();
for( var i = 0; i < array_length(global.lua_functions); i++ ) { for( var i = 0, n = array_length(global.lua_functions); i < n; i++ ) {
if(is_string(global.lua_functions[i])) continue; if(is_string(global.lua_functions[i])) continue;
if(global.lua_functions[i][1] == noone) continue; if(global.lua_functions[i][1] == noone) continue;
LUA_API[? global.lua_functions[i][0]] = global.lua_functions[i][1]; LUA_API[? global.lua_functions[i][0]] = global.lua_functions[i][1];

View file

@ -4,7 +4,7 @@ function VCT(node) constructor {
vars = []; vars = [];
static reset = function() { static reset = function() {
for( var i = 0; i < array_length(vars); i++ ) for( var i = 0, n = array_length(vars); i < n; i++ )
vars[i].set(vars[i].def_val); vars[i].set(vars[i].def_val);
} }
@ -19,7 +19,7 @@ function VCT(node) constructor {
var s = {}; var s = {};
s.variables = []; s.variables = [];
for( var i = 0; i < array_length(vars); i++ ) for( var i = 0, n = array_length(vars); i < n; i++ )
s.variables[i] = vars[i].get(); s.variables[i] = vars[i].get();
doSerialize(s); doSerialize(s);

View file

@ -4,7 +4,7 @@ enum CAMERA_PROJ {
} }
#region setup #region setup
globalvar PRIMITIVES, FORMAT_P, FORMAT_PT, FORMAT_PNT; globalvar PRIMITIVES, FORMAT_P, FORMAT_PT, FORMAT_PNT, FORMAT_2PC;
PRIMITIVES = ds_map_create(); PRIMITIVES = ds_map_create();
vertex_format_begin(); vertex_format_begin();
@ -21,6 +21,11 @@ enum CAMERA_PROJ {
vertex_format_add_normal(); vertex_format_add_normal();
vertex_format_add_texcoord(); vertex_format_add_texcoord();
FORMAT_PNT = vertex_format_end(); FORMAT_PNT = vertex_format_end();
vertex_format_begin();
vertex_format_add_position();
vertex_format_add_color();
FORMAT_2PC = vertex_format_end();
#endregion #endregion
#region 3d obj #region 3d obj
@ -110,7 +115,7 @@ enum CAMERA_PROJ {
var VB = vertex_create_buffer(); var VB = vertex_create_buffer();
vertex_begin(VB, FORMAT_PNT); vertex_begin(VB, FORMAT_PNT);
for( var i = 0; i < array_length(faces); i++ ) { for( var i = 0, n = array_length(faces); i < n; i++ ) {
var face = faces[i]; var face = faces[i];
var _pos = positions[face[0]]; var _pos = positions[face[0]];
var _nor = normals [face[1]]; var _nor = normals [face[1]];

View file

@ -60,6 +60,10 @@ function __part(_node) constructor {
anim_speed = 1; anim_speed = 1;
anim_end = ANIM_END_ACTION.loop; anim_end = ANIM_END_ACTION.loop;
ground = false;
ground_y = 0;
ground_bounce = 0;
static create = function(_surf, _x, _y, _life) { static create = function(_surf, _x, _y, _life) {
active = true; active = true;
surf = _surf; surf = _surf;
@ -68,6 +72,9 @@ function __part(_node) constructor {
gx = 0; gx = 0;
gy = 0; gy = 0;
prevx = undefined;
prevy = undefined;
life = _life; life = _life;
life_total = life; life_total = life;
node.onPartCreate(self); node.onPartCreate(self);
@ -86,6 +93,15 @@ function __part(_node) constructor {
turnSpd = _turnSpd; turnSpd = _turnSpd;
wig = _wig; wig = _wig;
spVec[0] = point_distance(0, 0, speedx, speedy);
spVec[1] = point_direction(0, 0, speedx, speedy);
}
static setGround = function(_ground, _ground_offset, _ground_bounce) {
ground = _ground;
ground_y = y + _ground_offset;
ground_bounce = _ground_bounce;
} }
static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) { static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) {
@ -114,7 +130,12 @@ function __part(_node) constructor {
static step = function() { static step = function() {
if(!active) return; if(!active) return;
x += speedx; x += speedx;
y += speedy;
if(ground && y + speedy > ground_y) {
y = ground_y;
speedy = -speedy * ground_bounce;
} else
y += speedy;
var dirr = point_direction(0, 0, speedx, speedy); var dirr = point_direction(0, 0, speedx, speedy);
var diss = point_distance(0, 0, speedx, speedy); var diss = point_distance(0, 0, speedx, speedy);
@ -130,15 +151,15 @@ function __part(_node) constructor {
} }
} }
speedx = lengthdir_x(diss, dirr); speedx = lengthdir_x(diss, dirr) + _gx;
speedy = lengthdir_y(diss, dirr); speedy = lengthdir_y(diss, dirr) + _gy;
if(_gx != 0 || _gy != 0) { //if(_gx != 0 || _gy != 0) {
gx += _gx; // gx += _gx;
gy += _gy; // gy += _gy;
x += gx; // x += gx;
y += gy; // y += gy;
} //}
if(follow) rot = spVec[1]; if(follow) rot = spVec[1];
else rot += rot_s; else rot += rot_s;
@ -147,8 +168,10 @@ function __part(_node) constructor {
node.onPartStep(self); node.onPartStep(self);
if(life-- < 0) kill(); if(life-- < 0) kill();
spVec[0] = point_distance(prevx, prevy, x, y); if(prevx != undefined) {
spVec[1] = point_direction(prevx, prevy, x, y); spVec[0] = point_distance(prevx, prevy, x, y);
spVec[1] = point_direction(prevx, prevy, x, y);
}
prevx = x; prevx = x;
prevy = y; prevy = y;

View file

@ -47,7 +47,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
static childCount = function() { static childCount = function() {
var amo = array_length(childs); var amo = array_length(childs);
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
amo += childs[i].childCount(); amo += childs[i].childCount();
return amo; return amo;
} }
@ -60,7 +60,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
direction: direction direction: direction
} }
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
childs[i].freeze(); childs[i].freeze();
} }
@ -68,7 +68,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
if(ID == _id) if(ID == _id)
return self; return self;
for( var i = 0; i < array_length(childs); i++ ) { for( var i = 0, n = array_length(childs); i < n; i++ ) {
var b = childs[i].findBone(_id); var b = childs[i].findBone(_id);
if(b != noone) if(b != noone)
return b; return b;
@ -82,7 +82,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
if(string_trim(name) == string_trim(_name)) if(string_trim(name) == string_trim(_name))
return self; return self;
for( var i = 0; i < array_length(childs); i++ ) { for( var i = 0, n = array_length(childs); i < n; i++ ) {
var b = childs[i].findBoneByName(_name); var b = childs[i].findBoneByName(_name);
if(b != noone) if(b != noone)
return b; return b;
@ -209,13 +209,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
} }
} }
//draw_set_color(c_red); for( var i = 0, n = array_length(childs); i < n; i++ ) {
//for( var i = 0; i < array_length(FABRIK_result); i++ ) {
// var pt = FABRIK_result[i];
// draw_circle(_x + pt.x * _s, _y + pt.y * _s, 16, false);
//}
for( var i = 0; i < array_length(childs); i++ ) {
var h = childs[i]._drawBone(attributes, edit, _x, _y, _s, _mx, _my, hovering, selecting); var h = childs[i]._drawBone(attributes, edit, _x, _y, _s, _mx, _my, hovering, selecting);
if(hover == noone && h != noone) if(hover == noone && h != noone)
hover = h; hover = h;
@ -238,7 +232,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
} }
} }
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
childs[i].drawControl(attributes); childs[i].drawControl(attributes);
} }
@ -247,7 +241,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
pose_scale = 1; pose_scale = 1;
pose_posit = [ 0, 0 ]; pose_posit = [ 0, 0 ];
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
childs[i].resetPose(); childs[i].resetPose();
} }
@ -258,7 +252,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
static setPoseTransform = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { static setPoseTransform = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) {
if(is_main) { if(is_main) {
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
childs[i].setPoseTransform(_position, _angle, _scale); childs[i].setPoseTransform(_position, _angle, _scale);
return; return;
} }
@ -281,7 +275,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
angle += pose_angle; angle += pose_angle;
length *= pose_scale; length *= pose_scale;
for( var i = 0; i < array_length(childs); i++ ) { for( var i = 0, n = array_length(childs); i < n; i++ ) {
if(childs[i].parent_anchor) if(childs[i].parent_anchor)
childs[i].setPoseTransform(_position, pose_angle, pose_scale); childs[i].setPoseTransform(_position, pose_angle, pose_scale);
else else
@ -326,7 +320,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
FABRIK(bones, points, lengths, p.x, p.y); FABRIK(bones, points, lengths, p.x, p.y);
} }
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
childs[i].setIKconstrain(); childs[i].setIKconstrain();
} }
@ -334,7 +328,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
static FABRIK = function(bones, points, lengths, dx, dy) { static FABRIK = function(bones, points, lengths, dx, dy) {
var threshold = 0.1; var threshold = 0.1;
var _bo = array_create(array_length(points)); var _bo = array_create(array_length(points));
for( var i = 0; i < array_length(points); i++ ) for( var i = 0, n = array_length(points); i < n; i++ )
_bo[i] = { x: points[i].x, y: points[i].y }; _bo[i] = { x: points[i].x, y: points[i].y };
var sx = points[0].x; var sx = points[0].x;
var sy = points[0].y; var sy = points[0].y;
@ -346,7 +340,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
var delta = 0; var delta = 0;
var _bn = array_create(array_length(points)); var _bn = array_create(array_length(points));
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
_bn[i] = { x: points[i].x, y: points[i].y }; _bn[i] = { x: points[i].x, y: points[i].y };
delta += point_distance(_bo[i].x, _bo[i].y, _bn[i].x, _bn[i].y); delta += point_distance(_bo[i].x, _bo[i].y, _bn[i].x, _bn[i].y);
} }
@ -355,7 +349,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
if(++itr >= 32) break; if(++itr >= 32) break;
} until(delta <= threshold); } until(delta <= threshold);
for( var i = 0; i < array_length(points) - 1; i++ ) { for( var i = 0, n = array_length(points) - 1; i < n; i++ ) {
var bone = bones[i]; var bone = bones[i];
var p0 = points[i]; var p0 = points[i];
var p1 = points[i + 1]; var p1 = points[i + 1];
@ -394,7 +388,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
var tx = sx; var tx = sx;
var ty = sy; var ty = sy;
for( var i = 0; i < array_length(points) - 1; i++ ) { for( var i = 0, n = array_length(points) - 1; i < n; i++ ) {
var p0 = points[i]; var p0 = points[i];
var p1 = points[i + 1]; var p1 = points[i + 1];
var len = lengths[i]; var len = lengths[i];
@ -427,7 +421,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
var _bbox = __getBBOX(); var _bbox = __getBBOX();
//print($"BBOX: {_bbox}") //print($"BBOX: {_bbox}")
for( var i = 0; i < array_length(childs); i++ ) { for( var i = 0, n = array_length(childs); i < n; i++ ) {
var _bbox_ch = childs[i].bbox(); var _bbox_ch = childs[i].bbox();
//print($"BBOX ch: {_bbox_ch}") //print($"BBOX ch: {_bbox_ch}")
@ -457,7 +451,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
bone.IKTarget = IKTarget == noone? "" : IKTarget.ID; bone.IKTarget = IKTarget == noone? "" : IKTarget.ID;
bone.childs = []; bone.childs = [];
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
bone.childs[i] = childs[i].serialize(); bone.childs[i] = childs[i].serialize();
return bone; return bone;
@ -480,7 +474,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
IKTarget = bone.IKTarget; IKTarget = bone.IKTarget;
childs = []; childs = [];
for( var i = 0; i < array_length(bone.childs); i++ ) { for( var i = 0, n = array_length(bone.childs); i < n; i++ ) {
var _b = new __Bone().deserialize(bone.childs[i], node); var _b = new __Bone().deserialize(bone.childs[i], node);
addChild(_b); addChild(_b);
} }
@ -494,7 +488,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
else if(is_string(IKTarget)) else if(is_string(IKTarget))
IKTarget = parent.findBone(IKTarget); IKTarget = parent.findBone(IKTarget);
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
childs[i].connect(); childs[i].connect();
} }
@ -507,7 +501,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
_b.IKlength = IKlength; _b.IKlength = IKlength;
_b.IKTarget = IKTarget == noone? "" : IKTarget.ID; _b.IKTarget = IKTarget == noone? "" : IKTarget.ID;
for( var i = 0; i < array_length(childs); i++ ) for( var i = 0, n = array_length(childs); i < n; i++ )
_b.addChild(childs[i].clone()); _b.addChild(childs[i].clone());
return _b; return _b;

View file

@ -57,6 +57,6 @@ function loadAddon() {
if(!file_exists(_path)) return; if(!file_exists(_path)) return;
ADDONS_ON_START = json_load_struct(_path); ADDONS_ON_START = json_load_struct(_path);
for( var i = 0; i < array_length(ADDONS_ON_START); i++ ) for( var i = 0, n = array_length(ADDONS_ON_START); i < n; i++ )
addonTrigger(ADDONS_ON_START[i], false); addonTrigger(ADDONS_ON_START[i], false);
} }

View file

@ -20,7 +20,7 @@ function Mesh() constructor {
} }
static draw = function(_x, _y, _s) { static draw = function(_x, _y, _s) {
for( var i = 0; i < array_length(triangles); i++ ) { for( var i = 0, n = array_length(triangles); i < n; i++ ) {
var t = triangles[i]; var t = triangles[i];
draw_line(_x + t[0].x * _s, _y + t[0].y * _s, _x + t[1].x * _s, _y + t[1].y * _s); draw_line(_x + t[0].x * _s, _y + t[0].y * _s, _x + t[1].x * _s, _y + t[1].y * _s);
@ -30,7 +30,7 @@ function Mesh() constructor {
} }
static pointIn = function(_x, _y) { static pointIn = function(_x, _y) {
for( var i = 0; i < array_length(triangles); i++ ) { for( var i = 0, n = array_length(triangles); i < n; i++ ) {
var t = triangles[i]; var t = triangles[i];
if(point_in_triangle(_x, _y, t[0].x, t[0].y, t[1].x, t[1].y, t[2].x, t[2].y)) if(point_in_triangle(_x, _y, t[0].x, t[0].y, t[1].x, t[1].y, t[2].x, t[2].y))
@ -46,7 +46,7 @@ function Mesh() constructor {
var segments = []; var segments = [];
var pointsPairs = ds_map_create(); var pointsPairs = ds_map_create();
for( var i = 0; i < array_length(triangles); i++ ) { for( var i = 0, n = array_length(triangles); i < n; i++ ) {
var t = triangles[i]; var t = triangles[i];
for( var j = 0; j < 3; j++ ) { for( var j = 0; j < 3; j++ ) {
@ -72,7 +72,7 @@ function Mesh() constructor {
} }
} }
for( var i = 0; i < array_length(segments); i++ ) { for( var i = 0, n = array_length(segments); i < n; i++ ) {
var s0 = string(segments[i][0]); var s0 = string(segments[i][0]);
var s1 = string(segments[i][1]); var s1 = string(segments[i][1]);
@ -85,7 +85,7 @@ function Mesh() constructor {
var path = [ segments[0][0], segments[0][1] ]; var path = [ segments[0][0], segments[0][1] ];
for( var i = 0; i < array_length(segments); i++ ) { for( var i = 0, n = array_length(segments); i < n; i++ ) {
var end_point = path[array_length(path) - 1]; var end_point = path[array_length(path) - 1];
var next_point = array_pop(pointsPairs[? string(end_point) ]); var next_point = array_pop(pointsPairs[? string(end_point) ]);
@ -100,7 +100,7 @@ function Mesh() constructor {
static clone = function() { static clone = function() {
var msh = new Mesh(); var msh = new Mesh();
for( var i = 0; i < array_length(triangles); i++ ) { for( var i = 0, n = array_length(triangles); i < n; i++ ) {
msh.triangles[i] = [ msh.triangles[i] = [
triangles[i][0].clone(), triangles[i][0].clone(),
triangles[i][1].clone(), triangles[i][1].clone(),

View file

@ -15,9 +15,9 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
var node_list = getNodeList(); var node_list = getNodeList();
for( var i = 0; i < ds_list_size(node_list); i++ ) { for( var i = 0; i < ds_list_size(node_list); i++ ) {
var n = node_list[| i]; var _node = node_list[| i];
if(variable_struct_exists(n, "initLoop")) if(variable_struct_exists(_node, "initLoop"))
n.initLoop(); _node.initLoop();
} }
doInitLoop(); doInitLoop();
@ -79,6 +79,9 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
var maxIter = getIterationCount(); var maxIter = getIterationCount();
iterated++; iterated++;
for( var i = 0; i < ds_list_size(nodes); i++ )
nodes[| i].clearInputCache();
if(iterated == maxIter) { if(iterated == maxIter) {
LOG_LINE_IF(global.FLAG.render, $"------------------< Iteration update: {iterated} / {maxIter} [COMPLETE] >------------------"); LOG_LINE_IF(global.FLAG.render, $"------------------< Iteration update: {iterated} / {maxIter} [COMPLETE] >------------------");
render_time = get_timer() - loop_start_time; render_time = get_timer() - loop_start_time;

View file

@ -26,7 +26,7 @@ function PathSegment() : Path() constructor {
var minx = segments[0].x, maxx = segments[0].x; var minx = segments[0].x, maxx = segments[0].x;
var miny = segments[0].y, maxy = segments[0].y; var miny = segments[0].y, maxy = segments[0].y;
for( var i = 0; i < array_length(segments); i++ ) { for( var i = 0, n = array_length(segments); i < n; i++ ) {
var s = segments[i]; var s = segments[i];
minx = min(minx, s.x); minx = min(minx, s.x);
@ -46,7 +46,7 @@ function PathSegment() : Path() constructor {
lengthTotal = 0; lengthTotal = 0;
var op, np; var op, np;
for( var i = 0; i < array_length(segment); i++ ) { for( var i = 0, n = array_length(segment); i < n; i++ ) {
np = segment[i]; np = segment[i];
if(i) { if(i) {

View file

@ -94,7 +94,7 @@ function polygon_triangulate(points, tolerance = 4) {
if(array_length(reflected) == 0) if(array_length(reflected) == 0)
return polygon_triangulate_convex(points); return polygon_triangulate_convex(points);
for( var i = 0; i < array_length(points); i++ ) for( var i = 0, n = array_length(points); i < n; i++ )
pointInd[i] = i; pointInd[i] = i;
var triangles = []; var triangles = [];

View file

@ -134,7 +134,7 @@
oy = ny; oy = ny;
} }
for( var i = 0; i < array_length(_seg); i++ ) for( var i = 0, n = array_length(_seg); i < n; i++ )
array_push(segment, _seg[array_length(_seg) - i - 1]); array_push(segment, _seg[array_length(_seg) - i - 1]);
shapes[2] = { type: SHAPE_TYPE.triangles, triangles: triangles }; shapes[2] = { type: SHAPE_TYPE.triangles, triangles: triangles };

View file

@ -195,7 +195,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
static store = function() { static store = function() {
var op, np; var op, np;
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
np = points[i]; np = points[i];
if(i) { if(i) {
@ -213,7 +213,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
var aa = 0; var aa = 0;
var ox, oy, nx, ny; var ox, oy, nx, ny;
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
aa += restAngle[i]; aa += restAngle[i];
if(i) { if(i) {
@ -233,7 +233,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
//draw_set_color(c_lime); //draw_set_color(c_lime);
//var ox, oy, nx, ny; //var ox, oy, nx, ny;
//for( var i = 0; i < array_length(points); i++ ) { //for( var i = 0, n = array_length(points); i < n; i++ ) {
// nx = points[i].px; // nx = points[i].px;
// ny = points[i].py; // ny = points[i].py;
@ -248,7 +248,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
draw_set_color(baked? c_aqua : c_blue); draw_set_color(baked? c_aqua : c_blue);
var ox, oy, nx, ny; var ox, oy, nx, ny;
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
nx = points[i].x; nx = points[i].x;
ny = points[i].y; ny = points[i].y;
@ -261,7 +261,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
oy = ny; oy = ny;
} }
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
nx = points[i].x; nx = points[i].x;
ny = points[i].y; ny = points[i].y;
@ -275,7 +275,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
static set = function(sx = points[0].x, sy = points[0].y) { static set = function(sx = points[0].x, sy = points[0].y) {
var ox, oy, aa = 0; var ox, oy, aa = 0;
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
aa += restAngle[i]; aa += restAngle[i];
if(i) { if(i) {
@ -290,7 +290,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
oy = points[i].y; oy = points[i].y;
} }
for( var i = 0; i < array_length(points); i++ ) { for( var i = 0, n = array_length(points); i < n; i++ ) {
points[i].px = points[i].x; points[i].px = points[i].x;
points[i].py = points[i].y; points[i].py = points[i].y;
} }
@ -359,7 +359,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
set(); set();
var s = new Strand(points[0].x, points[0].y, array_length(points), length[0], direct, curl_freq, curl_size); var s = new Strand(points[0].x, points[0].y, array_length(points), length[0], direct, curl_freq, curl_size);
for( var i = 0; i < array_length(points); i++ ) for( var i = 0, n = array_length(points); i < n; i++ )
s.points[i] = points[i].clone(); s.points[i] = points[i].clone();
s.restAngle = array_clone(restAngle); s.restAngle = array_clone(restAngle);
s.length = array_clone(length); s.length = array_clone(length);
@ -389,22 +389,22 @@ function StrandMesh() constructor {
mesh = noone; mesh = noone;
static step = function(iteration = 4) { static step = function(iteration = 4) {
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
hairs[i].step(iteration); hairs[i].step(iteration);
} }
static draw = function(_x, _y, _s, drawAngle = false, baked = false) { static draw = function(_x, _y, _s, drawAngle = false, baked = false) {
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
hairs[i].draw(_x, _y, _s, drawAngle, baked); hairs[i].draw(_x, _y, _s, drawAngle, baked);
} }
static store = function() { static store = function() {
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
hairs[i].store(); hairs[i].store();
} }
static freeze = function(fixLength = false) { static freeze = function(fixLength = false) {
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
hairs[i].freeze(fixLength); hairs[i].freeze(fixLength);
} }
@ -426,7 +426,7 @@ function StrandMesh() constructor {
} }
static set = function() { static set = function() {
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
hairs[i].set(); hairs[i].set();
return self; return self;
@ -437,7 +437,7 @@ function StrandMesh() constructor {
s.loop = loop; s.loop = loop;
s.mesh = mesh; s.mesh = mesh;
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
s.hairs[i] = hairs[i].clone(); s.hairs[i] = hairs[i].clone();
return s; return s;
@ -445,7 +445,7 @@ function StrandMesh() constructor {
static serialize = function() { static serialize = function() {
var _h = []; var _h = [];
for( var i = 0; i < array_length(hairs); i++ ) for( var i = 0, n = array_length(hairs); i < n; i++ )
_h[i] = hairs[i].serialize(); _h[i] = hairs[i].serialize();
return json_stringify(_h); return json_stringify(_h);
} }
@ -453,7 +453,7 @@ function StrandMesh() constructor {
static deserialize = function(s) { static deserialize = function(s) {
var j = json_parse(s); var j = json_parse(s);
for( var i = 0; i < array_length(j); i++ ) for( var i = 0, n = array_length(j); i < n; i++ )
hairs[i] = new Strand().deserialize(j[i]); hairs[i] = new Strand().deserialize(j[i]);
return self; return self;
} }

View file

@ -97,6 +97,13 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." ); inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." );
inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
inputs[| 37] = nodeValue("Collide ground", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
inputs[| 38] = nodeValue("Ground offset", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 );
inputs[| 39] = nodeValue("Bounce amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5 )
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]);
input_len = ds_list_size(inputs); input_len = ds_list_size(inputs);
@ -105,6 +112,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5, ["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5,
["Movement", true], 29, 6, 18, ["Movement", true], 29, 6, 18,
["Physics", true], 7, 19, 33, 20, 34, 35, 36, ["Physics", true], 7, 19, 33, 20, 34, 35, 36,
["Ground", true], 37, 38, 39,
["Rotation", true], 15, 8, 9, ["Rotation", true], 15, 8, 9,
["Scale", true], 10, 17, 11, ["Scale", true], 10, 17, 11,
["Color", true], 12, 28, 13, 14, ["Color", true], 12, 28, 13, 14,
@ -175,6 +183,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
var _anim_speed = current_data[23]; var _anim_speed = current_data[23];
var _anim_end = current_data[26]; var _anim_end = current_data[26];
var _ground = current_data[37];
var _ground_offset = current_data[38];
var _ground_bounce = current_data[39];
if(_rotation[1] < _rotation[0]) _rotation[1] += 360; if(_rotation[1] < _rotation[0]) _rotation[1] += 360;
var _posDist = []; var _posDist = [];
@ -266,8 +278,9 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
var _trn = random_range(_turn[0], _turn[1]); var _trn = random_range(_turn[0], _turn[1]);
if(_turnBi) _trn *= choose(-1, 1); if(_turnBi) _trn *= choose(-1, 1);
part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc); part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc);
part.setGround(_ground, _ground_offset, _ground_bounce);
part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow); part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow);
part.setDraw(_color, _bld, _alp, _fade); part.setDraw(_color, _bld, _alp, _fade);
spawn_index = safe_mod(spawn_index + 1, attributes.part_amount); spawn_index = safe_mod(spawn_index + 1, attributes.part_amount);
@ -349,15 +362,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
static step = function() {} static step = function() {}
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { static inspectorStep = function() {
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
if(onDrawOverlay != -1)
onDrawOverlay(active, _x, _y, _s, _mx, _my);
}
static onDrawOverlay = -1;
static update = function(frame = PROJECT.animator.current_frame) {
var _inSurf = inputs[| 0].getValue(); var _inSurf = inputs[| 0].getValue();
var _dist = inputs[| 4].getValue(); var _dist = inputs[| 4].getValue();
var _scatt = inputs[| 24].getValue(); var _scatt = inputs[| 24].getValue();
@ -379,7 +384,17 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
inputs[| 26].setVisible(true); inputs[| 26].setVisible(true);
} }
} }
}
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
if(onDrawOverlay != -1)
onDrawOverlay(active, _x, _y, _s, _mx, _my);
}
static onDrawOverlay = -1;
static update = function(frame = PROJECT.animator.current_frame) {
checkPartPool(); checkPartPool();
var _spawn_type = inputs[| 16].getValue(); var _spawn_type = inputs[| 16].getValue();
if(_spawn_type == 0) inputs[| 1].name = "Spawn delay"; if(_spawn_type == 0) inputs[| 1].name = "Spawn delay";
@ -395,4 +410,11 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
static onPartCreate = function(part) {} static onPartCreate = function(part) {}
static onPartStep = function(part) {} static onPartStep = function(part) {}
static onPartDestroy = function(part) {} static onPartDestroy = function(part) {}
static postDeserialize = function() {
if(PROJECT.version < SAVE_VERSION) {
for( var i = 37; i <= 39; i++ )
array_insert(load_map.inputs, i, noone);
}
}
} }

View file

@ -11,7 +11,7 @@
if(!is_array(_str)) __str = [ _str ]; \ if(!is_array(_str)) __str = [ _str ]; \
\ \
for( var k = 0; k < array_length(__str); k++ ) \ for( var k = 0; k < array_length(__str); k++ ) \
for( var i = 0; i < array_length(__str[k].hairs); i++ ) { \ for( var i = 0, n = array_length(__str[k].hairs); i < n; i++ ) { \
var h = __str[k].hairs[i]; \ var h = __str[k].hairs[i]; \
\ \
for( var j = 1; j < array_length(h.points); j++ ) { \ for( var j = 1; j < array_length(h.points); j++ ) { \

View file

@ -6,7 +6,7 @@ function addonContextGenerator(_addon, _function) constructor {
var _items = lua_call(_addon.thread, _function); var _items = lua_call(_addon.thread, _function);
var arr = []; var arr = [];
for( var i = 0; i < array_length(_items); i++ ) { for( var i = 0, n = array_length(_items); i < n; i++ ) {
var _item = _items[i]; var _item = _items[i];
if(_item == -1) if(_item == -1)
array_push(arr, -1); array_push(arr, -1);

View file

@ -10,7 +10,7 @@
#region API #region API
function __addon_lua_setup_functions(lua) { function __addon_lua_setup_functions(lua) {
for( var i = 0; i < array_length(global.__lua_functions); i++ ) { for( var i = 0, n = array_length(global.__lua_functions); i < n; i++ ) {
var _func = global.__lua_functions[i]; var _func = global.__lua_functions[i];
if(is_string(_func)) if(is_string(_func))
@ -864,7 +864,7 @@
var arr = variable_struct_get_names(_addon.panels); var arr = variable_struct_get_names(_addon.panels);
for( var i = 0; i < array_length(arr); i++ ) { for( var i = 0, n = array_length(arr); i < n; i++ ) {
if(arr[i] != panel) continue; if(arr[i] != panel) continue;
var pane = _addon.panels[$ arr[i]]; var pane = _addon.panels[$ arr[i]];
@ -1040,7 +1040,7 @@ end",
]; ];
function __addon_lua_setup_widget(lua, context) { function __addon_lua_setup_widget(lua, context) {
for( var i = 0; i < array_length(global.__lua_widget_functions); i++ ) { for( var i = 0, n = array_length(global.__lua_widget_functions); i < n; i++ ) {
var _func = global.__lua_widget_functions[i]; var _func = global.__lua_widget_functions[i];
if(is_string(_func)) if(is_string(_func))

View file

@ -5,6 +5,8 @@
loop, loop,
stop stop
} }
#macro ANIMATION_STATIC !(PROJECT.animator.is_playing || PROJECT.animator.frame_progress)
#endregion #endregion
#region animation class #region animation class
@ -61,35 +63,57 @@
} }
static render = function() { static render = function() {
setFrame(-1); setFrame(0);
is_playing = true; is_playing = true;
rendering = true; rendering = true;
frame_progress = true; frame_progress = true;
time_since_last_frame = 0;
} }
static toggle = function() { static toggle = function() {
is_playing = !is_playing; is_playing = !is_playing;
frame_progress = true; frame_progress = true;
time_since_last_frame = 0;
} }
static pause = function() { static pause = function() {
is_playing = false; is_playing = false;
frame_progress = true; frame_progress = true;
time_since_last_frame = 0;
} }
static play = function() { static play = function() {
setFrame(0);
is_playing = true; is_playing = true;
frame_progress = true; frame_progress = true;
time_since_last_frame = 0;
} }
static resume = function() { static resume = function() {
is_playing = true; is_playing = true;
frame_progress = true; frame_progress = true;
time_since_last_frame = 0;
} }
static stop = function() { static stop = function() {
is_playing = false;
setFrame(0); setFrame(0);
is_playing = false;
time_since_last_frame = 0;
}
static step = function() {
if(is_playing && play_freeze == 0) {
time_since_last_frame += framerate * (delta_time / 1000000);
if(time_since_last_frame >= 1)
setFrame(real_frame + 1);
} else {
frame_progress = false;
//setFrame(real_frame);
time_since_last_frame = 0;
}
play_freeze = max(0, play_freeze - 1);
} }
} }
#endregion #endregion

View file

@ -16,7 +16,6 @@ function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) {
function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) { function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
static log = false; static log = false;
APPENDING = true;
UNDO_HOLDING = true; UNDO_HOLDING = true;
if(struct_has(_map, "version")) { if(struct_has(_map, "version")) {
@ -33,6 +32,8 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
var appended_list = ds_list_create(); var appended_list = ds_list_create();
var node_create = ds_list_create(); var node_create = ds_list_create();
APPENDING = true;
ds_queue_clear(CONNECTION_CONFLICT); ds_queue_clear(CONNECTION_CONFLICT);
ds_map_clear(APPEND_MAP); ds_map_clear(APPEND_MAP);
var t = current_time; var t = current_time;

View file

@ -74,21 +74,26 @@ function array_get_decimal(arr, index, color = false) {
} }
function array_exists(arr, val) { function array_exists(arr, val) {
for( var i = 0; i < array_length(arr); i++ ) { gml_pragma("forceinline");
if(isEqual(arr[i], val)) return true; self.__temp_val = val;
}
return false; return array_any(arr, function(_val, _ind) {
return isEqual(_val, self.__temp_val);
});
} }
function array_empty(arr) { function array_empty(arr) {
gml_pragma("forceinline");
return array_length(arr) == 0; return array_length(arr) == 0;
} }
function array_find(arr, val) { function array_find(arr, val) {
for( var i = 0; i < array_length(arr); i++ ) { gml_pragma("forceinline");
if(isEqual(arr[i], val)) return i; self.__temp_val = val;
}
return -1; return array_find_index(arr, function(_val, _ind) {
return isEqual(_val, self.__temp_val);
});
} }
function array_remove(arr, val) { function array_remove(arr, val) {
@ -109,23 +114,11 @@ function array_insert_unique(arr, ind, val) {
} }
function array_append(arr, arr0) { function array_append(arr, arr0) {
for( var i = 0; i < array_length(arr0); i++ ) for( var i = 0, n = array_length(arr0); i < n; i++ )
array_push(arr, arr0[i]); array_push(arr, arr0[i]);
return arr; return arr;
} }
function array_shuffle(arr) {
var r = array_length(arr) - 1;
for(var i = 0; i < r; i += 1) {
var j = irandom_range(i,r);
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
return arr;
}
function array_merge() { function array_merge() {
var arr = []; var arr = [];
for( var i = 0; i < argument_count; i++ ) { for( var i = 0; i < argument_count; i++ ) {
@ -140,7 +133,7 @@ function array_clone(arr) {
return arr; return arr;
var _res = []; var _res = [];
for( var i = 0; i < array_length(arr); i++ ) for( var i = 0, n = array_length(arr); i < n; i++ )
_res[i] = array_clone(arr[i]); _res[i] = array_clone(arr[i]);
return _res; return _res;
} }
@ -149,7 +142,7 @@ function array_min(arr) {
if(array_length(arr) == 0) return 0; if(array_length(arr) == 0) return 0;
var mn = arr[0]; var mn = arr[0];
for( var i = 0; i < array_length(arr); i++ ) for( var i = 0, n = array_length(arr); i < n; i++ )
mn = min(mn, arr[i]); mn = min(mn, arr[i]);
return mn; return mn;
} }
@ -158,7 +151,7 @@ function array_max(arr) {
if(array_length(arr) == 0) return 0; if(array_length(arr) == 0) return 0;
var mx = arr[0]; var mx = arr[0];
for( var i = 0; i < array_length(arr); i++ ) for( var i = 0, n = array_length(arr); i < n; i++ )
mx = max(mx, arr[i]); mx = max(mx, arr[i]);
return mx; return mx;
} }
@ -188,7 +181,7 @@ function array_spread(arr, _arr = []) {
return _arr; return _arr;
} }
for( var i = 0; i < array_length(arr); i++ ) for( var i = 0, n = array_length(arr); i < n; i++ )
array_spread(arr[i], _arr); array_spread(arr[i], _arr);
return _arr; return _arr;

View file

@ -338,7 +338,7 @@ function read_format(bin, format, outMap) {
} }
function read_format_array(bin, formatArr, outMap) { function read_format_array(bin, formatArr, outMap) {
for( var i = 0; i < array_length(formatArr); i++ ) { for( var i = 0, n = array_length(formatArr); i < n; i++ ) {
if(array_length(formatArr[i]) >= 4 && !formatArr[i][3](outMap)) if(array_length(formatArr[i]) >= 4 && !formatArr[i][3](outMap))
continue; continue;
var pos = file_bin_position(bin); var pos = file_bin_position(bin);

View file

@ -47,7 +47,7 @@
var s = global.ASSET_CACHE[? key]; var s = global.ASSET_CACHE[? key];
var valid = true; var valid = true;
if(is_array(s)) { if(is_array(s)) {
for( var i = 0; i < array_length(s); i++ ) for( var i = 0, n = array_length(s); i < n; i++ )
valid &= is_surface(s[i]); valid &= is_surface(s[i]);
} else } else
valid = is_surface(s); valid = is_surface(s);

View file

@ -66,8 +66,8 @@ function buttonGroupClass(_data, _onClick) : widget() constructor {
var spr = i == 0 ? buttonSpr[0] : (i == amo - 1? buttonSpr[2] : buttonSpr[1]); var spr = i == 0 ? buttonSpr[0] : (i == amo - 1? buttonSpr[2] : buttonSpr[1]);
if(_selecting == i) { if(_selecting == i) {
draw_sprite_stretched(spr, 2, bx, _y, ww, _h); draw_sprite_stretched(spr, 2, bx, _y, ww - !!i, _h);
draw_sprite_stretched_ext(spr, 3, bx, _y, ww, _h, COLORS._main_accent, 1); draw_sprite_stretched_ext(spr, 3, bx, _y, ww - !!i, _h, COLORS._main_accent, 1);
} else { } else {
buttons[i].draw(bx, _y, ww, _h, _m, spr); buttons[i].draw(bx, _y, ww, _h, _m, spr);
if(buttons[i].clicked) onClick(i); if(buttons[i].clicked) onClick(i);

View file

@ -86,15 +86,15 @@ function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) {
draw_rectangle(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, false); draw_rectangle(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, false);
} }
if(c_color > -1) { if(c_color == -1) return;
for(var i = 0; i < array_length(_pal); i++) {
if(c_color == _pal[i]) { for(var i = 0; i < array_length(_pal); i++) {
var _x0 = _x + safe_mod(i, col) * _gs; if(c_color != _pal[i]) continue;
var _y0 = _y + floor(i / col) * _gs;
var _x0 = _x + safe_mod(i, col) * _gs;
var _y0 = _y + floor(i / col) * _gs;
draw_set_color(c_white); draw_set_color(c_white);
draw_rectangle_border(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, 2); draw_rectangle_border(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, 2);
}
}
} }
} }

View file

@ -44,7 +44,7 @@ function _loadColor(theme = "default", replace = false) {
var clrkeys = variable_struct_get_names(clrs.colors); var clrkeys = variable_struct_get_names(clrs.colors);
for( var i = 0; i < array_length(clrkeys); i++ ) { for( var i = 0, n = array_length(clrkeys); i < n; i++ ) {
var key = clrkeys[i]; var key = clrkeys[i];
var str = variable_struct_get(clrs.colors, key); var str = variable_struct_get(clrs.colors, key);
@ -52,7 +52,7 @@ function _loadColor(theme = "default", replace = false) {
variable_struct_set(CDEF, key, c); variable_struct_set(CDEF, key, c);
} }
for( var i = 0; i < array_length(defkeys); i++ ) { for( var i = 0, n = array_length(defkeys); i < n; i++ ) {
var key = defkeys[i]; var key = defkeys[i];
var c = c_white; var c = c_white;
@ -75,7 +75,7 @@ function _loadColor(theme = "default", replace = false) {
variable_struct_set(COLORS, key, c); variable_struct_set(COLORS, key, c);
} }
for( var i = 0; i < array_length(valkeys); i++ ) { for( var i = 0, n = array_length(valkeys); i < n; i++ ) {
var key = valkeys[i]; var key = valkeys[i];
if(variable_struct_exists(oclr, key)) { if(variable_struct_exists(oclr, key)) {
var c = variable_struct_get(oclr, key); var c = variable_struct_get(oclr, key);
@ -84,7 +84,7 @@ function _loadColor(theme = "default", replace = false) {
} }
var arrkeys = variable_struct_get_names(clrs.array); var arrkeys = variable_struct_get_names(clrs.array);
for( var i = 0; i < array_length(arrkeys); i++ ) { for( var i = 0, n = array_length(arrkeys); i < n; i++ ) {
var key = arrkeys[i]; var key = arrkeys[i];
var def = variable_struct_get(clrs.array, key); var def = variable_struct_get(clrs.array, key);

View file

@ -7,7 +7,7 @@
if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) { if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) {
var callbacks = CONTEXT_MENU_CALLBACK[? menu_id]; var callbacks = CONTEXT_MENU_CALLBACK[? menu_id];
for( var i = 0; i < array_length(callbacks); i++ ) for( var i = 0, n = array_length(callbacks); i < n; i++ )
array_append(menu, callbacks[i].populate()); array_append(menu, callbacks[i].populate());
} }

View file

@ -42,12 +42,12 @@ function controlPointBox(_onModify) : widget() constructor {
static setInteract = function(interactable = noone) { static setInteract = function(interactable = noone) {
self.interactable = interactable; self.interactable = interactable;
for( var i = 0; i < array_length(widgets); i++ ) for( var i = 0, n = array_length(widgets); i < n; i++ )
widgets[i].setInteract(interactable); widgets[i].setInteract(interactable);
} }
static register = function(parent = noone) { static register = function(parent = noone) {
for( var i = 0; i < array_length(widgets); i++ ) for( var i = 0, n = array_length(widgets); i < n; i++ )
widgets[i].register(parent); widgets[i].register(parent);
} }
@ -55,7 +55,7 @@ function controlPointBox(_onModify) : widget() constructor {
x = _x; x = _x;
y = _y; y = _y;
for( var i = 0; i < array_length(widgets); i++ ) for( var i = 0, n = array_length(widgets); i < n; i++ )
widgets[i].setFocusHover(active, hover); widgets[i].setFocusHover(active, hover);
var yy = _y; var yy = _y;

View file

@ -12,7 +12,7 @@
#endregion #endregion
function _log_template() { function _log_template() {
return $"{string(current_year)}/{string(current_month)}/{string(current_day)} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > "; return $"{current_year}/{current_month}/{current_day} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > ";
} }
function __log(title, str, fname = "log/log.txt") { function __log(title, str, fname = "log/log.txt") {
@ -63,7 +63,7 @@ function exception_print(e) {
var str = "\n\n========== Crash log ==========\n\n" + e.longMessage; var str = "\n\n========== Crash log ==========\n\n" + e.longMessage;
str += "\n\n========== Stack trace ==========\n\n"; str += "\n\n========== Stack trace ==========\n\n";
for( var i = 0; i < array_length(e.stacktrace); i++ ) for( var i = 0, n = array_length(e.stacktrace); i < n; i++ )
str += e.stacktrace[i] + "\n" str += e.stacktrace[i] + "\n"
str += "\n\n========= Crash log end =========\n"; str += "\n\n========= Crash log end =========\n";
@ -80,7 +80,7 @@ function setException() {
tt += "\n" + ex.longMessage; tt += "\n" + ex.longMessage;
tt += "\n" + ex.script; tt += "\n" + ex.script;
tt += "\n-------------------------- STACK TRACE --------------------------\n\n"; tt += "\n-------------------------- STACK TRACE --------------------------\n\n";
for( var i = 0; i < array_length(ex.stacktrace); i++ ) { for( var i = 0, n = array_length(ex.stacktrace); i < n; i++ ) {
tt += ex.stacktrace[i] + "\n"; tt += ex.stacktrace[i] + "\n";
} }
tt += "\n---------------------------- :( ----------------------------\n"; tt += "\n---------------------------- :( ----------------------------\n";

View file

@ -11,7 +11,7 @@ function dialogCall(_dia, _x = noone, _y = noone, param = {}, create = false) {
dia.resetPosition(); dia.resetPosition();
var args = variable_struct_get_names(param); var args = variable_struct_get_names(param);
for( var i = 0; i < array_length(args); i++ ) for( var i = 0, n = array_length(args); i < n; i++ )
variable_instance_set(dia, args[i], variable_struct_get(param, args[i])); variable_instance_set(dia, args[i], variable_struct_get(param, args[i]));
setFocus(dia.id, "Dialog"); setFocus(dia.id, "Dialog");

View file

@ -1,7 +1,14 @@
function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = 10) { function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = 10) {
var dir0 = point_direction(x1, y1, xc, yc); var dir0 = point_direction(x1, y1, xc, yc);
var dir1 = point_direction(x3, y3, xc, yc); var dir1 = point_direction(x3, y3, xc, yc);
var dis = point_distance(x1, y1, x3, y3);
if(dis < 8) {
draw_set_color(col);
draw_line_width(x1, y1, x3, y3, thick);
return;
}
var p2 = point_rotate(xc, yc, x1, y1, -90); var p2 = point_rotate(xc, yc, x1, y1, -90);
var x2 = p2[0]; var x2 = p2[0];
var y2 = p2[1]; var y2 = p2[1];
@ -25,16 +32,22 @@ function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample =
var d1 = point_direction(px, py, x3, y3); var d1 = point_direction(px, py, x3, y3);
draw_set_color(col); draw_set_color(col);
draw_primitive_begin(pr_trianglestrip);
var ox, oy, nx, ny; var ox, oy, nx, ny;
var st = 1 / round(sample); var aa = angle_difference(d1, d0);
for( var i = 0; i <= 1; i += st ) { sample = round(sample);
var a = d0 + angle_difference(d1, d0) * i;
nx = px + lengthdir_x(r, a); for( var i = 0; i <= sample; i++ ) {
ny = py + lengthdir_y(r, a); var a = d0 + aa * (i / sample);
nx = px + lengthdir_x(r - thick / 2, a) + 1;
ny = py + lengthdir_y(r - thick / 2, a) + 1;
ox = px + lengthdir_x(r + thick / 2, a) + 1;
oy = py + lengthdir_y(r + thick / 2, a) + 1;
if(i > 0) draw_line_round(ox, oy, nx, ny, thick, i == st, i == 1, sample); draw_vertex(nx, ny);
draw_vertex(ox, oy);
ox = nx;
oy = ny;
} }
draw_primitive_end();
} }

View file

@ -1,6 +1,7 @@
function draw_line_width_vertex(xs, ys, xe, ye, thick, c0, c1) { function draw_line_width_vertex(xs, ys, xe, ye, thick, c0, c1) {
draw_primitive_begin(pr_trianglestrip); var vb = vertex_create_buffer();
vertex_begin(vb, FORMAT_2PC);
// Calculate the direction and perpendicular vector of the line // Calculate the direction and perpendicular vector of the line
var dx = xe - xs; var dx = xe - xs;
var dy = ye - ys; var dy = ye - ys;
@ -19,10 +20,13 @@ function draw_line_width_vertex(xs, ys, xe, ye, thick, c0, c1) {
var y3 = ye - py; var y3 = ye - py;
// Draw vertices // Draw vertices
draw_vertex_color(x0, y0, c0, 1); vertex_add_2pc(vb, x0, y0, c0);
draw_vertex_color(x1, y1, c0, 1); vertex_add_2pc(vb, x1, y1, c0);
draw_vertex_color(x2, y2, c1, 1); vertex_add_2pc(vb, x2, y2, c1);
draw_vertex_color(x3, y3, c1, 1); vertex_add_2pc(vb, x3, y3, c1);
draw_primitive_end(); vertex_end(vb);
vertex_freeze(vb);
return vb;
} }

View file

@ -72,7 +72,7 @@ function __draw_text_ext_transformed(_x, _y, _text, _sep, _w, sx, sy, rotation)
case fa_bottom : yy = _y - hh; break; case fa_bottom : yy = _y - hh; break;
} }
for( var i = 0; i < array_length(lines); i++ ) { for( var i = 0, n = array_length(lines); i < n; i++ ) {
var lw = string_width(lines[i]) * sx; var lw = string_width(lines[i]) * sx;
switch(ha) { switch(ha) {

View file

@ -1,6 +1,6 @@
function ds_list_create_from_array(array) { function ds_list_create_from_array(array) {
var l = ds_list_create(); var l = ds_list_create();
for( var i = 0; i < array_length(array); i++ ) { for( var i = 0, n = array_length(array); i < n; i++ ) {
l[| i] = array[i]; l[| i] = array[i];
} }
return l; return l;

View file

@ -2,7 +2,7 @@ function Queue() constructor {
data = []; data = [];
static enqueue = function(val) { static enqueue = function(val) {
if(array_exists(data, val)) return self; if(array_contains(data, val)) return self;
//array_remove(data, val); //array_remove(data, val);
array_push(data, val); array_push(data, val);
@ -25,10 +25,10 @@ function Queue() constructor {
static size = function() { return array_length(data); } static size = function() { return array_length(data); }
static empty = function() { return size() == 0; } static empty = function() { return size() == 0; }
static toString = function() { static toString = function() { return "";
var ss = "["; var ss = "[";
for( var i = 0; i < array_length(data); i++ ) for( var i = 0, n = array_length(data); i < n; i++ )
ss += (i? ", " : "") + string(data[i].internalName); ss += (i? ", " : "") + data[i].internalName;
ss += "]" ss += "]"
return ss; return ss;
} }

View file

@ -94,7 +94,7 @@ function Action(_type, _object, _data) constructor {
groupNodes(data.content, obj, false); groupNodes(data.content, obj, false);
break; break;
case ACTION_TYPE.collection_loaded : case ACTION_TYPE.collection_loaded :
for( var i = 0; i < array_length(obj); i++ ) for( var i = 0, n = array_length(obj); i < n; i++ )
nodeDelete(obj[i]); nodeDelete(obj[i]);
break; break;
} }
@ -156,7 +156,7 @@ function Action(_type, _object, _data) constructor {
upgroupNode(obj, false); upgroupNode(obj, false);
break; break;
case ACTION_TYPE.collection_loaded : case ACTION_TYPE.collection_loaded :
for( var i = 0; i < array_length(obj); i++ ) for( var i = 0, n = array_length(obj); i < n; i++ )
obj[i].restore(); obj[i].restore();
break; break;
} }

View file

@ -14,11 +14,11 @@ function FFT(array_in) {
} }
function _FFT(array_in) { function _FFT(array_in) {
var n = array_length(array_in); var _n = array_length(array_in);
var nh = n div 2; var nh = _n div 2;
var theta = (2 * pi) / n; var theta = (2 * pi) / _n;
if (n == 1) if (_n == 1)
return array_in; return array_in;
var even = array_create(nh, 0); var even = array_create(nh, 0);
@ -34,7 +34,7 @@ function _FFT(array_in) {
//print($"> {evenFFT}, {oddFFT}"); //print($"> {evenFFT}, {oddFFT}");
var array_out = array_create(n); var array_out = array_create(_n);
for (var i = 0; i < nh; i++) { for (var i = 0; i < nh; i++) {
var t = new Complex( var t = new Complex(

View file

@ -90,7 +90,7 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 1147; VERSION = 1147;
SAVE_VERSION = 1448; SAVE_VERSION = 1448.1;
VERSION_STRING = "1.14.7"; VERSION_STRING = "1.14.7";
BUILD_NUMBER = 114600; BUILD_NUMBER = 114600;

View file

@ -22,7 +22,7 @@ function gradientObject(color = c_black) constructor {
static clone = function() { static clone = function() {
var g = new gradientObject(); var g = new gradientObject();
for( var i = 0; i < array_length(keys); i++ ) { for( var i = 0, n = array_length(keys); i < n; i++ ) {
g.keys[i] = keys[i].clone(); g.keys[i] = keys[i].clone();
} }
g.type = type; g.type = type;
@ -153,7 +153,7 @@ function gradientObject(color = c_black) constructor {
g.keys = []; g.keys = [];
g.type = type; g.type = type;
for( var i = 0; i < array_length(keys); i++ ) for( var i = 0, n = array_length(keys); i < n; i++ )
g.keys[i] = keys[i].clone(); g.keys[i] = keys[i].clone();
return g; return g;
@ -162,7 +162,7 @@ function gradientObject(color = c_black) constructor {
static serialize = function() { static serialize = function() {
var s = {type}; var s = {type};
s.keys = []; s.keys = [];
for( var i = 0; i < array_length(keys); i++ ) for( var i = 0, n = array_length(keys); i < n; i++ )
s.keys[i] = keys[i].serialize(); s.keys[i] = keys[i].serialize();
return json_stringify(s, false); return json_stringify(s, false);
@ -177,7 +177,7 @@ function gradientObject(color = c_black) constructor {
s = str; s = str;
else if(is_array(str)) { else if(is_array(str)) {
keys = []; keys = [];
for( var i = 0; i < array_length(str); i++ ) for( var i = 0, n = array_length(str); i < n; i++ )
keys[i] = new gradientKey(str[i].time, str[i].value); keys[i] = new gradientKey(str[i].time, str[i].value);
return self; return self;
@ -185,7 +185,7 @@ function gradientObject(color = c_black) constructor {
type = s.type; type = s.type;
keys = []; keys = [];
for( var i = 0; i < array_length(s.keys); i++ ) for( var i = 0, n = array_length(s.keys); i < n; i++ )
keys[i] = new gradientKey(s.keys[i].time, s.keys[i].value); keys[i] = new gradientKey(s.keys[i].time, s.keys[i].value);
return self; return self;

View file

@ -62,7 +62,7 @@ function histogramUpdate(surface) {
var sth = max(1, sh / attributes.preview_sample); var sth = max(1, sh / attributes.preview_sample);
for( var j = 0; j < 4; j++ ) for( var j = 0; j < 4; j++ )
for( var i = 0; i < array_length(hist[0]); i++ ) { for( var i = 0, n = array_length(hist[0]); i < n; i++ ) {
hist[j][i] = 0; hist[j][i] = 0;
} }

View file

@ -22,23 +22,26 @@ function TEST_PATH(path) {
} }
function LOAD_PATH(path, readonly = false, safe_mode = false) { function LOAD_PATH(path, readonly = false, safe_mode = false) {
for( var i = 0; i < array_length(PROJECTS); i++ ) for( var i = 0, n = array_length(PROJECTS); i < n; i++ )
if(PROJECTS[i].path == path) return; if(PROJECTS[i].path == path) return;
var _PROJECT = PROJECT; var _PROJECT = PROJECT;
PROJECT = new Project(); PROJECT = new Project();
if(PANEL_GRAPH.project.path == "" && !PANEL_GRAPH.project.modified) { if(PANEL_GRAPH.project.path == "" && !PANEL_GRAPH.project.modified) {
var ind = array_find(PROJECTS, PANEL_GRAPH.project);
PROJECTS[ind] = PROJECT;
PANEL_GRAPH.setProject(PROJECT); PANEL_GRAPH.setProject(PROJECT);
} else { } else {
var graph = new Panel_Graph(PROJECT); var graph = new Panel_Graph(PROJECT);
PANEL_GRAPH.panel.setContent(graph, true); PANEL_GRAPH.panel.setContent(graph, true);
PANEL_GRAPH = graph; PANEL_GRAPH = graph;
array_push(PROJECTS, PROJECT);
} }
var res = __LOAD_PATH(path, readonly, safe_mode); var res = __LOAD_PATH(path, readonly, safe_mode);
if(!res) return false; if(!res) return false;
array_push(PROJECTS, PROJECT);
PANEL_ANIMATION.updatePropertyList(); PANEL_ANIMATION.updatePropertyList();
setFocus(PANEL_GRAPH.panel); setFocus(PANEL_GRAPH.panel);
@ -93,7 +96,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false
log_warning("LOAD", warn); log_warning("LOAD", warn);
} }
} else { } else {
var warn = $"File version mismatch : loading old format to Pixel Composer {string(SAVE_VERSION)}"; var warn = $"File version mismatch : loading old format to Pixel Composer {SAVE_VERSION}";
log_warning("LOAD", warn); log_warning("LOAD", warn);
} }
@ -220,6 +223,13 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false
log_warning("LOAD, connect", exception_print(e)); log_warning("LOAD, connect", exception_print(e));
} }
try {
for(var i = 0; i < ds_list_size(create_list); i++)
create_list[| i].clearInputCache();
} catch(e) {
log_warning("LOAD, connect", exception_print(e));
}
Render(); Render();
LOADING = false; LOADING = false;

View file

@ -2,10 +2,12 @@
global.LOG_LEVEL = 0; global.LOG_LEVEL = 0;
function LOG_BLOCK_START() { function LOG_BLOCK_START() {
gml_pragma("forceinline");
global.LOG_LEVEL++; global.LOG_LEVEL++;
} }
function LOG(text) { function LOG(text) {
gml_pragma("forceinline");
var s = ""; var s = "";
repeat(global.LOG_LEVEL - 1) repeat(global.LOG_LEVEL - 1)
s += " "; s += " ";
@ -15,26 +17,29 @@
} }
function LOG_LINE(text) { function LOG_LINE(text) {
gml_pragma("forceinline");
LOG_BLOCK_START(); LOG_BLOCK_START();
LOG(text); LOG(text);
LOG_BLOCK_END(); LOG_BLOCK_END();
} }
function LOG_IF(cond, text) { function LOG_IF(cond, text) {
if(!cond) return; gml_pragma("forceinline");
LOG(text); if(cond) LOG(text);
} }
function LOG_LINE_IF(cond, text) { function LOG_LINE_IF(cond, text) {
if(!cond) return; gml_pragma("forceinline");
LOG_LINE(text); if(cond) LOG_LINE(text);
} }
function LOG_BLOCK_END() { function LOG_BLOCK_END() {
gml_pragma("forceinline");
global.LOG_LEVEL--; global.LOG_LEVEL--;
} }
function LOG_END() { function LOG_END() {
gml_pragma("forceinline");
global.LOG_LEVEL = 0; global.LOG_LEVEL = 0;
} }
#endregion #endregion

View file

@ -3,7 +3,7 @@ var reserved = ["and", "break", "do", "else", "elseif", "end", "false",
"for", "function", "if", "in", "local", "nil", "not", "for", "function", "if", "in", "local", "nil", "not",
"or", "repeat", "return", "then", "true", "until", "while"]; "or", "repeat", "return", "then", "true", "until", "while"];
for( var i = 0; i < array_length(reserved); i++ ) for( var i = 0, n = array_length(reserved); i < n; i++ )
global.lua_reserved[? reserved[i]] = 1; global.lua_reserved[? reserved[i]] = 1;
function token_splice(str) { function token_splice(str) {
@ -15,7 +15,7 @@ function token_splice(str) {
do { do {
sp = 999999; sp = 999999;
for( var i = 0; i < array_length(tk); i++ ) { for( var i = 0, n = array_length(tk); i < n; i++ ) {
var _pos = string_pos(tk[i], ss); var _pos = string_pos(tk[i], ss);
if(_pos != 0) sp = min(sp, _pos); if(_pos != 0) sp = min(sp, _pos);
} }

View file

@ -129,7 +129,7 @@ function MetaDataManager() constructor {
var tx = 0; var tx = 0;
var hh = line_get_height(f_p0, ui(4)); var hh = line_get_height(f_p0, ui(4));
var th = hh; var th = hh;
for( var i = 0; i < array_length(tags); i++ ) { for( var i = 0, n = array_length(tags); i < n; i++ ) {
var ww = string_width(tags[i]) + ui(16); var ww = string_width(tags[i]) + ui(16);
if(tx + ww + ui(2) > _w - ui(16)) { if(tx + ww + ui(2) > _w - ui(16)) {
tx = 0; tx = 0;
@ -190,7 +190,7 @@ function MetaDataManager() constructor {
var tx = 0; var tx = 0;
var hh = line_get_height(f_p0, ui(4)); var hh = line_get_height(f_p0, ui(4));
for( var i = 0; i < array_length(tags); i++ ) { for( var i = 0, n = array_length(tags); i < n; i++ ) {
var ww = string_width(tags[i]) + ui(16); var ww = string_width(tags[i]) + ui(16);
if(tx + ww + ui(2) > _w - ui(16)) { if(tx + ww + ui(2) > _w - ui(16)) {
tx = 0; tx = 0;

View file

@ -103,7 +103,7 @@ function Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) construc
inputs = _l; inputs = _l;
var _d = []; var _d = [];
for( var i = 0; i < array_length(input_display_list); i++ ) { for( var i = 0, n = array_length(input_display_list); i < n; i++ ) {
var ind = input_display_list[i]; var ind = input_display_list[i];
if(i < input_display_len || ind < ds_list_size(inputs)) if(i < input_display_len || ind < ds_list_size(inputs))
@ -168,7 +168,7 @@ function Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) construc
inputs[| 12].setVisible(_proj); inputs[| 12].setVisible(_proj);
for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
var ind = output_display_list[i]; var ind = output_display_list[i];
var _outSurf = outputs[| ind].getValue(); var _outSurf = outputs[| ind].getValue();
outputs[| ind].setValue(surface_verify(_outSurf, _dim[0], _dim[1])); outputs[| ind].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));

View file

@ -91,7 +91,7 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
_3d_local_transform(_lpos, _lrot, _lsca); _3d_local_transform(_lpos, _lrot, _lsca);
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].submit(); vertexObjects[i].submit();
_3d_clear_local_transform(); _3d_clear_local_transform();
@ -130,11 +130,11 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
if(_output_index == 0 && attributes.auto_update) { if(_output_index == 0 && attributes.auto_update) {
var _vert = _data[11]; var _vert = _data[11];
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].destroy(); vertexObjects[i].destroy();
vertexObjects = []; vertexObjects = [];
for( var i = 0; i < array_length(_vert); i++ ) { for( var i = 0, n = array_length(_vert); i < n; i++ ) {
var v = _vert[i].clone(false); var v = _vert[i].clone(false);
for( var j = 0; j < array_length(v.faces); j++ ) { for( var j = 0; j < array_length(v.faces); j++ ) {
@ -175,7 +175,7 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var _cam = new __3d_camera(_proj, _fov); var _cam = new __3d_camera(_proj, _fov);
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass); _outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].submit(); vertexObjects[i].submit();
_3d_post_setup(); _3d_post_setup();

View file

@ -37,7 +37,7 @@ function Node_3D_Export(_x, _y, _group = noone) : Node(_x, _y, _group) construct
file_text_write_string(fObj, "mtllib " + filename_name(mPath) + "\n"); file_text_write_string(fObj, "mtllib " + filename_name(mPath) + "\n");
for( var i = 0; i < array_length(vert); i++ ) { for( var i = 0, n = array_length(vert); i < n; i++ ) {
file_text_write_string(fObj, "\n"); file_text_write_string(fObj, "\n");
var v = vert[i]; var v = vert[i];

View file

@ -111,7 +111,7 @@ function Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
var _ins = inputs[| 0].getValue(); var _ins = inputs[| 0].getValue();
if(!is_array(_ins)) _ins = [ _ins ]; if(!is_array(_ins)) _ins = [ _ins ];
for( var i = 0; i < array_length(vertexObjects); i++ ) { for( var i = 0, n = array_length(vertexObjects); i < n; i++ ) {
if(vertexObjects[i] == noone) continue; if(vertexObjects[i] == noone) continue;
vertexObjects[i].destroy(); vertexObjects[i].destroy();
} }

View file

@ -250,7 +250,7 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
inputs[| 16].setVisible(_proj == 1); inputs[| 16].setVisible(_proj == 1);
for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
var ind = output_display_list[i]; var ind = output_display_list[i];
var _outSurf = outputs[| ind].getValue(); var _outSurf = outputs[| ind].getValue();

View file

@ -69,7 +69,7 @@ function Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
_3d_node_init(0, /*Transform*/ 1, 3, 6, 2, 7); _3d_node_init(0, /*Transform*/ 1, 3, 6, 2, 7);
static generate_vb = function() { static generate_vb = function() {
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].destroy(); vertexObjects[i].destroy();
vertexObjects = []; vertexObjects = [];

View file

@ -79,7 +79,7 @@ function Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
static generate_vb = function() { static generate_vb = function() {
var _ox, _oy, _nx, _ny, _ou, _nu; var _ox, _oy, _nx, _ny, _ou, _nu;
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].destroy(); vertexObjects[i].destroy();
vertexObjects = []; vertexObjects = [];

View file

@ -87,7 +87,7 @@ function Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
static generate_vb = function() { static generate_vb = function() {
var _ox, _oy, _nx, _ny, _ou, _nu; var _ox, _oy, _nx, _ny, _ou, _nu;
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].destroy(); vertexObjects[i].destroy();
vertexObjects = []; vertexObjects = [];

View file

@ -78,7 +78,7 @@ function Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
static generate_vb = function() { static generate_vb = function() {
var _ox, _oy, _nx, _ny, _ou, _nu; var _ox, _oy, _nx, _ny, _ou, _nu;
for( var i = 0; i < array_length(vertexObjects); i++ ) for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].destroy(); vertexObjects[i].destroy();
vertexObjects = []; vertexObjects = [];

View file

@ -205,7 +205,7 @@
// inputs[| 16].setVisible(_proj == 1); // inputs[| 16].setVisible(_proj == 1);
// for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { // for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
// var ind = output_display_list[i]; // var ind = output_display_list[i];
// var _outSurf = outputs[| ind].getValue(); // var _outSurf = outputs[| ind].getValue();

View file

@ -183,7 +183,7 @@ function Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _patt = inputs[| 16].getValue(); var _patt = inputs[| 16].getValue();
for( var i = 0; i < array_length(output_display_list) - 1; i++ ) { for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
var ind = output_display_list[i]; var ind = output_display_list[i];
var _outSurf = outputs[| ind].getValue(); var _outSurf = outputs[| ind].getValue();

View file

@ -78,7 +78,7 @@ function Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
_3d_local_transform(_lpos, _lrot, _lsca); _3d_local_transform(_lpos, _lrot, _lsca);
if(is_array(sv)) { if(is_array(sv)) {
for( var i = 0; i < array_length(sv); i++ ) for( var i = 0, n = array_length(sv); i < n; i++ )
sv[i](i); sv[i](i);
} else } else
sv(); sv();

View file

@ -36,7 +36,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
var _dim = current_data[1]; var _dim = current_data[1];
var _splice = current_data[2]; var _splice = current_data[2];
for( var i = 0; i < array_length(_splice); i++ ) for( var i = 0, n = array_length(_splice); i < n; i++ )
_splice[i] = round(_splice[i]); _splice[i] = round(_splice[i]);
var sp_r = _x + (_dim[0] - _splice[0]) * _s; var sp_r = _x + (_dim[0] - _splice[0]) * _s;

View file

@ -34,7 +34,7 @@ function Node_FFT(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const
var _res = FFT(_cmp); var _res = FFT(_cmp);
var _r = array_create(array_length(_res)); var _r = array_create(array_length(_res));
for( var i = 0; i < array_length(_res); i++ ) for( var i = 0, n = array_length(_res); i < n; i++ )
_r[i] = sqrt(sqr(_res[i].re) + sqr(_res[i].im)); _r[i] = sqrt(sqr(_res[i].re) + sqr(_res[i].im));
return _r; return _r;

View file

@ -151,7 +151,7 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(!is_array(val) || array_length(val) == 0) return; if(!is_array(val) || array_length(val) == 0) return;
if(!is_array(val[0])) val = [ val ]; if(!is_array(val[0])) val = [ val ];
for( var i = 0; i < array_length(val); i++ ) for( var i = 0, n = array_length(val); i < n; i++ )
for( var j = 0; j < array_length(val[i]); j++ ) { for( var j = 0; j < array_length(val[i]); j++ ) {
affect(val[i][j]); affect(val[i][j]);
} }

View file

@ -40,7 +40,7 @@ function Node_VFX_Override(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _alp = inputs[| 5].getValue(); var _alp = inputs[| 5].getValue();
var _srf = inputs[| 6].getValue(); var _srf = inputs[| 6].getValue();
for( var i = 0; i < array_length(parts); i++ ) { for( var i = 0, n = array_length(parts); i < n; i++ ) {
var part = parts[i]; var part = parts[i];
if(is_array(_pos) && array_length(_pos) > i && is_array(_pos[i])) { if(is_array(_pos) && array_length(_pos) > i && is_array(_pos[i])) {

View file

@ -31,7 +31,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
return; return;
} else { } else {
var _parts = []; var _parts = [];
for( var i = 0; i < array_length(parts); i++ ) { for( var i = 0, n = array_length(parts); i < n; i++ ) {
if(!parts[i].active) continue; if(!parts[i].active) continue;
array_push(_parts, parts[i]); array_push(_parts, parts[i]);
} }

View file

@ -53,7 +53,7 @@ function Node_VFX_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) constr
for( var i = 0; i < ds_list_size(outputs); i++ ) for( var i = 0; i < ds_list_size(outputs); i++ )
_val[i] = array_create(array_length(parts)); _val[i] = array_create(array_length(parts));
for( var i = 0; i < array_length(parts); i++ ) { for( var i = 0, n = array_length(parts); i < n; i++ ) {
var part = parts[i]; var part = parts[i];
if(outputs[| 0].visible) _val[0][i] = [part.x, part.y]; if(outputs[| 0].visible) _val[0][i] = [part.x, part.y];

View file

@ -79,8 +79,8 @@ function node_hdistribute(nodeList) {
var sp = (x1 - x0) / (amo - 1); var sp = (x1 - x0) / (amo - 1);
for( var i = 0; i < amo; i++ ) { for( var i = 0; i < amo; i++ ) {
var n = ds_priority_delete_min(nodes); var _node = ds_priority_delete_min(nodes);
n.x = x0 + sp * i - n.w / 2; _node.x = x0 + sp * i - _node.w / 2;
} }
ds_priority_destroy(nodes); ds_priority_destroy(nodes);
@ -103,8 +103,8 @@ function node_vdistribute(nodeList) {
var sp = (y1 - y0) / (amo - 1); var sp = (y1 - y0) / (amo - 1);
for( var i = 0; i < amo; i++ ) { for( var i = 0; i < amo; i++ ) {
var n = ds_priority_delete_min(nodes); var _node = ds_priority_delete_min(nodes);
n.y = y0 + sp * i - n.h / 2; _node.y = y0 + sp * i - _node.h / 2;
} }
ds_priority_destroy(nodes); ds_priority_destroy(nodes);

View file

@ -38,7 +38,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
var __x = _st[1]; var __x = _st[1];
var __w = _st[2]; var __w = _st[2];
for( var i = 0; i < array_length(bone.childs); i++ ) for( var i = 0, n = array_length(bone.childs); i < n; i++ )
ds_stack_push(_bst, [ bone.childs[i], __x + 16, __w - 16 ]); ds_stack_push(_bst, [ bone.childs[i], __x + 16, __w - 16 ]);
if(bone.is_main) continue; if(bone.is_main) continue;
@ -88,7 +88,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
var _par = bone_remove.parent; var _par = bone_remove.parent;
array_remove(_par.childs, bone_remove); array_remove(_par.childs, bone_remove);
for( var i = 0; i < array_length(bone_remove.childs); i++ ) { for( var i = 0, n = array_length(bone_remove.childs); i < n; i++ ) {
var _ch = bone_remove.childs[i]; var _ch = bone_remove.childs[i];
_par.addChild(_ch); _par.addChild(_ch);
@ -193,7 +193,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
builder_bone.length = point_distance( bn.x, bn.y, bo.x, bo.y); builder_bone.length = point_distance( bn.x, bn.y, bo.x, bo.y);
} else if(builder_type == 1) { } else if(builder_type == 1) {
var chs = []; var chs = [];
for( var i = 0; i < array_length(builder_bone.childs); i++ ) { for( var i = 0, n = array_length(builder_bone.childs); i < n; i++ ) {
var ch = builder_bone.childs[i]; var ch = builder_bone.childs[i];
chs[i] = ch.getPoint(1); chs[i] = ch.getPoint(1);
} }
@ -201,7 +201,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
builder_bone.angle = dir; builder_bone.angle = dir;
builder_bone.length = dis; builder_bone.length = dis;
for( var i = 0; i < array_length(builder_bone.childs); i++ ) { for( var i = 0, n = array_length(builder_bone.childs); i < n; i++ ) {
var ch = builder_bone.childs[i]; var ch = builder_bone.childs[i];
var c0 = ch.getPoint(0); var c0 = ch.getPoint(0);
@ -357,7 +357,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
while(!ds_stack_empty(_bst)) { while(!ds_stack_empty(_bst)) {
var __b = ds_stack_pop(_bst); var __b = ds_stack_pop(_bst);
for( var i = 0; i < array_length(__b.childs); i++ ) for( var i = 0, n = array_length(__b.childs); i < n; i++ )
ds_stack_push(_bst, __b.childs[i]); ds_stack_push(_bst, __b.childs[i]);
__b.distance *= _ss; __b.distance *= _ss;
@ -406,7 +406,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
var _md = new __Bone(noone, 0, 0, _pr.angle, _pr.length / 2, self); var _md = new __Bone(noone, 0, 0, _pr.angle, _pr.length / 2, self);
_pr.length = _md.length; _pr.length = _md.length;
for( var i = 0; i < array_length(_pr.childs); i++ ) for( var i = 0, n = array_length(_pr.childs); i < n; i++ )
_md.addChild(_pr.childs[i]); _md.addChild(_pr.childs[i]);
_pr.childs = []; _pr.childs = [];
@ -432,7 +432,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
array_remove(_par.childs, _bone); array_remove(_par.childs, _bone);
for( var i = 0; i < array_length(_bone.childs); i++ ) { for( var i = 0, n = array_length(_bone.childs); i < n; i++ ) {
var _ch = _bone.childs[i]; var _ch = _bone.childs[i];
_par.addChild(_ch); _par.addChild(_ch);
@ -523,7 +523,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
while(!ds_stack_empty(_bst)) { while(!ds_stack_empty(_bst)) {
var __b = ds_stack_pop(_bst); var __b = ds_stack_pop(_bst);
for( var i = 0; i < array_length(__b.childs); i++ ) { for( var i = 0, n = array_length(__b.childs); i < n; i++ ) {
var p0 = __b.childs[i].getPoint(0); var p0 = __b.childs[i].getPoint(0);
var p1 = __b.childs[i].getPoint(1); var p1 = __b.childs[i].getPoint(1);

View file

@ -109,7 +109,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
var __x = _st[1]; var __x = _st[1];
var __w = _st[2]; var __w = _st[2];
for( var i = 0; i < array_length(_bone.childs); i++ ) for( var i = 0, n = array_length(_bone.childs); i < n; i++ )
ds_stack_push(_bst, [ _bone.childs[i], __x + 16, __w - 16 ]); ds_stack_push(_bst, [ _bone.childs[i], __x + 16, __w - 16 ]);
if(_bone.is_main) continue; if(_bone.is_main) continue;
@ -130,7 +130,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
var _sx = __x + 24 + string_width(_bone.name) + 8; var _sx = __x + 24 + string_width(_bone.name) + 8;
var _sy = ty + 4; var _sy = ty + 4;
for( var i = 0; i < array_length(_sdata); i++ ) { for( var i = 0, n = array_length(_sdata); i < n; i++ ) {
var _sid = _sdata[i][0]; var _sid = _sdata[i][0];
var _surf = _sdata[i][1]; var _surf = _sdata[i][1];
var _sw = surface_get_width(_surf); var _sw = surface_get_width(_surf);
@ -461,7 +461,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
while(!ds_stack_empty(_bst)) { while(!ds_stack_empty(_bst)) {
var _bone = ds_stack_pop(_bst); var _bone = ds_stack_pop(_bst);
for( var i = 0; i < array_length(_bone.childs); i++ ) { for( var i = 0, n = array_length(_bone.childs); i < n; i++ ) {
var child_bone = _bone.childs[i]; var child_bone = _bone.childs[i];
boneMap[? child_bone.ID] = child_bone; boneMap[? child_bone.ID] = child_bone;
ds_stack_push(_bst, child_bone); ds_stack_push(_bst, child_bone);

View file

@ -59,7 +59,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
while(!ds_stack_empty(_bst)) { while(!ds_stack_empty(_bst)) {
var __b = ds_stack_pop(_bst); var __b = ds_stack_pop(_bst);
for( var i = 0; i < array_length(__b.childs); i++ ) { for( var i = 0, n = array_length(__b.childs); i < n; i++ ) {
array_push(_bones, __b.childs[i]); array_push(_bones, __b.childs[i]);
ds_stack_push(_bst, __b.childs[i]); ds_stack_push(_bst, __b.childs[i]);
} }
@ -76,7 +76,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
input_display_list[1] input_display_list[1]
]; ];
for( var i = 0; i < array_length(_bones); i++ ) { for( var i = 0, n = array_length(_bones); i < n; i++ ) {
var bone = _bones[i]; var bone = _bones[i];
var _idx = ds_list_size(_inputs); var _idx = ds_list_size(_inputs);
array_push(_input_display_list, _idx); array_push(_input_display_list, _idx);
@ -264,7 +264,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
bone.pose_scale = _trn[TRANSFORM.sca_x]; bone.pose_scale = _trn[TRANSFORM.sca_x];
} }
for( var i = 0; i < array_length(bone.childs); i++ ) for( var i = 0, n = array_length(bone.childs); i < n; i++ )
ds_stack_push(_bst, bone.childs[i]); ds_stack_push(_bst, bone.childs[i]);
} }
@ -287,7 +287,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
while(!ds_stack_empty(_bst)) { while(!ds_stack_empty(_bst)) {
var __b = ds_stack_pop(_bst); var __b = ds_stack_pop(_bst);
for( var i = 0; i < array_length(__b.childs); i++ ) { for( var i = 0, n = array_length(__b.childs); i < n; i++ ) {
var p0 = __b.childs[i].getPoint(0); var p0 = __b.childs[i].getPoint(0);
var p1 = __b.childs[i].getPoint(1); var p1 = __b.childs[i].getPoint(1);

View file

@ -100,7 +100,7 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const
current_length += point_distance(_p0.x, _p0.y, _p1.x, _p1.y); current_length += point_distance(_p0.x, _p0.y, _p1.x, _p1.y);
} }
for( var i = 0; i < array_length(bone.childs); i++ ) { for( var i = 0, n = array_length(bone.childs); i < n; i++ ) {
var child_bone = bone.childs[i]; var child_bone = bone.childs[i];
ds_stack_push(_bst, child_bone); ds_stack_push(_bst, child_bone);
} }

View file

@ -64,7 +64,7 @@ function Node_Array_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var res = is_array(index)? array_create(array_length(index)) : 0; var res = is_array(index)? array_create(array_length(index)) : 0;
if(is_array(index)) { if(is_array(index)) {
for( var i = 0; i < array_length(index); i++ ) for( var i = 0, n = array_length(index); i < n; i++ )
res[i] = getArray(_arr, index[i], _ovf); res[i] = getArray(_arr, index[i], _ovf);
} else } else
res = getArray(_arr, index, _ovf); res = getArray(_arr, index, _ovf);

View file

@ -43,7 +43,7 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var arr = array_clone(_arr); var arr = array_clone(_arr);
if(is_array(index)) { if(is_array(index)) {
if(!is_array(value)) value = [ value ]; if(!is_array(value)) value = [ value ];
for( var i = 0; i < array_length(index); i++ ) { for( var i = 0, n = array_length(index); i < n; i++ ) {
if(index[i] < 0) index[i] = array_length(arr) - 1 + index[i]; if(index[i] < 0) index[i] = array_length(arr) - 1 + index[i];
array_insert(arr, index[i], array_safe_get(value, i,, ARRAY_OVERFLOW.loop)); array_insert(arr, index[i], array_safe_get(value, i,, ARRAY_OVERFLOW.loop));
} }
@ -51,7 +51,7 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(index < 0) index = array_length(arr) + index; if(index < 0) index = array_length(arr) + index;
if(is_array(value) && spred) { if(is_array(value) && spred) {
for( var i = 0; i < array_length(value); i++ ) for( var i = 0, n = array_length(value); i < n; i++ )
array_insert(arr, index + i, value[i]); array_insert(arr, index + i, value[i]);
} else { } else {
array_insert(arr, index, value); array_insert(arr, index, value);

View file

@ -58,14 +58,14 @@ function Node_Array_Remove(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(!is_array(index)) index = [ index ]; if(!is_array(index)) index = [ index ];
array_sort(index, false); array_sort(index, false);
for( var i = 0; i < array_length(index); i++ ) { for( var i = 0, n = array_length(index); i < n; i++ ) {
if(index[i] < 0) index[i] = array_length(arr) + index[i]; if(index[i] < 0) index[i] = array_length(arr) + index[i];
array_delete(arr, index[i], 1); array_delete(arr, index[i], 1);
} }
} else { } else {
if(!spred || !is_array(value)) value = [ value ]; if(!spred || !is_array(value)) value = [ value ];
for( var i = 0; i < array_length(value); i++ ) for( var i = 0, n = array_length(value); i < n; i++ )
array_remove(arr, value[i]); array_remove(arr, value[i]);
} }

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