wine/dlls/user cursoricon.c
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Nov 7 05:07:44 CST 2005
ChangeSet ID: 21129
CVSROOT: /opt/cvs-commit
Module name: wine
Changes by: julliard at winehq.org 2005/11/07 05:07:43
Modified files:
dlls/user : cursoricon.c
Log message:
Christian Costa <titan.costa at wanadoo.fr>
When creating black & white cursor icon, handle special case where
hbmColor is null and hbmMask specify a bitmap having twice the height
and formatted so the upper half is the icon AND bitmask and the lower
one is the OR bitmask.
Patch: http://cvs.winehq.org/patch.py?id=21129
Old revision New revision Changes Path
1.17 1.18 +9 -9 wine/dlls/user/cursoricon.c
Index: wine/dlls/user/cursoricon.c
diff -u -p wine/dlls/user/cursoricon.c:1.17 wine/dlls/user/cursoricon.c:1.18
--- wine/dlls/user/cursoricon.c:1.17 7 Nov 2005 11: 7:43 -0000
+++ wine/dlls/user/cursoricon.c 7 Nov 2005 11: 7:43 -0000
@@ -1807,10 +1807,10 @@ HICON WINAPI CreateIconIndirect(PICONINF
HICON16 hObj;
int sizeXor,sizeAnd;
- GetObjectA( iconinfo->hbmColor, sizeof(bmpXor), &bmpXor );
+ if (iconinfo->hbmColor) GetObjectA( iconinfo->hbmColor, sizeof(bmpXor), &bmpXor );
GetObjectA( iconinfo->hbmMask, sizeof(bmpAnd), &bmpAnd );
- sizeXor = bmpXor.bmHeight * bmpXor.bmWidthBytes;
+ sizeXor = iconinfo->hbmColor ? (bmpXor.bmHeight * bmpXor.bmWidthBytes) : 0;
sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes;
hObj = GlobalAlloc16( GMEM_MOVEABLE,
@@ -1833,16 +1833,16 @@ HICON WINAPI CreateIconIndirect(PICONINF
info->ptHotSpot.y = iconinfo->yHotspot;
}
- info->nWidth = bmpXor.bmWidth;
- info->nHeight = bmpXor.bmHeight;
- info->nWidthBytes = bmpXor.bmWidthBytes;
- info->bPlanes = bmpXor.bmPlanes;
- info->bBitsPerPixel = bmpXor.bmBitsPixel;
+ info->nWidth = bmpAnd.bmWidth;
+ info->nHeight = iconinfo->hbmColor ? bmpAnd.bmHeight : (bmpAnd.bmHeight / 2);
+ info->nWidthBytes = bmpAnd.bmWidthBytes;
+ info->bPlanes = bmpAnd.bmPlanes;
+ info->bBitsPerPixel = bmpAnd.bmBitsPixel;
/* Transfer the bitmap bits to the CURSORICONINFO structure */
- GetBitmapBits( iconinfo->hbmMask ,sizeAnd,(char*)(info + 1) );
- GetBitmapBits( iconinfo->hbmColor,sizeXor,(char*)(info + 1) +sizeAnd);
+ GetBitmapBits( iconinfo->hbmMask, sizeAnd, (char*)(info + 1) );
+ if (iconinfo->hbmColor) GetBitmapBits( iconinfo->hbmColor, sizeXor, (char*)(info + 1) + sizeAnd );
GlobalUnlock16( hObj );
}
return HICON_32(hObj);
More information about the wine-cvs
mailing list