From a5b530ad12b2c454fbe32a779e62bc09cc6408f1 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Tue, 12 Dec 2023 12:40:29 +0700 Subject: [PATCH] mac --- PixelComposer.resource_order | 1 + PixelComposer.yyp | 1 + scripts/globals/globals.gml | 6 +++--- scripts/mac_window_init/mac_window_init.gml | 8 ++++++- scripts/panel_menu/panel_menu.gml | 21 +++++++------------ scripts/windowManager/windowManager.gml | 11 ++++++++++ shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh | 4 +--- shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh | 3 --- shaders/sh_perlin_tiled/sh_perlin_tiled.fsh | 3 +-- .../sh_seperate_shape_ite.fsh | 4 ++-- shaders/sh_shape/sh_shape.fsh | 2 -- shaders/sh_warp_4points/sh_warp_4points.fsh | 2 +- 12 files changed, 35 insertions(+), 31 deletions(-) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 148c021ec..7cbc23109 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -1644,6 +1644,7 @@ {"name":"paddingBox","order":7,"path":"scripts/paddingBox/paddingBox.yy",}, {"name":"fd_rectangle_set_visualization_shader","order":18,"path":"scripts/fd_rectangle_set_visualization_shader/fd_rectangle_set_visualization_shader.yy",}, {"name":"s_biterator_bg","order":2,"path":"sprites/s_biterator_bg/s_biterator_bg.yy",}, + {"name":"macMinimize","order":2,"path":"extensions/macMinimize/macMinimize.yy",}, {"name":"s_node_ase_layer","order":14,"path":"sprites/s_node_ase_layer/s_node_ase_layer.yy",}, {"name":"directory_functions","order":9,"path":"scripts/directory_functions/directory_functions.yy",}, {"name":"_f_p1","order":1,"path":"fonts/_f_p1/_f_p1.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 839ebef16..474fe73e2 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -2821,6 +2821,7 @@ {"id":{"name":"sh_mk_flag_mrt","path":"shaders/sh_mk_flag_mrt/sh_mk_flag_mrt.yy",},}, {"id":{"name":"s_biterator_bg","path":"sprites/s_biterator_bg/s_biterator_bg.yy",},}, {"id":{"name":"addonPanel","path":"scripts/addonPanel/addonPanel.yy",},}, + {"id":{"name":"macMinimize","path":"extensions/macMinimize/macMinimize.yy",},}, {"id":{"name":"s_node_ase_layer","path":"sprites/s_node_ase_layer/s_node_ase_layer.yy",},}, {"id":{"name":"directory_functions","path":"scripts/directory_functions/directory_functions.yy",},}, {"id":{"name":"_f_p1","path":"fonts/_f_p1/_f_p1.yy",},}, diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 9f86a9266..43b8cb834 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -25,10 +25,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION; LATEST_VERSION = 11500; - VERSION = 11603; + VERSION = 11604; SAVE_VERSION = 11600.1; - VERSION_STRING = "1.16.0.3"; - BUILD_NUMBER = 11603; + VERSION_STRING = "1.16.0.4"; + BUILD_NUMBER = 11604; globalvar APPEND_MAP; APPEND_MAP = ds_map_create(); diff --git a/scripts/mac_window_init/mac_window_init.gml b/scripts/mac_window_init/mac_window_init.gml index 706b9e1a4..28246d06c 100644 --- a/scripts/mac_window_init/mac_window_init.gml +++ b/scripts/mac_window_init/mac_window_init.gml @@ -18,13 +18,15 @@ function mac_window_init() { __win_drag_sw = 0; __win_drag_sh = 0; + __win_to_dock = false; + __win_is_maximized = false; __win_min_x = 0; __win_min_y = 0; __win_min_w = 0; __win_min_h = 0; - ext_window_set_showborder(false); + _window_set_showborder(window_handle(), false); } function mac_window_maximize() { @@ -55,4 +57,8 @@ function mac_window_minimize() { winMan_setRect(__win_min_x, __win_min_y, __win_min_w, __win_min_h); display_refresh(); +} + +function mac_window_dock() { + o_main.__win_to_dock = true; } \ No newline at end of file diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 0079e1540..072edff64 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -570,21 +570,14 @@ function Panel_Menu() : PanelContent() constructor { } break; case "minimize": - if(OS == os_windows) { - var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_minimize, 0, [ COLORS._main_icon, CDEF.yellow ]); - if(b) _draggable = false; - if(b == -2) { - if(OS == os_windows) - winMan_Minimize(); - else if(OS == os_macosx) { - - } - } + var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_minimize, 0, [ COLORS._main_icon, CDEF.yellow ]); + if(b) _draggable = false; + if(b == -2) { + if(OS == os_windows) + winMan_Minimize(); + else if(OS == os_macosx) + mac_window_dock(); } - - //if(OS == os_macosx) { - // buttonInstant(THEME.button_hide, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_minimize, 0, [ COLORS._main_icon, COLORS._main_icon ]); - //} break; case "fullscreen": var win_full = window_is_fullscreen; diff --git a/scripts/windowManager/windowManager.gml b/scripts/windowManager/windowManager.gml index f45c91ce5..2b477865b 100644 --- a/scripts/windowManager/windowManager.gml +++ b/scripts/windowManager/windowManager.gml @@ -118,6 +118,17 @@ function winMan_setFullscreen(full) { #region } #endregion function winManStep() { #region + if(OS == os_macosx) { + if(__win_to_dock) { + _window_set_showborder(window_handle(), true); + mac_minimize_to_dock(window_handle()); + __win_to_dock = false; + } else { + if(_window_get_showborder(window_handle())) + _window_set_showborder(window_handle(), false); + } + } + if(window_drag_status == 0) return; var _mx = window_drag_mx; var _my = window_drag_my; diff --git a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh index c47999ae1..64777238d 100644 --- a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh +++ b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh @@ -1,7 +1,5 @@ #extension GL_OES_standard_derivatives : enable -// -// Simple passthrough fragment shader -// + varying vec2 v_vTexcoord; varying vec4 v_vColour; diff --git a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh index 7d131d3d0..0d5050161 100644 --- a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh +++ b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh @@ -1,6 +1,3 @@ -// -// Simple passthrough vertex shader -// attribute vec3 in_Position; // (x,y,z) //attribute vec3 in_Normal; // (x,y,z) unused in this shader. attribute vec4 in_Colour; // (r,g,b,a) diff --git a/shaders/sh_perlin_tiled/sh_perlin_tiled.fsh b/shaders/sh_perlin_tiled/sh_perlin_tiled.fsh index dc24d88ce..f1227f6fe 100644 --- a/shaders/sh_perlin_tiled/sh_perlin_tiled.fsh +++ b/shaders/sh_perlin_tiled/sh_perlin_tiled.fsh @@ -61,8 +61,7 @@ float perlin(in vec2 st) { #region for(int i = 0; i < iteration; i++) { n += noise(pos, sc) * amp; - pos.x += random(vec2(float(i)), 0.574186) * sc; - pos.y += random(vec2(float(i)), 0.821458) * sc; + pos += random2(vec2(float(i), float(i)), seed + 1.574186) * sc; sc *= 2.; amp *= .5; diff --git a/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh b/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh index b424e4250..2e68e6d72 100644 --- a/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh +++ b/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh @@ -15,7 +15,7 @@ void main() { vec4 zero = vec4(0.); vec3 baseCol = sampVal(texture2D( map, v_vTexcoord )); - if(ignore == 1 && baseCol == 0.) { + if(ignore == 1 && baseCol == vec3(0.)) { gl_FragColor = vec4(0.); return; } @@ -28,7 +28,7 @@ void main() { vec2 pos = clamp(v_vTexcoord + vec2(i, j) / dimension, 0., 1.); vec3 samCl = sampVal(texture2D( map, pos )); - if(ignore == 1 && samCl == 0.) + if(ignore == 1 && samCl == vec3(0.)) continue; if(distance(samCl, baseCol) <= threshold) { diff --git a/shaders/sh_shape/sh_shape.fsh b/shaders/sh_shape/sh_shape.fsh index 33e6ff7c5..6ac2f4e66 100644 --- a/shaders/sh_shape/sh_shape.fsh +++ b/shaders/sh_shape/sh_shape.fsh @@ -1,5 +1,3 @@ -//#extension GL_OES_standard_derivatives : require - varying vec2 v_vTexcoord; varying vec4 v_vColour; diff --git a/shaders/sh_warp_4points/sh_warp_4points.fsh b/shaders/sh_warp_4points/sh_warp_4points.fsh index 6153da5ef..11b777b24 100644 --- a/shaders/sh_warp_4points/sh_warp_4points.fsh +++ b/shaders/sh_warp_4points/sh_warp_4points.fsh @@ -96,7 +96,7 @@ void main() { float _B = (A.x * py) + c1 - (A.y * px); float _C = (B.x * py) + c2 - (B.y * px); - u = A == 0.? 0. : (-_B - sqrt(_B * _B - 4.0 * _A * _C)) / (_A * 2.0); + u = A == vec2(0.)? 0. : (-_B - sqrt(_B * _B - 4.0 * _A * _C)) / (_A * 2.0); v = (u * A.x + B.x) == 0.? 0. : (px - (u * C.x) - D.x) / (u * A.x + B.x); uv = vec2(1. - u, v); }