pcsx2:windows: Remove DWM code

DwmEnableMMCSS doesn't seem to make a difference.
DwmSetPresentParameters is unused and is also not implemented from
Windows 8.1 onwards.
This commit is contained in:
Jonathan Li 2017-04-07 00:43:45 +01:00
parent a30a6583c1
commit cb96dec8a6
6 changed files with 0 additions and 108 deletions

View File

@ -517,7 +517,6 @@ set(pcsx2WindowsSources
gui/CpuUsageProviderMSW.cpp gui/CpuUsageProviderMSW.cpp
windows/cheats/browser.cpp windows/cheats/browser.cpp
windows/cheats/cheats.cpp windows/cheats/cheats.cpp
windows/DwmSetup.cpp
windows/FlatFileReaderWindows.cpp windows/FlatFileReaderWindows.cpp
windows/Optimus.cpp windows/Optimus.cpp
windows/PatchBrowser.cpp windows/PatchBrowser.cpp

View File

@ -490,9 +490,6 @@ bool Pcsx2App::OnInit()
InitDefaultGlobalAccelerators(); InitDefaultGlobalAccelerators();
delete wxLog::SetActiveTarget( new pxLogConsole() ); delete wxLog::SetActiveTarget( new pxLogConsole() );
#ifdef __WXMSW__
pxDwm_Load();
#endif
SysExecutorThread.Start(); SysExecutorThread.Start();
DetectCpuAndUserMode(); DetectCpuAndUserMode();
@ -656,10 +653,6 @@ void Pcsx2App::CleanupOnExit()
Console.Indent().Error( ex.FormatDiagnosticMessage() ); Console.Indent().Error( ex.FormatDiagnosticMessage() );
} }
#ifdef __WXMSW__
pxDwm_Unload();
#endif
// Notice: deleting the plugin manager (unloading plugins) here causes Lilypad to crash, // Notice: deleting the plugin manager (unloading plugins) here causes Lilypad to crash,
// likely due to some pending message in the queue that references lilypad procs. // likely due to some pending message in the queue that references lilypad procs.
// We don't need to unload plugins anyway tho -- shutdown is plenty safe enough for // We don't need to unload plugins anyway tho -- shutdown is plenty safe enough for

View File

@ -19,7 +19,3 @@
extern void MSW_SetWindowAfter( WXWidget hwnd, WXWidget hwndAfter ); extern void MSW_SetWindowAfter( WXWidget hwnd, WXWidget hwndAfter );
extern void MSW_OutputDebugString( const wxString& text ); extern void MSW_OutputDebugString( const wxString& text );
extern float MSW_GetDPIScale(); extern float MSW_GetDPIScale();
extern void pxDwm_Load();
extern void pxDwm_Unload();
extern void pxDwm_SetPresentParams( WXWidget wnd );

View File

@ -1,92 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "Utilities/Console.h"
#include "MSWstuff.h"
#include <wx/msw/wrapwin.h>
#include <wx/dynlib.h>
#include <dwmapi.h>
typedef HRESULT WINAPI Fntype_DwmEnableMMCSS(DWORD enable);
typedef HRESULT WINAPI Fntype_DwmSetPresentParameters( HWND hwnd, DWM_PRESENT_PARAMETERS *pPresentParams );
static wxDynamicLibrary lib_dwmapi;
// This could potentially reduce lag while running in Aero,
// by telling the DWM the application requires
// multimedia-class scheduling for smooth display.
void pxDwm_Load()
{
wxDoNotLogInThisScope please;
// Version test is not needed since we're using LoadLibrary. --air
/*OSVERSIONINFOEX info = {0};
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
info.dwMajorVersion = 6;
DWORDLONG mask=0;
VER_SET_CONDITION(mask,VER_MAJORVERSION, VER_GREATER_EQUAL);
VER_SET_CONDITION(mask,VER_MINORVERSION, VER_GREATER_EQUAL);
VER_SET_CONDITION(mask,VER_SERVICEPACKMAJOR,VER_GREATER_EQUAL);
VER_SET_CONDITION(mask,VER_SERVICEPACKMINOR,VER_GREATER_EQUAL);
//info
if(VerifyVersionInfo(&info,
VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR|VER_SERVICEPACKMINOR,
mask))*/
lib_dwmapi.Load( L"dwmapi.dll" );
if( !lib_dwmapi.IsLoaded() ) return;
if( Fntype_DwmEnableMMCSS* pDwmEnableMMCSS = (Fntype_DwmEnableMMCSS*)lib_dwmapi.GetSymbol(L"DwmEnableMMCSS") )
{
Console.WriteLn( "[Dwm] Desktop Window Manager detected." );
// Seems to set the Windows timer resolution to 10ms
if(FAILED(pDwmEnableMMCSS(TRUE)))
Console.WriteLn("[Dwm] DwmEnableMMCSS returned a failure code.");
}
}
// wnd - this parameter should be the GS display panel or the top level frame that holds it (not
// sure if it's supposed to be the actual gsPanel or the top level window/frame that the
// panel belongs to)
//
void pxDwm_SetPresentParams( WXWidget wnd )
{
if( !lib_dwmapi.IsLoaded() ) return;
Fntype_DwmSetPresentParameters* pDwmSetPresentParameters = (Fntype_DwmSetPresentParameters*)lib_dwmapi.GetSymbol(L"DwmSetPresentParameters");
if( pDwmSetPresentParameters == NULL ) return;
DWM_PRESENT_PARAMETERS params;
params.cbSize = sizeof(DWM_PRESENT_PARAMETERS);
params.fQueue = FALSE;
if(FAILED(pDwmSetPresentParameters( (HWND)wnd, &params )))
Console.WriteLn("[Dwm] DwmSetPresentParameters returned a failure code.");
//DwmSetDxFrameDuration(hMainWindow,1);
}
void pxDwm_Unload()
{
lib_dwmapi.Unload();
}

View File

@ -394,7 +394,6 @@
<ClCompile Include="..\..\gui\Panels\PluginSelectorPanel.cpp" /> <ClCompile Include="..\..\gui\Panels\PluginSelectorPanel.cpp" />
<ClCompile Include="..\..\gui\Panels\SpeedhacksPanel.cpp" /> <ClCompile Include="..\..\gui\Panels\SpeedhacksPanel.cpp" />
<ClCompile Include="..\..\gui\Panels\VideoPanel.cpp" /> <ClCompile Include="..\..\gui\Panels\VideoPanel.cpp" />
<ClCompile Include="..\DwmSetup.cpp" />
<ClCompile Include="..\WinCompressNTFS.cpp" /> <ClCompile Include="..\WinCompressNTFS.cpp" />
<ClCompile Include="..\WinConsolePipe.cpp" /> <ClCompile Include="..\WinConsolePipe.cpp" />
<ClCompile Include="..\..\Linux\LnxKeyCodes.cpp"> <ClCompile Include="..\..\Linux\LnxKeyCodes.cpp">

View File

@ -716,9 +716,6 @@
<ClCompile Include="..\..\gui\Panels\VideoPanel.cpp"> <ClCompile Include="..\..\gui\Panels\VideoPanel.cpp">
<Filter>AppHost\Panels</Filter> <Filter>AppHost\Panels</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\DwmSetup.cpp">
<Filter>AppHost\Win32</Filter>
</ClCompile>
<ClCompile Include="..\WinCompressNTFS.cpp"> <ClCompile Include="..\WinCompressNTFS.cpp">
<Filter>AppHost\Win32</Filter> <Filter>AppHost\Win32</Filter>
</ClCompile> </ClCompile>