aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sound/joal
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2006-11-23 12:32:49 +0000
committerCarsten Weisse <[email protected]>2006-11-23 12:32:49 +0000
commit49521fc9affd2d9bc15b72c5977cda97009fc684 (patch)
treeb7cb7d03ae3169af9f830f3f4c4600278166a47d /src/jake2/sound/joal
parentb65a4af4324dbb93519f89ce51f24448909c171a (diff)
bugfix: solves the alGenSources problem. the previous versions of lwjgl and joal didn't throw an exception if a sound driver doesn't support 32 sound sources. Now it does and I changed the sound source generation handling.
Diffstat (limited to 'src/jake2/sound/joal')
-rw-r--r--src/jake2/sound/joal/Channel.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/jake2/sound/joal/Channel.java b/src/jake2/sound/joal/Channel.java
index d69afb9..09d2c16 100644
--- a/src/jake2/sound/joal/Channel.java
+++ b/src/jake2/sound/joal/Channel.java
@@ -3,7 +3,7 @@
*
* Copyright (C) 2003
*
- * $Id: Channel.java,v 1.7 2006-10-24 22:51:20 cawe Exp $
+ * $Id: Channel.java,v 1.8 2006-11-23 12:32:49 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -38,6 +38,7 @@ import java.nio.ByteBuffer;
import java.util.*;
import net.java.games.joal.AL;
+import net.java.games.joal.ALException;
/**
* Channel
@@ -108,10 +109,15 @@ public class Channel {
int sourceId;
for (int i = 0; i < MAX_CHANNELS; i++) {
+ try {
al.alGenSources(1, tmp, 0);
sourceId = tmp[0];
-
+ // can't generate more sources
if (sourceId <= 0) break;
+ } catch (ALException e) {
+ // can't generate more sources
+ break;
+ }
sources[i] = sourceId;