diff --git a/src/java/org/lwjgl/input/Cursor.java b/src/java/org/lwjgl/input/Cursor.java index 457645bd..7f9d9f0b 100644 --- a/src/java/org/lwjgl/input/Cursor.java +++ b/src/java/org/lwjgl/input/Cursor.java @@ -74,7 +74,7 @@ public class Cursor { */ public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws Exception { assert Mouse.isCreated(); - nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images, delays); + nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : 0); } /** @@ -94,7 +94,7 @@ public class Cursor { /** * Native method to create a native cursor */ - private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays); + private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset); /** * Native method to destroy a native cursor diff --git a/src/native/common/org_lwjgl_input_Cursor.h b/src/native/common/org_lwjgl_input_Cursor.h index 0ea7f7ce..30d56e0a 100644 --- a/src/native/common/org_lwjgl_input_Cursor.h +++ b/src/native/common/org_lwjgl_input_Cursor.h @@ -12,10 +12,10 @@ extern "C" { /* * Class: org_lwjgl_input_Cursor * Method: nCreateCursor - * Signature: (IIIIILjava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I + * Signature: (IIIIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *, jclass, jint, jint, jint, jint, jint, jobject, jobject); + (JNIEnv *, jclass, jint, jint, jint, jint, jint, jobject, jint, jobject, jint); /* * Class: org_lwjgl_input_Cursor diff --git a/src/native/configure.in b/src/native/configure.in index c2f1bb91..014c92f5 100644 --- a/src/native/configure.in +++ b/src/native/configure.in @@ -51,8 +51,8 @@ if test "x$JAVA_HOME" = x; then else AC_MSG_RESULT($JAVA_HOME) JAVA_HOME="$JAVA_HOME" - CPPFLAGS="$CPPFLAGS -D_DEBUG -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" - CFLAGS="$CFLAGS -D_DEBUG -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CPPFLAGS="$CPPFLAGS -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CFLAGS="$CFLAGS -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" fi dnl Checks for libraries. diff --git a/src/native/linux/org_lwjgl_input_Cursor.cpp b/src/native/linux/org_lwjgl_input_Cursor.cpp index 1b5578d5..1514bf4a 100644 --- a/src/native/linux/org_lwjgl_input_Cursor.cpp +++ b/src/native/linux/org_lwjgl_input_Cursor.cpp @@ -8,12 +8,12 @@ * Signature: (IIIIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jobject delay_buffer) + (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { const int *delays = NULL; if (delay_buffer != NULL) - delays = (const int *)env->GetDirectBufferAddress(delay_buffer); - XcursorPixel *pixels = (XcursorPixel *)env->GetDirectBufferAddress(image_buffer); + delays = (const int *)env->GetDirectBufferAddress(delay_buffer) + delays_offset; + XcursorPixel *pixels = (XcursorPixel *)env->GetDirectBufferAddress(image_buffer) + images_offset; int stride = width*height; XcursorImages *cursor_images = XcursorImagesCreate(num_images); if (cursor_images == NULL) diff --git a/src/native/win32/org_lwjgl_input_Cursor.cpp b/src/native/win32/org_lwjgl_input_Cursor.cpp index 2fd881fa..85371e35 100755 --- a/src/native/win32/org_lwjgl_input_Cursor.cpp +++ b/src/native/win32/org_lwjgl_input_Cursor.cpp @@ -8,9 +8,9 @@ * Signature: (IIIIIIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jobject delay_buffer) + (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { - int *pixels = (int *)env->GetDirectBufferAddress(image_buffer); + int *pixels = (int *)env->GetDirectBufferAddress(image_buffer) + images_offset; BITMAPINFO bitmapInfo;