[PATCH] winex11.drv: Do not cap the cursor size=0A=
Stefan Doesinger
stefan at codeweavers.com
Fri Aug 8 16:01:51 CDT 2008
=0A=
The Xcursor spec doesn't suggest any size limits of cursors.=0A=
There's no function to retrieve limits, and cursors > 32x32 work=0A=
nice here.=0A=
=0A=
This patch makes 64x64 cursors in City of Heroes work properly=0A=
---=0A=
dlls/winex11.drv/mouse.c | 19 ++++++++-----------=0A=
1 files changed, 8 insertions(+), 11 deletions(-)=0A=
=0A=
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c=0A=
index d939bb0..5df71a7 100644=0A=
--- a/dlls/winex11.drv/mouse.c=0A=
+++ b/dlls/winex11.drv/mouse.c=0A=
@@ -408,8 +408,8 @@ void X11DRV_send_mouse_input( HWND hwnd, DWORD =
flags, DWORD x, DWORD y,=0A=
*/=0A=
static XcursorImage *create_cursor_image( CURSORICONINFO *ptr )=0A=
{=0A=
- int x, xmax;=0A=
- int y, ymax;=0A=
+ int x;=0A=
+ int y;=0A=
int and_size;=0A=
unsigned char *and_bits, *and_ptr, *xor_bits, *xor_ptr;=0A=
int and_width_bytes, xor_width_bytes;=0A=
@@ -417,10 +417,7 @@ static XcursorImage *create_cursor_image( =
CURSORICONINFO *ptr )=0A=
XcursorImage *image;=0A=
BOOL alpha_zero =3D TRUE;=0A=
=0A=
- ymax =3D (ptr->nHeight > 32) ? 32 : ptr->nHeight;=0A=
- xmax =3D (ptr->nWidth > 32) ? 32 : ptr->nWidth;=0A=
-=0A=
- and_width_bytes =3D xmax / 8;=0A=
+ and_width_bytes =3D ptr->nWidth / 8;=0A=
xor_width_bytes =3D and_width_bytes * ptr->bBitsPerPixel;=0A=
=0A=
and_size =3D ptr->nWidth * ptr->nHeight / 8;=0A=
@@ -428,7 +425,7 @@ static XcursorImage *create_cursor_image( =
CURSORICONINFO *ptr )=0A=
=0A=
xor_ptr =3D xor_bits =3D and_ptr + and_size;=0A=
=0A=
- image =3D pXcursorImageCreate( xmax, ymax );=0A=
+ image =3D pXcursorImageCreate( ptr->nWidth, ptr->nHeight );=0A=
pixel_ptr =3D image->pixels;=0A=
=0A=
/* Generally 32 bit bitmaps have an alpha channel which is used in =
favor=0A=
@@ -447,10 +444,10 @@ static XcursorImage *create_cursor_image( =
CURSORICONINFO *ptr )=0A=
*/=0A=
if(ptr->bBitsPerPixel =3D=3D 32)=0A=
{=0A=
- for (y =3D 0; alpha_zero && y < ymax; ++y)=0A=
+ for (y =3D 0; alpha_zero && y < ptr->nHeight; ++y)=0A=
{=0A=
xor_ptr =3D xor_bits + (y * xor_width_bytes);=0A=
- for (x =3D 0; x < xmax; ++x)=0A=
+ for (x =3D 0; x < ptr->nWidth; ++x)=0A=
{=0A=
if (xor_ptr[3] !=3D 0x00)=0A=
{=0A=
@@ -476,12 +473,12 @@ static XcursorImage *create_cursor_image( =
CURSORICONINFO *ptr )=0A=
* the "xor" data to the alpha channel, and xor the color with =
either=0A=
* black or white.=0A=
*/=0A=
- for (y =3D 0; y < ymax; ++y)=0A=
+ for (y =3D 0; y < ptr->nHeight; ++y)=0A=
{=0A=
and_ptr =3D and_bits + (y * and_width_bytes);=0A=
xor_ptr =3D xor_bits + (y * xor_width_bytes);=0A=
=0A=
- for (x =3D 0; x < xmax; ++x)=0A=
+ for (x =3D 0; x < ptr->nWidth; ++x)=0A=
{=0A=
/* Xcursor pixel data is in ARGB format, with A in the high =
byte */=0A=
switch (ptr->bBitsPerPixel)=0A=
-- =0A=
1.5.4.5=0A=
=0A=
------=_NextPart_000_0065_01C902BC.A522AC70--
More information about the wine-patches
mailing list