David Catuhe 9 years ago
parent
commit
73ac01df6c

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


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


+ 12 - 15
dist/preview release/babylon.max.js

@@ -38396,9 +38396,7 @@ var BABYLON;
             }
         };
         SmartPropertyPrim.prototype.onPrimitivePropertyDirty = function (propFlagId) {
-            if (!this.isDirty) {
-                this.onPrimBecomesDirty();
-            }
+            this.onPrimBecomesDirty();
             this._instanceDirtyFlags |= propFlagId;
         };
         SmartPropertyPrim.prototype.handleGroupChanged = function (prop) {
@@ -38422,6 +38420,7 @@ var BABYLON;
         };
         SmartPropertyPrim.prototype._resetPropertiesDirty = function () {
             this._instanceDirtyFlags = 0;
+            this._clearFlags(SmartPropertyPrim.flagPrimInDirtyList);
         };
         Object.defineProperty(SmartPropertyPrim.prototype, "levelBoundingInfo", {
             /**
@@ -38591,6 +38590,7 @@ var BABYLON;
         SmartPropertyPrim.flagChildrenFlatZOrder = 0x0001000; // set if all the children (direct and indirect) will share the same Z-Order
         SmartPropertyPrim.flagZOrderDirty = 0x0002000; // set if the Z-Order for this prim and its children must be recomputed
         SmartPropertyPrim.flagActualOpacityDirty = 0x0004000; // set if the actualOpactity should be recomputed
+        SmartPropertyPrim.flagPrimInDirtyList = 0x0008000; // set if the primitive is in the primDirtyList
         SmartPropertyPrim = __decorate([
             BABYLON.className("SmartPropertyPrim")
         ], SmartPropertyPrim);
@@ -40846,8 +40846,9 @@ var BABYLON;
             return true;
         };
         Prim2DBase.prototype.onPrimBecomesDirty = function () {
-            if (this._renderGroup) {
+            if (this._renderGroup && !this._isFlagSet(BABYLON.SmartPropertyPrim.flagPrimInDirtyList)) {
                 this._renderGroup._addPrimToDirtyList(this);
+                this._setFlags(BABYLON.SmartPropertyPrim.flagPrimInDirtyList);
             }
         };
         Prim2DBase.prototype._needPrepare = function () {
@@ -40904,9 +40905,7 @@ var BABYLON;
             this._parent._setLayoutDirty();
         };
         Prim2DBase.prototype._setLayoutDirty = function () {
-            if (!this.isDirty) {
-                this.onPrimBecomesDirty();
-            }
+            this.onPrimBecomesDirty();
             this._setFlags(BABYLON.SmartPropertyPrim.flagLayoutDirty);
         };
         Prim2DBase.prototype._checkPositionChange = function () {
@@ -40917,9 +40916,7 @@ var BABYLON;
             return true;
         };
         Prim2DBase.prototype._positioningDirty = function () {
-            if (!this.isDirty) {
-                this.onPrimBecomesDirty();
-            }
+            this.onPrimBecomesDirty();
             this._setFlags(BABYLON.SmartPropertyPrim.flagPositioningDirty);
         };
         Prim2DBase.prototype._spreadActualOpacityChanged = function () {
@@ -41291,9 +41288,7 @@ var BABYLON;
         Prim2DBase.prototype._setZOrder = function (newZ, directEmit) {
             if (newZ !== this._zOrder) {
                 this._zOrder = newZ;
-                if (!this.isDirty) {
-                    this.onPrimBecomesDirty();
-                }
+                this.onPrimBecomesDirty();
                 this.onZOrderChanged();
                 if (this._actualZOrderChangedObservable && this._actualZOrderChangedObservable.hasObservers()) {
                     if (directEmit) {
@@ -44706,13 +44701,15 @@ var BABYLON;
             this.invertY = (settings.invertY == null) ? false : settings.invertY;
             this.alignToPixel = (settings.alignToPixel == null) ? true : settings.alignToPixel;
             this.isAlphaTest = true;
-            if (settings.spriteSize == null) {
+            if (settings.spriteSize == null || !texture.isReady()) {
                 if (texture.isReady()) {
                     this.size = texture.getSize();
                 }
                 else {
                     texture.onLoadObservable.add(function () {
-                        _this.size = texture.getSize();
+                        if (settings.spriteSize == null) {
+                            _this.size = texture.getSize();
+                        }
                         _this._positioningDirty();
                     });
                 }

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


+ 5 - 10
src/Canvas2d/babylon.prim2dBase.js

@@ -2229,8 +2229,9 @@ var BABYLON;
             return true;
         };
         Prim2DBase.prototype.onPrimBecomesDirty = function () {
-            if (this._renderGroup) {
+            if (this._renderGroup && !this._isFlagSet(BABYLON.SmartPropertyPrim.flagPrimInDirtyList)) {
                 this._renderGroup._addPrimToDirtyList(this);
+                this._setFlags(BABYLON.SmartPropertyPrim.flagPrimInDirtyList);
             }
         };
         Prim2DBase.prototype._needPrepare = function () {
@@ -2287,9 +2288,7 @@ var BABYLON;
             this._parent._setLayoutDirty();
         };
         Prim2DBase.prototype._setLayoutDirty = function () {
-            if (!this.isDirty) {
-                this.onPrimBecomesDirty();
-            }
+            this.onPrimBecomesDirty();
             this._setFlags(BABYLON.SmartPropertyPrim.flagLayoutDirty);
         };
         Prim2DBase.prototype._checkPositionChange = function () {
@@ -2300,9 +2299,7 @@ var BABYLON;
             return true;
         };
         Prim2DBase.prototype._positioningDirty = function () {
-            if (!this.isDirty) {
-                this.onPrimBecomesDirty();
-            }
+            this.onPrimBecomesDirty();
             this._setFlags(BABYLON.SmartPropertyPrim.flagPositioningDirty);
         };
         Prim2DBase.prototype._spreadActualOpacityChanged = function () {
@@ -2674,9 +2671,7 @@ var BABYLON;
         Prim2DBase.prototype._setZOrder = function (newZ, directEmit) {
             if (newZ !== this._zOrder) {
                 this._zOrder = newZ;
-                if (!this.isDirty) {
-                    this.onPrimBecomesDirty();
-                }
+                this.onPrimBecomesDirty();
                 this.onZOrderChanged();
                 if (this._actualZOrderChangedObservable && this._actualZOrderChangedObservable.hasObservers()) {
                     if (directEmit) {

+ 3 - 3
src/Canvas2d/babylon.smartPropertyPrim.js

@@ -357,9 +357,7 @@ var BABYLON;
             }
         };
         SmartPropertyPrim.prototype.onPrimitivePropertyDirty = function (propFlagId) {
-            if (!this.isDirty) {
-                this.onPrimBecomesDirty();
-            }
+            this.onPrimBecomesDirty();
             this._instanceDirtyFlags |= propFlagId;
         };
         SmartPropertyPrim.prototype.handleGroupChanged = function (prop) {
@@ -383,6 +381,7 @@ var BABYLON;
         };
         SmartPropertyPrim.prototype._resetPropertiesDirty = function () {
             this._instanceDirtyFlags = 0;
+            this._clearFlags(SmartPropertyPrim.flagPrimInDirtyList);
         };
         Object.defineProperty(SmartPropertyPrim.prototype, "levelBoundingInfo", {
             /**
@@ -552,6 +551,7 @@ var BABYLON;
         SmartPropertyPrim.flagChildrenFlatZOrder = 0x0001000; // set if all the children (direct and indirect) will share the same Z-Order
         SmartPropertyPrim.flagZOrderDirty = 0x0002000; // set if the Z-Order for this prim and its children must be recomputed
         SmartPropertyPrim.flagActualOpacityDirty = 0x0004000; // set if the actualOpactity should be recomputed
+        SmartPropertyPrim.flagPrimInDirtyList = 0x0008000; // set if the primitive is in the primDirtyList
         SmartPropertyPrim = __decorate([
             BABYLON.className("SmartPropertyPrim")
         ], SmartPropertyPrim);

+ 4 - 2
src/Canvas2d/babylon.sprite2d.js

@@ -194,13 +194,15 @@ var BABYLON;
             this.invertY = (settings.invertY == null) ? false : settings.invertY;
             this.alignToPixel = (settings.alignToPixel == null) ? true : settings.alignToPixel;
             this.isAlphaTest = true;
-            if (settings.spriteSize == null) {
+            if (settings.spriteSize == null || !texture.isReady()) {
                 if (texture.isReady()) {
                     this.size = texture.getSize();
                 }
                 else {
                     texture.onLoadObservable.add(function () {
-                        _this.size = texture.getSize();
+                        if (settings.spriteSize == null) {
+                            _this.size = texture.getSize();
+                        }
                         _this._positioningDirty();
                     });
                 }