Re: [AD] Another custom cursor question |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Another custom cursor question
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Sun, 14 Sep 2008 23:28:32 -0400
On 14 Sep 2008, at 22:34, Peter Wang wrote:
You could. The problem with a pure white cursor is that you won't
catch
BGR<->RGB issues.
True, but if there were any of those that wouldn't be affected by
checking the alpha channel alone with a black and white cursor.
Anyway, I've verified that changing the X11 code to use al_unmap_rgba
(like the Windows code) indeed makes the cursor behave properly and I
have commited the following patch (I had to reset my SF password
first, which was a bit of a hassle):
Modified: allegro/branches/4.9/src/x/xcursor.c
===================================================================
--- allegro/branches/4.9/src/x/xcursor.c 2008-09-15 00:25:22 UTC (rev
10822)
+++ allegro/branches/4.9/src/x/xcursor.c 2008-09-15 03:23:27 UTC (rev
10823)
@@ -52,8 +52,7 @@
unsigned char r, g, b, a;
col = al_get_pixel(bmp, ix, iy);
- al_unmap_rgb(col, &r, &g, &b);
- a = 255;
+ al_unmap_rgba(col, &r, &g, &b, &a);
image->pixels[c++] = (a<<24) | (r<<16) | (g<<8) | (b);
}
}
Evert