mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 06:25:46 +00:00
old resource loading was buggy?
This commit is contained in:
parent
fa26d83aae
commit
2305247ac1
2 changed files with 3 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue