From 5e6983681df17e4d50d1eeae0dc989bfe61114e5 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 25 Dec 2024 12:53:24 +0700 Subject: [PATCH] delete libsysinfo --- PixelComposer.resource_order | 1 - PixelComposer.yyp | 1 - .../panel_resource_monitor.gml | 86 +++++++++---------- 3 files changed, 43 insertions(+), 45 deletions(-) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 0f2326e26..af077f4cb 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -274,7 +274,6 @@ {"name":"FLIP","order":19,"path":"extensions/FLIP/FLIP.yy",}, {"name":"gameframe_native","order":2,"path":"extensions/gameframe_native/gameframe_native.yy",}, {"name":"GMSSimpleMIDI","order":17,"path":"extensions/GMSSimpleMIDI/GMSSimpleMIDI.yy",}, - {"name":"GMSysinfo","order":22,"path":"extensions/GMSysinfo/GMSysinfo.yy",}, {"name":"libborderless","order":1,"path":"extensions/libborderless/libborderless.yy",}, {"name":"libdlgmodule","order":15,"path":"extensions/libdlgmodule/libdlgmodule.yy",}, {"name":"libfilesystem","order":14,"path":"extensions/libfilesystem/libfilesystem.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index ac78f44a8..13db752e4 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -711,7 +711,6 @@ {"id":{"name":"FLIP","path":"extensions/FLIP/FLIP.yy",},}, {"id":{"name":"gameframe_native","path":"extensions/gameframe_native/gameframe_native.yy",},}, {"id":{"name":"GMSSimpleMIDI","path":"extensions/GMSSimpleMIDI/GMSSimpleMIDI.yy",},}, - {"id":{"name":"GMSysinfo","path":"extensions/GMSysinfo/GMSysinfo.yy",},}, {"id":{"name":"libborderless","path":"extensions/libborderless/libborderless.yy",},}, {"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},}, {"id":{"name":"libfilesystem","path":"extensions/libfilesystem/libfilesystem.yy",},}, diff --git a/scripts/panel_resource_monitor/panel_resource_monitor.gml b/scripts/panel_resource_monitor/panel_resource_monitor.gml index 19ef5508e..80e44f00d 100644 --- a/scripts/panel_resource_monitor/panel_resource_monitor.gml +++ b/scripts/panel_resource_monitor/panel_resource_monitor.gml @@ -1,55 +1,55 @@ function Panel_Resource_Monitor() : PanelContent() constructor { - title = "ResMon"; - w = ui(380); - h = ui(48); - min_h = ui(20); + // title = "ResMon"; + // w = ui(380); + // h = ui(48); + // min_h = ui(20); - sysinfo_init(); + // sysinfo_init(); - mb = 1024 * 1024; - gb = 1024 * 1024 * 1024; - memory_max = sysinfo_get_memory_max(); - vram_max = sysinfo_get_gpu_vram(); - cpu_cores = sysinfo_get_core_count(); + // mb = 1024 * 1024; + // gb = 1024 * 1024 * 1024; + // memory_max = sysinfo_get_memory_max(); + // vram_max = sysinfo_get_gpu_vram(); + // cpu_cores = sysinfo_get_core_count(); - memory_use = 0; - cpu_uses = array_create(5); - cpu_use_ind = 0; - cpu_use_acc = 0; - cpu_rec = 0; + // memory_use = 0; + // cpu_uses = array_create(5); + // cpu_use_ind = 0; + // cpu_use_acc = 0; + // cpu_rec = 0; - runner = 0; + // runner = 0; - function drawContent(panel) { - draw_clear(merge_color(c_black, CDEF.main_dkblack, 0.75)); - draw_clear(COLORS.panel_bg_clear_inner); - runner++; + // function drawContent(panel) { + // draw_clear(merge_color(c_black, CDEF.main_dkblack, 0.75)); + // draw_clear(COLORS.panel_bg_clear_inner); + // runner++; - if(runner % 100 == 0) { - memory_use = sysinfo_proc_memory_used(); - cpu_use = sysinfo_sys_cpu_usage(); - if(cpu_use > 0) { - cpu_use_acc -= cpu_uses[cpu_use_ind]; - cpu_uses[cpu_use_ind] = cpu_use; - cpu_use_acc += cpu_use; - cpu_use_ind = (cpu_use_ind + 1) % 5; - cpu_rec++; - } - } + // if(runner % 100 == 0) { + // memory_use = sysinfo_proc_memory_used(); + // cpu_use = sysinfo_sys_cpu_usage(); + // if(cpu_use > 0) { + // cpu_use_acc -= cpu_uses[cpu_use_ind]; + // cpu_uses[cpu_use_ind] = cpu_use; + // cpu_use_acc += cpu_use; + // cpu_use_ind = (cpu_use_ind + 1) % 5; + // cpu_rec++; + // } + // } - var _cpu = cpu_use_acc / clamp(cpu_rec, 1, 5); - var _mem = memory_use / memory_max; + // var _cpu = cpu_use_acc / clamp(cpu_rec, 1, 5); + // var _mem = memory_use / memory_max; - draw_sprite_stretched_ext(THEME.s_box_r2, 0, 0, 0, w * _mem, h, COLORS._main_value_positive, 0.2); - draw_set_text(f_code, fa_left, fa_center, COLORS._main_text); + // draw_sprite_stretched_ext(THEME.s_box_r2, 0, 0, 0, w * _mem, h, COLORS._main_value_positive, 0.2); + // draw_set_text(f_code, fa_left, fa_center, COLORS._main_text); - var _tx = ui(12); - var _ty = floor(h / 2); - draw_set_color(COLORS._main_text_sub); draw_text(_tx, _ty, $"CPU usage"); - draw_set_color(COLORS._main_text); draw_text(_tx + ui(80), _ty, $"{_cpu}%"); + // var _tx = ui(12); + // var _ty = floor(h / 2); + // draw_set_color(COLORS._main_text_sub); draw_text(_tx, _ty, $"CPU usage"); + // draw_set_color(COLORS._main_text); draw_text(_tx + ui(80), _ty, $"{_cpu}%"); - _tx += ui(160); - draw_set_color(COLORS._main_text_sub); draw_text(_tx, _ty, $"Memory"); - draw_set_color(COLORS._main_text); draw_text(_tx + ui(56), _ty, $"{memory_use / mb} MB"); - } + // _tx += ui(160); + // draw_set_color(COLORS._main_text_sub); draw_text(_tx, _ty, $"Memory"); + // draw_set_color(COLORS._main_text); draw_text(_tx + ui(56), _ty, $"{memory_use / mb} MB"); + // } } \ No newline at end of file