android fix things

This commit is contained in:
RandomityGuy 2023-07-08 14:03:53 +05:30
parent 0371c28b0b
commit d9a1615950
7 changed files with 22 additions and 17 deletions

View file

@ -88,12 +88,14 @@ class Main extends hxd.App {
// Marbleland.init();
marbleGame = new MarbleGame(s2d, s3d);
MarbleGame.canvas.setContent(new PresentsGui());
MissionList.buildMissionList(); // Yeah pls
marbleGame.startPreviewWorld(() -> {
marbleGame.setPreviewMission('urban', () -> {
MarbleGame.canvas.setContent(new MainMenuGui());
haxe.Timer.delay(() -> {
MissionList.buildMissionList(); // Yeah pls
marbleGame.startPreviewWorld(() -> {
marbleGame.setPreviewMission('urban', () -> {
MarbleGame.canvas.setContent(new MainMenuGui());
});
});
});
}, 100);
new ProfilerUI(s2d);

View file

@ -1667,7 +1667,6 @@ class MarbleWorld extends Scheduler {
this.checkpointCollectedGems.set(gem, true);
}
this.checkpointHeldPowerup = this.marble.heldPowerup;
this.displayAlert("Checkpoint reached!");
AudioManager.playSound(ResourceLoader.getResource('data/sound/checkpoint.wav', ResourceLoader.getAudio, this.soundResources));
return true;
}

View file

@ -16,7 +16,7 @@ class Renderer extends h3d.scene.Renderer {
public var depth:h3d.pass.Base = new h3d.scene.fwd.Renderer.DepthPass();
public var normal:h3d.pass.Base = new h3d.scene.fwd.Renderer.NormalPass();
public var shadow = new h3d.pass.DefaultShadowMap(1024);
public var shadow = new h3d.pass.CascadeShadowMap(null);
var glowBuffer:h3d.mat.Texture;

View file

@ -6,6 +6,7 @@ import hxd.fs.BytesFileSystem.BytesFileEntry;
import fs.ManifestLoader;
import fs.ManifestBuilder;
import fs.ManifestProgress;
import fs.ManifestFileSystem.ManifestEntry;
#end
import hxd.res.Image;
import hxd.res.Sound;
@ -59,6 +60,7 @@ class ResourceLoader {
hxd.res.Resource.LIVE_UPDATE = false; // Disable live update to save frames
@:privateAccess hxd.res.Image.ENABLE_AUTO_WATCH = false;
@:privateAccess hxd.res.Sound.ENABLE_AUTO_WATCH = false;
haxe.MainLoop.add(() -> {});
#if (js || android)
var mfileSystem = ManifestBuilder.create("data");
@ -67,6 +69,7 @@ class ResourceLoader {
loader = mloader;
fileSystem = mfileSystem;
initialized = true;
ManifestEntry.doQuickLoad = false;
onLoadedFunc();
}, scene2d);
#if js

View file

@ -33,6 +33,8 @@ import zygame.utils.hl.AssetsTools;
@:allow(fs.ManifestFileSystem)
class ManifestEntry extends FileEntry {
public static var doQuickLoad:Bool = true;
private var fs:ManifestFileSystem;
private var relPath:String;
@ -141,8 +143,10 @@ class ManifestEntry extends FileEntry {
}
#else
if (onReady != null)
onReady();
// haxe.Timer.delay(onReady, 1);
if (doQuickLoad)
onReady();
else
haxe.Timer.delay(onReady, 1);
#end
}

View file

@ -191,11 +191,11 @@ class GuiConsoleScrollCtrl extends GuiControl {
this.clickInteractive.setPosition(renderRect.position.x + renderRect.extent.x - 18 * Settings.uiScale, renderRect.position.y);
this.clickInteractive.height = scrollExtentY;
this.clickInteractive.height = renderRect.extent.y;
if (this.dirty) {
if (scrollBarYSize > scrollExtentY) {
scrollBarYSize = scrollExtentY;
if (scrollBarYSize > renderRect.extent.y) {
scrollBarYSize = renderRect.extent.y;
scrollBarY.visible = false;
// scrollBarY.clear();
return;
@ -227,7 +227,7 @@ class GuiConsoleScrollCtrl extends GuiControl {
for (c in this.children) {
if (c == this.scrollTrack || c == this.scrollUpButton || c == this.scrollDownButton)
continue;
c.onScroll(0, scrollY * (this.maxScrollY / renderRect.extent.y) / scrollExtentY);
c.onScroll(0, scrollY * this.maxScrollY / renderRect.extent.y);
}
}

View file

@ -84,10 +84,7 @@ class CameraInput {
var inpY = delta.y / scaleFactor;
if (jumpcam) {
if (Math.abs(inpX) < 1)
inpX = 0;
if (Math.abs(inpY) < 1)
inpY = 0;
trace('Input: ${inpX} ${inpY}');
}
MarbleGame.instance.world.marble.camera.orbit(inpX, inpY, true);