Skip to content

Commit 3c06801

Browse files
author
pandamicro
committed
Fix clear color not normalized issue
1 parent f8aeb7f commit 3c06801

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

cocos2d/core/CCDirectorWebGL.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ cc.game.addEventListener(cc.game.EVENT_RENDERER_INITED, function () {
160160
cc.eventManager.setEnabled(true);
161161
};
162162

163-
_p._clear = function () {
164-
var gl = cc._renderContext;
165-
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
166-
};
167-
168163
_p.getVisibleSize = function () {
169164
//if (this._openGLView) {
170165
return this._openGLView.getVisibleSize();

cocos2d/core/renderer/RendererWebGL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ return {
232232

233233
clear: function () {
234234
var gl = cc._renderContext;
235-
gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearColor.a);
235+
gl.clearColor(this._clearColor.r / 255, this._clearColor.g / 255, this._clearColor.b / 255, this._clearColor.a / 255);
236236
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
237237
},
238238

0 commit comments

Comments
 (0)