Update of /cvsroot/jake2/jake2/src/jake2/sound/joal
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28847/src/jake2/sound/joal
Modified Files:
Channel.java
Log Message:
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.
Index: Channel.java
===================================================================
RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/Channel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Channel.java 24 Oct 2006 22:51:20 -0000 1.7
--- Channel.java 23 Nov 2006 12:32:49 -0000 1.8
***************
*** 39,42 ****
--- 39,43 ----
import net.java.games.joal.AL;
+ import net.java.games.joal.ALException;
/**
***************
*** 109,116 ****
for (int i = 0; i < MAX_CHANNELS; i++) {
al.alGenSources(1, tmp, 0);
sourceId = tmp[0];
!
if (sourceId <= 0) break;
sources[i] = sourceId;
--- 110,122 ----
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;
|