From e5891539c9351649cbc4e8b6741791c3208658cb Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Mon, 17 Oct 2016 11:52:16 +0800 Subject: [PATCH] add graphics warn --- cocos2d/core/graphics/graphics-webgl-cmd.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos2d/core/graphics/graphics-webgl-cmd.js b/cocos2d/core/graphics/graphics-webgl-cmd.js index c694e6896e..06ef569ff8 100644 --- a/cocos2d/core/graphics/graphics-webgl-cmd.js +++ b/cocos2d/core/graphics/graphics-webgl-cmd.js @@ -325,6 +325,10 @@ Js.mixin(_p, { this._indicesDirty = false; } + if (this._vertsOffset > 65536) { + cc.warn('Too many graphics vertices generated, only 65536 vertices support.'); + } + gl.enableVertexAttribArray(cc.macro.VERTEX_ATTRIB_POSITION); gl.vertexAttribPointer(cc.macro.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, VERTS_BYTE_LENGTH, 0);