mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-24 00:42:46 +00:00
android fixes
This commit is contained in:
parent
2e7836bd7a
commit
f93b363808
13 changed files with 40 additions and 17 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,17 @@
|
|||
|
||||
<!-- Tell the system this app requires OpenGL ES 3.0. -->
|
||||
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
|
||||
|
||||
<application android:label="@string/app_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:hardwareAccelerated="true">
|
||||
android:hardwareAccelerated="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:debuggable="true">
|
||||
|
||||
<activity android:name="org.haxe.HashLinkActivity"
|
||||
android:label="@string/app_name"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
by30:data%2Ffont%2FArial%20Bold.fntaoy3:outy44:data%2Ftmp%2Fdata%2Ffont%2FArial%20Bold.bfnty3:veri1y4:hashy40:dce4a5edf92262f9ea5540d55271f8423683d064y4:timei1659272757ghy21:font%2FDomCasualD.fntaoR1y28:tmp%2Ffont%2FDomCasualD.bfntR3i1R4y40:ea40ffbf969a51d3e653a3d09b450143a814c7eeR6i1659272757ghy16:font%2FEXPON.fntaoR1y23:tmp%2Ffont%2FEXPON.bfntR3i1R4y40:ba8ecd55d9475ee0f9d20c9a5189fe6a9c9ff727R6i1659272757ghy27:font%2FLucida%20Console.fntaoR1y34:tmp%2Ffont%2FLucida%20Console.bfntR3i1R4y40:b56483df1b8f3d8472856b51459d5ce8f3cdfa09R6i1675969447ghy23:font%2FArial%20Bold.fntaoR1y30:tmp%2Ffont%2FArial%20Bold.bfntR3i1R4R5R6i1659272757ghy28:data%2Ffont%2FMarkerFelt.fntaoR1y42:data%2Ftmp%2Fdata%2Ffont%2FMarkerFelt.bfntR3i1R4y40:eb239790210478413cc111da54400b3d38aba041R6i1675969447ghy16:font%2Farial.fntaoR1y23:tmp%2Ffont%2Farial.bfntR3i1R4y40:dc7f069d72e0d1b6b7edfd5b9e6af9c22f9c641cR6i1659272757ghy28:data%2Ffont%2FDomCasualD.fntaoR1y42:data%2Ftmp%2Fdata%2Ffont%2FDomCasualD.bfntR3i1R4R9R6i1659272757ghy34:data%2Ffont%2FLucida%20Console.fntaoR1y48:data%2Ftmp%2Fdata%2Ffont%2FLucida%20Console.bfntR3i1R4R15R6i1675969447ghy21:font%2FMarkerFelt.fntaoR1y28:tmp%2Ffont%2FMarkerFelt.bfntR3i1R4R20R6i1675969447ghy23:data%2Ffont%2FEXPON.fntaoR1y37:data%2Ftmp%2Fdata%2Ffont%2FEXPON.bfntR3i1R4R12R6i1659272757ghy23:data%2Ffont%2Farial.fntaoR1y37:data%2Ftmp%2Fdata%2Ffont%2Farial.bfntR3i1R4R23R6i1659272757ghh
|
||||
by16:font%2Farial.fntaoy3:veri1y4:timei1659272757y4:hashy40:dc7f069d72e0d1b6b7edfd5b9e6af9c22f9c641cy3:outy23:tmp%2Ffont%2Farial.bfntghy21:font%2FMarkerFelt.fntaoR1i1R2i1676915168R3y40:eb239790210478413cc111da54400b3d38aba041R5y28:tmp%2Ffont%2FMarkerFelt.bfntghy27:font%2FLucida%20Console.fntaoR1i1R2i1676915168R3y40:b56483df1b8f3d8472856b51459d5ce8f3cdfa09R5y34:tmp%2Ffont%2FLucida%20Console.bfntghy16:font%2FEXPON.fntaoR1i1R2i1659272757R3y40:ba8ecd55d9475ee0f9d20c9a5189fe6a9c9ff727R5y23:tmp%2Ffont%2FEXPON.bfntghy21:font%2FDomCasualD.fntaoR1i1R2i1659272757R3y40:ea40ffbf969a51d3e653a3d09b450143a814c7eeR5y28:tmp%2Ffont%2FDomCasualD.bfntghy23:font%2FArial%20Bold.fntaoR1i1R2i1659272757R3y40:dce4a5edf92262f9ea5540d55271f8423683d064R5y30:tmp%2Ffont%2FArial%20Bold.bfntghy23:data%2Ffont%2Farial.fntaoR1i1R2i1659272757R3R4R5y37:data%2Ftmp%2Fdata%2Ffont%2Farial.bfntghy28:data%2Ffont%2FMarkerFelt.fntaoR1i1R2i1675969447R3R8R5y42:data%2Ftmp%2Fdata%2Ffont%2FMarkerFelt.bfntghy34:data%2Ffont%2FLucida%20Console.fntaoR1i1R2i1675969447R3R11R5y48:data%2Ftmp%2Fdata%2Ffont%2FLucida%20Console.bfntghy23:data%2Ffont%2FEXPON.fntaoR1i1R2i1659272757R3R14R5y37:data%2Ftmp%2Fdata%2Ffont%2FEXPON.bfntghy28:data%2Ffont%2FDomCasualD.fntaoR1i1R2i1659272757R3R17R5y42:data%2Ftmp%2Fdata%2Ffont%2FDomCasualD.bfntghy30:data%2Ffont%2FArial%20Bold.fntaoR1i1R2i1659272757R3R20R5y44:data%2Ftmp%2Fdata%2Ffont%2FArial%20Bold.bfntghh
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -58,6 +58,9 @@ class Console {
|
|||
#if (hl && !android)
|
||||
consoleFileHandle.writeString('[${e.time}] ${e.text}\n');
|
||||
#end
|
||||
#if android
|
||||
trace('[${e.time}] ${msg}');
|
||||
#end
|
||||
for (c in consumers) {
|
||||
c(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import src.Settings;
|
|||
|
||||
class Gamepad {
|
||||
public static var gamepad:Pad = Pad.createDummy();
|
||||
static var hasPad = false;
|
||||
|
||||
public static function init() {
|
||||
Pad.wait(onPad);
|
||||
|
|
@ -17,8 +18,10 @@ class Gamepad {
|
|||
pad.onDisconnect = function() {
|
||||
Console.log("Gamepad disconnected");
|
||||
gamepad = Pad.createDummy();
|
||||
hasPad = false;
|
||||
}
|
||||
gamepad = pad;
|
||||
hasPad = true;
|
||||
}
|
||||
|
||||
public static function getId(name:String) {
|
||||
|
|
@ -68,6 +71,8 @@ class Gamepad {
|
|||
}
|
||||
|
||||
public static function isDown(buttons:Array<String>) {
|
||||
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<String>) {
|
||||
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<String>) {
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue