Commit 18a7653c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WINED3DDISPLAYMODE typedef.

parent 7cce4453
...@@ -422,7 +422,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(IDirect3DDevice8 *ifac ...@@ -422,7 +422,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(IDirect3DDevice8 *ifac
TRACE("iface %p, mode %p.\n", iface, pMode); TRACE("iface %p, mode %p.\n", iface, pMode);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_display_mode(This->wined3d_device, 0, (WINED3DDISPLAYMODE *)pMode); hr = wined3d_device_get_display_mode(This->wined3d_device, 0, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
......
...@@ -175,7 +175,8 @@ static HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Ad ...@@ -175,7 +175,8 @@ static HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Ad
iface, Adapter, Mode, pMode); iface, Adapter, Mode, pMode);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_enum_adapter_modes(This->WineD3D, Adapter, WINED3DFMT_UNKNOWN, Mode, (WINED3DDISPLAYMODE *)pMode); hr = wined3d_enum_adapter_modes(This->WineD3D, Adapter, WINED3DFMT_UNKNOWN,
Mode, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
...@@ -193,7 +194,7 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UI ...@@ -193,7 +194,7 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UI
iface, Adapter, pMode); iface, Adapter, pMode);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_get_adapter_display_mode(This->WineD3D, Adapter, (WINED3DDISPLAYMODE *)pMode); hr = wined3d_get_adapter_display_mode(This->WineD3D, Adapter, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
......
...@@ -371,7 +371,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(IDirect3DDevice9Ex *if ...@@ -371,7 +371,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(IDirect3DDevice9Ex *if
TRACE("iface %p, swapchain %u, mode %p.\n", iface, iSwapChain, pMode); TRACE("iface %p, swapchain %u, mode %p.\n", iface, iSwapChain, pMode);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_display_mode(This->wined3d_device, iSwapChain, (WINED3DDISPLAYMODE *)pMode); hr = wined3d_device_get_display_mode(This->wined3d_device, iSwapChain, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
......
...@@ -185,7 +185,7 @@ static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(IDirect3D9Ex *iface, UINT ...@@ -185,7 +185,7 @@ static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_enum_adapter_modes(This->WineD3D, Adapter, wined3dformat_from_d3dformat(Format), hr = wined3d_enum_adapter_modes(This->WineD3D, Adapter, wined3dformat_from_d3dformat(Format),
Mode, (WINED3DDISPLAYMODE *) pMode); Mode, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
...@@ -202,7 +202,7 @@ static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(IDirect3D9Ex *iface, ...@@ -202,7 +202,7 @@ static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(IDirect3D9Ex *iface,
TRACE("iface %p, adapter %u, mode %p.\n", iface, Adapter, pMode); TRACE("iface %p, adapter %u, mode %p.\n", iface, Adapter, pMode);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_get_adapter_display_mode(This->WineD3D, Adapter, (WINED3DDISPLAYMODE *)pMode); hr = wined3d_get_adapter_display_mode(This->WineD3D, Adapter, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
......
...@@ -159,7 +159,7 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN ...@@ -159,7 +159,7 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN
TRACE("iface %p, mode %p.\n", iface, pMode); TRACE("iface %p, mode %p.\n", iface, pMode);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_swapchain_get_display_mode(This->wined3d_swapchain, (WINED3DDISPLAYMODE *)pMode); hr = wined3d_swapchain_get_display_mode(This->wined3d_swapchain, (struct wined3d_display_mode *)pMode);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format); if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
......
...@@ -1053,8 +1053,8 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, ...@@ -1053,8 +1053,8 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
void *Arg) void *Arg)
{ {
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface); IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
struct wined3d_display_mode mode;
HRESULT hr; HRESULT hr;
WINED3DDISPLAYMODE mode;
unsigned int i; unsigned int i;
static const enum wined3d_format_id FormatList[] = static const enum wined3d_format_id FormatList[] =
...@@ -1107,7 +1107,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, ...@@ -1107,7 +1107,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i) for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i)
{ {
hr = wined3d_check_device_format(This->ddraw->wineD3D, WINED3DADAPTER_DEFAULT, WINED3DDEVTYPE_HAL, hr = wined3d_check_device_format(This->ddraw->wineD3D, WINED3DADAPTER_DEFAULT, WINED3DDEVTYPE_HAL,
mode.Format, 0, WINED3DRTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL); mode.format_id, 0, WINED3DRTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL);
if (hr == D3D_OK) if (hr == D3D_OK)
{ {
DDPIXELFORMAT pformat; DDPIXELFORMAT pformat;
...@@ -1130,7 +1130,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, ...@@ -1130,7 +1130,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
for (i = 0; i < sizeof(BumpFormatList) / sizeof(*BumpFormatList); ++i) for (i = 0; i < sizeof(BumpFormatList) / sizeof(*BumpFormatList); ++i)
{ {
hr = wined3d_check_device_format(This->ddraw->wineD3D, WINED3DADAPTER_DEFAULT, hr = wined3d_check_device_format(This->ddraw->wineD3D, WINED3DADAPTER_DEFAULT,
WINED3DDEVTYPE_HAL, mode.Format, WINED3DUSAGE_QUERY_LEGACYBUMPMAP, WINED3DDEVTYPE_HAL, mode.format_id, WINED3DUSAGE_QUERY_LEGACYBUMPMAP,
WINED3DRTYPE_TEXTURE, BumpFormatList[i], SURFACE_OPENGL); WINED3DRTYPE_TEXTURE, BumpFormatList[i], SURFACE_OPENGL);
if (hr == D3D_OK) if (hr == D3D_OK)
{ {
...@@ -1205,9 +1205,9 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface, ...@@ -1205,9 +1205,9 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
void *Arg) void *Arg)
{ {
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice2(iface); IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice2(iface);
struct wined3d_display_mode mode;
HRESULT hr; HRESULT hr;
unsigned int i; unsigned int i;
WINED3DDISPLAYMODE mode;
static const enum wined3d_format_id FormatList[] = static const enum wined3d_format_id FormatList[] =
{ {
...@@ -1246,7 +1246,7 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface, ...@@ -1246,7 +1246,7 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i) for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i)
{ {
hr = wined3d_check_device_format(This->ddraw->wineD3D, 0, WINED3DDEVTYPE_HAL, hr = wined3d_check_device_format(This->ddraw->wineD3D, 0, WINED3DDEVTYPE_HAL,
mode.Format, 0, WINED3DRTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL); mode.format_id, 0, WINED3DRTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL);
if (hr == D3D_OK) if (hr == D3D_OK)
{ {
DDSURFACEDESC sdesc; DDSURFACEDESC sdesc;
......
...@@ -160,7 +160,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa ...@@ -160,7 +160,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
for (i = 0; i < *mode_count; ++i) for (i = 0; i < *mode_count; ++i)
{ {
WINED3DDISPLAYMODE mode; struct wined3d_display_mode mode;
HRESULT hr; HRESULT hr;
hr = wined3d_enum_adapter_modes(wined3d, This->adapter->ordinal, wined3d_format, i, &mode); hr = wined3d_enum_adapter_modes(wined3d, This->adapter->ordinal, wined3d_format, i, &mode);
...@@ -172,9 +172,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa ...@@ -172,9 +172,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
return hr; return hr;
} }
desc[i].Width = mode.Width; desc[i].Width = mode.width;
desc[i].Height = mode.Height; desc[i].Height = mode.height;
desc[i].RefreshRate.Numerator = mode.RefreshRate; desc[i].RefreshRate.Numerator = mode.refresh_rate;
desc[i].RefreshRate.Denominator = 1; desc[i].RefreshRate.Denominator = 1;
desc[i].Format = format; desc[i].Format = format;
desc[i].ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; /* FIXME */ desc[i].ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; /* FIXME */
......
...@@ -1586,16 +1586,16 @@ void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device) ...@@ -1586,16 +1586,16 @@ void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device)
} }
HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device, HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device,
UINT swapchain_idx, const WINED3DDISPLAYMODE *mode) UINT swapchain_idx, const struct wined3d_display_mode *mode)
{ {
struct wined3d_adapter *adapter = device->adapter; struct wined3d_adapter *adapter = device->adapter;
const struct wined3d_format *format = wined3d_get_format(&adapter->gl_info, mode->Format); const struct wined3d_format *format = wined3d_get_format(&adapter->gl_info, mode->format_id);
DEVMODEW devmode; DEVMODEW devmode;
LONG ret; LONG ret;
RECT clip_rc; RECT clip_rc;
TRACE("device %p, swapchain_idx %u, mode %p (%ux%u@%u %s).\n", device, swapchain_idx, mode, TRACE("device %p, swapchain_idx %u, mode %p (%ux%u@%u %s).\n", device, swapchain_idx, mode,
mode->Width, mode->Height, mode->RefreshRate, debug_d3dformat(mode->Format)); mode->width, mode->height, mode->refresh_rate, debug_d3dformat(mode->format_id));
/* Resize the screen even without a window: /* Resize the screen even without a window:
* The app could have unset it with SetCooperativeLevel, but not called * The app could have unset it with SetCooperativeLevel, but not called
...@@ -1607,16 +1607,16 @@ HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device, ...@@ -1607,16 +1607,16 @@ HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device,
devmode.dmSize = sizeof(devmode); devmode.dmSize = sizeof(devmode);
devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
devmode.dmBitsPerPel = format->byte_count * CHAR_BIT; devmode.dmBitsPerPel = format->byte_count * CHAR_BIT;
devmode.dmPelsWidth = mode->Width; devmode.dmPelsWidth = mode->width;
devmode.dmPelsHeight = mode->Height; devmode.dmPelsHeight = mode->height;
devmode.dmDisplayFrequency = mode->RefreshRate; devmode.dmDisplayFrequency = mode->refresh_rate;
if (mode->RefreshRate) if (mode->refresh_rate)
devmode.dmFields |= DM_DISPLAYFREQUENCY; devmode.dmFields |= DM_DISPLAYFREQUENCY;
/* Only change the mode if necessary */ /* Only change the mode if necessary */
if (adapter->screen_size.cx == mode->Width && adapter->screen_size.cy == mode->Height if (adapter->screen_size.cx == mode->width && adapter->screen_size.cy == mode->height
&& adapter->screen_format == mode->Format && !mode->RefreshRate) && adapter->screen_format == mode->format_id && !mode->refresh_rate)
return WINED3D_OK; return WINED3D_OK;
ret = ChangeDisplaySettingsExW(NULL, &devmode, NULL, CDS_FULLSCREEN, NULL); ret = ChangeDisplaySettingsExW(NULL, &devmode, NULL, CDS_FULLSCREEN, NULL);
...@@ -1635,12 +1635,12 @@ HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device, ...@@ -1635,12 +1635,12 @@ HRESULT CDECL wined3d_device_set_display_mode(struct wined3d_device *device,
} }
/* Store the new values */ /* Store the new values */
adapter->screen_size.cx = mode->Width; adapter->screen_size.cx = mode->width;
adapter->screen_size.cy = mode->Height; adapter->screen_size.cy = mode->height;
adapter->screen_format = mode->Format; adapter->screen_format = mode->format_id;
/* And finally clip mouse to our screen */ /* And finally clip mouse to our screen */
SetRect(&clip_rc, 0, 0, mode->Width, mode->Height); SetRect(&clip_rc, 0, 0, mode->width, mode->height);
ClipCursor(&clip_rc); ClipCursor(&clip_rc);
return WINED3D_OK; return WINED3D_OK;
...@@ -3882,7 +3882,7 @@ HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device ...@@ -3882,7 +3882,7 @@ HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device
} }
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device,
UINT swapchain_idx, WINED3DDISPLAYMODE *mode) UINT swapchain_idx, struct wined3d_display_mode *mode)
{ {
struct wined3d_swapchain *swapchain; struct wined3d_swapchain *swapchain;
HRESULT hr; HRESULT hr;
...@@ -3909,10 +3909,10 @@ HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *devic ...@@ -3909,10 +3909,10 @@ HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *devic
* *
* Also don't relay to the swapchain because with ddraw it's possible * Also don't relay to the swapchain because with ddraw it's possible
* that there isn't a swapchain at all. */ * that there isn't a swapchain at all. */
mode->Width = adapter->screen_size.cx; mode->width = adapter->screen_size.cx;
mode->Height = adapter->screen_size.cy; mode->height = adapter->screen_size.cy;
mode->Format = adapter->screen_format; mode->format_id = adapter->screen_format;
mode->RefreshRate = 0; mode->refresh_rate = 0;
hr = WINED3D_OK; hr = WINED3D_OK;
} }
...@@ -5269,8 +5269,8 @@ static HRESULT updateSurfaceDesc(struct wined3d_surface *surface, ...@@ -5269,8 +5269,8 @@ static HRESULT updateSurfaceDesc(struct wined3d_surface *surface,
static BOOL is_display_mode_supported(const struct wined3d_device *device, const WINED3DPRESENT_PARAMETERS *pp) static BOOL is_display_mode_supported(const struct wined3d_device *device, const WINED3DPRESENT_PARAMETERS *pp)
{ {
struct wined3d_display_mode m;
UINT i, count; UINT i, count;
WINED3DDISPLAYMODE m;
HRESULT hr; HRESULT hr;
/* All Windowed modes are supported, as is leaving the current mode */ /* All Windowed modes are supported, as is leaving the current mode */
...@@ -5285,7 +5285,7 @@ static BOOL is_display_mode_supported(const struct wined3d_device *device, const ...@@ -5285,7 +5285,7 @@ static BOOL is_display_mode_supported(const struct wined3d_device *device, const
hr = wined3d_enum_adapter_modes(device->wined3d, device->adapter->ordinal, WINED3DFMT_UNKNOWN, i, &m); hr = wined3d_enum_adapter_modes(device->wined3d, device->adapter->ordinal, WINED3DFMT_UNKNOWN, i, &m);
if (FAILED(hr)) if (FAILED(hr))
ERR("Failed to enumerate adapter mode.\n"); ERR("Failed to enumerate adapter mode.\n");
if (m.Width == pp->BackBufferWidth && m.Height == pp->BackBufferHeight) if (m.width == pp->BackBufferWidth && m.height == pp->BackBufferHeight)
/* Mode found, it is supported. */ /* Mode found, it is supported. */
return TRUE; return TRUE;
} }
...@@ -5416,9 +5416,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, ...@@ -5416,9 +5416,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{ {
struct wined3d_resource *resource, *cursor; struct wined3d_resource *resource, *cursor;
struct wined3d_swapchain *swapchain; struct wined3d_swapchain *swapchain;
struct wined3d_display_mode mode;
BOOL DisplayModeChanged = FALSE; BOOL DisplayModeChanged = FALSE;
BOOL update_desc = FALSE; BOOL update_desc = FALSE;
WINED3DDISPLAYMODE mode;
unsigned int i; unsigned int i;
HRESULT hr; HRESULT hr;
...@@ -5544,17 +5544,17 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, ...@@ -5544,17 +5544,17 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (present_parameters->Windowed) if (present_parameters->Windowed)
{ {
mode.Width = swapchain->orig_width; mode.width = swapchain->orig_width;
mode.Height = swapchain->orig_height; mode.height = swapchain->orig_height;
mode.RefreshRate = 0; mode.refresh_rate = 0;
mode.Format = swapchain->presentParms.BackBufferFormat; mode.format_id = swapchain->presentParms.BackBufferFormat;
} }
else else
{ {
mode.Width = present_parameters->BackBufferWidth; mode.width = present_parameters->BackBufferWidth;
mode.Height = present_parameters->BackBufferHeight; mode.height = present_parameters->BackBufferHeight;
mode.RefreshRate = present_parameters->FullScreen_RefreshRateInHz; mode.refresh_rate = present_parameters->FullScreen_RefreshRateInHz;
mode.Format = swapchain->presentParms.BackBufferFormat; mode.format_id = swapchain->presentParms.BackBufferFormat;
} }
/* Should Width == 800 && Height == 0 set 800x600? */ /* Should Width == 800 && Height == 0 set 800x600? */
...@@ -5893,9 +5893,9 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, ...@@ -5893,9 +5893,9 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
{ {
struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx]; struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
const struct fragment_pipeline *fragment_pipeline; const struct fragment_pipeline *fragment_pipeline;
struct wined3d_display_mode mode;
struct shader_caps shader_caps; struct shader_caps shader_caps;
struct fragment_caps ffp_caps; struct fragment_caps ffp_caps;
WINED3DDISPLAYMODE mode;
unsigned int i; unsigned int i;
HRESULT hr; HRESULT hr;
...@@ -5916,9 +5916,9 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, ...@@ -5916,9 +5916,9 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
wined3d_decref(device->wined3d); wined3d_decref(device->wined3d);
return hr; return hr;
} }
adapter->screen_size.cx = mode.Width; adapter->screen_size.cx = mode.width;
adapter->screen_size.cy = mode.Height; adapter->screen_size.cy = mode.height;
adapter->screen_format = mode.Format; adapter->screen_format = mode.format_id;
/* Save the creation parameters. */ /* Save the creation parameters. */
device->createParms.AdapterOrdinal = adapter_idx; device->createParms.AdapterOrdinal = adapter_idx;
......
...@@ -2903,7 +2903,7 @@ UINT CDECL wined3d_get_adapter_mode_count(const struct wined3d *wined3d, UINT ad ...@@ -2903,7 +2903,7 @@ UINT CDECL wined3d_get_adapter_mode_count(const struct wined3d *wined3d, UINT ad
/* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */ /* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx, HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx,
enum wined3d_format_id format_id, UINT mode_idx, WINED3DDISPLAYMODE *mode) enum wined3d_format_id format_id, UINT mode_idx, struct wined3d_display_mode *mode)
{ {
TRACE_(d3d_caps)("wined3d %p, adapter_idx %u, format %s, mode_idx %u, mode %p.\n", TRACE_(d3d_caps)("wined3d %p, adapter_idx %u, format %s, mode_idx %u, mode %p.\n",
wined3d, adapter_idx, debug_d3dformat(format_id), mode_idx, mode); wined3d, adapter_idx, debug_d3dformat(format_id), mode_idx, mode);
...@@ -2954,16 +2954,16 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada ...@@ -2954,16 +2954,16 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
/* Now get the display mode via the calculated index */ /* Now get the display mode via the calculated index */
if (EnumDisplaySettingsExW(NULL, ModeIdx, &DevModeW, 0)) if (EnumDisplaySettingsExW(NULL, ModeIdx, &DevModeW, 0))
{ {
mode->Width = DevModeW.dmPelsWidth; mode->width = DevModeW.dmPelsWidth;
mode->Height = DevModeW.dmPelsHeight; mode->height = DevModeW.dmPelsHeight;
mode->RefreshRate = DEFAULT_REFRESH_RATE; mode->refresh_rate = DEFAULT_REFRESH_RATE;
if (DevModeW.dmFields & DM_DISPLAYFREQUENCY) if (DevModeW.dmFields & DM_DISPLAYFREQUENCY)
mode->RefreshRate = DevModeW.dmDisplayFrequency; mode->refresh_rate = DevModeW.dmDisplayFrequency;
if (format_id == WINED3DFMT_UNKNOWN) if (format_id == WINED3DFMT_UNKNOWN)
mode->Format = pixelformat_for_depth(DevModeW.dmBitsPerPel); mode->format_id = pixelformat_for_depth(DevModeW.dmBitsPerPel);
else else
mode->Format = format_id; mode->format_id = format_id;
} }
else else
{ {
...@@ -2972,8 +2972,8 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada ...@@ -2972,8 +2972,8 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
} }
TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n",
mode->Width, mode->Height, mode->RefreshRate, mode->Format, mode->width, mode->height, mode->refresh_rate, mode->format_id,
debug_d3dformat(mode->Format), DevModeW.dmBitsPerPel); debug_d3dformat(mode->format_id), DevModeW.dmBitsPerPel);
} }
else else
{ {
...@@ -2984,7 +2984,7 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada ...@@ -2984,7 +2984,7 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
} }
HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx,
WINED3DDISPLAYMODE *mode) struct wined3d_display_mode *mode)
{ {
TRACE("wined3d %p, adapter_idx %u, display_mode %p.\n", wined3d, adapter_idx, mode); TRACE("wined3d %p, adapter_idx %u, display_mode %p.\n", wined3d, adapter_idx, mode);
...@@ -3000,21 +3000,21 @@ HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UI ...@@ -3000,21 +3000,21 @@ HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UI
DevModeW.dmSize = sizeof(DevModeW); DevModeW.dmSize = sizeof(DevModeW);
EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &DevModeW, 0); EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &DevModeW, 0);
mode->Width = DevModeW.dmPelsWidth; mode->width = DevModeW.dmPelsWidth;
mode->Height = DevModeW.dmPelsHeight; mode->height = DevModeW.dmPelsHeight;
bpp = DevModeW.dmBitsPerPel; bpp = DevModeW.dmBitsPerPel;
mode->RefreshRate = DEFAULT_REFRESH_RATE; mode->refresh_rate = DEFAULT_REFRESH_RATE;
if (DevModeW.dmFields&DM_DISPLAYFREQUENCY) if (DevModeW.dmFields & DM_DISPLAYFREQUENCY)
mode->RefreshRate = DevModeW.dmDisplayFrequency; mode->refresh_rate = DevModeW.dmDisplayFrequency;
mode->Format = pixelformat_for_depth(bpp); mode->format_id = pixelformat_for_depth(bpp);
} }
else else
{ {
FIXME_(d3d_caps)("Adapter not primary display\n"); FIXME_(d3d_caps)("Adapter not primary display\n");
} }
TRACE_(d3d_caps)("returning w:%d, h:%d, ref:%d, fmt:%s\n", mode->Width, TRACE_(d3d_caps)("returning w:%d, h:%d, ref:%d, fmt:%s\n", mode->width,
mode->Height, mode->RefreshRate, debug_d3dformat(mode->Format)); mode->height, mode->refresh_rate, debug_d3dformat(mode->format_id));
return WINED3D_OK; return WINED3D_OK;
} }
......
...@@ -29,7 +29,7 @@ WINE_DECLARE_DEBUG_CHANNEL(fps); ...@@ -29,7 +29,7 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static void swapchain_cleanup(struct wined3d_swapchain *swapchain) static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
{ {
WINED3DDISPLAYMODE mode; struct wined3d_display_mode mode;
UINT i; UINT i;
TRACE("Destroying swapchain %p.\n", swapchain); TRACE("Destroying swapchain %p.\n", swapchain);
...@@ -74,10 +74,10 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain) ...@@ -74,10 +74,10 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
* orig_height will be equal to the modes in the presentation params. */ * orig_height will be equal to the modes in the presentation params. */
if (!swapchain->presentParms.Windowed && swapchain->presentParms.AutoRestoreDisplayMode) if (!swapchain->presentParms.Windowed && swapchain->presentParms.AutoRestoreDisplayMode)
{ {
mode.Width = swapchain->orig_width; mode.width = swapchain->orig_width;
mode.Height = swapchain->orig_height; mode.height = swapchain->orig_height;
mode.RefreshRate = 0; mode.refresh_rate = 0;
mode.Format = swapchain->orig_fmt; mode.format_id = swapchain->orig_fmt;
wined3d_device_set_display_mode(swapchain->device, 0, &mode); wined3d_device_set_display_mode(swapchain->device, 0, &mode);
} }
...@@ -221,7 +221,8 @@ HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain ...@@ -221,7 +221,8 @@ HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain, WINED3DDISPLAYMODE *mode) HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain,
struct wined3d_display_mode *mode)
{ {
HRESULT hr; HRESULT hr;
...@@ -230,7 +231,7 @@ HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain ...@@ -230,7 +231,7 @@ HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain
hr = wined3d_get_adapter_display_mode(swapchain->device->wined3d, swapchain->device->adapter->ordinal, mode); hr = wined3d_get_adapter_display_mode(swapchain->device->wined3d, swapchain->device->adapter->ordinal, mode);
TRACE("Returning w %u, h %u, refresh rate %u, format %s.\n", TRACE("Returning w %u, h %u, refresh rate %u, format %s.\n",
mode->Width, mode->Height, mode->RefreshRate, debug_d3dformat(mode->Format)); mode->width, mode->height, mode->refresh_rate, debug_d3dformat(mode->format_id));
return hr; return hr;
} }
...@@ -828,8 +829,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY ...@@ -828,8 +829,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
{ {
const struct wined3d_adapter *adapter = device->adapter; const struct wined3d_adapter *adapter = device->adapter;
const struct wined3d_format *format; const struct wined3d_format *format;
struct wined3d_display_mode mode;
BOOL displaymode_set = FALSE; BOOL displaymode_set = FALSE;
WINED3DDISPLAYMODE mode;
RECT client_rect; RECT client_rect;
HWND window; HWND window;
HRESULT hr; HRESULT hr;
...@@ -873,10 +874,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY ...@@ -873,10 +874,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
swapchain->device_window = window; swapchain->device_window = window;
wined3d_get_adapter_display_mode(device->wined3d, adapter->ordinal, &mode); wined3d_get_adapter_display_mode(device->wined3d, adapter->ordinal, &mode);
swapchain->orig_width = mode.Width; swapchain->orig_width = mode.width;
swapchain->orig_height = mode.Height; swapchain->orig_height = mode.height;
swapchain->orig_fmt = mode.Format; swapchain->orig_fmt = mode.format_id;
format = wined3d_get_format(&adapter->gl_info, mode.Format); format = wined3d_get_format(&adapter->gl_info, mode.format_id);
GetClientRect(window, &client_rect); GetClientRect(window, &client_rect);
if (present_parameters->Windowed if (present_parameters->Windowed
...@@ -929,13 +930,13 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY ...@@ -929,13 +930,13 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTY
if (!present_parameters->Windowed) if (!present_parameters->Windowed)
{ {
WINED3DDISPLAYMODE mode; struct wined3d_display_mode mode;
/* Change the display settings */ /* Change the display settings */
mode.Width = present_parameters->BackBufferWidth; mode.width = present_parameters->BackBufferWidth;
mode.Height = present_parameters->BackBufferHeight; mode.height = present_parameters->BackBufferHeight;
mode.Format = present_parameters->BackBufferFormat; mode.format_id = present_parameters->BackBufferFormat;
mode.RefreshRate = present_parameters->FullScreen_RefreshRateInHz; mode.refresh_rate = present_parameters->FullScreen_RefreshRateInHz;
hr = wined3d_device_set_display_mode(device, 0, &mode); hr = wined3d_device_set_display_mode(device, 0, &mode);
if (FAILED(hr)) if (FAILED(hr))
......
...@@ -1509,13 +1509,13 @@ enum wined3d_sysval_semantic ...@@ -1509,13 +1509,13 @@ enum wined3d_sysval_semantic
#define WINEDDPCAPS_2BIT 0x00000200 #define WINEDDPCAPS_2BIT 0x00000200
#define WINEDDPCAPS_ALPHA 0x00000400 #define WINEDDPCAPS_ALPHA 0x00000400
typedef struct _WINED3DDISPLAYMODE struct wined3d_display_mode
{ {
UINT Width; UINT width;
UINT Height; UINT height;
UINT RefreshRate; UINT refresh_rate;
enum wined3d_format_id Format; enum wined3d_format_id format_id;
} WINED3DDISPLAYMODE; };
struct wined3d_color struct wined3d_color
{ {
...@@ -2121,10 +2121,10 @@ HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT ad ...@@ -2121,10 +2121,10 @@ HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT ad
struct wined3d * __cdecl wined3d_create(UINT dxVersion, DWORD flags, void *parent); struct wined3d * __cdecl wined3d_create(UINT dxVersion, DWORD flags, void *parent);
ULONG __cdecl wined3d_decref(struct wined3d *wined3d); ULONG __cdecl wined3d_decref(struct wined3d *wined3d);
HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx, HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx,
enum wined3d_format_id format_id, UINT mode_idx, WINED3DDISPLAYMODE *mode); enum wined3d_format_id format_id, UINT mode_idx, struct wined3d_display_mode *mode);
UINT __cdecl wined3d_get_adapter_count(const struct wined3d *wined3d); UINT __cdecl wined3d_get_adapter_count(const struct wined3d *wined3d);
HRESULT __cdecl wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, HRESULT __cdecl wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx,
WINED3DDISPLAYMODE *mode); struct wined3d_display_mode *mode);
HRESULT __cdecl wined3d_get_adapter_identifier(const struct wined3d *wined3d, UINT adapter_idx, HRESULT __cdecl wined3d_get_adapter_identifier(const struct wined3d *wined3d, UINT adapter_idx,
DWORD flags, WINED3DADAPTER_IDENTIFIER *identifier); DWORD flags, WINED3DADAPTER_IDENTIFIER *identifier);
UINT __cdecl wined3d_get_adapter_mode_count(const struct wined3d *wined3d, UINT __cdecl wined3d_get_adapter_mode_count(const struct wined3d *wined3d,
...@@ -2207,7 +2207,7 @@ HRESULT __cdecl wined3d_device_get_depth_stencil(const struct wined3d_device *de ...@@ -2207,7 +2207,7 @@ HRESULT __cdecl wined3d_device_get_depth_stencil(const struct wined3d_device *de
struct wined3d_surface **depth_stencil); struct wined3d_surface **depth_stencil);
HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps); HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps);
HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device,
UINT swapchain_idx, WINED3DDISPLAYMODE *mode); UINT swapchain_idx, struct wined3d_display_mode *mode);
HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_surface *dst_surface); UINT swapchain_idx, struct wined3d_surface *dst_surface);
void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device, void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device,
...@@ -2287,7 +2287,7 @@ HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *devi ...@@ -2287,7 +2287,7 @@ HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *devi
HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil); HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil);
HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs); HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs);
HRESULT __cdecl wined3d_device_set_display_mode(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_display_mode(struct wined3d_device *device,
UINT swapchain_idx, const WINED3DDISPLAYMODE *mode); UINT swapchain_idx, const struct wined3d_display_mode *mode);
void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device, void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device,
UINT swapchain_idx, DWORD flags, const WINED3DGAMMARAMP *ramp); UINT swapchain_idx, DWORD flags, const WINED3DGAMMARAMP *ramp);
HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
...@@ -2451,7 +2451,7 @@ HRESULT __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain ...@@ -2451,7 +2451,7 @@ HRESULT __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain
UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, struct wined3d_surface **backbuffer); UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, struct wined3d_surface **backbuffer);
struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain); struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain);
HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain, HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain,
WINED3DDISPLAYMODE *mode); struct wined3d_display_mode *mode);
HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
struct wined3d_surface *dst_surface); struct wined3d_surface *dst_surface);
HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain, HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain,
......
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