diff options
author | Jose Antonio Marquez | 2012-03-27 14:27:26 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-27 14:27:26 -0700 |
commit | 57696598cd39d4aa31b5106cba29dd2b6d02c6d9 (patch) | |
tree | 215b54eee4d6f982809087c59cf8f1d37b2f4350 /js/lib/drawing | |
parent | 7bf738bc08f6a24edce30dbc2b101a8cab2d27aa (diff) | |
parent | 675fffb08f570783f055471501f94fc273de2b9e (diff) | |
download | ninja-57696598cd39d4aa31b5106cba29dd2b6d02c6d9.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into FileIO
Diffstat (limited to 'js/lib/drawing')
-rwxr-xr-x | js/lib/drawing/world.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 781695b6..fec6a478 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js | |||
@@ -761,13 +761,10 @@ World.prototype.exportJSON = function() | |||
761 | // We need to rebuild everything | 761 | // We need to rebuild everything |
762 | if (this._useWebGL) | 762 | if (this._useWebGL) |
763 | { | 763 | { |
764 | var root = this._rootNode; | ||
765 | root.children = new Array(); | ||
766 | if (worldObj.children && (worldObj.children.length === 1)) | 764 | if (worldObj.children && (worldObj.children.length === 1)) |
767 | { | 765 | { |
768 | this.init(); | 766 | this.rebuildTree(this._geomRoot); |
769 | this._geomRoot = undefined; | 767 | this.restartRenderLoop(); |
770 | this.importObjectsJSON( worldObj.children[0] ); | ||
771 | } | 768 | } |
772 | } | 769 | } |
773 | 770 | ||
@@ -783,6 +780,20 @@ World.prototype.exportJSON = function() | |||
783 | return jStr; | 780 | return jStr; |
784 | } | 781 | } |
785 | 782 | ||
783 | World.prototype.rebuildTree = function( obj ) | ||
784 | { | ||
785 | if (!obj) return; | ||
786 | |||
787 | obj.buildBuffers(); | ||
788 | |||
789 | if (obj.getChild()) { | ||
790 | this.rebuildTree( obj.getChild () ); | ||
791 | } | ||
792 | |||
793 | if (obj.getNext()) | ||
794 | this.rebuildTree( obj.getNext() ); | ||
795 | } | ||
796 | |||
786 | World.prototype.exportObjectsJSON = function( obj, parentObj ) | 797 | World.prototype.exportObjectsJSON = function( obj, parentObj ) |
787 | { | 798 | { |
788 | if (!obj) return; | 799 | if (!obj) return; |