Revision: 2900
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=2900&view=rev
Author: matzon
Date: 2007-10-20 07:48:07 -0700 (Sat, 20 Oct 2007)
Log Message:
-----------
make sure that any windows cursor image pixel is either 0xffxxxxxx or 0x00000000
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java
Modified: trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2007-10-17 08:24:07 UTC (rev 2899)
+++ trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2007-10-20 14:48:07 UTC (rev 2900)
@@ -179,6 +179,17 @@
// create our cursor elements
cursors = new CursorElement[numImages];
for(int i=0; i<numImages; i++) {
+
+ // iterate through the images, and make sure that the pixels are either 0xffxxxxxx or 0x00000000
+ int size = width * height;
+ for(int j=0; j<size; j++) {
+ int index = j + (i*size);
+ int alpha = images_copy.get(index) >> 24 & 0xff;
+ if(alpha != 0xff) {
+ images_copy.put(index, 0);
+ }
+ }
+
Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null);
long delay = (delays != null) ? delays.get(i) : 0;
long timeout = System.currentTimeMillis();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|