Cursor.java:Fixed case where delays == null

This commit is contained in:
Elias Naur 2004-04-12 07:20:01 +00:00
parent 6f1f14facb
commit e7eb679f24
1 changed files with 32 additions and 32 deletions

View File

@ -101,38 +101,38 @@ public class Cursor {
IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer();
flipImages(width, height, numImages, images, images_copy);
// Win32 doesn't (afaik) allow for animation based cursors, except when they're
// in the .ani format, which we don't support.
// The cursor animation was therefor developed using java side time tracking.
// unfortunately X flickers when changing cursor. We therefor check for either
// 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
// Win32 doesn't (afaik) allow for animation based cursors, except when they're
// in the .ani format, which we don't support.
// The cursor animation was therefor developed using java side time tracking.
// 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
// might want to split it into a X/Win/Mac cursor if it gets too cluttered
switch(Display.getPlatform()) {
case Display.PLATFORM_GLX:
// create our cursor elements
cursors = new CursorElement[1];
cursors[0] = new CursorElement();
cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays.position());
break;
case Display.PLATFORM_WGL:
// create our cursor elements
cursors = new CursorElement[numImages];
for(int i=0; i<numImages; i++) {
cursors[i] = new CursorElement();
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].timeout = System.currentTimeMillis();
switch(Display.getPlatform()) {
case Display.PLATFORM_GLX:
// create our cursor elements
cursors = new CursorElement[1];
cursors[0] = new CursorElement();
cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays != null ? delays.position() : -1);
break;
case Display.PLATFORM_WGL:
// create our cursor elements
cursors = new CursorElement[numImages];
for(int i=0; i<numImages; i++) {
cursors[i] = new CursorElement();
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].timeout = System.currentTimeMillis();
// offset to next image
images_copy.position(width*height*(i+1));
}
// set index
index = 0;
break;
case Display.PLATFORM_AGL:
break;
}
// offset to next image
images_copy.position(width*height*(i+1));
}
// set index
index = 0;
break;
case Display.PLATFORM_AGL:
break;
}
}
/**