From: Carsten W. <ca...@us...> - 2005-04-26 20:18:08
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14747/src/jake2/sound/joal Modified Files: JOALSoundImpl.java Log Message: bugfix: very stupid sound registration ;-) now the dynamic sounds (weapons) will be loaded only once. This solves the lwjgl crash too. Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JOALSoundImpl.java 3 Nov 2004 12:17:17 -0000 1.10 --- JOALSoundImpl.java 26 Apr 2005 20:17:54 -0000 1.11 *************** *** 510,515 **** */ public sfxcache_t LoadSound(sfx_t s) { sfxcache_t sc = WaveLoader.LoadSound(s); ! initBuffer(s); return sc; } --- 510,519 ---- */ public sfxcache_t LoadSound(sfx_t s) { + if (s.isCached) return s.cache; sfxcache_t sc = WaveLoader.LoadSound(s); ! if (sc != null) { ! initBuffer(s); ! s.isCached = true; ! } return sc; } *************** *** 519,525 **** */ public void StartLocalSound(String sound) { ! sfx_t sfx; ! ! sfx = RegisterSound(sound); if (sfx == null) { Com.Printf("S_StartLocalSound: can't cache " + sound + "\n"); --- 523,527 ---- */ public void StartLocalSound(String sound) { ! sfx_t sfx = RegisterSound(sound); if (sfx == null) { Com.Printf("S_StartLocalSound: can't cache " + sound + "\n"); |