Kaynağa Gözat

Merge pull request #3022 from bghgary/bug-fixes

Miscellanous bug fixes
David Catuhe 7 yıl önce
ebeveyn
işleme
e98260d474

+ 1 - 1
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -1162,7 +1162,7 @@ module BABYLON.GLTF2 {
 
         public _whenAction(action: () => void, onComplete: () => void): void {
             const tracker = new GLTFLoaderTracker(() => {
-                this._loaderTrackers.splice(this._loaderTrackers.indexOf(tracker));
+                this._loaderTrackers.splice(this._loaderTrackers.indexOf(tracker), 1);
                 onComplete();
             });
 

+ 1 - 1
src/Bones/babylon.bone.ts

@@ -74,7 +74,7 @@ module BABYLON {
             if (this._parent) {
                 var index = this._parent.children.indexOf(this);
                 if (index !== -1) {
-                    this._parent.children.splice(index);
+                    this._parent.children.splice(index, 1);
                 }
             }
 

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

@@ -4251,6 +4251,15 @@
                 return;
             }
 
+            if (!texture._webGLTexture) {
+                this.resetTextureCache();
+                if (scene) {
+                    scene._removePendingData(texture);
+                }
+
+                return;
+            }
+
             this._bindTextureDirectly(gl.TEXTURE_2D, texture);
             gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
 

+ 4 - 0
src/babylon.scene.ts

@@ -1728,6 +1728,10 @@
 
         // Ready
         public isReady(): boolean {
+            if (this._isDisposed) {
+                return false;
+            }
+
             if (this._pendingData.length > 0) {
                 return false;
             }