Commit 49976571 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Introduce helpers to convert between d3d9 and wined3d scanline ordering types.

parent 5b70e332
......@@ -341,6 +341,11 @@ static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_
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)
......@@ -394,4 +399,9 @@ static inline enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3
return (enum wined3d_multisample_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 */
......@@ -1030,7 +1030,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))
......@@ -4370,7 +4370,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;
......
......@@ -525,7 +525,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;
......@@ -550,9 +550,8 @@ static HRESULT WINAPI d3d9_EnumAdapterModesEx(IDirect3D9Ex *iface,
return D3DERR_INVALIDCALL;
wined3d_mutex_lock();
hr = wined3d_output_get_mode(d3d9->wined3d_outputs[output_idx],
wined3dformat_from_d3dformat(filter->Format), filter->ScanLineOrdering, mode_idx,
&wined3d_mode);
hr = wined3d_output_get_mode(d3d9->wined3d_outputs[output_idx], wined3dformat_from_d3dformat(filter->Format),
wined3d_scanline_ordering_from_d3d(filter->ScanLineOrdering), mode_idx, &wined3d_mode);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))
......@@ -561,7 +560,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 +595,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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment