From 92865d88dad7eff9fb2462f97ec8b10d75505e20 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 18 May 2018 15:01:38 +0800 Subject: [PATCH] Add Texture premultiply alpha serialization support --- cocos2d/core/assets/CCTexture2D.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/assets/CCTexture2D.js b/cocos2d/core/assets/CCTexture2D.js index 30f59e71b5..7340d7e35c 100644 --- a/cocos2d/core/assets/CCTexture2D.js +++ b/cocos2d/core/assets/CCTexture2D.js @@ -657,7 +657,10 @@ var Texture2D = cc.Class({ } } } - let asset = "" + extId + "," + this._minFilter + "," + this._magFilter + "," + this._wrapS + "," + this._wrapT; + let asset = "" + extId + "," + + this._minFilter + "," + this._magFilter + "," + + this._wrapS + "," + this._wrapT + "," + + (this._premultiplyAlpha ? 1 : 0); return asset; }, @@ -687,6 +690,8 @@ var Texture2D = cc.Class({ // decode wraps this._wrapS = parseInt(fields[3]); this._wrapT = parseInt(fields[4]); + // decode premultiply alpha + this._premultiplyAlpha = !!parseInt(fields[5]); } } });