Changeset b2d7893 in lost-haven for main/Map.java


Ignore:
Timestamp:
Feb 20, 2021, 6:43:24 PM (4 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
4d8825f
Parents:
a49176d
Message:

Change all file paths to work from inside a JAR and update the makefile to correctly build the project

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/Map.java

    ra49176d rb2d7893  
    1919    if (readMapFromImage) {
    2020      try {
    21         BufferedImage img = ImageIO.read(getClass().getResource("../images/" + mapFile));
     21        BufferedImage img = ImageIO.read(getClass().getResource("/images/" + mapFile));
    2222        int length = img.getHeight();
    2323        int height = img.getWidth();
     
    101101    } else {
    102102      try {
    103         BufferedReader in = new BufferedReader(new FileReader("../" + mapFile));
     103        BufferedReader in = new BufferedReader(new FileReader("/" + mapFile));
    104104        String str = in.readLine();
    105105        int length = Integer.parseInt(str.substring(0, str.indexOf("x")));
Note: See TracChangeset for help on using the changeset viewer.