(Win32 refresh) Update DirectXHelpers.cpp
The DirectInput / DirectSound version defs need to be exposed to other parts of the engine, so they are moved to the header instead of the cpp file. The includes can be consolidated after that. I'm also replacing the usage of a raw array of char *'s with an RString and using c_str() to get its value - a small change, but raw arrays are unreliable.
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "DirectXHelpers.h"
|
||||
#include "RageUtil.h"
|
||||
#include <cstdarg>
|
||||
#include <dinput.h>
|
||||
#include <d3d9.h>
|
||||
#include <mmsystem.h> // dsound.h needs this
|
||||
#include <dsound.h>
|
||||
#include <stdexcept>
|
||||
|
||||
RString GetErrorString(HRESULT hr);
|
||||
|
||||
RString hr_ssprintf( int hr, const char *fmt, ... )
|
||||
{
|
||||
@@ -9,18 +17,10 @@ RString hr_ssprintf( int hr, const char *fmt, ... )
|
||||
RString s = vssprintf( fmt, va );
|
||||
va_end(va);
|
||||
|
||||
const char *szError = GetErrorString( hr );
|
||||
return s + ssprintf( " (%s)", szError );
|
||||
RString szError = GetErrorString(hr);
|
||||
return s + ssprintf(" (%s)", szError.c_str());
|
||||
}
|
||||
|
||||
// needed for defines
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#define DIRECTSOUND_VERSION 0x0700
|
||||
#include <dinput.h>
|
||||
#include <d3d9.h>
|
||||
#include <mmsystem.h> // dsound.h needs this
|
||||
#include <dsound.h>
|
||||
|
||||
#define DXERRMSG(hrcode, dummy) case hrcode: return #hrcode;
|
||||
|
||||
RString GetErrorString(HRESULT hr)
|
||||
|
||||
@@ -7,6 +7,10 @@ RString hr_ssprintf( int hr, const char *fmt, ... );
|
||||
|
||||
RString GetErrorString(HRESULT hr);
|
||||
|
||||
// These defined need to be exposed anywhere this is included.
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#define DIRECTSOUND_VERSION 0x0700
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user