Merge branch 'develop' into develop_nutty_modify_framework_testbugfixed

This commit is contained in:
CaiWenzhi 2013-12-30 15:57:41 +08:00
commit b8aa9fbf93
6 changed files with 67 additions and 12 deletions

View File

@ -30,6 +30,7 @@ THE SOFTWARE.
#include "CCActionGrid.h"
#include "CCActionPageTurn3D.h"
#include "CCNodeGrid.h"
#include "renderer/CCRenderer.h"
NS_CC_BEGIN
@ -78,24 +79,43 @@ void TransitionPageTurn::sceneOrder()
_isInSceneOnTop = _back;
}
void TransitionPageTurn::onEnablePolygonOffset()
{
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(POLYGON_OFFSET_FACTOR, POLYGON_OFFSET_UNITS);
}
void TransitionPageTurn::onDisablePolygonOffset()
{
glDisable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, 0);
}
void TransitionPageTurn::draw()
{
Scene::draw();
if( _isInSceneOnTop ) {
_outSceneProxy->visit();
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(POLYGON_OFFSET_FACTOR, POLYGON_OFFSET_UNITS);
_enableOffsetCmd.init(0, _vertexZ);
_enableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onEnablePolygonOffset, this);
Director::getInstance()->getRenderer()->addCommand(&_enableOffsetCmd);
_inSceneProxy->visit();
glDisable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, 0);
_disableOffsetCmd.init(0, _vertexZ);
_disableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onDisablePolygonOffset, this);
Director::getInstance()->getRenderer()->addCommand(&_disableOffsetCmd);
} else {
_inSceneProxy->visit();
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(POLYGON_OFFSET_FACTOR, POLYGON_OFFSET_UNITS);
_enableOffsetCmd.init(0, _vertexZ);
_enableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onEnablePolygonOffset, this);
Director::getInstance()->getRenderer()->addCommand(&_enableOffsetCmd);
_outSceneProxy->visit();
glDisable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, 0);
_disableOffsetCmd.init(0, _vertexZ);
_disableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onDisablePolygonOffset, this);
Director::getInstance()->getRenderer()->addCommand(&_disableOffsetCmd);
}
}

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
#define __CCPAGE_TURN_TRANSITION_H__
#include "CCTransition.h"
#include "renderer/CCCustomCommand.h"
NS_CC_BEGIN
@ -96,6 +97,12 @@ protected:
bool _back;
static float POLYGON_OFFSET_FACTOR;
static float POLYGON_OFFSET_UNITS;
protected:
CustomCommand _enableOffsetCmd;
CustomCommand _disableOffsetCmd;
void onEnablePolygonOffset();
void onDisablePolygonOffset();
};
// end of transition group

View File

@ -276,7 +276,7 @@ static int tolua_Cocos2d_ScriptHandlerMgr_registerScriptHandler00(lua_State* tol
}
#endif
LUA_FUNCTION handler = toluafix_ref_function(tolua_S,3,0);
ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)tolua_tonumber(tolua_S, 4, 0);
ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)(int)tolua_tonumber(tolua_S, 4, 0);
scriptHanlderMgr->addObjectHandler(tolua_tousertype(tolua_S, 2, 0), handler,handlerType);
}
return 1;
@ -308,7 +308,7 @@ static int tolua_Cocos2d_ScriptHandlerMgr_unregisterScriptHandler00(lua_State* t
return 0;
}
#endif
ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)tolua_tonumber(tolua_S, 3, 0);
ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)(int)tolua_tonumber(tolua_S, 3, 0);
scriptHanlderMgr->removeObjectHandler(tolua_tousertype(tolua_S, 2, 0), handlerType);
}
return 1;

View File

@ -64,7 +64,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)extensions\network;$(EngineRoot)external;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)cocos\scripting\auto-generated\lua-bindings;$(EngineRoot)cocos\gui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)extensions\network;$(EngineRoot)external;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)cocos\scripting\auto-generated\lua-bindings;$(EngineRoot)cocos\gui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -131,6 +131,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$
<ClCompile Include="..\..\..\..\external\lua\tolua\tolua_to.c" />
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.cpp" />
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto.cpp" />
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_spine_auto.cpp" />
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_studio_auto.cpp" />
<ClCompile Include="CCBProxy.cpp" />
<ClCompile Include="CCLuaBridge.cpp" />
@ -141,10 +142,12 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$
<ClCompile Include="LuaBasicConversions.cpp" />
<ClCompile Include="LuaOpengl.cpp" />
<ClCompile Include="LuaScriptHandlerMgr.cpp" />
<ClCompile Include="LuaSkeletonAnimation.cpp" />
<ClCompile Include="lua_cocos2dx_coco_studio_manual.cpp" />
<ClCompile Include="lua_cocos2dx_deprecated.cpp" />
<ClCompile Include="lua_cocos2dx_extension_manual.cpp" />
<ClCompile Include="lua_cocos2dx_manual.cpp" />
<ClCompile Include="lua_cocos2dx_spine_manual.cpp" />
<ClCompile Include="Lua_web_socket.cpp" />
<ClCompile Include="lua_xml_http_request.cpp" />
<ClCompile Include="tolua_fix.c" />
@ -158,6 +161,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$
<ClInclude Include="..\..\..\..\external\lua\tolua\tolua_event.h" />
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.hpp" />
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto.hpp" />
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_spine_auto.hpp" />
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_studio_auto.hpp" />
<ClInclude Include="CCBProxy.h" />
<ClInclude Include="CCLuaBridge.h" />
@ -168,10 +172,12 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$
<ClInclude Include="LuaBasicConversions.h" />
<ClInclude Include="LuaOpengl.h" />
<ClInclude Include="LuaScriptHandlerMgr.h" />
<ClInclude Include="LuaSkeletonAnimation.h" />
<ClInclude Include="lua_cocos2dx_coco_studio_manual.hpp" />
<ClInclude Include="lua_cocos2dx_deprecated.h" />
<ClInclude Include="lua_cocos2dx_extension_manual.h" />
<ClInclude Include="lua_cocos2dx_manual.hpp" />
<ClInclude Include="lua_cocos2dx_spine_manual.hpp" />
<ClInclude Include="Lua_web_socket.h" />
<ClInclude Include="lua_xml_http_request.h" />
<ClInclude Include="tolua_fix.h" />
@ -179,6 +185,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$
<ItemGroup>
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto_api.js" />
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto_api.js" />
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_spine_auto_api.js" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -90,6 +90,15 @@
<ClCompile Include="lua_cocos2dx_coco_studio_manual.cpp">
<Filter>cocos2dx_support</Filter>
</ClCompile>
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_spine_auto.cpp">
<Filter>cocos2dx_support\generated</Filter>
</ClCompile>
<ClCompile Include="lua_cocos2dx_spine_manual.cpp">
<Filter>cocos2dx_support</Filter>
</ClCompile>
<ClCompile Include="LuaSkeletonAnimation.cpp">
<Filter>cocos2dx_support</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.hpp">
@ -167,6 +176,15 @@
<ClInclude Include="lua_cocos2dx_coco_studio_manual.hpp">
<Filter>cocos2dx_support</Filter>
</ClInclude>
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_spine_auto.hpp">
<Filter>cocos2dx_support\generated</Filter>
</ClInclude>
<ClInclude Include="lua_cocos2dx_spine_manual.hpp">
<Filter>cocos2dx_support</Filter>
</ClInclude>
<ClInclude Include="LuaSkeletonAnimation.h">
<Filter>cocos2dx_support</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto_api.js">
@ -175,5 +193,8 @@
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto_api.js">
<Filter>cocos2dx_support\generated</Filter>
</None>
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_spine_auto_api.js">
<Filter>cocos2dx_support\generated</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1 +1 @@
91928b80f0e66732d837b163cd32fd7613369715
c3e1d45b75519a265427c1b2479e2bf43305fc1d