Initialize the dwMipmapCount field even if the application forgets it.

This commit is contained in:
Lionel Ulmer 2003-05-11 03:46:53 +00:00 committed by Alexandre Julliard
parent 449f6b212f
commit 7ebdcb3538
1 changed files with 8 additions and 0 deletions

View File

@ -355,6 +355,14 @@ create_texture(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
GET_BPP(ddsd)*8);
}
/* Check also for the MIPMAP / MIPMAPCOUNT flags.
TODO: check if Windows 'auto-builds' somehow the mip-map levels */
if (((ddsd.dwFlags & DDSD_MIPMAPCOUNT) == 0) &&
((ddsd.ddsCaps.dwCaps & DDSCAPS_MIPMAP) != 0)) {
ddsd.dwFlags |= DDSD_MIPMAPCOUNT;
ddsd.u2.dwMipMapCount = 1;
}
ddsd.dwFlags |= DDSD_PITCH | DDSD_PIXELFORMAT;
hr = This->create_texture(This, &ddsd, ppSurf, pUnkOuter, mipmap_level);