mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
1.16rc8
This commit is contained in:
parent
746dee6593
commit
3e0994ce4d
20 changed files with 408 additions and 175 deletions
|
@ -245,6 +245,7 @@
|
|||
{"name":"button","order":34,"path":"folders/widgets/button.yy",},
|
||||
{"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",},
|
||||
{"name":"text","order":36,"path":"folders/widgets/text.yy",},
|
||||
{"name":"math","order":43,"path":"folders/functions/math.yy",},
|
||||
],
|
||||
"ResourceOrderSettings": [
|
||||
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
|
||||
|
|
|
@ -280,6 +280,7 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"button","folderPath":"folders/widgets/button.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rotator","folderPath":"folders/widgets/rotator.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"text","folderPath":"folders/widgets/text.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"math","folderPath":"folders/functions/math.yy",},
|
||||
],
|
||||
"IncludedFiles": [
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
|
||||
|
@ -2265,6 +2266,7 @@
|
|||
{"id":{"name":"s_node_texture_map","path":"sprites/s_node_texture_map/s_node_texture_map.yy",},},
|
||||
{"id":{"name":"fd_rectangle_create","path":"scripts/fd_rectangle_create/fd_rectangle_create.yy",},},
|
||||
{"id":{"name":"s_node_level_selector","path":"sprites/s_node_level_selector/s_node_level_selector.yy",},},
|
||||
{"id":{"name":"real_number_functions","path":"scripts/real_number_functions/real_number_functions.yy",},},
|
||||
{"id":{"name":"random_function","path":"scripts/random_function/random_function.yy",},},
|
||||
{"id":{"name":"FriebaseREST_Firestore_urlUpdateMask","path":"scripts/FriebaseREST_Firestore_urlUpdateMask/FriebaseREST_Firestore_urlUpdateMask.yy",},},
|
||||
{"id":{"name":"s_node_input","path":"sprites/s_node_input/s_node_input.yy",},},
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color Data";
|
||||
|
||||
name = "Color Data";
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
|
||||
|
|
|
@ -172,10 +172,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
|
||||
inspecting = false;
|
||||
previewing = 0;
|
||||
|
||||
|
||||
preview_surface = noone;
|
||||
preview_amount = 0;
|
||||
previewable = true;
|
||||
preview_draw = true;
|
||||
preview_speed = 0;
|
||||
preview_index = 0;
|
||||
preview_channel = 0;
|
||||
|
@ -1253,7 +1254,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
drawDimension(xx, yy, _s);
|
||||
|
||||
if(previewable) {
|
||||
drawPreview(xx, yy, _s);
|
||||
if(preview_draw) drawPreview(xx, yy, _s);
|
||||
onDrawNode(xx, yy, _mx, _my, _s, PANEL_GRAPH.node_hovering == self, PANEL_GRAPH.getFocusingNode() == self);
|
||||
} else {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
|
|
|
@ -14,7 +14,7 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
|
||||
outputs[| 2] = nodeValue("Type", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0 );
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
var gra = _data[0];
|
||||
|
||||
switch(_output_index) {
|
||||
|
@ -33,9 +33,9 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
|
@ -46,5 +46,5 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
}
|
||||
|
||||
grad.draw(bbox.x0, bbox.y0, bbox.w, bbox.h);
|
||||
}
|
||||
} #endregion
|
||||
}
|
|
@ -18,21 +18,27 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
inputs[| 5] = nodeValue("Edge Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "Uniform", "Individual" ] );
|
||||
|
||||
inputs[| 6] = nodeValue("Edge", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 7] = nodeValue("Edge bottom", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 8] = nodeValue("Edge left", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 9] = nodeValue("Edge right", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 6] = nodeValue("Edge", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 7] = nodeValue("Edge bottom", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 8] = nodeValue("Edge left", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 9] = nodeValue("Edge right", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 10] = nodeValue("Edge shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.padding);
|
||||
|
||||
inputs[| 11] = nodeValue("Full edge", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.toggle, { data: [ "T", "B", "L", "R" ] });
|
||||
|
||||
inputs[| 12] = nodeValue("Extend edge", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||
|
||||
inputs[| 13] = nodeValue("Edge sprite", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Single", "Side + Center", "Side + Center + Side" ] );
|
||||
|
||||
input_display_list = [
|
||||
["Surfaces", false], 0, 1,
|
||||
["Tiling", false], 2, 4,
|
||||
["Edge", false], 10, 5, 6, 7, 8, 9,
|
||||
["Edge", false], 5, 13, 10, 11, 12,
|
||||
["Edge Textures", true], 6, 7, 8, 9,
|
||||
["Output", false], 3,
|
||||
];
|
||||
|
||||
|
@ -42,25 +48,69 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
for( var i = 0, n = array_length(temp_surface); i < n; i++ )
|
||||
temp_surface[i] = array_create(1, 1);
|
||||
|
||||
__edge_surface = array_create(4);
|
||||
__edge_surface = array_create(12);
|
||||
__edge_buffer = [ surface_create(1, 1), surface_create(1, 1)];
|
||||
edge_surface = [];
|
||||
|
||||
index_18 = [ 0, 8, 12, 4, 7, 11,
|
||||
0, 10, 15, 5, 13, 14,
|
||||
0, 2, 3, 1, 9, 6];
|
||||
#region index
|
||||
index_18 = [ 0, 8, 12, 4, 7, 11,
|
||||
0, 10, 15, 5, 13, 14,
|
||||
0, 2, 3, 1, 9, 6];
|
||||
|
||||
index_55 = [208, 224, 104, 64, /**/ 80, 120, 216, 72, /**/ 88, 219, -1,
|
||||
148, 255, 41, 66, /**/ 86, 127, 223, 75, /**/ 95, 126, -1,
|
||||
22, 7, 11, 2, /**/ 210, 251, 254, 106, /**/ 250, 218, 122,
|
||||
16, 24, 8, 0, /**/ 18, 27, 30, 10, /**/ 26, 94, 91,
|
||||
-1, -1, -1, -1, /**/ 82, 123, 222, 74, /**/ 90, -1, -1];
|
||||
index_18_et = [ 0, 0, 1, 2, 0, 0,
|
||||
0, 0, 0, 0, 0, 2,
|
||||
0, 0, 0, 0, 0, 2];
|
||||
|
||||
index_18_eb = [ 0, 0, 0, 0, 0, 2,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 2, 2, 0];
|
||||
|
||||
index_18_el = [ 0, 0, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 2,
|
||||
0, 2, 0, 0, 0, 2];
|
||||
|
||||
index_18_er = [ 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 1, 2, 0,
|
||||
0, 0, 0, 2, 2, 0];
|
||||
|
||||
index_55 = [208, 224, 104, /**/ 64, /**/ 80, 120, 216, 72, /**/ 88, 219, -1,
|
||||
148, 255, 41, /**/ 66, /**/ 86, 127, 223, 75, /**/ 95, 126, -1,
|
||||
22, 7, 11, /**/ 2, /**/ 210, 251, 254, 106, /**/ 250, 218, 122,
|
||||
16, 24, 8, /**/ 0, /**/ 18, 27, 30, 10, /**/ 26, 94, 91,
|
||||
-1, -1, -1, /**/ -1, /**/ 82, 123, 222, 74, /**/ 90, -1, -1];
|
||||
|
||||
index_55_et = [ 0, 1, 2, /**/ 1, /**/ 0, 1, 1, 0, /**/ 1, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 2, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 2, 2, /**/ 0, 0, 0,
|
||||
0, 1, 2, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0, ];
|
||||
|
||||
index_55_eb = [ 0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0, ];
|
||||
|
||||
index_55_el = [ 0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0, ];
|
||||
|
||||
index_55_er = [ 0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0,
|
||||
0, 0, 0, /**/ 0, /**/ 0, 0, 0, 0, /**/ 0, 0, 0, ];
|
||||
#endregion
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||
|
||||
} #endregion
|
||||
|
||||
static step = function() { #region
|
||||
var _edgType = getSingleValue(5);
|
||||
var _edgType = getSingleValue( 5);
|
||||
var _edgFull = getSingleValue(11);
|
||||
|
||||
inputs[| 6].name = _edgType == 1? "Edge top" : "Edge"
|
||||
inputs[| 7].setVisible(_edgType == 1, _edgType == 1);
|
||||
|
@ -79,11 +129,9 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
var l = _crop[2];
|
||||
var b = _crop[3];
|
||||
|
||||
var _edgType = _data[5];
|
||||
var _et = _edge[0]; var _uet = is_surface(_et);
|
||||
var _eb = _edge[1]; var _ueb = is_surface(_eb);
|
||||
var _el = _edge[2]; var _uel = is_surface(_el);
|
||||
var _er = _edge[3]; var _uer = is_surface(_er);
|
||||
var _edgeShf = _data[10];
|
||||
var _edgFull = _data[11];
|
||||
var _edgExtn = _data[12];
|
||||
|
||||
for( var i = 0; i < 18; i++ ) {
|
||||
var _index = index_18[i];
|
||||
|
@ -110,41 +158,55 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
if(_index & 0b0101 >= 0b0101) draw_surface_part(_tex0, 0, 0, _sw - r, _sh, 0, 0);
|
||||
if(_index & 0b0011 >= 0b0011) draw_surface_part(_tex0, 0, 0, _sw, _sh - b, 0, 0);
|
||||
|
||||
if(_uel) { #region
|
||||
var _et = _edge[0][index_18_et[i]];
|
||||
var _eb = _edge[1][index_18_eb[i]];
|
||||
var _el = _edge[2][index_18_el[i]];
|
||||
var _er = _edge[3][index_18_er[i]];
|
||||
|
||||
if(_el != noone) { #region
|
||||
shader_set(sh_mk_tile18_edge_l);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b0100));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_el, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
} #endregion
|
||||
|
||||
if(_uer) { #region
|
||||
if(_er != noone) { #region
|
||||
shader_set(sh_mk_tile18_edge_r);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b1000));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
|
||||
draw_surface_ext(_er, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
} #endregion
|
||||
|
||||
if(_uet) { #region
|
||||
if(_et != noone) { #region
|
||||
shader_set(sh_mk_tile18_edge_t);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b0001));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_et, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
} #endregion
|
||||
|
||||
if(_ueb) { #region
|
||||
if(_eb != noone) { #region
|
||||
shader_set(sh_mk_tile18_edge_b);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b0010));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_eb, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
|
@ -170,10 +232,8 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
var l = _crop[2];
|
||||
var b = _crop[3];
|
||||
|
||||
var _et = _edge[0]; var _uet = is_surface(_et);
|
||||
var _eb = _edge[1]; var _ueb = is_surface(_eb);
|
||||
var _el = _edge[2]; var _uel = is_surface(_el);
|
||||
var _er = _edge[3]; var _uer = is_surface(_er);
|
||||
var _edgFull = _data[11];
|
||||
var _edgExtn = _data[12];
|
||||
|
||||
for( var i = 0; i < 55; i++ ) {
|
||||
var _index = index_55[i];
|
||||
|
@ -208,41 +268,54 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
if(_index & 0b0000_1011 >= 0b0000_1011) draw_surface_part(_tex0, 0, 0, _sw - r, _sh - b, 0, 0);
|
||||
if(_index & 0b0001_0110 >= 0b0001_0110) draw_surface_part(_tex0, l, 0, _sw - l, _sh - b, l, 0);
|
||||
|
||||
if(_uel) { #region
|
||||
var _et = _edge[0][1];
|
||||
var _eb = _edge[1][1];
|
||||
var _el = _edge[2][1];
|
||||
var _er = _edge[3][1];
|
||||
|
||||
if(_el == noone) { #region
|
||||
shader_set(sh_mk_tile55_edge_l);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b0100));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_el, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
} #endregion
|
||||
|
||||
if(_uer) { #region
|
||||
if(_er == noone) { #region
|
||||
shader_set(sh_mk_tile55_edge_r);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b1000));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_er, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
} #endregion
|
||||
|
||||
if(_uet) { #region
|
||||
if(_et == noone) { #region
|
||||
shader_set(sh_mk_tile55_edge_t);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b0001));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_et, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
} #endregion
|
||||
|
||||
if(_ueb) { #region
|
||||
if(_eb == noone) { #region
|
||||
shader_set(sh_mk_tile55_edge_b);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_f("crop", _crop);
|
||||
shader_set_i("edge", _index);
|
||||
shader_set_i("fullEdge", bool(_edgFull & 0b0010));
|
||||
shader_set_i("extendEdge", _edgExtn);
|
||||
|
||||
draw_surface_ext(_eb, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
|
@ -266,53 +339,115 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
var _edgType = _data[5];
|
||||
var _edgeShf = _data[10];
|
||||
var _edgFull = _data[11];
|
||||
var _edgSprt = _data[13];
|
||||
var _edges = _edgType == 0? [ _data[6], _data[6], _data[6], _data[6] ] : [ _data[6], _data[7], _data[8], _data[9] ];
|
||||
var _edge;
|
||||
|
||||
var _rt = [ 0, 180, 90, 270 ];
|
||||
var _sh = [ 1, 3, 2, 0 ];
|
||||
var _rot = [ 0, 180, 90, 270 ];
|
||||
var _shi = [ 1, 3, 2, 0 ];
|
||||
|
||||
var _sw = surface_get_width_safe(_tex0);
|
||||
var _sh = surface_get_height_safe(_tex0);
|
||||
var _pp;
|
||||
|
||||
for( var i = 0, n = array_length(__edge_buffer); i < n; i++ )
|
||||
__edge_buffer[i] = surface_verify(__edge_buffer[i], _sw, _sh);
|
||||
|
||||
for( var i = 0; i < 4; i++ ) {
|
||||
var _ed = _edges[i];
|
||||
if(!is_surface(_ed)) {
|
||||
edge_surface[i] = noone;
|
||||
continue;
|
||||
}
|
||||
var _ed = _edges[i];
|
||||
var _edShf = _edgeShf[_shi[i]];
|
||||
|
||||
var _ew = surface_get_width_safe(_ed);
|
||||
var _eh = surface_get_height_safe(_ed);
|
||||
|
||||
var _edShf = _edgeShf[_sh[i]];
|
||||
edge_surface[i] = [ noone, noone, noone ];
|
||||
if(!is_surface(_ed)) continue;
|
||||
|
||||
__edge_surface[i] = surface_verify(__edge_surface[i], _ew, _eh);
|
||||
surface_set_target(__edge_surface[i]);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE
|
||||
var _ew = surface_get_width_safe(_ed);
|
||||
var _eh = surface_get_height_safe(_ed);
|
||||
var _am = _edgSprt + 1;
|
||||
var _esw = _ew > _eh? _ew / _am : 0;
|
||||
var _esh = _ew > _eh? 0 : _eh / _am;
|
||||
|
||||
for( var j = 0; j < 3; j++ ) {
|
||||
var _sIndx = i * 3 + j;
|
||||
var _edBuf = _ed;
|
||||
|
||||
if(_edgType == 0) {
|
||||
var p = point_rotate(0, 0, _ew / 2, _eh / 2, _rt[i]);
|
||||
switch(i) {
|
||||
case 0 : p[1] += _edShf; break;
|
||||
case 1 : p[1] -= _edShf; break;
|
||||
case 2 : p[0] += _edShf; break;
|
||||
case 3 : p[0] -= _edShf; break;
|
||||
}
|
||||
|
||||
draw_surface_ext(_ed, p[0], p[1], 1, 1, _rt[i], c_white, 1);
|
||||
__edge_surface[_sIndx] = surface_verify(__edge_surface[_sIndx], _sw, _sh);
|
||||
|
||||
if(_edgSprt) {
|
||||
surface_set_target(__edge_buffer[0]); #region
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE
|
||||
|
||||
} else {
|
||||
switch(i) {
|
||||
case 0 : draw_surface(_ed, 0, _edShf); break;
|
||||
case 1 : draw_surface(_ed, 0, -_edShf); break;
|
||||
case 2 : draw_surface(_ed, _edShf, 0); break;
|
||||
case 3 : draw_surface(_ed, -_edShf, 0); break;
|
||||
if(_edgSprt == 1) {
|
||||
switch(j) {
|
||||
case 0 : draw_surface(_ed, -_esw * 0, -_esh * 0); break;
|
||||
case 1 : draw_surface(_ed, -_esw * 1, -_esh * 1); break;
|
||||
case 2 : draw_surface(_ed, -_esw * 0, -_esh * 0); break;
|
||||
}
|
||||
} else if(_edgSprt == 2) {
|
||||
switch(j) {
|
||||
case 0 : draw_surface(_ed, -_esw * 0, -_esh * 0); break;
|
||||
case 1 : draw_surface(_ed, -_esw * 1, -_esh * 1); break;
|
||||
case 2 : draw_surface(_ed, -_esw * 2, -_esh * 2); break;
|
||||
}
|
||||
}
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target(); #endregion
|
||||
|
||||
_edBuf = __edge_buffer[0];
|
||||
|
||||
if(_edgSprt == 1 && j == 2) {
|
||||
surface_set_target(__edge_buffer[1]); #region
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE
|
||||
|
||||
if(i == 0 || i == 1) draw_surface_ext(__edge_buffer[0], _sw, 0, -1, 1, 0, c_white, 1);
|
||||
if(i == 2 || i == 3) draw_surface_ext(__edge_buffer[0], 0, _sh, 1, -1, 0, c_white, 1);
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target(); #endregion
|
||||
|
||||
_edBuf = __edge_buffer[1];
|
||||
}
|
||||
}
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
edge_surface[i] = __edge_surface[i];
|
||||
surface_set_target(__edge_surface[_sIndx]); #region
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE
|
||||
|
||||
var _rr = 0;
|
||||
var _xx = 0;
|
||||
var _yy = 0;
|
||||
|
||||
if(_edgType == 0) {
|
||||
_rr = _rot[i];
|
||||
|
||||
if(_edgSprt) {
|
||||
if(i == 1 && j != 1) _rr += 180;
|
||||
if(i == 2 && j == 0) _rr += 180;
|
||||
if(i == 3 && j == 2) _rr += 180;
|
||||
}
|
||||
|
||||
_pp = point_rotate(0, 0, _sw / 2, _sh / 2, _rr);
|
||||
_xx = _pp[0];
|
||||
_yy = _pp[1];
|
||||
}
|
||||
|
||||
switch(i) {
|
||||
case 0 : _yy += _edShf; break;
|
||||
case 1 : _yy -= _edShf; break;
|
||||
case 2 : _xx += _edShf; break;
|
||||
case 3 : _xx -= _edShf; break;
|
||||
}
|
||||
|
||||
draw_surface_ext(_edBuf, _xx, _yy, 1, 1, _rr, c_white, 1);
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target(); #endregion
|
||||
|
||||
edge_surface[i][j] = __edge_surface[_sIndx];
|
||||
}
|
||||
}
|
||||
|
||||
_edge = edge_surface;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Tunnel In";
|
||||
color = COLORS.node_blend_tunnel;
|
||||
is_group_io = true;
|
||||
is_group_io = true;
|
||||
preview_draw = false;
|
||||
|
||||
w = 96;
|
||||
|
||||
|
@ -21,37 +22,6 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
_node.inputs[| 0].setValue(getInputData(0));
|
||||
} #endregion
|
||||
|
||||
static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) { #region
|
||||
var xx = _x + x * _s;
|
||||
var yy = _y + y * _s;
|
||||
|
||||
var hover = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx, yy, xx + w * _s, yy + h * _s);
|
||||
var tun = findPanel("Panel_Tunnels");
|
||||
hover |= tun && tun.tunnel_hover == self;
|
||||
if(!hover) return;
|
||||
|
||||
var _key = getInputData(0);
|
||||
var amo = ds_map_size(TUNNELS_OUT);
|
||||
var k = ds_map_find_first(TUNNELS_OUT);
|
||||
repeat(amo) {
|
||||
if(TUNNELS_OUT[? k] == _key && ds_map_exists(PROJECT.nodeMap, k)) {
|
||||
var node = PROJECT.nodeMap[? k];
|
||||
if(node.group != group) continue;
|
||||
|
||||
draw_set_color(COLORS.node_blend_tunnel);
|
||||
draw_set_alpha(0.35);
|
||||
var frx = xx + w * _s / 2;
|
||||
var fry = yy + h * _s / 2;
|
||||
var tox = _x + (node.x + node.w / 2) * _s;
|
||||
var toy = _y + (node.y + node.h / 2) * _s;
|
||||
draw_line_dashed(frx, fry, tox, toy, 8 * _s, 16 * _s, current_time / 10);
|
||||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
k = ds_map_find_next(TUNNELS_OUT, k);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) { onValueUpdate(); }
|
||||
|
||||
static resetMap = function() { #region
|
||||
|
@ -145,6 +115,37 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
return nodes;
|
||||
} #endregion
|
||||
|
||||
static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) { #region
|
||||
var xx = _x + x * _s;
|
||||
var yy = _y + y * _s;
|
||||
|
||||
var hover = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx, yy, xx + w * _s, yy + h * _s);
|
||||
var tun = findPanel("Panel_Tunnels");
|
||||
hover |= tun && tun.tunnel_hover == self;
|
||||
if(!hover) return;
|
||||
|
||||
var _key = getInputData(0);
|
||||
var amo = ds_map_size(TUNNELS_OUT);
|
||||
var k = ds_map_find_first(TUNNELS_OUT);
|
||||
repeat(amo) {
|
||||
if(TUNNELS_OUT[? k] == _key && ds_map_exists(PROJECT.nodeMap, k)) {
|
||||
var node = PROJECT.nodeMap[? k];
|
||||
if(node.group != group) continue;
|
||||
|
||||
draw_set_color(COLORS.node_blend_tunnel);
|
||||
draw_set_alpha(0.35);
|
||||
var frx = xx + w * _s / 2;
|
||||
var fry = yy + h * _s / 2;
|
||||
var tox = _x + (node.x + node.w / 2) * _s;
|
||||
var toy = _y + (node.y + node.h / 2) * _s;
|
||||
draw_line_dashed(frx, fry, tox, toy, 8 * _s, 16 * _s, current_time / 10);
|
||||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
k = ds_map_find_next(TUNNELS_OUT, k);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
|
||||
var str = string(getInputData(0));
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Tunnel Out";
|
||||
color = COLORS.node_blend_tunnel;
|
||||
is_group_io = true;
|
||||
is_group_io = true;
|
||||
preview_draw = false;
|
||||
|
||||
w = 96;
|
||||
|
||||
|
|
|
@ -1729,7 +1729,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
if(array_depth == 0 && !typeArray(display_type)) { //Value is not an array by default, and no array depth enforced
|
||||
if(_cac) cache_array[1] = true;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
var ar = val;
|
||||
|
|
13
scripts/real_number_functions/real_number_functions.gml
Normal file
13
scripts/real_number_functions/real_number_functions.gml
Normal file
|
@ -0,0 +1,13 @@
|
|||
function GCD(num1, num2) {
|
||||
if(num1 * num2 == 0) return 0;
|
||||
|
||||
if (num2 == 0) return num1;
|
||||
else return GCD(num2, num1 % num2);
|
||||
}
|
||||
|
||||
function GCDs(num1, num2) {
|
||||
if(num1 == num2) return 0;
|
||||
if(num1 % num2 == 0) return num2;
|
||||
if(num2 % num1 == 0) return num1;
|
||||
return 0;
|
||||
}
|
11
scripts/real_number_functions/real_number_functions.yy
Normal file
11
scripts/real_number_functions/real_number_functions.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "real_number_functions",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "math",
|
||||
"path": "folders/functions/math.yy",
|
||||
},
|
||||
}
|
|
@ -519,7 +519,8 @@ function __surface_array_deserialize(arr) {
|
|||
}
|
||||
|
||||
function surface_encode(surface) {
|
||||
if(!is_surface(surface)) return "";
|
||||
if(!is_real(surface)) return "";
|
||||
if(!surface_exists(surface)) return "";
|
||||
|
||||
var buff = buffer_create(surface_get_width_safe(surface) * surface_get_height_safe(surface) * 4, buffer_fixed, 1);
|
||||
buffer_get_surface(buff, surface, 0);
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
//////////////// 18 Tile Bottom ////////////////
|
||||
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -16,24 +17,30 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 2) {
|
||||
if(tx.x < w - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < w - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2] ) discard;
|
||||
|
||||
} else if(edge == 3) {
|
||||
|
||||
} else if(edge == 1) {
|
||||
if(tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 7) {
|
||||
if(tx.x + crop[2] < tx.y + crop[1]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[2] < tx.y + crop[1]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2]) discard;
|
||||
|
||||
} else if(edge == 11) {
|
||||
if(tx.x - crop[0] > h - tx.y - crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x - crop[0] > h - tx.y - crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 9) {
|
||||
if(tx.x + crop[2] > tx.y + crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[2] > tx.y + crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 6) {
|
||||
if(tx.x - crop[0] < h - tx.y - crop[1]) discard;
|
||||
if(fullEdge == 0 && tx.x - crop[0] < h - tx.y - crop[1]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2]) discard;
|
||||
|
||||
} else {
|
||||
discard;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
//////////////// 18 Tile Left ////////////////
|
||||
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -16,24 +17,30 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 8) {
|
||||
if(tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else if(edge == 10) {
|
||||
|
||||
} else if(edge == 2) {
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 11) {
|
||||
if(tx.x + crop[0] < h - tx.y + crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[0] < h - tx.y + crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else if(edge == 14) {
|
||||
if(tx.x + crop[0] < tx.y + crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[0] < tx.y + crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 6) {
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 9) {
|
||||
if(tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else {
|
||||
discard;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
//////////////// 18 Tile Right ////////////////
|
||||
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -16,24 +17,30 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 4) {
|
||||
if(tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else if(edge == 5) {
|
||||
|
||||
} else if(edge == 1) {
|
||||
if(tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 7) {
|
||||
if(tx.x + crop[0] > tx.y + crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[0] > tx.y + crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else if(edge == 13) {
|
||||
if(tx.x + crop[0] > h - tx.y + crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[0] > h - tx.y + crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 9) {
|
||||
if(tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 6) {
|
||||
if(tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else {
|
||||
discard;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
//////////////// 18 Tile Top ////////////////
|
||||
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -16,24 +17,30 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 8) {
|
||||
if(tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2] ) discard;
|
||||
|
||||
} else if(edge == 12) {
|
||||
|
||||
} else if(edge == 4) {
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 13) {
|
||||
if(tx.x - crop[2] < h - tx.y - crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x - crop[2] < h - tx.y - crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2]) discard;
|
||||
|
||||
} else if(edge == 14) {
|
||||
if(tx.x + crop[0] > tx.y + crop[1]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[0] > tx.y + crop[1]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 9) {
|
||||
if(tx.x - crop[2] < tx.y - crop[1]) discard;
|
||||
if(fullEdge == 0 && tx.x - crop[2] < tx.y - crop[1]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2]) discard;
|
||||
|
||||
} else if(edge == 6) {
|
||||
if(tx.x + crop[0] > h - tx.y + crop[3]) discard;
|
||||
if(fullEdge == 0 && tx.x + crop[0] > h - tx.y + crop[3]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else {
|
||||
discard;
|
||||
|
|
|
@ -6,6 +6,8 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -15,27 +17,35 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 22 || edge == 16 || edge == 18) {
|
||||
if(tx.x < w - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < w - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2] ) discard;
|
||||
|
||||
} else if(edge == 7 || edge == 24 || edge == 27 || edge == 30 || edge == 26 ) {
|
||||
|
||||
} else if(edge == 11 || edge == 8 || edge == 10) {
|
||||
if(tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 2 || edge == 0) {
|
||||
if(tx.x < w - tx.y) discard;
|
||||
if(tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < w - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2] ) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else {
|
||||
bool draw = false;
|
||||
|
||||
if(edge == 80 || edge == 120 || edge == 86 || edge == 127 || edge == 82 || edge == 123 || edge == 88 || edge == 95 || edge == 126 || edge == 122 || edge == 94 || edge == 91 || edge == 90) {
|
||||
if(tx.x + crop[2] >= tx.y + crop[1])
|
||||
if(fullEdge == 0 && tx.x + crop[2] >= tx.y + crop[1])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.x > w - crop[0]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
if(edge == 216 || edge == 72 || edge == 223 || edge == 75 || edge == 222 || edge == 74 || edge == 88 || edge == 219 || edge == 95 || edge == 218 || edge == 94 || edge == 91 || edge == 90) {
|
||||
if(tx.x - crop[0] < h - tx.y - crop[3])
|
||||
if(fullEdge == 0 && tx.x - crop[0] < h - tx.y - crop[3])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.x < crop[2]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -15,27 +17,35 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 208 || edge == 64 || edge == 80) {
|
||||
if(tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else if(edge == 148 || edge == 66 || edge == 86 || edge == 210 || edge == 82) {
|
||||
|
||||
} else if(edge == 22 || edge == 2 || edge == 18) {
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 16 || edge == 0) {
|
||||
if(tx.x > tx.y) discard;
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else {
|
||||
bool draw = false;
|
||||
|
||||
if(edge == 216 || edge == 72 || edge == 223 || edge == 75 || edge == 222 || edge == 74 || edge == 95 || edge == 88 || edge == 219 || edge == 218 || edge == 94 || edge == 91 || edge == 90) {
|
||||
if(tx.x - crop[0] >= h - tx.y - crop[3])
|
||||
if(fullEdge == 0 && tx.x - crop[0] >= h - tx.y - crop[3])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.y > h - crop[3]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
if(edge == 254 || edge == 106 || edge == 30 || edge == 10 || edge == 222 || edge == 74 || edge == 126 || edge == 250 || edge == 218 || edge == 122 || edge == 26 || edge == 94 || edge == 90) {
|
||||
if(tx.x - crop[0] > tx.y - crop[3])
|
||||
if(fullEdge == 0 && tx.x - crop[0] > tx.y - crop[3])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.y < crop[1]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -15,27 +17,35 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 104 || edge == 64 || edge == 72) {
|
||||
if(tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
|
||||
} else if(edge == 41 || edge == 66 || edge == 75 || edge == 106 || edge == 74) {
|
||||
|
||||
} else if(edge == 11 || edge == 2 || edge == 10) {
|
||||
if(tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else if(edge == 8 || edge == 0) {
|
||||
if(tx.x < h - tx.y) discard;
|
||||
if(tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y < crop[1]) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.y > h - crop[3]) discard;
|
||||
|
||||
} else {
|
||||
bool draw = false;
|
||||
|
||||
if(edge == 80 || edge == 120 || edge == 86 || edge == 127 || edge == 82 || edge == 123 || edge == 88 || edge == 95 || edge == 126 || edge == 122 || edge == 94 || edge == 91 || edge == 90) {
|
||||
if(tx.x - crop[0] <= tx.y - crop[3])
|
||||
if(fullEdge == 0 && tx.x - crop[0] <= tx.y - crop[3])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.y > h - crop[3]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
if(edge == 210 || edge == 251 || edge == 18 || edge == 27 || edge == 82 || edge == 123 || edge == 219 || edge == 250 || edge == 218 || edge == 122 || edge == 26 || edge == 91 || edge == 90) {
|
||||
if(tx.x - crop[0] < h - tx.y - crop[3])
|
||||
if(fullEdge == 0 && tx.x - crop[0] < h - tx.y - crop[3])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.y < crop[1]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
uniform vec4 crop;
|
||||
uniform int edge;
|
||||
uniform int fullEdge;
|
||||
uniform int extendEdge;
|
||||
|
||||
void main() {
|
||||
float w = dimension.x;
|
||||
|
@ -15,27 +17,35 @@ void main() {
|
|||
gl_FragColor = vec4(0.);
|
||||
|
||||
if(edge == 208 || edge == 16 || edge == 80) {
|
||||
if(tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2] ) discard;
|
||||
|
||||
} else if(edge == 224 || edge == 24 || edge == 120 || edge == 216 || edge == 88) {
|
||||
|
||||
} else if(edge == 104 || edge == 8 || edge == 72) {
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else if(edge == 64 || edge == 0) {
|
||||
if(tx.x < tx.y) discard;
|
||||
if(tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x < tx.y) discard;
|
||||
if(fullEdge == 0 && tx.x > h - tx.y) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x < crop[2] ) discard;
|
||||
if(fullEdge == 1 && extendEdge == 0 && tx.x > w - crop[0]) discard;
|
||||
|
||||
} else {
|
||||
bool draw = false;
|
||||
|
||||
if(edge == 210 || edge == 251 || edge == 18 || edge == 27 || edge == 82 || edge == 123 || edge == 219 || edge == 250 || edge == 218 || edge == 122 || edge == 26 || edge == 91 || edge == 90) {
|
||||
if(tx.x - crop[2] >= h - tx.y - crop[3])
|
||||
if(fullEdge == 0 && tx.x - crop[2] >= h - tx.y - crop[3])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.x < crop[2]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
if(edge == 254 || edge == 106 || edge == 30 || edge == 10 || edge == 222 || edge == 74 || edge == 126 || edge == 250 || edge == 218 || edge == 122 || edge == 26 || edge == 94 || edge == 90) {
|
||||
if(tx.x + crop[0] <= tx.y + crop[1])
|
||||
if(fullEdge == 0 && tx.x + crop[0] <= tx.y + crop[1])
|
||||
draw = true;
|
||||
if(fullEdge == 1 && (extendEdge == 1 || tx.x > w - crop[0]))
|
||||
draw = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue