aboutsummaryrefslogtreecommitdiff
path: root/js/lib/drawing
diff options
context:
space:
mode:
authorhwc4872012-04-23 17:04:48 -0700
committerhwc4872012-04-23 17:04:48 -0700
commit27c1ba250a7db26cf24dd456d20af9ff1649e638 (patch)
treeee178314a5e5ff13128ebfd8b3f0add4dd2ae8e3 /js/lib/drawing
parent0f2b7cf2e1aae16e3cf4e699ab7e3ca83deb1529 (diff)
downloadninja-27c1ba250a7db26cf24dd456d20af9ff1649e638.tar.gz
canvas interaction
Diffstat (limited to 'js/lib/drawing')
-rwxr-xr-xjs/lib/drawing/world.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 945c9883..8ad4c6f5 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 );
@@ -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