Browse Source

Fix TGA load + Nightly

David Catuhe 7 years ago
parent
commit
e64e5d29f5

File diff suppressed because it is too large
+ 8958 - 8958
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 8965 - 8965
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 16 - 16
dist/preview release/babylon.js


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

@@ -15384,7 +15384,6 @@ var BABYLON;
             var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
             this._bindTextureDirectly(bindTarget, texture, true);
             this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
-            this._bindTextureDirectly(bindTarget, null, true);
         };
         /** @hidden */
         Engine.prototype._uploadImageToTexture = function (texture, image, faceIndex, lod) {
@@ -51077,7 +51076,7 @@ var BABYLON;
          * @param loop defines if the current animation must loop
          * @param speedRatio defines the current speed ratio
          * @param weight defines the weight of the animation (default is -1 so no weight)
-         * @returns a boolean indicating if the animation has ended
+         * @returns a boolean indicating if the animation is running
          */
         RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, weight) {
             if (weight === void 0) { weight = -1.0; }
@@ -51086,18 +51085,18 @@ var BABYLON;
                 this._stopped = true;
                 return false;
             }
-            var keys = this._animation.getKeys();
-            // Return immediately if there is only one key frame.
-            if (keys.length === 1) {
-                this.setValue(keys[0].value, weight);
-                return !loop;
-            }
             var returnValue = true;
+            var keys = this._animation.getKeys();
             // Adding a start key at frame 0 if missing
             if (keys[0].frame !== 0) {
                 var newKey = { frame: 0, value: keys[0].value };
                 keys.splice(0, 0, newKey);
             }
+            // Adding a duplicate key when there is only one key at frame zero
+            else if (keys.length === 1) {
+                var newKey = { frame: 0.001, value: keys[0].value };
+                keys.push(newKey);
+            }
             // Check limits
             if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
                 from = keys[0].frame;

+ 7 - 8
dist/preview release/babylon.no-module.max.js

@@ -15351,7 +15351,6 @@ var BABYLON;
             var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
             this._bindTextureDirectly(bindTarget, texture, true);
             this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
-            this._bindTextureDirectly(bindTarget, null, true);
         };
         /** @hidden */
         Engine.prototype._uploadImageToTexture = function (texture, image, faceIndex, lod) {
@@ -51044,7 +51043,7 @@ var BABYLON;
          * @param loop defines if the current animation must loop
          * @param speedRatio defines the current speed ratio
          * @param weight defines the weight of the animation (default is -1 so no weight)
-         * @returns a boolean indicating if the animation has ended
+         * @returns a boolean indicating if the animation is running
          */
         RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, weight) {
             if (weight === void 0) { weight = -1.0; }
@@ -51053,18 +51052,18 @@ var BABYLON;
                 this._stopped = true;
                 return false;
             }
-            var keys = this._animation.getKeys();
-            // Return immediately if there is only one key frame.
-            if (keys.length === 1) {
-                this.setValue(keys[0].value, weight);
-                return !loop;
-            }
             var returnValue = true;
+            var keys = this._animation.getKeys();
             // Adding a start key at frame 0 if missing
             if (keys[0].frame !== 0) {
                 var newKey = { frame: 0, value: keys[0].value };
                 keys.splice(0, 0, newKey);
             }
+            // Adding a duplicate key when there is only one key at frame zero
+            else if (keys.length === 1) {
+                var newKey = { frame: 0.001, value: keys[0].value };
+                keys.push(newKey);
+            }
             // Check limits
             if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
                 from = keys[0].frame;

File diff suppressed because it is too large
+ 16 - 16
dist/preview release/babylon.worker.js


+ 7 - 8
dist/preview release/es6.js

@@ -15351,7 +15351,6 @@ var BABYLON;
             var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
             this._bindTextureDirectly(bindTarget, texture, true);
             this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
-            this._bindTextureDirectly(bindTarget, null, true);
         };
         /** @hidden */
         Engine.prototype._uploadImageToTexture = function (texture, image, faceIndex, lod) {
@@ -51044,7 +51043,7 @@ var BABYLON;
          * @param loop defines if the current animation must loop
          * @param speedRatio defines the current speed ratio
          * @param weight defines the weight of the animation (default is -1 so no weight)
-         * @returns a boolean indicating if the animation has ended
+         * @returns a boolean indicating if the animation is running
          */
         RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, weight) {
             if (weight === void 0) { weight = -1.0; }
@@ -51053,18 +51052,18 @@ var BABYLON;
                 this._stopped = true;
                 return false;
             }
-            var keys = this._animation.getKeys();
-            // Return immediately if there is only one key frame.
-            if (keys.length === 1) {
-                this.setValue(keys[0].value, weight);
-                return !loop;
-            }
             var returnValue = true;
+            var keys = this._animation.getKeys();
             // Adding a start key at frame 0 if missing
             if (keys[0].frame !== 0) {
                 var newKey = { frame: 0, value: keys[0].value };
                 keys.splice(0, 0, newKey);
             }
+            // Adding a duplicate key when there is only one key at frame zero
+            else if (keys.length === 1) {
+                var newKey = { frame: 0.001, value: keys[0].value };
+                keys.push(newKey);
+            }
             // Check limits
             if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
                 from = keys[0].frame;

File diff suppressed because it is too large
+ 13 - 13
dist/preview release/viewer/babylon.viewer.js


+ 7 - 8
dist/preview release/viewer/babylon.viewer.max.js

@@ -15472,7 +15472,6 @@ var BABYLON;
             var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
             this._bindTextureDirectly(bindTarget, texture, true);
             this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
-            this._bindTextureDirectly(bindTarget, null, true);
         };
         /** @hidden */
         Engine.prototype._uploadImageToTexture = function (texture, image, faceIndex, lod) {
@@ -51165,7 +51164,7 @@ var BABYLON;
          * @param loop defines if the current animation must loop
          * @param speedRatio defines the current speed ratio
          * @param weight defines the weight of the animation (default is -1 so no weight)
-         * @returns a boolean indicating if the animation has ended
+         * @returns a boolean indicating if the animation is running
          */
         RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, weight) {
             if (weight === void 0) { weight = -1.0; }
@@ -51174,18 +51173,18 @@ var BABYLON;
                 this._stopped = true;
                 return false;
             }
-            var keys = this._animation.getKeys();
-            // Return immediately if there is only one key frame.
-            if (keys.length === 1) {
-                this.setValue(keys[0].value, weight);
-                return !loop;
-            }
             var returnValue = true;
+            var keys = this._animation.getKeys();
             // Adding a start key at frame 0 if missing
             if (keys[0].frame !== 0) {
                 var newKey = { frame: 0, value: keys[0].value };
                 keys.splice(0, 0, newKey);
             }
+            // Adding a duplicate key when there is only one key at frame zero
+            else if (keys.length === 1) {
+                var newKey = { frame: 0.001, value: keys[0].value };
+                keys.push(newKey);
+            }
             // Check limits
             if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
                 from = keys[0].frame;

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

@@ -5252,8 +5252,6 @@
             this._bindTextureDirectly(bindTarget, texture, true);
 
             this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
-
-            this._bindTextureDirectly(bindTarget, null, true);
         }
 
         /** @hidden */