Integrated res folder into JAR

This commit is contained in:
Kai S. K. Engelbart 2019-07-16 18:47:26 +02:00
parent 2108ea7280
commit e092f43fb5
Signed by: kske
GPG Key ID: 8BEB13EC5DF7EF13
2 changed files with 2 additions and 3 deletions

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="res"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="res"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -2,7 +2,6 @@ package dev.kske.minesweeper;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
@ -28,7 +27,7 @@ public class TextureLoader {
public static Image loadScaledImage(String name, int scale) {
BufferedImage in = null;
try {
in = ImageIO.read(new File("res" + File.separator + name + ".png"));
in = ImageIO.read(TextureLoader.class.getResourceAsStream("/" + name + ".png"));
} catch (IOException e) {
e.printStackTrace();
}