Stefan Dösinger : ddraw: Trust wined3d to give us what we asked for.

Alexandre Julliard julliard at winehq.org
Mon Aug 29 11:28:39 CDT 2011


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Aug 26 02:12:10 2011 +0200

ddraw: Trust wined3d to give us what we asked for.

---

 dlls/ddraw/surface.c |   15 ++-------------
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 1f25437..64a8e15 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5112,8 +5112,6 @@ HRESULT ddraw_surface_create_texture(IDirectDrawSurfaceImpl *surface)
 HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddraw,
         DDSURFACEDESC2 *desc, UINT mip_level, WINED3DSURFTYPE surface_type, UINT version)
 {
-    struct wined3d_resource_desc wined3d_desc;
-    struct wined3d_resource *wined3d_resource;
     WINED3DPOOL pool = WINED3DPOOL_DEFAULT;
     enum wined3d_format_id format;
     DWORD usage = 0;
@@ -5215,15 +5213,6 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
         return hr;
     }
 
-    wined3d_resource = wined3d_surface_get_resource(surface->wined3d_surface);
-    wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
-
-    format = wined3d_desc.format;
-    if (format == WINED3DFMT_UNKNOWN)
-    {
-        FIXME("IWineD3DSurface::GetDesc returned WINED3DFMT_UNKNOWN.\n");
-    }
-
     /* Anno 1602 stores the pitch right after surface creation, so make sure
      * it's there. TODO: Test other fourcc formats. */
     if (format == WINED3DFMT_DXT1 || format == WINED3DFMT_DXT2 || format == WINED3DFMT_DXT3
@@ -5232,11 +5221,11 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
         surface->surface_desc.dwFlags |= DDSD_LINEARSIZE;
         if (format == WINED3DFMT_DXT1)
         {
-            surface->surface_desc.u1.dwLinearSize = max(4, wined3d_desc.width) * max(4, wined3d_desc.height) / 2;
+            surface->surface_desc.u1.dwLinearSize = max(4, desc->dwWidth) * max(4, desc->dwHeight) / 2;
         }
         else
         {
-            surface->surface_desc.u1.dwLinearSize = max(4, wined3d_desc.width) * max(4, wined3d_desc.height);
+            surface->surface_desc.u1.dwLinearSize = max(4, desc->dwWidth) * max(4, desc->dwHeight);
         }
     }
     else




More information about the wine-cvs mailing list