From: Chip Davis cdavis@codeweavers.com
Signed-off-by: Chip Davis cdavis@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/d3d8/d3d8_private.h | 5 +++++ dlls/d3d8/device.c | 14 ++++++++++---- dlls/d3d8/surface.c | 2 +- dlls/d3d8/texture.c | 4 ++-- 4 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 93526411767..7e772c2b99b 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -369,4 +369,9 @@ static inline unsigned int wined3d_bind_flags_from_d3d8_usage(DWORD usage) return bind_flags; }
+static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_multisample_type type) +{ + return (D3DMULTISAMPLE_TYPE)type; +} + #endif /* __WINE_D3DX8_PRIVATE_H */ diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 23e93df0616..08076228e2a 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -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_from_wined3d(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; @@ -255,6 +255,11 @@ static enum wined3d_swap_interval wined3dswapinterval_from_d3d(DWORD interval) } }
+static enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3DMULTISAMPLE_TYPE type) +{ + return (enum wined3d_multisample_type)type; +} + static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters) { @@ -291,7 +296,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 = 0; /* d3d9 only */ swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect); swapchain_desc->device_window = present_parameters->hDeviceWindow; @@ -1241,7 +1246,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); + wined3d_multisample_type_from_d3d(multisample_type), + WINED3D_BIND_RENDER_TARGET, access, width, height, surface); }
static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *iface, @@ -1259,7 +1265,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, + wined3d_multisample_type_from_d3d(multisample_type), WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, surface); }
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index bbd7e38338b..c3d28efba20 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_from_wined3d(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..f383b374bde 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_from_wined3d(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_from_wined3d(wined3d_desc.multisample_type); desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; }