mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 03:18:03 +01:00
DynaSurf width, height
This commit is contained in:
parent
20527a2a63
commit
1fffd38ba9
132 changed files with 488 additions and 414 deletions
|
@ -549,6 +549,7 @@
|
|||
{"name":"s_node_pack_sprite","order":5,"path":"sprites/s_node_pack_sprite/s_node_pack_sprite.yy",},
|
||||
{"name":"surface_valid","order":6,"path":"scripts/surface_valid/surface_valid.yy",},
|
||||
{"name":"sh_blur_zoom","order":5,"path":"shaders/sh_blur_zoom/sh_blur_zoom.yy",},
|
||||
{"name":"node_isosurf","order":4,"path":"scripts/node_isosurf/node_isosurf.yy",},
|
||||
{"name":"node_VFX_renderer","order":3,"path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",},
|
||||
{"name":"s_node_pb_fx_stack","order":2,"path":"sprites/s_node_pb_fx_stack/s_node_pb_fx_stack.yy",},
|
||||
{"name":"fd_draw_sprite_to_collision_mask_surface","order":1,"path":"scripts/fd_draw_sprite_to_collision_mask_surface/fd_draw_sprite_to_collision_mask_surface.yy",},
|
||||
|
|
|
@ -1117,6 +1117,7 @@
|
|||
{"id":{"name":"surface_valid","path":"scripts/surface_valid/surface_valid.yy",},},
|
||||
{"id":{"name":"steam_ugc_collection","path":"scripts/steam_ugc_collection/steam_ugc_collection.yy",},},
|
||||
{"id":{"name":"sh_blur_zoom","path":"shaders/sh_blur_zoom/sh_blur_zoom.yy",},},
|
||||
{"id":{"name":"node_isosurf","path":"scripts/node_isosurf/node_isosurf.yy",},},
|
||||
{"id":{"name":"node_VFX_renderer","path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",},},
|
||||
{"id":{"name":"s_node_pb_fx_stack","path":"sprites/s_node_pb_fx_stack/s_node_pb_fx_stack.yy",},},
|
||||
{"id":{"name":"fd_draw_sprite_to_collision_mask_surface","path":"scripts/fd_draw_sprite_to_collision_mask_surface/fd_draw_sprite_to_collision_mask_surface.yy",},},
|
||||
|
|
Binary file not shown.
|
@ -72,8 +72,8 @@ event_inherited();
|
|||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, fx, _y, ww, hg);
|
||||
if(thmb && _y + hg > 0 && _y < sp_recent.h) {
|
||||
var sw = surface_get_width(thmb);
|
||||
var sh = surface_get_height(thmb);
|
||||
var sw = surface_get_width_safe(thmb);
|
||||
var sh = surface_get_height_safe(thmb);
|
||||
|
||||
var ss = (ww - ui(8)) / sw;
|
||||
var sy = (((sh * ss) - hg) * clamp((_y + hg) / (sp_recent.h + hg), 0, 1)) / ss;
|
||||
|
|
|
@ -79,6 +79,8 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
|
|||
case VALUE_TYPE.buffer :
|
||||
draw_tooltip_buffer(content);
|
||||
break;
|
||||
default :
|
||||
draw_tooltip_text(string(content));
|
||||
}
|
||||
} else if(TOOLTIP != "")
|
||||
draw_tooltip_text(TOOLTIP);
|
||||
|
|
|
@ -195,8 +195,8 @@ function __part(_node) constructor {
|
|||
scy = sc_sy * scCurve;
|
||||
|
||||
var _xx, _yy;
|
||||
var s_w = surface_get_width(ss) * scx;
|
||||
var s_h = surface_get_height(ss) * scy;
|
||||
var s_w = surface_get_width_safe(ss) * scx;
|
||||
var s_h = surface_get_height_safe(ss) * scy;
|
||||
|
||||
if(boundary_data == -1) {
|
||||
var _pp = point_rotate(-s_w / 2, -s_h / 2, 0, 0, rot);
|
||||
|
|
|
@ -147,7 +147,7 @@ function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
var str = 1;
|
||||
|
||||
if(is_surface(_dspTex)) {
|
||||
var c = surface_getpixel(_dspTex, v.textures[_texI][0] * surface_get_width(_dspTex), v.textures[_texI][1] * surface_get_height(_dspTex));
|
||||
var c = surface_getpixel(_dspTex, v.textures[_texI][0] * surface_get_width_safe(_dspTex), v.textures[_texI][1] * surface_get_height_safe(_dspTex));
|
||||
var r = color_get_red(c) / 255;
|
||||
var g = color_get_green(c) / 255;
|
||||
var b = color_get_blue(c) / 255;
|
||||
|
|
|
@ -129,8 +129,8 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var _smt = getSingleValue(19, index);
|
||||
|
||||
if(!is_surface(_ins)) return noone;
|
||||
var ww = surface_get_width(_ins);
|
||||
var hh = surface_get_height(_ins);
|
||||
var ww = surface_get_width_safe(_ins);
|
||||
var hh = surface_get_height_safe(_ins);
|
||||
|
||||
var tw = 1 / ww;
|
||||
var th = 1 / hh;
|
||||
|
@ -159,8 +159,8 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
}
|
||||
|
||||
if(useH) {
|
||||
var hgw = surface_get_width(_hei);
|
||||
var hgh = surface_get_height(_hei);
|
||||
var hgw = surface_get_width_safe(_hei);
|
||||
var hgh = surface_get_height_safe(_hei);
|
||||
var hgtW = hgw / ww;
|
||||
var hgtH = hgh / hh;
|
||||
|
||||
|
@ -479,8 +479,8 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var _cam = new __3d_camera(_proj, _fov);
|
||||
|
||||
if(_smt) {
|
||||
var ww = surface_get_width(_ins);
|
||||
var hh = surface_get_height(_ins);
|
||||
var ww = surface_get_width_safe(_ins);
|
||||
var hh = surface_get_height_safe(_ins);
|
||||
|
||||
var ts = surface_create(ww, hh);
|
||||
surface_set_shader(ts, sh_3d_extrude_corner);
|
||||
|
|
|
@ -153,8 +153,8 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
switch(_out_type) {
|
||||
case OUTPUT_SCALING.same_as_input :
|
||||
inputs[| 5].setVisible(false);
|
||||
_ww = surface_get_width(_data[0]);
|
||||
_hh = surface_get_height(_data[0]);
|
||||
_ww = surface_get_width_safe(_data[0]);
|
||||
_hh = surface_get_height_safe(_data[0]);
|
||||
break;
|
||||
case OUTPUT_SCALING.constant :
|
||||
inputs[| 5].setVisible(true);
|
||||
|
@ -163,8 +163,8 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
break;
|
||||
case OUTPUT_SCALING.relative :
|
||||
inputs[| 5].setVisible(true);
|
||||
_ww = surface_get_width(_data[0]) * _out[0];
|
||||
_hh = surface_get_height(_data[0]) * _out[1];
|
||||
_ww = surface_get_width_safe(_data[0]) * _out[0];
|
||||
_hh = surface_get_height_safe(_data[0]) * _out[1];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ function SurfaceAtlas(surface, position = [ 0, 0 ], rotation = 0, scale = [ 1, 1
|
|||
function Surface(surface) constructor {
|
||||
static set = function(surface) {
|
||||
self.surface = surface;
|
||||
w = surface_get_width(surface);
|
||||
h = surface_get_height(surface);
|
||||
w = surface_get_width_safe(surface);
|
||||
h = surface_get_height_safe(surface);
|
||||
format = surface_get_format(surface);
|
||||
}
|
||||
set(surface);
|
||||
|
|
|
@ -206,8 +206,8 @@
|
|||
[ "surface_copy", surface_copy ],
|
||||
[ "surface_copy_part", surface_copy_part ],
|
||||
[ "surface_depth_disable", surface_depth_disable ],
|
||||
[ "surface_get_height", surface_get_height ],
|
||||
[ "surface_get_width", surface_get_width ],
|
||||
[ "surface_get_height_safe", surface_get_height_safe ],
|
||||
[ "surface_get_width_safe", surface_get_width_safe ],
|
||||
[ "surface_get_texture", surface_get_texture ],
|
||||
[ "surface_get_depth_disable", surface_get_depth_disable ],
|
||||
[ "surface_getpixel", surface_getpixel ],
|
||||
|
|
|
@ -207,7 +207,7 @@ function array_get_dimension(arr) {
|
|||
function array_shape(arr, first = true, isSurface = false) {
|
||||
if(!is_array(arr)) {
|
||||
if(isSurface && is_surface(arr))
|
||||
return (first? "" : " x ") + string(surface_get_width(arr)) + " x " + string(surface_get_height(arr)) + " px";
|
||||
return (first? "" : " x ") + string(surface_get_width_safe(arr)) + " x " + string(surface_get_height_safe(arr)) + " px";
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampl
|
|||
static uni_ovc = shader_get_uniform(sh_blur_gaussian, "overColor");
|
||||
|
||||
var format = surface_get_format(surface)
|
||||
__blur_hori = surface_verify(__blur_hori, surface_get_width(surface), surface_get_height(surface), format);
|
||||
__blur_vert = surface_verify(__blur_vert, surface_get_width(surface), surface_get_height(surface), format);
|
||||
__blur_hori = surface_verify(__blur_hori, surface_get_width_safe(surface), surface_get_height_safe(surface), format);
|
||||
__blur_vert = surface_verify(__blur_vert, surface_get_width_safe(surface), surface_get_height_safe(surface), format);
|
||||
|
||||
#region kernel generation
|
||||
size = max(1, round(size));
|
||||
|
@ -38,7 +38,7 @@ function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampl
|
|||
draw_clear_alpha(bg_c, bg);
|
||||
|
||||
shader_set(sh_blur_gaussian);
|
||||
shader_set_uniform_f_array_safe(uni_dim, [ surface_get_width(surface), surface_get_height(surface) ]);
|
||||
shader_set_uniform_f_array_safe(uni_dim, [ surface_get_width_safe(surface), surface_get_height_safe(surface) ]);
|
||||
shader_set_uniform_f_array_safe(uni_wei, gau_array);
|
||||
|
||||
shader_set_uniform_i(uni_bor, sampleMode);
|
||||
|
|
|
@ -33,11 +33,11 @@ function buffer_from_surface(surface, size = true) {
|
|||
|
||||
var bitSize = surface_format_get_bytes(surface_get_format(surface));
|
||||
|
||||
var _b = buffer_create((header_length * size) + surface_get_width(surface) * surface_get_height(surface) * bitSize, buffer_fixed, 1);
|
||||
var _b = buffer_create((header_length * size) + surface_get_width_safe(surface) * surface_get_height_safe(surface) * bitSize, buffer_fixed, 1);
|
||||
if(size) {
|
||||
buffer_write(_b, buffer_text, "PXCS");
|
||||
buffer_write(_b, buffer_u16, surface_get_width(surface));
|
||||
buffer_write(_b, buffer_u16, surface_get_height(surface));
|
||||
buffer_write(_b, buffer_u16, surface_get_width_safe(surface));
|
||||
buffer_write(_b, buffer_u16, surface_get_height_safe(surface));
|
||||
buffer_write(_b, buffer_u8, surface_get_format(surface));
|
||||
}
|
||||
|
||||
|
|
|
@ -175,8 +175,8 @@ function __3dScene(camera) constructor {
|
|||
static ssaoPass = function(deferData) { #region
|
||||
if(!ssao_enabled) return;
|
||||
|
||||
var _sw = surface_get_width(deferData.geometry_data[0]);
|
||||
var _sh = surface_get_height(deferData.geometry_data[0]);
|
||||
var _sw = surface_get_width_safe(deferData.geometry_data[0]);
|
||||
var _sh = surface_get_height_safe(deferData.geometry_data[0]);
|
||||
var _ssao_surf = surface_create(_sw, _sh);
|
||||
|
||||
surface_set_shader(_ssao_surf, sh_d3d_ssao);
|
||||
|
|
|
@ -29,8 +29,8 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _
|
|||
var _surface = surface;
|
||||
var _height = height;
|
||||
|
||||
var ww = surface_get_width(_surface);
|
||||
var hh = surface_get_height(_surface);
|
||||
var ww = surface_get_width_safe(_surface);
|
||||
var hh = surface_get_height_safe(_surface);
|
||||
|
||||
surface_w = ww;
|
||||
surface_h = hh;
|
||||
|
@ -61,8 +61,8 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _
|
|||
}
|
||||
|
||||
if(useH) {
|
||||
var hgw = surface_get_width(_height);
|
||||
var hgh = surface_get_height(_height);
|
||||
var hgw = surface_get_width_safe(_height);
|
||||
var hgh = surface_get_height_safe(_height);
|
||||
var hgtW = hgw / ww;
|
||||
var hgtH = hgh / hh;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
function get_point_from_dist(distMap, attempt = 4) {
|
||||
if(!is_surface(distMap)) return noone;
|
||||
|
||||
var w = surface_get_width(distMap);
|
||||
var h = surface_get_height(distMap);
|
||||
var w = surface_get_width_safe(distMap);
|
||||
var h = surface_get_height_safe(distMap);
|
||||
var v = 0;
|
||||
var res = noone;
|
||||
|
||||
|
@ -33,7 +33,7 @@ function get_points_from_dist(distMap, amount, seed = 0, attempt = 8) {
|
|||
BLEND_OVERRIDE;
|
||||
shader_set(sh_sample_points);
|
||||
shader_set_uniform_f(shader_get_uniform(sh_sample_points, "dimension"),
|
||||
surface_get_width(distMap) / amount, surface_get_height(distMap));
|
||||
surface_get_width_safe(distMap) / amount, surface_get_height_safe(distMap));
|
||||
shader_set_uniform_i(shader_get_uniform(sh_sample_points, "attempt"), attempt);
|
||||
shader_set_uniform_f(shader_get_uniform(sh_sample_points, "seed"), seed);
|
||||
|
||||
|
@ -47,8 +47,8 @@ function get_points_from_dist(distMap, amount, seed = 0, attempt = 8) {
|
|||
buffer_seek(b, buffer_seek_start, 0);
|
||||
|
||||
var pos = array_create(amount);
|
||||
var w = surface_get_width(distMap);
|
||||
var h = surface_get_height(distMap);
|
||||
var w = surface_get_width_safe(distMap);
|
||||
var h = surface_get_height_safe(distMap);
|
||||
|
||||
for( var i = 0; i < amount; i++ ) {
|
||||
var cc = buffer_read(b, buffer_u32);
|
||||
|
|
|
@ -4,8 +4,8 @@ function draw_sprite_fit(spr, ind, xx, yy, w, h, color = c_white, alpha = 1) {
|
|||
}
|
||||
|
||||
function draw_surface_fit(surf, xx, yy, w, h, color = c_white, alpha = 1) {
|
||||
var ss = min(w / surface_get_width(surf), h / surface_get_height(surf));
|
||||
draw_surface_ext_safe(surf, xx - surface_get_width(surf) * ss / 2, yy - surface_get_height(surf) * ss / 2, ss, ss,, color, alpha);
|
||||
var ss = min(w / surface_get_width_safe(surf), h / surface_get_height_safe(surf));
|
||||
draw_surface_ext_safe(surf, xx - surface_get_width_safe(surf) * ss / 2, yy - surface_get_height_safe(surf) * ss / 2, ss, ss,, color, alpha);
|
||||
}
|
||||
|
||||
function draw_surface_stretch_fit(surf, xx, yy, w, h, sw, sh) {
|
||||
|
|
|
@ -32,15 +32,15 @@ function draw_surface_blend(background, foreground, blend = 0, alpha = 1, _pre_a
|
|||
var uniform_presalpha = shader_get_uniform(sh, "preserveAlpha");
|
||||
|
||||
var surf = surface_get_target();
|
||||
var surf_w = surface_get_width(surf);
|
||||
var surf_h = surface_get_height(surf);
|
||||
var surf_w = surface_get_width_safe(surf);
|
||||
var surf_h = surface_get_height_safe(surf);
|
||||
|
||||
if(is_surface(foreground)) {
|
||||
shader_set(sh);
|
||||
texture_set_stage(uniform_foreground, surface_get_texture(foreground));
|
||||
if(_mask) texture_set_stage(uniform_mask, surface_get_texture(_mask));
|
||||
shader_set_uniform_i(uniform_is_mask, _mask != 0? 1 : 0);
|
||||
shader_set_uniform_f_array(uniform_dim_rat, [ surface_get_width(background) / surface_get_width(foreground), surface_get_height(background) / surface_get_height(foreground) ]);
|
||||
shader_set_uniform_f_array(uniform_dim_rat, [ surface_get_width_safe(background) / surface_get_width_safe(foreground), surface_get_height_safe(background) / surface_get_height_safe(foreground) ]);
|
||||
shader_set_uniform_f(uniform_alpha, alpha);
|
||||
shader_set_uniform_i(uniform_presalpha, _pre_alp);
|
||||
shader_set_uniform_i(uniform_tile, tile);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
function draw_surface_align(surface, _x, _y, _s, _halign = fa_left, _valign = fa_top) {
|
||||
if(!is_surface(surface)) return;
|
||||
|
||||
var w = surface_get_width(surface) * _s;
|
||||
var h = surface_get_height(surface) * _s;
|
||||
var w = surface_get_width_safe(surface) * _s;
|
||||
var h = surface_get_height_safe(surface) * _s;
|
||||
|
||||
var _sx = _x, _sy = _y;
|
||||
switch(_halign) {
|
||||
|
|
|
@ -84,8 +84,8 @@ function draw_tooltip_surface_array(surf) {
|
|||
var i = floor(ind / col);
|
||||
var j = safe_mod(ind, col);
|
||||
|
||||
var sw = surface_get_width(surf[ind]);
|
||||
var sh = surface_get_height(surf[ind]);
|
||||
var sw = surface_get_width_safe(surf[ind]);
|
||||
var sh = surface_get_height_safe(surf[ind]);
|
||||
var ss = nn / max(sw, sh);
|
||||
var cx = mx + ui(8) + j * nn + nn / 2;
|
||||
var cy = my + ui(8) + i * nn + nn / 2;
|
||||
|
@ -103,8 +103,8 @@ function draw_tooltip_surface(surf) {
|
|||
}
|
||||
if(!is_surface(surf)) return;
|
||||
|
||||
var sw = surface_get_width(surf);
|
||||
var sh = surface_get_height(surf);
|
||||
var sw = surface_get_width_safe(surf);
|
||||
var sh = surface_get_height_safe(surf);
|
||||
|
||||
var ss = min(ui(128) / sw, ui(128) / sh);
|
||||
|
||||
|
@ -146,8 +146,8 @@ function draw_tooltip_atlas(atlas) {
|
|||
|
||||
if(!is_surface(surf)) continue;
|
||||
|
||||
var sw = surface_get_width(surf);
|
||||
var sh = surface_get_height(surf);
|
||||
var sw = surface_get_width_safe(surf);
|
||||
var sh = surface_get_height_safe(surf);
|
||||
|
||||
var ss = min(ui(48) / sw, ui(48) / sh);
|
||||
draw_surface_ext_safe(surf, sx, _y, ss, ss);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function dynaSurf() constructor {
|
||||
function DynaSurf() constructor {
|
||||
surfaces = [];
|
||||
|
||||
static getWidth = function() { return 1; }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function dynaSurf_iso_4() : dynaSurf() constructor {
|
||||
function dynaSurf_iso_4() : DynaSurf() constructor {
|
||||
surfaces = array_create(4, noone);
|
||||
|
||||
static getSurface = function(_rot) {
|
||||
|
|
|
@ -801,7 +801,7 @@ function gameframe_caption_get_overlap() {
|
|||
if (window_get_fullscreen() || gameframe_isFullscreen_hx) return 0.;
|
||||
var _h = gameframe_caption_get_height();
|
||||
var _rect = application_get_position();
|
||||
return max(0, _h - _rect[1]) / ((_rect[2] - _rect[0]) / surface_get_width(application_surface));
|
||||
return max(0, _h - _rect[1]) / ((_rect[2] - _rect[0]) / surface_get_width_safe(application_surface));
|
||||
}
|
||||
|
||||
function gameframe_caption_draw_border_default(__x, __y, __width, __height) {
|
||||
|
|
|
@ -160,7 +160,7 @@ function gif_std_enum_getIndex() {
|
|||
surface_set_target(_ws);
|
||||
draw_clear(16777215);
|
||||
surface_reset_target();
|
||||
_white32 = sprite_create_from_surface(_ws, 0, 0, surface_get_width(_ws), surface_get_height(_ws), false, false, 0, 0);
|
||||
_white32 = sprite_create_from_surface(_ws, 0, 0, surface_get_width_safe(_ws), surface_get_height_safe(_ws), false, false, 0, 0);
|
||||
surface_free(_ws);
|
||||
Gif_white32 = _white32;
|
||||
}
|
||||
|
@ -182,11 +182,11 @@ function gif_std_enum_getIndex() {
|
|||
surface_copy(_sf, _frame.x, _frame.y, _frame.surface);
|
||||
|
||||
if (_spr == -1) {
|
||||
_spr = sprite_create_from_surface(_sf, 0, 0, surface_get_width(_sf), surface_get_height(_sf), false, false, 0, 0);
|
||||
_spr = sprite_create_from_surface(_sf, 0, 0, surface_get_width_safe(_sf), surface_get_height_safe(_sf), false, false, 0, 0);
|
||||
} else {
|
||||
//spr_size = sprite_get_width(_spr) * sprite_get_height(_spr) * sprite_get_number(_spr);
|
||||
//show_debug_message(string(spr_size));
|
||||
sprite_add_from_surface(_spr, _sf, 0, 0, surface_get_width(_sf), surface_get_height(_sf), false, false);
|
||||
sprite_add_from_surface(_spr, _sf, 0, 0, surface_get_width_safe(_sf), surface_get_height_safe(_sf), false, false);
|
||||
}
|
||||
|
||||
var _fdelay = _frame.delay;
|
||||
|
@ -234,7 +234,7 @@ function gif_std_enum_getIndex() {
|
|||
surface_set_target(_ws);
|
||||
draw_clear(16777215);
|
||||
surface_reset_target();
|
||||
_white32 = sprite_create_from_surface(_ws, 0, 0, surface_get_width(_ws), surface_get_height(_ws), false, false, 0, 0);
|
||||
_white32 = sprite_create_from_surface(_ws, 0, 0, surface_get_width_safe(_ws), surface_get_height_safe(_ws), false, false, 0, 0);
|
||||
surface_free(_ws);
|
||||
Gif_white32 = _white32;
|
||||
}
|
||||
|
@ -255,11 +255,11 @@ function gif_std_enum_getIndex() {
|
|||
surface_copy(_sf, _frame.x, _frame.y, _frame.surface);
|
||||
|
||||
if (_spr == -1) {
|
||||
_spr = sprite_create_from_surface(_sf, 0, 0, surface_get_width(_sf), surface_get_height(_sf), false, false, 0, 0);
|
||||
_spr = sprite_create_from_surface(_sf, 0, 0, surface_get_width_safe(_sf), surface_get_height_safe(_sf), false, false, 0, 0);
|
||||
} else {
|
||||
//spr_size = sprite_get_width(_spr) * sprite_get_height(_spr) * sprite_get_number(_spr);
|
||||
//show_debug_message(string(spr_size));
|
||||
sprite_add_from_surface(_spr, _sf, 0, 0, surface_get_width(_sf), surface_get_height(_sf), false, false);
|
||||
sprite_add_from_surface(_spr, _sf, 0, 0, surface_get_width_safe(_sf), surface_get_height_safe(_sf), false, false);
|
||||
}
|
||||
|
||||
var _fdelay = _frame.delay;
|
||||
|
|
|
@ -56,8 +56,8 @@ function histogramUpdate(surface) {
|
|||
if(!is_surface(surface)) return;
|
||||
|
||||
histMax = 0;
|
||||
var sw = surface_get_width(surface);
|
||||
var sh = surface_get_height(surface);
|
||||
var sw = surface_get_width_safe(surface);
|
||||
var sh = surface_get_height_safe(surface);
|
||||
var stw = max(1, sw / attributes.preview_sample);
|
||||
var sth = max(1, sh / attributes.preview_sample);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ function mask_apply(original, edited, mask, mix = 1) {
|
|||
|
||||
shader_set_uniform_f(shader_get_uniform(sh_mask, "mixRatio"), mix);
|
||||
|
||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width(original), surface_get_height(original));
|
||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width_safe(original), surface_get_height_safe(original));
|
||||
shader_reset();
|
||||
surface_reset_target();
|
||||
|
||||
|
|
|
@ -51,16 +51,16 @@ function Node_3D_Depth(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
DRAW_CLEAR
|
||||
|
||||
shader_set_surface("texMap", _tex);
|
||||
shader_set_f("dimension", surface_get_width(_tex), surface_get_height(_tex));
|
||||
shader_set_f("dimension", surface_get_width_safe(_tex), surface_get_height_safe(_tex));
|
||||
|
||||
shader_set_surface("depthMap", _dep);
|
||||
shader_set_f("depthDimension", surface_get_width(_dep), surface_get_height(_dep));
|
||||
shader_set_f("depthDimension", surface_get_width_safe(_dep), surface_get_height_safe(_dep));
|
||||
|
||||
shader_set_f("cameraPos", _cx, _cy, _cz);
|
||||
shader_set_f("cameraUp", up_x, up_y, up_z);
|
||||
shader_set_f("cameraRight", right_x, right_y, right_z);
|
||||
|
||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width(_tex), surface_get_height(_tex));
|
||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width_safe(_tex), surface_get_height_safe(_tex));
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -27,7 +27,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
if(index == 0) {
|
||||
var s = inputs[| 0].getValue();
|
||||
if(is_array(s)) s = s[0];
|
||||
inputs[| 1].setValue([surface_get_width(s), surface_get_height(s)]);
|
||||
inputs[| 1].setValue([surface_get_width_safe(s), surface_get_height_safe(s)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,8 +123,8 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
shader_set_interpolation(_inSurf);
|
||||
var ww = _dim[0];
|
||||
var hh = _dim[1];
|
||||
var in_w = surface_get_width(_inSurf);
|
||||
var in_h = surface_get_height(_inSurf);
|
||||
var in_w = surface_get_width_safe(_inSurf);
|
||||
var in_h = surface_get_height_safe(_inSurf);
|
||||
var sp_r = _splice[0];
|
||||
var sp_t = _splice[1];
|
||||
var sp_l = _splice[2];
|
||||
|
|
|
@ -18,7 +18,7 @@ function Node_FXAA(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_shader(_outSurf, sh_FXAA);
|
||||
gpu_set_tex_filter(true);
|
||||
shader_set_f("dimension", surface_get_width(_data[0]), surface_get_height(_data[0]));
|
||||
shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
gpu_set_tex_filter(false);
|
||||
surface_reset_shader();
|
||||
|
|
|
@ -92,8 +92,8 @@ function Node_VFX_Renderer(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
else if(_blend == PARTICLE_BLEND_MODE.additive)
|
||||
BLEND_ADD;
|
||||
|
||||
var surf_w = surface_get_width(_outSurf);
|
||||
var surf_h = surface_get_height(_outSurf);
|
||||
var surf_w = surface_get_width_safe(_outSurf);
|
||||
var surf_h = surface_get_height_safe(_outSurf);
|
||||
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var parts = inputs[| i].getValue(_time);
|
||||
|
|
|
@ -102,7 +102,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
|
|||
|
||||
var cx = xx + w * _s / 2;
|
||||
var cy = yy + h * _s / 2;
|
||||
var ss = min((w - 8) / surface_get_width(spr), (h - 8) / surface_get_height(spr)) * _s;
|
||||
var ss = min((w - 8) / surface_get_width_safe(spr), (h - 8) / surface_get_height_safe(spr)) * _s;
|
||||
draw_surface_align(spr, cx, cy, ss, fa_center, fa_center);
|
||||
}
|
||||
}
|
|
@ -26,7 +26,7 @@ function Node_Alpha_Hash(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_data[0]), surface_get_height(_data[0]));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||
shader_set_uniform_f_array_safe(uniform_dit, dither8);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
|
|
@ -132,8 +132,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
for( var i = 0, n = array_length(_sdata); i < n; i++ ) {
|
||||
var _sid = _sdata[i][0];
|
||||
var _surf = _sdata[i][1];
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
var _ss = (_hh - 8) / _sh;
|
||||
|
||||
draw_surface_ext_safe(_surf, _sx, _sy, _ss, _ss, 0, c_white, 1);
|
||||
|
@ -281,8 +281,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
var _sy1 = _sy0 + ssh;
|
||||
draw_rectangle(_sx0, _sy0, _sx1, _sy1, true);
|
||||
|
||||
var _ssw = surface_get_width(_surf);
|
||||
var _ssh = surface_get_height(_surf);
|
||||
var _ssw = surface_get_width_safe(_surf);
|
||||
var _ssh = surface_get_height_safe(_surf);
|
||||
var _sss = min(ssh / _ssw, ssh / _ssh);
|
||||
draw_surface_ext_safe(_surf, _sx0, _sy0, _sss, _sss, 0, c_white, 1);
|
||||
|
||||
|
@ -556,8 +556,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
_tran[TRANSFORM.rot] = sa;
|
||||
} else if(drag_type == NODE_COMPOSE_DRAG.scale) {
|
||||
var _rot = _aang * (_pang? _bone.angle : _bone.pose_local_angle) + _tran[TRANSFORM.rot];
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
|
||||
var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot);
|
||||
var sca_x = _p[0] / _s / _sw * 2;
|
||||
|
@ -621,8 +621,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
_sca[1] *= _psca? _bone.pose_scale : _bone.pose_local_scale;
|
||||
}
|
||||
|
||||
var _ww = surface_get_width(_surf);
|
||||
var _hh = surface_get_height(_surf);
|
||||
var _ww = surface_get_width_safe(_surf);
|
||||
var _hh = surface_get_height_safe(_surf);
|
||||
var _sw = _ww * _sca[0];
|
||||
var _sh = _hh * _sca[1];
|
||||
|
||||
|
@ -836,8 +836,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
_sca[1] *= _psca? _b.pose_scale : _b.pose_local_scale;
|
||||
}
|
||||
|
||||
var _ww = surface_get_width(_s);
|
||||
var _hh = surface_get_height(_s);
|
||||
var _ww = surface_get_width_safe(_s);
|
||||
var _hh = surface_get_height_safe(_s);
|
||||
var _sw = _ww * _sca[0];
|
||||
var _sh = _hh * _sca[1];
|
||||
|
||||
|
@ -887,8 +887,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
|
||||
_b = boneMap[? _b];
|
||||
|
||||
var _cx = surface_get_width(_surf) / 2;
|
||||
var _cy = surface_get_height(_surf) / 2;
|
||||
var _cx = surface_get_width_safe(_surf) / 2;
|
||||
var _cy = surface_get_height_safe(_surf) / 2;
|
||||
|
||||
var _anc = _b.getPoint(0.5);
|
||||
var _rot = _arot? -_b.angle : 0;
|
||||
|
|
|
@ -20,7 +20,7 @@ function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(sh_atlas);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
if(_output_index == 1)
|
||||
return array_safe_get(colors, _array_index);
|
||||
|
||||
var side = max(surface_get_width(inSurf), surface_get_height(inSurf));
|
||||
var side = max(surface_get_width_safe(inSurf), surface_get_height_safe(inSurf));
|
||||
var lop = ceil(log2(side));
|
||||
var cc;
|
||||
side = power(2, lop);
|
||||
|
|
|
@ -49,8 +49,8 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
var _surf = current_data[0];
|
||||
if(!is_surface(_surf)) return;
|
||||
|
||||
var _pw = surface_get_width(_surf) * _s / 2;
|
||||
var _ph = surface_get_height(_surf) * _s / 2;
|
||||
var _pw = surface_get_width_safe(_surf) * _s / 2;
|
||||
var _ph = surface_get_height_safe(_surf) * _s / 2;
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x + _pw, _y + _ph, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
shader_set_uniform_f_array_safe(uniform_shf, _shf);
|
||||
shader_set_uniform_f_array_safe(uniform_sca, _sca);
|
||||
shader_set_uniform_i(uniform_slp, _slp);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
shader_set_uniform_i(uniform_sam, _sam);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -74,11 +74,11 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
inputs[| 11].setVisible(_tile == 0);
|
||||
|
||||
if(_tile == 0 && is_surface(_fore)) {
|
||||
ww = surface_get_width(_back);
|
||||
hh = surface_get_height(_back);
|
||||
ww = surface_get_width_safe(_back);
|
||||
hh = surface_get_height_safe(_back);
|
||||
|
||||
var fw = surface_get_width(_fore);
|
||||
var fh = surface_get_height(_fore);
|
||||
var fw = surface_get_width_safe(_fore);
|
||||
var fh = surface_get_height_safe(_fore);
|
||||
|
||||
temp_surface[0] = surface_verify(temp_surface[0], ww, hh, cDep);
|
||||
_foreDraw = temp_surface[0];
|
||||
|
@ -108,22 +108,22 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
|
||||
switch(_outp) {
|
||||
case 0 :
|
||||
ww = surface_get_width(_back);
|
||||
hh = surface_get_height(_back);
|
||||
ww = surface_get_width_safe(_back);
|
||||
hh = surface_get_height_safe(_back);
|
||||
break;
|
||||
case 1 :
|
||||
if(is_surface(_foreDraw)) {
|
||||
ww = surface_get_width(_foreDraw);
|
||||
hh = surface_get_height(_foreDraw);
|
||||
ww = surface_get_width_safe(_foreDraw);
|
||||
hh = surface_get_height_safe(_foreDraw);
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
ww = surface_get_width(_mask);
|
||||
hh = surface_get_height(_mask);
|
||||
ww = surface_get_width_safe(_mask);
|
||||
hh = surface_get_height_safe(_mask);
|
||||
break;
|
||||
case 3 :
|
||||
ww = max(surface_get_width(_back), is_surface(_fore)? surface_get_width(_fore) : 1, surface_get_width(_mask));
|
||||
hh = max(surface_get_height(_back), is_surface(_fore)? surface_get_height(_fore) : 1, surface_get_height(_mask));
|
||||
ww = max(surface_get_width_safe(_back), is_surface(_fore)? surface_get_width_safe(_fore) : 1, surface_get_width_safe(_mask));
|
||||
hh = max(surface_get_height_safe(_back), is_surface(_fore)? surface_get_height_safe(_fore) : 1, surface_get_height_safe(_mask));
|
||||
break;
|
||||
case 4 :
|
||||
ww = _out_dim[0];
|
||||
|
|
|
@ -38,7 +38,7 @@ function Node_Blinker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
//if(!is_surface(_surf)) return _outSurf;
|
||||
|
||||
//temp_surface[0] = surface_verify(temp_surface[0], surface_get_width(_outSurf), surface_get_height(_outSurf));
|
||||
//temp_surface[0] = surface_verify(temp_surface[0], surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf));
|
||||
|
||||
//surface_set_shader(temp_surface[0], sh_blink_extract);
|
||||
// draw_surface_safe(_surf);
|
||||
|
|
|
@ -44,7 +44,7 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
var _tole = _data[2];
|
||||
var _stre = _data[3];
|
||||
var _mask = _data[4];
|
||||
var pass1 = surface_create_valid(surface_get_width(_outSurf), surface_get_height(_outSurf), attrDepth());
|
||||
var pass1 = surface_create_valid(surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf), attrDepth());
|
||||
|
||||
surface_set_target(pass1);
|
||||
draw_clear_alpha(c_black, 1);
|
||||
|
|
|
@ -37,7 +37,7 @@ function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_data[0]), surface_get_height(_data[0]));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||
shader_set_uniform_f(uniform_str, _str);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
|
|
@ -41,8 +41,8 @@ function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
var _mask = _data[3];
|
||||
var _mix = _data[4];
|
||||
|
||||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
var ww = surface_get_width_safe(_surf);
|
||||
var hh = surface_get_height_safe(_surf);
|
||||
|
||||
temp_surface[0] = surface_verify(temp_surface[0], ww, hh, attrDepth());
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
_surf = _surf[preview_index];
|
||||
}
|
||||
|
||||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
var ww = surface_get_width_safe(_surf);
|
||||
var hh = surface_get_height_safe(_surf);
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x + ww / 2 * _s, _y + hh / 2 * _s, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
var _mix = _data[4];
|
||||
|
||||
surface_set_shader(_outSurf, sh_blur_directional);
|
||||
shader_set_f("size", max(surface_get_width(_data[0]), surface_get_height( _data[1])));
|
||||
shader_set_f("size", max(surface_get_width_safe(_data[0]), surface_get_height_safe( _data[1])));
|
||||
shader_set_f("strength", _str);
|
||||
shader_set_f("direction", _dir + 90);
|
||||
shader_set_i("sampleMode", struct_try_get(attributes, "oversample"));
|
||||
|
|
|
@ -46,12 +46,12 @@ function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
var _cen = _data[2];
|
||||
var _mask = _data[4];
|
||||
var _mix = _data[5];
|
||||
_cen[0] /= surface_get_width(_outSurf);
|
||||
_cen[1] /= surface_get_height(_outSurf);
|
||||
_cen[0] /= surface_get_width_safe(_outSurf);
|
||||
_cen[1] /= surface_get_height_safe(_outSurf);
|
||||
|
||||
surface_set_shader(_outSurf, sh_blur_radial);
|
||||
shader_set_interpolation(_data[0]);
|
||||
shader_set_f("dimension", surface_get_width(_outSurf), surface_get_height(_outSurf));
|
||||
shader_set_f("dimension", surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf));
|
||||
shader_set_f("strength", abs(_str));
|
||||
shader_set_f("center", _cen);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_data[0]), surface_get_height(_data[0]));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||
shader_set_uniform_f(uniform_siz, _size);
|
||||
shader_set_uniform_i(uniform_sam, _samp);
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _msk = _data[5];
|
||||
var _mask = _data[6];
|
||||
var _mix = _data[7];
|
||||
_cen[0] /= surface_get_width(_outSurf);
|
||||
_cen[1] /= surface_get_height(_outSurf);
|
||||
_cen[0] /= surface_get_width_safe(_outSurf);
|
||||
_cen[1] /= surface_get_height_safe(_outSurf);
|
||||
|
||||
surface_set_shader(_outSurf, sh_blur_zoom);
|
||||
shader_set_f("strength", _str);
|
||||
|
|
|
@ -188,8 +188,8 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
py = _cam_y + sy;
|
||||
}
|
||||
|
||||
_scnW = surface_get_width(_surface);
|
||||
_scnH = surface_get_height(_surface);
|
||||
_scnW = surface_get_width_safe(_surface);
|
||||
_scnH = surface_get_height_safe(_surface);
|
||||
|
||||
px /= _scnW;
|
||||
py /= _scnH;
|
||||
|
|
|
@ -106,7 +106,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
if(!is_surface(canvas_surface)) {
|
||||
canvas_surface = surface_create_from_buffer(_dim[0], _dim[1], canvas_buffer);
|
||||
} else if(surface_get_width(canvas_surface) != _dim[0] || surface_get_height(canvas_surface) != _dim[1]) {
|
||||
} else if(surface_get_width_safe(canvas_surface) != _dim[0] || surface_get_height_safe(canvas_surface) != _dim[1]) {
|
||||
buffer_delete(canvas_buffer);
|
||||
canvas_buffer = buffer_create(_dim[0] * _dim[1] * 4, buffer_fixed, 4);
|
||||
canvas_surface = surface_size_to(canvas_surface, _dim[0], _dim[1]);
|
||||
|
@ -119,8 +119,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
function surface_store_buffer() {
|
||||
buffer_delete(canvas_buffer);
|
||||
|
||||
surface_w = surface_get_width(canvas_surface);
|
||||
surface_h = surface_get_height(canvas_surface);
|
||||
surface_w = surface_get_width_safe(canvas_surface);
|
||||
surface_h = surface_get_height_safe(canvas_surface);
|
||||
canvas_buffer = buffer_create(surface_w * surface_h * 4, buffer_fixed, 4);
|
||||
buffer_get_surface(canvas_buffer, canvas_surface, 0);
|
||||
|
||||
|
@ -163,8 +163,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
} else
|
||||
draw_circle_prec(_x, _y, _siz / 2, 0);
|
||||
} else {
|
||||
var _sw = surface_get_width(_brush);
|
||||
var _sh = surface_get_height(_brush);
|
||||
var _sw = surface_get_width_safe(_brush);
|
||||
var _sh = surface_get_height_safe(_brush);
|
||||
|
||||
draw_surface_ext_safe(_brush, _x - floor(_sw / 2), _y - floor(_sh / 2), 1, 1, 0, draw_get_color(), draw_get_alpha());
|
||||
}
|
||||
|
@ -377,8 +377,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
function canvas_fill(_x, _y, _surf, _thres) { #region
|
||||
var _alp = inputs[| 11].getValue();
|
||||
|
||||
var w = surface_get_width(_surf);
|
||||
var h = surface_get_height(_surf);
|
||||
var w = surface_get_width_safe(_surf);
|
||||
var h = surface_get_height_safe(_surf);
|
||||
|
||||
var _c1 = get_color_buffer(_x, _y);
|
||||
var thr = _thres * _thres;
|
||||
|
@ -425,8 +425,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(!surface_exists(canvas_surface))
|
||||
surface_store_buffer();
|
||||
|
||||
var _surf_w = surface_get_width(canvas_surface);
|
||||
var _surf_h = surface_get_height(canvas_surface);
|
||||
var _surf_w = surface_get_width_safe(canvas_surface);
|
||||
var _surf_h = surface_get_height_safe(canvas_surface);
|
||||
|
||||
#region drawing surface review
|
||||
_drawing_surface = surface_verify(_drawing_surface, _surf_w, _surf_h);
|
||||
|
@ -474,8 +474,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(mouse_press(mb_left, active)) {
|
||||
var pos_x = selection_position[0];
|
||||
var pos_y = selection_position[1];
|
||||
var sel_w = surface_get_width(selection_surface);
|
||||
var sel_h = surface_get_height(selection_surface);
|
||||
var sel_w = surface_get_width_safe(selection_surface);
|
||||
var sel_h = surface_get_height_safe(selection_surface);
|
||||
|
||||
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, pos_x, pos_y, pos_x + sel_w, pos_y + sel_h)) {
|
||||
is_select_drag = true;
|
||||
|
@ -683,7 +683,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
prev_surface = surface_verify(prev_surface, _dim[0], _dim[1]);
|
||||
preview_draw_surface = surface_verify(preview_draw_surface, _dim[0], _dim[1]);
|
||||
_preview_draw_surface = surface_verify(_preview_draw_surface, surface_get_width(__s), surface_get_height(__s));
|
||||
_preview_draw_surface = surface_verify(_preview_draw_surface, surface_get_width_safe(__s), surface_get_height_safe(__s));
|
||||
|
||||
surface_set_shader(preview_draw_surface, noone,, BLEND.alpha);
|
||||
draw_surface_safe(_drawing_surface, 0, 0);
|
||||
|
@ -723,8 +723,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(is_selected) {
|
||||
var pos_x = _x + selection_position[0] * _s;
|
||||
var pos_y = _y + selection_position[1] * _s;
|
||||
var sel_w = surface_get_width(selection_surface) * _s;
|
||||
var sel_h = surface_get_height(selection_surface) * _s;
|
||||
var sel_w = surface_get_width_safe(selection_surface) * _s;
|
||||
var sel_h = surface_get_height_safe(selection_surface) * _s;
|
||||
|
||||
draw_set_color(c_white);
|
||||
draw_rectangle_dashed(pos_x, pos_y, pos_x + sel_w, pos_y + sel_h, true, 4);
|
||||
|
@ -743,7 +743,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
surface_reset_target();
|
||||
|
||||
shader_set(sh_brush_outline);
|
||||
shader_set_f("dimension", surface_get_width(_preview_draw_surface), surface_get_height(_preview_draw_surface));
|
||||
shader_set_f("dimension", surface_get_width_safe(_preview_draw_surface), surface_get_height_safe(_preview_draw_surface));
|
||||
draw_surface_ext_safe(_preview_draw_surface, 0, 0, 1, 1, 0, c_white, 1);
|
||||
shader_reset();
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ function Node_Checker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
surface_set_target(_outSurf);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_outSurf), surface_get_height(_outSurf));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf));
|
||||
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
|
||||
shader_set_uniform_f(uniform_angle, degtorad(_ang));
|
||||
shader_set_uniform_f(uniform_amount, _amo);
|
||||
|
|
|
@ -37,7 +37,7 @@ function Node_Chromatic_Aberration(_x, _y, _group = noone) : Node_Processor(_x,
|
|||
|
||||
surface_set_shader(_outSurf, shader);
|
||||
shader_set_interpolation(_data[0]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_cen, center);
|
||||
shader_set_uniform_f(uniform_str, stren);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -139,8 +139,8 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
var _pall = ds_map_create();
|
||||
|
||||
for( var i = 0, n = array_length(_surf); i < n; i++ ) {
|
||||
var ww = surface_get_width(_surf[i]);
|
||||
var hh = surface_get_height(_surf[i]);
|
||||
var ww = surface_get_width_safe(_surf[i]);
|
||||
var hh = surface_get_height_safe(_surf[i]);
|
||||
|
||||
var c_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
var _suf = current_data[0];
|
||||
if(!is_surface(_suf)) return;
|
||||
var ww = surface_get_width(_suf);
|
||||
var hh = surface_get_height(_suf);
|
||||
var ww = surface_get_width_safe(_suf);
|
||||
var hh = surface_get_height_safe(_suf);
|
||||
|
||||
var _pos = current_data[1];
|
||||
var _sam = 1 + (current_data[2] - 1) * 2;
|
||||
|
@ -51,8 +51,8 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
var _sam = _data[2];
|
||||
if(!is_surface(_surf)) return c_black;
|
||||
|
||||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
var ww = surface_get_width_safe(_surf);
|
||||
var hh = surface_get_height_safe(_surf);
|
||||
|
||||
var r = 0, g = 0, b = 0, amo = 0;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ function Node_Combine_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
texture_set_stage(uniform_s, surface_get_texture(_s));
|
||||
texture_set_stage(uniform_v, surface_get_texture(_v));
|
||||
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, surface_get_width(_outSurf), surface_get_width(_outSurf), 0, c_white, 1);
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, surface_get_width_safe(_outSurf), surface_get_width_safe(_outSurf), 0, c_white, 1);
|
||||
shader_reset();
|
||||
|
||||
BLEND_NORMAL;
|
||||
|
|
|
@ -47,7 +47,7 @@ function Node_Combine_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
shader_set_uniform_i(uniform_usea, is_surface(_a));
|
||||
texture_set_stage(uniform_a, surface_get_texture(_a));
|
||||
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, surface_get_width(_outSurf), surface_get_width(_outSurf), 0, c_white, 1);
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, surface_get_width_safe(_outSurf), surface_get_width_safe(_outSurf), 0, c_white, 1);
|
||||
shader_reset();
|
||||
|
||||
BLEND_NORMAL;
|
||||
|
|
|
@ -120,8 +120,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _sy1 = _sy0 + ssh;
|
||||
draw_rectangle(_sx0, _sy0, _sx1, _sy1, true);
|
||||
|
||||
var _ssw = surface_get_width(_surf);
|
||||
var _ssh = surface_get_height(_surf);
|
||||
var _ssw = surface_get_width_safe(_surf);
|
||||
var _ssh = surface_get_height_safe(_surf);
|
||||
var _sss = min(ssh / _ssw, ssh / _ssh);
|
||||
draw_surface_ext_safe(_surf, _sx0, _sy0, _sss, _sss, 0, c_white, 1);
|
||||
|
||||
|
@ -496,8 +496,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
if(key_mod_press(ALT)) {
|
||||
var _surf = current_data[input_dragging - 1];
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
|
||||
var x0 = pos_x, x1 = pos_x + _sw;
|
||||
var y0 = pos_y, y1 = pos_y + _sh;
|
||||
|
@ -554,8 +554,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
} else if(drag_type == NODE_COMPOSE_DRAG.scale) {
|
||||
var _surf = inputs[| surf_dragging + 0].getValue();
|
||||
var _rot = inputs[| surf_dragging + 2].getValue();
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
|
||||
var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot);
|
||||
var sca_x = _p[0] / _s / _sw * 2;
|
||||
|
@ -599,8 +599,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
if(!_surf || is_array(_surf)) continue;
|
||||
|
||||
var _ww = surface_get_width(_surf);
|
||||
var _hh = surface_get_height(_surf);
|
||||
var _ww = surface_get_width_safe(_surf);
|
||||
var _hh = surface_get_height_safe(_surf);
|
||||
var _sw = _ww * _sca[0];
|
||||
var _sh = _hh * _sca[1];
|
||||
|
||||
|
@ -757,14 +757,14 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
switch(_dim_type) {
|
||||
case COMPOSE_OUTPUT_SCALING.first :
|
||||
ww = surface_get_width(base);
|
||||
hh = surface_get_height(base);
|
||||
ww = surface_get_width_safe(base);
|
||||
hh = surface_get_height_safe(base);
|
||||
break;
|
||||
case COMPOSE_OUTPUT_SCALING.largest :
|
||||
for(var i = input_fix_len; i < array_length(_data) - data_length; i += data_length) {
|
||||
var _s = _data[i];
|
||||
ww = max(ww, surface_get_width(_s));
|
||||
hh = max(hh, surface_get_height(_s));
|
||||
ww = max(ww, surface_get_width_safe(_s));
|
||||
hh = max(hh, surface_get_height_safe(_s));
|
||||
}
|
||||
break;
|
||||
case COMPOSE_OUTPUT_SCALING.constant :
|
||||
|
@ -800,8 +800,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
if(!_s || is_array(_s)) continue;
|
||||
|
||||
var _ww = surface_get_width(_s);
|
||||
var _hh = surface_get_height(_s);
|
||||
var _ww = surface_get_width_safe(_s);
|
||||
var _hh = surface_get_height_safe(_s);
|
||||
var _sw = _ww * _sca[0];
|
||||
var _sh = _hh * _sca[1];
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_outSurf), surface_get_height(_outSurf));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf));
|
||||
shader_set_uniform_f_array_safe(uniform_ker, _ker);
|
||||
shader_set_uniform_i(uniform_sam, _sam);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -32,14 +32,14 @@ function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var wd = _data[1];
|
||||
|
||||
var temp = surface_create_valid(surface_get_width(_data[0]), surface_get_height(_data[0]), attrDepth());
|
||||
var temp = surface_create_valid(surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]), attrDepth());
|
||||
|
||||
surface_set_target(temp);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(sh_corner_erode);
|
||||
shader_set_uniform_f_array_safe(uniform_er_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_f_array_safe(uniform_er_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||
shader_set_uniform_f(uniform_er_size, wd);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
||||
|
@ -52,7 +52,7 @@ function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(sh_corner);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||
shader_set_uniform_f(uniform_rad, wd);
|
||||
shader_set_surface("original", _data[0]);
|
||||
draw_surface_safe(temp, 0, 0);
|
||||
|
|
|
@ -34,7 +34,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
for( var i = 0, n = array_length(_splice); i < n; i++ )
|
||||
_splice[i] = round(_splice[i]);
|
||||
|
||||
var dim = [ surface_get_width(_inSurf), surface_get_height(_inSurf) ]
|
||||
var dim = [ surface_get_width_safe(_inSurf), surface_get_height_safe(_inSurf) ]
|
||||
|
||||
var sp_r = _x + (dim[0] - _splice[0]) * _s;
|
||||
var sp_l = _x + _splice[2] * _s;
|
||||
|
@ -110,7 +110,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _inSurf = _data[0];
|
||||
var _crop = _data[1];
|
||||
var _dim = [ surface_get_width(_inSurf) - _crop[0] - _crop[2], surface_get_height(_inSurf) - _crop[1] - _crop[3] ];
|
||||
var _dim = [ surface_get_width_safe(_inSurf) - _crop[0] - _crop[2], surface_get_height_safe(_inSurf) - _crop[1] - _crop[3] ];
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
for( var j = 0; j < array_length(_inSurf); j++ ) {
|
||||
var _surf = _inSurf[j];
|
||||
|
||||
var _dim = [ surface_get_width(_surf), surface_get_height(_surf) ];
|
||||
var _dim = [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ];
|
||||
var s = surface_create(_dim[0], _dim[1], surface_r8unorm);
|
||||
surface_set_target(s);
|
||||
DRAW_CLEAR
|
||||
|
|
|
@ -851,8 +851,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
return "";
|
||||
}
|
||||
|
||||
var pw = surface_get_width(preview_surface);
|
||||
var ph = surface_get_height(preview_surface);
|
||||
var pw = surface_get_width_safe(preview_surface);
|
||||
var ph = surface_get_height_safe(preview_surface);
|
||||
var format = surface_get_format(preview_surface);
|
||||
|
||||
var txt = "[" + string(pw) + " x " + string(ph) + " ";
|
||||
|
@ -1278,7 +1278,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
_surf = array_safe_get(_surf, preview_index, noone);
|
||||
if(!is_surface(_surf)) return noone;
|
||||
|
||||
return BBOX().fromWH(preview_x, preview_y, surface_get_width(_surf), surface_get_height(_surf));
|
||||
return BBOX().fromWH(preview_x, preview_y, surface_get_width_safe(_surf), surface_get_height_safe(_surf));
|
||||
} #endregion
|
||||
|
||||
static getTool = function() { return self; }
|
||||
|
|
|
@ -19,7 +19,7 @@ function Node_De_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_shader(_outSurf, sh_de_corner);
|
||||
shader_set_f("dimension", [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_f("dimension", [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
shader_set_f("tolerance", _data[2]);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -59,7 +59,7 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
surface_set_shader(_outSurf, shader);
|
||||
shader_set_interpolation(_data[0]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_cen, center);
|
||||
shader_set_uniform_f(uniform_str, stren);
|
||||
shader_set_uniform_f(uniform_rad, rad);
|
||||
|
|
|
@ -68,10 +68,10 @@ If set, then strength value control how many times the effect applies on itself.
|
|||
inputs[| 2].setVisible(false);
|
||||
break;
|
||||
}
|
||||
var ww = surface_get_width(_data[0]);
|
||||
var hh = surface_get_height(_data[0]);
|
||||
var mw = surface_get_width(_data[1]);
|
||||
var mh = surface_get_height(_data[1]);
|
||||
var ww = surface_get_width_safe(_data[0]);
|
||||
var hh = surface_get_height_safe(_data[0]);
|
||||
var mw = surface_get_width_safe(_data[1]);
|
||||
var mh = surface_get_height_safe(_data[1]);
|
||||
|
||||
surface_set_shader(_outSurf, shader);
|
||||
shader_set_interpolation(_data[0]);
|
||||
|
|
|
@ -97,7 +97,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
shader_set(shader);
|
||||
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ] );
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ] );
|
||||
|
||||
switch(_typ) {
|
||||
case 0 :
|
||||
|
@ -118,7 +118,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
case 3 :
|
||||
if(is_surface(_map)) {
|
||||
shader_set_uniform_i(uniform_map_use, 1);
|
||||
shader_set_uniform_f_array_safe(uniform_map_dim, [ surface_get_width(_map), surface_get_height(_map) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_map_dim, [ surface_get_width_safe(_map), surface_get_height_safe(_map) ]);
|
||||
texture_set_stage(uniform_map, surface_get_texture(_map));
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -41,7 +41,7 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||
shader_set_uniform_i(uniform_filter, ft);
|
||||
shader_set_uniform_i(uniform_sam, ov);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -40,7 +40,7 @@ function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||
shader_set_uniform_f(uniform_size, wd);
|
||||
shader_set_uniform_i(uniform_bor, _data[2]? 1 : 0);
|
||||
shader_set_uniform_i(uniform_alp, _data[3]? 1 : 0);
|
||||
|
|
|
@ -29,14 +29,14 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
DRAW_CLEAR
|
||||
shader_set(shader);
|
||||
texture_set_stage(shader_tex, surface_get_texture(_surf));
|
||||
shader_set_uniform_f(shader_dim, surface_get_width(_surf), surface_get_height(_surf));
|
||||
shader_set_uniform_f(shader_dim, surface_get_width_safe(_surf), surface_get_height_safe(_surf));
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, 1, 1, 0, _col, 1);
|
||||
shader_reset();
|
||||
surface_reset_target();
|
||||
|
||||
var pos = surface_get_pixel(temp_surface[0], 0, 0);
|
||||
var _x = round(color_get_red(pos) / 255 * surface_get_width(_surf));
|
||||
var _y = round(color_get_green(pos) / 255 * surface_get_height(_surf));
|
||||
var _x = round(color_get_red(pos) / 255 * surface_get_width_safe(_surf));
|
||||
var _y = round(color_get_green(pos) / 255 * surface_get_height_safe(_surf));
|
||||
|
||||
return [ _x, _y ];
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
|
||||
var _filC = surface_get_pixel_ext(inSurf, _pos[0], _pos[1]);
|
||||
|
||||
var sw = surface_get_width(inSurf);
|
||||
var sh = surface_get_height(inSurf);
|
||||
var sw = surface_get_width_safe(inSurf);
|
||||
var sh = surface_get_height_safe(inSurf);
|
||||
|
||||
for( var i = 0, n = array_length(temp_surface); i < n; i++ )
|
||||
temp_surface[i] = surface_verify(temp_surface[i], sw, sh, attrDepth());
|
||||
|
|
|
@ -33,8 +33,8 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con
|
|||
var _pos = inputs[| 2].getValue();
|
||||
|
||||
if(is_surface(_mat)) {
|
||||
var sw = surface_get_width(_mat) * _s;
|
||||
var sh = surface_get_height(_mat) * _s;
|
||||
var sw = surface_get_width_safe(_mat) * _s;
|
||||
var sh = surface_get_height_safe(_mat) * _s;
|
||||
var mx = _x + _pos[0] * _s - sw / 2;
|
||||
var my = _y + _pos[1] * _s - sh / 2;
|
||||
|
||||
|
@ -60,8 +60,8 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con
|
|||
if(!_act) return;
|
||||
if(!is_surface(_mat)) return;
|
||||
|
||||
var sw = surface_get_width(_mat);
|
||||
var sh = surface_get_height(_mat);
|
||||
var sw = surface_get_width_safe(_mat);
|
||||
var sh = surface_get_height_safe(_mat);
|
||||
|
||||
if(_prevPos != noone && _inh != 0) {
|
||||
var dx = _pos[0] - _prevPos[0];
|
||||
|
|
|
@ -28,8 +28,8 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y,
|
|||
var _pos = inputs[| 2].getValue();
|
||||
|
||||
if(is_surface(_mat)) {
|
||||
var sw = surface_get_width(_mat) * _s;
|
||||
var sh = surface_get_height(_mat) * _s;
|
||||
var sw = surface_get_width_safe(_mat) * _s;
|
||||
var sh = surface_get_height_safe(_mat) * _s;
|
||||
var mx = _x + _pos[0] * _s - sw / 2;
|
||||
var my = _y + _pos[1] * _s - sh / 2;
|
||||
|
||||
|
@ -52,8 +52,8 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y,
|
|||
if(!_act) return;
|
||||
if(!is_surface(_mat)) return;
|
||||
|
||||
var sw = surface_get_width(_mat);
|
||||
var sh = surface_get_height(_mat);
|
||||
var sw = surface_get_width_safe(_mat);
|
||||
var sh = surface_get_height_safe(_mat);
|
||||
|
||||
fd_rectangle_add_velocity_surface(_dom, _mat, _pos[0] - sw / 2, _pos[1] - sh / 2, 1, 1, _vel[0], _vel[1]);
|
||||
}
|
||||
|
|
|
@ -42,12 +42,12 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
var _size = _data[2];
|
||||
var _stre = _data[3];
|
||||
var cl = _data[4];
|
||||
var pass1 = surface_create_valid(surface_get_width(_outSurf), surface_get_height(_outSurf), attrDepth());
|
||||
var pass1 = surface_create_valid(surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf), attrDepth());
|
||||
|
||||
surface_set_target(pass1);
|
||||
draw_clear_alpha(c_black, 1);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_outSurf), surface_get_height(_outSurf) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf) ]);
|
||||
shader_set_uniform_f(uniform_size, _size + _border);
|
||||
shader_set_uniform_f_array_safe(uniform_colr, [ 1., 1., 1., 1. ]);
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ struct PixelShaderOutput {
|
|||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
var _surf = _data[2];
|
||||
if(!is_surface(_surf)) return;
|
||||
_output = surface_verify(_output, surface_get_width(_surf), surface_get_height(_surf));
|
||||
_output = surface_verify(_output, surface_get_width_safe(_surf), surface_get_height_safe(_surf));
|
||||
|
||||
surface_set_target(_output);
|
||||
DRAW_CLEAR
|
||||
|
@ -186,7 +186,7 @@ struct PixelShaderOutput {
|
|||
}
|
||||
}
|
||||
|
||||
matrix_set(matrix_world, matrix_build(0, 0, 0, 0, 0, 0, surface_get_width(_surf), surface_get_height(_surf), 1));
|
||||
matrix_set(matrix_world, matrix_build(0, 0, 0, 0, 0, 0, surface_get_width_safe(_surf), surface_get_height_safe(_surf), 1));
|
||||
vertex_submit(global.HLSL_VB, pr_trianglestrip, surface_get_texture(_surf));
|
||||
matrix_set(matrix_world, matrix_build_identity());
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
var _sur = inputs[| 0].getValue();
|
||||
if(!is_surface(_sur) || _sur == DEF_SURFACE) return;
|
||||
var ww = surface_get_width(_sur);
|
||||
var hh = surface_get_height(_sur);
|
||||
var ww = surface_get_width_safe(_sur);
|
||||
var hh = surface_get_height_safe(_sur);
|
||||
|
||||
var _size = inputs[| 1].getValue();
|
||||
var _offs = inputs[| 4].getValue();
|
||||
|
|
12
scripts/node_isosurf/node_counter.yy
Normal file
12
scripts/node_isosurf/node_counter.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "number",
|
||||
"path": "folders/nodes/data/number.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_counter",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
29
scripts/node_isosurf/node_isosurf.gml
Normal file
29
scripts/node_isosurf/node_isosurf.gml
Normal file
|
@ -0,0 +1,29 @@
|
|||
function Node_IsoSurf(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "IsoSurf";
|
||||
|
||||
inputs[| 0] = nodeValue("Direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "4", "8" ]);
|
||||
|
||||
inputs[| 1] = nodeValue("Surfaces", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
|
||||
.setVisible(true, true)
|
||||
.setArrayDepth(1);
|
||||
|
||||
outputs[| 0] = nodeValue("IsoSurf", self, JUNCTION_CONNECT.output, VALUE_TYPE.dynaSurf, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Isometric", false], 0,
|
||||
["Surfaces", false], 1,
|
||||
];
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _type = _data[0];
|
||||
var _surf = _data[1];
|
||||
var _amo = _type == 0? 4 : 8;
|
||||
|
||||
var _iso = new dynaSurf_iso_4();
|
||||
for( var i = 0; i < _amo; i++ )
|
||||
_iso.surfaces[i] = array_safe_get(_surf, i, noone);
|
||||
|
||||
return _iso;
|
||||
}
|
||||
}
|
11
scripts/node_isosurf/node_isosurf.yy
Normal file
11
scripts/node_isosurf/node_isosurf.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_isosurf",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "surface",
|
||||
"path": "folders/nodes/data/value/surface.yy",
|
||||
},
|
||||
}
|
|
@ -51,7 +51,7 @@ function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_data[0]), surface_get_height(_data[0]));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||
shader_set_uniform_i(uniform_alg, _alg);
|
||||
shader_set_uniform_i(uniform_sam, _sam);
|
||||
shader_set_uniform_i(uniform_sha, _shp);
|
||||
|
|
|
@ -43,7 +43,7 @@ function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _dim = [ surface_get_width(_data[0]), surface_get_height(_data[0]) ];
|
||||
var _dim = [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ];
|
||||
var _pos = _data[1];
|
||||
var _ang = _data[2];
|
||||
|
||||
|
|
|
@ -34,11 +34,11 @@ function Node_Morph_Surface(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
shader_set_interpolation(_data[0]);
|
||||
shader_set_surface("sFrom", sFrom);
|
||||
shader_set_surface("sTo", sTo);
|
||||
shader_set_f("dimension", surface_get_width(sFrom), surface_get_height(sTo));
|
||||
shader_set_f("dimension", surface_get_width_safe(sFrom), surface_get_height_safe(sTo));
|
||||
shader_set_f("amount", amo);
|
||||
shader_set_f("threshold", thres);
|
||||
|
||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width(sFrom), surface_get_height(sTo));
|
||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width_safe(sFrom), surface_get_height_safe(sTo));
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -30,7 +30,7 @@ function Node_Normal(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
surface_set_shader(_outSurf, sh_normal);
|
||||
shader_set_uniform_f(uniform_hei, _hei);
|
||||
shader_set_uniform_i(uniform_smt, _smt);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
surface_reset_shader();
|
||||
|
|
|
@ -69,7 +69,7 @@ function Node_Normal_Light(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
texture_set_stage(uniform_map, surface_get_texture(_map));
|
||||
shader_set_uniform_f(uniform_hei, _hei);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_amb, [color_get_red(_amb) / 255, color_get_green(_amb) / 255, color_get_blue(_amb) / 255]);
|
||||
|
||||
shader_set_uniform_f_array_safe(uniform_light_pos, [ _light_pos[0], _light_pos[1], _light_pos[2] / 100, _light_ran ] );
|
||||
|
|
|
@ -46,7 +46,7 @@ function Node_Onion_Skin(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
cacheCurrentFrame(_surf);
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
_outSurf = surface_verify(_outSurf, surface_get_width(_surf), surface_get_height(_surf));
|
||||
_outSurf = surface_verify(_outSurf, surface_get_width_safe(_surf), surface_get_height_safe(_surf));
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
|
|
|
@ -57,8 +57,8 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
attribute_oversample();
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var ww = surface_get_width(_data[0]);
|
||||
var hh = surface_get_height(_data[0]);
|
||||
var ww = surface_get_width_safe(_data[0]);
|
||||
var hh = surface_get_height_safe(_data[0]);
|
||||
var wd = _data[1];
|
||||
var cl = _data[2];
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ function Node_Pack_Sprites(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
if(!is_surface(_surf)) continue;
|
||||
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
|
||||
draw_rectangle(
|
||||
_x + _s * (_sx + spac),
|
||||
|
@ -66,8 +66,8 @@ function Node_Pack_Sprites(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
var s = _inpt[i];
|
||||
if(!is_surface(s)) continue;
|
||||
|
||||
_rects[i] = new spriteAtlasData(0, 0, surface_get_width(s) + _spac * 2,
|
||||
surface_get_height(s) + _spac * 2, s, i);
|
||||
_rects[i] = new spriteAtlasData(0, 0, surface_get_width_safe(s) + _spac * 2,
|
||||
surface_get_height_safe(s) + _spac * 2, s, i);
|
||||
}
|
||||
|
||||
var pack;
|
||||
|
|
|
@ -63,8 +63,8 @@ function Node_Padding(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
inputs[| 3].setVisible(fill);
|
||||
|
||||
var ww = surface_get_width(_data[0]);
|
||||
var hh = surface_get_height(_data[0]);
|
||||
var ww = surface_get_width_safe(_data[0]);
|
||||
var hh = surface_get_height_safe(_data[0]);
|
||||
|
||||
if(mode == 0) {
|
||||
var sw = ww + padding[0] + padding[2];
|
||||
|
|
|
@ -59,11 +59,11 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
}
|
||||
|
||||
function extractKmean(_surfFull, _size, _seed) {
|
||||
var _surf = surface_create_valid(min(32, surface_get_width(_surfFull)), min(32, surface_get_height(_surfFull)), attrDepth());
|
||||
var _surf = surface_create_valid(min(32, surface_get_width_safe(_surfFull)), min(32, surface_get_height_safe(_surfFull)), attrDepth());
|
||||
_size = max(1, _size);
|
||||
|
||||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
var ww = surface_get_width_safe(_surf);
|
||||
var hh = surface_get_height_safe(_surf);
|
||||
|
||||
surface_set_target(_surf);
|
||||
DRAW_CLEAR
|
||||
|
@ -183,8 +183,8 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
}
|
||||
|
||||
function extractAll(_surfFull) {
|
||||
var ww = surface_get_width(_surfFull);
|
||||
var hh = surface_get_height(_surfFull);
|
||||
var ww = surface_get_width_safe(_surfFull);
|
||||
var hh = surface_get_height_safe(_surfFull);
|
||||
|
||||
var c_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
|
||||
|
||||
|
@ -209,11 +209,11 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
|
||||
function extractFrequence(_surfFull, _size) {
|
||||
var msize = 128;
|
||||
var _surf = surface_create_valid(min(msize, surface_get_width(_surfFull)), min(msize, surface_get_height(_surfFull)));
|
||||
var _surf = surface_create_valid(min(msize, surface_get_width_safe(_surfFull)), min(msize, surface_get_height_safe(_surfFull)));
|
||||
_size = max(1, _size);
|
||||
|
||||
var ww = surface_get_width(_surf);
|
||||
var hh = surface_get_height(_surf);
|
||||
var ww = surface_get_width_safe(_surf);
|
||||
var hh = surface_get_height_safe(_surf);
|
||||
|
||||
surface_set_target(_surf);
|
||||
DRAW_CLEAR
|
||||
|
|
|
@ -87,8 +87,8 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
|
|||
else if(_blend == PARTICLE_BLEND_MODE.additive)
|
||||
BLEND_ADD;
|
||||
|
||||
var surf_w = surface_get_width(_outSurf);
|
||||
var surf_h = surface_get_height(_outSurf);
|
||||
var surf_w = surface_get_width_safe(_outSurf);
|
||||
var surf_h = surface_get_height_safe(_outSurf);
|
||||
|
||||
for(var i = 0; i < attributes.part_amount; i++)
|
||||
parts[i].draw(_exact, surf_w, surf_h);
|
||||
|
|
|
@ -14,11 +14,11 @@ function Node_PB_Fx(_x, _y, _group = noone) : Node_PB(_x, _y, _group) constructo
|
|||
\
|
||||
var _pbox = new __pbBox(); \
|
||||
\
|
||||
_pbox.w = surface_get_width(_surf); \
|
||||
_pbox.h = surface_get_height(_surf); \
|
||||
_pbox.w = surface_get_width_safe(_surf); \
|
||||
_pbox.h = surface_get_height_safe(_surf); \
|
||||
\
|
||||
_pbox.layer_w = surface_get_width(_surf); \
|
||||
_pbox.layer_h = surface_get_height(_surf); \
|
||||
_pbox.layer_w = surface_get_width_safe(_surf); \
|
||||
_pbox.layer_h = surface_get_height_safe(_surf); \
|
||||
\
|
||||
_pbox.mask = surface_create(_pbox.w, _pbox.h); \
|
||||
surface_set_shader(_pbox.mask, sh_pb_to_mask); \
|
||||
|
|
|
@ -19,7 +19,7 @@ function Node_PB_Fx_Radial(_x, _y, _group = noone) : Node_PB_Fx(_x, _y, _group)
|
|||
surface_set_shader(_nbox.content);
|
||||
for( var i = 0; i < _amo; i++ ) {
|
||||
var aa = i / _amo * 360;
|
||||
var p = point_rotate(0, 0, surface_get_width(_pbox.content) / 2, surface_get_height(_pbox.content) / 2, aa);
|
||||
var p = point_rotate(0, 0, surface_get_width_safe(_pbox.content) / 2, surface_get_height_safe(_pbox.content) / 2, aa);
|
||||
|
||||
draw_surface_ext_safe(_pbox.content, p[0], p[1],,, aa);
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
if(_dr < 0) _dr = 4 + _dr;
|
||||
if(_it <= 0) return _outSurf;
|
||||
|
||||
var sw = surface_get_width(_outSurf);
|
||||
var sh = surface_get_height(_outSurf);
|
||||
var sw = surface_get_width_safe(_outSurf);
|
||||
var sh = surface_get_height_safe(_outSurf);
|
||||
|
||||
var pp = [ surface_create_valid(sw, sh), surface_create_valid(sw, sh) ];
|
||||
var sBase, sDraw;
|
||||
|
@ -57,7 +57,7 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
surface_reset_target();
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_in), surface_get_height(_in));
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_in), surface_get_height_safe(_in));
|
||||
shader_set_uniform_f(uniform_tre, _tr);
|
||||
shader_set_uniform_i(uniform_dir, _dr);
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
var _in = getSingleValue(dimension_index, arr);
|
||||
|
||||
if(inputs[| dimension_index].type == VALUE_TYPE.surface && is_surface(_in)) {
|
||||
var ww = surface_get_width(_in);
|
||||
var hh = surface_get_height(_in);
|
||||
var ww = surface_get_width_safe(_in);
|
||||
var hh = surface_get_height_safe(_in);
|
||||
return [ww, hh];
|
||||
}
|
||||
|
||||
|
@ -84,8 +84,8 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
var _sw = 1, _sh = 1;
|
||||
if(inputs[| dimension_index].type == VALUE_TYPE.surface) {
|
||||
if(is_surface(surf)) {
|
||||
_sw = surface_get_width(surf);
|
||||
_sh = surface_get_height(surf);
|
||||
_sw = surface_get_width_safe(surf);
|
||||
_sh = surface_get_height_safe(surf);
|
||||
} else
|
||||
return noone;
|
||||
} else if(is_array(surf)) {
|
||||
|
@ -128,8 +128,8 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
var _sw = 1, _sh = 1;
|
||||
if(inputs[| dimension_index].type == VALUE_TYPE.surface) {
|
||||
if(is_surface(surf)) {
|
||||
_sw = surface_get_width(surf);
|
||||
_sh = surface_get_height(surf);
|
||||
_sw = surface_get_width_safe(surf);
|
||||
_sh = surface_get_height_safe(surf);
|
||||
} else
|
||||
return noone;
|
||||
} else if(is_array(surf)) {
|
||||
|
|
|
@ -15,8 +15,8 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
function surfaceContentRatio(_surf) {
|
||||
var s = 0;
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
var total = _sw * _sh;
|
||||
var _buff = buffer_create(_sw * _sh * 4, buffer_fixed, 4);
|
||||
buffer_get_surface(_buff, _surf, 0);
|
||||
|
|
|
@ -36,8 +36,8 @@ function Node_Region_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
var _fill = _data[3];
|
||||
var _seed = _data[4];
|
||||
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf)
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf)
|
||||
|
||||
temp_surface[0] = surface_verify(temp_surface[0], _sw, _sh);
|
||||
temp_surface[1] = surface_verify(temp_surface[1], _sw, _sh);
|
||||
|
|
|
@ -584,6 +584,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(values, "Atlas Set", s_node_atlas_set, "Node_Atlas_Set", [1, Node_Atlas_Set]).setVersion(1141);
|
||||
|
||||
ds_list_add(values, "Surface");
|
||||
addNodeObject(values, "IsoSurf", s_node_surface_from_buffer, "Node_IsoSurf", [1, Node_IsoSurf]).setVersion(11520);
|
||||
addNodeObject(values, "Surface from Buffer", s_node_surface_from_buffer, "Node_Surface_From_Buffer", [1, Node_Surface_From_Buffer], ["buffer to surface"], "Create surface from buffer.").setVersion(1146);
|
||||
|
||||
ds_list_add(values, "Buffer");
|
||||
|
|
|
@ -106,8 +106,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
_atl[i] = [];
|
||||
|
||||
if(!is_surface(inpt[i])) continue;
|
||||
var sw = surface_get_width(inpt[i]);
|
||||
var sh = surface_get_height(inpt[i]);
|
||||
var sw = surface_get_width_safe(inpt[i]);
|
||||
var sh = surface_get_height_safe(inpt[i]);
|
||||
var ww = sw, hh = sh;
|
||||
|
||||
switch(pack) {
|
||||
|
@ -184,11 +184,11 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
else oo = oupt[i];
|
||||
if(!is_surface(oo)) break;
|
||||
|
||||
var ww = surface_get_width(oo);
|
||||
var hh = surface_get_height(oo);
|
||||
var ww = surface_get_width_safe(oo);
|
||||
var hh = surface_get_height_safe(oo);
|
||||
|
||||
var _w = surface_get_width(inpt[i]);
|
||||
var _h = surface_get_height(inpt[i]);
|
||||
var _w = surface_get_width_safe(inpt[i]);
|
||||
var _h = surface_get_height_safe(inpt[i]);
|
||||
|
||||
surface_set_target(oo);
|
||||
BLEND_OVERRIDE;
|
||||
|
@ -303,15 +303,15 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
switch(pack) {
|
||||
case SPRITE_STACK.horizontal :
|
||||
for(var i = _st; i < _ed; i++) {
|
||||
ww += surface_get_width(inpt[i]);
|
||||
ww += surface_get_width_safe(inpt[i]);
|
||||
if(i > _st) ww += spac;
|
||||
hh = max(hh, surface_get_height(inpt[i]));
|
||||
hh = max(hh, surface_get_height_safe(inpt[i]));
|
||||
}
|
||||
break;
|
||||
case SPRITE_STACK.vertical :
|
||||
for(var i = _st; i < _ed; i++) {
|
||||
ww = max(ww, surface_get_width(inpt[i]));
|
||||
hh += surface_get_height(inpt[i]);
|
||||
ww = max(ww, surface_get_width_safe(inpt[i]));
|
||||
hh += surface_get_height_safe(inpt[i]);
|
||||
if(i > _st) hh += spac;
|
||||
}
|
||||
break;
|
||||
|
@ -329,9 +329,9 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
for(var j = 0; j < col; j++) {
|
||||
var index = _st + i * col + j;
|
||||
if(index >= amo) break;
|
||||
row_w += surface_get_width(inpt[index]);
|
||||
row_w += surface_get_width_safe(inpt[index]);
|
||||
if(j) row_w += spac;
|
||||
row_h = max(row_h, surface_get_height(inpt[index]));
|
||||
row_h = max(row_h, surface_get_height_safe(inpt[index]));
|
||||
}
|
||||
|
||||
ww = max(ww, row_w);
|
||||
|
@ -354,8 +354,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
var px = padd[2];
|
||||
var py = padd[1];
|
||||
for(var i = _st; i < _ed; i++) {
|
||||
var _w = surface_get_width(inpt[i]);
|
||||
var _h = surface_get_height(inpt[i]);
|
||||
var _w = surface_get_width_safe(inpt[i]);
|
||||
var _h = surface_get_height_safe(inpt[i]);
|
||||
var _sx = px;
|
||||
var _sy = py;
|
||||
|
||||
|
@ -374,8 +374,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
var px = padd[2];
|
||||
var py = padd[1];
|
||||
for(var i = _st; i < _ed; i++) {
|
||||
var _w = surface_get_width(inpt[i]);
|
||||
var _h = surface_get_height(inpt[i]);
|
||||
var _w = surface_get_width_safe(inpt[i]);
|
||||
var _h = surface_get_height_safe(inpt[i]);
|
||||
var _sx = px;
|
||||
var _sy = py;
|
||||
|
||||
|
@ -409,8 +409,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
var index = _st + i * col + j;
|
||||
if(index >= amo) break;
|
||||
|
||||
var _w = surface_get_width(inpt[index]);
|
||||
var _h = surface_get_height(inpt[index]);
|
||||
var _w = surface_get_width_safe(inpt[index]);
|
||||
var _h = surface_get_height_safe(inpt[index]);
|
||||
|
||||
array_push(_atl, new SurfaceAtlas(inpt[index], [px, py]));
|
||||
draw_surface_safe(inpt[index], px, py);
|
||||
|
|
|
@ -97,11 +97,11 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(is_array(_surf)) {
|
||||
if(array_length(_surf) == 0) return [1, 1];
|
||||
if(!is_surface(_surf[0])) return [1, 1];
|
||||
return [ surface_get_width(_surf[0]), surface_get_height(_surf[0]) ];
|
||||
return [ surface_get_width_safe(_surf[0]), surface_get_height_safe(_surf[0]) ];
|
||||
}
|
||||
|
||||
if(!is_surface(_surf)) return [1, 1];
|
||||
return [ surface_get_width(_surf), surface_get_height(_surf) ];
|
||||
return [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ];
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
|
@ -220,8 +220,8 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
if(is_array(_inSurf))
|
||||
_surf = array_safe_get(_inSurf, _arr? irandom(array_length(_inSurf) - 1) : safe_mod(i, array_length(_inSurf)));
|
||||
|
||||
var _sw = surface_get_width(_surf);
|
||||
var _sh = surface_get_height(_surf);
|
||||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
var sw = _sw * scax;
|
||||
var sh = _sh * scay;
|
||||
|
||||
|
|
|
@ -97,8 +97,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
if(_shp == 2) {
|
||||
var _tex = inputs[| 6].getValue();
|
||||
if(is_array(_tex)) _tex = _tex[safe_mod(preview_index, array_length(_tex))];
|
||||
var tw = surface_get_width(_tex);
|
||||
var th = surface_get_height(_tex);
|
||||
var tw = surface_get_width_safe(_tex);
|
||||
var th = surface_get_height_safe(_tex);
|
||||
|
||||
draw_set_color(is_convex? COLORS._main_accent : COLORS._main_value_negative);
|
||||
|
||||
|
@ -263,8 +263,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
var meshes = attributes.mesh;
|
||||
var mesh = [];
|
||||
|
||||
var ww = surface_get_width(_tex);
|
||||
var hh = surface_get_height(_tex);
|
||||
var ww = surface_get_width_safe(_tex);
|
||||
var hh = surface_get_height_safe(_tex);
|
||||
|
||||
var surface_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
|
||||
buffer_get_surface(surface_buffer, _tex, 0);
|
||||
|
@ -514,8 +514,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
var _spos = inputs[| 7].getValue();
|
||||
|
||||
var ww = max(1, surface_get_width(_tex));
|
||||
var hh = max(1, surface_get_height(_tex));
|
||||
var ww = max(1, surface_get_width_safe(_tex));
|
||||
var hh = max(1, surface_get_height_safe(_tex));
|
||||
|
||||
var ox = rpos == noone? _spos[0] : rpos[0];
|
||||
var oy = rpos == noone? _spos[1] : rpos[1];
|
||||
|
|
|
@ -38,8 +38,8 @@ function Node_Scale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
var ww, hh;
|
||||
switch(mode) {
|
||||
case 0 :
|
||||
ww = scale * surface_get_width(_data[0]);
|
||||
hh = scale * surface_get_height(_data[0]);
|
||||
ww = scale * surface_get_width_safe(_data[0]);
|
||||
hh = scale * surface_get_height_safe(_data[0]);
|
||||
break;
|
||||
case 1 :
|
||||
ww = targ[0];
|
||||
|
|
|
@ -36,8 +36,8 @@ function Node_Scale_Algo(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var inSurf = _data[0];
|
||||
var algo = _data[1];
|
||||
var ww = surface_get_width(inSurf);
|
||||
var hh = surface_get_height(inSurf);
|
||||
var ww = surface_get_width_safe(inSurf);
|
||||
var hh = surface_get_height_safe(inSurf);
|
||||
var cDep = attrDepth();
|
||||
var shader;
|
||||
var sc = 2;
|
||||
|
|
|
@ -244,8 +244,8 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
posS++;
|
||||
}
|
||||
|
||||
var sw = surface_get_width(surf);
|
||||
var sh = surface_get_height(surf);
|
||||
var sw = surface_get_width_safe(surf);
|
||||
var sh = surface_get_height_safe(surf);
|
||||
|
||||
if(_dist != AREA_DISTRIBUTION.area || _scat != AREA_SCATTER.uniform) {
|
||||
var p = point_rotate(-sw / 2 * _scx, -sh * _scy / 2, 0, 0, _r);
|
||||
|
@ -264,8 +264,8 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
draw_surface_ext_safe(surf, _x, _y, _scx, _scy, _r, clr, alp);
|
||||
|
||||
if(_dist == 5) {
|
||||
var _sw = surface_get_width(surf) * _scx;
|
||||
var _sh = surface_get_height(surf) * _scy;
|
||||
var _sw = surface_get_width_safe(surf) * _scx;
|
||||
var _sh = surface_get_height_safe(surf) * _scy;
|
||||
|
||||
if(_x < _sw)
|
||||
draw_surface_ext_safe(surf, _dim[0] + _x, _y, _scx, _scy, _r, clr, alp);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue