Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Hide the casts behind functions. --- dlls/d3d9/d3d9_private.h | 25 +++++++++++++ dlls/d3d9/device.c | 77 +++++++++++++++++++++++++++------------- dlls/d3d9/directx.c | 29 +++++++-------- dlls/d3d9/query.c | 14 ++++++-- dlls/d3d9/surface.c | 2 +- dlls/d3d9/swapchain.c | 2 +- dlls/d3d9/texture.c | 4 +-- 7 files changed, 109 insertions(+), 44 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index ff9a8fec0b0..e78ce75a2f0 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -336,6 +336,16 @@ static inline D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned i } }
+static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_multisample_type type) +{ + return (D3DMULTISAMPLE_TYPE)type; +} + +static inline D3DSCANLINEORDERING d3dscanlineordering_from_wined3d(enum wined3d_scanline_ordering ordering) +{ + return (D3DSCANLINEORDERING)ordering; +} + static inline unsigned int map_access_from_usage(unsigned int usage) { if (usage & D3DUSAGE_WRITEONLY) @@ -384,4 +394,19 @@ static inline DWORD wined3dusage_from_d3dusage(unsigned int usage) return usage & WINED3DUSAGE_MASK; }
+static inline enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3DMULTISAMPLE_TYPE type) +{ + return (enum wined3d_multisample_type)type; +} + +static inline enum wined3d_device_type wined3d_device_type_from_d3d(D3DDEVTYPE type) +{ + return (enum wined3d_device_type)type; +} + +static inline enum wined3d_scanline_ordering wined3d_scanline_ordering_from_d3d(D3DSCANLINEORDERING ordering) +{ + return (enum wined3d_scanline_ordering)ordering; +} + #endif /* __WINE_D3D9_PRIVATE_H */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 61cb505d77a..b74dcd48f82 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -44,7 +44,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) { @@ -108,7 +108,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) { @@ -244,7 +244,7 @@ void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *prese 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_from_wined3d(swapchain_desc->multisample_type); present_parameters->MultiSampleQuality = swapchain_desc->multisample_quality; present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect); present_parameters->hDeviceWindow = swapchain_desc->device_window; @@ -335,7 +335,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 = wined3d_multisample_type_from_d3d(present_parameters->MultiSampleType); swapchain_desc->multisample_quality = present_parameters->MultiSampleQuality; swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect); swapchain_desc->device_window = present_parameters->hDeviceWindow; @@ -551,6 +551,31 @@ void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_or } }
+static enum wined3d_texture_filter_type wined3d_texture_filter_type_from_d3d(D3DTEXTUREFILTERTYPE type) +{ + return (enum wined3d_texture_filter_type)type; +} + +static enum wined3d_transform_state wined3d_transform_state_from_d3d(D3DTRANSFORMSTATETYPE type) +{ + return (enum wined3d_transform_state)type; +} + +static enum wined3d_render_state wined3d_render_state_from_d3d(D3DRENDERSTATETYPE type) +{ + return (enum wined3d_render_state)type; +} + +static enum wined3d_sampler_state wined3d_sampler_state_from_d3d(D3DSAMPLERSTATETYPE type) +{ + return (enum wined3d_sampler_state)type; +} + +static enum wined3d_primitive_type wined3d_primitive_type_from_d3d(D3DPRIMITIVETYPE type) +{ + return (enum wined3d_primitive_type)type; +} + static void device_reset_viewport_state(struct d3d9_device *device) { struct wined3d_viewport vp; @@ -1008,7 +1033,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, wined3d_mode.height = mode->Height; wined3d_mode.refresh_rate = mode->RefreshRate; wined3d_mode.format_id = wined3dformat_from_d3dformat(mode->Format); - wined3d_mode.scanline_ordering = mode->ScanLineOrdering; + wined3d_mode.scanline_ordering = wined3d_scanline_ordering_from_d3d(mode->ScanLineOrdering); }
if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters, extended)) @@ -1522,7 +1547,8 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, unsigned i
if (user_mem) wined3d_texture_update_desc(texture, width, height, - desc.format, multisample_type, multisample_quality, user_mem, 0); + desc.format, wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, + user_mem, 0);
wined3d_texture_decref(texture);
@@ -1574,8 +1600,9 @@ static HRESULT WINAPI d3d9_device_CreateRenderTarget(IDirect3DDevice9Ex *iface, if (lockable) access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
- return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), multisample_type, - multisample_quality, 0, WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); + return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0, WINED3D_BIND_RENDER_TARGET, + access, width, height, NULL, surface); }
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex *iface, UINT width, UINT height, @@ -1606,7 +1633,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex * flags |= WINED3D_TEXTURE_CREATE_DISCARD;
return d3d9_device_create_surface(device, flags, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, 0, WINED3D_BIND_DEPTH_STENCIL, + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0, WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); }
@@ -1807,7 +1834,8 @@ static HRESULT WINAPI d3d9_device_StretchRect(IDirect3DDevice9Ex *iface, IDirect }
hr = wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, dst_rect, - src->wined3d_texture, src->sub_resource_idx, src_rect, 0, NULL, filter); + src->wined3d_texture, src->sub_resource_idx, src_rect, 0, NULL, + wined3d_texture_filter_type_from_d3d(filter)); if (hr == WINEDDERR_INVALIDRECT) hr = D3DERR_INVALIDCALL; if (SUCCEEDED(hr) && dst->texture) @@ -2136,7 +2164,8 @@ static HRESULT WINAPI d3d9_device_SetTransform(IDirect3DDevice9Ex *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, wined3d_transform_state_from_d3d(state), + (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -2166,7 +2195,7 @@ static HRESULT WINAPI d3d9_device_MultiplyTransform(IDirect3DDevice9Ex *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, wined3d_transform_state_from_d3d(state), (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -2369,7 +2398,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); - wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_stateblock_set_render_state(device->update_state, wined3d_render_state_from_d3d(state), value); if (state == D3DRS_POINTSIZE && value == D3D9_RESZ_CODE) resolve_depth_buffer(device); wined3d_mutex_unlock(); @@ -2715,7 +2744,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState(IDirect3DDev sampler -= D3DVERTEXTEXTURESAMPLER0 - WINED3D_VERTEX_SAMPLER_OFFSET;
wined3d_mutex_lock(); - wined3d_stateblock_set_sampler_state(device->update_state, sampler, state, value); + wined3d_stateblock_set_sampler_state(device->update_state, sampler, wined3d_sampler_state_from_d3d(state), value); wined3d_mutex_unlock();
return D3D_OK; @@ -2965,7 +2994,7 @@ static HRESULT WINAPI d3d9_device_DrawPrimitive(IDirect3DDevice9Ex *iface, vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count); d3d9_device_upload_sysmem_vertex_buffers(device, 0, start_vertex, vertex_count); d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count); if (SUCCEEDED(hr)) d3d9_rts_flag_auto_gen_mipmap(device); @@ -2999,7 +3028,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface d3d9_device_upload_sysmem_index_buffer(device, start_idx, index_count); d3d9_generate_auto_mipmaps(device); wined3d_stateblock_set_base_vertex_index(device->state, base_vertex_idx); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(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); if (SUCCEEDED(hr)) @@ -3108,7 +3137,7 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, goto done;
d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(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); @@ -3252,7 +3281,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vertex_stride - min_vertex_idx);
wined3d_device_apply_stateblock(device->wined3d_device, device->state); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -4254,7 +4283,7 @@ static HRESULT WINAPI d3d9_device_CreateRenderTargetEx(IDirect3DDevice9Ex *iface access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, usage & WINED3DUSAGE_MASK, + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, usage & WINED3DUSAGE_MASK, WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); }
@@ -4294,8 +4323,8 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex
*surface = NULL; return d3d9_device_create_surface(device, flags, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, usage & WINED3DUSAGE_MASK, WINED3D_BIND_DEPTH_STENCIL, - WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, usage & WINED3DUSAGE_MASK, + WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); }
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *iface, @@ -4347,7 +4376,7 @@ static HRESULT WINAPI d3d9_device_GetDisplayModeEx(IDirect3DDevice9Ex *iface, mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; @@ -4658,7 +4687,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *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, wined3d_device_type_from_d3d(device_type), focus_window, flags, 4, feature_levels, ARRAY_SIZE(feature_levels), &device->device_parent, &device->wined3d_device))) { @@ -4667,7 +4696,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine return hr; }
- wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); + wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps); d3d9_caps_from_wined3dcaps(parent, adapter, &caps, &wined3d_caps); device->max_user_clip_planes = caps.MaxUserClipPlanes; device->vs_uniform_count = caps.MaxVertexShaderConst; diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index 6c67be31b45..37adfb7a68c 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -268,8 +268,8 @@ static HRESULT WINAPI d3d9_CheckDeviceType(IDirect3D9Ex *iface, UINT adapter, D3 return WINED3DERR_NOTAVAILABLE;
wined3d_mutex_lock(); - hr = wined3d_check_device_type(d3d9->wined3d, d3d9->wined3d_outputs[output_idx], device_type, - wined3dformat_from_d3dformat(display_format), + hr = wined3d_check_device_type(d3d9->wined3d, d3d9->wined3d_outputs[output_idx], + wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(display_format), wined3dformat_from_d3dformat(backbuffer_format), windowed); wined3d_mutex_unlock();
@@ -334,13 +334,13 @@ static HRESULT WINAPI d3d9_CheckDeviceFormat(IDirect3D9Ex *iface, UINT adapter, { DWORD levels;
- hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, + hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(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(d3d9->wined3d, wined3d_adapter, device_type, + hr = wined3d_check_device_format(d3d9->wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(adapter_format), usage, bind_flags, wined3d_rtype, wined3dformat_from_d3dformat(format)); wined3d_mutex_unlock(); @@ -368,8 +368,9 @@ static HRESULT WINAPI d3d9_CheckDeviceMultiSampleType(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, - wined3dformat_from_d3dformat(format), windowed, multisample_type, levels); + hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type), + wined3dformat_from_d3dformat(format), windowed, wined3d_multisample_type_from_d3d(multisample_type), + levels); wined3d_mutex_unlock(); if (hr == WINED3DERR_NOTAVAILABLE && levels) *levels = 1; @@ -394,7 +395,7 @@ static HRESULT WINAPI d3d9_CheckDepthStencilMatch(IDirect3D9Ex *iface, UINT adap
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_check_depth_stencil_match(wined3d_adapter, device_type, + hr = wined3d_check_depth_stencil_match(wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(adapter_format), wined3dformat_from_d3dformat(rt_format), wined3dformat_from_d3dformat(ds_format)); wined3d_mutex_unlock(); @@ -418,7 +419,7 @@ static HRESULT WINAPI d3d9_CheckDeviceFormatConversion(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock(); hr = wined3d_check_device_format_conversion(d3d9->wined3d_outputs[output_idx], - device_type, wined3dformat_from_d3dformat(src_format), + wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(src_format), wined3dformat_from_d3dformat(dst_format)); wined3d_mutex_unlock();
@@ -446,7 +447,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); + hr = wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps); wined3d_mutex_unlock();
d3d9_caps_from_wined3dcaps(d3d9, adapter, caps, &wined3d_caps); @@ -525,7 +526,7 @@ static UINT WINAPI d3d9_GetAdapterModeCountEx(IDirect3D9Ex *iface,
wined3d_mutex_lock(); count = wined3d_output_get_mode_count(d3d9->wined3d_outputs[output_idx], - wined3dformat_from_d3dformat(filter->Format), filter->ScanLineOrdering); + wined3dformat_from_d3dformat(filter->Format), wined3d_scanline_ordering_from_d3d(filter->ScanLineOrdering)); wined3d_mutex_unlock();
return count; @@ -551,8 +552,8 @@ static HRESULT WINAPI d3d9_EnumAdapterModesEx(IDirect3D9Ex *iface,
wined3d_mutex_lock(); hr = wined3d_output_get_mode(d3d9->wined3d_outputs[output_idx], - wined3dformat_from_d3dformat(filter->Format), filter->ScanLineOrdering, mode_idx, - &wined3d_mode); + wined3dformat_from_d3dformat(filter->Format), wined3d_scanline_ordering_from_d3d(filter->ScanLineOrdering), + mode_idx, &wined3d_mode); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) @@ -561,7 +562,7 @@ static HRESULT WINAPI d3d9_EnumAdapterModesEx(IDirect3D9Ex *iface, mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; @@ -596,7 +597,7 @@ static HRESULT WINAPI d3d9_GetAdapterDisplayModeEx(IDirect3D9Ex *iface, mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c index e9180fb481f..207ad55e5a1 100644 --- a/dlls/d3d9/query.c +++ b/dlls/d3d9/query.c @@ -24,6 +24,16 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
+static D3DQUERYTYPE d3dquerytype_from_wined3d(enum wined3d_query_type type) +{ + return (D3DQUERYTYPE)type; +} + +static enum wined3d_query_type wined3d_query_type_from_d3d(D3DQUERYTYPE type) +{ + return (enum wined3d_query_type)type; +} + static inline struct d3d9_query *impl_from_IDirect3DQuery9(IDirect3DQuery9 *iface) { return CONTAINING_RECORD(iface, struct d3d9_query, IDirect3DQuery9_iface); @@ -98,7 +108,7 @@ static D3DQUERYTYPE WINAPI d3d9_query_GetType(IDirect3DQuery9 *iface) TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); - type = wined3d_query_get_type(query->wined3d_query); + type = d3dquerytype_from_wined3d(wined3d_query_get_type(query->wined3d_query)); wined3d_mutex_unlock();
return type; @@ -198,7 +208,7 @@ HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUER query->refcount = 1;
wined3d_mutex_lock(); - if (FAILED(hr = wined3d_query_create(device->wined3d_device, type, + if (FAILED(hr = wined3d_query_create(device->wined3d_device, wined3d_query_type_from_d3d(type), query, &d3d9_null_wined3d_parent_ops, &query->wined3d_query))) { wined3d_mutex_unlock(); diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index b74f6cacf7e..3d1fbf12f99 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -224,7 +224,7 @@ static HRESULT WINAPI d3d9_surface_GetDesc(IDirect3DSurface9 *iface, D3DSURFACE_ desc->Type = D3DRTYPE_SURFACE; desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index be9c55ac3ef..8d6cff982d3 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -320,7 +320,7 @@ static HRESULT WINAPI d3d9_swapchain_GetDisplayModeEx(IDirect3DSwapChain9Ex *ifa mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 9be9d450ba0..a8c2985c4ea 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -367,7 +367,7 @@ static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc(IDirect3DTexture9 *iface, UIN desc->Type = D3DRTYPE_SURFACE; desc->Usage = texture->usage; desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; @@ -774,7 +774,7 @@ static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc(IDirect3DCubeTexture9 *ifac desc->Type = D3DRTYPE_SURFACE; desc->Usage = texture->usage; desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height;