This commit is contained in:
Tanasart 2023-07-28 19:41:57 +02:00
parent 9e957c5cd6
commit dd9cb05c96
30 changed files with 141 additions and 77 deletions

View file

@ -75,7 +75,6 @@
{"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":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",},
@ -90,6 +89,7 @@
{"name":"group","order":6,"path":"folders/nodes/data/group.yy",},
{"name":"network","order":16,"path":"folders/nodes/data/IO/network.yy",},
{"name":"iterate","order":9,"path":"folders/nodes/data/iterate.yy",},
{"name":"feedback","order":7,"path":"folders/nodes/data/iterate/feedback.yy",},
{"name":"for each","order":1,"path":"folders/nodes/data/iterate/for each.yy",},
{"name":"for filter","order":3,"path":"folders/nodes/data/iterate/for filter.yy",},
{"name":"for sort","order":5,"path":"folders/nodes/data/iterate/for sort.yy",},

View file

@ -98,7 +98,6 @@
{"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/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",},
@ -115,6 +114,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"IO","folderPath":"folders/nodes/data/IO.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"network","folderPath":"folders/nodes/data/IO/network.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"iterate","folderPath":"folders/nodes/data/iterate.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/iterate/feedback.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"for each","folderPath":"folders/nodes/data/iterate/for each.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"for filter","folderPath":"folders/nodes/data/iterate/for filter.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"for sort","folderPath":"folders/nodes/data/iterate/for sort.yy",},

View file

@ -31,7 +31,7 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
static outputNextNode = function() {
LOG_BLOCK_START();
LOG_IF(global.FLAG.render, "Get next node from Loop output");
LOG_IF(global.FLAG.render, "[outputNextNode] Get next node from Loop output");
var _nodes = [];
for( var i = 0; i < ds_list_size(nodes); i++ ) { // check if every node is updated
@ -43,6 +43,7 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
}
if(willRestart) {
LOG_IF(global.FLAG.render, $"Restart");
resetRender();
willRestart = false;
}
@ -53,7 +54,7 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
//LOG_IF(global.FLAG.render, "Loop restart: iteration " + string(group.iterated));
_nodes = array_append(_nodes, __nodeLeafList(getNodeList()));
} else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
//LOG_IF(global.FLAG.render, "Loop completed");
//LOG_IF(global.FLAG.render, "Loop completed get next node external");
setRenderStatus(true);
_nodes = getNextNodesExternal();
}
@ -75,7 +76,6 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
for( var i = 0; i < ds_list_size(nodes); i++ ) // check if every node is updated
if(!nodes[| i].rendered) return;
willRestart = true;
var maxIter = getIterationCount();
iterated++;
@ -87,6 +87,7 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
render_time = get_timer() - loop_start_time;
} else if(iterated < maxIter) {
LOG_LINE_IF(global.FLAG.render, $"------------------< Iteration update: {iterated} / {maxIter} [RESTART] >------------------");
willRestart = true;
}
}
}

View file

@ -54,6 +54,9 @@
]
static cleanup = function() {
if(!ds_map_empty(nodeMap))
array_map(ds_map_keys_to_array(nodeMap), function(_key, _ind) { nodeMap[? _key].active = false; });
ds_list_destroy(nodes);
ds_map_destroy(nodeMap);
ds_map_destroy(nodeNameMap);
@ -70,12 +73,12 @@
globalvar PROJECT_VARIABLES;
PROJECT_VARIABLES = ds_map_create();
PROJECT_VARIABLES[? "frame"] = [ function() { return PROJECT.animator.current_frame; }];
PROJECT_VARIABLES[? "progress"] = [ function() { return PROJECT.animator.current_frame / PROJECT.animator.frames_total; }];
PROJECT_VARIABLES[? "frameTotal"] = [ function() { return PROJECT.animator.frames_total; }];
PROJECT_VARIABLES[? "fps"] = [ function() { return PROJECT.animator.framerate; }];
PROJECT_VARIABLES[? "time"] = [ function() { return PROJECT.animator.current_frame / PROJECT.animator.framerate; }];
PROJECT_VARIABLES[? "name"] = [ function() { return filename_name_only(PROJECT.path); }];
PROJECT_VARIABLES[? "frame"] = function() { return PROJECT.animator.current_frame; };
PROJECT_VARIABLES[? "progress"] = function() { return PROJECT.animator.current_frame / PROJECT.animator.frames_total; };
PROJECT_VARIABLES[? "frameTotal"] = function() { return PROJECT.animator.frames_total; };
PROJECT_VARIABLES[? "fps"] = function() { return PROJECT.animator.framerate; };
PROJECT_VARIABLES[? "time"] = function() { return PROJECT.animator.current_frame / PROJECT.animator.framerate; };
PROJECT_VARIABLES[? "name"] = function() { return filename_name_only(PROJECT.path); };
#endregion
#region main
@ -89,10 +92,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 1147;
SAVE_VERSION = 1448.1;
VERSION = 11470;
SAVE_VERSION = 11470;
VERSION_STRING = "1.14.7";
BUILD_NUMBER = 114600;
BUILD_NUMBER = 11470;
globalvar APPEND_MAP;
APPEND_MAP = ds_map_create();

View file

@ -14,6 +14,8 @@ function gradientKey(time, value) constructor {
}
function gradientObject(color = c_black) constructor {
static GRADIENT_LIMIT = 128;
if(is_array(color))
keys = [ new gradientKey(0, color[0]), new gradientKey(1, color[1]) ];
else
@ -22,15 +24,15 @@ function gradientObject(color = c_black) constructor {
static clone = function() {
var g = new gradientObject();
for( var i = 0, n = array_length(keys); i < n; i++ ) {
for( var i = 0, n = array_length(keys); i < n; i++ )
g.keys[i] = keys[i].clone();
}
g.type = type;
return g;
}
static add = function(_addkey, _deleteDup = true) {
if(array_length(keys) > GRADIENT_LIMIT) return;
if(array_length(keys) == 0) {
array_push(keys, _addkey);
return;
@ -85,8 +87,10 @@ function gradientObject(color = c_black) constructor {
var _grad_color = [];
var _grad_time = [];
for(var i = 0; i < array_length(keys); i++) {
var len = min(128, array_length(keys));
for(var i = 0; i < len; i++) {
if(keys[i].value == undefined) return;
_grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255;
@ -96,14 +100,14 @@ function gradientObject(color = c_black) constructor {
_grad_time[i] = keys[i].time;
}
if(array_length(keys) == 0) {
if(len == 0) {
draw_sprite_stretched_ext(s_fx_pixel, 0, _x, _y, _w, _h, c_white, _a)
} else {
shader_set(sh_gradient_display);
shader_set_uniform_i(uniform_grad_blend, type);
shader_set_uniform_f_array_safe(uniform_grad, _grad_color);
shader_set_uniform_f_array_safe(uniform_grad, _grad_color, GRADIENT_LIMIT * 4);
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
shader_set_uniform_i(uniform_grad_key, array_length(keys));
shader_set_uniform_i(uniform_grad_key, len);
draw_sprite_stretched_ext(s_fx_pixel, 0, _x, _y, _w, _h, c_white, _a)
shader_reset();

View file

@ -33,6 +33,8 @@
}
function __txtx(key, def = "") {
gml_pragma("forceinline");
if(struct_has(LOCALE.word, key))
return LOCALE.word[$ key]
if(struct_has(LOCALE.ui, key))
@ -43,6 +45,8 @@
}
function __txt(txt, prefix = "") {
gml_pragma("forceinline");
var key = string_lower(txt);
key = string_replace_all(key, " ", "_");
@ -50,18 +54,24 @@
}
function __txt_node_name(node, def = "") {
gml_pragma("forceinline");
if(struct_has(LOCALE.node, node))
return LOCALE.node[$ node].name;
return def;
}
function __txt_node_tooltip(node, def = "") {
gml_pragma("forceinline");
if(struct_has(LOCALE.node, node))
return LOCALE.node[$ node].tooltip;
return def;
}
function __txt_junction_name(node, type, index, def = "") {
gml_pragma("forceinline");
if(!struct_has(LOCALE.node, node))
return def;
@ -73,6 +83,8 @@
}
function __txt_junction_tooltip(node, type, index, def = "") {
gml_pragma("forceinline");
if(!struct_has(LOCALE.node, node))
return def;

View file

@ -200,7 +200,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(_focus) jun.express_edit.register(_scrollPane);
var wd_h = jun.express_edit.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.expression, _m);
widH = lineBreak? wd_h : 0;
widH = wd_h - (TEXTBOX_HEIGHT * !lineBreak);
} else if(jun.editWidget) {
jun.editWidget.setFocusHover(_focus, _hover);

View file

@ -178,20 +178,25 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
}
static getNextNodesExternal = function() { //get node connected to the parent object
LOG_IF(global.FLAG.render, $"Checking next node external for {internalName}");
LOG_BLOCK_START();
var nodes = [];
for( var i = 0; i < ds_list_size(outputs); i++ ) {
var _ot = outputs[| i];
var _tos = _ot.getJunctionTo();
for(var j = 0; j < ds_list_size(_ot.value_to); j++) {
var _to = _ot.value_to[| j];
for( var j = 0, n = array_length(_tos); j < n; j++ ) {
var _to = _tos[j];
var _node = _to.node;
if(!_node.isRenderActive()) continue;
LOG_IF(global.FLAG.render, $"Checking node {_node.internalName} : {_node.isRenderable()}");
if(!_node.isRenderable()) continue;
if(_node.active && _to.value_from != noone && _to.value_from.node == group && _node.isRenderable())
array_push(nodes, _to.node);
array_push(nodes, _to.node);
}
}
LOG_BLOCK_END();
return nodes;
}
@ -199,18 +204,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static setRenderStatus = function(result) {
LOG_BLOCK_START();
LOG_IF(global.FLAG.render, $"Set render status for {internalName} : {result}");
LOG_BLOCK_END();
rendered = result;
if(result) {
var siz = ds_list_size(outputs);
for( var i = custom_output_index; i < siz; i++ ) {
var _o = outputs[| i];
if(_o.from.rendered) continue;
if(result)
for( var i = custom_output_index, n = ds_list_size(outputs); i < n; i++ ) {
var _o = outputs[| i];
if(_o.from.rendered) continue;
rendered = false;
break;
}
LOG_IF(global.FLAG.render, $"Set fail because {_o.from.internalName} is not rendered.");
rendered = false;
break;
}
if(rendered)
@ -218,6 +221,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
if(!result && group != noone)
group.setRenderStatus(result);
LOG_BLOCK_END();
}
static exitGroup = function() {}
@ -441,7 +445,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
LOG_IF(global.FLAG.render, $"Reset Render for {internalName}");
for( var i = 0; i < ds_list_size(nodes); i++ ) {
//LOG_IF(global.FLAG.render, $"Reset Render for {nodes[| i].internalName}");
LOG_IF(global.FLAG.render, $"Reseting {nodes[| i].internalName}");
nodes[| i].resetRender();
}

View file

@ -437,8 +437,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if( val_from == noone) continue;
if(!val_from.node.active) continue;
if(!val_from.node.isRenderActive()) continue;
if(!val_from.node.rendered && !val_from.node.update_on_frame) {
LOG_LINE_IF(global.FLAG.render, $"Node {internalName} is not renderable because input {val_from.node.internalName} is not rendered");
if!(val_from.node.rendered || val_from.node.update_on_frame) {
LOG_LINE_IF(global.FLAG.render, $"Node {internalName} is not renderable because input {val_from.node.internalName} is not rendered ({val_from.node.rendered})");
return false;
}
}

View file

@ -210,7 +210,11 @@
return inp == noone? 0 : inp.getValueRecursive()[0];
} else if(string_lower(strs[0]) == "project") {
if(!ds_map_exists(PROJECT_VARIABLES, strs[1])) return 0;
return PROJECT_VARIABLES[? strs[1]]();
var val = PROJECT_VARIABLES[? strs[1]];
if(is_callable(val))
return val();
return val;
} else if(array_length(strs) > 2) {
var key = strs[0];
if(!ds_map_exists(PROJECT.nodeNameMap, key)) return 0;

View file

@ -33,14 +33,18 @@ function Node_Gradient_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y,
var type = _data[3];
var grad = new gradientObject();
grad.keys = [];
var len = min(128, array_length(pal));
grad.keys = array_create(len);
for( var i = 0, n = array_length(pal); i < n; i++ ) {
//print("Process gradient");
for( var i = 0; i < len; i++ ) {
var clr = pal[i];
var pos = pos_use? array_safe_get(_pos, i, 0) : i / array_length(pal);
var pos = pos_use? array_safe_get(_pos, i, 0) : i / len;
grad.keys[i] = new gradientKey(pos, clr);
//print($" {i} = {pos} : {clr}");
}
switch(type) {
case 0 : grad.type = GRADIENT_INTER.smooth; break;
case 1 : grad.type = GRADIENT_INTER.hue; break;

View file

@ -300,6 +300,8 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
}
outputs[| 0].setValue(res);
triggerRender();
}
static onInspector1Update = function() { extractPalettes(); }

View file

@ -100,7 +100,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
ds_list_add(iter, "Groups");
addNodeObject(iter, "Input", s_node_loop_input, "Node_Iterator_Input", [1, Node_Iterator_Input]);
addNodeObject(iter, "Output", s_node_loop_output, "Node_Iterator_Output", [1, Node_Iterator_Output]);
ds_list_add(iter, "Loops");
addNodeObject(iter, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]);
addNodeObject(iter, "Loop amount", s_node_iterator_amount, "Node_Iterator_Length", [1, Node_Iterator_Length]);

View file

@ -1063,6 +1063,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
cache_hit &= (!is_anim && value_from == noone) || cache_value[1] == _time;
cache_hit &= cache_value[2] != undefined;
cache_hit &= connect_type == JUNCTION_CONNECT.input;
cache_hit &= unit.reference == noone || unit.mode == VALUE_UNIT.constant;
if(cache_hit) {
global.cache_hit++;
@ -1160,7 +1161,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
//print($"========== EXPRESSION CALLED ==========");
//print(debug_get_callstack(8));
printIf(global.FLAG.expression_debug, "==================== EVAL BEGIN ====================");
//printIf(global.FLAG.expression_debug, "==================== EVAL BEGIN ====================");
if(global.EVALUATE_HEAD != noone && global.EVALUATE_HEAD == self) {
//noti_warning($"Expression evaluation error : recursive call detected.");
} else {
@ -1204,7 +1205,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
}
static showValue = function() {
var val = getValue(, false,, false);
var val = getValue(, false,, true);
if(isArray()) {
if(array_length(val) == 0) return 0;
var v = val[safe_mod(node.preview_index, array_length(val))];

View file

@ -614,7 +614,6 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function setTab(tabIndex) {
if(tabIndex < 0) return;
if(tabIndex >= array_length(content)) return;
if(content_index == tabIndex) return;
var prec = array_safe_get(content, content_index);
if(prec) prec.onFocusEnd();

View file

@ -688,6 +688,9 @@ function Panel_Inspector() : PanelContent() constructor {
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(8), top_bar_h - ui(8), w - ui(16), h - top_bar_h);
if(inspecting && !inspecting.active)
inspecting = noone;
if(inspecting) {
title = inspecting.display_name == ""? inspecting.name : inspecting.display_name;
inspecting.inspectorStep();

View file

@ -61,6 +61,7 @@ function Panel_Menu() : PanelContent() constructor {
gameframe_set_fullscreen(2);
},, ["", "Fullscreen"]),
menuItem(__txt("Close current file"), function() { PANEL_GRAPH.close(); },, [ "", "Close file" ]),
menuItem(__txt("Close all projects"), function() { for( var i = array_length(PROJECTS) - 1; i >= 0; i-- ) closeProject(PROJECTS[i]); },, [ "", "Close all" ]),
menuItem(__txt("Close program"), function() { window_close(); },, [ "", "Close program" ]),
];

View file

@ -188,6 +188,10 @@ function Panel_Preview() : PanelContent() constructor {
var node = preview_node[i];
if(node == noone) continue;
if(!node.active) {
preview_node[i] = noone;
continue;
}
var _prev_val = node.getPreviewValue();

View file

@ -112,7 +112,7 @@ function Render(partial = false, runAction = false) {
// render forward
while(!RENDER_QUEUE.empty()) {
LOG_BLOCK_START();
LOG_IF(global.FLAG.render, $"➤➤➤➤➤➤ CURRENT RENDER QUEUE {RENDER_QUEUE}");
LOG_IF(global.FLAG.render, $"➤➤➤➤➤➤ CURRENT RENDER QUEUE {RENDER_QUEUE} [{RENDER_QUEUE.size()}] ");
rendering = RENDER_QUEUE.dequeue();
var renderable = rendering.isRenderable();

View file

@ -57,6 +57,8 @@ function SET_PATH(project, path) {
} else if(!project.readonly) {
ds_list_remove(RECENT_FILES, path);
ds_list_insert(RECENT_FILES, 0, path);
while(ds_list_size(RECENT_FILES) > 64)
ds_list_delete(RECENT_FILES, ds_list_size(RECENT_FILES) - 1);
RECENT_SAVE();
RECENT_REFRESH();
//project.path = filename_name(path);

View file

@ -26,7 +26,7 @@ function shader_set_f(uniform, value) {
shader_set_f_array(shader, uniform, value);
return;
}
if(argument_count > 2) {
var array = [];
for( var i = 1; i < argument_count; i++ )
@ -38,13 +38,15 @@ function shader_set_f(uniform, value) {
shader_set_uniform_f(shader_get_uniform(shader, uniform), value);
}
function shader_set_f_array(shader, uniform, array) {
shader_set_uniform_f_array(shader_get_uniform(shader, uniform), array);
function shader_set_f_array(shader, uniform, array, max_length = 128) {
shader_set_uniform_f_array_safe(shader_get_uniform(shader, uniform), array, max_length);
}
function shader_set_uniform_f_array_safe(uniform, array) {
function shader_set_uniform_f_array_safe(uniform, array, max_length = 128) {
if(!is_array(array)) return;
if(array_length(array) == 0) return;
if(array_length(array) > max_length)
array_resize(array, max_length)
shader_set_uniform_f_array(uniform, array);
}
@ -81,11 +83,11 @@ function shader_set_color(uniform, col, alpha = 1) {
shader_set_f(uniform, colToVec4(col, alpha));
}
function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount") {
shader_set_i(amo_uni, array_length(pal));
function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount", max_length = 128) {
shader_set_i(amo_uni, min(max_length, array_length(pal)));
var _pal = [];
for( var i = 0, n = array_length(pal); i < n; i++ )
for( var i = 0, n = min(max_length, array_length(pal)); i < n; i++ )
array_append(_pal, colToVec4(pal[i]));
if(array_length(_pal))

View file

@ -7,17 +7,13 @@ function string_cut(str, w, tail = "...", scale = 1) {
if(string_width(str) <= w) return str;
var amo = string_length(str);
for( var i = 1; i <= amo; i++ ) {
var ch = string_char_at(str, 1);
str = string_copy(str, 2, string_length(str) - 1);
for( var i = 1, n = string_length(str); i <= n; i++ ) {
var ch = string_char_at(str, i);
var _w = string_width(ch) * scale;
ww += _w;
var _tl = string_width(str) * scale;
if(ww + tw > w)
return ww + _tl <= w? _str : ss + tail;
if(string_width(ss + ch) + tw > w)
return ss + tail;
ss += ch;
}

View file

@ -535,7 +535,7 @@ function functionStringClean(fx) {
var _ch = "";
var in_str = false;
//print($"===== Function: {fx} =====");
printIf(global.FLAG.expression_debug, $"===== Evaluating function: {fx} =====");
while(l <= len) {
ch = string_char_at(fx, l);

View file

@ -14,6 +14,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
auto_update = false;
_input_text_line = [];
_input_text_line_index = [];
_current_text = "";
_input_text = "";
_prev_text = "";
@ -256,6 +257,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
static cut_line = function() {
_input_text_line = [];
_input_text_line_index = [];
draw_set_font(font);
var _txtLines = string_splice(_input_text, "\n");
@ -268,6 +270,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
var currL = "";
var cut = true;
var len = array_length(words);
var _iIndex = i + 1;
for( var j = 0; j < len; j++ ) {
var word = words[j];
@ -279,6 +282,8 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
if(currW + string_width(ch) > line_width) {
array_push(_input_text_line, currL);
array_push(_input_text_line_index, _iIndex); _iIndex = "";
currW = 0;
currL = "";
}
@ -291,6 +296,8 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
if(currW + string_width(word) > line_width) {
array_push(_input_text_line, currL);
array_push(_input_text_line_index, _iIndex); _iIndex = "";
currW = 0;
currL = "";
}
@ -300,7 +307,10 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
currL += word;
}
if(cut) array_push(_input_text_line, currL);
if(cut) {
array_push(_input_text_line, currL);
array_push(_input_text_line_index, _iIndex); _iIndex = "";
}
}
}
@ -611,7 +621,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
for( var i = 0; i < line_count; i++ ) {
var ly = _y + ui(7) + i * c_h;
draw_text(lx, ly, string(i + 1));
draw_text(lx, ly, _input_text_line_index[i]);
}
}

View file

@ -5,8 +5,10 @@ varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float hue;
#define PALETTE_LIMIT 128
uniform int usePalette;
uniform vec4 palette[64];
uniform vec4 palette[PALETTE_LIMIT];
uniform int paletteAmount;
vec3 hsv2rgb(vec3 c) {

View file

@ -3,11 +3,14 @@
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define PALETTE_LIMIT 128
uniform float sat;
uniform float value;
uniform int usePalette;
uniform vec4 palette[64];
uniform vec4 palette[PALETTE_LIMIT];
uniform int paletteAmount;
vec3 hsv2rgb(vec3 c) {

View file

@ -3,11 +3,14 @@
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define PALETTE_LIMIT 128
uniform float hue;
uniform float sat;
uniform int usePalette;
uniform vec4 palette[64];
uniform vec4 palette[PALETTE_LIMIT];
uniform int paletteAmount;
vec3 hsv2rgb(vec3 c) {

View file

@ -3,10 +3,13 @@
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define PALETTE_LIMIT 128
uniform float value;
uniform int usePalette;
uniform vec4 palette[64];
uniform vec4 palette[PALETTE_LIMIT];
uniform int paletteAmount;
vec3 hsv2rgb(vec3 c) {

View file

@ -67,10 +67,9 @@ vec3 gradientEval(in float prog) {
}
break;
}
if(i >= gradient_keys - 1) {
col = gradient_color[gradient_keys - 1];
break;
}
if(i >= gradient_keys - 1)
return gradient_color[gradient_keys - 1].rgb;
}
return col.rgb;

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec4 palette[64];
#define PALETTE_LIMIT 128
uniform vec4 palette[PALETTE_LIMIT];
uniform int keys;
vec3 rgb2xyz( vec3 c ) {