Skip to content

Commit 4973461

Browse files
committed
Fix cocos2d#3156 setBlendFunc issue in parser
1 parent ef10a0b commit 4973461

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

extensions/cocostudio/loader/parsers/action-2.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
handle: function(options){
261261
var frame = new ccs.BlendFuncFrame();
262262
var blendFunc = options["BlendFunc"];
263-
if(blendFunc)
263+
if(blendFunc && blendFunc["Src"] !== undefined && blendFunc["Dst"] !== undefined)
264264
frame.setBlendFunc(new cc.BlendFunc(blendFunc["Src"], blendFunc["Dst"]));
265265
return frame;
266266
}

extensions/cocostudio/loader/parsers/timelineParser-2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,8 @@
12921292
node.setDebugDrawLength(length);
12931293

12941294
var blendFunc = json["BlendFunc"];
1295-
if(blendFunc)
1296-
node.setBlendFunc(new cc.BlendFunc(blendFunc["Src"] || 0, blendFunc["Dst"] || 0));
1295+
if(blendFunc && blendFunc["Src"] !== undefined && blendFunc["Dst"] !== undefined)
1296+
node.setBlendFunc(new cc.BlendFunc(blendFunc["Src"], blendFunc["Dst"]));
12971297

12981298
parser.generalAttributes(node, json);
12991299
var color = json["CColor"];

0 commit comments

Comments
 (0)