Browse Source

Add error if DDSLoader is not present, remove unnecessary newrow

Anton Bergman 7 years ago
parent
commit
7bdba7190c
1 changed files with 7 additions and 0 deletions
  1. 7 0
      examples/js/loaders/GLTFLoader.js

+ 7 - 0
examples/js/loaders/GLTFLoader.js

@@ -1786,6 +1786,7 @@ THREE.GLTFLoader = ( function () {
 	 * @return {Promise<THREE.Texture>}
 	 */
 	GLTFParser.prototype.loadTexture = function ( textureIndex ) {
+
 		var parser = this;
 		var json = this.json;
 		var options = this.options;
@@ -1800,6 +1801,12 @@ THREE.GLTFLoader = ( function () {
 		var source;
 		if ( textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] ) {
 
+			if (!THREE.DDSLoader) {
+
+				throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' );
+
+			}
+
 			var DDSLoader = new THREE.DDSLoader;
 			source = json.images[ textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].source ];