Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
54 changes: 42 additions & 12 deletions source/funkin/backend/system/framerate/AssetTreeInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,62 @@ class AssetTreeInfo extends FramerateCategory {

lastUpdateTime = 0;

var text = 'Not initialized yet\n';
var text = "Not initialized yet\n";
if (Paths.assetsTree != null){
text = "";
var buf = new StringBuf();
for(l in Paths.assetsTree.libraries) {
var l = AssetsLibraryList.getCleanLibrary(l);

var tag = l.tag.toString().toUpperCase();

text += '[$tag] ';
buf.add("[");
buf.add(tag);
buf.add("] ");

var className = Type.getClassName(Type.getClass(l));
className = className.substr(className.lastIndexOf(".") + 1);

#if TRANSLATIONS_SUPPORT
if (l is TranslatedAssetLibrary)
text += '${className} - ${cast(l, TranslatedAssetLibrary).langFolder} for (${cast(l, TranslatedAssetLibrary).forLibrary.modName})\n';
else #end if (l is ScriptedAssetLibrary)
text += '${className} - ${cast(l, ScriptedAssetLibrary).scriptName} (${cast(l, ScriptedAssetLibrary).modName} | ${cast(l, ScriptedAssetLibrary).libName} | ${cast(l, ScriptedAssetLibrary).prefix})\n';
else if (l is IModsAssetLibrary)
text += '${className} - ${cast(l, IModsAssetLibrary).modName} - ${cast(l, IModsAssetLibrary).libName} (${cast(l, IModsAssetLibrary).prefix})\n';
else
text += Std.string(l) + '\n';
if (l is TranslatedAssetLibrary) {
buf.add(className);
buf.add(" - ");
buf.add(cast(l, TranslatedAssetLibrary).langFolder);
buf.add(" for (");
buf.add(cast(l, TranslatedAssetLibrary).forLibrary.modName);
buf.add(")\n");
}
else #end if (l is ScriptedAssetLibrary) {
buf.add(className);
buf.add(" - ");
buf.add(cast(l, ScriptedAssetLibrary).scriptName);
buf.add(" (");
buf.add(cast(l, ScriptedAssetLibrary).modName);
buf.add(" | ");
buf.add(cast(l, ScriptedAssetLibrary).libName);
buf.add(" | ");
buf.add(cast(l, ScriptedAssetLibrary).prefix);
buf.add(")\n");
}
else if (l is IModsAssetLibrary) {
buf.add(className);
buf.add(" - ");
buf.add(cast(l, IModsAssetLibrary).modName);
buf.add(" - ");
buf.add(cast(l, IModsAssetLibrary).libName);
buf.add(" (");
buf.add(cast(l, IModsAssetLibrary).prefix);
buf.add(")\n");
}
else {
buf.add(Std.string(l));
buf.add("\n");
}
}
text = buf.toString();
if (text != "")
text = text.substr(0, text.length-1);
}
if (text != "")
text = text.substr(0, text.length-1);

this.text.text = text;
super.__enterFrame(t);
Expand Down
26 changes: 20 additions & 6 deletions source/funkin/backend/system/framerate/ConductorInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ class ConductorInfo extends FramerateCategory {

public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;
_text = 'Current Song Position: ${Math.floor(Conductor.songPosition * 1000) / 1000}';
_text += '\n - ${Conductor.curBeat} beats';
_text += '\n - ${Conductor.curStep} steps';
_text += '\n - ${Conductor.curMeasure} measures';
_text += '\nCurrent BPM: ${Conductor.bpm}';
_text += '\nTime Signature: ${Conductor.beatsPerMeasure}/${Conductor.denominator}';

var buf = new StringBuf();
buf.add("Current Song Position: ");
buf.add(Math.floor(Conductor.songPosition * 1000) / 1000);
buf.add("\n - ");
buf.add(Conductor.curBeat);
buf.add(" beats");
buf.add("\n - ");
buf.add(Conductor.curStep);
buf.add(" steps");
buf.add("\n - ");
buf.add(Conductor.curMeasure);
buf.add(" measures");
buf.add("\nCurrent BPM: ");
buf.add(Conductor.bpm);
buf.add("\nTime Signature: ");
buf.add(Conductor.beatsPerMeasure);
buf.add("/");
buf.add(Conductor.denominator);
_text = buf.toString();

this.text.text = _text;
super.__enterFrame(t);
Expand Down
33 changes: 21 additions & 12 deletions source/funkin/backend/system/framerate/FlixelInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,37 @@ class FlixelInfo extends FramerateCategory {
public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;


@:privateAccess {
var c:Int = Lambda.count(FlxG.bitmap._cache);
var buf = new StringBuf();

if((FlxG.state is ModState)) {
var state:ModState = cast FlxG.state;
_text = "Mod State: " + state.scriptName;
buf.add("Mod State: ");
buf.add(state.scriptName);
} else {
_text = 'State: ${Type.getClassName(Type.getClass(FlxG.state))}';
buf.add("State: ");
buf.add(Type.getClassName(Type.getClass(FlxG.state)));
}
buf.add("\nObject Count: ");
buf.add(FlxG.state.members.length);
buf.add("\nCamera Count: ");
buf.add(FlxG.cameras.list.length);
buf.add("\nBitmaps Count: ");
buf.add(c);
buf.add("\nSounds Count: ");
buf.add(FlxG.sound.list.length);
buf.add("\nFlxG.game Childs Count: ");
buf.add(FlxG.game.numChildren);
if(FlxG.renderBlit) {
buf.add("\nBlitting Render: true");
}
_text += '\nObject Count: ${FlxG.state.members.length}';
_text += '\nCamera Count: ${FlxG.cameras.list.length}';
_text += '\nBitmaps Count: ${c}';
_text += '\nSounds Count: ${FlxG.sound.list.length}';
_text += '\nFlxG.game Childs Count: ${FlxG.game.numChildren}';
if(FlxG.renderBlit) _text += '\nBlitting Render: true';
// _text += '\nCached objects count: ${cachedObjects}';
#if FLX_POINT_POOL
//var points = flixel.math.FlxPoint.FlxBasePoint.pool;
//_text += '\nPoint Count: ${points._count} | +${points.made} | -${points.gotten} | ${points.balance} | >${points.putted}';
//_text += '\nPoint Count: ${points._count}';
//buf.add('\nPoint Count: ${points._count} | +${points.made} | -${points.gotten} | ${points.balance} | >${points.putted}');
//buf.add('\nPoint Count: ${points._count}');
#end
_text = buf.toString();
}

this.text.text = _text;
Expand Down
1 change: 0 additions & 1 deletion source/funkin/backend/system/framerate/MemoryCounter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class MemoryCounter extends Sprite {

memory = mem;
if (memoryPeak < memory) memoryPeak = memory;
memoryText.text = CoolUtil.getSizeString(memory);
memoryPeakText.text = ' / ${CoolUtil.getSizeString(memoryPeak)}';

updateLabelPosition();
Expand Down
12 changes: 9 additions & 3 deletions source/funkin/backend/system/framerate/StatsInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ class StatsInfo extends FramerateCategory {

public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;
_text = "totalDC: " + Context3DStats.totalDrawCalls();
_text += "\nstageDC: " + Context3DStats.contextDrawCalls(DrawCallContext.STAGE);
_text += "\nstage3DDC: " + Context3DStats.contextDrawCalls(DrawCallContext.STAGE3D);

var buf = new StringBuf();
buf.add("totalDC: ");
buf.add(Context3DStats.totalDrawCalls());
buf.add("\nstageDC: ");
buf.add(Context3DStats.contextDrawCalls(DrawCallContext.STAGE));
buf.add("\nstage3DDC: ");
buf.add(Context3DStats.contextDrawCalls(DrawCallContext.STAGE3D));
_text = buf.toString();

this.text.text = _text;
super.__enterFrame(t);
Expand Down
51 changes: 40 additions & 11 deletions source/funkin/backend/system/framerate/SystemInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,43 @@ class SystemInfo extends FramerateCategory {
}

static function formatSysInfo() {
__formattedSysText = "";
if (osInfo != "Unknown") __formattedSysText += 'System: $osInfo';
if (cpuName != "Unknown") __formattedSysText += '\nCPU: $cpuName ${openfl.system.Capabilities.cpuArchitecture} ${(openfl.system.Capabilities.supports64BitProcesses ? '64-Bit' : '32-Bit')}';
var buf = new StringBuf();
if (osInfo != "Unknown") {
buf.add("System: ");
buf.add(osInfo);
}
if (cpuName != "Unknown") {
buf.add("\nCPU: ");
buf.add(cpuName);
buf.add(" ");
buf.add(openfl.system.Capabilities.cpuArchitecture);
buf.add(" ");
buf.add(openfl.system.Capabilities.supports64BitProcesses ? "64-Bit" : "32-Bit");
}
if (gpuName != cpuName || vRAM != "Unknown") {
var gpuNameKnown = gpuName != "Unknown" && gpuName != cpuName;
var vramKnown = vRAM != "Unknown";

if(gpuNameKnown || vramKnown) __formattedSysText += "\n";
if(gpuNameKnown || vramKnown) buf.add("\n");

if(gpuNameKnown) __formattedSysText += 'GPU: $gpuName';
if(gpuNameKnown && vramKnown) __formattedSysText += " | ";
if(vramKnown) __formattedSysText += 'VRAM: $vRAM'; // 1000 bytes of vram (apus)
if(gpuNameKnown) {
buf.add("GPU: ");
buf.add(gpuName);
}
if(gpuNameKnown && vramKnown) buf.add(" | ");
if(vramKnown) {
buf.add("VRAM: ");
buf.add(vRAM);
}
}
//if (gpuMaxSize != "Unknown") buf.add('\nMax Bitmap Size: $gpuMaxSize');
if (totalMem != "Unknown" && memType != "Unknown") {
buf.add("\nTotal MEM: ");
buf.add(totalMem);
buf.add(" ");
buf.add(memType);
}
//if (gpuMaxSize != "Unknown") __formattedSysText += '\nMax Bitmap Size: $gpuMaxSize';
if (totalMem != "Unknown" && memType != "Unknown") __formattedSysText += '\nTotal MEM: $totalMem $memType';
__formattedSysText = buf.toString();
}

static function getSizeString(size:Float):String {
Expand All @@ -172,8 +194,15 @@ class SystemInfo extends FramerateCategory {
public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;

_text = __formattedSysText;
_text += '${__formattedSysText == "" ? "" : "\n"}Garbage Collector: ${MemoryUtil.disableCount > 0 ? "OFF" : "ON"} (${MemoryUtil.disableCount})';
var buf = new StringBuf();
buf.add(__formattedSysText);
if (__formattedSysText != "") buf.add("\n");
buf.add("Garbage Collector: ");
buf.add(MemoryUtil.disableCount > 0 ? "OFF" : "ON");
buf.add(" (");
buf.add(MemoryUtil.disableCount);
buf.add(")");
_text = buf.toString();

this.text.text = _text;
super.__enterFrame(t);
Expand Down