Explorar o código

Fixed lastDot issue in createCubeTexture

David Catuhe %!s(int64=7) %!d(string=hai) anos
pai
achega
8e9b1a5157

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5535 - 5535
dist/preview release/babylon.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/preview release/babylon.js


+ 8 - 10
dist/preview release/babylon.max.js

@@ -10669,16 +10669,14 @@ var BABYLON;
             var isKTX = false;
             var isDDS = false;
             var lastDot = rootUrl.lastIndexOf('.');
-            if (lastDot > -1) {
-                var extension = forcedExtension ? forcedExtension : rootUrl.substring(lastDot).toLowerCase();
-                if (this._textureFormatInUse) {
-                    extension = this._textureFormatInUse;
-                    rootUrl = rootUrl.substring(0, lastDot) + this._textureFormatInUse;
-                    isKTX = true;
-                }
-                else {
-                    isDDS = (extension === ".dds");
-                }
+            var extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
+            if (this._textureFormatInUse) {
+                extension = this._textureFormatInUse;
+                rootUrl = (lastDot > -1 ? rootUrl.substring(0, lastDot) : rootUrl) + this._textureFormatInUse;
+                isKTX = true;
+            }
+            else {
+                isDDS = (extension === ".dds");
             }
             var onerror = function (request, exception) {
                 if (onError) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5535 - 5535
dist/preview release/babylon.module.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/preview release/babylon.worker.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1269 - 1269
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 8 - 10
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -10669,16 +10669,14 @@ var BABYLON;
             var isKTX = false;
             var isDDS = false;
             var lastDot = rootUrl.lastIndexOf('.');
-            if (lastDot > -1) {
-                var extension = forcedExtension ? forcedExtension : rootUrl.substring(lastDot).toLowerCase();
-                if (this._textureFormatInUse) {
-                    extension = this._textureFormatInUse;
-                    rootUrl = rootUrl.substring(0, lastDot) + this._textureFormatInUse;
-                    isKTX = true;
-                }
-                else {
-                    isDDS = (extension === ".dds");
-                }
+            var extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
+            if (this._textureFormatInUse) {
+                extension = this._textureFormatInUse;
+                rootUrl = (lastDot > -1 ? rootUrl.substring(0, lastDot) : rootUrl) + this._textureFormatInUse;
+                isKTX = true;
+            }
+            else {
+                isDDS = (extension === ".dds");
             }
             var onerror = function (request, exception) {
                 if (onError) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1269 - 1269
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 7 - 9
src/Engine/babylon.engine.ts

@@ -3690,15 +3690,13 @@
             var isKTX = false;
             var isDDS = false;
             var lastDot = rootUrl.lastIndexOf('.');
-            if (lastDot > -1) {
-                var extension = forcedExtension ? forcedExtension : rootUrl.substring(lastDot).toLowerCase();
-                if (this._textureFormatInUse) {
-                    extension = this._textureFormatInUse;
-                    rootUrl = rootUrl.substring(0, lastDot) + this._textureFormatInUse;
-                    isKTX = true;
-                } else {
-                    isDDS = (extension === ".dds");
-                }
+            var extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
+            if (this._textureFormatInUse) {
+                extension = this._textureFormatInUse;
+                rootUrl = (lastDot > -1 ? rootUrl.substring(0, lastDot) : rootUrl) + this._textureFormatInUse;
+                isKTX = true;
+            } else {
+                isDDS = (extension === ".dds");
             }
 
             let onerror = (request: XMLHttpRequest, exception: any) => {