mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-28 07:56:17 +01:00
delete libsysinfo
This commit is contained in:
parent
dde78b78bb
commit
5e6983681d
3 changed files with 43 additions and 45 deletions
|
@ -274,7 +274,6 @@
|
||||||
{"name":"FLIP","order":19,"path":"extensions/FLIP/FLIP.yy",},
|
{"name":"FLIP","order":19,"path":"extensions/FLIP/FLIP.yy",},
|
||||||
{"name":"gameframe_native","order":2,"path":"extensions/gameframe_native/gameframe_native.yy",},
|
{"name":"gameframe_native","order":2,"path":"extensions/gameframe_native/gameframe_native.yy",},
|
||||||
{"name":"GMSSimpleMIDI","order":17,"path":"extensions/GMSSimpleMIDI/GMSSimpleMIDI.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":"libborderless","order":1,"path":"extensions/libborderless/libborderless.yy",},
|
||||||
{"name":"libdlgmodule","order":15,"path":"extensions/libdlgmodule/libdlgmodule.yy",},
|
{"name":"libdlgmodule","order":15,"path":"extensions/libdlgmodule/libdlgmodule.yy",},
|
||||||
{"name":"libfilesystem","order":14,"path":"extensions/libfilesystem/libfilesystem.yy",},
|
{"name":"libfilesystem","order":14,"path":"extensions/libfilesystem/libfilesystem.yy",},
|
||||||
|
|
|
@ -711,7 +711,6 @@
|
||||||
{"id":{"name":"FLIP","path":"extensions/FLIP/FLIP.yy",},},
|
{"id":{"name":"FLIP","path":"extensions/FLIP/FLIP.yy",},},
|
||||||
{"id":{"name":"gameframe_native","path":"extensions/gameframe_native/gameframe_native.yy",},},
|
{"id":{"name":"gameframe_native","path":"extensions/gameframe_native/gameframe_native.yy",},},
|
||||||
{"id":{"name":"GMSSimpleMIDI","path":"extensions/GMSSimpleMIDI/GMSSimpleMIDI.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":"libborderless","path":"extensions/libborderless/libborderless.yy",},},
|
||||||
{"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},},
|
{"id":{"name":"libdlgmodule","path":"extensions/libdlgmodule/libdlgmodule.yy",},},
|
||||||
{"id":{"name":"libfilesystem","path":"extensions/libfilesystem/libfilesystem.yy",},},
|
{"id":{"name":"libfilesystem","path":"extensions/libfilesystem/libfilesystem.yy",},},
|
||||||
|
|
|
@ -1,55 +1,55 @@
|
||||||
function Panel_Resource_Monitor() : PanelContent() constructor {
|
function Panel_Resource_Monitor() : PanelContent() constructor {
|
||||||
title = "ResMon";
|
// title = "ResMon";
|
||||||
w = ui(380);
|
// w = ui(380);
|
||||||
h = ui(48);
|
// h = ui(48);
|
||||||
min_h = ui(20);
|
// min_h = ui(20);
|
||||||
|
|
||||||
sysinfo_init();
|
// sysinfo_init();
|
||||||
|
|
||||||
mb = 1024 * 1024;
|
// mb = 1024 * 1024;
|
||||||
gb = 1024 * 1024 * 1024;
|
// gb = 1024 * 1024 * 1024;
|
||||||
memory_max = sysinfo_get_memory_max();
|
// memory_max = sysinfo_get_memory_max();
|
||||||
vram_max = sysinfo_get_gpu_vram();
|
// vram_max = sysinfo_get_gpu_vram();
|
||||||
cpu_cores = sysinfo_get_core_count();
|
// cpu_cores = sysinfo_get_core_count();
|
||||||
|
|
||||||
memory_use = 0;
|
// memory_use = 0;
|
||||||
cpu_uses = array_create(5);
|
// cpu_uses = array_create(5);
|
||||||
cpu_use_ind = 0;
|
// cpu_use_ind = 0;
|
||||||
cpu_use_acc = 0;
|
// cpu_use_acc = 0;
|
||||||
cpu_rec = 0;
|
// cpu_rec = 0;
|
||||||
|
|
||||||
runner = 0;
|
// runner = 0;
|
||||||
|
|
||||||
function drawContent(panel) {
|
// function drawContent(panel) {
|
||||||
draw_clear(merge_color(c_black, CDEF.main_dkblack, 0.75));
|
// draw_clear(merge_color(c_black, CDEF.main_dkblack, 0.75));
|
||||||
draw_clear(COLORS.panel_bg_clear_inner);
|
// draw_clear(COLORS.panel_bg_clear_inner);
|
||||||
runner++;
|
// runner++;
|
||||||
|
|
||||||
if(runner % 100 == 0) {
|
// if(runner % 100 == 0) {
|
||||||
memory_use = sysinfo_proc_memory_used();
|
// memory_use = sysinfo_proc_memory_used();
|
||||||
cpu_use = sysinfo_sys_cpu_usage();
|
// cpu_use = sysinfo_sys_cpu_usage();
|
||||||
if(cpu_use > 0) {
|
// if(cpu_use > 0) {
|
||||||
cpu_use_acc -= cpu_uses[cpu_use_ind];
|
// cpu_use_acc -= cpu_uses[cpu_use_ind];
|
||||||
cpu_uses[cpu_use_ind] = cpu_use;
|
// cpu_uses[cpu_use_ind] = cpu_use;
|
||||||
cpu_use_acc += cpu_use;
|
// cpu_use_acc += cpu_use;
|
||||||
cpu_use_ind = (cpu_use_ind + 1) % 5;
|
// cpu_use_ind = (cpu_use_ind + 1) % 5;
|
||||||
cpu_rec++;
|
// cpu_rec++;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
var _cpu = cpu_use_acc / clamp(cpu_rec, 1, 5);
|
// var _cpu = cpu_use_acc / clamp(cpu_rec, 1, 5);
|
||||||
var _mem = memory_use / memory_max;
|
// 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_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_set_text(f_code, fa_left, fa_center, COLORS._main_text);
|
||||||
|
|
||||||
var _tx = ui(12);
|
// var _tx = ui(12);
|
||||||
var _ty = floor(h / 2);
|
// var _ty = floor(h / 2);
|
||||||
draw_set_color(COLORS._main_text_sub); draw_text(_tx, _ty, $"CPU usage");
|
// 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}%");
|
// draw_set_color(COLORS._main_text); draw_text(_tx + ui(80), _ty, $"{_cpu}%");
|
||||||
|
|
||||||
_tx += ui(160);
|
// _tx += ui(160);
|
||||||
draw_set_color(COLORS._main_text_sub); draw_text(_tx, _ty, $"Memory");
|
// 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");
|
// draw_set_color(COLORS._main_text); draw_text(_tx + ui(56), _ty, $"{memory_use / mb} MB");
|
||||||
}
|
// }
|
||||||
}
|
}
|
Loading…
Reference in a new issue