aboutsummaryrefslogtreecommitdiffstats
path: root/patch
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2004-10-24 13:35:40 +0000
committerCarsten Weisse <[email protected]>2004-10-24 13:35:40 +0000
commitfa1f6ac360a891685ca446ae3bbd081ad44c979c (patch)
tree12a0959fbf02cb79c8e4655f274e67631fa8cedf /patch
parent14c95b700a0458e49c8f7df69891fe08af503481 (diff)
sorry, the init() method throws an exception if the dlopen fails
so now it works :-)
Diffstat (limited to 'patch')
-rw-r--r--patch/net/java/games/joal/ALFactory.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/patch/net/java/games/joal/ALFactory.java b/patch/net/java/games/joal/ALFactory.java
index 0d55ee5..ee4bc38 100644
--- a/patch/net/java/games/joal/ALFactory.java
+++ b/patch/net/java/games/joal/ALFactory.java
@@ -58,14 +58,17 @@ public class ALFactory {
* able to intialize
*/
public static boolean initialize() throws OpenALException {
- String sep = System.getProperty("file.separator");
- String openalPath = System.getProperty("user.home") + sep + ".jake2";
String osProperty = System.getProperty("os.name");
if (osProperty.startsWith("Win")) {
isInitialized = init(new String[] { "OpenAL32.dll" });
} else if (osProperty.startsWith("Linux")) {
- isInitialized = init(new String[] { "libopenal.so" });
- if (!isInitialized) {
+ try {
+ // use the system wide lib
+ isInitialized = init(new String[] { "libopenal.so" });
+ } catch (OpenALException e) {
+ // fallback to bytonic's libopenal.so
+ String sep = System.getProperty("file.separator");
+ String openalPath = System.getProperty("user.home") + sep + ".jake2";
isInitialized = init(new String[] { openalPath + sep
+ "libopenal.so" });
}