From: Charles Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/d3d8/device.c | 34 ++++++++++++++++++---------------- dlls/d3d8/directx.c | 12 ++++++------ dlls/d3d8/surface.c | 2 +- dlls/d3d8/texture.c | 4 ++-- 4 files changed, 27 insertions(+), 25 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 23e93df0616..2ecbcf25502 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -35,7 +35,7 @@ D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) BYTE *c = (BYTE *)&format;
/* Don't translate FOURCC formats */ - if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format; + if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return (D3DFORMAT)format;
switch(format) { @@ -85,7 +85,7 @@ enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) BYTE *c = (BYTE *)&format;
/* Don't translate FOURCC formats */ - if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format; + if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return (enum wined3d_format_id)format;
switch(format) { @@ -204,7 +204,7 @@ static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS present_parameters->BackBufferHeight = swapchain_desc->backbuffer_height; present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc->backbuffer_format); present_parameters->BackBufferCount = swapchain_desc->backbuffer_count; - present_parameters->MultiSampleType = swapchain_desc->multisample_type; + present_parameters->MultiSampleType = (D3DMULTISAMPLE_TYPE)swapchain_desc->multisample_type; present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect); present_parameters->hDeviceWindow = swapchain_desc->device_window; present_parameters->Windowed = swapchain_desc->windowed; @@ -291,7 +291,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount); swapchain_desc->backbuffer_bind_flags = WINED3D_BIND_RENDER_TARGET; - swapchain_desc->multisample_type = present_parameters->MultiSampleType; + swapchain_desc->multisample_type = (enum wined3d_multisample_type)present_parameters->MultiSampleType; swapchain_desc->multisample_quality = 0; /* d3d9 only */ swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect); swapchain_desc->device_window = present_parameters->hDeviceWindow; @@ -1241,7 +1241,8 @@ static HRESULT WINAPI d3d8_device_CreateRenderTarget(IDirect3DDevice8 *iface, UI access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
return d3d8_device_create_surface(device, wined3dformat_from_d3dformat(format), - multisample_type, WINED3D_BIND_RENDER_TARGET, access, width, height, surface); + (enum wined3d_multisample_type)multisample_type, WINED3D_BIND_RENDER_TARGET, access, + width, height, surface); }
static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *iface, @@ -1259,7 +1260,7 @@ static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *if *surface = NULL;
return d3d8_device_create_surface(device, wined3dformat_from_d3dformat(format), - multisample_type, WINED3D_BIND_DEPTH_STENCIL, + (enum wined3d_multisample_type)multisample_type, WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, surface); }
@@ -1621,7 +1622,7 @@ static HRESULT WINAPI d3d8_device_SetTransform(IDirect3DDevice8 *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_set_transform(device->update_state, state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_set_transform(device->update_state, (enum wined3d_transform_state)state, (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -1651,7 +1652,7 @@ static HRESULT WINAPI d3d8_device_MultiplyTransform(IDirect3DDevice8 *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_multiply_transform(device->state, state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_multiply_transform(device->state, (enum wined3d_transform_state)state, (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -1871,13 +1872,14 @@ static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, D3DRENDERSTATETYPE state, DWORD value) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); + enum wined3d_render_state wined3d_state = (enum wined3d_render_state)state;
TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); if (state == D3DRS_ZBIAS) - state = WINED3D_RS_DEPTHBIAS; - wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_state = WINED3D_RS_DEPTHBIAS; + wined3d_stateblock_set_render_state(device->update_state, wined3d_state, value); if (state == D3DRS_POINTSIZE && value == D3D8_RESZ_CODE) resolve_depth_buffer(device); wined3d_mutex_unlock(); @@ -2439,7 +2441,7 @@ static HRESULT WINAPI d3d8_device_DrawPrimitive(IDirect3DDevice8 *iface, vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count); wined3d_mutex_lock(); d3d8_device_upload_sysmem_vertex_buffers(device, start_vertex, vertex_count); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count); wined3d_mutex_unlock(); @@ -2464,7 +2466,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface, base_vertex_index = device->stateblock_state->base_vertex_index; d3d8_device_upload_sysmem_vertex_buffers(device, base_vertex_index + min_vertex_idx, vertex_count); d3d8_device_upload_sysmem_index_buffer(device, start_idx, index_count); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); wined3d_mutex_unlock(); @@ -2558,7 +2560,7 @@ static HRESULT WINAPI d3d8_device_DrawPrimitiveUP(IDirect3DDevice8 *iface, if (FAILED(hr)) goto done;
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count); wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -2686,7 +2688,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface wined3dformat_from_d3dformat(index_format)); wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vertex_stride - min_vertex_idx);
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
@@ -3694,7 +3696,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(parent->wined3d_outputs[output_idx]); - if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, device_type, + if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, (enum wined3d_device_type)device_type, focus_window, flags, 4, feature_levels, ARRAY_SIZE(feature_levels), &device->device_parent, &device->wined3d_device))) { @@ -3704,7 +3706,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine return hr; }
- wined3d_get_device_caps(wined3d_adapter, device_type, &caps); + wined3d_get_device_caps(wined3d_adapter, (enum wined3d_device_type)device_type, &caps); device->max_user_clip_planes = caps.MaxUserClipPlanes; device->vs_uniform_count = caps.MaxVertexShaderConst;
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 509a76239d6..aca3c5ad4c7 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -234,7 +234,7 @@ static HRESULT WINAPI d3d8_CheckDeviceType(IDirect3D8 *iface, UINT adapter, D3DD return WINED3DERR_NOTAVAILABLE;
wined3d_mutex_lock(); - hr = wined3d_check_device_type(d3d8->wined3d, d3d8->wined3d_outputs[output_idx], device_type, + hr = wined3d_check_device_type(d3d8->wined3d, d3d8->wined3d_outputs[output_idx], (enum wined3d_device_type)device_type, wined3dformat_from_d3dformat(display_format), wined3dformat_from_d3dformat(backbuffer_format), windowed); wined3d_mutex_unlock(); @@ -300,13 +300,13 @@ static HRESULT WINAPI d3d8_CheckDeviceFormat(IDirect3D8 *iface, UINT adapter, D3 { DWORD levels;
- hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, + hr = wined3d_check_device_multisample_type(wined3d_adapter, (enum wined3d_device_type)device_type, WINED3DFMT_D24_UNORM_S8_UINT, FALSE, WINED3D_MULTISAMPLE_NON_MASKABLE, &levels); if (SUCCEEDED(hr) && !levels) hr = D3DERR_NOTAVAILABLE; } else - hr = wined3d_check_device_format(d3d8->wined3d, wined3d_adapter, device_type, + hr = wined3d_check_device_format(d3d8->wined3d, wined3d_adapter, (enum wined3d_device_type)device_type, wined3dformat_from_d3dformat(adapter_format), usage, bind_flags, wined3d_rtype, wined3dformat_from_d3dformat(format)); wined3d_mutex_unlock(); @@ -334,7 +334,7 @@ static HRESULT WINAPI d3d8_CheckDeviceMultiSampleType(IDirect3D8 *iface, UINT ad
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]); - hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, + hr = wined3d_check_device_multisample_type(wined3d_adapter, (enum wined3d_device_type)device_type, wined3dformat_from_d3dformat(format), windowed, (enum wined3d_multisample_type)multisample_type, NULL); wined3d_mutex_unlock(); @@ -359,7 +359,7 @@ static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapte
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]); - hr = wined3d_check_depth_stencil_match(wined3d_adapter, device_type, + hr = wined3d_check_depth_stencil_match(wined3d_adapter, (enum wined3d_device_type)device_type, wined3dformat_from_d3dformat(adapter_format), wined3dformat_from_d3dformat(rt_format), wined3dformat_from_d3dformat(ds_format)); wined3d_mutex_unlock(); @@ -386,7 +386,7 @@ static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEV
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]); - hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); + hr = wined3d_get_device_caps(wined3d_adapter, (enum wined3d_device_type)device_type, &wined3d_caps); wined3d_mutex_unlock();
d3dcaps_from_wined3dcaps(caps, &wined3d_caps, adapter); diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index bbd7e38338b..53a4e498b96 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -193,7 +193,7 @@ static HRESULT WINAPI d3d8_surface_GetDesc(IDirect3DSurface8 *iface, D3DSURFACE_ desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); desc->Size = wined3d_desc.size; - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = (D3DMULTISAMPLE_TYPE)wined3d_desc.multisample_type; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height;
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index c82a75d87a4..35bf85de94c 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -255,7 +255,7 @@ static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UIN desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); desc->Size = wined3d_desc.size; - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = (D3DMULTISAMPLE_TYPE)wined3d_desc.multisample_type; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; } @@ -602,7 +602,7 @@ static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc(IDirect3DCubeTexture8 *ifac desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); desc->Size = wined3d_desc.size; - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = (D3DMULTISAMPLE_TYPE)wined3d_desc.multisample_type; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; }