Updated Framerate shit

This commit is contained in:
lunarcleint
2023-03-21 17:03:18 -07:00
parent 88b75cf086
commit 02358a0246
3 changed files with 24 additions and 4 deletions
+2
View File
@@ -1,5 +1,6 @@
package funkin.system;
import funkin.system.framerate.SystemInfo;
import openfl.utils.AssetLibrary;
import openfl.utils.AssetCache;
import openfl.text.TextFormat;
@@ -107,6 +108,7 @@ class Main extends Sprite
#if !mobile
// addChild(new FramerateField(10, 3, 0xFFFFFF));
addChild(new funkin.system.framerate.Framerate());
SystemInfo.init();
#end
trace("Hello", "World");
@@ -54,6 +54,7 @@ class Framerate extends Sprite {
__addToList(codenameBuildField = new CodenameBuildField());
#end
__addCategory(new ConductorInfo());
__addCategory(new FlixelInfo());
__addCategory(new SystemInfo());
__addCategory(new AssetTreeInfo());
+21 -4
View File
@@ -3,16 +3,33 @@ package funkin.system.framerate;
import funkin.utils.MemoryUtil;
class SystemInfo extends FramerateCategory {
public static var osInfo:String = "Unknown";
public static var gpuName:String = "Unknown";
public static var vRAM:String = "-1 MB";
public static var cpuName:String = "Unknown";
public static inline function init() {
osInfo = '${lime.system.System.platformLabel} ${lime.system.System.platformVersion}';
@:privateAccess {
gpuName = Std.string(flixel.FlxG.stage.context3D.gl.getParameter(flixel.FlxG.stage.context3D.gl.RENDERER)).split("/")[0];
vRAM = CoolUtil.getSizeString(cast(flixel.FlxG.stage.context3D.gl.getParameter(openfl.display3D.Context3D.__glMemoryTotalAvailable), UInt) * 1000);
}
#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];
#end
}
public function new() {
super("System Info");
}
public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;
_text = 'System: ${lime.system.System.platformLabel} ${lime.system.System.platformVersion}';
_text += '\nObjs in state: ${FlxG.state.members.length}';
_text += '\nNb cameras: ${FlxG.cameras.list.length}';
_text += '\nCurrent state: ${Type.getClassName(Type.getClass(FlxG.state))}';
_text = 'System: $osInfo';
_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;