From 6c77064f2c57d0f54a1538bdff8a94de4d201337 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Mon, 27 Mar 2017 14:41:06 +0800 Subject: [PATCH 1/2] set camera executeInEditMode to false --- cocos2d/core/camera/CCCamera.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos2d/core/camera/CCCamera.js b/cocos2d/core/camera/CCCamera.js index 99aa572702..baab85ea38 100644 --- a/cocos2d/core/camera/CCCamera.js +++ b/cocos2d/core/camera/CCCamera.js @@ -35,6 +35,7 @@ let Camera = cc.Class({ editor: CC_EDITOR && { menu: 'i18n:MAIN_MENU.component.others/Camera', + executeInEditMode: false }, properties: { From f55932382660524c7a921b90efc0f9f137e6246e Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Mon, 27 Mar 2017 15:28:23 +0800 Subject: [PATCH 2/2] fixed matrix stack update state --- cocos2d/kazmath/gl/mat4stack.js | 6 ++++++ cocos2d/kazmath/gl/matrix.js | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2d/kazmath/gl/mat4stack.js b/cocos2d/kazmath/gl/mat4stack.js index 8e2089e0bb..58059665c9 100644 --- a/cocos2d/kazmath/gl/mat4stack.js +++ b/cocos2d/kazmath/gl/mat4stack.js @@ -50,11 +50,17 @@ proto.push = function(item) { this.stack.push(this.top); this.top = new cc.math.Matrix4(item); //this.top = this._getFromPool(item); + this.update(); }; proto.pop = function() { //this._putInPool(this.top); this.top = this.stack.pop(); + this.update(); +}; + +proto.update = function () { + this.lastUpdated ++; }; proto.release = function(){ diff --git a/cocos2d/kazmath/gl/matrix.js b/cocos2d/kazmath/gl/matrix.js index db7e2fc653..3aa868815d 100644 --- a/cocos2d/kazmath/gl/matrix.js +++ b/cocos2d/kazmath/gl/matrix.js @@ -106,7 +106,6 @@ math.glMatrixMode = function (mode) { throw new Error("Invalid matrix mode specified"); //TODO: Proper error handling break; } - cc.current_stack.lastUpdated = cc.director.getTotalFrames(); }; math.glLoadIdentity = function () {