|
From: Elias N. <eli...@us...> - 2003-03-24 11:56:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv22996/src/native/common Modified Files: extal.cpp org_lwjgl_openal_ALC.cpp Log Message: Fixed Brian's bugs Index: extal.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extal.cpp 23 Mar 2003 12:52:11 -0000 1.1 +++ extal.cpp 24 Mar 2003 11:56:05 -0000 1.2 @@ -168,30 +168,26 @@ #ifdef _DEBUG printf("Found %d OpenAL paths\n", pathcount); #endif -#ifdef _WIN32 for(int i=0;i<pathcount;i++) { jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i); + const char *path_str = env->GetStringUTFChars(path, NULL); #ifdef _DEBUG - printf("Testing '%s'\n", env->GetStringUTFChars(path, NULL)); + printf("Testing '%s'\n", path_str); #endif - handleOAL = LoadLibrary(env->GetStringUTFChars(path, NULL)); +#ifdef _WIN32 + handleOAL = LoadLibrary(path_str); +#endif +#ifdef _X11 + handleOAL = dlopen(path_str, RTLD_LAZY); +#endif if (handleOAL != NULL) { #ifdef _DEBUG - printf("Found OpenAL at '%s'\n", env->GetStringUTFChars(path, NULL)); + printf("Found OpenAL at '%s'\n", path_str); #endif break; } + env->ReleaseStringUTFChars(path, path_str); } -#endif -#ifdef _X11 - for(int i=0;i<pathcount;i++) { - jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i); - handleOAL = dlopen(env->GetStringUTFChars(path, NULL), RTLD_LAZY); - if (handleOAL != NULL) { - break; - } - } -#endif } /** @@ -199,10 +195,10 @@ */ void UnLoadOpenAL() { #ifdef _WIN32 - //FreeLibrary(handleOAL); + FreeLibrary(handleOAL); #endif #ifdef _X11 - dlclose(handleOAL); + dlclose(handleOAL); #endif } Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_ALC.cpp 17 Mar 2003 18:34:43 -0000 1.5 +++ org_lwjgl_openal_ALC.cpp 24 Mar 2003 11:56:05 -0000 1.6 @@ -387,4 +387,4 @@ CHECK_ALC_ERROR return result; -} \ No newline at end of file +} |