From 966744e5452e85d7e4f21817ac8e4085a3853264 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Oct 2018 19:22:16 +0200 Subject: [PATCH] Native fixes --- .gitignore | 1 + Sources/arm/App.hx | 3 ++- Sources/arm/UINodes.hx | 1 + Sources/arm/UITrait.hx | 4 +++- Sources/arm/UIView2D.hx | 1 + Sources/arm/renderpath/RenderPathDeferred.hx | 2 ++ 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1b77a7bd..0129336f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build_armorpaint/ build_grid/ build/ khafile.js +korefile.js Sources/Main.hx *.pyc .vscode diff --git a/Sources/arm/App.hx b/Sources/arm/App.hx index 75faafb1..2d32b094 100644 --- a/Sources/arm/App.hx +++ b/Sources/arm/App.hx @@ -4,7 +4,7 @@ import zui.*; import zui.Zui.State; import zui.Canvas; -class App { +class App extends iron.Trait { public static var uienabled = true; public static var isDragging = false; @@ -34,6 +34,7 @@ class App { } public function new() { + super(); kha.System.notifyOnDropFiles(function(filePath:String) { dropPath = StringTools.rtrim(filePath); diff --git a/Sources/arm/UINodes.hx b/Sources/arm/UINodes.hx index e7f5eae6..cf0f4adf 100644 --- a/Sources/arm/UINodes.hx +++ b/Sources/arm/UINodes.hx @@ -272,6 +272,7 @@ class UINodes extends iron.Trait { } if (!show) return; + if (arm.App.realw() == 0 || arm.App.realh() == 0) return; if (!arm.App.uienabled && ui.inputRegistered) ui.unregisterInput(); if (arm.App.uienabled && !ui.inputRegistered) ui.registerInput(); diff --git a/Sources/arm/UITrait.hx b/Sources/arm/UITrait.hx index bdad5a64..d9e18fad 100644 --- a/Sources/arm/UITrait.hx +++ b/Sources/arm/UITrait.hx @@ -541,6 +541,8 @@ class UITrait extends iron.Trait { cmd += ' --output0 "' + tmp + 'tmp_rad"'; cmd += ' --output0params hdr,rgbe,latlong'; Krom.sysCommand(cmd); + #else + var tmp = ""; #end // Load irr @@ -1709,7 +1711,7 @@ void main() { ui.row([1/2,1/2]); paintVisible = ui.check(Id.handle({selected: paintVisible}), "Visible Only"); var mirrorHandle = Id.handle({selected: mirrorX}); - mirrorX = ui.check(mirrorHandle, "Mirror"); + mirrorX = ui.check(mirrorHandle, "Mirror Screen"); if (mirrorHandle.changed) { UINodes.inst.updateCanvasMap(); UINodes.inst.parsePaintMaterial(); diff --git a/Sources/arm/UIView2D.hx b/Sources/arm/UIView2D.hx index f326726e..caafec24 100644 --- a/Sources/arm/UIView2D.hx +++ b/Sources/arm/UIView2D.hx @@ -83,6 +83,7 @@ void main() { wy = 0; if (!show) return; + if (arm.App.realw() == 0 || arm.App.realh() == 0) return; if (UITrait.inst.paintDirty()) hwnd.redraws = 2; diff --git a/Sources/arm/renderpath/RenderPathDeferred.hx b/Sources/arm/renderpath/RenderPathDeferred.hx index 4eb5ece0..90be5f67 100644 --- a/Sources/arm/renderpath/RenderPathDeferred.hx +++ b/Sources/arm/renderpath/RenderPathDeferred.hx @@ -569,6 +569,8 @@ class RenderPathDeferred { @:access(iron.RenderPath) public static function commands() { + if (arm.App.realw() == 0 || arm.App.realh() == 0) return; + // Paint if (!arm.UITrait.inst.dirty()) { path.setTarget("");