aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sound/lwjgl
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-04-26 20:17:54 +0000
committerCarsten Weisse <[email protected]>2005-04-26 20:17:54 +0000
commit60bf8f9a05c2431404de68d8b3b4caefbb1f6ffe (patch)
treecee141f7d66792cc0d6bd5a17b5671b563c5c13f /src/jake2/sound/lwjgl
parentce4513e421be446829008cab1547bca01066f3e6 (diff)
bugfix: very stupid sound registration ;-)
now the dynamic sounds (weapons) will be loaded only once. This solves the lwjgl crash too.
Diffstat (limited to 'src/jake2/sound/lwjgl')
-rw-r--r--src/jake2/sound/lwjgl/LWJGLSoundImpl.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jake2/sound/lwjgl/LWJGLSoundImpl.java b/src/jake2/sound/lwjgl/LWJGLSoundImpl.java
index eb8ed8c..3936b87 100644
--- a/src/jake2/sound/lwjgl/LWJGLSoundImpl.java
+++ b/src/jake2/sound/lwjgl/LWJGLSoundImpl.java
@@ -2,7 +2,7 @@
* LWJGLSoundImpl.java
* Copyright (C) 2004
*
- * $Id: LWJGLSoundImpl.java,v 1.4 2004-12-23 00:52:12 cawe Exp $
+ * $Id: LWJGLSoundImpl.java,v 1.5 2005-04-26 20:17:54 cawe Exp $
*/
package jake2.sound.lwjgl;
@@ -481,8 +481,12 @@ public final class LWJGLSoundImpl implements Sound {
==============
*/
public sfxcache_t LoadSound(sfx_t s) {
+ if (s.isCached) return s.cache;
sfxcache_t sc = WaveLoader.LoadSound(s);
- initBuffer(s);
+ if (sc != null) {
+ initBuffer(s);
+ s.isCached = true;
+ }
return sc;
}