|
@@ -61,6 +61,7 @@ class Scene extends Component implements h3d.IDrawable {
|
|
|
var texCache = new Map<String, h3d.mat.Texture>();
|
|
|
var cleanup = new Array<Void->Void>();
|
|
|
var defaultCamera : h3d.Camera;
|
|
|
+ public var props : hide.ui.Props;
|
|
|
public var engine : h3d.Engine;
|
|
|
public var width(get, never) : Int;
|
|
|
public var height(get, never) : Int;
|
|
@@ -70,8 +71,9 @@ class Scene extends Component implements h3d.IDrawable {
|
|
|
public var speed : Float = 1.0;
|
|
|
public var visible(default, null) : Bool = true;
|
|
|
|
|
|
- public function new(?parent,?el) {
|
|
|
+ public function new(props : hide.ui.Props, parent, el) {
|
|
|
super(parent,el);
|
|
|
+ this.props = props;
|
|
|
element.addClass("hide-scene-container");
|
|
|
canvas = cast new Element("<canvas class='hide-scene' style='width:100%;height:100%'/>").appendTo(element)[0];
|
|
|
canvas.addEventListener("mousemove",function(_) canvas.focus());
|
|
@@ -137,7 +139,7 @@ class Scene extends Component implements h3d.IDrawable {
|
|
|
return engine.height;
|
|
|
}
|
|
|
|
|
|
- public function init( props : hide.ui.Props, ?root : h3d.scene.Object ) {
|
|
|
+ public function init( ?root : h3d.scene.Object ) {
|
|
|
var autoHide : Array<String> = props.get("scene.autoHide");
|
|
|
function initRec( obj : h3d.scene.Object ) {
|
|
|
if( autoHide.indexOf(obj.name) >= 0 )
|
|
@@ -198,6 +200,7 @@ class Scene extends Component implements h3d.IDrawable {
|
|
|
}
|
|
|
untyped bmp.ctx = { getImageData : function(_) return bmp, canvas : { width : 0, height : 0 } };
|
|
|
engine.driver.uploadTextureBitmap(t, cast bmp, 0, 0);
|
|
|
+ t.flags.unset(Loading);
|
|
|
if( onReady != null ) {
|
|
|
onReady(t);
|
|
|
onReady = null;
|
|
@@ -348,6 +351,7 @@ class Scene extends Component implements h3d.IDrawable {
|
|
|
var size = hxd.res.Any.fromBytes(path, bytes).toImage().getSize();
|
|
|
t = new h3d.mat.Texture(size.width,size.height);
|
|
|
t.clear(0x102030);
|
|
|
+ t.flags.set(Loading);
|
|
|
t.name = ide.makeRelative(path);
|
|
|
texCache.set(path, t);
|
|
|
if( onReady == null ) onReady = function(_) {};
|