Module: wine
Branch: master
Commit: 1f32d6235e4f12cdf805469ff77a9c27db7e1744
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f32d6235e4f12cdf805469ff…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu Feb 15 13:52:21 2007 +0100
wined3d: Convert the full surface for now.
Until we have proper subrectangle handling for offscreen surfaces,
surface conversion has to use the real surface sizes, and not the size
of the opengl subrectangle that it is going to upload. Due to the
power of 2 limitations the gl height may be bigger than the real
surface height. If that is not the case, the uploading function will
pick the correct parts from the converted surface data.
---
dlls/wined3d/surface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a42d4ef..333712d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1714,7 +1714,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
pitch = IWineD3DSurface_GetPitch(iface);
if((convert != NO_CONVERSION) && This->resource.allocatedMemory) {
- int height = This->glRect.bottom - This->glRect.top;
+ int height = This->currentDesc.Height;
/* Stick to the alignment for the converted surface too, makes it easier to load the surface */
outpitch = width * bpp;
Module: wine
Branch: master
Commit: a41ba013b6a262758ab41053b798dea11f9f65a9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a41ba013b6a262758ab41053b…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu Feb 15 13:51:24 2007 +0100
wined3d: Test for supported queries.
This test contains a table of known supported / known unsupported
queries. In theory wined3d could just report the queries it supports,
but applications may make some assumtions regarding supported /
unsupported queries and stop working if they find a query unexpectadely
supported or unsupported. It also tests what is supposed to happen if an
unsupported query is created.
---
dlls/d3d9/tests/Makefile.in | 1 +
dlls/d3d9/tests/query.c | 169 +++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 54 +++++++-------
3 files changed, 197 insertions(+), 27 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=a41ba013b6a262758ab41…
Module: wine
Branch: master
Commit: 8e84127aedd6b32eb4b76ea22a07f648342ae2a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e84127aedd6b32eb4b76ea22…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu Feb 15 13:53:33 2007 +0100
wined3d: Restore the display mode when releasing a swapchain.
---
dlls/wined3d/device.c | 1 +
dlls/wined3d/swapchain.c | 13 +++++++++++++
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a80c3e7..4bfc07d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1288,6 +1288,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
object->orig_width = GetSystemMetrics(SM_CXSCREEN);
object->orig_height = GetSystemMetrics(SM_CYSCREEN);
+ object->orig_fmt = pixelformat_for_depth(GetDeviceCaps(hDc, BITSPIXEL) * GetDeviceCaps(hDc, PLANES));
/** MSDN: If Windowed is TRUE and either of the BackBufferWidth/Height values is zero,
* then the corresponding dimension of the client area of the hDeviceWindow
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 52271df..e99e096 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -104,6 +104,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetParent(IWineD3DSwapChain *iface,
/*IWineD3DSwapChain parts follow: */
static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderTarget) {
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
+ WINED3DDISPLAYMODE mode;
/* release the ref to the front and back buffer parents */
if(This->frontBuffer) {
@@ -123,6 +124,18 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
}
}
+ /* Restore the screen resolution if we rendered in fullscreen
+ * This will restore the screen resolution to what it was before creating the swapchain. In case of d3d8 and d3d9
+ * this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution
+ * before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params
+ */
+ if(This->presentParms.Windowed == FALSE) {
+ mode.Width = This->orig_width;
+ mode.Height = This->orig_height;
+ mode.RefreshRate = 0;
+ mode.Format = This->orig_fmt;
+ IWineD3DDevice_SetDisplayMode((IWineD3DDevice *) This->wineD3DDevice, 0, &mode);
+ }
DestroyContext(This->wineD3DDevice, This->context);
HeapFree(GetProcessHeap(), 0, This);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c20532e..3a2ee8a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1318,6 +1318,7 @@ typedef struct IWineD3DSwapChainImpl
BOOL wantsDepthStencilBuffer;
D3DPRESENT_PARAMETERS presentParms;
DWORD orig_width, orig_height;
+ WINED3DFORMAT orig_fmt;
long prev_time, frames; /* Performance tracking */