From ca512ea06a4f3e4e7170f294df163aaa5d7c42b6 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 3 Feb 2015 21:59:36 +0100 Subject: [PATCH] More minor cleanup. Update lang. --- UI/EmuScreen.cpp | 6 ++---- Windows/D3D9Base.cpp | 6 ++++-- Windows/GEDebugger/VertexPreview.cpp | 9 +++++++-- lang | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 393e274b06..7018ad6ea1 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -805,10 +805,10 @@ void EmuScreen::render() { if (useBufferedRendering && g_Config.iGPUBackend == GPU_BACKEND_OPENGL) fbo_unbind(); - if (!osm.IsEmpty() || g_Config.bShowDebugStats || g_Config.iShowFPSCounter || g_Config.bShowTouchControls || g_Config.bShowDeveloperMenu || g_Config.bShowAudioDebug) { - + if (!osm.IsEmpty() || g_Config.bShowDebugStats || g_Config.iShowFPSCounter || g_Config.bShowTouchControls || g_Config.bShowDeveloperMenu || g_Config.bShowAudioDebug || saveStatePreview_->GetVisibility() != UI::V_GONE) { Thin3DContext *thin3d = screenManager()->getThin3DContext(); + // This sets up some important states but not the viewport. screenManager()->getUIContext()->Begin(); T3DViewport viewport; @@ -819,8 +819,6 @@ void EmuScreen::render() { viewport.MaxDepth = 1.0; viewport.MinDepth = 0.0; thin3d->SetViewports(1, &viewport); - thin3d->SetBlendState(thin3d->GetBlendStatePreset(BS_STANDARD_ALPHA)); - thin3d->SetScissorEnabled(false); DrawBuffer *draw2d = screenManager()->getUIContext()->Draw(); diff --git a/Windows/D3D9Base.cpp b/Windows/D3D9Base.cpp index 063c8982a7..7363ebfd70 100644 --- a/Windows/D3D9Base.cpp +++ b/Windows/D3D9Base.cpp @@ -26,6 +26,7 @@ static HDC hDC; // Private GDI Device Context static HGLRC hRC; // Permanent Rendering Context static HWND hWnd; // Holds Our Window Handle static D3DPRESENT_PARAMETERS pp; +static HMODULE hD3D9; // TODO: Make config? static bool enableGLDebug = true; @@ -68,7 +69,7 @@ bool D3D9_Init(HWND wnd, bool windowed, std::string *error_message) { DIRECT3DCREATE9EX g_pfnCreate9ex; - HMODULE hD3D9 = LoadLibrary(TEXT("d3d9.dll")); + hD3D9 = LoadLibrary(TEXT("d3d9.dll")); if (!hD3D9) { ELOG("Missing d3d9.dll"); *error_message = "D3D9.dll missing - try reinstalling DirectX."; @@ -100,7 +101,6 @@ bool D3D9_Init(HWND wnd, bool windowed, std::string *error_message) { return false; } } - FreeLibrary(hD3D9); D3DCAPS9 d3dCaps; @@ -231,4 +231,6 @@ void D3D9_Shutdown() { DX9::pD3DdeviceEx = nullptr; device = nullptr; hWnd = nullptr; + FreeLibrary(hD3D9); + hD3D9 = nullptr; } diff --git a/Windows/GEDebugger/VertexPreview.cpp b/Windows/GEDebugger/VertexPreview.cpp index a98f62d7f1..20582d2e2c 100644 --- a/Windows/GEDebugger/VertexPreview.cpp +++ b/Windows/GEDebugger/VertexPreview.cpp @@ -20,6 +20,7 @@ #include "Windows/GEDebugger/GEDebugger.h" #include "Windows/GEDebugger/SimpleGLWindow.h" #include "Core/System.h" +#include "Core/Config.h" #include "GPU/GPUInterface.h" #include "GPU/Common/GPUDebugInterface.h" #include "GPU/GPUState.h" @@ -257,6 +258,10 @@ void CGEDebugger::UpdatePrimPreview(u32 op) { } void CGEDebugger::CleanupPrimPreview() { - glsl_destroy(previewProgram); - glsl_destroy(texPreviewProgram); + if (previewProgram) { + glsl_destroy(previewProgram); + } + if (texPreviewProgram) { + glsl_destroy(texPreviewProgram); + } } diff --git a/lang b/lang index 5aca62de1c..8ba302b6ba 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 5aca62de1c916da408f2400bd5b42bf70eba5c4d +Subproject commit 8ba302b6baeeddf4435fa68f0c6cc5e1dfaa427e