From 32c00ef88c43cb65a1b32b4d22eefa679ba3865d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 22 Feb 2016 15:28:09 +0100 Subject: RustAndDust: fix db file path --- core/src/ch/asynk/rustanddust/RustAndDust.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/RustAndDust.java b/core/src/ch/asynk/rustanddust/RustAndDust.java index d11f828..759f72c 100644 --- a/core/src/ch/asynk/rustanddust/RustAndDust.java +++ b/core/src/ch/asynk/rustanddust/RustAndDust.java @@ -62,7 +62,7 @@ public class RustAndDust extends Game public static final String DOM = "RustAndDust"; - public static final String DB_FILE = "data/rustanddust.sqlite"; + public static final String DB_FILE = "rustanddust.sqlite"; public AssetManager manager; public Factory factory; @@ -112,6 +112,15 @@ public class RustAndDust extends Game return uiAtlas.findRegion(s); } + private String dbFile() + { + switch (Gdx.app.getType()) { + case Desktop: + return String.format("data/%s", DB_FILE); + } + return DB_FILE; + } + @Override public void create () { @@ -119,7 +128,7 @@ public class RustAndDust extends Game this.hudCorrection = ((int) (125 * Gdx.graphics.getDensity()) - 75); debug("create() [" + Gdx.graphics.getWidth() + ";" + Gdx.graphics.getHeight() + "] " + Gdx.graphics.getDensity() + " -> " + hudCorrection); - db = new DB(Gdx.files.internal(DB_FILE).path(), true); + db = new DB(Gdx.files.internal(dbFile()).path(), true); db.setup(); manager = new AssetManager(); -- cgit v1.1-2-g2b99