From befc5db031b6bbce22ebbc4e27907781087b7336 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Wed, 11 Oct 2017 03:06:30 +0200 Subject: [PATCH] restore FPS counter --- src/libui_sdl/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 6797139f..288d9b5b 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -68,6 +68,11 @@ SDL_Joystick* Joystick; +void UpdateWindowTitle(void* data) +{ + uiWindowSetTitle(MainWindow, (const char*)data); +} + void AudioCallback(void* data, Uint8* stream, int len) { SPU::ReadOutput((s16*)stream, len>>2); @@ -117,6 +122,7 @@ int EmuThreadFunc(void* burp) u32 lastmeasuretick = lasttick; u32 fpslimitcount = 0; bool limitfps = true; + char melontitle[100]; while (EmuRunning != 0) { @@ -200,9 +206,8 @@ int EmuThreadFunc(void* burp) if (framerate < 1) fpstarget = 999; else fpstarget = 1000.0f/framerate; - char melontitle[100]; - sprintf(melontitle, "%d/%.0f FPS | melonDS " MELONDS_VERSION, fps, fpstarget); - //uiWindowSetTitle(MainWindow, melontitle); + sprintf(melontitle, "[%d/%.0f] melonDS " MELONDS_VERSION, fps, fpstarget); + uiQueueMain(UpdateWindowTitle, melontitle); } } else