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":"compose","order":14,"path":"folders/nodes/data/compose.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":"colors","order":4,"path":"folders/nodes/data/filter/colors.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":"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":"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":"blur","folderPath":"folders/nodes/data/filter/blur.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_execute": "Execute 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_upload": "Upload to Steam Workshop",
"panel_inspector_workshop_update": "Update Steam Workshop",

View file

@ -27,7 +27,7 @@ event_inherited();
if(_openDialog) {
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 pane = panels[$ _key];
@ -41,7 +41,7 @@ event_inherited();
context_menus = meta.context_menu_callbacks;
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 _fnk = context_menus[$ arr[i]];
var _generator = new addonContextGenerator(self, _fnk);

View file

@ -6,7 +6,7 @@ array_remove(ANIMATION_PRE, animationPreStep);
array_remove(ANIMATION_POST, animationPostStep);
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], []);
for( var j = array_length(_call) - 1; j >= 0; j-- ) {

View file

@ -162,7 +162,7 @@
function checkMouse() {
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;
var x0 = dialog_x - dialog_resizable * 6;

View file

@ -2,7 +2,7 @@
#region draw
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]))
key += key == ""? extra_keys[i][1] : (" + " + extra_keys[i][1]);
}
@ -39,7 +39,7 @@
var mlx = WIN_W - array_length(mouse_left);
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;
ny = WIN_H - 4 - mouse_left[i] * 24;

View file

@ -36,7 +36,7 @@ event_inherited();
draw_set_color(COLORS._main_text_sub);
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);
draw_set_font(f_p2);
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);
switch(i) {
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];
Node_create_Image_path(nx, ny, path);
ny += 160;

View file

@ -75,7 +75,7 @@ event_inherited();
var ar = call_in? io.outputs : io.inputs;
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;
var _in = call_in? node_called.type : ar[i].type;
@ -89,7 +89,7 @@ event_inherited();
var to = junction_hovering.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 _ot = io.inputs[i].type;
if(!io.inputs[i].visible) continue;
@ -97,7 +97,7 @@ event_inherited();
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 _ot = to;
@ -303,13 +303,13 @@ event_inherited();
var sug = ds_map_try_get(global.VALUE_SUGGESTION, node_called.type, []);
if(array_length(sug)) {
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, "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];
if(!ds_map_exists(ALL_NODES, _nodeIndex)) continue;
@ -317,7 +317,7 @@ event_inherited();
}
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];
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 key = ds_map_find_first(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);
if(!n || !n.active) continue;
if(!_node || !_node.active) continue;
for(var i = 0; i < ds_list_size(n.inputs); i++) {
var in = n.inputs[| i];
for(var i = 0; i < ds_list_size(_node.inputs); i++) {
var in = _node.inputs[| i];
if(!in.is_anim) continue;
for(var j = 0; j < ds_list_size(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);
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 c = i % col;

View file

@ -85,8 +85,15 @@ event_inherited();
if(isHover)
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);
draw_text(ui(16), yy + ui(8), preset_name[| i]);
var x0 = ui(16) + (i == 0) * ui(8 + 6);
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)
drawPaletteGrid(presets[| i], ui(16), yy + ui(28), ww, _gs, selector.current_color);
else

View file

@ -198,8 +198,15 @@ event_inherited();
if(isHover)
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);
draw_text(ui(16), yy + ui(8), filename_name_only(palette_name[| i]));
var x0 = ui(16) + (i == 0) * ui(8 + 6);
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)
drawPaletteGrid(palettes[| i], ui(16), yy + ui(28), ww, _gs);
else

View file

@ -33,7 +33,7 @@ event_inherited();
var inpt = 0;
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];
if(is_array(disp)) {
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 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]);
target.inputs[| 0].setValue(arr);

View file

@ -57,7 +57,7 @@ event_inherited();
var _h = 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];
if(is_string(_f)) {
if(i) {

View file

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

View file

@ -332,7 +332,7 @@ event_inherited();
var cx = x1 - cw - ui(8);
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 val = variable_struct_get(COLORS, key);

View file

@ -32,7 +32,7 @@ if(node_target == noone) {
var ind = 0;
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 sw = surface_get_width(s);
var sh = surface_get_height(s);

View file

@ -42,7 +42,7 @@ event_inherited();
}
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];
if(val == -1) continue;
@ -57,7 +57,7 @@ event_inherited();
var hght = line_get_height(f_p0, 8);
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;
dialog_h = min(max_h, hh);

View file

@ -401,7 +401,7 @@ event_inherited();
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 _att = _sub.attachments;

View file

@ -85,7 +85,7 @@ if !ready exit;
var tab_cover = noone;
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);
var txt = pages[i];
var dtxt = __txt(txt);

View file

@ -8,7 +8,7 @@ if(async_load[? "id"] == contest_req) { //get contests
if(struct_has(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];
if(thr.parent_id != "1113080578351312906") continue; //not in contest channel
@ -29,7 +29,7 @@ if(async_load[? "id"] == contest_req) { //get contests
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;
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);
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]];
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);
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]];
if(!is_array(att)) continue;

View file

@ -75,7 +75,7 @@
slp[array_length(slp) - 1] = rep;
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) {
for( var j = 0; j < array_length(slp); j++ )
txt += slp[j];

View file

@ -9,7 +9,7 @@ if(textbox == noone) exit;
var _w = 300;
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 __w = ui(40 + 32);

View file

@ -42,7 +42,7 @@ event_inherited();
function searchNodes() {
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 key = node.inputs[| 0].getValue(0);
@ -63,7 +63,7 @@ event_inherited();
var arr = search_string == ""? tunnel_ins : search_res;
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];
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");
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);
n.inputs[| 0].setValue(key);
var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y);
_node.inputs[| 0].setValue(key);
instance_destroy();
}

View file

@ -110,12 +110,12 @@
ANIMATION_POST = [];
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]();
}
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]();
}
#endregion
@ -146,7 +146,7 @@
if(array_length(path) == 1 && directory_exists(path[0]))
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 ext = string_lower(filename_ext(p));
@ -168,7 +168,7 @@
PANEL_GRAPH.onStepBegin();
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 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;
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)
nodeTarget[i].asyncPackets(async_load);
}

View file

@ -3,20 +3,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
//print("===== Step start =====");
if(PROJECT.active) {
#region animation
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
PROJECT.animator.step();
#region step
PROJECT.globalNode.step();

View file

@ -1,5 +1,4 @@
/// @description init
//print(PROJECT.path);
global.cache_call = 0;
global.cache_hit = 0;
@ -199,4 +198,4 @@ _HOVERING_ELEMENT = noone;
MOUSE_WRAP = false;
#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;
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(global.lua_functions[i][1] == noone) continue;
LUA_API[? global.lua_functions[i][0]] = global.lua_functions[i][1];

View file

@ -4,7 +4,7 @@ function VCT(node) constructor {
vars = [];
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);
}
@ -19,7 +19,7 @@ function VCT(node) constructor {
var s = {};
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();
doSerialize(s);

View file

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

View file

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

View file

@ -47,7 +47,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
static childCount = function() {
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();
return amo;
}
@ -60,7 +60,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
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();
}
@ -68,7 +68,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
if(ID == _id)
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);
if(b != noone)
return b;
@ -82,7 +82,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
if(string_trim(name) == string_trim(_name))
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);
if(b != noone)
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; 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++ ) {
for( var i = 0, n = array_length(childs); i < n; i++ ) {
var h = childs[i]._drawBone(attributes, edit, _x, _y, _s, _mx, _my, hovering, selecting);
if(hover == noone && h != noone)
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);
}
@ -247,7 +241,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
pose_scale = 1;
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();
}
@ -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) {
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);
return;
}
@ -281,7 +275,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
angle += pose_angle;
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)
childs[i].setPoseTransform(_position, pose_angle, pose_scale);
else
@ -326,7 +320,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
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();
}
@ -334,7 +328,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
static FABRIK = function(bones, points, lengths, dx, dy) {
var threshold = 0.1;
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 };
var sx = points[0].x;
var sy = points[0].y;
@ -346,7 +340,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
var delta = 0;
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 };
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;
} 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 p0 = points[i];
var p1 = points[i + 1];
@ -394,7 +388,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
var tx = sx;
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 p1 = points[i + 1];
var len = lengths[i];
@ -427,7 +421,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
var _bbox = __getBBOX();
//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();
//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.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();
return bone;
@ -480,7 +474,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
IKTarget = bone.IKTarget;
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);
addChild(_b);
}
@ -494,7 +488,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
else if(is_string(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();
}
@ -507,7 +501,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length =
_b.IKlength = IKlength;
_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());
return _b;

View file

@ -57,6 +57,6 @@ function loadAddon() {
if(!file_exists(_path)) return;
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);
}

View file

@ -20,7 +20,7 @@ function Mesh() constructor {
}
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];
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) {
for( var i = 0; i < array_length(triangles); i++ ) {
for( var i = 0, n = array_length(triangles); i < n; 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))
@ -46,7 +46,7 @@ function Mesh() constructor {
var segments = [];
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];
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 s1 = string(segments[i][1]);
@ -85,7 +85,7 @@ function Mesh() constructor {
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 next_point = array_pop(pointsPairs[? string(end_point) ]);
@ -100,7 +100,7 @@ function Mesh() constructor {
static clone = function() {
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] = [
triangles[i][0].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();
for( var i = 0; i < ds_list_size(node_list); i++ ) {
var n = node_list[| i];
if(variable_struct_exists(n, "initLoop"))
n.initLoop();
var _node = node_list[| i];
if(variable_struct_exists(_node, "initLoop"))
_node.initLoop();
}
doInitLoop();
@ -79,6 +79,9 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
var maxIter = getIterationCount();
iterated++;
for( var i = 0; i < ds_list_size(nodes); i++ )
nodes[| i].clearInputCache();
if(iterated == maxIter) {
LOG_LINE_IF(global.FLAG.render, $"------------------< Iteration update: {iterated} / {maxIter} [COMPLETE] >------------------");
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 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];
minx = min(minx, s.x);
@ -46,7 +46,7 @@ function PathSegment() : Path() constructor {
lengthTotal = 0;
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];
if(i) {

View file

@ -94,7 +94,7 @@ function polygon_triangulate(points, tolerance = 4) {
if(array_length(reflected) == 0)
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;
var triangles = [];

View file

@ -134,7 +134,7 @@
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]);
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() {
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];
if(i) {
@ -213,7 +213,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
var aa = 0;
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];
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);
//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;
// 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);
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;
ny = points[i].y;
@ -261,7 +261,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
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;
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) {
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];
if(i) {
@ -290,7 +290,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
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].py = points[i].y;
}
@ -359,7 +359,7 @@ function Strand(sx = 0, sy = 0, amount = 5, length = 8, direct = 0, curlFreq = 4
set();
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.restAngle = array_clone(restAngle);
s.length = array_clone(length);
@ -389,22 +389,22 @@ function StrandMesh() constructor {
mesh = noone;
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);
}
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);
}
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();
}
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);
}
@ -426,7 +426,7 @@ function StrandMesh() constructor {
}
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();
return self;
@ -437,7 +437,7 @@ function StrandMesh() constructor {
s.loop = loop;
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();
return s;
@ -445,7 +445,7 @@ function StrandMesh() constructor {
static serialize = function() {
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();
return json_stringify(_h);
}
@ -453,7 +453,7 @@ function StrandMesh() constructor {
static deserialize = function(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]);
return self;
}

View file

@ -98,6 +98,13 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
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_display_list = [ 32,
@ -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,
["Movement", true], 29, 6, 18,
["Physics", true], 7, 19, 33, 20, 34, 35, 36,
["Ground", true], 37, 38, 39,
["Rotation", true], 15, 8, 9,
["Scale", true], 10, 17, 11,
["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_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;
var _posDist = [];
@ -268,6 +280,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
if(_turnBi) _trn *= choose(-1, 1);
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.setDraw(_color, _bld, _alp, _fade);
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 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) {
static inspectorStep = function() {
var _inSurf = inputs[| 0].getValue();
var _dist = inputs[| 4].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);
}
}
}
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();
var _spawn_type = inputs[| 16].getValue();
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 onPartStep = 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 ]; \
\
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]; \
\
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 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];
if(_item == -1)
array_push(arr, -1);

View file

@ -10,7 +10,7 @@
#region API
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];
if(is_string(_func))
@ -864,7 +864,7 @@
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;
var pane = _addon.panels[$ arr[i]];
@ -1040,7 +1040,7 @@ end",
];
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];
if(is_string(_func))

View file

@ -5,6 +5,8 @@
loop,
stop
}
#macro ANIMATION_STATIC !(PROJECT.animator.is_playing || PROJECT.animator.frame_progress)
#endregion
#region animation class
@ -61,35 +63,57 @@
}
static render = function() {
setFrame(-1);
setFrame(0);
is_playing = true;
rendering = true;
frame_progress = true;
time_since_last_frame = 0;
}
static toggle = function() {
is_playing = !is_playing;
frame_progress = true;
time_since_last_frame = 0;
}
static pause = function() {
is_playing = false;
frame_progress = true;
time_since_last_frame = 0;
}
static play = function() {
setFrame(0);
is_playing = true;
frame_progress = true;
time_since_last_frame = 0;
}
static resume = function() {
is_playing = true;
frame_progress = true;
time_since_last_frame = 0;
}
static stop = function() {
is_playing = false;
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

View file

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

View file

@ -74,21 +74,26 @@ function array_get_decimal(arr, index, color = false) {
}
function array_exists(arr, val) {
for( var i = 0; i < array_length(arr); i++ ) {
if(isEqual(arr[i], val)) return true;
}
return false;
gml_pragma("forceinline");
self.__temp_val = val;
return array_any(arr, function(_val, _ind) {
return isEqual(_val, self.__temp_val);
});
}
function array_empty(arr) {
gml_pragma("forceinline");
return array_length(arr) == 0;
}
function array_find(arr, val) {
for( var i = 0; i < array_length(arr); i++ ) {
if(isEqual(arr[i], val)) return i;
}
return -1;
gml_pragma("forceinline");
self.__temp_val = val;
return array_find_index(arr, function(_val, _ind) {
return isEqual(_val, self.__temp_val);
});
}
function array_remove(arr, val) {
@ -109,23 +114,11 @@ function array_insert_unique(arr, ind, val) {
}
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]);
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() {
var arr = [];
for( var i = 0; i < argument_count; i++ ) {
@ -140,7 +133,7 @@ function array_clone(arr) {
return arr;
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]);
return _res;
}
@ -149,7 +142,7 @@ function array_min(arr) {
if(array_length(arr) == 0) return 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]);
return mn;
}
@ -158,7 +151,7 @@ function array_max(arr) {
if(array_length(arr) == 0) return 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]);
return mx;
}
@ -188,7 +181,7 @@ function array_spread(arr, _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);
return _arr;

View file

@ -338,7 +338,7 @@ function read_format(bin, format, 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))
continue;
var pos = file_bin_position(bin);

View file

@ -47,7 +47,7 @@
var s = global.ASSET_CACHE[? key];
var valid = true;
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]);
} else
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]);
if(_selecting == i) {
draw_sprite_stretched(spr, 2, bx, _y, ww, _h);
draw_sprite_stretched_ext(spr, 3, bx, _y, ww, _h, COLORS._main_accent, 1);
draw_sprite_stretched(spr, 2, bx, _y, ww - !!i, _h);
draw_sprite_stretched_ext(spr, 3, bx, _y, ww - !!i, _h, COLORS._main_accent, 1);
} else {
buttons[i].draw(bx, _y, ww, _h, _m, spr);
if(buttons[i].clicked) onClick(i);

View file

@ -86,9 +86,11 @@ function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) {
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]) {
if(c_color != _pal[i]) continue;
var _x0 = _x + safe_mod(i, col) * _gs;
var _y0 = _y + floor(i / col) * _gs;
@ -96,5 +98,3 @@ function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) {
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);
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 str = variable_struct_get(clrs.colors, key);
@ -52,7 +52,7 @@ function _loadColor(theme = "default", replace = false) {
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 c = c_white;
@ -75,7 +75,7 @@ function _loadColor(theme = "default", replace = false) {
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];
if(variable_struct_exists(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);
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 def = variable_struct_get(clrs.array, key);

View file

@ -7,7 +7,7 @@
if(menu_id != "" && ds_map_exists(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());
}

View file

@ -42,12 +42,12 @@ function controlPointBox(_onModify) : widget() constructor {
static setInteract = function(interactable = noone) {
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);
}
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);
}
@ -55,7 +55,7 @@ function controlPointBox(_onModify) : widget() constructor {
x = _x;
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);
var yy = _y;

View file

@ -12,7 +12,7 @@
#endregion
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") {
@ -63,7 +63,7 @@ function exception_print(e) {
var str = "\n\n========== Crash log ==========\n\n" + e.longMessage;
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 += "\n\n========= Crash log end =========\n";
@ -80,7 +80,7 @@ function setException() {
tt += "\n" + ex.longMessage;
tt += "\n" + ex.script;
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 += "\n---------------------------- :( ----------------------------\n";

View file

@ -11,7 +11,7 @@ function dialogCall(_dia, _x = noone, _y = noone, param = {}, create = false) {
dia.resetPosition();
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]));
setFocus(dia.id, "Dialog");

View file

@ -2,6 +2,13 @@ function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample =
var dir0 = point_direction(x1, y1, 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 x2 = p2[0];
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);
draw_set_color(col);
draw_primitive_begin(pr_trianglestrip);
var ox, oy, nx, ny;
var st = 1 / round(sample);
for( var i = 0; i <= 1; i += st ) {
var a = d0 + angle_difference(d1, d0) * i;
nx = px + lengthdir_x(r, a);
ny = py + lengthdir_y(r, a);
var aa = angle_difference(d1, d0);
sample = round(sample);
if(i > 0) draw_line_round(ox, oy, nx, ny, thick, i == st, i == 1, sample);
for( var i = 0; i <= sample; i++ ) {
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;
ox = nx;
oy = ny;
draw_vertex(nx, ny);
draw_vertex(ox, oy);
}
draw_primitive_end();
}

View file

@ -1,5 +1,6 @@
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
var dx = xe - xs;
@ -19,10 +20,13 @@ function draw_line_width_vertex(xs, ys, xe, ye, thick, c0, c1) {
var y3 = ye - py;
// Draw vertices
draw_vertex_color(x0, y0, c0, 1);
draw_vertex_color(x1, y1, c0, 1);
draw_vertex_color(x2, y2, c1, 1);
draw_vertex_color(x3, y3, c1, 1);
vertex_add_2pc(vb, x0, y0, c0);
vertex_add_2pc(vb, x1, y1, c0);
vertex_add_2pc(vb, x2, y2, c1);
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;
}
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;
switch(ha) {

View file

@ -1,6 +1,6 @@
function ds_list_create_from_array(array) {
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];
}
return l;

View file

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

View file

@ -94,7 +94,7 @@ function Action(_type, _object, _data) constructor {
groupNodes(data.content, obj, false);
break;
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]);
break;
}
@ -156,7 +156,7 @@ function Action(_type, _object, _data) constructor {
upgroupNode(obj, false);
break;
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();
break;
}

View file

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

View file

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

View file

@ -22,7 +22,7 @@ function gradientObject(color = c_black) constructor {
static clone = function() {
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.type = type;
@ -153,7 +153,7 @@ function gradientObject(color = c_black) constructor {
g.keys = [];
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();
return g;
@ -162,7 +162,7 @@ function gradientObject(color = c_black) constructor {
static serialize = function() {
var s = {type};
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();
return json_stringify(s, false);
@ -177,7 +177,7 @@ function gradientObject(color = c_black) constructor {
s = str;
else if(is_array(str)) {
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);
return self;
@ -185,7 +185,7 @@ function gradientObject(color = c_black) constructor {
type = s.type;
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);
return self;

View file

@ -62,7 +62,7 @@ function histogramUpdate(surface) {
var sth = max(1, sh / attributes.preview_sample);
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;
}

View file

@ -22,23 +22,26 @@ function TEST_PATH(path) {
}
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;
var _PROJECT = PROJECT;
PROJECT = new Project();
if(PANEL_GRAPH.project.path == "" && !PANEL_GRAPH.project.modified) {
var ind = array_find(PROJECTS, PANEL_GRAPH.project);
PROJECTS[ind] = PROJECT;
PANEL_GRAPH.setProject(PROJECT);
} else {
var graph = new Panel_Graph(PROJECT);
PANEL_GRAPH.panel.setContent(graph, true);
PANEL_GRAPH = graph;
array_push(PROJECTS, PROJECT);
}
var res = __LOAD_PATH(path, readonly, safe_mode);
if(!res) return false;
array_push(PROJECTS, PROJECT);
PANEL_ANIMATION.updatePropertyList();
setFocus(PANEL_GRAPH.panel);
@ -93,7 +96,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false
log_warning("LOAD", warn);
}
} 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);
}
@ -220,6 +223,13 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false
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();
LOADING = false;

View file

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

View file

@ -3,7 +3,7 @@ var reserved = ["and", "break", "do", "else", "elseif", "end", "false",
"for", "function", "if", "in", "local", "nil", "not",
"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;
function token_splice(str) {
@ -15,7 +15,7 @@ function token_splice(str) {
do {
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);
if(_pos != 0) sp = min(sp, _pos);
}

View file

@ -129,7 +129,7 @@ function MetaDataManager() constructor {
var tx = 0;
var hh = line_get_height(f_p0, ui(4));
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);
if(tx + ww + ui(2) > _w - ui(16)) {
tx = 0;
@ -190,7 +190,7 @@ function MetaDataManager() constructor {
var tx = 0;
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);
if(tx + ww + ui(2) > _w - ui(16)) {
tx = 0;

View file

@ -103,7 +103,7 @@ function Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) construc
inputs = _l;
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];
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);
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 _outSurf = outputs[| ind].getValue();
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);
for( var i = 0; i < array_length(vertexObjects); i++ )
for( var i = 0, n = array_length(vertexObjects); i < n; i++ )
vertexObjects[i].submit();
_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) {
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 = [];
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);
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);
_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();
_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");
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");
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();
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;
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);
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 _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);
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 = [];

View file

@ -79,7 +79,7 @@ function Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
static generate_vb = function() {
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 = [];

View file

@ -87,7 +87,7 @@ function Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
static generate_vb = function() {
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 = [];

View file

@ -78,7 +78,7 @@ function Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
static generate_vb = function() {
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 = [];

View file

@ -205,7 +205,7 @@
// 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 _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();
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 _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);
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);
} else
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 _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]);
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 _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));
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[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++ ) {
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 _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];
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;
} else {
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;
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++ )
_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];
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);
for( var i = 0; i < amo; i++ ) {
var n = ds_priority_delete_min(nodes);
n.x = x0 + sp * i - n.w / 2;
var _node = ds_priority_delete_min(nodes);
_node.x = x0 + sp * i - _node.w / 2;
}
ds_priority_destroy(nodes);
@ -103,8 +103,8 @@ function node_vdistribute(nodeList) {
var sp = (y1 - y0) / (amo - 1);
for( var i = 0; i < amo; i++ ) {
var n = ds_priority_delete_min(nodes);
n.y = y0 + sp * i - n.h / 2;
var _node = ds_priority_delete_min(nodes);
_node.y = y0 + sp * i - _node.h / 2;
}
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 __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 ]);
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;
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];
_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);
} else if(builder_type == 1) {
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];
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.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 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)) {
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]);
__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);
_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]);
_pr.childs = [];
@ -432,7 +432,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
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];
_par.addChild(_ch);
@ -523,7 +523,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
while(!ds_stack_empty(_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 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 __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 ]);
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 _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 _surf = _sdata[i][1];
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)) {
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];
boneMap[? child_bone.ID] = 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)) {
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]);
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]
];
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 _idx = ds_list_size(_inputs);
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];
}
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]);
}
@ -287,7 +287,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
while(!ds_stack_empty(_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 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);
}
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];
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;
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);
} else
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);
if(is_array(index)) {
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];
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(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]);
} else {
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 ];
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];
array_delete(arr, index[i], 1);
}
} else {
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]);
}

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