Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28847/src/jake2/sound/lwjgl
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/lwjgl/Channel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Channel.java 26 Oct 2006 22:02:55 -0000 1.9
--- Channel.java 23 Nov 2006 12:32:49 -0000 1.10
***************
*** 110,118 ****
for (int i = 0; i < MAX_CHANNELS; i++) {
! AL10.alGenSources(tmp);
! sourceId = tmp.get(0);
!
! // can't generate more sources
! if (sourceId <= 0) break;
sources.put(i, sourceId);
--- 110,122 ----
for (int i = 0; i < MAX_CHANNELS; i++) {
! try {
! AL10.alGenSources(tmp);
! sourceId = tmp.get(0);
! // can't generate more sources
! if (sourceId <= 0) break;
! } catch (OpenALException e) {
! // can't generate more sources
! break;
! }
sources.put(i, sourceId);
|