(d3d_common.c) Fix D3D8 codepaths

This commit is contained in:
twinaphex 2018-01-03 20:16:19 +01:00
parent 45d532b3a2
commit 5d5115941f

View File

@ -85,20 +85,11 @@ typedef HRESULT (__stdcall
LPDIRECT3DTEXTURE8* ppTexture);
#endif
#ifdef UNICODE
#define D3DXCreateFontIndirect D3DXCreateFontIndirectW
typedef HRESULT (__stdcall *D3DXCreateFontIndirect_t)
(
LPDIRECT3DDEVICE9 pDevice,
CONST D3DXFONT_DESCW* pDesc,
LPD3DXFONT* ppFont);
#else
typedef HRESULT (__stdcall
*D3DXCreateFontIndirect_t)(
LPDIRECT3DDEVICE9 pDevice,
CONST D3DXFONT_DESCA* pDesc,
LPDIRECT3DDEVICE8 pDevice,
CONST LOGFONT* pDesc,
LPD3DXFONT* ppFont);
#endif
static D3DXCreateFontIndirect_t D3DCreateFontIndirect;
static D3DCreateTextureFromFile_t D3DCreateTextureFromFile;
@ -1340,6 +1331,7 @@ bool d3d_create_font_indirect(LPDIRECT3DDEVICE dev,
void *desc, void **font_data)
{
#ifndef _XBOX
#if defined(HAVE_D3D9)
#ifdef __cplusplus
if (FAILED(D3DCreateFontIndirect(
dev, (D3DXFONT_DESC*)desc, font_data)))
@ -1350,6 +1342,12 @@ bool d3d_create_font_indirect(LPDIRECT3DDEVICE dev,
(struct ID3DXFont**)font_data)))
return false;
#endif
#elif defined(HAVE_D3D8)
if (FAILED(D3DCreateFontIndirect(
dev, (CONST LOGFONT*)desc,
(struct ID3DXFont**)font_data)))
return false;
#endif
#endif
return true;
}