Update of /cvsroot/jake2/jake2/src/jake2/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8929/src/jake2/sound
Modified Files:
S.java
Log Message:
checks the runtime package for sound drivers
Index: S.java
===================================================================
RCS file: /cvsroot/jake2/jake2/src/jake2/sound/S.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** S.java 16 Dec 2004 20:17:55 -0000 1.4
--- S.java 16 Dec 2004 21:11:56 -0000 1.5
***************
*** 45,51 ****
static {
try {
Class.forName("jake2.sound.DummyDriver");
! Class.forName("jake2.sound.joal.JOALSoundImpl");
! Class.forName("jake2.sound.lwjgl.LWJGLSoundImpl");
}
catch (Throwable e) {
--- 45,62 ----
static {
try {
+ // dummy driver (no sound)
Class.forName("jake2.sound.DummyDriver");
! try {
! Class.forName("net.java.games.joal.AL");
! Class.forName("jake2.sound.joal.JOALSoundImpl");
! } catch (ClassNotFoundException e) {
! // ignore the joal driver if runtime not in classpath
! }
! try {
! Class.forName("org.lwjgl.openal.AL");
! Class.forName("jake2.sound.lwjgl.LWJGLSoundImpl");
! } catch (ClassNotFoundException e) {
! // ignore the lwjgl driver if runtime not in classpath
! }
}
catch (Throwable e) {
***************
*** 87,91 ****
}
! s_impl = Cvar.Get("s_impl", "joal", Defines.CVAR_ARCHIVE);
useDriver(s_impl.string);
--- 98,108 ----
}
! // set the first driver after dummy as default
! String defaultDriver = "dummy";
! if (drivers.size() > 1){
! defaultDriver = ((Sound)drivers.elementAt(1)).getName();
! }
!
! s_impl = Cvar.Get("s_impl", defaultDriver, Defines.CVAR_ARCHIVE);
useDriver(s_impl.string);
***************
*** 189,191 ****
return impl.getName();
}
! }
--- 206,208 ----
return impl.getName();
}
! }
\ No newline at end of file
|