Cursor.java:Fixed case where delays == null
This commit is contained in:
parent
6f1f14facb
commit
e7eb679f24
|
@ -101,38 +101,38 @@ public class Cursor {
|
||||||
IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer();
|
IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer();
|
||||||
flipImages(width, height, numImages, images, images_copy);
|
flipImages(width, height, numImages, images, images_copy);
|
||||||
|
|
||||||
// Win32 doesn't (afaik) allow for animation based cursors, except when they're
|
// Win32 doesn't (afaik) allow for animation based cursors, except when they're
|
||||||
// in the .ani format, which we don't support.
|
// in the .ani format, which we don't support.
|
||||||
// The cursor animation was therefor developed using java side time tracking.
|
// The cursor animation was therefor developed using java side time tracking.
|
||||||
// unfortunately X flickers when changing cursor. We therefor check for either
|
// unfortunately X flickers when changing cursor. We therefore check for either
|
||||||
// Win32 or X and do accordingly. This hasn't been implemented on Mac, but we
|
// Win32 or X and do accordingly. This hasn't been implemented on Mac, but we
|
||||||
// might want to split it into a X/Win/Mac cursor if it gets too cluttered
|
// might want to split it into a X/Win/Mac cursor if it gets too cluttered
|
||||||
|
|
||||||
switch(Display.getPlatform()) {
|
switch(Display.getPlatform()) {
|
||||||
case Display.PLATFORM_GLX:
|
case Display.PLATFORM_GLX:
|
||||||
// create our cursor elements
|
// create our cursor elements
|
||||||
cursors = new CursorElement[1];
|
cursors = new CursorElement[1];
|
||||||
cursors[0] = new CursorElement();
|
cursors[0] = new CursorElement();
|
||||||
cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays.position());
|
cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays != null ? delays.position() : -1);
|
||||||
break;
|
break;
|
||||||
case Display.PLATFORM_WGL:
|
case Display.PLATFORM_WGL:
|
||||||
// create our cursor elements
|
// create our cursor elements
|
||||||
cursors = new CursorElement[numImages];
|
cursors = new CursorElement[numImages];
|
||||||
for(int i=0; i<numImages; i++) {
|
for(int i=0; i<numImages; i++) {
|
||||||
cursors[i] = new CursorElement();
|
cursors[i] = new CursorElement();
|
||||||
cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0);
|
cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0);
|
||||||
cursors[i].delay = (delays != null) ? delays.get(i) : 0;
|
cursors[i].delay = (delays != null) ? delays.get(i) : 0;
|
||||||
cursors[i].timeout = System.currentTimeMillis();
|
cursors[i].timeout = System.currentTimeMillis();
|
||||||
|
|
||||||
// offset to next image
|
// offset to next image
|
||||||
images_copy.position(width*height*(i+1));
|
images_copy.position(width*height*(i+1));
|
||||||
}
|
}
|
||||||
// set index
|
// set index
|
||||||
index = 0;
|
index = 0;
|
||||||
break;
|
break;
|
||||||
case Display.PLATFORM_AGL:
|
case Display.PLATFORM_AGL:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue