提交 2a0c1c07 编写于 作者: A Anton Bergman

Moved error throwing to constructor, added suggested changes from pr

上级 a7a87674
......@@ -243,8 +243,14 @@ THREE.GLTFLoader = ( function () {
*/
function GLTFTextureDDSExtension() {
if (!THREE.DDSLoader) {
throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' );
}
this.name = EXTENSIONS.MSFT_TEXTURE_DDS;
this.ddsLoader = new THREE.DDSLoader();
this.ddsLoader = new THREE.DDSLoader();
}
......@@ -1817,12 +1823,6 @@ THREE.GLTFLoader = ( function () {
if ( textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] ) {
if (!THREE.DDSLoader) {
throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' );
}
source = json.images[ textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].source ];
} else {
......@@ -1853,15 +1853,13 @@ THREE.GLTFLoader = ( function () {
// Load Texture resource.
var loader;
if ( textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] ) {
var loader = THREE.Loader.Handlers.get( sourceURI );
loader = THREE.Loader.Handlers.get( sourceURI ) || parser.extensions[EXTENSIONS.MSFT_TEXTURE_DDS].ddsLoader
} else {
if ( ! loader ) {
loader = THREE.Loader.Handlers.get( sourceURI ) || textureLoader;
loader = textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ]
? parser.extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].ddsLoader
: textureLoader;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册