Browse Source

Update Loader.js texture double slash fix

previous was :
var fullPath = texturePath + "/" + sourceFile;
but texturePath may already have a slash (see extractUrlBase function)

changed slash to texturePath.slice(-1) === '/' : '' : '/'
Baccanno 11 years ago
parent
commit
06522053e2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/loaders/Loader.js

+ 2 - 1
src/loaders/Loader.js

@@ -146,7 +146,8 @@ THREE.Loader.prototype = {
 		function create_texture( where, name, sourceFile, repeat, offset, wrap, anisotropy ) {
 
 			var isCompressed = /\.dds$/i.test( sourceFile );
-			var fullPath = texturePath + "/" + sourceFile;
+			
+			var fullPath = texturePath + texturePath.slice(-1) === '/' : '' : '/' + sourceFile;
 
 			if ( isCompressed ) {