PCX array fixes

This commit is contained in:
Tanasart 2023-11-17 12:24:31 +07:00
parent 97c2915406
commit e187bc7184
21 changed files with 166 additions and 87 deletions

View file

@ -1383,6 +1383,7 @@
{"name":"__node_3d_prim_cylinder","order":2,"path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",}, {"name":"__node_3d_prim_cylinder","order":2,"path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",},
{"name":"s_discord","order":7,"path":"sprites/s_discord/s_discord.yy",}, {"name":"s_discord","order":7,"path":"sprites/s_discord/s_discord.yy",},
{"name":"Obj_FirebaseFirestore_Collection_Query_options","order":10,"path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",}, {"name":"Obj_FirebaseFirestore_Collection_Query_options","order":10,"path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",},
{"name":"stack_functions","order":7,"path":"scripts/stack_functions/stack_functions.yy",},
{"name":"panel_nodes","order":2,"path":"scripts/panel_nodes/panel_nodes.yy",}, {"name":"panel_nodes","order":2,"path":"scripts/panel_nodes/panel_nodes.yy",},
{"name":"sh_gradient_points","order":19,"path":"shaders/sh_gradient_points/sh_gradient_points.yy",}, {"name":"sh_gradient_points","order":19,"path":"shaders/sh_gradient_points/sh_gradient_points.yy",},
{"name":"node_array_composite","order":17,"path":"scripts/node_array_composite/node_array_composite.yy",}, {"name":"node_array_composite","order":17,"path":"scripts/node_array_composite/node_array_composite.yy",},

View file

@ -766,6 +766,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"README.txt","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"README.txt","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Welcome files.zip","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
@ -800,7 +801,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Steamworks_Extension_Documentation.html","CopyToMask":0,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Steamworks_Extension_Documentation.html","CopyToMask":0,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ucrtbased.dll","ConfigValues":{},"CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ucrtbased.dll","ConfigValues":{},"CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"webpmux.exe","CopyToMask":-1,"filePath":"datafiles/webp",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"webpmux.exe","CopyToMask":-1,"filePath":"datafiles/webp",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Welcome files.zip","CopyToMask":-1,"filePath":"datafiles",},
], ],
"isEcma": false, "isEcma": false,
"LibraryEmitters": [], "LibraryEmitters": [],
@ -2108,6 +2108,7 @@
{"id":{"name":"__node_3d_prim_cylinder","path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",},}, {"id":{"name":"__node_3d_prim_cylinder","path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",},},
{"id":{"name":"s_discord","path":"sprites/s_discord/s_discord.yy",},}, {"id":{"name":"s_discord","path":"sprites/s_discord/s_discord.yy",},},
{"id":{"name":"Obj_FirebaseFirestore_Collection_Query_options","path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",},}, {"id":{"name":"Obj_FirebaseFirestore_Collection_Query_options","path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",},},
{"id":{"name":"stack_functions","path":"scripts/stack_functions/stack_functions.yy",},},
{"id":{"name":"panel_nodes","path":"scripts/panel_nodes/panel_nodes.yy",},}, {"id":{"name":"panel_nodes","path":"scripts/panel_nodes/panel_nodes.yy",},},
{"id":{"name":"sh_gradient_points","path":"shaders/sh_gradient_points/sh_gradient_points.yy",},}, {"id":{"name":"sh_gradient_points","path":"shaders/sh_gradient_points/sh_gradient_points.yy",},},
{"id":{"name":"node_array_composite","path":"scripts/node_array_composite/node_array_composite.yy",},}, {"id":{"name":"node_array_composite","path":"scripts/node_array_composite/node_array_composite.yy",},},

Binary file not shown.

View file

@ -46,7 +46,7 @@ event_inherited();
var name = __txt(cat.name); var name = __txt(cat.name);
maxLen = max(maxLen, string_width(name)); maxLen = max(maxLen, string_width(name));
} }
category_width = maxLen + ui(48); category_width = maxLen + ui(56);
#endregion #endregion
function rightClick(node) { #region function rightClick(node) { #region

View file

@ -93,7 +93,7 @@ event_inherited();
} }
if(clickable) { if(clickable) {
if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly + 1, _dw, _ly + hght - 1)) { if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1)) {
selecting = i; selecting = i;
hovering = data[i]; hovering = data[i];

View file

@ -1,4 +1,4 @@
function array_create_from_list(list) { function array_create_from_list(list) { #region
if(list == undefined) return []; if(list == undefined) return [];
if(!ds_exists(list, ds_type_list)) return []; if(!ds_exists(list, ds_type_list)) return [];
@ -6,9 +6,9 @@ function array_create_from_list(list) {
for( var i = 0; i < ds_list_size(list); i++ ) for( var i = 0; i < ds_list_size(list); i++ )
arr[i] = list[| i]; arr[i] = list[| i];
return arr; return arr;
} } #endregion
function array_safe_set(arr, index, value, fill = 0) { function array_safe_set(arr, index, value, fill = 0) { #region
if(!is_array(arr)) return arr; if(!is_array(arr)) return arr;
if(is_array(index)) return arr; if(is_array(index)) return arr;
@ -23,9 +23,16 @@ function array_safe_set(arr, index, value, fill = 0) {
array_set(arr, index, value); array_set(arr, index, value);
return arr; return arr;
} } #endregion
function array_resize_fill(arr, size, fill = 0) { function array_fill(arr, startIndex, endIndex, value = 0) { #region
INLINE
for( var i = startIndex; i < endIndex; i++ )
arr[i] = value;
} #endregion
function array_resize_fill(arr, size, fill = 0) { #region
if(size < array_length(arr)) { if(size < array_length(arr)) {
array_resize(arr, size); array_resize(arr, size);
return arr; return arr;
@ -35,14 +42,14 @@ function array_resize_fill(arr, size, fill = 0) {
for(; i < size; i++) for(; i < size; i++)
arr[i] = fill; arr[i] = fill;
return arr; return arr;
} } #endregion
enum ARRAY_OVERFLOW { enum ARRAY_OVERFLOW {
_default, _default,
loop loop
} }
function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) { function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) { #region
INLINE INLINE
if(!is_array(arr)) return def; if(!is_array(arr)) return def;
if(is_array(index)) return def; if(is_array(index)) return def;
@ -57,17 +64,17 @@ function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default)
if(index < 0) return def; if(index < 0) return def;
if(index >= array_length(arr)) return def; if(index >= array_length(arr)) return def;
return arr[index] == undefined? def : arr[index]; return arr[index] == undefined? def : arr[index];
} } #endregion
function array_push_create(arr, val) { function array_push_create(arr, val) { #region
INLINE INLINE
if(!is_array(arr)) return [ val ]; if(!is_array(arr)) return [ val ];
array_push(arr, val); array_push(arr, val);
return arr; return arr;
} } #endregion
function array_get_decimal(arr, index, color = false) { function array_get_decimal(arr, index, color = false) { #region
INLINE INLINE
if(!is_array(arr)) return 0; if(!is_array(arr)) return 0;
@ -79,9 +86,9 @@ function array_get_decimal(arr, index, color = false) {
return color? return color?
merge_color(v0, v1, frac(index)) : merge_color(v0, v1, frac(index)) :
lerp(v0, v1, frac(index)); lerp(v0, v1, frac(index));
} } #endregion
function array_exists(arr, val) { function array_exists(arr, val) { #region
INLINE INLINE
self.__temp_val = val; self.__temp_val = val;
@ -89,9 +96,9 @@ function array_exists(arr, val) {
return array_any(arr, function(_val, _ind) { return array_any(arr, function(_val, _ind) {
return isEqual(_val, self.__temp_val); return isEqual(_val, self.__temp_val);
}); });
} } #endregion
function array_overlap(arr0, arr1) { function array_overlap(arr0, arr1) { #region
INLINE INLINE
self.__temp_arr = arr1; self.__temp_arr = arr1;
@ -101,14 +108,14 @@ function array_overlap(arr0, arr1) {
return array_any(arr0, function(_val, _ind) { return array_any(arr0, function(_val, _ind) {
return array_exists(self.__temp_arr, _val); return array_exists(self.__temp_arr, _val);
}); });
} } #endregion
function array_empty(arr) { function array_empty(arr) { #region
INLINE INLINE
return is_array(arr) && array_length(arr) == 0; return is_array(arr) && array_length(arr) == 0;
} } #endregion
function array_find(arr, val) { function array_find(arr, val) { #region
INLINE INLINE
self.__temp_val = val; self.__temp_val = val;
@ -116,35 +123,34 @@ function array_find(arr, val) {
return array_find_index(arr, function(_val, _ind) { return array_find_index(arr, function(_val, _ind) {
return isEqual(_val, self.__temp_val); return isEqual(_val, self.__temp_val);
}); });
} } #endregion
function array_remove(arr, val) { function array_remove(arr, val) { #region
INLINE INLINE
if(!is_array(arr)) return; if(!is_array(arr)) return;
if(!array_exists(arr, val)) return; if(!array_exists(arr, val)) return;
var ind = array_find(arr, val); var ind = array_find(arr, val);
array_delete(arr, ind, 1); array_delete(arr, ind, 1);
} } #endregion
function array_push_unique(arr, val) { function array_push_unique(arr, val) { #region
INLINE INLINE
if(!is_array(arr)) return; if(!is_array(arr)) return;
if(array_exists(arr, val)) return; if(array_exists(arr, val)) return;
array_push(arr, val); array_push(arr, val);
} } #endregion
function array_insert_unique(arr, ind, val) { #region
function array_insert_unique(arr, ind, val) {
INLINE INLINE
if(!is_array(arr)) return; if(!is_array(arr)) return;
if(array_exists(arr, val)) return; if(array_exists(arr, val)) return;
array_insert(arr, ind, val); array_insert(arr, ind, val);
} } #endregion
function array_append(arr, arr0) { function array_append(arr, arr0) { #region
INLINE INLINE
if(!is_array(arr)) return arr; if(!is_array(arr)) return arr;
@ -153,9 +159,9 @@ function array_append(arr, arr0) {
for( var i = 0, n = array_length(arr0); i < n; 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;
} } #endregion
function array_merge() { function array_merge() { #region
INLINE INLINE
var arr = []; var arr = [];
@ -163,9 +169,9 @@ function array_merge() {
array_append(arr, argument[i]); array_append(arr, argument[i]);
return arr; return arr;
} } #endregion
function array_clone(arr) { function array_clone(arr) { #region
INLINE INLINE
if(!is_array(arr)) return arr; if(!is_array(arr)) return arr;
@ -174,9 +180,9 @@ function array_clone(arr) {
for( var i = 0, n = array_length(arr); i < n; 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;
} } #endregion
function array_min(arr) { function array_min(arr) { #region
INLINE INLINE
if(!is_array(arr) || array_length(arr) == 0) return 0; if(!is_array(arr) || array_length(arr) == 0) return 0;
@ -185,9 +191,9 @@ function array_min(arr) {
for( var i = 0, n = array_length(arr); i < n; 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;
} } #endregion
function array_max(arr) { function array_max(arr) { #region
INLINE INLINE
if(!is_array(arr) || array_length(arr) == 0) return 0; if(!is_array(arr) || array_length(arr) == 0) return 0;
@ -196,15 +202,15 @@ function array_max(arr) {
for( var i = 0, n = array_length(arr); i < n; 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;
} } #endregion
function array_get_dimension(arr) { function array_get_dimension(arr) { #region
INLINE INLINE
return is_array(arr)? array_length(arr) : 1; return is_array(arr)? array_length(arr) : 1;
} } #endregion
function array_shape(arr, first = true, isSurface = false) { function array_shape(arr, first = true, isSurface = false) { #region
if(!is_array(arr)) { if(!is_array(arr)) {
if(isSurface && is_surface(arr)) if(isSurface && is_surface(arr))
return (first? "" : " x ") + string(surface_get_width_safe(arr)) + " x " + string(surface_get_height_safe(arr)) + " px"; return (first? "" : " x ") + string(surface_get_width_safe(arr)) + " x " + string(surface_get_height_safe(arr)) + " px";
@ -217,9 +223,9 @@ function array_shape(arr, first = true, isSurface = false) {
dim += array_shape(arr[0], false, isSurface); dim += array_shape(arr[0], false, isSurface);
return (first? "" : " x ") + dim; return (first? "" : " x ") + dim;
} } #endregion
function array_get_depth(arr) { function array_get_depth(arr) { #region
INLINE INLINE
if(!is_array(arr)) return 0; if(!is_array(arr)) return 0;
@ -232,9 +238,9 @@ function array_get_depth(arr) {
} }
return d; return d;
} } #endregion
function array_spread(arr, _arr = [], _minDepth = 0) { function array_spread(arr, _arr = [], _minDepth = 0) { #region
INLINE INLINE
if(array_get_depth(arr) == _minDepth) { if(array_get_depth(arr) == _minDepth) {
@ -246,9 +252,9 @@ function array_spread(arr, _arr = [], _minDepth = 0) {
array_spread(arr[i], _arr, _minDepth); array_spread(arr[i], _arr, _minDepth);
return _arr; return _arr;
} } #endregion
function array_verify(arr, length) { function array_verify(arr, length) { #region
INLINE INLINE
if(!is_array(arr)) return array_create(length); if(!is_array(arr)) return array_create(length);
@ -256,4 +262,4 @@ function array_verify(arr, length) {
array_resize(arr, length); array_resize(arr, length);
return arr; return arr;
} } #endregion

View file

@ -11,9 +11,9 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
objectPreview.materials[0] = materialPreview; objectPreview.materials[0] = materialPreview;
camera = camera_create(); camera = camera_create();
viewMat = matrix_build_lookat(0, 0, 1, viewMat = matrix_build_lookat(0, 0, 1,
0, 0, 0, 0, 0, 0,
1, 0, 0); 1, 0, 0);
projMat = matrix_build_projection_ortho(1, 1, 0.001, 10); projMat = matrix_build_projection_ortho(1, 1, 0.001, 10);

View file

@ -405,11 +405,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
targ.setFrom(junctionFrom); targ.setFrom(junctionFrom);
} #endregion } #endregion
static isActiveDynamic = function() { #region static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
if(update_on_frame) return true; if(update_on_frame) return true;
for(var i = 0; i < ds_list_size(inputs); i++) for(var i = 0; i < ds_list_size(inputs); i++)
if(inputs[| i].isActiveDynamic()) return true; if(inputs[| i].isActiveDynamic(frame)) return true;
return false; return false;
} #endregion } #endregion
@ -898,6 +898,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
var hover = noone; var hover = noone;
var amo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list); var amo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list);
var jun; var jun;
gpu_set_texfilter(true);
for(var i = 0; i < amo; i++) { for(var i = 0; i < amo; i++) {
var ind = getInputJunctionIndex(i); var ind = getInputJunctionIndex(i);
@ -928,6 +929,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
} }
onDrawJunctions(_x, _y, _mx, _my, _s); onDrawJunctions(_x, _y, _mx, _my, _s);
gpu_set_texfilter(false);
return hover; return hover;
} #endregion } #endregion

View file

@ -165,10 +165,13 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
switch(_dtype) { switch(_dtype) {
case "Range" : case "Range" :
if(!is_array(_val) || array_length(_val) != 2)
inParent.animator = new valueAnimator([0, 0], inParent);
inParent.setDisplay(VALUE_DISPLAY.range); inParent.setDisplay(VALUE_DISPLAY.range);
break; break;
case "Slider" : case "Slider" :
if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent);
inParent.setDisplay(VALUE_DISPLAY.slider, { range: [_range[0], _range[1], _step] }); inParent.setDisplay(VALUE_DISPLAY.slider, { range: [_range[0], _range[1], _step] });
break; break;
case "Slider range" : case "Slider range" :
@ -178,6 +181,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
break; break;
case "Rotation" : case "Rotation" :
if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent);
inParent.setDisplay(VALUE_DISPLAY.rotation); inParent.setDisplay(VALUE_DISPLAY.rotation);
break; break;
@ -219,8 +223,15 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
else if(_dtype == "Vector range") inParent.setDisplay(VALUE_DISPLAY.vector_range); else if(_dtype == "Vector range") inParent.setDisplay(VALUE_DISPLAY.vector_range);
break; break;
case "Enum button" : inParent.setDisplay(VALUE_DISPLAY.enum_button, string_splice(_enum_label, ",")); break; case "Enum button" :
case "Menu scroll" : inParent.setDisplay(VALUE_DISPLAY.enum_scroll, string_splice(_enum_label, ",")); break; if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent);
inParent.setDisplay(VALUE_DISPLAY.enum_button, string_splice(_enum_label, ","));
break;
case "Menu scroll" :
if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent);
inParent.setDisplay(VALUE_DISPLAY.enum_scroll, string_splice(_enum_label, ","));
break;
case "Palette" : case "Palette" :
if(!is_array(_val)) if(!is_array(_val))
@ -242,6 +253,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
break; break;
default: default:
if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent);
inParent.setDisplay(VALUE_DISPLAY._default); inParent.setDisplay(VALUE_DISPLAY._default);
break; break;
} }

View file

@ -76,10 +76,36 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
prop = _prop; prop = _prop;
y = 0; y = 0;
animate_frames = [];
if(_prop.type != VALUE_TYPE.trigger) if(_prop.type != VALUE_TYPE.trigger)
ds_list_add(values, new valueKey(0, _val, self)); ds_list_add(values, new valueKey(0, _val, self));
#endregion #endregion
static refreshAnimation = function() { #region
animate_frames = array_verify(animate_frames, TOTAL_FRAMES);
var _anim = false;
var _fr = noone;
for( var i = 0, n = ds_list_size(values); i < n; i++ ) {
var _key = values[| i];
if(_fr == noone) {
array_fill(animate_frames, 0, _key.time, 0);
} else {
if(array_equals(_fr.ease_out, [0, 0]) && array_equals(_fr.ease_in, [0, 1]) && isEqual(_fr.value, _key.value))
array_fill(animate_frames, _fr.time, _key.time, 0);
else
array_fill(animate_frames, _fr.time, _key.time, 1);
}
_fr = _key;
}
if(_fr) array_fill(animate_frames, _fr.time, TOTAL_FRAMES, 0);
} #endregion
static interpolate = function(from, to, rat) { #region static interpolate = function(from, to, rat) { #region
if(prop.type == VALUE_TYPE.boolean) if(prop.type == VALUE_TYPE.boolean)
return 0; return 0;

View file

@ -42,7 +42,7 @@ function Node_PC_Balls(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
input_display_list = [ 8, input_display_list = [ 8,
["Input", true], 0, 1, ["Input", true], 0, 1,
["Movement", false], 5, 2, 3, ["Movement", false], 5, 2, 3,
["Color", true], 4, 6, 7 ["Color", true], 4, 6, 7,
] ]
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);

View file

@ -141,8 +141,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
} #endregion } #endregion
static step = function() { #region static step = function() { #region
var pos = getInputData(2); var pos = getSingleValue(2);
var anc = getInputData(3); var anc = getSingleValue(3);
var _b = inputs[| 3].editWidget.side_button; var _b = inputs[| 3].editWidget.side_button;
var _a = anc[0] * 2 + anc[1] * 20; var _a = anc[0] * 2 + anc[1] * 20;
@ -335,16 +335,16 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
_surf_out = _surf_out[preview_index]; _surf_out = _surf_out[preview_index];
} }
var __pos = getInputData(2); var __pos = getSingleValue(2);
var pos = [ __pos[0], __pos[1] ]; var pos = [ __pos[0], __pos[1] ];
var _pos = [ __pos[0], __pos[1] ]; var _pos = [ __pos[0], __pos[1] ];
var __anc = getInputData(3); var __anc = getSingleValue(3);
var anc = [ __anc[0], __anc[1] ]; var anc = [ __anc[0], __anc[1] ];
var _anc = [ __anc[0], __anc[1] ]; var _anc = [ __anc[0], __anc[1] ];
var rot = getInputData(5); var rot = getSingleValue(5);
var sca = getInputData(6); var sca = getSingleValue(6);
var srw = surface_get_width_safe(_surf); var srw = surface_get_width_safe(_surf);
var srh = surface_get_height_safe(_surf); var srh = surface_get_height_safe(_surf);

View file

@ -1404,7 +1404,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
global.cache_call++; global.cache_call++;
if(useCache && use_cache) { if(useCache && use_cache) {
var cache_hit = cache_value[0]; var cache_hit = cache_value[0];
cache_hit &= !isActiveDynamic() || cache_value[1] == _time; cache_hit &= !isActiveDynamic(_time) || cache_value[1] == _time;
cache_hit &= cache_value[2] != undefined; cache_hit &= cache_value[2] != undefined;
cache_hit &= cache_value[3] == applyUnit; cache_hit &= cache_value[3] == applyUnit;
cache_hit &= connect_type == JUNCTION_CONNECT.input; cache_hit &= connect_type == JUNCTION_CONNECT.input;
@ -1592,7 +1592,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
node.refreshTimeline(); node.refreshTimeline();
} #endregion } #endregion
static isActiveDynamic = function() { #region static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
INLINE INLINE
if(value_from != noone) return false; if(value_from != noone) return false;

View file

@ -469,10 +469,11 @@ function Panel_Animation() : PanelContent() constructor {
getTimelineContentFolder(_cont, _context_folder, _depth + 1, _show && _cont.show); getTimelineContentFolder(_cont, _context_folder, _depth + 1, _show && _cont.show);
} else if(is_instanceof(_cont, timelineItemNode)) { } else if(is_instanceof(_cont, timelineItemNode)) {
var _node = _cont.node; var _node = _cont.node;
//if(_node != PROJECT.globalNode && !show_node_outside_context && _node.group != PANEL_GRAPH.getCurrentContext()) continue; if(!is_struct(_node)) continue;
var _anim = []; var _anim = [];
var _prop = []; var _prop = [];
for( var j = 0, m = ds_list_size(_node.inputs); j < m; j++ ) { for( var j = 0, m = ds_list_size(_node.inputs); j < m; j++ ) {
var prop = _node.inputs[| j]; var prop = _node.inputs[| j];
if(!prop.is_anim || prop.value_from != noone) continue; if(!prop.is_anim || prop.value_from != noone) continue;

View file

@ -395,7 +395,7 @@
res = v1; res = v1;
} else if(symbol == "【") { // array builder } else if(symbol == "【") { // array builder
res = array_create(array_length(v1)); res = array_create(array_length(v1));
for( var i = 0, n = array_length(res); i < n; i++ ) for( var i = 0, n = array_length(v1); i < n; i++ )
res[i] = getVal(v1[i], params); res[i] = getVal(v1[i], params);
} else if(symbol == "@") { // array getter } else if(symbol == "@") { // array getter
if(isLeft) if(isLeft)

View file

@ -81,6 +81,8 @@
fx = string_replace_all(fx, "-=", "⊖"); fx = string_replace_all(fx, "-=", "⊖");
fx = string_replace_all(fx, "*=", "⊗"); fx = string_replace_all(fx, "*=", "⊗");
fx = string_replace_all(fx, "/=", "⊘"); fx = string_replace_all(fx, "/=", "⊘");
fx = string_replace_all(fx, "]", ",");
fx = string_trim(fx); fx = string_trim(fx);
@ -199,7 +201,7 @@
} }
function evaluateFunctionTree(fx) { function evaluateFunctionTree(fx) {
static __BRACKETS = [ "(", ")", "[", "]" ]; static __BRACKETS = [ "(", ")", "[", "]", "" ];
var pres = global.EQUATION_PRES; var pres = global.EQUATION_PRES;
var vl = ds_stack_create(); var vl = ds_stack_create();
@ -219,7 +221,7 @@
while(l <= len) { while(l <= len) {
ch = string_char_at(fx, l); ch = string_char_at(fx, l);
//print($"Analyzing {ch}"); printIf(global.LOG_EXPRESSION, $"Analyzing {ch}");
if(ds_map_exists(pres, ch)) { //symbol is operator if(ds_map_exists(pres, ch)) { //symbol is operator
last_push = "op"; last_push = "op";
@ -261,15 +263,15 @@
last_push = "vl"; last_push = "vl";
l++; l++;
} else if (ch == "[") { } else if (ch == "[") {
if(last_push == "vl") { if(last_push == "vl") { // Get array member | a[1]
ds_stack_push(op, "@"); ds_stack_push(op, "@");
ds_stack_push(op, ch); ds_stack_push(op, ch);
} else } else // Create array member | a = [1]
ds_stack_push(op, [ "{", ds_stack_size(vl) ]); ds_stack_push(op, [ "{", ds_stack_size(vl) ]);
last_push = "op"; last_push = "op";
l++; l++;
} else if (ch == "]") { } else if (ch == "") {
while(!ds_stack_empty(op)) { while(!ds_stack_empty(op)) {
var _top = ds_stack_pop(op); var _top = ds_stack_pop(op);
if(_top == "[") break; if(_top == "[") break;
@ -277,6 +279,7 @@
var arr = []; var arr = [];
while(ds_stack_size(vl) > _top[1]) while(ds_stack_size(vl) > _top[1])
array_insert(arr, 0, ds_stack_pop(vl)); array_insert(arr, 0, ds_stack_pop(vl));
ds_stack_push(vl, new __funcTree("【", arr)); ds_stack_push(vl, new __funcTree("【", arr));
break; break;
} }
@ -291,10 +294,11 @@
var _top = ds_stack_top(op); var _top = ds_stack_top(op);
if(_top == "[" || _top == "(" || (is_array(_top) && _top[0] == "{")) break; if(_top == "[" || _top == "(" || (is_array(_top) && _top[0] == "{")) break;
var _top = ds_stack_pop(op);
ds_stack_push(vl, buildFuncTree(_top, vl)); ds_stack_push(vl, buildFuncTree(_top, vl));
} }
last_push = "vl"; last_push = "op";
l++; l++;
} else { } else {
var vsl = ""; var vsl = "";
@ -302,10 +306,8 @@
while(l <= len) { while(l <= len) {
cch = string_char_at(fx, l); cch = string_char_at(fx, l);
if(ds_map_exists(pres, cch) || array_exists(__BRACKETS, cch)) break; if(ds_map_exists(pres, cch) || array_exists(__BRACKETS, cch)) break;
if(cch == ",") { if(cch == ",")
l++;
break; break;
}
vsl += cch; vsl += cch;
l++; l++;
@ -329,7 +331,7 @@
} }
} }
//print($"op: {ds_stack_size(op)}; vl: {ds_stack_size(vl)}"); printIf(global.LOG_EXPRESSION, $"\tvl = {ds_stack_to_array(vl)}\n\top = {ds_stack_to_array(op)}");
_ch = ch; _ch = ch;
} }

View file

@ -8,6 +8,8 @@ enum RENDER_TYPE {
globalvar UPDATE, RENDER_QUEUE, RENDER_ORDER, UPDATE_RENDER_ORDER; globalvar UPDATE, RENDER_QUEUE, RENDER_ORDER, UPDATE_RENDER_ORDER;
UPDATE_RENDER_ORDER = false; UPDATE_RENDER_ORDER = false;
global.FLAG.render = 0; global.FLAG.render = 0;
global.FLAG.renderTime = false;
global.group_io = [ global.group_io = [
"Node_Group_Input", "Node_Group_Output", "Node_Group_Input", "Node_Group_Output",
"Node_Feedback_Input", "Node_Feedback_Output", "Node_Feedback_Input", "Node_Feedback_Output",
@ -228,7 +230,7 @@ function Render(partial = false, runAction = false) { #region
_render_time /= 1000; _render_time /= 1000;
LOG_IF(global.FLAG.render >= 1, $"=== RENDER COMPLETE IN {(get_timer() - t1) / 1000} ms ===\n"); LOG_IF(global.FLAG.renderTime || global.FLAG.render >= 1, $"=== RENDER FRAME {CURRENT_FRAME} COMPLETE IN {(get_timer() - t1) / 1000} ms ===\n");
LOG_IF(global.FLAG.render > 1, $"=== RENDER SUMMARY STA ==="); LOG_IF(global.FLAG.render > 1, $"=== RENDER SUMMARY STA ===");
LOG_IF(global.FLAG.render > 1, $" total time: {(get_timer() - t1) / 1000} ms"); LOG_IF(global.FLAG.render > 1, $" total time: {(get_timer() - t1) / 1000} ms");
LOG_IF(global.FLAG.render > 1, $" leaf: {_leaf_time / 1000} ms"); LOG_IF(global.FLAG.render > 1, $" leaf: {_leaf_time / 1000} ms");

View file

@ -12,7 +12,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
onModify = _onModify; onModify = _onModify;
data_list = _data; data_list = _data;
self.update_hover = update_hover; self.update_hover = update_hover;
data = []; data = _data;
curr_text = 0; curr_text = 0;
font = f_p0; font = f_p0;
@ -55,10 +55,12 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
if(is_method(data_list)) data = data_list(); if(is_method(data_list)) data = data_list();
else data = data_list; else data = data_list;
if(is_array(_val)) return 0; var _selVal = _val;
if(is_real(_val)) _val = array_safe_get(data, _val);
var _text = is_instanceof(_val, scrollItem)? _val.name : _val; if(is_array(_val)) return 0;
if(is_numeric(_val)) _selVal = array_safe_get(data, _val);
var _text = is_instanceof(_selVal, scrollItem)? _selVal.name : _selVal;
curr_text = _text; curr_text = _text;
w = _w; w = _w;
@ -96,7 +98,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
} }
var _arw = sprite_get_width(arrow_spr) + ui(8); var _arw = sprite_get_width(arrow_spr) + ui(8);
var _spr = is_instanceof(_val, scrollItem) && _val.spr; var _spr = is_instanceof(_selVal, scrollItem) && _selVal.spr;
draw_set_text(font, align, fa_center, COLORS._main_text); draw_set_text(font, align, fa_center, COLORS._main_text);
draw_set_alpha(0.5 + 0.5 * interactable); draw_set_alpha(0.5 + 0.5 * interactable);
@ -104,7 +106,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
else if(align == fa_left) draw_text(_x + ui(8) + _spr * _h, _y + _h / 2 - ui(2), _text); else if(align == fa_left) draw_text(_x + ui(8) + _spr * _h, _y + _h / 2 - ui(2), _text);
draw_set_alpha(1); draw_set_alpha(1);
if(_spr) draw_sprite_ext(_val.spr, 0, _x + ui(8) + _h / 2, _y + _h / 2, 1, 1, 0, _val.spr_blend, 1); if(_spr) draw_sprite_ext(_selVal.spr, 0, _x + ui(8) + _h / 2, _y + _h / 2, 1, 1, 0, _selVal.spr_blend, 1);
draw_sprite_ui_uniform(arrow_spr, arrow_ind, _x + w - _arw / 2, _y + _h / 2, 1, COLORS._main_icon, 0.5 + 0.5 * interactable); draw_sprite_ui_uniform(arrow_spr, arrow_ind, _x + w - _arw / 2, _y + _h / 2, 1, COLORS._main_icon, 0.5 + 0.5 * interactable);

View file

@ -0,0 +1,12 @@
function ds_stack_to_array(stack) {
var len = ds_stack_size(stack);
var _st = array_create(len);
for( var i = 0; i < len; i++ )
_st[len - i - 1] = ds_stack_pop(stack);
for( var i = 0; i < len; i++ )
ds_stack_push(stack, _st[i]);
return _st;
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "stack_functions",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "ds",
"path": "folders/functions/ds.yy",
},
}

View file

@ -109,7 +109,7 @@ function timelineItemNode(node) : timelineItem() constructor {
_map.type = "Node"; _map.type = "Node";
_map.show = show; _map.show = show;
_map.node_id = node.node_id; _map.node_id = is_struct(node)? node.node_id : -4;
return _map; return _map;
} #endregion } #endregion