From e975b0d5f9dad010c00aa6831de6d5279a4d98b5 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 17 Jul 2014 14:54:34 +0800 Subject: [PATCH] =?UTF-8?q?Update=20experimental=20lua=20bindings=E3=80=81?= =?UTF-8?q?related=20test=20cases=20and=20project=20setting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/scripting/lua-bindings/Android.mk | 2 + cocos/scripting/lua-bindings/CMakeLists.txt | 2 + .../lua-bindings/manual/CCLuaStack.cpp | 10 ++- .../lua_cocos2dx_experimental_manual.cpp | 89 ++----------------- .../lua_cocos2dx_experimental_manual.hpp | 2 - ...lua_cocos2dx_experimental_video_manual.cpp | 87 ++++++++++++++++++ ...lua_cocos2dx_experimental_video_manual.hpp | 41 +++++++++ .../project.pbxproj | 40 +++++---- .../lua-bindings/proj.win32/liblua.vcxproj | 4 + .../proj.win32/liblua.vcxproj.filters | 12 +++ .../src/FastTiledMapTest/FastTiledMapTest.lua | 50 +++++------ tools/tolua/cocos2dx.ini | 4 +- tools/tolua/cocos2dx_experimental.ini | 9 +- tools/tolua/cocos2dx_experimental_video.ini | 62 +++++++++++++ tools/tolua/genbindings.py | 1 + 15 files changed, 281 insertions(+), 134 deletions(-) create mode 100644 cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp create mode 100644 cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp create mode 100644 tools/tolua/cocos2dx_experimental_video.ini diff --git a/cocos/scripting/lua-bindings/Android.mk b/cocos/scripting/lua-bindings/Android.mk index c926b1d11c..aa2c13f5e3 100644 --- a/cocos/scripting/lua-bindings/Android.mk +++ b/cocos/scripting/lua-bindings/Android.mk @@ -23,6 +23,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \ manual/lua_cocos2dx_ui_manual.cpp \ manual/lua_cocos2dx_spine_manual.cpp \ manual/lua_cocos2dx_physics_manual.cpp \ + manual/lua_cocos2dx_experimental_manual.cpp \ manual/lua_cocos2dx_experimental_video_manual.cpp \ manual/lua_cocos2dx_deprecated.cpp \ manual/lua_xml_http_request.cpp \ @@ -36,6 +37,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \ auto/lua_cocos2dx_ui_auto.cpp \ auto/lua_cocos2dx_spine_auto.cpp \ auto/lua_cocos2dx_physics_auto.cpp \ + auto/lua_cocos2dx_experimental_auto.cpp \ auto/lua_cocos2dx_experimental_video_auto.cpp \ ../../../external/lua/tolua/tolua_event.c \ ../../../external/lua/tolua/tolua_is.c \ diff --git a/cocos/scripting/lua-bindings/CMakeLists.txt b/cocos/scripting/lua-bindings/CMakeLists.txt index 9ac8d5f1ff..1f414b9005 100644 --- a/cocos/scripting/lua-bindings/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/CMakeLists.txt @@ -5,6 +5,7 @@ set(LUABINDING_SRC auto/lua_cocos2dx_ui_auto.cpp auto/lua_cocos2dx_spine_auto.cpp auto/lua_cocos2dx_physics_auto.cpp + auto/lua_cocos2dx_experimental_auto.cpp manual/tolua_fix.cpp manual/CCLuaBridge.cpp manual/CCLuaEngine.cpp @@ -24,6 +25,7 @@ set(LUABINDING_SRC manual/lua_cocos2dx_deprecated.cpp manual/lua_xml_http_request.cpp manual/LuaSkeletonAnimation.cpp + manual/lua_cocos2dx_experimental_manual.cpp ) include_directories( diff --git a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp index 88f73fb0d1..144850b298 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -73,6 +73,10 @@ extern "C" { #include "lua_cocos2dx_ui_manual.hpp" #include "lua_cocos2dx_experimental_auto.hpp" #include "lua_cocos2dx_experimental_manual.hpp" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#include "lua_cocos2dx_experimental_video_auto.hpp" +#include "lua_cocos2dx_experimental_video_manual.hpp" +#endif namespace { int lua_print(lua_State * luastate) @@ -182,10 +186,12 @@ bool LuaStack::init(void) #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) register_all_cocos2dx_experimental(_state); register_all_cocos2dx_experimental_manual(_state); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + register_all_cocos2dx_experimental_video(_state); + register_all_cocos2dx_experimental_video_manual(_state); #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.cpp index 488c8cbcba..1a50a8a697 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.cpp @@ -1,83 +1,14 @@ #include "lua_cocos2dx_experimental_manual.hpp" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - #include "UIVideoPlayer.h" #include "tolua_fix.h" #include "LuaBasicConversions.h" #include "CCLuaValue.h" #include "CCLuaEngine.h" - - -static int lua_cocos2dx_experimental_video_VideoPlayer_addEventListener(lua_State* L) -{ - - int argc = 0; - cocos2d::experimental::ui::VideoPlayer* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", nullptr); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (argc == 1) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) - { - goto tolua_lerror; - } -#endif - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - self->addEventListener([=](cocos2d::Ref* ref, cocos2d::experimental::ui::VideoPlayer::EventType eventType){ - LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - - stack->pushObject(ref, "cc.Ref"); - stack->pushInt((int)eventType); - - stack->executeFunctionByHandler(handler, 2); - }); - - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "addEventListener",argc, 0); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(L, "#ferror in function 'lua_cocos2dx_experimental_VideoPlayer_addEventListener'.", &tolua_err); -#endif - return 0; -} - -static void extendVideoPlayer(lua_State* L) -{ - lua_pushstring(L, "ccexp.VideoPlayer"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addEventListener", lua_cocos2dx_experimental_video_VideoPlayer_addEventListener); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_experimental_FastTMXLayer_getTileGIDAt(lua_State* tolua_S) +static int lua_cocos2dx_experimental_TMXLayer_getTileGIDAt(lua_State* tolua_S) { int argc = 0; - cocos2d::experimental::FastTMXLayer* cobj = nullptr; + cocos2d::experimental::TMXLayer* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 @@ -89,12 +20,12 @@ static int lua_cocos2dx_experimental_FastTMXLayer_getTileGIDAt(lua_State* tolua_ if (!tolua_isusertype(tolua_S,1,"ccexp.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::experimental::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + cobj = (cocos2d::experimental::TMXLayer*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_FastTMXLayer_getTileGIDAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_TMXLayer_getTileGIDAt'", nullptr); return 0; } #endif @@ -133,19 +64,19 @@ static int lua_cocos2dx_experimental_FastTMXLayer_getTileGIDAt(lua_State* tolua_ #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_FastTMXLayer_getTileGIDAt'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_TMXLayer_getTileGIDAt'.",&tolua_err); #endif return 0; } -static void extendFastTMXLayer(lua_State* tolua_S) +static void extendExperimentalTMXLayer(lua_State* tolua_S) { - lua_pushstring(tolua_S, "ccexp.FastTMXLayer"); + lua_pushstring(tolua_S, "ccexp.TMXLayer"); lua_rawget(tolua_S, LUA_REGISTRYINDEX); if (lua_istable(tolua_S,-1)) { - tolua_function(tolua_S, "getTileGIDAt", lua_cocos2dx_experimental_FastTMXLayer_getTileGIDAt); + tolua_function(tolua_S, "getTileGIDAt", lua_cocos2dx_experimental_TMXLayer_getTileGIDAt); } lua_pop(tolua_S, 1); } @@ -155,10 +86,8 @@ int register_all_cocos2dx_experimental_manual(lua_State* L) if (nullptr == L) return 0; - extendVideoPlayer(L); - extendFastTMXLayer(L); + extendExperimentalTMXLayer(L); return 0; } -#endif diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.hpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.hpp index 4c8ee4d81a..a80dddc6e3 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.hpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_manual.hpp @@ -22,7 +22,6 @@ THE SOFTWARE. ****************************************************************************/ #include "base/ccConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_MANUAL_H #define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_MANUAL_H @@ -38,4 +37,3 @@ extern "C" { TOLUA_API int register_all_cocos2dx_experimental_manual(lua_State* L); #endif //#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_MANUAL_H -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp new file mode 100644 index 0000000000..9b144fa828 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp @@ -0,0 +1,87 @@ +#include "lua_cocos2dx_experimental_video_manual.hpp" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#include "UIVideoPlayer.h" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" +#include "CCLuaValue.h" +#include "CCLuaEngine.h" + + + +static int lua_cocos2dx_experimental_video_VideoPlayer_addEventListener(lua_State* L) +{ + + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", nullptr); + return 0; + } +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + self->addEventListener([=](cocos2d::Ref* ref, cocos2d::experimental::ui::VideoPlayer::EventType eventType){ + LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); + + stack->pushObject(ref, "cc.Ref"); + stack->pushInt((int)eventType); + + stack->executeFunctionByHandler(handler, 2); + }); + + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "addEventListener",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(L, "#ferror in function 'lua_cocos2dx_experimental_VideoPlayer_addEventListener'.", &tolua_err); +#endif + return 0; +} + +static void extendVideoPlayer(lua_State* L) +{ + lua_pushstring(L, "ccexp.VideoPlayer"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListener", lua_cocos2dx_experimental_video_VideoPlayer_addEventListener); + } + lua_pop(L, 1); +} + +int register_all_cocos2dx_experimental_video_manual(lua_State* L) +{ + if (nullptr == L) + return 0; + + extendVideoPlayer(L); + + return 0; +} + +#endif diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp new file mode 100644 index 0000000000..6201540e59 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp @@ -0,0 +1,41 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#include "base/ccConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H +#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +TOLUA_API int register_all_cocos2dx_experimental_video_manual(lua_State* L); + +#endif //#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index 9ef6f4a20a..80163c3135 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -21,12 +21,16 @@ 1540AF5A193EC30500717D8E /* xxtea.h in Headers */ = {isa = PBXBuildFile; fileRef = 1540AF56193EC30500717D8E /* xxtea.h */; }; 15622969197780DE009C9067 /* lua_cocos2dx_experimental_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15622967197780DE009C9067 /* lua_cocos2dx_experimental_auto.cpp */; }; 1562296A197780DE009C9067 /* lua_cocos2dx_experimental_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15622968197780DE009C9067 /* lua_cocos2dx_experimental_auto.hpp */; }; - 1562296D19778153009C9067 /* lua_cocos2dx_controller_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1562296B19778153009C9067 /* lua_cocos2dx_controller_auto.cpp */; }; - 1562296E19778153009C9067 /* lua_cocos2dx_controller_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1562296C19778153009C9067 /* lua_cocos2dx_controller_auto.hpp */; }; - 1562297319778209009C9067 /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1562296F19778209009C9067 /* lua_cocos2dx_controller_manual.cpp */; }; - 1562297419778209009C9067 /* lua_cocos2dx_controller_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1562297019778209009C9067 /* lua_cocos2dx_controller_manual.hpp */; }; 1562297519778209009C9067 /* lua_cocos2dx_experimental_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1562297119778209009C9067 /* lua_cocos2dx_experimental_manual.cpp */; }; 1562297619778209009C9067 /* lua_cocos2dx_experimental_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1562297219778209009C9067 /* lua_cocos2dx_experimental_manual.hpp */; }; + 156EADF31977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 156EADF11977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.cpp */; }; + 156EADF41977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 156EADF21977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.hpp */; }; + 156EADF51977A2BF00F53709 /* lua_cocos2dx_experimental_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15622967197780DE009C9067 /* lua_cocos2dx_experimental_auto.cpp */; }; + 156EADF61977A2C200F53709 /* lua_cocos2dx_experimental_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15622968197780DE009C9067 /* lua_cocos2dx_experimental_auto.hpp */; }; + 156EADF91977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 156EADF71977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.cpp */; }; + 156EADFA1977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 156EADF81977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.hpp */; }; + 156EADFB1977A3A300F53709 /* lua_cocos2dx_experimental_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1562297119778209009C9067 /* lua_cocos2dx_experimental_manual.cpp */; }; + 156EADFC1977A3A500F53709 /* lua_cocos2dx_experimental_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1562297219778209009C9067 /* lua_cocos2dx_experimental_manual.hpp */; }; 1A262AB818BEEF5900D2DB92 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; }; 1A262AB918BEEF5900D2DB92 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; }; 1AACE7B518BC45C200215002 /* lua_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74918BC45C200215002 /* lua_cocos2dx_auto.cpp */; }; @@ -231,12 +235,12 @@ 1540AF56193EC30500717D8E /* xxtea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xxtea.h; sourceTree = ""; }; 15622967197780DE009C9067 /* lua_cocos2dx_experimental_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_auto.cpp; sourceTree = ""; }; 15622968197780DE009C9067 /* lua_cocos2dx_experimental_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_auto.hpp; sourceTree = ""; }; - 1562296B19778153009C9067 /* lua_cocos2dx_controller_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_controller_auto.cpp; sourceTree = ""; }; - 1562296C19778153009C9067 /* lua_cocos2dx_controller_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_controller_auto.hpp; sourceTree = ""; }; - 1562296F19778209009C9067 /* lua_cocos2dx_controller_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_controller_manual.cpp; sourceTree = ""; }; - 1562297019778209009C9067 /* lua_cocos2dx_controller_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_controller_manual.hpp; sourceTree = ""; }; 1562297119778209009C9067 /* lua_cocos2dx_experimental_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_manual.cpp; sourceTree = ""; }; 1562297219778209009C9067 /* lua_cocos2dx_experimental_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_manual.hpp; sourceTree = ""; }; + 156EADF11977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_auto.cpp; sourceTree = ""; }; + 156EADF21977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_auto.hpp; sourceTree = ""; }; + 156EADF71977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_manual.cpp; sourceTree = ""; }; + 156EADF81977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_manual.hpp; sourceTree = ""; }; 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tolua_fix.cpp; sourceTree = ""; }; 1AACE74618BC45A000215002 /* libluabindings Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluabindings Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1AACE74718BC45A000215002 /* libluabindings iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluabindings iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -385,8 +389,8 @@ 1AACE74818BC45C200215002 /* auto */ = { isa = PBXGroup; children = ( - 1562296B19778153009C9067 /* lua_cocos2dx_controller_auto.cpp */, - 1562296C19778153009C9067 /* lua_cocos2dx_controller_auto.hpp */, + 156EADF11977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.cpp */, + 156EADF21977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.hpp */, 15622967197780DE009C9067 /* lua_cocos2dx_experimental_auto.cpp */, 15622968197780DE009C9067 /* lua_cocos2dx_experimental_auto.hpp */, 2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */, @@ -409,8 +413,8 @@ 1AACE75B18BC45C200215002 /* manual */ = { isa = PBXGroup; children = ( - 1562296F19778209009C9067 /* lua_cocos2dx_controller_manual.cpp */, - 1562297019778209009C9067 /* lua_cocos2dx_controller_manual.hpp */, + 156EADF71977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.cpp */, + 156EADF81977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.hpp */, 1562297119778209009C9067 /* lua_cocos2dx_experimental_manual.cpp */, 1562297219778209009C9067 /* lua_cocos2dx_experimental_manual.hpp */, 2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */, @@ -619,9 +623,9 @@ 1AACE83218BC45C200215002 /* CCLuaObjcBridge.h in Headers */, 1562297619778209009C9067 /* lua_cocos2dx_experimental_manual.hpp in Headers */, 1AACE82418BC45C200215002 /* LuaScriptHandlerMgr.h in Headers */, - 1562297419778209009C9067 /* lua_cocos2dx_controller_manual.hpp in Headers */, 1AACE7FC18BC45C200215002 /* lua_cocos2dx_extension_manual.h in Headers */, 2905FAD318CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp in Headers */, + 156EADF41977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.hpp in Headers */, 1AACE7EC18BC45C200215002 /* CCLuaValue.h in Headers */, 2905FAD918CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp in Headers */, 1AACE80C18BC45C200215002 /* lua_cocos2dx_spine_manual.hpp in Headers */, @@ -640,9 +644,9 @@ 1AACE7F818BC45C200215002 /* lua_cocos2dx_deprecated.h in Headers */, 1ABCA24C18CD8F7D0087CE3A /* mime.h in Headers */, 1ABCA1ED18CD8F470087CE3A /* lua.h in Headers */, - 1562296E19778153009C9067 /* lua_cocos2dx_controller_auto.hpp in Headers */, 1AACE7F418BC45C200215002 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */, 1ABCA26818CD8F7D0087CE3A /* udp.h in Headers */, + 156EADFA1977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.hpp in Headers */, 1ABCA25418CD8F7D0087CE3A /* select.h in Headers */, 1AACE7D618BC45C200215002 /* lua_cocos2dx_studio_auto.hpp in Headers */, ); @@ -671,6 +675,8 @@ 1AACE7CF18BC45C200215002 /* lua_cocos2dx_spine_auto.hpp in Headers */, 1ABCA1EA18CD8F470087CE3A /* lauxlib.h in Headers */, 1AACE80F18BC45C200215002 /* lua_extensions.h in Headers */, + 156EADF61977A2C200F53709 /* lua_cocos2dx_experimental_auto.hpp in Headers */, + 156EADFC1977A3A500F53709 /* lua_cocos2dx_experimental_manual.hpp in Headers */, 1AACE81F18BC45C200215002 /* LuaOpengl.h in Headers */, 1503FAA318DA8A1C00F6518C /* buffer.h in Headers */, 1ABCA25F18CD8F7D0087CE3A /* tcp.h in Headers */, @@ -780,7 +786,6 @@ 15622969197780DE009C9067 /* lua_cocos2dx_experimental_auto.cpp in Sources */, 1ABCA20518CD8F6E0087CE3A /* tolua_is.c in Sources */, 1AACE7F618BC45C200215002 /* lua_cocos2dx_deprecated.cpp in Sources */, - 1562296D19778153009C9067 /* lua_cocos2dx_controller_auto.cpp in Sources */, 1ABCA24E18CD8F7D0087CE3A /* options.c in Sources */, 1A262AB918BEEF5900D2DB92 /* tolua_fix.cpp in Sources */, 1AACE81E18BC45C200215002 /* LuaOpengl.cpp in Sources */, @@ -811,10 +816,10 @@ 1AACE81A18BC45C200215002 /* LuaBasicConversions.cpp in Sources */, 1AACE7EE18BC45C200215002 /* Cocos2dxLuaLoader.cpp in Sources */, 1AACE7DA18BC45C200215002 /* CCBProxy.cpp in Sources */, + 156EADF91977A39F00F53709 /* lua_cocos2dx_experimental_video_manual.cpp in Sources */, 1AACE81618BC45C200215002 /* lua_xml_http_request.cpp in Sources */, 1ABCA23A18CD8F7D0087CE3A /* inet.c in Sources */, 2905FAD118CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp in Sources */, - 1562297319778209009C9067 /* lua_cocos2dx_controller_manual.cpp in Sources */, 1AACE7E218BC45C200215002 /* CCLuaEngine.cpp in Sources */, 1ABCA26E18CD8F7D0087CE3A /* usocket.c in Sources */, 1AACE81218BC45C200215002 /* Lua_web_socket.cpp in Sources */, @@ -822,6 +827,7 @@ 1AACE7DE18BC45C200215002 /* CCLuaBridge.cpp in Sources */, 1ABCA23218CD8F7D0087CE3A /* auxiliar.c in Sources */, 1ABCA20118CD8F6E0087CE3A /* tolua_event.c in Sources */, + 156EADF31977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */, C0FEF4D718BE0E70001F446C /* lua_debugger.c in Sources */, 1AACE7E618BC45C200215002 /* CCLuaStack.cpp in Sources */, 1AACE80618BC45C200215002 /* lua_cocos2dx_physics_manual.cpp in Sources */, @@ -860,6 +866,7 @@ 1503FAA118DA8A1C00F6518C /* buffer.c in Sources */, 1AACE80D18BC45C200215002 /* lua_extensions.c in Sources */, 1AACE7E918BC45C200215002 /* CCLuaValue.cpp in Sources */, + 156EADF51977A2BF00F53709 /* lua_cocos2dx_experimental_auto.cpp in Sources */, 1AACE7D318BC45C200215002 /* lua_cocos2dx_studio_auto.cpp in Sources */, 1AACE7BB18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp in Sources */, 1ABCA20818CD8F6E0087CE3A /* tolua_push.c in Sources */, @@ -876,6 +883,7 @@ 1ABCA26D18CD8F7D0087CE3A /* usocket.c in Sources */, 1AACE81118BC45C200215002 /* Lua_web_socket.cpp in Sources */, 1AACE7F918BC45C200215002 /* lua_cocos2dx_extension_manual.cpp in Sources */, + 156EADFB1977A3A300F53709 /* lua_cocos2dx_experimental_manual.cpp in Sources */, 1AACE7DD18BC45C200215002 /* CCLuaBridge.cpp in Sources */, 1ABCA23118CD8F7D0087CE3A /* auxiliar.c in Sources */, 1ABCA20018CD8F6E0087CE3A /* tolua_event.c in Sources */, diff --git a/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj b/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj index 4ebf5661d4..8afd7fae0a 100644 --- a/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj @@ -31,6 +31,7 @@ + @@ -48,6 +49,7 @@ + @@ -82,6 +84,7 @@ + @@ -99,6 +102,7 @@ + diff --git a/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj.filters b/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj.filters index af8cd09e62..17e309c94c 100644 --- a/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj.filters +++ b/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj.filters @@ -165,6 +165,12 @@ xxtea + + manual + + + auto + @@ -314,6 +320,12 @@ xxtea + + manual + + + auto + diff --git a/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua b/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua index 85ac7bbb51..87c001f3e7 100644 --- a/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua +++ b/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua @@ -144,7 +144,7 @@ local function TMXOrthoTest() --local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) --addChild(color, -1) - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test2.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test2.tmx") layer:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -178,7 +178,7 @@ end local function TMXOrthoTest2() local layer = createTileDemoLayer("TMX Ortho test2") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test1.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test1.tmx") layer:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -195,7 +195,7 @@ end -------------------------------------------------------------------- local function TMXOrthoTest3() local layer = createTileDemoLayer("TMX anchorPoint test") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test3.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test3.tmx") layer:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -214,7 +214,7 @@ end -------------------------------------------------------------------- local function TMXOrthoTest4() local ret = createTileDemoLayer("TMX width/height test") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test4.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test4.tmx") ret:addChild(map, 0, kTagTileMap) local s1 = map:getContentSize() @@ -277,7 +277,7 @@ local function TMXReadWriteTest() local ret = createTileDemoLayer("TMX Read/Write test") local m_gid = 0 local m_gid2 = 0 - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test2.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test2.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -437,7 +437,7 @@ local function TMXIsoTest() local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) ret:addChild(color, -1) - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test.tmx") ret:addChild(map, 0, kTagTileMap) -- move map to the center of the screen @@ -457,7 +457,7 @@ local function TMXIsoTest1() local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) ret:addChild(color, -1) - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test1.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test1.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -477,7 +477,7 @@ local function TMXIsoTest2() local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) ret:addChild(color, -1) - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test2.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test2.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -500,7 +500,7 @@ local function TMXUncompressedTest() local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) ret:addChild(color, -1) - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test2-uncompressed.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test2-uncompressed.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -521,7 +521,7 @@ end -------------------------------------------------------------------- local function TMXTilesetTest() local ret = createTileDemoLayer("TMX Tileset test") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test5.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test5.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -537,7 +537,7 @@ end -------------------------------------------------------------------- local function TMXOrthoObjectsTest() local ret = createTileDemoLayer("TMX Ortho object test", "You should see a white box around the 3 platforms") - local map = ccexp.FastTMXTiledMap:create("TileMaps/ortho-objects.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/ortho-objects.tmx") ret:addChild(map, -1, kTagTileMap) local s = map:getContentSize() @@ -610,7 +610,7 @@ end local function TMXIsoObjectsTest() local ret = createTileDemoLayer("TMX Iso object test", "You need to parse them manually. See bug #810") - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test-objectgroup.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test-objectgroup.tmx") ret:addChild(map, -1, kTagTileMap) local s = map:getContentSize() @@ -679,7 +679,7 @@ end local function TMXResizeTest() local ret = createTileDemoLayer("TMX resize test", "Should not crash. Testing issue #740") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test5.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test5.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -705,7 +705,7 @@ end local function TMXIsoZorder() local m_tamara = nil local ret = createTileDemoLayer("TMX Iso Zorder", "Sprite should hide behind the trees") - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test-zorder.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test-zorder.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -765,7 +765,7 @@ end local function TMXOrthoZorder() local m_tamara = nil local ret = createTileDemoLayer("TMX Ortho Zorder", "Sprite should hide behind the trees") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test-zorder.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test-zorder.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -823,7 +823,7 @@ end local function TMXIsoVertexZ() local m_tamara = nil local ret = createTileDemoLayer("TMX Iso VertexZ", "Sprite should hide behind the trees") - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test-vertexz.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test-vertexz.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -878,7 +878,7 @@ end local function TMXOrthoVertexZ() local m_tamara = nil local ret = createTileDemoLayer("TMX Ortho vertexZ", "Sprite should hide behind the trees") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test-vertexz.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test-vertexz.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -932,7 +932,7 @@ end -------------------------------------------------------------------- local function TMXIsoMoveLayer() local ret = createTileDemoLayer("TMX Iso Move Layer", "Trees should be horizontally aligned") - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test-movelayer.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test-movelayer.tmx") ret:addChild(map, 0, kTagTileMap) map:setPosition(cc.p(-700,-50)) @@ -950,7 +950,7 @@ end -------------------------------------------------------------------- local function TMXOrthoMoveLayer() local ret = createTileDemoLayer("TMX Ortho Move Layer", "Trees should be horizontally aligned") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test-movelayer.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test-movelayer.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -983,7 +983,7 @@ end local function TMXOrthoFlipTest() local ret = createTileDemoLayer("TMX tile flip test") - local map = ccexp.FastTMXTiledMap:create("TileMaps/ortho-rotation-test.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/ortho-rotation-test.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -1002,7 +1002,7 @@ end local function TMXOrthoFlipRunTimeTest() local ret = createTileDemoLayer("TMX tile flip run time test", "in 2 sec bottom left tiles will flip") - local map = ccexp.FastTMXTiledMap:create("TileMaps/ortho-rotation-test.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/ortho-rotation-test.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -1076,7 +1076,7 @@ local function TMXOrthoFromXMLTest() cclog("Unable to open file") end - local map = ccexp.FastTMXTiledMap:createWithXML(str ,resources) + local map = ccexp.TMXTiledMap:createWithXML(str ,resources) ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -1096,7 +1096,7 @@ end local function TMXOrthoXMLFormatTest() local ret = createTileDemoLayer("you should see blue, green and yellow in console.") - local map = ccexp.FastTMXTiledMap:create("TileMaps/xml-test.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/xml-test.tmx") ret:addChild(map, 0, kTagTileMap) local s = map:getContentSize() @@ -1118,7 +1118,7 @@ end -------------------------------------------------------------------- local function TMXBug987() local ret = createTileDemoLayer("TMX Bug 987", "You should see an square") - local map = ccexp.FastTMXTiledMap:create("TileMaps/orthogonal-test6.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/orthogonal-test6.tmx") ret:addChild(map, 0, kTagTileMap) local s1 = map:getContentSize() @@ -1137,7 +1137,7 @@ end -------------------------------------------------------------------- local function TMXBug787() local ret = createTileDemoLayer("TMX Bug 787", "You should see a map") - local map = ccexp.FastTMXTiledMap:create("TileMaps/iso-test-bug787.tmx") + local map = ccexp.TMXTiledMap:create("TileMaps/iso-test-bug787.tmx") ret:addChild(map, 0, kTagTileMap) map:setScale(0.25) return ret diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 90da034f9c..5a81a03b9a 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -131,9 +131,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS Animation3D::[getBoneCurveByName], Animation3DCache::[*], Sprite3DMaterialCache::[*], - Bone3D::[*], - FastTMXLayer::[*], - FastTMXTiledMap::[*] + Bone3D::[*] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], diff --git a/tools/tolua/cocos2dx_experimental.ini b/tools/tolua/cocos2dx_experimental.ini index d259b76f9e..97d890abf1 100644 --- a/tools/tolua/cocos2dx_experimental.ini +++ b/tools/tolua/cocos2dx_experimental.ini @@ -7,8 +7,6 @@ prefix = cocos2dx_experimental # all classes will be embedded in that namespace target_namespace = ccexp -macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include android_flags = -D_SIZE_T_DEFINED_ @@ -25,11 +23,11 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/ui/UIVideoPlayer.h %(cocosdir)s/cocos/2d/CCFastTMXLayer.h %(cocosdir)s/cocos/2d/CCFastTMXTiledMap.h +headers = %(cocosdir)s/cocos/2d/CCFastTMXLayer.h %(cocosdir)s/cocos/2d/CCFastTMXTiledMap.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = VideoPlayer FastTMXLayer FastTMXTiledMap +classes = TMXLayer TMXTiledMap # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -38,8 +36,7 @@ classes = VideoPlayer FastTMXLayer FastTMXTiledMap # will apply to all class names. This is a convenience wildcard to be able to skip similar named # functions from all classes. -skip = VideoPlayer::[addEventListener], - FastTMXLayer::[(g|s)etTiles getTileGIDAt] +skip = TMXLayer::[(g|s)etTiles getTileGIDAt] rename_functions = diff --git a/tools/tolua/cocos2dx_experimental_video.ini b/tools/tolua/cocos2dx_experimental_video.ini new file mode 100644 index 0000000000..e0c343b56e --- /dev/null +++ b/tools/tolua/cocos2dx_experimental_video.ini @@ -0,0 +1,62 @@ +[cocos2dx_experimental_video] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_experimental_video + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = ccexp + +macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include +android_flags = -D_SIZE_T_DEFINED_ + +clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include +clang_flags = -nostdinc -x c++ -std=c++11 + +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s/cocos/platform/android + +cocos_flags = -DANDROID + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/ui/UIVideoPlayer.h + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". +classes = VideoPlayer FastTMXLayer FastTMXTiledMap + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = VideoPlayer::[addEventListener] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + diff --git a/tools/tolua/genbindings.py b/tools/tolua/genbindings.py index 53fb722638..72fa4824bd 100755 --- a/tools/tolua/genbindings.py +++ b/tools/tolua/genbindings.py @@ -132,6 +132,7 @@ def main(): 'cocos2dx_studio.ini' : ('cocos2dx_studio', 'lua_cocos2dx_studio_auto'), \ 'cocos2dx_spine.ini' : ('cocos2dx_spine', 'lua_cocos2dx_spine_auto'), \ 'cocos2dx_physics.ini' : ('cocos2dx_physics', 'lua_cocos2dx_physics_auto'), \ + 'cocos2dx_experimental_video.ini' : ('cocos2dx_experimental_video', 'lua_cocos2dx_experimental_video_auto'), \ 'cocos2dx_experimental.ini' : ('cocos2dx_experimental', 'lua_cocos2dx_experimental_auto'), \ 'cocos2dx_controller.ini' : ('cocos2dx_controller', 'lua_cocos2dx_controller_auto'), \ }