old resource loading was buggy?

This commit is contained in:
Brian Matzon 2003-06-17 21:24:48 +00:00
parent fa26d83aae
commit 2305247ac1
2 changed files with 3 additions and 5 deletions

View file

@ -91,7 +91,7 @@ public class WaveData {
try {
return create(
AudioSystem.getAudioInputStream(
new BufferedInputStream(ClassLoader.getSystemClassLoader().getResourceAsStream(filepath))));
new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filepath))));
} catch (Exception e) {
e.printStackTrace();
return null;

View file

@ -45,7 +45,6 @@ import org.lwjgl.input.*;
import org.lwjgl.opengl.*;
import org.lwjgl.*;
import java.net.*;
import java.io.*;
import java.nio.*;
import java.util.*;
@ -115,9 +114,8 @@ public class Grass {
int next;
java.util.Vector bytes = new java.util.Vector();
try {
ClassLoader loader = ClassLoader.getSystemClassLoader();
URL url = loader.getResource(file);
InputStream stream = new BufferedInputStream(url.openStream());
ClassLoader loader = Grass.class.getClassLoader();
InputStream stream = new BufferedInputStream(loader.getResourceAsStream(file));
while ((next = (stream.read())) != -1)
bytes.add(new Byte((byte) next));
stream.close();