From 0eec6f06a0186c1b865a8de737ff6cdaf5f08cf2 Mon Sep 17 00:00:00 2001 From: Aldo Fregoso Date: Sat, 23 Jul 2011 08:10:24 -0500 Subject: [PATCH] Updated RageDisplay_D3D.cpp to compile StepMania with any DirectX SDK up to August 2007 --- src/RageDisplay_D3D.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index 8dfb6974fd..fd485bee6a 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -13,17 +13,16 @@ #include "DisplayResolutions.h" #include "LocalizedString.h" -#include -#include -#include +#include +#include #include "archutils/Win32/GraphicsWindow.h" // Static libraries // load Windows D3D8 dynamically #if defined(_MSC_VER) - #pragma comment(lib, "D3dx8.lib") - #pragma comment(lib, "Dxerr8.lib") + #pragma comment(lib, "d3d8.lib") + #pragma comment(lib, "DxErr8.lib") #endif #include @@ -31,9 +30,7 @@ RString GetErrorString( HRESULT hr ) { - char szError[1024] = ""; - D3DXGetErrorString( hr, szError, sizeof(szError) ); - return szError; + return DXGetErrorString8(hr); } // Globals @@ -639,8 +636,11 @@ RageSurface* RageDisplay_D3D::CreateScreenshot() // Copy the back buffer into a surface of a type we support. IDirect3DSurface8* pCopy; g_pd3dDevice->CreateImageSurface( desc.Width, desc.Height, D3DFMT_A8R8G8B8, &pCopy ); - - D3DXLoadSurfaceFromSurface( pCopy, NULL, NULL, pSurface, NULL, NULL, D3DX_DEFAULT, 0 ); + + // Aldo_MX: D3DXLoadSurfaceFromSurface requires d3dx8core.h, I replaced it with CopyRects to + // remove this dependency so its possible to compile SM with any DirectX SDK up to Aug 2007 + //D3DXLoadSurfaceFromSurface( pCopy, NULL, NULL, pSurface, NULL, NULL, D3DX_DEFAULT, 0 ); + g_pd3dDevice->CopyRects( pSurface, NULL, 0, pCopy, NULL ); pSurface->Release();