Stefan Dösinger : wined3d: Nonpow2 repacking support for GetDC.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 15 07:34:44 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 8af7dd5dea83a129b359d7e9473ec5f9805e24ad
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=8af7dd5dea83a129b359d7e9473ec5f9805e24ad

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun May 14 16:28:14 2006 +0200

wined3d: Nonpow2 repacking support for GetDC.

---

 dlls/wined3d/surface.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 48b4e36..22b3f0e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -985,8 +985,16 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC
         }
 
         b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-        b_info->bmiHeader.biWidth = This->pow2Width;
-        b_info->bmiHeader.biHeight = -This->pow2Height;
+        if( (NP2_REPACK == wined3d_settings.nonpower2_mode || This->resource.usage & WINED3DUSAGE_RENDERTARGET)) {
+            b_info->bmiHeader.biWidth = This->currentDesc.Width;
+            b_info->bmiHeader.biHeight = -This->currentDesc.Height;
+            /* Use the full pow2 image size(assigned below) because LockRect
+             * will need it for a full glGetTexImage call
+             */
+        } else {
+            b_info->bmiHeader.biWidth = This->pow2Width;
+            b_info->bmiHeader.biHeight = -This->pow2Height;
+        }
         b_info->bmiHeader.biPlanes = 1;
         b_info->bmiHeader.biBitCount = This->bytesPerPixel * 8;
 




More information about the wine-cvs mailing list