Support for 16bit mouse cursor bitmaps.

Marco Pietrobono pietrobo at pietrobo.com
Thu Mar 28 13:14:25 CST 2002


  Hi, the subject says all... :)

  I'm not sure about the threshold's value, but it works.

Changelog:

   Marco Pietrobono <pietrobo at pietrobo.com>

 * dlls/x11drv/mouse.c

   Added support for 16bit mouse cursor bitmaps in RGB 565 format.


-- 
Stud. Marco Pietrobono            | Murphy's Law: if something could
v. del Calice, 39 - 00178 ROMA    |     go wrong, it does.
Tel. +39.06.7186329  339.7410893  | Legge di Murphy: se qualcosa può
http://www.pietrobo.com           |    andar male, lo farà.
------------------------------------------------------------------------
Strange game.
The only winning move 
is not to play.
What about a nice play of chess ?
-------------- next part --------------
Index: dlls/x11drv/mouse.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/mouse.c,v
retrieving revision 1.3
diff -u -r1.3 mouse.c
--- dlls/x11drv/mouse.c	9 Mar 2002 23:44:35 -0000	1.3
+++ dlls/x11drv/mouse.c	28 Mar 2002 18:57:28 -0000
@@ -215,6 +215,12 @@
                 bbits = 8;
                 threshold = 0x40;
                 break;
+            case 16:
+                rbits = 5;
+                gbits = 6;
+                bbits = 5;
+                threshold = 0x40;
+                break;
             default:
                 FIXME("Currently no support for cursors with %d bits per pixel\n",
                   ptr->bBitsPerPixel);
@@ -248,13 +254,27 @@
             {
                 for (x=0; x<xmax; x++)
                 {
-                    theChar = theImage[byteIndex++];
-                    red = green = blue = 0;
-                    blue = theChar;
-                    theChar = theImage[byteIndex++];
-                    green = theChar;
-                    theChar = theImage[byteIndex++];
-                    red = theChar;
+                   	red = green = blue = 0;
+                   	switch (ptr->bBitsPerPixel)
+                   	{
+                   	case 24:
+                   	    theChar = theImage[byteIndex++];
+                   	    blue = theChar;
+                   	    theChar = theImage[byteIndex++];
+                   	    green = theChar;
+                   	    theChar = theImage[byteIndex++];
+                   	    red = theChar;
+                   	    break;
+                   	case 16:
+                   	    theChar = theImage[byteIndex++];
+                   	    blue = theChar & 0x1F;
+                   	    green = (theChar & 0xE0) >> 5;
+                   	    theChar = theImage[byteIndex++];
+                   	    green |= (theChar & 0x07) << 3;
+                   	    red = (theChar & 0xF8) >> 3;
+                   	    break;
+                   	}
+
                     if (red+green+blue > threshold)
                     {
                         rfg += red;


More information about the wine-patches mailing list