diff options
author | Jose Antonio Marquez Russo | 2012-03-09 13:44:58 -0800 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-03-09 13:44:58 -0800 |
commit | af4b43723df785c946abae90d44269e819d55d71 (patch) | |
tree | 761159dc0056354c231d3bfb4f851bfdcea4b462 /js/lib/drawing/world.js | |
parent | 5da69dfd30f353ff753cba9322744e2f33f32a1a (diff) | |
parent | e92a6da7b84c58803489d70efedf74837ddfe4cd (diff) | |
download | ninja-af4b43723df785c946abae90d44269e819d55d71.tar.gz |
Merge pull request #32 from ericmueller/integration
Added asset folder replacement to runtime load.
Diffstat (limited to 'js/lib/drawing/world.js')
-rwxr-xr-x | js/lib/drawing/world.js | 23 |
1 files changed, 1 insertions, 22 deletions
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 | ||
730 | World.prototype.export = function( imagePath ) | 730 | World.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 | ||
940 | World.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 | |||
954 | if (typeof exports === "object") { | 933 | if (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 |