Browse Source

Merge pull request #3610 from sebavan/master

Fix extension detection with query string
David Catuhe 7 năm trước cách đây
mục cha
commit
c5de581dad
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 1 0
      dist/preview release/what's new.md
  2. 2 2
      src/Engine/babylon.engine.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -32,6 +32,7 @@
    ([carloslanderas](https://github.com/carloslanderas))
 
 ## Bug fixes
+- Texture extension detection in `Engine.CreateTexture` ([sebavan](https://github.com/sebavan))
 
 ## Breaking changes
 

+ 2 - 2
src/Engine/babylon.engine.ts

@@ -3136,8 +3136,8 @@
             // establish the file extension, if possible
             var lastDot = url.lastIndexOf('.');
             var extension = (lastDot > 0) ? url.substring(lastDot).toLowerCase() : "";
-            var isDDS = this.getCaps().s3tc && (extension === ".dds");
-            var isTGA = (extension === ".tga");
+            var isDDS = this.getCaps().s3tc && (extension.indexOf(".dds") === 0);
+            var isTGA = (extension.indexOf(".tga") === 0);
 
             // determine if a ktx file should be substituted
             var isKTX = false;