From fa1f6ac360a891685ca446ae3bbd081ad44c979c Mon Sep 17 00:00:00 2001 From: Carsten Weisse Date: Sun, 24 Oct 2004 13:35:40 +0000 Subject: sorry, the init() method throws an exception if the dlopen fails so now it works :-) --- patch/net/java/games/joal/ALFactory.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'patch/net/java') 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" }); } -- cgit v1.2.3