summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--android/src/ch/asynk/rustanddust/android/AndroidBackend.java15
-rw-r--r--android/src/ch/asynk/rustanddust/android/AndroidLauncher.java17
-rw-r--r--core/src/ch/asynk/rustanddust/Backend.java5
-rw-r--r--core/src/ch/asynk/rustanddust/RustAndDust.java6
-rw-r--r--desktop/src/ch/asynk/rustanddust/desktop/DesktopBackend.java10
-rw-r--r--desktop/src/ch/asynk/rustanddust/desktop/DesktopLauncher.java2
6 files changed, 47 insertions, 8 deletions
diff --git a/android/src/ch/asynk/rustanddust/android/AndroidBackend.java b/android/src/ch/asynk/rustanddust/android/AndroidBackend.java
new file mode 100644
index 0000000..c1650ad
--- /dev/null
+++ b/android/src/ch/asynk/rustanddust/android/AndroidBackend.java
@@ -0,0 +1,15 @@
+package ch.asynk.rustanddust.android;
+
+import android.app.Application;
+
+import ch.asynk.rustanddust.Backend;
+
+public class AndroidBackend implements Backend
+{
+ private Application app;
+
+ public AndroidBackend(Application app)
+ {
+ this.app = app;
+ }
+}
diff --git a/android/src/ch/asynk/rustanddust/android/AndroidLauncher.java b/android/src/ch/asynk/rustanddust/android/AndroidLauncher.java
index 46f2da9..a60693e 100644
--- a/android/src/ch/asynk/rustanddust/android/AndroidLauncher.java
+++ b/android/src/ch/asynk/rustanddust/android/AndroidLauncher.java
@@ -4,13 +4,16 @@ import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
+
import ch.asynk.rustanddust.RustAndDust;
+import ch.asynk.rustanddust.Backend;
-public class AndroidLauncher extends AndroidApplication {
- @Override
- protected void onCreate (Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
- initialize(new RustAndDust(), config);
- }
+public class AndroidLauncher extends AndroidApplication
+{
+ @Override
+ protected void onCreate (Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
+ initialize(new RustAndDust(new AndroidBackend(this.getApplication())), config);
+ }
}
diff --git a/core/src/ch/asynk/rustanddust/Backend.java b/core/src/ch/asynk/rustanddust/Backend.java
new file mode 100644
index 0000000..357304f
--- /dev/null
+++ b/core/src/ch/asynk/rustanddust/Backend.java
@@ -0,0 +1,5 @@
+package ch.asynk.rustanddust;
+
+public interface Backend
+{
+}
diff --git a/core/src/ch/asynk/rustanddust/RustAndDust.java b/core/src/ch/asynk/rustanddust/RustAndDust.java
index 9334123..146b982 100644
--- a/core/src/ch/asynk/rustanddust/RustAndDust.java
+++ b/core/src/ch/asynk/rustanddust/RustAndDust.java
@@ -61,6 +61,7 @@ public class RustAndDust extends Game
public Ctrl ctrl;
public Config config;
public int hudCorrection;
+ public Backend backend;
public TextureAtlas uiAtlas;
public BitmapFont font;
@@ -74,6 +75,11 @@ public class RustAndDust extends Game
}
private State state;
+ public RustAndDust(Backend backend)
+ {
+ this.backend = backend;
+ }
+
public static void debug(String msg)
{
Gdx.app.debug(DOM, msg);
diff --git a/desktop/src/ch/asynk/rustanddust/desktop/DesktopBackend.java b/desktop/src/ch/asynk/rustanddust/desktop/DesktopBackend.java
new file mode 100644
index 0000000..4b54056
--- /dev/null
+++ b/desktop/src/ch/asynk/rustanddust/desktop/DesktopBackend.java
@@ -0,0 +1,10 @@
+package ch.asynk.rustanddust.desktop;
+
+import ch.asynk.rustanddust.Backend;
+
+public class DesktopBackend implements Backend
+{
+ public DesktopBackend()
+ {
+ }
+}
diff --git a/desktop/src/ch/asynk/rustanddust/desktop/DesktopLauncher.java b/desktop/src/ch/asynk/rustanddust/desktop/DesktopLauncher.java
index 439e4f1..c1ab457 100644
--- a/desktop/src/ch/asynk/rustanddust/desktop/DesktopLauncher.java
+++ b/desktop/src/ch/asynk/rustanddust/desktop/DesktopLauncher.java
@@ -13,6 +13,6 @@ public class DesktopLauncher {
config.height = 768;
// config.fullscreen = true;
config.addIcon("data/icon.png", Files.FileType.Internal);
- new LwjglApplication(new RustAndDust(), config);
+ new LwjglApplication(new RustAndDust(new DesktopBackend()), config);
}
}