Ver código fonte

remove old inspector things

Nicolas Cannasse 4 anos atrás
pai
commit
25dbe4df87

+ 0 - 4
hxd/inspect/Group.hx

@@ -1,4 +0,0 @@
-package hxd.inspect;
-
-interface Group {
-}

+ 0 - 420
hxd/inspect/Inspector.hx

@@ -1,420 +0,0 @@
-package hxd.inspect;
-import vdom.JQuery;
-import hxd.inspect.Property;
-
-class Tool {
-	public var name(default,set) : String;
-	public var icon(default,set) : String;
-	public var title(default,set) : String;
-	public var click : Void -> Void;
-	public var j : JQuery;
-	public var jicon : JQuery;
-	public var active(get, set) : Bool;
-	public function new() {
-	}
-	function get_active() {
-		return j.hasClass("active");
-	}
-	function set_active(v) {
-		j.toggleClass("active", v);
-		return v;
-	}
-	function set_name(v) {
-		jicon.attr("alt", v);
-		return name = v;
-	}
-	function set_icon(v) {
-		jicon.attr("class", "fa fa-"+v);
-		return icon = v;
-	}
-	function set_title(v) {
-		j.attr("title", v);
-		return title = v;
-	}
-}
-
-class Inspector {
-
-	static var CSS = hxd.res.Embed.getFileContent("hxd/inspect/inspect.css");
-	static var current(default,set) : Inspector;
-
-	public static function getCurrent() return current;
-
-	public var scene(default, set) : h3d.scene.Scene;
-	public var connected(get, never): Bool;
-
-	var props : PropManager;
-	var jroot : JQuery;
-	var oldLog : Dynamic -> haxe.PosInfos -> Void;
-	var savedFile : String;
-	var oldLoop : Void -> Void;
-	var state : Map<String,{ original : Dynamic, current : Dynamic }>;
-
-	var panels : Array<Panel>;
-	var rootNodes : Array<Node>;
-
-	public var scenePanel : ScenePanel;
-	public var resPanel : ResPanel;
-	var propsPanel : Panel;
-	var logPanel : Panel;
-	var panelList : Array<{ name : String, create : Void -> Panel, p : Panel } >;
-	var currentNode : Node;
-	var event : haxe.MainLoop.MainEvent;
-
-	public function new( scene, ?host, ?port ) {
-
-		current = this;
-
-		savedFile = "sceneProps.js";
-		state = new Map();
-		oldLog = haxe.Log.trace;
-		haxe.Log.trace = onTrace;
-		props = new PropManager(host, port);
-		props.resolveProps = resolveProps;
-		props.onShowTexture = onShowTexture;
-		props.onChange = onChange;
-		props.handleKey = onKey;
-		this.scene = scene;
-		panels = [];
-		panelList = [];
-		rootNodes = [];
-
-		init();
-	}
-
-	static function set_current(i:Inspector) {
-		@:privateAccess Node.currentJRoot = i == null ? null : i.jroot;
-		return current = i;
-	}
-
-	function init() {
-		jroot = J(props.getRoot());
-		jroot.html('
-			<style>$CSS</style>
-			<ul id="toolbar" class="toolbar">
-			</ul>
-		');
-		jroot.attr("title", "Inspect");
-		current = this;
-
-		scenePanel = new ScenePanel("s3d", scene);
-		logPanel = new Panel("log", "Log");
-		//resPanel = new ResPanel("res", hxd.res.Loader.currentInstance);
-		//resPanel.dock(Left, 0.2);
-		//scenePanel.dock(Fill, null, resPanel);
-		scenePanel.dock(Left, 0.2);
-		logPanel.dock(Down, 0.3);
-		getPropsPanel();
-
-		addPanel("Scene", function() return scenePanel);
-		addPanel("Properties", function() return getPropsPanel());
-		//addPanel("Resources", function() return resPanel);
-		addPanel("Log", function() return logPanel);
-
-		addTool("Load...", "download", load, "Load settings");
-		addTool("Save...", "save", save, "Save settings");
-		addTool("Undo", "undo", props.undo, "Undo");
-		addTool("Repeat", "repeat", props.redo, "Redo");
-		var pause : Tool = null;
-		pause = addTool("Pause", "pause", function() {
-			if( oldLoop != null ) {
-				hxd.System.setLoop(oldLoop);
-				oldLoop = null;
-			} else {
-				oldLoop = hxd.System.getCurrentLoop();
-				hxd.System.setLoop(pauseLoop);
-			}
-			pause.active = oldLoop != null;
-		}, "Pause scene");
-
-		var sp : Tool = null;
-		sp = addTool("Show Panel", "bars", function() {
-			var panels = [for( p in panelList ) p.name];
-			panels.push("New...");
-			sp.j.special("popupMenu", panels, function(i) {
-				var p = panelList[i];
-				if( p == null ) {
-					newPanel();
-					return true;
-				}
-				if( p.p == null ) p.p = p.create();
-				if( !p.p.visible ) p.p.show();
-				return true;
-			});
-		}, "Show/Hide panel");
-
-		addPanel("Stats", function() {
-			var s = new StatsPanel();
-			s.dock(Right, 0.35);
-			return s;
-		});
-	}
-
-	function getPropsPanel() {
-		if( propsPanel == null || propsPanel.isDisposed() ) {
-			propsPanel = new Panel("props","Properties");
-			propsPanel.dock(Down, 0.5, scenePanel);
-		}
-		return propsPanel;
-	}
-
-	function onShowTexture( t : h3d.mat.Texture ) {
-		var p = new Panel(null, "" + t);
-		p.onClose = p.dispose;
-		function load( mode = "rgba" ) {
-			p.j.html("Loading...");
-			haxe.Timer.delay(function() {
-				var bmp = t.capturePixels();
-				function setChannel(v) {
-					var bits = v * 8;
-					for( x in 0...bmp.width )
-						for( y in 0...bmp.height ) {
-							var a = (bmp.getPixel(x, y) >>> bits) & 0xFF;
-							bmp.setPixel(x, y, 0xFF000000 | a | (a<<8) | (a<<16));
-						}
-				}
-				switch( mode ) {
-				case "rgb":
-					for( x in 0...bmp.width )
-						for( y in 0...bmp.height )
-							bmp.setPixel(x, y, bmp.getPixel(x, y) | 0xFF000000);
-				case "alpha":
-					setChannel(3);
-				case "red":
-					setChannel(2);
-				case "green":
-					setChannel(1);
-				case "blue":
-					setChannel(0);
-				default:
-				}
-
-				var png = bmp.toPNG();
-				bmp.dispose();
-				var pngBase64 = new haxe.crypto.BaseCode(haxe.io.Bytes.ofString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")).encodeBytes(png).toString();
-				p.j.html('
-					<select class="imageprops"><option value="rgba">RGBA</option><option value="rgb">RGB</option><option value="alpha">Alpha</option><option value="red">Red</option><option value="green">Green</option><option value="blue">Blue</option></select>
-					<img src="data:image/png;base64,$pngBase64" style="background:#696969;max-width:100%"/>
-				');
-				var props = p.j.find(".imageprops");
-				props.val(mode);
-				props.change(function(_) load(props.getValue()));
-			}, 0);
-		}
-		load();
-		p.show();
-	}
-
-	public function dispose() {
-		if( current == this ) current = null;
-		props.dispose();
-		scene = null;
-		if( oldLoop != null ) {
-			hxd.System.setLoop(oldLoop);
-			oldLoop = null;
-		}
-	}
-
-	inline function get_connected() {
-		return props.connected;
-	}
-
-	public inline function J( ?elt : vdom.Dom, ?query : String ) {
-		return props.J(elt,query);
-	}
-
-	public function addTool( name : String, icon : String, click : Void -> Void, ?title : String = "" ) {
-		var t = new Tool();
-		t.j = J("<li>");
-		t.jicon = J("<i>").appendTo(t.j);
-		t.j.click(function(_) t.click());
-		t.name = name;
-		t.icon = icon;
-		t.title = title;
-		t.click = click;
-		t.j.appendTo(jroot.find("#toolbar"));
-		return t;
-	}
-
-	function newPanel() {
-	}
-
-	public function addPanel( name : String, create : Void -> Panel ) {
-		panelList.push({ name : name, create : create, p : null });
-	}
-
-	function onKey( e : vdom.Event ) {
-		switch( e.keyCode ) {
-		case 'S'.code if( e.ctrlKey ):
-			save();
-		case hxd.Key.F1:
-			load();
-		default:
-		}
-	}
-
-	function onTrace( v : Dynamic, ?pos : haxe.PosInfos ) {
-		oldLog(v, pos);
-		if( props.connected ) {
-			var vstr = null;
-			if( pos.customParams != null ) {
-				pos.customParams.unshift(v);
-				vstr = [for( v in pos.customParams ) Std.string(v)].join(",");
-			} else
-				vstr = Std.string(v);
-			J("<pre>").addClass("line").text(pos.fileName+"(" + pos.lineNumber + ") : " + vstr).appendTo(logPanel.content);
-		}
-	}
-
-	function set_scene(s:h3d.scene.Scene) {
-		if( s == null && event != null ) {
-			event.stop();
-			event = null;
-		}
-		if( s != null && event == null )
-			event = haxe.MainLoop.add(sync);
-		return scene = s;
-	}
-
-	function pauseLoop() {
-		scene.setElapsedTime(0);
-		h3d.Engine.getCurrent().render(scene);
-	}
-
-	public function saveFile( defaultName : String, ext : String, bytes : haxe.io.Bytes, onSelect : String -> Void ) {
-		if( defaultName.charCodeAt(0) != "/".code && defaultName.charCodeAt(1) != ":".code )
-			defaultName = props.getResPath() + defaultName;
-		jroot.special("fileSave", [defaultName, ext, bytes], function(path) {
-			if( path != null ) onSelect(path);
-			return true;
-		});
-	}
-
-	public function loadFile( ext : String, onLoad : String -> haxe.io.Bytes -> Void, ?defaultPath : String ) {
-		if( defaultPath != null && defaultPath.charCodeAt(0) != "/".code && defaultPath.charCodeAt(1) != ":".code )
-			defaultPath = props.getResPath() + defaultPath;
-		jroot.special("fileSelect", [defaultPath, ext], function(newPath) {
-			if( newPath == null ) return true;
-			hxd.File.load(newPath, function(bytes) onLoad(newPath, bytes));
-			return true;
-		});
-	}
-
-	function load() {
-		loadFile("js", function(newPath, data) {
-			savedFile = newPath;
-			resetDefaults();
-			loadProps(data.toString());
-		}, savedFile);
-	}
-
-	function save() {
-		var o : Dynamic = { };
-		for( s in state.keys() ) {
-			var path = s.split(".");
-			var o = o;
-			while( path.length > 1 ) {
-				var name = path.shift();
-				var s = Reflect.field(o, name);
-				if( s == null ) {
-					s = { };
-					Reflect.setField(o, name, s);
-				}
-				o = s;
-			}
-			Reflect.setField(o, path[0], state.get(s).current);
-		}
-		var js = haxe.Json.stringify(o, null, "\t");
-		saveFile(savedFile, "js", haxe.io.Bytes.ofString(js), function(name) savedFile = name);
-	}
-
-	public function resetDefaults() {
-		for( s in state.keys() ) {
-			var v = state.get(s);
-			if( v.original != null )
-				props.setPathPropValue(s, v.original);
-		}
-		state = new Map();
-	}
-
-	public function loadProps( props : String ) {
-		var o : Dynamic = haxe.Json.parse(props);
-		function browseRec( path : Array<String>, v : Dynamic ) {
-			switch( Type.typeof(v) ) {
-			case TNull, TInt, TFloat, TBool, TClass(_):
-				var path = path.join(".");
-				state.set(path, { original : this.props.getPathPropValue(path), current : v });
-			case TUnknown, TFunction, TEnum(_):
-				throw "Invalid value " + v;
-			case TObject:
-				for( f in Reflect.fields(v) ) {
-					var fv = Reflect.field(v, f);
-					path.push(f);
-					browseRec(path, fv);
-					path.pop();
-				}
-			}
-		}
-		browseRec([], o);
-		for( s in state.keys() )
-			this.props.setPathPropValue(s, state.get(s).current);
-		refreshProps();
-	}
-
-	public function sync() {
-		if( scene == null || !props.connected ) return;
-		for( p in panels )
-			if( p.visible )
-				p.sync();
-	}
-
-	function resolveProps( path : Array<String> ) {
-		var cur = null;
-		var nodes = rootNodes;
-		while( true ) {
-			var k = path.shift();
-			if( k == null ) break;
-			var found = false;
-			for( n in nodes ) {
-				if( n.getPathName() == k ) {
-					found = true;
-					cur = n;
-					nodes = @:privateAccess n.childs;
-					break;
-				}
-			}
-			if( !found ) {
-				path.unshift(k);
-				break;
-			}
-		}
-		return cur == null || cur.props == null ? null : cur.props();
-	}
-
-	function onChange( path : String, oldV : Dynamic, newV : Dynamic ) {
-		var s = state.get(path);
-		if( s == null )
-			state.set(path, { original : oldV, current : newV } );
-		else {
-			if( props.sameValue(s.original,newV) )
-				state.remove(path);
-			else
-				s.current = newV;
-		}
-	}
-
-	public function refreshProps() {
-		if( currentNode != null ) editProps(currentNode);
-	}
-
-	public function editProps( n : Node ) {
-		currentNode = n;
-		var t = props.makeProps(n.getFullPath(), n.props());
-		getPropsPanel();
-		propsPanel.j.text("");
-		propsPanel.parent = n;
-		t.appendTo(propsPanel.j);
-		propsPanel.show();
-	}
-
-}

+ 0 - 76
hxd/inspect/Node.hx

@@ -1,76 +0,0 @@
-package hxd.inspect;
-
-class Node {
-
-	public var name(default,set) : String;
-	public var parent(default, set) : Node;
-	public var props : Void -> Array<Property>;
-	public var j : vdom.JQuery;
-	var childs : Array<Node>;
-
-	static var currentJRoot : vdom.JQuery = null;
-
-	public function new( name, ?parent ) {
-		childs = [];
-		initContent();
-		this.name = name;
-		this.parent = parent;
-	}
-
-	public function isDisposed() {
-		return j == null || j.length == 0;
-	}
-
-	function getJRoot() : vdom.JQuery {
-		return currentJRoot;
-	}
-
-	function initContent() {
-	}
-
-	function removeChild(n:Node) {
-		childs.remove(n);
-	}
-
-	function addChild(n:Node) {
-		childs.push(n);
-	}
-
-	function set_parent(p:Node) {
-		if( parent != null )
-			parent.removeChild(this);
-		if( p != null )
-			p.addChild(this);
-		return parent = p;
-	}
-
-	public function getChildByName( name : String ) {
-		for( n in childs )
-			if( n.getPathName() == name )
-				return n;
-		return null;
-	}
-
-	public function getPathName() {
-		return name;
-	}
-
-	public function getFullPath() {
-		var n = getPathName();
-		if( parent == null )
-			return n;
-		return parent.getFullPath() + "." + n;
-	}
-
-	public function dispose() {
-		parent = null;
-		if( j != null ) j.dispose();
-		for( c in childs )
-			c.dispose();
-	}
-
-	function set_name(v) {
-		return name = v;
-	}
-
-}

+ 0 - 116
hxd/inspect/Panel.hx

@@ -1,116 +0,0 @@
-package hxd.inspect;
-
-enum DockDirection {
-	Left;
-	Right;
-	Up;
-	Down;
-	Fill;
-}
-
-class Panel extends Node {
-
-	var inspect : Inspector;
-	var panel : vdom.JQuery;
-	var saveDock : { align : DockDirection, size : Float, into : Panel };
-	public var visible(default, null) : Bool;
-	public var caption(default, set) : String;
-	public var content : vdom.JQuery;
-
-	public function new( name, caption, ?panelGroup ) {
-		super(name, panelGroup);
-		this.caption = caption;
-		@:privateAccess {
-			inspect = Inspector.current;
-			inspect.panels.push(this);
-			inspect.rootNodes.push(this);
-		}
-	}
-
-	public function dock( align : DockDirection, ?size : Float, ?into : Panel ) {
-		undock();
-		saveDock = { align : align, size : size, into : into };
-		panel = j.query("<panel>");
-		panel.appendTo(into == null || into.panel == null ? @:privateAccess inspect.jroot : into.panel);
-		if( caption != null ) panel.attr("caption", caption);
-		panel.attr("docksize", "" + size);
-		panel.attr("dock", "" + align);
-		panel.bind("paneldock", function(e) {
-			if( e.target == null ) {
-				visible = false;
-				onClose();
-				return;
-			}
-		});
-		visible = true;
-		j.appendTo(panel);
-	}
-
-	public dynamic function onClose() {
-	}
-
-	override function dispose() {
-		undock();
-		super.dispose();
-	}
-
-	public function undock() {
-		if( panel == null ) return;
-		j.detach();
-		panel.removeAttr("dock");
-		panel.dispose();
-		panel = null;
-		visible = false;
-	}
-
-	function set_caption(c) {
-		if( panel != null ) panel.attr("caption", c);
-		return caption = c;
-	}
-
-	override function getJRoot() {
-		if( j == null ) return super.getJRoot();
-		return j;
-	}
-
-	override function initContent() {
-		var root = getJRoot();
-		j = root.query('<div>');
-		j.addClass("panel");
-		content = j;
-	}
-
-	override function addChild(n:Node)	{
-		super.addChild(n);
-		n.j.appendTo(content);
-	}
-
-	override function removeChild(n:Node) {
-		super.removeChild(n);
-		n.j.detach();
-	}
-
-	override function set_parent(p:Node) {
-		// no physical attachment
-		if( parent != null )
-			parent.childs.remove(this);
-		if( p != null )
-			p.childs.push(this);
-		return parent = p;
-	}
-
-	public function show() {
-		if( visible ) return;
-		var old = saveDock;
-		if( saveDock != null && saveDock.into != null && saveDock.into.visible )
-			dock(saveDock.align, saveDock.size, saveDock.into);
-		else {
-			dock(Fill);
-			saveDock = old;
-		}
-	}
-
-	public function sync() {
-	}
-
-}

+ 0 - 622
hxd/inspect/PropManager.hx

@@ -1,622 +0,0 @@
-package hxd.inspect;
-import vdom.JQuery;
-import hxd.inspect.Property;
-
-private typedef History = { path : String, oldV : Dynamic, newV : Dynamic };
-
-class PropManager extends vdom.Client {
-
-	public var host : String = "127.0.0.1";
-	public var port = 6669;
-	public var connected(default,null) = false;
-
-	var sock : hxd.net.Socket;
-	var pendingMessages : Array<vdom.Message>;
-
-	var refreshProps : Void -> Void;
-	var history : Array<History>;
-	var redoHistory : Array<History>;
-	var groupsStatus : Map<String,Bool>;
-
-	public function new( ?host, ?port ) {
-		super();
-		groupsStatus = new Map();
-		history = [];
-		redoHistory = [];
-		if( host != null )
-			this.host = host;
-		if( port != null )
-			this.port = port;
-		sock = new hxd.net.Socket();
-		sock.onError = function(e) {
-			if( connected ) onConnected(false);
-			connected = false;
-			haxe.Timer.delay(connect,500);
-		};
-		sock.onData = function() {
-			while( true ) {
-				var len = try sock.input.readUInt16() catch( e : haxe.io.Eof ) -1;
-				if( len < 0 ) break;
-				var data = sock.input.read(len);
-				handle(decodeAnswer(data));
-			}
-		}
-		connect();
-	}
-
-	public function dispose() {
-		if( sock != null ) {
-			sock.close();
-			sock = null;
-		}
-	}
-
-	override function onKey(e:vdom.Event) {
-		switch( e.keyCode ) {
-		case 'Z'.code if( e.ctrlKey ):
-			undo();
-		case 'Y'.code if( e.ctrlKey ):
-			redo();
-		default:
-			handleKey(e);
-		}
-	}
-
-	public dynamic function handleKey( e : vdom.Event ) {
-	}
-
-	function connect() {
-		if( sock == null ) return; // was closed
-		sock.close();
-		sock.connect(host, port, function() {
-			connected = true;
-			syncDom();
-			onConnected(true);
-		});
-	}
-
-	function flushMessages() {
-		if( pendingMessages == null ) return;
-		var msg = pendingMessages.length == 1 ? pendingMessages[0] : vdom.Message.Group(pendingMessages);
-		pendingMessages = null;
-		if( sock == null ) return;
-		var data = encodeMessage(msg);
-		sock.out.wait();
-		sock.out.writeInt32(data.length);
-		sock.out.write(data);
-		sock.out.flush();
-	}
-
-	override function send( msg : vdom.Message ) {
-		if( pendingMessages == null ) {
-			pendingMessages = [];
-			haxe.Timer.delay(flushMessages,0);
-		}
-		pendingMessages.push(msg);
-	}
-
-	public dynamic function onConnected(b:Bool) {
-	}
-
-	public function undo() {
-		var h = history.pop();
-		if( h == null ) return;
-		redoHistory.push(h);
-		setPathPropValue(h.path, h.oldV);
-		refreshProps();
-	}
-
-	public function redo() {
-		var h = redoHistory.pop();
-		if( h == null ) return;
-		history.push(h);
-		setPathPropValue(h.path, h.newV);
-		refreshProps();
-	}
-
-	public dynamic function resolveProps( path : Array<String> ) : Array<Property> {
-		return null;
-	}
-
-	function resolvePropPath( path : String ) : Property {
-		var fullPath = path;
-		var path = path.split(".");
-		var props = resolveProps(path);
-		if( props == null ) {
-			trace("Prop not found " + path);
-			return null;
-		}
-		var ppath = path.join(".");
-		var p = getPropPath(path, props);
-		if( p == null )
-			trace("Prop not found " + ppath + " in "+fullPath.substr(0, fullPath.length - (ppath.length + 1)));
-		return p;
-	}
-
-	public function getPathPropValue( path : String ) : Dynamic {
-		var p = resolvePropPath(path);
-		if( p == null ) return null;
-		return getPropValue(p);
-	}
-
-	public function setPathPropValue( path : String, v : Dynamic ) {
-		var p = resolvePropPath(path);
-		if( p != null )
-			PropTools.setPropValue(p, v);
-	}
-
-	function getPropPath( path : Array<String>, props : Array<Property> ) {
-		for( p in props ) {
-			var p = propFollow(p);
-			var name = PropTools.getPropName(p);
-			if( name == path[0] ) {
-				path.shift();
-				switch( p ) {
-				case PGroup(_, props):
-					return getPropPath(path, props);
-				default:
-					return path.length == 0 ? p : null;
-				}
-			}
-		}
-		return null;
-	}
-
-	function getPropValue( p : Property ) : Dynamic {
-		switch( p ) {
-		case PInt(_, get, _): return get();
-		case PFloat(_, get, _): return get();
-		case PRange(_, _, _, get, _): return get();
-		case PString(_, get, _): return get();
-		case PBool(_, get, _): return get();
-		case PEnum(_, _, get, _): return get();
-		case PColor(_, alpha, get, _): return "#" + StringTools.hex(get().toColor(),alpha?8:6);
-		case PFloats(_, get, _): return get().copy();
-		case PTexture(_, get, _):
-			var t = get();
-			return getTexturePath(t, false);
-		case PGroup(_), PPopup(_), PCustom(_):
-			throw "Cannot get property " + p.getName();
-		}
-	}
-
-	public function makeProps( basePath : String, props : Array<Property>, expandLevel = 1 ) {
-		var t = J("<table>");
-		t.addClass("iprops");
-		refreshProps = function() {
-			t.text("");
-			for( p in props )
-				addProp(basePath, t, p, [], expandLevel);
-		};
-		refreshProps();
-		return t;
-	}
-
-	public function sameValue( v1 : Dynamic, v2 : Dynamic ) {
-		if( v1 == v2 ) return true;
-		if( hxd.impl.Api.isOfType(v1, Array) && hxd.impl.Api.isOfType(v2, Array) ) {
-			var a1 : Array<Dynamic> = v1;
-			var a2 : Array<Dynamic> = v2;
-			if( a1.length != a2.length )
-				return false;
-			for( i in 0...a1.length )
-				if( !sameValue(a1[i], a2[i]) )
-					return false;
-			return true;
-		}
-		return false;
-	}
-
-	function addHistory( path : String, oldV : Dynamic, newV : Dynamic ) {
-		if( sameValue(oldV, newV) )
-			return;
-		history.push( { path : path, oldV : oldV, newV : newV } );
-		redoHistory = [];
-		onChange(path, oldV, newV);
-	}
-
-	public dynamic function onChange( path : String, oldV : Dynamic, newV : Dynamic ) {
-	}
-
-	function propFollow( p : Property ) {
-		return switch( p ) {
-		case PPopup(p, _, _): propFollow(p);
-		default: p;
-		}
-	}
-
-	var cachedResPath = null;
-
-	public function getResPath() {
-		if( cachedResPath != null )
-			return cachedResPath;
-		var lfs = hxd.impl.Api.downcast(hxd.res.Loader.currentInstance.fs, hxd.fs.LocalFileSystem);
-		if( lfs != null )
-			cachedResPath = lfs.baseDir;
-		else {
-			var resPath = haxe.macro.Compiler.getDefine("resPath");
-			if( resPath == null ) resPath = "res";
-			cachedResPath = hxd.File.applicationPath() + resPath + "/";
-		}
-		return cachedResPath;
-	}
-
-	function getTexturePath( t : h3d.mat.Texture, absolute : Bool ) {
-		var res = null;
-		try {
-			if( t != null && t.name != null )
-				res = hxd.res.Loader.currentInstance.load(t.name).toImage();
-		} catch( e : Dynamic ) {
-		}
-		if( res != null ) {
-			if( !absolute )
-				return res.entry.path;
-			return getResPath() + res.entry.path;
-		}
-		if( t != null && t.name != null && (t.name.charCodeAt(0) == '/'.code || t.name.charCodeAt(1) == ':'.code) )
-			return t.name;
-		return null;
-	}
-
-	public dynamic function onShowTexture( t : h3d.mat.Texture ) {
-	}
-
-	function addProp( basePath : String, t : JQuery, p : Property, gids : Array<Int>, expandLevel ) {
-		var j = J("<tr>");
-		j.addClass("prop");
-		for( g in gids )
-			j.addClass("g_" + g);
-		j.addClass(p.getName().toLowerCase());
-
-		var visible = gids.length <= expandLevel;
-
-		if( groupsStatus.exists(basePath) )
-			visible = groupsStatus.get(basePath);
-		if( !visible )
-			j.style("display", "none");
-
-		if( gids.length > 0 ) {
-			var gid = gids[gids.length - 1];
-			j.addClass("gs_" + gid);
-		}
-
-		j.appendTo(t);
-
-		var jname = J("<th>");
-		var jprop = J("<td>");
-		jname.appendTo(j);
-		jprop.appendTo(j);
-
-		var name = PropTools.getPropName(p);
-		var path = basePath + "." +name;
-		if( name != null )
-			jname.text(name);
-
-		switch( p ) {
-		case PGroup(name, props):
-
-			var expand = gids.length + 1 <= expandLevel;
-			if( groupsStatus.exists(path) )
-				expand = groupsStatus.get(path);
-
-			jname.attr("colspan", "2");
-			jname.style("padding-left", (gids.length * 16) + "px");
-			jname.html('<i class="fa ' + (expand ? 'fa-arrow-down' : 'fa-arrow-right') +'" attr="$path"/> ' + StringTools.htmlEscape(name));
-			var gid = t.get().childs.length;
-			j.click(function(_) {
-				var i = jname.find("i");
-				var show = i.hasClass("fa-arrow-right");
-
-				i.attr("class", "fa "+(show ? "fa-arrow-down" : "fa-arrow-right"));
-				if( show )
-					t.find(".gs_" + gid).style("display", "");
-				else {
-					var all = t.find(".g_" + gid);
-					all.style("display", "none");
-					all.find("i.fa-arrow-down").attr("class", "fa fa-arrow-right");
-					for( a in all.find("i.fa-arrow-right").elements() )
-						groupsStatus.set(a.getAttr("path"), false);
-				}
-
-				groupsStatus.set(path, show);
-
-			});
-			jprop.dispose();
-			gids.push(gid);
-			for( p in props )
-				addProp(path, t, p, gids, expandLevel);
-			gids.pop();
-
-		case PBool(_, get, set):
-			var v = get();
-			jprop.text(v ? "Yes" : "No");
-			jprop.click(function(_) {
-				addHistory(path,v,!v);
-				v = !v;
-				set(v);
-				jprop.text(v ? "Yes" : "No");
-			});
-		case PEnum(_, tenum, get, set):
-			jprop.text(get());
-			var delay = false;
-			jprop.click(function(_) {
-
-				if( delay ) return;
-
-				var input = J("<select>");
-				var cur = (get() : EnumValue).getIndex();
-				var all : Array<EnumValue> = tenum.createAll();
-				for( p in all ) {
-					var name = p.getName();
-					var idx = p.getIndex();
-					J("<option>").attr("value", "" + p.getIndex()).attr(idx == cur ? "selected" : "_sel", "selected").text(name).appendTo(input);
-				}
-				jprop.text("");
-				input.appendTo(jprop);
-				input.focus();
-				input.blur(function(_) {
-					input.dispose();
-					jprop.text(get());
-				});
-				input.change(function(_) {
-					var v = Std.parseInt(input.getValue());
-					if( v != null ) {
-						addHistory(path, cur, v);
-						cur = v;
-						set(all[v]);
-					}
-					input.dispose();
-					jprop.text(get());
-					delay = true;
-					haxe.Timer.delay(function() delay = false, 200);
-				});
-			});
-		case PInt(_, get, set):
-			jprop.text("" + get());
-			jprop.click(function(_) editValue(jprop,function() return "" + get(),
-				function(s) {
-					var i = Std.parseInt(s);
-					if( i != null ) {
-						addHistory(path, get(), i);
-						set(i);
-					}
-				}
-			));
-			jprop.mousedown(function(e) {
-				if( e.which == 3 ) {
-					if( jprop.find("input").length > 0 ) return;
-					var old = get();
-					var cur : Float = old;
-					j.addClass("active");
-					jprop.special("startDrag", [], function(v: { done:Bool, dx:Float, dy:Float } ) {
-						var delta = ( Math.max(Math.abs(old == 0 ? 1 : old),1e-3) / 200 ) * v.dx;
-						cur += delta;
-						cur = hxd.Math.fmt(cur);
-						var icur = Math.round(cur);
-						set(icur);
-						jprop.text("" + icur);
-						if( v.done ) {
-							j.removeClass("active");
-							addHistory(path, old, icur);
-						}
-						return v.done;
-					});
-				}
-			});
-		case PFloat(_, get, set):
-			jprop.text("" + get());
-			jprop.click(function(_) editValue(jprop,function() return "" + get(),
-				function(s) {
-					var f = Std.parseFloat(s);
-					if( !Math.isNaN(f) ) {
-						addHistory(path, get(), f);
-						set(f);
-					}
-				}
-			));
-			jprop.mousedown(function(e) {
-				if( e.which == 3 ) {
-					if( jprop.find("input").length > 0 ) return;
-					var old = get();
-					var cur = old;
-					j.addClass("active");
-					jprop.special("startDrag", [], function(v: { done:Bool, dx:Float, dy:Float } ) {
-						var delta = ( Math.max(Math.abs(old == 0 ? 1 : old),1e-3) / 100 ) * v.dx;
-						cur += delta;
-						cur = hxd.Math.fmt(cur);
-						set(cur);
-						jprop.text("" + cur);
-						if( v.done ) {
-							j.removeClass("active");
-							addHistory(path, old, cur);
-						}
-						return v.done;
-					});
-				}
-			});
-		case PRange(_, min, max, get, set, incr):
-			var v = get();
-			if( incr == null ) incr = (max - min) / 400;
-			jprop.html('<input class="range" type="range" min="$min" max="$max" value="$v" step="$incr"/> <span class="range_text">$v</span>');
-			var ji = jprop.find("input.range");
-			var jt = jprop.find("span");
-			ji.bind("input",function(_) {
-				var nv = Std.parseFloat(ji.getValue());
-				set(nv);
-				jt.text("" + nv);
-			});
-			ji.bind("change", function(_) {
-				var nv = Std.parseFloat(ji.getValue());
-				if( v != nv ) {
-					addHistory(path, v, nv);
-					v = nv;
-				}
-				set(nv);
-				jt.text("" + nv);
-			});
-			jt.click(function(_) editValue(jt, function() return "" + get(), function(s) {
-				var nv = Std.parseFloat(s);
-				if( !Math.isNaN(nv) && v != nv ) {
-					addHistory(path, v, nv);
-					v = nv;
-					set(nv);
-					ji.val(nv);
-				}
-			}));
-		case PFloats(_, get, set):
-			var values = get();
-			jprop.html("<table><tr></tr></table>");
-			var jt = jprop.find("tr");
-			for( i in 0...values.length ) {
-				var jv = J("<td>").appendTo(jt);
-				jv.text("" + values[i]);
-				jv.click(function(_) editValue(jv,function() return "" + values[i],
-					function(s) {
-						var f = Std.parseFloat(s);
-						if( !Math.isNaN(f) ) {
-							var old = values.copy();
-							values[i] = f;
-							addHistory(path, old, values.copy());
-							set(values);
-						}
-					}
-				));
-				jv.mousedown(function(e) {
-					if( e.which == 3 ) {
-						if( jv.find("input").length > 0 ) return;
-						var old = values.copy();
-						var cur = old[i];
-						jv.addClass("active");
-						jv.special("startDrag", [], function(v: { done:Bool, dx:Float, dy:Float } ) {
-							var delta = ( Math.max(Math.abs(old[i] == 0 ? 1 : old[i]), 1e-3) / 100 ) * v.dx;
-							cur += delta;
-							values[i] = hxd.Math.fmt(cur);
-							set(values);
-							jv.text("" + values[i]);
-							if( v.done ) {
-								jv.removeClass("active");
-								addHistory(path, old, values.copy());
-							}
-							return v.done;
-						});
-					}
-			});
-			}
-		case PString(_, get, set):
-			var cur = get();
-			jprop.text("" + cur);
-			jprop.click(function(_) editValue(jprop, get, function(s) {
-				addHistory(path, cur, s);
-				cur = s;
-				set(cur);
-			}));
-		case PColor(_, alpha, get, set):
-			var cur = 0;
-			function init() {
-				cur = get().toColor();
-				if( !alpha ) cur &= 0xFFFFFF;
-				jprop.html('<div class="color" style="background:#${StringTools.hex(cur&0xFFFFFF,6)}"></div>');
-			}
-			var delay = false;
-			jprop.click(function(_) {
-				if( delay ) return;
-				jprop.special("colorPick", [get().toColor(), alpha], function(c:Dynamic) {
-					if( jprop.get() == null || jprop.get().id < 0 )
-						return true;
-					delay = true;
-					haxe.Timer.delay(function() delay = false, 200);
-					var color = h3d.Vector.fromColor(c.color);
-					if( c.done ) {
-						if( !alpha ) c.color &= 0xFFFFFF;
-						addHistory(path, "#"+StringTools.hex(cur,alpha?8:6), "#"+StringTools.hex(c.color,alpha?8:6));
-						cur = c.color;
-					}
-					set(color);
-					if( c.done ) init();
-					return c.done;
-				});
-			});
-			init();
-		case PTexture(_, get, set):
-			var filePath = null;
-			var isLoaded = false;
-			function init() {
-				var t = get();
-				filePath = getTexturePath(t, true);
-				if( filePath == null ) {
-					if( t == null )
-						jprop.text("");
-					else {
-						jprop.html(StringTools.htmlEscape("" + t) + " <button>View</button>");
-						jprop.find("button").click(function(_) onShowTexture(get()));
-					}
-				} else
-					jprop.html('<img src="file://$filePath"/>');
-			}
-			init();
-
-			function onTextureSelect(_) {
-				jprop.special("fileSelect", [filePath, "png,jpg,jpeg,gif"], function(newPath) {
-					if( newPath == null ) return true;
-
-					hxd.File.load(newPath, function(data) {
-						if( isLoaded ) get().dispose();
-						isLoaded = true;
-						if( StringTools.startsWith(newPath.toLowerCase(), getResPath().toLowerCase()) )
-							newPath = newPath.substr(getResPath().length);
-						set( hxd.res.Any.fromBytes(newPath, data).toTexture() );
-						addHistory(path, filePath, newPath);
-						init();
-						filePath = newPath;
-					});
-
-					return true;
-				});
-			}
-
-			if( filePath == null )
-				jprop.dblclick(onTextureSelect);
-			else
-				jprop.click(onTextureSelect);
-
-
-		case PPopup(p, menu, click):
-			j.dispose();
-			j = addProp(basePath, t, p, gids, expandLevel);
-			j.mousedown(function(e) {
-				if( e.which == 3 )
-					j.special("popupMenu", menu, function(i) { click(j, i); return true; });
-			});
-		case PCustom(name, content, _):
-			if( name == "" ) {
-				jname.dispose();
-				jprop.attr("colspan", "2");
-			}
-			var c = content();
-			if( c != null ) c.appendTo(jprop);
-		}
-		return j;
-	}
-
-	function editValue( j : JQuery, get : Void -> String, set : String -> Void ) {
-
-		if( j.find("input").length > 0 ) return;
-
-		var input = J("<input>");
-		input.attr("value", get());
-		j.text("");
-		input.appendTo(j);
-		input.focus();
-		input.select();
-		input.blur(function(_) {
-			set(input.getValue());
-			input.dispose();
-			j.text(get());
-		});
-		input.keydown(function(e) {
-			if( e.keyCode == 13 )
-				input.blur();
-		});
-	}
-
-}

+ 0 - 91
hxd/inspect/PropTools.hx

@@ -1,91 +0,0 @@
-package hxd.inspect;
-import hxd.impl.Api;
-
-class PropTools {
-
-	public static function setPropValue( p : Property, v : Dynamic, lerp = 1. ) {
-		switch( p ) {
-		case PInt(_, get, set):
-			if( !Api.isOfType(v, Int) ) throw "Invalid int value " + v;
-			var v : Int = v;
-			if( lerp == 1 )
-				set(v);
-			else {
-				var prev = get();
-				var u = hxd.Math.lerp(prev, v, lerp);
-				set( prev < v ? Math.ceil(u) : Math.floor(u) );
-			}
-		case PFloat(_, get, set):
-			if( !Api.isOfType(v, Float) ) throw "Invalid float value " + v;
-			if( lerp == 1 )
-				set(v);
-			else
-				set(hxd.Math.lerp(get(), v, lerp));
-		case PRange(_, _, _, get, set):
-			if( !Api.isOfType(v, Float) ) throw "Invalid float value " + v;
-			if( lerp == 1 )
-				set(v);
-			else
-				set(hxd.Math.lerp(get(), v, lerp));
-		case PBool(_, _, set):
-			if( !Api.isOfType(v, Bool) ) throw "Invalid bool value " + v;
-			set(v);
-		case PString(_, _, set):
-			if( v != null && !Api.isOfType(v, String) ) throw "Invalid string value " + v;
-			set(v);
-		case PEnum(_, en, _, set):
-			var e = en.createAll()[v];
-			if( e == null || !Api.isOfType(v, Int) ) throw "Invalid enum " + en.getName() + " value " + v;
-			set(e);
-		case PColor(_, _, get, set):
-			if( !Api.isOfType(v, String) ) throw "Invalid color value " + v;
-			var v : String = v;
-			var newV = h3d.Vector.fromColor(Std.parseInt("0x" + v.substr(1)));
-			if( lerp == 1 )
-				set(newV);
-			else {
-				var prev = get();
-				newV.r = hxd.Math.lerp(prev.r, newV.r, lerp);
-				newV.g = hxd.Math.lerp(prev.g, newV.g, lerp);
-				newV.b = hxd.Math.lerp(prev.b, newV.b, lerp);
-				newV.a = hxd.Math.lerp(prev.a, newV.a, lerp);
-				set(newV);
-			}
-		case PFloats(_, get, set):
-			if( !Api.isOfType(v, Array) ) throw "Invalid floats value " + v;
-			var a : Array<Float> = v;
-			var prev = get();
-			var need = prev.length;
-			if( a.length != need ) throw "Require " + need + " floats in value " + v;
-			if( lerp == 1 )
-				set(a.copy());
-			else {
-				var newA = a.copy();
-				for( i in 0...need )
-					newA[i] = hxd.Math.lerp(prev[i], newA[i], lerp);
-				set(newA);
-			}
-		case PTexture(_, _, set):
-			if( !Api.isOfType(v, String) ) throw "Invalid texture value " + v;
-			var path : String = v;
-			if( path.charCodeAt(0) != '/'.code && path.charCodeAt(1) != ':'.code ) {
-				set(hxd.res.Loader.currentInstance.load(path).toTexture());
-			} else
-				hxd.File.load(path, function(data) set( hxd.res.Any.fromBytes(path, data).toTexture() ));
-		case PCustom(_, _, set) if( set != null ):
-			set(v);
-		case PPopup(p, _):
-			setPropValue(p, v);
-		case PGroup(_), PCustom(_):
-			throw "Cannot set property " + p.getName();
-		}
-	}
-
-	public static function getPropName( p : Property ) {
-		return switch( p ) {
-		case PGroup(name, _), PBool(name, _), PInt(name, _), PFloat(name, _), PFloats(name, _), PString(name, _), PColor(name, _), PTexture(name, _), PEnum(name,_,_,_), PCustom(name,_), PRange(name,_): name;
-		case PPopup(p, _): getPropName(p);
-		}
-	}
-
-}

+ 0 - 18
hxd/inspect/Property.hx

@@ -1,18 +0,0 @@
-package hxd.inspect;
-
-enum Property {
-	PBool( name : String, get : Void -> Bool, set : Bool -> Void );
-	PInt( name : String, get : Void -> Int, set : Int -> Void );
-	PFloat( name : String, get : Void -> Float, set : Float -> Void );
-	PRange( name : String, min : Float, max : Float, get : Void -> Float, set : Float -> Void, ?incr : Float );
-	PString( name : String, get : Void -> String, set : String -> Void );
-	PEnum( name : String, e : Enum<Dynamic>, get : Void -> Dynamic, set : Dynamic -> Void );
-	PColor( name : String, hasAlpha : Bool, get : Void -> h3d.Vector, set : h3d.Vector -> Void );
-	PGroup( name : String, props : Array<Property> );
-	PTexture( name : String, get : Void -> h3d.mat.Texture, set : h3d.mat.Texture -> Void );
-	PFloats( name : String, get : Void -> Array<Float>, set : Array<Float> -> Void );
-#if hxbit
-	PPopup( p : Property, menu : Array<String>, click : vdom.JQuery -> Int -> Void );
-	PCustom( name : String, content : Void -> vdom.JQuery, ?set : Dynamic -> Void );
-#end
-}

+ 0 - 87
hxd/inspect/ResPanel.hx

@@ -1,87 +0,0 @@
-package hxd.inspect;
-
-private class ResObject extends TreeNode {
-
-	public var f : hxd.fs.FileEntry;
-
-	public function new(f, p) {
-		this.f = f;
-		super(f.name, p);
-	}
-
-}
-
-
-class ResPanel extends Panel {
-
-	var loader : hxd.res.Loader;
-	var needSync = true;
-	var files : Array<ResObject> = [];
-	var filePos : Int;
-
-	public function new(id, loader) {
-		super(id, "Resources");
-		this.loader = loader;
-		sync();
-	}
-
-	override function sync() {
-		if( !needSync ) return;
-		needSync = false;
-		filePos = 0;
-		var subs = Lambda.array(loader.fs.getRoot());
-		haxe.ds.ArraySort.sort(subs,function(s1, s2) return (s1.isDirectory?0:1) - (s2.isDirectory?0:1));
-		for( e in subs )
-			syncRec(e, this);
-		while( files.length > filePos )
-			files.pop().dispose();
-	}
-
-	override function initContent() {
-		super.initContent();
-		j.addClass("resources");
-		j.html('
-			<div class="scrollable">
-				<ul class="elt root">
-				</ul>
-			</div>
-		');
-		content = j.find(".root");
-	}
-
-	function getFileIcon( f : hxd.fs.FileEntry ) {
-		if( f.isDirectory )
-			return "folder-o";
-		switch( f.extension ) {
-		case "png", "gif", "jpg", "jpeg":
-			return "file-image-o";
-		case "xml":
-			return "file-code-o";
-		case "wav", "mp3", "ogg":
-			return "file-sound-o";
-		case "fbx":
-			return "cube";
-		default:
-			return "file-text-o";
-		}
-	}
-
-	function syncRec( f : hxd.fs.FileEntry, parent : Node ) {
-		var fo = files[filePos];
-		if( fo == null || fo.name != f.name ) {
-			fo = new ResObject(f, parent);
-			fo.icon = getFileIcon(f);
-			files.insert(filePos, fo);
-		}
-		filePos++;
-		if( f.isDirectory ) {
-			f.watch(function() needSync = true);
-			fo.openIcon = "folder-open-o";
-			var subs = Lambda.array(f);
-			haxe.ds.ArraySort.sort(subs,function(s1, s2) return (s1.isDirectory?0:1) - (s2.isDirectory?0:1));
-			for( c in subs )
-				syncRec(c, fo);
-		}
-	}
-
-}

+ 0 - 416
hxd/inspect/ScenePanel.hx

@@ -1,416 +0,0 @@
-package hxd.inspect;
-import hxd.inspect.Property;
-import hxd.impl.Api;
-
-private class SceneObject extends TreeNode {
-
-	public var o : h3d.scene.Object;
-	public var visible = true;
-	public var culled = false;
-
-	public function new(o, p) {
-		this.o = o;
-		super(o.name != null ? o.name : o.toString(), p);
-	}
-
-	override function initContent() {
-		super.initContent();
-		j.children(".content").mousedown(function(e) {
-			if( e.which == 3 ) {
-				var menu = getContextMenu();
-				j.special("popupMenu", [for( m in menu ) m.name], function(i) { if( i >= 0 ) menu[i].call(); return true; });
-			}
-		});
-	}
-
-	function getContextMenu() {
-		return [
-			{ name : "Remove", call : function() o.remove() },
-			{ name : "Add Particles", call : function() new h3d.parts.GpuParticles(o) },
-		];
-	}
-
-	function objectName( o : h3d.scene.Object ) {
-		var name = o.name != null ? o.name : o.toString();
-		return name.split(".").join("_");
-	}
-
-	override function getPathName() {
-		var name = objectName(o);
-		if( o.parent == null )
-			return name;
-		var idx = @:privateAccess o.parent.children.indexOf(o);
-		var count = 0;
-		for( i in 0...idx )
-			if( objectName(o.parent.getChildAt(i)) == name )
-				count++;
-		if( count > 0 )
-			name += "@" + count;
-		return name;
-	}
-
-}
-
-private class CustomSceneProps extends SceneProps {
-
-	var inspect : Inspector;
-	var panel : ScenePanel;
-	var resPath : Map<h3d.scene.Object, String> = new Map();
-
-	public function new(panel, scene) {
-		this.inspect = Inspector.getCurrent();
-		this.panel = panel;
-		super(scene);
-	}
-
-	override function refresh() {
-		haxe.Timer.delay(inspect.refreshProps, 0);
-	}
-
-	override function addNode(name:String, icon:String, props:Void-> Array<Property>, ?parent:Node) : Node {
-		return panel.addNode(name, icon, props, cast parent);
-	}
-
-	override function getMaterialShaderProps(mat:h3d.mat.Material, pass:h3d.mat.Pass, shader:hxsl.Shader) {
-		var shaders = [for( s in pass.getShaders() ) s];
-		shaders.reverse();
-		var index = shaders.indexOf(shader);
-		var p = super.getMaterialShaderProps(mat, pass, shader);
-		p = PPopup(p, ["Toggle", "View Source"], function(j, i) {
-			switch( i ) {
-			case 0:
-				if( index == 0 ) return; // Don't allow toggle base shader
-				if( !pass.removeShader(shader) )
-					@:privateAccess pass.addShaderAtIndex(shader, shaders.length - (index + 1));
-				j.toggleClass("disable");
-			case 1:
-				var shader = @:privateAccess shader.shader;
-				var p = new Panel(null, shader.data.name+" shader");
-				var toString = hxsl.Printer.shaderToString;
-				var code = toString(shader.data);
-				p.j.html("<pre class='code'>" + colorize(code) + "</pre>");
-				p.show();
-			}
-		});
-		return p;
-	}
-
-	override function getMaterialPassProps(mat:h3d.mat.Material, pass:h3d.mat.Pass) {
-		var p = super.getMaterialPassProps(mat, pass);
-		p = PPopup(p, ["Toggle", "View Shader"], function(j, i) {
-			switch( i ) {
-			case 0:
-				if( !mat.removePass(pass) )
-					mat.addPass(pass);
-				j.toggleClass("disable");
-			case 1:
-				var p = new Panel(null,pass.name+" shader");
-				var shader = scene.renderer.debugCompileShader(pass);
-				var toString = hxsl.Printer.shaderToString;
-				var code = toString(shader.vertex.data) + "\n\n" + toString(shader.fragment.data);
-				p.j.html("<pre class='code'>" + colorize(code) + "</pre>");
-				p.show();
-			}
-		});
-		return p;
-	}
-
-	function colorize( code : String ) {
-		code = code.split("\t").join("    ");
-		code = StringTools.htmlEscape(code);
-		code = ~/\b((var)|(function)|(if)|(else)|(for)|(while))\b/g.replace(code, "<span class='kwd'>$1</span>");
-		code = ~/(@[A-Za-z]+)/g.replace(code, "<span class='meta'>$1</span>");
-		return code;
-	}
-
-	function getWorldInfos( world : h3d.scene.World, o : h3d.scene.Object ) {
-		var emap = new Map();
-		var extraMap = new Map();
-		var all = [];
-		for( chunk in @:privateAccess world.allChunks ) {
-
-			if( o == null && !panel.showHidden && (!chunk.root.visible || chunk.root.culled) )
-				continue;
-
-			for( mid in chunk.buffers.keys() ) {
-				var buf = chunk.buffers.get(mid);
-				if( (o == null && (panel.showHidden || (buf.visible && !buf.culled))) || chunk.root == o || buf == o ) {
-					for( e in chunk.elements )
-						for( g in e.model.geometries )
-							if( g.m.bits == mid ) {
-								var inf = emap.get(g);
-								if( inf == null ) {
-									inf = { count : 0, pass : buf.material.getPasses().length, tri : 0, name : e.model.r.name, e : e, g : g };
-									all.push(inf);
-									emap.set(g, inf);
-								}
-								inf.count++;
-							}
-				}
-			}
-			// negative ids are reserved for custom usage
-			var meshes = [for( mid in chunk.buffers.keys() ) if( mid >= 0 ) (chunk.buffers.get(mid):h3d.scene.Object)];
-			for( r in chunk.root )
-				if( r.name != null && !meshes.remove(r) && r.isMesh() && ((o == null && (panel.showHidden || (r.visible && !r.culled))) || chunk.root == o) ) {
-					var m = r.toMesh();
-					var inf = extraMap.get(r.name);
-					var npass = m.material.getPasses().length;
-					if( inf == null ) {
-						inf = { count : 0, pass : npass, tri : 0, name : r.name, e : null, g : null };
-						all.push(inf);
-						extraMap.set(r.name, inf);
-					}
-					inf.count++;
-					inf.tri += m.primitive.triCount() * npass;
-				}
-		}
-		if( all.length == 0 )
-			return null;
-		for( e in all )
-			if( e.e != null )
-				e.tri = Std.int(e.g.indexCount / 3) * e.count * e.pass;
-		all.sort(function(e1, e2) return e2.tri - e1.tri);
-		return PCustom("", function() {
-			var j = panel.j.query("<table>");
-
-			var totCount = 0, totTri = 0;
-			for( e in all ) {
-				totCount += e.count;
-				totTri += e.tri;
-			}
-
-			j.html('
-				<tr><th>Material</th><th>Count</th><th>Passes</th><th>Tri</th></tr>
-				<tr><td>TOTAL</td><td>$totCount</td><td></td><td>$totTri</td></tr>
-			');
-
-			for( e in all ) {
-				var name = e.name;
-				if( e.e != null && e.e.model.geometries.length > 1 )
-					name += ":" + e.g.m.name;
-				var line = j.query("<tr>");
-				j.query("<td>").text(name).appendTo(line);
-				j.query("<td>").text("" + e.count).appendTo(line);
-				j.query("<td>").text("" + e.pass).appendTo(line);
-				j.query("<td>").text("" + e.tri).appendTo(line);
-				line.appendTo(j);
-			}
-			return j;
-		});
-	}
-
-	override function getObjectProps( o : h3d.scene.Object ) {
-		var props = super.getObjectProps(o);
-		var world = hxd.impl.Api.downcast(o, h3d.scene.World);
-		var worldObject = world == null ? o : null;
-		if( world == null ) {
-			world = hxd.impl.Api.downcast(o.parent, h3d.scene.World);
-			if( world != null && !Lambda.exists(@:privateAccess world.allChunks, function(c) return c.root == o) )
-				world = null;
-		}
-		if( world == null && o.parent != null ) {
-			world = hxd.impl.Api.downcast(o.parent.parent, h3d.scene.World);
-			if( world != null && !Lambda.exists(@:privateAccess world.allChunks, function(c) return c.root == o.parent) )
-				world = null;
-		}
-		if( world != null ) {
-			var infos = getWorldInfos(world, worldObject);
-			if( infos != null ) props.push(infos);
-		}
-		return props;
-	}
-
-
-}
-
-class ScenePanel extends Panel {
-
-	var scene : h3d.scene.Scene;
-	var sceneObjects : Array<SceneObject>;
-	var scenePosition = 0;
-	var currentPick(default,set) : h3d.scene.Mesh;
-	var currentPickShader : hxsl.Shader;
-	var btPick : vdom.JQuery;
-	var lastPickEvent : Null<Int>;
-	var sprops : SceneProps;
-	public var showHidden(default, null) : Bool = true;
-
-	public function new(name, scene) {
-		super(name, "Scene 3D");
-		sceneObjects = [];
-		this.scene = scene;
-		sprops = new CustomSceneProps(this, scene);
-	}
-
-	override function initContent() {
-		super.initContent();
-		j.addClass("scene");
-		j.html('
-			<ul class="buttons">
-				<li class="bt_hide" title="Show/Hide invisible objects">
-					<i class="fa fa-eye" />
-				</li>
-				<li class="bt_pick" title="Pick object in game">
-					<i class="fa fa-hand-o-up" />
-				</li>
-			</ul>
-			<div class="scrollable">
-				<ul class="elt root">
-				</ul>
-			</div>
-		');
-		content = j.find(".root");
-
-		var bt = j.find(".bt_hide");
-		bt.addClass("active");
-		bt.click(function(_) {
-			showHidden = !showHidden;
-			bt.toggleClass("active");
-			content.toggleClass("masked");
-		});
-
-		btPick = j.find(".bt_pick");
-		btPick.click(function(_) {
-			btPick.toggleClass("active");
-			var window = hxd.Window.getInstance();
-			if( !btPick.hasClass("active") ) {
-				currentPick = null;
-				lastPickEvent = null;
-				window.removeEventTarget(onPickEvent);
-				return;
-			}
-			lastPickEvent = 0;
-			window.addEventTarget(onPickEvent);
-		});
-	}
-
-	function set_currentPick(m) {
-		if( currentPick == m )
-			return m;
-		if( currentPick != null ) {
-			currentPick.material.mainPass.removeShader(currentPickShader);
-			currentPickShader = null;
-		}
-		currentPick = m;
-		if( currentPick != null ) {
-			var m = new h3d.shader.ColorMatrix();
-			m.matrix.identity();
-			m.matrix.colorHue(0.1);
-			m.matrix.colorLightness(0.2);
-			currentPickShader = m;
-			currentPick.material.mainPass.addShader(m);
-		}
-		return m;
-	}
-
-	function onPickEvent( e : hxd.Event ) {
-		switch( e.kind ) {
-		case EMove:
-			lastPickEvent = hxd.Timer.frameCount;
-			var obj = scene.hardwarePick(e.relX, e.relY);
-			currentPick = obj == null ? null : obj.toMesh();
-		case EPush:
-			if( currentPick == null ) return;
-			var cur = currentPick;
-			currentPick = null;
-			btPick.click();
-			for( o in sceneObjects )
-				if( o.o == cur ) {
-					o.click();
-					o.j.scrollIntoView();
-					break;
-				}
-		default:
-		}
-	}
-
-	public function addNode( name : String, icon : String, ?getProps : Void -> Array<Property>, ?parent : TreeNode ) {
-		var n = new TreeNode(name, parent == null ? this : parent);
-		n.icon = icon;
-		n.props = getProps;
-		if( getProps != null )
-			n.onSelect = function() inspect.editProps(n);
-		return n;
-	}
-
-	function getObjectIcon( o : h3d.scene.Object) {
-		if( Api.isOfType(o, h3d.scene.Skin) )
-			return "child";
-		if( Api.isOfType(o, h3d.parts.Particles) || Api.isOfType(o,h3d.parts.GpuParticles) )
-			return "sun-o";
-		if( Api.isOfType(o, h3d.scene.Mesh) )
-			return "cube";
-		if( Api.isOfType(o, h3d.scene.CustomObject) )
-			return "globe";
-		if( Api.isOfType(o, h3d.scene.Scene) )
-			return "picture-o";
-		if( Api.isOfType(o, h3d.scene.Light) )
-			return "lightbulb-o";
-		return null;
-	}
-
-	override function sync() {
-		scenePosition = 0;
-		syncRec(scene, this);
-		while( sceneObjects.length > scenePosition )
-			sceneObjects.pop().dispose();
-		var frame = hxd.Timer.frameCount;
-		if( lastPickEvent != null && lastPickEvent < frame - 1 ) {
-			var window = hxd.Window.getInstance();
-			var e = new hxd.Event(EMove, window.mouseX, window.mouseY);
-			haxe.Timer.delay(function() { if( lastPickEvent == null ) return; onPickEvent(e); }, 0); // flash don't like to capture while rendering
-		}
-	}
-
-	@:access(hxd.inspect.TreeNode)
-	function syncRec( o : h3d.scene.Object, p : Node ) {
-		var so = sceneObjects[scenePosition];
-		if( so != null && so.o != o ) {
-			for( i in scenePosition + 1...sceneObjects.length )
-				if( sceneObjects[i].o == o ) {
-					var tmp = sceneObjects[i];
-					sceneObjects[i] = so;
-					sceneObjects[scenePosition] = tmp;
-					so = tmp;
-					break;
-				}
-		}
-		if( so == null || so.o != o ) {
-			so = new SceneObject(o, p);
-			sceneObjects.insert(scenePosition, so);
-			var icon = getObjectIcon(o);
-			so.icon = icon == null ? "circle-o" : getObjectIcon(o);
-			so.props = function() return sprops.getObjectProps(o);
-			so.onSelect = function() inspect.editProps(so);
-		}
-
-		if( so.parent != p ) so.parent = p;
-
-		if( o.visible != so.visible ) {
-			so.visible = o.visible;
-			so.j.toggleClass("hidden");
-		}
-		@:privateAccess if( o.culled != so.culled ) {
-			so.culled = o.culled;
-			so.j.toggleClass("culled");
-		}
-
-		scenePosition++;
-		if( o.numChildren > 0 ) {
-			if( so.openIcon == null && so.icon == "circle-o" ) {
-				so.openIcon = "circle-o";
-				so.icon = "dot-circle-o";
-			}
-			for( c in o )
-				syncRec(c, so);
-		} else if( so.jchild != null ) {
-			for( o in so.childs.copy() )
-				o.dispose();
-			if( so.openIcon == "circle-o" ) {
-				so.openIcon = null;
-				so.icon = "circle-o";
-			}
-		}
-	}
-
-}

+ 0 - 458
hxd/inspect/SceneProps.hx

@@ -1,458 +0,0 @@
-package hxd.inspect;
-import hxd.inspect.Property;
-import hxd.impl.Api;
-
-enum RendererSection {
-	Core;
-	Textures;
-	Lights;
-}
-
-class SceneProps {
-
-	var scene : h3d.scene.Scene;
-	public var root : Node;
-
-	public function new( scene ) {
-		this.scene = scene;
-		root = new Node("s3d");
-		initRenderer();
-	}
-
-	function refresh() {
-	}
-
-	function addNode( name : String, icon : String, props : Void -> Array<Property>, ?parent : Node ) : Node {
-		if( parent == null ) parent = root;
-		var n = new Node(name, parent);
-		n.props = props;
-		return n;
-	}
-
-	function initRenderer() {
-		var r = addNode("Renderer", "sliders", getRendererProps.bind(Core));
-		addNode("Lights", "adjust", getRendererProps.bind(Lights), r);
-		var s = addNode("Shaders", "code-fork", function() return [], r);
-		addNode("Passes", "gears", getRendererProps.bind(Textures), r);
-
-		var r = scene.renderer;
-		var cl = Type.getClass(r);
-		var ignoreList = getIgnoreList(cl);
-		var fields = Type.getInstanceFields(cl);
-		var meta = haxe.rtti.Meta.getFields(cl);
-		fields.sort(Reflect.compare);
-		var prev : { name : String, group : Array<{ name : String, v : Dynamic }> } = null;
-		for( f in fields ) {
-			if( ignoreList != null && ignoreList.indexOf(f) >= 0 ) continue;
-			var m = Reflect.field(meta, f);
-			if( m != null && Reflect.hasField(m, "ignore") ) continue;
-			var v = Reflect.field(r, f);
-			if( !Api.isOfType(v, hxsl.Shader) && !Api.isOfType(v, h3d.pass.ScreenFx) && !Api.isOfType(v,Group) ) continue;
-
-			if( prev != null && StringTools.startsWith(f, prev.name) ) {
-				prev.group.push({ name : f.substr(prev.name.length), v : v });
-				continue;
-			}
-
-			var subs = { name : f, group : [] };
-			prev = subs;
-			addNode(f, "circle", function() {
-				var props = getDynamicProps(v);
-				for( g in subs.group ) {
-					var gp = getDynamicProps(g.v);
-					if( gp.length == 1 )
-						switch( gp[0] ) {
-						case PGroup(_, props): gp = props;
-						default:
-						}
-					props.push(PGroup(g.name, gp));
-				}
-				return props;
-			}, s);
-		}
-	}
-
-	public function getRendererProps( section : RendererSection ) {
-		var props = [];
-
-		var r = scene.renderer;
-
-		switch( section ) {
-		case Lights:
-
-			var ls = scene.lightSystem;
-			var props = [];
-			var fls = hxd.impl.Api.downcast(ls, h3d.scene.fwd.LightSystem);
-			if( fls != null )
-				props.push(PGroup("LightSystem",[
-					PRange("maxLightsPerObject", 0, 10, function() return fls.maxLightsPerObject, function(s) fls.maxLightsPerObject = Std.int(s), 1),
-					PColor("ambientLight", false, function() return fls.ambientLight, function(v) fls.ambientLight.load(v)),
-					PBool("perPixelLighting", function() return fls.perPixelLighting, function(b) fls.perPixelLighting = b),
-				]));
-
-			if( ls.shadowLight != null )
-				props.push(PGroup("DirLight", getObjectProps(ls.shadowLight)));
-
-			var s = r.getPass(h3d.pass.DefaultShadowMap);
-			if( s != null ) {
-				props.push(PGroup("Shadows",[
-					PRange("size", 64, 2048, function() return s.size, function(sz) s.size = Std.int(sz), 64),
-					PColor("color", false, function() return s.color, function(v) s.color = v),
-					PRange("power", 0, 100, function() return s.power, function(v) s.power = v),
-					PRange("bias", 0, 0.1, function() return s.bias, function(v) s.bias = v),
-					PGroup("blur", getDynamicProps(s.blur)),
-				]));
-			}
-
-			return props;
-
-		case Textures:
-
-			var props = [];
-			/*
-			var tp = getTextures(@:privateAccess r.tcache);
-			if( tp.length > 0 )
-				props.push(PGroup("Textures",tp));*/
-
-			for( p in @:privateAccess r.allPasses )
-				props.push(PGroup("Pass " + p.name, getPassProps(p)));
-			return props;
-
-		case Core:
-
-			var props = [];
-			addDynamicProps(props, r, function(v) return !Api.isOfType(v,hxsl.Shader) && !Api.isOfType(v,h3d.pass.ScreenFx) && !Api.isOfType(v,Group));
-			return props;
-
-		}
-	}
-
-	function getShaderProps( s : hxsl.Shader ) {
-		var props = [];
-		var data = @:privateAccess s.shader;
-		var vars = data.data.vars.copy();
-		vars.sort(function(v1, v2) return Reflect.compare(v1.name, v2.name));
-		for( v in vars ) {
-			switch( v.kind ) {
-			case Param:
-
-				if( v.qualifiers != null && v.qualifiers.indexOf(Ignore) >= 0 ) continue;
-
-				var name = v.name+"__";
-				function set(val:Dynamic) {
-					Reflect.setField(s, name, val);
-					if( hxsl.Ast.Tools.isConst(v) )
-						@:privateAccess s.constModified = true;
-				}
-				switch( v.type ) {
-				case TBool:
-					props.push(PBool(v.name, function() return Reflect.field(s,name), set ));
-				case TInt:
-					var done = false;
-					if( v.qualifiers != null )
-						for( q in v.qualifiers )
-							switch( q ) {
-							case Range(min, max):
-								done = true;
-								props.push(PRange(v.name, min, max, function() return Reflect.field(s, name), set,1));
-								break;
-							default:
-							}
-					if( !done )
-						props.push(PInt(v.name, function() return Reflect.field(s,name), set ));
-				case TFloat:
-					var done = false;
-					if( v.qualifiers != null )
-						for( q in v.qualifiers )
-							switch( q ) {
-							case Range(min, max):
-								done = true;
-								props.push(PRange(v.name, min, max, function() return Reflect.field(s, name), set));
-								break;
-							default:
-							}
-					if( !done )
-						props.push(PFloat(v.name, function() return Reflect.field(s, name), set));
-				case TVec(size = (3 | 4), VFloat) if( v.name.toLowerCase().indexOf("color") >= 0 ):
-					props.push(PColor(v.name, size == 4, function() return Reflect.field(s, name), set));
-				case TSampler2D, TSamplerCube:
-					props.push(PTexture(v.name, function() return Reflect.field(s, name), set));
-				case TVec(size, VFloat):
-					props.push(PFloats(v.name, function() {
-						var v : h3d.Vector = Reflect.field(s, name);
-						var vl = [v.x, v.y];
-						if( size > 2 ) vl.push(v.z);
-						if( size > 3 ) vl.push(v.w);
-						return vl;
-					}, function(vl) {
-						set(new h3d.Vector(vl[0], vl[1], vl[2], vl[3]));
-					}));
-				case TArray(_):
-					props.push(PString(v.name, function() {
-						var a : Array<Dynamic> = Reflect.field(s, name);
-						return a == null ? "NULL" : "(" + a.length + " elements)";
-					}, function(val) {}));
-				default:
-					props.push(PString(v.name, function() return ""+Reflect.field(s,name), function(val) { } ));
-				}
-			default:
-			}
-		}
-
-		var name = data.data.name;
-		if( StringTools.startsWith(name, "h3d.shader.") )
-			name = name.substr(11);
-		name = name.split(".").join(" "); // no dot in prop name !
-
-		return PGroup("shader "+name, props);
-	}
-
-	function getMaterialShaderProps( mat : h3d.mat.Material, pass : h3d.mat.Pass, shader : hxsl.Shader ) {
-		return getShaderProps(shader);
-	}
-
-	function getMaterialPassProps( mat : h3d.mat.Material, pass : h3d.mat.Pass ) {
-		var pl = [
-			PBool("Lights", function() return pass.enableLights, function(v) pass.enableLights = v),
-			PEnum("Cull", h3d.mat.Data.Face, function() return pass.culling, function(v) pass.culling = v),
-			PEnum("BlendSrc", h3d.mat.Data.Blend, function() return pass.blendSrc, function(v) pass.blendSrc = pass.blendAlphaSrc = v),
-			PEnum("BlendDst", h3d.mat.Data.Blend, function() return pass.blendDst, function(v) pass.blendDst = pass.blendAlphaDst = v),
-			PBool("DepthWrite", function() return pass.depthWrite, function(b) pass.depthWrite = b),
-			PEnum("DepthTest", h3d.mat.Data.Compare, function() return pass.depthTest, function(v) pass.depthTest = v)
-		];
-
-		var shaders = [for( s in pass.getShaders() ) s];
-		shaders.reverse();
-		for( index in 0...shaders.length ) {
-			var s = shaders[index];
-			var p = getMaterialShaderProps(mat,pass,s);
-			pl.push(p);
-		}
-		return PGroup("pass " + pass.name, pl);
-	}
-
-	function getMaterialProps( mat : h3d.mat.Material ) {
-		var props = [];
-		props.push(PString("name", function() return mat.name == null ? "" : mat.name, function(n) mat.name = n == "" ? null : n));
-		if( mat.props == null ) {
-			for( pass in mat.getPasses() ) {
-				var p = getMaterialPassProps(mat, pass);
-				props.push(p);
-			}
-		} else {
-			//props = props.concat(mat.props.inspect(function() mat.props.apply(mat)));
-		}
-		return PGroup("Material",props);
-	}
-
-	function getLightProps( l : h3d.scene.Light ) {
-		var props = [];
-		props.push(PColor("color", false, function() return l.color, function(c) l.color.load(c)));
-		props.push(PRange("priority", 0, 10, function() return l.priority, function(p) l.priority = Std.int(p),1));
-		props.push(PBool("enableSpecular", function() return l.enableSpecular, function(b) l.enableSpecular = b));
-		var dl = hxd.impl.Api.downcast(l, h3d.scene.fwd.DirLight);
-		if( dl != null )
-			props.push(PFloats("direction", function() {
-				var dir = dl.getLocalDirection();
-				return [dl.x, dl.y, dl.z];
-			}, function(fl) dl.setDirection(new h3d.Vector(fl[0], fl[1], fl[2]))));
-		var pl = hxd.impl.Api.downcast(l, h3d.scene.fwd.PointLight);
-		if( pl != null )
-			props.push(PFloats("params", function() return [pl.params.x, pl.params.y, pl.params.z], function(fl) pl.params.set(fl[0], fl[1], fl[2], fl[3])));
-		return PGroup("Light", props);
-	}
-
-	public function getObjectProps( o : h3d.scene.Object ) {
-		var props = [];
-		props.push(PString("name", function() return o.name == null ? "" : o.name, function(v) o.name = v == "" ? null : v));
-		props.push(PFloats("pos", function() return [o.x, o.y, o.z], function(v) { o.x = v[0]; o.y = v[1]; o.z = v[2]; }));
-		props.push(PFloats("scale", function() return [o.scaleX, o.scaleY, o.scaleZ], function(v) { o.scaleX = v[0]; o.scaleY = v[1]; o.scaleZ = v[2]; }));
-		props.push(PBool("visible", function() return o.visible, function(v) o.visible = v));
-
-		if( o.isMesh() ) {
-			var multi = hxd.impl.Api.downcast(o, h3d.scene.MultiMaterial);
-			if( multi != null && multi.materials.length > 1 ) {
-				for( m in multi.materials )
-					props.push(getMaterialProps(m));
-			} else
-				props.push(getMaterialProps(o.toMesh().material));
-		} else {
-			var c = hxd.impl.Api.downcast(o, h3d.scene.CustomObject);
-			if( c != null )
-				props.push(getMaterialProps(c.material));
-			var l = hxd.impl.Api.downcast(o, h3d.scene.Light);
-			if( l != null )
-				props.push(getLightProps(l));
-		}
-		return props;
-	}
-
-	function getDynamicProps( v : Dynamic ) : Array<Property> {
-		if( Api.isOfType(v,h3d.pass.ScreenFx) || Api.isOfType(v,Group) ) {
-			var props = [];
-			addDynamicProps(props, v);
-			return props;
-		}
-		var s = hxd.impl.Api.downcast(v, hxsl.Shader);
-		if( s != null )
-			return [getShaderProps(s)];
-		var o = hxd.impl.Api.downcast(v, h3d.scene.Object);
-		if( o != null )
-			return getObjectProps(o);
-		var s = hxd.impl.Api.downcast(v, hxsl.Shader);
-		if( s != null )
-			return [getShaderProps(s)];
-		return null;
-	}
-
-	function getIgnoreList( c : Class<Dynamic> ) {
-		var ignoreList = null;
-		while( c != null ) {
-			var cmeta : Dynamic = haxe.rtti.Meta.getType(c);
-			if( cmeta != null ) {
-				var ignore : Array<String> = cmeta.ignore;
-				if( ignore != null ) {
-					if( ignoreList == null ) ignoreList = [];
-					for( i in ignore )
-						ignoreList.push(i);
-				}
-			}
-			c = Type.getSuperClass(c);
-		}
-		return ignoreList;
-	}
-
-	function addDynamicProps( props : Array<Property>, o : Dynamic, ?filter : Dynamic -> Bool ) {
-		var cl = Type.getClass(o);
-		var ignoreList = getIgnoreList(cl);
-		var meta = haxe.rtti.Meta.getFields(cl);
-		var fields = Type.getInstanceFields(cl);
-		fields.sort(Reflect.compare);
-		for( f in fields ) {
-
-			if( ignoreList != null && ignoreList.indexOf(f) >= 0 ) continue;
-
-			var v = Reflect.field(o, f);
-
-			if( filter != null && !filter(v) ) continue;
-
-			// @inspect metadata
-			var m : Dynamic = Reflect.field(meta, f);
-
-			if( m != null && Reflect.hasField(m, "ignore") )
-				continue;
-
-			if( m != null && Reflect.hasField(m, "inspect") ) {
-				if( Api.isOfType(v, Bool) )
-					props.unshift(PBool(f, function() return Reflect.getProperty(o, f), function(v) Reflect.setProperty(o, f, v)));
-				else if( Api.isOfType(v, Float) ) {
-					var range : Array<Dynamic> = m.range;
-					if( range != null )
-						props.unshift(PRange(f, range[0], range[1], function() return Reflect.getProperty(o, f), function(v) Reflect.setProperty(o, f, v), range[2]));
-					else
-						props.unshift(PFloat(f, function() return Reflect.getProperty(o, f), function(v) Reflect.setProperty(o, f, v)));
-				}
-			} else {
-
-				var pl = getDynamicProps(v);
-				if( pl != null ) {
-					if( pl.length == 1 && pl[0].match(PGroup(_)) )
-						props.push(pl[0]);
-					else
-						props.push(PGroup(f, pl));
-				}
-			}
-		}
-	}
-
-	function getPassProps( p : h3d.pass.Base ) {
-		var props = [];
-		var def = hxd.impl.Api.downcast(p, h3d.pass.Default);
-		if( def == null ) return props;
-
-		addDynamicProps(props, p);
-
-		//for( t in getTextures(@:privateAccess def.tcache) )
-		//	props.push(t);
-
-		return props;
-	}
-
-	function getTextures( t : h3d.impl.TextureCache ) {
-		var cache = @:privateAccess t.cache;
-		var props = [];
-		for( i in 0...cache.length ) {
-			var t = cache[i];
-			props.push(PTexture(t.name, function() return t, null));
-		}
-		return props;
-	}
-
-	public function applyProps( propsValues : Dynamic, ?node : Node, ?onError : String -> Void, lerp = 1. ) {
-		if( propsValues == null )
-			return;
-		if( node == null )
-			node = root;
-		if( lerp < 0 )
-			lerp = 0;
-		else if( lerp > 1 )
-			lerp = 1;
-		else if( Math.isNaN(lerp) )
-			throw "lerp is NaN";
-		var props = null;
-		for( f in Reflect.fields(propsValues) ) {
-			var v : Dynamic = Reflect.field(propsValues, f);
-			var isObj = Reflect.isObject(v) && !Api.isOfType(v, String) && !Api.isOfType(v, Array);
-			if( isObj ) {
-				var n = node.getChildByName(f);
-				if( n != null ) {
-					applyProps(v, n, onError, lerp);
-					continue;
-				}
-			}
-			if( props == null ) {
-				if( node.props == null ) {
-					if( onError != null ) onError(node.getFullPath() + " has no properties");
-					continue;
-				}
-				var pl = node.props();
-				props = new Map();
-				for( p in pl )
-					props.set(PropTools.getPropName(p), p);
-			}
-			var p = props.get(f);
-			if( p == null ) {
-				if( onError != null ) onError(node.getFullPath() + " has no property "+f);
-				continue;
-			}
-			switch( p ) {
-			case PGroup(_, props) if( isObj ):
-				applyPropsGroup(node.getFullPath()+"."+f, v, props, onError, lerp);
-			default:
-				PropTools.setPropValue(p, v, lerp);
-			}
-		}
-	}
-
-	function applyPropsGroup( path : String, propsValues : Dynamic, props : Array<Property>, onError : String -> Void, lerp : Float ) {
-		var pmap = new Map();
-		for( p in props )
-			pmap.set(PropTools.getPropName(p), p);
-		for( f in Reflect.fields(propsValues) ) {
-			var p = pmap.get(f);
-			if( p == null ) {
-				if( onError != null ) onError(path+" has no property "+f);
-				continue;
-			}
-			var v : Dynamic = Reflect.field(propsValues, f);
-			switch( p ) {
-			case PGroup(_, props):
-				applyPropsGroup(path + "." + f, v, props, onError, lerp);
-			default:
-				PropTools.setPropValue(p, v, lerp);
-			}
-		}
-	}
-
-
-}

+ 0 - 186
hxd/inspect/StatsPanel.hx

@@ -1,186 +0,0 @@
-package hxd.inspect;
-
-class StatsPanel extends Panel {
-
-	public function new() {
-		super("stats", "Statistics");
-	}
-
-	override function initContent() {
-		super.initContent();
-		j.html('
-			<table>
-				<tr>
-					<th class="title" colspan="2">Renderer</th>
-				</tr>
-				<tr>
-					<th>Framerate</th>
-					<td id="fps">0</td>
-				</tr>
-				<tr>
-					<th>Draw Calls</th>
-					<td id="calls">0</td>
-				</tr>
-				<tr>
-					<th>Drawn Triangles</th>
-					<td id="tris">0</td>
-				</tr>
-
-				<tr>
-					<th class="title" colspan="2">Memory</th>
-				</tr>
-				<tr>
-					<th>
-						<span>Total</span>
-						<span id="totMemCount"></span>
-					</th>
-					<td id="totMem"></td>
-				</tr>
-				<tr>
-					<th class="button hidden">
-						<i class="fa fa-arrow-right"/>
-						<span id="bufMemTitle">Buffers</span>
-						<span id="bufMemCount"></span>
-					</th>
-					<td id="bufMem"></td>
-				</tr>
-				<tr>
-					<th class="button hidden">
-						<i class="fa fa-arrow-right"/>
-						<span id="texMemTitle">Textures</span>
-						<span id="texMemCount"></span>
-					</th>
-					<td id="texMem"></td>
-				</tr>
-			</table>
-		');
-
-		for( b in j.find("th.button").elements() ) {
-			b.click(function(_) {
-				b.toggleClass("hidden");
-				var i = b.children("i");
-				i.toggleClass("fa-arrow-right");
-				i.toggleClass("fa-arrow-down");
-			});
-		}
-	}
-
-	function showMemoryDetails( button : vdom.JQuery ) {
-		var id = button.find("span").getAttr("id");
-		button.parent().parent().find(".detail_" + id).remove();
-
-		#if !track_alloc
-			if(!button.hasClass("hidden")) {
-				var newElement = j.query("<tr>");
-				newElement.addClass("detail_" + id);
-				newElement.html("<th class='debug' colspan='2'>(Debug mode only)</th>");
-				newElement.insertAfter(button.parent());
-			}
-		#else
-			if(!button.hasClass("hidden")) {
-				var engine = h3d.Engine.getCurrent();
-				var m = new Map();
-				@:privateAccess switch(id) {
-					case "bufMemTitle":
-						for( b in engine.mem.buffers ) {
-							var b = b;
-							while( b != null ) {
-								var buf = b.allocHead;
-								while( buf != null ) {
-									var mem = buf.buffer.stride * buf.vertices * 4;
-									var name = buf.allocPos.position;
-									var p = m.get(name);
-									if( p == null ) {
-										p = { count : 0, mem : 0, name : name };
-										m.set(name, p);
-									}
-									p.count++;
-									p.mem += mem;
-									buf = buf.allocNext;
-								}
-								b = b.next;
-							}
-						}
-					case "texMemTitle":
-						for( t in engine.mem.textures ) {
-							var mem = t.width * t.height * 4;
-							var name = t.allocPos.position;
-							var p = m.get(name);
-							if( p == null ) {
-								p = { count : 0, mem : 0, name : name };
-								m.set(name, p);
-							}
-							p.count++;
-							p.mem += mem;
-						}
-					default: null;
-				}
-
-				var elements = [for( k in m ) k];
-				elements.sort(function(e1, e2) return e1.mem - e2.mem);
-				for( e in elements) {
-					var newElement = j.query("<tr>");
-					newElement.addClass("subMem");
-					newElement.addClass("detail_" + id);
-					newElement.html("<th>" + e.name + "<span>[" + e.count + "]</span></th><td>" + fmtSize(e.mem) + "</td>");
-					newElement.insertAfter(button.parent());
-				}
-			}
-		#end
-	}
-
-	function fmtSize( size : Float ) {
-		size /= 1024;
-		return size > 1024 ? Math.fmt(size / 1024) + " MB" : Math.ceil(size) + " KB";
-	}
-
-	inline function numberFormat(v : Int) {
-		var tmp = Std.string(v);
-		var n = Math.ceil(tmp.length / 3);
-		var str = "";
-		for( i in 0...n) {
-			if(str != "") str = " " + str;
-			var start = tmp.length - 3 * (i + 1);
-			str = Std.string(tmp.substring(Math.imax(0, start), start + 3)) + str;
-		}
-		return Std.string(str);
-	}
-
-	override function sync() {
-		var engine = h3d.Engine.getCurrent();
-		var p = j;
-
-		p.find("#fps").text(Std.string(engine.fps));
-		p.find("#calls").text(numberFormat(engine.drawCalls));
-		p.find("#tris").text(numberFormat(engine.drawTriangles));
-
-		var bufMem = p.find("#bufMem");
-		var texMem = p.find("#texMem");
-		var totMem = p.find("#totMem");
-		var bufMemTitle = p.find("#bufMemTitle");
-		var texMemTitle = p.find("#texMemTitle");
-		var bufMemCount = p.find("#bufMemCount");
-		var texMemCount = p.find("#texMemCount");
-		var totMemCount = p.find("#totMemCount");
-
-		var stats = engine.mem.stats();
-		var idx = (stats.totalMemory - (stats.textureMemory + stats.managedMemory));
-		var sum : Float = idx + stats.managedMemory;
-		var freeMem : Float = stats.freeManagedMemory;
-		var totTex : Float = stats.textureMemory;
-		var totalMem : Float = stats.totalMemory;
-
-		bufMem.text(fmtSize(sum) + " (" + fmtSize(freeMem) + " free)");
-		texMem.text(fmtSize(totTex));
-		totMem.text(fmtSize(totalMem));
-		bufMemTitle.text("Buffers");
-		bufMemCount.text("[" + Std.string(stats.bufferCount) + "]");
-		texMemTitle.text("Textures");
-		texMemCount.text("[" + Std.string(stats.textureCount) + "]");
-		totMemCount.text("[" + Std.string(stats.bufferCount + stats.textureCount) + "]");
-
-		for( b in p.find("th.button").elements() )
-			showMemoryDetails(b);
-	}
-
-}

+ 0 - 82
hxd/inspect/TreeNode.hx

@@ -1,82 +0,0 @@
-package hxd.inspect;
-
-class TreeNode extends Node {
-
-	public var icon(default, set) : String;
-	public var openIcon(default, set) : Null<String>;
-	var jchild : vdom.JQuery;
-
-	override function initContent() {
-		j = getJRoot().query("<li>");
-		j.html('<i/><div class="content"></div>');
-		j.children("i").click(function(_) {
-			if( jchild != null ) {
-				j.toggleClass("expand");
-				if( openIcon != null ) syncIcon();
-				jchild.slideToggle(50);
-			}
-		});
-		j.children(".content").click(function(_) click());
-	}
-
-	public function click() {
-		getJRoot().find(".selected").removeClass("selected");
-		j.addClass("selected");
-		onSelect();
-	}
-
-	override function getJRoot() {
-		return parent == null ? super.getJRoot() : parent.getJRoot();
-	}
-
-	override function removeChild(n:Node) {
-		super.removeChild(n);
-		n.j.detach();
-		if( jchild != null && jchild.get().numChildren == 0 ) {
-			j.toggleClass("expand",false);
-			jchild.remove();
-			jchild = null;
-		}
-	}
-
-	override function addChild(n:Node) {
-		super.addChild(n);
-		if( jchild == null ) {
-			j.toggleClass("expand",true);
-			jchild = j.query("<ul>");
-			jchild.addClass("elt");
-			jchild.appendTo(j);
-			if( openIcon != null ) syncIcon();
-		}
-		n.j.appendTo(jchild);
-	}
-
-	override function getPathName() {
-		return name.split(".").join(" ");
-	}
-
-	public dynamic function onSelect() {
-	}
-
-	override function set_name(v) {
-		j.children(".content").text(v);
-		return name = v;
-	}
-
-	function syncIcon() {
-		j.children("i").attr("class", "fa fa-"+(openIcon == null || !j.hasClass("expand") ? icon : openIcon));
-	}
-
-	function set_icon(v) {
-		icon = v;
-		syncIcon();
-		return v;
-	}
-
-	function set_openIcon(v) {
-		openIcon = v;
-		syncIcon();
-		return v;
-	}
-
-}

+ 0 - 247
hxd/inspect/inspect.css

@@ -1,247 +0,0 @@
-.jqpage div, .jqpage a, .jqpage li, .jqpage td, .jqpage th, .dialog-floating div, .dialog-floating a, .dialog-floating li, .dialog-floating td, .dialog-floating th {
-	user-select : none;
-	-moz-user-select : none;
-	-webkit-user-select : none;
-}
-.jqpage panel, .dialog-floating panel {
-	display : block;
-	overflow : auto;
-}
-.jqpage pre, .dialog-floating pre {
-	user-select : text;
-	-moz-user-select : text;
-	-webkit-user-select : text;
-}
-.jqpage pre .kwd, .dialog-floating pre .kwd {
-	color : #1518FF;
-}
-.jqpage pre .meta, .dialog-floating pre .meta {
-	color : #156018;
-}
-.jqpage .panel, .dialog-floating .panel {
-	overflow : auto;
-	background-color : white;
-}
-.jqpage #log, .dialog-floating #log {
-	font-family : Courier;
-}
-.jqpage #log .line, .dialog-floating #log .line {
-	padding : 1px 3px;
-	user-select : all;
-	-moz-user-select : all;
-	-webkit-user-select : all;
-}
-.jqpage #log .line:nth-child(even), .dialog-floating #log .line:nth-child(even) {
-	background-color : #eee;
-}
-.jqpage ul.toolbar, .dialog-floating ul.toolbar {
-	color : #AAA;
-	background-color : #333;
-	border-top : 1px solid black;
-	border-bottom : 1px solid black;
-}
-.jqpage ul.toolbar li, .dialog-floating ul.toolbar li {
-	padding : 5px;
-	display : inline-block;
-	zoom : 1;
-	*display : inline;
-	border : 1px solid #555;
-}
-.jqpage ul.toolbar li:hover, .dialog-floating ul.toolbar li:hover {
-	color : white;
-	background-color : #555;
-	border-color : white;
-}
-.jqpage ul.toolbar li.active, .dialog-floating ul.toolbar li.active {
-	color : white;
-}
-.jqpage .panel, .dialog-floating .panel {
-	position : relative;
-}
-.jqpage .panel .imageprops, .dialog-floating .panel .imageprops {
-	position : absolute;
-	right : 5px;
-	top : 5px;
-}
-.jqpage .panel .scrollable, .dialog-floating .panel .scrollable {
-	position : relative;
-	height : 100%;
-	overflow : auto;
-}
-.jqpage .panel ul.elt.root, .dialog-floating .panel ul.elt.root {
-	padding : 5px;
-}
-.jqpage .panel ul.elt, .dialog-floating .panel ul.elt {
-	background-color : transparent;
-}
-.jqpage .panel ul.elt li, .dialog-floating .panel ul.elt li {
-	cursor : pointer;
-}
-.jqpage .panel ul.elt li>i, .dialog-floating .panel ul.elt li>i {
-	text-align : center;
-	width : 16px;
-}
-.jqpage .panel ul.elt li>.content, .dialog-floating .panel ul.elt li>.content {
-	margin-left : 2px;
-	display : inline-block;
-	zoom : 1;
-	*display : inline;
-	height : 18px;
-}
-.jqpage .panel ul.elt li .content:hover, .dialog-floating .panel ul.elt li .content:hover {
-	background-color : #eee;
-}
-.jqpage .panel ul.elt ul, .dialog-floating .panel ul.elt ul {
-	padding-left : 20px;
-}
-.jqpage .panel ul.elt li.selected>.content, .dialog-floating .panel ul.elt li.selected>.content {
-	background-color : #eee;
-}
-.jqpage .panel.scene ul.elt li.hidden, .dialog-floating .panel.scene ul.elt li.hidden {
-	opacity : 0.5;
-	filter : alpha(opacity=50);
-	zoom : 1;
-}
-.jqpage .panel.scene ul.elt li.culled>.content, .dialog-floating .panel.scene ul.elt li.culled>.content {
-	opacity : 0.5;
-	filter : alpha(opacity=50);
-	zoom : 1;
-	font-style : italic;
-}
-.jqpage .panel.scene .elt.root.masked li.hidden, .jqpage .panel.scene .elt.root.masked li.culled, .dialog-floating .panel.scene .elt.root.masked li.hidden, .dialog-floating .panel.scene .elt.root.masked li.culled {
-	display : none;
-}
-.jqpage .panel>ul.buttons, .dialog-floating .panel>ul.buttons {
-	color : #AAA;
-	background-color : #333;
-	border-right : 1px solid black;
-	float : left;
-	width : 25px;
-	height : 100%;
-}
-.jqpage .panel>ul.buttons li, .dialog-floating .panel>ul.buttons li {
-	padding : 5px;
-	display : inline-block;
-	zoom : 1;
-	*display : inline;
-	border : 1px solid #555;
-}
-.jqpage .panel>ul.buttons li:hover, .dialog-floating .panel>ul.buttons li:hover {
-	background-color : #555;
-	border-color : white;
-}
-.jqpage .panel>ul.buttons li.active, .dialog-floating .panel>ul.buttons li.active {
-	color : white;
-}
-.jqpage table.iprops tr.pgroup, .dialog-floating table.iprops tr.pgroup {
-	cursor : pointer;
-}
-.jqpage table.iprops tr.pgroup th, .dialog-floating table.iprops tr.pgroup th {
-	text-align : left;
-	background-color : #555;
-	color : #bbb;
-	font-weight : bold;
-	padding : 2px 4px;
-	cursor : pointer;
-}
-.jqpage table.iprops tr.disable, .dialog-floating table.iprops tr.disable {
-	opacity : 0.5;
-	filter : alpha(opacity=50);
-	zoom : 1;
-}
-.jqpage table.iprops td, .dialog-floating table.iprops td {
-	height : 24px;
-}
-.jqpage table.iprops td input, .jqpage table.iprops td select, .dialog-floating table.iprops td input, .dialog-floating table.iprops td select {
-	padding-left : 0px;
-	height : 18px;
-	border : 1px solid #888;
-	width : 100%;
-}
-.jqpage table.iprops tr.pcustom button, .dialog-floating table.iprops tr.pcustom button {
-	margin-left : 5px;
-}
-.jqpage table.iprops tr.pcustom .buttonGroup, .dialog-floating table.iprops tr.pcustom .buttonGroup {
-	text-align : right;
-}
-.jqpage table.iprops tr.prange input.range, .dialog-floating table.iprops tr.prange input.range {
-	width : auto;
-	display : inline-block;
-	zoom : 1;
-	*display : inline;
-	padding-bottom : 1px;
-}
-.jqpage table.iprops tr.prange .range_text, .dialog-floating table.iprops tr.prange .range_text {
-	width : 30px;
-	display : inline-block;
-	zoom : 1;
-	*display : inline;
-}
-.jqpage table.iprops tr.active td, .dialog-floating table.iprops tr.active td {
-	font-weight : bold;
-}
-.jqpage table.iprops tr.ptexture img, .dialog-floating table.iprops tr.ptexture img {
-	max-width : 128px;
-	max-height : 128px;
-}
-.jqpage table.iprops tr.pcolor td .modal, .dialog-floating table.iprops tr.pcolor td .modal {
-	opacity : 0;
-	filter : alpha(opacity=0);
-	zoom : 1;
-}
-.jqpage table.iprops tr.pcolor td .color, .dialog-floating table.iprops tr.pcolor td .color {
-	display : inline-block;
-	zoom : 1;
-	*display : inline;
-	width : 20px;
-	height : 20px;
-	border : 2px solid white;
-	outline : 1px solid black;
-}
-.jqpage #stats table, .dialog-floating #stats table {
-	cursor : default;
-	width : 100%;
-}
-.jqpage #stats table tr th.button, .dialog-floating #stats table tr th.button {
-	cursor : pointer;
-}
-.jqpage #stats table tr th.title, .dialog-floating #stats table tr th.title {
-	font-size : 14px;
-	text-align : left;
-	background-color : #555;
-	color : #bbb;
-	font-weight : bold;
-	padding : 2px 4px;
-	border-bottom : 1px solid #888;
-}
-.jqpage #stats table tr th, .dialog-floating #stats table tr th {
-	text-align : left;
-	background-color : #333;
-	color : #eee;
-	font-weight : bold;
-	padding : 2px 4px;
-	height : 24px;
-}
-.jqpage #stats table tr th i, .dialog-floating #stats table tr th i {
-	color : #eee;
-}
-.jqpage #stats table tr th div, .dialog-floating #stats table tr th div {
-	float : right;
-}
-.jqpage #stats table tr.subMem th, .dialog-floating #stats table tr.subMem th {
-	font-weight : normal;
-	overflow : hidden;
-	background-color : #eee;
-	color : black;
-	border-bottom : 1px solid #ccc;
-}
-.jqpage #stats table tr.subMem th div, .dialog-floating #stats table tr.subMem th div {
-	float : right;
-}
-.jqpage #stats table th.debug, .dialog-floating #stats table th.debug {
-	background-color : white;
-	font-weight : normal;
-	color : #333;
-	font-style : italic;
-	border : none;
-}

+ 0 - 275
hxd/inspect/inspect.hss

@@ -1,275 +0,0 @@
-.jqpage, .dialog-floating {
-
-	div, a, li, td, th {
-		user-select : none;
-	}
-
-	panel {
-		display:block;
-		overflow:auto;
-	}
-
-	pre {
-		user-select : text;
-		.kwd {
-			color : #1518FF;
-		}
-		.meta {
-			color : #156018;
-		}
-	}
-
-	.panel {
-		overflow : auto;
-		background-color : white;
-	}
-
-	#log {
-		font-family : Courier;
-		.line {
-			padding : 1px 3px;
-			user-select : all;
-		}
-		CSS(".line:nth-child(even)") {
-			background-color : #eee;
-		}
-	}
-
-	ul.toolbar {
-		color : #AAA;
-		background-color : #333;
-		border-top : 1px solid black;
-		border-bottom : 1px solid black;
-		li {
-			padding : 5px;
-			display : inline-block;
-			border : 1px solid #555;
-		}
-		li:hover {
-			color : white;
-			background-color : #555;
-			border-color : white;
-		}
-		li.active {
-			color : white;
-		}
-	}
-
-
-	.panel {
-
-		position : relative;
-
-		.imageprops {
-			position : absolute;
-			right : 5px;
-			top : 5px;
-		}
-
-		.scrollable {
-			position : relative;
-			height:100%;
-			overflow : auto;
-		}
-
-		ul.elt.root {
-			padding : 5px;
-		}
-
-		ul.elt {
-			background-color : transparent;
-			li {
-				cursor : pointer;
-			}
-
-			li > i {
-				text-align : center;
-				width : 16px;
-			}
-
-			li > .content {
-				margin-left : 2px;
-				display : inline-block;
-				height : 18px;
-			}
-			li .content:hover {
-				background-color : #eee;
-			}
-			ul {
-				padding-left : 20px;
-			}
-			li.selected > .content {
-				background-color : #eee;
-			}
-		}
-	}
-
-	.panel.scene {
-		ul.elt {
-			li.hidden {
-				opacity : 0.5;
-			}
-			li.culled > .content {
-				opacity : 0.5;
-				font-style : italic;
-			}
-		}
-
-		.elt.root.masked {
-			li.hidden, li.culled {
-				display : none;
-			}
-		}
-	}
-
-	.panel > ul.buttons {
-		color : #AAA;
-		background-color : #333;
-		border-right : 1px solid black;
-		float : left;
-		width : 25px;
-		height : 100%;
-		li {
-			padding : 5px;
-			display : inline-block;
-			border : 1px solid #555;
-		}
-		li:hover {
-			background-color : #555;
-			border-color : white;
-		}
-		li.active {
-			color : white;
-		}
-	}
-
-
-	table.iprops {
-
-		tr.pgroup {
-			cursor : pointer;
-			th {
-				text-align : left;
-				background-color : #555;
-				color : #bbb;
-				font-weight : bold;
-				padding : 2px 4px;
-				cursor : pointer;
-			}
-		}
-
-		tr.disable {
-			opacity : 0.5;
-		}
-
-		td {
-			height : 24px;
-			input, select {
-				padding-left : 0px;
-				height : 18px;
-				border : 1px solid #888;
-				width : 100%;
-			}
-		}
-
-		tr.pcustom {
-			button {
-				margin-left : 5px;
-			}
-			.buttonGroup {
-				text-align : right;
-			}
-		}
-
-		tr.prange {
-			input.range {
-				width : auto;
-				display : inline-block;
-				padding-bottom : 1px;
-			}
-			.range_text {
-				width : 30px;
-				display : inline-block;
-			}
-		}
-
-		tr.active td {
-			font-weight : bold;
-		}
-
-		tr.ptexture img {
-			max-width : 128px;
-			max-height : 128px;
-		}
-
-		tr.pcolor td {
-			.modal {
-				opacity : 0.;
-			}
-			.color {
-				display : inline-block;
-				width : 20px;
-				height : 20px;
-				border : 2px solid white;
-				outline : 1px solid black;
-			}
-		}
-
-	}
-
-	#stats {
-		table {
-			cursor : default;
-			width: 100%;
-
-			tr {
-				th.button {
-					cursor : pointer;
-				}
-				th.title {
-					font-size: 14px;
-					text-align: left;
-					background-color: #555;
-					color: #bbb;
-					font-weight: bold;
-					padding: 2px 4px;
-					border-bottom : 1px solid #888;
-				}
-				th {
-					text-align : left;
-					background-color : #333;
-					color : #eee;
-					font-weight : bold;
-					padding : 2px 4px;
-					height : 24px;
-					i {
-						color : #eee;
-					}
-					div {
-						float: right;
-					}
-				}
-			}
-
-			tr.subMem th {
-				font-weight : normal;
-				overflow : hidden;
-				background-color : #eee;
-				color: black;
-				border-bottom : 1px solid #ccc;
-				div {
-					float: right;
-				}
-			}
-
-			th.debug {
-				background-color : white;
-				font-weight : normal;
-				color : #333;
-				font-style: italic;
-				border: none;
-			}
-		}
-	}
-
-}