DynaSurf width, height

This commit is contained in:
Tanasart 2023-09-08 21:37:36 +02:00
parent 20527a2a63
commit 1fffd38ba9
132 changed files with 488 additions and 414 deletions

View file

@ -549,6 +549,7 @@
{"name":"s_node_pack_sprite","order":5,"path":"sprites/s_node_pack_sprite/s_node_pack_sprite.yy",}, {"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":"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":"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":"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":"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",}, {"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",},

View file

@ -1117,6 +1117,7 @@
{"id":{"name":"surface_valid","path":"scripts/surface_valid/surface_valid.yy",},}, {"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":"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":"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":"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":"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",},}, {"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.

View file

@ -72,8 +72,8 @@ event_inherited();
draw_sprite_stretched(THEME.ui_panel_bg, 1, fx, _y, ww, hg); draw_sprite_stretched(THEME.ui_panel_bg, 1, fx, _y, ww, hg);
if(thmb && _y + hg > 0 && _y < sp_recent.h) { if(thmb && _y + hg > 0 && _y < sp_recent.h) {
var sw = surface_get_width(thmb); var sw = surface_get_width_safe(thmb);
var sh = surface_get_height(thmb); var sh = surface_get_height_safe(thmb);
var ss = (ww - ui(8)) / sw; var ss = (ww - ui(8)) / sw;
var sy = (((sh * ss) - hg) * clamp((_y + hg) / (sp_recent.h + hg), 0, 1)) / ss; var sy = (((sh * ss) - hg) * clamp((_y + hg) / (sp_recent.h + hg), 0, 1)) / ss;

View file

@ -79,6 +79,8 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
case VALUE_TYPE.buffer : case VALUE_TYPE.buffer :
draw_tooltip_buffer(content); draw_tooltip_buffer(content);
break; break;
default :
draw_tooltip_text(string(content));
} }
} else if(TOOLTIP != "") } else if(TOOLTIP != "")
draw_tooltip_text(TOOLTIP); draw_tooltip_text(TOOLTIP);

View file

@ -195,8 +195,8 @@ function __part(_node) constructor {
scy = sc_sy * scCurve; scy = sc_sy * scCurve;
var _xx, _yy; var _xx, _yy;
var s_w = surface_get_width(ss) * scx; var s_w = surface_get_width_safe(ss) * scx;
var s_h = surface_get_height(ss) * scy; var s_h = surface_get_height_safe(ss) * scy;
if(boundary_data == -1) { if(boundary_data == -1) {
var _pp = point_rotate(-s_w / 2, -s_h / 2, 0, 0, rot); var _pp = point_rotate(-s_w / 2, -s_h / 2, 0, 0, rot);

View file

@ -147,7 +147,7 @@ function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
var str = 1; var str = 1;
if(is_surface(_dspTex)) { 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 r = color_get_red(c) / 255;
var g = color_get_green(c) / 255; var g = color_get_green(c) / 255;
var b = color_get_blue(c) / 255; var b = color_get_blue(c) / 255;

View file

@ -129,8 +129,8 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var _smt = getSingleValue(19, index); var _smt = getSingleValue(19, index);
if(!is_surface(_ins)) return noone; if(!is_surface(_ins)) return noone;
var ww = surface_get_width(_ins); var ww = surface_get_width_safe(_ins);
var hh = surface_get_height(_ins); var hh = surface_get_height_safe(_ins);
var tw = 1 / ww; var tw = 1 / ww;
var th = 1 / hh; var th = 1 / hh;
@ -159,8 +159,8 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
} }
if(useH) { if(useH) {
var hgw = surface_get_width(_hei); var hgw = surface_get_width_safe(_hei);
var hgh = surface_get_height(_hei); var hgh = surface_get_height_safe(_hei);
var hgtW = hgw / ww; var hgtW = hgw / ww;
var hgtH = hgh / hh; 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); var _cam = new __3d_camera(_proj, _fov);
if(_smt) { if(_smt) {
var ww = surface_get_width(_ins); var ww = surface_get_width_safe(_ins);
var hh = surface_get_height(_ins); var hh = surface_get_height_safe(_ins);
var ts = surface_create(ww, hh); var ts = surface_create(ww, hh);
surface_set_shader(ts, sh_3d_extrude_corner); surface_set_shader(ts, sh_3d_extrude_corner);

View file

@ -153,8 +153,8 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
switch(_out_type) { switch(_out_type) {
case OUTPUT_SCALING.same_as_input : case OUTPUT_SCALING.same_as_input :
inputs[| 5].setVisible(false); inputs[| 5].setVisible(false);
_ww = surface_get_width(_data[0]); _ww = surface_get_width_safe(_data[0]);
_hh = surface_get_height(_data[0]); _hh = surface_get_height_safe(_data[0]);
break; break;
case OUTPUT_SCALING.constant : case OUTPUT_SCALING.constant :
inputs[| 5].setVisible(true); inputs[| 5].setVisible(true);
@ -163,8 +163,8 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
break; break;
case OUTPUT_SCALING.relative : case OUTPUT_SCALING.relative :
inputs[| 5].setVisible(true); inputs[| 5].setVisible(true);
_ww = surface_get_width(_data[0]) * _out[0]; _ww = surface_get_width_safe(_data[0]) * _out[0];
_hh = surface_get_height(_data[0]) * _out[1]; _hh = surface_get_height_safe(_data[0]) * _out[1];
break; break;
} }

View file

@ -18,8 +18,8 @@ function SurfaceAtlas(surface, position = [ 0, 0 ], rotation = 0, scale = [ 1, 1
function Surface(surface) constructor { function Surface(surface) constructor {
static set = function(surface) { static set = function(surface) {
self.surface = surface; self.surface = surface;
w = surface_get_width(surface); w = surface_get_width_safe(surface);
h = surface_get_height(surface); h = surface_get_height_safe(surface);
format = surface_get_format(surface); format = surface_get_format(surface);
} }
set(surface); set(surface);

View file

@ -206,8 +206,8 @@
[ "surface_copy", surface_copy ], [ "surface_copy", surface_copy ],
[ "surface_copy_part", surface_copy_part ], [ "surface_copy_part", surface_copy_part ],
[ "surface_depth_disable", surface_depth_disable ], [ "surface_depth_disable", surface_depth_disable ],
[ "surface_get_height", surface_get_height ], [ "surface_get_height_safe", surface_get_height_safe ],
[ "surface_get_width", surface_get_width ], [ "surface_get_width_safe", surface_get_width_safe ],
[ "surface_get_texture", surface_get_texture ], [ "surface_get_texture", surface_get_texture ],
[ "surface_get_depth_disable", surface_get_depth_disable ], [ "surface_get_depth_disable", surface_get_depth_disable ],
[ "surface_getpixel", surface_getpixel ], [ "surface_getpixel", surface_getpixel ],

View file

@ -207,7 +207,7 @@ function array_get_dimension(arr) {
function array_shape(arr, first = true, isSurface = false) { function array_shape(arr, first = true, isSurface = false) {
if(!is_array(arr)) { if(!is_array(arr)) {
if(isSurface && is_surface(arr)) if(isSurface && is_surface(arr))
return (first? "" : " x ") + string(surface_get_width(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 ""; return "";
} }

View file

@ -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"); static uni_ovc = shader_get_uniform(sh_blur_gaussian, "overColor");
var format = surface_get_format(surface) var format = surface_get_format(surface)
__blur_hori = surface_verify(__blur_hori, 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(surface), surface_get_height(surface), format); __blur_vert = surface_verify(__blur_vert, surface_get_width_safe(surface), surface_get_height_safe(surface), format);
#region kernel generation #region kernel generation
size = max(1, round(size)); 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); draw_clear_alpha(bg_c, bg);
shader_set(sh_blur_gaussian); 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_f_array_safe(uni_wei, gau_array);
shader_set_uniform_i(uni_bor, sampleMode); shader_set_uniform_i(uni_bor, sampleMode);

View file

@ -33,11 +33,11 @@ function buffer_from_surface(surface, size = true) {
var bitSize = surface_format_get_bytes(surface_get_format(surface)); 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) { if(size) {
buffer_write(_b, buffer_text, "PXCS"); buffer_write(_b, buffer_text, "PXCS");
buffer_write(_b, buffer_u16, surface_get_width(surface)); buffer_write(_b, buffer_u16, surface_get_width_safe(surface));
buffer_write(_b, buffer_u16, surface_get_height(surface)); buffer_write(_b, buffer_u16, surface_get_height_safe(surface));
buffer_write(_b, buffer_u8, surface_get_format(surface)); buffer_write(_b, buffer_u8, surface_get_format(surface));
} }

View file

@ -175,8 +175,8 @@ function __3dScene(camera) constructor {
static ssaoPass = function(deferData) { #region static ssaoPass = function(deferData) { #region
if(!ssao_enabled) return; if(!ssao_enabled) return;
var _sw = surface_get_width(deferData.geometry_data[0]); var _sw = surface_get_width_safe(deferData.geometry_data[0]);
var _sh = surface_get_height(deferData.geometry_data[0]); var _sh = surface_get_height_safe(deferData.geometry_data[0]);
var _ssao_surf = surface_create(_sw, _sh); var _ssao_surf = surface_create(_sw, _sh);
surface_set_shader(_ssao_surf, sh_d3d_ssao); surface_set_shader(_ssao_surf, sh_d3d_ssao);

View file

@ -29,8 +29,8 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _
var _surface = surface; var _surface = surface;
var _height = height; var _height = height;
var ww = surface_get_width(_surface); var ww = surface_get_width_safe(_surface);
var hh = surface_get_height(_surface); var hh = surface_get_height_safe(_surface);
surface_w = ww; surface_w = ww;
surface_h = hh; surface_h = hh;
@ -61,8 +61,8 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _
} }
if(useH) { if(useH) {
var hgw = surface_get_width(_height); var hgw = surface_get_width_safe(_height);
var hgh = surface_get_height(_height); var hgh = surface_get_height_safe(_height);
var hgtW = hgw / ww; var hgtW = hgw / ww;
var hgtH = hgh / hh; var hgtH = hgh / hh;

View file

@ -1,8 +1,8 @@
function get_point_from_dist(distMap, attempt = 4) { function get_point_from_dist(distMap, attempt = 4) {
if(!is_surface(distMap)) return noone; if(!is_surface(distMap)) return noone;
var w = surface_get_width(distMap); var w = surface_get_width_safe(distMap);
var h = surface_get_height(distMap); var h = surface_get_height_safe(distMap);
var v = 0; var v = 0;
var res = noone; var res = noone;
@ -33,7 +33,7 @@ function get_points_from_dist(distMap, amount, seed = 0, attempt = 8) {
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(sh_sample_points); shader_set(sh_sample_points);
shader_set_uniform_f(shader_get_uniform(sh_sample_points, "dimension"), 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_i(shader_get_uniform(sh_sample_points, "attempt"), attempt);
shader_set_uniform_f(shader_get_uniform(sh_sample_points, "seed"), seed); 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); buffer_seek(b, buffer_seek_start, 0);
var pos = array_create(amount); var pos = array_create(amount);
var w = surface_get_width(distMap); var w = surface_get_width_safe(distMap);
var h = surface_get_height(distMap); var h = surface_get_height_safe(distMap);
for( var i = 0; i < amount; i++ ) { for( var i = 0; i < amount; i++ ) {
var cc = buffer_read(b, buffer_u32); var cc = buffer_read(b, buffer_u32);

View file

@ -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) { 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)); var ss = min(w / surface_get_width_safe(surf), h / surface_get_height_safe(surf));
draw_surface_ext_safe(surf, xx - surface_get_width(surf) * ss / 2, yy - surface_get_height(surf) * ss / 2, ss, ss,, color, alpha); 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) { function draw_surface_stretch_fit(surf, xx, yy, w, h, sw, sh) {

View file

@ -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 uniform_presalpha = shader_get_uniform(sh, "preserveAlpha");
var surf = surface_get_target(); var surf = surface_get_target();
var surf_w = surface_get_width(surf); var surf_w = surface_get_width_safe(surf);
var surf_h = surface_get_height(surf); var surf_h = surface_get_height_safe(surf);
if(is_surface(foreground)) { if(is_surface(foreground)) {
shader_set(sh); shader_set(sh);
texture_set_stage(uniform_foreground, surface_get_texture(foreground)); texture_set_stage(uniform_foreground, surface_get_texture(foreground));
if(_mask) texture_set_stage(uniform_mask, surface_get_texture(_mask)); 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_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_f(uniform_alpha, alpha);
shader_set_uniform_i(uniform_presalpha, _pre_alp); shader_set_uniform_i(uniform_presalpha, _pre_alp);
shader_set_uniform_i(uniform_tile, tile); shader_set_uniform_i(uniform_tile, tile);

View file

@ -1,8 +1,8 @@
function draw_surface_align(surface, _x, _y, _s, _halign = fa_left, _valign = fa_top) { function draw_surface_align(surface, _x, _y, _s, _halign = fa_left, _valign = fa_top) {
if(!is_surface(surface)) return; if(!is_surface(surface)) return;
var w = surface_get_width(surface) * _s; var w = surface_get_width_safe(surface) * _s;
var h = surface_get_height(surface) * _s; var h = surface_get_height_safe(surface) * _s;
var _sx = _x, _sy = _y; var _sx = _x, _sy = _y;
switch(_halign) { switch(_halign) {

View file

@ -84,8 +84,8 @@ function draw_tooltip_surface_array(surf) {
var i = floor(ind / col); var i = floor(ind / col);
var j = safe_mod(ind, col); var j = safe_mod(ind, col);
var sw = surface_get_width(surf[ind]); var sw = surface_get_width_safe(surf[ind]);
var sh = surface_get_height(surf[ind]); var sh = surface_get_height_safe(surf[ind]);
var ss = nn / max(sw, sh); var ss = nn / max(sw, sh);
var cx = mx + ui(8) + j * nn + nn / 2; var cx = mx + ui(8) + j * nn + nn / 2;
var cy = my + ui(8) + i * 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; if(!is_surface(surf)) return;
var sw = surface_get_width(surf); var sw = surface_get_width_safe(surf);
var sh = surface_get_height(surf); var sh = surface_get_height_safe(surf);
var ss = min(ui(128) / sw, ui(128) / sh); var ss = min(ui(128) / sw, ui(128) / sh);
@ -146,8 +146,8 @@ function draw_tooltip_atlas(atlas) {
if(!is_surface(surf)) continue; if(!is_surface(surf)) continue;
var sw = surface_get_width(surf); var sw = surface_get_width_safe(surf);
var sh = surface_get_height(surf); var sh = surface_get_height_safe(surf);
var ss = min(ui(48) / sw, ui(48) / sh); var ss = min(ui(48) / sw, ui(48) / sh);
draw_surface_ext_safe(surf, sx, _y, ss, ss); draw_surface_ext_safe(surf, sx, _y, ss, ss);

View file

@ -1,4 +1,4 @@
function dynaSurf() constructor { function DynaSurf() constructor {
surfaces = []; surfaces = [];
static getWidth = function() { return 1; } static getWidth = function() { return 1; }

View file

@ -1,4 +1,4 @@
function dynaSurf_iso_4() : dynaSurf() constructor { function dynaSurf_iso_4() : DynaSurf() constructor {
surfaces = array_create(4, noone); surfaces = array_create(4, noone);
static getSurface = function(_rot) { static getSurface = function(_rot) {

View file

@ -801,7 +801,7 @@ function gameframe_caption_get_overlap() {
if (window_get_fullscreen() || gameframe_isFullscreen_hx) return 0.; if (window_get_fullscreen() || gameframe_isFullscreen_hx) return 0.;
var _h = gameframe_caption_get_height(); var _h = gameframe_caption_get_height();
var _rect = application_get_position(); 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) { function gameframe_caption_draw_border_default(__x, __y, __width, __height) {

View file

@ -160,7 +160,7 @@ function gif_std_enum_getIndex() {
surface_set_target(_ws); surface_set_target(_ws);
draw_clear(16777215); draw_clear(16777215);
surface_reset_target(); 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); surface_free(_ws);
Gif_white32 = _white32; Gif_white32 = _white32;
} }
@ -182,11 +182,11 @@ function gif_std_enum_getIndex() {
surface_copy(_sf, _frame.x, _frame.y, _frame.surface); surface_copy(_sf, _frame.x, _frame.y, _frame.surface);
if (_spr == -1) { 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 { } else {
//spr_size = sprite_get_width(_spr) * sprite_get_height(_spr) * sprite_get_number(_spr); //spr_size = sprite_get_width(_spr) * sprite_get_height(_spr) * sprite_get_number(_spr);
//show_debug_message(string(spr_size)); //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; var _fdelay = _frame.delay;
@ -234,7 +234,7 @@ function gif_std_enum_getIndex() {
surface_set_target(_ws); surface_set_target(_ws);
draw_clear(16777215); draw_clear(16777215);
surface_reset_target(); 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); surface_free(_ws);
Gif_white32 = _white32; Gif_white32 = _white32;
} }
@ -255,11 +255,11 @@ function gif_std_enum_getIndex() {
surface_copy(_sf, _frame.x, _frame.y, _frame.surface); surface_copy(_sf, _frame.x, _frame.y, _frame.surface);
if (_spr == -1) { 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 { } else {
//spr_size = sprite_get_width(_spr) * sprite_get_height(_spr) * sprite_get_number(_spr); //spr_size = sprite_get_width(_spr) * sprite_get_height(_spr) * sprite_get_number(_spr);
//show_debug_message(string(spr_size)); //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; var _fdelay = _frame.delay;

View file

@ -56,8 +56,8 @@ function histogramUpdate(surface) {
if(!is_surface(surface)) return; if(!is_surface(surface)) return;
histMax = 0; histMax = 0;
var sw = surface_get_width(surface); var sw = surface_get_width_safe(surface);
var sh = surface_get_height(surface); var sh = surface_get_height_safe(surface);
var stw = max(1, sw / attributes.preview_sample); var stw = max(1, sw / attributes.preview_sample);
var sth = max(1, sh / attributes.preview_sample); var sth = max(1, sh / attributes.preview_sample);

View file

@ -14,7 +14,7 @@ function mask_apply(original, edited, mask, mix = 1) {
shader_set_uniform_f(shader_get_uniform(sh_mask, "mixRatio"), mix); 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(); shader_reset();
surface_reset_target(); surface_reset_target();

View file

@ -51,16 +51,16 @@ function Node_3D_Depth(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
DRAW_CLEAR DRAW_CLEAR
shader_set_surface("texMap", _tex); 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_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("cameraPos", _cx, _cy, _cz);
shader_set_f("cameraUp", up_x, up_y, up_z); shader_set_f("cameraUp", up_x, up_y, up_z);
shader_set_f("cameraRight", right_x, right_y, right_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(); surface_reset_shader();
return _outSurf; return _outSurf;

View file

@ -27,7 +27,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
if(index == 0) { if(index == 0) {
var s = inputs[| 0].getValue(); var s = inputs[| 0].getValue();
if(is_array(s)) s = s[0]; 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); shader_set_interpolation(_inSurf);
var ww = _dim[0]; var ww = _dim[0];
var hh = _dim[1]; var hh = _dim[1];
var in_w = surface_get_width(_inSurf); var in_w = surface_get_width_safe(_inSurf);
var in_h = surface_get_height(_inSurf); var in_h = surface_get_height_safe(_inSurf);
var sp_r = _splice[0]; var sp_r = _splice[0];
var sp_t = _splice[1]; var sp_t = _splice[1];
var sp_l = _splice[2]; var sp_l = _splice[2];

View file

@ -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) { static processData = function(_outSurf, _data, _output_index, _array_index) {
surface_set_shader(_outSurf, sh_FXAA); surface_set_shader(_outSurf, sh_FXAA);
gpu_set_tex_filter(true); 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); draw_surface_safe(_data[0], 0, 0);
gpu_set_tex_filter(false); gpu_set_tex_filter(false);
surface_reset_shader(); surface_reset_shader();

View file

@ -92,8 +92,8 @@ function Node_VFX_Renderer(_x, _y, _group = noone) : Node(_x, _y, _group) constr
else if(_blend == PARTICLE_BLEND_MODE.additive) else if(_blend == PARTICLE_BLEND_MODE.additive)
BLEND_ADD; BLEND_ADD;
var surf_w = surface_get_width(_outSurf); var surf_w = surface_get_width_safe(_outSurf);
var surf_h = surface_get_height(_outSurf); var surf_h = surface_get_height_safe(_outSurf);
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) { for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
var parts = inputs[| i].getValue(_time); var parts = inputs[| i].getValue(_time);

View file

@ -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 cx = xx + w * _s / 2;
var cy = yy + h * _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); draw_surface_align(spr, cx, cy, ss, fa_center, fa_center);
} }
} }

View file

@ -26,7 +26,7 @@ function Node_Alpha_Hash(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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); shader_set_uniform_f_array_safe(uniform_dit, dither8);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);
shader_reset(); shader_reset();

View file

@ -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++ ) { for( var i = 0, n = array_length(_sdata); i < n; i++ ) {
var _sid = _sdata[i][0]; var _sid = _sdata[i][0];
var _surf = _sdata[i][1]; var _surf = _sdata[i][1];
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
var _ss = (_hh - 8) / _sh; var _ss = (_hh - 8) / _sh;
draw_surface_ext_safe(_surf, _sx, _sy, _ss, _ss, 0, c_white, 1); 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; var _sy1 = _sy0 + ssh;
draw_rectangle(_sx0, _sy0, _sx1, _sy1, true); draw_rectangle(_sx0, _sy0, _sx1, _sy1, true);
var _ssw = surface_get_width(_surf); var _ssw = surface_get_width_safe(_surf);
var _ssh = surface_get_height(_surf); var _ssh = surface_get_height_safe(_surf);
var _sss = min(ssh / _ssw, ssh / _ssh); var _sss = min(ssh / _ssw, ssh / _ssh);
draw_surface_ext_safe(_surf, _sx0, _sy0, _sss, _sss, 0, c_white, 1); 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; _tran[TRANSFORM.rot] = sa;
} else if(drag_type == NODE_COMPOSE_DRAG.scale) { } else if(drag_type == NODE_COMPOSE_DRAG.scale) {
var _rot = _aang * (_pang? _bone.angle : _bone.pose_local_angle) + _tran[TRANSFORM.rot]; var _rot = _aang * (_pang? _bone.angle : _bone.pose_local_angle) + _tran[TRANSFORM.rot];
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot); var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot);
var sca_x = _p[0] / _s / _sw * 2; 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; _sca[1] *= _psca? _bone.pose_scale : _bone.pose_local_scale;
} }
var _ww = surface_get_width(_surf); var _ww = surface_get_width_safe(_surf);
var _hh = surface_get_height(_surf); var _hh = surface_get_height_safe(_surf);
var _sw = _ww * _sca[0]; var _sw = _ww * _sca[0];
var _sh = _hh * _sca[1]; 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; _sca[1] *= _psca? _b.pose_scale : _b.pose_local_scale;
} }
var _ww = surface_get_width(_s); var _ww = surface_get_width_safe(_s);
var _hh = surface_get_height(_s); var _hh = surface_get_height_safe(_s);
var _sw = _ww * _sca[0]; var _sw = _ww * _sca[0];
var _sh = _hh * _sca[1]; 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]; _b = boneMap[? _b];
var _cx = surface_get_width(_surf) / 2; var _cx = surface_get_width_safe(_surf) / 2;
var _cy = surface_get_height(_surf) / 2; var _cy = surface_get_height_safe(_surf) / 2;
var _anc = _b.getPoint(0.5); var _anc = _b.getPoint(0.5);
var _rot = _arot? -_b.angle : 0; var _rot = _arot? -_b.angle : 0;

View file

@ -20,7 +20,7 @@ function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(sh_atlas); 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); draw_surface_safe(_data[0], 0, 0);
shader_reset(); shader_reset();

View file

@ -33,7 +33,7 @@ function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
if(_output_index == 1) if(_output_index == 1)
return array_safe_get(colors, _array_index); 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 lop = ceil(log2(side));
var cc; var cc;
side = power(2, lop); side = power(2, lop);

View file

@ -49,8 +49,8 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var _surf = current_data[0]; var _surf = current_data[0];
if(!is_surface(_surf)) return; if(!is_surface(_surf)) return;
var _pw = surface_get_width(_surf) * _s / 2; var _pw = surface_get_width_safe(_surf) * _s / 2;
var _ph = surface_get_height(_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); 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_shf, _shf);
shader_set_uniform_f_array_safe(uniform_sca, _sca); shader_set_uniform_f_array_safe(uniform_sca, _sca);
shader_set_uniform_i(uniform_slp, _slp); 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); shader_set_uniform_i(uniform_sam, _sam);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);

View file

@ -74,11 +74,11 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 11].setVisible(_tile == 0); inputs[| 11].setVisible(_tile == 0);
if(_tile == 0 && is_surface(_fore)) { if(_tile == 0 && is_surface(_fore)) {
ww = surface_get_width(_back); ww = surface_get_width_safe(_back);
hh = surface_get_height(_back); hh = surface_get_height_safe(_back);
var fw = surface_get_width(_fore); var fw = surface_get_width_safe(_fore);
var fh = surface_get_height(_fore); var fh = surface_get_height_safe(_fore);
temp_surface[0] = surface_verify(temp_surface[0], ww, hh, cDep); temp_surface[0] = surface_verify(temp_surface[0], ww, hh, cDep);
_foreDraw = temp_surface[0]; _foreDraw = temp_surface[0];
@ -108,22 +108,22 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
switch(_outp) { switch(_outp) {
case 0 : case 0 :
ww = surface_get_width(_back); ww = surface_get_width_safe(_back);
hh = surface_get_height(_back); hh = surface_get_height_safe(_back);
break; break;
case 1 : case 1 :
if(is_surface(_foreDraw)) { if(is_surface(_foreDraw)) {
ww = surface_get_width(_foreDraw); ww = surface_get_width_safe(_foreDraw);
hh = surface_get_height(_foreDraw); hh = surface_get_height_safe(_foreDraw);
} }
break; break;
case 2 : case 2 :
ww = surface_get_width(_mask); ww = surface_get_width_safe(_mask);
hh = surface_get_height(_mask); hh = surface_get_height_safe(_mask);
break; break;
case 3 : case 3 :
ww = max(surface_get_width(_back), is_surface(_fore)? surface_get_width(_fore) : 1, surface_get_width(_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(_back), is_surface(_fore)? surface_get_height(_fore) : 1, surface_get_height(_mask)); hh = max(surface_get_height_safe(_back), is_surface(_fore)? surface_get_height_safe(_fore) : 1, surface_get_height_safe(_mask));
break; break;
case 4 : case 4 :
ww = _out_dim[0]; ww = _out_dim[0];

View file

@ -38,7 +38,7 @@ function Node_Blinker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
//if(!is_surface(_surf)) return _outSurf; //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); //surface_set_shader(temp_surface[0], sh_blink_extract);
// draw_surface_safe(_surf); // draw_surface_safe(_surf);

View file

@ -44,7 +44,7 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var _tole = _data[2]; var _tole = _data[2];
var _stre = _data[3]; var _stre = _data[3];
var _mask = _data[4]; 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); surface_set_target(pass1);
draw_clear_alpha(c_black, 1); draw_clear_alpha(c_black, 1);

View file

@ -37,7 +37,7 @@ function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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); shader_set_uniform_f(uniform_str, _str);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);
shader_reset(); shader_reset();

View file

@ -41,8 +41,8 @@ function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
var _mask = _data[3]; var _mask = _data[3];
var _mix = _data[4]; var _mix = _data[4];
var ww = surface_get_width(_surf); var ww = surface_get_width_safe(_surf);
var hh = surface_get_height(_surf); var hh = surface_get_height_safe(_surf);
temp_surface[0] = surface_verify(temp_surface[0], ww, hh, attrDepth()); temp_surface[0] = surface_verify(temp_surface[0], ww, hh, attrDepth());

View file

@ -34,8 +34,8 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y,
_surf = _surf[preview_index]; _surf = _surf[preview_index];
} }
var ww = surface_get_width(_surf); var ww = surface_get_width_safe(_surf);
var hh = surface_get_height(_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); 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]; var _mix = _data[4];
surface_set_shader(_outSurf, sh_blur_directional); 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("strength", _str);
shader_set_f("direction", _dir + 90); shader_set_f("direction", _dir + 90);
shader_set_i("sampleMode", struct_try_get(attributes, "oversample")); shader_set_i("sampleMode", struct_try_get(attributes, "oversample"));

View file

@ -46,12 +46,12 @@ function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var _cen = _data[2]; var _cen = _data[2];
var _mask = _data[4]; var _mask = _data[4];
var _mix = _data[5]; var _mix = _data[5];
_cen[0] /= surface_get_width(_outSurf); _cen[0] /= surface_get_width_safe(_outSurf);
_cen[1] /= surface_get_height(_outSurf); _cen[1] /= surface_get_height_safe(_outSurf);
surface_set_shader(_outSurf, sh_blur_radial); surface_set_shader(_outSurf, sh_blur_radial);
shader_set_interpolation(_data[0]); 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("strength", abs(_str));
shader_set_f("center", _cen); shader_set_f("center", _cen);

View file

@ -59,7 +59,7 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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_f(uniform_siz, _size);
shader_set_uniform_i(uniform_sam, _samp); shader_set_uniform_i(uniform_sam, _samp);

View file

@ -52,8 +52,8 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var _msk = _data[5]; var _msk = _data[5];
var _mask = _data[6]; var _mask = _data[6];
var _mix = _data[7]; var _mix = _data[7];
_cen[0] /= surface_get_width(_outSurf); _cen[0] /= surface_get_width_safe(_outSurf);
_cen[1] /= surface_get_height(_outSurf); _cen[1] /= surface_get_height_safe(_outSurf);
surface_set_shader(_outSurf, sh_blur_zoom); surface_set_shader(_outSurf, sh_blur_zoom);
shader_set_f("strength", _str); shader_set_f("strength", _str);

View file

@ -188,8 +188,8 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
py = _cam_y + sy; py = _cam_y + sy;
} }
_scnW = surface_get_width(_surface); _scnW = surface_get_width_safe(_surface);
_scnH = surface_get_height(_surface); _scnH = surface_get_height_safe(_surface);
px /= _scnW; px /= _scnW;
py /= _scnH; py /= _scnH;

View file

@ -106,7 +106,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(!is_surface(canvas_surface)) { if(!is_surface(canvas_surface)) {
canvas_surface = surface_create_from_buffer(_dim[0], _dim[1], canvas_buffer); 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); buffer_delete(canvas_buffer);
canvas_buffer = buffer_create(_dim[0] * _dim[1] * 4, buffer_fixed, 4); canvas_buffer = buffer_create(_dim[0] * _dim[1] * 4, buffer_fixed, 4);
canvas_surface = surface_size_to(canvas_surface, _dim[0], _dim[1]); 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() { function surface_store_buffer() {
buffer_delete(canvas_buffer); buffer_delete(canvas_buffer);
surface_w = surface_get_width(canvas_surface); surface_w = surface_get_width_safe(canvas_surface);
surface_h = surface_get_height(canvas_surface); surface_h = surface_get_height_safe(canvas_surface);
canvas_buffer = buffer_create(surface_w * surface_h * 4, buffer_fixed, 4); canvas_buffer = buffer_create(surface_w * surface_h * 4, buffer_fixed, 4);
buffer_get_surface(canvas_buffer, canvas_surface, 0); 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 } else
draw_circle_prec(_x, _y, _siz / 2, 0); draw_circle_prec(_x, _y, _siz / 2, 0);
} else { } else {
var _sw = surface_get_width(_brush); var _sw = surface_get_width_safe(_brush);
var _sh = surface_get_height(_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()); 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 function canvas_fill(_x, _y, _surf, _thres) { #region
var _alp = inputs[| 11].getValue(); var _alp = inputs[| 11].getValue();
var w = surface_get_width(_surf); var w = surface_get_width_safe(_surf);
var h = surface_get_height(_surf); var h = surface_get_height_safe(_surf);
var _c1 = get_color_buffer(_x, _y); var _c1 = get_color_buffer(_x, _y);
var thr = _thres * _thres; 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)) if(!surface_exists(canvas_surface))
surface_store_buffer(); surface_store_buffer();
var _surf_w = surface_get_width(canvas_surface); var _surf_w = surface_get_width_safe(canvas_surface);
var _surf_h = surface_get_height(canvas_surface); var _surf_h = surface_get_height_safe(canvas_surface);
#region drawing surface review #region drawing surface review
_drawing_surface = surface_verify(_drawing_surface, _surf_w, _surf_h); _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)) { if(mouse_press(mb_left, active)) {
var pos_x = selection_position[0]; var pos_x = selection_position[0];
var pos_y = selection_position[1]; var pos_y = selection_position[1];
var sel_w = surface_get_width(selection_surface); var sel_w = surface_get_width_safe(selection_surface);
var sel_h = surface_get_height(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)) { 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; 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]); 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, _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); surface_set_shader(preview_draw_surface, noone,, BLEND.alpha);
draw_surface_safe(_drawing_surface, 0, 0); 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) { if(is_selected) {
var pos_x = _x + selection_position[0] * _s; var pos_x = _x + selection_position[0] * _s;
var pos_y = _y + selection_position[1] * _s; var pos_y = _y + selection_position[1] * _s;
var sel_w = surface_get_width(selection_surface) * _s; var sel_w = surface_get_width_safe(selection_surface) * _s;
var sel_h = surface_get_height(selection_surface) * _s; var sel_h = surface_get_height_safe(selection_surface) * _s;
draw_set_color(c_white); draw_set_color(c_white);
draw_rectangle_dashed(pos_x, pos_y, pos_x + sel_w, pos_y + sel_h, true, 4); 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(); surface_reset_target();
shader_set(sh_brush_outline); 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); draw_surface_ext_safe(_preview_draw_surface, 0, 0, 1, 1, 0, c_white, 1);
shader_reset(); shader_reset();
} }

View file

@ -58,7 +58,7 @@ function Node_Checker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
surface_set_target(_outSurf); surface_set_target(_outSurf);
shader_set(shader); 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_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
shader_set_uniform_f(uniform_angle, degtorad(_ang)); shader_set_uniform_f(uniform_angle, degtorad(_ang));
shader_set_uniform_f(uniform_amount, _amo); shader_set_uniform_f(uniform_amount, _amo);

View file

@ -37,7 +37,7 @@ function Node_Chromatic_Aberration(_x, _y, _group = noone) : Node_Processor(_x,
surface_set_shader(_outSurf, shader); surface_set_shader(_outSurf, shader);
shader_set_interpolation(_data[0]); 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_array_safe(uniform_cen, center);
shader_set_uniform_f(uniform_str, stren); shader_set_uniform_f(uniform_str, stren);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);

View file

@ -139,8 +139,8 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
var _pall = ds_map_create(); var _pall = ds_map_create();
for( var i = 0, n = array_length(_surf); i < n; i++ ) { for( var i = 0, n = array_length(_surf); i < n; i++ ) {
var ww = surface_get_width(_surf[i]); var ww = surface_get_width_safe(_surf[i]);
var hh = surface_get_height(_surf[i]); var hh = surface_get_height_safe(_surf[i]);
var c_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2); var c_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);

View file

@ -20,8 +20,8 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var _suf = current_data[0]; var _suf = current_data[0];
if(!is_surface(_suf)) return; if(!is_surface(_suf)) return;
var ww = surface_get_width(_suf); var ww = surface_get_width_safe(_suf);
var hh = surface_get_height(_suf); var hh = surface_get_height_safe(_suf);
var _pos = current_data[1]; var _pos = current_data[1];
var _sam = 1 + (current_data[2] - 1) * 2; 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]; var _sam = _data[2];
if(!is_surface(_surf)) return c_black; if(!is_surface(_surf)) return c_black;
var ww = surface_get_width(_surf); var ww = surface_get_width_safe(_surf);
var hh = surface_get_height(_surf); var hh = surface_get_height_safe(_surf);
var r = 0, g = 0, b = 0, amo = 0; var r = 0, g = 0, b = 0, amo = 0;

View file

@ -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_s, surface_get_texture(_s));
texture_set_stage(uniform_v, surface_get_texture(_v)); 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(); shader_reset();
BLEND_NORMAL; BLEND_NORMAL;

View file

@ -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)); shader_set_uniform_i(uniform_usea, is_surface(_a));
texture_set_stage(uniform_a, surface_get_texture(_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(); shader_reset();
BLEND_NORMAL; BLEND_NORMAL;

View file

@ -120,8 +120,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var _sy1 = _sy0 + ssh; var _sy1 = _sy0 + ssh;
draw_rectangle(_sx0, _sy0, _sx1, _sy1, true); draw_rectangle(_sx0, _sy0, _sx1, _sy1, true);
var _ssw = surface_get_width(_surf); var _ssw = surface_get_width_safe(_surf);
var _ssh = surface_get_height(_surf); var _ssh = surface_get_height_safe(_surf);
var _sss = min(ssh / _ssw, ssh / _ssh); var _sss = min(ssh / _ssw, ssh / _ssh);
draw_surface_ext_safe(_surf, _sx0, _sy0, _sss, _sss, 0, c_white, 1); 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)) { if(key_mod_press(ALT)) {
var _surf = current_data[input_dragging - 1]; var _surf = current_data[input_dragging - 1];
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
var x0 = pos_x, x1 = pos_x + _sw; var x0 = pos_x, x1 = pos_x + _sw;
var y0 = pos_y, y1 = pos_y + _sh; 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) { } else if(drag_type == NODE_COMPOSE_DRAG.scale) {
var _surf = inputs[| surf_dragging + 0].getValue(); var _surf = inputs[| surf_dragging + 0].getValue();
var _rot = inputs[| surf_dragging + 2].getValue(); var _rot = inputs[| surf_dragging + 2].getValue();
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot); var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot);
var sca_x = _p[0] / _s / _sw * 2; 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; if(!_surf || is_array(_surf)) continue;
var _ww = surface_get_width(_surf); var _ww = surface_get_width_safe(_surf);
var _hh = surface_get_height(_surf); var _hh = surface_get_height_safe(_surf);
var _sw = _ww * _sca[0]; var _sw = _ww * _sca[0];
var _sh = _hh * _sca[1]; var _sh = _hh * _sca[1];
@ -757,14 +757,14 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
switch(_dim_type) { switch(_dim_type) {
case COMPOSE_OUTPUT_SCALING.first : case COMPOSE_OUTPUT_SCALING.first :
ww = surface_get_width(base); ww = surface_get_width_safe(base);
hh = surface_get_height(base); hh = surface_get_height_safe(base);
break; break;
case COMPOSE_OUTPUT_SCALING.largest : case COMPOSE_OUTPUT_SCALING.largest :
for(var i = input_fix_len; i < array_length(_data) - data_length; i += data_length) { for(var i = input_fix_len; i < array_length(_data) - data_length; i += data_length) {
var _s = _data[i]; var _s = _data[i];
ww = max(ww, surface_get_width(_s)); ww = max(ww, surface_get_width_safe(_s));
hh = max(hh, surface_get_height(_s)); hh = max(hh, surface_get_height_safe(_s));
} }
break; break;
case COMPOSE_OUTPUT_SCALING.constant : 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; if(!_s || is_array(_s)) continue;
var _ww = surface_get_width(_s); var _ww = surface_get_width_safe(_s);
var _hh = surface_get_height(_s); var _hh = surface_get_height_safe(_s);
var _sw = _ww * _sca[0]; var _sw = _ww * _sca[0];
var _sh = _hh * _sca[1]; var _sh = _hh * _sca[1];

View file

@ -41,7 +41,7 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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_f_array_safe(uniform_ker, _ker);
shader_set_uniform_i(uniform_sam, _sam); shader_set_uniform_i(uniform_sam, _sam);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);

View file

@ -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) { static processData = function(_outSurf, _data, _output_index, _array_index) {
var wd = _data[1]; 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); surface_set_target(temp);
DRAW_CLEAR DRAW_CLEAR
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(sh_corner_erode); 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); shader_set_uniform_f(uniform_er_size, wd);
draw_surface_safe(_data[0], 0, 0); 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; BLEND_OVERRIDE;
shader_set(sh_corner); 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_uniform_f(uniform_rad, wd);
shader_set_surface("original", _data[0]); shader_set_surface("original", _data[0]);
draw_surface_safe(temp, 0, 0); draw_surface_safe(temp, 0, 0);

View file

@ -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++ ) for( var i = 0, n = array_length(_splice); i < n; i++ )
_splice[i] = round(_splice[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_r = _x + (dim[0] - _splice[0]) * _s;
var sp_l = _x + _splice[2] * _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) { static processData = function(_outSurf, _data, _output_index, _array_index) {
var _inSurf = _data[0]; var _inSurf = _data[0];
var _crop = _data[1]; 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]); _outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);

View file

@ -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++ ) { for( var j = 0; j < array_length(_inSurf); j++ ) {
var _surf = _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); var s = surface_create(_dim[0], _dim[1], surface_r8unorm);
surface_set_target(s); surface_set_target(s);
DRAW_CLEAR DRAW_CLEAR

View file

@ -851,8 +851,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
return ""; return "";
} }
var pw = surface_get_width(preview_surface); var pw = surface_get_width_safe(preview_surface);
var ph = surface_get_height(preview_surface); var ph = surface_get_height_safe(preview_surface);
var format = surface_get_format(preview_surface); var format = surface_get_format(preview_surface);
var txt = "[" + string(pw) + " x " + string(ph) + " "; 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); _surf = array_safe_get(_surf, preview_index, noone);
if(!is_surface(_surf)) return 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 } #endregion
static getTool = function() { return self; } static getTool = function() { return self; }

View file

@ -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) { static processData = function(_outSurf, _data, _output_index, _array_index) {
surface_set_shader(_outSurf, sh_de_corner); 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]); shader_set_f("tolerance", _data[2]);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);

View file

@ -59,7 +59,7 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
surface_set_shader(_outSurf, shader); surface_set_shader(_outSurf, shader);
shader_set_interpolation(_data[0]); 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_array_safe(uniform_cen, center);
shader_set_uniform_f(uniform_str, stren); shader_set_uniform_f(uniform_str, stren);
shader_set_uniform_f(uniform_rad, rad); shader_set_uniform_f(uniform_rad, rad);

View file

@ -68,10 +68,10 @@ If set, then strength value control how many times the effect applies on itself.
inputs[| 2].setVisible(false); inputs[| 2].setVisible(false);
break; break;
} }
var ww = surface_get_width(_data[0]); var ww = surface_get_width_safe(_data[0]);
var hh = surface_get_height(_data[0]); var hh = surface_get_height_safe(_data[0]);
var mw = surface_get_width(_data[1]); var mw = surface_get_width_safe(_data[1]);
var mh = surface_get_height(_data[1]); var mh = surface_get_height_safe(_data[1]);
surface_set_shader(_outSurf, shader); surface_set_shader(_outSurf, shader);
shader_set_interpolation(_data[0]); shader_set_interpolation(_data[0]);

View file

@ -97,7 +97,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
shader_set(shader); 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) { switch(_typ) {
case 0 : case 0 :
@ -118,7 +118,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
case 3 : case 3 :
if(is_surface(_map)) { if(is_surface(_map)) {
shader_set_uniform_i(uniform_map_use, 1); 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)); texture_set_stage(uniform_map, surface_get_texture(_map));
} }
break; break;

View file

@ -41,7 +41,7 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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_filter, ft);
shader_set_uniform_i(uniform_sam, ov); shader_set_uniform_i(uniform_sam, ov);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);

View file

@ -40,7 +40,7 @@ function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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_f(uniform_size, wd);
shader_set_uniform_i(uniform_bor, _data[2]? 1 : 0); shader_set_uniform_i(uniform_bor, _data[2]? 1 : 0);
shader_set_uniform_i(uniform_alp, _data[3]? 1 : 0); shader_set_uniform_i(uniform_alp, _data[3]? 1 : 0);

View file

@ -29,14 +29,14 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
DRAW_CLEAR DRAW_CLEAR
shader_set(shader); shader_set(shader);
texture_set_stage(shader_tex, surface_get_texture(_surf)); 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); draw_sprite_ext(s_fx_pixel, 0, 0, 0, 1, 1, 0, _col, 1);
shader_reset(); shader_reset();
surface_reset_target(); surface_reset_target();
var pos = surface_get_pixel(temp_surface[0], 0, 0); var pos = surface_get_pixel(temp_surface[0], 0, 0);
var _x = round(color_get_red(pos) / 255 * surface_get_width(_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(_surf)); var _y = round(color_get_green(pos) / 255 * surface_get_height_safe(_surf));
return [ _x, _y ]; return [ _x, _y ];
} }

View file

@ -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 _filC = surface_get_pixel_ext(inSurf, _pos[0], _pos[1]);
var sw = surface_get_width(inSurf); var sw = surface_get_width_safe(inSurf);
var sh = surface_get_height(inSurf); var sh = surface_get_height_safe(inSurf);
for( var i = 0, n = array_length(temp_surface); i < n; i++ ) for( var i = 0, n = array_length(temp_surface); i < n; i++ )
temp_surface[i] = surface_verify(temp_surface[i], sw, sh, attrDepth()); temp_surface[i] = surface_verify(temp_surface[i], sw, sh, attrDepth());

View file

@ -33,8 +33,8 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con
var _pos = inputs[| 2].getValue(); var _pos = inputs[| 2].getValue();
if(is_surface(_mat)) { if(is_surface(_mat)) {
var sw = surface_get_width(_mat) * _s; var sw = surface_get_width_safe(_mat) * _s;
var sh = surface_get_height(_mat) * _s; var sh = surface_get_height_safe(_mat) * _s;
var mx = _x + _pos[0] * _s - sw / 2; var mx = _x + _pos[0] * _s - sw / 2;
var my = _y + _pos[1] * _s - sh / 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(!_act) return;
if(!is_surface(_mat)) return; if(!is_surface(_mat)) return;
var sw = surface_get_width(_mat); var sw = surface_get_width_safe(_mat);
var sh = surface_get_height(_mat); var sh = surface_get_height_safe(_mat);
if(_prevPos != noone && _inh != 0) { if(_prevPos != noone && _inh != 0) {
var dx = _pos[0] - _prevPos[0]; var dx = _pos[0] - _prevPos[0];

View file

@ -28,8 +28,8 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y,
var _pos = inputs[| 2].getValue(); var _pos = inputs[| 2].getValue();
if(is_surface(_mat)) { if(is_surface(_mat)) {
var sw = surface_get_width(_mat) * _s; var sw = surface_get_width_safe(_mat) * _s;
var sh = surface_get_height(_mat) * _s; var sh = surface_get_height_safe(_mat) * _s;
var mx = _x + _pos[0] * _s - sw / 2; var mx = _x + _pos[0] * _s - sw / 2;
var my = _y + _pos[1] * _s - sh / 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(!_act) return;
if(!is_surface(_mat)) return; if(!is_surface(_mat)) return;
var sw = surface_get_width(_mat); var sw = surface_get_width_safe(_mat);
var sh = surface_get_height(_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]); fd_rectangle_add_velocity_surface(_dom, _mat, _pos[0] - sw / 2, _pos[1] - sh / 2, 1, 1, _vel[0], _vel[1]);
} }

View file

@ -42,12 +42,12 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _size = _data[2]; var _size = _data[2];
var _stre = _data[3]; var _stre = _data[3];
var cl = _data[4]; 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); surface_set_target(pass1);
draw_clear_alpha(c_black, 1); draw_clear_alpha(c_black, 1);
shader_set(shader); 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(uniform_size, _size + _border);
shader_set_uniform_f_array_safe(uniform_colr, [ 1., 1., 1., 1. ]); shader_set_uniform_f_array_safe(uniform_colr, [ 1., 1., 1., 1. ]);

View file

@ -160,7 +160,7 @@ struct PixelShaderOutput {
static processData = function(_output, _data, _output_index, _array_index = 0) { static processData = function(_output, _data, _output_index, _array_index = 0) {
var _surf = _data[2]; var _surf = _data[2];
if(!is_surface(_surf)) return; 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); surface_set_target(_output);
DRAW_CLEAR 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)); vertex_submit(global.HLSL_VB, pr_trianglestrip, surface_get_texture(_surf));
matrix_set(matrix_world, matrix_build_identity()); matrix_set(matrix_world, matrix_build_identity());

View file

@ -33,8 +33,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
.setDisplay(VALUE_DISPLAY.button, [ function() { .setDisplay(VALUE_DISPLAY.button, [ function() {
var _sur = inputs[| 0].getValue(); var _sur = inputs[| 0].getValue();
if(!is_surface(_sur) || _sur == DEF_SURFACE) return; if(!is_surface(_sur) || _sur == DEF_SURFACE) return;
var ww = surface_get_width(_sur); var ww = surface_get_width_safe(_sur);
var hh = surface_get_height(_sur); var hh = surface_get_height_safe(_sur);
var _size = inputs[| 1].getValue(); var _size = inputs[| 1].getValue();
var _offs = inputs[| 4].getValue(); var _offs = inputs[| 4].getValue();

View 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",
}

View 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;
}
}

View 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",
},
}

View file

@ -51,7 +51,7 @@ function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
BLEND_OVERRIDE; BLEND_OVERRIDE;
shader_set(shader); 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_alg, _alg);
shader_set_uniform_i(uniform_sam, _sam); shader_set_uniform_i(uniform_sam, _sam);
shader_set_uniform_i(uniform_sha, _shp); shader_set_uniform_i(uniform_sha, _shp);

View file

@ -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) { 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 _pos = _data[1];
var _ang = _data[2]; var _ang = _data[2];

View file

@ -34,11 +34,11 @@ function Node_Morph_Surface(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
shader_set_interpolation(_data[0]); shader_set_interpolation(_data[0]);
shader_set_surface("sFrom", sFrom); shader_set_surface("sFrom", sFrom);
shader_set_surface("sTo", sTo); 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("amount", amo);
shader_set_f("threshold", thres); 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(); surface_reset_shader();
return _outSurf; return _outSurf;

View file

@ -30,7 +30,7 @@ function Node_Normal(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
surface_set_shader(_outSurf, sh_normal); surface_set_shader(_outSurf, sh_normal);
shader_set_uniform_f(uniform_hei, _hei); shader_set_uniform_f(uniform_hei, _hei);
shader_set_uniform_i(uniform_smt, _smt); 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); draw_surface_safe(_data[0], 0, 0);
surface_reset_shader(); surface_reset_shader();

View file

@ -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)); texture_set_stage(uniform_map, surface_get_texture(_map));
shader_set_uniform_f(uniform_hei, _hei); 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_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 ] ); shader_set_uniform_f_array_safe(uniform_light_pos, [ _light_pos[0], _light_pos[1], _light_pos[2] / 100, _light_ran ] );

View file

@ -46,7 +46,7 @@ function Node_Onion_Skin(_x, _y, _group = noone) : Node(_x, _y, _group) construc
cacheCurrentFrame(_surf); cacheCurrentFrame(_surf);
var _outSurf = outputs[| 0].getValue(); 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); outputs[| 0].setValue(_outSurf);
surface_set_target(_outSurf); surface_set_target(_outSurf);

View file

@ -57,8 +57,8 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
attribute_oversample(); attribute_oversample();
static processData = function(_outSurf, _data, _output_index, _array_index) { static processData = function(_outSurf, _data, _output_index, _array_index) {
var ww = surface_get_width(_data[0]); var ww = surface_get_width_safe(_data[0]);
var hh = surface_get_height(_data[0]); var hh = surface_get_height_safe(_data[0]);
var wd = _data[1]; var wd = _data[1];
var cl = _data[2]; var cl = _data[2];

View file

@ -35,8 +35,8 @@ function Node_Pack_Sprites(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(!is_surface(_surf)) continue; if(!is_surface(_surf)) continue;
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
draw_rectangle( draw_rectangle(
_x + _s * (_sx + spac), _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]; var s = _inpt[i];
if(!is_surface(s)) continue; if(!is_surface(s)) continue;
_rects[i] = new spriteAtlasData(0, 0, surface_get_width(s) + _spac * 2, _rects[i] = new spriteAtlasData(0, 0, surface_get_width_safe(s) + _spac * 2,
surface_get_height(s) + _spac * 2, s, i); surface_get_height_safe(s) + _spac * 2, s, i);
} }
var pack; var pack;

View file

@ -63,8 +63,8 @@ function Node_Padding(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 3].setVisible(fill); inputs[| 3].setVisible(fill);
var ww = surface_get_width(_data[0]); var ww = surface_get_width_safe(_data[0]);
var hh = surface_get_height(_data[0]); var hh = surface_get_height_safe(_data[0]);
if(mode == 0) { if(mode == 0) {
var sw = ww + padding[0] + padding[2]; var sw = ww + padding[0] + padding[2];

View file

@ -59,11 +59,11 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
} }
function extractKmean(_surfFull, _size, _seed) { 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); _size = max(1, _size);
var ww = surface_get_width(_surf); var ww = surface_get_width_safe(_surf);
var hh = surface_get_height(_surf); var hh = surface_get_height_safe(_surf);
surface_set_target(_surf); surface_set_target(_surf);
DRAW_CLEAR DRAW_CLEAR
@ -183,8 +183,8 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
} }
function extractAll(_surfFull) { function extractAll(_surfFull) {
var ww = surface_get_width(_surfFull); var ww = surface_get_width_safe(_surfFull);
var hh = surface_get_height(_surfFull); var hh = surface_get_height_safe(_surfFull);
var c_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2); 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) { function extractFrequence(_surfFull, _size) {
var msize = 128; 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); _size = max(1, _size);
var ww = surface_get_width(_surf); var ww = surface_get_width_safe(_surf);
var hh = surface_get_height(_surf); var hh = surface_get_height_safe(_surf);
surface_set_target(_surf); surface_set_target(_surf);
DRAW_CLEAR DRAW_CLEAR

View file

@ -87,8 +87,8 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
else if(_blend == PARTICLE_BLEND_MODE.additive) else if(_blend == PARTICLE_BLEND_MODE.additive)
BLEND_ADD; BLEND_ADD;
var surf_w = surface_get_width(_outSurf); var surf_w = surface_get_width_safe(_outSurf);
var surf_h = surface_get_height(_outSurf); var surf_h = surface_get_height_safe(_outSurf);
for(var i = 0; i < attributes.part_amount; i++) for(var i = 0; i < attributes.part_amount; i++)
parts[i].draw(_exact, surf_w, surf_h); parts[i].draw(_exact, surf_w, surf_h);

View file

@ -14,11 +14,11 @@ function Node_PB_Fx(_x, _y, _group = noone) : Node_PB(_x, _y, _group) constructo
\ \
var _pbox = new __pbBox(); \ var _pbox = new __pbBox(); \
\ \
_pbox.w = surface_get_width(_surf); \ _pbox.w = surface_get_width_safe(_surf); \
_pbox.h = surface_get_height(_surf); \ _pbox.h = surface_get_height_safe(_surf); \
\ \
_pbox.layer_w = surface_get_width(_surf); \ _pbox.layer_w = surface_get_width_safe(_surf); \
_pbox.layer_h = surface_get_height(_surf); \ _pbox.layer_h = surface_get_height_safe(_surf); \
\ \
_pbox.mask = surface_create(_pbox.w, _pbox.h); \ _pbox.mask = surface_create(_pbox.w, _pbox.h); \
surface_set_shader(_pbox.mask, sh_pb_to_mask); \ surface_set_shader(_pbox.mask, sh_pb_to_mask); \

View file

@ -19,7 +19,7 @@ function Node_PB_Fx_Radial(_x, _y, _group = noone) : Node_PB_Fx(_x, _y, _group)
surface_set_shader(_nbox.content); surface_set_shader(_nbox.content);
for( var i = 0; i < _amo; i++ ) { for( var i = 0; i < _amo; i++ ) {
var aa = i / _amo * 360; 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); draw_surface_ext_safe(_pbox.content, p[0], p[1],,, aa);
} }

View file

@ -43,8 +43,8 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
if(_dr < 0) _dr = 4 + _dr; if(_dr < 0) _dr = 4 + _dr;
if(_it <= 0) return _outSurf; if(_it <= 0) return _outSurf;
var sw = surface_get_width(_outSurf); var sw = surface_get_width_safe(_outSurf);
var sh = surface_get_height(_outSurf); var sh = surface_get_height_safe(_outSurf);
var pp = [ surface_create_valid(sw, sh), surface_create_valid(sw, sh) ]; var pp = [ surface_create_valid(sw, sh), surface_create_valid(sw, sh) ];
var sBase, sDraw; var sBase, sDraw;
@ -57,7 +57,7 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
surface_reset_target(); surface_reset_target();
shader_set(shader); 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_f(uniform_tre, _tr);
shader_set_uniform_i(uniform_dir, _dr); shader_set_uniform_i(uniform_dir, _dr);

View file

@ -57,8 +57,8 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _in = getSingleValue(dimension_index, arr); var _in = getSingleValue(dimension_index, arr);
if(inputs[| dimension_index].type == VALUE_TYPE.surface && is_surface(_in)) { if(inputs[| dimension_index].type == VALUE_TYPE.surface && is_surface(_in)) {
var ww = surface_get_width(_in); var ww = surface_get_width_safe(_in);
var hh = surface_get_height(_in); var hh = surface_get_height_safe(_in);
return [ww, hh]; return [ww, hh];
} }
@ -84,8 +84,8 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _sw = 1, _sh = 1; var _sw = 1, _sh = 1;
if(inputs[| dimension_index].type == VALUE_TYPE.surface) { if(inputs[| dimension_index].type == VALUE_TYPE.surface) {
if(is_surface(surf)) { if(is_surface(surf)) {
_sw = surface_get_width(surf); _sw = surface_get_width_safe(surf);
_sh = surface_get_height(surf); _sh = surface_get_height_safe(surf);
} else } else
return noone; return noone;
} else if(is_array(surf)) { } 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; var _sw = 1, _sh = 1;
if(inputs[| dimension_index].type == VALUE_TYPE.surface) { if(inputs[| dimension_index].type == VALUE_TYPE.surface) {
if(is_surface(surf)) { if(is_surface(surf)) {
_sw = surface_get_width(surf); _sw = surface_get_width_safe(surf);
_sh = surface_get_height(surf); _sh = surface_get_height_safe(surf);
} else } else
return noone; return noone;
} else if(is_array(surf)) { } else if(is_array(surf)) {

View file

@ -15,8 +15,8 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
function surfaceContentRatio(_surf) { function surfaceContentRatio(_surf) {
var s = 0; var s = 0;
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
var total = _sw * _sh; var total = _sw * _sh;
var _buff = buffer_create(_sw * _sh * 4, buffer_fixed, 4); var _buff = buffer_create(_sw * _sh * 4, buffer_fixed, 4);
buffer_get_surface(_buff, _surf, 0); buffer_get_surface(_buff, _surf, 0);

View file

@ -36,8 +36,8 @@ function Node_Region_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var _fill = _data[3]; var _fill = _data[3];
var _seed = _data[4]; var _seed = _data[4];
var _sw = surface_get_width(_surf); var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf) var _sh = surface_get_height_safe(_surf)
temp_surface[0] = surface_verify(temp_surface[0], _sw, _sh); temp_surface[0] = surface_verify(temp_surface[0], _sw, _sh);
temp_surface[1] = surface_verify(temp_surface[1], _sw, _sh); temp_surface[1] = surface_verify(temp_surface[1], _sw, _sh);

View file

@ -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); addNodeObject(values, "Atlas Set", s_node_atlas_set, "Node_Atlas_Set", [1, Node_Atlas_Set]).setVersion(1141);
ds_list_add(values, "Surface"); 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); 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"); ds_list_add(values, "Buffer");

View file

@ -106,8 +106,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
_atl[i] = []; _atl[i] = [];
if(!is_surface(inpt[i])) continue; if(!is_surface(inpt[i])) continue;
var sw = surface_get_width(inpt[i]); var sw = surface_get_width_safe(inpt[i]);
var sh = surface_get_height(inpt[i]); var sh = surface_get_height_safe(inpt[i]);
var ww = sw, hh = sh; var ww = sw, hh = sh;
switch(pack) { switch(pack) {
@ -184,11 +184,11 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
else oo = oupt[i]; else oo = oupt[i];
if(!is_surface(oo)) break; if(!is_surface(oo)) break;
var ww = surface_get_width(oo); var ww = surface_get_width_safe(oo);
var hh = surface_get_height(oo); var hh = surface_get_height_safe(oo);
var _w = surface_get_width(inpt[i]); var _w = surface_get_width_safe(inpt[i]);
var _h = surface_get_height(inpt[i]); var _h = surface_get_height_safe(inpt[i]);
surface_set_target(oo); surface_set_target(oo);
BLEND_OVERRIDE; BLEND_OVERRIDE;
@ -303,15 +303,15 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
switch(pack) { switch(pack) {
case SPRITE_STACK.horizontal : case SPRITE_STACK.horizontal :
for(var i = _st; i < _ed; i++) { 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; if(i > _st) ww += spac;
hh = max(hh, surface_get_height(inpt[i])); hh = max(hh, surface_get_height_safe(inpt[i]));
} }
break; break;
case SPRITE_STACK.vertical : case SPRITE_STACK.vertical :
for(var i = _st; i < _ed; i++) { for(var i = _st; i < _ed; i++) {
ww = max(ww, surface_get_width(inpt[i])); ww = max(ww, surface_get_width_safe(inpt[i]));
hh += surface_get_height(inpt[i]); hh += surface_get_height_safe(inpt[i]);
if(i > _st) hh += spac; if(i > _st) hh += spac;
} }
break; 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++) { for(var j = 0; j < col; j++) {
var index = _st + i * col + j; var index = _st + i * col + j;
if(index >= amo) break; if(index >= amo) break;
row_w += surface_get_width(inpt[index]); row_w += surface_get_width_safe(inpt[index]);
if(j) row_w += spac; 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); 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 px = padd[2];
var py = padd[1]; var py = padd[1];
for(var i = _st; i < _ed; i++) { for(var i = _st; i < _ed; i++) {
var _w = surface_get_width(inpt[i]); var _w = surface_get_width_safe(inpt[i]);
var _h = surface_get_height(inpt[i]); var _h = surface_get_height_safe(inpt[i]);
var _sx = px; var _sx = px;
var _sy = py; 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 px = padd[2];
var py = padd[1]; var py = padd[1];
for(var i = _st; i < _ed; i++) { for(var i = _st; i < _ed; i++) {
var _w = surface_get_width(inpt[i]); var _w = surface_get_width_safe(inpt[i]);
var _h = surface_get_height(inpt[i]); var _h = surface_get_height_safe(inpt[i]);
var _sx = px; var _sx = px;
var _sy = py; 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; var index = _st + i * col + j;
if(index >= amo) break; if(index >= amo) break;
var _w = surface_get_width(inpt[index]); var _w = surface_get_width_safe(inpt[index]);
var _h = surface_get_height(inpt[index]); var _h = surface_get_height_safe(inpt[index]);
array_push(_atl, new SurfaceAtlas(inpt[index], [px, py])); array_push(_atl, new SurfaceAtlas(inpt[index], [px, py]));
draw_surface_safe(inpt[index], px, py); draw_surface_safe(inpt[index], px, py);

View file

@ -97,11 +97,11 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(is_array(_surf)) { if(is_array(_surf)) {
if(array_length(_surf) == 0) return [1, 1]; if(array_length(_surf) == 0) return [1, 1];
if(!is_surface(_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]; 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) { 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)) if(is_array(_inSurf))
_surf = array_safe_get(_inSurf, _arr? irandom(array_length(_inSurf) - 1) : safe_mod(i, array_length(_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 _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height(_surf); var _sh = surface_get_height_safe(_surf);
var sw = _sw * scax; var sw = _sw * scax;
var sh = _sh * scay; var sh = _sh * scay;

View file

@ -97,8 +97,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(_shp == 2) { if(_shp == 2) {
var _tex = inputs[| 6].getValue(); var _tex = inputs[| 6].getValue();
if(is_array(_tex)) _tex = _tex[safe_mod(preview_index, array_length(_tex))]; if(is_array(_tex)) _tex = _tex[safe_mod(preview_index, array_length(_tex))];
var tw = surface_get_width(_tex); var tw = surface_get_width_safe(_tex);
var th = surface_get_height(_tex); var th = surface_get_height_safe(_tex);
draw_set_color(is_convex? COLORS._main_accent : COLORS._main_value_negative); 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 meshes = attributes.mesh;
var mesh = []; var mesh = [];
var ww = surface_get_width(_tex); var ww = surface_get_width_safe(_tex);
var hh = surface_get_height(_tex); var hh = surface_get_height_safe(_tex);
var surface_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2); var surface_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
buffer_get_surface(surface_buffer, _tex, 0); 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 _spos = inputs[| 7].getValue();
var ww = max(1, surface_get_width(_tex)); var ww = max(1, surface_get_width_safe(_tex));
var hh = max(1, surface_get_height(_tex)); var hh = max(1, surface_get_height_safe(_tex));
var ox = rpos == noone? _spos[0] : rpos[0]; var ox = rpos == noone? _spos[0] : rpos[0];
var oy = rpos == noone? _spos[1] : rpos[1]; var oy = rpos == noone? _spos[1] : rpos[1];

View file

@ -38,8 +38,8 @@ function Node_Scale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var ww, hh; var ww, hh;
switch(mode) { switch(mode) {
case 0 : case 0 :
ww = scale * surface_get_width(_data[0]); ww = scale * surface_get_width_safe(_data[0]);
hh = scale * surface_get_height(_data[0]); hh = scale * surface_get_height_safe(_data[0]);
break; break;
case 1 : case 1 :
ww = targ[0]; ww = targ[0];

View file

@ -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) { static processData = function(_outSurf, _data, _output_index, _array_index) {
var inSurf = _data[0]; var inSurf = _data[0];
var algo = _data[1]; var algo = _data[1];
var ww = surface_get_width(inSurf); var ww = surface_get_width_safe(inSurf);
var hh = surface_get_height(inSurf); var hh = surface_get_height_safe(inSurf);
var cDep = attrDepth(); var cDep = attrDepth();
var shader; var shader;
var sc = 2; var sc = 2;

View file

@ -244,8 +244,8 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
posS++; posS++;
} }
var sw = surface_get_width(surf); var sw = surface_get_width_safe(surf);
var sh = surface_get_height(surf); var sh = surface_get_height_safe(surf);
if(_dist != AREA_DISTRIBUTION.area || _scat != AREA_SCATTER.uniform) { if(_dist != AREA_DISTRIBUTION.area || _scat != AREA_SCATTER.uniform) {
var p = point_rotate(-sw / 2 * _scx, -sh * _scy / 2, 0, 0, _r); 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); draw_surface_ext_safe(surf, _x, _y, _scx, _scy, _r, clr, alp);
if(_dist == 5) { if(_dist == 5) {
var _sw = surface_get_width(surf) * _scx; var _sw = surface_get_width_safe(surf) * _scx;
var _sh = surface_get_height(surf) * _scy; var _sh = surface_get_height_safe(surf) * _scy;
if(_x < _sw) if(_x < _sw)
draw_surface_ext_safe(surf, _dim[0] + _x, _y, _scx, _scy, _r, clr, alp); 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