diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-08-02 18:19:22 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-08-02 19:22:13 +0100 |
commit | 8d9ffa6d6a2354993500110bb8500f7ef219cb28 (patch) | |
tree | a16fdf76cfa4564b8b0903ca7c6a45210c855a2a | |
parent | 1d1bc017207971b309e8a0b3924ea42afaf6ee14 (diff) |
Fix ARGB cursor conversion on x86_64
Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which
leads to ARGB cursors being horizontally streched by a factor of two on x86_64.
-rw-r--r-- | hw/xwin/wmutil/cursor_convert.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/xwin/wmutil/cursor_convert.c b/hw/xwin/wmutil/cursor_convert.c index 727d83813..157e3a4ea 100644 --- a/hw/xwin/wmutil/cursor_convert.c +++ b/hw/xwin/wmutil/cursor_convert.c @@ -84,7 +84,7 @@ winXCursorToHCURSOR(WMUTIL_CURSOR *pCursor) HDC hDC; BITMAPV4HEADER bi; BITMAPINFO *pbmi; - unsigned long *lpBits; + uint32_t *lpBits; int sm_cx = GetSystemMetrics(SM_CXCURSOR); int sm_cy = GetSystemMetrics(SM_CYCURSOR); @@ -144,15 +144,14 @@ winXCursorToHCURSOR(WMUTIL_CURSOR *pCursor) bi.bV4AlphaMask = 0xFF000000; lpBits = - (unsigned long *) calloc(sm_cx * + (uint32_t *) calloc(sm_cx * sm_cy, - sizeof(unsigned long)); + sizeof(uint32_t)); if (lpBits) { int y; for (y = 0; y < nCY; y++) { - unsigned long *src, *dst; - + void *src, *dst; src = &(pCursor->argb[y * pCursor->width]); dst = &(lpBits[y * sm_cx]); memcpy(dst, src, 4 * nCX); @@ -231,7 +230,7 @@ winXCursorToHCURSOR(WMUTIL_CURSOR *pCursor) pbmiColors[2].rgbReserved = 0; lpBits = - (unsigned long *) calloc(sm_cx * + (uint32_t *) calloc(sm_cx * sm_cy, sizeof(char)); pCur = (unsigned char *) lpBits; |