diff options
author | Carsten Weisse <[email protected]> | 2005-04-26 22:16:34 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2005-04-26 22:16:34 +0000 |
commit | a0442c3826bedf32cb596862d883dff1316b80be (patch) | |
tree | 39adee9384f538dec3810093071a0b9ce8e0ef6a /src | |
parent | 60bf8f9a05c2431404de68d8b3b4caefbb1f6ffe (diff) |
code clean up
Diffstat (limited to 'src')
-rw-r--r-- | src/jake2/sound/WaveLoader.java | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/jake2/sound/WaveLoader.java b/src/jake2/sound/WaveLoader.java index a5aad55..b207001 100644 --- a/src/jake2/sound/WaveLoader.java +++ b/src/jake2/sound/WaveLoader.java @@ -2,7 +2,7 @@ * SND_MEM.java * Copyright (C) 2004 * - * $Id: WaveLoader.java,v 1.3 2004-11-03 20:15:02 hzi Exp $ + * $Id: WaveLoader.java,v 1.4 2005-04-26 22:16:34 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -56,44 +56,36 @@ public class WaveLoader { ============== */ public static sfxcache_t LoadSound(sfx_t s) { - String namebuffer; - byte[] data; - wavinfo_t info; - int len; - float stepscale; - sfxcache_t sc = null; - int size; - String name; - if (s.name.charAt(0) == '*') return null; // see if still in memory - sc = s.cache; + sfxcache_t sc = s.cache; if (sc != null) return sc; + String name; // load it in if (s.truename != null) name = s.truename; else name = s.name; + String namebuffer; if (name.charAt(0) == '#') namebuffer = name.substring(1); - else namebuffer = "sound/" + name; - data = FS.LoadFile(namebuffer); + byte[] data = FS.LoadFile(namebuffer); if (data == null) { Com.DPrintf("Couldn't load " + namebuffer + "\n"); return null; } - size = data.length; + int size = data.length; - info = GetWavinfo(s.name, data, size); + wavinfo_t info = GetWavinfo(s.name, data, size); AudioInputStream in = null; AudioInputStream out = null; |