aboutsummaryrefslogtreecommitdiff
path: root/js/lib/drawing
diff options
context:
space:
mode:
authorAnanya Sen2012-05-01 13:39:30 -0700
committerAnanya Sen2012-05-01 13:39:30 -0700
commitc360d1a5cfe894591ae65f892ead11d0ca537b18 (patch)
tree13964f810d3516dbc02e27ab5bb576fe62366f26 /js/lib/drawing
parent3137d919e6b4ccbb2fb68c5920f4376acde3f1f5 (diff)
parente3fa4c7db57b63c5ac604c9420062de5d0fe413a (diff)
downloadninja-c360d1a5cfe894591ae65f892ead11d0ca537b18.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into Codeview-improvements
Diffstat (limited to 'js/lib/drawing')
-rwxr-xr-xjs/lib/drawing/world.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 1a391338..7ce23921 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -362,9 +362,9 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
362 362
363 // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state 363 // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state
364 // in the case of a procedurally built scene an init state is not needed for loading data 364 // in the case of a procedurally built scene an init state is not needed for loading data
365 this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" );
365 if (this._useWebGL) { 366 if (this._useWebGL) {
366 rdgeStarted = true; 367 rdgeStarted = true;
367 this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" );
368 RDGE.globals.engine.unregisterCanvas( this._canvas ); 368 RDGE.globals.engine.unregisterCanvas( this._canvas );
369 RDGE.globals.engine.registerCanvas(this._canvas, this); 369 RDGE.globals.engine.registerCanvas(this._canvas, this);
370 RDGE.RDGEStart( this._canvas ); 370 RDGE.RDGEStart( this._canvas );
@@ -758,7 +758,7 @@ World.prototype.exportJSON = function () {
758 // would not be destructive of the data. You would be wrong... 758 // would not be destructive of the data. You would be wrong...
759 // We need to rebuild everything 759 // We need to rebuild everything
760 if (this._useWebGL) { 760 if (this._useWebGL) {
761 if (worldObj.children && (worldObj.children.length === 1)) { 761 if (worldObj.children && (worldObj.children.length >= 1)) {
762 this.rebuildTree(this._geomRoot); 762 this.rebuildTree(this._geomRoot);
763 this.restartRenderLoop(); 763 this.restartRenderLoop();
764 } 764 }
@@ -835,8 +835,11 @@ World.prototype.importJSON = function (jObj) {
835 835
836 // import the objects 836 // import the objects
837 // there should be exactly one child of the parent object 837 // there should be exactly one child of the parent object
838 if (jObj.children && (jObj.children.length === 1)) 838 if (jObj.children)
839 this.importObjectsJSON( jObj.children[0] ); 839 {
840 for (var i=0; i<jObj.children.length; i++)
841 this.importObjectsJSON( jObj.children[i] );
842 }
840 else 843 else
841 throw new Error ("unrecoverable canvas import error - inconsistent root object: " + jObj.children ); 844 throw new Error ("unrecoverable canvas import error - inconsistent root object: " + jObj.children );
842 845