Explorar o código

Fix ktx loader

David `Deltakosh` Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
177f89f64d
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  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;