summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp12
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.h3
-rw-r--r--src/yuzu_cmd/yuzu.cpp4
3 files changed, 17 insertions, 2 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index a6edc089a..aa69cc9c8 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -4,6 +4,8 @@
4 4
5#include <SDL.h> 5#include <SDL.h>
6#include "common/logging/log.h" 6#include "common/logging/log.h"
7#include "common/scm_rev.h"
8#include "core/core.h"
7#include "input_common/keyboard.h" 9#include "input_common/keyboard.h"
8#include "input_common/main.h" 10#include "input_common/main.h"
9#include "input_common/motion_emu.h" 11#include "input_common/motion_emu.h"
@@ -170,6 +172,16 @@ void EmuWindow_SDL2::PollEvents() {
170 break; 172 break;
171 } 173 }
172 } 174 }
175
176 const u32 current_time = SDL_GetTicks();
177 if (current_time > last_time + 2000) {
178 const auto results = Core::System::GetInstance().GetAndResetPerfStats();
179 const auto title = fmt::format(
180 "yuzu {} | {}-{} | FPS: {:.0f} ({:.0%})", Common::g_build_fullname,
181 Common::g_scm_branch, Common::g_scm_desc, results.game_fps, results.emulation_speed);
182 SDL_SetWindowTitle(render_window, title.c_str());
183 last_time = current_time;
184 }
173} 185}
174 186
175void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned> minimal_size) { 187void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned> minimal_size) {
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h
index d8051ebdf..eaa971f77 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h
@@ -60,4 +60,7 @@ protected:
60 60
61 /// Internal SDL2 render window 61 /// Internal SDL2 render window
62 SDL_Window* render_window; 62 SDL_Window* render_window;
63
64 /// Keeps track of how often to update the title bar during gameplay
65 u32 last_time = 0;
63}; 66};
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index bac05b959..3ee088a91 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -186,8 +186,6 @@ int main(int argc, char** argv) {
186 system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>()); 186 system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>());
187 system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); 187 system.GetFileSystemController().CreateFactories(*system.GetFilesystem());
188 188
189 SCOPE_EXIT({ system.Shutdown(); });
190
191 const Core::System::ResultStatus load_result{system.Load(*emu_window, filepath)}; 189 const Core::System::ResultStatus load_result{system.Load(*emu_window, filepath)};
192 190
193 switch (load_result) { 191 switch (load_result) {
@@ -227,6 +225,8 @@ int main(int argc, char** argv) {
227 system.RunLoop(); 225 system.RunLoop();
228 } 226 }
229 227
228 system.Shutdown();
229
230 detached_tasks.WaitForAllTasks(); 230 detached_tasks.WaitForAllTasks();
231 return 0; 231 return 0;
232} 232}