mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
android fixes
This commit is contained in:
parent
27975d99bc
commit
a39d3137fc
5 changed files with 10 additions and 4 deletions
|
|
@ -57,11 +57,16 @@ class Main extends hxd.App {
|
||||||
});
|
});
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
trace("ResourceLoader::init");
|
||||||
ResourceLoader.init(s2d, () -> {
|
ResourceLoader.init(s2d, () -> {
|
||||||
|
trace("Settings::init");
|
||||||
Settings.init();
|
Settings.init();
|
||||||
|
trace("Gamepad::init");
|
||||||
Gamepad.init();
|
Gamepad.init();
|
||||||
|
trace("AudioManager::init");
|
||||||
AudioManager.init();
|
AudioManager.init();
|
||||||
AudioManager.playShell();
|
AudioManager.playShell();
|
||||||
|
trace("MarbleGame::new");
|
||||||
marbleGame = new MarbleGame(s2d, s3d);
|
marbleGame = new MarbleGame(s2d, s3d);
|
||||||
MarbleGame.canvas.setContent(new MainMenuGui());
|
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class ResourceLoader {
|
||||||
// static var threadPool:FixedThreadPool = new FixedThreadPool(4);
|
// static var threadPool:FixedThreadPool = new FixedThreadPool(4);
|
||||||
|
|
||||||
public static function init(scene2d:h2d.Scene, onLoadedFunc:Void->Void) {
|
public static function init(scene2d:h2d.Scene, onLoadedFunc:Void->Void) {
|
||||||
#if hl
|
#if (hl && !android)
|
||||||
@:privateAccess @:privateAccess cast(fileSystem, LocalFileSystem).convert.tmpDir = "data/tmp/";
|
@:privateAccess @:privateAccess cast(fileSystem, LocalFileSystem).convert.tmpDir = "data/tmp/";
|
||||||
#end
|
#end
|
||||||
hxd.res.Resource.LIVE_UPDATE = false; // Disable live update to save frames
|
hxd.res.Resource.LIVE_UPDATE = false; // Disable live update to save frames
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ class Settings {
|
||||||
#end
|
#end
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
#if hl
|
#if (hl && !android)
|
||||||
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
#end
|
#end
|
||||||
|
|
@ -336,7 +336,7 @@ class Settings {
|
||||||
public static function init() {
|
public static function init() {
|
||||||
load();
|
load();
|
||||||
#if hl
|
#if hl
|
||||||
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
Window.getInstance().resize(Window.getInstance().width, Window.getInstance().height);
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
uiScale = 1 / Window.getInstance().windowToPixelRatio;
|
uiScale = 1 / Window.getInstance().windowToPixelRatio;
|
||||||
#end
|
#end
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ class ManifestEntry extends FileEntry {
|
||||||
#if (sys && !android)
|
#if (sys && !android)
|
||||||
return sys.io.File.getBytes(file);
|
return sys.io.File.getBytes(file);
|
||||||
#elseif android
|
#elseif android
|
||||||
|
trace('Trying to get bytes for ${name}');
|
||||||
bytes = AssetsTools.getBytes(file);
|
bytes = AssetsTools.getBytes(file);
|
||||||
return bytes;
|
return bytes;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,7 @@ class HelpCreditsGui extends GuiImage {
|
||||||
dtsObj.init(null, () -> {}); // The lambda is not gonna run async anyway
|
dtsObj.init(null, () -> {}); // The lambda is not gonna run async anyway
|
||||||
for (mat in dtsObj.materials) {
|
for (mat in dtsObj.materials) {
|
||||||
mat.mainPass.enableLights = false;
|
mat.mainPass.enableLights = false;
|
||||||
mat.mainPass.culling = Front;
|
mat.mainPass.culling = Back;
|
||||||
if (mat.blendMode != Alpha && mat.blendMode != Add)
|
if (mat.blendMode != Alpha && mat.blendMode != Add)
|
||||||
mat.mainPass.addShader(new AlphaChannel());
|
mat.mainPass.addShader(new AlphaChannel());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue