ddraw: Use the largest dimension to determine the mipmap count for version 7 surfaces.
authorHenri Verbeet <hverbeet@codeweavers.com>
Wed, 6 Jan 2016 14:52:05 +0000 (15:52 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 6 Jan 2016 17:08:38 +0000 (18:08 +0100)
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/ddraw/surface.c

index 0976603b2838d8b38d9442b467377b96a244df19..9b845d2dc49c92fa5ca39e9cbd5b79dd0364b9ce 100644 (file)
@@ -5873,7 +5873,10 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
             {
                 /* Undocumented feature: Create sublevels until either the
                  * width or the height is 1. */
-                desc->u2.dwMipMapCount = wined3d_log2i(min(desc->dwWidth, desc->dwHeight)) + 1;
+                if (version == 7)
+                    desc->u2.dwMipMapCount = wined3d_log2i(max(desc->dwWidth, desc->dwHeight)) + 1;
+                else
+                    desc->u2.dwMipMapCount = wined3d_log2i(min(desc->dwWidth, desc->dwHeight)) + 1;
             }
         }
         else