Stefan Dösinger : ddraw: Search for texture sublevels with GetAttachedSurface.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 27 06:43:55 CDT 2007


Module: wine
Branch: master
Commit: a46012eff218b7aac6359a304f1a3ed2b9c2bc6b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a46012eff218b7aac6359a304f1a3ed2b9c2bc6b

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Apr 22 20:30:45 2007 +0200

ddraw: Search for texture sublevels with GetAttachedSurface.

---

 dlls/ddraw/ddraw.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index df107ce..8b8308a 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1598,12 +1598,20 @@ D3D7CB_CreateSurface(IUnknown *device,
 {
     ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw7, device);
     IDirectDrawSurfaceImpl *surf = This->tex_root;
-    int i;
+    int i = 0;
     TRACE("(%p) call back. surf=%p\n", device, surf);
 
     /* Find the wanted mipmap. There are enough mipmaps in the chain */
-    for(i = 0; i < level; i++)
-        surf = surf->next_complex;
+    while(i < level)
+    {
+        IDirectDrawSurface7 *attached;
+        IDirectDrawSurface7_GetAttachedSurface(ICOM_INTERFACE(surf, IDirectDrawSurface7),
+                                               &This->tex_root->surface_desc.ddsCaps,
+                                               &attached);
+        surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, attached);
+        IDirectDrawSurface7_Release(attached);
+        i++;
+    }
 
     /* Return the surface */
     *Surface = surf->WineD3DSurface;




More information about the wine-cvs mailing list