From 87e51a5c04ad5837898ef4fd96fa9bde12d5c8b2 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 20 Aug 2013 17:21:25 +0200 Subject: [PATCH] Fix some window title issues, etc. --- Core/System.cpp | 2 ++ Windows/DSoundStream.cpp | 6 +++--- Windows/WindowsHost.cpp | 4 +++- Windows/WndMainWindow.cpp | 15 +-------------- Windows/WndMainWindow.h | 1 - Windows/main.cpp | 1 + 6 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Core/System.cpp b/Core/System.cpp index 34145f74e8..98d9245dfc 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -181,6 +181,7 @@ void CPU_Init() { return; } + if (coreParameter.updateRecent) { g_Config.AddRecent(filename); } @@ -290,6 +291,7 @@ void PSP_Shutdown() { CPU_Shutdown(); } GPU_Shutdown(); + host->SetWindowTitle(0); } void PSP_RunLoopUntil(u64 globalticks) { diff --git a/Windows/DSoundStream.cpp b/Windows/DSoundStream.cpp index 20ebde10ad..3a204d2ea9 100644 --- a/Windows/DSoundStream.cpp +++ b/Windows/DSoundStream.cpp @@ -192,6 +192,9 @@ namespace DSound void DSound_StopSound() { + if (!dsBuffer) + return; + if (threadData == 0) threadData = 1; @@ -227,11 +230,8 @@ namespace DSound return playCursor; } - - float DSound_GetTimer() { return (float)DSound_GetCurSample()*(1.0f/(4.0f*44100.0f)); } - } diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 773a7867ce..65e863ca65 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -96,7 +96,9 @@ void WindowsHost::ShutdownGL() void WindowsHost::SetWindowTitle(const char *message) { - std::string title = std::string("PPSSPP ") + PPSSPP_GIT_VERSION + " - " + message; + std::string title = std::string("PPSSPP ") + PPSSPP_GIT_VERSION; + if (message) + title = title + " - " + message; int size = MultiByteToWideChar(CP_UTF8, 0, title.c_str(), (int) title.size(), NULL, 0); if (size > 0) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 0d73a458f0..f19196ebd4 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -333,7 +333,6 @@ namespace MainWindow SetTimer(hwndMain, TIMER_CURSORUPDATE, CURSORUPDATE_INTERVAL_MS, 0); Update(); - SetPlaying(0); if(g_Config.bFullScreenOnLaunch) _ViewFullScreen(hwndMain); @@ -694,7 +693,6 @@ namespace MainWindow Core_EnableStepping(false); } NativeMessageReceived("stop", ""); - SetPlaying(0); Update(); break; @@ -1156,8 +1154,7 @@ namespace MainWindow // Ugly, need to wait for the stop message to process in the EmuThread. Sleep(20); - MainWindow::SetPlaying(filename); - MainWindow::Update(); + Update(); NativeMessageReceived("boot", filename); } @@ -1497,16 +1494,6 @@ namespace MainWindow UpdateScreenScale(); } - void SetPlaying(const char *text) { - char temp[256]; - if (text == 0) - snprintf(temp, 256, "PPSSPP %s", PPSSPP_GIT_VERSION); - else - snprintf(temp, 256, "%s - PPSSPP %s", text, PPSSPP_GIT_VERSION); - temp[255] = '\0'; - SetWindowText(hwndMain, temp); - } - void SaveStateActionFinished(bool result, void *userdata) { PostMessage(hwndMain, WM_USER_SAVESTATE_FINISH, 0, 0); } diff --git a/Windows/WndMainWindow.h b/Windows/WndMainWindow.h index 7f6e5d3394..cd0e9bed63 100644 --- a/Windows/WndMainWindow.h +++ b/Windows/WndMainWindow.h @@ -50,7 +50,6 @@ namespace MainWindow HWND GetHWND(); HINSTANCE GetHInstance(); HWND GetDisplayHWND(); - void SetPlaying(const char*text); void BrowseAndBoot(std::string defaultPath, bool browseDirectory = false); void SaveStateActionFinished(bool result, void *userdata); void _ViewFullScreen(HWND hWnd); diff --git a/Windows/main.cpp b/Windows/main.cpp index 01a35b9fa1..b9e7597e6a 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -123,6 +123,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin DialogManager::AddDlg(vfpudlg = new CVFPUDlg(_hInstance, hwndMain, currentDebugMIPS)); host = new WindowsHost(hwndMain, hwndDisplay); + host->SetWindowTitle(0); // Emu thread is always running! EmuThread_Start();