From caff742d413bb3579101654bd18d1aa0c7f5bfc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Fri, 26 Aug 2011 02:12:10 +0200 Subject: [PATCH] ddraw: Trust wined3d to give us what we asked for. --- dlls/ddraw/surface.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 1f25437076b..64a8e150974 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 -- 2.11.4.GIT