aboutsummaryrefslogtreecommitdiff
path: root/js/lib/drawing
diff options
context:
space:
mode:
authorhwc4872012-05-01 11:03:56 -0700
committerhwc4872012-05-01 11:03:56 -0700
commitf6983a69649b1c274ce6fe2d278a325994d092b6 (patch)
treea360297930c35f3097af16e9f6714ec501bd5894 /js/lib/drawing
parent80715f4f0c45d29926184fa02e0a01b4e7642a79 (diff)
parentfb47c04b0a4d65f53d975311754aa0dd8a8a3f69 (diff)
downloadninja-f6983a69649b1c274ce6fe2d278a325994d092b6.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
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 50fa735a..9a7d42de 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -414,9 +414,9 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
414 414
415 // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state 415 // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state
416 // in the case of a procedurally built scene an init state is not needed for loading data 416 // in the case of a procedurally built scene an init state is not needed for loading data
417 this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" );
417 if (this._useWebGL) { 418 if (this._useWebGL) {
418 rdgeStarted = true; 419 rdgeStarted = true;
419 this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" );
420 RDGE.globals.engine.unregisterCanvas( this._canvas ); 420 RDGE.globals.engine.unregisterCanvas( this._canvas );
421 RDGE.globals.engine.registerCanvas(this._canvas, this); 421 RDGE.globals.engine.registerCanvas(this._canvas, this);
422 RDGE.RDGEStart( this._canvas ); 422 RDGE.RDGEStart( this._canvas );
@@ -864,7 +864,7 @@ World.prototype.exportJSON = function ()
864 // would not be destructive of the data. You would be wrong... 864 // would not be destructive of the data. You would be wrong...
865 // We need to rebuild everything 865 // We need to rebuild everything
866 if (this._useWebGL) { 866 if (this._useWebGL) {
867 if (worldObj.children && (worldObj.children.length === 1)) { 867 if (worldObj.children && (worldObj.children.length >= 1)) {
868 this.rebuildTree(this._geomRoot); 868 this.rebuildTree(this._geomRoot);
869 this.restartRenderLoop(); 869 this.restartRenderLoop();
870 } 870 }
@@ -950,8 +950,11 @@ World.prototype.importJSON = function (jObj)
950 950
951 // import the objects 951 // import the objects
952 // there should be exactly one child of the parent object 952 // there should be exactly one child of the parent object
953 if (jObj.children && (jObj.children.length === 1)) 953 if (jObj.children)
954 this.importObjectsJSON( jObj.children[0] ); 954 {
955 for (var i=0; i<jObj.children.length; i++)
956 this.importObjectsJSON( jObj.children[i] );
957 }
955 else 958 else
956 throw new Error ("unrecoverable canvas import error - inconsistent root object: " + jObj.children ); 959 throw new Error ("unrecoverable canvas import error - inconsistent root object: " + jObj.children );
957 960