Bläddra i källkod

Fix extension detection with querystring

Sebastien Vandenberghe 7 år sedan
förälder
incheckning
34c81737a0
2 ändrade filer med 3 tillägg och 2 borttagningar
  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

@@ -28,6 +28,7 @@
 - Introduced `isStroke` on `HighlightLayerOptions` which makes the highlight solid ([PixelsCommander](https://github.com/pixelscommander))
 
 ## 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;