Updated RageDisplay_D3D.cpp to compile StepMania with any DirectX SDK up to August 2007

This commit is contained in:
Aldo Fregoso
2011-07-23 08:10:24 -05:00
parent 1291121250
commit 0eec6f06a0
+10 -10
View File
@@ -13,17 +13,16 @@
#include "DisplayResolutions.h" #include "DisplayResolutions.h"
#include "LocalizedString.h" #include "LocalizedString.h"
#include <D3D8.h> #include <d3d8.h>
#include <D3dx8math.h> #include <dxerr8.h>
#include <D3DX8Core.h>
#include "archutils/Win32/GraphicsWindow.h" #include "archutils/Win32/GraphicsWindow.h"
// Static libraries // Static libraries
// load Windows D3D8 dynamically // load Windows D3D8 dynamically
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma comment(lib, "D3dx8.lib") #pragma comment(lib, "d3d8.lib")
#pragma comment(lib, "Dxerr8.lib") #pragma comment(lib, "DxErr8.lib")
#endif #endif
#include <math.h> #include <math.h>
@@ -31,9 +30,7 @@
RString GetErrorString( HRESULT hr ) RString GetErrorString( HRESULT hr )
{ {
char szError[1024] = ""; return DXGetErrorString8(hr);
D3DXGetErrorString( hr, szError, sizeof(szError) );
return szError;
} }
// Globals // Globals
@@ -639,8 +636,11 @@ RageSurface* RageDisplay_D3D::CreateScreenshot()
// Copy the back buffer into a surface of a type we support. // Copy the back buffer into a surface of a type we support.
IDirect3DSurface8* pCopy; IDirect3DSurface8* pCopy;
g_pd3dDevice->CreateImageSurface( desc.Width, desc.Height, D3DFMT_A8R8G8B8, &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(); pSurface->Release();