Skip to content

Commit cd468c5

Browse files
committed
Some minor fixes and changes
Squashed commits: Fix opacity on SkeletonAnimation not working issue [89cd5f4] More exigent check for sprite need draw [48f6fda] Use standard blend function for layer [9065802] Made webgl background not transparent [f5d3416] Fix variable leak in ProgressTimerRenderCmd
1 parent 6054f1f commit cd468c5

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Diff for: CCBoot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,7 @@ cc.game = /** @lends cc.game# */{
26542654
'stencil': true,
26552655
'preserveDrawingBuffer': true,
26562656
'antialias': !cc.sys.isMobile,
2657-
'alpha': true
2657+
'alpha': false
26582658
});
26592659
}
26602660
// WebGL context created successfully

Diff for: cocos2d/core/layers/CCLayer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ cc.LayerColor = cc.Layer.extend(/** @lends cc.LayerColor# */{
191191
*/
192192
ctor: function(color, width, height){
193193
cc.Layer.prototype.ctor.call(this);
194-
this._blendFunc = new cc.BlendFunc(cc.SRC_ALPHA, cc.ONE_MINUS_SRC_ALPHA);
194+
this._blendFunc = cc.BlendFunc._alphaNonPremultiplied();
195195
cc.LayerColor.prototype.init.call(this, color, width, height);
196196
},
197197

Diff for: cocos2d/core/sprites/CCSpriteWebGLRenderCmd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
};
532532

533533
proto.needDraw = function () {
534-
return (this._buffer && this._node._texture);
534+
return (this._buffer && this._needDraw);
535535
};
536536

537537
proto.rendering = function (ctx) {

Diff for: cocos2d/progress-timer/CCProgressTimerWebGLRenderCmd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
this._vertexArrayBuffer = new ArrayBuffer(MAX_VERTEX_COUNT * vertexDataLen);
198198
this._float32View = new Float32Array(this._vertexArrayBuffer);
199199
this._vertexData = [];
200-
for (i = 0; i < MAX_VERTEX_COUNT; i++) {
200+
for (var i = 0; i < MAX_VERTEX_COUNT; i++) {
201201
this._vertexData[i] = new cc.V3F_C4B_T2F(null, null, null, this._vertexArrayBuffer, i * vertexDataLen);
202202
}
203203

Diff for: extensions/spine/CCSkeletonCanvasRenderCmd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
}
198198

199199
//hack for sprite
200-
selSprite._renderCmd._displayedOpacity = 0 | (locSkeleton.a * slot.a * 255);
200+
selSprite._renderCmd._displayedOpacity = 0 | (this._node.getOpacity() * locSkeleton.a * slot.a);
201201
var r = 0 | (locSkeleton.r * slot.r * 255), g = 0 | (locSkeleton.g * slot.g * 255), b = 0 | (locSkeleton.b * slot.b * 255);
202202
selSprite.setColor(cc.color(r,g,b));
203203
selSprite._renderCmd._updateColor();

0 commit comments

Comments
 (0)