Fix some stuff with system info

This commit is contained in:
NeeEoo
2023-03-22 01:40:02 +01:00
parent 9e1a042e45
commit 2a9cab6535
2 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
2653
2654
+14 -4
View File
@@ -17,10 +17,20 @@ class SystemInfo extends FramerateCategory {
#if windows
var process = new sys.io.Process("wmic", ["cpu", "get", "name"]);
if (process.exitCode() == 0) cpuName = process.stdout.readAll().toString().trim().split("\n")[1];
#elseif (mac || linux)
if (process.exitCode() == 0) cpuName = process.stdout.readAll().toString().trim().split("\n")[1].trim();
#elseif (mac)
var process = new sys.io.Process("sysctl -a | grep brand");
if (process.exitCode() == 0) cpuName = process.stdout.readAll().toString().trim().split(":")[1];
if (process.exitCode() == 0) cpuName = process.stdout.readAll().toString().trim().split(":")[1].trim();
#else
var process = new sys.io.Process("cat", ["/proc/cpuinfo"]);
if (process.exitCode() != 0) return;
for (line in process.stdout.readAll().toString().split("\n")) {
if (line.indexOf("model name") == 0) {
cpuName = line.substring(line.indexOf(":") + 2);
break;
}
}
#end
}
@@ -34,7 +44,7 @@ class SystemInfo extends FramerateCategory {
_text += '\nCPU: ${cpuName} ${openfl.system.Capabilities.cpuArchitecture} ${(openfl.system.Capabilities.supports64BitProcesses ? '64-Bit' : '32-Bit')}';
_text += '\nGPU: ${gpuName} | VRAM $vRAM';
_text += '\nGarbage Collector: ${MemoryUtil.disableCount > 0 ? "OFF" : "ON"} (${MemoryUtil.disableCount})';
this.text.text = _text;
super.__enterFrame(t);
}