mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 21:21:41 +00:00
android fix things
This commit is contained in:
parent
0371c28b0b
commit
d9a1615950
7 changed files with 22 additions and 17 deletions
12
src/Main.hx
12
src/Main.hx
|
|
@ -88,12 +88,14 @@ class Main extends hxd.App {
|
||||||
// Marbleland.init();
|
// Marbleland.init();
|
||||||
marbleGame = new MarbleGame(s2d, s3d);
|
marbleGame = new MarbleGame(s2d, s3d);
|
||||||
MarbleGame.canvas.setContent(new PresentsGui());
|
MarbleGame.canvas.setContent(new PresentsGui());
|
||||||
MissionList.buildMissionList(); // Yeah pls
|
haxe.Timer.delay(() -> {
|
||||||
marbleGame.startPreviewWorld(() -> {
|
MissionList.buildMissionList(); // Yeah pls
|
||||||
marbleGame.setPreviewMission('urban', () -> {
|
marbleGame.startPreviewWorld(() -> {
|
||||||
MarbleGame.canvas.setContent(new MainMenuGui());
|
marbleGame.setPreviewMission('urban', () -> {
|
||||||
|
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}, 100);
|
||||||
|
|
||||||
new ProfilerUI(s2d);
|
new ProfilerUI(s2d);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1667,7 +1667,6 @@ class MarbleWorld extends Scheduler {
|
||||||
this.checkpointCollectedGems.set(gem, true);
|
this.checkpointCollectedGems.set(gem, true);
|
||||||
}
|
}
|
||||||
this.checkpointHeldPowerup = this.marble.heldPowerup;
|
this.checkpointHeldPowerup = this.marble.heldPowerup;
|
||||||
this.displayAlert("Checkpoint reached!");
|
|
||||||
AudioManager.playSound(ResourceLoader.getResource('data/sound/checkpoint.wav', ResourceLoader.getAudio, this.soundResources));
|
AudioManager.playSound(ResourceLoader.getResource('data/sound/checkpoint.wav', ResourceLoader.getAudio, this.soundResources));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class Renderer extends h3d.scene.Renderer {
|
||||||
|
|
||||||
public var depth:h3d.pass.Base = new h3d.scene.fwd.Renderer.DepthPass();
|
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 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;
|
var glowBuffer:h3d.mat.Texture;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import hxd.fs.BytesFileSystem.BytesFileEntry;
|
||||||
import fs.ManifestLoader;
|
import fs.ManifestLoader;
|
||||||
import fs.ManifestBuilder;
|
import fs.ManifestBuilder;
|
||||||
import fs.ManifestProgress;
|
import fs.ManifestProgress;
|
||||||
|
import fs.ManifestFileSystem.ManifestEntry;
|
||||||
#end
|
#end
|
||||||
import hxd.res.Image;
|
import hxd.res.Image;
|
||||||
import hxd.res.Sound;
|
import hxd.res.Sound;
|
||||||
|
|
@ -59,6 +60,7 @@ class ResourceLoader {
|
||||||
hxd.res.Resource.LIVE_UPDATE = false; // Disable live update to save frames
|
hxd.res.Resource.LIVE_UPDATE = false; // Disable live update to save frames
|
||||||
@:privateAccess hxd.res.Image.ENABLE_AUTO_WATCH = false;
|
@:privateAccess hxd.res.Image.ENABLE_AUTO_WATCH = false;
|
||||||
@:privateAccess hxd.res.Sound.ENABLE_AUTO_WATCH = false;
|
@:privateAccess hxd.res.Sound.ENABLE_AUTO_WATCH = false;
|
||||||
|
|
||||||
haxe.MainLoop.add(() -> {});
|
haxe.MainLoop.add(() -> {});
|
||||||
#if (js || android)
|
#if (js || android)
|
||||||
var mfileSystem = ManifestBuilder.create("data");
|
var mfileSystem = ManifestBuilder.create("data");
|
||||||
|
|
@ -67,6 +69,7 @@ class ResourceLoader {
|
||||||
loader = mloader;
|
loader = mloader;
|
||||||
fileSystem = mfileSystem;
|
fileSystem = mfileSystem;
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
ManifestEntry.doQuickLoad = false;
|
||||||
onLoadedFunc();
|
onLoadedFunc();
|
||||||
}, scene2d);
|
}, scene2d);
|
||||||
#if js
|
#if js
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ import zygame.utils.hl.AssetsTools;
|
||||||
|
|
||||||
@:allow(fs.ManifestFileSystem)
|
@:allow(fs.ManifestFileSystem)
|
||||||
class ManifestEntry extends FileEntry {
|
class ManifestEntry extends FileEntry {
|
||||||
|
public static var doQuickLoad:Bool = true;
|
||||||
|
|
||||||
private var fs:ManifestFileSystem;
|
private var fs:ManifestFileSystem;
|
||||||
private var relPath:String;
|
private var relPath:String;
|
||||||
|
|
||||||
|
|
@ -141,8 +143,10 @@ class ManifestEntry extends FileEntry {
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (onReady != null)
|
if (onReady != null)
|
||||||
onReady();
|
if (doQuickLoad)
|
||||||
// haxe.Timer.delay(onReady, 1);
|
onReady();
|
||||||
|
else
|
||||||
|
haxe.Timer.delay(onReady, 1);
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.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 (this.dirty) {
|
||||||
if (scrollBarYSize > scrollExtentY) {
|
if (scrollBarYSize > renderRect.extent.y) {
|
||||||
scrollBarYSize = scrollExtentY;
|
scrollBarYSize = renderRect.extent.y;
|
||||||
scrollBarY.visible = false;
|
scrollBarY.visible = false;
|
||||||
// scrollBarY.clear();
|
// scrollBarY.clear();
|
||||||
return;
|
return;
|
||||||
|
|
@ -227,7 +227,7 @@ class GuiConsoleScrollCtrl extends GuiControl {
|
||||||
for (c in this.children) {
|
for (c in this.children) {
|
||||||
if (c == this.scrollTrack || c == this.scrollUpButton || c == this.scrollDownButton)
|
if (c == this.scrollTrack || c == this.scrollUpButton || c == this.scrollDownButton)
|
||||||
continue;
|
continue;
|
||||||
c.onScroll(0, scrollY * (this.maxScrollY / renderRect.extent.y) / scrollExtentY);
|
c.onScroll(0, scrollY * this.maxScrollY / renderRect.extent.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,10 +84,7 @@ class CameraInput {
|
||||||
var inpY = delta.y / scaleFactor;
|
var inpY = delta.y / scaleFactor;
|
||||||
|
|
||||||
if (jumpcam) {
|
if (jumpcam) {
|
||||||
if (Math.abs(inpX) < 1)
|
trace('Input: ${inpX} ${inpY}');
|
||||||
inpX = 0;
|
|
||||||
if (Math.abs(inpY) < 1)
|
|
||||||
inpY = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MarbleGame.instance.world.marble.camera.orbit(inpX, inpY, true);
|
MarbleGame.instance.world.marble.camera.orbit(inpX, inpY, true);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue