aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorhwc4872012-03-09 13:34:09 -0800
committerhwc4872012-03-09 13:34:09 -0800
commite92a6da7b84c58803489d70efedf74837ddfe4cd (patch)
tree66c51b48669f29bd514df90b076b5e62f7cb925e /js
parentf83a04cda688cc9680749fffae6c0b9fa0c2087f (diff)
downloadninja-e92a6da7b84c58803489d70efedf74837ddfe4cd.tar.gz
Removed asset path replacement at authortime.
Diffstat (limited to 'js')
-rwxr-xr-xjs/document/html-document.js6
-rwxr-xr-xjs/lib/drawing/world.js23
-rwxr-xr-xjs/lib/rdge/materials/bump-metal-material.js6
-rw-r--r--js/lib/rdge/materials/pulse-material.js2
-rw-r--r--js/lib/rdge/materials/radial-blur-material.js2
-rwxr-xr-xjs/lib/rdge/materials/uber-material.js8
6 files changed, 13 insertions, 34 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index aa56fd0e..f57c61ee 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -197,7 +197,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
197 //if (path) { 197 //if (path) {
198 //this.collectGLData(elt, this._glData, path); 198 //this.collectGLData(elt, this._glData, path);
199 //} else { 199 //} else {
200 this.collectGLData(elt, this._glData, "assets/"); 200 this.collectGLData(elt, this._glData );
201 //} 201 //}
202 } else { 202 } else {
203 this._glData = null 203 this._glData = null
@@ -368,11 +368,11 @@ exports.HTMLDocument = Montage.create(TextDocument, {
368 368
369 369
370 collectGLData: { 370 collectGLData: {
371 value: function( elt, dataArray, imagePath ) 371 value: function( elt, dataArray )
372 { 372 {
373 if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) 373 if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld)
374 { 374 {
375 var data = elt.elementModel.shapeModel.GLWorld.export( imagePath ); 375 var data = elt.elementModel.shapeModel.GLWorld.export();
376 dataArray.push( data ); 376 dataArray.push( data );
377 } 377 }
378 378
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index cffd0083..44c9e37d 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -727,7 +727,7 @@ World.prototype.getShapeFromPoint = function( offsetX, offsetY ) {
727 } 727 }
728}; 728};
729 729
730World.prototype.export = function( imagePath ) 730World.prototype.export = function()
731{ 731{
732 var exportStr = "GLWorld 1.0\n"; 732 var exportStr = "GLWorld 1.0\n";
733 var id = this.getCanvas().getAttribute( "data-RDGE-id" ); 733 var id = this.getCanvas().getAttribute( "data-RDGE-id" );
@@ -747,13 +747,6 @@ World.prototype.export = function( imagePath )
747 var exportForPublish = true; 747 var exportForPublish = true;
748 exportStr += "publish: " + exportForPublish + "\n"; 748 exportStr += "publish: " + exportForPublish + "\n";
749 749
750 // the relative path for local assets needs to be modified to
751 // the path specified by argument 'imagePath'. Save that path
752 // so exporting functions can call newPath = world.cleansePath( oldPath );
753 this._imagePath = imagePath.slice();
754 var endchar = this._imagePath[this._imagePath.length-1]
755 if (endchar != '/') this._imagePath += '/';
756
757 if (exportForPublish && this._useWebGL) 750 if (exportForPublish && this._useWebGL)
758 { 751 {
759 exportStr += "scenedata: " + this.myScene.exportJSON() + "endscene\n"; 752 exportStr += "scenedata: " + this.myScene.exportJSON() + "endscene\n";
@@ -937,20 +930,6 @@ World.prototype.importSubObject = function( objStr, parentNode ) {
937 return trNode; 930 return trNode;
938}; 931};
939 932
940World.prototype.cleansePath = function( url )
941{
942 //this._imagePath
943 var searchStr = "assets/";
944 var index = url.indexOf( searchStr );
945 var rtnPath = url;
946 if (index >= 0)
947 {
948 rtnPath = url.substr( index + searchStr.length );
949 rtnPath = this._imagePath + rtnPath;
950 }
951 return rtnPath;
952}
953
954if (typeof exports === "object") { 933if (typeof exports === "object") {
955 exports.World = World; 934 exports.World = World;
956} \ No newline at end of file 935} \ No newline at end of file
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js
index 70873885..fa6f5300 100755
--- a/js/lib/rdge/materials/bump-metal-material.js
+++ b/js/lib/rdge/materials/bump-metal-material.js
@@ -163,9 +163,9 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
163 throw new Error( "no world in material.export, " + this.getName() ); 163 throw new Error( "no world in material.export, " + this.getName() );
164 164
165 exportStr += "lightDiff: " + this.getLightDiff() + "\n"; 165 exportStr += "lightDiff: " + this.getLightDiff() + "\n";
166 exportStr += "diffuseTexture: " + world.cleansePath(this.getDiffuseTexture()) + "\n"; 166 exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n";
167 exportStr += "specularTexture: " + world.cleansePath(this.getSpecularTexture()) + "\n"; 167 exportStr += "specularTexture: " + this.getSpecularTexture() + "\n";
168 exportStr += "normalMap: " + world.cleansePath(this.getNormalTexture()) + "\n"; 168 exportStr += "normalMap: " + this.getNormalTexture() + "\n";
169 169
170 // every material needs to terminate like this 170 // every material needs to terminate like this
171 exportStr += "endMaterial\n"; 171 exportStr += "endMaterial\n";
diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js
index 8ad78bd4..81db36c6 100644
--- a/js/lib/rdge/materials/pulse-material.js
+++ b/js/lib/rdge/materials/pulse-material.js
@@ -183,7 +183,7 @@ var PulseMaterial = function PulseMaterial() {
183 if (!world) 183 if (!world)
184 throw new Error( "no world in material.export, " + this.getName() ); 184 throw new Error( "no world in material.export, " + this.getName() );
185 185
186 var texMapName = world.cleansePath( this._propValues[this._propNames[0]] ); 186 var texMapName = this._propValues[this._propNames[0]];
187 exportStr += "texture: " +texMapName + "\n"; 187 exportStr += "texture: " +texMapName + "\n";
188 188
189 // every material needs to terminate like this 189 // every material needs to terminate like this
diff --git a/js/lib/rdge/materials/radial-blur-material.js b/js/lib/rdge/materials/radial-blur-material.js
index f23f0712..46cdda74 100644
--- a/js/lib/rdge/materials/radial-blur-material.js
+++ b/js/lib/rdge/materials/radial-blur-material.js
@@ -166,7 +166,7 @@ var RadialBlurMaterial = function RadialBlurMaterial() {
166 if (!world) 166 if (!world)
167 throw new Error( "no world in material.export, " + this.getName() ); 167 throw new Error( "no world in material.export, " + this.getName() );
168 168
169 var texMapName = world.cleansePath( this._propValues[this._propNames[0]] ); 169 var texMapName = this._propValues[this._propNames[0]];
170 exportStr += "texture: " + texMapName + "\n"; 170 exportStr += "texture: " + texMapName + "\n";
171 171
172 // every material needs to terminate like this 172 // every material needs to terminate like this
diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js
index d120ffa1..655d8e2a 100755
--- a/js/lib/rdge/materials/uber-material.js
+++ b/js/lib/rdge/materials/uber-material.js
@@ -457,16 +457,16 @@ var UberMaterial = function UberMaterial() {
457 throw new Error( "no world in material.export, " + this.getName() ); 457 throw new Error( "no world in material.export, " + this.getName() );
458 458
459 if(typeof caps.diffuseMap != 'undefined') 459 if(typeof caps.diffuseMap != 'undefined')
460 exportStr += "diffuseMap: " + world.cleansePath(caps.diffuseMap.texture) + "\n"; 460 exportStr += "diffuseMap: " + caps.diffuseMap.texture + "\n";
461 461
462 if(typeof caps.normalMap != 'undefined') 462 if(typeof caps.normalMap != 'undefined')
463 exportStr += "normalMap: " + world.cleansePath(caps.normalMap.texture) + "\n"; 463 exportStr += "normalMap: " + caps.normalMap.texture + "\n";
464 464
465 if(typeof caps.specularMap != 'undefined') 465 if(typeof caps.specularMap != 'undefined')
466 exportStr += "specularMap: " + world.cleansePath(caps.specularMap.texture) + "\n"; 466 exportStr += "specularMap: " + caps.specularMap.texture + "\n";
467 467
468 if(typeof caps.environmentMap != 'undefined') 468 if(typeof caps.environmentMap != 'undefined')
469 exportStr += "environmentMap: " + world.cleansePath(caps.environmentMap.texture) + "\n"; 469 exportStr += "environmentMap: " + caps.environmentMap.texture + "\n";
470 470
471 // every material needs to terminate like this 471 // every material needs to terminate like this
472 exportStr += "endMaterial\n"; 472 exportStr += "endMaterial\n";