From 6581ae8e589259e0de5e49d3afc70b54dfa8bf50 Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:16:50 +0700 Subject: [PATCH] replace backslash to slash for file path --- objects/_addon_custom/Create_0.gml | 4 ++-- objects/o_main/Other_2.gml | 6 +++--- scripts/__initAddon/__initAddon.gml | 8 ++++---- scripts/__node_3d_export/__node_3d_export.gml | 2 +- scripts/addon_function/addon_function.gml | 4 ++-- scripts/debug/debug.gml | 2 +- scripts/node_3d_mesh_export/node_3d_mesh_export.gml | 4 ++-- scripts/panel_addon/panel_addon.gml | 4 ++-- scripts/panel_file_explorer/panel_file_explorer.gml | 8 ++++---- scripts/panel_test/panel_test.gml | 10 +++++----- scripts/preferences/preferences.gml | 2 +- scripts/shell_functions/shell_functions.gml | 2 +- shaders/sh_blur_path/sh_blur_path.fsh | 9 +++++---- shaders/sh_curve_hsv/sh_curve_hsv.fsh | 10 ++++++---- shaders/sh_pixel_cloud/sh_pixel_cloud.fsh | 4 +++- shaders/sh_shape/sh_shape.fsh | 5 +++-- 16 files changed, 45 insertions(+), 39 deletions(-) diff --git a/objects/_addon_custom/Create_0.gml b/objects/_addon_custom/Create_0.gml index c1f8db555..b5f56f10e 100644 --- a/objects/_addon_custom/Create_0.gml +++ b/objects/_addon_custom/Create_0.gml @@ -15,7 +15,7 @@ event_inherited(); self.directory = directory; - var propPath = directory + "\\meta.json"; + var propPath = directory + "/meta.json"; context_menus = {}; panels = {}; @@ -51,7 +51,7 @@ event_inherited(); } } - scriptPath = directory + "\\script.lua"; + scriptPath = directory + "/script.lua"; if(!file_exists_empty(scriptPath)) { noti_warning(title + " Addon error: script.lua not found."); return self; diff --git a/objects/o_main/Other_2.gml b/objects/o_main/Other_2.gml index 391b1da32..b76436c85 100644 --- a/objects/o_main/Other_2.gml +++ b/objects/o_main/Other_2.gml @@ -21,7 +21,7 @@ if(DIRECTORY != "") { var _ch = string_char_last(DIRECTORY); - if(_ch != "\\" && _ch != "/") DIRECTORY += "\\"; + if(_ch != "\\" && _ch != "/") DIRECTORY += "/"; show_debug_message($"Env directory: {DIRECTORY}"); var dir_valid = DIRECTORY != "" && directory_exists(DIRECTORY); @@ -42,13 +42,13 @@ } else DIRECTORY = APP_DIRECTORY; - PREFERENCES_DIR = $"{DIRECTORY}Preferences\\{PREF_VERSION}\\"; + PREFERENCES_DIR = $"{DIRECTORY}Preferences/{PREF_VERSION}/"; directory_verify(DIRECTORY); APP_LOCATION = program_directory; if(OS == os_macosx) APP_LOCATION = string_replace(APP_LOCATION, "/Contents/MacOS/", "/Contents/Resources/"); - if(string_pos("GameMakerStudio2\\Cache\\runtimes", APP_LOCATION)) + if(string_pos("GameMakerStudio2/Cache/runtimes", APP_LOCATION)) APP_LOCATION = working_directory; print($"===================== WORKING DIRECTORIES =====================\n\t{working_directory}\n\t{DIRECTORY}"); #endregion diff --git a/scripts/__initAddon/__initAddon.gml b/scripts/__initAddon/__initAddon.gml index 2a5ffa713..f2f52849a 100644 --- a/scripts/__initAddon/__initAddon.gml +++ b/scripts/__initAddon/__initAddon.gml @@ -14,13 +14,13 @@ function __initAddon() { directory_verify(dirPath); __addonDefault(dirPath); - var f = file_find_first(dirPath + "\\*", fa_directory); + var f = file_find_first(dirPath + "/*", fa_directory); var _f = ""; while(f != "" && f != _f) { _f = f; - var _path = dirPath + "\\" + f; - var _meta = _path + "\\meta.json"; + var _path = dirPath + "/" + f; + var _meta = _path + "/meta.json"; if(!file_exists_empty(_meta)) { f = file_find_next(); @@ -44,7 +44,7 @@ function __initAddon() { } function loadAddon() { - var _path = DIRECTORY + "Addons\\__init.json"; + var _path = DIRECTORY + "Addons/__init.json"; if(!file_exists_empty(_path)) return; ADDONS_ON_START = json_load_struct(_path); diff --git a/scripts/__node_3d_export/__node_3d_export.gml b/scripts/__node_3d_export/__node_3d_export.gml index 74e319fe3..6818dc963 100644 --- a/scripts/__node_3d_export/__node_3d_export.gml +++ b/scripts/__node_3d_export/__node_3d_export.gml @@ -52,7 +52,7 @@ function __Node_3D_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constru file_text_write_string(fObj, "vn " + string(v.normals[j][0]) + " " + string(v.normals[j][1]) + " " + string(v.normals[j][2]) + "\n"); var mtlName = "material_" + string(i); - var mtlPath = filename_dir(mPath) + "\\" + filename_name_only(oPath) + "_material_" + string(i) + ".png"; + var mtlPath = filename_dir(mPath) + "/" + filename_name_only(oPath) + "_material_" + string(i) + ".png"; file_text_write_string(fObj, "\nusemtl " + mtlName + "\n"); file_text_write_string(fMtl, "newmtl " + mtlName + "\n"); diff --git a/scripts/addon_function/addon_function.gml b/scripts/addon_function/addon_function.gml index 9712d53f3..d8ff0abcf 100644 --- a/scripts/addon_function/addon_function.gml +++ b/scripts/addon_function/addon_function.gml @@ -64,7 +64,7 @@ function addonActivated(_addon) { function addonLoad(_addon, _openDialog = true) { var _name = filename_name_only(_addon); - var addonPath = DIRECTORY + "Addons\\" + _name; + var addonPath = DIRECTORY + "Addons/" + _name; if(!directory_exists(addonPath)) return; with(_addon_custom) if(name == _name) return; @@ -75,7 +75,7 @@ function addonLoad(_addon, _openDialog = true) { function addonUnload(_addon) { var _name = filename_name_only(_addon); - var addonPath = DIRECTORY + "Addons\\" + _name; + var addonPath = DIRECTORY + "Addons/" + _name; if(!directory_exists(addonPath)) return; with(_addon_custom) if(name == _name) instance_destroy(); diff --git a/scripts/debug/debug.gml b/scripts/debug/debug.gml index f3a799103..9c3b3583c 100644 --- a/scripts/debug/debug.gml +++ b/scripts/debug/debug.gml @@ -127,7 +127,7 @@ function setException() { } else show_debug_message(tt); - var rep = $"{APP_LOCATION}report\\PXC crash reporter.exe"; + var rep = $"{APP_LOCATION}report/PXC crash reporter.exe"; var pid = shell_execute(rep, DIRECTORY); print($"{rep} [{file_exists(rep)}]: {pid}"); diff --git a/scripts/node_3d_mesh_export/node_3d_mesh_export.gml b/scripts/node_3d_mesh_export/node_3d_mesh_export.gml index 99d5ce459..18bfe6931 100644 --- a/scripts/node_3d_mesh_export/node_3d_mesh_export.gml +++ b/scripts/node_3d_mesh_export/node_3d_mesh_export.gml @@ -32,7 +32,7 @@ function Node_3D_Mesh_Export(_x, _y, _group = noone) : Node(_x, _y, _group) cons var _vbs = _mesh.VB; - var _mtlPath = filename_dir(_path) + "\\" + filename_name_only(_path) + ".mtl"; + var _mtlPath = filename_dir(_path) + "/" + filename_name_only(_path) + ".mtl"; var _mtlName = filename_name(_mtlPath); var _mtl = "# Pixel Composer\n"; var _obj = "# Pixel Composer\n"; @@ -55,7 +55,7 @@ function Node_3D_Mesh_Export(_x, _y, _group = noone) : Node(_x, _y, _group) cons _obj += $"usemtl {_matName}\n"; if(is_surface(_material.surface)) { - var _surfPath = $"{filename_dir(_path)}\\{filename_name_only(_path)}_texture{i}.png"; + var _surfPath = $"{filename_dir(_path)}/{filename_name_only(_path)}_texture{i}.png"; surface_save(_material.surface, _surfPath); _mtl += $"map_Kd {_surfPath}\n"; } diff --git a/scripts/panel_addon/panel_addon.gml b/scripts/panel_addon/panel_addon.gml index 5313c05a8..e3f2e08e7 100644 --- a/scripts/panel_addon/panel_addon.gml +++ b/scripts/panel_addon/panel_addon.gml @@ -103,7 +103,7 @@ function Panel_Addon() : PanelContent() constructor { array_remove(ADDONS_ON_START, _addon.name); } - json_save_struct(DIRECTORY + "Addons\\__init.json", ADDONS_ON_START); + json_save_struct(DIRECTORY + "Addons/__init.json", ADDONS_ON_START); } } else draw_sprite_stretched_ext(THEME.checkbox_def, 0, chx0, chy0, ui(28), ui(28), c_white, 1); @@ -118,7 +118,7 @@ function Panel_Addon() : PanelContent() constructor { var b = buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, __txt("Open in explorer"), THEME.folder_content); if(b) hover = false; - if(b == 2) shellOpenExplorer(DIRECTORY + "Addons\\" + _addon.name); + if(b == 2) shellOpenExplorer(DIRECTORY + "Addons/" + _addon.name); _bx -= ui(36) if(_act && buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, __txt("Addon settings"), THEME.addon_setting) == 2) { diff --git a/scripts/panel_file_explorer/panel_file_explorer.gml b/scripts/panel_file_explorer/panel_file_explorer.gml index 487840b33..8b1b90bc2 100644 --- a/scripts/panel_file_explorer/panel_file_explorer.gml +++ b/scripts/panel_file_explorer/panel_file_explorer.gml @@ -85,9 +85,9 @@ function ExpDir(path) : ExpFile(path) constructor { if(!directory_exists(path)) return; - var f = file_find_first(path + "\\*", fa_directory); + var f = file_find_first(path + "/*", fa_directory); while (f != "") { - var _fp = $"{path}\\{f}"; + var _fp = $"{path}/{f}"; if(directory_exists(_fp)) { var _fileObj = ExpCreateFile(_fp); _fileObj.parent = self; @@ -97,9 +97,9 @@ function ExpDir(path) : ExpFile(path) constructor { } file_find_close(); - var f = file_find_first(path + "\\*", fa_none); + var f = file_find_first(path + "/*", fa_none); while (f != "") { - var _fp = $"{path}\\{f}"; + var _fp = $"{path}/{f}"; if(file_exists(_fp) && !directory_exists(_fp)) { var _fileObj = ExpCreateFile(_fp); _fileObj.parent = self; diff --git a/scripts/panel_test/panel_test.gml b/scripts/panel_test/panel_test.gml index 465a9770b..8a8368f08 100644 --- a/scripts/panel_test/panel_test.gml +++ b/scripts/panel_test/panel_test.gml @@ -3,7 +3,7 @@ function Panel_Test() : PanelContent() constructor { h = ui(160); title = "Tester"; - test_dir = "D:\\Project\\MakhamDev\\LTS-PixelComposer\\TEST"; + test_dir = "D:/Project/MakhamDev/LTS-PixelComposer/TEST"; tb_test_dir = new textBox(TEXTBOX_INPUT.text, function(txt) { test_dir = txt; }); tb_index = new textBox(TEXTBOX_INPUT.number, function(txt) { start_index = txt; }); tb_amount = new textBox(TEXTBOX_INPUT.number, function(txt) { test_amount = txt; }); @@ -17,20 +17,20 @@ function Panel_Test() : PanelContent() constructor { test_button_surface = surface_create(1, 1); function scanDir(dir) { - var f = file_find_first(dir + "\\*", fa_none); + var f = file_find_first(dir + "/*", fa_none); while(f != "") { - var path = dir + "\\" + f; + var path = dir + "/" + f; if(filename_ext_raw(path) == "pxc") array_push(test_files, path); f = file_find_next(); } file_find_close(); - var f = file_find_first(dir + "\\*", fa_directory); + var f = file_find_first(dir + "/*", fa_directory); var _dir = []; while(f != "") { - var path = dir + "\\" + f; + var path = dir + "/" + f; array_push(_dir, path); f = file_find_next(); } diff --git a/scripts/preferences/preferences.gml b/scripts/preferences/preferences.gml index 21f519a27..d3208d6e0 100644 --- a/scripts/preferences/preferences.gml +++ b/scripts/preferences/preferences.gml @@ -283,7 +283,7 @@ if(IS_CMD) return; directory_verify($"{DIRECTORY}Preferences"); - directory_verify($"{DIRECTORY}Preferences\\{PREF_VERSION}"); + directory_verify($"{DIRECTORY}Preferences/{PREF_VERSION}"); PREFERENCES.window_maximize = window_is_maximized; PREFERENCES.window_width = max(960, window_minimize_size[0]); diff --git a/scripts/shell_functions/shell_functions.gml b/scripts/shell_functions/shell_functions.gml index 108190177..4080ff609 100644 --- a/scripts/shell_functions/shell_functions.gml +++ b/scripts/shell_functions/shell_functions.gml @@ -46,7 +46,7 @@ function shell_execute_async(path, command, ref = noone, _log = true) { #region function env_user() { #region INLINE - if(OS == os_windows) return string(environment_get_variable("userprofile")) + "\\AppData\\Local\\PixelComposer\\"; + if(OS == os_windows) return string(environment_get_variable("userprofile")) + "/AppData/Local/PixelComposer/"; if(OS == os_macosx) return string(environment_get_variable("HOME")) + "/PixelComposer/"; return ""; } #endregion \ No newline at end of file diff --git a/shaders/sh_blur_path/sh_blur_path.fsh b/shaders/sh_blur_path/sh_blur_path.fsh index 22e072f0b..060096659 100644 --- a/shaders/sh_blur_path/sh_blur_path.fsh +++ b/shaders/sh_blur_path/sh_blur_path.fsh @@ -1,8 +1,9 @@ +#define CURVE_MAX 512 +#define MAX_POINTS 256 + varying vec2 v_vTexcoord; varying vec4 v_vColour; -#define MAX_POINTS 256 - uniform vec2 dimension; uniform int sampleMode; @@ -12,7 +13,7 @@ uniform float points_x[MAX_POINTS]; uniform float points_y[MAX_POINTS]; uniform float intensity; -uniform float i_curve[1024]; +uniform float i_curve[CURVE_MAX]; uniform int i_amount; vec4 sample(vec2 pos) { #region @@ -88,7 +89,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt); } -float curveEval(in float[1024] curve, in int amo, in float _x) { +float curveEval(in float[CURVE_MAX] curve, in int amo, in float _x) { int _shf = amo - int(floor(float(amo) / 6.) * 6.); int _segs = (amo - _shf) / 6 - 1; diff --git a/shaders/sh_curve_hsv/sh_curve_hsv.fsh b/shaders/sh_curve_hsv/sh_curve_hsv.fsh index 9b0313731..0f3bc0e93 100644 --- a/shaders/sh_curve_hsv/sh_curve_hsv.fsh +++ b/shaders/sh_curve_hsv/sh_curve_hsv.fsh @@ -1,13 +1,15 @@ +#define CURVE_MAX 512 + varying vec2 v_vTexcoord; varying vec4 v_vColour; -uniform float h_curve[1024]; +uniform float h_curve[CURVE_MAX]; uniform int h_amount; -uniform float s_curve[1024]; +uniform float s_curve[CURVE_MAX]; uniform int s_amount; -uniform float v_curve[1024]; +uniform float v_curve[CURVE_MAX]; uniform int v_amount; float eval_curve_segment_t(in float _y0, in float ax0, in float ay0, in float bx1, in float by1, in float _y1, in float prog) { @@ -64,7 +66,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt); } -float curveEval(in float[1024] curve, in int amo, in float _x) { +float curveEval(in float[CURVE_MAX] curve, in int amo, in float _x) { int _shf = amo - int(floor(float(amo) / 6.) * 6.); int _segs = (amo - _shf) / 6 - 1; diff --git a/shaders/sh_pixel_cloud/sh_pixel_cloud.fsh b/shaders/sh_pixel_cloud/sh_pixel_cloud.fsh index cd2e5b525..c7289b32b 100644 --- a/shaders/sh_pixel_cloud/sh_pixel_cloud.fsh +++ b/shaders/sh_pixel_cloud/sh_pixel_cloud.fsh @@ -1,3 +1,5 @@ +#define CURVE_MAX 512 + varying vec2 v_vTexcoord; varying vec4 v_vColour; @@ -7,7 +9,7 @@ uniform float dist; uniform int useMap; uniform sampler2D strengthMap; -uniform float alpha_curve[1024]; +uniform float alpha_curve[CURVE_MAX]; uniform int curve_amount; uniform float randomAmount; diff --git a/shaders/sh_shape/sh_shape.fsh b/shaders/sh_shape/sh_shape.fsh index ea4dd7173..b5819cc93 100644 --- a/shaders/sh_shape/sh_shape.fsh +++ b/shaders/sh_shape/sh_shape.fsh @@ -1,4 +1,5 @@ // 2D Signed Distance equations by InigoQuilez +#define CURVE_MAX 512 varying vec2 v_vTexcoord; varying vec4 v_vColour; @@ -12,7 +13,7 @@ uniform int tile; uniform int drawBG; uniform int drawDF; uniform vec2 dfLevel; -uniform float w_curve[1024]; +uniform float w_curve[CURVE_MAX]; uniform int w_amount; uniform float rotation; @@ -106,7 +107,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt); } -float curveEval(in float[1024] curve, in int amo, in float _x) { +float curveEval(in float[CURVE_MAX] curve, in int amo, in float _x) { int _shf = amo - int(floor(float(amo) / 6.) * 6.); int _segs = (amo - _shf) / 6 - 1;