Merge branch 'v3' into v3_addStaggeredTileMap

This commit is contained in:
Huabing.Xu 2014-10-11 15:15:12 +08:00
commit 7747e2ecf5
95 changed files with 3989 additions and 1476 deletions

View File

@ -812,6 +812,7 @@ Developers:
Added getAllTouches() in GLViewProtocol Added getAllTouches() in GLViewProtocol
Precompiled headers improvements Precompiled headers improvements
Added Application::openUrl for all supported platforms ecept WP8 and WinRT Added Application::openUrl for all supported platforms ecept WP8 and WinRT
Scale9Sprite capInsets set fix
youknowone youknowone
Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView

View File

@ -16,9 +16,12 @@ cocos2d-x-3.3-beta1
[FIX] Cocos Studio reader: UI animation playing crash if GUI JSON file is loaded again [FIX] Cocos Studio reader: UI animation playing crash if GUI JSON file is loaded again
[FIX] Cocos Studio reader: improvement ImageViewReader don't necessary loadTexture when imageFilePath is empty [FIX] Cocos Studio reader: improvement ImageViewReader don't necessary loadTexture when imageFilePath is empty
[FIX] EditBox: view rendereed in wrong position if click EditBox on iOS 8 [FIX] EditBox: view rendereed in wrong position if click EditBox on iOS 8
[FIX] FileUtils: can not remove files/directory on iOS devices
[FIX] GLProgram: crashed on some Android devices that do not support more than 8 attributes
[FIX] Label: getStringNumLines() may returns wrong result if label is dirty [FIX] Label: getStringNumLines() may returns wrong result if label is dirty
[FIX] Label: can not change opacity if using FNT font [FIX] Label: can not change opacity if using FNT font
[FIX] Label: endless loop if not using system font, and constrained length is less than one character width [FIX] Label: endless loop if not using system font, and constrained length is less than one character width
[FIX] LabelAtlas: opacity do not change when setting parent's opacity
[FIX] Lua-bindings: may crash if passing two-dimensional table from lua to c++ [FIX] Lua-bindings: may crash if passing two-dimensional table from lua to c++
[FIX] New audio: can not play audio after playing some times on Android [FIX] New audio: can not play audio after playing some times on Android
[FIX] Node: macro scheduler_selector() superseded by CC_SCHEDULER_SELECTOR(). The same is true for the other schedule_ macros [FIX] Node: macro scheduler_selector() superseded by CC_SCHEDULER_SELECTOR(). The same is true for the other schedule_ macros
@ -26,6 +29,8 @@ cocos2d-x-3.3-beta1
[FIX] Node: crashed if remove/add child too quickly when using integrated physics [FIX] Node: crashed if remove/add child too quickly when using integrated physics
[FIX] TextFieldTTF: will get wrong characters if using Chinese input method on WP8 [FIX] TextFieldTTF: will get wrong characters if using Chinese input method on WP8
[FIX] UI: Button: button remains gray when releasing it, this issue only happened if enable scale9 and only has one texture [FIX] UI: Button: button remains gray when releasing it, this issue only happened if enable scale9 and only has one texture
[FIX] UI: Button: when creating a button with a title only, button content size is not immediately updated
[FIX] UI: EditBox: setMaxLength is invalid on mac
cocos2d-x-3.3-beta0 Sep.20 2014 cocos2d-x-3.3-beta0 Sep.20 2014
[NEW] 3d: added `BillBoard` [NEW] 3d: added `BillBoard`

View File

@ -162,7 +162,7 @@ def copy_resources(target, app_android_root):
copy_files(os.path.join(common_script_dir, "cocos2d"), assets_dir) copy_files(os.path.join(common_script_dir, "cocos2d"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocosbuilder"), assets_dir) copy_files(os.path.join(common_script_dir, "cocosbuilder"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocosdenshion"), assets_dir) copy_files(os.path.join(common_script_dir, "cocosdenshion"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocostudio"), assets_dir) copy_files(os.path.join(common_script_dir, "cocosstudio"), assets_dir)
copy_files(os.path.join(common_script_dir, "extension"), assets_dir) copy_files(os.path.join(common_script_dir, "extension"), assets_dir)
copy_files(os.path.join(common_script_dir, "network"), assets_dir) copy_files(os.path.join(common_script_dir, "network"), assets_dir)
copy_files(os.path.join(common_script_dir, "ui"), assets_dir) copy_files(os.path.join(common_script_dir, "ui"), assets_dir)

View File

@ -1813,6 +1813,10 @@
B60C5BD519AC68B10056FBDE /* CCBillBoard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B60C5BD219AC68B10056FBDE /* CCBillBoard.cpp */; }; B60C5BD519AC68B10056FBDE /* CCBillBoard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B60C5BD219AC68B10056FBDE /* CCBillBoard.cpp */; };
B60C5BD619AC68B10056FBDE /* CCBillBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = B60C5BD319AC68B10056FBDE /* CCBillBoard.h */; }; B60C5BD619AC68B10056FBDE /* CCBillBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = B60C5BD319AC68B10056FBDE /* CCBillBoard.h */; };
B60C5BD719AC68B10056FBDE /* CCBillBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = B60C5BD319AC68B10056FBDE /* CCBillBoard.h */; }; B60C5BD719AC68B10056FBDE /* CCBillBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = B60C5BD319AC68B10056FBDE /* CCBillBoard.h */; };
DA8C62A219E52C6400000516 /* ioapi_mem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA8C62A019E52C6400000516 /* ioapi_mem.cpp */; };
DA8C62A319E52C6400000516 /* ioapi_mem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA8C62A019E52C6400000516 /* ioapi_mem.cpp */; };
DA8C62A419E52C6400000516 /* ioapi_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8C62A119E52C6400000516 /* ioapi_mem.h */; };
DA8C62A519E52C6400000516 /* ioapi_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8C62A119E52C6400000516 /* ioapi_mem.h */; };
ED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */; }; ED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */; };
ED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */; }; ED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */; };
ED9C6A9618599AD8000A5232 /* CCNodeGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = ED9C6A9318599AD8000A5232 /* CCNodeGrid.h */; }; ED9C6A9618599AD8000A5232 /* CCNodeGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = ED9C6A9318599AD8000A5232 /* CCNodeGrid.h */; };
@ -2802,6 +2806,8 @@
B67C624319D4186F00F11FC6 /* ccShader_3D_ColorNormal.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorNormal.frag; sourceTree = "<group>"; }; B67C624319D4186F00F11FC6 /* ccShader_3D_ColorNormal.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorNormal.frag; sourceTree = "<group>"; };
B67C624419D4186F00F11FC6 /* ccShader_3D_ColorNormalTex.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorNormalTex.frag; sourceTree = "<group>"; }; B67C624419D4186F00F11FC6 /* ccShader_3D_ColorNormalTex.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorNormalTex.frag; sourceTree = "<group>"; };
B67C624519D4186F00F11FC6 /* ccShader_3D_PositionNormalTex.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_PositionNormalTex.vert; sourceTree = "<group>"; }; B67C624519D4186F00F11FC6 /* ccShader_3D_PositionNormalTex.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_PositionNormalTex.vert; sourceTree = "<group>"; };
DA8C62A019E52C6400000516 /* ioapi_mem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ioapi_mem.cpp; sourceTree = "<group>"; };
DA8C62A119E52C6400000516 /* ioapi_mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi_mem.h; sourceTree = "<group>"; };
ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCNodeGrid.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCNodeGrid.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
ED9C6A9318599AD8000A5232 /* CCNodeGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeGrid.h; sourceTree = "<group>"; }; ED9C6A9318599AD8000A5232 /* CCNodeGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeGrid.h; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -3350,6 +3356,8 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1A570350180BD0B00088DEC7 /* ioapi.cpp */, 1A570350180BD0B00088DEC7 /* ioapi.cpp */,
DA8C62A019E52C6400000516 /* ioapi_mem.cpp */,
DA8C62A119E52C6400000516 /* ioapi_mem.h */,
1A570351180BD0B00088DEC7 /* ioapi.h */, 1A570351180BD0B00088DEC7 /* ioapi.h */,
1A570352180BD0B00088DEC7 /* unzip.cpp */, 1A570352180BD0B00088DEC7 /* unzip.cpp */,
1A570353180BD0B00088DEC7 /* unzip.h */, 1A570353180BD0B00088DEC7 /* unzip.h */,
@ -4936,6 +4944,7 @@
50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */, 50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */,
15AE19D319AAD3A700C27E9E /* Bone.h in Headers */, 15AE19D319AAD3A700C27E9E /* Bone.h in Headers */,
1A57019F180BCB590088DEC7 /* CCFont.h in Headers */, 1A57019F180BCB590088DEC7 /* CCFont.h in Headers */,
DA8C62A419E52C6400000516 /* ioapi_mem.h in Headers */,
1A5701A3180BCB590088DEC7 /* CCFontAtlas.h in Headers */, 1A5701A3180BCB590088DEC7 /* CCFontAtlas.h in Headers */,
15AE18E919AAD35000C27E9E /* CCActionManagerEx.h in Headers */, 15AE18E919AAD35000C27E9E /* CCActionManagerEx.h in Headers */,
1A01C68618F57BE800EFE3A6 /* CCArray.h in Headers */, 1A01C68618F57BE800EFE3A6 /* CCArray.h in Headers */,
@ -5395,6 +5404,7 @@
15AE1B9619AADA9A00C27E9E /* CocosGUI.h in Headers */, 15AE1B9619AADA9A00C27E9E /* CocosGUI.h in Headers */,
1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */, 1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */,
1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, 1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */,
DA8C62A519E52C6400000516 /* ioapi_mem.h in Headers */,
1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */, 1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */,
1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */, 1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */,
15AE184919AAD2F700C27E9E /* cocos3d.h in Headers */, 15AE184919AAD2F700C27E9E /* cocos3d.h in Headers */,
@ -5907,6 +5917,7 @@
15AE18A219AAD33D00C27E9E /* CCParticleSystemQuadLoader.cpp in Sources */, 15AE18A219AAD33D00C27E9E /* CCParticleSystemQuadLoader.cpp in Sources */,
15AE188C19AAD33D00C27E9E /* CCLabelBMFontLoader.cpp in Sources */, 15AE188C19AAD33D00C27E9E /* CCLabelBMFontLoader.cpp in Sources */,
15AE19E619AAD3A700C27E9E /* Skin.cpp in Sources */, 15AE19E619AAD3A700C27E9E /* Skin.cpp in Sources */,
DA8C62A219E52C6400000516 /* ioapi_mem.cpp in Sources */,
1A570069180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */, 1A570069180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */,
B257B44E1989D5E800D9A687 /* CCPrimitive.cpp in Sources */, B257B44E1989D5E800D9A687 /* CCPrimitive.cpp in Sources */,
299CF1FB19A434BC00C378C1 /* ccRandom.cpp in Sources */, 299CF1FB19A434BC00C378C1 /* ccRandom.cpp in Sources */,
@ -6426,6 +6437,7 @@
3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */, 3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */,
50ABC00E1926664800A911A9 /* CCFileUtils.cpp in Sources */, 50ABC00E1926664800A911A9 /* CCFileUtils.cpp in Sources */,
299CF1FC19A434BC00C378C1 /* ccRandom.cpp in Sources */, 299CF1FC19A434BC00C378C1 /* ccRandom.cpp in Sources */,
DA8C62A319E52C6400000516 /* ioapi_mem.cpp in Sources */,
15AE18C919AAD33D00C27E9E /* CCMenuItemLoader.cpp in Sources */, 15AE18C919AAD33D00C27E9E /* CCMenuItemLoader.cpp in Sources */,
50ABBE241925AB6F00A911A9 /* base64.cpp in Sources */, 50ABBE241925AB6F00A911A9 /* base64.cpp in Sources */,
1A5701A6180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */, 1A5701A6180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */,

View File

@ -58,6 +58,8 @@
1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; }; 1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; };
1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
150F918819DA409E00B89F57 /* lua_test_bindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 150F918619DA409E00B89F57 /* lua_test_bindings.cpp */; };
150F918919DA409F00B89F57 /* lua_test_bindings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 150F918619DA409E00B89F57 /* lua_test_bindings.cpp */; };
15427B79198B879900DC375D /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA665198B33EE000C57D3 /* libluacocos2d iOS.a */; }; 15427B79198B879900DC375D /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA665198B33EE000C57D3 /* libluacocos2d iOS.a */; };
15427B7A198B87AA00DC375D /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; 15427B7A198B87AA00DC375D /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; };
15427B7D198B880100DC375D /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */; }; 15427B7D198B880100DC375D /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */; };
@ -197,14 +199,6 @@
15D1FD3E199863CA00302043 /* DeprecatedCocosDenshionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD39199863CA00302043 /* DeprecatedCocosDenshionClass.lua */; }; 15D1FD3E199863CA00302043 /* DeprecatedCocosDenshionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD39199863CA00302043 /* DeprecatedCocosDenshionClass.lua */; };
15D1FD3F199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */; }; 15D1FD3F199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */; };
15D1FD40199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */; }; 15D1FD40199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */; };
15D1FD45199863E800302043 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD41199863E800302043 /* CocoStudio.lua */; };
15D1FD46199863E800302043 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD41199863E800302043 /* CocoStudio.lua */; };
15D1FD47199863E800302043 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD42199863E800302043 /* DeprecatedCocoStudioClass.lua */; };
15D1FD48199863E800302043 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD42199863E800302043 /* DeprecatedCocoStudioClass.lua */; };
15D1FD49199863E800302043 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD43199863E800302043 /* DeprecatedCocoStudioFunc.lua */; };
15D1FD4A199863E800302043 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD43199863E800302043 /* DeprecatedCocoStudioFunc.lua */; };
15D1FD4B199863E800302043 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD44199863E800302043 /* StudioConstants.lua */; };
15D1FD4C199863E800302043 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD44199863E800302043 /* StudioConstants.lua */; };
15D1FD51199863F900302043 /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD4D199863F900302043 /* DeprecatedExtensionClass.lua */; }; 15D1FD51199863F900302043 /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD4D199863F900302043 /* DeprecatedExtensionClass.lua */; };
15D1FD52199863F900302043 /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD4D199863F900302043 /* DeprecatedExtensionClass.lua */; }; 15D1FD52199863F900302043 /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD4D199863F900302043 /* DeprecatedExtensionClass.lua */; };
15D1FD53199863F900302043 /* DeprecatedExtensionEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD4E199863F900302043 /* DeprecatedExtensionEnum.lua */; }; 15D1FD53199863F900302043 /* DeprecatedExtensionEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD4E199863F900302043 /* DeprecatedExtensionEnum.lua */; };
@ -237,6 +231,22 @@
15D1FD761998642800302043 /* experimentalUIConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD6F1998642800302043 /* experimentalUIConstants.lua */; }; 15D1FD761998642800302043 /* experimentalUIConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD6F1998642800302043 /* experimentalUIConstants.lua */; };
15D1FD771998642800302043 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD701998642800302043 /* GuiConstants.lua */; }; 15D1FD771998642800302043 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD701998642800302043 /* GuiConstants.lua */; };
15D1FD781998642800302043 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD701998642800302043 /* GuiConstants.lua */; }; 15D1FD781998642800302043 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FD701998642800302043 /* GuiConstants.lua */; };
15D7638219E8FC980069EAE8 /* CocosStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637E19E8FC980069EAE8 /* CocosStudio.lua */; };
15D7638319E8FC980069EAE8 /* CocosStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637E19E8FC980069EAE8 /* CocosStudio.lua */; };
15D7638419E8FC980069EAE8 /* CocosStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637E19E8FC980069EAE8 /* CocosStudio.lua */; };
15D7638519E8FC980069EAE8 /* CocosStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637E19E8FC980069EAE8 /* CocosStudio.lua */; };
15D7638619E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637F19E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua */; };
15D7638719E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637F19E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua */; };
15D7638819E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637F19E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua */; };
15D7638919E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7637F19E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua */; };
15D7638A19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638019E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua */; };
15D7638B19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638019E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua */; };
15D7638C19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638019E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua */; };
15D7638D19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638019E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua */; };
15D7638E19E8FC980069EAE8 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638119E8FC980069EAE8 /* StudioConstants.lua */; };
15D7638F19E8FC980069EAE8 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638119E8FC980069EAE8 /* StudioConstants.lua */; };
15D7639019E8FC980069EAE8 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638119E8FC980069EAE8 /* StudioConstants.lua */; };
15D7639119E8FC980069EAE8 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D7638119E8FC980069EAE8 /* StudioConstants.lua */; };
15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; };
15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; };
15EE465B19A7200300AF29F1 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EE465A19A7200300AF29F1 /* libcurl.a */; }; 15EE465B19A7200300AF29F1 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EE465A19A7200300AF29F1 /* libcurl.a */; };
@ -1160,6 +1170,8 @@
1503FAB018DA8B6C00F6518C /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = ../external/lua/luasocket/socket.lua; sourceTree = "<group>"; }; 1503FAB018DA8B6C00F6518C /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = ../external/lua/luasocket/socket.lua; sourceTree = "<group>"; };
1503FAB118DA8B6C00F6518C /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = ../external/lua/luasocket/tp.lua; sourceTree = "<group>"; }; 1503FAB118DA8B6C00F6518C /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = ../external/lua/luasocket/tp.lua; sourceTree = "<group>"; };
1503FAB218DA8B6C00F6518C /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = ../external/lua/luasocket/url.lua; sourceTree = "<group>"; }; 1503FAB218DA8B6C00F6518C /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = ../external/lua/luasocket/url.lua; sourceTree = "<group>"; };
150F918619DA409E00B89F57 /* lua_test_bindings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_test_bindings.cpp; sourceTree = "<group>"; };
150F918719DA409E00B89F57 /* lua_test_bindings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_test_bindings.h; sourceTree = "<group>"; };
15427B76198B750300DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_module_register.h; sourceTree = "<group>"; }; 15427B76198B750300DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_module_register.h; sourceTree = "<group>"; };
15427B77198B843300DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_module_register.h; sourceTree = "<group>"; }; 15427B77198B843300DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_module_register.h; sourceTree = "<group>"; };
15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lua_cocos2dx_controller_manual.cpp; path = "../../../../cocos/scripting/lua-bindings/manual/controller/lua_cocos2dx_controller_manual.cpp"; sourceTree = "<group>"; }; 15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lua_cocos2dx_controller_manual.cpp; path = "../../../../cocos/scripting/lua-bindings/manual/controller/lua_cocos2dx_controller_manual.cpp"; sourceTree = "<group>"; };
@ -2306,10 +2318,6 @@
15D1FD38199863CA00302043 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = "../cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua"; sourceTree = "<group>"; }; 15D1FD38199863CA00302043 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = "../cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua"; sourceTree = "<group>"; };
15D1FD39199863CA00302043 /* DeprecatedCocosDenshionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosDenshionClass.lua; path = "../cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionClass.lua"; sourceTree = "<group>"; }; 15D1FD39199863CA00302043 /* DeprecatedCocosDenshionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosDenshionClass.lua; path = "../cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionClass.lua"; sourceTree = "<group>"; };
15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosDenshionFunc.lua; path = "../cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionFunc.lua"; sourceTree = "<group>"; }; 15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosDenshionFunc.lua; path = "../cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionFunc.lua"; sourceTree = "<group>"; };
15D1FD41199863E800302043 /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = "../cocos/scripting/lua-bindings/script/cocostudio/CocoStudio.lua"; sourceTree = "<group>"; };
15D1FD42199863E800302043 /* DeprecatedCocoStudioClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioClass.lua; path = "../cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua"; sourceTree = "<group>"; };
15D1FD43199863E800302043 /* DeprecatedCocoStudioFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioFunc.lua; path = "../cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua"; sourceTree = "<group>"; };
15D1FD44199863E800302043 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = "../cocos/scripting/lua-bindings/script/cocostudio/StudioConstants.lua"; sourceTree = "<group>"; };
15D1FD4D199863F900302043 /* DeprecatedExtensionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionClass.lua; path = "../cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua"; sourceTree = "<group>"; }; 15D1FD4D199863F900302043 /* DeprecatedExtensionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionClass.lua; path = "../cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua"; sourceTree = "<group>"; };
15D1FD4E199863F900302043 /* DeprecatedExtensionEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionEnum.lua; path = "../cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua"; sourceTree = "<group>"; }; 15D1FD4E199863F900302043 /* DeprecatedExtensionEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionEnum.lua; path = "../cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua"; sourceTree = "<group>"; };
15D1FD4F199863F900302043 /* DeprecatedExtensionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionFunc.lua; path = "../cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua"; sourceTree = "<group>"; }; 15D1FD4F199863F900302043 /* DeprecatedExtensionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionFunc.lua; path = "../cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua"; sourceTree = "<group>"; };
@ -2322,6 +2330,10 @@
15D1FD6E1998642800302043 /* DeprecatedUIFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIFunc.lua; path = "../cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua"; sourceTree = "<group>"; }; 15D1FD6E1998642800302043 /* DeprecatedUIFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIFunc.lua; path = "../cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua"; sourceTree = "<group>"; };
15D1FD6F1998642800302043 /* experimentalUIConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalUIConstants.lua; path = "../cocos/scripting/lua-bindings/script/ui/experimentalUIConstants.lua"; sourceTree = "<group>"; }; 15D1FD6F1998642800302043 /* experimentalUIConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalUIConstants.lua; path = "../cocos/scripting/lua-bindings/script/ui/experimentalUIConstants.lua"; sourceTree = "<group>"; };
15D1FD701998642800302043 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = "../cocos/scripting/lua-bindings/script/ui/GuiConstants.lua"; sourceTree = "<group>"; }; 15D1FD701998642800302043 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = "../cocos/scripting/lua-bindings/script/ui/GuiConstants.lua"; sourceTree = "<group>"; };
15D7637E19E8FC980069EAE8 /* CocosStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocosStudio.lua; path = "../cocos/scripting/lua-bindings/script/cocosstudio/CocosStudio.lua"; sourceTree = "<group>"; };
15D7637F19E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioClass.lua; path = "../cocos/scripting/lua-bindings/script/cocosstudio/DeprecatedCocoStudioClass.lua"; sourceTree = "<group>"; };
15D7638019E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioFunc.lua; path = "../cocos/scripting/lua-bindings/script/cocosstudio/DeprecatedCocoStudioFunc.lua"; sourceTree = "<group>"; };
15D7638119E8FC980069EAE8 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = "../cocos/scripting/lua-bindings/script/cocosstudio/StudioConstants.lua"; sourceTree = "<group>"; };
15EE465A19A7200300AF29F1 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../external/curl/prebuilt/ios/libcurl.a; sourceTree = "<group>"; }; 15EE465A19A7200300AF29F1 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../external/curl/prebuilt/ios/libcurl.a; sourceTree = "<group>"; };
1A0EE2B218CDF6DA004CD58F /* cpp-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1A0EE2B218CDF6DA004CD58F /* cpp-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1A0EE31418CDF733004CD58F /* lua-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1A0EE31418CDF733004CD58F /* lua-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -5308,6 +5320,10 @@
1ABCA36418CD9E060087CE3A /* Lua Common */ = { 1ABCA36418CD9E060087CE3A /* Lua Common */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
15D7637E19E8FC980069EAE8 /* CocosStudio.lua */,
15D7637F19E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua */,
15D7638019E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua */,
15D7638119E8FC980069EAE8 /* StudioConstants.lua */,
15D1FD6D1998642800302043 /* DeprecatedUIEnum.lua */, 15D1FD6D1998642800302043 /* DeprecatedUIEnum.lua */,
15D1FD6E1998642800302043 /* DeprecatedUIFunc.lua */, 15D1FD6E1998642800302043 /* DeprecatedUIFunc.lua */,
15D1FD6F1998642800302043 /* experimentalUIConstants.lua */, 15D1FD6F1998642800302043 /* experimentalUIConstants.lua */,
@ -5320,10 +5336,6 @@
15D1FD4E199863F900302043 /* DeprecatedExtensionEnum.lua */, 15D1FD4E199863F900302043 /* DeprecatedExtensionEnum.lua */,
15D1FD4F199863F900302043 /* DeprecatedExtensionFunc.lua */, 15D1FD4F199863F900302043 /* DeprecatedExtensionFunc.lua */,
15D1FD50199863F900302043 /* ExtensionConstants.lua */, 15D1FD50199863F900302043 /* ExtensionConstants.lua */,
15D1FD41199863E800302043 /* CocoStudio.lua */,
15D1FD42199863E800302043 /* DeprecatedCocoStudioClass.lua */,
15D1FD43199863E800302043 /* DeprecatedCocoStudioFunc.lua */,
15D1FD44199863E800302043 /* StudioConstants.lua */,
15D1FD38199863CA00302043 /* AudioEngine.lua */, 15D1FD38199863CA00302043 /* AudioEngine.lua */,
15D1FD39199863CA00302043 /* DeprecatedCocosDenshionClass.lua */, 15D1FD39199863CA00302043 /* DeprecatedCocosDenshionClass.lua */,
15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */, 15D1FD3A199863CA00302043 /* DeprecatedCocosDenshionFunc.lua */,
@ -6614,6 +6626,8 @@
1AC35D7C18CEE5B100F37B72 /* Classes */ = { 1AC35D7C18CEE5B100F37B72 /* Classes */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
150F918619DA409E00B89F57 /* lua_test_bindings.cpp */,
150F918719DA409E00B89F57 /* lua_test_bindings.h */,
15427B76198B750300DC375D /* lua_module_register.h */, 15427B76198B750300DC375D /* lua_module_register.h */,
1AC35D7D18CEE5B100F37B72 /* AppDelegate.cpp */, 1AC35D7D18CEE5B100F37B72 /* AppDelegate.cpp */,
1AC35D7E18CEE5B100F37B72 /* AppDelegate.h */, 1AC35D7E18CEE5B100F37B72 /* AppDelegate.h */,
@ -7509,6 +7523,7 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
15D7638719E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */,
1AC35D5C18CEDE9E00F37B72 /* InfoPlist.strings in Resources */, 1AC35D5C18CEDE9E00F37B72 /* InfoPlist.strings in Resources */,
1AC35D5D18CEDE9E00F37B72 /* MainMenu.xib in Resources */, 1AC35D5D18CEDE9E00F37B72 /* MainMenu.xib in Resources */,
15D1FD621998641200302043 /* DeprecatedNetworkEnum.lua in Resources */, 15D1FD621998641200302043 /* DeprecatedNetworkEnum.lua in Resources */,
@ -7519,12 +7534,15 @@
15D1FCED1998637C00302043 /* bitExtend.lua in Resources */, 15D1FCED1998637C00302043 /* bitExtend.lua in Resources */,
1503FABF18DA8B6C00F6518C /* smtp.lua in Resources */, 1503FABF18DA8B6C00F6518C /* smtp.lua in Resources */,
15D1FD291998637C00302043 /* Opengl.lua in Resources */, 15D1FD291998637C00302043 /* Opengl.lua in Resources */,
15D7638F19E8FC980069EAE8 /* StudioConstants.lua in Resources */,
1503FAB318DA8B6C00F6518C /* ftp.lua in Resources */, 1503FAB318DA8B6C00F6518C /* ftp.lua in Resources */,
1503FAB718DA8B6C00F6518C /* http.lua in Resources */, 1503FAB718DA8B6C00F6518C /* http.lua in Resources */,
15D1FCF71998637C00302043 /* Cocos2dConstants.lua in Resources */, 15D1FCF71998637C00302043 /* Cocos2dConstants.lua in Resources */,
1503FAC118DA8B6C00F6518C /* socket.lua in Resources */, 1503FAC118DA8B6C00F6518C /* socket.lua in Resources */,
1503FAB918DA8B6C00F6518C /* ltn12.lua in Resources */, 1503FAB918DA8B6C00F6518C /* ltn12.lua in Resources */,
15D1FD0B1998637C00302043 /* DeprecatedOpenglEnum.lua in Resources */, 15D1FD0B1998637C00302043 /* DeprecatedOpenglEnum.lua in Resources */,
15D7638B19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */,
15D7638319E8FC980069EAE8 /* CocosStudio.lua in Resources */,
15D1FD661998641200302043 /* DeprecatedNetworkFunc.lua in Resources */, 15D1FD661998641200302043 /* DeprecatedNetworkFunc.lua in Resources */,
15D1FD241998637C00302043 /* luaoc.lua in Resources */, 15D1FD241998637C00302043 /* luaoc.lua in Resources */,
1AC35D5E18CEDE9E00F37B72 /* Icon.icns in Resources */, 1AC35D5E18CEDE9E00F37B72 /* Icon.icns in Resources */,
@ -7577,7 +7595,9 @@
files = ( files = (
15D1FD171998637C00302043 /* extern.lua in Resources */, 15D1FD171998637C00302043 /* extern.lua in Resources */,
15D1FD641998641200302043 /* DeprecatedNetworkEnum.lua in Resources */, 15D1FD641998641200302043 /* DeprecatedNetworkEnum.lua in Resources */,
15D7638D19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */,
15D1FCF41998637C00302043 /* Cocos2d.lua in Resources */, 15D1FCF41998637C00302043 /* Cocos2d.lua in Resources */,
15D7638519E8FC980069EAE8 /* CocosStudio.lua in Resources */,
1AC35D4A18CEDE9400F37B72 /* Icon-120.png in Resources */, 1AC35D4A18CEDE9400F37B72 /* Icon-120.png in Resources */,
1503FAC018DA8B6C00F6518C /* smtp.lua in Resources */, 1503FAC018DA8B6C00F6518C /* smtp.lua in Resources */,
15D1FD681998641200302043 /* DeprecatedNetworkFunc.lua in Resources */, 15D1FD681998641200302043 /* DeprecatedNetworkFunc.lua in Resources */,
@ -7593,6 +7613,7 @@
1503FABE18DA8B6C00F6518C /* mime.lua in Resources */, 1503FABE18DA8B6C00F6518C /* mime.lua in Resources */,
15D1FD601998641200302043 /* DeprecatedNetworkClass.lua in Resources */, 15D1FD601998641200302043 /* DeprecatedNetworkClass.lua in Resources */,
15D1FD2B1998637C00302043 /* Opengl.lua in Resources */, 15D1FD2B1998637C00302043 /* Opengl.lua in Resources */,
15D7639119E8FC980069EAE8 /* StudioConstants.lua in Resources */,
1AC35D4E18CEDE9400F37B72 /* Icon-72.png in Resources */, 1AC35D4E18CEDE9400F37B72 /* Icon-72.png in Resources */,
1AC35D4F18CEDE9400F37B72 /* Icon-76.png in Resources */, 1AC35D4F18CEDE9400F37B72 /* Icon-76.png in Resources */,
1503FAC218DA8B6C00F6518C /* socket.lua in Resources */, 1503FAC218DA8B6C00F6518C /* socket.lua in Resources */,
@ -7602,6 +7623,7 @@
15D1FD301998637C00302043 /* OpenglConstants.lua in Resources */, 15D1FD301998637C00302043 /* OpenglConstants.lua in Resources */,
1503FAB618DA8B6C00F6518C /* headers.lua in Resources */, 1503FAB618DA8B6C00F6518C /* headers.lua in Resources */,
1AC35D4918CEDE9400F37B72 /* Icon-114.png in Resources */, 1AC35D4918CEDE9400F37B72 /* Icon-114.png in Resources */,
15D7638919E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */,
1503FAB418DA8B6C00F6518C /* ftp.lua in Resources */, 1503FAB418DA8B6C00F6518C /* ftp.lua in Resources */,
15D1FCEF1998637C00302043 /* bitExtend.lua in Resources */, 15D1FCEF1998637C00302043 /* bitExtend.lua in Resources */,
1AC35D2A18CEDE7200F37B72 /* res in Resources */, 1AC35D2A18CEDE7200F37B72 /* res in Resources */,
@ -7624,16 +7646,17 @@
files = ( files = (
15D1FD751998642800302043 /* experimentalUIConstants.lua in Resources */, 15D1FD751998642800302043 /* experimentalUIConstants.lua in Resources */,
156EAE071977D0BD00F53709 /* ActionTimeline in Resources */, 156EAE071977D0BD00F53709 /* ActionTimeline in Resources */,
15D7638219E8FC980069EAE8 /* CocosStudio.lua in Resources */,
15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */, 15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */,
15D1FD001998637C00302043 /* DeprecatedCocos2dEnum.lua in Resources */, 15D1FD001998637C00302043 /* DeprecatedCocos2dEnum.lua in Resources */,
15D1FD2D1998637C00302043 /* OpenglConstants.lua in Resources */, 15D1FD2D1998637C00302043 /* OpenglConstants.lua in Resources */,
15D1FCF11998637C00302043 /* Cocos2d.lua in Resources */, 15D1FCF11998637C00302043 /* Cocos2d.lua in Resources */,
15D1FD47199863E800302043 /* DeprecatedCocoStudioClass.lua in Resources */,
3E2F27BC19D00D7200E7C490 /* audio in Resources */, 3E2F27BC19D00D7200E7C490 /* audio in Resources */,
1AC35DC318CEE65100F37B72 /* Misc in Resources */, 1AC35DC318CEE65100F37B72 /* Misc in Resources */,
1AC35DC618CEE65100F37B72 /* Shaders in Resources */, 1AC35DC618CEE65100F37B72 /* Shaders in Resources */,
15D1FD141998637C00302043 /* extern.lua in Resources */, 15D1FD141998637C00302043 /* extern.lua in Resources */,
1AC35DBB18CEE65100F37B72 /* components in Resources */, 1AC35DBB18CEE65100F37B72 /* components in Resources */,
15D7638E19E8FC980069EAE8 /* StudioConstants.lua in Resources */,
1AC35DE218CEE65900F37B72 /* effect2.ogg in Resources */, 1AC35DE218CEE65900F37B72 /* effect2.ogg in Resources */,
15C90B4318E66C1700D69802 /* mime.lua in Resources */, 15C90B4318E66C1700D69802 /* mime.lua in Resources */,
15D1FD651998641200302043 /* DeprecatedNetworkFunc.lua in Resources */, 15D1FD651998641200302043 /* DeprecatedNetworkFunc.lua in Resources */,
@ -7644,6 +7667,7 @@
1AC35DBF18CEE65100F37B72 /* hd in Resources */, 1AC35DBF18CEE65100F37B72 /* hd in Resources */,
1AC35DC818CEE65100F37B72 /* TileMaps in Resources */, 1AC35DC818CEE65100F37B72 /* TileMaps in Resources */,
1AC35DBE18CEE65100F37B72 /* fonts in Resources */, 1AC35DBE18CEE65100F37B72 /* fonts in Resources */,
15D7638619E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */,
15D1FD691998641200302043 /* NetworkConstants.lua in Resources */, 15D1FD691998641200302043 /* NetworkConstants.lua in Resources */,
1AC35DDE18CEE65900F37B72 /* CocosBuilderExample.ccbresourcelog in Resources */, 1AC35DDE18CEE65900F37B72 /* CocosBuilderExample.ccbresourcelog in Resources */,
15D1FD34199863BA00302043 /* CCBReaderLoad.lua in Resources */, 15D1FD34199863BA00302043 /* CCBReaderLoad.lua in Resources */,
@ -7658,6 +7682,7 @@
C08689C218D370C90093E810 /* background.caf in Resources */, C08689C218D370C90093E810 /* background.caf in Resources */,
15D1FD0A1998637C00302043 /* DeprecatedOpenglEnum.lua in Resources */, 15D1FD0A1998637C00302043 /* DeprecatedOpenglEnum.lua in Resources */,
15C90B4918E66C2A00D69802 /* tp.lua in Resources */, 15C90B4918E66C2A00D69802 /* tp.lua in Resources */,
15D7638A19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */,
15D1FD281998637C00302043 /* Opengl.lua in Resources */, 15D1FD281998637C00302043 /* Opengl.lua in Resources */,
1AC35DE918CEE65900F37B72 /* effect1.wav in Resources */, 1AC35DE918CEE65900F37B72 /* effect1.wav in Resources */,
3E2F27BD19D00D7D00E7C490 /* background.wav in Resources */, 3E2F27BD19D00D7D00E7C490 /* background.wav in Resources */,
@ -7670,9 +7695,7 @@
1AC35DC418CEE65100F37B72 /* Particles in Resources */, 1AC35DC418CEE65100F37B72 /* Particles in Resources */,
15D1FD3F199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */, 15D1FD3F199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */,
15D1FD191998637C00302043 /* json.lua in Resources */, 15D1FD191998637C00302043 /* json.lua in Resources */,
15D1FD4B199863E800302043 /* StudioConstants.lua in Resources */,
1AC35DB918CEE65100F37B72 /* ccb in Resources */, 1AC35DB918CEE65100F37B72 /* ccb in Resources */,
15D1FD49199863E800302043 /* DeprecatedCocoStudioFunc.lua in Resources */,
15C90B4118E66C1100D69802 /* mbox.lua in Resources */, 15C90B4118E66C1100D69802 /* mbox.lua in Resources */,
15D1FD55199863F900302043 /* DeprecatedExtensionFunc.lua in Resources */, 15D1FD55199863F900302043 /* DeprecatedExtensionFunc.lua in Resources */,
15D1FD3B199863CA00302043 /* AudioEngine.lua in Resources */, 15D1FD3B199863CA00302043 /* AudioEngine.lua in Resources */,
@ -7697,7 +7720,6 @@
15D1FD51199863F900302043 /* DeprecatedExtensionClass.lua in Resources */, 15D1FD51199863F900302043 /* DeprecatedExtensionClass.lua in Resources */,
1AC35DBD18CEE65100F37B72 /* extensions in Resources */, 1AC35DBD18CEE65100F37B72 /* extensions in Resources */,
15D1FD771998642800302043 /* GuiConstants.lua in Resources */, 15D1FD771998642800302043 /* GuiConstants.lua in Resources */,
15D1FD45199863E800302043 /* CocoStudio.lua in Resources */,
15D1FD1E1998637C00302043 /* luaj.lua in Resources */, 15D1FD1E1998637C00302043 /* luaj.lua in Resources */,
1AC35DC718CEE65100F37B72 /* spine in Resources */, 1AC35DC718CEE65100F37B72 /* spine in Resources */,
15C90B4518E66C1E00D69802 /* smtp.lua in Resources */, 15C90B4518E66C1E00D69802 /* smtp.lua in Resources */,
@ -7723,7 +7745,6 @@
1AC35DF718CEE65B00F37B72 /* effect1.wav in Resources */, 1AC35DF718CEE65B00F37B72 /* effect1.wav in Resources */,
C08689C418D370C90093E810 /* background.caf in Resources */, C08689C418D370C90093E810 /* background.caf in Resources */,
1AC35DD118CEE65200F37B72 /* fonts in Resources */, 1AC35DD118CEE65200F37B72 /* fonts in Resources */,
15D1FD4C199863E800302043 /* StudioConstants.lua in Resources */,
1AC35DCC18CEE65200F37B72 /* ccb in Resources */, 1AC35DCC18CEE65200F37B72 /* ccb in Resources */,
1AC35DD218CEE65200F37B72 /* hd in Resources */, 1AC35DD218CEE65200F37B72 /* hd in Resources */,
15D1FD251998637C00302043 /* luaoc.lua in Resources */, 15D1FD251998637C00302043 /* luaoc.lua in Resources */,
@ -7740,7 +7761,6 @@
15D1FD021998637C00302043 /* DeprecatedCocos2dEnum.lua in Resources */, 15D1FD021998637C00302043 /* DeprecatedCocos2dEnum.lua in Resources */,
1AC35DF818CEE65B00F37B72 /* pew-pew-lei.wav in Resources */, 1AC35DF818CEE65B00F37B72 /* pew-pew-lei.wav in Resources */,
1AC35D9918CEE5D100F37B72 /* Default-568h@2x.png in Resources */, 1AC35D9918CEE5D100F37B72 /* Default-568h@2x.png in Resources */,
15D1FD4A199863E800302043 /* DeprecatedCocoStudioFunc.lua in Resources */,
15D1FD071998637C00302043 /* DeprecatedCocos2dFunc.lua in Resources */, 15D1FD071998637C00302043 /* DeprecatedCocos2dFunc.lua in Resources */,
15C90B4218E66C1200D69802 /* mbox.lua in Resources */, 15C90B4218E66C1200D69802 /* mbox.lua in Resources */,
15D1FD201998637C00302043 /* luaj.lua in Resources */, 15D1FD201998637C00302043 /* luaj.lua in Resources */,
@ -7774,16 +7794,16 @@
15D1FD2F1998637C00302043 /* OpenglConstants.lua in Resources */, 15D1FD2F1998637C00302043 /* OpenglConstants.lua in Resources */,
15D1FD671998641200302043 /* DeprecatedNetworkFunc.lua in Resources */, 15D1FD671998641200302043 /* DeprecatedNetworkFunc.lua in Resources */,
1A1645A9191B6283008C7C7F /* ccs-res in Resources */, 1A1645A9191B6283008C7C7F /* ccs-res in Resources */,
15D1FD46199863E800302043 /* CocoStudio.lua in Resources */,
15D1FD37199863BA00302043 /* DeprecatedCocosBuilderClass.lua in Resources */, 15D1FD37199863BA00302043 /* DeprecatedCocosBuilderClass.lua in Resources */,
1AC35DA118CEE5D100F37B72 /* Icon-72.png in Resources */, 1AC35DA118CEE5D100F37B72 /* Icon-72.png in Resources */,
15D7638819E8FC980069EAE8 /* DeprecatedCocoStudioClass.lua in Resources */,
15C90B4018E66C0D00D69802 /* ltn12.lua in Resources */, 15C90B4018E66C0D00D69802 /* ltn12.lua in Resources */,
15D1FD48199863E800302043 /* DeprecatedCocoStudioClass.lua in Resources */,
15D1FD161998637C00302043 /* extern.lua in Resources */, 15D1FD161998637C00302043 /* extern.lua in Resources */,
1AC35DA218CEE5D100F37B72 /* Icon-76.png in Resources */, 1AC35DA218CEE5D100F37B72 /* Icon-76.png in Resources */,
15C90B4818E66C2500D69802 /* socket.lua in Resources */, 15C90B4818E66C2500D69802 /* socket.lua in Resources */,
15D1FD40199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */, 15D1FD40199863CA00302043 /* DeprecatedCocosDenshionFunc.lua in Resources */,
15C90B3C18E66BEC00D69802 /* headers.lua in Resources */, 15C90B3C18E66BEC00D69802 /* headers.lua in Resources */,
15D7638419E8FC980069EAE8 /* CocosStudio.lua in Resources */,
1AC35DF418CEE65B00F37B72 /* effect1.raw in Resources */, 1AC35DF418CEE65B00F37B72 /* effect1.raw in Resources */,
1AC35DD918CEE65200F37B72 /* Shaders in Resources */, 1AC35DD918CEE65200F37B72 /* Shaders in Resources */,
1AC35DCF18CEE65200F37B72 /* configs in Resources */, 1AC35DCF18CEE65200F37B72 /* configs in Resources */,
@ -7797,7 +7817,9 @@
1AC35D9C18CEE5D100F37B72 /* Icon-114.png in Resources */, 1AC35D9C18CEE5D100F37B72 /* Icon-114.png in Resources */,
15D1FD52199863F900302043 /* DeprecatedExtensionClass.lua in Resources */, 15D1FD52199863F900302043 /* DeprecatedExtensionClass.lua in Resources */,
1AC35D9F18CEE5D100F37B72 /* Icon-152.png in Resources */, 1AC35D9F18CEE5D100F37B72 /* Icon-152.png in Resources */,
15D7638C19E8FC980069EAE8 /* DeprecatedCocoStudioFunc.lua in Resources */,
1AC35DEE18CEE65B00F37B72 /* background.mp3 in Resources */, 1AC35DEE18CEE65B00F37B72 /* background.mp3 in Resources */,
15D7639019E8FC980069EAE8 /* StudioConstants.lua in Resources */,
1AC35D9A18CEE5D100F37B72 /* Default.png in Resources */, 1AC35D9A18CEE5D100F37B72 /* Default.png in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -8006,6 +8028,7 @@
files = ( files = (
1AC35D8118CEE5B100F37B72 /* AppDelegate.cpp in Sources */, 1AC35D8118CEE5B100F37B72 /* AppDelegate.cpp in Sources */,
1AC35DB518CEE5DA00F37B72 /* LuaObjectCBridgeTest.mm in Sources */, 1AC35DB518CEE5DA00F37B72 /* LuaObjectCBridgeTest.mm in Sources */,
150F918819DA409E00B89F57 /* lua_test_bindings.cpp in Sources */,
1AC35DB618CEE5DA00F37B72 /* main.cpp in Sources */, 1AC35DB618CEE5DA00F37B72 /* main.cpp in Sources */,
1AC35D8318CEE5B100F37B72 /* lua_assetsmanager_test_sample.cpp in Sources */, 1AC35D8318CEE5B100F37B72 /* lua_assetsmanager_test_sample.cpp in Sources */,
); );
@ -8015,6 +8038,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
150F918919DA409F00B89F57 /* lua_test_bindings.cpp in Sources */,
1AC35DA518CEE5D100F37B72 /* main.m in Sources */, 1AC35DA518CEE5D100F37B72 /* main.m in Sources */,
1AC35DA418CEE5D100F37B72 /* LuaObjectCBridgeTest.mm in Sources */, 1AC35DA418CEE5D100F37B72 /* LuaObjectCBridgeTest.mm in Sources */,
1AC35D9818CEE5D100F37B72 /* AppController.mm in Sources */, 1AC35D9818CEE5D100F37B72 /* AppController.mm in Sources */,

View File

@ -216,7 +216,15 @@ void AtlasNode::setBlendFunc(const BlendFunc &blendFunc)
void AtlasNode::updateBlendFunc() void AtlasNode::updateBlendFunc()
{ {
if( ! _textureAtlas->getTexture()->hasPremultipliedAlpha() ) if( ! _textureAtlas->getTexture()->hasPremultipliedAlpha() )
{
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
setOpacityModifyRGB(false);
}
else
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
setOpacityModifyRGB(true);
}
} }
void AtlasNode::setTexture(Texture2D *texture) void AtlasNode::setTexture(Texture2D *texture)

View File

@ -233,6 +233,12 @@ void LabelAtlas::updateColor()
if (_textureAtlas) if (_textureAtlas)
{ {
Color4B color4( _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity ); Color4B color4( _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity );
if (_isOpacityModifyRGB)
{
color4.r *= _displayedOpacity/255.0f;
color4.g *= _displayedOpacity/255.0f;
color4.b *= _displayedOpacity/255.0f;
}
auto quads = _textureAtlas->getQuads(); auto quads = _textureAtlas->getQuads();
ssize_t length = _string.length(); ssize_t length = _string.length();
for (int index = 0; index < length; index++) for (int index = 0; index < length; index++)

View File

@ -7,7 +7,7 @@
<PropertyGroup /> <PropertyGroup />
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>$(EngineRoot)cocos;$(EngineRoot)cocos\platform;$(EngineRoot)cocos\platform\desktop;$(EngineRoot)external\glfw3\include\win32;$(EngineRoot)external\win32-specific\gles\include\OGLES</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos;$(EngineRoot)cocos\platform;$(EngineRoot)cocos\platform\desktop;$(EngineRoot)external\glfw3\include\win32;$(EngineRoot)external\win32-specific\gles\include\OGLES</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ProjectReference> <ProjectReference>

View File

@ -288,6 +288,7 @@
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" /> <ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" />
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" /> <ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" /> <ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" /> <ClCompile Include="..\..\external\unzip\ioapi.cpp" />
<ClCompile Include="..\..\external\unzip\unzip.cpp" /> <ClCompile Include="..\..\external\unzip\unzip.cpp" />
<ClCompile Include="..\..\external\xxhash\xxhash.c"> <ClCompile Include="..\..\external\xxhash\xxhash.c">
@ -506,6 +507,7 @@
<ClInclude Include="..\..\external\ConvertUTF\ConvertUTF.h" /> <ClInclude Include="..\..\external\ConvertUTF\ConvertUTF.h" />
<ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" /> <ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" /> <ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi_mem.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" /> <ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" /> <ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\..\external\xxhash\xxhash.h" /> <ClInclude Include="..\..\external\xxhash\xxhash.h" />

View File

@ -455,6 +455,9 @@
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp"> <ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp">
<Filter>external\tinyxml2</Filter> <Filter>external\tinyxml2</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp">
<Filter>external\unzip</Filter>
</ClCompile>
<ClCompile Include="..\..\external\unzip\ioapi.cpp"> <ClCompile Include="..\..\external\unzip\ioapi.cpp">
<Filter>external\unzip</Filter> <Filter>external\unzip</Filter>
</ClCompile> </ClCompile>
@ -1071,6 +1074,9 @@
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h"> <ClInclude Include="..\..\external\tinyxml2\tinyxml2.h">
<Filter>external\tinyxml2</Filter> <Filter>external\tinyxml2</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\external\unzip\ioapi_mem.h">
<Filter>external\unzip</Filter>
</ClInclude>
<ClInclude Include="..\..\external\unzip\ioapi.h"> <ClInclude Include="..\..\external\unzip\ioapi.h">
<Filter>external\unzip</Filter> <Filter>external\unzip</Filter>
</ClInclude> </ClInclude>

View File

@ -203,6 +203,7 @@
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" /> <ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" />
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" /> <ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" /> <ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" /> <ClCompile Include="..\..\external\unzip\ioapi.cpp" />
<ClCompile Include="..\..\external\unzip\unzip.cpp" /> <ClCompile Include="..\..\external\unzip\unzip.cpp" />
<ClCompile Include="..\..\external\xxhash\xxhash.c"> <ClCompile Include="..\..\external\xxhash\xxhash.c">
@ -444,6 +445,7 @@
<ClInclude Include="..\..\external\ConvertUTF\ConvertUTF.h" /> <ClInclude Include="..\..\external\ConvertUTF\ConvertUTF.h" />
<ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" /> <ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" /> <ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi_mem.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" /> <ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" /> <ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\..\external\xxhash\xxhash.h" /> <ClInclude Include="..\..\external\xxhash\xxhash.h" />

View File

@ -382,6 +382,9 @@
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp"> <ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp">
<Filter>external\tinyxml2</Filter> <Filter>external\tinyxml2</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp">
<Filter>external\unzip</Filter>
</ClCompile>
<ClCompile Include="..\..\external\unzip\ioapi.cpp"> <ClCompile Include="..\..\external\unzip\ioapi.cpp">
<Filter>external\unzip</Filter> <Filter>external\unzip</Filter>
</ClCompile> </ClCompile>
@ -1012,6 +1015,9 @@
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h"> <ClInclude Include="..\..\external\tinyxml2\tinyxml2.h">
<Filter>external\tinyxml2</Filter> <Filter>external\tinyxml2</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\external\unzip\ioapi_mem.h">
<Filter>external\unzip</Filter>
</ClInclude>
<ClInclude Include="..\..\external\unzip\ioapi.h"> <ClInclude Include="..\..\external\unzip\ioapi.h">
<Filter>external\unzip</Filter> <Filter>external\unzip</Filter>
</ClInclude> </ClInclude>

View File

@ -204,6 +204,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" /> <ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" />
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" /> <ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" /> <ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" /> <ClCompile Include="..\..\external\unzip\ioapi.cpp" />
<ClCompile Include="..\..\external\unzip\unzip.cpp" /> <ClCompile Include="..\..\external\unzip\unzip.cpp" />
<ClCompile Include="..\..\external\xxhash\xxhash.c" /> <ClCompile Include="..\..\external\xxhash\xxhash.c" />
@ -544,6 +545,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\..\external\json\stringbuffer.h" /> <ClInclude Include="..\..\external\json\stringbuffer.h" />
<ClInclude Include="..\..\external\json\writer.h" /> <ClInclude Include="..\..\external\json\writer.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" /> <ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi_mem.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" /> <ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" /> <ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\..\external\xxhash\xxhash.h" /> <ClInclude Include="..\..\external\xxhash\xxhash.h" />

View File

@ -679,6 +679,9 @@
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp"> <ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp">
<Filter>external\tinyxml2</Filter> <Filter>external\tinyxml2</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp">
<Filter>external\unzip</Filter>
</ClCompile>
<ClCompile Include="..\..\external\unzip\ioapi.cpp"> <ClCompile Include="..\..\external\unzip\ioapi.cpp">
<Filter>external\unzip</Filter> <Filter>external\unzip</Filter>
</ClCompile> </ClCompile>
@ -1729,6 +1732,9 @@
<ClInclude Include="..\..\external\unzip\ioapi.h"> <ClInclude Include="..\..\external\unzip\ioapi.h">
<Filter>external\unzip</Filter> <Filter>external\unzip</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\external\unzip\ioapi_mem.h">
<Filter>external\unzip</Filter>
</ClInclude>
<ClInclude Include="..\..\external\edtaa3func\edtaa3func.h"> <ClInclude Include="..\..\external\edtaa3func\edtaa3func.h">
<Filter>external\edtaa</Filter> <Filter>external\edtaa</Filter>
</ClInclude> </ClInclude>

View File

@ -2084,22 +2084,23 @@ unsigned int Bundle3D::parseGLProgramAttribute(const std::string& str)
{ {
return GLProgram::VERTEX_ATTRIB_TEX_COORD3; return GLProgram::VERTEX_ATTRIB_TEX_COORD3;
} }
else if (str == "VERTEX_ATTRIB_TEX_COORD4") //comment out them
{ // else if (str == "VERTEX_ATTRIB_TEX_COORD4")
return GLProgram::VERTEX_ATTRIB_TEX_COORD4; // {
} // return GLProgram::VERTEX_ATTRIB_TEX_COORD4;
else if (str == "VERTEX_ATTRIB_TEX_COORD5") // }
{ // else if (str == "VERTEX_ATTRIB_TEX_COORD5")
return GLProgram::VERTEX_ATTRIB_TEX_COORD5; // {
} // return GLProgram::VERTEX_ATTRIB_TEX_COORD5;
else if (str == "VERTEX_ATTRIB_TEX_COORD6") // }
{ // else if (str == "VERTEX_ATTRIB_TEX_COORD6")
return GLProgram::VERTEX_ATTRIB_TEX_COORD6; // {
} // return GLProgram::VERTEX_ATTRIB_TEX_COORD6;
else if (str == "VERTEX_ATTRIB_TEX_COORD7") // }
{ // else if (str == "VERTEX_ATTRIB_TEX_COORD7")
return GLProgram::VERTEX_ATTRIB_TEX_COORD7; // {
} // return GLProgram::VERTEX_ATTRIB_TEX_COORD7;
// }
else if (str == "VERTEX_ATTRIB_NORMAL") else if (str == "VERTEX_ATTRIB_NORMAL")
{ {
return GLProgram::VERTEX_ATTRIB_NORMAL; return GLProgram::VERTEX_ATTRIB_NORMAL;

View File

@ -44,7 +44,7 @@
NS_CC_BEGIN NS_CC_BEGIN
std::string s_attributeNames[] = {GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::ATTRIBUTE_NAME_TEX_COORD2,GLProgram::ATTRIBUTE_NAME_TEX_COORD3,GLProgram::ATTRIBUTE_NAME_TEX_COORD4,GLProgram::ATTRIBUTE_NAME_TEX_COORD5,GLProgram::ATTRIBUTE_NAME_TEX_COORD6,GLProgram::ATTRIBUTE_NAME_TEX_COORD7,GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT, GLProgram::ATTRIBUTE_NAME_BLEND_INDEX}; std::string s_attributeNames[] = {GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::ATTRIBUTE_NAME_TEX_COORD2,GLProgram::ATTRIBUTE_NAME_TEX_COORD3,GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT, GLProgram::ATTRIBUTE_NAME_BLEND_INDEX};
Sprite3D* Sprite3D::create(const std::string &modelPath) Sprite3D* Sprite3D::create(const std::string &modelPath)
{ {

View File

@ -180,6 +180,7 @@ physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp \
../external/ConvertUTF/ConvertUTFWrapper.cpp \ ../external/ConvertUTF/ConvertUTFWrapper.cpp \
../external/ConvertUTF/ConvertUTF.c \ ../external/ConvertUTF/ConvertUTF.c \
../external/tinyxml2/tinyxml2.cpp \ ../external/tinyxml2/tinyxml2.cpp \
../external/unzip/ioapi_mem.cpp \
../external/unzip/ioapi.cpp \ ../external/unzip/ioapi.cpp \
../external/unzip/unzip.cpp \ ../external/unzip/unzip.cpp \
../external/edtaa3func/edtaa3func.cpp \ ../external/edtaa3func/edtaa3func.cpp \

View File

@ -22,17 +22,26 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
// FIXME: hack, must be included before ziputils
#include "unzip.h"
#include "base/ZipUtils.h"
#include <zlib.h> #include <zlib.h>
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "base/ZipUtils.h"
#include "base/CCData.h" #include "base/CCData.h"
#include "base/ccMacros.h" #include "base/ccMacros.h"
#include "platform/CCFileUtils.h" #include "platform/CCFileUtils.h"
#include "unzip.h"
#include <map> #include <map>
// FIXME: Other platforms should use upstream minizip like mingw-w64
#ifdef __MINGW32__
#define unzGoToFirstFile64(A,B,C,D) unzGoToFirstFile2(A,B,C,D, NULL, 0, NULL, 0)
#define unzGoToNextFile64(A,B,C,D) unzGoToNextFile2(A,B,C,D, NULL, 0, NULL, 0)
#endif
NS_CC_BEGIN NS_CC_BEGIN
unsigned int ZipUtils::s_uEncryptedPvrKeyParts[4] = {0,0,0,0}; unsigned int ZipUtils::s_uEncryptedPvrKeyParts[4] = {0,0,0,0};
@ -484,6 +493,8 @@ void ZipUtils::setPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2,
// from unzip.cpp // from unzip.cpp
#define UNZ_MAXFILENAMEINZIP 256 #define UNZ_MAXFILENAMEINZIP 256
static const std::string emptyFilename("");
struct ZipEntryInfo struct ZipEntryInfo
{ {
unz_file_pos pos; unz_file_pos pos;
@ -500,6 +511,23 @@ public:
FileListContainer fileList; FileListContainer fileList;
}; };
ZipFile *ZipFile::createWithBuffer(const void* buffer, uLong size)
{
ZipFile *zip = new ZipFile();
if (zip && zip->initWithBuffer(buffer, size)) {
return zip;
} else {
if (zip) delete zip;
return nullptr;
}
}
ZipFile::ZipFile()
: _data(new ZipFilePrivate)
{
_data->zipFile = nullptr;
}
ZipFile::ZipFile(const std::string &zipFile, const std::string &filter) ZipFile::ZipFile(const std::string &zipFile, const std::string &filter)
: _data(new ZipFilePrivate) : _data(new ZipFilePrivate)
{ {
@ -612,4 +640,45 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, ssize_t *size)
return buffer; return buffer;
} }
std::string ZipFile::getFirstFilename()
{
if (unzGoToFirstFile(_data->zipFile) != UNZ_OK) return emptyFilename;
std::string path;
unz_file_info info;
getCurrentFileInfo(&path, &info);
return path;
}
std::string ZipFile::getNextFilename()
{
if (unzGoToNextFile(_data->zipFile) != UNZ_OK) return emptyFilename;
std::string path;
unz_file_info info;
getCurrentFileInfo(&path, &info);
return path;
}
int ZipFile::getCurrentFileInfo(std::string *filename, unz_file_info *info)
{
char path[FILENAME_MAX + 1];
int ret = unzGetCurrentFileInfo(_data->zipFile, info, path, sizeof(path), nullptr, 0, nullptr, 0);
if (ret != UNZ_OK) {
*filename = emptyFilename;
} else {
filename->assign(path);
}
return ret;
}
bool ZipFile::initWithBuffer(const void *buffer, uLong size)
{
if (!buffer || size == 0) return false;
_data->zipFile = unzOpenBuffer(buffer, size);
if (!_data->zipFile) return false;
setFilter(emptyFilename);
return true;
}
NS_CC_END NS_CC_END

View File

@ -37,6 +37,10 @@ THE SOFTWARE.
#include "platform/CCStdC.h" #include "platform/CCStdC.h"
#endif #endif
#ifndef _unz64_H
typedef struct unz_file_info_s unz_file_info;
#endif
namespace cocos2d namespace cocos2d
{ {
/* XXX: pragma pack ??? */ /* XXX: pragma pack ??? */
@ -214,6 +218,7 @@ namespace cocos2d
// forward declaration // forward declaration
class ZipFilePrivate; class ZipFilePrivate;
struct unz_file_info_s;
/** /**
* Zip file - reader helper class. * Zip file - reader helper class.
@ -270,7 +275,18 @@ namespace cocos2d
*/ */
unsigned char *getFileData(const std::string &fileName, ssize_t *size); unsigned char *getFileData(const std::string &fileName, ssize_t *size);
std::string getFirstFilename();
std::string getNextFilename();
static ZipFile *createWithBuffer(const void* buffer, unsigned long size);
private: private:
/* Only used internal for createWithBuffer() */
ZipFile();
bool initWithBuffer(const void *buffer, unsigned long size);
int getCurrentFileInfo(std::string *filename, unz_file_info *info);
/** Internal data like zip file pointer / file list array and so on */ /** Internal data like zip file pointer / file list array and so on */
ZipFilePrivate *_data; ZipFilePrivate *_data;
}; };

View File

@ -341,6 +341,14 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par
createObject(subDict, gb, attachComponent); createObject(subDict, gb, attachComponent);
} }
const rapidjson::Value &canvasSizeDict = DICTOOL->getSubDictionary_json(dict, "CanvasSize");
if (DICTOOL->checkObjectExist_json(canvasSizeDict))
{
int width = DICTOOL->getIntValue_json(canvasSizeDict, "_width");
int height = DICTOOL->getIntValue_json(canvasSizeDict, "_height");
gb->setContentSize(Size(width, height));
}
return gb; return gb;
} }

View File

@ -26,7 +26,6 @@
#if CC_USE_PHYSICS #if CC_USE_PHYSICS
#include <algorithm> #include <algorithm>
#include <unordered_map> #include <unordered_map>
#include "chipmunk.h"
NS_CC_BEGIN NS_CC_BEGIN

View File

@ -31,10 +31,7 @@
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
#include "platform/CCPlatformMacros.h" #include "platform/CCPlatformMacros.h"
#include "chipmunk.h"
typedef uintptr_t cpGroup;
struct cpShape;
struct cpBody;
NS_CC_BEGIN NS_CC_BEGIN

View File

@ -37,6 +37,10 @@ THE SOFTWARE.
#include "unzip.h" #include "unzip.h"
#include <sys/stat.h> #include <sys/stat.h>
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#include <ftw.h>
#endif
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
@ -644,7 +648,12 @@ unsigned char* FileUtils::getFileDataFromZip(const std::string& zipFilePath, con
file = unzOpen(zipFilePath.c_str()); file = unzOpen(zipFilePath.c_str());
CC_BREAK_IF(!file); CC_BREAK_IF(!file);
// FIXME: Other platforms should use upstream minizip like mingw-w64
#ifdef __MINGW32__
int ret = unzLocateFile(file, filename.c_str(), NULL);
#else
int ret = unzLocateFile(file, filename.c_str(), 1); int ret = unzLocateFile(file, filename.c_str(), 1);
#endif
CC_BREAK_IF(UNZ_OK != ret); CC_BREAK_IF(UNZ_OK != ret);
char filePathA[260]; char filePathA[260];
@ -1103,6 +1112,18 @@ bool FileUtils::createDirectory(const std::string& path)
#endif #endif
} }
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
{
auto ret = remove(fpath);
if (ret) {
log("Fail to remove:%s ",fpath);
}
return ret;
}
#endif
bool FileUtils::removeDirectory(const std::string& path) bool FileUtils::removeDirectory(const std::string& path)
{ {
if (path.size() > 0 && path[path.size() - 1] != '/') if (path.size() > 0 && path[path.size() - 1] != '/')
@ -1155,6 +1176,11 @@ bool FileUtils::removeDirectory(const std::string& path)
return true; return true;
else else
return false; return false;
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
if (nftw(path.c_str(),unlink_cb, 64, FTW_DEPTH | FTW_PHYS))
return false;
else
return true;
#else #else
std::string command = "rm -r "; std::string command = "rm -r ";
// Path may include space. // Path may include space.
@ -1195,13 +1221,11 @@ bool FileUtils::removeFile(const std::string &path)
else else
return false; return false;
#else #else
std::string command = "rm -f "; if (remove(path.c_str())) {
// Path may include space.
command += "\"" + path + "\"";
if (system(command.c_str()) >= 0)
return true;
else
return false; return false;
} else {
return true;
}
#endif #endif
} }

View File

@ -213,7 +213,7 @@ bool Application::openURL(const std::string &url)
int wchars_num = MultiByteToWideChar(CP_UTF8, 0, url.c_str(), url.size() + 1, temp, url.size() + 1); int wchars_num = MultiByteToWideChar(CP_UTF8, 0, url.c_str(), url.size() + 1, temp, url.size() + 1);
HINSTANCE r = ShellExecuteW(NULL, L"open", temp, NULL, NULL, SW_SHOWNORMAL); HINSTANCE r = ShellExecuteW(NULL, L"open", temp, NULL, NULL, SW_SHOWNORMAL);
delete[] temp; delete[] temp;
return (int)r>32; return (size_t)r>32;
} }
void Application::setResourceRootPath(const std::string& rootResDir) void Application::setResourceRootPath(const std::string& rootResDir)

View File

@ -100,10 +100,6 @@ const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD = "a_texCoord";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD1 = "a_texCoord1"; const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD1 = "a_texCoord1";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD2 = "a_texCoord2"; const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD2 = "a_texCoord2";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD3 = "a_texCoord3"; const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD3 = "a_texCoord3";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD4 = "a_texCoord4";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD5 = "a_texCoord5";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD6 = "a_texCoord6";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD7 = "a_texCoord7";
const char* GLProgram::ATTRIBUTE_NAME_NORMAL = "a_normal"; const char* GLProgram::ATTRIBUTE_NAME_NORMAL = "a_normal";
const char* GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT = "a_blendWeight"; const char* GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT = "a_blendWeight";
const char* GLProgram::ATTRIBUTE_NAME_BLEND_INDEX = "a_blendIndex"; const char* GLProgram::ATTRIBUTE_NAME_BLEND_INDEX = "a_blendIndex";
@ -294,10 +290,6 @@ void GLProgram::bindPredefinedVertexAttribs()
{GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::VERTEX_ATTRIB_TEX_COORD1}, {GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::VERTEX_ATTRIB_TEX_COORD1},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD2, GLProgram::VERTEX_ATTRIB_TEX_COORD2}, {GLProgram::ATTRIBUTE_NAME_TEX_COORD2, GLProgram::VERTEX_ATTRIB_TEX_COORD2},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD3, GLProgram::VERTEX_ATTRIB_TEX_COORD3}, {GLProgram::ATTRIBUTE_NAME_TEX_COORD3, GLProgram::VERTEX_ATTRIB_TEX_COORD3},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD4, GLProgram::VERTEX_ATTRIB_TEX_COORD4},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD5, GLProgram::VERTEX_ATTRIB_TEX_COORD5},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD6, GLProgram::VERTEX_ATTRIB_TEX_COORD6},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD7, GLProgram::VERTEX_ATTRIB_TEX_COORD7},
{GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::VERTEX_ATTRIB_NORMAL}, {GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::VERTEX_ATTRIB_NORMAL},
}; };

View File

@ -87,14 +87,9 @@ public:
VERTEX_ATTRIB_TEX_COORD1, VERTEX_ATTRIB_TEX_COORD1,
VERTEX_ATTRIB_TEX_COORD2, VERTEX_ATTRIB_TEX_COORD2,
VERTEX_ATTRIB_TEX_COORD3, VERTEX_ATTRIB_TEX_COORD3,
VERTEX_ATTRIB_TEX_COORD4,
VERTEX_ATTRIB_TEX_COORD5,
VERTEX_ATTRIB_TEX_COORD6,
VERTEX_ATTRIB_TEX_COORD7,
VERTEX_ATTRIB_NORMAL, VERTEX_ATTRIB_NORMAL,
VERTEX_ATTRIB_BLEND_WEIGHT, VERTEX_ATTRIB_BLEND_WEIGHT,
VERTEX_ATTRIB_BLEND_INDEX, VERTEX_ATTRIB_BLEND_INDEX,
VERTEX_ATTRIB_MAX, VERTEX_ATTRIB_MAX,
// backward compatibility // backward compatibility
@ -169,10 +164,6 @@ public:
static const char* ATTRIBUTE_NAME_TEX_COORD1; static const char* ATTRIBUTE_NAME_TEX_COORD1;
static const char* ATTRIBUTE_NAME_TEX_COORD2; static const char* ATTRIBUTE_NAME_TEX_COORD2;
static const char* ATTRIBUTE_NAME_TEX_COORD3; static const char* ATTRIBUTE_NAME_TEX_COORD3;
static const char* ATTRIBUTE_NAME_TEX_COORD4;
static const char* ATTRIBUTE_NAME_TEX_COORD5;
static const char* ATTRIBUTE_NAME_TEX_COORD6;
static const char* ATTRIBUTE_NAME_TEX_COORD7;
static const char* ATTRIBUTE_NAME_NORMAL; static const char* ATTRIBUTE_NAME_NORMAL;
static const char* ATTRIBUTE_NAME_BLEND_WEIGHT; static const char* ATTRIBUTE_NAME_BLEND_WEIGHT;
static const char* ATTRIBUTE_NAME_BLEND_INDEX; static const char* ATTRIBUTE_NAME_BLEND_INDEX;

View File

@ -1,9 +1,5 @@
const char* cc3D_PositionNormalTex_vert = STRINGIFY( const char* cc3D_PositionNormalTex_vert = STRINGIFY(
\n#define MAX_DIRECTIONAL_LIGHT_NUM 1 \n
\n#define MAX_POINT_LIGHT_NUM 1 \n
\n#define MAX_SPOT_LIGHT_NUM 1 \n
\n#define MAX_AMBIENT_LIGHT_NUM 1 \n
\n#if (MAX_POINT_LIGHT_NUM > 0)\n \n#if (MAX_POINT_LIGHT_NUM > 0)\n
uniform vec3 u_PointLightSourcePosition[MAX_POINT_LIGHT_NUM]; uniform vec3 u_PointLightSourcePosition[MAX_POINT_LIGHT_NUM];
@ -55,10 +51,6 @@ void main(void)
); );
const char* cc3D_SkinPositionNormalTex_vert = STRINGIFY( const char* cc3D_SkinPositionNormalTex_vert = STRINGIFY(
\n#define MAX_DIRECTIONAL_LIGHT_NUM 1 \n
\n#define MAX_POINT_LIGHT_NUM 1 \n
\n#define MAX_SPOT_LIGHT_NUM 1 \n
\n#define MAX_AMBIENT_LIGHT_NUM 1 \n
\n#if (MAX_POINT_LIGHT_NUM > 0)\n \n#if (MAX_POINT_LIGHT_NUM > 0)\n
uniform vec3 u_PointLightSourcePosition[MAX_POINT_LIGHT_NUM]; uniform vec3 u_PointLightSourcePosition[MAX_POINT_LIGHT_NUM];

View File

@ -1,64 +0,0 @@
--------------------------------
-- @module AABB
-- @parent_module cc
--------------------------------
-- reset min and max value.
-- @function [parent=#AABB] reset
-- @param self
--------------------------------
-- Sets this bounding box to the specified values.
-- @function [parent=#AABB] set
-- @param self
-- @param #vec3_table min
-- @param #vec3_table max
--------------------------------
-- Transforms the bounding box by the given transformation matrix.
-- @function [parent=#AABB] transform
-- @param self
-- @param #mat4_table mat
--------------------------------
-- Gets the center point of the bounding box.
-- @function [parent=#AABB] getCenter
-- @param self
-- @return vec3_table#vec3_table ret (return value: vec3_table)
--------------------------------
--
-- @function [parent=#AABB] isEmpty
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#AABB] getCorners
-- @param self
-- @param #vec3_table dst
--------------------------------
-- update the _min and _max from the given point.
-- @function [parent=#AABB] updateMinMax
-- @param self
-- @param #vec3_table point
-- @param #long num
--------------------------------
-- check whether the point is in.
-- @function [parent=#AABB] containPoint
-- @param self
-- @param #vec3_table point
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @overload self, vec3_table, vec3_table
-- @overload self
-- @function [parent=#AABB] AABB
-- @param self
-- @param #vec3_table min
-- @param #vec3_table max
return nil

View File

@ -1,40 +0,0 @@
--------------------------------
-- @module OBB
-- @parent_module cc
--------------------------------
--
-- @function [parent=#OBB] reset
-- @param self
--------------------------------
--
-- @function [parent=#OBB] set
-- @param self
-- @param #vec3_table center
-- @param #vec3_table _xAxis
-- @param #vec3_table _yAxis
-- @param #vec3_table _zAxis
-- @param #vec3_table _extents
--------------------------------
-- Transforms the obb by the given transformation matrix.
-- @function [parent=#OBB] transform
-- @param self
-- @param #mat4_table mat
--------------------------------
--
-- @function [parent=#OBB] getCorners
-- @param self
-- @param #vec3_table verts
--------------------------------
--
-- @function [parent=#OBB] containPoint
-- @param self
-- @param #vec3_table point
-- @return bool#bool ret (return value: bool)
return nil

View File

@ -1,16 +1,6 @@
-------------------------------- --------------------------------
-- @module cc -- @module cc
--------------------------------------------------------
-- the cc AABB
-- @field [parent=#cc] AABB#AABB AABB preloaded module
--------------------------------------------------------
-- the cc OBB
-- @field [parent=#cc] OBB#OBB OBB preloaded module
-------------------------------------------------------- --------------------------------------------------------
-- the cc Skeleton3D -- the cc Skeleton3D
-- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module -- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module

View File

@ -5,712 +5,6 @@
int lua_cocos2dx_3d_AABB_reset(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_reset'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
cobj->reset();
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:reset",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_reset'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_set(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_set'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 2)
{
cocos2d::Vec3 arg0;
cocos2d::Vec3 arg1;
ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.AABB:set");
ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.AABB:set");
if(!ok)
return 0;
cobj->set(arg0, arg1);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:set",argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_set'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_transform(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_transform'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Mat4 arg0;
ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.AABB:transform");
if(!ok)
return 0;
cobj->transform(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:transform",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_transform'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_getCenter(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_getCenter'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
cocos2d::Vec3 ret = cobj->getCenter();
vec3_to_luaval(tolua_S, ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:getCenter",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_getCenter'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_isEmpty(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_isEmpty'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
bool ret = cobj->isEmpty();
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:isEmpty",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_isEmpty'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_getCorners(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_getCorners'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Vec3* arg0;
ok &= luaval_to_object<cocos2d::Vec3>(tolua_S, 2, "cc.Vec3",&arg0);
if(!ok)
return 0;
cobj->getCorners(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:getCorners",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_getCorners'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_updateMinMax(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_updateMinMax'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 2)
{
const cocos2d::Vec3* arg0;
ssize_t arg1;
ok &= luaval_to_object<const cocos2d::Vec3>(tolua_S, 2, "cc.Vec3",&arg0);
ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.AABB:updateMinMax");
if(!ok)
return 0;
cobj->updateMinMax(arg0, arg1);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:updateMinMax",argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_updateMinMax'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_containPoint(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.AABB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::AABB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_AABB_containPoint'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Vec3 arg0;
ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.AABB:containPoint");
if(!ok)
return 0;
bool ret = cobj->containPoint(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:containPoint",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_containPoint'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_AABB_constructor(lua_State* tolua_S)
{
int argc = 0;
cocos2d::AABB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
argc = lua_gettop(tolua_S)-1;
do{
if (argc == 2) {
cocos2d::Vec3 arg0;
ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.AABB:AABB");
if (!ok) { break; }
cocos2d::Vec3 arg1;
ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.AABB:AABB");
if (!ok) { break; }
cobj = new cocos2d::AABB(arg0, arg1);
tolua_pushusertype(tolua_S,(void*)cobj,"cc.AABB");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
return 1;
}
}while(0);
ok = true;
do{
if (argc == 0) {
cobj = new cocos2d::AABB();
tolua_pushusertype(tolua_S,(void*)cobj,"cc.AABB");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
return 1;
}
}while(0);
ok = true;
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AABB:AABB",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AABB_constructor'.",&tolua_err);
#endif
return 0;
}
static int lua_cocos2dx_3d_AABB_finalize(lua_State* tolua_S)
{
printf("luabindings: finalizing LUA object (AABB)");
return 0;
}
int lua_register_cocos2dx_3d_AABB(lua_State* tolua_S)
{
tolua_usertype(tolua_S,"cc.AABB");
tolua_cclass(tolua_S,"AABB","cc.AABB","",nullptr);
tolua_beginmodule(tolua_S,"AABB");
tolua_function(tolua_S,"new",lua_cocos2dx_3d_AABB_constructor);
tolua_function(tolua_S,"reset",lua_cocos2dx_3d_AABB_reset);
tolua_function(tolua_S,"set",lua_cocos2dx_3d_AABB_set);
tolua_function(tolua_S,"transform",lua_cocos2dx_3d_AABB_transform);
tolua_function(tolua_S,"getCenter",lua_cocos2dx_3d_AABB_getCenter);
tolua_function(tolua_S,"isEmpty",lua_cocos2dx_3d_AABB_isEmpty);
tolua_function(tolua_S,"getCorners",lua_cocos2dx_3d_AABB_getCorners);
tolua_function(tolua_S,"updateMinMax",lua_cocos2dx_3d_AABB_updateMinMax);
tolua_function(tolua_S,"containPoint",lua_cocos2dx_3d_AABB_containPoint);
tolua_endmodule(tolua_S);
std::string typeName = typeid(cocos2d::AABB).name();
g_luaType[typeName] = "cc.AABB";
g_typeCast["AABB"] = "cc.AABB";
return 1;
}
int lua_cocos2dx_3d_OBB_reset(lua_State* tolua_S)
{
int argc = 0;
cocos2d::OBB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.OBB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::OBB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_OBB_reset'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
cobj->reset();
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.OBB:reset",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_OBB_reset'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_OBB_set(lua_State* tolua_S)
{
int argc = 0;
cocos2d::OBB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.OBB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::OBB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_OBB_set'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 5)
{
cocos2d::Vec3 arg0;
cocos2d::Vec3 arg1;
cocos2d::Vec3 arg2;
cocos2d::Vec3 arg3;
cocos2d::Vec3 arg4;
ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.OBB:set");
ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.OBB:set");
ok &= luaval_to_vec3(tolua_S, 4, &arg2, "cc.OBB:set");
ok &= luaval_to_vec3(tolua_S, 5, &arg3, "cc.OBB:set");
ok &= luaval_to_vec3(tolua_S, 6, &arg4, "cc.OBB:set");
if(!ok)
return 0;
cobj->set(arg0, arg1, arg2, arg3, arg4);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.OBB:set",argc, 5);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_OBB_set'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_OBB_transform(lua_State* tolua_S)
{
int argc = 0;
cocos2d::OBB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.OBB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::OBB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_OBB_transform'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Mat4 arg0;
ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.OBB:transform");
if(!ok)
return 0;
cobj->transform(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.OBB:transform",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_OBB_transform'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_OBB_getCorners(lua_State* tolua_S)
{
int argc = 0;
cocos2d::OBB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.OBB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::OBB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_OBB_getCorners'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Vec3* arg0;
ok &= luaval_to_object<cocos2d::Vec3>(tolua_S, 2, "cc.Vec3",&arg0);
if(!ok)
return 0;
cobj->getCorners(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.OBB:getCorners",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_OBB_getCorners'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_OBB_containPoint(lua_State* tolua_S)
{
int argc = 0;
cocos2d::OBB* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.OBB",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::OBB*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_OBB_containPoint'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Vec3 arg0;
ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.OBB:containPoint");
if(!ok)
return 0;
bool ret = cobj->containPoint(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.OBB:containPoint",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_OBB_containPoint'.",&tolua_err);
#endif
return 0;
}
static int lua_cocos2dx_3d_OBB_finalize(lua_State* tolua_S)
{
printf("luabindings: finalizing LUA object (OBB)");
return 0;
}
int lua_register_cocos2dx_3d_OBB(lua_State* tolua_S)
{
tolua_usertype(tolua_S,"cc.OBB");
tolua_cclass(tolua_S,"OBB","cc.OBB","",nullptr);
tolua_beginmodule(tolua_S,"OBB");
tolua_function(tolua_S,"reset",lua_cocos2dx_3d_OBB_reset);
tolua_function(tolua_S,"set",lua_cocos2dx_3d_OBB_set);
tolua_function(tolua_S,"transform",lua_cocos2dx_3d_OBB_transform);
tolua_function(tolua_S,"getCorners",lua_cocos2dx_3d_OBB_getCorners);
tolua_function(tolua_S,"containPoint",lua_cocos2dx_3d_OBB_containPoint);
tolua_endmodule(tolua_S);
std::string typeName = typeid(cocos2d::OBB).name();
g_luaType[typeName] = "cc.OBB";
g_typeCast["OBB"] = "cc.OBB";
return 1;
}
int lua_cocos2dx_3d_Skeleton3D_getBoneByName(lua_State* tolua_S) int lua_cocos2dx_3d_Skeleton3D_getBoneByName(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -2814,8 +2108,6 @@ TOLUA_API int register_all_cocos2dx_3d(lua_State* tolua_S)
lua_register_cocos2dx_3d_Animate3D(tolua_S); lua_register_cocos2dx_3d_Animate3D(tolua_S);
lua_register_cocos2dx_3d_Sprite3D(tolua_S); lua_register_cocos2dx_3d_Sprite3D(tolua_S);
lua_register_cocos2dx_3d_AttachNode(tolua_S); lua_register_cocos2dx_3d_AttachNode(tolua_S);
lua_register_cocos2dx_3d_AABB(tolua_S);
lua_register_cocos2dx_3d_OBB(tolua_S);
lua_register_cocos2dx_3d_BillBoard(tolua_S); lua_register_cocos2dx_3d_BillBoard(tolua_S);
lua_register_cocos2dx_3d_Animation3D(tolua_S); lua_register_cocos2dx_3d_Animation3D(tolua_S);
lua_register_cocos2dx_3d_Skeleton3D(tolua_S); lua_register_cocos2dx_3d_Skeleton3D(tolua_S);

View File

@ -43,22 +43,6 @@ int register_all_cocos2dx_3d(lua_State* tolua_S);

View File

@ -57,9 +57,6 @@ bool LuaEngine::init(void)
{ {
_stack = LuaStack::create(); _stack = LuaStack::create();
_stack->retain(); _stack->retain();
executeScriptFile("DeprecatedCocos2dClass");
executeScriptFile("DeprecatedCocos2dEnum");
executeScriptFile("DeprecatedCocos2dFunc");
return true; return true;
} }

View File

@ -177,7 +177,7 @@ bool LuaStack::init(void)
const luaL_reg global_functions [] = { const luaL_reg global_functions [] = {
{"print", lua_print}, {"print", lua_print},
{"release_print",lua_release_print}, {"release_print",lua_release_print},
{NULL, NULL} {nullptr, nullptr}
}; };
luaL_register(_state, "_G", global_functions); luaL_register(_state, "_G", global_functions);
@ -186,6 +186,7 @@ bool LuaStack::init(void)
tolua_opengl_open(_state); tolua_opengl_open(_state);
register_all_cocos2dx_manual(_state); register_all_cocos2dx_manual(_state);
register_all_cocos2dx_module_manual(_state); register_all_cocos2dx_module_manual(_state);
register_all_cocos2dx_math_manual(_state);
register_all_cocos2dx_experimental(_state); register_all_cocos2dx_experimental(_state);
register_all_cocos2dx_experimental_manual(_state); register_all_cocos2dx_experimental_manual(_state);
@ -584,7 +585,7 @@ int LuaStack::executeFunctionReturnArray(int handler,int numArgs,int numResults,
}else{ }else{
resultArray.addObject(static_cast<Ref*>(tolua_tousertype(_state, -1, NULL))); resultArray.addObject(static_cast<Ref*>(tolua_tousertype(_state, -1, nullptr)));
} }
// remove return value from stack // remove return value from stack
lua_pop(_state, 1); /* L: ... [G] ret1 ret2 ... ret*/ lua_pop(_state, 1); /* L: ... [G] ret1 ret2 ... ret*/
@ -731,6 +732,97 @@ void LuaStack::cleanupXXTEAKeyAndSign()
} }
} }
int LuaStack::loadChunksFromZIP(const char *zipFilePath)
{
pushString(zipFilePath);
luaLoadChunksFromZIP(_state);
int ret = lua_toboolean(_state, -1);
lua_pop(_state, 1);
return ret;
}
int LuaStack::luaLoadChunksFromZIP(lua_State *L)
{
if (lua_gettop(L) < 1) {
CCLOG("luaLoadChunksFromZIP() - invalid arguments");
return 0;
}
const char *zipFilename = lua_tostring(L, -1);
lua_settop(L, 0);
FileUtils *utils = FileUtils::getInstance();
std::string zipFilePath = utils->fullPathForFilename(zipFilename);
LuaStack *stack = this;
do {
ssize_t size = 0;
void *buffer = nullptr;
unsigned char *zipFileData = utils->getFileData(zipFilePath.c_str(), "rb", &size);
ZipFile *zip = nullptr;
bool isXXTEA = stack && stack->_xxteaEnabled && zipFileData;
for (int i = 0; isXXTEA && i < stack->_xxteaSignLen && i < size; ++i) {
isXXTEA = zipFileData[i] == stack->_xxteaSign[i];
}
if (isXXTEA) { // decrypt XXTEA
xxtea_long len = 0;
buffer = xxtea_decrypt(zipFileData + stack->_xxteaSignLen,
(xxtea_long)size - (xxtea_long)stack->_xxteaSignLen,
(unsigned char*)stack->_xxteaKey,
(xxtea_long)stack->_xxteaKeyLen,
&len);
delete []zipFileData;
zipFileData = nullptr;
zip = ZipFile::createWithBuffer(buffer, len);
} else {
if (zipFileData) {
zip = ZipFile::createWithBuffer(zipFileData, size);
}
}
if (zip) {
CCLOG("lua_loadChunksFromZIP() - load zip file: %s%s", zipFilePath.c_str(), isXXTEA ? "*" : "");
lua_getglobal(L, "package");
lua_getfield(L, -1, "preload");
int count = 0;
std::string filename = zip->getFirstFilename();
while (filename.length()) {
ssize_t bufferSize = 0;
unsigned char *zbuffer = zip->getFileData(filename.c_str(), &bufferSize);
if (bufferSize) {
if (stack->luaLoadBuffer(L, (char*)zbuffer, (int)bufferSize, filename.c_str()) == 0) {
lua_setfield(L, -2, filename.c_str());
++count;
}
delete []zbuffer;
}
filename = zip->getNextFilename();
}
CCLOG("lua_loadChunksFromZIP() - loaded chunks count: %d", count);
lua_pop(L, 2);
lua_pushboolean(L, 1);
delete zip;
} else {
CCLOG("lua_loadChunksFromZIP() - not found or invalid zip file: %s", zipFilePath.c_str());
lua_pushboolean(L, 0);
}
if (zipFileData) {
delete []zipFileData;
}
if (buffer) {
free(buffer);
}
} while (0);
return 1;
}
int LuaStack::luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, const char *chunkName) int LuaStack::luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, const char *chunkName)
{ {
int r = 0; int r = 0;

View File

@ -133,6 +133,8 @@ public:
virtual void cleanupXXTEAKeyAndSign(); virtual void cleanupXXTEAKeyAndSign();
int luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, const char *chunkName); int luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, const char *chunkName);
int loadChunksFromZIP(const char *zipFilePath);
int luaLoadChunksFromZIP(lua_State *L);
protected: protected:
LuaStack(void) LuaStack(void)

View File

@ -371,12 +371,12 @@ bool luaval_to_vec4(lua_State* L,int lo,cocos2d::Vec4* outValue, const char* fun
lua_pushstring(L, "z"); lua_pushstring(L, "z");
lua_gettable(L, lo); lua_gettable(L, lo);
outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); outValue->z = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1); lua_pop(L, 1);
lua_pushstring(L, "w"); lua_pushstring(L, "w");
lua_gettable(L, lo); lua_gettable(L, lo);
outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); outValue->w = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1); lua_pop(L, 1);
} }
return ok; return ok;
@ -1997,6 +1997,48 @@ bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector<unsigned shor
return ok; return ok;
} }
bool luaval_to_quaternion(lua_State* L,int lo,cocos2d::Quaternion* outValue, const char* funcName)
{
if (nullptr == L || nullptr == outValue)
return false;
bool ok = true;
tolua_Error tolua_err;
if (!tolua_istable(L, lo, 0, &tolua_err) )
{
#if COCOS2D_DEBUG >=1
luaval_to_native_err(L,"#ferror:",&tolua_err,funcName);
#endif
ok = false;
}
if (ok)
{
lua_pushstring(L, "x");
lua_gettable(L, lo);
outValue->x = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "y");
lua_gettable(L, lo);
outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "z");
lua_gettable(L, lo);
outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "w");
lua_gettable(L, lo);
outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1);
}
return ok;
}
void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count)
{ {
if (NULL == L) if (NULL == L)
@ -2939,3 +2981,23 @@ void ccvector_ushort_to_luaval(lua_State* L, const std::vector<unsigned short>&
++index; ++index;
} }
} }
void quaternion_to_luaval(lua_State* L,const cocos2d::Quaternion& inValue)
{
if (NULL == L)
return;
lua_newtable(L); /* L: table */
lua_pushstring(L, "x"); /* L: table key */
lua_pushnumber(L, (lua_Number) inValue.x); /* L: table key value*/
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "y"); /* L: table key */
lua_pushnumber(L, (lua_Number) inValue.y); /* L: table key value*/
lua_rawset(L, -3);
lua_pushstring(L, "z"); /* L: table key */
lua_pushnumber(L, (lua_Number) inValue.z); /* L: table key value*/
lua_rawset(L, -3);
lua_pushstring(L, "w"); /* L: table key */
lua_pushnumber(L, (lua_Number) inValue.w); /* L: table key value*/
lua_rawset(L, -3);
}

View File

@ -235,6 +235,7 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret)
extern bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttrib* ret, const char* funcName = ""); extern bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttrib* ret, const char* funcName = "");
extern bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector<float>* ret, const char* funcName = ""); extern bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector<float>* ret, const char* funcName = "");
extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector<unsigned short>* ret, const char* funcName = ""); extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector<unsigned short>* ret, const char* funcName = "");
extern bool luaval_to_quaternion(lua_State* L,int lo,cocos2d::Quaternion* outValue, const char* funcName = "");
// from native // from native
extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2); extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2);
@ -386,5 +387,6 @@ void ccvector_std_string_to_luaval(lua_State* L, const std::vector<std::string>&
void ccvector_int_to_luaval(lua_State* L, const std::vector<int>& inValue); void ccvector_int_to_luaval(lua_State* L, const std::vector<int>& inValue);
void ccvector_float_to_luaval(lua_State* L, const std::vector<float>& inValue); void ccvector_float_to_luaval(lua_State* L, const std::vector<float>& inValue);
void ccvector_ushort_to_luaval(lua_State* L, const std::vector<unsigned short>& inValue); void ccvector_ushort_to_luaval(lua_State* L, const std::vector<unsigned short>& inValue);
void quaternion_to_luaval(lua_State* L,const cocos2d::Quaternion& inValue);
#endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__ #endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__

View File

@ -7232,3 +7232,254 @@ int register_all_cocos2dx_module_manual(lua_State* tolua_S)
return 0; return 0;
} }
static int tolua_cocos2d_Mat4_getInversed(lua_State* tolua_S)
{
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (!tolua_istable(tolua_S, 1, 0, &tolua_err))
goto tolua_lerror;
else
#endif
{
cocos2d::Mat4 mat;
bool ok = luaval_to_mat4(tolua_S, 1, &mat);
if (ok)
{
mat4_to_luaval(tolua_S, mat.getInversed());
return 1;
}
}
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'mat4_getInversed'.",&tolua_err);
return 0;
#endif
}
static int tolua_cocos2d_Mat4_transformVector(lua_State* tolua_S)
{
bool ok = true;
int argc = lua_gettop(tolua_S);
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
if (argc == 3)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||
!tolua_istable(tolua_S, 2, 0, &tolua_err) ||
!tolua_istable(tolua_S, 3, 0, &tolua_err))
goto tolua_lerror;
else
#endif
{
cocos2d::Mat4 mat;
cocos2d::Vec4 vector;
cocos2d::Vec4 dst;
ok &= luaval_to_mat4(tolua_S, 1, &mat);
if (!ok)
return 0;
ok &= luaval_to_vec4(tolua_S, 2, &vector);
if (!ok)
return 0;
ok &= luaval_to_vec4(tolua_S, 3, &dst);
if (!ok)
return 0;
mat.transformVector(vector, &dst);
vec4_to_luaval(tolua_S, dst);
return 1;
}
}
else if(argc == 6)
{
/*
float x, float y, float z, float w, Vec3* dst
*/
#if COCOS2D_DEBUG >= 1
if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||
!tolua_isnumber(tolua_S, 2, 0, &tolua_err) ||
!tolua_isnumber(tolua_S, 3, 0, &tolua_err) ||
!tolua_isnumber(tolua_S, 4, 0, &tolua_err) ||
!tolua_isnumber(tolua_S, 5, 0, &tolua_err) ||
!tolua_isnumber(tolua_S, 6, 0, &tolua_err))
goto tolua_lerror;
else
#endif
{
cocos2d::Mat4 mat;
float x,y,z,w;
cocos2d::Vec3 dst;
ok &= luaval_to_mat4(tolua_S, 1, &mat);
if (!ok)
return 0;
x = tolua_tonumber(tolua_S, 2, 0);
y = tolua_tonumber(tolua_S, 3, 0);
z = tolua_tonumber(tolua_S, 4, 0);
w = tolua_tonumber(tolua_S, 5, 0);
ok &= luaval_to_vec3(tolua_S, 6, &dst);
if (!ok)
return 0;
mat.transformVector(x,y,z,w, &dst);
vec3_to_luaval(tolua_S, dst);
return 1;
}
}
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'mat4_transformVector'.",&tolua_err);
return 0;
#endif
}
static int tolua_cocos2d_Mat4_decompose(lua_State* tolua_S)
{
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||
!tolua_istable(tolua_S, 2, 0, &tolua_err) ||
!tolua_istable(tolua_S, 3, 0, &tolua_err) ||
!tolua_istable(tolua_S, 4, 0, &tolua_err))
goto tolua_lerror;
else
#endif
{
cocos2d::Mat4 mat;
cocos2d::Vec3 scale;
cocos2d::Quaternion rotation;
cocos2d::Vec3 translation;
bool ok = true;
ok &= luaval_to_mat4(tolua_S, 1, &mat);
if (!ok)
return 0;
ok &= luaval_to_vec3(tolua_S, 2, &scale);
if (!ok)
return 0;
ok &= luaval_to_quaternion(tolua_S, 3, &rotation);
if (!ok)
return 0;
ok &= luaval_to_vec3(tolua_S, 2, &translation);
if (!ok)
return 0;
mat.decompose(&scale, &rotation, &translation);
vec3_to_luaval(tolua_S, scale);
quaternion_to_luaval(tolua_S, rotation);
vec3_to_luaval(tolua_S, translation);
return 3;
}
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'mat4_decompose'.",&tolua_err);
return 0;
#endif
}
static int tolua_cocos2d_Vec3_cross(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S);
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
if (1 == argc)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||
!tolua_istable(tolua_S, 2, 0, &tolua_err) )
goto tolua_lerror;
else
#endif
{
cocos2d::Vec3 cobj;
cocos2d::Vec3 v;
bool ok = true;
ok &= luaval_to_vec3(tolua_S, 1, &cobj);
if (!ok)
return 0;
ok &= luaval_to_vec3(tolua_S, 2, &v);
if (!ok)
return 0;
cobj.cross(v);
vec3_to_luaval(tolua_S, cobj);
return 1;
}
}
else if (3 == argc)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||
!tolua_istable(tolua_S, 2, 0, &tolua_err) ||
!tolua_istable(tolua_S, 3, 0, &tolua_err) )
goto tolua_lerror;
else
#endif
{
cocos2d::Vec3 v1;
cocos2d::Vec3 v2;
cocos2d::Vec3 dst;
bool ok = true;
ok &= luaval_to_vec3(tolua_S, 1, &v1);
if (!ok)
return 0;
ok &= luaval_to_vec3(tolua_S, 2, &v2);
if (!ok)
return 0;
ok &= luaval_to_vec3(tolua_S, 3, &dst);
if (!ok)
return 0;
cocos2d::Vec3::cross(v1, v2, &dst);
vec3_to_luaval(tolua_S, dst);
return 1;
}
}
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'MathUtil_gcrossVec3'.",&tolua_err);
return 0;
#endif
}
int register_all_cocos2dx_math_manual(lua_State* tolua_S)
{
if (nullptr == tolua_S)
return 0;
tolua_module(tolua_S, nullptr, 0);
tolua_beginmodule(tolua_S, nullptr);
tolua_function(tolua_S, "mat4_getInversed", tolua_cocos2d_Mat4_getInversed);
tolua_function(tolua_S, "mat4_transformVector", tolua_cocos2d_Mat4_transformVector);
tolua_function(tolua_S, "mat4_decompose", tolua_cocos2d_Mat4_decompose);
tolua_function(tolua_S, "vec3_cross", tolua_cocos2d_Vec3_cross);
tolua_endmodule(tolua_S);
return 0;
}

View File

@ -57,6 +57,8 @@ TOLUA_API int register_cocos2dx_event_releated(lua_State* tolua_S);
TOLUA_API int register_all_cocos2dx_module_manual(lua_State* tolua_S); TOLUA_API int register_all_cocos2dx_module_manual(lua_State* tolua_S);
TOLUA_API int register_all_cocos2dx_math_manual(lua_State* tolua_S);
struct LuaEventAccelerationData struct LuaEventAccelerationData
{ {
void* acc; void* acc;

View File

@ -465,7 +465,5 @@ int register_cocosbuilder_module(lua_State* tolua_S)
register_all_cocos2dx_cocosbuilder_manual(tolua_S); register_all_cocos2dx_cocosbuilder_manual(tolua_S);
} }
lua_pop(tolua_S, 1); lua_pop(tolua_S, 1);
LuaEngine::getInstance()->executeScriptFile("DeprecatedCocosBuilderClass");
return 1; return 1;
} }

View File

@ -33,8 +33,5 @@ int register_cocosdenshion_module(lua_State* L)
register_all_cocos2dx_cocosdenshion(L); register_all_cocos2dx_cocosdenshion(L);
} }
lua_pop(L, 1); lua_pop(L, 1);
cocos2d::LuaEngine::getInstance()->executeScriptFile("DeprecatedCocosDenshionClass");
cocos2d::LuaEngine::getInstance()->executeScriptFile("DeprecatedCocosDenshionFunc");
return 1; return 1;
} }

View File

@ -647,8 +647,5 @@ int register_cocostudio_module(lua_State* L)
lua_register_cocos2dx_coco_studio_CustomGUIReader(L); lua_register_cocos2dx_coco_studio_CustomGUIReader(L);
} }
lua_pop(L, 1); lua_pop(L, 1);
LuaEngine::getInstance()->executeScriptFile("DeprecatedCocoStudioClass");
LuaEngine::getInstance()->executeScriptFile("DeprecatedCocoStudioFunc");
return 1; return 1;
} }

View File

@ -957,9 +957,5 @@ int register_extension_module(lua_State* tolua_S)
register_all_cocos2dx_extension_manual(tolua_S); register_all_cocos2dx_extension_manual(tolua_S);
} }
lua_pop(tolua_S, 1); lua_pop(tolua_S, 1);
LuaEngine::getInstance()->executeScriptFile("DeprecatedExtensionClass");
LuaEngine::getInstance()->executeScriptFile("DeprecatedExtensionEnum");
LuaEngine::getInstance()->executeScriptFile("DeprecatedExtensionFunc");
return 1; return 1;
} }

View File

@ -53,9 +53,5 @@ int register_network_module(lua_State* L)
} }
lua_pop(L, 1); lua_pop(L, 1);
cocos2d::LuaEngine::getInstance()->executeScriptFile("DeprecatedNetworkClass");
cocos2d::LuaEngine::getInstance()->executeScriptFile("DeprecatedNetworkEnum");
cocos2d::LuaEngine::getInstance()->executeScriptFile("DeprecatedNetworkFunc");
return 1; return 1;
} }

View File

@ -808,7 +808,5 @@ int register_ui_moudle(lua_State* L)
} }
lua_pop(L, 1); lua_pop(L, 1);
LuaEngine::getInstance()->executeScriptFile("DeprecatedUIEnum");
LuaEngine::getInstance()->executeScriptFile("DeprecatedUIFunc");
return 1; return 1;
} }

View File

@ -1,10 +1,11 @@
cc = cc or {} cc = cc or {}
function cc.clampf(value, min_inclusive, max_inclusive) function cc.clampf(value, min_inclusive, max_inclusive)
-- body -- body
local temp = 0 local temp = 0
if min_inclusive > max_inclusive then if min_inclusive > max_inclusive then
temp = min_inclusive temp = min_inclusive
min_inclusive = max_inclusive min_inclusive = max_inclusive
max_inclusive = temp max_inclusive = temp
end end
@ -110,7 +111,7 @@ function cc.pIsLineIntersect(A, B, C, D, s, t)
return false, s, t return false, s, t
end end
s = s / denom s = s / denom
t = t / denom t = t / denom
@ -153,7 +154,7 @@ function cc.pFromSize(sz)
return { x = sz.width, y = sz.height } return { x = sz.width, y = sz.height }
end end
function cc.pLerp(pt1,pt2,alpha) function cc.pLerp(pt1,pt2,alpha)
return cc.pAdd(cc.pMul(pt1, 1.0 - alpha), cc.pMul(pt2,alpha) ) return cc.pAdd(cc.pMul(pt1, 1.0 - alpha), cc.pMul(pt2,alpha) )
end end
@ -166,13 +167,13 @@ function cc.pFuzzyEqual(pt1,pt2,variance)
end end
function cc.pRotateByAngle(pt1, pt2, angle) function cc.pRotateByAngle(pt1, pt2, angle)
return cc.pAdd(pt2, cc.pRotate( cc.pSub(pt1, pt2),cc.pForAngle(angle))) return cc.pAdd(pt2, cc.pRotate( cc.pSub(pt1, pt2),cc.pForAngle(angle)))
end end
function cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4) function cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)
local s,t,ret = 0,0,false local s,t,ret = 0,0,false
ret,s,t =cc.pIsLineIntersect(pt1, pt2, pt3, pt4,s,t) ret,s,t =cc.pIsLineIntersect(pt1, pt2, pt3, pt4,s,t)
if ret and s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 0.0 then if ret and s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 0.0 then
return true; return true;
end end
@ -182,7 +183,7 @@ end
function cc.pGetIntersectPoint(pt1,pt2,pt3,pt4) function cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)
local s,t, ret = 0,0,false local s,t, ret = 0,0,false
ret,s,t = cc.pIsLineIntersect(pt1,pt2,pt3,pt4,s,t) ret,s,t = cc.pIsLineIntersect(pt1,pt2,pt3,pt4,s,t)
if ret then if ret then
return cc.p(pt1.x + s * (pt2.x - pt1.x), pt1.y + s * (pt2.y - pt1.y)) return cc.p(pt1.x + s * (pt2.x - pt1.x), pt1.y + s * (pt2.y - pt1.y))
else else
@ -235,7 +236,7 @@ end
function cc.rectContainsPoint( rect, point ) function cc.rectContainsPoint( rect, point )
local ret = false local ret = false
if (point.x >= rect.x) and (point.x <= rect.x + rect.width) and if (point.x >= rect.x) and (point.x <= rect.x + rect.width) and
(point.y >= rect.y) and (point.y <= rect.y + rect.height) then (point.y >= rect.y) and (point.y <= rect.y + rect.height) then
ret = true ret = true
@ -367,6 +368,10 @@ function cc.vec3(_x, _y, _z)
return { x = _x, y = _y, z = _z } return { x = _x, y = _y, z = _z }
end end
function cc.vec4(_x, _y, _z, _w)
return { x = _x, y = _y, z = _z, w = _w }
end
function cc.vec3normalize(vec3) function cc.vec3normalize(vec3)
local n = vec3.x * vec3.x + vec3.y * vec3.y + vec3.z * vec3.z local n = vec3.x * vec3.x + vec3.y * vec3.y + vec3.z * vec3.z
if n == 1.0 then if n == 1.0 then
@ -382,3 +387,45 @@ function cc.vec3normalize(vec3)
n = 1.0 / n n = 1.0 / n
return {x = vec3.x * n, y = vec3.y * n, z = vec3.z * n} return {x = vec3.x * n, y = vec3.y * n, z = vec3.z * n}
end end
function cc.quaternion(_x, _y ,_z,_w)
return { x = _x, y = _y, z = _z, w = _w }
end
cc.mat4 = cc.mat4 or {}
function cc.mat4.new(...)
local params = {...}
local size = #params
local obj = {}
if 1 == size then
assert(type(params[1]) == "table" , "type of input params are wrong to new a mat4 when num of params is 1")
for i= 1, 16 do
if params[1][i] ~= nil then
obj[i] = params[1][i]
else
obj[i] = 0
end
end
elseif 16 == size then
if params[i] ~= nil then
mat4[i] = params[i]
else
mat4[i] = 0
end
end
setmetatable(obj, {__index = cc.mat4})
return obj
end
function cc.mat4.getInversed(self)
return mat4_getInversed(self)
end
function cc.mat4.transformVector(self, vector, dst)
return mat4_transformVector(self, vector, dst)
end

View File

@ -1,3 +1,4 @@
cc = cc or {} cc = cc or {}
cc.SPRITE_INDEX_NOT_INITIALIZED = 0xffffffff cc.SPRITE_INDEX_NOT_INITIALIZED = 0xffffffff
@ -204,7 +205,7 @@ cc.LANGUAGE_ARABIC = 11
cc.NODE_ON_ENTER = 0 cc.NODE_ON_ENTER = 0
cc.NODE_ON_EXIT = 1 cc.NODE_ON_EXIT = 1
cc.NODE_ON_ENTER_TRANSITION_DID_FINISH = 2 cc.NODE_ON_ENTER_TRANSITION_DID_FINISH = 2
cc.NODE_ON_EXIT_TRANSITION_DID_START = 3 cc.NODE_ON_EXIT_TRANSITION_DID_START = 3
cc.NODE_ON_CLEAN_UP = 4 cc.NODE_ON_CLEAN_UP = 4
cc.Handler = cc.Handler or {} cc.Handler = cc.Handler or {}
@ -289,7 +290,7 @@ cc.GLYPHCOLLECTION_NEHE = 1
cc.GLYPHCOLLECTION_ASCII = 2 cc.GLYPHCOLLECTION_ASCII = 2
cc.GLYPHCOLLECTION_CUSTOM = 3 cc.GLYPHCOLLECTION_CUSTOM = 3
cc.ResolutionPolicy = cc.ResolutionPolicy =
{ {
EXACT_FIT = 0, EXACT_FIT = 0,
NO_BORDER = 1, NO_BORDER = 1,
@ -299,7 +300,7 @@ cc.ResolutionPolicy =
UNKNOWN = 5, UNKNOWN = 5,
} }
cc.LabelEffect = cc.LabelEffect =
{ {
NORMAL = 0, NORMAL = 0,
OUTLINE = 1, OUTLINE = 1,
@ -496,7 +497,7 @@ cc.EventCode =
cc.DIRECTOR_PROJECTION_2D = 0 cc.DIRECTOR_PROJECTION_2D = 0
cc.DIRECTOR_PROJECTION_3D = 1 cc.DIRECTOR_PROJECTION_3D = 1
cc.ConfigType = cc.ConfigType =
{ {
NONE = 0, NONE = 0,
COCOSTUDIO = 1, COCOSTUDIO = 1,
@ -505,7 +506,7 @@ cc.ConfigType =
cc.AUDIO_INVAILD_ID = -1 cc.AUDIO_INVAILD_ID = -1
cc.AUDIO_TIME_UNKNOWN = -1.0 cc.AUDIO_TIME_UNKNOWN = -1.0
cc.CameraFlag = cc.CameraFlag =
{ {
DEFAULT = 1, DEFAULT = 1,
USER1 = 2, USER1 = 2,
@ -518,8 +519,35 @@ cc.CameraFlag =
USER8 = 256, USER8 = 256,
} }
cc.BillBoard_Mode = cc.BillBoard_Mode =
{ {
VIEW_POINT_ORIENTED = 0, VIEW_POINT_ORIENTED = 0,
VIEW_PLANE_ORIENTED = 1, VIEW_PLANE_ORIENTED = 1,
} }
cc.GLProgram_VERTEX_ATTRIB =
{
POSITION = 0,
COLOR = 1,
TEX_COORD = 2,
TEX_COORD1 = 3,
TEX_COORD2 = 4,
TEX_COORD3 = 5,
TEX_COORD4 = 6,
TEX_COORD5 = 7,
TEX_COORD6 = 8,
TEX_COORD7 = 9,
NORMAL = 10,
BLEND_WEIGHT = 11,
BLEND_INDEX =12,
MAX = 13,
--backward compatibility
TEX_COORDS = 2,
}
cc.MATRIX_STACK_TYPE =
{
MODELVIEW = 0,
PROJECTION = 1,
TEXTURE = 2,
}

View File

@ -1,13 +1,12 @@
require "Cocos2dConstants.lua"
require "OpenglConstants.lua"
--Enums will be deprecated,begin --Enums will be deprecated,begin
_G.kCCTextAlignmentLeft = cc.TEXT_ALIGNMENT_LEFT _G.kCCTextAlignmentLeft = cc.TEXT_ALIGNMENT_LEFT
_G.kCCTextAlignmentRight = cc.TEXT_ALIGNMENT_RIGHT _G.kCCTextAlignmentRight = cc.TEXT_ALIGNMENT_RIGHT
_G.kCCTextAlignmentCenter = cc.TEXT_ALIGNMENT_CENTER _G.kCCTextAlignmentCenter = cc.TEXT_ALIGNMENT_CENTER
_G.kCCVerticalTextAlignmentTop = cc.VERTICAL_TEXT_ALIGNMENT_TOP _G.kCCVerticalTextAlignmentTop = cc.VERTICAL_TEXT_ALIGNMENT_TOP
_G.kCCVerticalTextAlignmentCenter = cc.VERTICAL_TEXT_ALIGNMENT_CENTER _G.kCCVerticalTextAlignmentCenter = cc.VERTICAL_TEXT_ALIGNMENT_CENTER
_G.kCCVerticalTextAlignmentBottom = cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM _G.kCCVerticalTextAlignmentBottom = cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM
_G.kCCDirectorProjection3D = cc.DIRECTOR_PROJECTION3_D _G.kCCDirectorProjection3D = cc.DIRECTOR_PROJECTION3_D
_G.kCCDirectorProjection2D = cc.DIRECTOR_PROJECTION2_D _G.kCCDirectorProjection2D = cc.DIRECTOR_PROJECTION2_D
_G.kCCDirectorProjectionCustom = cc.DIRECTOR_PROJECTION_CUSTOM _G.kCCDirectorProjectionCustom = cc.DIRECTOR_PROJECTION_CUSTOM
_G.kCCDirectorProjectionDefault = cc.DIRECTOR_PROJECTION_DEFAULT _G.kCCDirectorProjectionDefault = cc.DIRECTOR_PROJECTION_DEFAULT
@ -18,14 +17,14 @@ _G.kCCTexture2DPixelFormat_RGBA8888 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888
_G.kCCTexture2DPixelFormat_RGB888 = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B888 _G.kCCTexture2DPixelFormat_RGB888 = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B888
_G.kCCTexture2DPixelFormat_RGB565 = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B565 _G.kCCTexture2DPixelFormat_RGB565 = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B565
_G.kCCTexture2DPixelFormat_A8 = cc.TEXTURE2_D_PIXEL_FORMAT_A8 _G.kCCTexture2DPixelFormat_A8 = cc.TEXTURE2_D_PIXEL_FORMAT_A8
_G.kCCTexture2DPixelFormat_I8 = cc.TEXTURE2_D_PIXEL_FORMAT_I8 _G.kCCTexture2DPixelFormat_I8 = cc.TEXTURE2_D_PIXEL_FORMAT_I8
_G.kCCTexture2DPixelFormat_AI88 = cc.TEXTURE2_D_PIXEL_FORMAT_A_I88 _G.kCCTexture2DPixelFormat_AI88 = cc.TEXTURE2_D_PIXEL_FORMAT_A_I88
_G.kCCTexture2DPixelFormat_RGBA4444 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444 _G.kCCTexture2DPixelFormat_RGBA4444 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444
_G.kCCTexture2DPixelFormat_RGB5A1 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1 _G.kCCTexture2DPixelFormat_RGB5A1 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1
_G.kCCTexture2DPixelFormat_PVRTC4 = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4 _G.kCCTexture2DPixelFormat_PVRTC4 = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4
_G.kCCTexture2DPixelFormat_PVRTC2 = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2 _G.kCCTexture2DPixelFormat_PVRTC2 = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2
_G.kCCTexture2DPixelFormat_Default = cc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT _G.kCCTexture2DPixelFormat_Default = cc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT
_G.kCCImageFormatPNG = cc.IMAGE_FORMAT_PNG _G.kCCImageFormatPNG = cc.IMAGE_FORMAT_PNG
_G.kCCImageFormatJPEG = cc.IMAGE_FORMAT_JPEG _G.kCCImageFormatJPEG = cc.IMAGE_FORMAT_JPEG
_G.kCCTouchesOneByOne = cc.TOUCHES_ONE_BY_ONE _G.kCCTouchesOneByOne = cc.TOUCHES_ONE_BY_ONE
_G.kCCTouchesAllAtOnce = cc.TOUCHES_ALL_AT_ONCE _G.kCCTouchesAllAtOnce = cc.TOUCHES_ALL_AT_ONCE
@ -35,18 +34,18 @@ _G.kCCTransitionOrientationUpOver = cc.TRANSITION_ORIENTATION_UP_OVER
_G.kCCTransitionOrientationDownOver = cc.TRANSITION_ORIENTATION_DOWN_OVER _G.kCCTransitionOrientationDownOver = cc.TRANSITION_ORIENTATION_DOWN_OVER
_G.kCCActionTagInvalid = cc.ACTION_TAG_INVALID _G.kCCActionTagInvalid = cc.ACTION_TAG_INVALID
_G.kCCLabelAutomaticWidth = cc.LABEL_AUTOMATIC_WIDTH _G.kCCLabelAutomaticWidth = cc.LABEL_AUTOMATIC_WIDTH
_G.kCCMenuStateWaiting = cc.MENU_STATE_WAITING _G.kCCMenuStateWaiting = cc.MENU_STATE_WAITING
_G.kCCMenuStateTrackingTouch = cc.MENU_STATE_TRACKING_TOUCH _G.kCCMenuStateTrackingTouch = cc.MENU_STATE_TRACKING_TOUCH
_G.kCCMenuHandlerPriority = cc.MENU_HANDLER_PRIORITY _G.kCCMenuHandlerPriority = cc.MENU_HANDLER_PRIORITY
_G.kCCParticleDurationInfinity = cc.PARTICLE_DURATION_INFINITY _G.kCCParticleDurationInfinity = cc.PARTICLE_DURATION_INFINITY
_G.kCCParticleStartSizeEqualToEndSize = cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE _G.kCCParticleStartSizeEqualToEndSize = cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE
_G.kCCParticleStartRadiusEqualToEndRadius = cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS _G.kCCParticleStartRadiusEqualToEndRadius = cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS
_G.kCCParticleModeGravity = cc.PARTICLE_MODE_GRAVITY _G.kCCParticleModeGravity = cc.PARTICLE_MODE_GRAVITY
_G.kCCParticleModeRadius = cc.PARTICLE_MODE_RADIUS _G.kCCParticleModeRadius = cc.PARTICLE_MODE_RADIUS
_G.kCCPositionTypeFree = cc.POSITION_TYPE_FREE _G.kCCPositionTypeFree = cc.POSITION_TYPE_FREE
_G.kCCPositionTypeRelative = cc.POSITION_TYPE_RELATIVE _G.kCCPositionTypeRelative = cc.POSITION_TYPE_RELATIVE
_G.kCCPositionTypeGrouped = cc.POSITION_TYPE_GROUPED _G.kCCPositionTypeGrouped = cc.POSITION_TYPE_GROUPED
_G.kCCProgressTimerTypeRadial = cc.PROGRESS_TIMER_TYPE_RADIAL _G.kCCProgressTimerTypeRadial = cc.PROGRESS_TIMER_TYPE_RADIAL
_G.kCCProgressTimerTypeBar = cc.PROGRESS_TIMER_TYPE_BAR _G.kCCProgressTimerTypeBar = cc.PROGRESS_TIMER_TYPE_BAR
_G.kCCTMXTileHorizontalFlag = cc.TMX_TILE_HORIZONTAL_FLAG _G.kCCTMXTileHorizontalFlag = cc.TMX_TILE_HORIZONTAL_FLAG
_G.kCCTMXTileVerticalFlag = cc.TMX_TILE_VERTICAL_FLAG _G.kCCTMXTileVerticalFlag = cc.TMX_TILE_VERTICAL_FLAG
@ -54,9 +53,9 @@ _G.kCCTMXTileDiagonalFlag = cc.TMX_TILE_DIAGONAL_FLAG
_G.kCCFlipedAll = cc.FLIPED_ALL _G.kCCFlipedAll = cc.FLIPED_ALL
_G.kCCFlippedMask = cc.FLIPPED_MASK _G.kCCFlippedMask = cc.FLIPPED_MASK
_G.kLanguageEnglish = cc.LANGUAGE_ENGLISH _G.kLanguageEnglish = cc.LANGUAGE_ENGLISH
_G.kLanguageChinese = cc.LANGUAGE_CHINESE _G.kLanguageChinese = cc.LANGUAGE_CHINESE
_G.kLanguageFrench = cc.LANGUAGE_FRENCH _G.kLanguageFrench = cc.LANGUAGE_FRENCH
_G.kLanguageItalian = cc.LANGUAGE_ITALIAN _G.kLanguageItalian = cc.LANGUAGE_ITALIAN
_G.kLanguageGerman = cc.LANGUAGE_GERMAN _G.kLanguageGerman = cc.LANGUAGE_GERMAN
_G.kLanguageSpanish = cc.LANGUAGE_SPANISH _G.kLanguageSpanish = cc.LANGUAGE_SPANISH
@ -67,21 +66,21 @@ _G.kLanguageHungarian = cc.LANGUAGE_HUNGARIAN
_G.kLanguagePortuguese = cc.LANGUAGE_PORTUGUESE _G.kLanguagePortuguese = cc.LANGUAGE_PORTUGUESE
_G.kLanguageArabic = cc.LANGUAGE_ARABIC _G.kLanguageArabic = cc.LANGUAGE_ARABIC
_G.kTargetWindows = cc.PLATFORM_OS_WINDOWS _G.kTargetWindows = cc.PLATFORM_OS_WINDOWS
_G.kTargetLinux = cc.PLATFORM_OS_LINUX _G.kTargetLinux = cc.PLATFORM_OS_LINUX
_G.kTargetMacOS = cc.PLATFORM_OS_MAC _G.kTargetMacOS = cc.PLATFORM_OS_MAC
_G.kTargetAndroid = cc.PLATFORM_OS_ANDROID _G.kTargetAndroid = cc.PLATFORM_OS_ANDROID
_G.kTargetIphone = cc.PLATFORM_OS_IPHONE _G.kTargetIphone = cc.PLATFORM_OS_IPHONE
_G.kTargetIpad = cc.PLATFORM_OS_IPAD _G.kTargetIpad = cc.PLATFORM_OS_IPAD
_G.kTargetBlackBerry = cc.PLATFORM_OS_BLACKBERRY _G.kTargetBlackBerry = cc.PLATFORM_OS_BLACKBERRY
_G.GL_ZERO = gl.ZERO _G.GL_ZERO = gl.ZERO
_G.GL_ONE = gl.ONE _G.GL_ONE = gl.ONE
_G.GL_SRC_COLOR = gl.SRC_COLOR _G.GL_SRC_COLOR = gl.SRC_COLOR
_G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR _G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR
_G.GL_SRC_ALPHA = gl.SRC_ALPHA _G.GL_SRC_ALPHA = gl.SRC_ALPHA
_G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA _G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA
_G.GL_DST_ALPHA = gl.DST_ALPHA _G.GL_DST_ALPHA = gl.DST_ALPHA
_G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA _G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA
_G.GL_DST_COLOR = gl.DST_COLOR _G.GL_DST_COLOR = gl.DST_COLOR
_G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR _G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR
_G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT _G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT

View File

@ -1,10 +1,9 @@
require "Cocos2d.lua"
--tip --tip
local function deprecatedTip(old_name,new_name) local function deprecatedTip(old_name,new_name)
print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
end end
--functions of CCDirector will be deprecated,begin --functions of CCDirector will be deprecated,begin
local CCDirectorDeprecated = { } local CCDirectorDeprecated = { }
function CCDirectorDeprecated.sharedDirector() function CCDirectorDeprecated.sharedDirector()
@ -308,7 +307,7 @@ rawset(_G,"ccc3",ccc3)
local function ccp(x,y) local function ccp(x,y)
deprecatedTip("ccp(x,y)","cc.p(x,y)") deprecatedTip("ccp(x,y)","cc.p(x,y)")
return cc.p(x,y) return cc.p(x,y)
end end
rawset(_G,"ccp",ccp) rawset(_G,"ccp",ccp)
local function CCSizeMake(width,height) local function CCSizeMake(width,height)
@ -337,7 +336,7 @@ rawset(_G,"ccc4f",ccc4f)
local function ccc4FFromccc4B(color4B) local function ccc4FFromccc4B(color4B)
deprecatedTip("ccc4FFromccc4B(color4B)","cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)") deprecatedTip("ccc4FFromccc4B(color4B)","cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)")
return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0) return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)
end end
rawset(_G,"ccc4FFromccc4B",ccc4FFromccc4B) rawset(_G,"ccc4FFromccc4B",ccc4FFromccc4B)
@ -360,7 +359,7 @@ rawset(_G,"ccpLineIntersect",ccpLineIntersect)
local function CCPointMake(x,y) local function CCPointMake(x,y)
deprecatedTip("CCPointMake(x,y)","cc.p(x,y)") deprecatedTip("CCPointMake(x,y)","cc.p(x,y)")
return cc.p(x,y) return cc.p(x,y)
end end
rawset(_G,"CCPointMake",CCPointMake) rawset(_G,"CCPointMake",CCPointMake)
@ -494,7 +493,7 @@ rawset(_G,"ccpFromSize",ccpFromSize)
local function ccpLerp(pt1,pt2,alpha) local function ccpLerp(pt1,pt2,alpha)
deprecatedTip("ccpLerp","cc.pLerp") deprecatedTip("ccpLerp","cc.pLerp")
return cc.pLerp(pt1,pt2,alpha) return cc.pLerp(pt1,pt2,alpha)
end end
rawset(_G,"ccpLerp",ccpLerp) rawset(_G,"ccpLerp",ccpLerp)
@ -557,11 +556,11 @@ local function tex2(u,v)
deprecatedTip("tex2(u,v)","cc.tex2f(u,v)") deprecatedTip("tex2(u,v)","cc.tex2f(u,v)")
return cc.tex2f(u,v) return cc.tex2f(u,v)
end end
rawset(_G,"tex2",tex2) rawset(_G,"tex2",tex2)
local function ccc4BFromccc4F(color4F) local function ccc4BFromccc4F(color4F)
deprecatedTip("ccc4BFromccc4F(color4F)","Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)") deprecatedTip("ccc4BFromccc4F(color4F)","Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)")
return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0) return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)
end end
rawset(_G,"ccc4BFromccc4F",ccc4BFromccc4F) rawset(_G,"ccc4BFromccc4F",ccc4BFromccc4F)

View File

@ -1,3 +1,4 @@
local dp_initialized = false local dp_initialized = false
local dp_shader = nil local dp_shader = nil
local dp_colorLocation = -1 local dp_colorLocation = -1
@ -31,7 +32,7 @@ end
local function setDrawProperty() local function setDrawProperty()
gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION ) gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION )
dp_shader:use() dp_shader:use()
dp_shader:setUniformsForBuiltins() dp_shader:setUniformsForBuiltins()
dp_shader:setUniformLocationWith4fv(dp_colorLocation, dp_color, 1) dp_shader:setUniformLocationWith4fv(dp_colorLocation, dp_color, 1)
end end
@ -204,7 +205,7 @@ function ccDrawSolidPoly(points,numOfPoints,color)
gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION ) gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION )
dp_shader:use() dp_shader:use()
dp_shader:setUniformsForBuiltins() dp_shader:setUniformsForBuiltins()
dp_shader:setUniformLocationWith4fv(dp_colorLocation, color, 1) dp_shader:setUniformLocationWith4fv(dp_colorLocation, color, 1)
gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)
@ -316,7 +317,7 @@ function ccDrawQuadBezier(origin, control, destination, segments)
local vertexBuffer = { } local vertexBuffer = { }
local function initBuffer() local function initBuffer()
local vertices = { } local vertices = { }
local i = 1 local i = 1
local t = 0.0 local t = 0.0
@ -325,7 +326,7 @@ function ccDrawQuadBezier(origin, control, destination, segments)
vertices[2 * i] = math.pow(1 - t,2) * origin.y + 2.0 * (1 - t) * t * control.y + t * t * destination.y vertices[2 * i] = math.pow(1 - t,2) * origin.y + 2.0 * (1 - t) * t * control.y + t * t * destination.y
t = t + 1.0 / segments t = t + 1.0 / segments
end end
vertices[2 * (segments + 1) - 1] = destination.x vertices[2 * (segments + 1) - 1] = destination.x
vertices[2 * (segments + 1)] = destination.y vertices[2 * (segments + 1)] = destination.y
@ -353,7 +354,7 @@ function ccDrawCubicBezier(origin, control1, control2, destination, segments)
local vertexBuffer = { } local vertexBuffer = { }
local function initBuffer() local function initBuffer()
local vertices = { } local vertices = { }
local t = 0 local t = 0
local i = 1 local i = 1

View File

@ -1,6 +1,5 @@
require "OpenglConstants"
gl = gl or {} if not gl then return end
--Create functions --Create functions
function gl.createTexture() function gl.createTexture()
@ -112,7 +111,7 @@ function gl.bindTexture(target, texture)
end end
gl._bindTexture(target,texture_id) gl._bindTexture(target,texture_id)
end end
function gl.bindBuffer( target,buffer ) function gl.bindBuffer( target,buffer )
local buffer_id = 0 local buffer_id = 0
@ -211,7 +210,7 @@ function gl.linkProgram( program )
gl._linkProgram(program_id) gl._linkProgram(program_id)
end end
function gl.getProgramParameter(program, e) function gl.getProgramParameter(program, e)
local program_id = 0 local program_id = 0
if "number" == type(program) then if "number" == type(program) then
@ -296,4 +295,3 @@ end
function gl.glNodeCreate() function gl.glNodeCreate()
return cc.GLNode:create() return cc.GLNode:create()
end end

View File

@ -1,5 +1,5 @@
--Encapsulate opengl constants.
gl = gl or {} if not gl then return end
gl.GCCSO_SHADER_BINARY_FJ = 0x9260 gl.GCCSO_SHADER_BINARY_FJ = 0x9260
gl._3DC_XY_AMD = 0x87fa gl._3DC_XY_AMD = 0x87fa
@ -822,3 +822,5 @@ gl.WRITEONLY_RENDERING_QCOM = 0x8823
gl.WRITE_ONLY_OES = 0x88b9 gl.WRITE_ONLY_OES = 0x88b9
gl.Z400_BINARY_AMD = 0x8740 gl.Z400_BINARY_AMD = 0x8740
gl.ZERO = 0x0 gl.ZERO = 0x0
gl.VERTEX_ATTRIB_POINTER_VEC3 = 0
gl.VERTEX_ATTRIB_POINTER_COLOR4B = 1

View File

@ -2,15 +2,16 @@
bit = bit or {} bit = bit or {}
bit.data32 = {} bit.data32 = {}
for i=1,32 do for i=1,32 do
bit.data32[i]=2^(32-i) bit.data32[i]=2^(32-i)
end end
function bit._b2d(arg) function bit._b2d(arg)
local nr=0 local nr=0
for i=1,32 do for i=1,32 do
if arg[i] ==1 then if arg[i] ==1 then
nr=nr+bit.data32[i] nr=nr+bit.data32[i]
end end
end end
return nr return nr
@ -18,23 +19,23 @@ end
function bit._d2b(arg) function bit._d2b(arg)
arg = arg >= 0 and arg or (0xFFFFFFFF + arg + 1) arg = arg >= 0 and arg or (0xFFFFFFFF + arg + 1)
local tr={} local tr={}
for i=1,32 do for i=1,32 do
if arg >= bit.data32[i] then if arg >= bit.data32[i] then
tr[i]=1 tr[i]=1
arg=arg-bit.data32[i] arg=arg-bit.data32[i]
else else
tr[i]=0 tr[i]=0
end end
end end
return tr return tr
end end
function bit._and(a,b) function bit._and(a,b)
local op1=bit._d2b(a) local op1=bit._d2b(a)
local op2=bit._d2b(b) local op2=bit._d2b(b)
local r={} local r={}
for i=1,32 do for i=1,32 do
if op1[i]==1 and op2[i]==1 then if op1[i]==1 and op2[i]==1 then
r[i]=1 r[i]=1
@ -43,11 +44,11 @@ function bit._and(a,b)
end end
end end
return bit._b2d(r) return bit._b2d(r)
end end
function bit._rshift(a,n) function bit._rshift(a,n)
local op1=bit._d2b(a) local op1=bit._d2b(a)
n = n <= 32 and n or 32 n = n <= 32 and n or 32
n = n >= 0 and n or 0 n = n >= 0 and n or 0
@ -57,13 +58,13 @@ function bit._rshift(a,n)
for i=1, n do for i=1, n do
op1[i] = 0 op1[i] = 0
end end
return bit._b2d(op1) return bit._b2d(op1)
end end
function bit._not(a) function bit._not(a)
local op1=bit._d2b(a) local op1=bit._d2b(a)
local r={} local r={}
for i=1,32 do for i=1,32 do
if op1[i]==1 then if op1[i]==1 then
@ -72,14 +73,14 @@ function bit._not(a)
r[i]=1 r[i]=1
end end
end end
return bit._b2d(r) return bit._b2d(r)
end end
function bit._or(a,b) function bit._or(a,b)
local op1=bit._d2b(a) local op1=bit._d2b(a)
local op2=bit._d2b(b) local op2=bit._d2b(b)
local r={} local r={}
for i=1,32 do for i=1,32 do
if op1[i]==1 or op2[i]==1 then if op1[i]==1 or op2[i]==1 then
r[i]=1 r[i]=1
@ -87,9 +88,9 @@ function bit._or(a,b)
r[i]=0 r[i]=0
end end
end end
return bit._b2d(r) return bit._b2d(r)
end end
bit.band = bit.band or bit._and bit.band = bit.band or bit._and
bit.rshift = bit.rshift or bit._rshift bit.rshift = bit.rshift or bit._rshift
bit.bnot = bit.bnot or bit._not bit.bnot = bit.bnot or bit._not

View File

@ -1,3 +1,4 @@
function clone(object) function clone(object)
local lookup_table = {} local lookup_table = {}
local function _copy(object) local function _copy(object)
@ -90,4 +91,3 @@ function performWithDelay(node, callback, delay)
node:runAction(sequence) node:runAction(sequence)
return sequence return sequence
end end

View File

@ -18,7 +18,7 @@
-- compat-5.1 if using Lua 5.0 -- compat-5.1 if using Lua 5.0
-- --
-- CHANGELOG -- CHANGELOG
-- 0.9.20 Introduction of local Lua functions for private functions (removed _ function prefix). -- 0.9.20 Introduction of local Lua functions for private functions (removed _ function prefix).
-- Fixed Lua 5.1 compatibility issues. -- Fixed Lua 5.1 compatibility issues.
-- Introduced json.null to have null values in associative arrays. -- Introduced json.null to have null values in associative arrays.
-- encode() performance improvement (more than 50%) through table.concat rather than .. -- encode() performance improvement (more than 50%) through table.concat rather than ..
@ -65,19 +65,19 @@ function encode (v)
if v==nil then if v==nil then
return "null" return "null"
end end
local vtype = base.type(v) local vtype = base.type(v)
-- Handle strings -- Handle strings
if vtype=='string' then if vtype=='string' then
return '"' .. encodeString(v) .. '"' -- Need to handle encoding in string return '"' .. encodeString(v) .. '"' -- Need to handle encoding in string
end end
-- Handle booleans -- Handle booleans
if vtype=='number' or vtype=='boolean' then if vtype=='number' or vtype=='boolean' then
return base.tostring(v) return base.tostring(v)
end end
-- Handle tables -- Handle tables
if vtype=='table' then if vtype=='table' then
local rval = {} local rval = {}
@ -100,12 +100,12 @@ function encode (v)
return '{' .. table.concat(rval,',') .. '}' return '{' .. table.concat(rval,',') .. '}'
end end
end end
-- Handle null values -- Handle null values
if vtype=='function' and v==null then if vtype=='function' and v==null then
return 'null' return 'null'
end end
base.assert(false,'encode attempt to encode unsupported type ' .. vtype .. ':' .. base.tostring(v)) base.assert(false,'encode attempt to encode unsupported type ' .. vtype .. ':' .. base.tostring(v))
end end
@ -191,14 +191,14 @@ function decode_scanComment(s, startPos)
base.assert( string.sub(s,startPos,startPos+1)=='/*', "decode_scanComment called but comment does not start at position " .. startPos) base.assert( string.sub(s,startPos,startPos+1)=='/*', "decode_scanComment called but comment does not start at position " .. startPos)
local endPos = string.find(s,'*/',startPos+2) local endPos = string.find(s,'*/',startPos+2)
base.assert(endPos~=nil, "Unterminated comment in string at " .. startPos) base.assert(endPos~=nil, "Unterminated comment in string at " .. startPos)
return endPos+2 return endPos+2
end end
--- Scans for given constants: true, false or null --- Scans for given constants: true, false or null
-- Returns the appropriate Lua type, and the position of the next character to read. -- Returns the appropriate Lua type, and the position of the next character to read.
-- @param s The string being scanned. -- @param s The string being scanned.
-- @param startPos The position in the string at which to start scanning. -- @param startPos The position in the string at which to start scanning.
-- @return object, int The object (true, false or nil) and the position at which the next character should be -- @return object, int The object (true, false or nil) and the position at which the next character should be
-- scanned. -- scanned.
function decode_scanConstant(s, startPos) function decode_scanConstant(s, startPos)
local consts = { ["true"] = true, ["false"] = false, ["null"] = nil } local consts = { ["true"] = true, ["false"] = false, ["null"] = nil }
@ -290,7 +290,7 @@ function decode_scanString(s,startPos)
local stringLen = string.len(s) local stringLen = string.len(s)
repeat repeat
local curChar = string.sub(s,endPos,endPos) local curChar = string.sub(s,endPos,endPos)
if not escaped then if not escaped then
if curChar==[[\]] then if curChar==[[\]] then
escaped = true escaped = true
else else
@ -306,7 +306,7 @@ function decode_scanString(s,startPos)
local stringValue = 'return ' .. string.sub(s, startPos, endPos-1) local stringValue = 'return ' .. string.sub(s, startPos, endPos-1)
local stringEval = base.loadstring(stringValue) local stringEval = base.loadstring(stringValue)
base.assert(stringEval, 'Failed to load string [ ' .. stringValue .. '] in JSON4Lua.decode_scanString at position ' .. startPos .. ' : ' .. endPos) base.assert(stringEval, 'Failed to load string [ ' .. stringValue .. '] in JSON4Lua.decode_scanString at position ' .. startPos .. ' : ' .. endPos)
return stringEval(), endPos return stringEval(), endPos
end end
--- Scans a JSON string skipping all whitespace from the current start position. --- Scans a JSON string skipping all whitespace from the current start position.
@ -334,7 +334,7 @@ function encodeString(s)
s = string.gsub(s,"'","\\'") s = string.gsub(s,"'","\\'")
s = string.gsub(s,'\n','\\n') s = string.gsub(s,'\n','\\n')
s = string.gsub(s,'\t','\\t') s = string.gsub(s,'\t','\\t')
return s return s
end end
-- Determines whether the given Lua type is an array or a table / dictionary. -- Determines whether the given Lua type is an array or a table / dictionary.
@ -344,9 +344,9 @@ end
-- @param t The table to evaluate as an array -- @param t The table to evaluate as an array
-- @return boolean, number True if the table can be represented as an array, false otherwise. If true, -- @return boolean, number True if the table can be represented as an array, false otherwise. If true,
-- the second returned value is the maximum -- the second returned value is the maximum
-- number of indexed elements in the array. -- number of indexed elements in the array.
function isArray(t) function isArray(t)
-- Next we count all the elements, ensuring that any non-indexed elements are not-encodable -- Next we count all the elements, ensuring that any non-indexed elements are not-encodable
-- (with the possible exception of 'n') -- (with the possible exception of 'n')
local maxIndex = 0 local maxIndex = 0
for k,v in base.pairs(t) do for k,v in base.pairs(t) do
@ -371,6 +371,6 @@ end
-- @return boolean True if the object should be JSON encoded, false if it should be ignored. -- @return boolean True if the object should be JSON encoded, false if it should be ignored.
function isEncodable(o) function isEncodable(o)
local t = base.type(o) local t = base.type(o)
return (t=='string' or t=='boolean' or t=='number' or t=='nil' or t=='table') or (t=='function' and o==null) return (t=='string' or t=='boolean' or t=='number' or t=='nil' or t=='table') or (t=='function' and o==null)
end end

View File

@ -1,4 +1,5 @@
--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects.
--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects.
local M = {} local M = {}
function M.stopAllEffects() function M.stopAllEffects()
@ -105,16 +106,4 @@ function M.destroyInstance()
return cc.SimpleAudioEngine:destroyInstance() return cc.SimpleAudioEngine:destroyInstance()
end end
local modename = "AudioEngine" AudioEngine = M
local proxy = {}
local mt = {
__index = M,
__newindex = function (t ,k ,v)
print("attemp to update a read-only table")
end
}
setmetatable(proxy,mt)
_G[modename] = proxy
package.loaded[modename] = proxy

View File

@ -1,11 +1,15 @@
require "json"
require "extern" if not json then
require "cocos.cocos2d.json"
end
ccs = ccs or {} ccs = ccs or {}
require "cocos.cocosstudio.StudioConstants"
function ccs.sendTriggerEvent(event) function ccs.sendTriggerEvent(event)
local triggerObjArr = ccs.TriggerMng.getInstance():get(event) local triggerObjArr = ccs.TriggerMng.getInstance():get(event)
if nil == triggerObjArr then if nil == triggerObjArr then
return return
end end
@ -106,7 +110,7 @@ end
function ccs.TriggerObj:detect() function ccs.TriggerObj:detect()
if (not self._enable) or (table.getn(self._cons) == 0) then if (not self._enable) or (table.getn(self._cons) == 0) then
return true return true
end end
local ret = true local ret = true
local obj = nil local obj = nil
@ -355,7 +359,7 @@ end
function ccs.TriggerMng:removeTriggerObj(id) function ccs.TriggerMng:removeTriggerObj(id)
local obj = self.getTriggerObj(id) local obj = self.getTriggerObj(id)
if nil == obj then if nil == obj then
return false return false
end end

View File

@ -1,8 +1,8 @@
ccs = ccs or {}
ccs = ccs or {}
ccs.MovementEventType = { ccs.MovementEventType = {
start = 0, start = 0,
complete = 1, complete = 1,
loopComplete = 2, loopComplete = 2,
} }

View File

@ -1,3 +1,4 @@
cc = cc or {} cc = cc or {}
cc.ControllerKey = cc.ControllerKey =
@ -13,7 +14,7 @@ cc.ControllerKey =
BUTTON_X = 1007, BUTTON_X = 1007,
BUTTON_Y = 1008, BUTTON_Y = 1008,
BUTTON_Z = 1009, BUTTON_Z = 1009,
BUTTON_DPAD_UP = 1010, BUTTON_DPAD_UP = 1010,
BUTTON_DPAD_DOWN = 1011, BUTTON_DPAD_DOWN = 1011,
BUTTON_DPAD_LEFT = 1012, BUTTON_DPAD_LEFT = 1012,

View File

@ -1,3 +1,4 @@
cc = cc or {} cc = cc or {}
cc.CONTROL_STATE_NORMAL = 1 cc.CONTROL_STATE_NORMAL = 1

View File

@ -0,0 +1,55 @@
require "cocos.cocos2d.Cocos2d"
require "cocos.cocos2d.Cocos2dConstants"
require "cocos.cocos2d.extern"
-- opengl
require "cocos.cocos2d.Opengl"
require "cocos.cocos2d.OpenglConstants"
-- cocosdenshion
require "cocos.cocosdenshion.AudioEngine"
-- cocosstudio
require "cocos.cocosstudio.CocosStudio"
-- ui
require "cocos.ui.GuiConstants"
-- extensions
require "cocos.extension.ExtensionConstants"
-- network
require "cocos.network.NetworkConstants"
if CC_USE_DEPRECATED_API then
-- CCLuaEngine
require "cocos.cocos2d.DeprecatedCocos2dClass"
require "cocos.cocos2d.DeprecatedCocos2dEnum"
require "cocos.cocos2d.DeprecatedCocos2dFunc"
-- register_cocostudio_module
require "cocos.cocosstudio.DeprecatedCocoStudioClass"
require "cocos.cocosstudio.DeprecatedCocoStudioFunc"
-- register_cocosbuilder_module
require "cocos.cocosbuilder.DeprecatedCocosBuilderClass"
-- register_cocosdenshion_module
require "cocos.cocosdenshion.DeprecatedCocosDenshionClass"
require "cocos.cocosdenshion.DeprecatedCocosDenshionFunc"
-- register_extension_module
require "cocos.extension.DeprecatedExtensionClass"
require "cocos.extension.DeprecatedExtensionEnum"
require "cocos.extension.DeprecatedExtensionFunc"
-- register_network_module
require "cocos.network.DeprecatedNetworkClass"
require "cocos.network.DeprecatedNetworkEnum"
require "cocos.network.DeprecatedNetworkFunc"
-- register_ui_moudle
require "cocos.ui.DeprecatedUIEnum"
require "cocos.ui.DeprecatedUIFunc"
end

View File

@ -1,3 +1,4 @@
cc = cc or {} cc = cc or {}
cc.WEBSOCKET_OPEN = 0 cc.WEBSOCKET_OPEN = 0
@ -10,9 +11,8 @@ cc.WEBSOCKET_STATE_OPEN = 1
cc.WEBSOCKET_STATE_CLOSING = 2 cc.WEBSOCKET_STATE_CLOSING = 2
cc.WEBSOCKET_STATE_CLOSED = 3 cc.WEBSOCKET_STATE_CLOSED = 3
cc.XMLHTTPREQUEST_RESPONSE_STRING = 0
cc.XMLHTTPREQUEST_RESPONSE_STRING = 0
cc.XMLHTTPREQUEST_RESPONSE_ARRAY_BUFFER = 1 cc.XMLHTTPREQUEST_RESPONSE_ARRAY_BUFFER = 1
cc.XMLHTTPREQUEST_RESPONSE_BLOB = 2 cc.XMLHTTPREQUEST_RESPONSE_BLOB = 2
cc.XMLHTTPREQUEST_RESPONSE_DOCUMENT = 3 cc.XMLHTTPREQUEST_RESPONSE_DOCUMENT = 3
cc.XMLHTTPREQUEST_RESPONSE_JSON = 4 cc.XMLHTTPREQUEST_RESPONSE_JSON = 4

View File

@ -1,92 +1,91 @@
require("GuiConstants")
_G.LAYOUT_COLOR_NONE = ccui.LayoutBackGroundColorType.none LAYOUT_COLOR_NONE = ccui.LayoutBackGroundColorType.none
_G.LAYOUT_COLOR_SOLID = ccui.LayoutBackGroundColorType.solid LAYOUT_COLOR_SOLID = ccui.LayoutBackGroundColorType.solid
_G.LAYOUT_COLOR_GRADIENT = ccui.LayoutBackGroundColorType.gradient LAYOUT_COLOR_GRADIENT = ccui.LayoutBackGroundColorType.gradient
_G.LAYOUT_ABSOLUTE = ccui.LayoutType.ABSOLUTE LAYOUT_ABSOLUTE = ccui.LayoutType.ABSOLUTE
_G.LAYOUT_LINEAR_VERTICAL = ccui.LayoutType.VERTICAL LAYOUT_LINEAR_VERTICAL = ccui.LayoutType.VERTICAL
_G.LAYOUT_LINEAR_HORIZONTAL = ccui.LayoutType.HORIZONTAL LAYOUT_LINEAR_HORIZONTAL = ccui.LayoutType.HORIZONTAL
_G.LAYOUT_RELATIVE = ccui.LayoutType.RELATIVE LAYOUT_RELATIVE = ccui.LayoutType.RELATIVE
_G.BRIGHT_NONE = ccui.BrightStyle.none BRIGHT_NONE = ccui.BrightStyle.none
_G.BRIGHT_NORMAL = ccui.BrightStyle.normal BRIGHT_NORMAL = ccui.BrightStyle.normal
_G.BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight
_G.UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType
_G.UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType
_G.TOUCH_EVENT_BEGAN = ccui.TouchEventType.began TOUCH_EVENT_BEGAN = ccui.TouchEventType.began
_G.TOUCH_EVENT_MOVED = ccui.TouchEventType.moved TOUCH_EVENT_MOVED = ccui.TouchEventType.moved
_G.TOUCH_EVENT_ENDED = ccui.TouchEventType.ended TOUCH_EVENT_ENDED = ccui.TouchEventType.ended
_G.TOUCH_EVENT_CANCELED = ccui.TouchEventType.canceled TOUCH_EVENT_CANCELED = ccui.TouchEventType.canceled
_G.SIZE_ABSOLUTE = ccui.SizeType.absolute
_G.SIZE_PERCENT = ccui.SizeType.percent
_G.POSITION_ABSOLUTE = ccui.PositionType.absolute SIZE_ABSOLUTE = ccui.SizeType.absolute
_G.POSITION_PERCENT = ccui.PositionType.percent SIZE_PERCENT = ccui.SizeType.percent
_G.CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected POSITION_ABSOLUTE = ccui.PositionType.absolute
_G.CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected POSITION_PERCENT = ccui.PositionType.percent
_G.CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected
_G.CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected
_G.LoadingBarTypeLeft = ccui.LoadingBarDirection.LEFT CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected
_G.LoadingBarTypeRight = ccui.LoadingBarDirection.RIGHT CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected
_G.LoadingBarTypeRight = ccui.SliderEventType.percent_changed LoadingBarTypeLeft = ccui.LoadingBarDirection.LEFT
LoadingBarTypeRight = ccui.LoadingBarDirection.RIGHT
_G.TEXTFIELD_EVENT_ATTACH_WITH_IME = ccui.TextFiledEventType.attach_with_ime LoadingBarTypeRight = ccui.SliderEventType.percent_changed
_G.TEXTFIELD_EVENT_DETACH_WITH_IME = ccui.TextFiledEventType.detach_with_ime
_G.TEXTFIELD_EVENT_INSERT_TEXT = ccui.TextFiledEventType.insert_text
_G.TEXTFIELD_EVENT_DELETE_BACKWARD = ccui.TextFiledEventType.delete_backward
_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollViewDir.none TEXTFIELD_EVENT_ATTACH_WITH_IME = ccui.TextFiledEventType.attach_with_ime
_G.SCROLLVIEW_DIR_VERTICAL = ccui.ScrollViewDir.vertical TEXTFIELD_EVENT_DETACH_WITH_IME = ccui.TextFiledEventType.detach_with_ime
_G.SCROLLVIEW_DIR_HORIZONTAL = ccui.ScrollViewDir.horizontal TEXTFIELD_EVENT_INSERT_TEXT = ccui.TextFiledEventType.insert_text
_G.SCROLLVIEW_DIR_BOTH = ccui.ScrollViewDir.both TEXTFIELD_EVENT_DELETE_BACKWARD = ccui.TextFiledEventType.delete_backward
_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.scrollToTop SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollViewDir.none
_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.scrollToBottom SCROLLVIEW_DIR_VERTICAL = ccui.ScrollViewDir.vertical
_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.scrollToLeft SCROLLVIEW_DIR_HORIZONTAL = ccui.ScrollViewDir.horizontal
_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.scrollToRight SCROLLVIEW_DIR_BOTH = ccui.ScrollViewDir.both
_G.SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.scrolling
_G.SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop
_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom
_G.SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft
_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight
_G.PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.scrollToTop
SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.scrollToBottom
SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.scrollToLeft
SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.scrollToRight
SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.scrolling
SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop
SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom
SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft
SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight
_G.PAGEVIEW_TOUCHLEFT = ccui.PVTouchDir.touch_left PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning
_G.PAGEVIEW_TOUCHRIGHT = ccui.PVTouchDir.touch_right
_G.LISTVIEW_DIR_NONE = ccui.ListViewDirection.none PAGEVIEW_TOUCHLEFT = ccui.PVTouchDir.touch_left
_G.LISTVIEW_DIR_VERTICAL = ccui.ListViewDirection.vertical PAGEVIEW_TOUCHRIGHT = ccui.PVTouchDir.touch_right
_G.LISTVIEW_DIR_HORIZONTAL = ccui.ListViewDirection.horizontal
_G.LISTVIEW_MOVE_DIR_NONE = ccui.ListViewMoveDirection.none LISTVIEW_DIR_NONE = ccui.ListViewDirection.none
_G.LISTVIEW_MOVE_DIR_UP = ccui.ListViewMoveDirection.up LISTVIEW_DIR_VERTICAL = ccui.ListViewDirection.vertical
_G.LISTVIEW_MOVE_DIR_DOWN = ccui.ListViewMoveDirection.down LISTVIEW_DIR_HORIZONTAL = ccui.ListViewDirection.horizontal
_G.LISTVIEW_MOVE_DIR_LEFT = ccui.ListViewMoveDirection.left
_G.LISTVIEW_MOVE_DIR_RIGHT = ccui.ListViewMoveDirection.right
_G.LISTVIEW_EVENT_INIT_CHILD = ccui.ListViewEventType.init_child LISTVIEW_MOVE_DIR_NONE = ccui.ListViewMoveDirection.none
_G.LISTVIEW_EVENT_UPDATE_CHILD = ccui.ListViewEventType.update_child LISTVIEW_MOVE_DIR_UP = ccui.ListViewMoveDirection.up
LISTVIEW_MOVE_DIR_DOWN = ccui.ListViewMoveDirection.down
LISTVIEW_MOVE_DIR_LEFT = ccui.ListViewMoveDirection.left
LISTVIEW_MOVE_DIR_RIGHT = ccui.ListViewMoveDirection.right
_G.LAYOUT_PARAMETER_NONE = ccui.LayoutParameterType.none LISTVIEW_EVENT_INIT_CHILD = ccui.ListViewEventType.init_child
_G.LAYOUT_PARAMETER_LINEAR = ccui.LayoutParameterType.linear LISTVIEW_EVENT_UPDATE_CHILD = ccui.ListViewEventType.update_child
_G.LAYOUT_PARAMETER_RELATIVE = ccui.LayoutParameterType.relative
ccui.LoadingBarType = ccui.LoadingBarDirection LAYOUT_PARAMETER_NONE = ccui.LayoutParameterType.none
ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT LAYOUT_PARAMETER_LINEAR = ccui.LayoutParameterType.linear
ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT LAYOUT_PARAMETER_RELATIVE = ccui.LayoutParameterType.relative
ccui.LayoutType.absolute = ccui.LayoutType.ABSOLUTE ccui.LoadingBarType = ccui.LoadingBarDirection
ccui.LayoutType.linearVertical = ccui.LayoutType.VERTICAL ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT
ccui.LayoutType.linearHorizontal = ccui.LayoutType.HORIZONTAL ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT
ccui.LayoutType.relative = ccui.LayoutType.RELATIVE
ccui.ListViewEventType.onsSelectedItem = ccui.ListViewEventType.ONSELECTEDITEM_START ccui.LayoutType.absolute = ccui.LayoutType.ABSOLUTE
ccui.LayoutType.linearVertical = ccui.LayoutType.VERTICAL
ccui.LayoutType.linearHorizontal = ccui.LayoutType.HORIZONTAL
ccui.LayoutType.relative = ccui.LayoutType.RELATIVE
ccui.ListViewEventType.onsSelectedItem = ccui.ListViewEventType.ONSELECTEDITEM_START

View File

@ -1,19 +1,20 @@
ccui = ccui or {} ccui = ccui or {}
ccui.BrightStyle = ccui.BrightStyle =
{ {
none = -1, none = -1,
normal = 0, normal = 0,
highlight = 1, highlight = 1,
} }
ccui.TextureResType = ccui.TextureResType =
{ {
localType = 0, localType = 0,
plistType = 1, plistType = 1,
} }
ccui.TouchEventType = ccui.TouchEventType =
{ {
began = 0, began = 0,
moved = 1, moved = 1,
@ -21,7 +22,7 @@ ccui.TouchEventType =
canceled = 3, canceled = 3,
} }
ccui.SizeType = ccui.SizeType =
{ {
absolute = 0, absolute = 0,
percent = 1, percent = 1,
@ -32,13 +33,13 @@ ccui.PositionType = {
percent = 1, percent = 1,
} }
ccui.CheckBoxEventType = ccui.CheckBoxEventType =
{ {
selected = 0, selected = 0,
unselected = 1, unselected = 1,
} }
ccui.TextFiledEventType = ccui.TextFiledEventType =
{ {
attach_with_ime = 0, attach_with_ime = 0,
detach_with_ime = 1, detach_with_ime = 1,
@ -46,14 +47,14 @@ ccui.TextFiledEventType =
delete_backward = 3, delete_backward = 3,
} }
ccui.LayoutBackGroundColorType = ccui.LayoutBackGroundColorType =
{ {
none = 0, none = 0,
solid = 1, solid = 1,
gradient = 2, gradient = 2,
} }
ccui.LayoutType = ccui.LayoutType =
{ {
ABSOLUTE = 0, ABSOLUTE = 0,
VERTICAL = 1, VERTICAL = 1,
@ -61,14 +62,14 @@ ccui.LayoutType =
RELATIVE = 3, RELATIVE = 3,
} }
ccui.LayoutParameterType = ccui.LayoutParameterType =
{ {
none = 0, none = 0,
linear = 1, linear = 1,
relative = 2, relative = 2,
} }
ccui.LinearGravity = ccui.LinearGravity =
{ {
none = 0, none = 0,
left = 1, left = 1,
@ -79,7 +80,7 @@ ccui.LinearGravity =
centerHorizontal = 6, centerHorizontal = 6,
} }
ccui.RelativeAlign = ccui.RelativeAlign =
{ {
alignNone = 0, alignNone = 0,
alignParentTopLeft = 1, alignParentTopLeft = 1,
@ -156,7 +157,7 @@ ccui.ListViewEventType = {
} }
ccui.PageViewEventType = { ccui.PageViewEventType = {
turning = 0, turning = 0,
} }
ccui.PVTouchDir = { ccui.PVTouchDir = {

View File

@ -638,6 +638,11 @@ void Button::setPressedActionEnabled(bool enabled)
void Button::setTitleText(const std::string& text) void Button::setTitleText(const std::string& text)
{ {
_titleRenderer->setString(text); _titleRenderer->setString(text);
if (_ignoreSize)
{
Size s = getVirtualRendererSize();
this->setContentSize(s);
}
} }
const std::string& Button::getTitleText() const const std::string& Button::getTitleText() const

View File

@ -34,6 +34,60 @@
#define getEditBoxImplMac() ((cocos2d::ui::EditBoxImplMac*)editBox_) #define getEditBoxImplMac() ((cocos2d::ui::EditBoxImplMac*)editBox_)
@interface CustomTextFieldFormatter : NSFormatter {
int maxLength;
}
- (void)setMaximumLength:(int)len;
- (int)maximumLength;
@end
@implementation CustomTextFieldFormatter
- (id)init {
if(self = [super init]){
maxLength = INT_MAX;
}
return self;
}
- (void)setMaximumLength:(int)len {
maxLength = len;
}
- (int)maximumLength {
return maxLength;
}
- (NSString *)stringForObjectValue:(id)object {
return (NSString *)object;
}
- (BOOL)getObjectValue:(id *)object forString:(NSString *)string errorDescription:(NSString **)error {
*object = string;
return YES;
}
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr
proposedSelectedRange:(NSRangePointer)proposedSelRangePtr
originalString:(NSString *)origString
originalSelectedRange:(NSRange)origSelRange
errorDescription:(NSString **)error {
if ([*partialStringPtr length] > maxLength) {
return NO;
}
return YES;
}
- (NSAttributedString *)attributedStringForObjectValue:(id)anObject withDefaultAttributes:(NSDictionary *)attributes {
return nil;
}
@end
@implementation UIEditBoxImplMac @implementation UIEditBoxImplMac
@ -206,28 +260,6 @@
#endif #endif
} }
/**
* Delegate method called before the text has been changed.
* @param textField The text field containing the text.
* @param range The range of characters to be replaced.
* @param string The replacement string.
* @return YES if the specified text range should be replaced; otherwise, NO to keep the old text.
*/
- (BOOL)textField:(NSTextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (getEditBoxImplMac()->getMaxLength() < 0)
{
return YES;
}
NSUInteger oldLength = [[textField stringValue] length];
NSUInteger replacementLength = [string length];
NSUInteger rangeLength = range.length;
NSUInteger newLength = oldLength - rangeLength + replacementLength;
return newLength <= getEditBoxImplMac()->getMaxLength();
}
/** /**
* Called each time when the text field's text has changed. * Called each time when the text field's text has changed.
@ -364,6 +396,10 @@ void EditBoxImplMac::setInputMode(EditBox::InputMode inputMode)
void EditBoxImplMac::setMaxLength(int maxLength) void EditBoxImplMac::setMaxLength(int maxLength)
{ {
_maxTextLength = maxLength; _maxTextLength = maxLength;
id formater = [[[CustomTextFieldFormatter alloc]init] autorelease];
[formater setMaximumLength:maxLength];
[_sysEdit.secureTextField setFormatter:formater];
[_sysEdit.textField setFormatter:formater];
} }
int EditBoxImplMac::getMaxLength() int EditBoxImplMac::getMaxLength()

View File

@ -828,7 +828,7 @@ y+=ytranslate; \
void Scale9Sprite::setSpriteFrame(SpriteFrame * spriteFrame, const Rect& capInsets) void Scale9Sprite::setSpriteFrame(SpriteFrame * spriteFrame, const Rect& capInsets)
{ {
Sprite * sprite = Sprite::createWithTexture(spriteFrame->getTexture()); Sprite * sprite = Sprite::createWithTexture(spriteFrame->getTexture());
this->updateWithSprite(sprite, spriteFrame->getRect(), spriteFrame->isRotated(), spriteFrame->getOffset(), spriteFrame->getOriginalSize(), Rect::ZERO); this->updateWithSprite(sprite, spriteFrame->getRect(), spriteFrame->isRotated(), spriteFrame->getOffset(), spriteFrame->getOriginalSize(), capInsets);
// Reset insets // Reset insets
this->_insetLeft = capInsets.origin.x; this->_insetLeft = capInsets.origin.x;

View File

@ -1,5 +1,5 @@
{ {
"version":"v3-deps-12", "version":"v3-deps-14",
"zip_file_size":"70810291", "zip_file_size":"70810291",
"repo_name":"cocos2d-x-3rd-party-libs-bin", "repo_name":"cocos2d-x-3rd-party-libs-bin",
"repo_parent":"https://github.com/cocos2d/", "repo_parent":"https://github.com/cocos2d/",

View File

@ -2148,6 +2148,8 @@
"external/unzip/CMakeLists.txt", "external/unzip/CMakeLists.txt",
"external/unzip/ioapi.cpp", "external/unzip/ioapi.cpp",
"external/unzip/ioapi.h", "external/unzip/ioapi.h",
"external/unzip/ioapi_mem.cpp",
"external/unzip/ioapi_mem.h",
"external/unzip/unzip.cpp", "external/unzip/unzip.cpp",
"external/unzip/unzip.h", "external/unzip/unzip.h",
"external/version.json", "external/version.json",
@ -4124,7 +4126,6 @@
], ],
"lua": [ "lua": [
"cocos/scripting/lua-bindings/CMakeLists.txt", "cocos/scripting/lua-bindings/CMakeLists.txt",
"cocos/scripting/lua-bindings/auto/api/AABB.lua",
"cocos/scripting/lua-bindings/auto/api/Action.lua", "cocos/scripting/lua-bindings/auto/api/Action.lua",
"cocos/scripting/lua-bindings/auto/api/ActionCamera.lua", "cocos/scripting/lua-bindings/auto/api/ActionCamera.lua",
"cocos/scripting/lua-bindings/auto/api/ActionEase.lua", "cocos/scripting/lua-bindings/auto/api/ActionEase.lua",
@ -4331,7 +4332,6 @@
"cocos/scripting/lua-bindings/auto/api/Node.lua", "cocos/scripting/lua-bindings/auto/api/Node.lua",
"cocos/scripting/lua-bindings/auto/api/NodeGrid.lua", "cocos/scripting/lua-bindings/auto/api/NodeGrid.lua",
"cocos/scripting/lua-bindings/auto/api/NodeReader.lua", "cocos/scripting/lua-bindings/auto/api/NodeReader.lua",
"cocos/scripting/lua-bindings/auto/api/OBB.lua",
"cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua", "cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua",
"cocos/scripting/lua-bindings/auto/api/PageTurn3D.lua", "cocos/scripting/lua-bindings/auto/api/PageTurn3D.lua",
"cocos/scripting/lua-bindings/auto/api/PageView.lua", "cocos/scripting/lua-bindings/auto/api/PageView.lua",
@ -4640,15 +4640,16 @@
"cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua", "cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua",
"cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionClass.lua", "cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionClass.lua",
"cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionFunc.lua", "cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionFunc.lua",
"cocos/scripting/lua-bindings/script/cocostudio/CocoStudio.lua", "cocos/scripting/lua-bindings/script/cocosstudio/CocosStudio.lua",
"cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua", "cocos/scripting/lua-bindings/script/cocosstudio/DeprecatedCocoStudioClass.lua",
"cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua", "cocos/scripting/lua-bindings/script/cocosstudio/DeprecatedCocoStudioFunc.lua",
"cocos/scripting/lua-bindings/script/cocostudio/StudioConstants.lua", "cocos/scripting/lua-bindings/script/cocosstudio/StudioConstants.lua",
"cocos/scripting/lua-bindings/script/controller/ControllerConstants.lua", "cocos/scripting/lua-bindings/script/controller/ControllerConstants.lua",
"cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua", "cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua",
"cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua", "cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua",
"cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua", "cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua",
"cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua", "cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua",
"cocos/scripting/lua-bindings/script/init.lua",
"cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua", "cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua",
"cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua", "cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua",
"cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua", "cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua",

View File

@ -2,6 +2,53 @@
"do_default":{ "do_default":{
"exclude_from_template":[ "exclude_from_template":[
"frameworks/runtime-src" "frameworks/runtime-src"
],
"append_dir": [
{
"from": "cocos/scripting/lua-bindings/script",
"to": "src/cocos",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/cocos2d",
"to": "src/cocos/cocos2d",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/cocosbuilder",
"to": "src/cocos/cocosbuilder",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/cocosdenshion",
"to": "src/cocos/cocosdenshion",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/cocosstudio",
"to": "src/cocos/cocosstudio",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/controller",
"to": "src/cocos/controller",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/extension",
"to": "src/cocos/extension",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/network",
"to": "src/cocos/network",
"exclude": []
},
{
"from": "cocos/scripting/lua-bindings/script/ui",
"to": "src/cocos/ui",
"exclude": []
}
] ]
}, },
"do_add_native_support":{ "do_add_native_support":{

View File

@ -14,37 +14,9 @@
"from": "../../../res", "from": "../../../res",
"to": "res" "to": "res"
}, },
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosbuilder",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/network",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui",
"to": ""
},
{ {
"from": "../../cocos2d-x/external/lua/luasocket", "from": "../../cocos2d-x/external/lua/luasocket",
"to": "", "to": "src",
"include": [ "include": [
"*.lua" "*.lua"
] ]

View File

@ -13,77 +13,7 @@
15427C79198F1FA200DC375D /* libluacocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C49198F1DE400DC375D /* libluacocos2d Mac.a */; }; 15427C79198F1FA200DC375D /* libluacocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C49198F1DE400DC375D /* libluacocos2d Mac.a */; };
15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; };
15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; };
15AA96B6199C668400725633 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96B4199C668400725633 /* CCBReaderLoad.lua */; };
15AA96B7199C668400725633 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96B4199C668400725633 /* CCBReaderLoad.lua */; };
15AA96B8199C668400725633 /* DeprecatedCocosBuilderClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96B5199C668400725633 /* DeprecatedCocosBuilderClass.lua */; };
15AA96B9199C668400725633 /* DeprecatedCocosBuilderClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96B5199C668400725633 /* DeprecatedCocosBuilderClass.lua */; };
15AA96BE199C66A100725633 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BA199C66A100725633 /* CocoStudio.lua */; };
15AA96BF199C66A100725633 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BA199C66A100725633 /* CocoStudio.lua */; };
15AA96C0199C66A100725633 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BB199C66A100725633 /* DeprecatedCocoStudioClass.lua */; };
15AA96C1199C66A100725633 /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BB199C66A100725633 /* DeprecatedCocoStudioClass.lua */; };
15AA96C2199C66A100725633 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BC199C66A100725633 /* DeprecatedCocoStudioFunc.lua */; };
15AA96C3199C66A100725633 /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BC199C66A100725633 /* DeprecatedCocoStudioFunc.lua */; };
15AA96C4199C66A100725633 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BD199C66A100725633 /* StudioConstants.lua */; };
15AA96C5199C66A100725633 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96BD199C66A100725633 /* StudioConstants.lua */; };
15AA96CA199C66B500725633 /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C6199C66B500725633 /* DeprecatedExtensionClass.lua */; };
15AA96CB199C66B500725633 /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C6199C66B500725633 /* DeprecatedExtensionClass.lua */; };
15AA96CC199C66B500725633 /* DeprecatedExtensionEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C7199C66B500725633 /* DeprecatedExtensionEnum.lua */; };
15AA96CD199C66B500725633 /* DeprecatedExtensionEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C7199C66B500725633 /* DeprecatedExtensionEnum.lua */; };
15AA96CE199C66B500725633 /* DeprecatedExtensionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C8199C66B500725633 /* DeprecatedExtensionFunc.lua */; };
15AA96CF199C66B500725633 /* DeprecatedExtensionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C8199C66B500725633 /* DeprecatedExtensionFunc.lua */; };
15AA96D0199C66B500725633 /* ExtensionConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C9199C66B500725633 /* ExtensionConstants.lua */; };
15AA96D1199C66B500725633 /* ExtensionConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96C9199C66B500725633 /* ExtensionConstants.lua */; };
15AA96D6199C66D500725633 /* DeprecatedNetworkClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D2199C66D500725633 /* DeprecatedNetworkClass.lua */; };
15AA96D7199C66D500725633 /* DeprecatedNetworkClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D2199C66D500725633 /* DeprecatedNetworkClass.lua */; };
15AA96D8199C66D500725633 /* DeprecatedNetworkEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D3199C66D500725633 /* DeprecatedNetworkEnum.lua */; };
15AA96D9199C66D500725633 /* DeprecatedNetworkEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D3199C66D500725633 /* DeprecatedNetworkEnum.lua */; };
15AA96DA199C66D500725633 /* DeprecatedNetworkFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D4199C66D500725633 /* DeprecatedNetworkFunc.lua */; };
15AA96DB199C66D500725633 /* DeprecatedNetworkFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D4199C66D500725633 /* DeprecatedNetworkFunc.lua */; };
15AA96DC199C66D500725633 /* NetworkConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D5199C66D500725633 /* NetworkConstants.lua */; };
15AA96DD199C66D500725633 /* NetworkConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96D5199C66D500725633 /* NetworkConstants.lua */; };
15AA96E2199C66E600725633 /* DeprecatedUIEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96DE199C66E600725633 /* DeprecatedUIEnum.lua */; };
15AA96E3199C66E600725633 /* DeprecatedUIEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96DE199C66E600725633 /* DeprecatedUIEnum.lua */; };
15AA96E4199C66E600725633 /* DeprecatedUIFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96DF199C66E600725633 /* DeprecatedUIFunc.lua */; };
15AA96E5199C66E600725633 /* DeprecatedUIFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96DF199C66E600725633 /* DeprecatedUIFunc.lua */; };
15AA96E6199C66E600725633 /* experimentalUIConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96E0199C66E600725633 /* experimentalUIConstants.lua */; };
15AA96E7199C66E600725633 /* experimentalUIConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96E0199C66E600725633 /* experimentalUIConstants.lua */; };
15AA96E8199C66E600725633 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96E1199C66E600725633 /* GuiConstants.lua */; };
15AA96E9199C66E600725633 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA96E1199C66E600725633 /* GuiConstants.lua */; };
15AECE29195D482800907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15AECE28195D482800907DB0 /* MediaPlayer.framework */; }; 15AECE29195D482800907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15AECE28195D482800907DB0 /* MediaPlayer.framework */; };
15D1FE491998730800302043 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3B1998730800302043 /* bitExtend.lua */; };
15D1FE4A1998730800302043 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3B1998730800302043 /* bitExtend.lua */; };
15D1FE4B1998730800302043 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3C1998730800302043 /* Cocos2d.lua */; };
15D1FE4C1998730800302043 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3C1998730800302043 /* Cocos2d.lua */; };
15D1FE4D1998730800302043 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3D1998730800302043 /* Cocos2dConstants.lua */; };
15D1FE4E1998730800302043 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3D1998730800302043 /* Cocos2dConstants.lua */; };
15D1FE4F1998730800302043 /* DeprecatedCocos2dClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3E1998730800302043 /* DeprecatedCocos2dClass.lua */; };
15D1FE501998730800302043 /* DeprecatedCocos2dClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3E1998730800302043 /* DeprecatedCocos2dClass.lua */; };
15D1FE511998730800302043 /* DeprecatedCocos2dEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3F1998730800302043 /* DeprecatedCocos2dEnum.lua */; };
15D1FE521998730800302043 /* DeprecatedCocos2dEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3F1998730800302043 /* DeprecatedCocos2dEnum.lua */; };
15D1FE531998730800302043 /* DeprecatedCocos2dFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE401998730800302043 /* DeprecatedCocos2dFunc.lua */; };
15D1FE541998730800302043 /* DeprecatedCocos2dFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE401998730800302043 /* DeprecatedCocos2dFunc.lua */; };
15D1FE551998730800302043 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE411998730800302043 /* DeprecatedOpenglEnum.lua */; };
15D1FE561998730800302043 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE411998730800302043 /* DeprecatedOpenglEnum.lua */; };
15D1FE571998730800302043 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE421998730800302043 /* DrawPrimitives.lua */; };
15D1FE581998730800302043 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE421998730800302043 /* DrawPrimitives.lua */; };
15D1FE591998730800302043 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE431998730800302043 /* extern.lua */; };
15D1FE5A1998730800302043 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE431998730800302043 /* extern.lua */; };
15D1FE5B1998730800302043 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE441998730800302043 /* json.lua */; };
15D1FE5C1998730800302043 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE441998730800302043 /* json.lua */; };
15D1FE5D1998730800302043 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE451998730800302043 /* luaj.lua */; };
15D1FE5E1998730800302043 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE451998730800302043 /* luaj.lua */; };
15D1FE5F1998730800302043 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE461998730800302043 /* luaoc.lua */; };
15D1FE601998730800302043 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE461998730800302043 /* luaoc.lua */; };
15D1FE611998730800302043 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE471998730800302043 /* Opengl.lua */; };
15D1FE621998730800302043 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE471998730800302043 /* Opengl.lua */; };
15D1FE631998730800302043 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE481998730800302043 /* OpenglConstants.lua */; };
15D1FE641998730800302043 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE481998730800302043 /* OpenglConstants.lua */; };
15D1FE681998732700302043 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE651998732700302043 /* AudioEngine.lua */; };
15D1FE691998732700302043 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE651998732700302043 /* AudioEngine.lua */; };
15D1FE6A1998732700302043 /* DeprecatedCocosDenshionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE661998732700302043 /* DeprecatedCocosDenshionClass.lua */; };
15D1FE6B1998732700302043 /* DeprecatedCocosDenshionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE661998732700302043 /* DeprecatedCocosDenshionClass.lua */; };
15D1FE6C1998732700302043 /* DeprecatedCocosDenshionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE671998732700302043 /* DeprecatedCocosDenshionFunc.lua */; };
15D1FE6D1998732700302043 /* DeprecatedCocosDenshionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE671998732700302043 /* DeprecatedCocosDenshionFunc.lua */; };
1AF4C403178663F200122817 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; }; 1AF4C403178663F200122817 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; };
5023811817EBBCAC00990C9B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023810817EBBCAC00990C9B /* AppController.mm */; }; 5023811817EBBCAC00990C9B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023810817EBBCAC00990C9B /* AppController.mm */; };
5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810917EBBCAC00990C9B /* Default-568h@2x.png */; }; 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810917EBBCAC00990C9B /* Default-568h@2x.png */; };
@ -194,43 +124,8 @@
15427C7E198F201A00DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_module_register.h; path = ../Classes/lua_module_register.h; sourceTree = "<group>"; }; 15427C7E198F201A00DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_module_register.h; path = ../Classes/lua_module_register.h; sourceTree = "<group>"; };
15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = "<group>"; }; 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = "<group>"; };
15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; };
15AA96B4199C668400725633 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosbuilder/CCBReaderLoad.lua"; sourceTree = "<group>"; };
15AA96B5199C668400725633 /* DeprecatedCocosBuilderClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosBuilderClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosbuilder/DeprecatedCocosBuilderClass.lua"; sourceTree = "<group>"; };
15AA96BA199C66A100725633 /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/CocoStudio.lua"; sourceTree = "<group>"; };
15AA96BB199C66A100725633 /* DeprecatedCocoStudioClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua"; sourceTree = "<group>"; };
15AA96BC199C66A100725633 /* DeprecatedCocoStudioFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua"; sourceTree = "<group>"; };
15AA96BD199C66A100725633 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/StudioConstants.lua"; sourceTree = "<group>"; };
15AA96C6199C66B500725633 /* DeprecatedExtensionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua"; sourceTree = "<group>"; };
15AA96C7199C66B500725633 /* DeprecatedExtensionEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua"; sourceTree = "<group>"; };
15AA96C8199C66B500725633 /* DeprecatedExtensionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua"; sourceTree = "<group>"; };
15AA96C9199C66B500725633 /* ExtensionConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ExtensionConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua"; sourceTree = "<group>"; };
15AA96D2199C66D500725633 /* DeprecatedNetworkClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua"; sourceTree = "<group>"; };
15AA96D3199C66D500725633 /* DeprecatedNetworkEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua"; sourceTree = "<group>"; };
15AA96D4199C66D500725633 /* DeprecatedNetworkFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua"; sourceTree = "<group>"; };
15AA96D5199C66D500725633 /* NetworkConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/NetworkConstants.lua"; sourceTree = "<group>"; };
15AA96DE199C66E600725633 /* DeprecatedUIEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua"; sourceTree = "<group>"; };
15AA96DF199C66E600725633 /* DeprecatedUIFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua"; sourceTree = "<group>"; };
15AA96E0199C66E600725633 /* experimentalUIConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalUIConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/experimentalUIConstants.lua"; sourceTree = "<group>"; };
15AA96E1199C66E600725633 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua"; sourceTree = "<group>"; };
15AECE28195D482800907DB0 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; 15AECE28195D482800907DB0 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "../../cocos2d-x/cocos2dx/platform/third_party/ios/libraries/libcurl.a"; sourceTree = "<group>"; }; 15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "../../cocos2d-x/cocos2dx/platform/third_party/ios/libraries/libcurl.a"; sourceTree = "<group>"; };
15D1FE3B1998730800302043 /* bitExtend.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = bitExtend.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua"; sourceTree = "<group>"; };
15D1FE3C1998730800302043 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua"; sourceTree = "<group>"; };
15D1FE3D1998730800302043 /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua"; sourceTree = "<group>"; };
15D1FE3E1998730800302043 /* DeprecatedCocos2dClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocos2dClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dClass.lua"; sourceTree = "<group>"; };
15D1FE3F1998730800302043 /* DeprecatedCocos2dEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocos2dEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dEnum.lua"; sourceTree = "<group>"; };
15D1FE401998730800302043 /* DeprecatedCocos2dFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocos2dFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dFunc.lua"; sourceTree = "<group>"; };
15D1FE411998730800302043 /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedOpenglEnum.lua"; sourceTree = "<group>"; };
15D1FE421998730800302043 /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua"; sourceTree = "<group>"; };
15D1FE431998730800302043 /* extern.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = extern.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/extern.lua"; sourceTree = "<group>"; };
15D1FE441998730800302043 /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = json.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/json.lua"; sourceTree = "<group>"; };
15D1FE451998730800302043 /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaj.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/luaj.lua"; sourceTree = "<group>"; };
15D1FE461998730800302043 /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaoc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/luaoc.lua"; sourceTree = "<group>"; };
15D1FE471998730800302043 /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/Opengl.lua"; sourceTree = "<group>"; };
15D1FE481998730800302043 /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/OpenglConstants.lua"; sourceTree = "<group>"; };
15D1FE651998732700302043 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua"; sourceTree = "<group>"; };
15D1FE661998732700302043 /* DeprecatedCocosDenshionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosDenshionClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionClass.lua"; sourceTree = "<group>"; };
15D1FE671998732700302043 /* DeprecatedCocosDenshionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosDenshionFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion/DeprecatedCocosDenshionFunc.lua"; sourceTree = "<group>"; };
1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
5023810717EBBCAC00990C9B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; }; 5023810717EBBCAC00990C9B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
5023810817EBBCAC00990C9B /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = "<group>"; }; 5023810817EBBCAC00990C9B /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = "<group>"; };
@ -334,48 +229,6 @@
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1A0227A417A3AA1A00B867AD /* Lua Common */ = {
isa = PBXGroup;
children = (
15AA96DE199C66E600725633 /* DeprecatedUIEnum.lua */,
15AA96DF199C66E600725633 /* DeprecatedUIFunc.lua */,
15AA96E0199C66E600725633 /* experimentalUIConstants.lua */,
15AA96E1199C66E600725633 /* GuiConstants.lua */,
15AA96D2199C66D500725633 /* DeprecatedNetworkClass.lua */,
15AA96D3199C66D500725633 /* DeprecatedNetworkEnum.lua */,
15AA96D4199C66D500725633 /* DeprecatedNetworkFunc.lua */,
15AA96D5199C66D500725633 /* NetworkConstants.lua */,
15AA96C6199C66B500725633 /* DeprecatedExtensionClass.lua */,
15AA96C7199C66B500725633 /* DeprecatedExtensionEnum.lua */,
15AA96C8199C66B500725633 /* DeprecatedExtensionFunc.lua */,
15AA96C9199C66B500725633 /* ExtensionConstants.lua */,
15AA96BA199C66A100725633 /* CocoStudio.lua */,
15AA96BB199C66A100725633 /* DeprecatedCocoStudioClass.lua */,
15AA96BC199C66A100725633 /* DeprecatedCocoStudioFunc.lua */,
15AA96BD199C66A100725633 /* StudioConstants.lua */,
15AA96B4199C668400725633 /* CCBReaderLoad.lua */,
15AA96B5199C668400725633 /* DeprecatedCocosBuilderClass.lua */,
15D1FE651998732700302043 /* AudioEngine.lua */,
15D1FE661998732700302043 /* DeprecatedCocosDenshionClass.lua */,
15D1FE671998732700302043 /* DeprecatedCocosDenshionFunc.lua */,
15D1FE3B1998730800302043 /* bitExtend.lua */,
15D1FE3C1998730800302043 /* Cocos2d.lua */,
15D1FE3D1998730800302043 /* Cocos2dConstants.lua */,
15D1FE3E1998730800302043 /* DeprecatedCocos2dClass.lua */,
15D1FE3F1998730800302043 /* DeprecatedCocos2dEnum.lua */,
15D1FE401998730800302043 /* DeprecatedCocos2dFunc.lua */,
15D1FE411998730800302043 /* DeprecatedOpenglEnum.lua */,
15D1FE421998730800302043 /* DrawPrimitives.lua */,
15D1FE431998730800302043 /* extern.lua */,
15D1FE441998730800302043 /* json.lua */,
15D1FE451998730800302043 /* luaj.lua */,
15D1FE461998730800302043 /* luaoc.lua */,
15D1FE471998730800302043 /* Opengl.lua */,
15D1FE481998730800302043 /* OpenglConstants.lua */,
);
name = "Lua Common";
sourceTree = "<group>";
};
5023810617EBBCAC00990C9B /* ios */ = { 5023810617EBBCAC00990C9B /* ios */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -443,7 +296,6 @@
5023817117EBBE3400990C9B /* mac */, 5023817117EBBE3400990C9B /* mac */,
F293BB7C15EB830F00256477 /* Classes */, F293BB7C15EB830F00256477 /* Classes */,
F293B3CB15EB7BE500256477 /* Frameworks */, F293B3CB15EB7BE500256477 /* Frameworks */,
1A0227A417A3AA1A00B867AD /* Lua Common */,
F293B3C915EB7BE500256477 /* Products */, F293B3C915EB7BE500256477 /* Products */,
F293BC4615EB859D00256477 /* Resources */, F293BC4615EB859D00256477 /* Resources */,
); );
@ -623,44 +475,9 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
15D1FE4A1998730800302043 /* bitExtend.lua in Resources */,
15D1FE561998730800302043 /* DeprecatedOpenglEnum.lua in Resources */,
15D1FE641998730800302043 /* OpenglConstants.lua in Resources */,
15D1FE541998730800302043 /* DeprecatedCocos2dFunc.lua in Resources */,
C03781BA18BF655400FE4F13 /* res in Resources */, C03781BA18BF655400FE4F13 /* res in Resources */,
15D1FE691998732700302043 /* AudioEngine.lua in Resources */,
15AA96C5199C66A100725633 /* StudioConstants.lua in Resources */,
15D1FE601998730800302043 /* luaoc.lua in Resources */,
15AA96D1199C66B500725633 /* ExtensionConstants.lua in Resources */,
15D1FE5E1998730800302043 /* luaj.lua in Resources */,
15D1FE6B1998732700302043 /* DeprecatedCocosDenshionClass.lua in Resources */,
15D1FE5A1998730800302043 /* extern.lua in Resources */,
15D1FE501998730800302043 /* DeprecatedCocos2dClass.lua in Resources */,
15D1FE581998730800302043 /* DrawPrimitives.lua in Resources */,
15AA96CF199C66B500725633 /* DeprecatedExtensionFunc.lua in Resources */,
15AA96E7199C66E600725633 /* experimentalUIConstants.lua in Resources */,
15AA96CB199C66B500725633 /* DeprecatedExtensionClass.lua in Resources */,
15AA96E3199C66E600725633 /* DeprecatedUIEnum.lua in Resources */,
15AA96B7199C668400725633 /* CCBReaderLoad.lua in Resources */,
15D1FE5C1998730800302043 /* json.lua in Resources */,
15AA96E5199C66E600725633 /* DeprecatedUIFunc.lua in Resources */,
15D1FE4E1998730800302043 /* Cocos2dConstants.lua in Resources */,
15D1FE521998730800302043 /* DeprecatedCocos2dEnum.lua in Resources */,
15AA96C1199C66A100725633 /* DeprecatedCocoStudioClass.lua in Resources */,
15AA96C3199C66A100725633 /* DeprecatedCocoStudioFunc.lua in Resources */,
15D1FE6D1998732700302043 /* DeprecatedCocosDenshionFunc.lua in Resources */,
15D1FE4C1998730800302043 /* Cocos2d.lua in Resources */,
15AA96CD199C66B500725633 /* DeprecatedExtensionEnum.lua in Resources */,
15AA96DD199C66D500725633 /* NetworkConstants.lua in Resources */,
15AA96D9199C66D500725633 /* DeprecatedNetworkEnum.lua in Resources */,
15AA96E9199C66E600725633 /* GuiConstants.lua in Resources */,
15AA96D7199C66D500725633 /* DeprecatedNetworkClass.lua in Resources */,
C03781BC18BF655400FE4F13 /* src in Resources */, C03781BC18BF655400FE4F13 /* src in Resources */,
5023817617EBBE3400990C9B /* Icon.icns in Resources */, 5023817617EBBE3400990C9B /* Icon.icns in Resources */,
15AA96BF199C66A100725633 /* CocoStudio.lua in Resources */,
15AA96B9199C668400725633 /* DeprecatedCocosBuilderClass.lua in Resources */,
15D1FE621998730800302043 /* Opengl.lua in Resources */,
15AA96DB199C66D500725633 /* DeprecatedNetworkFunc.lua in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -668,59 +485,24 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
15AA96E6199C66E600725633 /* experimentalUIConstants.lua in Resources */,
15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */, 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */,
5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */, 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */,
5091733B17ECE17A00D62437 /* Icon-100.png in Resources */, 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */,
5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */, 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */,
15AA96BE199C66A100725633 /* CocoStudio.lua in Resources */,
5091733617ECE17A00D62437 /* Icon-29.png in Resources */, 5091733617ECE17A00D62437 /* Icon-29.png in Resources */,
15D1FE631998730800302043 /* OpenglConstants.lua in Resources */,
15D1FE5D1998730800302043 /* luaj.lua in Resources */,
15AA96D0199C66B500725633 /* ExtensionConstants.lua in Resources */,
5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */, 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */,
5091733917ECE17A00D62437 /* Icon-58.png in Resources */, 5091733917ECE17A00D62437 /* Icon-58.png in Resources */,
5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */, 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */,
5023812017EBBCAC00990C9B /* Icon-57.png in Resources */, 5023812017EBBCAC00990C9B /* Icon-57.png in Resources */,
C03781B918BF655400FE4F13 /* res in Resources */, C03781B918BF655400FE4F13 /* res in Resources */,
15D1FE5B1998730800302043 /* json.lua in Resources */,
5023812217EBBCAC00990C9B /* Icon-76.png in Resources */, 5023812217EBBCAC00990C9B /* Icon-76.png in Resources */,
15AA96E2199C66E600725633 /* DeprecatedUIEnum.lua in Resources */,
15D1FE681998732700302043 /* AudioEngine.lua in Resources */,
15AA96E8199C66E600725633 /* GuiConstants.lua in Resources */,
15AA96CA199C66B500725633 /* DeprecatedExtensionClass.lua in Resources */,
15D1FE4D1998730800302043 /* Cocos2dConstants.lua in Resources */,
15D1FE4F1998730800302043 /* DeprecatedCocos2dClass.lua in Resources */,
5091733A17ECE17A00D62437 /* Icon-80.png in Resources */, 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */,
15D1FE6A1998732700302043 /* DeprecatedCocosDenshionClass.lua in Resources */,
15AA96CC199C66B500725633 /* DeprecatedExtensionEnum.lua in Resources */,
15D1FE571998730800302043 /* DrawPrimitives.lua in Resources */,
15D1FE4B1998730800302043 /* Cocos2d.lua in Resources */,
5091733717ECE17A00D62437 /* Icon-40.png in Resources */, 5091733717ECE17A00D62437 /* Icon-40.png in Resources */,
15D1FE5F1998730800302043 /* luaoc.lua in Resources */,
5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */, 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */,
15AA96B6199C668400725633 /* CCBReaderLoad.lua in Resources */,
5023811A17EBBCAC00990C9B /* Default.png in Resources */, 5023811A17EBBCAC00990C9B /* Default.png in Resources */,
15D1FE511998730800302043 /* DeprecatedCocos2dEnum.lua in Resources */,
15D1FE531998730800302043 /* DeprecatedCocos2dFunc.lua in Resources */,
15AA96DA199C66D500725633 /* DeprecatedNetworkFunc.lua in Resources */,
15AA96D8199C66D500725633 /* DeprecatedNetworkEnum.lua in Resources */,
15AA96B8199C668400725633 /* DeprecatedCocosBuilderClass.lua in Resources */,
C03781BB18BF655400FE4F13 /* src in Resources */, C03781BB18BF655400FE4F13 /* src in Resources */,
15AA96C0199C66A100725633 /* DeprecatedCocoStudioClass.lua in Resources */,
15D1FE591998730800302043 /* extern.lua in Resources */,
15D1FE551998730800302043 /* DeprecatedOpenglEnum.lua in Resources */,
15AA96E4199C66E600725633 /* DeprecatedUIFunc.lua in Resources */,
15D1FE6C1998732700302043 /* DeprecatedCocosDenshionFunc.lua in Resources */,
15AA96CE199C66B500725633 /* DeprecatedExtensionFunc.lua in Resources */,
15D1FE611998730800302043 /* Opengl.lua in Resources */,
5091733817ECE17A00D62437 /* Icon-50.png in Resources */, 5091733817ECE17A00D62437 /* Icon-50.png in Resources */,
15AA96C2199C66A100725633 /* DeprecatedCocoStudioFunc.lua in Resources */,
15AA96C4199C66A100725633 /* StudioConstants.lua in Resources */,
15D1FE491998730800302043 /* bitExtend.lua in Resources */,
15AA96DC199C66D500725633 /* NetworkConstants.lua in Resources */,
5023812117EBBCAC00990C9B /* Icon-72.png in Resources */, 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */,
15AA96D6199C66D500725633 /* DeprecatedNetworkClass.lua in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -7,14 +7,6 @@
{ {
"from": "../../../res", "from": "../../../res",
"to": "res" "to": "res"
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d",
"to": ""
},
{
"from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion",
"to": ""
} }
] ]
} }

View File

@ -1,5 +1,9 @@
require "Cocos2d"
require "Cocos2dConstants" cc.FileUtils:getInstance():addSearchPath("src")
cc.FileUtils:getInstance():addSearchPath("res")
-- CC_USE_DEPRECATED_API = true
require "cocos.init"
-- cclog -- cclog
cclog = function(...) cclog = function(...)
@ -37,17 +41,15 @@ local function main()
--set FPS. the default value is 1.0/60 if you don't call this --set FPS. the default value is 1.0/60 if you don't call this
director:setAnimationInterval(1.0 / 60) director:setAnimationInterval(1.0 / 60)
cc.FileUtils:getInstance():addSearchPath("src") local schedulerID = 0
cc.FileUtils:getInstance():addSearchPath("res")
local schedulerID = 0
--support debug --support debug
local targetPlatform = cc.Application:getInstance():getTargetPlatform() local targetPlatform = cc.Application:getInstance():getTargetPlatform()
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or
(cc.PLATFORM_OS_ANDROID == targetPlatform) or (cc.PLATFORM_OS_WINDOWS == targetPlatform) or (cc.PLATFORM_OS_ANDROID == targetPlatform) or (cc.PLATFORM_OS_WINDOWS == targetPlatform) or
(cc.PLATFORM_OS_MAC == targetPlatform) then (cc.PLATFORM_OS_MAC == targetPlatform) then
cclog("result is ") cclog("result is ")
--require('debugger')() --require('debugger')()
end end
require "hello2" require "hello2"
cclog("result is " .. myadd(1, 1)) cclog("result is " .. myadd(1, 1))
@ -168,7 +170,7 @@ local function main()
listener:registerScriptHandler(onTouchEnded,cc.Handler.EVENT_TOUCH_ENDED ) listener:registerScriptHandler(onTouchEnded,cc.Handler.EVENT_TOUCH_ENDED )
local eventDispatcher = layerFarm:getEventDispatcher() local eventDispatcher = layerFarm:getEventDispatcher()
eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layerFarm) eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layerFarm)
local function onNodeEvent(event) local function onNodeEvent(event)
if "exit" == event then if "exit" == event then
cc.Director:getInstance():getScheduler():unscheduleScriptEntry(schedulerID) cc.Director:getInstance():getScheduler():unscheduleScriptEntry(schedulerID)
@ -207,7 +209,7 @@ local function main()
menuPopup:setPosition(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2) menuPopup:setPosition(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2)
menuPopup:setVisible(false) menuPopup:setVisible(false)
layerMenu:addChild(menuPopup) layerMenu:addChild(menuPopup)
-- add the left-bottom "tools" menu to invoke menuPopup -- add the left-bottom "tools" menu to invoke menuPopup
local menuToolsItem = cc.MenuItemImage:create("menu1.png", "menu1.png") local menuToolsItem = cc.MenuItemImage:create("menu1.png", "menu1.png")
menuToolsItem:setPosition(0, 0) menuToolsItem:setPosition(0, 0)
@ -222,7 +224,7 @@ local function main()
end end
-- play background music, preload effect -- play background music, preload effect
local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("background.mp3") local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("background.mp3")
cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true) cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true)
local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav") local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav")
cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath) cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath)
@ -231,12 +233,12 @@ local function main()
local sceneGame = cc.Scene:create() local sceneGame = cc.Scene:create()
sceneGame:addChild(createLayerFarm()) sceneGame:addChild(createLayerFarm())
sceneGame:addChild(createLayerMenu()) sceneGame:addChild(createLayerMenu())
if cc.Director:getInstance():getRunningScene() then if cc.Director:getInstance():getRunningScene() then
cc.Director:getInstance():replaceScene(sceneGame) cc.Director:getInstance():replaceScene(sceneGame)
else else
cc.Director:getInstance():runWithScene(sceneGame) cc.Director:getInstance():runWithScene(sceneGame)
end end
end end

View File

@ -223,7 +223,7 @@ g_guisTests[] =
UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); UISceneManager* sceneManager = UISceneManager::sharedUISceneManager();
sceneManager->setCurrentUISceneId(kUIPageViewTest); sceneManager->setCurrentUISceneId(kUIPageViewTest);
sceneManager->setMinUISceneId(kUIPageViewTest); sceneManager->setMinUISceneId(kUIPageViewTest);
sceneManager->setMaxUISceneId(kUIPageViewTouchPropagationTest); sceneManager->setMaxUISceneId(kUIPageViewDynamicAddAndRemoveTest);
Scene* scene = sceneManager->currentUIScene(); Scene* scene = sceneManager->currentUIScene();
Director::getInstance()->replaceScene(scene); Director::getInstance()->replaceScene(scene);
} }

View File

@ -37,6 +37,8 @@ bool UIButtonTest::init()
// Create the button // Create the button
Button* button = Button::create("cocosui/animationbuttonnormal.png"); Button* button = Button::create("cocosui/animationbuttonnormal.png");
CCLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width,
button->getContentSize().height);
button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest::touchEvent, this)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest::touchEvent, this));
button->setZoomScale(0.4); button->setZoomScale(0.4);
@ -632,7 +634,10 @@ bool UIButtonTextOnly::init()
// Create the button // Create the button
auto button = Button::create(); auto button = Button::create();
button->setNormalizedPosition(Vec2(0.5, 0.5)); button->setNormalizedPosition(Vec2(0.5, 0.5));
button->setTitleText("PLAY GAME"); button->setTitleText("PLAY GAME");
CCLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width,
button->getContentSize().height);
button->setZoomScale(0.3); button->setZoomScale(0.3);
button->setPressedActionEnabled(true); button->setPressedActionEnabled(true);
button->addClickEventListener([this](Ref* sender) { button->addClickEventListener([this](Ref* sender) {

View File

@ -505,3 +505,180 @@ void UIPageViewTouchPropagationTest::pageViewEvent(Ref *pSender, PageView::Event
} }
} }
// UIPageViewDynamicAddAndRemoveTest
UIPageViewDynamicAddAndRemoveTest::UIPageViewDynamicAddAndRemoveTest()
: _displayValueLabel(nullptr)
{
}
UIPageViewDynamicAddAndRemoveTest::~UIPageViewDynamicAddAndRemoveTest()
{
}
bool UIPageViewDynamicAddAndRemoveTest::init()
{
if (UIScene::init())
{
Size widgetSize = _widget->getContentSize();
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = Text::create("Click Buttons on the Left", "fonts/Marker Felt.ttf", 32);
_displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f));
_displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f,
widgetSize.height / 2.0f +
_displayValueLabel->getContentSize().height * 1.5));
_uiLayer->addChild(_displayValueLabel);
// Add the black background
Text* alert = Text::create("PageView Dynamic Modification", "fonts/Marker Felt.ttf", 30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 3.075f));
_uiLayer->addChild(alert);
Layout* root = static_cast<Layout*>(_uiLayer->getChildByTag(81));
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
// Create the page view
PageView* pageView = PageView::create();
pageView->setContentSize(Size(240.0f, 130.0f));
pageView->setAnchorPoint(Vec2(0.5,0.5));
Size backgroundSize = background->getContentSize();
pageView->setPosition(Vec2(widgetSize.width / 2.0f ,widgetSize.height / 2.0f));
pageView->setBackGroundColor(Color3B::GREEN);
pageView->setBackGroundColorType(Layout::BackGroundColorType::SOLID);
int pageCount = 4;
for (int i = 0; i < pageCount; ++i)
{
HBox* outerBox = HBox::create();
outerBox->setContentSize(Size(240.0f, 130.0f));
for (int k = 0; k < 2; ++k)
{
VBox* innerBox = VBox::create();
for (int j = 0; j < 3; j++)
{
Button *btn = Button::create("cocosui/animationbuttonnormal.png",
"cocosui/animationbuttonpressed.png");
btn->setName(StringUtils::format("button %d", j));
innerBox->addChild(btn);
}
LinearLayoutParameter *parameter = LinearLayoutParameter::create();
parameter->setMargin(Margin(0,0,100,0));
innerBox->setLayoutParameter(parameter);
outerBox->addChild(innerBox);
}
pageView->insertPage(outerBox,i);
}
pageView->addEventListener(CC_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this));
pageView->setName("pageView");
_uiLayer->addChild(pageView);
//add buttons
auto button = Button::create();
button->setNormalizedPosition(Vec2(0.12,0.7));
button->setTitleText("Add A Page");
button->setZoomScale(0.3);
button->setPressedActionEnabled(true);
button->setTitleColor(Color3B::RED);
button->addClickEventListener([=](Ref* sender)
{
HBox* outerBox = HBox::create();
outerBox->setContentSize(Size(240.0f, 130.0f));
for (int k = 0; k < 2; ++k)
{
VBox* innerBox = VBox::create();
for (int j = 0; j < 3; j++)
{
Button *btn = Button::create("cocosui/animationbuttonnormal.png",
"cocosui/animationbuttonpressed.png");
btn->setName(StringUtils::format("button %d", j));
innerBox->addChild(btn);
}
LinearLayoutParameter *parameter = LinearLayoutParameter::create();
parameter->setMargin(Margin(0,0,100,0));
innerBox->setLayoutParameter(parameter);
outerBox->addChild(innerBox);
}
pageView->addPage(outerBox);
_displayValueLabel->setString(CCString::createWithFormat("page count = %ld", pageView->getPages().size())->getCString());
});
_uiLayer->addChild(button);
auto button2 = Button::create();
button2->setNormalizedPosition(Vec2(0.12,0.5));
button2->setTitleText("Remove A Page");
button2->setZoomScale(0.3);
button2->setPressedActionEnabled(true);
button2->setTitleColor(Color3B::RED);
button2->addClickEventListener([=](Ref* sender)
{
if (pageView->getPages().size() > 0)
{
pageView->removePageAtIndex(pageView->getPages().size()-1);
}
else
{
CCLOG("There is no page to remove!");
}
_displayValueLabel->setString(CCString::createWithFormat("page count = %ld", pageView->getPages().size())->getCString());
});
_uiLayer->addChild(button2);
auto button3 = Button::create();
button3->setNormalizedPosition(Vec2(0.12,0.3));
button3->setTitleText("Remove All Pages");
button3->setZoomScale(0.3);
button3->setPressedActionEnabled(true);
button3->setTitleColor(Color3B::RED);
button3->addClickEventListener([=](Ref* sender)
{
pageView->removeAllPages();
_displayValueLabel->setString(CCString::createWithFormat("page count = %ld", pageView->getPages().size())->getCString());
});
_uiLayer->addChild(button3);
return true;
}
return false;
}
void UIPageViewDynamicAddAndRemoveTest::pageViewEvent(Ref *pSender, PageView::EventType type)
{
switch (type)
{
case PageView::EventType::TURNING:
{
PageView* pageView = dynamic_cast<PageView*>(pSender);
_displayValueLabel->setString(CCString::createWithFormat("page = %ld", pageView->getCurPageIndex() + 1)->getCString());
}
break;
default:
break;
}
}

View File

@ -85,4 +85,19 @@ protected:
Text* _displayValueLabel; Text* _displayValueLabel;
}; };
class UIPageViewDynamicAddAndRemoveTest : public UIScene
{
public:
UIPageViewDynamicAddAndRemoveTest();
~UIPageViewDynamicAddAndRemoveTest();
bool init();
void pageViewEvent(Ref* pSender, PageView::EventType type);
void onButtonClicked(Ref* pSender, Widget::TouchEventType type);
protected:
UI_SCENE_CREATE_FUNC(UIPageViewDynamicAddAndRemoveTest)
Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UIPageViewTest__) */ #endif /* defined(__TestCpp__UIPageViewTest__) */

View File

@ -55,6 +55,7 @@ static const char* s_testArray[] =
"UIImageViewTest", "UIImageViewTest",
"UIImageViewTest_Scale9", "UIImageViewTest_Scale9",
"UIImageViewTest_ContentSize", "UIImageViewTest_ContentSize",
"UILoadingBarTest_Left", "UILoadingBarTest_Left",
"UILoadingBarTest_Right", "UILoadingBarTest_Right",
"UILoadingBarTest_Left_Scale9", "UILoadingBarTest_Left_Scale9",
@ -63,17 +64,17 @@ static const char* s_testArray[] =
"UITextAtlasTest", "UITextAtlasTest",
"UITextTest", "UITextTest",
"UITextTest_LineWrap", "UITextTest_LineWrap",
"UILabelTest_Effect", "UILabelTest_Effect",
"UITextTest_TTF", "UITextTest_TTF",
"UITextBMFontTest", "UITextBMFontTest",
"UITextFieldTest", "UITextFieldTest",
"UITextFieldTest_MaxLength", "UITextFieldTest_MaxLength",
"UITextFieldTest_Password", "UITextFieldTest_Password",
"UITextFieldTest_LineWrap", "UITextFieldTest_LineWrap",
"UITextFieldTest_TrueTypeFont", "UITextFieldTest_TrueTypeFont",
"UITextFieldTest_PlaceHolderColor", "UITextFieldTest_PlaceHolderColor",
"UILayoutTest", "UILayoutTest",
"UILayoutTest_Color", "UILayoutTest_Color",
"UILayoutTest_Gradient", "UILayoutTest_Gradient",
@ -90,15 +91,20 @@ static const char* s_testArray[] =
"UIScrollViewTest_ScrollToPercentBothDirection", "UIScrollViewTest_ScrollToPercentBothDirection",
"UIScrollViewTest_ScrollToPercentBothDirection_Bounce", "UIScrollViewTest_ScrollToPercentBothDirection_Bounce",
"UIScrollViewNestTest", "UIScrollViewNestTest",
"UIPageViewTest", "UIPageViewTest",
"UIPageViewButtonTest", "UIPageViewButtonTest",
"UIPageViewCustomScrollThreshold", "UIPageViewCustomScrollThreshold",
"UIPageViewTouchPropagationTest", "UIPageViewTouchPropagationTest",
"UIPageViewDynamicAddAndRemoveTest",
"UIListViewTest_Vertical", "UIListViewTest_Vertical",
"UIListViewTest_Horizontal", "UIListViewTest_Horizontal",
"UIWidgetAddNodeTest", "UIWidgetAddNodeTest",
"UIRichTextTest", "UIRichTextTest",
"UIFocusTest-HBox", "UIFocusTest-HBox",
"UIFocusTest-VBox", "UIFocusTest-VBox",
"UIFocusTest-NestedLayout1", "UIFocusTest-NestedLayout1",
@ -325,7 +331,8 @@ Scene *UISceneManager::currentUIScene()
return UIPageViewCustomScrollThreshold::sceneWithTitle(s_testArray[_currentUISceneId]); return UIPageViewCustomScrollThreshold::sceneWithTitle(s_testArray[_currentUISceneId]);
case kUIPageViewTouchPropagationTest: case kUIPageViewTouchPropagationTest:
return UIPageViewTouchPropagationTest::sceneWithTitle(s_testArray[_currentUISceneId]); return UIPageViewTouchPropagationTest::sceneWithTitle(s_testArray[_currentUISceneId]);
case kUIPageViewDynamicAddAndRemoveTest:
return UIPageViewDynamicAddAndRemoveTest::sceneWithTitle(s_testArray[_currentUISceneId]);
case kUIListViewTest_Vertical: case kUIListViewTest_Vertical:
return UIListViewTest_Vertical::sceneWithTitle(s_testArray[_currentUISceneId]); return UIListViewTest_Vertical::sceneWithTitle(s_testArray[_currentUISceneId]);

View File

@ -86,6 +86,7 @@ enum
kUIPageViewButtonTest, kUIPageViewButtonTest,
kUIPageViewCustomScrollThreshold, kUIPageViewCustomScrollThreshold,
kUIPageViewTouchPropagationTest, kUIPageViewTouchPropagationTest,
kUIPageViewDynamicAddAndRemoveTest,
kUIListViewTest_Vertical, kUIListViewTest_Vertical,
kUIListViewTest_Horizontal, kUIListViewTest_Horizontal,
kUIWidgetAddNodeTest, kUIWidgetAddNodeTest,

View File

@ -3,6 +3,7 @@ set(APP_NAME lua-tests)
set(SAMPLE_SRC set(SAMPLE_SRC
Classes/AppDelegate.cpp Classes/AppDelegate.cpp
Classes/lua_assetsmanager_test_sample.cpp Classes/lua_assetsmanager_test_sample.cpp
Classes/lua_test_bindings.cpp
) )
if(LINUX) if(LINUX)
@ -48,7 +49,7 @@ pre_build(${APP_NAME}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/cocosdenshion ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/cocosdenshion ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/network ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/network ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/cocosbuilder ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/cocosbuilder ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/cocostudio ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/cocosstudio ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/extension ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/extension ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/ui ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua-bindings/script/ui ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests/cpp-tests/Resources ${APP_BIN_DIR}/Resources/res COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests/cpp-tests/Resources ${APP_BIN_DIR}/Resources/res

View File

@ -4,6 +4,7 @@
#include "audio/include/SimpleAudioEngine.h" #include "audio/include/SimpleAudioEngine.h"
#include "lua_assetsmanager_test_sample.h" #include "lua_assetsmanager_test_sample.h"
#include "lua_module_register.h" #include "lua_module_register.h"
#include "lua_test_bindings.h"
using namespace CocosDenshion; using namespace CocosDenshion;
@ -43,6 +44,7 @@ bool AppDelegate::applicationDidFinishLaunching()
if (lua_istable(L,-1))//stack:...,_G, if (lua_istable(L,-1))//stack:...,_G,
{ {
register_assetsmanager_test_sample(L); register_assetsmanager_test_sample(L);
register_test_binding(L);
} }
lua_pop(L, 1); lua_pop(L, 1);
#endif #endif

View File

@ -0,0 +1,621 @@
#include "lua_test_bindings.h"
#include "cocos2d.h"
#include "LuaBasicConversions.h"
NS_CC_BEGIN
/**
* Copy DrawNode for 3D geometry drawing.
*/
class DrawNode3D: public Node
{
public:
/** creates and initialize a DrawNode3D node */
static DrawNode3D* create();
/**
* Draw 3D Line
*/
void drawLine(const Vec3 &from, const Vec3 &to, const Color4F &color);
/**
* Draw 3D cube
* @param point to a vertex array who has 8 element.
* vertices[0]:Left-top-front,
* vertices[1]:Left-bottom-front,
* vertices[2]:Right-bottom-front,
* vertices[3]:Right-top-front,
* vertices[4]:Right-top-back,
* vertices[5]:Right-bottom-back,
* vertices[6]:Left-bottom-back,
* vertices[7]:Left-top-back.
* @param color
*/
void drawCube(Vec3* vertices, const Color4F &color);
/** Clear the geometry in the node's buffer. */
void clear();
/**
* @js NA
* @lua NA
*/
const BlendFunc& getBlendFunc() const;
/**
* @code
* When this function bound into js or lua,the parameter will be changed
* In js: var setBlendFunc(var src, var dst)
* @endcode
* @lua NA
*/
void setBlendFunc(const BlendFunc &blendFunc);
void onDraw(const Mat4 &transform, uint32_t flags);
// Overrides
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
CC_CONSTRUCTOR_ACCESS:
DrawNode3D();
virtual ~DrawNode3D();
virtual bool init();
protected:
struct V3F_C4B
{
Vec3 vertices;
Color4B colors;
};
void ensureCapacity(int count);
GLuint _vao;
GLuint _vbo;
int _bufferCapacity;
GLsizei _bufferCount;
V3F_C4B* _buffer;
BlendFunc _blendFunc;
CustomCommand _customCommand;
bool _dirty;
private:
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode3D);
};
DrawNode3D::DrawNode3D()
: _vao(0)
, _vbo(0)
, _bufferCapacity(0)
, _bufferCount(0)
, _buffer(nullptr)
, _dirty(false)
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
}
DrawNode3D::~DrawNode3D()
{
free(_buffer);
_buffer = nullptr;
glDeleteBuffers(1, &_vbo);
_vbo = 0;
if (Configuration::getInstance()->supportsShareableVAO())
{
glDeleteVertexArrays(1, &_vao);
GL::bindVAO(0);
_vao = 0;
}
}
DrawNode3D* DrawNode3D::create()
{
DrawNode3D* ret = new (std::nothrow) DrawNode3D();
if (ret && ret->init())
{
ret->autorelease();
}
else
{
CC_SAFE_DELETE(ret);
}
return ret;
}
void DrawNode3D::ensureCapacity(int count)
{
CCASSERT(count>=0, "capacity must be >= 0");
if(_bufferCount + count > _bufferCapacity)
{
_bufferCapacity += MAX(_bufferCapacity, count);
_buffer = (V3F_C4B*)realloc(_buffer, _bufferCapacity*sizeof(V3F_C4B));
}
}
bool DrawNode3D::init()
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_COLOR));
ensureCapacity(512);
if (Configuration::getInstance()->supportsShareableVAO())
{
glGenVertexArrays(1, &_vao);
GL::bindVAO(_vao);
}
glGenBuffers(1, &_vbo);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(V3F_C4B)* _bufferCapacity, _buffer, GL_STREAM_DRAW);
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B), (GLvoid *)offsetof(V3F_C4B, vertices));
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B), (GLvoid *)offsetof(V3F_C4B, colors));
glBindBuffer(GL_ARRAY_BUFFER, 0);
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(0);
}
CHECK_GL_ERROR_DEBUG();
_dirty = true;
#if CC_ENABLE_CACHE_TEXTURE_DATA
// Need to listen the event only when not use batchnode, because it will use VBO
auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){
/** listen the event that coming to foreground on Android */
this->init();
});
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
#endif
return true;
}
void DrawNode3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
{
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(DrawNode3D::onDraw, this, transform, flags);
renderer->addCommand(&_customCommand);
}
void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags)
{
auto glProgram = getGLProgram();
glProgram->use();
glProgram->setUniformsForBuiltins(transform);
glEnable(GL_DEPTH_TEST);
GL::blendFunc(_blendFunc.src, _blendFunc.dst);
if (_dirty)
{
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(V3F_C4B)*_bufferCapacity, _buffer, GL_STREAM_DRAW);
_dirty = false;
}
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(_vao);
}
else
{
GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
// vertex
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B), (GLvoid *)offsetof(V3F_C4B, vertices));
// color
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B), (GLvoid *)offsetof(V3F_C4B, colors));
}
glDrawArrays(GL_LINES, 0, _bufferCount);
glBindBuffer(GL_ARRAY_BUFFER, 0);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCount);
glDisable(GL_DEPTH_TEST);
CHECK_GL_ERROR_DEBUG();
}
void DrawNode3D::drawLine(const Vec3 &from, const Vec3 &to, const Color4F &color)
{
unsigned int vertex_count = 2;
ensureCapacity(vertex_count);
Color4B col = Color4B(color);
V3F_C4B a = {Vec3(from.x, from.y, from.z), col};
V3F_C4B b = {Vec3(to.x, to.y, to.z), col, };
V3F_C4B *lines = (V3F_C4B *)(_buffer + _bufferCount);
lines[0] = a;
lines[1] = b;
_bufferCount += vertex_count;
_dirty = true;
}
void DrawNode3D::drawCube(Vec3* vertices, const Color4F &color)
{
// front face
drawLine(vertices[0], vertices[1], color);
drawLine(vertices[1], vertices[2], color);
drawLine(vertices[2], vertices[3], color);
drawLine(vertices[3], vertices[0], color);
// back face
drawLine(vertices[4], vertices[5], color);
drawLine(vertices[5], vertices[6], color);
drawLine(vertices[6], vertices[7], color);
drawLine(vertices[7], vertices[4], color);
// edge
drawLine(vertices[0], vertices[7], color);
drawLine(vertices[1], vertices[6], color);
drawLine(vertices[2], vertices[5], color);
drawLine(vertices[3], vertices[4], color);
}
void DrawNode3D::clear()
{
_bufferCount = 0;
_dirty = true;
}
const BlendFunc& DrawNode3D::getBlendFunc() const
{
return _blendFunc;
}
void DrawNode3D::setBlendFunc(const BlendFunc &blendFunc)
{
_blendFunc = blendFunc;
}
NS_CC_END
int lua_cocos2dx_DrawNode3D_getBlendFunc(lua_State* L)
{
int argc = 0;
cocos2d::DrawNode3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::DrawNode3D*)tolua_tousertype(L,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode3D_getBlendFunc'", nullptr);
return 0;
}
#endif
argc = lua_gettop(L)-1;
if (argc == 0)
{
if(!ok)
return 0;
const cocos2d::BlendFunc& ret = cobj->getBlendFunc();
blendfunc_to_luaval(L, ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode3D:getBlendFunc",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_DrawNode3D_getBlendFunc'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_DrawNode3D_setBlendFunc(lua_State* L)
{
int argc = 0;
cocos2d::DrawNode3D* cobj = nullptr;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::DrawNode3D*)tolua_tousertype(L,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode3D_setBlendFunc'", nullptr);
return 0;
}
#endif
argc = lua_gettop(L)-1;
if (argc == 2)
{
GLenum src, dst;
if (!luaval_to_int32(L, 2, (int32_t*)&src, "cc.DrawNode3D:setBlendFunc"))
return 0;
if (!luaval_to_int32(L, 3, (int32_t*)&dst, "cc.DrawNode3D:setBlendFunc"))
return 0;
BlendFunc blendFunc = {src, dst};
cobj->setBlendFunc(blendFunc);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode3D:setBlendFunc",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_DrawNode3D_setBlendFunc'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L)
{
int argc = 0;
cocos2d::DrawNode3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::DrawNode3D*)tolua_tousertype(L,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode3D_drawLine'", nullptr);
return 0;
}
#endif
argc = lua_gettop(L)-1;
if (argc == 3)
{
cocos2d::Vec3 arg0;
cocos2d::Vec3 arg1;
cocos2d::Color4F arg2;
ok &= luaval_to_vec3(L, 2, &arg0, "cc.DrawNode3D:drawLine");
ok &= luaval_to_vec3(L, 3, &arg1, "cc.DrawNode3D:drawLine");
ok &=luaval_to_color4f(L, 4, &arg2, "cc.DrawNode3D:drawLine");
if(!ok)
return 0;
cobj->drawLine(arg0, arg1, arg2);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode3D:drawLine",argc, 3);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_DrawNode3D_drawLine'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_DrawNode3D_clear(lua_State* L)
{
int argc = 0;
cocos2d::DrawNode3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::DrawNode3D*)tolua_tousertype(L,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode3D_clear'", nullptr);
return 0;
}
#endif
argc = lua_gettop(L)-1;
if (argc == 0)
{
if(!ok)
return 0;
cobj->clear();
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode3D:clear",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_DrawNode3D_clear'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L)
{
int argc = 0;
cocos2d::DrawNode3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::DrawNode3D*)tolua_tousertype(L,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode3D_drawCube'", nullptr);
return 0;
}
#endif
argc = lua_gettop(L)-1;
if (argc == 2)
{
std::vector<cocos2d::Vec3> arg0;
cocos2d::Color4F arg1;
Vec3 vec3;
#if COCOS2D_DEBUG >= 1
if (!tolua_istable(L, 2, 0, &tolua_err))
goto tolua_lerror;
#endif
size_t size = lua_objlen(L, 2);
for (int i = 0; i < size; i++)
{
lua_pushnumber(L, i + 1);
lua_gettable(L, 2);
#ifndef TOLUA_RELEASE
if (!tolua_istable(L, -1, 0, &tolua_err))
{
lua_pop(L, 1);
goto tolua_lerror;
}
#endif
ok &= luaval_to_vec3(L, lua_gettop(L), &vec3);
#ifndef TOLUA_RELEASE
if (!ok)
{
lua_pop(L, 1);
goto tolua_lerror;
}
#endif
//arg0[i] = vec3;
arg0.push_back(vec3);
lua_pop(L, 1);
}
ok &=luaval_to_color4f(L, 3, &arg1, "cc.DrawNode3D:drawCube");
if(!ok)
return 0;
cobj->drawCube(&arg0[0], arg1);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode3D:drawCube",argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_DrawNode3D_drawCube'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_DrawNode3D_create(lua_State* L)
{
int argc = 0;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(L) - 1;
if (argc == 0)
{
if(!ok)
return 0;
cocos2d::DrawNode3D* ret = cocos2d::DrawNode3D::create();
object_to_luaval<cocos2d::DrawNode3D>(L, "cc.DrawNode3D",(cocos2d::DrawNode3D*)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.DrawNode3D:create",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_DrawNode3D_create'.",&tolua_err);
#endif
return 0;
}
int lua_register_cocos2dx_DrawNode3D(lua_State* L)
{
tolua_usertype(L,"cc.DrawNode3D");
tolua_cclass(L,"DrawNode3D","cc.DrawNode3D","cc.Node",nullptr);
tolua_beginmodule(L,"DrawNode3D");
tolua_function(L,"getBlendFunc",lua_cocos2dx_DrawNode3D_getBlendFunc);
tolua_function(L,"setBlendFunc",lua_cocos2dx_DrawNode3D_setBlendFunc);
tolua_function(L,"drawLine",lua_cocos2dx_DrawNode3D_drawLine);
tolua_function(L,"clear",lua_cocos2dx_DrawNode3D_clear);
tolua_function(L,"drawCube",lua_cocos2dx_DrawNode3D_drawCube);
tolua_function(L,"create", lua_cocos2dx_DrawNode3D_create);
tolua_endmodule(L);
std::string typeName = typeid(cocos2d::DrawNode3D).name();
g_luaType[typeName] = "cc.DrawNode3D";
g_typeCast["DrawNode3D"] = "cc.DrawNode3D";
return 1;
}
int register_test_binding(lua_State* L)
{
tolua_open(L);
tolua_module(L, "cc", 0);
tolua_beginmodule(L, "cc");
lua_register_cocos2dx_DrawNode3D(L);
tolua_endmodule(L);
return 0;
}

View File

@ -0,0 +1,14 @@
#ifndef COCOS2DX_TEST_LUA_TESTS_PROJECT_CLASSES_LUA_TEST_BINDINGS_H
#define COCOS2DX_TEST_LUA_TESTS_PROJECT_CLASSES_LUA_TEST_BINDINGS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "tolua++.h"
#ifdef __cplusplus
}
#endif
TOLUA_API int register_test_binding(lua_State* tolua_S);
#endif // #ifndef COCOS2DX_TEST_LUA_TESTS_PROJECT_CLASSES_LUA_TEST_BINDINGS_H

View File

@ -33,7 +33,7 @@
"to": "" "to": ""
}, },
{ {
"from": "../../../../cocos/scripting/lua-bindings/script/cocostudio", "from": "../../../../cocos/scripting/lua-bindings/script/cocosstudio",
"to": "" "to": ""
}, },
{ {

View File

@ -8,7 +8,8 @@ LOCAL_MODULE_FILENAME := liblua_tests
LOCAL_SRC_FILES += main.cpp \ LOCAL_SRC_FILES += main.cpp \
../../Classes/AppDelegate.cpp \ ../../Classes/AppDelegate.cpp \
../../Classes/lua_assetsmanager_test_sample.cpp ../../Classes/lua_assetsmanager_test_sample.cpp \
../../Classes/lua_test_bindings.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes

View File

@ -112,7 +112,7 @@
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\network" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\network" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosbuilder" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosbuilder" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocostudio" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosstudio" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\extension" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\extension" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\ui" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\ui" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\..\" /e /Y
@ -167,7 +167,7 @@ xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(ProjectDir)..\..\res" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\network" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\network" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosbuilder" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosbuilder" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocostudio" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocosstudio" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\extension" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\extension" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\ui" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\ui" "$(ProjectDir)..\..\" /e /Y
xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\..\" /e /Y xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\..\" /e /Y
@ -182,12 +182,14 @@ xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(ProjectDir)..\..\res" /e /Y
<ItemGroup> <ItemGroup>
<ClInclude Include="..\Classes\AppDelegate.h" /> <ClInclude Include="..\Classes\AppDelegate.h" />
<ClInclude Include="..\Classes\lua_assetsmanager_test_sample.h" /> <ClInclude Include="..\Classes\lua_assetsmanager_test_sample.h" />
<ClInclude Include="..\Classes\lua_test_bindings.h" />
<ClInclude Include="..\Classes\lua_module_register.h" /> <ClInclude Include="..\Classes\lua_module_register.h" />
<ClInclude Include="main.h" /> <ClInclude Include="main.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\Classes\AppDelegate.cpp" /> <ClCompile Include="..\Classes\AppDelegate.cpp" />
<ClCompile Include="..\Classes\lua_assetsmanager_test_sample.cpp" /> <ClCompile Include="..\Classes\lua_assetsmanager_test_sample.cpp" />
<ClCompile Include="..\Classes\lua_test_bindings.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -21,6 +21,9 @@
<ClInclude Include="..\Classes\lua_module_register.h"> <ClInclude Include="..\Classes\lua_module_register.h">
<Filter>Classes</Filter> <Filter>Classes</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Classes\lua_test_bindings.h">
<Filter>Classes</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\Classes\AppDelegate.cpp"> <ClCompile Include="..\Classes\AppDelegate.cpp">
@ -32,5 +35,8 @@
<ClCompile Include="..\Classes\lua_assetsmanager_test_sample.cpp"> <ClCompile Include="..\Classes\lua_assetsmanager_test_sample.cpp">
<Filter>Classes</Filter> <Filter>Classes</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\Classes\lua_test_bindings.cpp">
<Filter>Classes</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -413,7 +413,22 @@ function Camera3DTestDemo:onEnter()
self:SwitchViewCallback(self, CameraType.ThirdCamera) self:SwitchViewCallback(self, CameraType.ThirdCamera)
--UNDO DrawLine3D drwaline local line = cc.DrawNode3D:create()
--draw x
for i = -20 ,20 do
line:drawLine(cc.vec3(-100, 0, 5 * i), cc.vec3(100, 0, 5 * i), cc.c4f(1, 0, 0, 0))
end
--draw z
for i = -20, 20 do
line:drawLine(cc.vec3(5 * i, 0, -100), cc.vec3(5 * i, 0, 100), cc.c4f(0, 0, 1, 1))
end
--draw y
line:drawLine(cc.vec3(0, -50, 0), cc.vec3(0,0,0), cc.c4f(0, 0.5, 0, 1))
line:drawLine(cc.vec3(0, 0, 0), cc.vec3(0,50,0), cc.c4f(0, 1, 0, 1))
self._layer3D:addChild(line)
self._layer3D:setCameraMask(2) self._layer3D:setCameraMask(2)
end end

View File

@ -629,6 +629,245 @@ function Sprite3DReskinTest.create()
return layer return layer
end end
----------------------------------------
----Sprite3DWithOBBPerfromanceTest
----------------------------------------
local Sprite3DWithOBBPerfromanceTest = class("Sprite3DWithOBBPerfromanceTest",function()
return cc.Layer:create()
end)
function Sprite3DWithOBBPerfromanceTest:ctor()
self._obb = {}
local listener = cc.EventListenerTouchAllAtOnce:create()
listener:registerScriptHandler(function (touches, event)
for i,touch in ipairs(touches) do
local location = touch:getLocationInView()
if nil ~= self._obb and #self._obb > 0 then
self._intersetList = {}
local ray = cc.Ray:new()
self:calculateRayByLocationInView(ray, location)
for idx,value in ipairs(self._obb) do
if ray:intersects(value) then
table.insert(self._intersetList, idx)
return
end
end
end
end
end,cc.Handler.EVENT_TOUCHES_BEGAN)
listener:registerScriptHandler(function (touches, event)
end,cc.Handler.EVENT_TOUCHES_ENDED)
listener:registerScriptHandler(function (touches, event)
for i,touch in ipairs(touches) do
local location = touch:getLocation()
for idx,value in ipairs(self._obb) do
for lstIdx,lstValue in ipairs(self._intersetList) do
if idx == lstValue then
self._obb[idx]._center = cc.vec3(location.x,location.y,0)
end
end
end
end
end,cc.Handler.EVENT_TOUCHES_MOVED)
local eventDispatcher = self:getEventDispatcher()
eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self)
local s = cc.Director:getInstance():getWinSize()
self:initDrawBox()
self:addNewSpriteWithCoords(cc.p(s.width/2, s.height/2))
cc.MenuItemFont:setFontName("fonts/arial.ttf")
cc.MenuItemFont:setFontSize(65)
local decrease = cc.MenuItemFont:create(" - ")
decrease:registerScriptTapHandler(function(tag, sender)
self:delOBBWithCount(10)
end)
decrease:setColor(cc.c3b(0, 200, 20))
local increase = cc.MenuItemFont:create(" + ")
increase:registerScriptTapHandler(function(tag, sender)
self:addOBBWithCount(10)
end)
increase:setColor(cc.c3b(0, 200, 20))
local menu = cc.Menu:create(decrease, increase)
menu:alignItemsHorizontally()
menu:setPosition(cc.p(s.width/2, s.height - 90))
self:addChild(menu, 1)
local ttfConfig = {}
ttfConfig.fontFilePath = "fonts/Marker Felt.ttf"
ttfConfig.fontSize = 30
self._labelCubeCount = cc.Label:createWithTTF(ttfConfig,"0 cubes")
self._labelCubeCount:setColor(cc.c3b(0,200,20))
self._labelCubeCount:setPosition(cc.p(s.width/2, s.height-90))
self:addChild(self._labelCubeCount)
self:addOBBWithCount(10)
self:scheduleUpdateWithPriorityLua(function(dt)
self._labelCubeCount:setString(string.format("%u cubes", #self._obb))
if nil ~= self._drawDebug then
self._drawDebug:clear()
local mat = self._sprite:getNodeToWorldTransform()
self._obbt._xAxis = cc.vec3(mat[1], mat[2], mat[3])
self._obbt._xAxis = cc.vec3normalize(self._obbt._xAxis)
self._obbt._yAxis = cc.vec3(mat[5], mat[6], mat[7])
self._obbt._yAxis = cc.vec3normalize(self._obbt._yAxis)
self._obbt._zAxis = cc.vec3(-mat[9], -mat[10], -mat[11])
self._obbt._zAxis = cc.vec3normalize(self._obbt._zAxis)
self._obbt._center = self._sprite:getPosition3D()
local corners = {}
for i=1,8 do
corners[i] = {}
end
corners = self._obbt:getCorners(corners)
self._drawDebug:drawCube(corners, cc.c4f(0, 0, 1, 1))
end
if #self._obb > 0 then
self._drawOBB:clear()
for i= 1, #self._obb do
local corners = {}
for i=1,8 do
corners[i] = {}
end
corners = self._obb[i]:getCorners(corners)
if self._obbt:intersects(self._obb[i]) then
self._drawOBB:drawCube(corners, cc.c4f(1, 0, 0, 1))
else
self._drawOBB:drawCube(corners, cc.c4f(0, 1, 0, 1))
end
end
end
end, 0)
end
function Sprite3DWithOBBPerfromanceTest:addOBBWithCount( value )
for i=1,value do
local randompos = cc.p(math.random() * cc.Director:getInstance():getWinSize().width, math.random() * cc.Director:getInstance():getWinSize().height)
local extents = cc.vec3(10, 10, 10)
local aabb = cc.AABB:new({x = -10, y = -10, z = -10}, extents)
local obb = cc.OBB:new(aabb)
obb._center = cc.vec3(randompos.x,randompos.y,0)
table.insert(self._obb, obb)
end
end
function Sprite3DWithOBBPerfromanceTest:delOBBWithCount( value )
if #self._obb >= 10 then
for i= 1, 10 do
table.remove(self._obb)
end
self._drawOBB:clear()
end
end
function Sprite3DWithOBBPerfromanceTest:initDrawBox()
self._drawOBB = cc.DrawNode3D:create()
self:addChild(self._drawOBB )
end
function Sprite3DWithOBBPerfromanceTest:unproject( viewProjection, viewport, src, dst)
assert(viewport.width ~= 0.0 and viewport.height ~= 0)
local screen = cc.vec4(src.x / viewport.width, (viewport.height - src.y) / viewport.height, src.z, 1.0)
screen.x = screen.x * 2.0 - 1.0
screen.y = screen.y * 2.0 - 1.0
screen.z = screen.z * 2.0 - 1.0
local inversed = cc.mat4.new(viewProjection:getInversed())
screen = inversed:transformVector(screen, screen)
if screen.w ~= 0.0 then
screen.x = screen.x / screen.w
screen.y = screen.y / screen.w
screen.z = screen.z / screen.w
end
dst.x = screen.x
dst.y = screen.y
dst.z = screen.z
return viewport, src, dst
end
function Sprite3DWithOBBPerfromanceTest:calculateRayByLocationInView(ray, location)
local dir = cc.Director:getInstance()
local view = dir:getWinSize()
local mat = cc.mat4.new(dir:getMatrix(cc.MATRIX_STACK_TYPE.PROJECTION))
local src = cc.vec3(location.x, location.y, -1)
local nearPoint = {}
view, src, nearPoint = self:unproject(mat, view, src, nearPoint)
src = cc.vec3(location.x, location.y, 1)
local farPoint = {}
view, src, farPoint = self:unproject(mat, view, src, farPoint)
local direction = {}
direction.x = farPoint.x - nearPoint.x
direction.y = farPoint.y - nearPoint.y
direction.z = farPoint.z - nearPoint.z
direction = cc.vec3normalize(direction)
ray._origin = nearPoint
ray._direction = direction
end
function Sprite3DWithOBBPerfromanceTest:addNewSpriteWithCoords(vec2)
local fileName = "Sprite3DTest/tortoise.c3b"
local sprite = cc.Sprite3D:create(fileName)
sprite:setScale(0.1)
local s = cc.Director:getInstance():getWinSize()
sprite:setPosition(cc.p(s.width * 4.0 / 5.0, s.height / 2.0))
self:addChild(sprite)
self._sprite = sprite
local animation = cc.Animation3D:create(fileName)
if nil ~= animation then
local animate = cc.Animate3D:create(animation, 0.0, 1.933)
sprite:runAction(cc.RepeatForever:create(animate))
end
self._moveAction = cc.MoveTo:create(4.0, cc.p(s.width / 5.0, s.height / 2.0))
self._moveAction:retain()
local function reachEndCallBack()
self._sprite:stopActionByTag(100)
local inverse = self._moveAction:reverse()
inverse:retain()
self._moveAction:release()
self._moveAction = inverse
local rot = cc.RotateBy:create(1.0, { x = 0.0, y = 180.0, z = 0.0})
local seq = cc.Sequence:create(rot, self._moveAction, cc.CallFunc:create(reachEndCallBack))
seq:setTag(100)
self._sprite:runAction(seq)
end
local seq = cc.Sequence:create(self._moveAction, cc.CallFunc:create(reachEndCallBack))
seq:setTag(100)
sprite:runAction(seq)
local aabb = self._sprite:getAABB()
self._obbt = cc.OBB:new(aabb)
self._drawDebug = cc.DrawNode3D:create()
self:addChild(self._drawDebug)
end
function Sprite3DWithOBBPerfromanceTest.create()
local layer = Sprite3DWithOBBPerfromanceTest.new()
Helper.initWithLayer(layer)
Helper.titleLabel:setString("OBB Collison Perfromance Test")
return layer
end
---------------------------------------- ----------------------------------------
----Sprite3DMirrorTest ----Sprite3DMirrorTest
---------------------------------------- ----------------------------------------
@ -680,7 +919,6 @@ function Sprite3DMirrorTest.create()
return layer return layer
end end
function Sprite3DTest() function Sprite3DTest()
local scene = cc.Scene:create() local scene = cc.Scene:create()
@ -692,6 +930,7 @@ function Sprite3DTest()
Animate3DTest.create, Animate3DTest.create,
AttachmentTest.create, AttachmentTest.create,
Sprite3DReskinTest.create, Sprite3DReskinTest.create,
Sprite3DWithOBBPerfromanceTest.create,
Sprite3DMirrorTest.create, Sprite3DMirrorTest.create,
} }

@ -1 +1 @@
Subproject commit 1a71fe7be45db504f3bdc0e24e8d7eca83f2fc1a Subproject commit b49fad3fb2dbc396e71a5b1178cf2532309cd174

View File

@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h
# what classes to produce code for. You can use regular expressions here. When testing the regular # 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*$". # expression, it will be enclosed in "^$", like this: "^Menu*$".
classes = Animate3D Sprite3D Animation3D Skeleton3D ^Mesh$ AttachNode AABB OBB BillBoard classes = Animate3D Sprite3D Animation3D Skeleton3D ^Mesh$ AttachNode BillBoard
# what should we skip? in the format ClassName::[function function] # 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 # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
@ -39,8 +39,6 @@ skip = Mesh::[create getAABB getVertexBuffer hasVertexAttrib getMeshVertexAttrib
Sprite3D::[getSkin getAABB setBlendFunc], Sprite3D::[getSkin getAABB setBlendFunc],
Skeleton3D::[create], Skeleton3D::[create],
Animation3D::[getBoneCurveByName], Animation3D::[getBoneCurveByName],
AABB::[intersects merge],
OBB::[intersects],
BillBoard::[draw] BillBoard::[draw]
@ -59,7 +57,7 @@ base_classes_to_skip = Clonable
# classes that create no constructor # classes that create no constructor
# Set is special and we will use a hand-written constructor # Set is special and we will use a hand-written constructor
abstract_classes = OBB 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'. # 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 script_control_cpp = no