mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
Better handling of pitch set to 0.
This commit is contained in:
parent
2d27504fc1
commit
5d62e55d3d
1 changed files with 7 additions and 6 deletions
|
@ -114,6 +114,13 @@ static HRESULT create_dib(IDirectDrawSurfaceImpl* This)
|
|||
b_info->bmiHeader.biClrUsed = 0;
|
||||
b_info->bmiHeader.biClrImportant = 0;
|
||||
|
||||
if (!This->surface_desc.u1.lPitch) {
|
||||
/* This can't happen, right? */
|
||||
/* or use GDI_GetObj to get it from the created DIB? */
|
||||
This->surface_desc.u1.lPitch = get_dib_width_bytes(b_info->bmiHeader.biWidth, b_info->bmiHeader.biBitCount);
|
||||
This->surface_desc.dwFlags |= DDSD_PITCH;
|
||||
}
|
||||
|
||||
switch (This->surface_desc.u4.ddpfPixelFormat.u1.dwRGBBitCount)
|
||||
{
|
||||
case 16:
|
||||
|
@ -158,12 +165,6 @@ static HRESULT create_dib(IDirectDrawSurfaceImpl* This)
|
|||
}
|
||||
|
||||
TRACE("DIBSection at : %p\n", priv->dib.bitmap_data);
|
||||
if (!This->surface_desc.u1.lPitch) {
|
||||
/* This can't happen, right? */
|
||||
/* or use GDI_GetObj to get it from the created DIB? */
|
||||
This->surface_desc.u1.lPitch = get_dib_width_bytes(b_info->bmiHeader.biWidth, b_info->bmiHeader.biBitCount);
|
||||
This->surface_desc.dwFlags |= DDSD_PITCH;
|
||||
}
|
||||
|
||||
if (!This->surface_desc.lpSurface) {
|
||||
This->surface_desc.lpSurface = priv->dib.bitmap_data;
|
||||
|
|
Loading…
Reference in a new issue