From 965453bcc6f0ab77bff6c29c4802054220a5c24a Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Sun, 16 Apr 2023 16:24:17 +0200 Subject: [PATCH] Inline --- PixelComposer.resource_order | 6 +++--- PixelComposer.yyp | 6 +++--- scripts/array_functions/array_functions.gml | 2 +- scripts/draw_UI_scale/draw_UI_scale.gml | 6 ++++-- scripts/string_decimal/string_decimal.gml | 2 +- scripts/surface_functions/surface_functions.gml | 6 ++++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 0e3db2005..ffcbf4627 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -83,6 +83,7 @@ {"name":"strandSim","order":20,"path":"folders/nodes/data/strandSim.yy",}, {"name":"transform","order":8,"path":"folders/nodes/data/transform.yy",}, {"name":"value","order":3,"path":"folders/nodes/data/value.yy",}, + {"name":"atlas","order":9,"path":"folders/nodes/data/value/atlas.yy",}, {"name":"mesh","order":7,"path":"folders/nodes/data/value/mesh.yy",}, {"name":"struct","order":6,"path":"folders/nodes/data/value/struct.yy",}, {"name":"trigger","order":8,"path":"folders/nodes/data/value/trigger.yy",}, @@ -101,6 +102,7 @@ {"name":"transform","order":145,"path":"folders/nodes/icons/transform.yy",}, {"name":"value","order":144,"path":"folders/nodes/icons/value.yy",}, {"name":"array","order":44,"path":"folders/nodes/icons/value/array.yy",}, + {"name":"atlas","order":52,"path":"folders/nodes/icons/value/atlas.yy",}, {"name":"bool","order":45,"path":"folders/nodes/icons/value/bool.yy",}, {"name":"color","order":46,"path":"folders/nodes/icons/value/color.yy",}, {"name":"mesh","order":51,"path":"folders/nodes/icons/value/mesh.yy",}, @@ -132,6 +134,7 @@ {"name":"generator","order":19,"path":"folders/shader/generator.yy",}, {"name":"mask","order":45,"path":"folders/shader/mask.yy",}, {"name":"misc","order":50,"path":"folders/shader/misc.yy",}, + {"name":"morph","order":54,"path":"folders/shader/morph.yy",}, {"name":"shape seperator","order":35,"path":"folders/shader/shape seperator.yy",}, {"name":"sprites","order":20,"path":"folders/shader/sprites.yy",}, {"name":"surface replace","order":53,"path":"folders/shader/surface replace.yy",}, @@ -140,9 +143,6 @@ {"name":"sprites","order":12,"path":"folders/sprites.yy",}, {"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",}, - {"name":"morph","order":54,"path":"folders/shader/morph.yy",}, - {"name":"atlas","order":9,"path":"folders/nodes/data/value/atlas.yy",}, - {"name":"atlas","order":52,"path":"folders/nodes/icons/value/atlas.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 26f2a6633..23c9c65f0 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -110,6 +110,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"transform","folderPath":"folders/nodes/data/transform.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/data/value.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/data/value/array.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"atlas","folderPath":"folders/nodes/data/value/atlas.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"bool","folderPath":"folders/nodes/data/value/bool.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"color","folderPath":"folders/nodes/data/value/color.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mesh","folderPath":"folders/nodes/data/value/mesh.yy",}, @@ -133,6 +134,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"transform","folderPath":"folders/nodes/icons/transform.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/icons/value.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/icons/value/array.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"atlas","folderPath":"folders/nodes/icons/value/atlas.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"bool","folderPath":"folders/nodes/icons/value/bool.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"color","folderPath":"folders/nodes/icons/value/color.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mesh","folderPath":"folders/nodes/icons/value/mesh.yy",}, @@ -165,6 +167,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"generator","folderPath":"folders/shader/generator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mask","folderPath":"folders/shader/mask.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/shader/misc.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"morph","folderPath":"folders/shader/morph.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"shape seperator","folderPath":"folders/shader/shape seperator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/shader/sprites.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface replace","folderPath":"folders/shader/surface replace.yy",}, @@ -176,9 +179,6 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Steamworks","folderPath":"folders/Steamworks.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"morph","folderPath":"folders/shader/morph.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"atlas","folderPath":"folders/nodes/data/value/atlas.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"atlas","folderPath":"folders/nodes/icons/value/atlas.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","CopyToMask":-1,"filePath":"datafiles",}, diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index 1935b47c4..019e63be6 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -21,8 +21,8 @@ enum ARRAY_OVERFLOW { loop } -gml_pragma("forceinline"); function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) { + gml_pragma("forceinline"); if(!is_array(arr)) return def; if(overflow == ARRAY_OVERFLOW.loop) { diff --git a/scripts/draw_UI_scale/draw_UI_scale.gml b/scripts/draw_UI_scale/draw_UI_scale.gml index 5c3a62240..5515cf733 100644 --- a/scripts/draw_UI_scale/draw_UI_scale.gml +++ b/scripts/draw_UI_scale/draw_UI_scale.gml @@ -23,6 +23,8 @@ function line_width(txt, font = noone, offset = 0) { #region global #macro TEXTBOX_HEIGHT line_height(f_p0, 12) - gml_pragma("forceinline"); - function ui(val) { return val * UI_SCALE; } + function ui(val) { + gml_pragma("forceinline"); + return val * UI_SCALE; + } #endregion \ No newline at end of file diff --git a/scripts/string_decimal/string_decimal.gml b/scripts/string_decimal/string_decimal.gml index 3bd33e1c6..4f2632df4 100644 --- a/scripts/string_decimal/string_decimal.gml +++ b/scripts/string_decimal/string_decimal.gml @@ -9,8 +9,8 @@ function string_decimal(str) { return (neg? "-" : "") + (dec? string_digits(pre) + "." + string_digits(pos) : string_digits(str)); } -gml_pragma("forceinline"); function toNumber(str) { + gml_pragma("forceinline"); if(is_real(str)) return str; var expo = 0; diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index e46cbcd30..7a68801e9 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -88,8 +88,9 @@ function surface_save_safe(surface, path) { } //check -gml_pragma("forceinline"); function is_surface(s) { + gml_pragma("forceinline"); + if(is_undefined(s)) return false; if(is_array(s)) return false; if(!is_real(s)) return false; @@ -102,8 +103,9 @@ function is_surface(s) { return true; } -gml_pragma("forceinline"); function surface_verify(surf, w, h, format = surface_rgba8unorm) { + gml_pragma("forceinline"); + if(!is_surface(surf)) return surface_create_valid(w, h, format); return surface_size_to(surf, w, h, format);