Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions source/funkin/backend/system/framerate/SystemInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class SystemInfo extends FramerateCategory {
gpuName = Std.string(flixel.FlxG.stage.context3D.gl.getParameter(flixel.FlxG.stage.context3D.gl.RENDERER)).split("/")[0].trim();
#if !flash
var size = FlxG.bitmap.maxTextureSize;
gpuMaxSize = size+"x"+size;
gpuMaxSize = size+"x"+size; //if (gpuMaxSize != "Unknown") StringMacro.addLine(buf, '\nMax Bitmap Size: ',gpuMaxSize);
#end

if(openfl.display3D.Context3D.__glMemoryTotalAvailable != -1) {
Expand All @@ -124,7 +124,9 @@ class SystemInfo extends FramerateCategory {
}

#if cpp
totalMem = Std.string(MemoryUtil.getTotalMem() / 1024) + " GB";
var rawMem:Float = MemoryUtil.getTotalMem();
var rawGBMem:Float = flixel.math.FlxMath.roundDecimal(rawMem / 1024, 2);
totalMem = Std.string(rawGBMem) + " GB";
#else
Logs.error('Unable to grab RAM Amount');
#end
Expand All @@ -140,7 +142,7 @@ class SystemInfo extends FramerateCategory {
static function formatSysInfo() {
var buf = new StringBuf();
if (osInfo != "Unknown") {
StringMacro.addLine(buf, 'System: ${osInfo}');
StringMacro.addLine(buf, 'System: ${osInfo} ');
}
if (cpuName != "Unknown") {
StringMacro.addLine(buf, '\nCPU: ${cpuName} ${openfl.system.Capabilities.cpuArchitecture} ${openfl.system.Capabilities.supports64BitProcesses ? "64-Bit" : "32-Bit"}');
Expand All @@ -159,7 +161,7 @@ class SystemInfo extends FramerateCategory {
StringMacro.addLine(buf, 'VRAM: ${vRAM}');
}
}
//if (gpuMaxSize != "Unknown") StringMacro.addLine(buf, '\nMax Bitmap Size: ',gpuMaxSize);

if (totalMem != "Unknown" && memType != "Unknown") {
StringMacro.addLine(buf, '\nTotal MEM: ${totalMem} ${memType}');
}
Expand Down
17 changes: 9 additions & 8 deletions source/funkin/backend/utils/MemoryUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,16 @@ final class MemoryUtil {
reg.match(process.stdout.readAll().toString());
if (process.exitCode() == 0) return reg.matched(1);
#elseif linux
/*var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]);
if (process.exitCode() != 0) return "Unknown";
var lines = process.stdout.readAll().toString().split("\n");
for (line in lines) {
if (line.startsWith("Type:")) {
return line.substring("Type:".length).trim();
try {
var process = new HiddenProcess("sh", ["-c", "inxi --mm --c 0 | grep -i 'type:' | awk -F'type:' '{print $2}' | awk '{print $1}' | head -n 1"]);
var output = StringTools.trim(process.stdout.readAll().toString());
process.close();

if (output != "" && output != "None" && output != "Unknown") {
return StringTools.replace(output, ",", "");
}
}*/
// TODO: sort of unsafe? also requires users to use `sudo`
} catch (e:Dynamic) {}
// TODO: sort of unsafe? also requires users to use `sudo` (or use inxi (YOU NEED INXI INSTALLED ON YOUR DISTRO FOR THIS OTHERWISE ENGINE WILL FREEZE ON INITIALISATION))
// when launching the engine through the CLI, REIMPLEMENT LATER.
#end
return "Unknown";
Expand Down