From 0c2f8ed4014bf778deb0d9da6466e8db368fdf01 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 4 Jun 2014 09:26:39 -0700 Subject: [PATCH] Lua compiles and runs --- build/cocos2d_tests.xcodeproj/project.pbxproj | 2 ++ cocos/scripting/lua-bindings/manual/LuaOpengl.cpp | 6 +++--- cocos/scripting/lua-bindings/manual/LuaOpengl.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 31ff531727..5169d3949d 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -5514,6 +5514,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; @@ -5540,6 +5541,7 @@ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk"; diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp index 5641ffac02..2b5aba203b 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp @@ -38,10 +38,10 @@ using namespace cocos2d::extension; -void GLNode::draw(Renderer *renderer, const cocos2d::Mat4& transform, bool transformUpdated) +void GLNode::draw(Renderer *renderer, const cocos2d::Mat4& transform, uint32_t flags) { _renderCmd.init(_globalZOrder); - _renderCmd.func = CC_CALLBACK_0(GLNode::onDraw, this, transform, transformUpdated); + _renderCmd.func = CC_CALLBACK_0(GLNode::onDraw, this, transform, flags); renderer->addCommand(&_renderCmd); } @@ -60,7 +60,7 @@ void GLNode::onDraw(const cocos2d::Mat4 &transform, uint32_t flags) stack->pushFloat(transform.m[i]); lua_rawseti(L, -2, i + 1); } - stack->pushBoolean(transformUpdated); + stack->pushInt(flags); stack->executeFunctionByHandler(handler, 2); stack->clean(); } diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.h b/cocos/scripting/lua-bindings/manual/LuaOpengl.h index 0ca285cbfd..874f814415 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.h +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.h @@ -39,7 +39,7 @@ class GLNode:public cocos2d::Node { public: virtual ~GLNode(){} - virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4& transform, bool transformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4& transform, uint32_t flags) override; protected: cocos2d::CustomCommand _renderCmd; void onDraw(const cocos2d::Mat4 &transform, uint32_t flags);