diff --git a/cocos2d/core/CCDrawingPrimitivesWebGL.js b/cocos2d/core/CCDrawingPrimitivesWebGL.js index eca726063a..44215e2233 100644 --- a/cocos2d/core/CCDrawingPrimitivesWebGL.js +++ b/cocos2d/core/CCDrawingPrimitivesWebGL.js @@ -85,7 +85,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); this._shader.setUniformLocationWith1f(this._pointSizeLocation, this._pointSize); @@ -114,7 +114,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); this._shader.setUniformLocationWith1f(this._pointSizeLocation, this._pointSize); @@ -149,7 +149,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); @@ -204,7 +204,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); @@ -235,7 +235,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); @@ -283,7 +283,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); @@ -321,7 +321,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); @@ -360,7 +360,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); @@ -420,7 +420,7 @@ cc.DrawingPrimitiveWebGL = cc._Class.extend(/** @lends cc.DrawingPrimitiveWebGL# var glContext = this._renderContext; this._shader.use(); this._shader.setUniformForModelViewAndProjectionMatrixWithMat4(); - glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_FLAG_POSITION); + glContext.enableVertexAttribArray(macro.VERTEX_ATTRIB_POSITION); this._shader.setUniformLocationWith4fv(this._colorLocation, this._colorArray); var pointBuffer = glContext.createBuffer(); diff --git a/cocos2d/core/components/CCComponentEventHandler.js b/cocos2d/core/components/CCComponentEventHandler.js index 3f267accec..0b32437f40 100644 --- a/cocos2d/core/components/CCComponentEventHandler.js +++ b/cocos2d/core/components/CCComponentEventHandler.js @@ -23,8 +23,6 @@ THE SOFTWARE. ****************************************************************************/ -var _args = []; - /** * !#en * Component will register a event to target component's handler. @@ -106,17 +104,19 @@ cc.Component.EventHandler = cc.Class({ } } : function(events) { 'use strict'; - _args.length = arguments.length > 0 ? arguments.length - 1 : 0; - for (var i = 0, l = _args.length; i < l; i++) { - _args[i] = arguments[i+1]; + var args, i, l; + if (arguments.length > 0) { + args = new Array(arguments.length - 1); + for (i = 0, l = args.length; i < l; i++) { + args[i] = arguments[i+1]; + } } for (i = 0, l = events.length; i < l; i++) { var event = events[i]; if (!(event instanceof cc.Component.EventHandler)) continue; - event.emit(_args); + event.emit(args); } - _args.length = 0; } }, diff --git a/cocos2d/core/editbox/CCSGEditBox.js b/cocos2d/core/editbox/CCSGEditBox.js index c73bb9cffc..6161f89e42 100644 --- a/cocos2d/core/editbox/CCSGEditBox.js +++ b/cocos2d/core/editbox/CCSGEditBox.js @@ -699,7 +699,7 @@ _ccsg.EditBox.KeyboardReturnType = KeyboardReturnType; } if (editBox._delegate && editBox._delegate.editBoxTextChanged) { - if (editBox._text.toLowerCase() !== this.value.toLowerCase()) { + if (editBox._text !== this.value) { editBox._text = this.value; thisPointer._updateDomTextCases(); editBox._delegate.editBoxTextChanged(editBox, editBox._text); diff --git a/cocos2d/core/load-pipeline/CCLoader.js b/cocos2d/core/load-pipeline/CCLoader.js index 50b29798b4..03c4d62c1e 100644 --- a/cocos2d/core/load-pipeline/CCLoader.js +++ b/cocos2d/core/load-pipeline/CCLoader.js @@ -496,7 +496,7 @@ JS.mixin(CCLoader.prototype, { */ getRes: function (url, type) { var item = this._cache[url]; - if (!item && type) { + if (!item) { var uuid = this._getResUuid(url, type, true); if (uuid) { var ref = this._getReferenceKey(uuid);