Browse Source

Fix ktx loader

David `Deltakosh` Catuhe 5 năm trước cách đây
mục cha
commit
177f89f64d
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 8 1
      src/Engines/thinEngine.ts

+ 8 - 1
src/Engines/thinEngine.ts

@@ -2809,9 +2809,16 @@ export class ThinEngine {
 
         // establish the file extension, if possible
         const lastDot = url.lastIndexOf('.');
-        const extension = forcedExtension ? forcedExtension : (lastDot > -1 ? url.substring(lastDot).toLowerCase() : "");
+        let extension = forcedExtension ? forcedExtension : (lastDot > -1 ? url.substring(lastDot).toLowerCase() : "");        
         let loader: Nullable<IInternalTextureLoader> = null;
 
+        // Remove query string
+        let queryStringIndex = extension.indexOf("?");
+
+        if (queryStringIndex > -1) {
+            extension = extension.split("?")[0];
+        }
+
         for (const availableLoader of ThinEngine._TextureLoaders) {
             if (availableLoader.canLoad(extension, mimeType)) {
                 loader = availableLoader;