Skip to content

Commit

Permalink
More compatibility fixes for CXX_BUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jan 25, 2018
1 parent b0f7728 commit 8e3b376
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
30 changes: 20 additions & 10 deletions gfx/common/d3d_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,16 @@ static void *d3d_texture_new_from_file(
#if defined(HAVE_D3D9)
hr = D3DCreateTextureFromFile((LPDIRECT3DDEVICE9)dev,
path, width, height, miplevels, usage, format,
pool, filter, mipfilter, color_key, src_info_data,
(D3DPOOL)pool, filter, mipfilter, color_key,
(D3DXIMAGE_INFO*)src_info_data,
palette, (struct IDirect3DTexture9**)&buf);
#endif
break;
case GFX_CTX_DIRECT3D8_API:
#if defined(HAVE_D3D8)
hr = D3DCreateTextureFromFile((LPDIRECT3DDEVICE8)dev,
path, width, height, miplevels, usage, format,
pool, filter, mipfilter, color_key, src_info_data,
(D3DPOOL)pool, filter, mipfilter, color_key, src_info_data,
palette, (struct IDirect3DTeture8**)&buf);
#endif
break;
Expand Down Expand Up @@ -692,7 +693,8 @@ void *d3d_texture_new(void *_dev,
#ifdef HAVE_D3DX
return d3d_texture_new_from_file(_dev,
path, width, height, miplevels,
usage, (D3DFORMAT)format, pool, filter, mipfilter,
usage, (D3DFORMAT)format,
(D3DPOOL)pool, filter, mipfilter,
color_key, src_info_data, palette);
#else
return NULL;
Expand All @@ -712,11 +714,14 @@ void *d3d_texture_new(void *_dev,
#ifdef __cplusplus
hr = dev->CreateTexture(
width, height, miplevels, usage,
(D3DFORMAT)format, pool, (LPDIRECT3DTEXTURE9)&buf, NULL);
(D3DFORMAT)format,
(D3DPOOL)pool,
(struct IDirect3DTexture9**)&buf, NULL);
#else
hr = IDirect3DDevice9_CreateTexture(dev,
width, height, miplevels, usage,
(D3DFORMAT)format, pool,
(D3DFORMAT)format,
(D3DPOOL)pool,
(struct IDirect3DTexture9**)&buf, NULL);
#endif
#endif
Expand Down Expand Up @@ -998,9 +1003,12 @@ void *d3d_vertex_buffer_new(void *_dev,
}

#ifdef __cplusplus
hr = dev->CreateVertexBuffer(length, usage, fvf, pool, (LPDIRECT3DVERTEXBUFFER9*)&buf, NULL);
hr = dev->CreateVertexBuffer(length, usage, fvf,
(D3DPOOL)pool,
(LPDIRECT3DVERTEXBUFFER9*)&buf, NULL);
#else
hr = IDirect3DDevice9_CreateVertexBuffer(dev, length, usage, fvf, pool,
hr = IDirect3DDevice9_CreateVertexBuffer(dev, length, usage, fvf,
(D3DPOOL)pool,
(LPDIRECT3DVERTEXBUFFER9*)&buf, NULL);
#endif

Expand All @@ -1014,7 +1022,8 @@ void *d3d_vertex_buffer_new(void *_dev,
#ifdef __cplusplus
hr = dev->CreateVertexBuffer(length, usage, fvf, (D3DPOOL)pool, (IDirect3DVertexBuffer8**)&buf);
#else
hr = IDirect3DDevice8_CreateVertexBuffer(dev, length, usage, fvf, pool,
hr = IDirect3DDevice8_CreateVertexBuffer(dev, length, usage, fvf,
(D3DPOOL)pool,
(struct IDirect3DVertexBuffer8**)&buf);
#endif
#endif
Expand Down Expand Up @@ -2470,7 +2479,7 @@ static bool d3d_create_device_internal(
focus_window,
behavior_flags,
d3dpp,
dev)))
(IDirect3DDevice9**)dev)))
return true;
#else
if (SUCCEEDED(IDirect3D9_CreateDevice(d3d,
Expand Down Expand Up @@ -2809,7 +2818,8 @@ bool d3dx_create_font_indirect(void *_dev,
LPDIRECT3DDEVICE9 dev = (LPDIRECT3DDEVICE9)_dev;
#ifdef __cplusplus
if (SUCCEEDED(D3DCreateFontIndirect(
dev, (D3DXFONT_DESC*)desc, font_data)))
dev, (D3DXFONT_DESC*)desc,
(struct ID3DXFont**)font_data)))
return true;
#else
if (SUCCEEDED(D3DCreateFontIndirect(
Expand Down
3 changes: 3 additions & 0 deletions tasks/task_autodetect.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@
#include <ks.h>
#include <setupapi.h>
#include <hidsdi.h>

#ifndef __cplusplus
/* Why doesn't including cguid.h work to get a GUID_NULL instead? */
__attribute__((weak))
const GUID GUID_NULL = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
#endif
#endif

#include "../input/input_driver.h"
#include "../input/include/blissbox.h"
Expand Down

0 comments on commit 8e3b376

Please sign in to comment.