diff --git a/Export/android/app/build.gradle b/Export/android/app/build.gradle index 51f8e628..97e5df60 100644 --- a/Export/android/app/build.gradle +++ b/Export/android/app/build.gradle @@ -17,7 +17,7 @@ android { externalNativeBuild { cmake { cppFlags '-lstdc++' - arguments "-DANDROID_LD=lld" + arguments "-DANDROID_LD=lld",'-DANDROID_PLATFORM=android-24' } } } @@ -27,6 +27,7 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + debuggable true } } compileOptions { diff --git a/Export/android/app/src/main/AndroidManifest.xml b/Export/android/app/src/main/AndroidManifest.xml index e23ff63f..2e1f3eab 100644 --- a/Export/android/app/src/main/AndroidManifest.xml +++ b/Export/android/app/src/main/AndroidManifest.xml @@ -9,11 +9,17 @@ + + + + + android:hardwareAccelerated="true" + android:usesCleartextTraffic="true" + android:debuggable="true"> ) { + if (!hasPad) + return false; for (button in buttons) { var buttonId = getId(button); if (buttonId < 0 || buttonId > gamepad.buttons.length) @@ -79,6 +84,8 @@ class Gamepad { } public static function isPressed(buttons:Array) { + if (!hasPad) + return false; for (button in buttons) { var buttonId = getId(button); if (buttonId < 0 || buttonId > gamepad.buttons.length) @@ -90,6 +97,8 @@ class Gamepad { } public static function isReleased(buttons:Array) { + if (!hasPad) + return false; for (button in buttons) { var buttonId = getId(button); if (buttonId < 0 || buttonId > gamepad.buttons.length) @@ -101,6 +110,8 @@ class Gamepad { } public static function getAxis(axis:String) { + if (!hasPad) + return 0.0; switch (axis) { case "analogX": return gamepad.xAxis; diff --git a/src/Http.hx b/src/Http.hx index f0663c00..7f5f2d20 100644 --- a/src/Http.hx +++ b/src/Http.hx @@ -40,14 +40,17 @@ class Http { cancellationMutex.release(); var http = new sys.Http(req.url); http.onError = (e) -> { + trace('HTTP Request Failed: ' + req.url); responses.add(() -> req.errCallback(e)); req.fulfilled = true; }; http.onBytes = (b) -> { + trace('HTTP Request Succeeded: ' + req.url); responses.add(() -> req.callback(b)); req.fulfilled = true; }; hl.Gc.blocking(true); // Wtf is this shit + trace('HTTP Request: ' + req.url); http.request(false); hl.Gc.blocking(false); } diff --git a/src/Marble.hx b/src/Marble.hx index 588bc650..2f5db9ca 100644 --- a/src/Marble.hx +++ b/src/Marble.hx @@ -1765,7 +1765,7 @@ class Marble extends GameObject { || Gamepad.isDown(Settings.gamepadSettings.jump)) { move.jump = true; } - if (Key.isDown(Settings.controlsSettings.powerup) + if ((!Util.isTouchDevice() && Key.isDown(Settings.controlsSettings.powerup)) || (Util.isTouchDevice() && MarbleGame.instance.touchInput.powerupButton.pressed) || Gamepad.isDown(Settings.gamepadSettings.powerup)) { move.powerup = true; diff --git a/src/MarbleWorld.hx b/src/MarbleWorld.hx index a0b1eb57..49c740f8 100644 --- a/src/MarbleWorld.hx +++ b/src/MarbleWorld.hx @@ -275,18 +275,17 @@ class MarbleWorld extends Scheduler { public function postInit() { // Add the sky at the last so that cubemap reflections work - this.playGui.init(this.scene2d, this.mission.game.toLowerCase(), () -> { - // this.scene.addChild(this.sky); TODO FIX ANDROID - this._ready = true; - var musicFileName = 'data/sound/music/' + this.mission.missionInfo.music; - AudioManager.playMusic(ResourceLoader.getResource(musicFileName, ResourceLoader.getAudio, this.soundResources), this.mission.missionInfo.music); - MarbleGame.canvas.clearContent(); - if (this.endPad != null) - this.endPad.generateCollider(); - this.playGui.formatGemCounter(this.gemCount, this.totalGems); - Console.log("MISSION LOADED"); - start(); - }); + this.playGui.init(this.scene2d, this.mission.game.toLowerCase()); + this.scene.addChild(this.sky); // TODO FIX ANDROID + this._ready = true; + var musicFileName = 'data/sound/music/' + this.mission.missionInfo.music; + AudioManager.playMusic(ResourceLoader.getResource(musicFileName, ResourceLoader.getAudio, this.soundResources), this.mission.missionInfo.music); + MarbleGame.canvas.clearContent(); + if (this.endPad != null) + this.endPad.generateCollider(); + this.playGui.formatGemCounter(this.gemCount, this.totalGems); + Console.log("MISSION LOADED"); + start(); } public function initScene(onFinish:Void->Void) { diff --git a/src/ResourceLoader.hx b/src/ResourceLoader.hx index 61605ca0..de4a2e52 100644 --- a/src/ResourceLoader.hx +++ b/src/ResourceLoader.hx @@ -564,7 +564,7 @@ class ResourceLoader { zipFilesystem.clear(); // We are only allowed to load one zip for (entry in entries) { var fname = entry.fileName.toLowerCase(); - #if sys + #if (sys && !android) fname = "data/" + fname; #end if (game == 'gold')