summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c004c0)
raw | patch | inline | side by side (parent: 1c004c0)
author | fredboy <fredboy@protonmail.com> | |
Sat, 20 Apr 2024 15:37:01 +0000 (22:37 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Sat, 20 Apr 2024 15:37:01 +0000 (22:37 +0700) |
diff --git a/core/src/ru/deadsoftware/cavedroid/CaveGame.java b/core/src/ru/deadsoftware/cavedroid/CaveGame.java
index 1c1679145d6a70bf8a73948ace2e76f3f3ba06c0..42533236e2794d906b6392480ecbd593f4dc5c25 100644 (file)
package ru.deadsoftware.cavedroid;
+import com.badlogic.gdx.Application;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import ru.deadsoftware.cavedroid.game.GameItems;
mMainConfig.setHeight(height);
mMainConfig.setShowInfo(mDebug);
mMainConfig.setAssetsPackPath(mAssetsPackPath);
+
+ if (mDebug) {
+ Gdx.app.setLogLevel(Application.LOG_DEBUG);
+ } else {
+ Gdx.app.setLogLevel(Application.LOG_ERROR);
+ }
}
public void newGame(int gameMode) {
diff --git a/desktop/build.gradle b/desktop/build.gradle
index 57fae418b7fbd7e2f47c036681b5f841f9991a05..94e48c3ebf7ff14595b2d925a2770d567a44479a 100644 (file)
--- a/desktop/build.gradle
+++ b/desktop/build.gradle
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true as JavaExecSpec
+ args "--debug"
}
task runTouch(dependsOn: classes, type: JavaExec) {
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true as JavaExecSpec
- args "--touch"
+ args "--touch --debug"
}
task debug(dependsOn: classes, type: JavaExec) {
diff --git a/desktop/src/ru/deadsoftware/cavedroid/desktop/DesktopLauncher.java b/desktop/src/ru/deadsoftware/cavedroid/desktop/DesktopLauncher.java
index 025beb484ed0e573abf795d267d3705feac6ee7b..fe78235dd8fe5bc0ec937561b82ae1a9b4f6e87e 100644 (file)
import ru.deadsoftware.cavedroid.CaveGame;
class DesktopLauncher {
- public static void main (String[] arg) {
- Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
- config.setWindowIcon(Files.FileType.Internal, "icons/icon256.png", "icons/icon128.png");
+ public static void main(String[] arg) {
+ Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
+ config.setWindowIcon(Files.FileType.Internal, "icons/icon256.png", "icons/icon128.png");
config.setTitle("CaveDroid");
- config.setWindowedMode(960, 540);
- config.useVsync(true);
+ config.setWindowedMode(960, 540);
+ config.useVsync(true);
- boolean touch = false;
- String assetsPath = null;
+ boolean touch = false;
+ boolean debug = false;
+ String assetsPath = null;
- for (String anArg : arg) {
+ for (String anArg : arg) {
if (anArg.equals("--touch")) {
touch = true;
}
- if (anArg.startsWith("--assets")) {
- String[] splitArg = anArg.split("=");
- if (splitArg.length >= 2) {
- assetsPath = splitArg[1];
- }
- }
- }
-
- new Lwjgl3Application(
- new CaveGame(
- System.getProperty("user.home") + "/.cavedroid",
- touch,
- assetsPath),
- config
- );
- }
+ if (anArg.equals("--debug")) {
+ debug = true;
+ }
+
+ if (anArg.startsWith("--assets")) {
+ String[] splitArg = anArg.split("=");
+ if (splitArg.length >= 2) {
+ assetsPath = splitArg[1];
+ }
+ }
+ }
+
+ CaveGame caveGame = new CaveGame(System.getProperty("user.home") + "/.cavedroid", touch, assetsPath);
+ caveGame.setDebug(debug);
+
+ new Lwjgl3Application(caveGame, config);
+ }
}