Added support for 16bit mouse cursor bitmaps in RGB 565 format.
This commit is contained in:
parent
a7dbc6c823
commit
0449937a84
|
@ -215,6 +215,12 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr )
|
||||||
bbits = 8;
|
bbits = 8;
|
||||||
threshold = 0x40;
|
threshold = 0x40;
|
||||||
break;
|
break;
|
||||||
|
case 16:
|
||||||
|
rbits = 5;
|
||||||
|
gbits = 6;
|
||||||
|
bbits = 5;
|
||||||
|
threshold = 0x40;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FIXME("Currently no support for cursors with %d bits per pixel\n",
|
FIXME("Currently no support for cursors with %d bits per pixel\n",
|
||||||
ptr->bBitsPerPixel);
|
ptr->bBitsPerPixel);
|
||||||
|
@ -248,13 +254,27 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr )
|
||||||
{
|
{
|
||||||
for (x=0; x<xmax; x++)
|
for (x=0; x<xmax; x++)
|
||||||
{
|
{
|
||||||
theChar = theImage[byteIndex++];
|
red = green = blue = 0;
|
||||||
red = green = blue = 0;
|
switch (ptr->bBitsPerPixel)
|
||||||
blue = theChar;
|
{
|
||||||
theChar = theImage[byteIndex++];
|
case 24:
|
||||||
green = theChar;
|
theChar = theImage[byteIndex++];
|
||||||
theChar = theImage[byteIndex++];
|
blue = theChar;
|
||||||
red = 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)
|
if (red+green+blue > threshold)
|
||||||
{
|
{
|
||||||
rfg += red;
|
rfg += red;
|
||||||
|
|
Loading…
Reference in New Issue