Skip to content

Commit

Permalink
CXX_BUILD - buildfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twinaphex committed Jan 25, 2018
1 parent 204f9aa commit b0f7728
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
23 changes: 12 additions & 11 deletions gfx/common/d3d_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ bool d3d_check_device_type(void *_d3d,
if (FAILED(d3d->CheckDeviceType(
0,
D3DDEVTYPE_HAL,
disp_format,
backbuffer_format,
(D3DFORMAT)disp_format,
(D3DFORMAT)backbuffer_format,
windowed_mode)))
return false;
#else
Expand Down Expand Up @@ -729,11 +729,11 @@ void *d3d_texture_new(void *_dev,
#ifdef __cplusplus
hr = dev->CreateTexture(
width, height, miplevels, usage,
(D3DFORMAT)format, pool, (LPDIRECT3DTEXTURE8)&buf);
(D3DFORMAT)format, (D3DPOOL)pool, (IDirect3DTexture8**)&buf);
#else
hr = IDirect3DDevice8_CreateTexture(dev,
width, height, miplevels, usage,
(D3DFORMAT)format, pool, (struct IDirect3DTexture8**)&buf);
(D3DFORMAT)format, (D3DPOOL)pool, (struct IDirect3DTexture8**)&buf);
#endif
#endif
}
Expand Down Expand Up @@ -1012,7 +1012,7 @@ void *d3d_vertex_buffer_new(void *_dev,
#ifdef HAVE_D3D8
LPDIRECT3DDEVICE8 dev = (LPDIRECT3DDEVICE8)_dev;
#ifdef __cplusplus
hr = dev->CreateVertexBuffer(length, usage, fvf, pool, &buf, NULL);
hr = dev->CreateVertexBuffer(length, usage, fvf, (D3DPOOL)pool, (IDirect3DVertexBuffer8**)&buf);
#else
hr = IDirect3DDevice8_CreateVertexBuffer(dev, length, usage, fvf, pool,
(struct IDirect3DVertexBuffer8**)&buf);
Expand Down Expand Up @@ -1099,7 +1099,7 @@ void *d3d_vertex_buffer_lock(void *vertbuf_ptr)
if (!vertbuf)
return NULL;
#ifdef __cplusplus
vertbuf->Lock(0, 0, &buf, 0);
vertbuf->Lock(0, 0, (BYTE**)&buf, 0);
#else
IDirect3DVertexBuffer8_Lock(vertbuf, 0, 0, (BYTE**)&buf, 0);
#endif
Expand Down Expand Up @@ -1576,7 +1576,7 @@ void d3d_draw_primitive(void *dev,
if (!d3d_begin_scene(dev))
return;

d3d_draw_primitive_internal(dev, type, start, count);
d3d_draw_primitive_internal(dev, (D3DPRIMITIVETYPE)type, start, count);
d3d_end_scene(dev);
}

Expand Down Expand Up @@ -2499,7 +2499,7 @@ static bool d3d_create_device_internal(
focus_window,
behavior_flags,
d3dpp,
dev)))
(IDirect3DDevice8**)dev)))
return true;
#else
if (SUCCEEDED(IDirect3D8_CreateDevice(d3d,
Expand Down Expand Up @@ -2529,13 +2529,14 @@ bool d3d_create_device(void *dev,
unsigned cur_mon_id)
{
if (!d3d_create_device_internal(dev,
d3dpp,
(D3DPRESENT_PARAMETERS*)d3dpp,
d3d,
focus_window,
cur_mon_id,
D3DCREATE_HARDWARE_VERTEXPROCESSING))
if (!d3d_create_device_internal(
dev, d3dpp, d3d, focus_window,
dev,
(D3DPRESENT_PARAMETERS*)d3dpp, d3d, focus_window,
cur_mon_id,
D3DCREATE_SOFTWARE_VERTEXPROCESSING))
return false;
Expand All @@ -2546,7 +2547,7 @@ bool d3d_reset(void *dev, void *d3dpp)
{
const char *err = NULL;

if (d3d_reset_internal(dev, d3dpp))
if (d3d_reset_internal(dev, (D3DPRESENT_PARAMETERS*)d3dpp))
return true;

RARCH_WARN("[D3D]: Attempting to recover from dead state...\n");
Expand Down
6 changes: 3 additions & 3 deletions gfx/drivers/d3d8.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static bool d3d8_renderchain_create_first_pass(void *data,
LPDIRECT3DDEVICE8 d3dr = (LPDIRECT3DDEVICE8)d3d->dev;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;

chain->vertex_buf = d3d_vertex_buffer_new(d3dr, 4 * sizeof(Vertex),
chain->vertex_buf = (LPDIRECT3DVERTEXBUFFER8)d3d_vertex_buffer_new(d3dr, 4 * sizeof(Vertex),
D3DUSAGE_WRITEONLY,
D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_DIFFUSE,
D3DPOOL_MANAGED,
Expand All @@ -110,7 +110,7 @@ static bool d3d8_renderchain_create_first_pass(void *data,
if (!chain->vertex_buf)
return false;

chain->tex = d3d_texture_new(d3dr, NULL,
chain->tex = (LPDIRECT3DTEXTURE8)d3d_texture_new(d3dr, NULL,
chain->tex_w, chain->tex_h, 1, 0,
info->rgb32
?
Expand Down Expand Up @@ -1654,7 +1654,7 @@ static void d3d8_video_texture_load_d3d(d3d_video_t *d3d,
{
D3DLOCKED_RECT d3dlr;
unsigned usage = 0;
LPDIRECT3DTEXTURE8 tex = d3d_texture_new(d3d->dev, NULL,
LPDIRECT3DTEXTURE8 tex = (LPDIRECT3DTEXTURE8)d3d_texture_new(d3d->dev, NULL,
ti->width, ti->height, 0,
usage, d3d_get_argb8888_format(),
D3DPOOL_MANAGED, 0, 0, 0,
Expand Down
2 changes: 1 addition & 1 deletion menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -5559,7 +5559,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
for (user = 0; user < MAX_USERS; user++)
{
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY_REQUEST_DEVICE_1 + user,
(enum msg_hash_enums)(MENU_ENUM_LABEL_NETPLAY_REQUEST_DEVICE_1 + user),
PARSE_ONLY_BOOL, false) != -1)
count++;
}
Expand Down

0 comments on commit b0f7728

Please sign in to comment.