aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/GLWorld.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE/GLWorld.js')
-rwxr-xr-xjs/helper-classes/RDGE/GLWorld.js31
1 files changed, 14 insertions, 17 deletions
diff --git a/js/helper-classes/RDGE/GLWorld.js b/js/helper-classes/RDGE/GLWorld.js
index ce5f0516..c8bc4c1c 100755
--- a/js/helper-classes/RDGE/GLWorld.js
+++ b/js/helper-classes/RDGE/GLWorld.js
@@ -905,27 +905,24 @@ GLWorld.prototype.import = function( importStr )
905 905
906 // determine if the data was written for export (no Ninja objects) 906 // determine if the data was written for export (no Ninja objects)
907 // or for save/restore 907 // or for save/restore
908 var index = importStr.indexOf( "scenedata: " ); 908 //var index = importStr.indexOf( "scenedata: " );
909 if (index >= 0) 909 var index = importStr.indexOf( "webGL: " );
910 this._useWebGL = (index >= 0)
911 if (this._useWebGL)
910 { 912 {
911 var rdgeStr = importStr.substr( index+11 ); 913 // start RDGE
912 var endIndex = rdgeStr.indexOf( "endscene\n" ); 914 rdgeStarted = true;
913 if (endIndex < 0) throw new Error( "ill-formed WebGL data" ); 915 var id = this._canvas.getAttribute( "data-RDGE-id" );
914 var len = endIndex - index + 11; 916 this._canvas.rdgeid = id;
915 rdgeStr = rdgeStr.substr( 0, endIndex ); 917 g_Engine.registerCanvas(this._canvas, this);
916 918 RDGEStart( this._canvas );
917 this.myScene.importJSON( rdgeStr ); 919 this._canvas.task.stop()
918
919 this.importObjects( importStr, this._rootNode );
920 } 920 }
921 else
922 {
923 // load the material library
924 //importStr = MaterialsLibrary.import( importStr );
925 921
926 // import the objects 922 this.importObjects( importStr, this._rootNode );
927 this.importObjects( importStr, this._rootNode );
928 923
924 if (!this._useWebGL)
925 {
929 // render using canvas 2D 926 // render using canvas 2D
930 this.render(); 927 this.render();
931 } 928 }