From d3ff35b2c0bb8558db63930b73d1c60eb0657771 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Fri, 5 May 2017 12:30:23 +0200 Subject: [PATCH] Fix to partial restarts (when switching backends), plus misc. Helps #9666 --- UI/HostTypes.h | 4 +--- UI/NativeApp.cpp | 4 ++-- Windows/EmuThread.cpp | 2 +- Windows/main.cpp | 2 +- ext/freetype2 | 1 + ext/native/gfx_es2/draw_buffer.h | 2 -- ext/native/ui/ui_screen.cpp | 4 +--- 7 files changed, 7 insertions(+), 12 deletions(-) create mode 160000 ext/freetype2 diff --git a/UI/HostTypes.h b/UI/HostTypes.h index d591a60d58..137684ec7f 100644 --- a/UI/HostTypes.h +++ b/UI/HostTypes.h @@ -25,11 +25,9 @@ #include "Qt/mainwindow.h" #endif -// TODO: Get rid of this junk class NativeHost : public Host { public: - NativeHost() { - } + NativeHost() {} void UpdateUI() override {} diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index bbcd0980f9..264dfe26d2 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -330,7 +330,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch VFSRegister("", new DirectoryAssetReader("assets/")); VFSRegister("", new DirectoryAssetReader(savegame_dir)); -#if (defined(MOBILE_DEVICE) || !defined(USING_QT_UI)) && !PPSSPP_PLATFORM(UWP) +#if (defined(MOBILE_DEVICE) || !defined(USING_QT_UI)) && !PPSSPP_PLATFORM(WINDOWS) if (host == nullptr) { host = new NativeHost(); } @@ -1087,7 +1087,7 @@ void NativeShutdown() { gl_lost_manager_shutdown(); } -#if !PPSSPP_PLATFORM(UWP) +#if !PPSSPP_PLATFORM(WINDOWS) delete host; host = nullptr; #endif diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index b576196892..1a9e7d782a 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -113,7 +113,7 @@ unsigned int WINAPI TheThread(void *) host->UpdateUI(); - GraphicsContext *graphicsContext; + GraphicsContext *graphicsContext = nullptr; std::string error_string; if (!host->InitGraphics(&error_string, &graphicsContext)) { diff --git a/Windows/main.cpp b/Windows/main.cpp index 4203eed02a..608fdf1071 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -505,7 +505,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin DialogManager::AddDlg(vfpudlg = new CVFPUDlg(_hInstance, hwndMain, currentDebugMIPS)); host = new WindowsHost(_hInstance, hwndMain, hwndDisplay); - host->SetWindowTitle(0); + host->SetWindowTitle(nullptr); MainWindow::CreateDebugWindows(); diff --git a/ext/freetype2 b/ext/freetype2 new file mode 160000 index 0000000000..3e79254ae7 --- /dev/null +++ b/ext/freetype2 @@ -0,0 +1 @@ +Subproject commit 3e79254ae73ba4e5f951967b42d38b0aa1460af8 diff --git a/ext/native/gfx_es2/draw_buffer.h b/ext/native/gfx_es2/draw_buffer.h index ba0efc5480..d31530fa35 100644 --- a/ext/native/gfx_es2/draw_buffer.h +++ b/ext/native/gfx_es2/draw_buffer.h @@ -140,8 +140,6 @@ public: void DrawText(int font, const char *text, float x, float y, Color color = 0xFFFFFFFF, int align = 0); void DrawTextShadow(int font, const char *text, float x, float y, Color color = 0xFFFFFFFF, int align = 0); - void RotateSprite(ImageID atlas_image, float x, float y, float angle, float scale, Color color); - void SetFontScale(float xs, float ys) { fontscalex = xs; fontscaley = ys; diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index 21a0c37920..f4afc57a2b 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -13,9 +13,7 @@ static const bool ClickDebug = false; UIScreen::UIScreen() - : Screen(), root_(nullptr), recreateViews_(true), hatDown_(0) { - translation_ = Vec3(0.0f); - scale_ = Vec3(1.0f); + : Screen(), root_(nullptr), translation_(0.0f), scale_(1.0f), recreateViews_(true), hatDown_(0) { } UIScreen::~UIScreen() {