From 6a88241e64c429fcb9312eb4b1425c34884bb8a0 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 20 Jun 2010 22:23:34 +0000 Subject: [PATCH] D3D9: Delete some long dead code. Also add one more statistic: number of compiled shaders that actually have unique code (not accurate unless you delete the shader cache before running). This stat clearly shows that in f-zero we create 5x as many pixel shaders as we should, so there's clearly a problem with the shader ID generation. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5754 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/Statistics.cpp | 1 + Source/Core/VideoCommon/Src/Statistics.h | 2 + .../Plugin_VideoDX9/Plugin_VideoDX9.vcproj | 502 ------------------ .../Plugin_VideoDX9/Src/BPFunctions.cpp | 3 +- .../Plugin_VideoDX9/Src/DlgSettings.cpp | 2 - .../Plugin_VideoDX9/Src/PixelShaderCache.cpp | 16 +- .../Plugin_VideoDX9/Src/PixelShaderCache.h | 5 +- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 9 +- Source/Plugins/Plugin_VideoDX9/Src/Utils.cpp | 45 -- Source/Plugins/Plugin_VideoDX9/Src/Utils.h | 31 -- .../Plugin_VideoDX9/Src/VertexManager.cpp | 1 - .../Plugin_VideoDX9/Src/VertexShaderCache.cpp | 1 - .../Src/W32Util/DialogManager.cpp | 29 - .../Src/W32Util/DialogManager.h | 12 - .../Plugin_VideoDX9/Src/W32Util/File.cpp | 148 ------ .../Plugin_VideoDX9/Src/W32Util/File.h | 61 --- .../Plugin_VideoDX9/Src/W32Util/Misc.cpp | 102 ---- .../Plugin_VideoDX9/Src/W32Util/Misc.h | 9 - .../Src/W32Util/PropertySheet.cpp | 227 -------- .../Src/W32Util/PropertySheet.h | 87 --- .../Plugin_VideoDX9/Src/W32Util/ShellUtil.cpp | 113 ---- .../Plugin_VideoDX9/Src/W32Util/ShellUtil.h | 15 - .../Src/W32Util/TabControl.cpp | 94 ---- .../Plugin_VideoDX9/Src/W32Util/TabControl.h | 36 -- .../Plugin_VideoDX9/Src/W32Util/Thread.cpp | 82 --- .../Plugin_VideoDX9/Src/W32Util/Thread.h | 36 -- Source/Plugins/Plugin_VideoDX9/Src/main.cpp | 4 - .../Plugin_VideoOGL/Src/VertexShaderCache.cpp | 1 - 28 files changed, 27 insertions(+), 1647 deletions(-) delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/Utils.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/Utils.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.h delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.h diff --git a/Source/Core/VideoCommon/Src/Statistics.cpp b/Source/Core/VideoCommon/Src/Statistics.cpp index 6297b7191c..202769c55f 100644 --- a/Source/Core/VideoCommon/Src/Statistics.cpp +++ b/Source/Core/VideoCommon/Src/Statistics.cpp @@ -50,6 +50,7 @@ char *Statistics::ToString(char *ptr) ptr+=sprintf(ptr,"textures alive: %i\n",stats.numTexturesAlive); ptr+=sprintf(ptr,"pshaders created: %i\n",stats.numPixelShadersCreated); ptr+=sprintf(ptr,"pshaders alive: %i\n",stats.numPixelShadersAlive); + ptr+=sprintf(ptr,"pshaders (unique, delete cache first): %i\n",stats.numUniquePixelShaders); ptr+=sprintf(ptr,"vshaders created: %i\n",stats.numVertexShadersCreated); ptr+=sprintf(ptr,"vshaders alive: %i\n",stats.numVertexShadersAlive); ptr+=sprintf(ptr,"dlists called: %i\n",stats.numDListsCalled); diff --git a/Source/Core/VideoCommon/Src/Statistics.h b/Source/Core/VideoCommon/Src/Statistics.h index 658101b6f1..b102741753 100644 --- a/Source/Core/VideoCommon/Src/Statistics.h +++ b/Source/Core/VideoCommon/Src/Statistics.h @@ -41,6 +41,8 @@ struct Statistics int numVertexLoaders; + int numUniquePixelShaders; + float proj_0, proj_1, proj_2, proj_3, proj_4, proj_5, proj_6; float gproj_0, gproj_1, gproj_2, gproj_3, gproj_4, gproj_5; float gproj_6, gproj_7, gproj_8, gproj_9, gproj_10, gproj_11, gproj_12, gproj_13, gproj_14, gproj_15; diff --git a/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj b/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj index c9e6498a4f..bbfe07dc7e 100644 --- a/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj +++ b/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj @@ -668,74 +668,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -744,432 +676,6 @@ RelativePath=".\Src\EmuWindow.h" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1393,14 +899,6 @@ RelativePath=".\Src\stdafx.h" > - - - - diff --git a/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp b/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp index f00e8a120a..9667d8b018 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp @@ -22,8 +22,7 @@ #include "TextureCache.h" #include "VertexManager.h" #include "VertexShaderManager.h" -#include "Utils.h" -#include "debugger/debugger.h" +#include "Debugger/Debugger.h" #include "TextureConverter.h" diff --git a/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp b/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp index d83abe7ec9..f953ce08ed 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp @@ -23,8 +23,6 @@ #include #include "DlgSettings.h" -#include "W32Util/PropertySheet.h" -#include "W32Util/ShellUtil.h" #include "FileUtil.h" #include "D3DBase.h" diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp index 83f40354e8..7290061b6a 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp @@ -15,7 +15,11 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include +#include + #include "Common.h" +#include "Hash.h" #include "FileUtil.h" #include "LinearDiskCache.h" @@ -23,7 +27,6 @@ #include "D3DBase.h" #include "D3DShader.h" #include "Statistics.h" -#include "Utils.h" #include "VideoConfig.h" #include "PixelShaderGen.h" #include "PixelShaderManager.h" @@ -38,7 +41,8 @@ PixelShaderCache::PSCache PixelShaderCache::PixelShaders; const PixelShaderCache::PSCacheEntry *PixelShaderCache::last_entry; -LinearDiskCache g_ps_disk_cache; +static LinearDiskCache g_ps_disk_cache; +static std::set unique_shaders; static float lastPSconstants[C_COLORMATRIX+16][4]; @@ -47,7 +51,6 @@ static LPDIRECT3DPIXELSHADER9 s_ColorCopyProgram[3]; static LPDIRECT3DPIXELSHADER9 s_DepthMatrixProgram[3]; static LPDIRECT3DPIXELSHADER9 s_ClearProgram = 0; - LPDIRECT3DPIXELSHADER9 PixelShaderCache::GetColorMatrixProgram(int SSAAMode) { return s_ColorMatrixProgram[SSAAMode % 3]; @@ -297,6 +300,8 @@ void PixelShaderCache::Shutdown() Clear(); g_ps_disk_cache.Sync(); g_ps_disk_cache.Close(); + + unique_shaders.clear(); } bool PixelShaderCache::SetShader(bool dstAlpha) @@ -338,6 +343,11 @@ bool PixelShaderCache::SetShader(bool dstAlpha) // OK, need to generate and compile it. const char *code = GeneratePixelShaderCode(PixelShaderManager::GetTextureMask(), dstAlpha, API_D3D9); + + u32 code_hash = HashAdler32((const u8 *)code, strlen(code)); + unique_shaders.insert(code_hash); + SETSTAT(stats.numUniquePixelShaders, unique_shaders.size()); + #if defined(_DEBUG) || defined(DEBUGFAST) if (g_ActiveConfig.iLog & CONF_SAVESHADERS && code) { static int counter = 0; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.h b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.h index 2e32e40b75..06ae56b935 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.h @@ -37,14 +37,15 @@ private: struct PSCacheEntry { LPDIRECT3DPIXELSHADER9 shader; + bool owns_shader; int frameCount; #if defined(_DEBUG) || defined(DEBUGFAST) std::string code; #endif - PSCacheEntry() : shader(NULL), frameCount(0) {} + PSCacheEntry() : shader(NULL), owns_shader(true), frameCount(0) {} void Destroy() { - if (shader) + if (shader && owns_shader) shader->Release(); shader = NULL; } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index a4ffddbfa0..a466bb3149 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -41,7 +41,6 @@ #include "PixelShaderCache.h" #include "VertexLoaderManager.h" #include "TextureCache.h" -#include "Utils.h" #include "EmuWindow.h" #include "AVIDump.h" #include "OnScreenDisplay.h" @@ -84,7 +83,10 @@ static u32 s_LastEFBScale; static bool IS_AMD; static bool XFBWrited; -char st[32768]; +// used extern by other files. need to clean this up at some point. +int frameCount; + +static char *st; static bool s_bScreenshot = false; static Common::CriticalSection s_criticalScreenshot; @@ -252,6 +254,7 @@ void TeardownDeviceObjects() bool Renderer::Init() { + st = new char[32768]; UpdateActiveConfig(); int fullScreenRes, x, y, w_temp, h_temp; s_blendMode = 0; @@ -370,6 +373,7 @@ void Renderer::Shutdown() { AVIDump::Stop(); } + delete [] st; } int Renderer::GetTargetWidth() { return s_target_width; } @@ -1179,6 +1183,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) D3D::font.DrawTextScaled(0,30,20,20,0.0f,0xFF00FFFF,st,false); } + OSD::DrawMessages(); D3D::EndFrame(); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Utils.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Utils.cpp deleted file mode 100644 index 75c0e2292c..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/Utils.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#ifdef _WIN32 -#include "W32Util/Misc.h" -#endif - -#include "Common.h" -#include - -int frameCount; - -// Message handler for about box. -LRESULT CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM /*lParam*/) -{ - switch (message) - { - case WM_INITDIALOG: - W32Util::CenterWindow(hDlg); - return TRUE; - - case WM_COMMAND: - if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) - { - EndDialog(hDlg, LOWORD(wParam)); - return TRUE; - } - break; - } - return FALSE; -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Utils.h b/Source/Plugins/Plugin_VideoDX9/Src/Utils.h deleted file mode 100644 index eaeb6a72dc..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/Utils.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#ifndef _UTILS_H -#define _UTILS_H - -#include "Common.h" -#include "main.h" -#include "LookUpTables.h" -#include "VideoCommon.h" - -extern int frameCount; - -LRESULT CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); - - -#endif diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp index 72571a6c79..827ce5800d 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp @@ -29,7 +29,6 @@ #include "VertexShaderCache.h" #include "PixelShaderManager.h" #include "PixelShaderCache.h" -#include "Utils.h" #include "NativeVertexFormat.h" #include "NativeVertexWriter.h" #include "TextureCache.h" diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp index 7bb5c36bd3..e062fb270a 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp @@ -25,7 +25,6 @@ #include "D3DBase.h" #include "D3DShader.h" #include "Statistics.h" -#include "Utils.h" #include "Profiler.h" #include "VideoConfig.h" #include "VertexShaderCache.h" diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.cpp deleted file mode 100644 index 46be5c0dfa..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include "DialogManager.h" - -typedef std::vector WindowList; -WindowList dialogs; - -void DialogManager::AddDlg(HWND hDialog) -{ - dialogs.push_back(hDialog); -} - -bool DialogManager::IsDialogMessage(LPMSG message) -{ - WindowList::iterator iter; - for (iter=dialogs.begin(); iter!=dialogs.end(); ++iter) - { - if (::IsDialogMessage(*iter,message)) - return true; - } - return false; -} - -void DialogManager::EnableAll(BOOL enable) -{ - WindowList::iterator iter; - for (iter=dialogs.begin(); iter!=dialogs.end(); ++iter) - EnableWindow(*iter,enable); -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.h deleted file mode 100644 index 1ce828a640..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/DialogManager.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include - -class DialogManager -{ -public: - static void AddDlg(HWND hDialog); - static bool IsDialogMessage(LPMSG message); - static void EnableAll(BOOL enable); -}; - diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.cpp deleted file mode 100644 index 42f48cad34..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include - -#include "File.h" - - -namespace W32Util -{ - - File::File() - { - fileHandle = INVALID_HANDLE_VALUE; - isOpen=false; - } - - File::~File() - { - - } - - - bool File::Open(const TCHAR *filename, eFileMode _mode) - { - mode = _mode; - //it's time to open the file - fileHandle = CreateFile(filename, - mode==FILE_READ ? GENERIC_READ : GENERIC_WRITE, //open mode - mode == FILE_READ ? FILE_SHARE_READ : NULL, //sharemode - NULL, //security - mode==FILE_READ ? OPEN_EXISTING : CREATE_ALWAYS, //create mode - FILE_ATTRIBUTE_NORMAL, //atrributes - NULL); //template - - if (fileHandle == INVALID_HANDLE_VALUE) - isOpen=false; - else - isOpen=true; - - return isOpen; - } - - - void File::Close() - { - if (isOpen) - { - //close the file and reset variables - CloseHandle(fileHandle); - fileHandle=INVALID_HANDLE_VALUE; - isOpen=false; - } - } - - int File::GetSize() - { - if (!isOpen) //of course - return 0; - else - return GetFileSize(fileHandle,0); - } - - int File::Write(void *data, int size) //let's do some writing - { - if (isOpen) - { - DWORD written; - WriteFile(fileHandle, data, size, &written,0); - return written; //we return the number of bytes that actually got written - } - else - { - return 0; - } - } - - int File::Read(void *data, int size) - { - if (isOpen) - { - DWORD wasRead; - ReadFile(fileHandle, data, size, &wasRead,0); - return wasRead; //we return the number of bytes that actually was read - } - else - { - return 0; - } - } - - int File::WR(void *data, int size) - { - if (mode==FILE_READ) - return Read(data,size); - else - return Write(data,size); - } - bool File::MagicCookie(int cookie) - { - if (mode==FILE_READ) - { - if (ReadInt()!=cookie) - { - char mojs[5],temp[256]; - mojs[4]=0; - *(int*)mojs=cookie; - sprintf(temp,"W32Util::File: Magic Cookie %s is bad!",mojs); - MessageBoxA(0,temp,"Error reading file",MB_ICONERROR); - return false; - } - else - return true; - } - else if (mode==FILE_WRITE) - { - WriteInt(cookie); - return true; - } - return false; - } - - int File::ReadInt() - { - int temp; - if (Read(&temp, sizeof(int))) - return temp; - else - return 0; - } - - void File::WriteInt(int i) - { - Write(&i,sizeof(int)); - } - - char File::ReadChar() - { - char temp; - if (Read(&temp, sizeof(char))) - return temp; - else - return 0; - } - - void File::WriteChar(char i) - { - Write(&i,sizeof(char)); - } -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.h deleted file mode 100644 index 1c71e66002..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/File.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __LAMEFILE_H__ -#define __LAMEFILE_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#include - -namespace W32Util -{ - - enum eFileMode - { - FILE_READ=5, - FILE_WRITE=6, - FILE_ERROR=0xff - }; - - class File - { - HANDLE fileHandle; - eFileMode mode; - bool isOpen; - public: - File(); - virtual ~File(); - - bool Open(const TCHAR *filename, eFileMode mode); - void Adopt(HANDLE h) { fileHandle = h;} - void Close(); - - void WriteInt(int i); - void WriteChar(char i); - int Write(void *data, int size); - - - int ReadInt(); - char ReadChar(); - int Read(void *data, int size); - - int WR(void *data, int size); //write or read depending on open mode - bool MagicCookie(int cookie); - - int GetSize(); - eFileMode GetMode() {return mode;} - void SeekBeg(int pos) - { - if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_BEGIN); - } - void SeekEnd(int pos) - { - if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_END); - } - void SeekCurrent(int pos) - { - if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_CURRENT); - } - }; - -} - - -#endif //__LAMEFILE_H__ diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.cpp deleted file mode 100644 index 45855382b1..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include -#include - -#include "Misc.h" - -namespace W32Util -{ - //shamelessly taken from http://www.catch22.org.uk/tuts/tips.asp - void CenterWindow(HWND hwnd) - { - HWND hwndParent; - RECT rect, rectP; - int width, height; - int screenwidth, screenheight; - int x, y; - - //make the window relative to its parent - hwndParent = GetParent(hwnd); - if (!hwndParent) - return; - - GetWindowRect(hwnd, &rect); - GetWindowRect(hwndParent, &rectP); - - width = rect.right - rect.left; - height = rect.bottom - rect.top; - - x = ((rectP.right-rectP.left) - width) / 2 + rectP.left; - y = ((rectP.bottom-rectP.top) - height) / 2 + rectP.top; - - screenwidth = GetSystemMetrics(SM_CXSCREEN); - screenheight = GetSystemMetrics(SM_CYSCREEN); - - //make sure that the dialog box never moves outside of - //the screen - if(x < 0) x = 0; - if(y < 0) y = 0; - if(x + width > screenwidth) x = screenwidth - width; - if(y + height > screenheight) y = screenheight - height; - - MoveWindow(hwnd, x, y, width, height, FALSE); - } - - HBITMAP CreateBitmapFromARGB(HWND someHwnd, DWORD *image, int w, int h) - { - BITMAPINFO *bitmap_header; - static char bitmapbuffer[sizeof(BITMAPINFO)+16]; - memset(bitmapbuffer,0,sizeof(BITMAPINFO)+16); - bitmap_header=(BITMAPINFO *)bitmapbuffer; - bitmap_header->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bitmap_header->bmiHeader.biPlanes = 1; - bitmap_header->bmiHeader.biBitCount = 32; - bitmap_header->bmiHeader.biCompression = BI_RGB; - bitmap_header->bmiHeader.biWidth = w; - bitmap_header->bmiHeader.biHeight = -h; - - ((unsigned long *)bitmap_header->bmiColors)[0] = 0x00FF0000; - ((unsigned long *)bitmap_header->bmiColors)[1] = 0x0000FF00; - ((unsigned long *)bitmap_header->bmiColors)[2] = 0x000000FF; - - HDC dc = GetDC(someHwnd); - HBITMAP bitmap = CreateDIBitmap(dc,&bitmap_header->bmiHeader,CBM_INIT,image,bitmap_header,DIB_RGB_COLORS); - ReleaseDC(someHwnd,dc); - return bitmap; - } - - void NiceSizeFormat(size_t size, char *out) - { - char *sizes[] = {"b","KB","MB","GB","TB","PB","EB"}; - int s = 0; - int frac = 0; - while (size>1024) - { - s++; - frac = (int)size & 1023; - size /= 1024; - } - float f = (float)size + ((float)frac / 1024.0f); - sprintf(out,"%3.1f %s",f,sizes[s]); - } - BOOL CopyTextToClipboard(HWND hwnd, TCHAR *text) - { - OpenClipboard(hwnd); - EmptyClipboard(); - HANDLE hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (wcslen(text) + 1) * sizeof(TCHAR)); - if (hglbCopy == NULL) - { - CloseClipboard(); - return FALSE; - } - - // Lock the handle and copy the text to the buffer. - - TCHAR *lptstrCopy = (TCHAR *)GlobalLock(hglbCopy); - wcscpy(lptstrCopy, text); - lptstrCopy[wcslen(text)] = (TCHAR) 0; // null character - GlobalUnlock(hglbCopy); - SetClipboardData(CF_TEXT,hglbCopy); - CloseClipboard(); - return TRUE; - } -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.h deleted file mode 100644 index 4a1f9b9d3c..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Misc.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -namespace W32Util -{ - void CenterWindow(HWND hwnd); - HBITMAP CreateBitmapFromARGB(HWND someHwnd, DWORD *image, int w, int h); - void NiceSizeFormat(size_t size, char * out); - BOOL CopyTextToClipboard(HWND hwnd, char * text); -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.cpp deleted file mode 100644 index 3e2d38d4b3..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.cpp +++ /dev/null @@ -1,227 +0,0 @@ -#include "Misc.h" -#include "PropertySheet.h" - -namespace W32Util -{ - bool centered; - - PropSheet::PropSheet() - { - watermark = 0; - header = 0; - icon = 0; - } - - int CALLBACK PropSheet::Callback(HWND hwndDlg, UINT uMsg, LPARAM lParam) - { - switch (uMsg) { - case PSCB_PRECREATE: - { - if (uMsg == PSCB_PRECREATE) - { - /* - if (lParam) - { - DLGTEMPLATE *pDlgTemplate; - DLGTEMPLATEEX *pDlgTemplateEx; - - pDlgTemplateEx = (DLGTEMPLATEEX *)lParam; - if (pDlgTemplateEx->signature == 0xFFFF) - { - // pDlgTemplateEx points to an extended - // dialog template structure. - - //pDlgTemplate->style |= DS_SETFONT; - u8 *tmp1 = (u8*)&pDlgTemplateEx + sizeof(DLGTEMPLATEEX); - u16 *tmp = (u16*)tmp1; - tmp++; //skip menu - tmp++; //skip dlg class - //Crash(); - //Here we should bash in Segoe UI - //It turns out to be way complicated though - //Not worth it - } - else - { - // This is a standard dialog template - // structure. - pDlgTemplate = (DLGTEMPLATE *)lParam; - } - } */ - } - - } - break; - case PSCB_INITIALIZED: - { - } - return 0; - } - return 0; - } - - void PropSheet::Show(HINSTANCE hInstance, HWND hParent, LPCTSTR title, int startpage, bool floating, bool wizard) - { - HPROPSHEETPAGE *pages = new HPROPSHEETPAGE[list.size()]; - PROPSHEETPAGE page; - //common settings - memset((void*)&page,0,sizeof(PROPSHEETPAGE)); - page.dwSize = sizeof(PROPSHEETPAGE); - page.hInstance = hInstance; - - int i=0; - for (DlgList::iterator iter = list.begin(); iter != list.end(); ++iter, ++i) - { - if (wizard) - { - if (i == 0 || i == list.size()-1) - page.dwFlags = PSP_HIDEHEADER; - else - page.dwFlags = PSP_USEHEADERTITLE|PSP_USEHEADERSUBTITLE; - } - else - { - page.dwFlags = PSP_USETITLE; - } - page.pszTemplate = iter->resource; - page.pfnDlgProc = Tab::TabDlgProc; - page.pszTitle = iter->title; - page.pszHeaderTitle = wizard?iter->title:0; - page.pszHeaderSubTitle = wizard?iter->hdrSubTitle:0; - page.lParam = (LPARAM)iter->tab; - pages[i] = CreatePropertySheetPage(&page); - } - - PROPSHEETHEADER sheet; - memset(&sheet,0,sizeof(sheet)); - sheet.dwSize = sizeof(PROPSHEETHEADER); - sheet.hInstance = hInstance; - sheet.hwndParent = hParent; - sheet.pszbmWatermark = watermark; - sheet.pszbmHeader = header; - sheet.pszCaption = title; - sheet.nPages = (UINT)list.size(); - sheet.phpage = pages; - sheet.nStartPage = startpage; - sheet.pfnCallback = (PFNPROPSHEETCALLBACK)Callback; - - NONCLIENTMETRICS ncm = {0}; - ncm.cbSize = sizeof(ncm); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); - hDialogFont = CreateFontIndirect(&ncm.lfMessageFont); - - if (wizard) - { - sheet.dwFlags = PSH_USECALLBACK | PSH_WIZARD97 | (watermark?PSH_WATERMARK:0) | (header?PSH_HEADER:0); - - //Create the intro/end title font - LOGFONT TitleLogFont = ncm.lfMessageFont; - TitleLogFont.lfWeight = FW_BOLD; - lstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold")); - //StringCchCopy(TitleLogFont.lfFaceName, 32, TEXT("Verdana Bold")); - - HDC hdc = GetDC(NULL); //gets the screen DC - int FontSize = 12; - TitleLogFont.lfHeight = 0 - GetDeviceCaps(hdc, LOGPIXELSY) * FontSize / 72; - hTitleFont = CreateFontIndirect(&TitleLogFont); - ReleaseDC(NULL, hdc); - } else { - sheet.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE; - hTitleFont = 0; - } - - if (icon) { - sheet.dwFlags |= PSH_USEHICON; - sheet.hIcon = icon; - } - - sheet.dwFlags |= PSH_NOCONTEXTHELP; - - if (floating) - sheet.dwFlags |= PSH_MODELESS; - //else - // sheet.dwFlags |= PSH_NOAPPLYNOW; - - centered=false; - PropertySheet(&sheet); - if (!floating) - { - for (DlgList::iterator iter = list.begin(); iter != list.end(); ++iter) - { - delete iter->tab; - } - DeleteObject(hTitleFont); - } - DeleteObject(hDialogFont); - delete [] pages; - } - void PropSheet::Add(Tab *tab, LPCTSTR resource, LPCTSTR title, LPCTSTR subtitle) - { - tab->sheet = this; - list.push_back(Page(tab,resource,title,subtitle)); - } - - - void WizExteriorPage::Init(HWND hDlg) - { - HWND hwndControl = GetDlgItem(hDlg, captionID); - //SetWindowFont(hwndControl, sheet->GetTitleFont(), TRUE); - SendMessage(hwndControl,WM_SETFONT,(WPARAM)sheet->GetTitleFont(),0); - } - - INT_PTR Tab::TabDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - Tab *tab = (Tab *)GetWindowLongPtr(hDlg, GWLP_USERDATA); - switch(message) - { - case WM_INITDIALOG: - { - if (!centered) //HACK - { - CenterWindow(GetParent(hDlg)); - centered=true; - } - LPARAM l = ((LPPROPSHEETPAGE)lParam)->lParam; - tab = (Tab *)l; - SetWindowLongPtr(hDlg, GWLP_USERDATA, (DWORD_PTR)l); - tab->Init(hDlg); - } - break; - - case WM_COMMAND: - tab->Command(hDlg,wParam); - PropSheet_Changed(GetParent(hDlg), hDlg); - break; - case WM_NOTIFY: - { - LPNMHDR lpnmh = (LPNMHDR) lParam; - HWND sheet = lpnmh->hwndFrom; - switch(lpnmh->code) { - case PSN_APPLY: - tab->Apply(hDlg); - SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); - break; - case PSN_SETACTIVE: - PropSheet_SetWizButtons(GetParent(hDlg), - (tab->HasPrev()?PSWIZB_BACK:0) | - (tab->HasNext()?PSWIZB_NEXT:0) | - (tab->HasFinish()?PSWIZB_FINISH:0)); - break; - case PSN_KILLACTIVE: - SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); - break; - case PSN_WIZNEXT: - tab->Apply(hDlg); //maybe not always good - break; - case PSN_WIZBACK: - case PSN_RESET: //cancel - break; - default: - return tab->Notify(hDlg, lParam); - } - } - break; - } - return 0; - } -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.h deleted file mode 100644 index b0422530b8..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/PropertySheet.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include - -namespace W32Util -{ - class PropSheet; - - class Tab - { - public: - PropSheet *sheet; //back pointer .. - virtual void Init(HWND hDlg) {} - virtual void Command(HWND hDlg, WPARAM wParam) {} - virtual int Notify(HWND, LPARAM) {return 0;} - virtual void Apply(HWND hDlg) {} - virtual bool HasPrev() {return true;} - virtual bool HasFinish() {return false;} - virtual bool HasNext() {return true;} - static INT_PTR __stdcall TabDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); - }; - - - class WizExteriorPage : public Tab - { - int captionID; - public: - WizExteriorPage(int caption) {captionID = caption;} - void Init(HWND hDlg); - }; - - - class WizFirstPage : public WizExteriorPage - { - public: - WizFirstPage(int caption) : WizExteriorPage(caption) {} - bool HasPrev() {return false;} - }; - - - class WizLastPage : public WizExteriorPage - { - public: - WizLastPage(int caption) : WizExteriorPage(caption) {} - bool HasNext() {return false;} - bool HasFinish() {return true;} - }; - - - class WizInteriorPage : public Tab - { - public: - }; - - class PropSheet - { - LPCTSTR watermark; - LPCTSTR header; - HFONT hTitleFont; - HFONT hDialogFont; - HICON icon; - struct Page - { - Page(Tab *_tab, LPCTSTR _resource, LPCTSTR _title, LPCTSTR _subtitle = 0) - : tab(_tab), resource(_resource), title(_title), hdrSubTitle(_subtitle) {} - Tab *tab; - LPCTSTR resource; - LPCTSTR title; - LPCTSTR hdrSubTitle; - }; - public: - PropSheet(); - typedef std::vector DlgList; - DlgList list; - void SetWaterMark(LPCTSTR _watermark) {watermark=_watermark;} - void SetHeader(LPCTSTR _header) {header=_header;} - void SetIcon(HICON _icon) {icon = _icon;} - void Add(Tab *tab, LPCTSTR resource, LPCTSTR title, LPCTSTR subtitle = 0); - void Show(HINSTANCE hInstance, HWND hParent, LPCTSTR title, int startpage=0, bool floating = false, bool wizard = false); - HFONT GetTitleFont() {return hTitleFont;} - HFONT GetFont() {return hDialogFont;} - static int CALLBACK Callback(HWND hwndDlg, UINT uMsg, LPARAM lParam); - }; - - - -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.cpp deleted file mode 100644 index ec98ae7d26..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include -#include -#include - -#include "ShellUtil.h" - -namespace W32Util -{ - std::string BrowseForFolder(HWND parent, char *title) - { - BROWSEINFOA info; - memset(&info,0,sizeof(info)); - info.hwndOwner = parent; - info.lpszTitle = title; - info.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; - - //info.pszDisplayName - LPCITEMIDLIST idList = SHBrowseForFolderA(&info); - - char temp[MAX_PATH]; - SHGetPathFromIDListA(idList, temp); - if (strlen(temp)) - { - return temp; - } - else - return ""; - } - - //--------------------------------------------------------------------------------------------------- - // function WinBrowseForFileName - //--------------------------------------------------------------------------------------------------- - bool BrowseForFileName (bool _bLoad, HWND _hParent, const char *_pTitle, - const char *_pInitialFolder, const char *_pFilter, const char *_pExtension, - std::string& _strFileName) - { - char szFile [MAX_PATH+1] = {0}; - char szFileTitle [MAX_PATH+1] = {0}; - - OPENFILENAMEA ofn; - ZeroMemory (&ofn,sizeof (ofn)); - ofn.lStructSize = sizeof (OPENFILENAME); - ofn.lpstrInitialDir = _pInitialFolder; - ofn.lpstrFilter = _pFilter; - ofn.nMaxFile = sizeof (szFile); - ofn.lpstrFile = szFile; - ofn.lpstrFileTitle = szFileTitle; - ofn.nMaxFileTitle = sizeof (szFileTitle); - ofn.lpstrDefExt = _pExtension; - ofn.hwndOwner = _hParent; - ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY; - - if (_strFileName.size () != 0) - ofn.lpstrFile = (char *)_strFileName.c_str(); - - if (((_bLoad) ? GetOpenFileNameA(&ofn) : GetSaveFileNameA(&ofn))) - { - _strFileName = ofn.lpstrFile; - return true; - } - return false; - } - - std::vector BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle, - const char *_pInitialFolder,const char *_pFilter,const char *_pExtension) - { - char szFile [MAX_PATH+1+2048*2]; - char szFileTitle [MAX_PATH+1]; - - strcpy (szFile,""); - strcpy (szFileTitle,""); - - OPENFILENAMEA ofn; - - ZeroMemory (&ofn,sizeof (ofn)); - - ofn.lStructSize = sizeof (OPENFILENAME); - ofn.lpstrInitialDir = _pInitialFolder; - ofn.lpstrFilter = _pFilter; - ofn.nMaxFile = sizeof (szFile); - ofn.lpstrFile = szFile; - ofn.lpstrFileTitle = szFileTitle; - ofn.nMaxFileTitle = sizeof (szFileTitle); - ofn.lpstrDefExt = _pExtension; - ofn.hwndOwner = _hParent; - ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT ; - - std::vector files; - - if (((_bLoad)?GetOpenFileNameA (&ofn):GetSaveFileNameA (&ofn))) - { - std::string directory = ofn.lpstrFile; - char *temp = ofn.lpstrFile; - char *oldtemp = temp; - temp+=strlen(temp)+1; - if (*temp==0) - { - //we only got one file - files.push_back(std::string(oldtemp)); - } - else - { - while (*temp) - { - files.push_back(directory+"\\"+std::string(temp)); - temp+=strlen(temp)+1; - } - } - return files; - } - return std::vector(); // empty vector; - } -} // namespace diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.h deleted file mode 100644 index bf79a53c46..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/ShellUtil.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include - - -namespace W32Util -{ - std::string BrowseForFolder(HWND parent, char *title); - bool BrowseForFileName (bool _bLoad, HWND _hParent, const char *_pTitle, - const char *_pInitialFolder,const char *_pFilter,const char *_pExtension, - std::string& _strFileName); - std::vector BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle, - const char *_pInitialFolder,const char *_pFilter,const char *_pExtension); -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.cpp deleted file mode 100644 index f674267574..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include - -#include "TabControl.h" - -namespace W32Util -{ - // __________________________________________________________________________________________________ - // constructor - // - TabControl::TabControl(HINSTANCE _hInstance, HWND _hTabCtrl,DLGPROC _lpDialogFunc) : - m_hInstance(_hInstance), - m_hTabCtrl(_hTabCtrl), - m_numDialogs(0) - { - for (int i=0; ihwndFrom == m_hTabCtrl) - { - int iPage = TabCtrl_GetCurSel (m_hTabCtrl); - SelectDialog (iPage); - } - } - } - -} - diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.h deleted file mode 100644 index 1e51b53017..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/TabControl.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -namespace W32Util -{ -#define MAX_WIN_DIALOGS 32 - - - class TabControl - { - private: - - HINSTANCE m_hInstance; - HWND m_hWndParent; - HWND m_hTabCtrl; - - HWND m_WinDialogs[MAX_WIN_DIALOGS]; - int m_numDialogs; - - public: - - TabControl(HINSTANCE _hInstance, HWND _hTabCtrl,DLGPROC _lpDialogFunc); - - ~TabControl(void); - - // - // --- tools --- - // - - HWND AddItem (char* _szText,int _iResource,DLGPROC _lpDialogFunc); - - void SelectDialog (int _nDialogId); - - void MessageHandler(UINT message, WPARAM wParam, LPARAM lParam); - }; - -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.cpp b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.cpp deleted file mode 100644 index 3aafc3d17a..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "Thread.h" - -namespace W32Util -{ - // __________________________________________________________________________________________________ - // Constructor - // - Thread::Thread ( DWORD (WINAPI * pFun) (void* arg), void* pArg) - { - _handle = CreateThread ( - 0, // Security attributes - 0, // Stack size - pFun, - pArg, - CREATE_SUSPENDED, - &_tid); - } - // __________________________________________________________________________________________________ - // Destructor - // - Thread::~Thread (void) - { - if (_handle != NULL) - { - if (CloseHandle (_handle) == FALSE) - { - Terminate(); - } - } - } - - // __________________________________________________________________________________________________ - // Resume - // - void - Thread::Resume (void) - { - if (_handle != NULL) - ResumeThread (_handle); - } - - // __________________________________________________________________________________________________ - // WaitForDeath - // - void - Thread::WaitForDeath (void) - { - if (_handle != NULL) - WaitForSingleObject (_handle, 100); - } - - // __________________________________________________________________________________________________ - // Terminate - // - void - Thread::Terminate (void) - { - if (_handle != NULL) - TerminateThread (_handle, 0); - _handle = NULL; - } - - // __________________________________________________________________________________________________ - // SetPriority - // - void - Thread::SetPriority (int _nPriority) - { - if (_handle != NULL) - SetThreadPriority(_handle, _nPriority); - } - - // __________________________________________________________________________________________________ - // Suspend - // - void - Thread::Suspend (void) - { - if (_handle != NULL) - SuspendThread(_handle); - } -} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.h b/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.h deleted file mode 100644 index b0f89ee7b9..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/W32Util/Thread.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -namespace W32Util -{ - class Thread - { - private: - HANDLE _handle; - DWORD _tid; // thread id - - public: - Thread ( DWORD (WINAPI * pFun) (void* arg), void* pArg); - ~Thread () ; - - // - // --- tools --- - // - - void Resume(void); - - void Suspend(void); - - void WaitForDeath(void); - - void Terminate(void); - - void SetPriority(int _nPriority); - - bool IsActive (void); - - HANDLE GetHandle(void) {return _handle;} - - }; - -} - diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index 589b5b19e8..c9d6c4d68f 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -52,15 +52,11 @@ GFXDebuggerDX9 *m_DebuggerFrame = NULL; #include "DlgSettings.h" #include "D3DTexture.h" #include "D3DUtil.h" -#include "W32Util/Misc.h" #include "EmuWindow.h" #include "VideoState.h" #include "XFBConvert.h" #include "render.h" - -#include "Utils.h" - HINSTANCE g_hInstance = NULL; SVideoInitialize g_VideoInitialize; PLUGIN_GLOBALS* globals = NULL; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp index 01d2f3edd7..87752e5f80 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp @@ -134,7 +134,6 @@ VERTEXSHADER* VertexShaderCache::GetShader(u32 components) } memcpy(&last_vertex_shader_uid, &uid, sizeof(VERTEXSHADERUID)); - VSCache::iterator iter = vshaders.find(uid); if (iter != vshaders.end()) {