mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-12 13:35:35 -04:00
frame usage debug info
This commit is contained in:
@@ -10,6 +10,7 @@ extern const char* configPath;
|
||||
|
||||
namespace dusk {
|
||||
extern AuroraStats lastFrameAuroraStats;
|
||||
extern float frameUsagePct;
|
||||
}
|
||||
|
||||
constexpr u32 defaultWindowWidth = 608;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "JSystem/JUtility/JUTDbPrint.h"
|
||||
#include "JSystem/JUtility/JUTProcBar.h"
|
||||
#include "aurora/aurora.h"
|
||||
#include "dusk/dusk.h"
|
||||
#include "dusk/gx_helper.h"
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/settings.h"
|
||||
@@ -358,10 +359,12 @@ static void waitForTick(u32 p1, u16 p2) {
|
||||
{
|
||||
static OSTime nextTick = OSGetTime();
|
||||
OSTime time = OSGetTime();
|
||||
OSTime waitTime = (nextTick > time) ? (nextTick - time) : 0;
|
||||
while (time < nextTick) {
|
||||
JFWDisplay::getManager()->threadSleep((nextTick - time));
|
||||
time = OSGetTime();
|
||||
}
|
||||
dusk::frameUsagePct = 100.0f * (1.0f - (float)waitTime / (float)p1);
|
||||
nextTick = time + p1;
|
||||
} else {
|
||||
static u32 nextCount = VIGetRetraceCount();
|
||||
|
||||
@@ -97,6 +97,7 @@ namespace dusk {
|
||||
hasPrevious = true;
|
||||
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("FPS: {:.2f}\n"), io.Framerate));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Frame usage: {:.1f}%\n"), frameUsagePct));
|
||||
|
||||
if (hasPrevious) {
|
||||
ImGui::Separator();
|
||||
|
||||
@@ -111,6 +111,7 @@ s32 LOAD_COPYDATE(void*) {
|
||||
|
||||
AuroraInfo auroraInfo;
|
||||
AuroraStats dusk::lastFrameAuroraStats;
|
||||
float dusk::frameUsagePct = 0.0f;
|
||||
const char* configPath;
|
||||
|
||||
void main01(void) {
|
||||
|
||||
Reference in New Issue
Block a user