Move DEBUG_D3DRESULT macro towards XbD3D8Logging.h (in preparation for the next commit, that's going to use it)

This commit is contained in:
patrickvl 2020-04-30 14:27:17 +02:00
parent cc7e1a4069
commit ea5f494a8e
3 changed files with 12 additions and 11 deletions

View File

@ -265,15 +265,6 @@ struct EmuD3D8CreateDeviceProxyData
}
g_EmuCDPD = {0};
#define DEBUG_D3DRESULT(hRet, message) \
do { \
LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { \
if (FAILED(hRet)) \
if(g_bPrintfOn) \
printf("%s%s : %s D3D error (0x%.08X: %s)\n", _logThreadPrefix.c_str(), _logFuncPrefix.c_str(), message, hRet, D3DErrorString(hRet)); \
} \
} while (0)
// Declare trampolines
#define XB_TRAMPOLINES(XB_MACRO) \
XB_MACRO(HRESULT, WINAPI, D3DDevice_CreateVertexShader, (CONST DWORD*, CONST DWORD*, DWORD*, DWORD) ); \

View File

@ -28,6 +28,17 @@
#include "Logging.h"
#include "XbD3D8Types.h"
extern const char* D3DErrorString(HRESULT hResult); // Implemented in Direct3D9.cpp
#define DEBUG_D3DRESULT(hRet, message) \
do { \
LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { \
if (FAILED(hRet)) \
if(g_bPrintfOn) \
printf("%s%s : %s D3D error (0x%.08X: %s)\n", _logThreadPrefix.c_str(), _logFuncPrefix.c_str(), message, hRet, D3DErrorString(hRet)); \
} \
} while (0)
// Additional types, exclusively for logging (not really enums) :
enum D3DVS20CAPS : int;
enum D3DPS20CAPS : int;

View File

@ -58,6 +58,7 @@
#include "core\kernel\support\Emu.h"
#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For g_pD3DDevice, g_pXbox_PixelShader
#include "core\hle\D3D8\XbPixelShader.h"
#include "core\hle\D3D8\XbD3D8Logging.h" // For D3DErrorString()
#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup()
@ -5920,8 +5921,6 @@ static const
);
if (hRet != D3D_OK) {
extern const char *D3DErrorString(HRESULT hResult);
printf(D3DErrorString(hRet));
}
}