Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22075/src/native/win32 Modified Files: display.c org_lwjgl_Sys.c org_lwjgl_input_Keyboard.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_Pbuffer.c org_lwjgl_opengl_Win32ContextImplementation.c Log Message: OpenAL: Made the openal library path returned by the current ClassLoader and cwd more override java.library.path. Converted some printfDebug to printfDebugJava Index: org_lwjgl_Sys.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_Sys.c 13 Mar 2005 20:12:50 -0000 1.10 +++ org_lwjgl_Sys.c 12 May 2005 07:47:07 -0000 1.11 @@ -87,7 +87,7 @@ char * cTitleBarText = GetStringNativeChars(env, title); MessageBox(getCurrentHWND(), eMessageText, cTitleBarText, MB_OK | MB_TOPMOST); - printfDebug("*** Alert ***%s\n%s\n", cTitleBarText, eMessageText); + printfDebugJava(env, "*** Alert ***%s\n%s\n", cTitleBarText, eMessageText); free(eMessageText); free(cTitleBarText); @@ -129,7 +129,7 @@ &pi ) // Pointer to PROCESS_INFORMATION structure. ) { - printfDebug("Failed to open URL %s\n", urlString); + printfDebugJava(env, "Failed to open URL %s", urlString); return JNI_FALSE; } Index: org_lwjgl_input_Keyboard.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_input_Keyboard.c 18 Jan 2005 16:50:54 -0000 1.3 +++ org_lwjgl_input_Keyboard.c 12 May 2005 07:47:07 -0000 1.4 @@ -98,7 +98,7 @@ ret = IDirectInputDevice_Acquire(lpdiKeyboard); if(FAILED(ret)) { - printfDebug("Failed to acquire keyboard\n"); + printfDebugJava(env, "Failed to acquire keyboard"); } osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx(&osvi); @@ -126,7 +126,7 @@ } // Release DirectInput if (lpdi != NULL) { - printfDebug("Destroying directinput\n"); + printfDebugJava(env, "Destroying directinput"); IDirectInput_Release(lpdi); lpdi = NULL; } @@ -260,19 +260,19 @@ current_di_event++; } } else if (ret == DI_BUFFEROVERFLOW) { - printfDebug("Keyboard buffer overflowed\n"); + printfDebugJava(env, "Keyboard buffer overflowed"); } else if (ret == DIERR_INPUTLOST) { - printfDebug("Input lost\n"); + printfDebugJava(env, "Input lost"); } else if (ret == DIERR_NOTACQUIRED) { - printfDebug("not acquired\n"); + printfDebugJava(env, "not acquired"); } else if (ret == DIERR_INVALIDPARAM) { - printfDebug("invalid parameter\n"); + printfDebugJava(env, "invalid parameter"); } else if (ret == DIERR_NOTBUFFERED) { - printfDebug("not buffered\n"); + printfDebugJava(env, "not buffered"); } else if (ret == DIERR_NOTINITIALIZED) { - printfDebug("not inited\n"); + printfDebugJava(env, "not inited"); } else { - printfDebug("unknown keyboard error\n"); + printfDebugJava(env, "unknown keyboard error"); } return num_events; } Index: org_lwjgl_opengl_Win32ContextImplementation.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Win32ContextImplementation.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_opengl_Win32ContextImplementation.c 24 Feb 2005 13:24:08 -0000 1.2 +++ org_lwjgl_opengl_Win32ContextImplementation.c 12 May 2005 07:47:07 -0000 1.3 @@ -88,7 +88,7 @@ } extgl_InitWGL(&extensions); if (!wglMakeCurrent(saved_hdc, saved_context)) - printfDebug("Failed to restore current context\n"); + printfDebugJava(env, "Failed to restore current context"); context_info = (Win32Context *)(*env)->GetDirectBufferAddress(env, context_handle); context_info->context = context; context_info->extensions = extensions; Index: org_lwjgl_opengl_Pbuffer.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- org_lwjgl_opengl_Pbuffer.c 2 Mar 2005 16:00:44 -0000 1.15 +++ org_lwjgl_opengl_Pbuffer.c 12 May 2005 07:47:07 -0000 1.16 @@ -93,7 +93,7 @@ } extgl_InitWGL(extensions); if (!wglMakeCurrent(saved_hdc, saved_context)) - printfDebug("ERROR: Could not restore current context\n"); + printfDebugJava(env, "ERROR: Could not restore current context"); closeWindow(&dummy_hwnd, &dummy_hdc); wglDeleteContext(dummy_context); return true; Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/display.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- display.c 21 Feb 2005 14:46:47 -0000 1.3 +++ display.c 12 May 2005 07:47:07 -0000 1.4 @@ -118,7 +118,7 @@ } } } - printfDebug("Found %d displaymodes\n", n); + printfDebugJava(env, "Found %d displaymodes", n); ret = (*env)->NewObjectArray(env, n, displayModeClass, NULL); for (i = 0; i < n; i++) { @@ -155,12 +155,12 @@ if (cdsret != DISP_CHANGE_SUCCESSFUL) { // Failed: so let's check to see if it's a wierd dual screen display - printfDebug("Failed to set display mode... assuming dual monitors\n"); + printfDebugJava(env, "Failed to set display mode... assuming dual monitors"); devmode.dmPelsWidth = width * 2; cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN); if (cdsret != DISP_CHANGE_SUCCESSFUL) { - printfDebug("Failed to set display mode using dual monitors\n"); + printfDebugJava(env, "Failed to set display mode using dual monitors"); throwException(env, "Failed to set display mode."); return; } @@ -227,7 +227,7 @@ // Get the default gamma ramp if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) { - printfDebug("Failed to get initial device gamma\n"); + printfDebugJava(env, "Failed to get initial device gamma"); } memcpy(currentGamma, originalGamma, sizeof(WORD)*GAMMA_SIZE); ReleaseDC(NULL, screenDC); @@ -238,7 +238,7 @@ // Return device gamma to normal HDC screenDC = GetDC(NULL); if (!SetDeviceGammaRamp(screenDC, originalGamma)) { - printfDebug("Could not reset device gamma\n"); + printfDebugJava(env, "Could not reset device gamma"); } ReleaseDC(NULL, screenDC); Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_input_Mouse.c 29 Apr 2005 15:20:19 -0000 1.14 +++ org_lwjgl_input_Mouse.c 12 May 2005 07:47:07 -0000 1.15 @@ -75,7 +75,7 @@ // Function prototypes (defined in the cpp file, since header file is generic across platforms BOOL CALLBACK EnumMouseObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef); -void ShutdownMouse(); +void ShutdownMouse(JNIEnv *env); void InitializeMouseFields(); void UpdateMouseFields(JNIEnv *env, jobject coord_buffer_obj, jobject button_buffer_obj); @@ -123,7 +123,7 @@ //check for > 4 buttons - need to clamp since we're using dx 5 if(mButtoncount > 4) { mButtoncount = 4; - printfDebug("WARNING: Clamping to 4 mouse buttons\n"); + printfDebugJava(env, "WARNING: Clamping to 4 mouse buttons\n"); } return true; } @@ -194,14 +194,14 @@ if (mFirstTimeInitialization) { /* Enumerate capabilities of Mouse */ if (!EnumerateMouseCapabilities(env)) { - ShutdownMouse(); + ShutdownMouse(env); return; } mFirstTimeInitialization = false; } /* Do setup of Mouse */ if (!SetupMouse(env)) { - ShutdownMouse(); + ShutdownMouse(env); return; } created = true; @@ -280,7 +280,7 @@ putMouseEventWithCoords(-1, 0, dx, -dy, dwheel); } -static void readDXBuffer() { +static void readDXBuffer(JNIEnv *env) { DIDEVICEOBJECTDATA rgdod[EVENT_BUFFER_SIZE]; DWORD num_di_events = EVENT_BUFFER_SIZE; @@ -299,19 +299,19 @@ if (ret == DI_OK) { copyDXEvents(num_di_events, rgdod); } else if (ret == DI_BUFFEROVERFLOW) { - printfDebug("Buffer overflowed\n"); + printfDebugJava(env, "Buffer overflowed"); } else if (ret == DIERR_INPUTLOST) { - printfDebug("Input lost\n"); + printfDebugJava(env, "Input lost"); } else if (ret == DIERR_NOTACQUIRED) { - printfDebug("not acquired\n"); + printfDebugJava(env, "not acquired"); } else if (ret == DIERR_INVALIDPARAM) { - printfDebug("invalid parameter\n"); + printfDebugJava(env, "invalid parameter"); } else if (ret == DIERR_NOTBUFFERED) { - printfDebug("not buffered\n"); + printfDebugJava(env, "not buffered"); } else if (ret == DIERR_NOTINITIALIZED) { - printfDebug("not inited\n"); + printfDebugJava(env, "not inited"); } else { - printfDebug("unknown keyboard error\n"); + printfDebugJava(env, "unknown keyboard error"); } } @@ -321,7 +321,7 @@ jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer_obj) + buffer_position; int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer_obj))/sizeof(jint) - buffer_position; if (mouse_grabbed) { - readDXBuffer(); + readDXBuffer(env); } else { handleMessages(); } @@ -345,7 +345,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_destroyMouse(JNIEnv *env, jobject self) { - ShutdownMouse(); + ShutdownMouse(env); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_pollMouse(JNIEnv * env, jobject self, jobject coord_buffer_obj, jobject button_buffer_obj) { @@ -408,17 +408,17 @@ /** * Shutdown DI */ -static void ShutdownMouse() { +static void ShutdownMouse(JNIEnv *env) { // release device if (mDIDevice != NULL) { - printfDebug("Releasing mouse DI device\n"); + printfDebugJava(env, "Releasing mouse DI device"); IDirectInputDevice_Unacquire(mDIDevice); IDirectInputDevice_Release(mDIDevice); mDIDevice = NULL; } // Release DirectInput if (lpdi != NULL) { - printfDebug("Releasing directinput\n"); + printfDebugJava(env, "Releasing directinput"); IDirectInput_Release(lpdi); lpdi = NULL; } @@ -465,7 +465,7 @@ int num_buttons; int buttons_length = (int)(*env)->GetDirectBufferCapacity(env, button_buffer_obj); if (coords_length < 3) { - printfDebug("ERROR: Not enough space in coords array: %d < 3\n", coords_length); + printfDebugJava(env, "ERROR: Not enough space in coords array: %d < 3", coords_length); return; } @@ -485,7 +485,7 @@ if (hRes != DI_OK) return; } else { - printfDebug("Error getting mouse state: %d\n", hRes); + printfDebugJava(env, "Error getting mouse state: %d", hRes); return; } } |