fix: inclusion des librairies, debogueage sous android, correction de bogues

This commit is contained in:
Nicolas Hordé 2016-01-17 23:29:37 +01:00
parent c3d7ec0281
commit 95fc31301a
6 changed files with 20 additions and 2 deletions

BIN
core/libs/gdx-sqlite.jar Normal file

Binary file not shown.

View File

@ -27,7 +27,7 @@ import com.badlogic.gdx.utils.ObjectMap.Values;
import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.ScalingViewport; import com.badlogic.gdx.utils.viewport.ScalingViewport;
import com.badlogic.gdx.utils.viewport.StretchViewport; import com.badlogic.gdx.utils.viewport.StretchViewport;
import com.badlogic.gdx.Application;
import fr.evolving.automata.Inverter_I; import fr.evolving.automata.Inverter_I;
import fr.evolving.automata.Inverter_II; import fr.evolving.automata.Inverter_II;
import fr.evolving.automata.Negativer; import fr.evolving.automata.Negativer;
@ -222,6 +222,7 @@ public class AssetLoader {
Datahandler.RegisterBackend(LocalBase.class); Datahandler.RegisterBackend(LocalBase.class);
Datahandler.RegisterBackend(SqlBase.class); Datahandler.RegisterBackend(SqlBase.class);
Databasemanagerfrompref(); Databasemanagerfrompref();
Gdx.app.log("init", "Ok");
} }
public static void Databasemanagerfrompref() { public static void Databasemanagerfrompref() {

View File

@ -55,7 +55,7 @@ public class Preference {
Preference.prefs.putFloat("Music", 0.75f); Preference.prefs.putFloat("Music", 0.75f);
Preference.prefs.putInteger("Adaptation", 0); Preference.prefs.putInteger("Adaptation", 0);
Preference.prefs.putInteger("Quality", 2); Preference.prefs.putInteger("Quality", 2);
Preference.prefs.putInteger("log", Gdx.app.LOG_DEBUG); Preference.prefs.putInteger("log", Application.LOG_DEBUG);
Preference.prefs.flush(); Preference.prefs.flush();
} }
} }

View File

@ -317,19 +317,29 @@ public class LocalBase extends Base {
public boolean setGrid(int user, int level, Grid data) { public boolean setGrid(int user, int level, Grid data) {
String encoded = ""; String encoded = "";
try { try {
Gdx.app.log("Base", "Infos:"+user+","+level);
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
Gdx.app.log("Base", "CK1");
ObjectOutputStream oos = new ObjectOutputStream(bos); ObjectOutputStream oos = new ObjectOutputStream(bos);
Gdx.app.log("Base", "CK2");
oos.writeObject(data); oos.writeObject(data);
Gdx.app.log("Base", "CK3");
oos.flush(); oos.flush();
Gdx.app.log("Base", "CK4");
oos.close(); oos.close();
bos.close(); bos.close();
byte[] bytes = bos.toByteArray(); byte[] bytes = bos.toByteArray();
Gdx.app.log("Base", "size"+bytes.length);
encoded = Base64Coder.encodeLines(bytes); encoded = Base64Coder.encodeLines(bytes);
Gdx.app.log("Base", "size2"+encoded.length());
dbHandler.rawQuery("insert into grids (user,level,object) values (" dbHandler.rawQuery("insert into grids (user,level,object) values ("
+ user + "," + level + ",'" + encoded + "');"); + user + "," + level + ",'" + encoded + "');");
Gdx.app.log("Base", "CK5");
} catch (Exception e) { } catch (Exception e) {
Gdx.app.log("Base", "cancel");
return false; return false;
} }
Gdx.app.log("Base", "Ok");
return true; return true;
} }

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Application.ApplicationType; import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Game; import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
@ -197,6 +198,7 @@ public class GameScreen implements Screen {
// This is the constructor, not the class declaration // This is the constructor, not the class declaration
public GameScreen(Level alevel) { public GameScreen(Level alevel) {
Gdx.app.log("game", "Ok");
this.level = alevel; this.level = alevel;
Gdx.app.debug(getClass().getSimpleName(), Gdx.app.debug(getClass().getSimpleName(),
"Récupération des derniers niveaux."); "Récupération des derniers niveaux.");
@ -865,6 +867,9 @@ public class GameScreen implements Screen {
if (winSave.isVisible()) if (winSave.isVisible())
readsaved(); readsaved();
} else if (caller.getName() == "save") { } else if (caller.getName() == "save") {
Gdx.app.log("save", "Ok");
Gdx.app.debug("Barre", "Sauvegarde de la grille.");
Gdx.app.debug("Barre", AssetLoader.Datahandler.user().toString());
AssetLoader.Datahandler.user().setGrid(0, level.id, level.Grid); AssetLoader.Datahandler.user().setGrid(0, level.id, level.Grid);
readsaved(); readsaved();
} else if (caller.getName() == "levels") { } else if (caller.getName() == "levels") {

View File

@ -6,6 +6,7 @@ import java.util.TimerTask;
import com.badlogic.gdx.Game; import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen; import com.badlogic.gdx.Screen;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.Stage;
@ -278,6 +279,7 @@ public class LevelScreen implements Screen {
} }
public LevelScreen(int aworld) { public LevelScreen(int aworld) {
Gdx.app.log("level", "Ok");
this.world = aworld; this.world = aworld;
Gdx.app.debug(getClass().getSimpleName(), Gdx.app.debug(getClass().getSimpleName(),
"Création des elements primordiaux du screen (stage, renderer, table)"); "Création des elements primordiaux du screen (stage, renderer, table)");