From a7a2490aee854a9587d7286750f11d00f688990c Mon Sep 17 00:00:00 2001 From: dimkaafan Date: Tue, 1 Jul 2014 10:23:21 +0400 Subject: [PATCH 001/147] bug on began touch - prevpoint --- cocos/base/CCTouch.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/base/CCTouch.h b/cocos/base/CCTouch.h index 624016aafd..efde06d223 100644 --- a/cocos/base/CCTouch.h +++ b/cocos/base/CCTouch.h @@ -77,6 +77,7 @@ public: { _startPoint = _point; _startPointCaptured = true; + _prevPoint = _point; } } /** From 5349aa7efba0f6803020d3c92547478141e62029 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Thu, 7 Aug 2014 20:57:26 +0900 Subject: [PATCH 002/147] Add ccRandom.h --- build/cocos2d_libs.xcodeproj/project.pbxproj | 6 ++ cocos/base/ccRandom.h | 103 +++++++++++++++++++ templates/cocos2dx_files.json | 1 + 3 files changed, 110 insertions(+) create mode 100644 cocos/base/ccRandom.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index ae84e6534b..910a81b397 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -567,6 +567,8 @@ 1AD71EF5180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */; }; 1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; + 1F36C031BE016A88AB195F1B /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; + 1F36C5F58B5642071337D8E2 /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244C19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 2958244A19873D8E00F9746D /* UIScale9Sprite.h */; }; @@ -2393,6 +2395,7 @@ 1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsDebugNode.h; sourceTree = ""; }; 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = ""; }; 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = ""; }; + 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccRandom.h; path = ../base/ccRandom.h; sourceTree = ""; }; 2905F9E918CF08D000240AA3 /* CocosGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUI.cpp; sourceTree = ""; }; 2905F9EA18CF08D000240AA3 /* CocosGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUI.h; sourceTree = ""; }; 2905F9EB18CF08D000240AA3 /* GUIDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDefine.h; sourceTree = ""; }; @@ -3469,6 +3472,7 @@ 50ABBDFB1925AB6E00A911A9 /* CCProfiling.cpp */, 50ABBDFC1925AB6E00A911A9 /* CCProfiling.h */, 50ABBDFD1925AB6E00A911A9 /* CCProtocols.h */, + 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */, 50ABBDFE1925AB6E00A911A9 /* CCRef.cpp */, 50ABBDFF1925AB6E00A911A9 /* CCRef.h */, 50ABBE001925AB6E00A911A9 /* CCRefPtr.h */, @@ -5457,6 +5461,7 @@ B6ACD899193D6693005E0B8A /* CCMeshSkin.h in Headers */, B6ACD8A0193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, B6AAF84319404E0D0069DE01 /* CCBundle3D.h in Headers */, + 1F36C031BE016A88AB195F1B /* ccRandom.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5833,6 +5838,7 @@ B6ACD89A193D6693005E0B8A /* CCMeshSkin.h in Headers */, B6ACD8A1193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, B6AAF84419404E0D0069DE01 /* CCBundle3D.h in Headers */, + 1F36C5F58B5642071337D8E2 /* ccRandom.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h new file mode 100644 index 0000000000..2be07b6a95 --- /dev/null +++ b/cocos/base/ccRandom.h @@ -0,0 +1,103 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#ifndef __ccRandom_H_ +#define __ccRandom_H_ + +#include "base/CCPlatformMacros.h" +#include + + +NS_CC_BEGIN + +class RandomHelper { +public: + template + static inline T random_real(T min, T max) { + std::uniform_real_distribution dist(min, max); + std::mt19937 mt = RandomHelper::getEngine(); + return dist(mt); + } + + template + static inline T random_int(T min, T max) { + std::uniform_int_distribution<> dist(min, max); + std::mt19937 mt = RandomHelper::getEngine(); + return dist(mt); + } +private: + static std::mt19937 getEngine() { + static std::random_device seed_gen; + static std::mt19937 engine(seed_gen()); + return engine; + } +}; + +/** +* returns a random value between `min` and `max` +*/ +template +inline T random(T min, T max) { + return RandomHelper::random_int(min, max); +} + +template<> +inline float random(float min, float max) { + return RandomHelper::random_real(min, max); +} + +template<> +inline long double random(long double min, long double max) { + return RandomHelper::random_real(min, max); +} + +template<> +inline double random(double min, double max) { + return RandomHelper::random_real(min, max); +} + +/** +* returns a random int between 0 and RAND_MAX +*/ +inline int random() { + return cocos2d::random(0, RAND_MAX); +}; + +/** +* returns a random float between -1 and 1 +*/ +inline float rand_minus1_1() { + return cocos2d::random(-1.f, 1.f); +}; + +/** +* returns a random float between 0 and 1 +*/ +inline float rand_0_1() { + return cocos2d::random(0.f, 1.f); +}; + +NS_CC_END +#endif //__ccRandom_H_ diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 49bba596f5..e9f888e127 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -344,6 +344,7 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", + "cocos/base/ccRanrom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", "cocos/base/CCRefPtr.h", From 2ca881287ff799fa21f9e4516c1b0932476992d7 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Thu, 7 Aug 2014 21:01:30 +0900 Subject: [PATCH 003/147] CCRANDOM macro use ccRandom --- cocos/base/ccMacros.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index 165dbab7cf..9c13d654df 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -69,16 +69,17 @@ simple macro that swaps 2 variables x = y; y = temp; \ } +#include "base/ccRandom.h" /** @def CCRANDOM_MINUS1_1 returns a random float between -1 and 1 */ -#define CCRANDOM_MINUS1_1() ((2.0f*((float)rand()/RAND_MAX))-1.0f) +#define CCRANDOM_MINUS1_1() cocos2d::rand_minus1_1() /** @def CCRANDOM_0_1 returns a random float between 0 and 1 */ -#define CCRANDOM_0_1() ((float)rand()/RAND_MAX) +#define CCRANDOM_0_1() cocos2d::rand_0_1() /** @def CC_DEGREES_TO_RADIANS converts degrees to radians From 813e954f4e0d482222d975fa29d83715ec04ecf9 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 8 Aug 2014 00:00:58 +0800 Subject: [PATCH 004/147] aabb, obb --- build/cocos2d_libs.xcodeproj/project.pbxproj | 24 + cocos/3d/CCAABB.cpp | 186 ++++++++ cocos/3d/CCAABB.h | 114 +++++ cocos/3d/CCOBB.cpp | 439 +++++++++++++++++++ cocos/3d/CCOBB.h | 117 +++++ cocos/3d/CMakeLists.txt | 2 + cocos/Android.mk | 2 + templates/cocos2dx_files.json | 4 + 8 files changed, 888 insertions(+) create mode 100755 cocos/3d/CCAABB.cpp create mode 100755 cocos/3d/CCAABB.h create mode 100755 cocos/3d/CCOBB.cpp create mode 100755 cocos/3d/CCOBB.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index f6336e4b6a..c9cb06ded3 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -584,6 +584,14 @@ 3E6176771960F89B00DE83F5 /* CCEventListenerController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */; }; 3E6176781960F89B00DE83F5 /* CCGameController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176651960F89B00DE83F5 /* CCGameController.h */; }; 3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61781C1966A5A300DE83F5 /* CCController.cpp */; }; + 3E9E75E41993D8E4005B7047 /* CCAABB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E75E01993D8E4005B7047 /* CCAABB.cpp */; }; + 3E9E75E51993D8E4005B7047 /* CCAABB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E75E01993D8E4005B7047 /* CCAABB.cpp */; }; + 3E9E75E61993D8E4005B7047 /* CCAABB.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E75E11993D8E4005B7047 /* CCAABB.h */; }; + 3E9E75E71993D8E4005B7047 /* CCAABB.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E75E11993D8E4005B7047 /* CCAABB.h */; }; + 3E9E75E81993D8E4005B7047 /* CCOBB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E75E21993D8E4005B7047 /* CCOBB.cpp */; }; + 3E9E75E91993D8E4005B7047 /* CCOBB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E75E21993D8E4005B7047 /* CCOBB.cpp */; }; + 3E9E75EA1993D8E4005B7047 /* CCOBB.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E75E31993D8E4005B7047 /* CCOBB.h */; }; + 3E9E75EB1993D8E4005B7047 /* CCOBB.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E75E31993D8E4005B7047 /* CCOBB.h */; }; 3E9E80E9198639EF00FA95D0 /* CCAttachNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */; }; 3E9E80EA198639EF00FA95D0 /* CCAttachNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */; }; 3E9E80EB198639EF00FA95D0 /* CCAttachNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E4198639EF00FA95D0 /* CCAttachNode.h */; }; @@ -2477,6 +2485,10 @@ 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerController.h; path = ../base/CCEventListenerController.h; sourceTree = ""; }; 3E6176651960F89B00DE83F5 /* CCGameController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGameController.h; path = ../base/CCGameController.h; sourceTree = ""; }; 3E61781C1966A5A300DE83F5 /* CCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCController.cpp; path = ../base/CCController.cpp; sourceTree = ""; }; + 3E9E75E01993D8E4005B7047 /* CCAABB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAABB.cpp; sourceTree = ""; }; + 3E9E75E11993D8E4005B7047 /* CCAABB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAABB.h; sourceTree = ""; }; + 3E9E75E21993D8E4005B7047 /* CCOBB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCOBB.cpp; sourceTree = ""; }; + 3E9E75E31993D8E4005B7047 /* CCOBB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCOBB.h; sourceTree = ""; }; 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAttachNode.cpp; sourceTree = ""; }; 3E9E80E4198639EF00FA95D0 /* CCAttachNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAttachNode.h; sourceTree = ""; }; 3E9E80E5198639EF00FA95D0 /* CCSubMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSubMesh.cpp; sourceTree = ""; }; @@ -5202,6 +5214,10 @@ B29594B81926D61F003EEF37 /* 3d */ = { isa = PBXGroup; children = ( + 3E9E75E01993D8E4005B7047 /* CCAABB.cpp */, + 3E9E75E11993D8E4005B7047 /* CCAABB.h */, + 3E9E75E21993D8E4005B7047 /* CCOBB.cpp */, + 3E9E75E31993D8E4005B7047 /* CCOBB.h */, 3EA3EDCA199234B500645534 /* CCDrawNode3D.cpp */, 3EA3EDCB199234B500645534 /* CCDrawNode3D.h */, 3EA2A83E1987A6810077B3D4 /* CCSkeleton3D.cpp */, @@ -5339,6 +5355,7 @@ 1A570216180BCBF40088DEC7 /* CCRenderTexture.h in Headers */, 1A01C69618F57BE800EFE3A6 /* CCInteger.h in Headers */, 3EA3EDCE199234B500645534 /* CCDrawNode3D.h in Headers */, + 3E9E75EA1993D8E4005B7047 /* CCOBB.h in Headers */, 1A570223180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */, 50ABBD891925AB4100A911A9 /* CCCustomCommand.h in Headers */, 5034CA43191D591100CE6051 /* ccShader_Label.vert in Headers */, @@ -5387,6 +5404,7 @@ 50ABBDBB1925AB4100A911A9 /* CCTextureAtlas.h in Headers */, 1A570302180BCE890088DEC7 /* CCParallaxNode.h in Headers */, 50ABBE4B1925AB6F00A911A9 /* CCEventAcceleration.h in Headers */, + 3E9E75E61993D8E4005B7047 /* CCAABB.h in Headers */, 1A57030E180BCF190088DEC7 /* CCComponent.h in Headers */, 3E9E80EF198639EF00FA95D0 /* CCSubMesh.h in Headers */, 1A570312180BCF190088DEC7 /* CCComponentContainer.h in Headers */, @@ -5621,6 +5639,7 @@ 503DD8EF1926736A00CD74DD /* CCPlatformDefine.h in Headers */, 46A171041807CECB005B8026 /* CCPhysicsShape.h in Headers */, 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, + 3E9E75EB1993D8E4005B7047 /* CCOBB.h in Headers */, 5034CA38191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */, 50ABBE7C1925AB6F00A911A9 /* CCEventMouse.h in Headers */, B29594D11926D61F003EEF37 /* CCSprite3DMaterial.h in Headers */, @@ -5851,6 +5870,7 @@ B6B2634019381FBF0088FE25 /* CCAnimationCurve.h in Headers */, B6B26346193884D60088FE25 /* CCAnimation3D.h in Headers */, B6ACD89A193D6693005E0B8A /* CCMeshSkin.h in Headers */, + 3E9E75E71993D8E4005B7047 /* CCAABB.h in Headers */, B6ACD8A1193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, B6AAF84419404E0D0069DE01 /* CCBundle3D.h in Headers */, ); @@ -6885,6 +6905,7 @@ 50ABBD481925AB0000A911A9 /* Mat4.cpp in Sources */, 50ABBD8F1925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */, 50ABBD441925AB0000A911A9 /* CCVertex.cpp in Sources */, + 3E9E75E81993D8E4005B7047 /* CCOBB.cpp in Sources */, 503DD8F71926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */, 50ABBE751925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, 50ABBE511925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */, @@ -6904,6 +6925,7 @@ 50ABBECF1925AB6F00A911A9 /* TGAlib.cpp in Sources */, 50ABBE451925AB6F00A911A9 /* CCEvent.cpp in Sources */, 50ABBE611925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, + 3E9E75E41993D8E4005B7047 /* CCAABB.cpp in Sources */, 50ABBD9F1925AB4100A911A9 /* CCGroupCommand.cpp in Sources */, 50ABBD871925AB4100A911A9 /* CCCustomCommand.cpp in Sources */, 50ABBDBD1925AB4100A911A9 /* CCTextureCache.cpp in Sources */, @@ -7099,6 +7121,7 @@ 50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, 50ABBE461925AB6F00A911A9 /* CCEvent.cpp in Sources */, 50ABBEA01925AB6F00A911A9 /* CCScheduler.cpp in Sources */, + 3E9E75E91993D8E4005B7047 /* CCOBB.cpp in Sources */, 3E9E80EA198639EF00FA95D0 /* CCAttachNode.cpp in Sources */, 3EA3EDCD199234B500645534 /* CCDrawNode3D.cpp in Sources */, 50ABBE4E1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */, @@ -7107,6 +7130,7 @@ 1A570076180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */, B37510851823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */, 50ABBD551925AB0000A911A9 /* TransformUtils.cpp in Sources */, + 3E9E75E51993D8E4005B7047 /* CCAABB.cpp in Sources */, 1A57007A180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */, 50ABBEC01925AB6F00A911A9 /* CCValue.cpp in Sources */, 50ABBD591925AB0000A911A9 /* Vec2.cpp in Sources */, diff --git a/cocos/3d/CCAABB.cpp b/cocos/3d/CCAABB.cpp new file mode 100755 index 0000000000..0cc13f2e46 --- /dev/null +++ b/cocos/3d/CCAABB.cpp @@ -0,0 +1,186 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "3d/CCAABB.h" + +NS_CC_BEGIN + +AABB::AABB() +{ + reset(); +} + +AABB::AABB(const Vec3& min, const Vec3& max) +{ + set(min, max); +} + +AABB::AABB(const AABB& box) +{ + set(box._min,box._max); +} + +Vec3 AABB::getCenter() +{ + Vec3 center; + center.x = 0.5f*(_min.x+_max.x); + center.y = 0.5f*(_min.y+_max.y); + center.z = 0.5f*(_min.z+_max.z); + + return center; +} + +void AABB::getCorners(Vec3 *dst) const +{ + assert(dst); + + // Near face, specified counter-clockwise looking towards the origin from the positive z-axis. + // Left-top-front. + dst[0].set(_min.x, _max.y, _max.z); + // Left-bottom-front. + dst[1].set(_min.x, _min.y, _max.z); + // Right-bottom-front. + dst[2].set(_max.x, _min.y, _max.z); + // Right-top-front. + dst[3].set(_max.x, _max.y, _max.z); + + // Far face, specified counter-clockwise looking towards the origin from the negative z-axis. + // Right-top-back. + dst[4].set(_max.x, _max.y, _min.z); + // Right-bottom-back. + dst[5].set(_max.x, _min.y, _min.z); + // Left-bottom-back. + dst[6].set(_min.x, _min.y, _min.z); + // Left-top-back. + dst[7].set(_min.x, _max.y, _min.z); +} + +bool AABB::intersects(const AABB& aabb) const +{ + return ((_min.x >= aabb._min.x && _min.x <= aabb._max.x) || (aabb._min.x >= _min.x && aabb._min.x <= _max.x)) && + ((_min.y >= aabb._min.y && _min.y <= aabb._max.y) || (aabb._min.y >= _min.y && aabb._min.y <= _max.y)) && + ((_min.z >= aabb._min.z && _min.z <= aabb._max.z) || (aabb._min.z >= _min.z && aabb._min.z <= _max.z)); +} + +bool AABB::containPoint(const Vec3& point) const +{ + if (point.x < _min.x) return false; + if (point.y < _min.y) return false; + if (point.z < _min.z) return false; + if (point.x > _max.x) return false; + if (point.y > _max.y) return false; + if (point.z > _max.z) return false; + return true; +} + +void AABB::merge(const AABB& box) +{ + // Calculate the new minimum point. + _min.x = std::min(_min.x, box._min.x); + _min.y = std::min(_min.y, box._min.y); + _min.z = std::min(_min.z, box._min.z); + + // Calculate the new maximum point. + _max.x = std::max(_max.x, box._max.x); + _max.y = std::max(_max.y, box._max.y); + _max.z = std::max(_max.z, box._max.z); +} + +void AABB::set(const Vec3& min, const Vec3& max) +{ + this->_min = min; + this->_max = max; +} + +void AABB::reset() +{ + _min.set(99999.0f, 99999.0f, 99999.0f); + _max.set(-99999.0f, -99999.0f, -99999.0f); +} + +void AABB::updateMinMax(const Vec3* point, ssize_t num) +{ + for (ssize_t i = 0; i < num; i++) + { + // Leftmost point. + if (point[i].x < _min.x) + _min.x = point[i].x; + + // Lowest point. + if (point[i].y < _min.y) + _min.y = point[i].y; + + // Farthest point. + if (point[i].z < _min.z) + _min.z = point[i].z; + + // Rightmost point. + if (point[i].x > _max.x) + _max.x = point[i].x; + + // Highest point. + if (point[i].y > _max.y) + _max.y = point[i].y; + + // Nearest point. + if (point[i].z > _max.z) + _max.z = point[i].z; + } +} + +void AABB::transform(const Mat4& matrix) +{ + Vec3 corners[8]; + // Near face, specified counter-clockwise + // Left-top-front. + corners[0].set(_min.x, _max.y, _max.z); + // Left-bottom-front. + corners[1].set(_min.x, _min.y, _max.z); + // Right-bottom-front. + corners[2].set(_max.x, _min.y, _max.z); + // Right-top-front. + corners[3].set(_max.x, _max.y, _max.z); + + // Far face, specified clockwise + // Right-top-back. + corners[4].set(_max.x, _max.y, _min.z); + // Right-bottom-back. + corners[5].set(_max.x, _min.y, _min.z); + // Left-bottom-back. + corners[6].set(_min.x, _min.y, _min.z); + // Left-top-back. + corners[7].set(_min.x, _max.y, _min.z); + + // Transform the corners, recalculating the min and max points along the way. + //matrix.transformPoint(&corners[0]); + + for (int i = 0; i < 8; i++) + matrix.transformPoint(&corners[i]); + + reset(); + + updateMinMax(corners, 8); +} + +NS_CC_END diff --git a/cocos/3d/CCAABB.h b/cocos/3d/CCAABB.h new file mode 100755 index 0000000000..97d25a09fe --- /dev/null +++ b/cocos/3d/CCAABB.h @@ -0,0 +1,114 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CC_AABB_H__ +#define __CC_AABB_H__ + +#include "base/ccMacros.h" +#include "math/CCMath.h" + +NS_CC_BEGIN + +class CC_DLL AABB +{ + +public: + /** + * Constructor. + */ + AABB(); + + /** + * Constructor. + */ + AABB(const Vec3& min, const Vec3& max); + + /** + * Constructor. + */ + AABB(const AABB& box); + + /** + * Gets the center point of the bounding box. + */ + Vec3 getCenter(); + + /* Near face, specified counter-clockwise looking towards the origin from the positive z-axis. + * verts[0] : left top front + * verts[1] : left bottom front + * verts[2] : right bottom front + * verts[3] : right top front + * + * Far face, specified counter-clockwise looking towards the origin from the negative z-axis. + * verts[4] : right top back + * verts[5] : right bottom back + * verts[6] : left bottom back + * verts[7] : left top back + */ + void getCorners(Vec3 *dst) const; + + /** + * Tests whether this bounding box intersects the specified bounding object. + */ + bool intersects(const AABB& aabb) const; + + /** + * check whether the point is in. + */ + bool containPoint(const Vec3& point) const; + + /** + * Sets this bounding box to the smallest bounding box + * that contains both this bounding object and the specified bounding box. + */ + void merge(const AABB& box); + + /** + * Sets this bounding box to the specified values. + */ + void set(const Vec3& min, const Vec3& max); + + /** + * reset min and max value. + */ + void reset(); + + /** + * update the _min and _max from the given point. + */ + void updateMinMax(const Vec3* point, ssize_t num); + + /** + * Transforms the bounding box by the given transformation matrix. + */ + void transform(const Mat4& matrix); + +public: + Vec3 _min; + Vec3 _max; +}; + +NS_CC_END + +#endif diff --git a/cocos/3d/CCOBB.cpp b/cocos/3d/CCOBB.cpp new file mode 100755 index 0000000000..65a7e2b733 --- /dev/null +++ b/cocos/3d/CCOBB.cpp @@ -0,0 +1,439 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "3d/CCOBB.h" + +NS_CC_BEGIN + +#define ROTATE(a,i,j,k,l) g=a.m[i + 4 * j]; h=a.m[k + 4 * l]; a.m[i + 4 * j]=(float)(g-s*(h+g*tau)); a.m[k + 4 * l]=(float)(h+s*(g-h*tau)); + +static Mat4 _convarianceMatrix(const Vec3* aVertPos, int nVertCount) +{ + int i; + Mat4 Cov; + + double S1[3]; + double S2[3][3]; + + S1[0] = S1[1] = S1[2] = 0.0; + S2[0][0] = S2[1][0] = S2[2][0] = 0.0; + S2[0][1] = S2[1][1] = S2[2][1] = 0.0; + S2[0][2] = S2[1][2] = S2[2][2] = 0.0; + + // get center of mass + for(i=0; i3 && fabs(dmip)+g==fabs(dmip) && fabs(dmiq)+g==fabs(dmiq) ) + a.m[ip + 4 * iq]=0.0; + else if (fabs(a.m[ip + 4 * iq])>tresh) + { + h = dmiq-dmip; + if (fabs(h)+g == fabs(h)) + t=(a.m[ip + 4 * iq])/h; + else + { + theta=0.5*h/(a.m[ip + 4 * iq]); + t=1.0/(fabs(theta)+sqrt(1.0+theta*theta)); + if (theta < 0.0) t = -t; + } + c=1.0/sqrt(1+t*t); + s=t*c; + tau=s/(1.0+c); + h=t*a.m[ip + 4 * iq]; + _getElement(z, ip) -= (float)h; + _getElement(z, iq) += (float)h; + _getElement(d, ip) -= (float)h; + _getElement(d, iq) += (float)h; + a.m[ip + 4 * iq]=0.0; + for(j=0;j vect.x ? vecMax.x : vect.x; + vecMax.y = vecMax.y > vect.y ? vecMax.y : vect.y; + vecMax.z = vecMax.z > vect.z ? vecMax.z : vect.z; + + vecMin.x = vecMin.x < vect.x ? vecMin.x : vect.x; + vecMin.y = vecMin.y < vect.y ? vecMin.y : vect.y; + vecMin.z = vecMin.z < vect.z ? vecMin.z : vect.z; + } + + matTransform.transpose(); + + _xAxis = Vec3(matTransform.m[0], matTransform.m[1], matTransform.m[2]); + _yAxis = Vec3(matTransform.m[4], matTransform.m[5], matTransform.m[6]); + _zAxis = Vec3(matTransform.m[8], matTransform.m[9], matTransform.m[10]); + + _center = 0.5f * (vecMax + vecMin); + _center *= matTransform; + + _xAxis.normalize(); + _yAxis.normalize(); + _zAxis.normalize(); + + _extents = 0.5f * (vecMax - vecMin); +} + +bool OBB::containPoint(const Vec3& point) const +{ + Vec3 vd = point - _center; + + float d = vd.dot(_xAxis); + if (d > _extents.x || d < -_extents.x) + return false; + + d = vd.dot(_yAxis); + if (d > _extents.y || d < -_extents.y) + return false; + + d = vd.dot(_zAxis); + if (d > _extents.z || d < -_extents.z) + return false; + + return true; +} + +void OBB::set(const Vec3& center, const Vec3& xAxis, const Vec3& yAxis, const Vec3& zAxis, const Vec3& extents) +{ + _center = center; + _xAxis = xAxis; + _yAxis = yAxis; + _zAxis = zAxis; + _extents = extents; +} + +void OBB::reset() +{ + memset(this, 0, sizeof(OBB)); +} + +void OBB::getCorners(Vec3* verts) const +{ + Vec3 extX = _xAxis * _extents.x; + Vec3 extY = _yAxis * _extents.y; + Vec3 extZ = _zAxis * _extents.z; + + verts[0] = _center - extX + extY + extZ; // left top front + verts[1] = _center - extX - extY + extZ; // left bottom front + verts[2] = _center + extX - extY + extZ; // right bottom front + verts[3] = _center + extX + extY + extZ; // right top front + + verts[4] = _center + extX + extY - extZ; // right top back + verts[5] = _center + extX - extY - extZ; // right bottom back + verts[6] = _center - extX - extY - extZ; // left bottom back + verts[7] = _center - extX + extY - extZ; // left top back +} + +float OBB::projectPoint(const Vec3& point, const Vec3& axis)const +{ + float dot = axis.dot(point); + float ret = dot * point.length(); + return ret; +} + +void OBB::getInterval(const OBB& box, const Vec3& axis, float &min, float &max)const +{ + Vec3 corners[8]; + box.getCorners(corners); + float value; + min = max = projectPoint(axis, corners[0]); + for(int i = 1; i < 8; i++) + { + value = projectPoint(axis, corners[i]); + min = MIN(min, value); + max = MAX(max, value); + } +} + +Vec3 OBB::getEdgeDir(int index)const +{ + Vec3 corners[8]; + getCorners(corners); + + Vec3 tmpLine; + switch(index) + { + case 0:// edge with x axis + tmpLine = corners[5] - corners[6]; + tmpLine.normalize(); + break; + case 1:// edge with y axis + tmpLine = corners[7] - corners[6]; + tmpLine.normalize(); + break; + case 2:// edge with z axis + tmpLine = corners[1] - corners[6]; + tmpLine.normalize(); + break; + } + return tmpLine; +} + +Vec3 OBB::getFaceDir(int index) const +{ + Vec3 corners[8]; + getCorners(corners); + + Vec3 faceDir, v0, v1; + switch(index) + { + case 0:// front and back + v0 = corners[2] - corners[1]; + v1 = corners[0] - corners[1]; + Vec3::cross(v0, v1, &faceDir); + faceDir.normalize(); + break; + case 1:// left and right + v0 = corners[5] - corners[2]; + v1 = corners[3] - corners[2]; + Vec3::cross(v0, v1, &faceDir); + faceDir.normalize(); + break; + case 2:// top and bottom + v0 = corners[1] - corners[2]; + v1 = corners[5] - corners[2]; + Vec3::cross(v0, v1, &faceDir); + faceDir.normalize(); + break; + } + return faceDir; +} + +bool OBB::intersects(const OBB& box) const +{ + float min1, max1, min2, max2; + for (int i = 0; i < 3; i++) + { + getInterval(*this, getFaceDir(i), min1, max1); + getInterval(box, getFaceDir(i), min2, max2); + if (max1 < min2 || max2 < min1) return false; + } + + for (int i = 0; i < 3; i++) + { + getInterval(*this, box.getFaceDir(i), min1, max1); + getInterval(box, box.getFaceDir(i), min2, max2); + if (max1 < min2 || max2 < min1) return false; + } + + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + Vec3 axis; + Vec3::cross(getEdgeDir(i), box.getEdgeDir(j), &axis); + getInterval(*this, axis, min1, max1); + getInterval(box, axis, min2, max2); + if (max1 < min2 || max2 < min1) return false; + } + } + + return true; +} + + +void OBB::transform(const Mat4& mat) +{ + Vec4 newcenter = mat * Vec4(_center.x, _center.y, _center.z, 1.0f);// center; + _center.x = newcenter.x; + _center.y = newcenter.y; + _center.z = newcenter.z; + + _xAxis = mat * _xAxis; + _yAxis = mat * _yAxis; + _zAxis = mat * _zAxis; + + _xAxis.normalize(); + _yAxis.normalize(); + _zAxis.normalize(); + + Vec3 scale, trans; + Quaternion quat; + mat.decompose(&scale, &quat, &trans); + + _extents.x *= scale.x; + _extents.y *= scale.y; + _extents.z *= scale.z; +} + +NS_CC_END diff --git a/cocos/3d/CCOBB.h b/cocos/3d/CCOBB.h new file mode 100755 index 0000000000..ed691d9f79 --- /dev/null +++ b/cocos/3d/CCOBB.h @@ -0,0 +1,117 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CC_OBB_H__ +#define __CC_OBB_H__ + +#include "CCAABB.h" + +NS_CC_BEGIN + +class CC_DLL OBB +{ +public: + OBB(); + + /* + * Construct obb from oriented bounding box + */ + OBB(const AABB& aabb); + + /* + * Construct obb from points + */ + OBB(const Vec3* verts, int nVerts); + + /* + * Check point in + */ + bool containPoint(const Vec3& point) const; + + /* + * Specify obb values + */ + void set(const Vec3& center, const Vec3& _xAxis, const Vec3& _yAxis, const Vec3& _zAxis, const Vec3& _extents); + + /* + * Clear obb + */ + void reset(); + + /* face to the obb's -z direction + * verts[0] : left top front + * verts[1] : left bottom front + * verts[2] : right bottom front + * verts[3] : right top front + * + * face to the obb's z direction + * verts[4] : right top back + * verts[5] : right bottom back + * verts[6] : left bottom back + * verts[7] : left top back + */ + void getCorners(Vec3* verts) const; + + /* + * Check intersect with other + */ + bool intersects(const OBB& box) const; + + /** + * Transforms the obb by the given transformation matrix. + */ + void transform(const Mat4& mat); + +protected: + /* + * Project point to the target axis + */ + float projectPoint(const Vec3& point, const Vec3& axis) const; + + /* + * Calculate the min and max project value of through the box's corners + */ + void getInterval(const OBB& box, const Vec3& axis, float &min, float &max) const; + + /* + * Get the edege of x y z axis direction + */ + Vec3 getEdgeDir(int index) const; + + /* + * Get the face of x y z axis direction + */ + Vec3 getFaceDir(int index) const; + +public: + Vec3 _center; // obb center + Vec3 _xAxis; // x axis of obb, unit vector + Vec3 _yAxis; // y axis of obb, unit vecotr + Vec3 _zAxis; // z axis of obb, unit vector + Vec3 _extents; // obb length along each axis +}; + +NS_CC_END + +#endif diff --git a/cocos/3d/CMakeLists.txt b/cocos/3d/CMakeLists.txt index 19b90ab82e..bebc7af70b 100644 --- a/cocos/3d/CMakeLists.txt +++ b/cocos/3d/CMakeLists.txt @@ -1,4 +1,6 @@ set(COCOS_3D_SRC + 3d/CCAABB.cpp + 3d/CCOBB.cpp 3d/CCDrawNode3D.cpp 3d/CCSkeleton3D.cpp 3d/CCAttachNode.cpp diff --git a/cocos/Android.mk b/cocos/Android.mk index 479b3a3988..dd3ddc8a1e 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -74,6 +74,8 @@ cocos2d.cpp \ 2d/CCTransitionPageTurn.cpp \ 2d/CCTransitionProgress.cpp \ 2d/CCTweenFunction.cpp \ +3d/CCAABB.cpp \ +3d/CCOBB.cpp \ 3d/CCAnimate3D.cpp \ 3d/CCAnimation3D.cpp \ 3d/CCAttachNode.cpp \ diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 799c5e127a..4fd30579a1 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -192,6 +192,10 @@ "cocos/2d/cocos2dx.props", "cocos/2d/libcocos2d.vcxproj", "cocos/2d/libcocos2d.vcxproj.filters", + "cocos/3d/CCAABB.cpp", + "cocos/3d/CCAABB.h”, + "cocos/3d/CCOBB.cpp", + "cocos/3d/CCOBB.h”, "cocos/3d/CCAnimate3D.cpp", "cocos/3d/CCAnimate3D.h", "cocos/3d/CCAnimation3D.cpp", From 9471b572f7683dc655e6b92ecea4c7ba87598866 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 8 Aug 2014 00:05:02 +0800 Subject: [PATCH 005/147] add to cocos2d.h --- cocos/cocos2d.h | 2 ++ tools/tolua/cocos2dx.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index afdb4cfa13..9ffea8f200 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -262,6 +262,8 @@ THE SOFTWARE. #include "2d/CCComponentContainer.h" //3d +#include "3d/CCAABB.h" +#include "3d/CCOBB.h" #include "3d/CCSprite3D.h" #include "3d/CCMesh.h" #include "3d/CCMeshSkin.h" diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 525d31fc6b..6626ccf4c5 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h % # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console Mesh GLProgramCache GLProgramState SubMeshState AttachNode Camera DrawNode3D +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console Mesh GLProgramCache GLProgramState SubMeshState AttachNode Camera DrawNode3D AABB OBB # 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 From 28769c9b1512072400d95a06b7d16465d3be89ed Mon Sep 17 00:00:00 2001 From: lvlong Date: Fri, 8 Aug 2014 11:16:33 +0800 Subject: [PATCH 006/147] add obb sample --- build/cocos2d_libs.xcodeproj/project.pbxproj | 12 + cocos/3d/CCRay.cpp | 176 ++++++++++++ cocos/3d/CCRay.h | 97 +++++++ cocos/Android.mk | 1 + .../Classes/Sprite3DTest/Sprite3DTest.cpp | 261 +++++++++++++++++- .../Classes/Sprite3DTest/Sprite3DTest.h | 35 +++ 6 files changed, 581 insertions(+), 1 deletion(-) create mode 100755 cocos/3d/CCRay.cpp create mode 100755 cocos/3d/CCRay.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index c9cb06ded3..2b8e040b16 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1264,6 +1264,10 @@ 50ABC0651926664800A911A9 /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF531926664700A911A9 /* CCGL.h */; }; 50ABC0671926664800A911A9 /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF541926664700A911A9 /* CCPlatformDefine.h */; }; 50ABC0691926664800A911A9 /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF551926664700A911A9 /* CCStdC.h */; }; + 5E7EAC03199469D200CCFA35 /* CCRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7EAC01199469D200CCFA35 /* CCRay.cpp */; }; + 5E7EAC04199469D200CCFA35 /* CCRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7EAC01199469D200CCFA35 /* CCRay.cpp */; }; + 5E7EAC05199469D200CCFA35 /* CCRay.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E7EAC02199469D200CCFA35 /* CCRay.h */; }; + 5E7EAC06199469D200CCFA35 /* CCRay.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E7EAC02199469D200CCFA35 /* CCRay.h */; }; A07A4CAF1783777C0073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; }; B217703C1977ECB4009EE11B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B217703B1977ECB4009EE11B /* IOKit.framework */; }; B21770401977ECE6009EE11B /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B217703F1977ECE6009EE11B /* OpenGL.framework */; }; @@ -2998,6 +3002,8 @@ 50FCEB9018C72017004AD434 /* WidgetReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetReader.cpp; sourceTree = ""; }; 50FCEB9118C72017004AD434 /* WidgetReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReader.h; sourceTree = ""; }; 50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReaderProtocol.h; sourceTree = ""; }; + 5E7EAC01199469D200CCFA35 /* CCRay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRay.cpp; sourceTree = ""; }; + 5E7EAC02199469D200CCFA35 /* CCRay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRay.h; sourceTree = ""; }; A03F2CB81780BD04006731B9 /* libchipmunk Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libchipmunk Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A03F2D9B1780BDF7006731B9 /* libbox2d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbox2d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A03F2ED617814268006731B9 /* libcocosdenshion Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocosdenshion Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -5214,6 +5220,8 @@ B29594B81926D61F003EEF37 /* 3d */ = { isa = PBXGroup; children = ( + 5E7EAC01199469D200CCFA35 /* CCRay.cpp */, + 5E7EAC02199469D200CCFA35 /* CCRay.h */, 3E9E75E01993D8E4005B7047 /* CCAABB.cpp */, 3E9E75E11993D8E4005B7047 /* CCAABB.h */, 3E9E75E21993D8E4005B7047 /* CCOBB.cpp */, @@ -5318,6 +5326,7 @@ 1A570114180BC8EE0088DEC7 /* CCDrawNode.h in Headers */, 1A57011D180BC90D0088DEC7 /* CCGrabber.h in Headers */, 1A570121180BC90D0088DEC7 /* CCGrid.h in Headers */, + 5E7EAC05199469D200CCFA35 /* CCRay.h in Headers */, 5034CA2D191D591100CE6051 /* ccShader_PositionTextureA8Color.frag in Headers */, 1AC0269C1914068200FA920D /* ConvertUTF.h in Headers */, 50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */, @@ -5637,6 +5646,7 @@ 46A170FF1807CECB005B8026 /* CCPhysicsContact.h in Headers */, 50ABBDA21925AB4100A911A9 /* CCGroupCommand.h in Headers */, 503DD8EF1926736A00CD74DD /* CCPlatformDefine.h in Headers */, + 5E7EAC06199469D200CCFA35 /* CCRay.h in Headers */, 46A171041807CECB005B8026 /* CCPhysicsShape.h in Headers */, 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 3E9E75EB1993D8E4005B7047 /* CCOBB.h in Headers */, @@ -6855,6 +6865,7 @@ 1A570225180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */, 1A570229180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */, 1A57022D180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */, + 5E7EAC03199469D200CCFA35 /* CCRay.cpp in Sources */, 1A57027E180BCC900088DEC7 /* CCSprite.cpp in Sources */, 3EA3EDCC199234B500645534 /* CCDrawNode3D.cpp in Sources */, 1A570282180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */, @@ -7143,6 +7154,7 @@ 50ABBED81925AB6F00A911A9 /* ZipUtils.cpp in Sources */, 1A57008E180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */, 1A570092180BC5A10088DEC7 /* CCActionTween.cpp in Sources */, + 5E7EAC04199469D200CCFA35 /* CCRay.cpp in Sources */, 1A570099180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */, 50ABBD4D1925AB0000A911A9 /* MathUtil.cpp in Sources */, 50ABBE3E1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, diff --git a/cocos/3d/CCRay.cpp b/cocos/3d/CCRay.cpp new file mode 100755 index 0000000000..8d8275af18 --- /dev/null +++ b/cocos/3d/CCRay.cpp @@ -0,0 +1,176 @@ +/**************************************************************************** +Copyright (c) Chukong Technologies Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "CCRay.h" +#include "CCAABB.h" +#include "CCOBB.h" + +NS_CC_BEGIN + +Ray::Ray() + : _direction(0, 0, 1) +{ +} + +Ray::Ray(const Vec3& origin, const Vec3& direction) +{ + set(origin, direction); +} + +Ray::~Ray() +{ +} + +bool Ray::intersects(const AABB& aabb) const +{ + Vec3 ptOnPlane; + Vec3 min = aabb._min; + Vec3 max = aabb._max; + + const Vec3& origin = _origin; + const Vec3& dir = _direction; + + float t; + + if (dir.x != 0.f) + { + if (dir.x > 0) + t = (min.x - origin.x) / dir.x; + else + t = (max.x - origin.x) / dir.x; + + if (t > 0.f) + { + ptOnPlane = origin + t * dir; + + if (min.y < ptOnPlane.y && ptOnPlane.y < max.y && min.z < ptOnPlane.z && ptOnPlane.z < max.z) + { + return true; + } + } + } + + if (dir.y != 0.f) + { + if (dir.y > 0) + t = (min.y - origin.y) / dir.y; + else + t = (max.y - origin.y) / dir.y; + + if (t > 0.f) + { + ptOnPlane = origin + t * dir; + + if (min.z < ptOnPlane.z && ptOnPlane.z < max.z && min.x < ptOnPlane.x && ptOnPlane.x < max.x) + { + return true; + } + } + } + + if (dir.z != 0.f) + { + if (dir.z > 0) + t = (min.z - origin.z) / dir.z; + else + t = (max.z - origin.z) / dir.z; + + if (t > 0.f) + { + ptOnPlane = origin + t * dir; + + if (min.x < ptOnPlane.x && ptOnPlane.x < max.x && min.y < ptOnPlane.y && ptOnPlane.y < max.y) + { + return true; + } + } + } + + return false; +} + +bool Ray::intersects(const OBB& obb) const +{ + AABB aabb; + aabb._min = - obb._extents; + aabb._max = obb._extents; + + Ray ray; + ray._direction = _direction; + ray._origin = _origin; + + Mat4 mat = Mat4::IDENTITY; + mat.m[0] = obb._xAxis.x; + mat.m[1] = obb._xAxis.y; + mat.m[2] = obb._xAxis.z; + + mat.m[4] = obb._yAxis.x; + mat.m[5] = obb._yAxis.y; + mat.m[6] = obb._yAxis.z; + + mat.m[8] = obb._zAxis.x; + mat.m[9] = obb._zAxis.y; + mat.m[10] = obb._zAxis.z; + + mat.m[12] = obb._center.x; + mat.m[13] = obb._center.y; + mat.m[14] = obb._center.z; + + mat = mat.getInversed(); + + ray.transform(mat); + + return ray.intersects(aabb); +} + +void Ray::set(const Vec3& origin, const Vec3& direction) +{ + _origin = origin; + _direction = direction; + normalize(); +} + +void Ray::transform(const Mat4& matrix) +{ + matrix.transformPoint(&_origin); + matrix.transformVector(&_direction); + _direction.normalize(); +} + +void Ray::normalize() +{ + if (_direction.isZero()) + { + return; + } + + // Normalize the ray's direction vector. + float normalizeFactor = 1.0f / sqrt(_direction.x * _direction.x + _direction.y * _direction.y + _direction.z * _direction.z); + if (normalizeFactor != 1.0f) + { + _direction.x *= normalizeFactor; + _direction.y *= normalizeFactor; + _direction.z *= normalizeFactor; + } +} + +NS_CC_END diff --git a/cocos/3d/CCRay.h b/cocos/3d/CCRay.h new file mode 100755 index 0000000000..7c60c35635 --- /dev/null +++ b/cocos/3d/CCRay.h @@ -0,0 +1,97 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CC_RAY_H_ +#define __CC_RAY_H_ + +#include "base/ccMacros.h" +#include "math/CCMath.h" +#include "CCAABB.h" +#include "CCOBB.h" + +NS_CC_BEGIN + +class CC_DLL Ray +{ +public: + /** + * Constructor. + */ + Ray(); + + /** + * Constructor. + */ + Ray(const Ray& ray); + + /** + * Constructs a new ray initialized to the specified values. + * + * @param origin The ray's origin. + * @param direction The ray's direction. + */ + Ray(const Vec3& origin, const Vec3& direction); + + /** + * Destructor. + */ + ~Ray(); + + /** + * Check whether this ray intersects the specified bounding box. + */ + bool intersects(const AABB& aabb) const; + + /** + * Check whether this ray intersects the specified obb. + */ + bool intersects(const OBB& obb) const; + + /** + * Sets this ray to the specified values. + * + * @param origin The ray's origin. + * @param direction The ray's direction. + */ + void set(const Vec3& origin, const Vec3& direction); + + /** + * Transforms this ray by the given transformation matrix. + * + * @param matrix The transformation matrix to transform by. + */ + void transform(const Mat4& matrix); + + /** + * Normalizes the ray. + */ + void normalize(); + + Vec3 _origin; // The ray origin position. + Vec3 _direction; // The ray direction vector. +}; + +NS_CC_END + +#endif diff --git a/cocos/Android.mk b/cocos/Android.mk index dd3ddc8a1e..ece0054f1d 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -74,6 +74,7 @@ cocos2d.cpp \ 2d/CCTransitionPageTurn.cpp \ 2d/CCTransitionProgress.cpp \ 2d/CCTweenFunction.cpp \ +3d/CCRay.cpp\ 3d/CCAABB.cpp \ 3d/CCOBB.cpp \ 3d/CCAnimate3D.cpp \ diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 2c9c540c72..2ce7ce40e0 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -28,6 +28,7 @@ #include "3d/CCAnimate3D.h" #include "3d/CCSubMesh.h" #include "3d/CCAttachNode.h" +#include "3d/CCRay.h" #include #include "../testResource.h" @@ -52,7 +53,8 @@ static std::function createFunctions[] = #endif CL(Sprite3DWithSkinTest), CL(Animate3DTest), - CL(AttachmentTest) + CL(AttachmentTest), + CL(Sprite3DWithOBBPerfromanceTest) }; #define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) @@ -867,3 +869,260 @@ void AttachmentTest::onTouchesEnded(const std::vector& touches, Event* e } _hasWeapon = !_hasWeapon; } + +Sprite3DWithOBBPerfromanceTest::Sprite3DWithOBBPerfromanceTest() +{ + auto listener = EventListenerTouchAllAtOnce::create(); + listener->onTouchesBegan = CC_CALLBACK_2(Sprite3DWithOBBPerfromanceTest::onTouchesBegan, this); + listener->onTouchesEnded = CC_CALLBACK_2(Sprite3DWithOBBPerfromanceTest::onTouchesEnded, this); + listener->onTouchesMoved = CC_CALLBACK_2(Sprite3DWithOBBPerfromanceTest::onTouchesMoved, this); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); + auto s = Director::getInstance()->getWinSize(); + initDrawBox(); + + addNewSpriteWithCoords(Vec2(s.width/2, s.height/2)); + MenuItemFont::setFontName("fonts/arial.ttf"); + MenuItemFont::setFontSize(65); + auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(Sprite3DWithOBBPerfromanceTest::delOBBCallback, this)); + decrease->setColor(Color3B(0,200,20)); + auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(Sprite3DWithOBBPerfromanceTest::addOBBCallback, this)); + increase->setColor(Color3B(0,200,20)); + + auto menu = Menu::create(decrease, increase, nullptr); + menu->alignItemsHorizontally(); + menu->setPosition(Vec2(s.width/2, s.height-65)); + addChild(menu, 1); + + TTFConfig ttfCount("fonts/Marker Felt.ttf", 30); + _labelCubeCount = Label::createWithTTF(ttfCount,"0 cubes"); + _labelCubeCount->setColor(Color3B(0,200,20)); + _labelCubeCount->setPosition(Vec2(s.width/2, s.height-90)); + addChild(_labelCubeCount); + _hasCollider = false; + scheduleUpdate(); +} +std::string Sprite3DWithOBBPerfromanceTest::title() const +{ + return "OBB Collison Perfromance Test"; +} +std::string Sprite3DWithOBBPerfromanceTest::subtitle() const +{ + return ""; +} +void Sprite3DWithOBBPerfromanceTest::addNewOBBWithCoords(Vec2 p) +{ + Vec3 extents = Vec3(10, 10, 10); + AABB aabb(-extents, extents); + auto obb = OBB(aabb); + obb._center = Vec3(p.x,p.y,0); + _obb.push_back(obb); +} + +void Sprite3DWithOBBPerfromanceTest::onTouchesBegan(const std::vector& touches, Event* event) +{ + for (auto touch: touches) + { + auto location = touch->getLocationInView(); + + if(_obb.size() > 0) + { + _intersetList.clear(); + Ray ray; + calculateRayByLocationInView(&ray,location); + for(int i = 0; i < _obb.size(); i++) + { + if(ray.intersects(_obb[i])) + { + _intersetList.insert(i); + return; + } + } + } + } +} + +void Sprite3DWithOBBPerfromanceTest::onTouchesEnded(const std::vector& touches, Event* event) +{ + +} + +void Sprite3DWithOBBPerfromanceTest::onTouchesMoved(const std::vector& touches, Event* event) +{ + for (auto touch: touches) + { + auto location = touch->getLocation(); + + for(int i = 0; i < _obb.size(); i++) + { + if(_intersetList.find(i) != _intersetList.end()) + _obb[i]._center = Vec3(location.x,location.y,0); + } + } +} + +void Sprite3DWithOBBPerfromanceTest::update(float dt) +{ + char szText[16]; + sprintf(szText,"%lu cubes",_obb.size()); + _labelCubeCount->setString(szText); + + if (_drawDebug) + { + _drawDebug->clear(); + + Mat4 mat = _sprite->getNodeToWorldTransform(); + mat.getRightVector(&_obbt._xAxis); + _obbt._xAxis.normalize(); + + mat.getUpVector(&_obbt._yAxis); + _obbt._yAxis.normalize(); + + mat.getForwardVector(&_obbt._zAxis); + _obbt._zAxis.normalize(); + + _obbt._center = _sprite->getPosition3D(); + + Vec3 corners[8] = {}; + _obbt.getCorners(corners); + _drawDebug->drawCube(corners, Color4F(0,0,1,1)); + } + if(_obb.size() > 0) + { + _drawOBB->clear(); + for(int i =0; i < _obb.size(); i++) + { + Vec3 corners[8] = {}; + _obb[i].getCorners(corners); + _drawOBB->drawCube(corners, _obbt.intersects(_obb[i])?Color4F(1,0,0,1):Color4F(0,1,0,1)); + } + } +} + +void Sprite3DWithOBBPerfromanceTest::initDrawBox() +{ + _drawOBB = DrawNode3D::create(); + addChild(_drawOBB); +} + +void Sprite3DWithOBBPerfromanceTest::addNewSpriteWithCoords(Vec2 p) +{ + std::string fileName = "Sprite3DTest/tortoise.c3b"; + auto sprite = Sprite3D::create(fileName); + sprite->setScale(0.1f); + auto s = Director::getInstance()->getWinSize(); + sprite->setPosition(Vec2(s.width * 4.f / 5.f, s.height / 2.f)); + addChild(sprite); + _sprite = sprite; + auto animation = Animation3D::create(fileName); + if (animation) + { + auto animate = Animate3D::create(animation, 0.f, 1.933f); + sprite->runAction(RepeatForever::create(animate)); + } + + _moveAction = MoveTo::create(4.f, Vec2(s.width / 5.f, s.height / 2.f)); + _moveAction->retain(); + auto seq = Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(Sprite3DWithOBBPerfromanceTest::reachEndCallBack, this)), nullptr); + seq->setTag(100); + sprite->runAction(seq); + + //Generate OBB by AABB + Vec3 extents = Vec3(50, 25, 25); + AABB aabb(-extents, extents); + _obbt = OBB(aabb); + + _drawDebug = DrawNode3D::create(); + addChild(_drawDebug); +} + +void Sprite3DWithOBBPerfromanceTest::reachEndCallBack() +{ + _sprite->stopActionByTag(100); + auto inverse = (MoveTo*)_moveAction->reverse(); + inverse->retain(); + _moveAction->release(); + _moveAction = inverse; + auto rot = RotateBy::create(1.0f, Vec3(0.f, 180.f, 0.f)); + auto seq = Sequence::create(rot, _moveAction, CallFunc::create(CC_CALLBACK_0(Sprite3DWithOBBPerfromanceTest::reachEndCallBack, this)), nullptr); + seq->setTag(100); + _sprite->runAction(seq); +} + +void Sprite3DWithOBBPerfromanceTest::addOBBCallback(Ref* sender) +{ + addOBBWithCount(10); +} + +void Sprite3DWithOBBPerfromanceTest::addOBBWithCount(float value) +{ + for(int i = 0; i < value; i++) + { + Vec2 randompos = Vec2(CCRANDOM_0_1() * Director::getInstance()->getWinSize().width,CCRANDOM_0_1() * Director::getInstance()->getWinSize().height); + Vec3 extents = Vec3(10, 10, 10); + AABB aabb(-extents, extents); + auto obb = OBB(aabb); + obb._center = Vec3(randompos.x,randompos.y,0); + _obb.push_back(obb); + } +} + +void Sprite3DWithOBBPerfromanceTest::delOBBCallback(Ref* sender) +{ + delOBBWithCount(10); +} + +void Sprite3DWithOBBPerfromanceTest::delOBBWithCount(float value) +{ + if(_obb.size() >= 10) + { + _obb.erase(_obb.begin(),_obb.begin() + value); + _drawOBB->clear(); + } + else + return; +} +void Sprite3DWithOBBPerfromanceTest::unproject(const Mat4& viewProjection, const Size* viewport, Vec3* src, Vec3* dst) +{ + assert(dst); + + assert(viewport->width != 0.0f && viewport->height != 0.0f); + Vec4 screen(src->x / viewport->width, ((viewport->height - src->y)) / viewport->height, src->z, 1.0f); + + screen.x = screen.x * 2.0f - 1.0f; + screen.y = screen.y * 2.0f - 1.0f; + screen.z = screen.z * 2.0f - 1.0f; + + viewProjection.getInversed().transformVector(screen, &screen); + + if (screen.w != 0.0f) + { + screen.x /= screen.w; + screen.y /= screen.w; + screen.z /= screen.w; + } + + dst->set(screen.x, screen.y, screen.z); +} + +void Sprite3DWithOBBPerfromanceTest::calculateRayByLocationInView(Ray* ray, const Vec2& location) +{ + auto dir = Director::getInstance(); + auto view = dir->getWinSize(); + Mat4 mat = dir->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + mat = dir->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + + Vec3 src = Vec3(location.x, location.y, -1); + Vec3 nearPoint; + unproject(mat, &view, &src, &nearPoint); + + src = Vec3(location.x, location.y, 1); + Vec3 farPoint; + unproject(mat, &view, &src, &farPoint); + + Vec3 direction; + Vec3::subtract(farPoint, nearPoint, &direction); + direction.normalize(); + + ray->_origin = nearPoint; + ray->_direction = direction; +} diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index a9f774d368..6b97aac4d6 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -33,6 +33,7 @@ namespace cocos2d { class Animate3D; class Sprite3D; class Delay; + class Ray; } class Sprite3DTestDemo : public BaseTest @@ -224,6 +225,40 @@ protected: cocos2d::Sprite3D* _sprite; }; +class Sprite3DWithOBBPerfromanceTest : public Sprite3DTestDemo +{ +public: + CREATE_FUNC(Sprite3DWithOBBPerfromanceTest); + Sprite3DWithOBBPerfromanceTest(); + virtual std::string title() const override; + virtual std::string subtitle() const override; + virtual void update(float dt) override; + void addNewOBBWithCoords(Vec2 p); + void addNewSpriteWithCoords(Vec2 p); + void onTouchesBegan(const std::vector& touches, Event* event); + void onTouchesEnded(const std::vector& touches, Event* event); + void onTouchesMoved(const std::vector& touches, Event* event); + void addOBBCallback(Ref* sender); + void delOBBCallback(Ref* sender); + void addOBBWithCount(float value); + void delOBBWithCount(float value); +protected: + cocos2d::Sprite3D* _sprite; + std::vector _obb; + DrawNode3D* _drawOBB; + Label* _labelCubeCount; + MoveTo* _moveAction; + OBB _obbt; + DrawNode3D* _drawDebug; + bool _hasCollider; + std::set _intersetList; + void initDrawBox(); + void reachEndCallBack(); + + void unproject(const Mat4& viewProjection, const Size* viewport, Vec3* src, Vec3* dst); + void calculateRayByLocationInView(Ray* ray, const Vec2& location); +}; + class Sprite3DTestScene : public TestScene { public: From 6722f8d5463fa456dd664807fdb523c04c577639 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Fri, 8 Aug 2014 13:27:09 +0900 Subject: [PATCH 007/147] Fix typo --- templates/cocos2dx_files.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index e9f888e127..4830583baf 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -344,7 +344,7 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", - "cocos/base/ccRanrom.h", + "cocos/base/ccRandom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", "cocos/base/CCRefPtr.h", From fe58c43b2d2c8605c0692029111a7dbe57932147 Mon Sep 17 00:00:00 2001 From: lvlong Date: Fri, 8 Aug 2014 14:06:54 +0800 Subject: [PATCH 008/147] add abb and obb to vc2012-project --- cocos/2d/libcocos2d.vcxproj | 6 ++++++ cocos/2d/libcocos2d.vcxproj.filters | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index f935648fa7..c6396c878d 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -183,6 +183,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -191,7 +192,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + @@ -370,6 +373,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -380,7 +384,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index b20b7f8bc3..dbbb942f17 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -616,6 +616,15 @@ base + + 3d + + + 3d + + + 3d + @@ -1252,6 +1261,15 @@ base + + 3d + + + 3d + + + 3d + From c71df09072b3840a2f5f8b72579b20f4e45cedff Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 8 Aug 2014 16:30:17 +0800 Subject: [PATCH 009/147] not export getCameras --- tools/tolua/cocos2dx.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index f067e48d6f..b89d890a58 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -132,7 +132,8 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS Animation3D::[getBoneCurveByName], Animation3DCache::[*], Sprite3DMaterialCache::[*], - Bone3D::[*] + Bone3D::[*], + Scene::[getCameras] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], From 8101e2ff1adf3a0b5a12a180f1c4822f5a5b01bd Mon Sep 17 00:00:00 2001 From: lvlong Date: Fri, 8 Aug 2014 17:54:39 +0800 Subject: [PATCH 010/147] 1. move drawnode3d to Sprite3DTest 2. add getAABB to sprite3D and mesh --- build/cocos2d_libs.xcodeproj/project.pbxproj | 46 ---- build/cocos2d_tests.xcodeproj/project.pbxproj | 8 + cocos/3d/CCMesh.cpp | 22 ++ cocos/3d/CCMesh.h | 15 ++ cocos/3d/CCSprite3D.cpp | 25 ++ cocos/3d/CCSprite3D.h | 15 ++ tests/cpp-tests/Android.mk | 1 + .../Classes/Sprite3DTest/DrawNode3D.cpp | 240 ++++++++++++++++++ .../Classes/Sprite3DTest/DrawNode3D.h | 117 +++++++++ .../Classes/Sprite3DTest/Sprite3DTest.cpp | 5 +- .../Classes/Sprite3DTest/Sprite3DTest.h | 1 + 11 files changed, 446 insertions(+), 49 deletions(-) create mode 100644 tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp create mode 100644 tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index e5b3dbac4b..12a9dde1f8 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -7867,7 +7867,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -7905,7 +7904,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -7940,7 +7938,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_EXTENSION = a; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -7973,7 +7970,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_EXTENSION = a; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -8006,7 +8002,6 @@ A03F2CB61780BD04006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; HEADER_SEARCH_PATHS = ""; @@ -8017,7 +8012,6 @@ A03F2CB71780BD04006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -8029,7 +8023,6 @@ A03F2D991780BDF7006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8045,7 +8038,6 @@ A03F2D9A1780BDF7006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8062,7 +8054,6 @@ A03F2E90178141C1006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "COCOS2D_DEBUG=1", @@ -8079,7 +8070,6 @@ A03F2E91178141C1006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; HEADER_SEARCH_PATHS = ( "$(inherited)", "/Applications/Xcode\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", @@ -8091,7 +8081,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC; GCC_TREAT_WARNINGS_AS_ERRORS = NO; @@ -8104,7 +8093,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC; @@ -8118,7 +8106,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = ""; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8137,7 +8124,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = ""; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -8157,7 +8143,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; @@ -8187,7 +8172,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -8217,7 +8201,6 @@ A07A4E0D178386390073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; IPHONEOS_DEPLOYMENT_TARGET = 5.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -8227,7 +8210,6 @@ A07A4E0E178386390073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; IPHONEOS_DEPLOYMENT_TARGET = 5.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -8238,7 +8220,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8258,7 +8239,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8278,7 +8258,6 @@ A07A4F39178387670073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; @@ -8291,7 +8270,6 @@ A07A4F3A178387670073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; HEADER_SEARCH_PATHS = ""; @@ -8305,7 +8283,6 @@ A07A4F9C1783876B0073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8324,7 +8301,6 @@ A07A4F9D1783876B0073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8345,7 +8321,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8364,7 +8339,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8384,7 +8358,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8403,7 +8376,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8423,7 +8395,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8444,7 +8415,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8466,7 +8436,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8487,7 +8456,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8509,7 +8477,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8530,7 +8497,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8552,7 +8518,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8573,7 +8538,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8595,7 +8559,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8619,7 +8582,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8644,7 +8606,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8663,7 +8624,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8683,7 +8643,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8702,7 +8661,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8722,7 +8680,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8741,7 +8698,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8761,7 +8717,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8783,7 +8738,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index b71dae873f..6613a084c1 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -969,6 +969,8 @@ 3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */; }; 59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; 59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; + 5EBEECB01995247000429821 /* DrawNode3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBEECAE1995247000429821 /* DrawNode3D.cpp */; }; + 5EBEECB11995247000429821 /* DrawNode3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBEECAE1995247000429821 /* DrawNode3D.cpp */; }; A05FCACA177C124500BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; }; A07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; }; A07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; @@ -3659,6 +3661,8 @@ 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = cocos2d_libs.xcodeproj; sourceTree = ""; }; 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-Child.cpp"; sourceTree = ""; }; 59620E8E1921E5CF002021B6 /* Bug-Child.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-Child.h"; sourceTree = ""; }; + 5EBEECAE1995247000429821 /* DrawNode3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawNode3D.cpp; path = Sprite3DTest/DrawNode3D.cpp; sourceTree = ""; }; + 5EBEECAF1995247000429821 /* DrawNode3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawNode3D.h; path = Sprite3DTest/DrawNode3D.h; sourceTree = ""; }; 70A7F72D191D3E4900F0F206 /* shaderTest.psh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = shaderTest.psh.h; sourceTree = ""; }; 70A7F730191D421B00F0F206 /* ShaderTest.vsh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShaderTest.vsh.h; sourceTree = ""; }; A035A71117822E9E00987F6C /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; @@ -7891,6 +7895,8 @@ 3E92EA7D1921A0C60094CD21 /* Sprite3DTest */ = { isa = PBXGroup; children = ( + 5EBEECAE1995247000429821 /* DrawNode3D.cpp */, + 5EBEECAF1995247000429821 /* DrawNode3D.h */, 3E92EA801921A1400094CD21 /* Sprite3DTest.cpp */, 3E92EA811921A1400094CD21 /* Sprite3DTest.h */, ); @@ -9154,6 +9160,7 @@ 29080DC3191B595E0066F8DF /* UIScene.cpp in Sources */, 29080D9B191B595E0066F8DF /* CustomParticleWidget.cpp in Sources */, 29080D8D191B595E0066F8DF /* CocosGUIScene.cpp in Sources */, + 5EBEECB01995247000429821 /* DrawNode3D.cpp in Sources */, 1AC35BED18CECF0C00F37B72 /* CCControlStepperTest.cpp in Sources */, 1AC35C3318CECF0C00F37B72 /* PerformanceScenarioTest.cpp in Sources */, 1AC35C5918CECF0C00F37B72 /* TextureAtlasEncryptionTest.cpp in Sources */, @@ -9248,6 +9255,7 @@ 29080DB4191B595E0066F8DF /* UILayoutTest_Editor.cpp in Sources */, 1AC35C4E18CECF0C00F37B72 /* SpineTest.cpp in Sources */, 1AC35C1E18CECF0C00F37B72 /* NewRendererTest.cpp in Sources */, + 5EBEECB11995247000429821 /* DrawNode3D.cpp in Sources */, 1AC35B6818CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, 29080D8E191B595E0066F8DF /* CocosGUIScene.cpp in Sources */, 1AC35BFA18CECF0C00F37B72 /* WebSocketTest.cpp in Sources */, diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index 76438101b1..5cc5fe475a 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -207,6 +207,9 @@ bool Mesh::init(const std::vector& positions, const std::vector& n buildSubMeshes(); buildBuffer(); + + calcuOriginAABB(positions, 3); + return true; } @@ -220,6 +223,10 @@ bool Mesh::init(const std::vector& vertices, int vertexSizeInFloat, const buildSubMeshes(); buildBuffer(); + + unsigned int perVertexSize = _renderdata.calVertexSizeBytes() / sizeof(float); + calcuOriginAABB(vertices, perVertexSize); + return true; } @@ -245,6 +252,16 @@ void Mesh::cleanAndFreeBuffers() } } +void Mesh::calcuOriginAABB(const std::vector& vertices, unsigned int stride) +{ + ssize_t vertexNum = vertices.size() / stride; + for(unsigned int i = 0; i < vertexNum; i++) + { + Vec3 point = Vec3(vertices[i * stride], vertices[i * stride + 1], vertices[i * stride + 2]); + _originAABB.updateMinMax(&point, 1); + } +} + void Mesh::buildBuffer() { cleanAndFreeBuffers(); @@ -273,6 +290,11 @@ void Mesh::restore() buildBuffer(); } +const AABB& Mesh::getOriginAABB() const +{ + return _originAABB; +} + /** * MeshCache */ diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index 2cea95b189..d88f30d7ea 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -37,6 +37,9 @@ #include "math/CCMath.h" #include "renderer/CCGLProgram.h" +#include "CCAABB.h" + + NS_CC_BEGIN class EventListenerCustom; @@ -121,6 +124,9 @@ public: /**build vertex buffer from renderdata*/ void restore(); + /** get origin aabb that calculate from vertices*/ + const AABB& getOriginAABB() const; + /**to be deprecated, those functions have been moved to SubMesh*/ /** get primitive type*/ CC_DEPRECATED_ATTRIBUTE PrimitiveType getPrimitiveType() const { return _subMeshes.at(0)->getPrimitiveType(); } @@ -147,12 +153,21 @@ CC_CONSTRUCTOR_ACCESS: void buildBuffer(); /**free buffer*/ void cleanAndFreeBuffers(); + + /* + * calculate AABB by origin vertices + * @param the vertices list + * @param stride the stride between two vertex's position data. + */ + void calcuOriginAABB(const std::vector& vertices, unsigned int stride); protected: GLuint _vertexBuffer; Vector _subMeshes; RenderMeshData _renderdata; + + AABB _originAABB; }; /** diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 0bbc9ccd58..629c141c30 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -399,4 +399,29 @@ const BlendFunc& Sprite3D::getBlendFunc() const return _blend; } +AABB Sprite3D::getAABB() const +{ + AABB aabb = _mesh->getOriginAABB(); + Mat4 transform; + + if (getSkin() && getSkin()->getRootBone()) + { + transform = getNodeToWorldTransform() * getSkin()->getRootBone()->getWorldMat(); + } + else + { + transform = getNodeToWorldTransform(); + } + + aabb.transform(transform); + return aabb; +} + +Rect Sprite3D::getBoundingBox() const +{ + AABB aabb = getAABB(); + Rect ret(aabb._min.x, aabb._min.y, (aabb._max.x - aabb._min.x), (aabb._max.y - aabb._min.y)); + return ret; +} + NS_CC_END diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 734f52c675..340a6ca9c2 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -33,6 +33,7 @@ #include "base/CCProtocols.h" #include "2d/CCNode.h" #include "renderer/CCMeshCommand.h" +#include "CCAABB.h" NS_CC_BEGIN @@ -79,6 +80,20 @@ public: // overrides virtual void setBlendFunc(const BlendFunc &blendFunc) override; virtual const BlendFunc &getBlendFunc() const override; + + /* + * Get AABB + * If the sprite has animation, it can't be calculated accuratly, + * because bone can drive the vertices, we just use the origin vertices + * to calculate the AABB. + */ + AABB getAABB() const; + + /** + * Returns 2d bounding-box + * Note: the bouding-box is just get from the AABB which as Z=0, so that is not very accurate. + */ + virtual Rect getBoundingBox() const override; CC_CONSTRUCTOR_ACCESS: diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 994ba9f81d..9b69186e42 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -168,6 +168,7 @@ Classes/ShaderTest/ShaderTest.cpp \ Classes/ShaderTest/ShaderTest2.cpp \ Classes/SpineTest/SpineTest.cpp \ Classes/SpriteTest/SpriteTest.cpp \ +Classes/Sprite3DTest/DrawNode3D.cpp \ Classes/Sprite3DTest/Sprite3DTest.cpp \ Classes/TextInputTest/TextInputTest.cpp \ Classes/Texture2dTest/Texture2dTest.cpp \ diff --git a/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp b/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp new file mode 100644 index 0000000000..acb88b95e9 --- /dev/null +++ b/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp @@ -0,0 +1,240 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "DrawNode3D.h" +#include "CCGL.h" +#include "base/CCEventType.h" +#include "base/CCConfiguration.h" +#include "renderer/CCCustomCommand.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCGLProgramState.h" +#include "base/CCDirector.h" +#include "base/CCEventListenerCustom.h" +#include "base/CCEventDispatcher.h" + +NS_CC_BEGIN + + +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 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 diff --git a/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.h b/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.h new file mode 100644 index 0000000000..240bb025ee --- /dev/null +++ b/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.h @@ -0,0 +1,117 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __DRAW_NODE_3D_H__ +#define __DRAW_NODE_3D_H__ + +#include "2d/CCNode.h" +#include "base/ccTypes.h" +#include "renderer/CCCustomCommand.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); +}; + +NS_CC_END + +#endif // __DRAW_NODE_3D_H__ diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 2ce7ce40e0..54100ba464 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -29,6 +29,7 @@ #include "3d/CCSubMesh.h" #include "3d/CCAttachNode.h" #include "3d/CCRay.h" +#include "DrawNode3D.h" #include #include "../testResource.h" @@ -1026,9 +1027,7 @@ void Sprite3DWithOBBPerfromanceTest::addNewSpriteWithCoords(Vec2 p) seq->setTag(100); sprite->runAction(seq); - //Generate OBB by AABB - Vec3 extents = Vec3(50, 25, 25); - AABB aabb(-extents, extents); + AABB aabb = _sprite->getAABB(); _obbt = OBB(aabb); _drawDebug = DrawNode3D::create(); diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index 6b97aac4d6..e82f5491e9 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -34,6 +34,7 @@ namespace cocos2d { class Sprite3D; class Delay; class Ray; + class DrawNode3D; } class Sprite3DTestDemo : public BaseTest From 504ef32b97c6417f61531853cb40f33cb5991168 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 8 Aug 2014 18:14:41 +0800 Subject: [PATCH 011/147] linux --- tests/cpp-tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 439db8020c..ac88ce2b90 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -162,6 +162,7 @@ set(SAMPLE_SRC Classes/ShaderTest/ShaderTest2.cpp Classes/SpriteTest/SpriteTest.cpp Classes/Sprite3DTest/Sprite3DTest.cpp + Classes/Sprite3DTest/CCDrawNode3D.cpp Classes/TextInputTest/TextInputTest.cpp Classes/Texture2dTest/Texture2dTest.cpp Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp From e904ee646a3f96914fe0657960980dbebf27df86 Mon Sep 17 00:00:00 2001 From: yangxiao1 Date: Fri, 8 Aug 2014 18:25:36 +0800 Subject: [PATCH 012/147] windows work --- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 ++ tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 394aa71ab2..27cc2c0735 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -183,6 +183,7 @@ + @@ -370,6 +371,7 @@ + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index eee082ff8a..e815660d53 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -864,6 +864,9 @@ Classes\Camera3DTest + + Classes\Sprite3DTest + @@ -1595,5 +1598,8 @@ Classes\Camera3DTest + + Classes\Sprite3DTest + \ No newline at end of file From 73a0b7701d6315581942be062d302a89ec127ce4 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 9 Aug 2014 00:02:19 +0800 Subject: [PATCH 013/147] remove normalize --- cocos/3d/CCRay.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/cocos/3d/CCRay.cpp b/cocos/3d/CCRay.cpp index 8d8275af18..b49fd17343 100755 --- a/cocos/3d/CCRay.cpp +++ b/cocos/3d/CCRay.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. NS_CC_BEGIN Ray::Ray() - : _direction(0, 0, 1) +: _direction(0, 0, 1) { } @@ -146,7 +146,6 @@ void Ray::set(const Vec3& origin, const Vec3& direction) { _origin = origin; _direction = direction; - normalize(); } void Ray::transform(const Mat4& matrix) @@ -156,21 +155,4 @@ void Ray::transform(const Mat4& matrix) _direction.normalize(); } -void Ray::normalize() -{ - if (_direction.isZero()) - { - return; - } - - // Normalize the ray's direction vector. - float normalizeFactor = 1.0f / sqrt(_direction.x * _direction.x + _direction.y * _direction.y + _direction.z * _direction.z); - if (normalizeFactor != 1.0f) - { - _direction.x *= normalizeFactor; - _direction.y *= normalizeFactor; - _direction.z *= normalizeFactor; - } -} - NS_CC_END From 53c143c67936c2a138af1754f4af9b8a7ba2629a Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 9 Aug 2014 00:02:40 +0800 Subject: [PATCH 014/147] remove normalize --- cocos/3d/CCRay.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cocos/3d/CCRay.h b/cocos/3d/CCRay.h index 7c60c35635..0deab2a68a 100755 --- a/cocos/3d/CCRay.h +++ b/cocos/3d/CCRay.h @@ -83,11 +83,6 @@ public: */ void transform(const Mat4& matrix); - /** - * Normalizes the ray. - */ - void normalize(); - Vec3 _origin; // The ray origin position. Vec3 _direction; // The ray direction vector. }; From 754a78bd26a2f78c6aad17fc34fcf30682d24606 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 9 Aug 2014 00:03:11 +0800 Subject: [PATCH 015/147] can not export aabb obb ray --- tools/tolua/cocos2dx.ini | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index b89d890a58..146766e652 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -126,14 +126,17 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS TurnOffTiles::[shuffle], LabelTTF::[*], LabelBMFont::[*], - Mesh::[create], + Mesh::[create getOriginAABB], SubMeshState::[getSkin setSkin create], - Sprite3D::[getSkin getSubMeshState], + Sprite3D::[getSkin getSubMeshState getAABB], Animation3D::[getBoneCurveByName], Animation3DCache::[*], Sprite3DMaterialCache::[*], Bone3D::[*], - Scene::[getCameras] + Scene::[getCameras], + Ray::[*], + AABB::[*], + OBB::[*] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], From 933439c6ca5ff588fe8757413051b0b84b186625 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 9 Aug 2014 09:27:48 +0800 Subject: [PATCH 016/147] fix linux --- tests/cpp-tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index ac88ce2b90..e457e435f2 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -162,7 +162,7 @@ set(SAMPLE_SRC Classes/ShaderTest/ShaderTest2.cpp Classes/SpriteTest/SpriteTest.cpp Classes/Sprite3DTest/Sprite3DTest.cpp - Classes/Sprite3DTest/CCDrawNode3D.cpp + Classes/Sprite3DTest/DrawNode3D.cpp Classes/TextInputTest/TextInputTest.cpp Classes/Texture2dTest/Texture2dTest.cpp Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp From 2576622778a9773ab7ca7e4dc654fa62ccc086db Mon Sep 17 00:00:00 2001 From: yangxiao Date: Mon, 11 Aug 2014 10:07:23 +0800 Subject: [PATCH 017/147] move create camera to Scene::initWithSize --- cocos/2d/CCScene.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index 5fc4c3bd14..f373ec8017 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -54,16 +54,16 @@ Scene::~Scene() bool Scene::init() { - //create default camera - auto camera = Camera::create(); - addChild(camera); - auto size = Director::getInstance()->getWinSize(); return initWithSize(size); } bool Scene::initWithSize(const Size& size) { + //create default camera + auto camera = Camera::create(); + addChild(camera); + setContentSize(size); return true; } From c592ac4248392571afa6603d7863656295eaa1ac Mon Sep 17 00:00:00 2001 From: lvlong Date: Mon, 11 Aug 2014 10:40:34 +0800 Subject: [PATCH 018/147] for pull request modify!! --- cocos/3d/CCAABB.cpp | 13 ++++-- cocos/3d/CCAABB.h | 5 +- cocos/3d/CCMesh.cpp | 6 +-- cocos/3d/CCMesh.h | 2 +- cocos/3d/CCOBB.cpp | 109 ++++++++++++++++++++++++-------------------- cocos/3d/CCOBB.h | 7 ++- cocos/3d/CCRay.cpp | 76 +++++++++++++++--------------- 7 files changed, 119 insertions(+), 99 deletions(-) diff --git a/cocos/3d/CCAABB.cpp b/cocos/3d/CCAABB.cpp index 0cc13f2e46..f56c06f12e 100755 --- a/cocos/3d/CCAABB.cpp +++ b/cocos/3d/CCAABB.cpp @@ -149,8 +149,13 @@ void AABB::updateMinMax(const Vec3* point, ssize_t num) } } -void AABB::transform(const Mat4& matrix) +void AABB::transform(const Mat4& mat) { + // if _transform matrix isn't changed, just return. + int size = sizeof(Mat4); + if (memcmp(&_transform, &mat, size) == 0) + return; + Vec3 corners[8]; // Near face, specified counter-clockwise // Left-top-front. @@ -172,11 +177,9 @@ void AABB::transform(const Mat4& matrix) // Left-top-back. corners[7].set(_min.x, _max.y, _min.z); - // Transform the corners, recalculating the min and max points along the way. - //matrix.transformPoint(&corners[0]); - + // Transform the corners, recalculate the min and max points along the way. for (int i = 0; i < 8; i++) - matrix.transformPoint(&corners[i]); + mat.transformPoint(&corners[i]); reset(); diff --git a/cocos/3d/CCAABB.h b/cocos/3d/CCAABB.h index 97d25a09fe..e560f3456c 100755 --- a/cocos/3d/CCAABB.h +++ b/cocos/3d/CCAABB.h @@ -102,7 +102,10 @@ public: /** * Transforms the bounding box by the given transformation matrix. */ - void transform(const Mat4& matrix); + void transform(const Mat4& mat); + +private: + Mat4 _transform; public: Vec3 _min; diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index 5cc5fe475a..16007b1588 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -208,7 +208,7 @@ bool Mesh::init(const std::vector& positions, const std::vector& n buildBuffer(); - calcuOriginAABB(positions, 3); + calOriginAABB(positions, 3); return true; } @@ -225,7 +225,7 @@ bool Mesh::init(const std::vector& vertices, int vertexSizeInFloat, const buildBuffer(); unsigned int perVertexSize = _renderdata.calVertexSizeBytes() / sizeof(float); - calcuOriginAABB(vertices, perVertexSize); + calOriginAABB(vertices, perVertexSize); return true; } @@ -252,7 +252,7 @@ void Mesh::cleanAndFreeBuffers() } } -void Mesh::calcuOriginAABB(const std::vector& vertices, unsigned int stride) +void Mesh::calOriginAABB(const std::vector& vertices, unsigned int stride) { ssize_t vertexNum = vertices.size() / stride; for(unsigned int i = 0; i < vertexNum; i++) diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index d88f30d7ea..304a09f207 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -159,7 +159,7 @@ CC_CONSTRUCTOR_ACCESS: * @param the vertices list * @param stride the stride between two vertex's position data. */ - void calcuOriginAABB(const std::vector& vertices, unsigned int stride); + void calOriginAABB(const std::vector& vertices, unsigned int stride); protected: GLuint _vertexBuffer; diff --git a/cocos/3d/CCOBB.cpp b/cocos/3d/CCOBB.cpp index 65a7e2b733..c191fee9fc 100755 --- a/cocos/3d/CCOBB.cpp +++ b/cocos/3d/CCOBB.cpp @@ -28,7 +28,7 @@ NS_CC_BEGIN #define ROTATE(a,i,j,k,l) g=a.m[i + 4 * j]; h=a.m[k + 4 * l]; a.m[i + 4 * j]=(float)(g-s*(h+g*tau)); a.m[k + 4 * l]=(float)(h+s*(g-h*tau)); -static Mat4 _convarianceMatrix(const Vec3* aVertPos, int nVertCount) +static Mat4 _getConvarianceMatrix(const Vec3* vertPos, int vertCount) { int i; Mat4 Cov; @@ -42,21 +42,21 @@ static Mat4 _convarianceMatrix(const Vec3* aVertPos, int nVertCount) S2[0][2] = S2[1][2] = S2[2][2] = 0.0; // get center of mass - for(i=0; i3 && fabs(dmip)+g==fabs(dmip) && fabs(dmiq)+g==fabs(dmiq) ) - a.m[ip + 4 * iq]=0.0; - else if (fabs(a.m[ip + 4 * iq])>tresh) + + if( i>3 && fabs(dmip) + g == fabs(dmip) && fabs(dmiq) + g == fabs(dmiq) ) { - h = dmiq-dmip; - if (fabs(h)+g == fabs(h)) + a.m[ip + 4 * iq] = 0.0; + } + else if (fabs(a.m[ip + 4 * iq]) > tresh) + { + h = dmiq - dmip; + if (fabs(h) + g == fabs(h)) + { t=(a.m[ip + 4 * iq])/h; + } else { - theta=0.5*h/(a.m[ip + 4 * iq]); - t=1.0/(fabs(theta)+sqrt(1.0+theta*theta)); + theta = 0.5 * h / (a.m[ip + 4 * iq]); + t=1.0 / (fabs(theta) + sqrt(1.0 + theta * theta)); if (theta < 0.0) t = -t; } - c=1.0/sqrt(1+t*t); - s=t*c; - tau=s/(1.0+c); - h=t*a.m[ip + 4 * iq]; + c = 1.0 / sqrt(1+t*t); + s = t*c; + tau = s / (1.0+c); + h = t * a.m[ip + 4 * iq]; _getElement(z, ip) -= (float)h; _getElement(z, iq) += (float)h; _getElement(d, ip) -= (float)h; _getElement(d, iq) += (float)h; a.m[ip + 4 * iq]=0.0; - for(j=0;j 0) t = (min.x - origin.x) / dir.x; else t = (max.x - origin.x) / dir.x; - if (t > 0.f) - { - ptOnPlane = origin + t * dir; - - if (min.y < ptOnPlane.y && ptOnPlane.y < max.y && min.z < ptOnPlane.z && ptOnPlane.z < max.z) - { - return true; - } - } - } + if (t > 0.f) + { + ptOnPlane = origin + t * dir; + + if (min.y < ptOnPlane.y && ptOnPlane.y < max.y && min.z < ptOnPlane.z && ptOnPlane.z < max.z) + { + return true; + } + } + } - if (dir.y != 0.f) - { + if (dir.y != 0.f) + { if (dir.y > 0) t = (min.y - origin.y) / dir.y; else t = (max.y - origin.y) / dir.y; - if (t > 0.f) - { - ptOnPlane = origin + t * dir; - - if (min.z < ptOnPlane.z && ptOnPlane.z < max.z && min.x < ptOnPlane.x && ptOnPlane.x < max.x) - { - return true; - } - } - } + if (t > 0.f) + { + ptOnPlane = origin + t * dir; + + if (min.z < ptOnPlane.z && ptOnPlane.z < max.z && min.x < ptOnPlane.x && ptOnPlane.x < max.x) + { + return true; + } + } + } if (dir.z != 0.f) { @@ -94,18 +94,18 @@ bool Ray::intersects(const AABB& aabb) const else t = (max.z - origin.z) / dir.z; - if (t > 0.f) - { - ptOnPlane = origin + t * dir; + if (t > 0.f) + { + ptOnPlane = origin + t * dir; - if (min.x < ptOnPlane.x && ptOnPlane.x < max.x && min.y < ptOnPlane.y && ptOnPlane.y < max.y) - { - return true; - } - } - } + if (min.x < ptOnPlane.x && ptOnPlane.x < max.x && min.y < ptOnPlane.y && ptOnPlane.y < max.y) + { + return true; + } + } + } - return false; + return false; } bool Ray::intersects(const OBB& obb) const From 3a7b6731640b8abacd51e233bc3283cd0f29c3fc Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 12 Aug 2014 10:50:57 +0800 Subject: [PATCH 019/147] add callback for RenderTexture::saveToFile --- cocos/2d/CCRenderTexture.cpp | 19 +++++++++++++------ cocos/2d/CCRenderTexture.h | 5 +++-- .../RenderTextureTest/RenderTextureTest.cpp | 16 +++++----------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 8a60335503..9cee8b1434 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -67,6 +67,7 @@ RenderTexture::RenderTexture() , _rtTextureRect(Rect::ZERO) , _fullRect(Rect::ZERO) , _fullviewPort(Rect::ZERO) +, _saveFileCallback(nullptr) { #if CC_ENABLE_CACHE_TEXTURE_DATA // Listen this event to save render texture before come to background. @@ -415,33 +416,36 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3 _orderOfArrival = 0; } -bool RenderTexture::saveToFile(const std::string& filename, bool isRGBA) +bool RenderTexture::saveToFile(const std::string& filename, bool isRGBA, std::function callback) { std::string basename(filename); std::transform(basename.begin(), basename.end(), basename.begin(), ::tolower); if (basename.find(".png") != std::string::npos) { - return saveToFile(filename, Image::Format::PNG, isRGBA); + return saveToFile(filename, Image::Format::PNG, isRGBA, callback); } else if (basename.find(".jpg") != std::string::npos) { if (isRGBA) CCLOG("RGBA is not supported for JPG format."); - return saveToFile(filename, Image::Format::JPG, false); + return saveToFile(filename, Image::Format::JPG, false, callback); } else { CCLOG("Only PNG and JPG format are supported now!"); } - return saveToFile(filename, Image::Format::JPG, false); + return saveToFile(filename, Image::Format::JPG, false, callback); } -bool RenderTexture::saveToFile(const std::string& fileName, Image::Format format, bool isRGBA) + +bool RenderTexture::saveToFile(const std::string& fileName, Image::Format format, bool isRGBA, std::function callback) { CCASSERT(format == Image::Format::JPG || format == Image::Format::PNG, "the image can only be saved as JPG or PNG format"); if (isRGBA && format == Image::Format::JPG) CCLOG("RGBA is not supported for JPG format"); + _saveFileCallback = callback; + std::string fullpath = FileUtils::getInstance()->getWritablePath() + fileName; _saveToFileCommand.init(_globalZOrder); _saveToFileCommand.func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA); @@ -457,7 +461,10 @@ void RenderTexture::onSaveToFile(const std::string& filename, bool isRGBA) { image->saveToFile(filename.c_str(), !isRGBA); } - + if(_saveFileCallback) + { + _saveFileCallback(this, filename); + } CC_SAFE_DELETE(image); } diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index 187acc18b3..3d016b0be6 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -103,12 +103,12 @@ public: /** saves the texture into a file using JPEG format. The file will be saved in the Documents folder. Returns true if the operation is successful. */ - bool saveToFile(const std::string& filename, bool isRGBA = true); + bool saveToFile(const std::string& filename, bool isRGBA = true, std::function callback = nullptr); /** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder. Returns true if the operation is successful. */ - bool saveToFile(const std::string& filename, Image::Format format, bool isRGBA = true); + bool saveToFile(const std::string& filename, Image::Format format, bool isRGBA = true, std::function callback = nullptr); /** Listen "come to background" message, and save render texture. It only has effect on Android. @@ -214,6 +214,7 @@ protected: CustomCommand _beginCommand; CustomCommand _endCommand; CustomCommand _saveToFileCommand; + std::function _saveFileCallback; protected: //renderer caches and callbacks void onBegin(); diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 334d578b79..c75eb75cd3 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -135,25 +135,19 @@ void RenderTextureSave::saveImage(cocos2d::Ref *sender) char png[20]; sprintf(png, "image-%d.png", counter); - char jpg[20]; - sprintf(jpg, "image-%d.jpg", counter); - - _target->saveToFile(png, Image::Format::PNG); - _target->saveToFile(jpg, Image::Format::JPG); - std::string fileName = FileUtils::getInstance()->getWritablePath() + jpg; - auto action1 = DelayTime::create(1); - auto func = [&,fileName]() + auto callback = [&](RenderTexture* rt, const std::string& path) { - auto sprite = Sprite::create(fileName); + auto sprite = Sprite::create(path); addChild(sprite); sprite->setScale(0.3f); sprite->setPosition(Vec2(40, 40)); sprite->setRotation(counter * 3); }; - runAction(Sequence::create(action1, CallFunc::create(func), nullptr)); + + _target->saveToFile(png, Image::Format::PNG, true, callback); - CCLOG("Image saved %s and %s", png, jpg); + CCLOG("Image saved %s", png); counter++; } From 89cf0c1e8c7bf08f21fdd57960c744dcb1493a36 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Tue, 12 Aug 2014 11:56:08 +0900 Subject: [PATCH 020/147] fix getEngine --- cocos/base/ccRandom.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h index 2be07b6a95..9bb813d29d 100644 --- a/cocos/base/ccRandom.h +++ b/cocos/base/ccRandom.h @@ -37,18 +37,18 @@ public: template static inline T random_real(T min, T max) { std::uniform_real_distribution dist(min, max); - std::mt19937 mt = RandomHelper::getEngine(); + auto &mt = RandomHelper::getEngine(); return dist(mt); } template static inline T random_int(T min, T max) { std::uniform_int_distribution<> dist(min, max); - std::mt19937 mt = RandomHelper::getEngine(); + auto &mt = RandomHelper::getEngine(); return dist(mt); } private: - static std::mt19937 getEngine() { + static std::mt19937 &getEngine() { static std::random_device seed_gen; static std::mt19937 engine(seed_gen()); return engine; From f191bebe7224fd24234c49ffdc53e1a5b0d3d05a Mon Sep 17 00:00:00 2001 From: lvlong Date: Tue, 12 Aug 2014 13:45:06 +0800 Subject: [PATCH 021/147] optimize Sprite3D get aabb. --- cocos/3d/CCAABB.cpp | 5 ----- cocos/3d/CCAABB.h | 3 --- cocos/3d/CCOBB.cpp | 4 ---- cocos/3d/CCOBB.h | 3 --- cocos/3d/CCSprite3D.cpp | 22 +++++++++++++++------- cocos/3d/CCSprite3D.h | 3 +++ 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/cocos/3d/CCAABB.cpp b/cocos/3d/CCAABB.cpp index f56c06f12e..4c159ae8b8 100755 --- a/cocos/3d/CCAABB.cpp +++ b/cocos/3d/CCAABB.cpp @@ -151,11 +151,6 @@ void AABB::updateMinMax(const Vec3* point, ssize_t num) void AABB::transform(const Mat4& mat) { - // if _transform matrix isn't changed, just return. - int size = sizeof(Mat4); - if (memcmp(&_transform, &mat, size) == 0) - return; - Vec3 corners[8]; // Near face, specified counter-clockwise // Left-top-front. diff --git a/cocos/3d/CCAABB.h b/cocos/3d/CCAABB.h index e560f3456c..8894aa0098 100755 --- a/cocos/3d/CCAABB.h +++ b/cocos/3d/CCAABB.h @@ -104,9 +104,6 @@ public: */ void transform(const Mat4& mat); -private: - Mat4 _transform; - public: Vec3 _min; Vec3 _max; diff --git a/cocos/3d/CCOBB.cpp b/cocos/3d/CCOBB.cpp index c191fee9fc..f74bf96a47 100755 --- a/cocos/3d/CCOBB.cpp +++ b/cocos/3d/CCOBB.cpp @@ -421,10 +421,6 @@ bool OBB::intersects(const OBB& box) const void OBB::transform(const Mat4& mat) { - int size = sizeof(Mat4); - if (memcmp(&_transform, &mat, size) == 0) - return; - Vec4 newcenter = mat * Vec4(_center.x, _center.y, _center.z, 1.0f);// center; _center.x = newcenter.x; _center.y = newcenter.y; diff --git a/cocos/3d/CCOBB.h b/cocos/3d/CCOBB.h index 9b797c9746..95776bd5f5 100755 --- a/cocos/3d/CCOBB.h +++ b/cocos/3d/CCOBB.h @@ -104,9 +104,6 @@ protected: */ Vec3 getFaceDir(int index) const; -private: - Mat4 _transform; - public: Vec3 _center; // obb center Vec3 _xAxis; // x axis of obb, unit vector diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 629c141c30..acc03c1d18 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -401,20 +401,28 @@ const BlendFunc& Sprite3D::getBlendFunc() const AABB Sprite3D::getAABB() const { - AABB aabb = _mesh->getOriginAABB(); - Mat4 transform; + Mat4 nodeToWorldTransform(getNodeToWorldTransform()); - if (getSkin() && getSkin()->getRootBone()) + // If nodeToWorldTransform matrix isn't changed, we don't need to transform aabb. + if (memcmp(_nodeToWorldTransform.m, nodeToWorldTransform.m, sizeof(Mat4)) == 0) { - transform = getNodeToWorldTransform() * getSkin()->getRootBone()->getWorldMat(); + return _aabb; } else { - transform = getNodeToWorldTransform(); + Mat4 transform(nodeToWorldTransform); + _aabb = _mesh->getOriginAABB(); + + if (getSkin() && getSkin()->getRootBone()) + { + transform = nodeToWorldTransform * getSkin()->getRootBone()->getWorldMat(); + } + + _aabb.transform(transform); + _nodeToWorldTransform = nodeToWorldTransform; } - aabb.transform(transform); - return aabb; + return _aabb; } Rect Sprite3D::getBoundingBox() const diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 340a6ca9c2..49a1282e89 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -134,6 +134,9 @@ protected: std::unordered_map _attachments; BlendFunc _blend; + + mutable AABB _aabb; // cache current aabb + mutable Mat4 _nodeToWorldTransform; // cache the matrix }; extern std::string CC_DLL s_attributeNames[];//attribute names array From 32645c1622b1fe3298ef81cc226d304ce5b7f018 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 12 Aug 2014 14:42:08 +0800 Subject: [PATCH 022/147] fix default camera, add listener for projection change --- cocos/2d/CCScene.cpp | 30 +++++++++++-- cocos/2d/CCScene.h | 4 ++ cocos/base/CCCamera.cpp | 98 +++++++++++++++++++++++++++++------------ cocos/base/CCCamera.h | 6 +++ 4 files changed, 106 insertions(+), 32 deletions(-) diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index cfc5f4f83a..f399c01fc5 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -28,6 +28,8 @@ THE SOFTWARE. #include "2d/CCScene.h" #include "base/CCDirector.h" #include "base/CCCamera.h" +#include "base/CCEventDispatcher.h" +#include "base/CCEventListenerCustom.h" #include "2d/CCLayer.h" #include "2d/CCSprite.h" #include "2d/CCSpriteBatchNode.h" @@ -43,6 +45,8 @@ Scene::Scene() { _ignoreAnchorPointForPosition = true; setAnchorPoint(Vec2(0.5f, 0.5f)); + _event = nullptr; + _defaultCamera = nullptr; } Scene::~Scene() @@ -50,6 +54,8 @@ Scene::~Scene() #if CC_USE_PHYSICS CC_SAFE_DELETE(_physicsWorld); #endif + Director::getInstance()->getEventDispatcher()->removeEventListener(_event); + CC_SAFE_RELEASE(_event); } bool Scene::init() @@ -61,8 +67,14 @@ bool Scene::init() bool Scene::initWithSize(const Size& size) { //create default camera - auto camera = Camera::create(); - addChild(camera); + _defaultCamera = Camera::create(); + addChild(_defaultCamera); + CCLOG("camera %p", _defaultCamera); + + _event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1)); + _event->retain(); + static int tag = 0; + setTag(tag++); setContentSize(size); return true; @@ -154,8 +166,10 @@ bool Scene::initWithPhysics() Director * director; CC_BREAK_IF( ! (director = Director::getInstance()) ); // add camera - auto camera = Camera::create(); - addChild(camera); + _defaultCamera = Camera::create(); + addChild(_defaultCamera); + _event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1)); + _event->retain(); this->setContentSize(director->getWinSize()); CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::construct(*this))); @@ -189,6 +203,14 @@ void Scene::addChildToPhysicsWorld(Node* child) } } +void Scene::onProjectionChanged(EventCustom* event) +{ + if (_defaultCamera) + { + _defaultCamera->initDefault(); + } +} + #endif NS_CC_END diff --git a/cocos/2d/CCScene.h b/cocos/2d/CCScene.h index 41c53659a4..7630111cc9 100644 --- a/cocos/2d/CCScene.h +++ b/cocos/2d/CCScene.h @@ -74,6 +74,8 @@ CC_CONSTRUCTOR_ACCESS: bool init(); bool initWithSize(const Size& size); + + void onProjectionChanged(EventCustom* event); protected: friend class Node; @@ -83,6 +85,8 @@ protected: friend class Director; std::vector _cameras; //weak ref to Camera + Camera* _defaultCamera; //weak ref, default camera created by scene, _cameras[0], Caution that the default camera can not be added to _cameras before onEnter is called + EventListenerCustom* _event; private: CC_DISALLOW_COPY_AND_ASSIGN(Scene); diff --git a/cocos/base/CCCamera.cpp b/cocos/base/CCCamera.cpp index d4ee14911d..0c9cd3b234 100644 --- a/cocos/base/CCCamera.cpp +++ b/cocos/base/CCCamera.cpp @@ -65,20 +65,7 @@ Camera* Camera::createPerspective(float fieldOfView, float aspectRatio, float ne auto ret = new Camera(); if (ret) { - ret->_fieldOfView = fieldOfView; - ret->_aspectRatio = aspectRatio; - ret->_nearPlane = nearPlane; - ret->_farPlane = farPlane; - Mat4::createPerspective(ret->_fieldOfView, ret->_aspectRatio, ret->_nearPlane, ret->_farPlane, &ret->_projection); -#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 - //if needed, we need to add a rotation for Landscape orientations on Windows Phone 8 since it is always in Portrait Mode - GLView* view = Director::getInstance()->getOpenGLView(); - if(view != nullptr) - { - setAdditionalProjection(view->getOrientationMatrix()); - } -#endif - ret->_viewProjectionDirty = true; + ret->initPerspective(fieldOfView, aspectRatio, nearPlane, farPlane); ret->autorelease(); return ret; } @@ -91,20 +78,7 @@ Camera* Camera::createOrthographic(float zoomX, float zoomY, float nearPlane, fl auto ret = new Camera(); if (ret) { - ret->_zoom[0] = zoomX; - ret->_zoom[1] = zoomY; - ret->_nearPlane = nearPlane; - ret->_farPlane = farPlane; - Mat4::createOrthographic(ret->_zoom[0], ret->_zoom[1], ret->_nearPlane, ret->_farPlane, &ret->_projection); -#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 - //if needed, we need to add a rotation for Landscape orientations on Windows Phone 8 since it is always in Portrait Mode - GLView* view = Director::getInstance()->getOpenGLView(); - if(view != nullptr) - { - setAdditionalProjection(view->getOrientationMatrix()); - } -#endif - ret->_viewProjectionDirty = true; + ret->initOrthographic(zoomX, zoomY, nearPlane, farPlane); ret->autorelease(); return ret; } @@ -203,6 +177,74 @@ void Camera::setAdditionalProjection(const Mat4& mat) getViewProjectionMatrix(); } +bool Camera::initDefault() +{ + auto size = Director::getInstance()->getWinSize(); + //create default camera + auto projection = Director::getInstance()->getProjection(); + switch (projection) + { + case Director::Projection::_2D: + { + initOrthographic(size.width, size.height, -1024, 1024); + break; + } + case Director::Projection::_3D: + { + float zeye = Director::getInstance()->getZEye(); + initPerspective(60, (GLfloat)size.width / size.height, 10, zeye + size.height / 2.0f); + Vec3 eye(size.width/2, size.height/2.0f, zeye), center(size.width/2, size.height/2, 0.0f), up(0.0f, 1.0f, 0.0f); + setPosition3D(eye); + lookAt(center, up); + break; + } + default: + CCLOG("unrecognized projection"); + break; + } + return true; +} + +bool Camera::initPerspective(float fieldOfView, float aspectRatio, float nearPlane, float farPlane) +{ + _fieldOfView = fieldOfView; + _aspectRatio = aspectRatio; + _nearPlane = nearPlane; + _farPlane = farPlane; + Mat4::createPerspective(_fieldOfView, _aspectRatio, _nearPlane, _farPlane, &_projection); +#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 + //if needed, we need to add a rotation for Landscape orientations on Windows Phone 8 since it is always in Portrait Mode + GLView* view = Director::getInstance()->getOpenGLView(); + if(view != nullptr) + { + setAdditionalProjection(view->getOrientationMatrix()); + } +#endif + _viewProjectionDirty = true; + + return true; +} + +bool Camera::initOrthographic(float zoomX, float zoomY, float nearPlane, float farPlane) +{ + _zoom[0] = zoomX; + _zoom[1] = zoomY; + _nearPlane = nearPlane; + _farPlane = farPlane; + Mat4::createOrthographic(_zoom[0], _zoom[1], _nearPlane, _farPlane, &_projection); +#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 + //if needed, we need to add a rotation for Landscape orientations on Windows Phone 8 since it is always in Portrait Mode + GLView* view = Director::getInstance()->getOpenGLView(); + if(view != nullptr) + { + setAdditionalProjection(view->getOrientationMatrix()); + } +#endif + _viewProjectionDirty = true; + + return true; +} + void Camera::unproject(const Size& viewport, Vec3* src, Vec3* dst) const { assert(dst); diff --git a/cocos/base/CCCamera.h b/cocos/base/CCCamera.h index d65ba3798e..6825b14268 100644 --- a/cocos/base/CCCamera.h +++ b/cocos/base/CCCamera.h @@ -50,6 +50,7 @@ enum class CameraFlag */ class CC_DLL Camera :public Node { + friend class Scene; public: /** * The type of camera. @@ -142,6 +143,11 @@ CC_CONSTRUCTOR_ACCESS: /**set additional matrix for the projection matrix, it multiplys mat to projection matrix when called, used by WP8*/ void setAdditionalProjection(const Mat4& mat); + + /** init camera */ + bool initDefault(); + bool initPerspective(float fieldOfView, float aspectRatio, float nearPlane, float farPlane); + bool initOrthographic(float zoomX, float zoomY, float nearPlane, float farPlane); protected: From 510b72d7c8f10d7f6257c936069a148b219a22ba Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 12 Aug 2014 15:21:21 +0800 Subject: [PATCH 023/147] reset cocos2d project --- build/cocos2d_libs.xcodeproj/project.pbxproj | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 12a9dde1f8..e5b3dbac4b 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -7867,6 +7867,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -7904,6 +7905,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -7938,6 +7940,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_EXTENSION = a; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -7970,6 +7973,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_EXTENSION = a; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -8002,6 +8006,7 @@ A03F2CB61780BD04006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; HEADER_SEARCH_PATHS = ""; @@ -8012,6 +8017,7 @@ A03F2CB71780BD04006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -8023,6 +8029,7 @@ A03F2D991780BDF7006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8038,6 +8045,7 @@ A03F2D9A1780BDF7006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8054,6 +8062,7 @@ A03F2E90178141C1006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "COCOS2D_DEBUG=1", @@ -8070,6 +8079,7 @@ A03F2E91178141C1006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; HEADER_SEARCH_PATHS = ( "$(inherited)", "/Applications/Xcode\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", @@ -8081,6 +8091,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC; GCC_TREAT_WARNINGS_AS_ERRORS = NO; @@ -8093,6 +8104,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC; @@ -8106,6 +8118,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = ""; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8124,6 +8137,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = ""; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -8143,6 +8157,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; @@ -8172,6 +8187,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -8201,6 +8217,7 @@ A07A4E0D178386390073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; IPHONEOS_DEPLOYMENT_TARGET = 5.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -8210,6 +8227,7 @@ A07A4E0E178386390073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; IPHONEOS_DEPLOYMENT_TARGET = 5.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -8220,6 +8238,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8239,6 +8258,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8258,6 +8278,7 @@ A07A4F39178387670073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; @@ -8270,6 +8291,7 @@ A07A4F3A178387670073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; HEADER_SEARCH_PATHS = ""; @@ -8283,6 +8305,7 @@ A07A4F9C1783876B0073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8301,6 +8324,7 @@ A07A4F9D1783876B0073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -8321,6 +8345,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8339,6 +8364,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8358,6 +8384,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8376,6 +8403,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8395,6 +8423,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8415,6 +8444,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8436,6 +8466,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8456,6 +8487,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8477,6 +8509,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8497,6 +8530,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8518,6 +8552,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8538,6 +8573,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8559,6 +8595,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8582,6 +8619,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8606,6 +8644,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8624,6 +8663,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8643,6 +8683,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8661,6 +8702,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8680,6 +8722,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8698,6 +8741,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8717,6 +8761,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8738,6 +8783,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From 1d0deb0bc1b87198db0cd92885f28e8c21b7a273 Mon Sep 17 00:00:00 2001 From: GavinThornton Date: Tue, 12 Aug 2014 01:02:06 -0700 Subject: [PATCH 024/147] Update CCEventTouch.h MAX_TOUCHES=5 is less than most touch devices, iPad/Android tablets can almost all handle all 10-11 touches. Perhaps a value of 15 would be better? Note: There is a #define IOS_MAX_TOUCHES_COUNT 10 in CCEAGLView.mm already for this, but multitouch fails on touch 5 in "void GLViewProtocol::handleTouchesBegin" at the code:- // The touches is more than MAX_TOUCHES ? if (unusedIndex == -1) { CCLOG("The touches is more than MAX_TOUCHES, unusedIndex = %d", unusedIndex); continue; } --- cocos/base/CCEventTouch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCEventTouch.h b/cocos/base/CCEventTouch.h index 412db171a0..52bbbf9a2c 100644 --- a/cocos/base/CCEventTouch.h +++ b/cocos/base/CCEventTouch.h @@ -36,7 +36,7 @@ NS_CC_BEGIN class CC_DLL EventTouch : public Event { public: - static const int MAX_TOUCHES = 5; + static const int MAX_TOUCHES = 15; enum class EventCode { From d9fdfb2659bf259b1898d8977784cde9ad8a57b1 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Tue, 12 Aug 2014 17:05:39 +0800 Subject: [PATCH 025/147] Modify cpp-template-default project configure --- templates/cpp-template-default/CMakeLists.txt | 14 +++++++++----- .../cpp-template-default/proj.win32/HelloCpp.sln | 7 ------- .../proj.win32/HelloCpp.vcxproj | 3 --- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index cfc1fb578e..97c0813e94 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -189,6 +189,15 @@ add_subdirectory(${COCOS2D_ROOT}/external/xxhash) # cocos2d add_subdirectory(${COCOS2D_ROOT}/cocos) +# network library +add_subdirectory(${COCOS2D_ROOT}/cocos/network) + +# ui library +add_subdirectory(${COCOS2D_ROOT}/cocos/ui) + +# sqlite3 library +add_subdirectory(${COCOS2D_ROOT}/cocos/storage) + # extensions add_subdirectory(${COCOS2D_ROOT}/extensions) @@ -223,11 +232,6 @@ set(FMOD_LIB "fmodex") endif() target_link_libraries(${APP_NAME} - spine - cocostudio - cocosbuilder - extensions - audio cocos2d ) diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.sln b/templates/cpp-template-default/proj.win32/HelloCpp.sln index a36c9b37cb..3bc2c2704e 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.sln +++ b/templates/cpp-template-default/proj.win32/HelloCpp.sln @@ -5,15 +5,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "HelloCpp.vcxpro ProjectSection(ProjectDependencies) = postProject {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} - {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos2d\cocos\audio\proj.win32\libcocosdenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -32,10 +29,6 @@ Global {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32 - {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32 - {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32 - {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32 - {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj index 0b704a8960..022025afc8 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj +++ b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj @@ -151,9 +151,6 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)"{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} false - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} From 17aa2833db739f6f05cdf5b5d83559a4b6c5ade7 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Tue, 12 Aug 2014 12:46:14 +0900 Subject: [PATCH 026/147] Fix xcode warning that cause `getEngine` inline expansion --- build/cocos2d_libs.xcodeproj/project.pbxproj | 6 ++++ cocos/Android.mk | 1 + cocos/base/CMakeLists.txt | 1 + cocos/base/ccRandom.cpp | 32 ++++++++++++++++++++ cocos/base/ccRandom.h | 6 +--- templates/cocos2dx_files.json | 1 + 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 cocos/base/ccRandom.cpp diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 910a81b397..eddca4ccc3 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -568,7 +568,9 @@ 1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1F36C031BE016A88AB195F1B /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; + 1F36C5262E265FD5FFEA0D04 /* ccRandom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */; }; 1F36C5F58B5642071337D8E2 /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; + 1F36CBBF38533B59D96661B1 /* ccRandom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */; }; 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244C19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 2958244A19873D8E00F9746D /* UIScale9Sprite.h */; }; @@ -2396,6 +2398,7 @@ 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = ""; }; 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = ""; }; 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccRandom.h; path = ../base/ccRandom.h; sourceTree = ""; }; + 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccRandom.cpp; path = ../base/ccRandom.cpp; sourceTree = ""; }; 2905F9E918CF08D000240AA3 /* CocosGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUI.cpp; sourceTree = ""; }; 2905F9EA18CF08D000240AA3 /* CocosGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUI.h; sourceTree = ""; }; 2905F9EB18CF08D000240AA3 /* GUIDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDefine.h; sourceTree = ""; }; @@ -3506,6 +3509,7 @@ 50ABBE1C1925AB6F00A911A9 /* utlist.h */, 50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */, 50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */, + 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */, ); name = base; path = ../cocos/2d; @@ -6912,6 +6916,7 @@ B6ACD897193D6693005E0B8A /* CCMeshSkin.cpp in Sources */, B6ACD89E193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */, B6AAF84119404E0D0069DE01 /* CCBundle3D.cpp in Sources */, + 1F36CBBF38533B59D96661B1 /* ccRandom.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7244,6 +7249,7 @@ B6ACD898193D6693005E0B8A /* CCMeshSkin.cpp in Sources */, B6ACD89F193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */, B6AAF84219404E0D0069DE01 /* CCBundle3D.cpp in Sources */, + 1F36C5262E265FD5FFEA0D04 /* ccRandom.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/cocos/Android.mk b/cocos/Android.mk index de7056977b..49cd30c780 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -128,6 +128,7 @@ base/CCEventTouch.cpp \ base/CCIMEDispatcher.cpp \ base/CCNS.cpp \ base/CCProfiling.cpp \ +base/ccRandom.cpp \ base/CCRef.cpp \ base/CCScheduler.cpp \ base/CCScriptSupport.cpp \ diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index e57058fd5a..9e4bab6394 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -23,6 +23,7 @@ set(COCOS_BASE_SRC base/CCIMEDispatcher.cpp base/CCNS.cpp base/CCProfiling.cpp + base/ccRandom.cpp base/CCRef.cpp base/CCScheduler.cpp base/CCScriptSupport.cpp diff --git a/cocos/base/ccRandom.cpp b/cocos/base/ccRandom.cpp new file mode 100644 index 0000000000..b14783f2e9 --- /dev/null +++ b/cocos/base/ccRandom.cpp @@ -0,0 +1,32 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "ccRandom.h" + +std::mt19937 &cocos2d::RandomHelper::getEngine() { + static std::random_device seed_gen; + static std::mt19937 engine(seed_gen()); + return engine; +} diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h index 9bb813d29d..5d3a7ab2e0 100644 --- a/cocos/base/ccRandom.h +++ b/cocos/base/ccRandom.h @@ -48,11 +48,7 @@ public: return dist(mt); } private: - static std::mt19937 &getEngine() { - static std::random_device seed_gen; - static std::mt19937 engine(seed_gen()); - return engine; - } + static std::mt19937 &getEngine(); }; /** diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 4830583baf..cb271b5e8a 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -344,6 +344,7 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", + "cocos/base/ccRandom.cpp", "cocos/base/ccRandom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", From 2d18763f76654e4220153baa754920e862147fa2 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 12 Aug 2014 17:32:51 +0800 Subject: [PATCH 027/147] call Scene::init --- .../Classes/PerformanceTest/PerformanceParticleTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp index 7f43d0ae6e..f01e8b1312 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -72,6 +72,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) { //srandom(0); + init(); subtestNumber = asubtest; auto s = Director::getInstance()->getWinSize(); From 0dbfb3336ca99a9ab7801855aa910fe5c39bf78b Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 12 Aug 2014 17:47:12 +0800 Subject: [PATCH 028/147] call Scene::init --- tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp | 1 + .../cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp index 0948b6ccfa..e8228e0c3b 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -81,6 +81,7 @@ int LabelMainScene::_s_labelCurCase = 0; void LabelMainScene::initWithSubTest(int nodes) { + init(); //srandom(0); auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 51194ee6a0..3af71b605f 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -371,6 +371,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) { //srandom(0); + init(); subtestNumber = asubtest; _subTest = new SubTest; _subTest->initWithSubTest(asubtest, this); From 0b93cc40d7423ed83816bf27a99dd28947181eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=96=E6=A2=81?= <418094911@qq.com> Date: Tue, 12 Aug 2014 20:12:23 +0800 Subject: [PATCH 029/147] when http code 301,302, can follow rediect --- extensions/assets-manager/AssetsManager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 52073d2f07..e2cf66548f 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -159,6 +159,7 @@ bool AssetsManager::checkUpdate() curl_easy_setopt(_curl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_LIMIT, LOW_SPEED_LIMIT); curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_TIME, LOW_SPEED_TIME); + curl_easy_setopt(_curl, CURLOPT_FOLLOWLOCATION, 1 ); res = curl_easy_perform(_curl); if (res != 0) @@ -525,6 +526,7 @@ bool AssetsManager::downLoad() curl_easy_setopt(_curl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_LIMIT, LOW_SPEED_LIMIT); curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_TIME, LOW_SPEED_TIME); + curl_easy_setopt(_curl, CURLOPT_FOLLOWLOCATION, 1 ); res = curl_easy_perform(_curl); curl_easy_cleanup(_curl); From c673955d5d5c5a807f15356cec78341d9df6dcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=96=E6=A2=81?= <418094911@qq.com> Date: Tue, 12 Aug 2014 20:13:52 +0800 Subject: [PATCH 030/147] uncompress false means zip wrong, download again --- extensions/assets-manager/AssetsManager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index e2cf66548f..06df43b5a2 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -210,6 +210,8 @@ void AssetsManager::downloadAndUncompress() if (! uncompress()) { Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{ + UserDefault::getInstance()->setStringForKey(this->keyOfDownloadedVersion().c_str(),""); + UserDefault::getInstance()->flush(); if (this->_delegate) this->_delegate->onError(ErrorCode::UNCOMPRESS); }); From 5ce9afbd696009f012d7b5dda6888a8d5f8e6b68 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 12 Aug 2014 23:34:06 +0800 Subject: [PATCH 031/147] create default camera at Scene constructor --- cocos/2d/CCScene.cpp | 24 ++++++------------- .../PerformanceTest/PerformanceLabelTest.cpp | 1 - .../PerformanceTest/PerformanceSpriteTest.cpp | 1 - 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index dd256eb9b0..9d5fa4cfdc 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -45,8 +45,13 @@ Scene::Scene() { _ignoreAnchorPointForPosition = true; setAnchorPoint(Vec2(0.5f, 0.5f)); - _event = nullptr; - _defaultCamera = nullptr; + + //create default camera + _defaultCamera = Camera::create(); + addChild(_defaultCamera); + + _event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1)); + _event->retain(); } Scene::~Scene() @@ -66,16 +71,6 @@ bool Scene::init() bool Scene::initWithSize(const Size& size) { - //create default camera - _defaultCamera = Camera::create(); - addChild(_defaultCamera); - CCLOG("camera %p", _defaultCamera); - - _event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1)); - _event->retain(); - static int tag = 0; - setTag(tag++); - setContentSize(size); return true; } @@ -165,11 +160,6 @@ bool Scene::initWithPhysics() { Director * director; CC_BREAK_IF( ! (director = Director::getInstance()) ); - // add camera - _defaultCamera = Camera::create(); - addChild(_defaultCamera); - _event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1)); - _event->retain(); this->setContentSize(director->getWinSize()); CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::construct(*this))); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp index e8228e0c3b..0948b6ccfa 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -81,7 +81,6 @@ int LabelMainScene::_s_labelCurCase = 0; void LabelMainScene::initWithSubTest(int nodes) { - init(); //srandom(0); auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 3af71b605f..51194ee6a0 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -371,7 +371,6 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) { //srandom(0); - init(); subtestNumber = asubtest; _subTest = new SubTest; _subTest->initWithSubTest(asubtest, this); From 96500a17d6d6e8070879cc2fddc3f6f68da99770 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 12 Aug 2014 23:39:34 +0800 Subject: [PATCH 032/147] reset ParticleMainScene --- .../Classes/PerformanceTest/PerformanceParticleTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp index f01e8b1312..7f43d0ae6e 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -72,7 +72,6 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) { //srandom(0); - init(); subtestNumber = asubtest; auto s = Director::getInstance()->getWinSize(); From 0154f7a94a80859e9296b34a34e03b756c42f21d Mon Sep 17 00:00:00 2001 From: Mircea Rila Date: Tue, 12 Aug 2014 21:05:09 +0300 Subject: [PATCH 033/147] virtual Node::pause() / Node::resume() --- cocos/2d/CCNode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index e907d06c1d..b40cec89be 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1284,12 +1284,12 @@ public: * Resumes all scheduled selectors, actions and event listeners. * This method is called internally by onEnter */ - void resume(void); + virtual void resume(void); /** * Pauses all scheduled selectors, actions and event listeners.. * This method is called internally by onExit */ - void pause(void); + virtual void pause(void); /** * Resumes all scheduled selectors, actions and event listeners. From cfafeb1e87d2dbfa48d08f6143f4f837b7508b06 Mon Sep 17 00:00:00 2001 From: Mircea Rila Date: Tue, 12 Aug 2014 22:22:47 +0300 Subject: [PATCH 034/147] add minimize / restore for win32 --- cocos/platform/desktop/CCGLViewImpl.cpp | 22 ++++++++++++++++++++++ cocos/platform/desktop/CCGLViewImpl.h | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cocos/platform/desktop/CCGLViewImpl.cpp b/cocos/platform/desktop/CCGLViewImpl.cpp index 515e1272cf..cb8976fa92 100644 --- a/cocos/platform/desktop/CCGLViewImpl.cpp +++ b/cocos/platform/desktop/CCGLViewImpl.cpp @@ -24,6 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCGLViewImpl.h" +#include "CCApplication.h" #include "base/CCDirector.h" #include "base/CCTouch.h" #include "base/CCEventDispatcher.h" @@ -101,6 +102,14 @@ public: _view = view; } + static void onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified) + { + if (_view) + { + _view->onGLFWWindowIconifyCallback(window, iconified); + } + } + private: static GLViewImpl* _view; }; @@ -352,6 +361,7 @@ bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float fram glfwSetWindowPosCallback(_mainWindow, GLFWEventHandler::onGLFWWindowPosCallback); glfwSetFramebufferSizeCallback(_mainWindow, GLFWEventHandler::onGLFWframebuffersize); glfwSetWindowSizeCallback(_mainWindow, GLFWEventHandler::onGLFWWindowSizeFunCallback); + glfwSetWindowIconifyCallback(_mainWindow, GLFWEventHandler::onGLFWWindowIconifyCallback); setFrameSize(rect.size.width, rect.size.height); @@ -709,6 +719,18 @@ void GLViewImpl::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int } } +void GLViewImpl::onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified) +{ + if (iconified == GL_TRUE) + { + Application::getInstance()->applicationDidEnterBackground(); + } + else + { + Application::getInstance()->applicationWillEnterForeground(); + } +} + #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) static bool glew_dynamic_binding() { diff --git a/cocos/platform/desktop/CCGLViewImpl.h b/cocos/platform/desktop/CCGLViewImpl.h index a9befbbd51..0bd3fd0373 100644 --- a/cocos/platform/desktop/CCGLViewImpl.h +++ b/cocos/platform/desktop/CCGLViewImpl.h @@ -130,8 +130,9 @@ protected: void onGLFWWindowPosCallback(GLFWwindow* windows, int x, int y); void onGLFWframebuffersize(GLFWwindow* window, int w, int h); void onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int height); + void onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified); - bool _captured; + bool _captured; bool _supportTouch; bool _isInRetinaMonitor; bool _isRetinaEnabled; From 5a42a94d21268b5d681e472af7f172de2f9421a6 Mon Sep 17 00:00:00 2001 From: Mircea Rila Date: Tue, 12 Aug 2014 22:31:28 +0300 Subject: [PATCH 035/147] update AUTHORS --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 6ab981b04e..40ef469e80 100644 --- a/AUTHORS +++ b/AUTHORS @@ -974,6 +974,9 @@ Developers: DavidPartouche Fixed the bug that video player not showing on iOS if it's not in FullScreen mode + + zaWasp + Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32 Retired Core Developers: WenSheng Yang From 93800c58216f42b754ca1119b6d29ffeb3cd147c Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 13 Aug 2014 01:27:24 +0000 Subject: [PATCH 036/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 0c7d502d92..d41e965099 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -943,6 +943,10 @@ "cocos/renderer/CCGroupCommand.h", "cocos/renderer/CCMeshCommand.cpp", "cocos/renderer/CCMeshCommand.h", + "cocos/renderer/CCPrimitive.cpp", + "cocos/renderer/CCPrimitive.h", + "cocos/renderer/CCPrimitiveCommand.cpp", + "cocos/renderer/CCPrimitiveCommand.h", "cocos/renderer/CCQuadCommand.cpp", "cocos/renderer/CCQuadCommand.h", "cocos/renderer/CCRenderCommand.cpp", @@ -956,6 +960,10 @@ "cocos/renderer/CCTextureAtlas.h", "cocos/renderer/CCTextureCache.cpp", "cocos/renderer/CCTextureCache.h", + "cocos/renderer/CCVertexIndexBuffer.cpp", + "cocos/renderer/CCVertexIndexBuffer.h", + "cocos/renderer/CCVertexIndexData.cpp", + "cocos/renderer/CCVertexIndexData.h", "cocos/renderer/CMakeLists.txt", "cocos/renderer/ccGLStateCache.cpp", "cocos/renderer/ccGLStateCache.h", From bdc5a7b306b30bc9d6a0d184abf80776bce890c3 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 13 Aug 2014 09:30:33 +0800 Subject: [PATCH 037/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 225ca6b315..2475f2bd49 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ cocos2d-x-3.3 ?? [NEW] Added submesh support, and support attaching a Sprite3D object to a bone [NEW] Added UIScale9Sprite [NEW] Added Camera + [NEW] Added render primitive and render primitive command, support passing point, line and triangle data [NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions [NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile() getFileSize() From e269ad49c135ef1ba28133b3647350dbbe2d1d5b Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 13 Aug 2014 09:56:37 +0800 Subject: [PATCH 038/147] fix custom particle tests position --- .../CustomParticleWidgetTest/CustomParticleWidgetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp index 2898a95f57..8724ddd8ce 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp @@ -34,7 +34,7 @@ void CustomParticleWidgetLayer::onEnter() CustomParticleWidget* custom = CustomParticleWidget::create(); custom->setParticlePlist("Particles/BoilingFoam.plist"); - + custom->setPosition(Vec2(VisibleRect::center())); addChild(custom, 10, -1); } From a2cafa29e59a139e822c73538fa24e1f53ae3fea Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 13 Aug 2014 10:06:14 +0800 Subject: [PATCH 039/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 2475f2bd49..d06c1028ae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ cocos2d-x-3.3 ?? [NEW] FileUtilsApple: allow setting bundle to use in file utils on iOS and Mac OS X [NEW] Image: support of software PVRTC v1 decompression [NEW] Physics Integration: can invoke update in demand + [NEW] RenderTexture: add a call back function for saveToFile() [NEW] RotateTo: added 3D rotation support [NEW] ScrollView: added `setMinScale()` and `setMaxScale()` [NEW] SpriteFrameCache: load from plist file content data From c8ad850d68453b1d5fe0a7ff9f43bd931f8810e6 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 13 Aug 2014 10:06:22 +0800 Subject: [PATCH 040/147] Update the reference of submodule cocos2d-console. --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 5db5a4283a..4b020e4900 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 5db5a4283aa22e362901e2924146ad66c2e1484f +Subproject commit 4b020e4900e601a2d5845095f2e6970c13c59613 From 5b99ee71c135b3e4dbb2185afbbcd649cbd1dcb5 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Wed, 13 Aug 2014 10:14:26 +0800 Subject: [PATCH 041/147] add comment for the limit of RenderTextue::saveToFile --- cocos/2d/CCRenderTexture.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index 3d016b0be6..384a466bb6 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -213,6 +213,10 @@ protected: CustomCommand _clearCommand; CustomCommand _beginCommand; CustomCommand _endCommand; + /*this command is used to encapsulate saveToFile, + call saveToFile twice will overwrite this command and callback + and the command and callback will be executed twice. + */ CustomCommand _saveToFileCommand; std::function _saveFileCallback; protected: From 8ab7647b54ad66b7a7844983090f92a32037fc1a Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 13 Aug 2014 10:27:06 +0800 Subject: [PATCH 042/147] Add release_print lua bindings --- .../lua-bindings/manual/CCLuaStack.cpp | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp index 1976b62672..c1f5def686 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -97,7 +97,49 @@ int lua_print(lua_State * luastate) return 0; } -} // namespace { + +int lua_release_print(lua_State * L) +{ + int nargs = lua_gettop(L); + + std::string t; + for (int i=1; i <= nargs; i++) + { + if (lua_istable(L, i)) + t += "table"; + else if (lua_isnone(L, i)) + t += "none"; + else if (lua_isnil(L, i)) + t += "nil"; + else if (lua_isboolean(L, i)) + { + if (lua_toboolean(L, i) != 0) + t += "true"; + else + t += "false"; + } + else if (lua_isfunction(L, i)) + t += "function"; + else if (lua_islightuserdata(L, i)) + t += "lightuserdata"; + else if (lua_isthread(L, i)) + t += "thread"; + else + { + const char * str = lua_tostring(L, i); + if (str) + t += lua_tostring(L, i); + else + t += lua_typename(L, lua_type(L, i)); + } + if (i!=nargs) + t += "\t"; + } + log("[LUA-print] %s", t.c_str()); + + return 0; +} +} NS_CC_BEGIN @@ -134,6 +176,7 @@ bool LuaStack::init(void) // Register our version of the global "print" function const luaL_reg global_functions [] = { {"print", lua_print}, + {"release_print",lua_release_print}, {NULL, NULL} }; luaL_register(_state, "_G", global_functions); From e2d609c05d511aceb9498bc26dba5d175586b588 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 13 Aug 2014 11:28:37 +0800 Subject: [PATCH 043/147] add UITextField color & place hold color, fix double delete bug --- cocos/2d/CCTextFieldTTF.cpp | 15 +++- cocos/platform/desktop/CCGLViewImpl.cpp | 3 - cocos/ui/UITextField.cpp | 20 +++++ cocos/ui/UITextField.h | 4 + .../CocoStudioGUITest/CocosGUIScene.cpp | 2 +- .../CocoStudioGUITest/UISceneManager.cpp | 4 +- .../UITest/CocoStudioGUITest/UISceneManager.h | 1 + .../UITextFieldTest/UITextFieldTest.cpp | 77 +++++++++++++++++++ .../UITextFieldTest/UITextFieldTest.h | 13 ++++ 9 files changed, 131 insertions(+), 8 deletions(-) diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 5a0848d3a8..fef8b66e66 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -259,7 +259,9 @@ const std::string& TextFieldTTF::getContentText() void TextFieldTTF::setTextColor(const Color4B &color) { _colorText = color; - Label::setTextColor(_colorText); + if (_inputText.length() > 0) { + Label::setTextColor(_colorText); + } } void TextFieldTTF::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) @@ -282,11 +284,18 @@ void TextFieldTTF::setColorSpaceHolder(const Color3B& color) _colorSpaceHolder.g = color.g; _colorSpaceHolder.b = color.b; _colorSpaceHolder.a = 255; + if (0 == _inputText.length()) + { + Label::setTextColor(_colorSpaceHolder); + } } void TextFieldTTF::setColorSpaceHolder(const Color4B& color) { _colorSpaceHolder = color; + if (0 == _inputText.length()) { + Label::setTextColor(_colorSpaceHolder); + } } ////////////////////////////////////////////////////////////////////////// @@ -321,7 +330,7 @@ void TextFieldTTF::setString(const std::string &text) } // if there is no input text, display placeholder instead - if (! _inputText.length()) + if (0 == _inputText.length()) { Label::setTextColor(_colorSpaceHolder); Label::setString(_placeHolder); @@ -343,7 +352,7 @@ const std::string& TextFieldTTF::getString() const void TextFieldTTF::setPlaceHolder(const std::string& text) { _placeHolder = text; - if (! _inputText.length()) + if (0 == _inputText.length()) { Label::setTextColor(_colorSpaceHolder); Label::setString(_placeHolder); diff --git a/cocos/platform/desktop/CCGLViewImpl.cpp b/cocos/platform/desktop/CCGLViewImpl.cpp index 515e1272cf..534e52623a 100644 --- a/cocos/platform/desktop/CCGLViewImpl.cpp +++ b/cocos/platform/desktop/CCGLViewImpl.cpp @@ -647,9 +647,6 @@ void GLViewImpl::onGLFWKeyCallback(GLFWwindow *window, int key, int scancode, in EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action); auto dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->dispatchEvent(&event); - if (key == GLFW_KEY_BACKSPACE && action == GLFW_PRESS) { - IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - } } if (GLFW_RELEASE != action && g_keyCodeMap[key] == EventKeyboard::KeyCode::KEY_BACKSPACE) { diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index 6b79323e6b..4bac5b186d 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -445,6 +445,26 @@ const std::string& TextField::getPlaceHolder()const { return _textFieldRenderer->getPlaceHolder(); } + +const Color4B& TextField::getPlaceHolderColor()const +{ + return _textFieldRenderer->getColorSpaceHolder(); +} + +void TextField::setPlaceHolderColor(const cocos2d::Color3B &color) +{ + _textFieldRenderer->setColorSpaceHolder(color); +} + +void TextField::setPlaceHolderColor(const cocos2d::Color4B &color) +{ + _textFieldRenderer->setColorSpaceHolder(color); +} + +void TextField::setTextColor(const cocos2d::Color4B &textColor) +{ + _textFieldRenderer->setTextColor(textColor); +} void TextField::setFontSize(int size) { diff --git a/cocos/ui/UITextField.h b/cocos/ui/UITextField.h index eaea50d952..6738ef2685 100644 --- a/cocos/ui/UITextField.h +++ b/cocos/ui/UITextField.h @@ -135,6 +135,10 @@ public: void setPlaceHolder(const std::string& value); const std::string& getPlaceHolder()const; + const Color4B& getPlaceHolderColor()const; + void setPlaceHolderColor(const Color3B& color); + void setPlaceHolderColor(const Color4B& color); + void setTextColor(const Color4B& textColor); void setFontSize(int size); int getFontSize()const; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 003a4e1f61..c9edfef871 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -159,7 +159,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUITextFieldTest); sceneManager->setMinUISceneId(kUITextFieldTest); - sceneManager->setMaxUISceneId(kUITextFieldTest_TrueTypeFont); + sceneManager->setMaxUISceneId(kUITextFieldTest_PlaceHolderColor); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 37031bf8af..939ae6586a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -59,6 +59,7 @@ static const char* s_testArray[] = "UITextFieldTest_Password", "UITextFieldTest_LineWrap", "UITextFieldTest_TrueTypeFont", + "UITextFieldTest_PlaceHolderColor", "UILayoutTest", "UILayoutTest_Color", "UILayoutTest_Gradient", @@ -241,7 +242,8 @@ Scene *UISceneManager::currentUIScene() return UITextFieldTest_LineWrap::sceneWithTitle(s_testArray[_currentUISceneId]); case kUITextFieldTest_TrueTypeFont: return UITextFieldTest_TrueTypeFont::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUITextFieldTest_PlaceHolderColor: + return UITextFieldTest_PlaceHolderColor::sceneWithTitle(s_testArray[_currentUISceneId]); case kUILayoutTest: return UILayoutTest::sceneWithTitle(s_testArray[_currentUISceneId]); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index a730422203..4b9403172b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -59,6 +59,7 @@ enum kUITextFieldTest_Password, kUITextFieldTest_LineWrap, kUITextFieldTest_TrueTypeFont, + kUITextFieldTest_PlaceHolderColor, kUILayoutTest, kUILayoutTest_Color, kUILayoutTest_Gradient, diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 9f3b8485e6..7d3917246e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -407,3 +407,80 @@ void UITextFieldTest_TrueTypeFont::textFieldEvent(Ref *pSender, TextField::Event break; } } + +// UITextFieldTest_PlaceHolderColor +UITextFieldTest_PlaceHolderColor::UITextFieldTest_PlaceHolderColor() +: _displayValueLabel(nullptr) +{ + +} + +UITextFieldTest_PlaceHolderColor::~UITextFieldTest_PlaceHolderColor() +{ +} + +bool UITextFieldTest_PlaceHolderColor::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the textfield events will be displayed + _displayValueLabel = Text::create("Set place hold color","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.5f)); + _uiLayer->addChild(_displayValueLabel); + + // Add the alert + Text* alert = Text::create("TextField","fonts/Marker Felt.ttf",30); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 3.075f)); + _uiLayer->addChild(alert); + + // Create the textfield + TextField* textField = TextField::create("input words here","Arial",30); + textField->setPlaceHolder("input text here"); + textField->setPlaceHolderColor(Color4B::GREEN); + textField->setTextColor(Color4B::RED); + textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); + _uiLayer->addChild(textField); + return true; + } + return false; +} + +void UITextFieldTest_PlaceHolderColor::textFieldEvent(Ref *pSender, TextField::EventType type) +{ + switch (type) + { + case TextField::EventType::ATTACH_WITH_IME: + { + TextField* textField = dynamic_cast(pSender); + Size screenSize = CCDirector::getInstance()->getWinSize(); + textField->runAction(CCMoveTo::create(0.225f, + Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); + _displayValueLabel->setString(String::createWithFormat("attach with IME")->getCString()); + } + break; + + case TextField::EventType::DETACH_WITH_IME: + { + TextField* textField = dynamic_cast(pSender); + Size screenSize = CCDirector::getInstance()->getWinSize(); + textField->runAction(CCMoveTo::create(0.175f, Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f))); + _displayValueLabel->setString(String::createWithFormat("detach with IME")->getCString()); + } + break; + + case TextField::EventType::INSERT_TEXT: + _displayValueLabel->setString(String::createWithFormat("insert words")->getCString()); + break; + + case TextField::EventType::DELETE_BACKWARD: + _displayValueLabel->setString(String::createWithFormat("delete word")->getCString()); + break; + + default: + break; + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h index e44798cb7f..6c62bc14d2 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h @@ -91,4 +91,17 @@ protected: UI_SCENE_CREATE_FUNC(UITextFieldTest_TrueTypeFont) Text* _displayValueLabel; }; + +class UITextFieldTest_PlaceHolderColor : public UIScene +{ +public: + UITextFieldTest_PlaceHolderColor(); + ~UITextFieldTest_PlaceHolderColor(); + bool init(); + void textFieldEvent(Ref* pSender, TextField::EventType type); + +protected: + UI_SCENE_CREATE_FUNC(UITextFieldTest_PlaceHolderColor) + Text* _displayValueLabel; +}; #endif /* defined(__TestCpp__UITextFieldTest__) */ From 76329f9e5337f7b5d13be1b707167b45eb6dbd39 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Wed, 13 Aug 2014 12:06:51 +0800 Subject: [PATCH 044/147] add camera mask check to visit --- cocos/2d/CCClippingNode.cpp | 6 ++++-- cocos/2d/CCLabel.cpp | 2 +- cocos/2d/CCNode.cpp | 15 ++++++++++----- cocos/2d/CCNode.h | 3 +++ cocos/2d/CCNodeGrid.cpp | 6 ++++-- cocos/2d/CCParticleBatchNode.cpp | 2 +- cocos/2d/CCProtectedNode.cpp | 3 ++- cocos/2d/CCRenderTexture.cpp | 2 +- cocos/2d/CCSpriteBatchNode.cpp | 2 +- cocos/editor-support/cocostudio/CCArmature.cpp | 2 +- cocos/editor-support/cocostudio/CCBatchNode.cpp | 2 +- cocos/ui/UIScale9Sprite.cpp | 3 ++- extensions/GUI/CCScrollView/CCScrollView.cpp | 6 ++++-- 13 files changed, 35 insertions(+), 19 deletions(-) diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index fba3c00deb..53ed6797bb 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -261,6 +261,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32 renderer->addCommand(&_afterDrawStencilCmd); int i = 0; + bool visibleByCamera = checkCameraMask(); if(!_children.empty()) { @@ -276,12 +277,13 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32 break; } // self draw - this->draw(renderer, _modelViewTransform, flags); + if (visibleByCamera) + this->draw(renderer, _modelViewTransform, flags); for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) (*it)->visit(renderer, _modelViewTransform, flags); } - else + else if (visibleByCamera) { this->draw(renderer, _modelViewTransform, flags); } diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index ab0b98023c..d0242c1fc2 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1053,7 +1053,7 @@ void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags) void Label::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { - if (! _visible || _originalUTF8String.empty()) + if (! _visible || _originalUTF8String.empty() || !checkCameraMask()) { return; } diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index a83d9e0a3d..81290f2327 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1225,6 +1225,13 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl return flags; } +bool Node::checkCameraMask() const +{ + auto camera = Camera::getVisitingCamera(); + bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true; + return visibleByCamera; +} + void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. @@ -1242,8 +1249,7 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); - auto camera = Camera::getVisitingCamera(); - bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true; + bool visibleByCamera = checkCameraMask(); int i = 0; @@ -1267,10 +1273,9 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) (*it)->visit(renderer, _modelViewTransform, flags); } - else + else if (visibleByCamera) { - if (visibleByCamera) - this->draw(renderer, _modelViewTransform, flags); + this->draw(renderer, _modelViewTransform, flags); } director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index e907d06c1d..6d0f788104 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1521,6 +1521,9 @@ protected: bool doEnumerate(std::string name, std::function callback) const; bool doEnumerateRecursive(const Node* node, const std::string &name, std::function callback) const; + //check whether this camera mask is visible by the current visiting camera + bool checkCameraMask() const; + #if CC_USE_PHYSICS void updatePhysicsBodyTransform(Scene* layer); virtual void updatePhysicsBodyPosition(Scene* layer); diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index b2ed64a5c7..ee86daa2e4 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -126,6 +126,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p } int i = 0; + bool visibleByCamera = checkCameraMask(); if(!_children.empty()) { @@ -141,13 +142,14 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p break; } // self draw,currently we have nothing to draw on NodeGrid, so there is no need to add render command - this->draw(renderer, _modelViewTransform, dirty); + if (visibleByCamera) + this->draw(renderer, _modelViewTransform, dirty); for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) { (*it)->visit(renderer, _modelViewTransform, dirty); } } - else + else if (visibleByCamera) { this->draw(renderer, _modelViewTransform, dirty); } diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 72a0646284..eb24526f82 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -130,7 +130,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, u // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (!_visible) + if (!_visible || !checkCameraMask()) { return; } diff --git a/cocos/2d/CCProtectedNode.cpp b/cocos/2d/CCProtectedNode.cpp index de9bbc8bc0..5cf53729e6 100644 --- a/cocos/2d/CCProtectedNode.cpp +++ b/cocos/2d/CCProtectedNode.cpp @@ -318,7 +318,8 @@ void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint3 // // draw self // - this->draw(renderer, _modelViewTransform, flags); + if (checkCameraMask()) + this->draw(renderer, _modelViewTransform, flags); // // draw children and protectedChildren zOrder >= 0 diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 8a60335503..7cb4cf9e12 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -393,7 +393,7 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3 { // override visit. // Don't call visit on its children - if (!_visible) + if (!_visible || !checkCameraMask()) { return; } diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 201d335f3f..df68d82b26 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -147,7 +147,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uin // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (! _visible) + if (! _visible || !checkCameraMask()) { return; } diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 5a35a80c27..ed11c16734 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -467,7 +467,7 @@ void Armature::onExit() void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible) + if (!_visible || !checkCameraMask()) { return; } diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index f11e38affc..ab64329483 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -108,7 +108,7 @@ void BatchNode::removeChild(Node* child, bool cleanup) void BatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible) + if (!_visible || !checkCameraMask()) { return; } diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 4cabd4dad3..3d31885daa 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -774,7 +774,8 @@ y+=ytranslate; \ // // draw self // - this->draw(renderer, _modelViewTransform, flags); + if (checkCameraMask()) + this->draw(renderer, _modelViewTransform, flags); // // draw children and protectedChildren zOrder >= 0 diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 01abe5ca06..f864ba1a79 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -581,6 +581,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); this->beforeDraw(); + bool visibleByCamera = checkCameraMask(); if (!_children.empty()) { @@ -601,7 +602,8 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t } // this draw - this->draw(renderer, _modelViewTransform, flags); + if (visibleByCamera) + this->draw(renderer, _modelViewTransform, flags); // draw children zOrder >= 0 for( ; i < _children.size(); i++ ) @@ -611,7 +613,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t } } - else + else if (visibleByCamera) { this->draw(renderer, _modelViewTransform, flags); } From e766a22bda2661fbfd12f6e137739b4693c3c38a Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 13 Aug 2014 14:29:14 +0800 Subject: [PATCH 045/147] Adjust the lua templates for the lua modules. --- .../runtime-src/proj.android/build-cfg.json | 4 +-- .../runtime-src/proj.win32/HelloLua.vcxproj | 8 +++--- .../runtime-src/proj.win32/build-cfg.json | 6 +++- .../cocos-project-template.json | 21 ++++++++++++-- .../runtime-src/proj.android/build-cfg.json | 4 +-- .../runtime-src/proj.win32/HelloLua.vcxproj | 28 ++++++++++++------- .../runtime-src/proj.win32/build-cfg.json | 6 +++- 7 files changed, 54 insertions(+), 23 deletions(-) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json b/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json index 2a2f0182e0..6ef87e7940 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json @@ -15,11 +15,11 @@ "to": "res" }, { - "from": "../../../../cocos/scripting/lua-bindings/script/cocos2d", + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d", "to": "" }, { - "from": "../../../../cocos/scripting/lua-bindings/script/cocosdenshion", + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion", "to": "" } ] diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 007300f4b5..5762e3d1ec 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -109,8 +109,8 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden copy files - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + @@ -157,8 +157,8 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden copy files - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json b/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json index 48d47e369f..051f1647e3 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json @@ -9,7 +9,11 @@ "to": "res" }, { - "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script", + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d", + "to": "" + }, + { + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion", "to": "" } ] diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index fe5231abd3..bece211bc9 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -14,17 +14,32 @@ }, "append_dir": [ { - "from": "cocos/scripting/lua-bindings/script", + "from": "cocos/scripting/lua-bindings/script/cocos2d", "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", "exclude": [] }, { - "from": "cocos/scripting/lua-bindings/script", + "from": "cocos/scripting/lua-bindings/script/cocos2d", "to": "runtime/ios/PrebuiltRuntimeLua.app", "exclude": [] }, { - "from": "cocos/scripting/lua-bindings/script", + "from": "cocos/scripting/lua-bindings/script/cocos2d", + "to": "runtime/win32", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocosdenshion", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocosdenshion", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocosdenshion", "to": "runtime/win32", "exclude": [] }, diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json index 1872a20add..1d3aee4fa1 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json @@ -23,11 +23,11 @@ ], "must_copy_resources": [ { - "from": "../../../../cocos/scripting/lua-bindings/script/cocos2d", + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d", "to": "" }, { - "from": "../../../../cocos/scripting/lua-bindings/script/cocosdenshion", + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion", "to": "" }, { diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 2136c9badc..6bdeabdb2a 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -108,14 +108,14 @@ - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(ProjectDir)..\..\..\runtime\win32\" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\..\runtime\win32\" /e /Y + if not exist "$(LocalDebuggerWorkingDirectory)" mkdir "$(LocalDebuggerWorkingDirectory)" +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(LocalDebuggerWorkingDirectory)" /e /Y copy files - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + xcopy /Y /Q "$(OutDir)*.dll" "$(ProjectDir)..\..\..\runtime\win32\" @@ -162,14 +162,22 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(ProjectDir)..\..\..\runtime\win32\" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\..\runtime\win32\" /e /Y + if exist "$(LocalDebuggerWorkingDirectory)" rd /s /q "$(LocalDebuggerWorkingDirectory)" +mkdir "$(LocalDebuggerWorkingDirectory)" +mkdir "$(LocalDebuggerWorkingDirectory)\src" +mkdir "$(LocalDebuggerWorkingDirectory)\res" +xcopy "$(ProjectDir)..\..\..\src" "$(LocalDebuggerWorkingDirectory)\src" /e /Y +xcopy "$(ProjectDir)..\..\..\res" "$(LocalDebuggerWorkingDirectory)\res" /e /Y +copy "$(ProjectDir)..\..\..\config.json" "$(LocalDebuggerWorkingDirectory)\config.json" /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(LocalDebuggerWorkingDirectory)" /e /Y + copy files - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json index 37fecf9b02..add6413e4f 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json @@ -15,7 +15,11 @@ ], "must_copy_resources": [ { - "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script", + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d", + "to": "" + }, + { + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion", "to": "" }, { From df7c0ae1cb3635aec29828f950af8d8d74e30ec9 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 13 Aug 2014 06:42:14 +0000 Subject: [PATCH 046/147] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/PhysicsWorld.lua | 97 +- .../lua-bindings/auto/api/RenderTexture.lua | 5 +- .../lua-bindings/auto/api/Skeleton3D.lua | 51 + .../auto/api/lua_cocos2dx_auto_api.lua | 5 + .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 433 ++++++++ .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 9 + .../auto/lua_cocos2dx_physics_auto.cpp | 941 ++++++++++-------- .../auto/lua_cocos2dx_physics_auto.hpp | 3 + 8 files changed, 1100 insertions(+), 444 deletions(-) create mode 100644 cocos/scripting/lua-bindings/auto/api/Skeleton3D.lua diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua index df5c6d9783..6c16ea6dc4 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua @@ -4,9 +4,9 @@ -- @parent_module cc -------------------------------- --- @function [parent=#PhysicsWorld] getGravity +-- @function [parent=#PhysicsWorld] setGravity -- @param self --- @return vec2_table#vec2_table ret (return value: vec2_table) +-- @param #vec2_table vec2 -------------------------------- -- @function [parent=#PhysicsWorld] getAllBodies @@ -14,14 +14,28 @@ -- @return array_table#array_table ret (return value: array_table) -------------------------------- --- @function [parent=#PhysicsWorld] setGravity +-- @function [parent=#PhysicsWorld] getDebugDrawMask -- @param self --- @param #vec2_table vec2 +-- @return int#int ret (return value: int) -------------------------------- --- @function [parent=#PhysicsWorld] getSpeed +-- @function [parent=#PhysicsWorld] setAutoStep -- @param self --- @return float#float ret (return value: float) +-- @param #bool bool + +-------------------------------- +-- @function [parent=#PhysicsWorld] addJoint +-- @param self +-- @param #cc.PhysicsJoint physicsjoint + +-------------------------------- +-- @function [parent=#PhysicsWorld] removeAllJoints +-- @param self + +-------------------------------- +-- @function [parent=#PhysicsWorld] isAutoStep +-- @param self +-- @return bool#bool ret (return value: bool) -------------------------------- -- @overload self, int @@ -36,16 +50,6 @@ -- @param #cc.PhysicsJoint physicsjoint -- @param #bool bool --------------------------------- --- @function [parent=#PhysicsWorld] getUpdateRate --- @param self --- @return int#int ret (return value: int) - --------------------------------- --- @function [parent=#PhysicsWorld] setSpeed --- @param self --- @param #float float - -------------------------------- -- @function [parent=#PhysicsWorld] getShapes -- @param self @@ -53,8 +57,43 @@ -- @return array_table#array_table ret (return value: array_table) -------------------------------- --- @function [parent=#PhysicsWorld] removeAllJoints +-- @function [parent=#PhysicsWorld] step -- @param self +-- @param #float float + +-------------------------------- +-- @function [parent=#PhysicsWorld] setDebugDrawMask +-- @param self +-- @param #int int + +-------------------------------- +-- @function [parent=#PhysicsWorld] getGravity +-- @param self +-- @return vec2_table#vec2_table ret (return value: vec2_table) + +-------------------------------- +-- @function [parent=#PhysicsWorld] setUpdateRate +-- @param self +-- @param #int int + +-------------------------------- +-- @function [parent=#PhysicsWorld] getSpeed +-- @param self +-- @return float#float ret (return value: float) + +-------------------------------- +-- @function [parent=#PhysicsWorld] getUpdateRate +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#PhysicsWorld] removeAllBodies +-- @param self + +-------------------------------- +-- @function [parent=#PhysicsWorld] setSpeed +-- @param self +-- @param #float float -------------------------------- -- @function [parent=#PhysicsWorld] getShape @@ -62,34 +101,10 @@ -- @param #vec2_table vec2 -- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape) --------------------------------- --- @function [parent=#PhysicsWorld] removeAllBodies --- @param self - --------------------------------- --- @function [parent=#PhysicsWorld] getDebugDrawMask --- @param self --- @return int#int ret (return value: int) - --------------------------------- --- @function [parent=#PhysicsWorld] setDebugDrawMask --- @param self --- @param #int int - -------------------------------- -- @function [parent=#PhysicsWorld] getBody -- @param self -- @param #int int -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) --------------------------------- --- @function [parent=#PhysicsWorld] setUpdateRate --- @param self --- @param #int int - --------------------------------- --- @function [parent=#PhysicsWorld] addJoint --- @param self --- @param #cc.PhysicsJoint physicsjoint - return nil diff --git a/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua b/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua index 4717d8015e..661a25c17e 100644 --- a/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua +++ b/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua @@ -65,13 +65,14 @@ -- @param self -------------------------------- --- @overload self, string, int, bool --- @overload self, string, bool +-- @overload self, string, int, bool, function +-- @overload self, string, bool, function -- @function [parent=#RenderTexture] saveToFile -- @param self -- @param #string str -- @param #int format -- @param #bool bool +-- @param #function func -- @return bool#bool ret (retunr value: bool) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Skeleton3D.lua b/cocos/scripting/lua-bindings/auto/api/Skeleton3D.lua new file mode 100644 index 0000000000..ae57f8f9c1 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/Skeleton3D.lua @@ -0,0 +1,51 @@ + +-------------------------------- +-- @module Skeleton3D +-- @extend Ref +-- @parent_module cc + +-------------------------------- +-- @function [parent=#Skeleton3D] getBoneByName +-- @param self +-- @param #string str +-- @return Bone3D#Bone3D ret (return value: cc.Bone3D) + +-------------------------------- +-- @function [parent=#Skeleton3D] getRootBone +-- @param self +-- @return Bone3D#Bone3D ret (return value: cc.Bone3D) + +-------------------------------- +-- @function [parent=#Skeleton3D] updateBoneMatrix +-- @param self + +-------------------------------- +-- @function [parent=#Skeleton3D] getBoneByIndex +-- @param self +-- @param #unsigned int int +-- @return Bone3D#Bone3D ret (return value: cc.Bone3D) + +-------------------------------- +-- @function [parent=#Skeleton3D] setRootBone +-- @param self +-- @param #cc.Bone3D bone3d + +-------------------------------- +-- @function [parent=#Skeleton3D] getBoneIndex +-- @param self +-- @param #cc.Bone3D bone3d +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#Skeleton3D] getBoneCount +-- @param self +-- @return long#long ret (return value: long) + +-------------------------------- +-- @function [parent=#Skeleton3D] create +-- @param self +-- @param #string str +-- @param #string str +-- @return Skeleton3D#Skeleton3D ret (return value: cc.Skeleton3D) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index 2656af7e64..1a9c6ff721 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -1216,6 +1216,11 @@ -- @field [parent=#cc] Mesh#Mesh Mesh preloaded module +-------------------------------------------------------- +-- the cc Skeleton3D +-- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module + + -------------------------------------------------------- -- the cc Animation3D -- @field [parent=#cc] Animation3D#Animation3D Animation3D preloaded module diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index c54974c376..94bb320293 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -48198,6 +48198,34 @@ int lua_cocos2dx_RenderTexture_saveToFile(lua_State* tolua_S) } }while(0); ok = true; + do{ + if (argc == 4) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFile"); + + if (!ok) { break; } + cocos2d::Image::Format arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.RenderTexture:saveToFile"); + + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.RenderTexture:saveToFile"); + + if (!ok) { break; } + std::function &)> arg3; + do { + // Lambda binding for lua is not supported. + assert(false); + } while(0) + ; + + if (!ok) { break; } + bool ret = cobj->saveToFile(arg0, arg1, arg2, arg3); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; do{ if (argc == 1) { std::string arg0; @@ -48226,6 +48254,30 @@ int lua_cocos2dx_RenderTexture_saveToFile(lua_State* tolua_S) } }while(0); ok = true; + do{ + if (argc == 3) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFile"); + + if (!ok) { break; } + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFile"); + + if (!ok) { break; } + std::function &)> arg2; + do { + // Lambda binding for lua is not supported. + assert(false); + } while(0) + ; + + if (!ok) { break; } + bool ret = cobj->saveToFile(arg0, arg1, arg2); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.RenderTexture:saveToFile",argc, 1); return 0; @@ -64654,6 +64706,386 @@ int lua_register_cocos2dx_Mesh(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Skeleton3D_getBoneByName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneByName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByName"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getBoneByName(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneByName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_getRootBone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getRootBone'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getRootBone(); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootBone",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getRootBone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_updateBoneMatrix(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_updateBoneMatrix'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->updateBoneMatrix(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:updateBoneMatrix",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_updateBoneMatrix'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_getBoneByIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneByIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByIndex"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getBoneByIndex(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneByIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_setRootBone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_setRootBone'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Bone3D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + if(!ok) + return 0; + cobj->setRootBone(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:setRootBone",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_setRootBone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_getBoneIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Bone3D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + if(!ok) + return 0; + int ret = cobj->getBoneIndex(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_getBoneCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getBoneCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Skeleton3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 2) + { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Skeleton3D:create"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Skeleton3D:create"); + if(!ok) + return 0; + cocos2d::Skeleton3D* ret = cocos2d::Skeleton3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Skeleton3D:create",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_Skeleton3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Skeleton3D)"); + return 0; +} + +int lua_register_cocos2dx_Skeleton3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Skeleton3D"); + tolua_cclass(tolua_S,"Skeleton3D","cc.Skeleton3D","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Skeleton3D"); + tolua_function(tolua_S,"getBoneByName",lua_cocos2dx_Skeleton3D_getBoneByName); + tolua_function(tolua_S,"getRootBone",lua_cocos2dx_Skeleton3D_getRootBone); + tolua_function(tolua_S,"updateBoneMatrix",lua_cocos2dx_Skeleton3D_updateBoneMatrix); + tolua_function(tolua_S,"getBoneByIndex",lua_cocos2dx_Skeleton3D_getBoneByIndex); + tolua_function(tolua_S,"setRootBone",lua_cocos2dx_Skeleton3D_setRootBone); + tolua_function(tolua_S,"getBoneIndex",lua_cocos2dx_Skeleton3D_getBoneIndex); + tolua_function(tolua_S,"getBoneCount",lua_cocos2dx_Skeleton3D_getBoneCount); + tolua_function(tolua_S,"create", lua_cocos2dx_Skeleton3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Skeleton3D).name(); + g_luaType[typeName] = "cc.Skeleton3D"; + g_typeCast["Skeleton3D"] = "cc.Skeleton3D"; + return 1; +} + int lua_cocos2dx_Animation3D_getDuration(lua_State* tolua_S) { int argc = 0; @@ -65982,6 +66414,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EventFocus(tolua_S); lua_register_cocos2dx_EaseQuinticActionInOut(tolua_S); lua_register_cocos2dx_SpriteFrameCache(tolua_S); + lua_register_cocos2dx_Skeleton3D(tolua_S); lua_register_cocos2dx_TransitionCrossFade(tolua_S); lua_register_cocos2dx_Ripple3D(tolua_S); lua_register_cocos2dx_Lens3D(tolua_S); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index d0e6199af9..1673f167da 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1582,6 +1582,15 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp index c4b13b740f..1bedeb5d24 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp @@ -5435,7 +5435,7 @@ int lua_register_cocos2dx_physics_PhysicsBody(lua_State* tolua_S) return 1; } -int lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S) +int lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S) { int argc = 0; cocos2d::PhysicsWorld* cobj = nullptr; @@ -5455,26 +5455,28 @@ int lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getGravity'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setGravity'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) + if (argc == 1) { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.PhysicsWorld:setGravity"); if(!ok) return 0; - cocos2d::Vec2 ret = cobj->getGravity(); - vec2_to_luaval(tolua_S, ret); - return 1; + cobj->setGravity(arg0); + return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getGravity",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setGravity",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getGravity'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setGravity'.",&tolua_err); #endif return 0; @@ -5523,7 +5525,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getAllBodies(lua_State* tolua_S) return 0; } -int lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S) +int lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask(lua_State* tolua_S) { int argc = 0; cocos2d::PhysicsWorld* cobj = nullptr; @@ -5543,53 +5545,7 @@ int lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setGravity'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.PhysicsWorld:setGravity"); - if(!ok) - return 0; - cobj->setGravity(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setGravity",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setGravity'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_physics_PhysicsWorld_getSpeed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getSpeed'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask'", nullptr); return 0; } #endif @@ -5599,16 +5555,205 @@ int lua_cocos2dx_physics_PhysicsWorld_getSpeed(lua_State* tolua_S) { if(!ok) return 0; - double ret = cobj->getSpeed(); + int ret = cobj->getDebugDrawMask(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getSpeed",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getDebugDrawMask",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getSpeed'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_setAutoStep(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setAutoStep'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.PhysicsWorld:setAutoStep"); + if(!ok) + return 0; + cobj->setAutoStep(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setAutoStep",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setAutoStep'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_addJoint(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::PhysicsJoint* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0); + if(!ok) + return 0; + cobj->addJoint(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:addJoint",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_removeAllJoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllJoints'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->removeAllJoints(); + return 0; + } + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.PhysicsWorld:removeAllJoints"); + if(!ok) + return 0; + cobj->removeAllJoints(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:removeAllJoints",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllJoints'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_isAutoStep(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_isAutoStep'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isAutoStep(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:isAutoStep",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_isAutoStep'.",&tolua_err); #endif return 0; @@ -5725,96 +5870,6 @@ int lua_cocos2dx_physics_PhysicsWorld_removeJoint(lua_State* tolua_S) return 0; } -int lua_cocos2dx_physics_PhysicsWorld_getUpdateRate(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getUpdateRate'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = cobj->getUpdateRate(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getUpdateRate",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getUpdateRate'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_physics_PhysicsWorld_setSpeed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setSpeed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.PhysicsWorld:setSpeed"); - if(!ok) - return 0; - cobj->setSpeed(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setSpeed",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setSpeed'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_physics_PhysicsWorld_getShapes(lua_State* tolua_S) { int argc = 0; @@ -5862,7 +5917,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShapes(lua_State* tolua_S) return 0; } -int lua_cocos2dx_physics_PhysicsWorld_removeAllJoints(lua_State* tolua_S) +int lua_cocos2dx_physics_PhysicsWorld_step(lua_State* tolua_S) { int argc = 0; cocos2d::PhysicsWorld* cobj = nullptr; @@ -5882,7 +5937,99 @@ int lua_cocos2dx_physics_PhysicsWorld_removeAllJoints(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllJoints'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_step'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.PhysicsWorld:step"); + if(!ok) + return 0; + cobj->step(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:step",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_step'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.PhysicsWorld:setDebugDrawMask"); + if(!ok) + return 0; + cobj->setDebugDrawMask(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setDebugDrawMask",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getGravity'", nullptr); return 0; } #endif @@ -5892,25 +6039,239 @@ int lua_cocos2dx_physics_PhysicsWorld_removeAllJoints(lua_State* tolua_S) { if(!ok) return 0; - cobj->removeAllJoints(); - return 0; + cocos2d::Vec2 ret = cobj->getGravity(); + vec2_to_luaval(tolua_S, ret); + return 1; } - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.PhysicsWorld:removeAllJoints"); - if(!ok) - return 0; - cobj->removeAllJoints(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:removeAllJoints",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getGravity",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllJoints'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getGravity'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_setUpdateRate(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setUpdateRate'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.PhysicsWorld:setUpdateRate"); + if(!ok) + return 0; + cobj->setUpdateRate(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setUpdateRate",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setUpdateRate'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_getSpeed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getSpeed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getSpeed(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getSpeed",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getSpeed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_getUpdateRate(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getUpdateRate'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getUpdateRate(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getUpdateRate",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getUpdateRate'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_removeAllBodies(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllBodies'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->removeAllBodies(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:removeAllBodies",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllBodies'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_setSpeed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setSpeed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.PhysicsWorld:setSpeed"); + if(!ok) + return 0; + cobj->setSpeed(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setSpeed",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setSpeed'.",&tolua_err); #endif return 0; @@ -5962,139 +6323,6 @@ int lua_cocos2dx_physics_PhysicsWorld_getShape(lua_State* tolua_S) return 0; } -int lua_cocos2dx_physics_PhysicsWorld_removeAllBodies(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllBodies'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->removeAllBodies(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:removeAllBodies",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllBodies'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = cobj->getDebugDrawMask(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:getDebugDrawMask",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.PhysicsWorld:setDebugDrawMask"); - if(!ok) - return 0; - cobj->setDebugDrawMask(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setDebugDrawMask",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_physics_PhysicsWorld_getBody(lua_State* tolua_S) { int argc = 0; @@ -6142,98 +6370,6 @@ int lua_cocos2dx_physics_PhysicsWorld_getBody(lua_State* tolua_S) return 0; } -int lua_cocos2dx_physics_PhysicsWorld_setUpdateRate(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setUpdateRate'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.PhysicsWorld:setUpdateRate"); - if(!ok) - return 0; - cobj->setUpdateRate(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:setUpdateRate",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setUpdateRate'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_physics_PhysicsWorld_addJoint(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::PhysicsWorld* 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.PhysicsWorld",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::PhysicsJoint* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0); - if(!ok) - return 0; - cobj->addJoint(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsWorld:addJoint",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'.",&tolua_err); -#endif - - return 0; -} static int lua_cocos2dx_physics_PhysicsWorld_finalize(lua_State* tolua_S) { printf("luabindings: finalizing LUA object (PhysicsWorld)"); @@ -6246,23 +6382,26 @@ int lua_register_cocos2dx_physics_PhysicsWorld(lua_State* tolua_S) tolua_cclass(tolua_S,"PhysicsWorld","cc.PhysicsWorld","",nullptr); tolua_beginmodule(tolua_S,"PhysicsWorld"); - tolua_function(tolua_S,"getGravity",lua_cocos2dx_physics_PhysicsWorld_getGravity); - tolua_function(tolua_S,"getAllBodies",lua_cocos2dx_physics_PhysicsWorld_getAllBodies); tolua_function(tolua_S,"setGravity",lua_cocos2dx_physics_PhysicsWorld_setGravity); - tolua_function(tolua_S,"getSpeed",lua_cocos2dx_physics_PhysicsWorld_getSpeed); + tolua_function(tolua_S,"getAllBodies",lua_cocos2dx_physics_PhysicsWorld_getAllBodies); + tolua_function(tolua_S,"getDebugDrawMask",lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask); + tolua_function(tolua_S,"setAutoStep",lua_cocos2dx_physics_PhysicsWorld_setAutoStep); + tolua_function(tolua_S,"addJoint",lua_cocos2dx_physics_PhysicsWorld_addJoint); + tolua_function(tolua_S,"removeAllJoints",lua_cocos2dx_physics_PhysicsWorld_removeAllJoints); + tolua_function(tolua_S,"isAutoStep",lua_cocos2dx_physics_PhysicsWorld_isAutoStep); tolua_function(tolua_S,"removeBody",lua_cocos2dx_physics_PhysicsWorld_removeBody); tolua_function(tolua_S,"removeJoint",lua_cocos2dx_physics_PhysicsWorld_removeJoint); - tolua_function(tolua_S,"getUpdateRate",lua_cocos2dx_physics_PhysicsWorld_getUpdateRate); - tolua_function(tolua_S,"setSpeed",lua_cocos2dx_physics_PhysicsWorld_setSpeed); tolua_function(tolua_S,"getShapes",lua_cocos2dx_physics_PhysicsWorld_getShapes); - tolua_function(tolua_S,"removeAllJoints",lua_cocos2dx_physics_PhysicsWorld_removeAllJoints); - tolua_function(tolua_S,"getShape",lua_cocos2dx_physics_PhysicsWorld_getShape); - tolua_function(tolua_S,"removeAllBodies",lua_cocos2dx_physics_PhysicsWorld_removeAllBodies); - tolua_function(tolua_S,"getDebugDrawMask",lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask); + tolua_function(tolua_S,"step",lua_cocos2dx_physics_PhysicsWorld_step); tolua_function(tolua_S,"setDebugDrawMask",lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask); - tolua_function(tolua_S,"getBody",lua_cocos2dx_physics_PhysicsWorld_getBody); + tolua_function(tolua_S,"getGravity",lua_cocos2dx_physics_PhysicsWorld_getGravity); tolua_function(tolua_S,"setUpdateRate",lua_cocos2dx_physics_PhysicsWorld_setUpdateRate); - tolua_function(tolua_S,"addJoint",lua_cocos2dx_physics_PhysicsWorld_addJoint); + tolua_function(tolua_S,"getSpeed",lua_cocos2dx_physics_PhysicsWorld_getSpeed); + tolua_function(tolua_S,"getUpdateRate",lua_cocos2dx_physics_PhysicsWorld_getUpdateRate); + tolua_function(tolua_S,"removeAllBodies",lua_cocos2dx_physics_PhysicsWorld_removeAllBodies); + tolua_function(tolua_S,"setSpeed",lua_cocos2dx_physics_PhysicsWorld_setSpeed); + tolua_function(tolua_S,"getShape",lua_cocos2dx_physics_PhysicsWorld_getShape); + tolua_function(tolua_S,"getBody",lua_cocos2dx_physics_PhysicsWorld_getBody); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::PhysicsWorld).name(); g_luaType[typeName] = "cc.PhysicsWorld"; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp index 6ef0ca4ab5..42884debc5 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp @@ -259,6 +259,9 @@ int register_all_cocos2dx_physics(lua_State* tolua_S); + + + From b4ec344bcf004004b6aaccf48a869bb43b6b7d9b Mon Sep 17 00:00:00 2001 From: yangxiao Date: Wed, 13 Aug 2014 15:57:22 +0800 Subject: [PATCH 047/147] reset camera position in initDefault --- cocos/base/CCCamera.cpp | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/cocos/base/CCCamera.cpp b/cocos/base/CCCamera.cpp index 0c9cd3b234..6b3be0526d 100644 --- a/cocos/base/CCCamera.cpp +++ b/cocos/base/CCCamera.cpp @@ -33,30 +33,10 @@ Camera* Camera::_visitingCamera = nullptr; Camera* Camera::create() { - Camera* camera = nullptr; - auto size = Director::getInstance()->getWinSize(); - //create default camera - auto projection = Director::getInstance()->getProjection(); - switch (projection) - { - case Director::Projection::_2D: - { - camera = Camera::createOrthographic(size.width, size.height, -1024, 1024); - break; - } - case Director::Projection::_3D: - { - float zeye = Director::getInstance()->getZEye(); - camera = Camera::createPerspective(60, (GLfloat)size.width / size.height, 10, zeye + size.height / 2.0f); - Vec3 eye(size.width/2, size.height/2.0f, zeye), center(size.width/2, size.height/2, 0.0f), up(0.0f, 1.0f, 0.0f); - camera->setPosition3D(eye); - camera->lookAt(center, up); - break; - } - default: - CCLOG("unrecognized projection"); - break; - } + Camera* camera = new Camera(); + camera->initDefault(); + camera->autorelease(); + return camera; } @@ -187,6 +167,7 @@ bool Camera::initDefault() case Director::Projection::_2D: { initOrthographic(size.width, size.height, -1024, 1024); + setPosition3D(Vec3(0.0f, 0.0f, 0.0f)); break; } case Director::Projection::_3D: @@ -231,7 +212,7 @@ bool Camera::initOrthographic(float zoomX, float zoomY, float nearPlane, float f _zoom[1] = zoomY; _nearPlane = nearPlane; _farPlane = farPlane; - Mat4::createOrthographic(_zoom[0], _zoom[1], _nearPlane, _farPlane, &_projection); + Mat4::createOrthographicOffCenter(0, _zoom[0], 0, _zoom[1], _nearPlane, _farPlane, &_projection); #if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 //if needed, we need to add a rotation for Landscape orientations on Windows Phone 8 since it is always in Portrait Mode GLView* view = Director::getInstance()->getOpenGLView(); From 3ee6a9ab10b98df64a5184b8b45114c78178d269 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 13 Aug 2014 17:15:15 +0800 Subject: [PATCH 048/147] add missing safe guard in checkbox callback --- cocos/ui/UICheckBox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index 41fa4dfa7d..4854885df6 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -356,6 +356,7 @@ bool CheckBox::getSelectedState()const void CheckBox::selectedEvent() { + this->retain(); if (_checkBoxEventCallback) { _checkBoxEventCallback(this, EventType::SELECTED); @@ -365,10 +366,12 @@ void CheckBox::selectedEvent() { (_checkBoxEventListener->*_checkBoxEventSelector)(this,CHECKBOX_STATE_EVENT_SELECTED); } + this->release(); } void CheckBox::unSelectedEvent() { + this->retain(); if (_checkBoxEventCallback) { _checkBoxEventCallback(this, EventType::UNSELECTED); } @@ -376,6 +379,7 @@ void CheckBox::unSelectedEvent() { (_checkBoxEventListener->*_checkBoxEventSelector)(this,CHECKBOX_STATE_EVENT_UNSELECTED); } + this->release(); } void CheckBox::addEventListenerCheckBox(Ref *target, SEL_SelectedStateEvent selector) From 6ce3b5c20a1bc787f5a6ddf1a95e921da577fbb4 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Wed, 13 Aug 2014 17:38:16 +0800 Subject: [PATCH 049/147] add mirror test --- cocos/3d/CCSprite3D.cpp | 14 ++++ cocos/3d/CCSprite3D.h | 5 ++ cocos/renderer/CCMeshCommand.cpp | 38 ++++++++--- .../Classes/Sprite3DTest/Sprite3DTest.cpp | 65 ++++++++++++++++++- .../Classes/Sprite3DTest/Sprite3DTest.h | 16 +++++ 5 files changed, 127 insertions(+), 11 deletions(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 0bbc9ccd58..9f3abf342d 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -399,4 +399,18 @@ const BlendFunc& Sprite3D::getBlendFunc() const return _blend; } +void Sprite3D::setCullFace(GLenum cullFace) +{ + for (auto& it : _meshCommands) { + it.setCullFace(cullFace); + } +} + +void Sprite3D::setCullFaceEnabled(bool enable) +{ + for (auto& it : _meshCommands) { + it.setCullFaceEnabled(enable); + } +} + NS_CC_END diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 734f52c675..9e79ba37ab 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -79,6 +79,11 @@ public: // overrides virtual void setBlendFunc(const BlendFunc &blendFunc) override; virtual const BlendFunc &getBlendFunc() const override; + + // set which face is going to cull, GL_BACK, GL_FRONT, GL_FRONT_AND_BACK, default GL_BACK + void setCullFace(GLenum cullFace); + // set cull face enable or not + void setCullFaceEnabled(bool enable); CC_CONSTRUCTOR_ACCESS: diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index ad251cb9cc..8b69a7c3b0 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -41,6 +41,12 @@ NS_CC_BEGIN +//render state +static bool s_cullFaceEnabled = false; +static GLenum s_cullFace = 0; +static bool s_depthTestEnabled = false; +static bool s_depthWriteEnabled = false; + MeshCommand::MeshCommand() : _textureID(0) , _blendType(BlendFunc::DISABLE) @@ -86,7 +92,7 @@ void MeshCommand::init(float globalOrder, _primitive = primitive; _indexFormat = indexFormat; _indexCount = indexCount; - _mv = mv; + _mv.set(mv); } void MeshCommand::setCullFaceEnabled(bool enable) @@ -124,35 +130,46 @@ MeshCommand::~MeshCommand() void MeshCommand::applyRenderState() { - if (_cullFaceEnabled) + if (_cullFaceEnabled && !s_cullFaceEnabled) { glEnable(GL_CULL_FACE); - glCullFace(_cullFace); + if (s_cullFace != _cullFace) + { + glCullFace(_cullFace); + s_cullFace = _cullFace; + } + s_cullFaceEnabled = true; } - if (_depthTestEnabled) + if (_depthTestEnabled && !s_depthTestEnabled) { glEnable(GL_DEPTH_TEST); + s_depthTestEnabled = true; } - if (_depthWriteEnabled) + if (_depthWriteEnabled && !s_depthWriteEnabled) { glDepthMask(GL_TRUE); + s_depthWriteEnabled = true; } } void MeshCommand::restoreRenderState() { - if (_cullFaceEnabled) + if (s_cullFaceEnabled) { glDisable(GL_CULL_FACE); + s_cullFaceEnabled = false; } - if (_depthTestEnabled) + if (s_depthTestEnabled) { glDisable(GL_DEPTH_TEST); + s_depthTestEnabled = false; } - if (_depthWriteEnabled) + if (s_depthWriteEnabled) { glDepthMask(GL_FALSE); + s_depthWriteEnabled = false; } + s_cullFace = 0; } void MeshCommand::genMaterialID(GLuint texID, void* glProgramState, void* mesh, const BlendFunc& blend) @@ -177,8 +194,6 @@ void MeshCommand::MatrixPalleteCallBack( GLProgram* glProgram, Uniform* uniform) void MeshCommand::preBatchDraw() { - // set render state - applyRenderState(); // Set material GL::bindTexture2D(_textureID); GL::blendFunc(_blendType.src, _blendType.dst); @@ -198,6 +213,9 @@ void MeshCommand::preBatchDraw() } void MeshCommand::batchDraw() { + // set render state + applyRenderState(); + _glProgramState->setUniformVec4("u_color", _displayColor); if (_matrixPaletteSize && _matrixPalette) diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 7da0226345..345d402967 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -55,7 +55,8 @@ static std::function createFunctions[] = CL(Sprite3DWithSkinOutlineTest), #endif CL(Animate3DTest), - CL(AttachmentTest) + CL(AttachmentTest), + CL(Sprite3DMirrorTest) }; #define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) @@ -993,3 +994,65 @@ void AttachmentTest::onTouchesEnded(const std::vector& touches, Event* e } _hasWeapon = !_hasWeapon; } + +Sprite3DMirrorTest::Sprite3DMirrorTest() +: _sprite(nullptr) +, _mirrorSprite(nullptr) +{ + auto s = Director::getInstance()->getWinSize(); + addNewSpriteWithCoords( Vec2(s.width/2, s.height/2) ); +} +std::string Sprite3DMirrorTest::title() const +{ + return "Sprite3D Mirror Test"; +} +std::string Sprite3DMirrorTest::subtitle() const +{ + return ""; +} + +void Sprite3DMirrorTest::addNewSpriteWithCoords(Vec2 p) +{ + std::string fileName = "Sprite3DTest/orc.c3b"; + auto sprite = Sprite3D::create(fileName); + sprite->setScale(5); + sprite->setRotation3D(Vec3(0,180,0)); + addChild(sprite); + sprite->setPosition( Vec2( p.x - 80, p.y) ); + + //test attach + auto sp = Sprite3D::create("Sprite3DTest/axe.c3b"); + sprite->getAttachNode("Bip001 R Hand")->addChild(sp); + + auto animation = Animation3D::create(fileName); + if (animation) + { + auto animate = Animate3D::create(animation); + + sprite->runAction(RepeatForever::create(animate)); + } + _sprite = sprite; + _hasWeapon = true; + + //create mirror Sprite3D + sprite = Sprite3D::create(fileName); + sprite->setScale(5); + sprite->setScaleX(-5); + sprite->setCullFace(GL_FRONT); + sprite->setRotation3D(Vec3(0,180,0)); + addChild(sprite); + sprite->setPosition( Vec2( p.x + 80, p.y) ); + + //test attach + sp = Sprite3D::create("Sprite3DTest/axe.c3b"); + sprite->getAttachNode("Bip001 R Hand")->addChild(sp); + + animation = Animation3D::create(fileName); + if (animation) + { + auto animate = Animate3D::create(animation); + + sprite->runAction(RepeatForever::create(animate)); + } + _mirrorSprite = sprite; +} diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index 0d223fc8b5..e34b31067d 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -244,6 +244,22 @@ protected: cocos2d::Sprite3D* _sprite; }; +class Sprite3DMirrorTest : public Sprite3DTestDemo +{ +public: + CREATE_FUNC(Sprite3DMirrorTest); + Sprite3DMirrorTest(); + virtual std::string title() const override; + virtual std::string subtitle() const override; + + void addNewSpriteWithCoords(Vec2 p); + +protected: + bool _hasWeapon; + cocos2d::Sprite3D* _sprite; + cocos2d::Sprite3D* _mirrorSprite; +}; + class Sprite3DTestScene : public TestScene { public: From ff147b6cf85a91bda305b507766392b11b19a857 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 13 Aug 2014 18:40:35 +0800 Subject: [PATCH 050/147] close issue#5734:Label:The letters sometimes slightly cut. --- cocos/2d/CCFontFreeType.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 9e462e7bdf..6a4623d392 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -267,7 +267,7 @@ unsigned char* FontFreeType::getGlyphBitmap(unsigned short theChar, long &outWid } else { - if (FT_Load_Glyph(_fontRef,glyphIndex,FT_LOAD_RENDER)) + if (FT_Load_Glyph(_fontRef,glyphIndex,FT_LOAD_RENDER | FT_LOAD_NO_AUTOHINT)) break; } From 032f5ea7819b65a739d2bde4fa93fe8a9c21874e Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 14 Aug 2014 00:06:28 +0800 Subject: [PATCH 051/147] Adjust lua_debugger.h/c to lua runtime template and adjust related project configure --- .../lua-bindings/proj.android/Android.mk | 1 - .../project.pbxproj | 14 +- .../proj.win32/libluacocos2d.vcxproj | 2 - .../proj.win32/libluacocos2d.vcxproj.filters | 6 - extensions/proj.win32/libextension.vcxproj | 3 + .../frameworks/CMakeLists.txt | 2 - .../runtime-src/Classes/lua_module_register.h | 2 - .../runtime-src/proj.android/jni/Android.mk | 3 - .../runtime-src/proj.win32/HelloLua.sln | 12 -- .../runtime-src/proj.win32/HelloLua.vcxproj | 3 - .../cocos-project-template.json | 15 ++ .../runtime-src/Classes/lua_module_register.h | 2 + .../Classes/runtime}/lua_debugger.c | 0 .../Classes/runtime}/lua_debugger.h | 0 .../runtime-src/proj.android/build-cfg.json | 11 ++ .../runtime-src/proj.android/jni/Android.mk | 5 +- .../HelloLua.xcodeproj/project.pbxproj | 148 ++++++++++++------ .../runtime-src/proj.win32/HelloLua.sln | 6 + .../runtime-src/proj.win32/HelloLua.vcxproj | 23 ++- .../proj.win32/HelloLua.vcxproj.filters | 6 + .../runtime-src/proj.win32/build-cfg.json | 4 + .../project/proj.win32/lua-empty-test.vcxproj | 10 +- .../project/proj.android/jni/Android.mk | 2 - .../proj.win32/lua-tests.win32.vcxproj | 8 +- 24 files changed, 166 insertions(+), 122 deletions(-) rename {cocos/scripting/lua-bindings/manual => templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime}/lua_debugger.c (100%) rename {cocos/scripting/lua-bindings/manual => templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime}/lua_debugger.h (100%) diff --git a/cocos/scripting/lua-bindings/proj.android/Android.mk b/cocos/scripting/lua-bindings/proj.android/Android.mk index 1ffe8757e6..80c5b7e017 100644 --- a/cocos/scripting/lua-bindings/proj.android/Android.mk +++ b/cocos/scripting/lua-bindings/proj.android/Android.mk @@ -8,7 +8,6 @@ LOCAL_MODULE_FILENAME := libluacocos2d LOCAL_SRC_FILES := ../manual/CCLuaBridge.cpp \ ../manual/CCLuaEngine.cpp \ ../manual/CCLuaStack.cpp \ - ../manual/lua_debugger.c \ ../manual/CCLuaValue.cpp \ ../manual/Cocos2dxLuaLoader.cpp \ ../manual/LuaBasicConversions.cpp \ diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index cb302380eb..bc4b446080 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -150,10 +150,8 @@ 15C1C2E019874B8800A46ACC /* CCLuaValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE76618BC45C200215002 /* CCLuaValue.cpp */; }; 15C1C2E119874B8800A46ACC /* Cocos2dxLuaLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE76818BC45C200215002 /* Cocos2dxLuaLoader.cpp */; }; 15C1C2E219874BA100A46ACC /* LuaBasicConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE77E18BC45C200215002 /* LuaBasicConversions.cpp */; }; - 15C1C2E319874BEC00A46ACC /* lua_debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = C0FEF4D418BE0E70001F446C /* lua_debugger.c */; }; 15C1C2E419874C7C00A46ACC /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; }; 15C1C2E519874C9200A46ACC /* CCLuaObjcBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE78F18BC45C200215002 /* CCLuaObjcBridge.mm */; }; - 15C1C2E619874CBE00A46ACC /* lua_debugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0FEF4D518BE0E70001F446C /* lua_debugger.h */; }; 15C1C2E719874CBE00A46ACC /* CCLuaBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76118BC45C200215002 /* CCLuaBridge.h */; }; 15C1C2E819874CBE00A46ACC /* CCLuaEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76318BC45C200215002 /* CCLuaEngine.h */; }; 15C1C2E919874CBE00A46ACC /* CCLuaStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76518BC45C200215002 /* CCLuaStack.h */; }; @@ -250,7 +248,6 @@ 15EFA62E198B3220000C57D3 /* lua_cocos2dx_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15C1BCD81986525900A46ACC /* lua_cocos2dx_manual.hpp */; }; 15EFA62F198B3220000C57D3 /* lua_cocos2dx_physics_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15C1BCDA1986525900A46ACC /* lua_cocos2dx_physics_manual.hpp */; }; 15EFA630198B3220000C57D3 /* LuaScriptHandlerMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 15C1BCDC1986525900A46ACC /* LuaScriptHandlerMgr.h */; }; - 15EFA631198B328B000C57D3 /* lua_debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = C0FEF4D418BE0E70001F446C /* lua_debugger.c */; }; 15EFA632198B328B000C57D3 /* CCLuaBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE76018BC45C200215002 /* CCLuaBridge.cpp */; }; 15EFA633198B328B000C57D3 /* CCLuaEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE76218BC45C200215002 /* CCLuaEngine.cpp */; }; 15EFA634198B328B000C57D3 /* CCLuaStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE76418BC45C200215002 /* CCLuaStack.cpp */; }; @@ -259,7 +256,6 @@ 15EFA637198B328B000C57D3 /* LuaBasicConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE77E18BC45C200215002 /* LuaBasicConversions.cpp */; }; 15EFA638198B328B000C57D3 /* CCLuaObjcBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE78F18BC45C200215002 /* CCLuaObjcBridge.mm */; }; 15EFA639198B328B000C57D3 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; }; - 15EFA63A198B32BB000C57D3 /* lua_debugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0FEF4D518BE0E70001F446C /* lua_debugger.h */; }; 15EFA63B198B32BB000C57D3 /* CCLuaBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76118BC45C200215002 /* CCLuaBridge.h */; }; 15EFA63C198B32BB000C57D3 /* CCLuaEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76318BC45C200215002 /* CCLuaEngine.h */; }; 15EFA63D198B32BB000C57D3 /* CCLuaStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76518BC45C200215002 /* CCLuaStack.h */; }; @@ -541,8 +537,6 @@ 2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_ui_auto.cpp; sourceTree = ""; }; 2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_ui_auto.hpp; sourceTree = ""; }; C0D9BAFA1974D30000EC35BB /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../../../external/lua/lua/prebuilt/ios/liblua.a; sourceTree = ""; }; - C0FEF4D418BE0E70001F446C /* lua_debugger.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lua_debugger.c; sourceTree = ""; }; - C0FEF4D518BE0E70001F446C /* lua_debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_debugger.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -833,8 +827,6 @@ 15C1BD141986526C00A46ACC /* spine */, 15C1BD191986526C00A46ACC /* ui */, 15C1BCD21986525900A46ACC /* cocos2d */, - C0FEF4D418BE0E70001F446C /* lua_debugger.c */, - C0FEF4D518BE0E70001F446C /* lua_debugger.h */, 1AACE76018BC45C200215002 /* CCLuaBridge.cpp */, 1AACE76118BC45C200215002 /* CCLuaBridge.h */, 1AACE76218BC45C200215002 /* CCLuaEngine.cpp */, @@ -1082,7 +1074,6 @@ 15AC69DF1987711400D17520 /* lua.h in Headers */, 15AC69E01987711400D17520 /* luaconf.h in Headers */, 15AC69E11987711400D17520 /* lualib.h in Headers */, - 15C1C2E619874CBE00A46ACC /* lua_debugger.h in Headers */, 15C1C2E719874CBE00A46ACC /* CCLuaBridge.h in Headers */, 15C1C2E819874CBE00A46ACC /* CCLuaEngine.h in Headers */, 15C1C2E919874CBE00A46ACC /* CCLuaStack.h in Headers */, @@ -1189,7 +1180,6 @@ 15EFA64B198B3320000C57D3 /* tolua_event.h in Headers */, 15EFA64C198B3320000C57D3 /* tolua++.h in Headers */, 15EFA644198B32D5000C57D3 /* xxtea.h in Headers */, - 15EFA63A198B32BB000C57D3 /* lua_debugger.h in Headers */, 15EFA63B198B32BB000C57D3 /* CCLuaBridge.h in Headers */, 15EFA63C198B32BB000C57D3 /* CCLuaEngine.h in Headers */, 15EFA63D198B32BB000C57D3 /* CCLuaStack.h in Headers */, @@ -1633,7 +1623,6 @@ 15AC69DD1987710400D17520 /* tolua_to.c in Sources */, 15C1C2E519874C9200A46ACC /* CCLuaObjcBridge.mm in Sources */, 15C1C2E419874C7C00A46ACC /* tolua_fix.cpp in Sources */, - 15C1C2E319874BEC00A46ACC /* lua_debugger.c in Sources */, 15C1C2E219874BA100A46ACC /* LuaBasicConversions.cpp in Sources */, 15C1C2DD19874B8800A46ACC /* CCLuaBridge.cpp in Sources */, 15C1C2DE19874B8800A46ACC /* CCLuaEngine.cpp in Sources */, @@ -1738,7 +1727,6 @@ 15EFA649198B3311000C57D3 /* tolua_push.c in Sources */, 15EFA64A198B3311000C57D3 /* tolua_to.c in Sources */, 15EFA645198B32DB000C57D3 /* xxtea.cpp in Sources */, - 15EFA631198B328B000C57D3 /* lua_debugger.c in Sources */, 15EFA632198B328B000C57D3 /* CCLuaBridge.cpp in Sources */, 15EFA633198B328B000C57D3 /* CCLuaEngine.cpp in Sources */, 15EFA634198B328B000C57D3 /* CCLuaStack.cpp in Sources */, @@ -2772,6 +2760,7 @@ 15D1F2AE1994B2AD00302043 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 15D1F2C11994B2DA00302043 /* Build configuration list for PBXAggregateTarget "build all lualibs iOS" */ = { isa = XCConfigurationList; @@ -2780,6 +2769,7 @@ 15D1F2C31994B2DA00302043 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 15EFA2F6198B2791000C57D3 /* Build configuration list for PBXNativeTarget "libluacocosbuilder iOS" */ = { isa = XCConfigurationList; diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj index f5369027dd..cfccfeb76e 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj @@ -32,7 +32,6 @@ - @@ -58,7 +57,6 @@ - diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters index a777b58f12..6d63a2b301 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters @@ -63,9 +63,6 @@ manual - - manual - manual @@ -137,9 +134,6 @@ manual - - manual - manual diff --git a/extensions/proj.win32/libextension.vcxproj b/extensions/proj.win32/libextension.vcxproj index 067f36876f..a1023d1184 100644 --- a/extensions/proj.win32/libextension.vcxproj +++ b/extensions/proj.win32/libextension.vcxproj @@ -166,6 +166,9 @@ {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + {929480e7-23c0-4df6-8456-096d71547116} + diff --git a/templates/lua-template-default/frameworks/CMakeLists.txt b/templates/lua-template-default/frameworks/CMakeLists.txt index 14387ae6c6..34fc012279 100644 --- a/templates/lua-template-default/frameworks/CMakeLists.txt +++ b/templates/lua-template-default/frameworks/CMakeLists.txt @@ -159,10 +159,8 @@ endif() target_link_libraries(${APP_NAME} luacocos2d luacocosdenshion - luanetwork audio cocos2d - network xxtea ) diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h index c0293bc273..1654f34659 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h @@ -1,13 +1,11 @@ #ifndef __LUA_TEMPLATE_DEFAULT_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ #define __LUA_TEMPLATE_DEFAULT_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ -#include "network/lua_cocos2dx_network_manual.h" #include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" int lua_module_register(lua_State* L) { - register_network_module(L); register_cocosdenshion_module(L); return 1; } diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk index 7ff0c8f8d6..d9effcb7d3 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk @@ -12,11 +12,8 @@ LOCAL_SRC_FILES := hellolua/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_STATIC_LIBRARIES := curl_static_prebuilt - LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln index aad64775de..f1ccf5faa2 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -10,8 +10,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua.vcxpro EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\cocos2d-x\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\..\cocos2d-x\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\..\cocos2d-x\cocos\audio\proj.win32\libcocosdenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\cocos2d-x\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" @@ -20,8 +18,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\..\coco EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosdenshion", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocosdenshion.vcxproj", "{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluanetwork", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluanetwork.vcxproj", "{65E52F4B-703F-419E-AD67-926241A10042}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -36,10 +32,6 @@ Global {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32 - {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.ActiveCfg = Debug|Win32 - {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.Build.0 = Debug|Win32 - {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.ActiveCfg = Release|Win32 - {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.Build.0 = Release|Win32 {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32 {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32 {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32 @@ -56,10 +48,6 @@ Global {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Debug|Win32.Build.0 = Debug|Win32 {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.ActiveCfg = Release|Win32 {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.Build.0 = Release|Win32 - {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.ActiveCfg = Debug|Win32 - {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.Build.0 = Debug|Win32 - {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.ActiveCfg = Release|Win32 - {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 5762e3d1ec..9c84dea7b0 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -183,9 +183,6 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden {46a7d57a-7f25-4f52-823b-ffac4ff3a624} - - {65e52f4b-703f-419e-ad67-926241a10042} - diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index bece211bc9..e95ce981ec 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -43,6 +43,21 @@ "to": "runtime/win32", "exclude": [] }, + { + "from": "cocos/scripting/lua-bindings/script/network", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/network", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/network", + "to": "runtime/win32", + "exclude": [] + }, { "from": "external/lua/luasocket", "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h index e9c4a85bae..1ce4720324 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h @@ -1,11 +1,13 @@ #ifndef __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ #define __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ +#include "network/lua_cocos2dx_network_manual.h" #include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" int lua_module_register(lua_State* L) { + register_network_module(L); register_cocosdenshion_module(L); return 1; } diff --git a/cocos/scripting/lua-bindings/manual/lua_debugger.c b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.c similarity index 100% rename from cocos/scripting/lua-bindings/manual/lua_debugger.c rename to templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.c diff --git a/cocos/scripting/lua-bindings/manual/lua_debugger.h b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.h similarity index 100% rename from cocos/scripting/lua-bindings/manual/lua_debugger.h rename to templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.h diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json index 1d3aee4fa1..5ab381991f 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json @@ -30,6 +30,17 @@ "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion", "to": "" }, + { + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/network", + "to": "" + }, + { + "from": "../../cocos2d-x/external/lua/luasocket", + "to": "", + "include": [ + "*.lua" + ] + }, { "from": "../../../config.json", "to": "" diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk index 5b7c835906..e6225d828d 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk @@ -26,6 +26,7 @@ LOCAL_SRC_FILES := \ ../../Classes/runtime/Shine_png.cpp \ ../../Classes/runtime/Runtime.cpp \ ../../Classes/runtime/Protos.pb.cc \ +../../Classes/runtime/lua_debugger.c \ ../../Classes/VisibleRect.cpp \ ../../Classes/AppDelegate.cpp \ ../../Classes/ConfigParser.cpp \ @@ -39,11 +40,9 @@ $(LOCAL_PATH)/../../Classes/runtime \ $(LOCAL_PATH)/../../Classes \ $(LOCAL_PATH)/../../../cocos2d-x/external -LOCAL_STATIC_LIBRARIES := curl_static_prebuilt - LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static +LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 95c3eb54e2..9aa6943f6b 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -19,6 +19,38 @@ 15427CF0198F24C400DC375D /* libnetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C98198F220600DC375D /* libnetwork Mac.a */; }; 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; + 15AA7D36199B513100725633 /* libluanetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CCE198F220600DC375D /* libluanetwork iOS.a */; }; + 15AA7D47199B514300725633 /* libluanetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CBE198F220600DC375D /* libluanetwork Mac.a */; }; + 15AA7D52199B51F000725633 /* ftp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D48199B51F000725633 /* ftp.lua */; }; + 15AA7D53199B51F000725633 /* ftp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D48199B51F000725633 /* ftp.lua */; }; + 15AA7D54199B51F000725633 /* headers.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D49199B51F000725633 /* headers.lua */; }; + 15AA7D55199B51F000725633 /* headers.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D49199B51F000725633 /* headers.lua */; }; + 15AA7D56199B51F000725633 /* http.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4A199B51F000725633 /* http.lua */; }; + 15AA7D57199B51F000725633 /* http.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4A199B51F000725633 /* http.lua */; }; + 15AA7D58199B51F000725633 /* ltn12.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4B199B51F000725633 /* ltn12.lua */; }; + 15AA7D59199B51F000725633 /* ltn12.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4B199B51F000725633 /* ltn12.lua */; }; + 15AA7D5A199B51F000725633 /* mbox.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4C199B51F000725633 /* mbox.lua */; }; + 15AA7D5B199B51F000725633 /* mbox.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4C199B51F000725633 /* mbox.lua */; }; + 15AA7D5C199B51F000725633 /* mime.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4D199B51F000725633 /* mime.lua */; }; + 15AA7D5D199B51F000725633 /* mime.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4D199B51F000725633 /* mime.lua */; }; + 15AA7D5E199B51F000725633 /* smtp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4E199B51F000725633 /* smtp.lua */; }; + 15AA7D5F199B51F000725633 /* smtp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4E199B51F000725633 /* smtp.lua */; }; + 15AA7D60199B51F000725633 /* socket.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4F199B51F000725633 /* socket.lua */; }; + 15AA7D61199B51F000725633 /* socket.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D4F199B51F000725633 /* socket.lua */; }; + 15AA7D62199B51F000725633 /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D50199B51F000725633 /* tp.lua */; }; + 15AA7D63199B51F000725633 /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D50199B51F000725633 /* tp.lua */; }; + 15AA7D64199B51F000725633 /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D51199B51F000725633 /* url.lua */; }; + 15AA7D65199B51F000725633 /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA7D51199B51F000725633 /* url.lua */; }; + 15AA9632199B525400725633 /* DeprecatedNetworkClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA962E199B525400725633 /* DeprecatedNetworkClass.lua */; }; + 15AA9633199B525400725633 /* DeprecatedNetworkClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA962E199B525400725633 /* DeprecatedNetworkClass.lua */; }; + 15AA9634199B525400725633 /* DeprecatedNetworkEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA962F199B525400725633 /* DeprecatedNetworkEnum.lua */; }; + 15AA9635199B525400725633 /* DeprecatedNetworkEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA962F199B525400725633 /* DeprecatedNetworkEnum.lua */; }; + 15AA9636199B525400725633 /* DeprecatedNetworkFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA9630199B525400725633 /* DeprecatedNetworkFunc.lua */; }; + 15AA9637199B525400725633 /* DeprecatedNetworkFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA9630199B525400725633 /* DeprecatedNetworkFunc.lua */; }; + 15AA9638199B525400725633 /* NetworkConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA9631199B525400725633 /* NetworkConstants.lua */; }; + 15AA9639199B525400725633 /* NetworkConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AA9631199B525400725633 /* NetworkConstants.lua */; }; + 15AA9648199B6D4600725633 /* lua_debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AA9646199B6D4600725633 /* lua_debugger.c */; }; + 15AA9649199B6D4600725633 /* lua_debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AA9646199B6D4600725633 /* lua_debugger.c */; }; 15D1FDF81998714100302043 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FDEA1998714100302043 /* bitExtend.lua */; }; 15D1FDF91998714100302043 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FDEA1998714100302043 /* bitExtend.lua */; }; 15D1FDFA1998714100302043 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FDEB1998714100302043 /* Cocos2d.lua */; }; @@ -333,20 +365,6 @@ remoteGlobalIDString = 15EFA616198B2DAA000C57D3; remoteInfo = "libluacocos2d iOS"; }; - 15427CDB198F223300DC375D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 15EFA523198B2D13000C57D3; - remoteInfo = "libluacocosdenshion iOS"; - }; - 15427CDD198F223300DC375D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 15EFA59E198B2DAA000C57D3; - remoteInfo = "libluacocos2d iOS"; - }; 15427CE4198F23B300DC375D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; @@ -361,20 +379,6 @@ remoteGlobalIDString = B2DB498D197686CB00411E16; remoteInfo = "libnetwork Mac"; }; - 15427CE8198F244500DC375D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 15C1C255198748D200A46ACC; - remoteInfo = "libluacocos2d Mac"; - }; - 15427CEA198F246A00DC375D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 15C1BEEE19865A0600A46ACC; - remoteInfo = "libluacocosdenshion Mac"; - }; 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; @@ -479,6 +483,22 @@ 15427CE2198F237300DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_module_register.h; path = ../Classes/lua_module_register.h; sourceTree = ""; }; 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = ""; }; 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; + 15AA7D48199B51F000725633 /* ftp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ftp.lua; path = "../../cocos2d-x/external/lua/luasocket/ftp.lua"; sourceTree = ""; }; + 15AA7D49199B51F000725633 /* headers.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = headers.lua; path = "../../cocos2d-x/external/lua/luasocket/headers.lua"; sourceTree = ""; }; + 15AA7D4A199B51F000725633 /* http.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = http.lua; path = "../../cocos2d-x/external/lua/luasocket/http.lua"; sourceTree = ""; }; + 15AA7D4B199B51F000725633 /* ltn12.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ltn12.lua; path = "../../cocos2d-x/external/lua/luasocket/ltn12.lua"; sourceTree = ""; }; + 15AA7D4C199B51F000725633 /* mbox.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mbox.lua; path = "../../cocos2d-x/external/lua/luasocket/mbox.lua"; sourceTree = ""; }; + 15AA7D4D199B51F000725633 /* mime.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mime.lua; path = "../../cocos2d-x/external/lua/luasocket/mime.lua"; sourceTree = ""; }; + 15AA7D4E199B51F000725633 /* smtp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = smtp.lua; path = "../../cocos2d-x/external/lua/luasocket/smtp.lua"; sourceTree = ""; }; + 15AA7D4F199B51F000725633 /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = "../../cocos2d-x/external/lua/luasocket/socket.lua"; sourceTree = ""; }; + 15AA7D50199B51F000725633 /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = "../../cocos2d-x/external/lua/luasocket/tp.lua"; sourceTree = ""; }; + 15AA7D51199B51F000725633 /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = "../../cocos2d-x/external/lua/luasocket/url.lua"; sourceTree = ""; }; + 15AA962E199B525400725633 /* DeprecatedNetworkClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua"; sourceTree = ""; }; + 15AA962F199B525400725633 /* DeprecatedNetworkEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua"; sourceTree = ""; }; + 15AA9630199B525400725633 /* DeprecatedNetworkFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua"; sourceTree = ""; }; + 15AA9631199B525400725633 /* NetworkConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/NetworkConstants.lua"; sourceTree = ""; }; + 15AA9646199B6D4600725633 /* lua_debugger.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lua_debugger.c; sourceTree = ""; }; + 15AA9647199B6D4600725633 /* lua_debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_debugger.h; sourceTree = ""; }; 15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "../../cocos2d-x/cocos2dx/platform/third_party/ios/libraries/libcurl.a"; sourceTree = ""; }; 15D1FDEA1998714100302043 /* bitExtend.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = bitExtend.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua"; sourceTree = ""; }; 15D1FDEB1998714100302043 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua"; sourceTree = ""; }; @@ -611,6 +631,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AA7D47199B514300725633 /* libluanetwork Mac.a in Frameworks */, 15427CF0198F24C400DC375D /* libnetwork Mac.a in Frameworks */, 15427CEF198F24BD00DC375D /* libcocosdenshion Mac.a in Frameworks */, 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */, @@ -634,6 +655,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AA7D36199B513100725633 /* libluanetwork iOS.a in Frameworks */, 15427CE3198F23A100DC375D /* libnetwork iOS.a in Frameworks */, 15427CD5198F222200DC375D /* libluacocos2d iOS.a in Frameworks */, 15427CD6198F222200DC375D /* libluacocosdenshion iOS.a in Frameworks */, @@ -686,6 +708,20 @@ 1A0227A417A3AA1A00B867AD /* Lua Common */ = { isa = PBXGroup; children = ( + 15AA962E199B525400725633 /* DeprecatedNetworkClass.lua */, + 15AA962F199B525400725633 /* DeprecatedNetworkEnum.lua */, + 15AA9630199B525400725633 /* DeprecatedNetworkFunc.lua */, + 15AA9631199B525400725633 /* NetworkConstants.lua */, + 15AA7D48199B51F000725633 /* ftp.lua */, + 15AA7D49199B51F000725633 /* headers.lua */, + 15AA7D4A199B51F000725633 /* http.lua */, + 15AA7D4B199B51F000725633 /* ltn12.lua */, + 15AA7D4C199B51F000725633 /* mbox.lua */, + 15AA7D4D199B51F000725633 /* mime.lua */, + 15AA7D4E199B51F000725633 /* smtp.lua */, + 15AA7D4F199B51F000725633 /* socket.lua */, + 15AA7D50199B51F000725633 /* tp.lua */, + 15AA7D51199B51F000725633 /* url.lua */, 15D1FE141998715500302043 /* AudioEngine.lua */, 15D1FE151998715500302043 /* DeprecatedCocosDenshionClass.lua */, 15D1FE161998715500302043 /* DeprecatedCocosDenshionFunc.lua */, @@ -839,6 +875,8 @@ C00FD4891938512100C6382D /* runtime */ = { isa = PBXGroup; children = ( + 15AA9646199B6D4600725633 /* lua_debugger.c */, + 15AA9647199B6D4600725633 /* lua_debugger.h */, 3EB5152E1952865D006966AA /* protobuf-lite */, 3EB5152A19528284006966AA /* Protos.pb.cc */, 3EB5152B19528284006966AA /* Protos.pb.h */, @@ -970,8 +1008,6 @@ buildRules = ( ); dependencies = ( - 15427CEB198F246A00DC375D /* PBXTargetDependency */, - 15427CE9198F244500DC375D /* PBXTargetDependency */, 15427CE7198F23E600DC375D /* PBXTargetDependency */, C0A2F04118975FF80072A7AB /* PBXTargetDependency */, C0A2F03D18975FEB0072A7AB /* PBXTargetDependency */, @@ -996,8 +1032,6 @@ 15D1F30B1994BBE500302043 /* PBXTargetDependency */, 15D1F3091994BBCA00302043 /* PBXTargetDependency */, 15427CE5198F23B300DC375D /* PBXTargetDependency */, - 15427CDC198F223300DC375D /* PBXTargetDependency */, - 15427CDE198F223300DC375D /* PBXTargetDependency */, ); name = "HelloLua iOS"; productName = HelloLua; @@ -1305,6 +1339,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15AA7D5F199B51F000725633 /* smtp.lua in Resources */, + 15AA7D63199B51F000725633 /* tp.lua in Resources */, + 15AA7D5D199B51F000725633 /* mime.lua in Resources */, + 15AA9635199B525400725633 /* DeprecatedNetworkEnum.lua in Resources */, C03781BA18BF655400FE4F13 /* res in Resources */, 15D1FE131998714100302043 /* OpenglConstants.lua in Resources */, 15D1FE071998714100302043 /* DrawPrimitives.lua in Resources */, @@ -1312,21 +1350,31 @@ 15D1FE111998714100302043 /* Opengl.lua in Resources */, C07828F918B4D72E00BD2287 /* MainMenu.xib in Resources */, 15D1FE0D1998714100302043 /* luaj.lua in Resources */, + 15AA7D65199B51F000725633 /* url.lua in Resources */, + 15AA7D5B199B51F000725633 /* mbox.lua in Resources */, 15D1FE051998714100302043 /* DeprecatedOpenglEnum.lua in Resources */, 5023817617EBBE3400990C9B /* Icon.icns in Resources */, 15D1FE031998714100302043 /* DeprecatedCocos2dFunc.lua in Resources */, + 15AA7D59199B51F000725633 /* ltn12.lua in Resources */, 15D1FDFF1998714100302043 /* DeprecatedCocos2dClass.lua in Resources */, + 15AA7D53199B51F000725633 /* ftp.lua in Resources */, 15D1FE1C1998715500302043 /* DeprecatedCocosDenshionFunc.lua in Resources */, 15D1FDF91998714100302043 /* bitExtend.lua in Resources */, 15D1FE011998714100302043 /* DeprecatedCocos2dEnum.lua in Resources */, 15D1FE0B1998714100302043 /* json.lua in Resources */, + 15AA9639199B525400725633 /* NetworkConstants.lua in Resources */, 15D1FE091998714100302043 /* extern.lua in Resources */, + 15AA7D61199B51F000725633 /* socket.lua in Resources */, + 15AA9637199B525400725633 /* DeprecatedNetworkFunc.lua in Resources */, 15D1FE1A1998715500302043 /* DeprecatedCocosDenshionClass.lua in Resources */, C05D1C131923449100B808A4 /* config.json in Resources */, + 15AA9633199B525400725633 /* DeprecatedNetworkClass.lua in Resources */, 15D1FE0F1998714100302043 /* luaoc.lua in Resources */, + 15AA7D57199B51F000725633 /* http.lua in Resources */, 15D1FDFD1998714100302043 /* Cocos2dConstants.lua in Resources */, 15D1FDFB1998714100302043 /* Cocos2d.lua in Resources */, 15D1FE181998715500302043 /* AudioEngine.lua in Resources */, + 15AA7D55199B51F000725633 /* headers.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1335,13 +1383,19 @@ buildActionMask = 2147483647; files = ( 15D1FDF81998714100302043 /* bitExtend.lua in Resources */, + 15AA7D52199B51F000725633 /* ftp.lua in Resources */, + 15AA7D58199B51F000725633 /* ltn12.lua in Resources */, + 15AA7D5A199B51F000725633 /* mbox.lua in Resources */, 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */, 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */, 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */, + 15AA7D54199B51F000725633 /* headers.lua in Resources */, 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */, 15D1FDFE1998714100302043 /* DeprecatedCocos2dClass.lua in Resources */, 5091733617ECE17A00D62437 /* Icon-29.png in Resources */, + 15AA7D60199B51F000725633 /* socket.lua in Resources */, 15D1FE061998714100302043 /* DrawPrimitives.lua in Resources */, + 15AA7D56199B51F000725633 /* http.lua in Resources */, 15D1FE191998715500302043 /* DeprecatedCocosDenshionClass.lua in Resources */, 15D1FDFA1998714100302043 /* Cocos2d.lua in Resources */, 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */, @@ -1353,20 +1407,28 @@ 5023812017EBBCAC00990C9B /* Icon-57.png in Resources */, 15D1FE001998714100302043 /* DeprecatedCocos2dEnum.lua in Resources */, C03781B918BF655400FE4F13 /* res in Resources */, + 15AA9634199B525400725633 /* DeprecatedNetworkEnum.lua in Resources */, 15D1FE1B1998715500302043 /* DeprecatedCocosDenshionFunc.lua in Resources */, 5023812217EBBCAC00990C9B /* Icon-76.png in Resources */, 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */, 15D1FE0A1998714100302043 /* json.lua in Resources */, + 15AA7D5C199B51F000725633 /* mime.lua in Resources */, 15D1FE041998714100302043 /* DeprecatedOpenglEnum.lua in Resources */, 5091733717ECE17A00D62437 /* Icon-40.png in Resources */, 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */, 5023811A17EBBCAC00990C9B /* Default.png in Resources */, + 15AA7D5E199B51F000725633 /* smtp.lua in Resources */, + 15AA9632199B525400725633 /* DeprecatedNetworkClass.lua in Resources */, 15D1FE171998715500302043 /* AudioEngine.lua in Resources */, C03781BB18BF655400FE4F13 /* src in Resources */, + 15AA9636199B525400725633 /* DeprecatedNetworkFunc.lua in Resources */, 5091733817ECE17A00D62437 /* Icon-50.png in Resources */, 15D1FE081998714100302043 /* extern.lua in Resources */, 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */, + 15AA7D62199B51F000725633 /* tp.lua in Resources */, 15D1FDFC1998714100302043 /* Cocos2dConstants.lua in Resources */, + 15AA9638199B525400725633 /* NetworkConstants.lua in Resources */, + 15AA7D64199B51F000725633 /* url.lua in Resources */, C05D1C121923449100B808A4 /* config.json in Resources */, 15D1FE0E1998714100302043 /* luaoc.lua in Resources */, 15D1FE101998714100302043 /* Opengl.lua in Resources */, @@ -1416,6 +1478,7 @@ C033B51D191B337200D06937 /* VisibleRect.cpp in Sources */, C00FD49D1938512100C6382D /* Shine_png.cpp in Sources */, 3EB515691952865D006966AA /* common.cc in Sources */, + 15AA9649199B6D4600725633 /* lua_debugger.c in Sources */, 3EB515651952865D006966AA /* repeated_field.cc in Sources */, 3EB5156B1952865D006966AA /* once.cc in Sources */, 3EB5155D1952865D006966AA /* coded_stream.cc in Sources */, @@ -1441,6 +1504,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15AA9648199B6D4600725633 /* lua_debugger.c in Sources */, 3EB5156A1952865D006966AA /* once.cc in Sources */, C00FD4981938512100C6382D /* Portrait_png.cpp in Sources */, 5023812517EBBCAC00990C9B /* RootViewController.mm in Sources */, @@ -1473,16 +1537,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 15427CDC198F223300DC375D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "libluacocosdenshion iOS"; - targetProxy = 15427CDB198F223300DC375D /* PBXContainerItemProxy */; - }; - 15427CDE198F223300DC375D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "libluacocos2d iOS"; - targetProxy = 15427CDD198F223300DC375D /* PBXContainerItemProxy */; - }; 15427CE5198F23B300DC375D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libnetwork iOS"; @@ -1493,16 +1547,6 @@ name = "libnetwork Mac"; targetProxy = 15427CE6198F23E600DC375D /* PBXContainerItemProxy */; }; - 15427CE9198F244500DC375D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "libluacocos2d Mac"; - targetProxy = 15427CE8198F244500DC375D /* PBXContainerItemProxy */; - }; - 15427CEB198F246A00DC375D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "libluacocosdenshion Mac"; - targetProxy = 15427CEA198F246A00DC375D /* PBXContainerItemProxy */; - }; 15D1F3091994BBCA00302043 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libcocos2d iOS"; diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln index a50c2950ee..7bad96de2e 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -20,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\..\coco EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosdenshion", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocosdenshion.vcxproj", "{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluanetwork", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluanetwork.vcxproj", "{65E52F4B-703F-419E-AD67-926241A10042}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -54,6 +56,10 @@ Global {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Debug|Win32.Build.0 = Debug|Win32 {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.ActiveCfg = Release|Win32 {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.Build.0 = Release|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.ActiveCfg = Debug|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.Build.0 = Debug|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.ActiveCfg = Release|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 6bdeabdb2a..9dc61c7f96 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -109,8 +109,10 @@ if not exist "$(LocalDebuggerWorkingDirectory)" mkdir "$(LocalDebuggerWorkingDirectory)" -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(LocalDebuggerWorkingDirectory)" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\network\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y copy files @@ -170,8 +172,9 @@ xcopy "$(ProjectDir)..\..\..\src" "$(LocalDebuggerWorkingDirectory)\src" /e /Y xcopy "$(ProjectDir)..\..\..\res" "$(LocalDebuggerWorkingDirectory)\res" /e /Y copy "$(ProjectDir)..\..\..\config.json" "$(LocalDebuggerWorkingDirectory)\config.json" /Y xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(LocalDebuggerWorkingDirectory)" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\network\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y copy files @@ -204,6 +207,7 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden + @@ -228,6 +232,7 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden + @@ -246,20 +251,14 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - {9f2d6ce6-c893-4400-b50c-6db70cc2562f} {46a7d57a-7f25-4f52-823b-ffac4ff3a624} - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} + + {65e52f4b-703f-419e-ad67-926241a10042} diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj.filters b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj.filters index 184060831e..94b25bd143 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj.filters +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj.filters @@ -106,6 +106,9 @@ Classes\runtime\protobuf-lite + + Classes\runtime + @@ -183,6 +186,9 @@ Classes\runtime\protobuf-lite + + Classes\runtime + diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json index add6413e4f..3b2ca1cb79 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json @@ -22,6 +22,10 @@ "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosdenshion", "to": "" }, + { + "from": "../../cocos2d-x/cocos/scripting/lua-bindings/script/network", + "to": "" + }, { "from": "../../cocos2d-x/external/lua/luasocket", "to": "", diff --git a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj index 5f228d1567..6c6ff97247 100644 --- a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj +++ b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj @@ -114,9 +114,8 @@ xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\network" "$( xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\..\" /e /Y - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" - + + @@ -159,9 +158,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ true - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" - + + xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script\cocos2d" "$(ProjectDir)..\..\" /e /Y diff --git a/tests/lua-tests/project/proj.android/jni/Android.mk b/tests/lua-tests/project/proj.android/jni/Android.mk index e2b7121a98..1d31e9c980 100644 --- a/tests/lua-tests/project/proj.android/jni/Android.mk +++ b/tests/lua-tests/project/proj.android/jni/Android.mk @@ -13,8 +13,6 @@ LOCAL_SRC_FILES += main.cpp \ LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes -LOCAL_STATIC_LIBRARIES := curl_static_prebuilt - LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static diff --git a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj index 3390023fb2..678f8b4197 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -120,8 +120,8 @@ xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(ProjectDir)..\..\res" /e /Y copy files - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + @@ -175,8 +175,8 @@ xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(ProjectDir)..\..\res" /e /Y copy files - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + From 7bfd636b16000c0c728789206001d5c032fbb273 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 09:06:06 +0800 Subject: [PATCH 052/147] reset default camera rotation --- cocos/base/CCCamera.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/base/CCCamera.cpp b/cocos/base/CCCamera.cpp index 6b3be0526d..3cb67e4a46 100644 --- a/cocos/base/CCCamera.cpp +++ b/cocos/base/CCCamera.cpp @@ -168,6 +168,7 @@ bool Camera::initDefault() { initOrthographic(size.width, size.height, -1024, 1024); setPosition3D(Vec3(0.0f, 0.0f, 0.0f)); + setRotation3D(Vec3(0.f, 0.f, 0.f)); break; } case Director::Projection::_3D: From 6510d74ff78ef042c8541cd864b7a13ebc8a33e6 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 14 Aug 2014 01:29:42 +0000 Subject: [PATCH 053/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index d41e965099..6556e3e6ff 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -3875,6 +3875,7 @@ "cocos/scripting/lua-bindings/auto/api/ShuffleTiles.lua", "cocos/scripting/lua-bindings/auto/api/SimpleAudioEngine.lua", "cocos/scripting/lua-bindings/auto/api/Skeleton.lua", + "cocos/scripting/lua-bindings/auto/api/Skeleton3D.lua", "cocos/scripting/lua-bindings/auto/api/SkeletonAnimation.lua", "cocos/scripting/lua-bindings/auto/api/SkewBy.lua", "cocos/scripting/lua-bindings/auto/api/SkewFrame.lua", From b2dad11f7c2693bec0ec39253c39d87faf7ae527 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 14 Aug 2014 09:33:32 +0800 Subject: [PATCH 054/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d06c1028ae..d5edbd9d28 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ cocos2d-x-3.3 ?? [NEW] RenderTexture: add a call back function for saveToFile() [NEW] RotateTo: added 3D rotation support [NEW] ScrollView: added `setMinScale()` and `setMaxScale()` + [NEW] Sprite3D: added setCullFace() and setCullFaceEnabled() [NEW] SpriteFrameCache: load from plist file content data [NEW] utils: added gettime() [NEW] TextField: support utf8 From c809c8806a4e01d7356953b6e7c133a6c6d0e8f9 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 14 Aug 2014 09:36:29 +0800 Subject: [PATCH 055/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d5edbd9d28..5745fe2047 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ cocos2d-x-3.3 ?? getFileSize() [NEW] FileUtilsApple: allow setting bundle to use in file utils on iOS and Mac OS X [NEW] Image: support of software PVRTC v1 decompression + [NEW] Lua-binding: added release_print that can print log even in release mode [NEW] Physics Integration: can invoke update in demand [NEW] RenderTexture: add a call back function for saveToFile() [NEW] RotateTo: added 3D rotation support From 7a99220aadcdf05b25b594a584ba56e5a5ea9321 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 14 Aug 2014 01:39:44 +0000 Subject: [PATCH 056/147] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/Sprite3D.lua | 10 ++ .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 94 +++++++++++++++++++ .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 2 + 3 files changed, 106 insertions(+) diff --git a/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua b/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua index 52a51e7248..62dd9dcdd1 100644 --- a/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua @@ -4,6 +4,11 @@ -- @extend Node,BlendProtocol -- @parent_module cc +-------------------------------- +-- @function [parent=#Sprite3D] setCullFaceEnabled +-- @param self +-- @param #bool bool + -------------------------------- -- @overload self, cc.Texture2D -- @overload self, string @@ -30,6 +35,11 @@ -- @param self -- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc) +-------------------------------- +-- @function [parent=#Sprite3D] setCullFace +-- @param self +-- @param #unsigned int int + -------------------------------- -- @function [parent=#Sprite3D] removeAttachNode -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 94bb320293..44115b5555 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -63918,6 +63918,52 @@ int lua_register_cocos2dx_Component(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Sprite3D_setCullFaceEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setCullFaceEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFaceEnabled"); + if(!ok) + return 0; + cobj->setCullFaceEnabled(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFaceEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setCullFaceEnabled'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Sprite3D_setTexture(lua_State* tolua_S) { int argc = 0; @@ -64148,6 +64194,52 @@ int lua_cocos2dx_Sprite3D_getBlendFunc(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Sprite3D_setCullFace(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setCullFace'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace"); + if(!ok) + return 0; + cobj->setCullFace(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setCullFace'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Sprite3D_removeAttachNode(lua_State* tolua_S) { int argc = 0; @@ -64304,11 +64396,13 @@ int lua_register_cocos2dx_Sprite3D(lua_State* tolua_S) tolua_cclass(tolua_S,"Sprite3D","cc.Sprite3D","cc.Node",nullptr); tolua_beginmodule(tolua_S,"Sprite3D"); + tolua_function(tolua_S,"setCullFaceEnabled",lua_cocos2dx_Sprite3D_setCullFaceEnabled); tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite3D_setTexture); tolua_function(tolua_S,"removeAllAttachNode",lua_cocos2dx_Sprite3D_removeAllAttachNode); tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite3D_setBlendFunc); tolua_function(tolua_S,"getMesh",lua_cocos2dx_Sprite3D_getMesh); tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite3D_getBlendFunc); + tolua_function(tolua_S,"setCullFace",lua_cocos2dx_Sprite3D_setCullFace); tolua_function(tolua_S,"removeAttachNode",lua_cocos2dx_Sprite3D_removeAttachNode); tolua_function(tolua_S,"getAttachNode",lua_cocos2dx_Sprite3D_getAttachNode); tolua_function(tolua_S,"create", lua_cocos2dx_Sprite3D_create); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 1673f167da..a951802a00 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1598,6 +1598,8 @@ int register_all_cocos2dx(lua_State* tolua_S); + + From 55e9487dbd89a720ebcf27c798500e3b4ad20d57 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 14 Aug 2014 09:42:59 +0800 Subject: [PATCH 057/147] [ci skip] --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 5745fe2047..3c961998ab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,7 +16,8 @@ cocos2d-x-3.3 ?? [NEW] Sprite3D: added setCullFace() and setCullFaceEnabled() [NEW] SpriteFrameCache: load from plist file content data [NEW] utils: added gettime() - [NEW] TextField: support utf8 + [NEW] ui::TextField: support utf8 + [NEW] ui::TextField: support set color and placehold color [NEW] Text: added getter and setter for TextColor [FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X From 4629d257e17458905325a15eaaa374fb5f113342 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 09:58:11 +0800 Subject: [PATCH 058/147] rename checkCameraMask to isVisibleByVisitingCamera --- cocos/2d/CCClippingNode.cpp | 2 +- cocos/2d/CCLabel.cpp | 2 +- cocos/2d/CCNode.cpp | 4 ++-- cocos/2d/CCNode.h | 2 +- cocos/2d/CCNodeGrid.cpp | 2 +- cocos/2d/CCParticleBatchNode.cpp | 2 +- cocos/2d/CCProtectedNode.cpp | 2 +- cocos/2d/CCRenderTexture.cpp | 2 +- cocos/2d/CCSpriteBatchNode.cpp | 2 +- cocos/editor-support/cocostudio/CCArmature.cpp | 2 +- cocos/editor-support/cocostudio/CCBatchNode.cpp | 2 +- cocos/ui/UIScale9Sprite.cpp | 2 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- tools/cocos2d-console | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index 53ed6797bb..26c5f55786 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -261,7 +261,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32 renderer->addCommand(&_afterDrawStencilCmd); int i = 0; - bool visibleByCamera = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index d0242c1fc2..60798852f5 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1053,7 +1053,7 @@ void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags) void Label::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { - if (! _visible || _originalUTF8String.empty() || !checkCameraMask()) + if (! _visible || _originalUTF8String.empty() || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 81290f2327..413ecd58e0 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1225,7 +1225,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl return flags; } -bool Node::checkCameraMask() const +bool Node::isVisibleByVisitingCamera() const { auto camera = Camera::getVisitingCamera(); bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true; @@ -1249,7 +1249,7 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); - bool visibleByCamera = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); int i = 0; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 6d0f788104..91851c9b7a 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1522,7 +1522,7 @@ protected: bool doEnumerateRecursive(const Node* node, const std::string &name, std::function callback) const; //check whether this camera mask is visible by the current visiting camera - bool checkCameraMask() const; + bool isVisibleByVisitingCamera() const; #if CC_USE_PHYSICS void updatePhysicsBodyTransform(Scene* layer); diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index ee86daa2e4..fa4ad6d2d7 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -126,7 +126,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p } int i = 0; - bool visibleByCamera = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index eb24526f82..ac5873b686 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -130,7 +130,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, u // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (!_visible || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/2d/CCProtectedNode.cpp b/cocos/2d/CCProtectedNode.cpp index 5cf53729e6..485b7dd34a 100644 --- a/cocos/2d/CCProtectedNode.cpp +++ b/cocos/2d/CCProtectedNode.cpp @@ -318,7 +318,7 @@ void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint3 // // draw self // - if (checkCameraMask()) + if (isVisibleByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 7cb4cf9e12..f53dc17da2 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -393,7 +393,7 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3 { // override visit. // Don't call visit on its children - if (!_visible || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index df68d82b26..1e1516a76b 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -147,7 +147,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uin // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (! _visible || !checkCameraMask()) + if (! _visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index ed11c16734..0af7683eb1 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -467,7 +467,7 @@ void Armature::onExit() void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index ab64329483..b287c1acfc 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -108,7 +108,7 @@ void BatchNode::removeChild(Node* child, bool cleanup) void BatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 3d31885daa..8bd8fc7cb4 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -774,7 +774,7 @@ y+=ytranslate; \ // // draw self // - if (checkCameraMask()) + if (isVisibleByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index f864ba1a79..af346cf01a 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -581,7 +581,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); this->beforeDraw(); - bool visibleByCamera = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); if (!_children.empty()) { diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 5db5a4283a..4b020e4900 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 5db5a4283aa22e362901e2924146ad66c2e1484f +Subproject commit 4b020e4900e601a2d5845095f2e6970c13c59613 From 5d49afec0edb8eaef124859e0fc019921cb9ed61 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 14 Aug 2014 10:04:01 +0800 Subject: [PATCH 059/147] fix ios running error --- tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 345d402967..5c1c3584bc 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -381,7 +381,7 @@ const std::string Effect3DOutline::_vertShaderFile = "Shaders3D/OutLine.vert"; const std::string Effect3DOutline::_fragShaderFile = "Shaders3D/OutLine.frag"; const std::string Effect3DOutline::_keyInGLProgramCache = "Effect3DLibrary_Outline"; -const std::string Effect3DOutline::_vertSkinnedShaderFile = "Shaders3D/SkinnedOutLine.vert"; +const std::string Effect3DOutline::_vertSkinnedShaderFile = "Shaders3D/SkinnedOutline.vert"; const std::string Effect3DOutline::_fragSkinnedShaderFile = "Shaders3D/OutLine.frag"; const std::string Effect3DOutline::_keySkinnedInGLProgramCache = "Effect3DLibrary_Outline"; GLProgram* Effect3DOutline::getOrCreateProgram(bool isSkinned /* = false */ ) From 186fd78729f66a42408d3766c0584e1882cd8841 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 14 Aug 2014 10:06:32 +0800 Subject: [PATCH 060/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 3c961998ab..9e4b52c463 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,6 +26,7 @@ cocos2d-x-3.3 ?? [FIX] Label: setTextColor does not have any effect on Mac OS X [FIX] Label: result of LabelTTF::getBoundingBox() is wrong [FIX] Label: can not set outline color correctly if using system font on iOS + [FIX] Label: character edeg will be cut a little if character size is small [FIX] LabelBMFont: result of LabelBMFont::getBoundingBox() is wrong [FIX] ListView: can not insert an item in specific position, it is added at bottom [FIX] LoadingBar: position is changed if changing direction From 6467dcaa57e5224bd8e3e8763f62559aafde62cb Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 14 Aug 2014 02:17:25 +0000 Subject: [PATCH 061/147] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/TextField.lua | 27 ++- .../auto/lua_cocos2dx_ui_auto.cpp | 204 +++++++++++++++--- .../auto/lua_cocos2dx_ui_auto.hpp | 3 + 3 files changed, 200 insertions(+), 34 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/TextField.lua b/cocos/scripting/lua-bindings/auto/api/TextField.lua index b2c82a059d..c4e22b25bc 100644 --- a/cocos/scripting/lua-bindings/auto/api/TextField.lua +++ b/cocos/scripting/lua-bindings/auto/api/TextField.lua @@ -19,6 +19,11 @@ -- @param self -- @return string#string ret (return value: string) +-------------------------------- +-- @function [parent=#TextField] setPasswordStyleText +-- @param self +-- @param #char char + -------------------------------- -- @function [parent=#TextField] getDeleteBackward -- @param self @@ -92,6 +97,11 @@ -- @param self -- @param #bool bool +-------------------------------- +-- @function [parent=#TextField] getPlaceHolderColor +-- @param self +-- @return color4b_table#color4b_table ret (return value: color4b_table) + -------------------------------- -- @function [parent=#TextField] getPasswordStyleText -- @param self @@ -103,9 +113,9 @@ -- @param #bool bool -------------------------------- --- @function [parent=#TextField] setPasswordStyleText +-- @function [parent=#TextField] isPasswordEnabled -- @param self --- @param #char char +-- @return bool#bool ret (return value: bool) -------------------------------- -- @function [parent=#TextField] setDeleteBackward @@ -123,15 +133,22 @@ -- @param #string str -------------------------------- --- @function [parent=#TextField] isPasswordEnabled +-- @overload self, color4b_table +-- @overload self, color3b_table +-- @function [parent=#TextField] setPlaceHolderColor -- @param self --- @return bool#bool ret (return value: bool) - +-- @param #color3b_table color3b + -------------------------------- -- @function [parent=#TextField] setTextHorizontalAlignment -- @param self -- @param #int texthalignment +-------------------------------- +-- @function [parent=#TextField] setTextColor +-- @param self +-- @param #color4b_table color4b + -------------------------------- -- @function [parent=#TextField] getMaxLength -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index f4605cb5be..c4c11ce464 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -13233,6 +13233,52 @@ int lua_cocos2dx_ui_TextField_getStringValue(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_TextField_setPasswordStyleText(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextField* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + const char* arg0; + + std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "ccui.TextField:setPasswordStyleText"); arg0 = arg0_tmp.c_str(); + if(!ok) + return 0; + cobj->setPasswordStyleText(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setPasswordStyleText",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextField_getDeleteBackward(lua_State* tolua_S) { int argc = 0; @@ -13907,6 +13953,50 @@ int lua_cocos2dx_ui_TextField_setPasswordEnabled(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_TextField_getPlaceHolderColor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextField* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_getPlaceHolderColor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Color4B& ret = cobj->getPlaceHolderColor(); + color4b_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:getPlaceHolderColor",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_getPlaceHolderColor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextField_getPasswordStyleText(lua_State* tolua_S) { int argc = 0; @@ -13997,7 +14087,7 @@ int lua_cocos2dx_ui_TextField_setMaxLengthEnabled(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextField_setPasswordStyleText(lua_State* tolua_S) +int lua_cocos2dx_ui_TextField_isPasswordEnabled(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextField* cobj = nullptr; @@ -14017,28 +14107,26 @@ int lua_cocos2dx_ui_TextField_setPasswordStyleText(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) + if (argc == 0) { - const char* arg0; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "ccui.TextField:setPasswordStyleText"); arg0 = arg0_tmp.c_str(); if(!ok) return 0; - cobj->setPasswordStyleText(arg0); - return 0; + bool ret = cobj->isPasswordEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setPasswordStyleText",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:isPasswordEnabled",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'.",&tolua_err); #endif return 0; @@ -14181,46 +14269,55 @@ int lua_cocos2dx_ui_TextField_setPlaceHolder(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextField_isPasswordEnabled(lua_State* tolua_S) +int lua_cocos2dx_ui_TextField_setPlaceHolderColor(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextField* cobj = nullptr; bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif - #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); - #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setPlaceHolderColor'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) + do{ + if (argc == 1) { + cocos2d::Color4B arg0; + ok &=luaval_to_color4b(tolua_S, 2, &arg0, "ccui.TextField:setPlaceHolderColor"); + + if (!ok) { break; } + cobj->setPlaceHolderColor(arg0); return 0; - bool ret = cobj->isPasswordEnabled(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:isPasswordEnabled",argc, 0); + } + }while(0); + ok = true; + do{ + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "ccui.TextField:setPlaceHolderColor"); + + if (!ok) { break; } + cobj->setPlaceHolderColor(arg0); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setPlaceHolderColor",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setPlaceHolderColor'.",&tolua_err); #endif return 0; @@ -14271,6 +14368,52 @@ int lua_cocos2dx_ui_TextField_setTextHorizontalAlignment(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_TextField_setTextColor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextField* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setTextColor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Color4B arg0; + + ok &=luaval_to_color4b(tolua_S, 2, &arg0, "ccui.TextField:setTextColor"); + if(!ok) + return 0; + cobj->setTextColor(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setTextColor",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setTextColor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextField_getMaxLength(lua_State* tolua_S) { int argc = 0; @@ -14812,6 +14955,7 @@ int lua_register_cocos2dx_ui_TextField(lua_State* tolua_S) tolua_function(tolua_S,"setAttachWithIME",lua_cocos2dx_ui_TextField_setAttachWithIME); tolua_function(tolua_S,"getFontSize",lua_cocos2dx_ui_TextField_getFontSize); tolua_function(tolua_S,"getStringValue",lua_cocos2dx_ui_TextField_getStringValue); + tolua_function(tolua_S,"setPasswordStyleText",lua_cocos2dx_ui_TextField_setPasswordStyleText); tolua_function(tolua_S,"getDeleteBackward",lua_cocos2dx_ui_TextField_getDeleteBackward); tolua_function(tolua_S,"getPlaceHolder",lua_cocos2dx_ui_TextField_getPlaceHolder); tolua_function(tolua_S,"getAttachWithIME",lua_cocos2dx_ui_TextField_getAttachWithIME); @@ -14827,14 +14971,16 @@ int lua_register_cocos2dx_ui_TextField(lua_State* tolua_S) tolua_function(tolua_S,"attachWithIME",lua_cocos2dx_ui_TextField_attachWithIME); tolua_function(tolua_S,"getStringLength",lua_cocos2dx_ui_TextField_getStringLength); tolua_function(tolua_S,"setPasswordEnabled",lua_cocos2dx_ui_TextField_setPasswordEnabled); + tolua_function(tolua_S,"getPlaceHolderColor",lua_cocos2dx_ui_TextField_getPlaceHolderColor); tolua_function(tolua_S,"getPasswordStyleText",lua_cocos2dx_ui_TextField_getPasswordStyleText); tolua_function(tolua_S,"setMaxLengthEnabled",lua_cocos2dx_ui_TextField_setMaxLengthEnabled); - tolua_function(tolua_S,"setPasswordStyleText",lua_cocos2dx_ui_TextField_setPasswordStyleText); + tolua_function(tolua_S,"isPasswordEnabled",lua_cocos2dx_ui_TextField_isPasswordEnabled); tolua_function(tolua_S,"setDeleteBackward",lua_cocos2dx_ui_TextField_setDeleteBackward); tolua_function(tolua_S,"setFontSize",lua_cocos2dx_ui_TextField_setFontSize); tolua_function(tolua_S,"setPlaceHolder",lua_cocos2dx_ui_TextField_setPlaceHolder); - tolua_function(tolua_S,"isPasswordEnabled",lua_cocos2dx_ui_TextField_isPasswordEnabled); + tolua_function(tolua_S,"setPlaceHolderColor",lua_cocos2dx_ui_TextField_setPlaceHolderColor); tolua_function(tolua_S,"setTextHorizontalAlignment",lua_cocos2dx_ui_TextField_setTextHorizontalAlignment); + tolua_function(tolua_S,"setTextColor",lua_cocos2dx_ui_TextField_setTextColor); tolua_function(tolua_S,"getMaxLength",lua_cocos2dx_ui_TextField_getMaxLength); tolua_function(tolua_S,"isMaxLengthEnabled",lua_cocos2dx_ui_TextField_isMaxLengthEnabled); tolua_function(tolua_S,"setDetachWithIME",lua_cocos2dx_ui_TextField_setDetachWithIME); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index bb7e8f9958..e733905e27 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -398,6 +398,9 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + + + From 032ba062a9c5af11acccaae11cddd1c8ca408b94 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 10:26:37 +0800 Subject: [PATCH 062/147] rename isVisibleByVisitingCamera to isVisitableByVisitingCamera --- cocos/2d/CCClippingNode.cpp | 2 +- cocos/2d/CCLabel.cpp | 2 +- cocos/2d/CCNode.cpp | 4 ++-- cocos/2d/CCNode.h | 2 +- cocos/2d/CCNodeGrid.cpp | 2 +- cocos/2d/CCParticleBatchNode.cpp | 2 +- cocos/2d/CCProtectedNode.cpp | 2 +- cocos/2d/CCRenderTexture.cpp | 2 +- cocos/2d/CCSpriteBatchNode.cpp | 2 +- cocos/editor-support/cocostudio/CCArmature.cpp | 2 +- cocos/editor-support/cocostudio/CCBatchNode.cpp | 2 +- cocos/ui/UIScale9Sprite.cpp | 2 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index 26c5f55786..8a307f69df 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -261,7 +261,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32 renderer->addCommand(&_afterDrawStencilCmd); int i = 0; - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 60798852f5..9eaf5ee5f1 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1053,7 +1053,7 @@ void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags) void Label::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { - if (! _visible || _originalUTF8String.empty() || !isVisibleByVisitingCamera()) + if (! _visible || _originalUTF8String.empty() || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 413ecd58e0..fb42ac4ea2 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1225,7 +1225,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl return flags; } -bool Node::isVisibleByVisitingCamera() const +bool Node::isVisitableByVisitingCamera() const { auto camera = Camera::getVisitingCamera(); bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true; @@ -1249,7 +1249,7 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); int i = 0; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 91851c9b7a..729544681d 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1522,7 +1522,7 @@ protected: bool doEnumerateRecursive(const Node* node, const std::string &name, std::function callback) const; //check whether this camera mask is visible by the current visiting camera - bool isVisibleByVisitingCamera() const; + bool isVisitableByVisitingCamera() const; #if CC_USE_PHYSICS void updatePhysicsBodyTransform(Scene* layer); diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index fa4ad6d2d7..a2e5c263c2 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -126,7 +126,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p } int i = 0; - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index ac5873b686..b717205f82 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -130,7 +130,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, u // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/2d/CCProtectedNode.cpp b/cocos/2d/CCProtectedNode.cpp index 485b7dd34a..4eae3d0b5a 100644 --- a/cocos/2d/CCProtectedNode.cpp +++ b/cocos/2d/CCProtectedNode.cpp @@ -318,7 +318,7 @@ void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint3 // // draw self // - if (isVisibleByVisitingCamera()) + if (isVisitableByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index f53dc17da2..f21a7c6458 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -393,7 +393,7 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3 { // override visit. // Don't call visit on its children - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 1e1516a76b..a2e48bddca 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -147,7 +147,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uin // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (! _visible || !isVisibleByVisitingCamera()) + if (! _visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 0af7683eb1..c9081721ea 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -467,7 +467,7 @@ void Armature::onExit() void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index b287c1acfc..eb0ba5cf70 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -108,7 +108,7 @@ void BatchNode::removeChild(Node* child, bool cleanup) void BatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 8bd8fc7cb4..c3f79d13b2 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -774,7 +774,7 @@ y+=ytranslate; \ // // draw self // - if (isVisibleByVisitingCamera()) + if (isVisitableByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index af346cf01a..6c2862b3f0 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -581,7 +581,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); this->beforeDraw(); - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); if (!_children.empty()) { From f6da3b76b5e144e0f5aa33a1bba524778472f4be Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 10:29:17 +0800 Subject: [PATCH 063/147] use renderer passed instead of get from global --- cocos/3d/CCSprite3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 0bbc9ccd58..c5148a9a25 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -382,7 +382,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) } //support tint and fade meshCommand.setDisplayColor(Vec4(color.r, color.g, color.b, color.a)); - Director::getInstance()->getRenderer()->addCommand(&meshCommand); + renderer->addCommand(&meshCommand); } } From e2857097d610f22f122f331926da92e1d7411bd4 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 14 Aug 2014 02:30:08 +0000 Subject: [PATCH 064/147] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/TextField.lua | 27 ++- .../auto/lua_cocos2dx_ui_auto.cpp | 204 +++++++++++++++--- .../auto/lua_cocos2dx_ui_auto.hpp | 3 + 3 files changed, 200 insertions(+), 34 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/TextField.lua b/cocos/scripting/lua-bindings/auto/api/TextField.lua index b2c82a059d..c4e22b25bc 100644 --- a/cocos/scripting/lua-bindings/auto/api/TextField.lua +++ b/cocos/scripting/lua-bindings/auto/api/TextField.lua @@ -19,6 +19,11 @@ -- @param self -- @return string#string ret (return value: string) +-------------------------------- +-- @function [parent=#TextField] setPasswordStyleText +-- @param self +-- @param #char char + -------------------------------- -- @function [parent=#TextField] getDeleteBackward -- @param self @@ -92,6 +97,11 @@ -- @param self -- @param #bool bool +-------------------------------- +-- @function [parent=#TextField] getPlaceHolderColor +-- @param self +-- @return color4b_table#color4b_table ret (return value: color4b_table) + -------------------------------- -- @function [parent=#TextField] getPasswordStyleText -- @param self @@ -103,9 +113,9 @@ -- @param #bool bool -------------------------------- --- @function [parent=#TextField] setPasswordStyleText +-- @function [parent=#TextField] isPasswordEnabled -- @param self --- @param #char char +-- @return bool#bool ret (return value: bool) -------------------------------- -- @function [parent=#TextField] setDeleteBackward @@ -123,15 +133,22 @@ -- @param #string str -------------------------------- --- @function [parent=#TextField] isPasswordEnabled +-- @overload self, color4b_table +-- @overload self, color3b_table +-- @function [parent=#TextField] setPlaceHolderColor -- @param self --- @return bool#bool ret (return value: bool) - +-- @param #color3b_table color3b + -------------------------------- -- @function [parent=#TextField] setTextHorizontalAlignment -- @param self -- @param #int texthalignment +-------------------------------- +-- @function [parent=#TextField] setTextColor +-- @param self +-- @param #color4b_table color4b + -------------------------------- -- @function [parent=#TextField] getMaxLength -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index f4605cb5be..c4c11ce464 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -13233,6 +13233,52 @@ int lua_cocos2dx_ui_TextField_getStringValue(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_TextField_setPasswordStyleText(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextField* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + const char* arg0; + + std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "ccui.TextField:setPasswordStyleText"); arg0 = arg0_tmp.c_str(); + if(!ok) + return 0; + cobj->setPasswordStyleText(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setPasswordStyleText",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextField_getDeleteBackward(lua_State* tolua_S) { int argc = 0; @@ -13907,6 +13953,50 @@ int lua_cocos2dx_ui_TextField_setPasswordEnabled(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_TextField_getPlaceHolderColor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextField* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_getPlaceHolderColor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Color4B& ret = cobj->getPlaceHolderColor(); + color4b_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:getPlaceHolderColor",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_getPlaceHolderColor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextField_getPasswordStyleText(lua_State* tolua_S) { int argc = 0; @@ -13997,7 +14087,7 @@ int lua_cocos2dx_ui_TextField_setMaxLengthEnabled(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextField_setPasswordStyleText(lua_State* tolua_S) +int lua_cocos2dx_ui_TextField_isPasswordEnabled(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextField* cobj = nullptr; @@ -14017,28 +14107,26 @@ int lua_cocos2dx_ui_TextField_setPasswordStyleText(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) + if (argc == 0) { - const char* arg0; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "ccui.TextField:setPasswordStyleText"); arg0 = arg0_tmp.c_str(); if(!ok) return 0; - cobj->setPasswordStyleText(arg0); - return 0; + bool ret = cobj->isPasswordEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setPasswordStyleText",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:isPasswordEnabled",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setPasswordStyleText'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'.",&tolua_err); #endif return 0; @@ -14181,46 +14269,55 @@ int lua_cocos2dx_ui_TextField_setPlaceHolder(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextField_isPasswordEnabled(lua_State* tolua_S) +int lua_cocos2dx_ui_TextField_setPlaceHolderColor(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextField* cobj = nullptr; bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif - #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); - #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setPlaceHolderColor'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) + do{ + if (argc == 1) { + cocos2d::Color4B arg0; + ok &=luaval_to_color4b(tolua_S, 2, &arg0, "ccui.TextField:setPlaceHolderColor"); + + if (!ok) { break; } + cobj->setPlaceHolderColor(arg0); return 0; - bool ret = cobj->isPasswordEnabled(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:isPasswordEnabled",argc, 0); + } + }while(0); + ok = true; + do{ + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "ccui.TextField:setPlaceHolderColor"); + + if (!ok) { break; } + cobj->setPlaceHolderColor(arg0); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setPlaceHolderColor",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_isPasswordEnabled'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setPlaceHolderColor'.",&tolua_err); #endif return 0; @@ -14271,6 +14368,52 @@ int lua_cocos2dx_ui_TextField_setTextHorizontalAlignment(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_TextField_setTextColor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextField* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextField*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextField_setTextColor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Color4B arg0; + + ok &=luaval_to_color4b(tolua_S, 2, &arg0, "ccui.TextField:setTextColor"); + if(!ok) + return 0; + cobj->setTextColor(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextField:setTextColor",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextField_setTextColor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextField_getMaxLength(lua_State* tolua_S) { int argc = 0; @@ -14812,6 +14955,7 @@ int lua_register_cocos2dx_ui_TextField(lua_State* tolua_S) tolua_function(tolua_S,"setAttachWithIME",lua_cocos2dx_ui_TextField_setAttachWithIME); tolua_function(tolua_S,"getFontSize",lua_cocos2dx_ui_TextField_getFontSize); tolua_function(tolua_S,"getStringValue",lua_cocos2dx_ui_TextField_getStringValue); + tolua_function(tolua_S,"setPasswordStyleText",lua_cocos2dx_ui_TextField_setPasswordStyleText); tolua_function(tolua_S,"getDeleteBackward",lua_cocos2dx_ui_TextField_getDeleteBackward); tolua_function(tolua_S,"getPlaceHolder",lua_cocos2dx_ui_TextField_getPlaceHolder); tolua_function(tolua_S,"getAttachWithIME",lua_cocos2dx_ui_TextField_getAttachWithIME); @@ -14827,14 +14971,16 @@ int lua_register_cocos2dx_ui_TextField(lua_State* tolua_S) tolua_function(tolua_S,"attachWithIME",lua_cocos2dx_ui_TextField_attachWithIME); tolua_function(tolua_S,"getStringLength",lua_cocos2dx_ui_TextField_getStringLength); tolua_function(tolua_S,"setPasswordEnabled",lua_cocos2dx_ui_TextField_setPasswordEnabled); + tolua_function(tolua_S,"getPlaceHolderColor",lua_cocos2dx_ui_TextField_getPlaceHolderColor); tolua_function(tolua_S,"getPasswordStyleText",lua_cocos2dx_ui_TextField_getPasswordStyleText); tolua_function(tolua_S,"setMaxLengthEnabled",lua_cocos2dx_ui_TextField_setMaxLengthEnabled); - tolua_function(tolua_S,"setPasswordStyleText",lua_cocos2dx_ui_TextField_setPasswordStyleText); + tolua_function(tolua_S,"isPasswordEnabled",lua_cocos2dx_ui_TextField_isPasswordEnabled); tolua_function(tolua_S,"setDeleteBackward",lua_cocos2dx_ui_TextField_setDeleteBackward); tolua_function(tolua_S,"setFontSize",lua_cocos2dx_ui_TextField_setFontSize); tolua_function(tolua_S,"setPlaceHolder",lua_cocos2dx_ui_TextField_setPlaceHolder); - tolua_function(tolua_S,"isPasswordEnabled",lua_cocos2dx_ui_TextField_isPasswordEnabled); + tolua_function(tolua_S,"setPlaceHolderColor",lua_cocos2dx_ui_TextField_setPlaceHolderColor); tolua_function(tolua_S,"setTextHorizontalAlignment",lua_cocos2dx_ui_TextField_setTextHorizontalAlignment); + tolua_function(tolua_S,"setTextColor",lua_cocos2dx_ui_TextField_setTextColor); tolua_function(tolua_S,"getMaxLength",lua_cocos2dx_ui_TextField_getMaxLength); tolua_function(tolua_S,"isMaxLengthEnabled",lua_cocos2dx_ui_TextField_isMaxLengthEnabled); tolua_function(tolua_S,"setDetachWithIME",lua_cocos2dx_ui_TextField_setDetachWithIME); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index bb7e8f9958..e733905e27 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -398,6 +398,9 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + + + From a9a403013c9f1cd7d6d15b1eb5ec05cf324ab002 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 14 Aug 2014 10:44:03 +0800 Subject: [PATCH 065/147] fix skinned outline effect --- tests/cpp-tests/Resources/Shaders3D/SkinnedOutline.vert | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cpp-tests/Resources/Shaders3D/SkinnedOutline.vert b/tests/cpp-tests/Resources/Shaders3D/SkinnedOutline.vert index 5cdd990d80..fdf40e7a45 100644 --- a/tests/cpp-tests/Resources/Shaders3D/SkinnedOutline.vert +++ b/tests/cpp-tests/Resources/Shaders3D/SkinnedOutline.vert @@ -13,7 +13,7 @@ uniform vec4 u_matrixPalette[SKINNING_JOINT_COUNT * 3]; // Varyings varying vec2 TextureCoordOut; -vec4 SkinnedVec3(vec3 vec) +vec4 SkinnedVec3(vec4 vec) { float blendWeight = a_blendWeight[0]; @@ -54,7 +54,7 @@ vec4 SkinnedVec3(vec3 vec) vec4 _skinnedPosition; - vec4 postion = vec4(vec, 1.0); + vec4 postion = vec; _skinnedPosition.x = dot(postion, matrixPalette1); _skinnedPosition.y = dot(postion, matrixPalette2); _skinnedPosition.z = dot(postion, matrixPalette3); @@ -65,9 +65,9 @@ vec4 SkinnedVec3(vec3 vec) void main() { - vec4 pos = CC_MVPMatrix * SkinnedVec3(a_position); + vec4 pos = CC_MVPMatrix * SkinnedVec3(vec4(a_position,1.0)); - vec4 normalproj = CC_MVPMatrix * vec4(SkinnedVec3(a_normal).xyz, 0); + vec4 normalproj = CC_MVPMatrix * vec4(SkinnedVec3(vec4(a_normal,0.0)).xyz, 0); normalproj = normalize(normalproj); pos.xy += normalproj.xy * (OutlineWidth * (pos.z * 0.5 + 0.5)); From 85ad4241a043621344c415f3e8c33119f9f7673c Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 14 Aug 2014 11:10:52 +0800 Subject: [PATCH 066/147] Modify Xcode project setting --- .../cocos2d_lua_bindings.xcodeproj/project.pbxproj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index bc4b446080..aecee79193 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -2338,14 +2338,22 @@ 15D1F2C21994B2DA00302043 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + VALID_ARCHS = "arm64 armv7 armv7s"; }; name = Debug; }; 15D1F2C31994B2DA00302043 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + VALID_ARCHS = "arm64 armv7 armv7s"; }; name = Release; }; @@ -2760,7 +2768,6 @@ 15D1F2AE1994B2AD00302043 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; }; 15D1F2C11994B2DA00302043 /* Build configuration list for PBXAggregateTarget "build all lualibs iOS" */ = { isa = XCConfigurationList; @@ -2769,7 +2776,6 @@ 15D1F2C31994B2DA00302043 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; }; 15EFA2F6198B2791000C57D3 /* Build configuration list for PBXNativeTarget "libluacocosbuilder iOS" */ = { isa = XCConfigurationList; From 18851d3e815622be9933b19a9ddee6e21af7d587 Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 14 Aug 2014 11:14:24 +0800 Subject: [PATCH 067/147] add customization to UIButton and UIPageView --- cocos/ui/UIButton.cpp | 17 ++- cocos/ui/UIButton.h | 11 +- cocos/ui/UIPageView.cpp | 31 +++++- cocos/ui/UIPageView.h | 21 +++- .../CocoStudioGUITest/CocosGUIScene.cpp | 4 +- .../UIButtonTest/UIButtonTest.cpp | 68 ++++++++++++ .../UIButtonTest/UIButtonTest.h | 13 +++ .../UIPageViewTest/UIPageViewTest.cpp | 100 ++++++++++++++++++ .../UIPageViewTest/UIPageViewTest.h | 15 +++ .../CocoStudioGUITest/UISceneManager.cpp | 5 + .../UITest/CocoStudioGUITest/UISceneManager.h | 2 + 11 files changed, 278 insertions(+), 9 deletions(-) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 25bc9dcd50..468103761a 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -64,6 +64,7 @@ _normalTextureScaleXInSize(1.0f), _normalTextureScaleYInSize(1.0f), _pressedTextureScaleXInSize(1.0f), _pressedTextureScaleYInSize(1.0f), +_zoomScale(0.1f), _normalTextureLoaded(false), _pressedTextureLoaded(false), _disabledTextureLoaded(false), @@ -386,9 +387,9 @@ void Button::onPressStateChangedToPressed() { _buttonNormalRenderer->stopAllActions(); _buttonClickedRenderer->stopAllActions(); - Action *zoomAction = ScaleTo::create(0.05f, _pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f); + Action *zoomAction = ScaleTo::create(0.05f, _pressedTextureScaleXInSize + _zoomScale, _pressedTextureScaleYInSize + _zoomScale); _buttonClickedRenderer->runAction(zoomAction); - _buttonNormalRenderer->setScale(_pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f); + _buttonNormalRenderer->setScale(_pressedTextureScaleXInSize + _zoomScale, _pressedTextureScaleYInSize + _zoomScale); } } else @@ -403,7 +404,7 @@ void Button::onPressStateChangedToPressed() else { _buttonNormalRenderer->stopAllActions(); - _buttonNormalRenderer->setScale(_normalTextureScaleXInSize + 0.1f, _normalTextureScaleYInSize + 0.1f); + _buttonNormalRenderer->setScale(_normalTextureScaleXInSize +_zoomScale, _normalTextureScaleYInSize + _zoomScale); } } } @@ -643,6 +644,16 @@ float Button::getTitleFontSize() const { return _fontSize; } + +void Button::setZoomScale(float scale) +{ + _zoomScale = scale; +} + +float Button::getZoomScale()const +{ + return _zoomScale; +} void Button::setTitleFontName(const std::string& fontName) { diff --git a/cocos/ui/UIButton.h b/cocos/ui/UIButton.h index e44e148024..6d33e19770 100644 --- a/cocos/ui/UIButton.h +++ b/cocos/ui/UIButton.h @@ -188,6 +188,14 @@ public: float getTitleFontSize() const; void setTitleFontName(const std::string& fontName); const std::string& getTitleFontName() const; + /** When user pressed the button, the button will zoom to a scale. + * The final scale of the button equals (button original scale + _zoomScale) + */ + void setZoomScale(float scale); + /** + * @brief Return a zoom scale + */ + float getZoomScale()const; CC_CONSTRUCTOR_ACCESS: virtual bool init() override; @@ -222,7 +230,8 @@ protected: Scale9Sprite* _buttonClickedRenderer; Scale9Sprite* _buttonDisableRenderer; Label* _titleRenderer; - + + float _zoomScale; std::string _normalFileName; std::string _clickedFileName; std::string _disabledFileName; diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index c884be87e4..c4222959bd 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -44,7 +44,9 @@ _autoScrollDirection(AutoScrollDirection::LEFT), _childFocusCancelOffset(5.0f), _pageViewEventListener(nullptr), _pageViewEventSelector(nullptr), -_eventCallback(nullptr) +_eventCallback(nullptr), +_customScrollThreshold(0.0), +_usingCustomCrollThreshold(false) { this->setTouchEnabled(true); } @@ -447,6 +449,28 @@ void PageView::handleMoveLogic(Touch *touch) } scrollPages(offset); } + +void PageView::setCustomScrollThreshold(float threshold) +{ + CCASSERT(threshold > 0, "Invalid threshold!"); + _customScrollThreshold = threshold; + this->setUsingCustomScrollThreshold(true); +} + +float PageView::getCustomScrollThreshold()const +{ + return _customScrollThreshold; +} + +void PageView::setUsingCustomScrollThreshold(bool flag) +{ + _usingCustomCrollThreshold = flag; +} + +bool PageView::isUsingCustomScrollThreshold()const +{ + return _usingCustomCrollThreshold; +} void PageView::handleReleaseLogic(Touch *touch) { @@ -461,7 +485,10 @@ void PageView::handleReleaseLogic(Touch *touch) ssize_t pageCount = this->getPageCount(); float curPageLocation = curPagePos.x; float pageWidth = getContentSize().width; - float boundary = pageWidth/2.0f; + if (!_usingCustomCrollThreshold) { + _customScrollThreshold = pageWidth / 2.0; + } + float boundary = _customScrollThreshold; if (curPageLocation <= -boundary) { if (_curPageIdx >= pageCount-1) diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 96d01c98df..2065f2fb73 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -168,6 +168,23 @@ public: virtual std::string getDescription() const override; virtual void onEnter() override; + /** + * @brief If you don't specify the value, the pageView will scroll when half pageview width reached + */ + void setCustomScrollThreshold(float threshold); + /** + *@brief Return user defined scroll page threshold + */ + float getCustomScrollThreshold()const; + /** + *@brief Set using user defined scroll page threshold or not + * If you set it to false, then the default scroll threshold is pageView.width / 2 + */ + void setUsingCustomScrollThreshold(bool flag); + /** + *@brief Query whether we are using user defined scroll page threshold or not + */ + bool isUsingCustomScrollThreshold()const; CC_CONSTRUCTOR_ACCESS: virtual bool init() override; @@ -219,7 +236,9 @@ protected: float _leftBoundary; float _rightBoundary; - + float _customScrollThreshold; + bool _usingCustomCrollThreshold; + float _childFocusCancelOffset; Ref* _pageViewEventListener; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 003a4e1f61..ab7dc67667 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -63,7 +63,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIButtonTest); sceneManager->setMinUISceneId(kUIButtonTest); - sceneManager->setMaxUISceneId(kUIButtonTestSwitchScale9); + sceneManager->setMaxUISceneId(kUIButtonTestZoomScale); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } @@ -195,7 +195,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIPageViewTest); sceneManager->setMinUISceneId(kUIPageViewTest); - sceneManager->setMaxUISceneId(kUIPageViewButtonTest); + sceneManager->setMaxUISceneId(kUIPageViewCustomScrollThreshold); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 68307eed18..9c1016f681 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -520,3 +520,71 @@ void UIButtonTestSwitchScale9::touchEvent(Ref *pSender, Widget::TouchEventType t break; } } + + +// UIButtonTestZoomScale +UIButtonTestZoomScale::UIButtonTestZoomScale() +: _displayValueLabel(nullptr) +{ + +} + +UIButtonTestZoomScale::~UIButtonTestZoomScale() +{ +} + +bool UIButtonTestZoomScale::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the button events will be displayed + _displayValueLabel = Text::create("Zoom Scale: 0.1", "fonts/Marker Felt.ttf",32); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 20)); + _uiLayer->addChild(_displayValueLabel); + + // Add the alert + Text* alert = Text::create("Button","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 * 1.75f)); + + _uiLayer->addChild(alert); + + // Create the button + Button* button = Button::create("cocosui/animationbuttonnormal.png", + "cocosui/animationbuttonpressed.png"); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 20)); + button->setPressedActionEnabled(true); + button->setName("button"); + _uiLayer->addChild(button); + button->setZoomScale(-0.5); + + Slider* slider = Slider::create(); + slider->loadBarTexture("cocosui/sliderTrack.png"); + slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); + slider->loadProgressBarTexture("cocosui/sliderProgress.png"); + slider->setPosition(Vec2(widgetSize.width / 2.0f , widgetSize.height / 2.0f - 20)); + slider->addEventListener(CC_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); + slider->setPercent(button->getZoomScale()*100); + _uiLayer->addChild(slider); + return true; + } + return false; +} + +void UIButtonTestZoomScale::sliderEvent(Ref *pSender, Slider::EventType type) +{ + if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) + { + Slider* slider = dynamic_cast(pSender); + int percent = slider->getPercent(); + Button* btn = (Button*)_uiLayer->getChildByName("button"); + float zoomScale = percent * 0.01; + btn->setZoomScale(zoomScale); + _displayValueLabel->setString(String::createWithFormat("Zoom Scale: %f", zoomScale)->getCString()); + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index c9f7be36f7..668789066a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -105,4 +105,17 @@ protected: Text* _displayValueLabel; }; +class UIButtonTestZoomScale : public UIScene +{ +public: + UIButtonTestZoomScale(); + ~UIButtonTestZoomScale(); + bool init(); + void sliderEvent(Ref* pSender, Slider::EventType type); + +protected: + UI_SCENE_CREATE_FUNC(UIButtonTestZoomScale) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIButtonTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 973d6ba1ef..8419708306 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -208,3 +208,103 @@ void UIPageViewButtonTest::pageViewEvent(Ref *pSender, PageView::EventType type) break; } } + + +// UIPageViewCustomScrollThreshold +UIPageViewCustomScrollThreshold::UIPageViewCustomScrollThreshold() +: _displayValueLabel(nullptr) +{ + +} + +UIPageViewCustomScrollThreshold::~UIPageViewCustomScrollThreshold() +{ +} + +bool UIPageViewCustomScrollThreshold::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the dragpanel events will be displayed + _displayValueLabel = Text::create("Scroll Threshold", "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", "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(_uiLayer->getChildByTag(81)); + + Layout* background = dynamic_cast(root->getChildByName("background_Panel")); + + // Create the page view + PageView* pageView = PageView::create(); + pageView->setContentSize(Size(240.0f, 100.0f)); + Size backgroundSize = background->getContentSize(); + pageView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + + (backgroundSize.width - pageView->getContentSize().width) / 2.0f, + (widgetSize.height - backgroundSize.height) / 2.0f + + (backgroundSize.height - pageView->getContentSize().height) / 2.0f + 20)); + + int pageCount = 4; + for (int i = 0; i < pageCount; ++i) + { + Layout* layout = Layout::create(); + layout->setContentSize(Size(240.0f, 130.0f)); + + ImageView* imageView = ImageView::create("cocosui/scrollviewbg.png"); + imageView->setScale9Enabled(true); + imageView->setContentSize(Size(240, 130)); + imageView->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); + layout->addChild(imageView); + + Text* label = Text::create(StringUtils::format("page %d",(i+1)), "fonts/Marker Felt.ttf", 30); + label->setColor(Color3B(192, 192, 192)); + label->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); + layout->addChild(label); + + pageView->insertPage(layout,i); + } + + _uiLayer->addChild(pageView); + pageView->setName("pageView"); + + Slider* slider = Slider::create(); + slider->loadBarTexture("cocosui/sliderTrack.png"); + slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); + slider->loadProgressBarTexture("cocosui/sliderProgress.png"); + slider->setPosition(Vec2(widgetSize.width / 2.0f , widgetSize.height / 2.0f - 40)); + slider->addEventListener(CC_CALLBACK_2(UIPageViewCustomScrollThreshold::sliderEvent, this)); + slider->setPercent(50); + _uiLayer->addChild(slider); + + + return true; + } + return false; +} + + +void UIPageViewCustomScrollThreshold::sliderEvent(Ref *pSender, Slider::EventType type) +{ + if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) + { + Slider* slider = dynamic_cast(pSender); + int percent = slider->getPercent(); + PageView* pageView = (PageView*)_uiLayer->getChildByName("pageView"); + if (percent == 0) { + percent = 1; + } + pageView->setCustomScrollThreshold(percent * 0.01 * pageView->getContentSize().width); + + _displayValueLabel->setString(String::createWithFormat("Scroll Threshold: %f", pageView->getCustomScrollThreshold())->getCString()); + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h index 114737a291..0892b3e936 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h @@ -55,4 +55,19 @@ protected: Text* _displayValueLabel; }; +class UIPageViewCustomScrollThreshold : public UIScene +{ +public: + UIPageViewCustomScrollThreshold(); + ~UIPageViewCustomScrollThreshold(); + bool init(); + + void sliderEvent(Ref* pSender, Slider::EventType type); + + void pageViewEvent(Ref* pSender, PageView::EventType type); +protected: + UI_SCENE_CREATE_FUNC(UIPageViewCustomScrollThreshold) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIPageViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 37031bf8af..59cec14db4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -34,6 +34,7 @@ static const char* s_testArray[] = "UIButtonTest_Title", "UIButtonTest_RemoveSelf", "UIButtonTestSwitchScale9", + "UIButtonTestZoomScale", "UICheckBoxTest", "UISliderTest", "UISliderTest_Scale9", @@ -180,6 +181,8 @@ Scene *UISceneManager::currentUIScene() return UIButtonTestRemoveSelf::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIButtonTestSwitchScale9: return UIButtonTestSwitchScale9::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIButtonTestZoomScale: + return UIButtonTestZoomScale::sceneWithTitle(s_testArray[_currentUISceneId]); case kUICheckBoxTest: return UICheckBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); @@ -288,6 +291,8 @@ Scene *UISceneManager::currentUIScene() return UIPageViewTest::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIPageViewButtonTest: return UIPageViewButtonTest::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIPageViewCustomScrollThreshold: + return UIPageViewCustomScrollThreshold::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIListViewTest_Vertical: return UIListViewTest_Vertical::sceneWithTitle(s_testArray[_currentUISceneId]); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index a730422203..9d49b61b89 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -37,6 +37,7 @@ enum kUIButtonTest_Title, kUIButtonTest_RemoveSelf, kUIButtonTestSwitchScale9, + kUIButtonTestZoomScale, kUICheckBoxTest, kUISliderTest, kUISliderTest_Scale9, @@ -75,6 +76,7 @@ enum kUIScrollViewTest_ScrollToPercentBothDirection_Bounce, kUIPageViewTest, kUIPageViewButtonTest, + kUIPageViewCustomScrollThreshold, kUIListViewTest_Vertical, kUIListViewTest_Horizontal, kUIWidgetAddNodeTest, From dbf58b8873331f9da1fe6a57d6f2f76fcbad003f Mon Sep 17 00:00:00 2001 From: lvlong Date: Thu, 14 Aug 2014 13:15:37 +0800 Subject: [PATCH 068/147] modify function name and add default to switch block. --- cocos/3d/CCOBB.cpp | 36 +++++++++++++++++++++--------------- cocos/3d/CCOBB.h | 4 ++-- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/cocos/3d/CCOBB.cpp b/cocos/3d/CCOBB.cpp index f74bf96a47..a9e3235c31 100755 --- a/cocos/3d/CCOBB.cpp +++ b/cocos/3d/CCOBB.cpp @@ -332,7 +332,7 @@ void OBB::getInterval(const OBB& box, const Vec3& axis, float &min, float &max)c } } -Vec3 OBB::getEdgeDir(int index)const +Vec3 OBB::getEdgeDirection(int index)const { Vec3 corners[8]; getCorners(corners); @@ -352,38 +352,44 @@ Vec3 OBB::getEdgeDir(int index)const tmpLine = corners[1] - corners[6]; tmpLine.normalize(); break; + default: + CCASSERT(0, "Invalid index!"); + break; } return tmpLine; } -Vec3 OBB::getFaceDir(int index) const +Vec3 OBB::getFaceDirection(int index) const { Vec3 corners[8]; getCorners(corners); - Vec3 faceDir, v0, v1; + Vec3 faceDirection, v0, v1; switch(index) { case 0:// front and back v0 = corners[2] - corners[1]; v1 = corners[0] - corners[1]; - Vec3::cross(v0, v1, &faceDir); - faceDir.normalize(); + Vec3::cross(v0, v1, &faceDirection); + faceDirection.normalize(); break; case 1:// left and right v0 = corners[5] - corners[2]; v1 = corners[3] - corners[2]; - Vec3::cross(v0, v1, &faceDir); - faceDir.normalize(); + Vec3::cross(v0, v1, &faceDirection); + faceDirection.normalize(); break; case 2:// top and bottom v0 = corners[1] - corners[2]; v1 = corners[5] - corners[2]; - Vec3::cross(v0, v1, &faceDir); - faceDir.normalize(); + Vec3::cross(v0, v1, &faceDirection); + faceDirection.normalize(); + break; + default: + CCASSERT(0, "Invalid index!"); break; } - return faceDir; + return faceDirection; } bool OBB::intersects(const OBB& box) const @@ -391,15 +397,15 @@ bool OBB::intersects(const OBB& box) const float min1, max1, min2, max2; for (int i = 0; i < 3; i++) { - getInterval(*this, getFaceDir(i), min1, max1); - getInterval(box, getFaceDir(i), min2, max2); + getInterval(*this, getFaceDirection(i), min1, max1); + getInterval(box, getFaceDirection(i), min2, max2); if (max1 < min2 || max2 < min1) return false; } for (int i = 0; i < 3; i++) { - getInterval(*this, box.getFaceDir(i), min1, max1); - getInterval(box, box.getFaceDir(i), min2, max2); + getInterval(*this, box.getFaceDirection(i), min1, max1); + getInterval(box, box.getFaceDirection(i), min2, max2); if (max1 < min2 || max2 < min1) return false; } @@ -408,7 +414,7 @@ bool OBB::intersects(const OBB& box) const for (int j = 0; j < 3; j++) { Vec3 axis; - Vec3::cross(getEdgeDir(i), box.getEdgeDir(j), &axis); + Vec3::cross(getFaceDirection(i), box.getFaceDirection(j), &axis); getInterval(*this, axis, min1, max1); getInterval(box, axis, min2, max2); if (max1 < min2 || max2 < min1) return false; diff --git a/cocos/3d/CCOBB.h b/cocos/3d/CCOBB.h index 95776bd5f5..0fd8c1eea1 100755 --- a/cocos/3d/CCOBB.h +++ b/cocos/3d/CCOBB.h @@ -97,12 +97,12 @@ protected: /* * Get the edege of x y z axis direction */ - Vec3 getEdgeDir(int index) const; + Vec3 getEdgeDirection(int index) const; /* * Get the face of x y z axis direction */ - Vec3 getFaceDir(int index) const; + Vec3 getFaceDirection(int index) const; public: Vec3 _center; // obb center From 42e7e3bbe81ac9c05863669268e7afc058825fc3 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 14:11:00 +0800 Subject: [PATCH 069/147] format code --- extensions/GUI/CCScrollView/CCScrollView.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 6c2862b3f0..da6de500af 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -603,19 +603,18 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t // this draw if (visibleByCamera) - this->draw(renderer, _modelViewTransform, flags); + this->draw(renderer, _modelViewTransform, flags); - // draw children zOrder >= 0 - for( ; i < _children.size(); i++ ) + // draw children zOrder >= 0 + for( ; i < _children.size(); i++ ) { Node *child = _children.at(i); child->visit(renderer, _modelViewTransform, flags); - } - - } + } + } else if (visibleByCamera) { - this->draw(renderer, _modelViewTransform, flags); + this->draw(renderer, _modelViewTransform, flags); } this->afterDraw(); From 561945d6cd72ad1243892c21978366c3f91fc7b6 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 14:14:25 +0800 Subject: [PATCH 070/147] format code --- extensions/GUI/CCScrollView/CCScrollView.cpp | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index da6de500af..e763bf7489 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -565,9 +565,9 @@ void ScrollView::onAfterDraw() void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible - if (!isVisible()) + if (!isVisible()) { - return; + return; } uint32_t flags = processParentFlags(parentTransform, parentFlags); @@ -583,23 +583,23 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t this->beforeDraw(); bool visibleByCamera = isVisitableByVisitingCamera(); - if (!_children.empty()) + if (!_children.empty()) { - int i=0; + int i=0; // draw children zOrder < 0 - for( ; i < _children.size(); i++ ) + for( ; i < _children.size(); i++ ) { - Node *child = _children.at(i); - if ( child->getLocalZOrder() < 0 ) + Node *child = _children.at(i); + if ( child->getLocalZOrder() < 0 ) { - child->visit(renderer, _modelViewTransform, flags); - } + child->visit(renderer, _modelViewTransform, flags); + } else { - break; + break; } - } + } // this draw if (visibleByCamera) @@ -619,7 +619,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t this->afterDraw(); - director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } bool ScrollView::onTouchBegan(Touch* touch, Event* event) From d8eb1b26efe78204296820785be4fcd808860818 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 14:15:16 +0800 Subject: [PATCH 071/147] format code --- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index e763bf7489..4c698d5fbb 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -564,7 +564,7 @@ void ScrollView::onAfterDraw() void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { - // quick return if not visible + // quick return if not visible if (!isVisible()) { return; From e27a2aee91613699b0771965ab265b8d39e28feb Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 14 Aug 2014 14:36:30 +0800 Subject: [PATCH 072/147] fix typo --- cocos/ui/UIPageView.cpp | 8 ++++---- cocos/ui/UIPageView.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index c4222959bd..b6f702ede2 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -46,7 +46,7 @@ _pageViewEventListener(nullptr), _pageViewEventSelector(nullptr), _eventCallback(nullptr), _customScrollThreshold(0.0), -_usingCustomCrollThreshold(false) +_usingCustomScrollThreshold(false) { this->setTouchEnabled(true); } @@ -464,12 +464,12 @@ float PageView::getCustomScrollThreshold()const void PageView::setUsingCustomScrollThreshold(bool flag) { - _usingCustomCrollThreshold = flag; + _usingCustomScrollThreshold = flag; } bool PageView::isUsingCustomScrollThreshold()const { - return _usingCustomCrollThreshold; + return _usingCustomScrollThreshold; } void PageView::handleReleaseLogic(Touch *touch) @@ -485,7 +485,7 @@ void PageView::handleReleaseLogic(Touch *touch) ssize_t pageCount = this->getPageCount(); float curPageLocation = curPagePos.x; float pageWidth = getContentSize().width; - if (!_usingCustomCrollThreshold) { + if (!_usingCustomScrollThreshold) { _customScrollThreshold = pageWidth / 2.0; } float boundary = _customScrollThreshold; diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 2065f2fb73..65078870e9 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -237,7 +237,7 @@ protected: float _leftBoundary; float _rightBoundary; float _customScrollThreshold; - bool _usingCustomCrollThreshold; + bool _usingCustomScrollThreshold; float _childFocusCancelOffset; From 77c7ed98965977c64d2ae1cc08bda7b3b39e2a0d Mon Sep 17 00:00:00 2001 From: zhangbin Date: Thu, 14 Aug 2014 15:13:43 +0800 Subject: [PATCH 073/147] Update the reference of submodule cocos2d-console. --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 4b020e4900..b2a0338f0a 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 4b020e4900e601a2d5845095f2e6970c13c59613 +Subproject commit b2a0338f0a6d51878ce96c4e0521d083e232e67b From d9a0c6a2ad7658e48bcde8a7b4c95304db453cff Mon Sep 17 00:00:00 2001 From: Mircea Rila Date: Thu, 14 Aug 2014 10:48:09 +0300 Subject: [PATCH 074/147] replace tabs with spaces --- AUTHORS | 6 ++--- cocos/platform/desktop/CCGLViewImpl.cpp | 32 ++++++++++++------------- cocos/platform/desktop/CCGLViewImpl.h | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/AUTHORS b/AUTHORS index 40ef469e80..b85103502b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -974,9 +974,9 @@ Developers: DavidPartouche Fixed the bug that video player not showing on iOS if it's not in FullScreen mode - - zaWasp - Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32 + + zaWasp + Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32 Retired Core Developers: WenSheng Yang diff --git a/cocos/platform/desktop/CCGLViewImpl.cpp b/cocos/platform/desktop/CCGLViewImpl.cpp index cb8976fa92..210e6f12be 100644 --- a/cocos/platform/desktop/CCGLViewImpl.cpp +++ b/cocos/platform/desktop/CCGLViewImpl.cpp @@ -102,13 +102,13 @@ public: _view = view; } - static void onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified) - { - if (_view) - { - _view->onGLFWWindowIconifyCallback(window, iconified); - } - } + static void onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified) + { + if (_view) + { + _view->onGLFWWindowIconifyCallback(window, iconified); + } + } private: static GLViewImpl* _view; @@ -361,7 +361,7 @@ bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float fram glfwSetWindowPosCallback(_mainWindow, GLFWEventHandler::onGLFWWindowPosCallback); glfwSetFramebufferSizeCallback(_mainWindow, GLFWEventHandler::onGLFWframebuffersize); glfwSetWindowSizeCallback(_mainWindow, GLFWEventHandler::onGLFWWindowSizeFunCallback); - glfwSetWindowIconifyCallback(_mainWindow, GLFWEventHandler::onGLFWWindowIconifyCallback); + glfwSetWindowIconifyCallback(_mainWindow, GLFWEventHandler::onGLFWWindowIconifyCallback); setFrameSize(rect.size.width, rect.size.height); @@ -721,14 +721,14 @@ void GLViewImpl::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int void GLViewImpl::onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified) { - if (iconified == GL_TRUE) - { - Application::getInstance()->applicationDidEnterBackground(); - } - else - { - Application::getInstance()->applicationWillEnterForeground(); - } + if (iconified == GL_TRUE) + { + Application::getInstance()->applicationDidEnterBackground(); + } + else + { + Application::getInstance()->applicationWillEnterForeground(); + } } #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) diff --git a/cocos/platform/desktop/CCGLViewImpl.h b/cocos/platform/desktop/CCGLViewImpl.h index 0bd3fd0373..368e6d97a2 100644 --- a/cocos/platform/desktop/CCGLViewImpl.h +++ b/cocos/platform/desktop/CCGLViewImpl.h @@ -130,9 +130,9 @@ protected: void onGLFWWindowPosCallback(GLFWwindow* windows, int x, int y); void onGLFWframebuffersize(GLFWwindow* window, int w, int h); void onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int height); - void onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified); + void onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified); - bool _captured; + bool _captured; bool _supportTouch; bool _isInRetinaMonitor; bool _isRetinaEnabled; From 02da83979818702f24461de1ffd92a08a0199dee Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 14 Aug 2014 16:54:33 +0800 Subject: [PATCH 075/147] Make lua-template-default support all modules --- .../frameworks/CMakeLists.txt | 15 +- .../runtime-src/Classes/lua_module_register.h | 12 + .../runtime-src/proj.android/jni/Android.mk | 6 + .../HelloLua.xcodeproj/project.pbxproj | 408 ++++++++++++++++++ 4 files changed, 439 insertions(+), 2 deletions(-) diff --git a/templates/lua-template-default/frameworks/CMakeLists.txt b/templates/lua-template-default/frameworks/CMakeLists.txt index 34fc012279..68f26536f7 100644 --- a/templates/lua-template-default/frameworks/CMakeLists.txt +++ b/templates/lua-template-default/frameworks/CMakeLists.txt @@ -159,9 +159,20 @@ endif() target_link_libraries(${APP_NAME} luacocos2d luacocosdenshion - audio + luanetwork + luacocosbuilder + luacocostudio + luaspine + luaextension + luaui cocos2d - xxtea + audio + cocostudio + spine + cocosbuilder + extensions + ui + network ) set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin") diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h index 1654f34659..0de6e7001c 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h @@ -2,11 +2,23 @@ #define __LUA_TEMPLATE_DEFAULT_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ #include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" +#include "network/lua_cocos2dx_network_manual.h" +#include "cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h" +#include "cocostudio/lua_cocos2dx_coco_studio_manual.hpp" +#include "extension/lua_cocos2dx_extension_manual.h" +#include "ui/lua_cocos2dx_ui_manual.hpp" +#include "spine/lua_cocos2dx_spine_manual.hpp" int lua_module_register(lua_State* L) { register_cocosdenshion_module(L); + register_network_module(L); + register_cocosbuilder_module(L); + register_cocostudio_module(L); + register_extension_module(L); + register_ui_moudle(L); + register_spine_module(L); return 1; } diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk index d9effcb7d3..7810103733 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk @@ -14,6 +14,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += extension_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += ui_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 4c33eff6ce..4a0ea01ce4 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -21,6 +21,62 @@ 15427C7D198F1FD800DC375D /* libluanetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C45198F1DE400DC375D /* libluanetwork Mac.a */; }; 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; + 15AA968E199C627C00725633 /* libluaextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C4B198F1DE400DC375D /* libluaextension iOS.a */; }; + 15AA969F199C628500725633 /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4271834BDA200142BE0 /* libextension iOS.a */; }; + 15AA96A0199C628F00725633 /* libluacocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C51198F1DE400DC375D /* libluacocosbuilder iOS.a */; }; + 15AA96A1199C629B00725633 /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C25198F1DE400DC375D /* libcocosbuilder iOS.a */; }; + 15AA96A2199C62AE00725633 /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C23198F1DE400DC375D /* libcocostudio iOS.a */; }; + 15AA96A3199C62B900725633 /* libluacocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C4F198F1DE400DC375D /* libluacocostudio iOS.a */; }; + 15AA96A4199C62C500725633 /* libluaspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C53198F1DE400DC375D /* libluaspine iOS.a */; }; + 15AA96A5199C62CF00725633 /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C27198F1DE400DC375D /* libspine iOS.a */; }; + 15AA96A6199C62F500725633 /* libluaui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C4D198F1DE400DC375D /* libluaui iOS.a */; }; + 15AA96A7199C62FE00725633 /* libui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C21198F1DE400DC375D /* libui iOS.a */; }; + 15AA96A8199C633700725633 /* libcocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C1B198F1DE400DC375D /* libcocosbuilder Mac.a */; }; + 15AA96A9199C634600725633 /* libluacocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C41198F1DE400DC375D /* libluacocosbuilder Mac.a */; }; + 15AA96AA199C64DF00725633 /* libcocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C19198F1DE400DC375D /* libcocostudio Mac.a */; }; + 15AA96AB199C64F400725633 /* libluacocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C3F198F1DE400DC375D /* libluacocostudio Mac.a */; }; + 15AA96AC199C64FD00725633 /* libspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C1D198F1DE400DC375D /* libspine Mac.a */; }; + 15AA96AD199C650C00725633 /* libluaspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C43198F1DE400DC375D /* libluaspine Mac.a */; }; + 15AA96AE199C652A00725633 /* libextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4191834BDA200142BE0 /* libextension Mac.a */; }; + 15AA96AF199C653300725633 /* libluaextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C3B198F1DE400DC375D /* libluaextension Mac.a */; }; + 15AA96B0199C655200725633 /* libui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C17198F1DE400DC375D /* libui Mac.a */; }; + 15AA96B1199C655A00725633 /* libluaui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C3D198F1DE400DC375D /* libluaui Mac.a */; }; + 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 */; }; 15D1FE491998730800302043 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3B1998730800302043 /* bitExtend.lua */; }; 15D1FE4A1998730800302043 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15D1FE3B1998730800302043 /* bitExtend.lua */; }; @@ -105,6 +161,146 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 152A33CC199C93BF004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 155CA2C71988C494006E0A08; + remoteInfo = "libluaextension iOS"; + }; + 152A33CE199C93BF004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA300198B28A8000C57D3; + remoteInfo = "libluaui iOS"; + }; + 152A33D0199C93BF004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA381198B2934000C57D3; + remoteInfo = "libluacocostudio iOS"; + }; + 152A33D2199C93BF004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA27F198B2791000C57D3; + remoteInfo = "libluacocosbuilder iOS"; + }; + 152A33D4199C93BF004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA407198B2AFD000C57D3; + remoteInfo = "libluaspine iOS"; + }; + 152A33F2199C93CD004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "libextension iOS"; + }; + 152A33F4199C93CD004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA2C19775E92004493CC; + remoteInfo = "libui iOS"; + }; + 152A33F6199C93CD004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA6719775EBB004493CC; + remoteInfo = "libcocostudio iOS"; + }; + 152A33F8199C93CD004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA6F19775ECE004493CC; + remoteInfo = "libcocosbuilder iOS"; + }; + 152A33FA199C93CD004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA7719775EE1004493CC; + remoteInfo = "libspine iOS"; + }; + 152A33FC199C93E7004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BD5F1986538000A46ACC; + remoteInfo = "libluaextension Mac"; + }; + 152A33FE199C93E7004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1C0801987328E00A46ACC; + remoteInfo = "libluaui Mac"; + }; + 152A3400199C93E7004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BF7219865C2000A46ACC; + remoteInfo = "libluacocostudio Mac"; + }; + 152A3402199C93E7004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BE66198654BE00A46ACC; + remoteInfo = "libluacocosbuilder Mac"; + }; + 152A3404199C93E7004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BFF819865E5F00A46ACC; + remoteInfo = "libluaspine Mac"; + }; + 152A3406199C93F4004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2FC117814595006731B9; + remoteInfo = "libextension Mac"; + }; + 152A3408199C93F4004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B245F10019766132001920FD; + remoteInfo = "libui Mac"; + }; + 152A340A199C93F4004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B2DB48161976716E00411E16; + remoteInfo = "libcocostudio Mac"; + }; + 152A340C199C93F4004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B2DB479B197669A100411E16; + remoteInfo = "libcocosbuilder Mac"; + }; + 152A340E199C93F4004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B2DB48CA19767F1F00411E16; + remoteInfo = "libspine Mac"; + }; 15427C16198F1DE400DC375D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; @@ -447,6 +643,24 @@ 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 = ""; }; 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = ""; }; 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 = ""; }; + 15AA96B5199C668400725633 /* DeprecatedCocosBuilderClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosBuilderClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosbuilder/DeprecatedCocosBuilderClass.lua"; sourceTree = ""; }; + 15AA96BA199C66A100725633 /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/CocoStudio.lua"; sourceTree = ""; }; + 15AA96BB199C66A100725633 /* DeprecatedCocoStudioClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua"; sourceTree = ""; }; + 15AA96BC199C66A100725633 /* DeprecatedCocoStudioFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua"; sourceTree = ""; }; + 15AA96BD199C66A100725633 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/StudioConstants.lua"; sourceTree = ""; }; + 15AA96C6199C66B500725633 /* DeprecatedExtensionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua"; sourceTree = ""; }; + 15AA96C7199C66B500725633 /* DeprecatedExtensionEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua"; sourceTree = ""; }; + 15AA96C8199C66B500725633 /* DeprecatedExtensionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua"; sourceTree = ""; }; + 15AA96C9199C66B500725633 /* ExtensionConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ExtensionConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua"; sourceTree = ""; }; + 15AA96D2199C66D500725633 /* DeprecatedNetworkClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua"; sourceTree = ""; }; + 15AA96D3199C66D500725633 /* DeprecatedNetworkEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua"; sourceTree = ""; }; + 15AA96D4199C66D500725633 /* DeprecatedNetworkFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedNetworkFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua"; sourceTree = ""; }; + 15AA96D5199C66D500725633 /* NetworkConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/network/NetworkConstants.lua"; sourceTree = ""; }; + 15AA96DE199C66E600725633 /* DeprecatedUIEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua"; sourceTree = ""; }; + 15AA96DF199C66E600725633 /* DeprecatedUIFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua"; sourceTree = ""; }; + 15AA96E0199C66E600725633 /* experimentalUIConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalUIConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/experimentalUIConstants.lua"; sourceTree = ""; }; + 15AA96E1199C66E600725633 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua"; sourceTree = ""; }; 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 = ""; }; 15D1FE3B1998730800302043 /* bitExtend.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = bitExtend.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua"; sourceTree = ""; }; @@ -522,6 +736,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AA96B1199C655A00725633 /* libluaui Mac.a in Frameworks */, + 15AA96B0199C655200725633 /* libui Mac.a in Frameworks */, + 15AA96AF199C653300725633 /* libluaextension Mac.a in Frameworks */, + 15AA96AE199C652A00725633 /* libextension Mac.a in Frameworks */, + 15AA96AD199C650C00725633 /* libluaspine Mac.a in Frameworks */, + 15AA96AC199C64FD00725633 /* libspine Mac.a in Frameworks */, + 15AA96AB199C64F400725633 /* libluacocostudio Mac.a in Frameworks */, + 15AA96AA199C64DF00725633 /* libcocostudio Mac.a in Frameworks */, + 15AA96A9199C634600725633 /* libluacocosbuilder Mac.a in Frameworks */, + 15AA96A8199C633700725633 /* libcocosbuilder Mac.a in Frameworks */, 15427C7D198F1FD800DC375D /* libluanetwork Mac.a in Frameworks */, 15427C7C198F1FCB00DC375D /* libnetwork Mac.a in Frameworks */, 15427C7B198F1FC100DC375D /* libluacocosdenshion Mac.a in Frameworks */, @@ -546,6 +770,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AA96A7199C62FE00725633 /* libui iOS.a in Frameworks */, + 15AA96A6199C62F500725633 /* libluaui iOS.a in Frameworks */, + 15AA96A5199C62CF00725633 /* libspine iOS.a in Frameworks */, + 15AA96A4199C62C500725633 /* libluaspine iOS.a in Frameworks */, + 15AA96A3199C62B900725633 /* libluacocostudio iOS.a in Frameworks */, + 15AA96A2199C62AE00725633 /* libcocostudio iOS.a in Frameworks */, + 15AA96A1199C629B00725633 /* libcocosbuilder iOS.a in Frameworks */, + 15AA96A0199C628F00725633 /* libluacocosbuilder iOS.a in Frameworks */, + 15AA969F199C628500725633 /* libextension iOS.a in Frameworks */, + 15AA968E199C627C00725633 /* libluaextension iOS.a in Frameworks */, 15427C5F198F1E3300DC375D /* libluanetwork iOS.a in Frameworks */, 15427C5E198F1E2B00DC375D /* libnetwork iOS.a in Frameworks */, 15427C5D198F1E2100DC375D /* libluacocosdenshion iOS.a in Frameworks */, @@ -599,6 +833,24 @@ 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 */, @@ -776,6 +1028,16 @@ buildRules = ( ); dependencies = ( + 152A3407199C93F4004B68DC /* PBXTargetDependency */, + 152A3409199C93F4004B68DC /* PBXTargetDependency */, + 152A340B199C93F4004B68DC /* PBXTargetDependency */, + 152A340D199C93F4004B68DC /* PBXTargetDependency */, + 152A340F199C93F4004B68DC /* PBXTargetDependency */, + 152A33FD199C93E7004B68DC /* PBXTargetDependency */, + 152A33FF199C93E7004B68DC /* PBXTargetDependency */, + 152A3401199C93E7004B68DC /* PBXTargetDependency */, + 152A3403199C93E7004B68DC /* PBXTargetDependency */, + 152A3405199C93E7004B68DC /* PBXTargetDependency */, 15427C6D198F1F4D00DC375D /* PBXTargetDependency */, 15427C6F198F1F4D00DC375D /* PBXTargetDependency */, 15427C71198F1F4D00DC375D /* PBXTargetDependency */, @@ -800,6 +1062,16 @@ buildRules = ( ); dependencies = ( + 152A33F3199C93CD004B68DC /* PBXTargetDependency */, + 152A33F5199C93CD004B68DC /* PBXTargetDependency */, + 152A33F7199C93CD004B68DC /* PBXTargetDependency */, + 152A33F9199C93CD004B68DC /* PBXTargetDependency */, + 152A33FB199C93CD004B68DC /* PBXTargetDependency */, + 152A33CD199C93BF004B68DC /* PBXTargetDependency */, + 152A33CF199C93BF004B68DC /* PBXTargetDependency */, + 152A33D1199C93BF004B68DC /* PBXTargetDependency */, + 152A33D3199C93BF004B68DC /* PBXTargetDependency */, + 152A33D5199C93BF004B68DC /* PBXTargetDependency */, 15427C61198F1E7400DC375D /* PBXTargetDependency */, 15427C63198F1E7400DC375D /* PBXTargetDependency */, 15427C65198F1E7400DC375D /* PBXTargetDependency */, @@ -1119,20 +1391,38 @@ 15D1FE541998730800302043 /* DeprecatedCocos2dFunc.lua 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 */, 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; }; @@ -1140,13 +1430,16 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15AA96E6199C66E600725633 /* experimentalUIConstants.lua in Resources */, 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */, 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */, 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */, 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */, + 15AA96BE199C66A100725633 /* CocoStudio.lua 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 */, 5091733917ECE17A00D62437 /* Icon-58.png in Resources */, 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */, @@ -1154,27 +1447,42 @@ C03781B918BF655400FE4F13 /* res in Resources */, 15D1FE5B1998730800302043 /* json.lua 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 */, 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 */, 15D1FE5F1998730800302043 /* luaoc.lua in Resources */, 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */, + 15AA96B6199C668400725633 /* CCBReaderLoad.lua 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 */, + 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 */, + 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 */, + 15AA96D6199C66D500725633 /* DeprecatedNetworkClass.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1233,6 +1541,106 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 152A33CD199C93BF004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaextension iOS"; + targetProxy = 152A33CC199C93BF004B68DC /* PBXContainerItemProxy */; + }; + 152A33CF199C93BF004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaui iOS"; + targetProxy = 152A33CE199C93BF004B68DC /* PBXContainerItemProxy */; + }; + 152A33D1199C93BF004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocostudio iOS"; + targetProxy = 152A33D0199C93BF004B68DC /* PBXContainerItemProxy */; + }; + 152A33D3199C93BF004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocosbuilder iOS"; + targetProxy = 152A33D2199C93BF004B68DC /* PBXContainerItemProxy */; + }; + 152A33D5199C93BF004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaspine iOS"; + targetProxy = 152A33D4199C93BF004B68DC /* PBXContainerItemProxy */; + }; + 152A33F3199C93CD004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libextension iOS"; + targetProxy = 152A33F2199C93CD004B68DC /* PBXContainerItemProxy */; + }; + 152A33F5199C93CD004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libui iOS"; + targetProxy = 152A33F4199C93CD004B68DC /* PBXContainerItemProxy */; + }; + 152A33F7199C93CD004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocostudio iOS"; + targetProxy = 152A33F6199C93CD004B68DC /* PBXContainerItemProxy */; + }; + 152A33F9199C93CD004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocosbuilder iOS"; + targetProxy = 152A33F8199C93CD004B68DC /* PBXContainerItemProxy */; + }; + 152A33FB199C93CD004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libspine iOS"; + targetProxy = 152A33FA199C93CD004B68DC /* PBXContainerItemProxy */; + }; + 152A33FD199C93E7004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaextension Mac"; + targetProxy = 152A33FC199C93E7004B68DC /* PBXContainerItemProxy */; + }; + 152A33FF199C93E7004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaui Mac"; + targetProxy = 152A33FE199C93E7004B68DC /* PBXContainerItemProxy */; + }; + 152A3401199C93E7004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocostudio Mac"; + targetProxy = 152A3400199C93E7004B68DC /* PBXContainerItemProxy */; + }; + 152A3403199C93E7004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocosbuilder Mac"; + targetProxy = 152A3402199C93E7004B68DC /* PBXContainerItemProxy */; + }; + 152A3405199C93E7004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaspine Mac"; + targetProxy = 152A3404199C93E7004B68DC /* PBXContainerItemProxy */; + }; + 152A3407199C93F4004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libextension Mac"; + targetProxy = 152A3406199C93F4004B68DC /* PBXContainerItemProxy */; + }; + 152A3409199C93F4004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libui Mac"; + targetProxy = 152A3408199C93F4004B68DC /* PBXContainerItemProxy */; + }; + 152A340B199C93F4004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocostudio Mac"; + targetProxy = 152A340A199C93F4004B68DC /* PBXContainerItemProxy */; + }; + 152A340D199C93F4004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocosbuilder Mac"; + targetProxy = 152A340C199C93F4004B68DC /* PBXContainerItemProxy */; + }; + 152A340F199C93F4004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libspine Mac"; + targetProxy = 152A340E199C93F4004B68DC /* PBXContainerItemProxy */; + }; 15427C61198F1E7400DC375D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libluanetwork iOS"; From e8a5147b92225bd3661fb8602c69e4dc80e7ab5e Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 14 Aug 2014 16:56:15 +0800 Subject: [PATCH 076/147] copy new added widget property to clone method --- cocos/ui/UIButton.cpp | 1 + cocos/ui/UIPageView.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 468103761a..aebfd113d0 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -704,6 +704,7 @@ void Button::copySpecialProperties(Widget *widget) setTitleFontSize(button->getTitleFontSize()); setTitleColor(button->getTitleColor()); setPressedActionEnabled(button->_pressedActionEnabled); + setZoomScale(button->_zoomScale); } } diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index b6f702ede2..3931192a83 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -617,6 +617,8 @@ void PageView::copySpecialProperties(Widget *widget) _eventCallback = pageView->_eventCallback; _pageViewEventListener = pageView->_pageViewEventListener; _pageViewEventSelector = pageView->_pageViewEventSelector; + _usingCustomScrollThreshold = pageView->_usingCustomScrollThreshold; + _customScrollThreshold = pageView->_customScrollThreshold; } } From 3619fb943a635c5528cba37adf32770023056597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=96=E6=A2=81?= <418094911@qq.com> Date: Thu, 14 Aug 2014 17:07:04 +0800 Subject: [PATCH 077/147] mLastTickInNanoSeconds is the renderStart because: this.mLastTickInNanoSeconds = renderEnd - renderInterval; renderInterval = renderEnd - renderStart so: this.mLastTickInNanoSeconds = renderEnd - ( renderEnd - renderStart ); so: this.mLastTickInNanoSeconds = renderStart ; so: no need nanoTime() twice --- .../android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java index 14cb7739c6..89752bae2a 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java @@ -100,11 +100,8 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer { /* * Render time MUST be counted in, or the FPS will slower than appointed. */ - final long renderStart = System.nanoTime(); + this.mLastTickInNanoSeconds = System.nanoTime(); Cocos2dxRenderer.nativeRender(); - final long renderEnd = System.nanoTime(); - final long renderInterval = renderEnd - renderStart; - this.mLastTickInNanoSeconds = renderEnd - renderInterval; } } From 2d4f23d9e8efbead95b8fd059ff9c9c061d67c88 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 14 Aug 2014 10:36:05 +0000 Subject: [PATCH 078/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 6556e3e6ff..304082e7f1 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -4038,8 +4038,6 @@ "cocos/scripting/lua-bindings/manual/controller/lua_cocos2dx_controller_manual.hpp", "cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp", "cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.h", - "cocos/scripting/lua-bindings/manual/lua_debugger.c", - "cocos/scripting/lua-bindings/manual/lua_debugger.h", "cocos/scripting/lua-bindings/manual/network/Lua_web_socket.cpp", "cocos/scripting/lua-bindings/manual/network/Lua_web_socket.h", "cocos/scripting/lua-bindings/manual/network/lua_cocos2dx_network_manual.cpp", From a508477eda1042cd884a17c00549ab23fe20886f Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 19:07:40 +0800 Subject: [PATCH 079/147] remove unused code --- cocos/2d/CCScene.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index 93a644a2f6..9d5fa4cfdc 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -71,10 +71,6 @@ bool Scene::init() bool Scene::initWithSize(const Size& size) { - //create default camera - auto camera = Camera::create(); - addChild(camera); - setContentSize(size); return true; } From e9563696db57ba2ce8ede61666c9e6be05e86795 Mon Sep 17 00:00:00 2001 From: teivaz Date: Thu, 14 Aug 2014 15:14:25 +0300 Subject: [PATCH 080/147] * Fixed WP8 compilation errors (added path to CCGLView.h) - Modified filters for CCCamera.h/cpp --- cocos/2d/cocos2d_wp8.vcxproj.filters | 6 ++++++ cocos/2d/cocos2d_wp8_headers.props | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index 787f62f854..b8660f1d4b 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -632,6 +632,9 @@ 3d + + base + @@ -1292,6 +1295,9 @@ 3d + + base + diff --git a/cocos/2d/cocos2d_wp8_headers.props b/cocos/2d/cocos2d_wp8_headers.props index ca110ab470..b5f55539b7 100644 --- a/cocos/2d/cocos2d_wp8_headers.props +++ b/cocos/2d/cocos2d_wp8_headers.props @@ -7,7 +7,7 @@ - $(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\wp8-specific\zlib\include;$(GeneratedFilesDir) + $(EngineRoot)cocos\platform;$(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\wp8-specific\zlib\include;$(GeneratedFilesDir) _VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true true From 885fd16b9e56f74163407dd7d742ddaa780c48f5 Mon Sep 17 00:00:00 2001 From: teivaz Date: Thu, 14 Aug 2014 15:20:48 +0300 Subject: [PATCH 081/147] * Fixed WP8 compilation error (Added missing files CCCamera.h/cpp to the project) --- cocos/2d/cocos2d_wp8.vcxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index c81fef6b22..4b4908198e 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -238,6 +238,7 @@ + @@ -454,6 +455,7 @@ + From 90e5870499cc89a323cf3942ed357113461c50b0 Mon Sep 17 00:00:00 2001 From: teivaz Date: Thu, 14 Aug 2014 15:35:36 +0300 Subject: [PATCH 082/147] * Fixed WP compilation errors (added CCPrimitive, CCPrimitiveCommand, CCVertexIndexBuffer and CCVertexIndexData to the project) --- cocos/2d/cocos2d_wp8.vcxproj | 8 ++++++++ cocos/2d/cocos2d_wp8.vcxproj.filters | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index 4b4908198e..950d79440a 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -356,6 +356,8 @@ + + @@ -363,6 +365,8 @@ + + @@ -578,6 +582,8 @@ + + @@ -586,6 +592,8 @@ + + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index b8660f1d4b..9db875128a 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -635,6 +635,18 @@ base + + renderer + + + renderer + + + renderer + + + renderer + @@ -1298,6 +1310,18 @@ base + + renderer + + + renderer + + + renderer + + + renderer + From 1976b66ab81c1a3dea094c35b6b6c9b3ca1e5bd0 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 14 Aug 2014 21:27:02 +0800 Subject: [PATCH 083/147] Make lua-template-default support all modules --- .../frameworks/CMakeLists.txt | 5 + .../runtime-src/proj.android/build-cfg.json | 27 + .../runtime-src/proj.win32/HelloLua.sln | 78 +++ .../runtime-src/proj.win32/HelloLua.vcxproj | 32 +- .../cocos-project-template.json | 75 +++ .../Classes/runtime/lua_debugger.c | 7 +- .../runtime-src/proj.android/build-cfg.json | 16 + .../HelloLua.xcodeproj/project.pbxproj | 464 +++++++++++++++++- .../runtime-src/proj.win32/HelloLua.sln | 66 +++ .../runtime-src/proj.win32/HelloLua.vcxproj | 30 +- 10 files changed, 793 insertions(+), 7 deletions(-) diff --git a/templates/lua-template-default/frameworks/CMakeLists.txt b/templates/lua-template-default/frameworks/CMakeLists.txt index 68f26536f7..63cfe86d50 100644 --- a/templates/lua-template-default/frameworks/CMakeLists.txt +++ b/templates/lua-template-default/frameworks/CMakeLists.txt @@ -186,5 +186,10 @@ pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../src ${APP_BIN_DIR}/Resources/src COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/cocos2d ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/cocosdenshion ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/cocosbuilder ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/cocostudio ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/extension ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/network ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/ui ${APP_BIN_DIR}/Resources ) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json b/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json index 6ef87e7940..82ee655658 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/build-cfg.json @@ -21,6 +21,33 @@ { "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", + "to": "", + "include": [ + "*.lua" + ] } ] } diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln index f1ccf5faa2..465e8e4547 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -18,6 +18,32 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\..\coco EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosdenshion", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocosdenshion.vcxproj", "{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosbuilder", "..\..\cocos2d-x\cocos\editor-support\cocosbuilder\proj.win32\libcocosbuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\..\cocos2d-x\cocos\editor-support\cocostudio\proj.win32\libcocostudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\cocos2d-x\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\..\cocos2d-x\cocos\network\proj.win32\libnetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\..\cocos2d-x\extensions\proj.win32\libextension.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\..\cocos2d-x\cocos\ui\proj.win32\libui.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosbuilder", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocosbuilder.vcxproj", "{F8198014-F4F3-49F0-88AB-C1969A5829AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocostudio", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocostudio.vcxproj", "{9640951E-C5D0-47B5-9C42-0BCADA261C50}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaextension", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaextension.vcxproj", "{7068296E-38A4-4BCA-85DB-3A09BD014847}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluanetwork", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluanetwork.vcxproj", "{65E52F4B-703F-419E-AD67-926241A10042}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaspine.vcxproj", "{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaui", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaui.vcxproj", "{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -48,6 +74,58 @@ Global {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Debug|Win32.Build.0 = Debug|Win32 {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.ActiveCfg = Release|Win32 {46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.Build.0 = Release|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.Build.0 = Release|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32 + {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.ActiveCfg = Debug|Win32 + {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.Build.0 = Debug|Win32 + {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.ActiveCfg = Release|Win32 + {DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.Build.0 = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Debug|Win32.ActiveCfg = Debug|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Debug|Win32.Build.0 = Debug|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Release|Win32.ActiveCfg = Release|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Release|Win32.Build.0 = Release|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Debug|Win32.ActiveCfg = Debug|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Debug|Win32.Build.0 = Debug|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Release|Win32.ActiveCfg = Release|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Release|Win32.Build.0 = Release|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Debug|Win32.ActiveCfg = Debug|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Debug|Win32.Build.0 = Debug|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Release|Win32.ActiveCfg = Release|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Release|Win32.Build.0 = Release|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.ActiveCfg = Debug|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.Build.0 = Debug|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.ActiveCfg = Release|Win32 + {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.Build.0 = Release|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.ActiveCfg = Debug|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.Build.0 = Debug|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.ActiveCfg = Release|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.Build.0 = Release|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.Build.0 = Debug|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.ActiveCfg = Release|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.Build.0 = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 9c84dea7b0..40b906b691 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -105,7 +105,12 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(ProjectDir)..\..\..\" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosbuilder" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocostudio" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\extension" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\network" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\ui" "$(ProjectDir)..\..\..\" /e /Y copy files @@ -153,7 +158,12 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d" "$(ProjectDir)..\..\..\" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosbuilder" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocostudio" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\extension" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\network" "$(ProjectDir)..\..\..\" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\ui" "$(ProjectDir)..\..\..\" /e /Y copy files @@ -180,9 +190,27 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden {9f2d6ce6-c893-4400-b50c-6db70cc2562f} + + {f8198014-f4f3-49f0-88ab-c1969a5829af} + {46a7d57a-7f25-4f52-823b-ffac4ff3a624} + + {9640951e-c5d0-47b5-9c42-0bcada261c50} + + + {7068296e-38a4-4bca-85db-3a09bd014847} + + + {65e52f4b-703f-419e-ad67-926241a10042} + + + {31ef6ab1-0d9a-4bc6-99b8-2c482ea373c4} + + + {fe78eebb-3dbb-4713-8cbf-63d742c5bd82} + diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index e95ce981ec..070e2e8b45 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -79,6 +79,81 @@ "*.lua" ] }, + { + "from": "cocos/scripting/lua-bindings/script/cocosbuilder", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocosbuilder", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocosbuilder", + "to": "runtime/win32", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocostudio", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocostudio", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/cocostudio", + "to": "runtime/win32", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/extension", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/extension", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/extension", + "to": "runtime/win32", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/network", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/network", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/network", + "to": "runtime/win32", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/ui", + "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/ui", + "to": "runtime/ios/PrebuiltRuntimeLua.app", + "exclude": [] + }, + { + "from": "cocos/scripting/lua-bindings/script/ui", + "to": "runtime/win32", + "exclude": [] + }, { "from": "external/win32-specific/gles/prebuilt", "to": "runtime/win32", diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.c b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.c index e0acc689b0..c85809fb4d 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.c +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/lua_debugger.c @@ -1,9 +1,14 @@ /* debugger.c */ - +#if __cplusplus +extern "C"{ +#endif #include "lua.h" #include "lauxlib.h" #include "lua_debugger.h" +#if __cplusplus +} +#endif /* ldt_debugger */ static const char lua_m_ldt_debugger[] = { diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json index 5ab381991f..4de0e4d168 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json @@ -30,10 +30,26 @@ "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", "to": "", diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 9aa6943f6b..a74f2a5642 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -7,6 +7,54 @@ objects = { /* Begin PBXBuildFile section */ + 152A3432199CE585004B68DC /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3430199CE585004B68DC /* CCBReaderLoad.lua */; }; + 152A3433199CE585004B68DC /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3430199CE585004B68DC /* CCBReaderLoad.lua */; }; + 152A3434199CE585004B68DC /* DeprecatedCocosBuilderClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3431199CE585004B68DC /* DeprecatedCocosBuilderClass.lua */; }; + 152A3435199CE585004B68DC /* DeprecatedCocosBuilderClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3431199CE585004B68DC /* DeprecatedCocosBuilderClass.lua */; }; + 152A345C199CE5A7004B68DC /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3458199CE5A7004B68DC /* CocoStudio.lua */; }; + 152A345D199CE5A7004B68DC /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3458199CE5A7004B68DC /* CocoStudio.lua */; }; + 152A345E199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3459199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua */; }; + 152A345F199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3459199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua */; }; + 152A3460199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A345A199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua */; }; + 152A3461199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A345A199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua */; }; + 152A3462199CE5A7004B68DC /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A345B199CE5A7004B68DC /* StudioConstants.lua */; }; + 152A3463199CE5A7004B68DC /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A345B199CE5A7004B68DC /* StudioConstants.lua */; }; + 152A3468199CE5B9004B68DC /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3464199CE5B9004B68DC /* DeprecatedExtensionClass.lua */; }; + 152A3469199CE5B9004B68DC /* DeprecatedExtensionClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3464199CE5B9004B68DC /* DeprecatedExtensionClass.lua */; }; + 152A346A199CE5B9004B68DC /* DeprecatedExtensionEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3465199CE5B9004B68DC /* DeprecatedExtensionEnum.lua */; }; + 152A346B199CE5B9004B68DC /* DeprecatedExtensionEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3465199CE5B9004B68DC /* DeprecatedExtensionEnum.lua */; }; + 152A346C199CE5B9004B68DC /* DeprecatedExtensionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3466199CE5B9004B68DC /* DeprecatedExtensionFunc.lua */; }; + 152A346D199CE5B9004B68DC /* DeprecatedExtensionFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3466199CE5B9004B68DC /* DeprecatedExtensionFunc.lua */; }; + 152A346E199CE5B9004B68DC /* ExtensionConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3467199CE5B9004B68DC /* ExtensionConstants.lua */; }; + 152A346F199CE5B9004B68DC /* ExtensionConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3467199CE5B9004B68DC /* ExtensionConstants.lua */; }; + 152A3474199CE5CE004B68DC /* DeprecatedUIEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3470199CE5CE004B68DC /* DeprecatedUIEnum.lua */; }; + 152A3475199CE5CE004B68DC /* DeprecatedUIEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3470199CE5CE004B68DC /* DeprecatedUIEnum.lua */; }; + 152A3476199CE5CE004B68DC /* DeprecatedUIFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3471199CE5CE004B68DC /* DeprecatedUIFunc.lua */; }; + 152A3477199CE5CE004B68DC /* DeprecatedUIFunc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3471199CE5CE004B68DC /* DeprecatedUIFunc.lua */; }; + 152A3478199CE5CE004B68DC /* experimentalUIConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3472199CE5CE004B68DC /* experimentalUIConstants.lua */; }; + 152A3479199CE5CE004B68DC /* experimentalUIConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3472199CE5CE004B68DC /* experimentalUIConstants.lua */; }; + 152A347A199CE5CE004B68DC /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3473199CE5CE004B68DC /* GuiConstants.lua */; }; + 152A347B199CE5CE004B68DC /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 152A3473199CE5CE004B68DC /* GuiConstants.lua */; }; + 152A347C199CE60E004B68DC /* libluacocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CCA198F220600DC375D /* libluacocosbuilder iOS.a */; }; + 152A347D199CE60E004B68DC /* libluacocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CC8198F220600DC375D /* libluacocostudio iOS.a */; }; + 152A347E199CE60E004B68DC /* libluaextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CC4198F220600DC375D /* libluaextension iOS.a */; }; + 152A347F199CE60E004B68DC /* libluaspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CCC198F220600DC375D /* libluaspine iOS.a */; }; + 152A3480199CE60E004B68DC /* libluaui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CC6198F220600DC375D /* libluaui iOS.a */; }; + 152A3481199CE624004B68DC /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C9E198F220600DC375D /* libcocosbuilder iOS.a */; }; + 152A3482199CE62F004B68DC /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C9C198F220600DC375D /* libcocostudio iOS.a */; }; + 152A3483199CE63A004B68DC /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4271834BDA200142BE0 /* libextension iOS.a */; }; + 152A3484199CE64A004B68DC /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CA0198F220600DC375D /* libspine iOS.a */; }; + 152A3485199CE64A004B68DC /* libui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C9A198F220600DC375D /* libui iOS.a */; }; + 152A3486199CE6B4004B68DC /* libcocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C94198F220600DC375D /* libcocosbuilder Mac.a */; }; + 152A3487199CE6B4004B68DC /* libcocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C92198F220600DC375D /* libcocostudio Mac.a */; }; + 152A3488199CE6B4004B68DC /* libextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4191834BDA200142BE0 /* libextension Mac.a */; }; + 152A3489199CE6B4004B68DC /* libluacocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CBA198F220600DC375D /* libluacocosbuilder Mac.a */; }; + 152A348A199CE6B4004B68DC /* libluacocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CB8198F220600DC375D /* libluacocostudio Mac.a */; }; + 152A348B199CE6B4004B68DC /* libluaextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CB4198F220600DC375D /* libluaextension Mac.a */; }; + 152A348C199CE6B4004B68DC /* libluaspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CBC198F220600DC375D /* libluaspine Mac.a */; }; + 152A348D199CE6B4004B68DC /* libluaui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CB6198F220600DC375D /* libluaui Mac.a */; }; + 152A348E199CE6B4004B68DC /* libspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C96198F220600DC375D /* libspine Mac.a */; }; + 152A348F199CE6B4004B68DC /* libui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C90198F220600DC375D /* libui Mac.a */; }; 15427CD3198F221400DC375D /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4251834BDA200142BE0 /* libcocos2d iOS.a */; }; 15427CD4198F221400DC375D /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A42D1834BDA200142BE0 /* libcocosdenshion iOS.a */; }; 15427CD5198F222200DC375D /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CD2198F220600DC375D /* libluacocos2d iOS.a */; }; @@ -183,6 +231,188 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 152A3490199CE727004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 155CA2C71988C494006E0A08; + remoteInfo = "libluaextension iOS"; + }; + 152A3492199CE727004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA300198B28A8000C57D3; + remoteInfo = "libluaui iOS"; + }; + 152A3494199CE727004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA381198B2934000C57D3; + remoteInfo = "libluacocostudio iOS"; + }; + 152A3496199CE727004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA27F198B2791000C57D3; + remoteInfo = "libluacocosbuilder iOS"; + }; + 152A3498199CE727004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA407198B2AFD000C57D3; + remoteInfo = "libluaspine iOS"; + }; + 152A349A199CE72E004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA486198B2B9B000C57D3; + remoteInfo = "libluanetwork iOS"; + }; + 152A349C199CE72E004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA523198B2D13000C57D3; + remoteInfo = "libluacocosdenshion iOS"; + }; + 152A349E199CE72E004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15EFA59E198B2DAA000C57D3; + remoteInfo = "libluacocos2d iOS"; + }; + 152A34A0199CE741004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "libextension iOS"; + }; + 152A34A2199CE741004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA2C19775E92004493CC; + remoteInfo = "libui iOS"; + }; + 152A34A4199CE741004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA6719775EBB004493CC; + remoteInfo = "libcocostudio iOS"; + }; + 152A34A6199CE741004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA6F19775ECE004493CC; + remoteInfo = "libcocosbuilder iOS"; + }; + 152A34A8199CE741004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B24EEA7719775EE1004493CC; + remoteInfo = "libspine iOS"; + }; + 152A34AA199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BD5F1986538000A46ACC; + remoteInfo = "libluaextension Mac"; + }; + 152A34AC199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1C0801987328E00A46ACC; + remoteInfo = "libluaui Mac"; + }; + 152A34AE199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BF7219865C2000A46ACC; + remoteInfo = "libluacocostudio Mac"; + }; + 152A34B0199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BE66198654BE00A46ACC; + remoteInfo = "libluacocosbuilder Mac"; + }; + 152A34B2199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BFF819865E5F00A46ACC; + remoteInfo = "libluaspine Mac"; + }; + 152A34B4199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1C1061987340C00A46ACC; + remoteInfo = "libluanetwork Mac"; + }; + 152A34B6199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1BEEE19865A0600A46ACC; + remoteInfo = "libluacocosdenshion Mac"; + }; + 152A34B8199CE758004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15C1C255198748D200A46ACC; + remoteInfo = "libluacocos2d Mac"; + }; + 152A34BA199CE766004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2FC117814595006731B9; + remoteInfo = "libextension Mac"; + }; + 152A34BC199CE766004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B245F10019766132001920FD; + remoteInfo = "libui Mac"; + }; + 152A34BE199CE766004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B2DB48161976716E00411E16; + remoteInfo = "libcocostudio Mac"; + }; + 152A34C0199CE766004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B2DB479B197669A100411E16; + remoteInfo = "libcocosbuilder Mac"; + }; + 152A34C2199CE766004B68DC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B2DB48CA19767F1F00411E16; + remoteInfo = "libspine Mac"; + }; 15427C8F198F220600DC375D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; @@ -480,6 +710,20 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 152A3430199CE585004B68DC /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosbuilder/CCBReaderLoad.lua"; sourceTree = ""; }; + 152A3431199CE585004B68DC /* DeprecatedCocosBuilderClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocosBuilderClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocosbuilder/DeprecatedCocosBuilderClass.lua"; sourceTree = ""; }; + 152A3458199CE5A7004B68DC /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/CocoStudio.lua"; sourceTree = ""; }; + 152A3459199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua"; sourceTree = ""; }; + 152A345A199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedCocoStudioFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua"; sourceTree = ""; }; + 152A345B199CE5A7004B68DC /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/cocostudio/StudioConstants.lua"; sourceTree = ""; }; + 152A3464199CE5B9004B68DC /* DeprecatedExtensionClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionClass.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua"; sourceTree = ""; }; + 152A3465199CE5B9004B68DC /* DeprecatedExtensionEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua"; sourceTree = ""; }; + 152A3466199CE5B9004B68DC /* DeprecatedExtensionFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedExtensionFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua"; sourceTree = ""; }; + 152A3467199CE5B9004B68DC /* ExtensionConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ExtensionConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua"; sourceTree = ""; }; + 152A3470199CE5CE004B68DC /* DeprecatedUIEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIEnum.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua"; sourceTree = ""; }; + 152A3471199CE5CE004B68DC /* DeprecatedUIFunc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedUIFunc.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua"; sourceTree = ""; }; + 152A3472199CE5CE004B68DC /* experimentalUIConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalUIConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/experimentalUIConstants.lua"; sourceTree = ""; }; + 152A3473199CE5CE004B68DC /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = "../../cocos2d-x/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua"; sourceTree = ""; }; 15427CE2198F237300DC375D /* lua_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_module_register.h; path = ../Classes/lua_module_register.h; sourceTree = ""; }; 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = ""; }; 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; @@ -631,10 +875,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 15AA7D47199B514300725633 /* libluanetwork Mac.a in Frameworks */, + 152A3486199CE6B4004B68DC /* libcocosbuilder Mac.a in Frameworks */, + 152A3487199CE6B4004B68DC /* libcocostudio Mac.a in Frameworks */, + 152A3488199CE6B4004B68DC /* libextension Mac.a in Frameworks */, + 152A348C199CE6B4004B68DC /* libluaspine Mac.a in Frameworks */, + 152A348F199CE6B4004B68DC /* libui Mac.a in Frameworks */, 15427CF0198F24C400DC375D /* libnetwork Mac.a in Frameworks */, 15427CEF198F24BD00DC375D /* libcocosdenshion Mac.a in Frameworks */, 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */, + 152A348E199CE6B4004B68DC /* libspine Mac.a in Frameworks */, + 152A3489199CE6B4004B68DC /* libluacocosbuilder Mac.a in Frameworks */, + 152A348B199CE6B4004B68DC /* libluaextension Mac.a in Frameworks */, + 152A348A199CE6B4004B68DC /* libluacocostudio Mac.a in Frameworks */, + 152A348D199CE6B4004B68DC /* libluaui Mac.a in Frameworks */, + 15AA7D47199B514300725633 /* libluanetwork Mac.a in Frameworks */, 15427CEC198F24A600DC375D /* libluacocos2d Mac.a in Frameworks */, 15427CED198F24A600DC375D /* libluacocosdenshion Mac.a in Frameworks */, 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */, @@ -655,6 +909,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 152A3484199CE64A004B68DC /* libspine iOS.a in Frameworks */, + 152A3485199CE64A004B68DC /* libui iOS.a in Frameworks */, + 152A3483199CE63A004B68DC /* libextension iOS.a in Frameworks */, + 152A3482199CE62F004B68DC /* libcocostudio iOS.a in Frameworks */, + 152A3481199CE624004B68DC /* libcocosbuilder iOS.a in Frameworks */, + 152A347C199CE60E004B68DC /* libluacocosbuilder iOS.a in Frameworks */, + 152A347D199CE60E004B68DC /* libluacocostudio iOS.a in Frameworks */, + 152A347E199CE60E004B68DC /* libluaextension iOS.a in Frameworks */, + 152A347F199CE60E004B68DC /* libluaspine iOS.a in Frameworks */, + 152A3480199CE60E004B68DC /* libluaui iOS.a in Frameworks */, 15AA7D36199B513100725633 /* libluanetwork iOS.a in Frameworks */, 15427CE3198F23A100DC375D /* libnetwork iOS.a in Frameworks */, 15427CD5198F222200DC375D /* libluacocos2d iOS.a in Frameworks */, @@ -708,6 +972,20 @@ 1A0227A417A3AA1A00B867AD /* Lua Common */ = { isa = PBXGroup; children = ( + 152A3470199CE5CE004B68DC /* DeprecatedUIEnum.lua */, + 152A3471199CE5CE004B68DC /* DeprecatedUIFunc.lua */, + 152A3472199CE5CE004B68DC /* experimentalUIConstants.lua */, + 152A3473199CE5CE004B68DC /* GuiConstants.lua */, + 152A3464199CE5B9004B68DC /* DeprecatedExtensionClass.lua */, + 152A3465199CE5B9004B68DC /* DeprecatedExtensionEnum.lua */, + 152A3466199CE5B9004B68DC /* DeprecatedExtensionFunc.lua */, + 152A3467199CE5B9004B68DC /* ExtensionConstants.lua */, + 152A3458199CE5A7004B68DC /* CocoStudio.lua */, + 152A3459199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua */, + 152A345A199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua */, + 152A345B199CE5A7004B68DC /* StudioConstants.lua */, + 152A3430199CE585004B68DC /* CCBReaderLoad.lua */, + 152A3431199CE585004B68DC /* DeprecatedCocosBuilderClass.lua */, 15AA962E199B525400725633 /* DeprecatedNetworkClass.lua */, 15AA962F199B525400725633 /* DeprecatedNetworkEnum.lua */, 15AA9630199B525400725633 /* DeprecatedNetworkFunc.lua */, @@ -1008,6 +1286,19 @@ buildRules = ( ); dependencies = ( + 152A34BB199CE766004B68DC /* PBXTargetDependency */, + 152A34BD199CE766004B68DC /* PBXTargetDependency */, + 152A34BF199CE766004B68DC /* PBXTargetDependency */, + 152A34C1199CE766004B68DC /* PBXTargetDependency */, + 152A34C3199CE766004B68DC /* PBXTargetDependency */, + 152A34AB199CE758004B68DC /* PBXTargetDependency */, + 152A34AD199CE758004B68DC /* PBXTargetDependency */, + 152A34AF199CE758004B68DC /* PBXTargetDependency */, + 152A34B1199CE758004B68DC /* PBXTargetDependency */, + 152A34B3199CE758004B68DC /* PBXTargetDependency */, + 152A34B5199CE758004B68DC /* PBXTargetDependency */, + 152A34B7199CE758004B68DC /* PBXTargetDependency */, + 152A34B9199CE758004B68DC /* PBXTargetDependency */, 15427CE7198F23E600DC375D /* PBXTargetDependency */, C0A2F04118975FF80072A7AB /* PBXTargetDependency */, C0A2F03D18975FEB0072A7AB /* PBXTargetDependency */, @@ -1029,6 +1320,19 @@ buildRules = ( ); dependencies = ( + 152A349B199CE72E004B68DC /* PBXTargetDependency */, + 152A349D199CE72E004B68DC /* PBXTargetDependency */, + 152A349F199CE72E004B68DC /* PBXTargetDependency */, + 152A3491199CE727004B68DC /* PBXTargetDependency */, + 152A3493199CE727004B68DC /* PBXTargetDependency */, + 152A3495199CE727004B68DC /* PBXTargetDependency */, + 152A3497199CE727004B68DC /* PBXTargetDependency */, + 152A3499199CE727004B68DC /* PBXTargetDependency */, + 152A34A1199CE741004B68DC /* PBXTargetDependency */, + 152A34A3199CE741004B68DC /* PBXTargetDependency */, + 152A34A5199CE741004B68DC /* PBXTargetDependency */, + 152A34A7199CE741004B68DC /* PBXTargetDependency */, + 152A34A9199CE741004B68DC /* PBXTargetDependency */, 15D1F30B1994BBE500302043 /* PBXTargetDependency */, 15D1F3091994BBCA00302043 /* PBXTargetDependency */, 15427CE5198F23B300DC375D /* PBXTargetDependency */, @@ -1339,28 +1643,39 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 152A3469199CE5B9004B68DC /* DeprecatedExtensionClass.lua in Resources */, + 152A345F199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua in Resources */, 15AA7D5F199B51F000725633 /* smtp.lua in Resources */, 15AA7D63199B51F000725633 /* tp.lua in Resources */, 15AA7D5D199B51F000725633 /* mime.lua in Resources */, 15AA9635199B525400725633 /* DeprecatedNetworkEnum.lua in Resources */, + 152A346B199CE5B9004B68DC /* DeprecatedExtensionEnum.lua in Resources */, + 152A3475199CE5CE004B68DC /* DeprecatedUIEnum.lua in Resources */, + 152A3435199CE585004B68DC /* DeprecatedCocosBuilderClass.lua in Resources */, C03781BA18BF655400FE4F13 /* res in Resources */, 15D1FE131998714100302043 /* OpenglConstants.lua in Resources */, 15D1FE071998714100302043 /* DrawPrimitives.lua in Resources */, C03781BC18BF655400FE4F13 /* src in Resources */, 15D1FE111998714100302043 /* Opengl.lua in Resources */, C07828F918B4D72E00BD2287 /* MainMenu.xib in Resources */, + 152A345D199CE5A7004B68DC /* CocoStudio.lua in Resources */, 15D1FE0D1998714100302043 /* luaj.lua in Resources */, 15AA7D65199B51F000725633 /* url.lua in Resources */, 15AA7D5B199B51F000725633 /* mbox.lua in Resources */, 15D1FE051998714100302043 /* DeprecatedOpenglEnum.lua in Resources */, + 152A3479199CE5CE004B68DC /* experimentalUIConstants.lua in Resources */, 5023817617EBBE3400990C9B /* Icon.icns in Resources */, + 152A3463199CE5A7004B68DC /* StudioConstants.lua in Resources */, 15D1FE031998714100302043 /* DeprecatedCocos2dFunc.lua in Resources */, 15AA7D59199B51F000725633 /* ltn12.lua in Resources */, 15D1FDFF1998714100302043 /* DeprecatedCocos2dClass.lua in Resources */, 15AA7D53199B51F000725633 /* ftp.lua in Resources */, + 152A346D199CE5B9004B68DC /* DeprecatedExtensionFunc.lua in Resources */, 15D1FE1C1998715500302043 /* DeprecatedCocosDenshionFunc.lua in Resources */, 15D1FDF91998714100302043 /* bitExtend.lua in Resources */, 15D1FE011998714100302043 /* DeprecatedCocos2dEnum.lua in Resources */, + 152A3461199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua in Resources */, + 152A3477199CE5CE004B68DC /* DeprecatedUIFunc.lua in Resources */, 15D1FE0B1998714100302043 /* json.lua in Resources */, 15AA9639199B525400725633 /* NetworkConstants.lua in Resources */, 15D1FE091998714100302043 /* extern.lua in Resources */, @@ -1369,12 +1684,15 @@ 15D1FE1A1998715500302043 /* DeprecatedCocosDenshionClass.lua in Resources */, C05D1C131923449100B808A4 /* config.json in Resources */, 15AA9633199B525400725633 /* DeprecatedNetworkClass.lua in Resources */, + 152A346F199CE5B9004B68DC /* ExtensionConstants.lua in Resources */, 15D1FE0F1998714100302043 /* luaoc.lua in Resources */, 15AA7D57199B51F000725633 /* http.lua in Resources */, + 152A347B199CE5CE004B68DC /* GuiConstants.lua in Resources */, 15D1FDFD1998714100302043 /* Cocos2dConstants.lua in Resources */, 15D1FDFB1998714100302043 /* Cocos2d.lua in Resources */, 15D1FE181998715500302043 /* AudioEngine.lua in Resources */, 15AA7D55199B51F000725633 /* headers.lua in Resources */, + 152A3433199CE585004B68DC /* CCBReaderLoad.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1382,13 +1700,16 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 152A345C199CE5A7004B68DC /* CocoStudio.lua in Resources */, 15D1FDF81998714100302043 /* bitExtend.lua in Resources */, 15AA7D52199B51F000725633 /* ftp.lua in Resources */, 15AA7D58199B51F000725633 /* ltn12.lua in Resources */, 15AA7D5A199B51F000725633 /* mbox.lua in Resources */, 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */, + 152A3478199CE5CE004B68DC /* experimentalUIConstants.lua in Resources */, 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */, 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */, + 152A346E199CE5B9004B68DC /* ExtensionConstants.lua in Resources */, 15AA7D54199B51F000725633 /* headers.lua in Resources */, 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */, 15D1FDFE1998714100302043 /* DeprecatedCocos2dClass.lua in Resources */, @@ -1397,11 +1718,13 @@ 15D1FE061998714100302043 /* DrawPrimitives.lua in Resources */, 15AA7D56199B51F000725633 /* http.lua in Resources */, 15D1FE191998715500302043 /* DeprecatedCocosDenshionClass.lua in Resources */, + 152A3476199CE5CE004B68DC /* DeprecatedUIFunc.lua in Resources */, 15D1FDFA1998714100302043 /* Cocos2d.lua in Resources */, 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */, 15D1FE0C1998714100302043 /* luaj.lua in Resources */, 5091733917ECE17A00D62437 /* Icon-58.png in Resources */, 15D1FE121998714100302043 /* OpenglConstants.lua in Resources */, + 152A3474199CE5CE004B68DC /* DeprecatedUIEnum.lua in Resources */, 15D1FE021998714100302043 /* DeprecatedCocos2dFunc.lua in Resources */, 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */, 5023812017EBBCAC00990C9B /* Icon-57.png in Resources */, @@ -1411,13 +1734,17 @@ 15D1FE1B1998715500302043 /* DeprecatedCocosDenshionFunc.lua in Resources */, 5023812217EBBCAC00990C9B /* Icon-76.png in Resources */, 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */, + 152A347A199CE5CE004B68DC /* GuiConstants.lua in Resources */, 15D1FE0A1998714100302043 /* json.lua in Resources */, 15AA7D5C199B51F000725633 /* mime.lua in Resources */, + 152A3462199CE5A7004B68DC /* StudioConstants.lua in Resources */, 15D1FE041998714100302043 /* DeprecatedOpenglEnum.lua in Resources */, + 152A3468199CE5B9004B68DC /* DeprecatedExtensionClass.lua in Resources */, 5091733717ECE17A00D62437 /* Icon-40.png in Resources */, 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */, 5023811A17EBBCAC00990C9B /* Default.png in Resources */, 15AA7D5E199B51F000725633 /* smtp.lua in Resources */, + 152A3434199CE585004B68DC /* DeprecatedCocosBuilderClass.lua in Resources */, 15AA9632199B525400725633 /* DeprecatedNetworkClass.lua in Resources */, 15D1FE171998715500302043 /* AudioEngine.lua in Resources */, C03781BB18BF655400FE4F13 /* src in Resources */, @@ -1427,10 +1754,15 @@ 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */, 15AA7D62199B51F000725633 /* tp.lua in Resources */, 15D1FDFC1998714100302043 /* Cocos2dConstants.lua in Resources */, + 152A3432199CE585004B68DC /* CCBReaderLoad.lua in Resources */, 15AA9638199B525400725633 /* NetworkConstants.lua in Resources */, 15AA7D64199B51F000725633 /* url.lua in Resources */, + 152A346A199CE5B9004B68DC /* DeprecatedExtensionEnum.lua in Resources */, + 152A346C199CE5B9004B68DC /* DeprecatedExtensionFunc.lua in Resources */, C05D1C121923449100B808A4 /* config.json in Resources */, 15D1FE0E1998714100302043 /* luaoc.lua in Resources */, + 152A3460199CE5A7004B68DC /* DeprecatedCocoStudioFunc.lua in Resources */, + 152A345E199CE5A7004B68DC /* DeprecatedCocoStudioClass.lua in Resources */, 15D1FE101998714100302043 /* Opengl.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1537,6 +1869,136 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 152A3491199CE727004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaextension iOS"; + targetProxy = 152A3490199CE727004B68DC /* PBXContainerItemProxy */; + }; + 152A3493199CE727004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaui iOS"; + targetProxy = 152A3492199CE727004B68DC /* PBXContainerItemProxy */; + }; + 152A3495199CE727004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocostudio iOS"; + targetProxy = 152A3494199CE727004B68DC /* PBXContainerItemProxy */; + }; + 152A3497199CE727004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocosbuilder iOS"; + targetProxy = 152A3496199CE727004B68DC /* PBXContainerItemProxy */; + }; + 152A3499199CE727004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaspine iOS"; + targetProxy = 152A3498199CE727004B68DC /* PBXContainerItemProxy */; + }; + 152A349B199CE72E004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluanetwork iOS"; + targetProxy = 152A349A199CE72E004B68DC /* PBXContainerItemProxy */; + }; + 152A349D199CE72E004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocosdenshion iOS"; + targetProxy = 152A349C199CE72E004B68DC /* PBXContainerItemProxy */; + }; + 152A349F199CE72E004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos2d iOS"; + targetProxy = 152A349E199CE72E004B68DC /* PBXContainerItemProxy */; + }; + 152A34A1199CE741004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libextension iOS"; + targetProxy = 152A34A0199CE741004B68DC /* PBXContainerItemProxy */; + }; + 152A34A3199CE741004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libui iOS"; + targetProxy = 152A34A2199CE741004B68DC /* PBXContainerItemProxy */; + }; + 152A34A5199CE741004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocostudio iOS"; + targetProxy = 152A34A4199CE741004B68DC /* PBXContainerItemProxy */; + }; + 152A34A7199CE741004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocosbuilder iOS"; + targetProxy = 152A34A6199CE741004B68DC /* PBXContainerItemProxy */; + }; + 152A34A9199CE741004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libspine iOS"; + targetProxy = 152A34A8199CE741004B68DC /* PBXContainerItemProxy */; + }; + 152A34AB199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaextension Mac"; + targetProxy = 152A34AA199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34AD199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaui Mac"; + targetProxy = 152A34AC199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34AF199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocostudio Mac"; + targetProxy = 152A34AE199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34B1199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocosbuilder Mac"; + targetProxy = 152A34B0199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34B3199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluaspine Mac"; + targetProxy = 152A34B2199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34B5199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluanetwork Mac"; + targetProxy = 152A34B4199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34B7199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocosdenshion Mac"; + targetProxy = 152A34B6199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34B9199CE758004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos2d Mac"; + targetProxy = 152A34B8199CE758004B68DC /* PBXContainerItemProxy */; + }; + 152A34BB199CE766004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libextension Mac"; + targetProxy = 152A34BA199CE766004B68DC /* PBXContainerItemProxy */; + }; + 152A34BD199CE766004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libui Mac"; + targetProxy = 152A34BC199CE766004B68DC /* PBXContainerItemProxy */; + }; + 152A34BF199CE766004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocostudio Mac"; + targetProxy = 152A34BE199CE766004B68DC /* PBXContainerItemProxy */; + }; + 152A34C1199CE766004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocosbuilder Mac"; + targetProxy = 152A34C0199CE766004B68DC /* PBXContainerItemProxy */; + }; + 152A34C3199CE766004B68DC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libspine Mac"; + targetProxy = 152A34C2199CE766004B68DC /* PBXContainerItemProxy */; + }; 15427CE5198F23B300DC375D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libnetwork iOS"; diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln index 7bad96de2e..c3c7e7e29e 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -22,6 +22,28 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosdenshion", "..\. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluanetwork", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluanetwork.vcxproj", "{65E52F4B-703F-419E-AD67-926241A10042}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosbuilder", "..\..\cocos2d-x\cocos\editor-support\cocosbuilder\proj.win32\libcocosbuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\..\cocos2d-x\cocos\editor-support\cocostudio\proj.win32\libcocostudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\cocos2d-x\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\..\cocos2d-x\cocos\ui\proj.win32\libui.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\..\cocos2d-x\extensions\proj.win32\libextension.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosbuilder", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocosbuilder.vcxproj", "{F8198014-F4F3-49F0-88AB-C1969A5829AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocostudio", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocostudio.vcxproj", "{9640951E-C5D0-47B5-9C42-0BCADA261C50}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaextension", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaextension.vcxproj", "{7068296E-38A4-4BCA-85DB-3A09BD014847}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaspine.vcxproj", "{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaui", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaui.vcxproj", "{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -60,6 +82,50 @@ Global {65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.Build.0 = Debug|Win32 {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.ActiveCfg = Release|Win32 {65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.Build.0 = Release|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32 + {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.Build.0 = Release|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32 + {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Debug|Win32.ActiveCfg = Debug|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Debug|Win32.Build.0 = Debug|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Release|Win32.ActiveCfg = Release|Win32 + {F8198014-F4F3-49F0-88AB-C1969A5829AF}.Release|Win32.Build.0 = Release|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Debug|Win32.ActiveCfg = Debug|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Debug|Win32.Build.0 = Debug|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Release|Win32.ActiveCfg = Release|Win32 + {9640951E-C5D0-47B5-9C42-0BCADA261C50}.Release|Win32.Build.0 = Release|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Debug|Win32.ActiveCfg = Debug|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Debug|Win32.Build.0 = Debug|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Release|Win32.ActiveCfg = Release|Win32 + {7068296E-38A4-4BCA-85DB-3A09BD014847}.Release|Win32.Build.0 = Release|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.ActiveCfg = Debug|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.Build.0 = Debug|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.ActiveCfg = Release|Win32 + {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.Build.0 = Release|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.Build.0 = Debug|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.ActiveCfg = Release|Win32 + {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 9dc61c7f96..86b88da24f 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -80,6 +80,7 @@ true $(IntDir)vc$(PlatformToolsetVersion).pdb algorithm + CompileAsCpp Windows @@ -111,8 +112,12 @@ if not exist "$(LocalDebuggerWorkingDirectory)" mkdir "$(LocalDebuggerWorkingDirectory)" xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\network\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y -xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosbuilder\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\extension\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\ui\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocostudio\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y copy files @@ -138,6 +143,7 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden true $(IntDir)vc$(PlatformToolsetVersion).pdb algorithm + CompileAsCpp Windows @@ -175,7 +181,10 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(LocalDebugg xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\network\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocos2d\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosdenshion\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y - +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosbuilder\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\extension\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\ui\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y +xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocostudio\*.lua" "$(LocalDebuggerWorkingDirectory)" /e /Y copy files @@ -254,12 +263,27 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\cocosden {9f2d6ce6-c893-4400-b50c-6db70cc2562f} + + {f8198014-f4f3-49f0-88ab-c1969a5829af} + {46a7d57a-7f25-4f52-823b-ffac4ff3a624} + + {9640951e-c5d0-47b5-9c42-0bcada261c50} + + + {7068296e-38a4-4bca-85db-3a09bd014847} + {65e52f4b-703f-419e-ad67-926241a10042} + + {31ef6ab1-0d9a-4bc6-99b8-2c482ea373c4} + + + {fe78eebb-3dbb-4713-8cbf-63d742c5bd82} + From 97d8d27eec3a7d4b504cd00b25e81a13f55d1266 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 14 Aug 2014 21:58:40 +0800 Subject: [PATCH 084/147] Add LOCAL_WHOLE_STATIC_LIBRARIES for lua-template-runtime on android --- .../frameworks/runtime-src/proj.android/jni/Android.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk index e6225d828d..f007cdfe62 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk @@ -43,6 +43,11 @@ $(LOCAL_PATH)/../../../cocos2d-x/external LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += extension_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += ui_lua_static include $(BUILD_SHARED_LIBRARY) From 55180c63e49271ae413328a0e8b7e503a2b132c4 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 14 Aug 2014 23:22:24 +0800 Subject: [PATCH 085/147] Add modules register functions for lua-template-runtime on android --- .../runtime-src/Classes/lua_module_register.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h index 1ce4720324..43a2c175b2 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h @@ -3,12 +3,22 @@ #include "network/lua_cocos2dx_network_manual.h" #include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" +#include "cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h" +#include "cocostudio/lua_cocos2dx_coco_studio_manual.hpp" +#include "extension/lua_cocos2dx_extension_manual.h" +#include "ui/lua_cocos2dx_ui_manual.hpp" +#include "spine/lua_cocos2dx_spine_manual.hpp" int lua_module_register(lua_State* L) { register_network_module(L); register_cocosdenshion_module(L); + register_cocosbuilder_module(L); + register_cocostudio_module(L); + register_extension_module(L); + register_ui_moudle(L); + register_spine_module(L); return 1; } From 76a9382a91c32fdf5e1bc822a58e779c43942121 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 15 Aug 2014 00:08:15 +0800 Subject: [PATCH 086/147] =?UTF-8?q?Rename=20folder=20names=20of=20cpp-temp?= =?UTF-8?q?late:=20=E2=80=98Classes=E2=80=99=E2=80=94>=E2=80=99src?= =?UTF-8?q?=E2=80=99=20,=E2=80=99Resource=E2=80=99=E2=80=94>=E2=80=99res?= =?UTF-8?q?=E2=80=99=20and=20adjust=20the=20template=20project=20except=20?= =?UTF-8?q?wp8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/cpp-template-default/CMakeLists.txt | 12 +- .../proj.android/build-cfg.json | 2 +- .../proj.android/build_native.py | 2 +- .../proj.android/jni/Android.mk | 6 +- .../HelloCpp.xcodeproj/project.pbxproj | 362 +++++++++++------- .../cpp-template-default/proj.linux/main.cpp | 2 +- .../proj.win32/HelloCpp.vcxproj | 12 +- .../proj.win32/HelloCpp.vcxproj.filters | 22 +- .../proj.win32/HelloCpp.vcxproj.user | 4 +- .../{Resources => res}/CloseNormal.png | Bin .../{Resources => res}/CloseSelected.png | Bin .../{Resources => res}/HelloWorld.png | Bin .../{Resources => res}/fonts/Marker Felt.ttf | Bin .../{Classes => src}/AppDelegate.cpp | 0 .../{Classes => src}/AppDelegate.h | 0 .../{Classes => src}/HelloWorldScene.cpp | 0 .../{Classes => src}/HelloWorldScene.h | 0 17 files changed, 256 insertions(+), 168 deletions(-) rename templates/cpp-template-default/{Resources => res}/CloseNormal.png (100%) rename templates/cpp-template-default/{Resources => res}/CloseSelected.png (100%) rename templates/cpp-template-default/{Resources => res}/HelloWorld.png (100%) rename templates/cpp-template-default/{Resources => res}/fonts/Marker Felt.ttf (100%) rename templates/cpp-template-default/{Classes => src}/AppDelegate.cpp (100%) rename templates/cpp-template-default/{Classes => src}/AppDelegate.h (100%) rename templates/cpp-template-default/{Classes => src}/HelloWorldScene.cpp (100%) rename templates/cpp-template-default/{Classes => src}/HelloWorldScene.h (100%) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 97c0813e94..afee5d541d 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -57,16 +57,16 @@ endif() if( UNIX ) #assume linux set(GAME_SRC proj.linux/main.cpp - Classes/AppDelegate.cpp - Classes/HelloWorldScene.cpp + src/AppDelegate.cpp + src/HelloWorldScene.cpp ) elseif ( WIN32 ) set(GAME_SRC proj.win32/main.cpp proj.win32/main.h proj.win32/resource.h - Classes/AppDelegate.cpp - Classes/HelloWorldScene.cpp + src/AppDelegate.cpp + src/HelloWorldScene.cpp ) endif() @@ -244,14 +244,14 @@ if ( WIN32 ) #also copying dlls to binary directory for the executable to run pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/res ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/gles/prebuilt/glew32.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE} COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/zlib/prebuilt/zlib1.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE} ) else() pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/res ${APP_BIN_DIR}/Resources ) endif() diff --git a/templates/cpp-template-default/proj.android/build-cfg.json b/templates/cpp-template-default/proj.android/build-cfg.json index 611f232c30..c719dc3cf2 100644 --- a/templates/cpp-template-default/proj.android/build-cfg.json +++ b/templates/cpp-template-default/proj.android/build-cfg.json @@ -6,7 +6,7 @@ ], "copy_resources": [ { - "from": "../Resources", + "from": "../res", "to": "" } ] diff --git a/templates/cpp-template-default/proj.android/build_native.py b/templates/cpp-template-default/proj.android/build_native.py index 97c9f89991..8f231b2478 100755 --- a/templates/cpp-template-default/proj.android/build_native.py +++ b/templates/cpp-template-default/proj.android/build_native.py @@ -114,7 +114,7 @@ def copy_resources(app_android_root): # copy resources os.mkdir(assets_dir) - resources_dir = os.path.join(app_android_root, "../Resources") + resources_dir = os.path.join(app_android_root, "../res") if os.path.isdir(resources_dir): copy_files(resources_dir, assets_dir) diff --git a/templates/cpp-template-default/proj.android/jni/Android.mk b/templates/cpp-template-default/proj.android/jni/Android.mk index cddef45aa8..55e22ede0b 100644 --- a/templates/cpp-template-default/proj.android/jni/Android.mk +++ b/templates/cpp-template-default/proj.android/jni/Android.mk @@ -11,10 +11,10 @@ LOCAL_MODULE := cocos2dcpp_shared LOCAL_MODULE_FILENAME := libcocos2dcpp LOCAL_SRC_FILES := hellocpp/main.cpp \ - ../../Classes/AppDelegate.cpp \ - ../../Classes/HelloWorldScene.cpp + ../../src/AppDelegate.cpp \ + ../../src/HelloWorldScene.cpp -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../src LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static diff --git a/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj b/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj index 15fe6d6f6b..8f4d492fbf 100644 --- a/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj +++ b/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj @@ -7,21 +7,26 @@ objects = { /* Begin PBXBuildFile section */ + 15A6DA93199CFB1100B56DBF /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA8F199CFB1100B56DBF /* AppDelegate.cpp */; }; + 15A6DA94199CFB1100B56DBF /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA8F199CFB1100B56DBF /* AppDelegate.cpp */; }; + 15A6DA95199CFB1100B56DBF /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA91199CFB1100B56DBF /* HelloWorldScene.cpp */; }; + 15A6DA96199CFB1100B56DBF /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA91199CFB1100B56DBF /* HelloWorldScene.cpp */; }; + 15A6DA9B199CFB9800B56DBF /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 15A6DA98199CFB9800B56DBF /* CloseNormal.png */; }; + 15A6DA9C199CFB9800B56DBF /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 15A6DA98199CFB9800B56DBF /* CloseNormal.png */; }; + 15A6DA9D199CFB9800B56DBF /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 15A6DA99199CFB9800B56DBF /* CloseSelected.png */; }; + 15A6DA9E199CFB9800B56DBF /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 15A6DA99199CFB9800B56DBF /* CloseSelected.png */; }; + 15A6DA9F199CFB9800B56DBF /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 15A6DA9A199CFB9800B56DBF /* HelloWorld.png */; }; + 15A6DAA0199CFB9800B56DBF /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 15A6DA9A199CFB9800B56DBF /* HelloWorld.png */; }; 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */; }; 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */; }; - 1AC6FB21180E996B004C840B /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */; }; - 1AC6FB22180E996B004C840B /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */; }; - 1AC6FB23180E996B004C840B /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */; }; + 1AC6FB21180E996B004C840B /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAF9180E9839004C840B /* libcocos2d Mac.a */; }; + 1AC6FB22180E996B004C840B /* libextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFB180E9839004C840B /* libextension Mac.a */; }; + 1AC6FB23180E996B004C840B /* libcocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB01180E9839004C840B /* libcocosdenshion Mac.a */; }; 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */; }; 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */; }; - 1AC6FB30180E99EB004C840B /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */; }; - 1AC6FB31180E99EB004C840B /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */; }; - 1AC6FB32180E99EB004C840B /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */; }; - 1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; }; - 1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; }; - 1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; }; - 1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; }; - 1AFAF8BE16D35E4900DB1158 /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */; }; + 1AC6FB30180E99EB004C840B /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB07180E9839004C840B /* libcocos2d iOS.a */; }; + 1AC6FB31180E99EB004C840B /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB09180E9839004C840B /* libextension iOS.a */; }; + 1AC6FB32180E99EB004C840B /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0F180E9839004C840B /* libcocosdenshion iOS.a */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; @@ -32,11 +37,6 @@ 503AE10517EB98FF00D1A890 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503AE10317EB98FF00D1A890 /* main.cpp */; }; 503AE11217EB99EE00D1A890 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 503AE11117EB99EE00D1A890 /* libcurl.dylib */; }; 503AE11B17EB9C5A00D1A890 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503AE11A17EB9C5A00D1A890 /* IOKit.framework */; }; - 5087E75317EB910900C73F5D /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; }; - 5087E75417EB910900C73F5D /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; }; - 5087E75517EB910900C73F5D /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */; }; - 5087E75717EB910900C73F5D /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; }; - 5087E75817EB910900C73F5D /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; }; 5087E76317EB910900C73F5D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 5087E76517EB910900C73F5D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; 5087E76717EB910900C73F5D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; }; @@ -72,6 +72,76 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 15A6DA7A199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B245F13A19766132001920FD; + remoteInfo = "libui Mac"; + }; + 15A6DA7C199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B2DB484D1976716E00411E16; + remoteInfo = "libcocostudio Mac"; + }; + 15A6DA7E199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B2DB47D2197669A100411E16; + remoteInfo = "libcocosbuilder Mac"; + }; + 15A6DA80199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B2DB490119767F1F00411E16; + remoteInfo = "libspine Mac"; + }; + 15A6DA82199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B2DB49C4197686CB00411E16; + remoteInfo = "libnetwork Mac"; + }; + 15A6DA84199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B24EEA6619775E92004493CC; + remoteInfo = "libui iOS"; + }; + 15A6DA86199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B24EEA6E19775EBB004493CC; + remoteInfo = "libcocostudio iOS"; + }; + 15A6DA88199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B24EEA7619775ECE004493CC; + remoteInfo = "libcocosbuilder iOS"; + }; + 15A6DA8A199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B24EEA7E19775EE1004493CC; + remoteInfo = "libspine iOS"; + }; + 15A6DA8C199CFAFD00B56DBF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B24EEA8619775EF3004493CC; + remoteInfo = "libnetwork iOS"; + }; 1AC6FAF8180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; @@ -107,20 +177,6 @@ remoteGlobalIDString = A03F2ED617814268006731B9; remoteInfo = "CocosDenshion Mac"; }; - 1AC6FB02180E9839004C840B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = A03F31FD1781479B006731B9; - remoteInfo = "jsbindings Mac"; - }; - 1AC6FB04180E9839004C840B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 1A6FB53017854BC300CDF010; - remoteInfo = "luabindings Mac"; - }; 1AC6FB06180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; @@ -156,20 +212,6 @@ remoteGlobalIDString = A07A4FB4178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; - 1AC6FB10180E9839004C840B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = A07A5030178387750073F6A7; - remoteInfo = "jsbindings iOS"; - }; - 1AC6FB12180E9839004C840B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 1A119791178526AA00D62A44; - remoteInfo = "luabindings iOS"; - }; 1AC6FB15180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; @@ -243,15 +285,15 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 15A6DA8F199CFB1100B56DBF /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../src/AppDelegate.cpp; sourceTree = ""; }; + 15A6DA90199CFB1100B56DBF /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../src/AppDelegate.h; sourceTree = ""; }; + 15A6DA91199CFB1100B56DBF /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../src/HelloWorldScene.cpp; sourceTree = ""; }; + 15A6DA92199CFB1100B56DBF /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../src/HelloWorldScene.h; sourceTree = ""; }; + 15A6DA98199CFB9800B56DBF /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloseNormal.png; path = ../res/CloseNormal.png; sourceTree = ""; }; + 15A6DA99199CFB9800B56DBF /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloseSelected.png; path = ../res/CloseSelected.png; sourceTree = ""; }; + 15A6DA9A199CFB9800B56DBF /* HelloWorld.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HelloWorld.png; path = ../res/HelloWorld.png; sourceTree = ""; }; 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1ACB3243164770DE00914215 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; - 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; - 1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; - 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = ""; }; - 1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = ""; }; - 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = ""; }; - 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = ""; }; - 1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = HelloWorld.png; sourceTree = ""; }; 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1D6058910D05DD3D006BFB54 /* HelloCpp iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloCpp iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; @@ -304,9 +346,9 @@ files = ( 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */, 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */, - 1AC6FB30180E99EB004C840B /* libcocos2dx iOS.a in Frameworks */, - 1AC6FB31180E99EB004C840B /* libcocos2dx-extensions iOS.a in Frameworks */, - 1AC6FB32180E99EB004C840B /* libCocosDenshion iOS.a in Frameworks */, + 1AC6FB30180E99EB004C840B /* libcocos2d iOS.a in Frameworks */, + 1AC6FB31180E99EB004C840B /* libextension iOS.a in Frameworks */, + 1AC6FB32180E99EB004C840B /* libcocosdenshion iOS.a in Frameworks */, D6B0611B1803AB670077942B /* CoreMotion.framework in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, @@ -326,9 +368,9 @@ files = ( 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */, 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */, - 1AC6FB21180E996B004C840B /* libcocos2dx Mac.a in Frameworks */, - 1AC6FB22180E996B004C840B /* libcocos2dx-extensions Mac.a in Frameworks */, - 1AC6FB23180E996B004C840B /* libCocosDenshion Mac.a in Frameworks */, + 1AC6FB21180E996B004C840B /* libcocos2d Mac.a in Frameworks */, + 1AC6FB22180E996B004C840B /* libextension Mac.a in Frameworks */, + 1AC6FB23180E996B004C840B /* libcocosdenshion Mac.a in Frameworks */, 503AE11217EB99EE00D1A890 /* libcurl.dylib in Frameworks */, 5087E76717EB910900C73F5D /* libz.dylib in Frameworks */, 503AE11B17EB9C5A00D1A890 /* IOKit.framework in Frameworks */, @@ -361,16 +403,25 @@ path = Classes; sourceTree = ""; }; - 15AA9C4015B7EC450033D6C2 /* Classes */ = { + 15A6DA8E199CFB0100B56DBF /* src */ = { isa = PBXGroup; children = ( - 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */, - 1AFAF8B416D35DE700DB1158 /* AppDelegate.h */, - 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */, - 1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */, + 15A6DA8F199CFB1100B56DBF /* AppDelegate.cpp */, + 15A6DA90199CFB1100B56DBF /* AppDelegate.h */, + 15A6DA91199CFB1100B56DBF /* HelloWorldScene.cpp */, + 15A6DA92199CFB1100B56DBF /* HelloWorldScene.h */, ); - name = Classes; - path = ../classes; + name = src; + sourceTree = ""; + }; + 15A6DA97199CFB8700B56DBF /* res */ = { + isa = PBXGroup; + children = ( + 15A6DA98199CFB9800B56DBF /* CloseNormal.png */, + 15A6DA99199CFB9800B56DBF /* CloseSelected.png */, + 15A6DA9A199CFB9800B56DBF /* HelloWorld.png */, + ); + name = res; sourceTree = ""; }; 19C28FACFE9D520D11CA2CBB /* Products */ = { @@ -385,20 +436,26 @@ 1AC6FAE6180E9839004C840B /* Products */ = { isa = PBXGroup; children = ( - 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */, - 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FAF9180E9839004C840B /* libcocos2d Mac.a */, + 1AC6FAFB180E9839004C840B /* libextension Mac.a */, + 15A6DA7B199CFAFD00B56DBF /* libui Mac.a */, + 15A6DA7D199CFAFD00B56DBF /* libcocostudio Mac.a */, + 15A6DA7F199CFAFD00B56DBF /* libcocosbuilder Mac.a */, + 15A6DA81199CFAFD00B56DBF /* libspine Mac.a */, + 15A6DA83199CFAFD00B56DBF /* libnetwork Mac.a */, 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */, 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */, - 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */, - 1AC6FB03180E9839004C840B /* libjsbindings Mac.a */, - 1AC6FB05180E9839004C840B /* libluabindings Mac.a */, - 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */, - 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB01180E9839004C840B /* libcocosdenshion Mac.a */, + 1AC6FB07180E9839004C840B /* libcocos2d iOS.a */, + 1AC6FB09180E9839004C840B /* libextension iOS.a */, 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */, 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */, - 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */, - 1AC6FB11180E9839004C840B /* libjsbindings iOS.a */, - 1AC6FB13180E9839004C840B /* libluabindings iOS.a */, + 1AC6FB0F180E9839004C840B /* libcocosdenshion iOS.a */, + 15A6DA85199CFAFD00B56DBF /* libui iOS.a */, + 15A6DA87199CFAFD00B56DBF /* libcocostudio iOS.a */, + 15A6DA89199CFAFD00B56DBF /* libcocosbuilder iOS.a */, + 15A6DA8B199CFAFD00B56DBF /* libspine iOS.a */, + 15A6DA8D199CFAFD00B56DBF /* libnetwork iOS.a */, ); name = Products; sourceTree = ""; @@ -407,12 +464,12 @@ isa = PBXGroup; children = ( 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */, - 15AA9C4015B7EC450033D6C2 /* Classes */, + 15A6DA8E199CFB0100B56DBF /* src */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 080E96DDFE201D6D7F000001 /* ios */, 503AE10617EB990700D1A890 /* mac */, 19C28FACFE9D520D11CA2CBB /* Products */, - 78C7DDAA14EBA5050085D0C2 /* Resources */, + 15A6DA97199CFB8700B56DBF /* res */, ); name = CustomTemplate; sourceTree = ""; @@ -484,17 +541,6 @@ path = ios; sourceTree = SOURCE_ROOT; }; - 78C7DDAA14EBA5050085D0C2 /* Resources */ = { - isa = PBXGroup; - children = ( - 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */, - 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */, - 1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */, - ); - name = Resources; - path = ../Resources; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -582,17 +628,87 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */ = { + 15A6DA7B199CFAFD00B56DBF /* libui Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx Mac.a"; + path = "libui Mac.a"; + remoteRef = 15A6DA7A199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA7D199CFAFD00B56DBF /* libcocostudio Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocostudio Mac.a"; + remoteRef = 15A6DA7C199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA7F199CFAFD00B56DBF /* libcocosbuilder Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocosbuilder Mac.a"; + remoteRef = 15A6DA7E199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA81199CFAFD00B56DBF /* libspine Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libspine Mac.a"; + remoteRef = 15A6DA80199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA83199CFAFD00B56DBF /* libnetwork Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libnetwork Mac.a"; + remoteRef = 15A6DA82199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA85199CFAFD00B56DBF /* libui iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libui iOS.a"; + remoteRef = 15A6DA84199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA87199CFAFD00B56DBF /* libcocostudio iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocostudio iOS.a"; + remoteRef = 15A6DA86199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA89199CFAFD00B56DBF /* libcocosbuilder iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocosbuilder iOS.a"; + remoteRef = 15A6DA88199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA8B199CFAFD00B56DBF /* libspine iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libspine iOS.a"; + remoteRef = 15A6DA8A199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 15A6DA8D199CFAFD00B56DBF /* libnetwork iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libnetwork iOS.a"; + remoteRef = 15A6DA8C199CFAFD00B56DBF /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FAF9180E9839004C840B /* libcocos2d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2d Mac.a"; remoteRef = 1AC6FAF8180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */ = { + 1AC6FAFB180E9839004C840B /* libextension Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx-extensions Mac.a"; + path = "libextension Mac.a"; remoteRef = 1AC6FAFA180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -610,38 +726,24 @@ remoteRef = 1AC6FAFE180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */ = { + 1AC6FB01180E9839004C840B /* libcocosdenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libCocosDenshion Mac.a"; + path = "libcocosdenshion Mac.a"; remoteRef = 1AC6FB00180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AC6FB03180E9839004C840B /* libjsbindings Mac.a */ = { + 1AC6FB07180E9839004C840B /* libcocos2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libjsbindings Mac.a"; - remoteRef = 1AC6FB02180E9839004C840B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1AC6FB05180E9839004C840B /* libluabindings Mac.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libluabindings Mac.a"; - remoteRef = 1AC6FB04180E9839004C840B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libcocos2dx iOS.a"; + path = "libcocos2d iOS.a"; remoteRef = 1AC6FB06180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */ = { + 1AC6FB09180E9839004C840B /* libextension iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx-extensions iOS.a"; + path = "libextension iOS.a"; remoteRef = 1AC6FB08180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -659,27 +761,13 @@ remoteRef = 1AC6FB0C180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */ = { + 1AC6FB0F180E9839004C840B /* libcocosdenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libCocosDenshion iOS.a"; + path = "libcocosdenshion iOS.a"; remoteRef = 1AC6FB0E180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AC6FB11180E9839004C840B /* libjsbindings iOS.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libjsbindings iOS.a"; - remoteRef = 1AC6FB10180E9839004C840B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1AC6FB13180E9839004C840B /* libluabindings iOS.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libluabindings iOS.a"; - remoteRef = 1AC6FB12180E9839004C840B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -688,23 +776,23 @@ buildActionMask = 2147483647; files = ( 5087E78117EB970100C73F5D /* Icon-120.png in Resources */, + 15A6DA9F199CFB9800B56DBF /* HelloWorld.png in Resources */, 5087E78617EB970100C73F5D /* Icon-76.png in Resources */, 5087E77F17EB970100C73F5D /* Default@2x.png in Resources */, 50EF629917ECD46A001EB2F8 /* Icon-100.png in Resources */, - 1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */, 5087E78317EB970100C73F5D /* Icon-152.png in Resources */, + 15A6DA9D199CFB9800B56DBF /* CloseSelected.png in Resources */, 5087E77D17EB970100C73F5D /* Default-568h@2x.png in Resources */, 5087E78517EB970100C73F5D /* Icon-72.png in Resources */, - 1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */, 50EF62A317ECD613001EB2F8 /* Icon-50.png in Resources */, 5087E78017EB970100C73F5D /* Icon-114.png in Resources */, - 1AFAF8BE16D35E4900DB1158 /* HelloWorld.png in Resources */, 50EF62A217ECD613001EB2F8 /* Icon-29.png in Resources */, 50EF629617ECD46A001EB2F8 /* Icon-40.png in Resources */, 5087E78217EB970100C73F5D /* Icon-144.png in Resources */, 50EF629817ECD46A001EB2F8 /* Icon-80.png in Resources */, 5087E78417EB970100C73F5D /* Icon-57.png in Resources */, 5087E77E17EB970100C73F5D /* Default.png in Resources */, + 15A6DA9B199CFB9800B56DBF /* CloseNormal.png in Resources */, 50EF629717ECD46A001EB2F8 /* Icon-58.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -713,10 +801,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5087E75317EB910900C73F5D /* CloseNormal.png in Resources */, 503AE0F817EB97AB00D1A890 /* Icon.icns in Resources */, - 5087E75417EB910900C73F5D /* CloseSelected.png in Resources */, - 5087E75517EB910900C73F5D /* HelloWorld.png in Resources */, + 15A6DAA0199CFB9800B56DBF /* HelloWorld.png in Resources */, + 15A6DA9C199CFB9800B56DBF /* CloseNormal.png in Resources */, + 15A6DA9E199CFB9800B56DBF /* CloseSelected.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -727,11 +815,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15A6DA93199CFB1100B56DBF /* AppDelegate.cpp in Sources */, + 15A6DA95199CFB1100B56DBF /* HelloWorldScene.cpp in Sources */, 503AE10017EB989F00D1A890 /* AppController.mm in Sources */, 503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */, - 1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */, 503AE10117EB989F00D1A890 /* main.m in Sources */, - 1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -739,9 +827,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5087E75717EB910900C73F5D /* AppDelegate.cpp in Sources */, - 5087E75817EB910900C73F5D /* HelloWorldScene.cpp in Sources */, + 15A6DA94199CFB1100B56DBF /* AppDelegate.cpp in Sources */, 503AE10517EB98FF00D1A890 /* main.cpp in Sources */, + 15A6DA96199CFB1100B56DBF /* HelloWorldScene.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/templates/cpp-template-default/proj.linux/main.cpp b/templates/cpp-template-default/proj.linux/main.cpp index c5b735da78..529445638b 100644 --- a/templates/cpp-template-default/proj.linux/main.cpp +++ b/templates/cpp-template-default/proj.linux/main.cpp @@ -1,4 +1,4 @@ -#include "../Classes/AppDelegate.h" +#include "../src/AppDelegate.h" #include #include diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj index 022025afc8..a2eb592205 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj +++ b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj @@ -73,7 +73,7 @@ Disabled - $(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories) + $(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\src;..;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -106,7 +106,7 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" MaxSpeed true - $(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories) + $(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\src;..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL true @@ -137,13 +137,13 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" - - + + - - + + diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.filters b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.filters index 0afd6b671a..4b0292cd30 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.filters +++ b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.filters @@ -4,33 +4,33 @@ {84a8ebd7-7cf0-47f6-b75e-d441df67da40} - - {bb6c862e-70e9-49d9-81b7-3829a6f50471} - {715254bc-d70b-4ec5-bf29-467dd3ace079} + + {bb6c862e-70e9-49d9-81b7-3829a6f50471} + win32 - - Classes + + src - - Classes + + src win32 - - Classes + + src - - Classes + + src diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.user b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.user index 32a6296820..57d3d8f797 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.user +++ b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj.user @@ -1,11 +1,11 @@  - $(ProjectDir)..\Resources + $(ProjectDir)..\res WindowsLocalDebugger - $(ProjectDir)..\Resources + $(ProjectDir)..\res WindowsLocalDebugger \ No newline at end of file diff --git a/templates/cpp-template-default/Resources/CloseNormal.png b/templates/cpp-template-default/res/CloseNormal.png similarity index 100% rename from templates/cpp-template-default/Resources/CloseNormal.png rename to templates/cpp-template-default/res/CloseNormal.png diff --git a/templates/cpp-template-default/Resources/CloseSelected.png b/templates/cpp-template-default/res/CloseSelected.png similarity index 100% rename from templates/cpp-template-default/Resources/CloseSelected.png rename to templates/cpp-template-default/res/CloseSelected.png diff --git a/templates/cpp-template-default/Resources/HelloWorld.png b/templates/cpp-template-default/res/HelloWorld.png similarity index 100% rename from templates/cpp-template-default/Resources/HelloWorld.png rename to templates/cpp-template-default/res/HelloWorld.png diff --git a/templates/cpp-template-default/Resources/fonts/Marker Felt.ttf b/templates/cpp-template-default/res/fonts/Marker Felt.ttf similarity index 100% rename from templates/cpp-template-default/Resources/fonts/Marker Felt.ttf rename to templates/cpp-template-default/res/fonts/Marker Felt.ttf diff --git a/templates/cpp-template-default/Classes/AppDelegate.cpp b/templates/cpp-template-default/src/AppDelegate.cpp similarity index 100% rename from templates/cpp-template-default/Classes/AppDelegate.cpp rename to templates/cpp-template-default/src/AppDelegate.cpp diff --git a/templates/cpp-template-default/Classes/AppDelegate.h b/templates/cpp-template-default/src/AppDelegate.h similarity index 100% rename from templates/cpp-template-default/Classes/AppDelegate.h rename to templates/cpp-template-default/src/AppDelegate.h diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/src/HelloWorldScene.cpp similarity index 100% rename from templates/cpp-template-default/Classes/HelloWorldScene.cpp rename to templates/cpp-template-default/src/HelloWorldScene.cpp diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.h b/templates/cpp-template-default/src/HelloWorldScene.h similarity index 100% rename from templates/cpp-template-default/Classes/HelloWorldScene.h rename to templates/cpp-template-default/src/HelloWorldScene.h From 8b83419a32febbca01cd8217b889a03178454b1c Mon Sep 17 00:00:00 2001 From: xiangxw Date: Fri, 15 Aug 2014 11:48:33 +0800 Subject: [PATCH 087/147] fix replaceAll() This function will never return if new_value contains old_value. For example, old_value = "'", new_value = "''". --- .../frameworks/runtime-src/Classes/runtime/Runtime.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp index 94c78e7e56..065219dd92 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp @@ -72,11 +72,14 @@ const char* getRuntimeVersion() static string& replaceAll(string& str,const string& old_value,const string& new_value) { + int start = 0; while(true) { int pos=0; - if((pos=str.find(old_value,0))!=string::npos) + if((pos=str.find(old_value,start))!=string::npos) { str.replace(pos,old_value.length(),new_value); + start = pos + new_value.length(); + } else break; } return str; From db17084b6d4bbaba5cc5e4e0c9317d1cbaadee63 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 12:06:16 +0800 Subject: [PATCH 088/147] fix warnings --- cocos/base/CCDirector.cpp | 2 +- extensions/GUI/CCScrollView/CCScrollView.h | 2 ++ tests/cpp-tests/Classes/ActionsTest/ActionsTest.h | 2 ++ .../Classes/PerformanceTest/PerformanceAllocTest.cpp | 10 +++++----- .../PerformanceTest/PerformanceContainerTest.cpp | 2 +- tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h | 5 +++++ 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index b942e24a95..30518792db 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -232,7 +232,7 @@ void Director::setDefaultValues(void) // PVR v2 has alpha premultiplied ? bool pvr_alpha_premultipled = conf->getValue("cocos2d.x.texture.pvrv2_has_alpha_premultiplied", Value(false)).asBool(); - Texture2D::PVRImagesHavePremultipliedAlpha(pvr_alpha_premultipled); + Image::setPVRImagesHavePremultipliedAlpha(pvr_alpha_premultipled); } void Director::setGLDefaultValues() diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index a7939ee433..72695df5c7 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -181,10 +181,12 @@ public: /** * Provided to make scroll view compatible with SWLayer's pause method */ + using Layer::pause; // fix warning void pause(Ref* sender); /** * Provided to make scroll view compatible with SWLayer's resume method */ + using Layer::resume; // fix warning void resume(Ref* sender); void setTouchEnabled(bool enabled); diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h index 8d281e237e..a596e23cb0 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h @@ -630,7 +630,9 @@ public: virtual std::string subtitle() const override; virtual std::string title() const override; + using Layer::pause; void pause(float dt); + using Layer::resume; void resume(float dt); private: Vector _pausedTargets; diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp index 7aee682d4f..fec47cbdea 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp @@ -230,7 +230,7 @@ void NodeCreateTest::initWithQuantityOfNodes(unsigned int nNodes) { PerformceAllocScene::initWithQuantityOfNodes(nNodes); - log("Size of Node: %u\n", sizeof(Node)); + log("Size of Node: %lu\n", sizeof(Node)); scheduleUpdate(); } @@ -278,7 +278,7 @@ void NodeDeallocTest::initWithQuantityOfNodes(unsigned int nNodes) { PerformceAllocScene::initWithQuantityOfNodes(nNodes); - log("Size of Node: %u\n", sizeof(Node)); + log("Size of Node: %lu\n", sizeof(Node)); scheduleUpdate(); } @@ -331,7 +331,7 @@ void SpriteCreateEmptyTest::initWithQuantityOfNodes(unsigned int nNodes) { PerformceAllocScene::initWithQuantityOfNodes(nNodes); - log("Size of Sprite: %u\n", sizeof(Sprite)); + log("Size of Sprite: %lu\n", sizeof(Sprite)); scheduleUpdate(); } @@ -381,7 +381,7 @@ void SpriteCreateTest::initWithQuantityOfNodes(unsigned int nNodes) { PerformceAllocScene::initWithQuantityOfNodes(nNodes); - log("Size of Sprite: %u\n", sizeof(Sprite)); + log("Size of Sprite: %lu\n", sizeof(Sprite)); scheduleUpdate(); } @@ -431,7 +431,7 @@ void SpriteDeallocTest::initWithQuantityOfNodes(unsigned int nNodes) { PerformceAllocScene::initWithQuantityOfNodes(nNodes); - log("Size of sprite: %u\n", sizeof(Sprite)); + log("Size of sprite: %lu\n", sizeof(Sprite)); scheduleUpdate(); } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp index 2ebe66e483..2ad8bea2d9 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp @@ -156,7 +156,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) addChild(menuLayer); menuLayer->release(); - log("Size of Node: %u\n", sizeof(Node)); + log("Size of Node: %d\n", (int)sizeof(Node)); int oldFontSize = MenuItemFont::getFontSize(); MenuItemFont::setFontSize(24); diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h index 5728f46a3a..09e6534bf2 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h @@ -47,6 +47,7 @@ public: void tick1(float dt); void tick2(float dt); + using SchedulerTestLayer::pause; void pause(float dt); }; @@ -65,7 +66,9 @@ public: void tick1(float dt); void tick2(float dt); + using SchedulerTestLayer::pause; void pause(float dt); + using SchedulerTestLayer::resume; void resume(float dt); private: std::set _pausedTargets; @@ -85,7 +88,9 @@ public: void tick1(float dt); void tick2(float dt); + using SchedulerTestLayer::pause; void pause(float dt); + using SchedulerTestLayer::resume; void resume(float dt); private: std::set _pausedTargets; From 34ac767dc126d382c7b7d737aaa707b61c0223f1 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 13:41:11 +0800 Subject: [PATCH 089/147] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 6ab981b04e..75b7360c1c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -920,6 +920,7 @@ Developers: Teivaz Custom uniform search optimization + Fixed compiling error on WP8. chareice Make `setup.py` work on zsh From 5e7b75c5c7881333a92a2fea76b795a99dfb49f6 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 15 Aug 2014 14:05:17 +0800 Subject: [PATCH 090/147] fix android background and foreground crash for primitive --- cocos/renderer/CCVertexIndexBuffer.cpp | 56 +++++++++++--------------- cocos/renderer/CCVertexIndexBuffer.h | 11 ++--- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/cocos/renderer/CCVertexIndexBuffer.cpp b/cocos/renderer/CCVertexIndexBuffer.cpp index 5fdd9f31b6..44c1a70de9 100644 --- a/cocos/renderer/CCVertexIndexBuffer.cpp +++ b/cocos/renderer/CCVertexIndexBuffer.cpp @@ -57,11 +57,17 @@ VertexBuffer::VertexBuffer() : _vbo(0) , _vertexNumber(0) , _sizePerVertex(0) +, _recreateVBOEventListener(nullptr) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(VertexBuffer::listenToBackground, this)); - + auto callBack = [this](EventCustom* event) + { + this->recreateVBO(); + }; + + _recreateVBOEventListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_RENDERER_RECREATED, callBack); + #endif } @@ -72,6 +78,9 @@ VertexBuffer::~VertexBuffer() glDeleteBuffers(1, &_vbo); _vbo = 0; } +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + Director::getInstance()->getEventDispatcher()->removeEventListener(_recreateVBOEventListener); +#endif } bool VertexBuffer::init(int sizePerVertex, int vertexNumber) @@ -131,21 +140,8 @@ bool VertexBuffer::updateVertices(const void* verts, int count, int begin) return true; } -void VertexBuffer::listenToBackground(EventCustom *event) -{ - if(glIsBuffer(_vbo)) - { - glDeleteBuffers(1, &_vbo); - _vbo = 0; - } -} - GLuint VertexBuffer::getVBO() const { - if(0 == _vbo) - { - recreateVBO(); - } return _vbo; } @@ -159,7 +155,7 @@ void VertexBuffer::recreateVBO() const { buffer = &_shadowCopy[0]; } - + CCLOG("recreate IndexBuffer with size %d %d", getSizePerVertex(), _vertexNumber); glBufferData(GL_ARRAY_BUFFER, _sizePerVertex * _vertexNumber, buffer, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); if(!glIsBuffer(_vbo)) @@ -189,10 +185,15 @@ IndexBuffer::IndexBuffer() : _vbo(0) , _type(IndexType::INDEX_TYPE_SHORT_16) , _indexNumber(0) +, _recreateVBOEventListener(nullptr) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(IndexBuffer::listenToBackground, this)); - + auto callBack = [this](EventCustom* event) + { + this->recreateVBO(); + }; + + _recreateVBOEventListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_RENDERER_RECREATED, callBack); #endif } @@ -203,6 +204,9 @@ IndexBuffer::~IndexBuffer() glDeleteBuffers(1, &_vbo); _vbo = 0; } +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + Director::getInstance()->getEventDispatcher()->removeEventListener(_recreateVBOEventListener); +#endif } bool IndexBuffer::init(IndexBuffer::IndexType type, int number) @@ -273,22 +277,8 @@ int IndexBuffer::getSize() const return getSizePerIndex() * _indexNumber; } -void IndexBuffer::listenToBackground(EventCustom *event) -{ - if(glIsBuffer(_vbo)) - { - glDeleteBuffers(1, &_vbo); - _vbo = 0; - } -} - GLuint IndexBuffer::getVBO() const { - if(0 == _vbo) - { - recreateVBO(); - } - return _vbo; } @@ -302,7 +292,7 @@ void IndexBuffer::recreateVBO() const { buffer = &_shadowCopy[0]; } - + CCLOG("recreate IndexBuffer with size %d %d ", getSizePerIndex(), _indexNumber); glBufferData(GL_ARRAY_BUFFER, getSize(), buffer, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); if(!glIsBuffer(_vbo)) diff --git a/cocos/renderer/CCVertexIndexBuffer.h b/cocos/renderer/CCVertexIndexBuffer.h index 3c38af4422..ebc21b1537 100644 --- a/cocos/renderer/CCVertexIndexBuffer.h +++ b/cocos/renderer/CCVertexIndexBuffer.h @@ -30,6 +30,8 @@ NS_CC_BEGIN +class EventListenerCustom; + class CC_DLL VertexBuffer : public Ref { public: @@ -49,9 +51,9 @@ protected: bool init(int sizePerVertex, int vertexNumber); protected: - //event listener for foreground and background - void listenToBackground(EventCustom *event); + //event listener for foreground void recreateVBO() const; + EventListenerCustom* _recreateVBOEventListener; protected: mutable GLuint _vbo; int _sizePerVertex; @@ -98,10 +100,9 @@ protected: int _indexNumber; protected: - //event listener for foreground and background - void listenToBackground(EventCustom *event); + //event listener for foreground void recreateVBO() const; - + EventListenerCustom* _recreateVBOEventListener; //buffer used for shadow copy std::vector _shadowCopy; protected: From bf75e9996a423904aedb1743d26d315fc16bc2b0 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 14:29:10 +0800 Subject: [PATCH 091/147] separate jpeg, tiff and webp --- build/cocos2d_libs.xcodeproj/project.pbxproj | 12 + cocos/Android.mk | 7 +- cocos/base/CCModuleManager.cpp | 71 +++ cocos/base/CCModuleManager.h | 50 ++ cocos/platform/CCImage.cpp | 502 +++---------------- cocos/platform/CCImage.h | 32 ++ 6 files changed, 235 insertions(+), 439 deletions(-) create mode 100644 cocos/base/CCModuleManager.cpp create mode 100644 cocos/base/CCModuleManager.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 138951d22f..e4555d5cbe 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -690,6 +690,10 @@ 464AD6E6197EBB1400E502D8 /* pvr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 464AD6E3197EBB1400E502D8 /* pvr.cpp */; }; 464AD6E7197EBB1400E502D8 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 464AD6E4197EBB1400E502D8 /* pvr.h */; }; 464AD6E8197EBB1400E502D8 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 464AD6E4197EBB1400E502D8 /* pvr.h */; }; + 46633BC4199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */; }; + 46633BC5199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */; }; + 46633BC6199DDB2F00F6E838 /* CCModuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46633BC3199DDB2F00F6E838 /* CCModuleManager.h */; }; + 46633BC7199DDB2F00F6E838 /* CCModuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46633BC3199DDB2F00F6E838 /* CCModuleManager.h */; }; 46A160421807A5D4005B8026 /* Export.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE11807A56F005B8026 /* Export.h */; }; 46A160431807A5D4005B8026 /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE21807A56F005B8026 /* SimpleAudioEngine.h */; }; 46A160441807A5D4005B8026 /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FF41807A56F005B8026 /* CDAudioManager.h */; }; @@ -2505,6 +2509,8 @@ 3EA4786F195478E00068D9D1 /* CCBundleReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBundleReader.h; sourceTree = ""; }; 464AD6E3197EBB1400E502D8 /* pvr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pvr.cpp; path = ../base/pvr.cpp; sourceTree = ""; }; 464AD6E4197EBB1400E502D8 /* pvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pvr.h; path = ../base/pvr.h; sourceTree = ""; }; + 46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCModuleManager.cpp; path = ../base/CCModuleManager.cpp; sourceTree = ""; }; + 46633BC3199DDB2F00F6E838 /* CCModuleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCModuleManager.h; path = ../base/CCModuleManager.h; sourceTree = ""; }; 46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = ""; }; 46A15FCE1807A544005B8026 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; 46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; @@ -3411,6 +3417,8 @@ 1A570095180BC5B00088DEC7 /* base-nodes */ = { isa = PBXGroup; children = ( + 46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */, + 46633BC3199DDB2F00F6E838 /* CCModuleManager.h */, 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */, 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */, 1A57009C180BC5D20088DEC7 /* CCNode.cpp */, @@ -5280,6 +5288,7 @@ 1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */, 5034CA3F191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, 50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */, + 46633BC6199DDB2F00F6E838 /* CCModuleManager.h in Headers */, 46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */, 46A170EB1807CECA005B8026 /* CCPhysicsJoint.h in Headers */, 50ABBD3E1925AB0000A911A9 /* CCGeometry.h in Headers */, @@ -5664,6 +5673,7 @@ 50ABC0041926664800A911A9 /* CCLock.h in Headers */, 5034CA40191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, 50ABBEC21925AB6F00A911A9 /* CCValue.h in Headers */, + 46633BC7199DDB2F00F6E838 /* CCModuleManager.h in Headers */, 50ABBECA1925AB6F00A911A9 /* firePngData.h in Headers */, B257B4511989D5E800D9A687 /* CCPrimitive.h in Headers */, 50ABBE401925AB6F00A911A9 /* CCDataVisitor.h in Headers */, @@ -6821,6 +6831,7 @@ 50ABBE651925AB6F00A911A9 /* CCEventListenerCustom.cpp in Sources */, B37510781823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */, 50ABBE391925AB6F00A911A9 /* CCData.cpp in Sources */, + 46633BC4199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */, 1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */, 50ABBED71925AB6F00A911A9 /* ZipUtils.cpp in Sources */, 1A01C68418F57BE800EFE3A6 /* CCArray.cpp in Sources */, @@ -7228,6 +7239,7 @@ 50ABBE8C1925AB6F00A911A9 /* CCNS.cpp in Sources */, 50ABBDAE1925AB4100A911A9 /* CCRenderer.cpp in Sources */, 50ABBDBA1925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */, + 46633BC5199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */, 1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */, 1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */, 1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */, diff --git a/cocos/Android.mk b/cocos/Android.mk index 471ef20ff7..32b0039a16 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -127,6 +127,7 @@ base/CCEventListenerTouch.cpp \ base/CCEventMouse.cpp \ base/CCEventTouch.cpp \ base/CCIMEDispatcher.cpp \ +base/CCModuleManager.cpp \ base/CCNS.cpp \ base/CCProfiling.cpp \ base/CCRef.cpp \ @@ -226,9 +227,6 @@ LOCAL_WHOLE_STATIC_LIBRARIES := cocos_freetype2_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_png_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jpeg_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_tiff_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_webp_static # define the macro to compile through support/zip_support/ioapi.c LOCAL_CFLAGS := -DUSE_FILE32API @@ -241,7 +239,4 @@ include $(BUILD_STATIC_LIBRARY) $(call import-module,freetype2/prebuilt/android) $(call import-module,chipmunk) $(call import-module,platform/android) -$(call import-module,jpeg/prebuilt/android) $(call import-module,png/prebuilt/android) -$(call import-module,tiff/prebuilt/android) -$(call import-module,webp/prebuilt/android) diff --git a/cocos/base/CCModuleManager.cpp b/cocos/base/CCModuleManager.cpp new file mode 100644 index 0000000000..d6a8d9b681 --- /dev/null +++ b/cocos/base/CCModuleManager.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** + Copyright (c) 2014 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "base/CCModuleManager.h" +#include +#include "base/CCConsole.h" + +using namespace std; + +//RegisterJPEG *temp = new RegisterJPEG(); + +NS_CC_BEGIN + +void ModuleManager::registerModule(const string &moduleName, void* module) +{ + auto &moduleMap = createMap(); + if (moduleMap.find(moduleName) != moduleMap.end()) + { + CCLOG("module: %s exists", moduleName.c_str()); + return; + } + + moduleMap[moduleName] = module; +} + +void ModuleManager::unRegisterModule(const string &moduleName) +{ + auto &moduleMap = createMap(); + moduleMap.erase(moduleName); +} + +void* ModuleManager::getModule(const string &moduleName) +{ + auto &moduleMap = createMap(); + auto result = moduleMap.find(moduleName); + if (result != moduleMap.end()) + { + return result->second; + } + else + return nullptr; +} + +unordered_map& ModuleManager::createMap() +{ + static unordered_map map; + return map; +} + +NS_CC_END diff --git a/cocos/base/CCModuleManager.h b/cocos/base/CCModuleManager.h new file mode 100644 index 0000000000..c6ec6f1268 --- /dev/null +++ b/cocos/base/CCModuleManager.h @@ -0,0 +1,50 @@ +/**************************************************************************** + Copyright (c) 2014 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __BASE_CC_MODULE_MANAGER__ +#define __BASE_CC_MODULE_MANAGER__ + +#include +#include + +#include "base/CCPlatformMacros.h" + + +NS_CC_BEGIN + +class CC_DLL ModuleManager +{ +public: + static void registerModule(const std::string &moduleName, void* module); + static void unRegisterModule(const std::string &moduleName); + static void* getModule(const std::string &moduleName); + +private: + static std::unordered_map& createMap(); +}; + +NS_CC_END + +#endif + diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 08cd3e5f10..80ba8e672b 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -31,12 +31,6 @@ THE SOFTWARE. #include "base/CCData.h" - -#ifdef EMSCRIPTEN -#include -#include -#endif // EMSCRIPTEN - extern "C" { // To resolve link error when building 32bits with Xcode 6. @@ -57,22 +51,21 @@ extern "C" { return strerror(errnum); } + // int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs); + int fputs$UNIX2003(const char *str, FILE *stream) + { + return fputs(str, stream); + } #endif #endif #include "png.h" -#include "tiffio.h" #include "base/etc1.h" -#include "jpeglib.h" } #include "base/s3tc.h" #include "base/atitc.h" #include "base/pvr.h" #include "base/TGAlib.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) -#include "decode.h" -#endif - #include "base/ccMacros.h" #include "CCCommon.h" #include "CCStdC.h" @@ -80,6 +73,7 @@ extern "C" #include "base/CCConfiguration.h" #include "base/ccUtils.h" #include "base/ZipUtils.h" +#include "base/CCModuleManager.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "android/CCFileUtilsAndroid.h" #endif @@ -96,7 +90,6 @@ NS_CC_BEGIN namespace { static const int PVR_TEXTURE_FLAG_TYPE_MASK = 0xff; - static bool _PVRHaveAlphaPremultiplied = false; // Values taken from PVRTexture.h from http://www.imgtec.com @@ -759,158 +752,28 @@ bool Image::isCompressed() return Texture2D::getPixelFormatInfoMap().at(_renderFormat).compressed; } -namespace -{ -/* - * ERROR HANDLING: - * - * The JPEG library's standard error handler (jerror.c) is divided into - * several "methods" which you can override individually. This lets you - * adjust the behavior without duplicating a lot of code, which you might - * have to update with each future release. - * - * We override the "error_exit" method so that control is returned to the - * library's caller when a fatal error occurs, rather than calling exit() - * as the standard error_exit method does. - * - * We use C's setjmp/longjmp facility to return control. This means that the - * routine which calls the JPEG library must first execute a setjmp() call to - * establish the return point. We want the replacement error_exit to do a - * longjmp(). But we need to make the setjmp buffer accessible to the - * error_exit routine. To do this, we make a private extension of the - * standard JPEG error handler object. (If we were using C++, we'd say we - * were making a subclass of the regular error handler.) - * - * Here's the extended error handler struct: - */ - struct MyErrorMgr - { - struct jpeg_error_mgr pub; /* "public" fields */ - jmp_buf setjmp_buffer; /* for return to caller */ - }; - - typedef struct MyErrorMgr * MyErrorPtr; - - /* - * Here's the routine that will replace the standard error_exit method: - */ - - METHODDEF(void) - myErrorExit(j_common_ptr cinfo) - { - /* cinfo->err really points to a MyErrorMgr struct, so coerce pointer */ - MyErrorPtr myerr = (MyErrorPtr) cinfo->err; - - /* Always display the message. */ - /* We could postpone this until after returning, if we chose. */ - /* internal message function cann't show error message in some platforms, so we rewrite it here. - * edit it if has version confilict. - */ - //(*cinfo->err->output_message) (cinfo); - char buffer[JMSG_LENGTH_MAX]; - (*cinfo->err->format_message) (cinfo, buffer); - CCLOG("jpeg error: %s", buffer); - - /* Return control to the setjmp point */ - longjmp(myerr->setjmp_buffer, 1); - } -} - bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen) { - /* these are standard libjpeg structures for reading(decompression) */ - struct jpeg_decompress_struct cinfo; - /* We use our private extension JPEG error handler. - * Note that this struct must live as long as the main JPEG parameter - * struct, to avoid dangling-pointer problems. - */ - struct MyErrorMgr jerr; - /* libjpeg data structure for storing one row, that is, scanline of an image */ - JSAMPROW row_pointer[1] = {0}; - unsigned long location = 0; - unsigned int i = 0; - - bool bRet = false; - do + _hasPremultipliedAlpha = false; + + JPEGModule *jpegModule = static_cast(ModuleManager::getModule("jpeg")); + if (jpegModule) { - /* We set up the normal JPEG error routines, then override error_exit. */ - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = myErrorExit; - /* Establish the setjmp return context for MyErrorExit to use. */ - if (setjmp(jerr.setjmp_buffer)) { - /* If we get here, the JPEG code has signaled an error. - * We need to clean up the JPEG object, close the input file, and return. - */ - jpeg_destroy_decompress(&cinfo); - break; - } - - /* setup decompression process and source, then read JPEG header */ - jpeg_create_decompress( &cinfo ); - -#ifndef CC_TARGET_QT5 - jpeg_mem_src( &cinfo, const_cast(data), dataLen ); -#endif /* CC_TARGET_QT5 */ - - /* reading the image header which contains image information */ -#if (JPEG_LIB_VERSION >= 90) - // libjpeg 0.9 adds stricter types. - jpeg_read_header( &cinfo, TRUE ); -#else - jpeg_read_header( &cinfo, true ); -#endif - - // we only support RGB or grayscale - if (cinfo.jpeg_color_space == JCS_GRAYSCALE) - { - _renderFormat = Texture2D::PixelFormat::I8; - }else - { - cinfo.out_color_space = JCS_RGB; - _renderFormat = Texture2D::PixelFormat::RGB888; - } - - /* Start decompression jpeg here */ - jpeg_start_decompress( &cinfo ); - - /* init image info */ - _width = cinfo.output_width; - _height = cinfo.output_height; - _hasPremultipliedAlpha = false; - row_pointer[0] = static_cast(malloc(cinfo.output_width*cinfo.output_components * sizeof(unsigned char))); - CC_BREAK_IF(! row_pointer[0]); - - _dataLen = cinfo.output_width*cinfo.output_height*cinfo.output_components; - _data = static_cast(malloc(_dataLen * sizeof(unsigned char))); - CC_BREAK_IF(! _data); - - /* now actually read the jpeg into the raw buffer */ - /* read one scan line at a time */ - while( cinfo.output_scanline < cinfo.output_height ) - { - jpeg_read_scanlines( &cinfo, row_pointer, 1 ); - for( i=0; iinitWithJPEGData(data, dataLen, dataFromJPEGInit); + _width = dataFromJPEGInit.width; + _height = dataFromJPEGInit.height; + _renderFormat = dataFromJPEGInit.renderFormat; + _dataLen = dataFromJPEGInit.dataLength; + _data = dataFromJPEGInit.data; + + return result; + } + else { - free(row_pointer[0]); - }; - return bRet; + CCLOG("jpeg module is not enabled"); + return false; + } } bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) @@ -1062,175 +925,28 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) return bRet; } -namespace -{ - static tmsize_t tiffReadProc(thandle_t fd, void* buf, tmsize_t size) - { - tImageSource* isource = (tImageSource*)fd; - uint8* ma; - uint64 mb; - unsigned long n; - unsigned long o; - tmsize_t p; - ma=(uint8*)buf; - mb=size; - p=0; - while (mb>0) - { - n=0x80000000UL; - if ((uint64)n>mb) - n=(unsigned long)mb; - - - if((int)(isource->offset + n) <= isource->size) - { - memcpy(ma, isource->data+isource->offset, n); - isource->offset += n; - o = n; - } - else - { - return 0; - } - - ma+=o; - mb-=o; - p+=o; - if (o!=n) - { - break; - } - } - return p; - } - - static tmsize_t tiffWriteProc(thandle_t fd, void* buf, tmsize_t size) - { - CC_UNUSED_PARAM(fd); - CC_UNUSED_PARAM(buf); - CC_UNUSED_PARAM(size); - return 0; - } - - - static uint64 tiffSeekProc(thandle_t fd, uint64 off, int whence) - { - tImageSource* isource = (tImageSource*)fd; - uint64 ret = -1; - do - { - if (whence == SEEK_SET) - { - CC_BREAK_IF(off >= (uint64)isource->size); - ret = isource->offset = (uint32)off; - } - else if (whence == SEEK_CUR) - { - CC_BREAK_IF(isource->offset + off >= (uint64)isource->size); - ret = isource->offset += (uint32)off; - } - else if (whence == SEEK_END) - { - CC_BREAK_IF(off >= (uint64)isource->size); - ret = isource->offset = (uint32)(isource->size-1 - off); - } - else - { - CC_BREAK_IF(off >= (uint64)isource->size); - ret = isource->offset = (uint32)off; - } - } while (0); - - return ret; - } - - static uint64 tiffSizeProc(thandle_t fd) - { - tImageSource* pImageSrc = (tImageSource*)fd; - return pImageSrc->size; - } - - static int tiffCloseProc(thandle_t fd) - { - CC_UNUSED_PARAM(fd); - return 0; - } - - static int tiffMapProc(thandle_t fd, void** pbase, toff_t* psize) - { - CC_UNUSED_PARAM(fd); - CC_UNUSED_PARAM(pbase); - CC_UNUSED_PARAM(psize); - return 0; - } - - static void tiffUnmapProc(thandle_t fd, void* base, toff_t size) - { - CC_UNUSED_PARAM(fd); - CC_UNUSED_PARAM(base); - CC_UNUSED_PARAM(size); - } -} - bool Image::initWithTiffData(const unsigned char * data, ssize_t dataLen) { - bool bRet = false; - do + _hasPremultipliedAlpha = true; + + TIFFModule *tiffModule = static_cast(ModuleManager::getModule("tiff")); + if (tiffModule) { - // set the read call back function - tImageSource imageSource; - imageSource.data = data; - imageSource.size = dataLen; - imageSource.offset = 0; - - TIFF* tif = TIFFClientOpen("file.tif", "r", (thandle_t)&imageSource, - tiffReadProc, tiffWriteProc, - tiffSeekProc, tiffCloseProc, tiffSizeProc, - tiffMapProc, - tiffUnmapProc); - - CC_BREAK_IF(nullptr == tif); - - uint32 w = 0, h = 0; - uint16 bitsPerSample = 0, samplePerPixel = 0, planarConfig = 0; - size_t npixels = 0; + DataFromModule dataFromTIFFInit; + bool result = tiffModule->initWithTIFFData(data, dataLen, dataFromTIFFInit); + _width = dataFromTIFFInit.width; + _height = dataFromTIFFInit.height; + _renderFormat = dataFromTIFFInit.renderFormat; + _dataLen = dataFromTIFFInit.dataLength; + _data = dataFromTIFFInit.data; - TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); - TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); - TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bitsPerSample); - TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplePerPixel); - TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planarConfig); - - npixels = w * h; - - _renderFormat = Texture2D::PixelFormat::RGBA8888; - _width = w; - _height = h; - - _dataLen = npixels * sizeof (uint32); - _data = static_cast(malloc(_dataLen * sizeof(unsigned char))); - - uint32* raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32)); - if (raster != nullptr) - { - if (TIFFReadRGBAImageOriented(tif, w, h, raster, ORIENTATION_TOPLEFT, 0)) - { - /* the raster data is pre-multiplied by the alpha component - after invoking TIFFReadRGBAImageOriented*/ - _hasPremultipliedAlpha = true; - - memcpy(_data, raster, npixels*sizeof (uint32)); - } - - _TIFFfree(raster); - } - - - TIFFClose(tif); - - bRet = true; - } while (0); - return bRet; + return result; + } + else + { + CCLOG("tiff module is not enabled"); + return false; + } } namespace @@ -2011,42 +1727,29 @@ bool Image::initWithPVRData(const unsigned char * data, ssize_t dataLen) bool Image::initWithWebpData(const unsigned char * data, ssize_t dataLen) { - bool bRet = false; - #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) CCLOG("WEBP image format not supported on WinRT or WP8"); + return false; #else - do - { - WebPDecoderConfig config; - if (WebPInitDecoderConfig(&config) == 0) break; - if (WebPGetFeatures(static_cast(data), dataLen, &config.input) != VP8_STATUS_OK) break; - if (config.input.width == 0 || config.input.height == 0) break; + WEBPModule *webpModule = static_cast(ModuleManager::getModule("webp")); + if (webpModule) + { + DataFromModule dataFromWEBPInit; + bool result = webpModule->initWithWEBPData(data, dataLen, dataFromWEBPInit); + _width = dataFromWEBPInit.width; + _height = dataFromWEBPInit.height; + _renderFormat = dataFromWEBPInit.renderFormat; + _dataLen = dataFromWEBPInit.dataLength; + _data = dataFromWEBPInit.data; - config.output.colorspace = MODE_RGBA; - _renderFormat = Texture2D::PixelFormat::RGBA8888; - _width = config.input.width; - _height = config.input.height; - - _dataLen = _width * _height * 4; - _data = static_cast(malloc(_dataLen * sizeof(unsigned char))); - - config.output.u.RGBA.rgba = static_cast(_data); - config.output.u.RGBA.stride = _width * 4; - config.output.u.RGBA.size = _dataLen; - config.output.is_external_memory = 1; - - if (WebPDecode(static_cast(data), dataLen, &config) != VP8_STATUS_OK) - { - free(_data); - _data = nullptr; - break; - } - - bRet = true; - } while (0); + return result; + } + else + { + CCLOG("webp module is not enabled"); + return false; + } #endif - return bRet; } @@ -2265,82 +1968,16 @@ bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB) } bool Image::saveImageToJPG(const std::string& filePath) { - bool bRet = false; - do + JPEGModule *jpegModule = static_cast(ModuleManager::getModule("jpeg")); + if (jpegModule) { - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - FILE * outfile; /* target file */ - JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ - int row_stride; /* physical row width in image buffer */ - - cinfo.err = jpeg_std_error(&jerr); - /* Now we can initialize the JPEG compression object. */ - jpeg_create_compress(&cinfo); - - CC_BREAK_IF((outfile = fopen(filePath.c_str(), "wb")) == nullptr); - - jpeg_stdio_dest(&cinfo, outfile); - - cinfo.image_width = _width; /* image width and height, in pixels */ - cinfo.image_height = _height; - cinfo.input_components = 3; /* # of color components per pixel */ - cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ - - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, 90, TRUE); - - jpeg_start_compress(&cinfo, TRUE); - - row_stride = _width * 3; /* JSAMPLEs per row in image_buffer */ - - if (hasAlpha()) - { - unsigned char *pTempData = static_cast(malloc(_width * _height * 3 * sizeof(unsigned char))); - if (nullptr == pTempData) - { - jpeg_finish_compress(&cinfo); - jpeg_destroy_compress(&cinfo); - fclose(outfile); - break; - } - - for (int i = 0; i < _height; ++i) - { - for (int j = 0; j < _width; ++j) - - { - pTempData[(i * _width + j) * 3] = _data[(i * _width + j) * 4]; - pTempData[(i * _width + j) * 3 + 1] = _data[(i * _width + j) * 4 + 1]; - pTempData[(i * _width + j) * 3 + 2] = _data[(i * _width + j) * 4 + 2]; - } - } - - while (cinfo.next_scanline < cinfo.image_height) { - row_pointer[0] = & pTempData[cinfo.next_scanline * row_stride]; - (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); - } - - if (pTempData != nullptr) - { - free(pTempData); - } - } - else - { - while (cinfo.next_scanline < cinfo.image_height) { - row_pointer[0] = & _data[cinfo.next_scanline * row_stride]; - (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); - } - } - - jpeg_finish_compress(&cinfo); - fclose(outfile); - jpeg_destroy_compress(&cinfo); - - bRet = true; - } while (0); - return bRet; + return jpegModule->saveImage(filePath, this); + } + else + { + CCLOG("jpeg module is not enabled"); + return false; + } } void Image::premultipliedAlpha() @@ -2357,7 +1994,6 @@ void Image::premultipliedAlpha() _hasPremultipliedAlpha = true; } - void Image::setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) { _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index 483ea686ff..bb9e8d0014 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -26,6 +26,8 @@ THE SOFTWARE. #ifndef __CC_IMAGE_H__ #define __CC_IMAGE_H__ +#include +#include #include "base/CCRef.h" #include "renderer/CCTexture2D.h" @@ -167,6 +169,7 @@ protected: void premultipliedAlpha(); + protected: /** @brief Determine how many mipmaps can we have. @@ -212,6 +215,35 @@ protected: bool isATITC(const unsigned char *data, ssize_t dataLen); }; +/* Data returned from jpeg/tiff/webp module initialization + */ +typedef struct DataFromModule +{ + Texture2D::PixelFormat renderFormat; + int width; + int height; + ssize_t dataLength; + unsigned char* data; + bool hasPremultiAlpha; +} DataFromModule; + +struct JPEGModule +{ + std::function saveImage; + std::function initWithJPEGData; +}; + +struct TIFFModule +{ + std::function initWithTIFFData; +}; + +struct WEBPModule +{ + std::function initWithWEBPData; +}; + + // end of platform group /// @} From aa052eb1c1d78680f6bcee59811d12bb55ae8c4c Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 14:39:15 +0800 Subject: [PATCH 092/147] add CCModuleManager into vs project --- cocos/2d/libcocos2d.vcxproj | 2 ++ cocos/2d/libcocos2d.vcxproj.filters | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index b2a8130617..8e9bfae113 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -223,6 +223,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -420,6 +421,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index 6597d36e2e..4a44e2d359 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -625,6 +625,9 @@ renderer + + base + @@ -1270,6 +1273,9 @@ renderer + + base + From 408472625c7ddb9141d27f816ec23ffbe1a63ca2 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 14:46:21 +0800 Subject: [PATCH 093/147] add CCModuleManager into CMakeLists.txt --- cocos/base/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 197e6bb7d4..a9b1f51ad9 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -22,6 +22,7 @@ set(COCOS_BASE_SRC base/CCEventMouse.cpp base/CCEventTouch.cpp base/CCIMEDispatcher.cpp + base/CCModuleManager.cpp base/CCNS.cpp base/CCProfiling.cpp base/CCRef.cpp From 64f6b9a8cc7edd7219ff0034c7aa5be5c1cbcffc Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 15:02:09 +0800 Subject: [PATCH 094/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 9e4b52c463..ea4ffee5aa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ cocos2d-x-3.3 ?? [NEW] Added UIScale9Sprite [NEW] Added Camera [NEW] Added render primitive and render primitive command, support passing point, line and triangle data + [NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop [NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions [NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile() getFileSize() From 8d69d4b05ca6ff6af8e1c03dfa32c0c1985e0551 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 15:20:05 +0800 Subject: [PATCH 095/147] [ci skip] --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index ea4ffee5aa..cb3e5c2993 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,8 @@ cocos2d-x-3.3 ?? [NEW] Sprite3D: added setCullFace() and setCullFaceEnabled() [NEW] SpriteFrameCache: load from plist file content data [NEW] utils: added gettime() + [NEW] ui::Button: support customize how much zoom scale is when pressing a button + [NEW] ui::PageView: added `customScrollThreshold`, could determine the swipe distance to trigger a PageView scroll event [NEW] ui::TextField: support utf8 [NEW] ui::TextField: support set color and placehold color [NEW] Text: added getter and setter for TextColor From 24f0e8aada4c140da5e9b43de84b0273ebd377e2 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 15 Aug 2014 07:23:17 +0000 Subject: [PATCH 096/147] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/Button.lua | 10 + .../lua-bindings/auto/api/PageView.lua | 20 ++ .../auto/lua_cocos2dx_ui_auto.cpp | 276 ++++++++++++++++++ .../auto/lua_cocos2dx_ui_auto.hpp | 6 + 4 files changed, 312 insertions(+) diff --git a/cocos/scripting/lua-bindings/auto/api/Button.lua b/cocos/scripting/lua-bindings/auto/api/Button.lua index 01e2a2990d..b0212c1988 100644 --- a/cocos/scripting/lua-bindings/auto/api/Button.lua +++ b/cocos/scripting/lua-bindings/auto/api/Button.lua @@ -19,6 +19,11 @@ -- @param self -- @param #bool bool +-------------------------------- +-- @function [parent=#Button] getZoomScale +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- @function [parent=#Button] getCapInsetsDisabledRenderer -- @param self @@ -120,6 +125,11 @@ -- @param self -- @param #bool bool +-------------------------------- +-- @function [parent=#Button] setZoomScale +-- @param self +-- @param #float float + -------------------------------- -- @overload self, string, string, string, int -- @overload self diff --git a/cocos/scripting/lua-bindings/auto/api/PageView.lua b/cocos/scripting/lua-bindings/auto/api/PageView.lua index 2e660a0635..f68253b507 100644 --- a/cocos/scripting/lua-bindings/auto/api/PageView.lua +++ b/cocos/scripting/lua-bindings/auto/api/PageView.lua @@ -4,6 +4,11 @@ -- @extend Layout -- @parent_module ccui +-------------------------------- +-- @function [parent=#PageView] getCustomScrollThreshold +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- @function [parent=#PageView] getCurPageIndex -- @param self @@ -16,6 +21,11 @@ -- @param #long long -- @param #bool bool +-------------------------------- +-- @function [parent=#PageView] isUsingCustomScrollThreshold +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- @function [parent=#PageView] getPage -- @param self @@ -32,6 +42,16 @@ -- @param self -- @param #function func +-------------------------------- +-- @function [parent=#PageView] setUsingCustomScrollThreshold +-- @param self +-- @param #bool bool + +-------------------------------- +-- @function [parent=#PageView] setCustomScrollThreshold +-- @param self +-- @param #float float + -------------------------------- -- @function [parent=#PageView] insertPage -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index c4c11ce464..6774030a18 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -5069,6 +5069,50 @@ int lua_cocos2dx_ui_Button_setScale9Enabled(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Button_getZoomScale(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Button* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Button",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Button*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Button_getZoomScale'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getZoomScale(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Button:getZoomScale",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Button_getZoomScale'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Button_getCapInsetsDisabledRenderer(lua_State* tolua_S) { int argc = 0; @@ -6006,6 +6050,52 @@ int lua_cocos2dx_ui_Button_setPressedActionEnabled(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Button_setZoomScale(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Button* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Button",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Button*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Button_setZoomScale'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.Button:setZoomScale"); + if(!ok) + return 0; + cobj->setZoomScale(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Button:setZoomScale",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Button_setZoomScale'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Button_create(lua_State* tolua_S) { int argc = 0; @@ -6189,6 +6279,7 @@ int lua_register_cocos2dx_ui_Button(lua_State* tolua_S) tolua_function(tolua_S,"getTitleText",lua_cocos2dx_ui_Button_getTitleText); tolua_function(tolua_S,"setTitleFontSize",lua_cocos2dx_ui_Button_setTitleFontSize); tolua_function(tolua_S,"setScale9Enabled",lua_cocos2dx_ui_Button_setScale9Enabled); + tolua_function(tolua_S,"getZoomScale",lua_cocos2dx_ui_Button_getZoomScale); tolua_function(tolua_S,"getCapInsetsDisabledRenderer",lua_cocos2dx_ui_Button_getCapInsetsDisabledRenderer); tolua_function(tolua_S,"setTitleColor",lua_cocos2dx_ui_Button_setTitleColor); tolua_function(tolua_S,"setCapInsetsDisabledRenderer",lua_cocos2dx_ui_Button_setCapInsetsDisabledRenderer); @@ -6208,6 +6299,7 @@ int lua_register_cocos2dx_ui_Button(lua_State* tolua_S) tolua_function(tolua_S,"getTitleFontName",lua_cocos2dx_ui_Button_getTitleFontName); tolua_function(tolua_S,"getTitleColor",lua_cocos2dx_ui_Button_getTitleColor); tolua_function(tolua_S,"setPressedActionEnabled",lua_cocos2dx_ui_Button_setPressedActionEnabled); + tolua_function(tolua_S,"setZoomScale",lua_cocos2dx_ui_Button_setZoomScale); tolua_function(tolua_S,"create", lua_cocos2dx_ui_Button_create); tolua_function(tolua_S,"createInstance", lua_cocos2dx_ui_Button_createInstance); tolua_endmodule(tolua_S); @@ -15318,6 +15410,50 @@ int lua_register_cocos2dx_ui_TextBMFont(lua_State* tolua_S) return 1; } +int lua_cocos2dx_ui_PageView_getCustomScrollThreshold(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_getCustomScrollThreshold'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getCustomScrollThreshold(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:getCustomScrollThreshold",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_getCustomScrollThreshold'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_getCurPageIndex(lua_State* tolua_S) { int argc = 0; @@ -15414,6 +15550,50 @@ int lua_cocos2dx_ui_PageView_addWidgetToPage(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_isUsingCustomScrollThreshold(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_isUsingCustomScrollThreshold'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isUsingCustomScrollThreshold(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:isUsingCustomScrollThreshold",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_isUsingCustomScrollThreshold'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_getPage(lua_State* tolua_S) { int argc = 0; @@ -15557,6 +15737,98 @@ int lua_cocos2dx_ui_PageView_addEventListener(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_setUsingCustomScrollThreshold(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_setUsingCustomScrollThreshold'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccui.PageView:setUsingCustomScrollThreshold"); + if(!ok) + return 0; + cobj->setUsingCustomScrollThreshold(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:setUsingCustomScrollThreshold",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_setUsingCustomScrollThreshold'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ui_PageView_setCustomScrollThreshold(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_setCustomScrollThreshold'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.PageView:setCustomScrollThreshold"); + if(!ok) + return 0; + cobj->setCustomScrollThreshold(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:setCustomScrollThreshold",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_setCustomScrollThreshold'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_insertPage(lua_State* tolua_S) { int argc = 0; @@ -15940,11 +16212,15 @@ int lua_register_cocos2dx_ui_PageView(lua_State* tolua_S) tolua_beginmodule(tolua_S,"PageView"); tolua_function(tolua_S,"new",lua_cocos2dx_ui_PageView_constructor); + tolua_function(tolua_S,"getCustomScrollThreshold",lua_cocos2dx_ui_PageView_getCustomScrollThreshold); tolua_function(tolua_S,"getCurPageIndex",lua_cocos2dx_ui_PageView_getCurPageIndex); tolua_function(tolua_S,"addWidgetToPage",lua_cocos2dx_ui_PageView_addWidgetToPage); + tolua_function(tolua_S,"isUsingCustomScrollThreshold",lua_cocos2dx_ui_PageView_isUsingCustomScrollThreshold); tolua_function(tolua_S,"getPage",lua_cocos2dx_ui_PageView_getPage); tolua_function(tolua_S,"removePage",lua_cocos2dx_ui_PageView_removePage); tolua_function(tolua_S,"addEventListener",lua_cocos2dx_ui_PageView_addEventListener); + tolua_function(tolua_S,"setUsingCustomScrollThreshold",lua_cocos2dx_ui_PageView_setUsingCustomScrollThreshold); + tolua_function(tolua_S,"setCustomScrollThreshold",lua_cocos2dx_ui_PageView_setCustomScrollThreshold); tolua_function(tolua_S,"insertPage",lua_cocos2dx_ui_PageView_insertPage); tolua_function(tolua_S,"scrollToPage",lua_cocos2dx_ui_PageView_scrollToPage); tolua_function(tolua_S,"removePageAtIndex",lua_cocos2dx_ui_PageView_removePageAtIndex); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index e733905e27..fa92d1bdaa 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -398,6 +398,12 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + + + + + + From cf8e40f8ce5abe6dce8f378f0305c450e9b438aa Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 15 Aug 2014 15:26:19 +0800 Subject: [PATCH 097/147] deprecated UICheckBox setSelectedState/getSelectedState, use isSelected/setSelected instead --- cocos/ui/UICheckBox.cpp | 6 +++--- cocos/ui/UICheckBox.h | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index 4854885df6..a16d4be64a 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -339,7 +339,7 @@ void CheckBox::onPressStateChangedToDisabled() } } -void CheckBox::setSelectedState(bool selected) +void CheckBox::setSelected(bool selected) { if (selected == _isSelected) { @@ -348,8 +348,8 @@ void CheckBox::setSelectedState(bool selected) _isSelected = selected; _frontCrossRenderer->setVisible(_isSelected); } - -bool CheckBox::getSelectedState()const + +bool CheckBox::isSelected()const { return _isSelected; } diff --git a/cocos/ui/UICheckBox.h b/cocos/ui/UICheckBox.h index c90ab7b235..a58bd32d13 100644 --- a/cocos/ui/UICheckBox.h +++ b/cocos/ui/UICheckBox.h @@ -166,14 +166,17 @@ public: * * @param selected true that checkbox is selected, false otherwise. */ - void setSelectedState(bool selected); + CC_DEPRECATED_ATTRIBUTE void setSelectedState(bool selected){this->setSelected(selected);} /** * Gets selcted state of checkbox. * * @return selected true that checkbox is selected, false otherwise. */ - bool getSelectedState()const; + CC_DEPRECATED_ATTRIBUTE bool getSelectedState()const{return this->isSelected();} + + bool isSelected()const; + void setSelected(bool selected); //add a call back function would called when checkbox is selected or unselected. CC_DEPRECATED_ATTRIBUTE void addEventListenerCheckBox(Ref* target,SEL_SelectedStateEvent selector); From 0e637b4d9f333eb4db2c3e13368dd3dcc5011d63 Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 15 Aug 2014 15:28:28 +0800 Subject: [PATCH 098/147] add swallow touch and propagation customization to UIWidgets --- cocos/ui/UILayout.cpp | 4 +- cocos/ui/UILayout.h | 18 +- cocos/ui/UIPageView.cpp | 30 ++- cocos/ui/UIScrollView.cpp | 40 +++- cocos/ui/UIWidget.cpp | 79 +++++-- cocos/ui/UIWidget.h | 23 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 2 +- .../UIPageViewTest/UIPageViewTest.cpp | 199 +++++++++++++++++- .../UIPageViewTest/UIPageViewTest.h | 15 ++ .../CocoStudioGUITest/UISceneManager.cpp | 5 + .../UITest/CocoStudioGUITest/UISceneManager.h | 1 + 11 files changed, 372 insertions(+), 44 deletions(-) diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index c5460b0ea9..105b4ef0df 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -89,7 +89,8 @@ _backGroundImageColor(Color3B::WHITE), _backGroundImageOpacity(255), _passFocusToChild(true), _loopFocus(false), -_isFocusPassing(false) +_isFocusPassing(false), +_isInterceptTouch(false) { //no-op } @@ -1025,6 +1026,7 @@ void Layout::copySpecialProperties(Widget *widget) setClippingType(layout->_clippingType); _loopFocus = layout->_loopFocus; _passFocusToChild = layout->_passFocusToChild; + _isInterceptTouch = layout->_isInterceptTouch; } } diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 63a986f511..0ce92d964b 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -463,7 +463,6 @@ protected: bool checkFocusEnabledChild()const; protected: - bool _clippingEnabled; //background bool _backGroundScale9Enabled; @@ -472,6 +471,10 @@ protected: Rect _backGroundImageCapInsets; BackGroundColorType _colorType; TextureResType _bgImageTexType; + Size _backGroundImageTextureSize; + Color3B _backGroundImageColor; + GLubyte _backGroundImageOpacity; + LayerColor* _colorRender; LayerGradient* _gradientRender; Color3B _cColor; @@ -479,14 +482,15 @@ protected: Color3B _gEndColor; Vec2 _alongVector; GLubyte _cOpacity; - Size _backGroundImageTextureSize; + + //clipping + bool _clippingEnabled; Type _layoutType; ClippingType _clippingType; DrawNode* _clippingStencil; bool _scissorRectDirty; Rect _clippingRect; Layout* _clippingParent; - bool _doLayoutDirty; bool _clippingRectDirty; //clipping @@ -504,10 +508,7 @@ protected: GLboolean _currentAlphaTestEnabled; GLenum _currentAlphaTestFunc; GLclampf _currentAlphaTestRef; - - - Color3B _backGroundImageColor; - GLubyte _backGroundImageOpacity; + GLint _mask_layer_le; GroupCommand _groupCommand; @@ -517,6 +518,9 @@ protected: CustomCommand _beforeVisitCmdScissor; CustomCommand _afterVisitCmdScissor; + bool _doLayoutDirty; + bool _isInterceptTouch; + //whether enable loop focus or not bool _loopFocus; //on default, it will pass the focus to the next nearest widget diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index 3931192a83..3f7bf90c78 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -343,25 +343,31 @@ bool PageView::onTouchBegan(Touch *touch, Event *unusedEvent) void PageView::onTouchMoved(Touch *touch, Event *unusedEvent) { - handleMoveLogic(touch); - Widget* widgetParent = getWidgetParent(); - if (widgetParent) + Layout::onTouchMoved(touch, unusedEvent); + if (!_isInterceptTouch) { - widgetParent->interceptTouchEvent(TouchEventType::MOVED,this,touch); + handleMoveLogic(touch); } - moveEvent(); } void PageView::onTouchEnded(Touch *touch, Event *unusedEvent) { Layout::onTouchEnded(touch, unusedEvent); - handleReleaseLogic(touch); + if (!_isInterceptTouch) + { + handleReleaseLogic(touch); + } + _isInterceptTouch = false; } void PageView::onTouchCancelled(Touch *touch, Event *unusedEvent) { Layout::onTouchCancelled(touch, unusedEvent); - handleReleaseLogic(touch); + if (!_isInterceptTouch) + { + handleReleaseLogic(touch); + } + _isInterceptTouch = false; } void PageView::doLayout() @@ -526,7 +532,9 @@ void PageView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch * switch (event) { case TouchEventType::BEGAN: - //no-op + { + _isInterceptTouch = true; + } break; case TouchEventType::MOVED: { @@ -541,7 +549,13 @@ void PageView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch * break; case TouchEventType::CANCELED: case TouchEventType::ENDED: + { handleReleaseLogic(touch); + if (sender->isSwallowTouches()) + { + _isInterceptTouch = false; + } + } break; } } diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index ca7ba70a91..d3b39ad2fe 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -1498,9 +1498,12 @@ void ScrollView::handleReleaseLogic(Touch *touch) bool ScrollView::onTouchBegan(Touch *touch, Event *unusedEvent) { bool pass = Layout::onTouchBegan(touch, unusedEvent); - if (_hitted) + if (!_isInterceptTouch) { - handlePressLogic(touch); + if (_hitted) + { + handlePressLogic(touch); + } } return pass; } @@ -1508,19 +1511,30 @@ bool ScrollView::onTouchBegan(Touch *touch, Event *unusedEvent) void ScrollView::onTouchMoved(Touch *touch, Event *unusedEvent) { Layout::onTouchMoved(touch, unusedEvent); - handleMoveLogic(touch); + if (!_isInterceptTouch) + { + handleMoveLogic(touch); + } } void ScrollView::onTouchEnded(Touch *touch, Event *unusedEvent) { Layout::onTouchEnded(touch, unusedEvent); - handleReleaseLogic(touch); + if (!_isInterceptTouch) + { + handleReleaseLogic(touch); + } + _isInterceptTouch = false; } void ScrollView::onTouchCancelled(Touch *touch, Event *unusedEvent) { Layout::onTouchCancelled(touch, unusedEvent); - handleReleaseLogic(touch); + if (!_isInterceptTouch) + { + handleReleaseLogic(touch); + } + _isInterceptTouch = false; } void ScrollView::update(float dt) @@ -1550,10 +1564,12 @@ void ScrollView::interceptTouchEvent(Widget::TouchEventType event, Widget *sende switch (event) { case TouchEventType::BEGAN: + { + _isInterceptTouch = true; _touchBeganPosition = touch->getLocation(); handlePressLogic(touch); - break; - + } + break; case TouchEventType::MOVED: { float offset = (sender->getTouchBeganPosition() - touchPoint).getLength(); @@ -1564,13 +1580,19 @@ void ScrollView::interceptTouchEvent(Widget::TouchEventType event, Widget *sende handleMoveLogic(touch); } } - break; + break; case TouchEventType::CANCELED: case TouchEventType::ENDED: + { _touchEndPosition = touch->getLocation(); handleReleaseLogic(touch); - break; + if (sender->isSwallowTouches()) + { + _isInterceptTouch = false; + } + } + break; } } diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index b06f5367de..6f1ea39994 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -152,14 +152,14 @@ _sizeType(SizeType::ABSOLUTE), _sizePercent(Vec2::ZERO), _positionType(PositionType::ABSOLUTE), _positionPercent(Vec2::ZERO), -_reorderWidgetChildDirty(true), _hitted(false), _touchListener(nullptr), _flippedX(false), _flippedY(false), _focused(false), _focusEnabled(true), -_layoutParameterType(LayoutParameter::Type::NONE) +_layoutParameterType(LayoutParameter::Type::NONE), +_propagateTouchEvents(true) { } @@ -651,6 +651,33 @@ bool Widget::isAncestorsEnabled() return parentWidget->isAncestorsEnabled(); } + +void Widget::setPropagateTouchEvents(bool isPropagate) +{ + _propagateTouchEvents = isPropagate; +} + +bool Widget::isPropagateTouchEvents()const +{ + return _propagateTouchEvents; +} + +void Widget::setSwallowTouches(bool swallow) +{ + if (_touchListener) + { + _touchListener->setSwallowTouches(swallow); + } +} + +bool Widget::isSwallowTouches()const +{ + if (_touchListener) + { + return _touchListener->isSwallowTouches(); + } + return false; +} bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { @@ -668,24 +695,42 @@ bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) return false; } setHighlighted(true); + + /* + * Propagate touch events to its parents + */ + if (_propagateTouchEvents) + { + this->propagateTouchEvent(TouchEventType::BEGAN, this, touch); + } + + pushDownEvent(); + return true; +} + +void Widget::propagateTouchEvent(cocos2d::ui::Widget::TouchEventType event, cocos2d::ui::Widget *sender, cocos2d::Touch *touch) +{ Widget* widgetParent = getWidgetParent(); if (widgetParent) { - widgetParent->interceptTouchEvent(TouchEventType::BEGAN, this, touch); + widgetParent->interceptTouchEvent(event, sender, touch); } - pushDownEvent(); - return true; } void Widget::onTouchMoved(Touch *touch, Event *unusedEvent) { _touchMovePosition = touch->getLocation(); + setHighlighted(hitTest(_touchMovePosition)); - Widget* widgetParent = getWidgetParent(); - if (widgetParent) + + /* + * Propagate touch events to its parents + */ + if (_propagateTouchEvents) { - widgetParent->interceptTouchEvent(TouchEventType::MOVED, this, touch); + this->propagateTouchEvent(TouchEventType::MOVED, this, touch); } + moveEvent(); } @@ -693,10 +738,12 @@ void Widget::onTouchEnded(Touch *touch, Event *unusedEvent) { _touchEndPosition = touch->getLocation(); - Widget* widgetParent = getWidgetParent(); - if (widgetParent) + /* + * Propagate touch events to its parents + */ + if (_propagateTouchEvents) { - widgetParent->interceptTouchEvent(TouchEventType::ENDED, this, touch); + this->propagateTouchEvent(TouchEventType::ENDED, this, touch); } bool highlight = _highlight; @@ -721,7 +768,8 @@ void Widget::onTouchCancelled(Touch *touch, Event *unusedEvent) void Widget::pushDownEvent() { this->retain(); - if (_touchEventCallback) { + if (_touchEventCallback) + { _touchEventCallback(this, TouchEventType::BEGAN); } @@ -735,7 +783,8 @@ void Widget::pushDownEvent() void Widget::moveEvent() { this->retain(); - if (_touchEventCallback) { + if (_touchEventCallback) + { _touchEventCallback(this, TouchEventType::MOVED); } @@ -749,7 +798,8 @@ void Widget::moveEvent() void Widget::releaseUpEvent() { this->retain(); - if (_touchEventCallback) { + if (_touchEventCallback) + { _touchEventCallback(this, TouchEventType::ENDED); } @@ -1035,6 +1085,7 @@ void Widget::copyProperties(Widget *widget) _touchEventSelector = widget->_touchEventSelector; _focused = widget->_focused; _focusEnabled = widget->_focusEnabled; + _propagateTouchEvents = widget->_propagateTouchEvents; copySpecialProperties(widget); diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 4deef2cef3..c178b0fedb 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -502,10 +502,20 @@ public: void updateSizeAndPosition(const Size& parentSize); - /*temp action*/ void setActionTag(int tag); int getActionTag()const; + /** + *@brief Allow widget touch events to propagate to its parents. Set false will disable propagation + */ + void setPropagateTouchEvents(bool isPropagate); + bool isPropagateTouchEvents()const; + /** + *@brief Specify widget to swallow touches or not + */ + void setSwallowTouches(bool swallow); + bool isSwallowTouches()const; + /** *@return whether the widget is focused or not */ @@ -575,12 +585,19 @@ CC_CONSTRUCTOR_ACCESS: virtual bool init() override; /* - * Sends the touch event to widget's parent + * @brief Sends the touch event to widget's parent, if a widget wants to handle touch event under another widget, + * it must overide this function. * @param event the touch event type, it could be BEGAN/MOVED/CANCELED/ENDED * @param parent * @param point */ virtual void interceptTouchEvent(TouchEventType event, Widget* sender, Touch *touch); + + /** + *@brief Propagate touch events to its parents + */ + void propagateTouchEvent(TouchEventType event, Widget* sender, Touch *touch); + friend class PageView; /** * This method is called when a focus change event happens @@ -642,9 +659,9 @@ protected: bool _bright; bool _touchEnabled; bool _highlight; - bool _reorderWidgetChildDirty; bool _affectByClipping; bool _ignoreSize; + bool _propagateTouchEvents; BrightStyle _brightStyle; SizeType _sizeType; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 6298b97f05..852b73a013 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -195,7 +195,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIPageViewTest); sceneManager->setMinUISceneId(kUIPageViewTest); - sceneManager->setMaxUISceneId(kUIPageViewCustomScrollThreshold); + sceneManager->setMaxUISceneId(kUIPageViewTouchPropagationTest); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 8419708306..f7d7e5afe3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -1,7 +1,7 @@ #include "UIPageViewTest.h" - +#include "cocos2d.h" // UIPageViewTest UIPageViewTest::UIPageViewTest() @@ -308,3 +308,200 @@ void UIPageViewCustomScrollThreshold::sliderEvent(Ref *pSender, Slider::EventTyp _displayValueLabel->setString(String::createWithFormat("Scroll Threshold: %f", pageView->getCustomScrollThreshold())->getCString()); } } + +// UIPageViewTouchPropagationTest +UIPageViewTouchPropagationTest::UIPageViewTouchPropagationTest() +: _displayValueLabel(nullptr) +{ + +} + +UIPageViewTouchPropagationTest::~UIPageViewTouchPropagationTest() +{ +} + +bool UIPageViewTouchPropagationTest::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the dragpanel events will be displayed + _displayValueLabel = Text::create("Move by horizontal direction", "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 Touch Propagation", "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(_uiLayer->getChildByTag(81)); + + Layout* background = dynamic_cast(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)); + btn->addTouchEventListener( CC_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); + + 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(UIPageViewTouchPropagationTest::pageViewEvent, this)); + pageView->setName("pageView"); + pageView->addTouchEventListener([](Ref* sender, Widget::TouchEventType type){ + if (type == Widget::TouchEventType::BEGAN) + { + CCLOG("page view touch began"); + } + else if(type == Widget::TouchEventType::MOVED) + { + CCLOG("page view touch moved"); + } + else if(type == Widget::TouchEventType::ENDED) + { + CCLOG("page view touch ended"); + } + else + { + CCLOG("page view touch cancelled"); + } + }); + _uiLayer->addChild(pageView); + + Text *propagationText = Text::create("Allow Propagation", "Arial", 10); + propagationText->setAnchorPoint(Vec2(0,0.5)); + propagationText->setTextColor(Color4B::RED); + propagationText->setPosition(Vec2(0, pageView->getPosition().y + 50)); + _uiLayer->addChild(propagationText); + + Text *swallowTouchText = Text::create("Swallow Touches", "Arial", 10); + swallowTouchText->setAnchorPoint(Vec2(0,0.5)); + swallowTouchText->setTextColor(Color4B::RED); + swallowTouchText->setPosition(Vec2(0, pageView->getPosition().y)); + _uiLayer->addChild(swallowTouchText); + + // Create the checkbox + CheckBox* checkBox1 = CheckBox::create("cocosui/check_box_normal.png", + "cocosui/check_box_normal_press.png", + "cocosui/check_box_active.png", + "cocosui/check_box_normal_disable.png", + "cocosui/check_box_active_disable.png"); + checkBox1->setPosition(propagationText->getPosition() + Vec2(propagationText->getContentSize().width/2, -20)); + + checkBox1->setName("propagation"); + _uiLayer->addChild(checkBox1); + + + // Create the checkbox + CheckBox* checkBox2 = CheckBox::create("cocosui/check_box_normal.png", + "cocosui/check_box_normal_press.png", + "cocosui/check_box_active.png", + "cocosui/check_box_normal_disable.png", + "cocosui/check_box_active_disable.png"); + checkBox2->setPosition(swallowTouchText->getPosition() + Vec2(swallowTouchText->getContentSize().width/2, -20)); + + checkBox2->setName("swallow"); + _uiLayer->addChild(checkBox2); + + + auto eventListener = EventListenerTouchOneByOne::create(); + eventListener->onTouchBegan = [](Touch* touch, Event* event) -> bool{ + CCLOG("layout recieves touches"); + return true; + }; + _eventDispatcher->addEventListenerWithSceneGraphPriority(eventListener, this); + + return true; + } + return false; +} + +void UIPageViewTouchPropagationTest::onButtonClicked(Ref* pSender, Widget::TouchEventType type) +{ + Button *btn = (Button*)pSender; + CheckBox *ck1 = (CheckBox*)_uiLayer->getChildByName("propagation"); + CheckBox *ck2 = (CheckBox*)_uiLayer->getChildByName("swallow"); + auto pageView = (PageView*)_uiLayer->getChildByName("pageView"); + + if (type == Widget::TouchEventType::BEGAN) + { + if (ck1->isSelected()) + { + btn->setPropagateTouchEvents(true); + pageView->setPropagateTouchEvents(true); + + }else + { + btn->setPropagateTouchEvents(false); + pageView->setPropagateTouchEvents(false); + } + + if (ck2->isSelected()) + { + btn->setSwallowTouches(true); + pageView->setSwallowTouches(true); + }else + { + btn->setSwallowTouches(false); + pageView->setSwallowTouches(false); + } + } + if (type == Widget::TouchEventType::ENDED) { + CCLOG("button clicked"); + } +} + + +void UIPageViewTouchPropagationTest::pageViewEvent(Ref *pSender, PageView::EventType type) +{ + switch (type) + { + case PageView::EventType::TURNING: + { + PageView* pageView = dynamic_cast(pSender); + + _displayValueLabel->setString(CCString::createWithFormat("page = %ld", pageView->getCurPageIndex() + 1)->getCString()); + } + break; + + default: + break; + } +} + diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h index 0892b3e936..922115c52f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h @@ -70,4 +70,19 @@ protected: Text* _displayValueLabel; }; +class UIPageViewTouchPropagationTest : public UIScene +{ +public: + UIPageViewTouchPropagationTest(); + ~UIPageViewTouchPropagationTest(); + bool init(); + + void pageViewEvent(Ref* pSender, PageView::EventType type); + void onButtonClicked(Ref* pSender, Widget::TouchEventType type); + +protected: + UI_SCENE_CREATE_FUNC(UIPageViewTouchPropagationTest) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIPageViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 0d1bb60bd3..681ef69f4c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -78,6 +78,8 @@ static const char* s_testArray[] = "UIScrollViewTest_ScrollToPercentBothDirection_Bounce", "UIPageViewTest", "UIPageViewButtonTest", + "UIPageViewCustomScrollThreshold", + "UIPageViewTouchPropagationTest", "UIListViewTest_Vertical", "UIListViewTest_Horizontal", @@ -295,6 +297,9 @@ Scene *UISceneManager::currentUIScene() return UIPageViewButtonTest::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIPageViewCustomScrollThreshold: return UIPageViewCustomScrollThreshold::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIPageViewTouchPropagationTest: + return UIPageViewTouchPropagationTest::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIListViewTest_Vertical: return UIListViewTest_Vertical::sceneWithTitle(s_testArray[_currentUISceneId]); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 20c9471011..9716d9f344 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -78,6 +78,7 @@ enum kUIPageViewTest, kUIPageViewButtonTest, kUIPageViewCustomScrollThreshold, + kUIPageViewTouchPropagationTest, kUIListViewTest_Vertical, kUIListViewTest_Horizontal, kUIWidgetAddNodeTest, From 5cdccac843a72354559f6b4355a7df506cba3119 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 15 Aug 2014 07:36:03 +0000 Subject: [PATCH 099/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 304082e7f1..6259a85c2c 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -339,6 +339,8 @@ "cocos/base/CCIMEDispatcher.cpp", "cocos/base/CCIMEDispatcher.h", "cocos/base/CCMap.h", + "cocos/base/CCModuleManager.cpp", + "cocos/base/CCModuleManager.h", "cocos/base/CCNS.cpp", "cocos/base/CCNS.h", "cocos/base/CCPlatformConfig.h", From 128d06076a02b8aa4bbde8fa01df3b64acfba2b9 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 15 Aug 2014 07:41:13 +0000 Subject: [PATCH 100/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 304345daca..1652b0fb8f 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -192,10 +192,8 @@ "cocos/2d/cocos2dx.props", "cocos/2d/libcocos2d.vcxproj", "cocos/2d/libcocos2d.vcxproj.filters", - "cocos/3d/CCAABB.cpp", - "cocos/3d/CCAABB.h”, - "cocos/3d/CCOBB.cpp", - "cocos/3d/CCOBB.h”, + "cocos/3d/CCAABB.cpp", + "cocos/3d/CCAABB.h", "cocos/3d/CCAnimate3D.cpp", "cocos/3d/CCAnimate3D.h", "cocos/3d/CCAnimation3D.cpp", @@ -213,8 +211,12 @@ "cocos/3d/CCMesh.h", "cocos/3d/CCMeshSkin.cpp", "cocos/3d/CCMeshSkin.h", + "cocos/3d/CCOBB.cpp", + "cocos/3d/CCOBB.h", "cocos/3d/CCObjLoader.cpp", "cocos/3d/CCObjLoader.h", + "cocos/3d/CCRay.cpp", + "cocos/3d/CCRay.h", "cocos/3d/CCSkeleton3D.cpp", "cocos/3d/CCSkeleton3D.h", "cocos/3d/CCSprite3D.cpp", @@ -343,6 +345,8 @@ "cocos/base/CCIMEDispatcher.cpp", "cocos/base/CCIMEDispatcher.h", "cocos/base/CCMap.h", + "cocos/base/CCModuleManager.cpp", + "cocos/base/CCModuleManager.h", "cocos/base/CCNS.cpp", "cocos/base/CCNS.h", "cocos/base/CCPlatformConfig.h", From bdfc48b1277b685892c98f48993c472dc6948383 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 15 Aug 2014 07:44:57 +0000 Subject: [PATCH 101/147] [AUTO]: updating luabinding automatically --- cocos/scripting/lua-bindings/auto/api/Sprite3D.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua b/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua index 62dd9dcdd1..22e08d6e9a 100644 --- a/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua @@ -60,4 +60,9 @@ -- @param #string str -- @return Sprite3D#Sprite3D ret (retunr value: cc.Sprite3D) +-------------------------------- +-- @function [parent=#Sprite3D] getBoundingBox +-- @param self +-- @return rect_table#rect_table ret (return value: rect_table) + return nil From 6d214207553b41898d7a15198752062daa9e5664 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 15 Aug 2014 16:05:12 +0800 Subject: [PATCH 102/147] [ci skip] --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index cb3e5c2993..c7a4200e53 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ cocos2d-x-3.3 ?? [NEW] Added submesh support, and support attaching a Sprite3D object to a bone [NEW] Added UIScale9Sprite - [NEW] Added Camera + [NEW] Added Camera, AABB, OBB and Ray [NEW] Added render primitive and render primitive command, support passing point, line and triangle data [NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop [NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions @@ -15,6 +15,7 @@ cocos2d-x-3.3 ?? [NEW] RotateTo: added 3D rotation support [NEW] ScrollView: added `setMinScale()` and `setMaxScale()` [NEW] Sprite3D: added setCullFace() and setCullFaceEnabled() + [NEW] Sprite3D: added getBoundingBox() and getAABB() [NEW] SpriteFrameCache: load from plist file content data [NEW] utils: added gettime() [NEW] ui::Button: support customize how much zoom scale is when pressing a button From 0517ceb0dc90e200f4a7b9dddd76b44621b434a8 Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 15 Aug 2014 16:21:27 +0800 Subject: [PATCH 103/147] add scrollView nested tests --- .../CocoStudioGUITest/CocosGUIScene.cpp | 2 +- .../CocoStudioGUITest/UISceneManager.cpp | 6 +- .../UITest/CocoStudioGUITest/UISceneManager.h | 3 +- .../UIScrollViewTest/UIScrollViewTest.cpp | 96 +++++++++++++++++++ .../UIScrollViewTest/UIScrollViewTest.h | 12 +++ 5 files changed, 115 insertions(+), 4 deletions(-) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 852b73a013..51fb94d967 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -183,7 +183,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIScrollViewTest_Vertical); sceneManager->setMinUISceneId(kUIScrollViewTest_Vertical); - sceneManager->setMaxUISceneId(kUIScrollViewTest_ScrollToPercentBothDirection_Bounce); + sceneManager->setMaxUISceneId(kUIScrollViewNestTest); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 681ef69f4c..11e781e255 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -75,7 +75,8 @@ static const char* s_testArray[] = "UIScrollViewTest_Horizontal", "UIScrollViewTest_Both", "UIScrollViewTest_ScrollToPercentBothDirection", - "UIScrollViewTest_ScrollToPercentBothDirection_Bounce", + "UIScrollViewTest_ScrollToPercentBothDirection_Bounce", + "UIScrollViewNestTest", "UIPageViewTest", "UIPageViewButtonTest", "UIPageViewCustomScrollThreshold", @@ -290,7 +291,8 @@ Scene *UISceneManager::currentUIScene() case kUIScrollViewTest_ScrollToPercentBothDirection_Bounce: return UIScrollViewTest_ScrollToPercentBothDirection_Bounce::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUIScrollViewNestTest: + return UIScrollViewNestTest::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIPageViewTest: return UIPageViewTest::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIPageViewButtonTest: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 9716d9f344..4361de611f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -74,7 +74,8 @@ enum kUIScrollViewTest_Horizontal, kUIScrollViewTest_Both, kUIScrollViewTest_ScrollToPercentBothDirection, - kUIScrollViewTest_ScrollToPercentBothDirection_Bounce, + kUIScrollViewTest_ScrollToPercentBothDirection_Bounce, + kUIScrollViewNestTest, kUIPageViewTest, kUIPageViewButtonTest, kUIPageViewCustomScrollThreshold, diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp index d75facfd0e..e73cb4d4e5 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp @@ -329,3 +329,99 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init() return false; } + +// UIScrollViewNestTest + +UIScrollViewNestTest::UIScrollViewNestTest() +: _displayValueLabel(nullptr) +{ +} + +UIScrollViewNestTest::~UIScrollViewNestTest() +{ +} + +bool UIScrollViewNestTest::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the scrollview alert will be displayed + _displayValueLabel = Text::create("Move by vertical direction", "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.5f)); + _uiLayer->addChild(_displayValueLabel); + + // Add the alert + Text* alert = Text::create("ScrollView vertical", "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(_uiLayer->getChildByTag(81)); + + Layout* background = dynamic_cast(root->getChildByName("background_Panel")); + + // Create the scrollview by vertical + ui::ScrollView* scrollView = ui::ScrollView::create(); + scrollView->setContentSize(Size(280.0f, 150.0f)); + scrollView->setDirection(ui::ScrollView::Direction::BOTH); + Size backgroundSize = background->getContentSize(); + scrollView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + + (backgroundSize.width - scrollView->getContentSize().width) / 2.0f, + (widgetSize.height - backgroundSize.height) / 2.0f + + (backgroundSize.height - scrollView->getContentSize().height) / 2.0f)); + _uiLayer->addChild(scrollView); + + ImageView* imageView = ImageView::create("cocosui/ccicon.png"); + + float innerWidth = scrollView->getContentSize().width; + float innerHeight = scrollView->getContentSize().height + imageView->getContentSize().height; + + scrollView->setInnerContainerSize(Size(innerWidth, innerHeight)); + + Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); + button->setPosition(Vec2(innerWidth / 2.0f, scrollView->getInnerContainerSize().height - button->getContentSize().height / 2.0f)); + scrollView->addChild(button); + + Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); + titleButton->setTitleText("Title Button"); + titleButton->setPosition(Vec2(innerWidth / 2.0f, button->getBottomBoundary() - button->getContentSize().height)); + scrollView->addChild(titleButton); + + Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); + button_scale9->setScale9Enabled(true); + button_scale9->setContentSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); + button_scale9->setPosition(Vec2(innerWidth / 2.0f, titleButton->getBottomBoundary() - titleButton->getContentSize().height)); + scrollView->addChild(button_scale9); + + imageView->setPosition(Vec2(innerWidth / 2.0f, imageView->getContentSize().height / 2.0f)); + scrollView->addChild(imageView); + + + + // Create the scrollview by horizontal + ui::ScrollView* sc = ui::ScrollView::create(); + sc->setBackGroundColor(Color3B::GREEN); + sc->setBackGroundColorType(Layout::BackGroundColorType::SOLID); + sc->setBounceEnabled(true); + sc->setDirection(ui::ScrollView::Direction::BOTH); + sc->setInnerContainerSize(Size(480, 320)); + sc->setContentSize(Size(100,100)); + sc->setPropagateTouchEvents(false); + sc->setPosition(Vec2(180,100)); + sc->scrollToPercentBothDirection(Vec2(50, 50), 1, true); + ImageView* iv = ImageView::create("cocosui/Hello.png"); + iv->setPosition(Vec2(240, 160)); + sc->addChild(iv); + + + scrollView->addChild(sc); + + return true; + } + + return false; +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h index ec509b6851..bbb78949d3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h @@ -87,4 +87,16 @@ protected: Text* _displayValueLabel; }; +class UIScrollViewNestTest : public UIScene +{ +public: + UIScrollViewNestTest(); + ~UIScrollViewNestTest(); + bool init(); + +protected: + UI_SCENE_CREATE_FUNC(UIScrollViewNestTest) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIScrollViewTest__) */ From 1257f642c7b379497151d69bbbed7e33bd1ddfe2 Mon Sep 17 00:00:00 2001 From: Dmitry Bushtets Date: Fri, 15 Aug 2014 13:20:37 +0300 Subject: [PATCH 104/147] - added export to dll for: ZipFile, CGAffineToGL, GLToCGAffine, XXH32 (in .def file) --- cocos/2d/cocos2d.def | 3 ++- cocos/base/ZipUtils.h | 2 +- cocos/math/TransformUtils.h | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cocos/2d/cocos2d.def b/cocos/2d/cocos2d.def index 3cad80013e..31666e8001 100644 --- a/cocos/2d/cocos2d.def +++ b/cocos/2d/cocos2d.def @@ -1,2 +1,3 @@ - LIBRARY +EXPORTS + XXH32 \ No newline at end of file diff --git a/cocos/base/ZipUtils.h b/cocos/base/ZipUtils.h index d6b1e20c9a..9920cd582c 100644 --- a/cocos/base/ZipUtils.h +++ b/cocos/base/ZipUtils.h @@ -223,7 +223,7 @@ namespace cocos2d * * @since v2.0.5 */ - class ZipFile + class CC_DLL ZipFile { public: /** diff --git a/cocos/math/TransformUtils.h b/cocos/math/TransformUtils.h index 83072d7ccb..30ec353ba7 100644 --- a/cocos/math/TransformUtils.h +++ b/cocos/math/TransformUtils.h @@ -30,13 +30,14 @@ THE SOFTWARE. // todo: // when in MAC or windows, it includes #include "CCGL.h" +#include "base/ccMacros.h" namespace cocos2d { struct AffineTransform; -void CGAffineToGL(const AffineTransform &t, GLfloat *m); -void GLToCGAffine(const GLfloat *m, AffineTransform *t); +CC_DLL void CGAffineToGL(const AffineTransform &t, GLfloat *m); +CC_DLL void GLToCGAffine(const GLfloat *m, AffineTransform *t); }//namespace cocos2d #endif // __SUPPORT_TRANSFORM_UTILS_H__ From 85ef11ae56603e2d53b399452793a011788d9cd9 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 16 Aug 2014 21:51:39 +0800 Subject: [PATCH 105/147] Split cocos3d from cocos2d on the iOS/Mac platform and adjust the related iOS/Mac test project --- build/cocos2d_libs.xcodeproj/project.pbxproj | 512 +++++++++++++----- build/cocos2d_tests.xcodeproj/project.pbxproj | 60 ++ 2 files changed, 436 insertions(+), 136 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 00a135606f..8e715c2905 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ buildPhases = ( ); dependencies = ( + 1516202F199E76D9006099B8 /* PBXTargetDependency */, B2F0AFEC198794EE002FE562 /* PBXTargetDependency */, B2F0AFEE198794EE002FE562 /* PBXTargetDependency */, B2F0AFF0198794EE002FE562 /* PBXTargetDependency */, @@ -33,6 +34,7 @@ buildPhases = ( ); dependencies = ( + 15162225199E7B9E006099B8 /* PBXTargetDependency */, B2F0AFF619879508002FE562 /* PBXTargetDependency */, B2F0AFF819879508002FE562 /* PBXTargetDependency */, B2F0AFFA19879508002FE562 /* PBXTargetDependency */, @@ -50,6 +52,74 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1516200C199E75C2006099B8 /* CCAABB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105175199CB1A600DC41CE /* CCAABB.cpp */; }; + 1516200D199E75C2006099B8 /* CCOBB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105177199CB1A600DC41CE /* CCOBB.cpp */; }; + 1516200E199E75C2006099B8 /* CCRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105179199CB1A600DC41CE /* CCRay.cpp */; }; + 1516200F199E75C2006099B8 /* CCSkeleton3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA2A83E1987A6810077B3D4 /* CCSkeleton3D.cpp */; }; + 15162010199E75C2006099B8 /* CCAttachNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */; }; + 15162011199E75C2006099B8 /* CCSubMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E5198639EF00FA95D0 /* CCSubMesh.cpp */; }; + 15162012199E75C2006099B8 /* CCSubMeshState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E7198639EF00FA95D0 /* CCSubMeshState.cpp */; }; + 15162013199E75C2006099B8 /* CCBundleReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */; }; + 15162014199E75C2006099B8 /* CCBundle3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6AAF83F19404E0D0069DE01 /* CCBundle3D.cpp */; }; + 15162015199E75C2006099B8 /* CCAnimate3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD89C193DC0CC005E0B8A /* CCAnimate3D.cpp */; }; + 15162016199E75C2006099B8 /* CCMeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD895193D6693005E0B8A /* CCMeshSkin.cpp */; }; + 15162017199E75C2006099B8 /* CCAnimation3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6B26341193884D60088FE25 /* CCAnimation3D.cpp */; }; + 15162018199E75C2006099B8 /* CCMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B91926D61F003EEF37 /* CCMesh.cpp */; }; + 15162019199E75C2006099B8 /* CCObjLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */; }; + 1516201A199E75C2006099B8 /* CCSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */; }; + 1516201B199E75C2006099B8 /* CCSprite3DMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BF1926D61F003EEF37 /* CCSprite3DMaterial.cpp */; }; + 1516201C199E75FE006099B8 /* CCAABB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105176199CB1A600DC41CE /* CCAABB.h */; }; + 1516201D199E75FE006099B8 /* CCOBB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105178199CB1A600DC41CE /* CCOBB.h */; }; + 1516201E199E75FE006099B8 /* CCRay.h in Headers */ = {isa = PBXBuildFile; fileRef = B610517A199CB1A600DC41CE /* CCRay.h */; }; + 1516201F199E75FE006099B8 /* CCSkeleton3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA2A83F1987A6810077B3D4 /* CCSkeleton3D.h */; }; + 15162020199E75FE006099B8 /* CCAttachNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E4198639EF00FA95D0 /* CCAttachNode.h */; }; + 15162021199E75FE006099B8 /* CCSubMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E6198639EF00FA95D0 /* CCSubMesh.h */; }; + 15162022199E75FF006099B8 /* CCSubMeshState.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E8198639EF00FA95D0 /* CCSubMeshState.h */; }; + 15162023199E75FF006099B8 /* CCBundleReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA4786F195478E00068D9D1 /* CCBundleReader.h */; }; + 15162024199E75FF006099B8 /* CCBundle3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6AAF84019404E0D0069DE01 /* CCBundle3D.h */; }; + 15162025199E75FF006099B8 /* CCAnimate3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD89D193DC0CC005E0B8A /* CCAnimate3D.h */; }; + 15162026199E75FF006099B8 /* CCMeshSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD896193D6693005E0B8A /* CCMeshSkin.h */; }; + 15162027199E75FF006099B8 /* CCAnimation3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B26342193884D60088FE25 /* CCAnimation3D.h */; }; + 15162028199E75FF006099B8 /* CCAnimationCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B2633C19381FBF0088FE25 /* CCAnimationCurve.h */; }; + 15162029199E75FF006099B8 /* CCMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BA1926D61F003EEF37 /* CCMesh.h */; }; + 1516202A199E75FF006099B8 /* CCObjLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BC1926D61F003EEF37 /* CCObjLoader.h */; }; + 1516202B199E75FF006099B8 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; + 1516202C199E75FF006099B8 /* CCSprite3DMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DMaterial.h */; }; + 1516202D199E75FF006099B8 /* CCBundle3DData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3D3B81948613300BA4831 /* CCBundle3DData.h */; }; + 15162202199E7874006099B8 /* CCAABB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105175199CB1A600DC41CE /* CCAABB.cpp */; }; + 15162203199E7874006099B8 /* CCOBB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105177199CB1A600DC41CE /* CCOBB.cpp */; }; + 15162204199E7874006099B8 /* CCRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105179199CB1A600DC41CE /* CCRay.cpp */; }; + 15162205199E7874006099B8 /* CCSkeleton3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA2A83E1987A6810077B3D4 /* CCSkeleton3D.cpp */; }; + 15162206199E7874006099B8 /* CCAttachNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */; }; + 15162207199E7874006099B8 /* CCSubMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E5198639EF00FA95D0 /* CCSubMesh.cpp */; }; + 15162208199E7874006099B8 /* CCSubMeshState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E7198639EF00FA95D0 /* CCSubMeshState.cpp */; }; + 15162209199E7874006099B8 /* CCBundleReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */; }; + 1516220A199E7874006099B8 /* CCBundle3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6AAF83F19404E0D0069DE01 /* CCBundle3D.cpp */; }; + 1516220B199E7874006099B8 /* CCAnimate3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD89C193DC0CC005E0B8A /* CCAnimate3D.cpp */; }; + 1516220C199E7874006099B8 /* CCMeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD895193D6693005E0B8A /* CCMeshSkin.cpp */; }; + 1516220D199E7874006099B8 /* CCAnimation3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6B26341193884D60088FE25 /* CCAnimation3D.cpp */; }; + 1516220E199E7874006099B8 /* CCMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B91926D61F003EEF37 /* CCMesh.cpp */; }; + 1516220F199E7874006099B8 /* CCObjLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */; }; + 15162210199E7874006099B8 /* CCSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */; }; + 15162211199E7874006099B8 /* CCSprite3DMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BF1926D61F003EEF37 /* CCSprite3DMaterial.cpp */; }; + 15162212199E7A32006099B8 /* CCAABB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105176199CB1A600DC41CE /* CCAABB.h */; }; + 15162213199E7A32006099B8 /* CCOBB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105178199CB1A600DC41CE /* CCOBB.h */; }; + 15162214199E7A32006099B8 /* CCRay.h in Headers */ = {isa = PBXBuildFile; fileRef = B610517A199CB1A600DC41CE /* CCRay.h */; }; + 15162215199E7A32006099B8 /* CCSkeleton3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA2A83F1987A6810077B3D4 /* CCSkeleton3D.h */; }; + 15162216199E7A32006099B8 /* CCAttachNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E4198639EF00FA95D0 /* CCAttachNode.h */; }; + 15162217199E7A32006099B8 /* CCSubMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E6198639EF00FA95D0 /* CCSubMesh.h */; }; + 15162218199E7A32006099B8 /* CCSubMeshState.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E8198639EF00FA95D0 /* CCSubMeshState.h */; }; + 15162219199E7A32006099B8 /* CCBundleReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA4786F195478E00068D9D1 /* CCBundleReader.h */; }; + 1516221A199E7A32006099B8 /* CCBundle3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6AAF84019404E0D0069DE01 /* CCBundle3D.h */; }; + 1516221B199E7A32006099B8 /* CCAnimate3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD89D193DC0CC005E0B8A /* CCAnimate3D.h */; }; + 1516221C199E7A32006099B8 /* CCMeshSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD896193D6693005E0B8A /* CCMeshSkin.h */; }; + 1516221D199E7A32006099B8 /* CCAnimation3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B26342193884D60088FE25 /* CCAnimation3D.h */; }; + 1516221E199E7A32006099B8 /* CCAnimationCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B2633C19381FBF0088FE25 /* CCAnimationCurve.h */; }; + 1516221F199E7A32006099B8 /* CCMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BA1926D61F003EEF37 /* CCMesh.h */; }; + 15162220199E7A32006099B8 /* CCObjLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BC1926D61F003EEF37 /* CCObjLoader.h */; }; + 15162221199E7A32006099B8 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; + 15162222199E7A32006099B8 /* CCSprite3DMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DMaterial.h */; }; + 15162223199E7A32006099B8 /* CCBundle3DData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3D3B81948613300BA4831 /* CCBundle3DData.h */; }; 15EFA211198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA212198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA213198A2BB5000C57D3 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */; }; @@ -583,30 +653,10 @@ 3E6176771960F89B00DE83F5 /* CCEventListenerController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */; }; 3E6176781960F89B00DE83F5 /* CCGameController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176651960F89B00DE83F5 /* CCGameController.h */; }; 3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61781C1966A5A300DE83F5 /* CCController.cpp */; }; - 3E9E80E9198639EF00FA95D0 /* CCAttachNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */; }; - 3E9E80EA198639EF00FA95D0 /* CCAttachNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E3198639EF00FA95D0 /* CCAttachNode.cpp */; }; - 3E9E80EB198639EF00FA95D0 /* CCAttachNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E4198639EF00FA95D0 /* CCAttachNode.h */; }; - 3E9E80EC198639EF00FA95D0 /* CCAttachNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E4198639EF00FA95D0 /* CCAttachNode.h */; }; - 3E9E80ED198639EF00FA95D0 /* CCSubMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E5198639EF00FA95D0 /* CCSubMesh.cpp */; }; - 3E9E80EE198639EF00FA95D0 /* CCSubMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E5198639EF00FA95D0 /* CCSubMesh.cpp */; }; - 3E9E80EF198639EF00FA95D0 /* CCSubMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E6198639EF00FA95D0 /* CCSubMesh.h */; }; - 3E9E80F0198639EF00FA95D0 /* CCSubMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E6198639EF00FA95D0 /* CCSubMesh.h */; }; - 3E9E80F1198639EF00FA95D0 /* CCSubMeshState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E7198639EF00FA95D0 /* CCSubMeshState.cpp */; }; - 3E9E80F2198639EF00FA95D0 /* CCSubMeshState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E80E7198639EF00FA95D0 /* CCSubMeshState.cpp */; }; - 3E9E80F3198639EF00FA95D0 /* CCSubMeshState.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E8198639EF00FA95D0 /* CCSubMeshState.h */; }; - 3E9E80F4198639EF00FA95D0 /* CCSubMeshState.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E9E80E8198639EF00FA95D0 /* CCSubMeshState.h */; }; - 3EA2A8401987A6810077B3D4 /* CCSkeleton3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA2A83E1987A6810077B3D4 /* CCSkeleton3D.cpp */; }; - 3EA2A8411987A6810077B3D4 /* CCSkeleton3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA2A83E1987A6810077B3D4 /* CCSkeleton3D.cpp */; }; - 3EA2A8421987A6810077B3D4 /* CCSkeleton3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA2A83F1987A6810077B3D4 /* CCSkeleton3D.h */; }; - 3EA2A8431987A6810077B3D4 /* CCSkeleton3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA2A83F1987A6810077B3D4 /* CCSkeleton3D.h */; }; 3EA3EDBC1991CDFA00645534 /* CCCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA3EDBA1991CDFA00645534 /* CCCamera.cpp */; }; 3EA3EDBD1991CDFA00645534 /* CCCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA3EDBA1991CDFA00645534 /* CCCamera.cpp */; }; 3EA3EDBE1991CDFA00645534 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA3EDBB1991CDFA00645534 /* CCCamera.h */; }; 3EA3EDBF1991CDFA00645534 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA3EDBB1991CDFA00645534 /* CCCamera.h */; }; - 3EA47870195478E00068D9D1 /* CCBundleReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */; }; - 3EA47871195478E00068D9D1 /* CCBundleReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */; }; - 3EA47872195478E00068D9D1 /* CCBundleReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA4786F195478E00068D9D1 /* CCBundleReader.h */; }; - 3EA47873195478E00068D9D1 /* CCBundleReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA4786F195478E00068D9D1 /* CCBundleReader.h */; }; 460E468118080832000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; }; 460E468218080836000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; }; 460E477B180808F5000CDD6D /* ExtensionMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168321807AF4E005B8026 /* ExtensionMacros.h */; }; @@ -1301,22 +1351,6 @@ B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */; }; B29594B61926D5EC003EEF37 /* CCMeshCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594B31926D5EC003EEF37 /* CCMeshCommand.h */; }; B29594B71926D5EC003EEF37 /* CCMeshCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594B31926D5EC003EEF37 /* CCMeshCommand.h */; }; - B29594C21926D61F003EEF37 /* CCMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B91926D61F003EEF37 /* CCMesh.cpp */; }; - B29594C31926D61F003EEF37 /* CCMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B91926D61F003EEF37 /* CCMesh.cpp */; }; - B29594C41926D61F003EEF37 /* CCMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BA1926D61F003EEF37 /* CCMesh.h */; }; - B29594C51926D61F003EEF37 /* CCMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BA1926D61F003EEF37 /* CCMesh.h */; }; - B29594C61926D61F003EEF37 /* CCObjLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */; }; - B29594C71926D61F003EEF37 /* CCObjLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */; }; - B29594C81926D61F003EEF37 /* CCObjLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BC1926D61F003EEF37 /* CCObjLoader.h */; }; - B29594C91926D61F003EEF37 /* CCObjLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BC1926D61F003EEF37 /* CCObjLoader.h */; }; - B29594CA1926D61F003EEF37 /* CCSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */; }; - B29594CB1926D61F003EEF37 /* CCSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */; }; - B29594CC1926D61F003EEF37 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; - B29594CD1926D61F003EEF37 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; - B29594CE1926D61F003EEF37 /* CCSprite3DMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BF1926D61F003EEF37 /* CCSprite3DMaterial.cpp */; }; - B29594CF1926D61F003EEF37 /* CCSprite3DMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BF1926D61F003EEF37 /* CCSprite3DMaterial.cpp */; }; - B29594D01926D61F003EEF37 /* CCSprite3DMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DMaterial.h */; }; - B29594D11926D61F003EEF37 /* CCSprite3DMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DMaterial.h */; }; B2C599BF1977703300B452DF /* CCBAnimationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFB180E26E600808F54 /* CCBAnimationManager.h */; }; B2C599C01977703300B452DF /* CCBFileLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFD180E26E600808F54 /* CCBFileLoader.h */; }; B2C599C11977703300B452DF /* CCBKeyframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFF180E26E600808F54 /* CCBKeyframe.h */; }; @@ -1587,8 +1621,6 @@ B2CC507719776C340041958E /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA4180E26E600808F54 /* SlotData.cpp */; }; B2CC507819776C340041958E /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA6180E26E600808F54 /* spine-cocos2dx.cpp */; }; B2CC507C19776DD10041958E /* CCPhysicsJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170721807CE7A005B8026 /* CCPhysicsJoint.cpp */; }; - B2D3D3B91948613300BA4831 /* CCBundle3DData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3D3B81948613300BA4831 /* CCBundle3DData.h */; }; - B2D3D3BA1948613300BA4831 /* CCBundle3DData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3D3B81948613300BA4831 /* CCBundle3DData.h */; }; B2DB4764197661D500411E16 /* UIWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FA1318CF08D100240AA3 /* UIWidget.cpp */; }; B2DB4765197661E400411E16 /* UIHBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D32E18E174130051CA34 /* UIHBox.cpp */; }; B2DB4766197661EE00411E16 /* UILayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905F9F818CF08D000240AA3 /* UILayout.cpp */; }; @@ -1875,36 +1907,6 @@ B3AF01A31842FBA400A98B85 /* b2MotorJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B3AF019F1842FBA400A98B85 /* b2MotorJoint.h */; }; B3B12A5A17E7F44000026B4A /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A03F2CB81780BD04006731B9 /* libchipmunk Mac.a */; }; B3B12A5B17E7F45C00026B4A /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A4F3B178387670073F6A7 /* libchipmunk iOS.a */; }; - B610517B199CB1A600DC41CE /* CCAABB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105175199CB1A600DC41CE /* CCAABB.cpp */; }; - B610517C199CB1A600DC41CE /* CCAABB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105175199CB1A600DC41CE /* CCAABB.cpp */; }; - B610517D199CB1A600DC41CE /* CCAABB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105176199CB1A600DC41CE /* CCAABB.h */; }; - B610517E199CB1A600DC41CE /* CCAABB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105176199CB1A600DC41CE /* CCAABB.h */; }; - B610517F199CB1A600DC41CE /* CCOBB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105177199CB1A600DC41CE /* CCOBB.cpp */; }; - B6105180199CB1A600DC41CE /* CCOBB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105177199CB1A600DC41CE /* CCOBB.cpp */; }; - B6105181199CB1A600DC41CE /* CCOBB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105178199CB1A600DC41CE /* CCOBB.h */; }; - B6105182199CB1A600DC41CE /* CCOBB.h in Headers */ = {isa = PBXBuildFile; fileRef = B6105178199CB1A600DC41CE /* CCOBB.h */; }; - B6105183199CB1A600DC41CE /* CCRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105179199CB1A600DC41CE /* CCRay.cpp */; }; - B6105184199CB1A600DC41CE /* CCRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6105179199CB1A600DC41CE /* CCRay.cpp */; }; - B6105185199CB1A600DC41CE /* CCRay.h in Headers */ = {isa = PBXBuildFile; fileRef = B610517A199CB1A600DC41CE /* CCRay.h */; }; - B6105186199CB1A600DC41CE /* CCRay.h in Headers */ = {isa = PBXBuildFile; fileRef = B610517A199CB1A600DC41CE /* CCRay.h */; }; - B6AAF84119404E0D0069DE01 /* CCBundle3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6AAF83F19404E0D0069DE01 /* CCBundle3D.cpp */; }; - B6AAF84219404E0D0069DE01 /* CCBundle3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6AAF83F19404E0D0069DE01 /* CCBundle3D.cpp */; }; - B6AAF84319404E0D0069DE01 /* CCBundle3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6AAF84019404E0D0069DE01 /* CCBundle3D.h */; }; - B6AAF84419404E0D0069DE01 /* CCBundle3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6AAF84019404E0D0069DE01 /* CCBundle3D.h */; }; - B6ACD897193D6693005E0B8A /* CCMeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD895193D6693005E0B8A /* CCMeshSkin.cpp */; }; - B6ACD898193D6693005E0B8A /* CCMeshSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD895193D6693005E0B8A /* CCMeshSkin.cpp */; }; - B6ACD899193D6693005E0B8A /* CCMeshSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD896193D6693005E0B8A /* CCMeshSkin.h */; }; - B6ACD89A193D6693005E0B8A /* CCMeshSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD896193D6693005E0B8A /* CCMeshSkin.h */; }; - B6ACD89E193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD89C193DC0CC005E0B8A /* CCAnimate3D.cpp */; }; - B6ACD89F193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6ACD89C193DC0CC005E0B8A /* CCAnimate3D.cpp */; }; - B6ACD8A0193DC0CC005E0B8A /* CCAnimate3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD89D193DC0CC005E0B8A /* CCAnimate3D.h */; }; - B6ACD8A1193DC0CC005E0B8A /* CCAnimate3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6ACD89D193DC0CC005E0B8A /* CCAnimate3D.h */; }; - B6B2633F19381FBF0088FE25 /* CCAnimationCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B2633C19381FBF0088FE25 /* CCAnimationCurve.h */; }; - B6B2634019381FBF0088FE25 /* CCAnimationCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B2633C19381FBF0088FE25 /* CCAnimationCurve.h */; }; - B6B26343193884D60088FE25 /* CCAnimation3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6B26341193884D60088FE25 /* CCAnimation3D.cpp */; }; - B6B26344193884D60088FE25 /* CCAnimation3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6B26341193884D60088FE25 /* CCAnimation3D.cpp */; }; - B6B26345193884D60088FE25 /* CCAnimation3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B26342193884D60088FE25 /* CCAnimation3D.h */; }; - B6B26346193884D60088FE25 /* CCAnimation3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B26342193884D60088FE25 /* CCAnimation3D.h */; }; ED9C6A9418599AD8000A5232 /* 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 */; }; @@ -1914,6 +1916,20 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 1516202E199E76D9006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15161E42199E7362006099B8; + remoteInfo = "libcocos3d Mac"; + }; + 15162224199E7B9E006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15162030199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; 460E44F31807E241000CDD6D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1551A336158F2AB200E66CFE /* Project object */; @@ -2088,6 +2104,8 @@ 06CAAABF186AD63B0012A414 /* TriggerMng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerMng.h; sourceTree = ""; }; 06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerObj.cpp; sourceTree = ""; }; 06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.h; sourceTree = ""; }; + 1516200B199E7363006099B8 /* libcocos3d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos3d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 15162201199E7810006099B8 /* libcocos3d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos3d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1551A33F158F2AB200E66CFE /* libcocos2d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1551A342158F2AB200E66CFE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProtectedNode.cpp; sourceTree = ""; }; @@ -3104,6 +3122,20 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 15161F0B199E7362006099B8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15162101199E7810006099B8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1551A33C158F2AB200E66CFE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -3342,6 +3374,8 @@ B24EEA7619775ECE004493CC /* libcocosbuilder iOS.a */, B24EEA7E19775EE1004493CC /* libspine iOS.a */, B24EEA8619775EF3004493CC /* libnetwork iOS.a */, + 1516200B199E7363006099B8 /* libcocos3d Mac.a */, + 15162201199E7810006099B8 /* libcocos3d iOS.a */, ); name = Products; sourceTree = ""; @@ -5298,6 +5332,56 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 15161F1A199E7362006099B8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1516201C199E75FE006099B8 /* CCAABB.h in Headers */, + 1516201D199E75FE006099B8 /* CCOBB.h in Headers */, + 1516201E199E75FE006099B8 /* CCRay.h in Headers */, + 1516201F199E75FE006099B8 /* CCSkeleton3D.h in Headers */, + 15162020199E75FE006099B8 /* CCAttachNode.h in Headers */, + 15162021199E75FE006099B8 /* CCSubMesh.h in Headers */, + 15162022199E75FF006099B8 /* CCSubMeshState.h in Headers */, + 15162023199E75FF006099B8 /* CCBundleReader.h in Headers */, + 15162024199E75FF006099B8 /* CCBundle3D.h in Headers */, + 15162025199E75FF006099B8 /* CCAnimate3D.h in Headers */, + 15162026199E75FF006099B8 /* CCMeshSkin.h in Headers */, + 15162027199E75FF006099B8 /* CCAnimation3D.h in Headers */, + 15162028199E75FF006099B8 /* CCAnimationCurve.h in Headers */, + 15162029199E75FF006099B8 /* CCMesh.h in Headers */, + 1516202A199E75FF006099B8 /* CCObjLoader.h in Headers */, + 1516202B199E75FF006099B8 /* CCSprite3D.h in Headers */, + 1516202C199E75FF006099B8 /* CCSprite3DMaterial.h in Headers */, + 1516202D199E75FF006099B8 /* CCBundle3DData.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15162109199E7810006099B8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 15162212199E7A32006099B8 /* CCAABB.h in Headers */, + 15162213199E7A32006099B8 /* CCOBB.h in Headers */, + 15162214199E7A32006099B8 /* CCRay.h in Headers */, + 15162215199E7A32006099B8 /* CCSkeleton3D.h in Headers */, + 15162216199E7A32006099B8 /* CCAttachNode.h in Headers */, + 15162217199E7A32006099B8 /* CCSubMesh.h in Headers */, + 15162218199E7A32006099B8 /* CCSubMeshState.h in Headers */, + 15162219199E7A32006099B8 /* CCBundleReader.h in Headers */, + 1516221A199E7A32006099B8 /* CCBundle3D.h in Headers */, + 1516221B199E7A32006099B8 /* CCAnimate3D.h in Headers */, + 1516221C199E7A32006099B8 /* CCMeshSkin.h in Headers */, + 1516221D199E7A32006099B8 /* CCAnimation3D.h in Headers */, + 1516221E199E7A32006099B8 /* CCAnimationCurve.h in Headers */, + 1516221F199E7A32006099B8 /* CCMesh.h in Headers */, + 15162220199E7A32006099B8 /* CCObjLoader.h in Headers */, + 15162221199E7A32006099B8 /* CCSprite3D.h in Headers */, + 15162222199E7A32006099B8 /* CCSprite3DMaterial.h in Headers */, + 15162223199E7A32006099B8 /* CCBundle3DData.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1551A33D158F2AB200E66CFE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -5308,7 +5392,6 @@ 50ABBE891925AB6F00A911A9 /* CCMap.h in Headers */, 50ABBE8D1925AB6F00A911A9 /* CCNS.h in Headers */, 50ABBEA51925AB6F00A911A9 /* CCScriptSupport.h in Headers */, - B29594D01926D61F003EEF37 /* CCSprite3DMaterial.h in Headers */, 1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */, 5034CA3F191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, 50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */, @@ -5347,13 +5430,11 @@ 50ABBD8D1925AB4100A911A9 /* CCGLProgram.h in Headers */, 50ABBEA11925AB6F00A911A9 /* CCScheduler.h in Headers */, 50ABBDB71925AB4100A911A9 /* CCTexture2D.h in Headers */, - B2D3D3B91948613300BA4831 /* CCBundle3DData.h in Headers */, 50ABBE811925AB6F00A911A9 /* CCEventType.h in Headers */, 1A57008F180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, 1A570093180BC5A10088DEC7 /* CCActionTween.h in Headers */, 50ABBD4A1925AB0000A911A9 /* Mat4.h in Headers */, 1A57009A180BC5C10088DEC7 /* CCAtlasNode.h in Headers */, - 3E9E80F3198639EF00FA95D0 /* CCSubMeshState.h in Headers */, 1A5700A0180BC5D20088DEC7 /* CCNode.h in Headers */, 50ABC0671926664800A911A9 /* CCPlatformDefine.h in Headers */, 46C02E0918E91123004B7456 /* xxhash.h in Headers */, @@ -5366,7 +5447,6 @@ 1AC0269C1914068200FA920D /* ConvertUTF.h in Headers */, 50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */, 1A57019F180BCB590088DEC7 /* CCFont.h in Headers */, - B6105185199CB1A600DC41CE /* CCRay.h in Headers */, 1A5701A3180BCB590088DEC7 /* CCFontAtlas.h in Headers */, 1A01C68618F57BE800EFE3A6 /* CCArray.h in Headers */, 1A5701A7180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */, @@ -5376,7 +5456,6 @@ 1A5701BB180BCB5A0088DEC7 /* CCLabel.h in Headers */, 1A5701BF180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */, 50ABBED91925AB6F00A911A9 /* ZipUtils.h in Headers */, - 3E9E80EB198639EF00FA95D0 /* CCAttachNode.h in Headers */, 1A5701C3180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */, 50ABBE5F1925AB6F00A911A9 /* CCEventListener.h in Headers */, 1A5701C9180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */, @@ -5395,7 +5474,6 @@ 1A5701FD180BCBAD0088DEC7 /* CCMenuItem.h in Headers */, 1A570204180BCBD40088DEC7 /* CCClippingNode.h in Headers */, 1A01C6A618F58F7500EFE3A6 /* CCNotificationCenter.h in Headers */, - B6105181199CB1A600DC41CE /* CCOBB.h in Headers */, 1A57020A180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */, 1A570212180BCBF40088DEC7 /* CCProgressTimer.h in Headers */, 1A570216180BCBF40088DEC7 /* CCRenderTexture.h in Headers */, @@ -5426,7 +5504,6 @@ 1A570294180BCCAB0088DEC7 /* CCAnimation.h in Headers */, 50ABBD421925AB0000A911A9 /* CCMathBase.h in Headers */, 1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */, - B29594C81926D61F003EEF37 /* CCObjLoader.h in Headers */, 50ABBE911925AB6F00A911A9 /* CCPlatformMacros.h in Headers */, 50ABC05D1926664800A911A9 /* CCApplication.h in Headers */, 50ABC0071926664800A911A9 /* CCApplicationProtocol.h in Headers */, @@ -5449,7 +5526,6 @@ 1A570302180BCE890088DEC7 /* CCParallaxNode.h in Headers */, 50ABBE4B1925AB6F00A911A9 /* CCEventAcceleration.h in Headers */, 1A57030E180BCF190088DEC7 /* CCComponent.h in Headers */, - 3E9E80EF198639EF00FA95D0 /* CCSubMesh.h in Headers */, 1A570312180BCF190088DEC7 /* CCComponentContainer.h in Headers */, 50ABBD851925AB4100A911A9 /* CCBatchCommand.h in Headers */, 50ABC0651926664800A911A9 /* CCGL.h in Headers */, @@ -5458,7 +5534,6 @@ 1A01C69418F57BE800EFE3A6 /* CCFloat.h in Headers */, 1A57034D180BD09B0088DEC7 /* tinyxml2.h in Headers */, 1A570356180BD0B00088DEC7 /* ioapi.h in Headers */, - B29594C41926D61F003EEF37 /* CCMesh.h in Headers */, 50ABBE331925AB6F00A911A9 /* CCConfiguration.h in Headers */, 50ABC01F1926664800A911A9 /* CCThread.h in Headers */, 1A57035A180BD0B00088DEC7 /* unzip.h in Headers */, @@ -5481,10 +5556,8 @@ 50ABBD3A1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 50ABBE571925AB6F00A911A9 /* CCEventFocus.h in Headers */, 1A01C69218F57BE800EFE3A6 /* CCDouble.h in Headers */, - 3EA2A8421987A6810077B3D4 /* CCSkeleton3D.h in Headers */, 50ABBE251925AB6F00A911A9 /* base64.h in Headers */, 50ABBEC91925AB6F00A911A9 /* firePngData.h in Headers */, - B29594CC1926D61F003EEF37 /* CCSprite3D.h in Headers */, 503DD8F51926B0DB00CD74DD /* CCIMEDelegate.h in Headers */, 50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */, B24AA987195A675C007B4522 /* CCFastTMXLayer.h in Headers */, @@ -5498,7 +5571,6 @@ 50ABC00F1926664800A911A9 /* CCFileUtils.h in Headers */, 50ABBE3B1925AB6F00A911A9 /* CCData.h in Headers */, 50ABBE3F1925AB6F00A911A9 /* CCDataVisitor.h in Headers */, - 3EA47872195478E00068D9D1 /* CCBundleReader.h in Headers */, 50ABBD9D1925AB4100A911A9 /* ccGLStateCache.h in Headers */, 50ABBEB91925AB6F00A911A9 /* ccUTF8.h in Headers */, 50ABBE671925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */, @@ -5519,7 +5591,6 @@ 50ABBDB31925AB4100A911A9 /* ccShaders.h in Headers */, 50ABBDAB1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */, 5034CA45191D591100CE6051 /* ccShader_Label_outline.frag in Headers */, - B610517D199CB1A600DC41CE /* CCAABB.h in Headers */, 50ABBEB11925AB6F00A911A9 /* CCUserDefault.h in Headers */, 50ABBEC71925AB6F00A911A9 /* etc1.h in Headers */, 50ABBEA91925AB6F00A911A9 /* CCTouch.h in Headers */, @@ -5533,12 +5604,7 @@ 50ABBD951925AB4100A911A9 /* CCGLProgramState.h in Headers */, 50ABC0091926664800A911A9 /* CCCommon.h in Headers */, 50ABBE531925AB6F00A911A9 /* CCEventDispatcher.h in Headers */, - B6B2633F19381FBF0088FE25 /* CCAnimationCurve.h in Headers */, - B6B26345193884D60088FE25 /* CCAnimation3D.h in Headers */, 464AD6E7197EBB1400E502D8 /* pvr.h in Headers */, - B6ACD899193D6693005E0B8A /* CCMeshSkin.h in Headers */, - B6ACD8A0193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, - B6AAF84319404E0D0069DE01 /* CCBundle3D.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5687,10 +5753,8 @@ 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 5034CA38191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */, 50ABBE7C1925AB6F00A911A9 /* CCEventMouse.h in Headers */, - B29594D11926D61F003EEF37 /* CCSprite3DMaterial.h in Headers */, 46A171011807CECB005B8026 /* CCPhysicsJoint.h in Headers */, 46A170FD1807CECB005B8026 /* CCPhysicsBody.h in Headers */, - B29594C51926D61F003EEF37 /* CCMesh.h in Headers */, 50ABBE9C1925AB6F00A911A9 /* CCRef.h in Headers */, 50ABBD961925AB4100A911A9 /* CCGLProgramState.h in Headers */, 46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */, @@ -5722,13 +5786,11 @@ 1A57007C180BC5A10088DEC7 /* CCActionInstant.h in Headers */, 3E6176751960F89B00DE83F5 /* CCEventController.h in Headers */, 50ABBE781925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */, - B2D3D3BA1948613300BA4831 /* CCBundle3DData.h in Headers */, B37510861823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */, 1A570080180BC5A10088DEC7 /* CCActionInterval.h in Headers */, 1A570084180BC5A10088DEC7 /* CCActionManager.h in Headers */, 50ABC0141926664800A911A9 /* CCGLView.h in Headers */, 1A570088180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */, - 3EA2A8431987A6810077B3D4 /* CCSkeleton3D.h in Headers */, 50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */, 1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */, 1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, @@ -5786,7 +5848,6 @@ 50ABC00C1926664800A911A9 /* CCDevice.h in Headers */, 1A570205180BCBD40088DEC7 /* CCClippingNode.h in Headers */, 5034CA34191D591100CE6051 /* ccShader_PositionTexture_uColor.frag in Headers */, - B6105182199CB1A600DC41CE /* CCOBB.h in Headers */, 50ABBEA21925AB6F00A911A9 /* CCScheduler.h in Headers */, 1A57020B180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */, 1A570213180BCBF40088DEC7 /* CCProgressTimer.h in Headers */, @@ -5821,7 +5882,6 @@ 5034CA44191D591100CE6051 /* ccShader_Label.vert in Headers */, 1A5702F5180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */, 1A5702F9180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */, - 3E9E80F0198639EF00FA95D0 /* CCSubMesh.h in Headers */, 1AC0269D1914068200FA920D /* ConvertUTF.h in Headers */, 1A5702FD180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */, 1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */, @@ -5851,7 +5911,6 @@ 5034CA4C191D591100CE6051 /* ccShader_Label_df_glow.frag in Headers */, 503DD8EB1926736A00CD74DD /* CCGL.h in Headers */, 50ABBE3C1925AB6F00A911A9 /* CCData.h in Headers */, - 3E9E80EC198639EF00FA95D0 /* CCAttachNode.h in Headers */, 503DD8FA1926B0DB00CD74DD /* CCIMEDispatcher.h in Headers */, 50ABBEC81925AB6F00A911A9 /* etc1.h in Headers */, 50ABBDB01925AB4100A911A9 /* CCRenderer.h in Headers */, @@ -5860,12 +5919,10 @@ 50ABBD861925AB4100A911A9 /* CCBatchCommand.h in Headers */, 50ABBE481925AB6F00A911A9 /* CCEvent.h in Headers */, 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */, - B29594CD1926D61F003EEF37 /* CCSprite3D.h in Headers */, 3E6176691960F89B00DE83F5 /* CCController.h in Headers */, 3E6176781960F89B00DE83F5 /* CCGameController.h in Headers */, 50ABBE641925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */, 50ABBD921925AB4100A911A9 /* CCGLProgramCache.h in Headers */, - B29594C91926D61F003EEF37 /* CCObjLoader.h in Headers */, 50ABBE961925AB6F00A911A9 /* CCProfiling.h in Headers */, 503DD8E01926736A00CD74DD /* CCApplication.h in Headers */, 50ABBD8E1925AB4100A911A9 /* CCGLProgram.h in Headers */, @@ -5884,7 +5941,6 @@ 50ABBE821925AB6F00A911A9 /* CCEventType.h in Headers */, 1AAF5852180E40B9000584C8 /* LocalStorage.h in Headers */, 50ABBD471925AB0000A911A9 /* CCVertex.h in Headers */, - B6105186199CB1A600DC41CE /* CCRay.h in Headers */, 1A9DCA2A180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */, 1A01C69F18F57BE800EFE3A6 /* CCString.h in Headers */, 464AD6E8197EBB1400E502D8 /* pvr.h in Headers */, @@ -5900,10 +5956,8 @@ B276EF641988D1D500CD400F /* CCVertexIndexBuffer.h in Headers */, ED9C6A9718599AD8000A5232 /* CCNodeGrid.h in Headers */, 50ABC0201926664800A911A9 /* CCThread.h in Headers */, - B610517E199CB1A600DC41CE /* CCAABB.h in Headers */, 1A01C69318F57BE800EFE3A6 /* CCDouble.h in Headers */, 50ABBE221925AB6F00A911A9 /* atitc.h in Headers */, - 3EA47873195478E00068D9D1 /* CCBundleReader.h in Headers */, 50ABBED21925AB6F00A911A9 /* TGAlib.h in Headers */, 1A01C68D18F57BE800EFE3A6 /* CCDeprecated.h in Headers */, 503DD8EA1926736A00CD74DD /* CCESRenderer.h in Headers */, @@ -5915,14 +5969,8 @@ 503DD8F11926736A00CD74DD /* OpenGL_Internal.h in Headers */, B37510801823ACA100B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */, 50ABBDAA1925AB4100A911A9 /* CCRenderCommand.h in Headers */, - 3E9E80F4198639EF00FA95D0 /* CCSubMeshState.h in Headers */, 50ABBE601925AB6F00A911A9 /* CCEventListener.h in Headers */, 50ABBEB21925AB6F00A911A9 /* CCUserDefault.h in Headers */, - B6B2634019381FBF0088FE25 /* CCAnimationCurve.h in Headers */, - B6B26346193884D60088FE25 /* CCAnimation3D.h in Headers */, - B6ACD89A193D6693005E0B8A /* CCMeshSkin.h in Headers */, - B6ACD8A1193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, - B6AAF84419404E0D0069DE01 /* CCBundle3D.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -6414,6 +6462,40 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 15161E42199E7362006099B8 /* libcocos3d Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = 15162008199E7363006099B8 /* Build configuration list for PBXNativeTarget "libcocos3d Mac" */; + buildPhases = ( + 15161E45199E7362006099B8 /* Sources */, + 15161F0B199E7362006099B8 /* Frameworks */, + 15161F1A199E7362006099B8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libcocos3d Mac"; + productName = cocos2dx; + productReference = 1516200B199E7363006099B8 /* libcocos3d Mac.a */; + productType = "com.apple.product-type.library.static"; + }; + 15162030199E7810006099B8 /* libcocos3d iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 151621FE199E7810006099B8 /* Build configuration list for PBXNativeTarget "libcocos3d iOS" */; + buildPhases = ( + 15162033199E7810006099B8 /* Sources */, + 15162101199E7810006099B8 /* Frameworks */, + 15162109199E7810006099B8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libcocos3d iOS"; + productName = cocos2dx; + productReference = 15162201199E7810006099B8 /* libcocos3d iOS.a */; + productType = "com.apple.product-type.library.static"; + }; 1551A33E158F2AB200E66CFE /* libcocos2d Mac */ = { isa = PBXNativeTarget; buildConfigurationList = 1551A34C158F2AB200E66CFE /* Build configuration list for PBXNativeTarget "libcocos2d Mac" */; @@ -6788,6 +6870,7 @@ A03F2B781780BD04006731B9 /* libchipmunk Mac */, A03F2D5D1780BDF7006731B9 /* libbox2d Mac */, A03F2E9817814268006731B9 /* libcocosdenshion Mac */, + 15161E42199E7362006099B8 /* libcocos3d Mac */, A07A4E0B178386390073F6A7 /* build all libs iOS */, A07A4C241783777C0073F6A7 /* libcocos2d iOS */, A07A4E111783867C0073F6A7 /* libextension iOS */, @@ -6799,11 +6882,58 @@ B24EEA6F19775ECE004493CC /* libcocosbuilder iOS */, B24EEA7719775EE1004493CC /* libspine iOS */, B24EEA7F19775EF3004493CC /* libnetwork iOS */, + 15162030199E7810006099B8 /* libcocos3d iOS */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ + 15161E45199E7362006099B8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1516200C199E75C2006099B8 /* CCAABB.cpp in Sources */, + 1516200D199E75C2006099B8 /* CCOBB.cpp in Sources */, + 1516200E199E75C2006099B8 /* CCRay.cpp in Sources */, + 1516200F199E75C2006099B8 /* CCSkeleton3D.cpp in Sources */, + 15162010199E75C2006099B8 /* CCAttachNode.cpp in Sources */, + 15162011199E75C2006099B8 /* CCSubMesh.cpp in Sources */, + 15162012199E75C2006099B8 /* CCSubMeshState.cpp in Sources */, + 15162013199E75C2006099B8 /* CCBundleReader.cpp in Sources */, + 15162014199E75C2006099B8 /* CCBundle3D.cpp in Sources */, + 15162015199E75C2006099B8 /* CCAnimate3D.cpp in Sources */, + 15162016199E75C2006099B8 /* CCMeshSkin.cpp in Sources */, + 15162017199E75C2006099B8 /* CCAnimation3D.cpp in Sources */, + 15162018199E75C2006099B8 /* CCMesh.cpp in Sources */, + 15162019199E75C2006099B8 /* CCObjLoader.cpp in Sources */, + 1516201A199E75C2006099B8 /* CCSprite3D.cpp in Sources */, + 1516201B199E75C2006099B8 /* CCSprite3DMaterial.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15162033199E7810006099B8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15162202199E7874006099B8 /* CCAABB.cpp in Sources */, + 15162203199E7874006099B8 /* CCOBB.cpp in Sources */, + 15162204199E7874006099B8 /* CCRay.cpp in Sources */, + 15162205199E7874006099B8 /* CCSkeleton3D.cpp in Sources */, + 15162206199E7874006099B8 /* CCAttachNode.cpp in Sources */, + 15162207199E7874006099B8 /* CCSubMesh.cpp in Sources */, + 15162208199E7874006099B8 /* CCSubMeshState.cpp in Sources */, + 15162209199E7874006099B8 /* CCBundleReader.cpp in Sources */, + 1516220A199E7874006099B8 /* CCBundle3D.cpp in Sources */, + 1516220B199E7874006099B8 /* CCAnimate3D.cpp in Sources */, + 1516220C199E7874006099B8 /* CCMeshSkin.cpp in Sources */, + 1516220D199E7874006099B8 /* CCAnimation3D.cpp in Sources */, + 1516220E199E7874006099B8 /* CCMesh.cpp in Sources */, + 1516220F199E7874006099B8 /* CCObjLoader.cpp in Sources */, + 15162210199E7874006099B8 /* CCSprite3D.cpp in Sources */, + 15162211199E7874006099B8 /* CCSprite3DMaterial.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1551A33B158F2AB200E66CFE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -6823,14 +6953,12 @@ 46A170ED1807CECA005B8026 /* CCPhysicsShape.cpp in Sources */, 50ABBE991925AB6F00A911A9 /* CCRef.cpp in Sources */, ED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */, - B610517F199CB1A600DC41CE /* CCOBB.cpp in Sources */, 46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */, 50ABBDA71925AB4100A911A9 /* CCRenderCommand.cpp in Sources */, 50ABBD501925AB0000A911A9 /* Quaternion.cpp in Sources */, 50ABBEBB1925AB6F00A911A9 /* ccUtils.cpp in Sources */, 15EFA211198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */, 50ABBEB71925AB6F00A911A9 /* ccUTF8.cpp in Sources */, - 3E9E80F1198639EF00FA95D0 /* CCSubMeshState.cpp in Sources */, 50ABBE271925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */, 50ABBE8B1925AB6F00A911A9 /* CCNS.cpp in Sources */, 46A170E81807CECA005B8026 /* CCPhysicsContact.cpp in Sources */, @@ -6855,7 +6983,6 @@ 1A57008D180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */, 1A570091180BC5A10088DEC7 /* CCActionTween.cpp in Sources */, 50ABBEBF1925AB6F00A911A9 /* CCValue.cpp in Sources */, - 3E9E80E9198639EF00FA95D0 /* CCAttachNode.cpp in Sources */, 1A570098180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */, 1A57009E180BC5D20088DEC7 /* CCNode.cpp in Sources */, B257B460198A353E00D9A687 /* CCPrimitiveCommand.cpp in Sources */, @@ -6875,7 +7002,6 @@ 1A5701B1180BCB590088DEC7 /* CCFontFNT.cpp in Sources */, 1A5701B5180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */, 1A5701B9180BCB5A0088DEC7 /* CCLabel.cpp in Sources */, - 3EA2A8401987A6810077B3D4 /* CCSkeleton3D.cpp in Sources */, 1A5701BD180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */, 50ABBE551925AB6F00A911A9 /* CCEventFocus.cpp in Sources */, 50ABBE491925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */, @@ -6888,7 +7014,6 @@ 1A5701CB180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */, 50ABBE711925AB6F00A911A9 /* CCEventListenerMouse.cpp in Sources */, 1A5701DE180BCB8C0088DEC7 /* CCLayer.cpp in Sources */, - 3E9E80ED198639EF00FA95D0 /* CCSubMesh.cpp in Sources */, 1A5701E2180BCB8C0088DEC7 /* CCScene.cpp in Sources */, 1A12775C18DFCC590005F345 /* CCTweenFunction.cpp in Sources */, 1A5701E6180BCB8C0088DEC7 /* CCTransition.cpp in Sources */, @@ -6922,7 +7047,6 @@ 50ABBEAF1925AB6F00A911A9 /* CCUserDefault.cpp in Sources */, 50ABBE791925AB6F00A911A9 /* CCEventMouse.cpp in Sources */, 50ABC0111926664800A911A9 /* CCGLView.cpp in Sources */, - B29594C21926D61F003EEF37 /* CCMesh.cpp in Sources */, 50ABBE3D1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, 1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */, 50ABBE7D1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, @@ -6941,21 +7065,17 @@ 1A01C69C18F57BE800EFE3A6 /* CCString.cpp in Sources */, 50ABBD3C1925AB0000A911A9 /* CCGeometry.cpp in Sources */, 50ABC0011926664800A911A9 /* CCLock.cpp in Sources */, - B6105183199CB1A600DC41CE /* CCRay.cpp in Sources */, 50ABBD931925AB4100A911A9 /* CCGLProgramState.cpp in Sources */, 1A57034B180BD09B0088DEC7 /* tinyxml2.cpp in Sources */, 1A570354180BD0B00088DEC7 /* ioapi.cpp in Sources */, 1A570358180BD0B00088DEC7 /* unzip.cpp in Sources */, - 3EA47870195478E00068D9D1 /* CCBundleReader.cpp in Sources */, 50ABBEB31925AB6F00A911A9 /* CCUserDefault.mm in Sources */, 50ABBEB51925AB6F00A911A9 /* CCUserDefaultAndroid.cpp in Sources */, 50ABBE831925AB6F00A911A9 /* ccFPSImages.c in Sources */, 50ABBEA71925AB6F00A911A9 /* CCTouch.cpp in Sources */, 50ABBD8B1925AB4100A911A9 /* CCGLProgram.cpp in Sources */, - B610517B199CB1A600DC41CE /* CCAABB.cpp in Sources */, 464AD6E5197EBB1400E502D8 /* pvr.cpp in Sources */, 50ABBDA31925AB4100A911A9 /* CCQuadCommand.cpp in Sources */, - B29594C61926D61F003EEF37 /* CCObjLoader.cpp in Sources */, 50ABC01D1926664800A911A9 /* CCThread.cpp in Sources */, 50ABBECB1925AB6F00A911A9 /* s3tc.cpp in Sources */, 50ABBD481925AB0000A911A9 /* Mat4.cpp in Sources */, @@ -6966,7 +7086,6 @@ 50ABBE751925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, 50ABBE511925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */, 50ABC0051926664800A911A9 /* CCThread.mm in Sources */, - B29594CA1926D61F003EEF37 /* CCSprite3D.cpp in Sources */, 50ABC0631926664800A911A9 /* CCDevice.mm in Sources */, 50ABBE1F1925AB6F00A911A9 /* atitc.cpp in Sources */, 1A01C69818F57BE800EFE3A6 /* CCSet.cpp in Sources */, @@ -6984,7 +7103,6 @@ 50ABBD9F1925AB4100A911A9 /* CCGroupCommand.cpp in Sources */, 50ABBD871925AB4100A911A9 /* CCCustomCommand.cpp in Sources */, 50ABBDBD1925AB4100A911A9 /* CCTextureCache.cpp in Sources */, - B29594CE1926D61F003EEF37 /* CCSprite3DMaterial.cpp in Sources */, 299754F4193EC95400A54AC3 /* ObjectFactory.cpp in Sources */, 50ABC0211926664800A911A9 /* CCGLViewImpl.cpp in Sources */, 50ABC00D1926664800A911A9 /* CCFileUtils.cpp in Sources */, @@ -7001,10 +7119,6 @@ 46C02E0718E91123004B7456 /* xxhash.c in Sources */, 50ABBE931925AB6F00A911A9 /* CCProfiling.cpp in Sources */, 1ABA68AE1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */, - B6B26343193884D60088FE25 /* CCAnimation3D.cpp in Sources */, - B6ACD897193D6693005E0B8A /* CCMeshSkin.cpp in Sources */, - B6ACD89E193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */, - B6AAF84119404E0D0069DE01 /* CCBundle3D.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7158,7 +7272,6 @@ B2CC507C19776DD10041958E /* CCPhysicsJoint.cpp in Sources */, B2165EEA19921124000BE3E6 /* CCPrimitiveCommand.cpp in Sources */, 503DD8EE1926736A00CD74DD /* CCImage.mm in Sources */, - 3EA47871195478E00068D9D1 /* CCBundleReader.cpp in Sources */, B37510811823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */, 46A170FC1807CECB005B8026 /* CCPhysicsBody.cpp in Sources */, 50ABBD941925AB4100A911A9 /* CCGLProgramState.cpp in Sources */, @@ -7167,7 +7280,6 @@ 46A170FE1807CECB005B8026 /* CCPhysicsContact.cpp in Sources */, 1A570062180BC5A10088DEC7 /* CCAction.cpp in Sources */, 1A570066180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */, - 3E9E80F2198639EF00FA95D0 /* CCSubMeshState.cpp in Sources */, B276EF661988D1D500CD400F /* CCVertexIndexBuffer.cpp in Sources */, 1A57006A180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */, 1A57006E180BC5A10088DEC7 /* CCActionEase.cpp in Sources */, @@ -7175,14 +7287,11 @@ 1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */, 50ABBE621925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, 3E6176681960F89B00DE83F5 /* CCController-iOS.mm in Sources */, - B6105180199CB1A600DC41CE /* CCOBB.cpp in Sources */, B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */, - B6105184199CB1A600DC41CE /* CCRay.cpp in Sources */, 50ABBE7E1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, 50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, 50ABBE461925AB6F00A911A9 /* CCEvent.cpp in Sources */, 50ABBEA01925AB6F00A911A9 /* CCScheduler.cpp in Sources */, - 3E9E80EA198639EF00FA95D0 /* CCAttachNode.cpp in Sources */, 50ABBE4E1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */, 50ABBE761925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, 50ABBE5A1925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */, @@ -7197,7 +7306,6 @@ 1A570082180BC5A10088DEC7 /* CCActionManager.cpp in Sources */, 1A570086180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */, 1A57008A180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */, - B29594CB1926D61F003EEF37 /* CCSprite3D.cpp in Sources */, 50ABBED81925AB6F00A911A9 /* ZipUtils.cpp in Sources */, 1A57008E180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */, 1A570092180BC5A10088DEC7 /* CCActionTween.cpp in Sources */, @@ -7206,7 +7314,6 @@ 50ABBE3E1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, 1A57009F180BC5D20088DEC7 /* CCNode.cpp in Sources */, B37510831823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */, - B29594CF1926D61F003EEF37 /* CCSprite3DMaterial.cpp in Sources */, 1A57010F180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */, 1A570113180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */, 1A57011C180BC90D0088DEC7 /* CCGrabber.cpp in Sources */, @@ -7255,7 +7362,6 @@ 1A57022E180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */, 50ABBD901925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */, 1A57027F180BCC900088DEC7 /* CCSprite.cpp in Sources */, - 3EA2A8411987A6810077B3D4 /* CCSkeleton3D.cpp in Sources */, 1A570283180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */, 1A570287180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */, 1A57028B180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */, @@ -7291,7 +7397,6 @@ 50ABBD881925AB4100A911A9 /* CCCustomCommand.cpp in Sources */, 50ABBE941925AB6F00A911A9 /* CCProfiling.cpp in Sources */, 50ABBE5E1925AB6F00A911A9 /* CCEventListener.cpp in Sources */, - B29594C31926D61F003EEF37 /* CCMesh.cpp in Sources */, 50ABBEA81925AB6F00A911A9 /* CCTouch.cpp in Sources */, 503DD8E91926736A00CD74DD /* CCES2Renderer.m in Sources */, 5027253D190BF1B900AAF4ED /* cocos2d.cpp in Sources */, @@ -7300,7 +7405,6 @@ 503DD8F81926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */, 50ABBDB21925AB4100A911A9 /* ccShaders.cpp in Sources */, 50ABBD451925AB0000A911A9 /* CCVertex.cpp in Sources */, - B29594C71926D61F003EEF37 /* CCObjLoader.cpp in Sources */, 50ABBEB01925AB6F00A911A9 /* CCUserDefault.cpp in Sources */, 50ABBE521925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */, 1A01C68B18F57BE800EFE3A6 /* CCDeprecated.cpp in Sources */, @@ -7318,7 +7422,6 @@ 50ABBE9A1925AB6F00A911A9 /* CCRef.cpp in Sources */, 3E6176741960F89B00DE83F5 /* CCEventController.cpp in Sources */, 50ABBE361925AB6F00A911A9 /* CCConsole.cpp in Sources */, - 3E9E80EE198639EF00FA95D0 /* CCSubMesh.cpp in Sources */, 503DD8E51926736A00CD74DD /* CCDirectorCaller.mm in Sources */, 50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */, 50ABC0121926664800A911A9 /* CCGLView.cpp in Sources */, @@ -7331,7 +7434,6 @@ 50ABBE4A1925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */, 46C02E0818E91123004B7456 /* xxhash.c in Sources */, 50ABBED01925AB6F00A911A9 /* TGAlib.cpp in Sources */, - B610517C199CB1A600DC41CE /* CCAABB.cpp in Sources */, 1A01C68518F57BE800EFE3A6 /* CCArray.cpp in Sources */, 503DD8E31926736A00CD74DD /* CCDevice.mm in Sources */, 50ABBEB41925AB6F00A911A9 /* CCUserDefault.mm in Sources */, @@ -7342,10 +7444,6 @@ 50ABBE7A1925AB6F00A911A9 /* CCEventMouse.cpp in Sources */, 15EFA212198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */, 50ABBD981925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */, - B6B26344193884D60088FE25 /* CCAnimation3D.cpp in Sources */, - B6ACD898193D6693005E0B8A /* CCMeshSkin.cpp in Sources */, - B6ACD89F193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */, - B6AAF84219404E0D0069DE01 /* CCBundle3D.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7810,6 +7908,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 1516202F199E76D9006099B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 15161E42199E7362006099B8 /* libcocos3d Mac */; + targetProxy = 1516202E199E76D9006099B8 /* PBXContainerItemProxy */; + }; + 15162225199E7B9E006099B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 15162030199E7810006099B8 /* libcocos3d iOS */; + targetProxy = 15162224199E7B9E006099B8 /* PBXContainerItemProxy */; + }; 460E44F41807E241000CDD6D /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A03F2B781780BD04006731B9 /* libchipmunk Mac */; @@ -7923,6 +8031,120 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 15162009199E7363006099B8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; + EXECUTABLE_EXTENSION = a; + EXECUTABLE_PREFIX = ""; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_MAC, + CC_KEYBOARD_SUPPORT, + _USRDLL, + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + HEADER_SEARCH_PATHS = ""; + LD_DYLIB_INSTALL_NAME = ""; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACH_O_TYPE = staticlib; + PRODUCT_NAME = "libcocos3d Mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop $(SRCROOT)/../external/glfw3/include/mac"; + }; + name = Debug; + }; + 1516200A199E7363006099B8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; + EXECUTABLE_EXTENSION = a; + EXECUTABLE_PREFIX = ""; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_KEYBOARD_SUPPORT, + CC_TARGET_OS_MAC, + _USRDLL, + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + HEADER_SEARCH_PATHS = ""; + LD_DYLIB_INSTALL_NAME = ""; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACH_O_TYPE = staticlib; + PRODUCT_NAME = "libcocos3d Mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop $(SRCROOT)/../external/glfw3/include/mac"; + }; + name = Release; + }; + 151621FF199E7810006099B8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; + EXECUTABLE_PREFIX = ""; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_IPHONE, + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + LIBRARY_SEARCH_PATHS = ( + "\"$(SRCROOT)/../external/png/prebuilt/ios\"", + "\"$(SRCROOT)/../external/jpeg/prebuilt/ios\"", + "\"$(SRCROOT)/../external/tiff/prebuilt/ios\"", + "\"$(SRCROOT)/../external/webp/prebuilt/ios\"", + "\"$(SRCROOT)/../external/freetype2/prebuilt/ios\"", + "\"$(SRCROOT)/../external/curl/prebuilt/ios\"", + ); + PRODUCT_NAME = "libcocos3d iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; + }; + name = Debug; + }; + 15162200199E7810006099B8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; + EXECUTABLE_PREFIX = ""; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_IPHONE, + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + LIBRARY_SEARCH_PATHS = ( + "\"$(SRCROOT)/../external/png/prebuilt/ios\"", + "\"$(SRCROOT)/../external/jpeg/prebuilt/ios\"", + "\"$(SRCROOT)/../external/tiff/prebuilt/ios\"", + "\"$(SRCROOT)/../external/webp/prebuilt/ios\"", + "\"$(SRCROOT)/../external/freetype2/prebuilt/ios\"", + "\"$(SRCROOT)/../external/curl/prebuilt/ios\"", + ); + PRODUCT_NAME = "libcocos3d iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; + }; + name = Release; + }; 1551A34A158F2AB200E66CFE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -8873,6 +9095,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 15162008199E7363006099B8 /* Build configuration list for PBXNativeTarget "libcocos3d Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 15162009199E7363006099B8 /* Debug */, + 1516200A199E7363006099B8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 151621FE199E7810006099B8 /* Build configuration list for PBXNativeTarget "libcocos3d iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 151621FF199E7810006099B8 /* Debug */, + 15162200199E7810006099B8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 1551A339158F2AB200E66CFE /* Build configuration list for PBXProject "cocos2d_libs" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 24d4e9d5be..2918c5e756 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -58,6 +58,8 @@ 1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; }; 1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; + 15162232199F95C6006099B8 /* libcocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1516222D199F95B2006099B8 /* libcocos3d Mac.a */; }; + 15162235199F97E1006099B8 /* libcocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1516222F199F95B2006099B8 /* libcocos3d 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 */; }; 15427B7D198B880100DC375D /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */; }; @@ -1002,6 +1004,34 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 15162226199F95B2006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15161E42199E7362006099B8; + remoteInfo = "libcocos3d Mac"; + }; + 1516222C199F95B2006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516200B199E7363006099B8; + remoteInfo = "libcocos3d Mac"; + }; + 1516222E199F95B2006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 15162201199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 15162233199F97D1006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15162030199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; 15427B80198B8ACB00DC375D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; @@ -3855,6 +3885,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15162232199F95C6006099B8 /* libcocos3d Mac.a in Frameworks */, B244F3171976878E00ED1926 /* libnetwork Mac.a in Frameworks */, B2DB493A197681E500411E16 /* libspine Mac.a in Frameworks */, B2DB48C619767DAC00411E16 /* libcocostudio Mac.a in Frameworks */, @@ -3902,6 +3933,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15162235199F97E1006099B8 /* libcocos3d iOS.a in Frameworks */, B2C59AC8197782B900B452DF /* libcocosbuilder iOS.a in Frameworks */, B2C59AC9197782B900B452DF /* libui iOS.a in Frameworks */, B2C59ACA197782B900B452DF /* libcocostudio iOS.a in Frameworks */, @@ -7925,6 +7957,7 @@ 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */, 46A15FB61807A4F9005B8026 /* libbox2d Mac.a */, 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */, + 1516222D199F95B2006099B8 /* libcocos3d Mac.a */, 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */, 46A15FC01807A4F9005B8026 /* libextension iOS.a */, 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */, @@ -7935,6 +7968,7 @@ B2CC503D197763A20041958E /* libcocosbuilder iOS.a */, B2CC503F197763A20041958E /* libspine iOS.a */, B2CC5041197763A20041958E /* libnetwork iOS.a */, + 1516222F199F95B2006099B8 /* libcocos3d iOS.a */, ); name = Products; sourceTree = ""; @@ -8127,6 +8161,7 @@ buildRules = ( ); dependencies = ( + 15162227199F95B2006099B8 /* PBXTargetDependency */, B244F3111976878700ED1926 /* PBXTargetDependency */, B2DB49361976819900411E16 /* PBXTargetDependency */, B2DB48C519767DA500411E16 /* PBXTargetDependency */, @@ -8173,6 +8208,7 @@ buildRules = ( ); dependencies = ( + 15162234199F97D1006099B8 /* PBXTargetDependency */, B2C59ABE197782AC00B452DF /* PBXTargetDependency */, B2C59AC0197782AC00B452DF /* PBXTargetDependency */, B2C59AC2197782AC00B452DF /* PBXTargetDependency */, @@ -8240,6 +8276,20 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 1516222D199F95B2006099B8 /* libcocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d Mac.a"; + remoteRef = 1516222C199F95B2006099B8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1516222F199F95B2006099B8 /* libcocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d iOS.a"; + remoteRef = 1516222E199F95B2006099B8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 15EFA24A198A4A24000C57D3 /* libluaextension Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -9418,6 +9468,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 15162227199F95B2006099B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d Mac"; + targetProxy = 15162226199F95B2006099B8 /* PBXContainerItemProxy */; + }; + 15162234199F97D1006099B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d iOS"; + targetProxy = 15162233199F97D1006099B8 /* PBXContainerItemProxy */; + }; 15427B81198B8ACB00DC375D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libluanetwork iOS"; From 6259aebdabf66de8220d32cbe54f8fe98d91a335 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sun, 17 Aug 2014 23:45:56 +0800 Subject: [PATCH 106/147] =?UTF-8?q?Split=20cocos3d=20from=20cocos2d=20on?= =?UTF-8?q?=20the=20android=E3=80=81win32=20and=20linux=20platform=20and?= =?UTF-8?q?=20adjust=20the=20related=20test=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 + build/cocos2d-win32.vc2012.sln | 6 + build/cocos2d_libs.xcodeproj/project.pbxproj | 6 + cocos/2d/libcocos2d.vcxproj | 35 ------ cocos/2d/libcocos2d.vcxproj.filters | 110 +----------------- cocos/3d/CCAABB.h | 3 +- cocos/3d/CCAnimate3D.h | 3 +- cocos/3d/CCAnimation3D.h | 3 +- cocos/3d/CCAttachNode.h | 3 +- cocos/3d/CCBundle3D.h | 3 +- cocos/3d/CCMesh.h | 5 +- cocos/3d/CCMeshSkin.h | 3 +- cocos/3d/CCOBB.h | 3 +- cocos/3d/CCRay.h | 3 +- cocos/3d/CCSkeleton3D.h | 5 +- cocos/3d/CCSprite3D.h | 5 +- cocos/3d/CCSubMesh.h | 3 +- cocos/3d/CCSubMeshState.h | 3 +- cocos/3d/CMakeLists.txt | 51 +++++--- cocos/3d/cocos3d.h | 41 +++++++ cocos/Android.mk | 16 --- cocos/CMakeLists.txt | 2 - cocos/cocos2d.h | 13 --- tests/cpp-tests/Android.mk | 2 + tests/cpp-tests/CMakeLists.txt | 1 + .../Classes/Camera3DTest/Camera3DTest.cpp | 1 + .../Classes/Sprite3DTest/Sprite3DTest.cpp | 1 + tests/cpp-tests/Classes/testBasic.h | 1 + tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 3 + 29 files changed, 130 insertions(+), 207 deletions(-) mode change 100755 => 100644 cocos/3d/CCAABB.h mode change 100755 => 100644 cocos/3d/CCOBB.h mode change 100755 => 100644 cocos/3d/CCRay.h create mode 100755 cocos/3d/cocos3d.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f1e9da541..bd59e4b987 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,9 @@ add_subdirectory(cocos/audio) # cocos2d library add_subdirectory(cocos) +# cocos3d library +add_subdirectory(cocos/3d) + # network library add_subdirectory(cocos/network) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 44afe74dca..869f2360d8 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -45,6 +45,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaextension", "..\cocos EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\cocos\scripting\lua-bindings\proj.win32\libluaspine.vcxproj", "{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -139,6 +141,10 @@ Global {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.Build.0 = Debug|Win32 {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.ActiveCfg = Release|Win32 {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.Build.0 = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.ActiveCfg = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 8e715c2905..cb3e53540c 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -120,6 +120,8 @@ 15162221199E7A32006099B8 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; 15162222199E7A32006099B8 /* CCSprite3DMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DMaterial.h */; }; 15162223199E7A32006099B8 /* CCBundle3DData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3D3B81948613300BA4831 /* CCBundle3DData.h */; }; + 15162237199F9EEA006099B8 /* cocos3d.h in Headers */ = {isa = PBXBuildFile; fileRef = 15162236199F9EEA006099B8 /* cocos3d.h */; }; + 15162238199F9EEA006099B8 /* cocos3d.h in Headers */ = {isa = PBXBuildFile; fileRef = 15162236199F9EEA006099B8 /* cocos3d.h */; }; 15EFA211198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA212198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA213198A2BB5000C57D3 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */; }; @@ -2106,6 +2108,7 @@ 06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.h; sourceTree = ""; }; 1516200B199E7363006099B8 /* libcocos3d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos3d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 15162201199E7810006099B8 /* libcocos3d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos3d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 15162236199F9EEA006099B8 /* cocos3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocos3d.h; sourceTree = ""; }; 1551A33F158F2AB200E66CFE /* libcocos2d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1551A342158F2AB200E66CFE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProtectedNode.cpp; sourceTree = ""; }; @@ -5289,6 +5292,7 @@ B29594B81926D61F003EEF37 /* 3d */ = { isa = PBXGroup; children = ( + 15162236199F9EEA006099B8 /* cocos3d.h */, B6105175199CB1A600DC41CE /* CCAABB.cpp */, B6105176199CB1A600DC41CE /* CCAABB.h */, B6105177199CB1A600DC41CE /* CCOBB.cpp */, @@ -5346,6 +5350,7 @@ 15162023199E75FF006099B8 /* CCBundleReader.h in Headers */, 15162024199E75FF006099B8 /* CCBundle3D.h in Headers */, 15162025199E75FF006099B8 /* CCAnimate3D.h in Headers */, + 15162237199F9EEA006099B8 /* cocos3d.h in Headers */, 15162026199E75FF006099B8 /* CCMeshSkin.h in Headers */, 15162027199E75FF006099B8 /* CCAnimation3D.h in Headers */, 15162028199E75FF006099B8 /* CCAnimationCurve.h in Headers */, @@ -5371,6 +5376,7 @@ 15162219199E7A32006099B8 /* CCBundleReader.h in Headers */, 1516221A199E7A32006099B8 /* CCBundle3D.h in Headers */, 1516221B199E7A32006099B8 /* CCAnimate3D.h in Headers */, + 15162238199F9EEA006099B8 /* cocos3d.h in Headers */, 1516221C199E7A32006099B8 /* CCMeshSkin.h in Headers */, 1516221D199E7A32006099B8 /* CCAnimation3D.h in Headers */, 1516221E199E7A32006099B8 /* CCAnimationCurve.h in Headers */, diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 331e1c58cc..91e74ad18a 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -183,22 +183,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - - - - - - - - - - - - - @@ -377,24 +361,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - - - - - - - - - - - - - - - @@ -592,7 +558,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index b1c46820b0..eb482baa59 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -52,9 +52,6 @@ {b4e2b1e5-2d79-44a3-af45-728d47b7bdb2} - - {a20c4bdc-bd4c-40c1-a78a-fe31cd3ec76a} - {44bdf58f-4af2-433c-b4af-58dc05ef96b5} @@ -550,36 +547,9 @@ renderer - - 3d - - - 3d - - - 3d - base - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - 2d @@ -589,18 +559,6 @@ storage - - 3d - - - 3d - - - 3d - - - 3d - platform\desktop @@ -613,15 +571,6 @@ base - - 3d - - - 3d - - - 3d - renderer @@ -1201,42 +1150,9 @@ renderer - - 3d - - - 3d - - - 3d - base - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - 2d @@ -1246,18 +1162,6 @@ storage - - 3d - - - 3d - - - 3d - - - 3d - platform\desktop @@ -1270,15 +1174,6 @@ base - - 3d - - - 3d - - - 3d - renderer @@ -1317,9 +1212,6 @@ math - - 3d - \ No newline at end of file diff --git a/cocos/3d/CCAABB.h b/cocos/3d/CCAABB.h old mode 100755 new mode 100644 index 8894aa0098..20d1650e70 --- a/cocos/3d/CCAABB.h +++ b/cocos/3d/CCAABB.h @@ -27,10 +27,11 @@ #include "base/ccMacros.h" #include "math/CCMath.h" +#include "3d/3dExport.h" NS_CC_BEGIN -class CC_DLL AABB +class CC_3D_DLL AABB { public: diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index 823221d74d..d6d8152bb2 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -34,6 +34,7 @@ #include "base/ccTypes.h" #include "base/CCPlatformMacros.h" #include "2d/CCActionInterval.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -42,7 +43,7 @@ class Bone3D; /** * Animate3D, Animates a Sprite3D given with an Animation3D */ -class CC_DLL Animate3D: public ActionInterval +class CC_3D_DLL Animate3D: public ActionInterval { public: diff --git a/cocos/3d/CCAnimation3D.h b/cocos/3d/CCAnimation3D.h index 27713d9b20..006506d018 100644 --- a/cocos/3d/CCAnimation3D.h +++ b/cocos/3d/CCAnimation3D.h @@ -33,13 +33,14 @@ #include "base/CCRef.h" #include "base/ccTypes.h" #include "CCBundle3DData.h" +#include "3d/3dExport.h" NS_CC_BEGIN /** * static animation data, shared */ -class CC_DLL Animation3D: public Ref +class CC_3D_DLL Animation3D: public Ref { friend class Bundle3D; public: diff --git a/cocos/3d/CCAttachNode.h b/cocos/3d/CCAttachNode.h index bb142e1434..ed67bca143 100644 --- a/cocos/3d/CCAttachNode.h +++ b/cocos/3d/CCAttachNode.h @@ -33,6 +33,7 @@ #include "math/CCMath.h" #include "2d/CCNode.h" #include "renderer/CCMeshCommand.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ class Bone3D; * auto attachNode = sprite->getAttachNode("left hand"); * attachNode->addChild(weapon); */ -class CC_DLL AttachNode : public Node +class CC_3D_DLL AttachNode : public Node { public: /** diff --git a/cocos/3d/CCBundle3D.h b/cocos/3d/CCBundle3D.h index 58749abab0..b2b40aaf86 100644 --- a/cocos/3d/CCBundle3D.h +++ b/cocos/3d/CCBundle3D.h @@ -35,6 +35,7 @@ #include "json/document.h" #include "CCBundleReader.h" +#include "3d/3dExport.h" NS_CC_BEGIN class Animation3D; @@ -46,7 +47,7 @@ class Data; * c3t text file * c3b binary file */ -class CC_DLL Bundle3D +class CC_3D_DLL Bundle3D { public: /**you can define yourself bundle and set it, use default bundle otherwise*/ diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index 304a09f207..fa16d6c703 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -38,6 +38,7 @@ #include "renderer/CCGLProgram.h" #include "CCAABB.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ NS_CC_BEGIN class EventListenerCustom; class EventCustom; -class CC_DLL RenderMeshData +class CC_3D_DLL RenderMeshData { typedef std::vector IndexArray; friend class Mesh; @@ -72,7 +73,7 @@ protected: * Mesh: Geometry with a collection of vertex. * Supporting various vertex formats. */ -class CC_DLL Mesh : public Ref +class CC_3D_DLL Mesh : public Ref { typedef std::vector IndexArray; public: diff --git a/cocos/3d/CCMeshSkin.h b/cocos/3d/CCMeshSkin.h index bd5ff24245..20910ece02 100644 --- a/cocos/3d/CCMeshSkin.h +++ b/cocos/3d/CCMeshSkin.h @@ -35,6 +35,7 @@ #include "base/CCVector.h" #include "base/ccTypes.h" #include "math/CCMath.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ class Skeleton3D; * MeshSkin, A class maintain a collection of bones that affect Mesh vertex. * And it is responsible for computing matrix palletes that used by skin mesh rendering. */ -class CC_DLL MeshSkin: public Ref +class CC_3D_DLL MeshSkin: public Ref { public: diff --git a/cocos/3d/CCOBB.h b/cocos/3d/CCOBB.h old mode 100755 new mode 100644 index 0fd8c1eea1..917472f224 --- a/cocos/3d/CCOBB.h +++ b/cocos/3d/CCOBB.h @@ -26,10 +26,11 @@ #define __CC_OBB_H__ #include "CCAABB.h" +#include "3d/3dExport.h" NS_CC_BEGIN -class CC_DLL OBB +class CC_3D_DLL OBB { public: OBB(); diff --git a/cocos/3d/CCRay.h b/cocos/3d/CCRay.h old mode 100755 new mode 100644 index 0deab2a68a..d92d0ac06c --- a/cocos/3d/CCRay.h +++ b/cocos/3d/CCRay.h @@ -29,10 +29,11 @@ #include "math/CCMath.h" #include "CCAABB.h" #include "CCOBB.h" +#include "3d/3dExport.h" NS_CC_BEGIN -class CC_DLL Ray +class CC_3D_DLL Ray { public: /** diff --git a/cocos/3d/CCSkeleton3D.h b/cocos/3d/CCSkeleton3D.h index 2b8af4bebe..d6c431c22f 100644 --- a/cocos/3d/CCSkeleton3D.h +++ b/cocos/3d/CCSkeleton3D.h @@ -34,13 +34,14 @@ #include "base/CCVector.h" #include "base/ccTypes.h" #include "math/CCMath.h" +#include "3d/3dExport.h" NS_CC_BEGIN /** * Defines a basic hierachial structure of transformation spaces. */ -class CC_DLL Bone3D : public Ref +class CC_3D_DLL Bone3D : public Ref { friend class Skeleton3D; friend class MeshSkin; @@ -183,7 +184,7 @@ protected: * Skeleton * */ -class CC_DLL Skeleton3D: public Ref +class CC_3D_DLL Skeleton3D: public Ref { public: diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 4a594d5483..36de7ac3cf 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -34,6 +34,7 @@ #include "2d/CCNode.h" #include "renderer/CCMeshCommand.h" #include "CCAABB.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -46,7 +47,7 @@ class SubMeshState; class Skeleton3D; /** Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */ -class CC_DLL Sprite3D : public Node, public BlendProtocol +class CC_3D_DLL Sprite3D : public Node, public BlendProtocol { public: /** creates a Sprite3D*/ @@ -144,7 +145,7 @@ protected: mutable Mat4 _nodeToWorldTransform; // cache the matrix }; -extern std::string CC_DLL s_attributeNames[];//attribute names array +extern std::string CC_3D_DLL s_attributeNames[];//attribute names array NS_CC_END #endif // __SPRITE3D_H_ diff --git a/cocos/3d/CCSubMesh.h b/cocos/3d/CCSubMesh.h index ff8dc0e026..d8f62e7e65 100644 --- a/cocos/3d/CCSubMesh.h +++ b/cocos/3d/CCSubMesh.h @@ -34,6 +34,7 @@ #include "base/ccTypes.h" #include "math/CCMath.h" #include "renderer/CCGLProgram.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -57,7 +58,7 @@ enum class PrimitiveType /** * SubMesh: Defines the way the mesh's vertices how to be connected together. */ -class CC_DLL SubMesh : public Ref +class CC_3D_DLL SubMesh : public Ref { friend class Mesh; public: diff --git a/cocos/3d/CCSubMeshState.h b/cocos/3d/CCSubMeshState.h index 26bca6cb17..542b0ecd32 100644 --- a/cocos/3d/CCSubMeshState.h +++ b/cocos/3d/CCSubMeshState.h @@ -34,6 +34,7 @@ #include "base/ccTypes.h" #include "math/CCMath.h" #include "renderer/CCGLProgram.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -42,7 +43,7 @@ class MeshSkin; /** * SubMeshState: visibility and apperence of submesh */ -class CC_DLL SubMeshState : public Ref +class CC_3D_DLL SubMeshState : public Ref { public: diff --git a/cocos/3d/CMakeLists.txt b/cocos/3d/CMakeLists.txt index a5d625b094..5d353f8874 100644 --- a/cocos/3d/CMakeLists.txt +++ b/cocos/3d/CMakeLists.txt @@ -1,18 +1,37 @@ set(COCOS_3D_SRC - 3d/CCAABB.cpp - 3d/CCOBB.cpp - 3d/CCRay.cpp - 3d/CCSkeleton3D.cpp - 3d/CCAttachNode.cpp - 3d/CCSubMesh.cpp - 3d/CCSubMeshState.cpp - 3d/CCMesh.cpp - 3d/CCObjLoader.cpp - 3d/CCSprite3D.cpp - 3d/CCSprite3DMaterial.cpp - 3d/CCAnimate3D.cpp - 3d/CCAnimation3D.cpp - 3d/CCBundle3D.cpp - 3d/CCMeshSkin.cpp - 3d/CCBundleReader.cpp +CCRay.cpp +CCAABB.cpp +CCOBB.cpp +CCAnimate3D.cpp +CCAnimation3D.cpp +CCAttachNode.cpp +CCBundle3D.cpp +CCBundleReader.cpp +CCMesh.cpp +CCMeshSkin.cpp +CCSprite3DMaterial.cpp +CCObjLoader.cpp +CCSkeleton3D.cpp +CCSprite3D.cpp +CCSubMesh.cpp +CCSubMeshState.cpp ) + + +include_directories( + 3d +) + +add_library(cocos3d STATIC + ${COCOS_3D_SRC} +) + +target_link_libraries(cocos3d + cocos2d +) + +set_target_properties(cocos3d + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" +) \ No newline at end of file diff --git a/cocos/3d/cocos3d.h b/cocos/3d/cocos3d.h new file mode 100755 index 0000000000..58e88e969d --- /dev/null +++ b/cocos/3d/cocos3d.h @@ -0,0 +1,41 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __COCOS_3D_COCOS3D_H__ +#define __COCOS_3D_COCOS3D_H__ + +//3d +#include "3d/CCAABB.h" +#include "3d/CCOBB.h" +#include "3d/CCRay.h" +#include "3d/CCSprite3D.h" +#include "3d/CCMesh.h" +#include "3d/CCMeshSkin.h" +#include "3d/CCAnimate3D.h" +#include "3d/CCAnimation3D.h" +#include "3d/CCSprite3DMaterial.h" +#include "3d/CCSubMeshState.h" +#include "3d/CCAttachNode.h" + +#endif diff --git a/cocos/Android.mk b/cocos/Android.mk index 463fdd53c6..fc522d5810 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -74,22 +74,6 @@ cocos2d.cpp \ 2d/CCTransitionPageTurn.cpp \ 2d/CCTransitionProgress.cpp \ 2d/CCTweenFunction.cpp \ -3d/CCRay.cpp\ -3d/CCAABB.cpp \ -3d/CCOBB.cpp \ -3d/CCAnimate3D.cpp \ -3d/CCAnimation3D.cpp \ -3d/CCAttachNode.cpp \ -3d/CCBundle3D.cpp \ -3d/CCBundleReader.cpp \ -3d/CCMesh.cpp \ -3d/CCMeshSkin.cpp \ -3d/CCSprite3DMaterial.cpp \ -3d/CCObjLoader.cpp \ -3d/CCSkeleton3D.cpp \ -3d/CCSprite3D.cpp \ -3d/CCSubMesh.cpp \ -3d/CCSubMeshState.cpp \ platform/CCGLView.cpp \ platform/CCFileUtils.cpp \ platform/CCSAXParser.cpp \ diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 7965b6d867..bb62406fe1 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -5,7 +5,6 @@ endif() set(COCOS_SRC cocos2d.cpp) include(2d/CMakeLists.txt) -include(3d/CMakeLists.txt) include(platform/CMakeLists.txt) include(physics/CMakeLists.txt) include(math/CMakeLists.txt) @@ -16,7 +15,6 @@ include(deprecated/CMakeLists.txt) add_library(cocos2d STATIC ${COCOS_SRC} ${COCOS_2D_SRC} - ${COCOS_3D_SRC} ${COCOS_PLATFORM_SRC} ${COCOS_BASE_SRC} ${COCOS_RENDERER_SRC} diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 3e19d4a5c5..96158acfcf 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -261,19 +261,6 @@ THE SOFTWARE. #include "2d/CCComponent.h" #include "2d/CCComponentContainer.h" -//3d -#include "3d/CCAABB.h" -#include "3d/CCOBB.h" -#include "3d/CCRay.h" -#include "3d/CCSprite3D.h" -#include "3d/CCMesh.h" -#include "3d/CCMeshSkin.h" -#include "3d/CCAnimate3D.h" -#include "3d/CCAnimation3D.h" -#include "3d/CCSprite3DMaterial.h" -#include "3d/CCSubMeshState.h" -#include "3d/CCAttachNode.h" - // Deprecated include #include "deprecated/CCDictionary.h" #include "deprecated/CCArray.h" diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 9b69186e42..c1fcaefe21 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -195,6 +195,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes @@ -207,3 +208,4 @@ $(call import-module,editor-support/spine) $(call import-module,editor-support/cocostudio) $(call import-module,network) $(call import-module,Box2D) +$(call import-module,3d) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index e457e435f2..5dcfe748c8 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -207,6 +207,7 @@ target_link_libraries(${APP_NAME} extensions audio cocos2d + cocos3d box2d ui network diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index 1f779c3d22..6f0eda505a 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -28,6 +28,7 @@ THE SOFTWARE. #include "../testResource.h" #include "3d/CCAttachNode.h" +#include "3d/cocos3d.h" ////////////DrawLine///////////////////// diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 2410ffb068..9079785751 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -29,6 +29,7 @@ #include "3d/CCSubMesh.h" #include "3d/CCAttachNode.h" #include "3d/CCRay.h" +#include "3d/CCSprite3D.h" #include "DrawNode3D.h" #include diff --git a/tests/cpp-tests/Classes/testBasic.h b/tests/cpp-tests/Classes/testBasic.h index 5da3ba1a11..02fb9f32ad 100644 --- a/tests/cpp-tests/Classes/testBasic.h +++ b/tests/cpp-tests/Classes/testBasic.h @@ -2,6 +2,7 @@ #define _TEST_BASIC_H_ #include "cocos2d.h" +#include "3d/cocos3d.h" #include "audio/include/SimpleAudioEngine.h" #include "VisibleRect.h" diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 27cc2c0735..cd2cbd3f0a 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -567,6 +567,9 @@ {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + {e24950fa-5bc1-4aee-a900-4f0259354bf0} + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} From 7596a8a83152ff821f3ddb6a4bf1f0c1a866b9db Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 14:58:57 +0800 Subject: [PATCH 107/147] =?UTF-8?q?Split=20cocos3d=20from=20cocos2d=20on?= =?UTF-8?q?=20the=20android=E3=80=81win32=20and=20linux=20platform=20and?= =?UTF-8?q?=20adjust=20the=20related=20test=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/3d/3dExport.h | 28 ++++ cocos/3d/Android.mk | 33 ++++ cocos/3d/proj.win32/libcocos3d.vcxproj | 148 ++++++++++++++++++ .../3d/proj.win32/libcocos3d.vcxproj.filters | 120 ++++++++++++++ cocos/3d/proj.win32/libcocos3d.vcxproj.user | 4 + 5 files changed, 333 insertions(+) create mode 100644 cocos/3d/3dExport.h create mode 100644 cocos/3d/Android.mk create mode 100644 cocos/3d/proj.win32/libcocos3d.vcxproj create mode 100644 cocos/3d/proj.win32/libcocos3d.vcxproj.filters create mode 100644 cocos/3d/proj.win32/libcocos3d.vcxproj.user diff --git a/cocos/3d/3dExport.h b/cocos/3d/3dExport.h new file mode 100644 index 0000000000..30b90d478e --- /dev/null +++ b/cocos/3d/3dExport.h @@ -0,0 +1,28 @@ +#ifndef __COCOS_3D_3DEXPORT_H__ +#define __COCOS_3D_3DEXPORT_H__ + +#if defined(WIN32) && defined(_WINDOWS) + #ifdef __MINGW32__ + #include + #endif + + #if defined(_USE3DDLL) + #define CC_3D_DLL __declspec(dllexport) + #else /* use a DLL library */ + #define CC_3D_DLL __declspec(dllimport) + #endif + + + /* Define NULL pointer value */ + #ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif + #endif +#else + #define CC_3D_DLL +#endif + +#endif // __COCOS_3D_3DEXPORT_H__ \ No newline at end of file diff --git a/cocos/3d/Android.mk b/cocos/3d/Android.mk new file mode 100644 index 0000000000..cf05d12d7b --- /dev/null +++ b/cocos/3d/Android.mk @@ -0,0 +1,33 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos3d_static + +LOCAL_MODULE_FILENAME := libcocos3d + +LOCAL_SRC_FILES := \ +CCRay.cpp \ +CCAABB.cpp \ +CCOBB.cpp \ +CCAnimate3D.cpp \ +CCAnimation3D.cpp \ +CCAttachNode.cpp \ +CCBundle3D.cpp \ +CCBundleReader.cpp \ +CCMesh.cpp \ +CCMeshSkin.cpp \ +CCSprite3DMaterial.cpp \ +CCObjLoader.cpp \ +CCSkeleton3D.cpp \ +CCSprite3D.cpp \ +CCSubMesh.cpp \ +CCSubMeshState.cpp \ + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../../external \ + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/3d/proj.win32/libcocos3d.vcxproj b/cocos/3d/proj.win32/libcocos3d.vcxproj new file mode 100644 index 0000000000..25fe3874e2 --- /dev/null +++ b/cocos/3d/proj.win32/libcocos3d.vcxproj @@ -0,0 +1,148 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {E24950FA-5BC1-4AEE-A900-4F0259354BF0} + libcocos3d + libcocos3d + + + + DynamicLibrary + true + v100 + v110 + v110_xp + v120 + v120_xp + Unicode + + + DynamicLibrary + false + v100 + v110 + v110_xp + v120 + v120_xp + true + Unicode + + + + + + + + + + + + + + + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + + + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + + + + Level3 + Disabled + + + $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)external;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;%(PreprocessorDefinitions) + true + 4267;4251;4244;%(DisableSpecificWarnings) + false + OldStyle + + + true + $(OutDir);%(AdditionalLibraryDirectories) + opengl32.lib;glew32.lib;%(AdditionalDependencies) + + + + + Level3 + MinSpace + true + true + + + WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;%(PreprocessorDefinitions) + $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)external;%(AdditionalIncludeDirectories) + None + false + + + true + true + true + $(OutDir);%(AdditionalLibraryDirectories) + opengl32.lib;glew32.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/cocos/3d/proj.win32/libcocos3d.vcxproj.filters b/cocos/3d/proj.win32/libcocos3d.vcxproj.filters new file mode 100644 index 0000000000..21f2af6ec5 --- /dev/null +++ b/cocos/3d/proj.win32/libcocos3d.vcxproj.filters @@ -0,0 +1,120 @@ + + + + + {6107c94d-579b-488f-86b7-c191d4c3b9aa} + + + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + 3d + + + \ No newline at end of file diff --git a/cocos/3d/proj.win32/libcocos3d.vcxproj.user b/cocos/3d/proj.win32/libcocos3d.vcxproj.user new file mode 100644 index 0000000000..a375ae3527 --- /dev/null +++ b/cocos/3d/proj.win32/libcocos3d.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From e3149ce41aa598feb88c9e1f61d2c04621650aa6 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 15:00:40 +0800 Subject: [PATCH 108/147] Split lua bindings for 3D from cocos2d --- tools/tolua/cocos2dx.ini | 16 ++------- tools/tolua/cocos2dx_3d.ini | 68 +++++++++++++++++++++++++++++++++++++ tools/tolua/genbindings.py | 1 + 3 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 tools/tolua/cocos2dx_3d.ini diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 146766e652..70a3fe7618 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -22,11 +22,11 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %(cocosdir)s/cocos/3d/CCAnimation3D.h %(cocosdir)s/cocos/3d/CCAnimate3D.h +headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console Mesh GLProgramCache GLProgramState SubMeshState AttachNode Camera Ray AABB OBB +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console GLProgramCache GLProgramState Camera # 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 @@ -126,17 +126,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS TurnOffTiles::[shuffle], LabelTTF::[*], LabelBMFont::[*], - Mesh::[create getOriginAABB], - SubMeshState::[getSkin setSkin create], - Sprite3D::[getSkin getSubMeshState getAABB], - Animation3D::[getBoneCurveByName], - Animation3DCache::[*], - Sprite3DMaterialCache::[*], - Bone3D::[*], - Scene::[getCameras], - Ray::[*], - AABB::[*], - OBB::[*] + Scene::[getCameras] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], diff --git a/tools/tolua/cocos2dx_3d.ini b/tools/tolua/cocos2dx_3d.ini new file mode 100644 index 0000000000..db2a91cf3f --- /dev/null +++ b/tools/tolua/cocos2dx_3d.ini @@ -0,0 +1,68 @@ +[cocos2dx_3d] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_3d + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = cc + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include +android_flags = -D_SIZE_T_DEFINED_ + +clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include +clang_flags = -nostdinc -x c++ -std=c++11 + +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android +cocos_flags = -DANDROID + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/3d/cocos3d.h + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". +classes = .*3D$ Mesh SubMeshState AttachNode + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = Mesh::[create getOriginAABB], + SubMeshState::[getSkin setSkin create], + Sprite3D::[getSkin getSubMeshState getAABB], + Animation3D::[getBoneCurveByName], + Animation3DCache::[*], + Sprite3DMaterialCache::[*], + Bone3D::[*], + Ray::[*], + AABB::[*], + OBB::[*] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = Clonable + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + diff --git a/tools/tolua/genbindings.py b/tools/tolua/genbindings.py index 4e836491e5..152bff8ef4 100755 --- a/tools/tolua/genbindings.py +++ b/tools/tolua/genbindings.py @@ -137,6 +137,7 @@ def main(): 'cocos2dx_controller.ini' : ('cocos2dx_controller', 'lua_cocos2dx_controller_auto'), \ 'cocos2dx_cocosbuilder.ini': ('cocos2dx_cocosbuilder', 'lua_cocos2dx_cocosbuilder_auto'), \ 'cocos2dx_cocosdenshion.ini': ('cocos2dx_cocosdenshion', 'lua_cocos2dx_cocosdenshion_auto'), \ + 'cocos2dx_3d.ini': ('cocos2dx_3d', 'lua_cocos2dx_3d_auto'), \ } target = 'lua' generator_py = '%s/generator.py' % cxx_generator_root From e0168c373c61a388c27c2c8107fe0695ea8372a7 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 15:04:32 +0800 Subject: [PATCH 109/147] Add manual lua bindings for 3d and adjust related test case on different platform --- build/cocos2d-win32.vc2012.sln | 6 + build/cocos2d_tests.xcodeproj/project.pbxproj | 90 +++++++ cocos/scripting/lua-bindings/CMakeLists.txt | 22 ++ .../manual/3d/lua_cocos2dx_3d_manual.cpp | 38 +++ .../manual/3d/lua_cocos2dx_3d_manual.h | 38 +++ .../lua-bindings/manual/LuaBasicConversions.h | 1 + .../lua-bindings/proj.android/Android.mk | 23 ++ .../project.pbxproj | 222 ++++++++++++++++++ .../proj.win32/libluacocos3d.vcxproj | 147 ++++++++++++ .../proj.win32/libluacocos3d.vcxproj.filters | 30 +++ .../proj.win32/libluacocos3d.vcxproj.user | 4 + tests/lua-tests/project/CMakeLists.txt | 2 + .../project/Classes/lua_module_register.h | 2 + .../project/proj.android/jni/Android.mk | 1 + .../proj.win32/lua-tests.win32.vcxproj | 3 + 15 files changed, 629 insertions(+) create mode 100644 cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp create mode 100644 cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.h create mode 100644 cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj create mode 100644 cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.filters create mode 100644 cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.user diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 869f2360d8..1407201e55 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -47,6 +47,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\cocos\scr EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos3d", "..\cocos\scripting\lua-bindings\proj.win32\libluacocos3d.vcxproj", "{06840490-14A4-43D6-88BC-AAFA44D043EB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -145,6 +147,10 @@ Global {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32 {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32 {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.ActiveCfg = Debug|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.Build.0 = Debug|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.ActiveCfg = Release|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 2918c5e756..b75a2a309f 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -60,11 +60,15 @@ 1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 15162232199F95C6006099B8 /* libcocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1516222D199F95B2006099B8 /* libcocos3d Mac.a */; }; 15162235199F97E1006099B8 /* libcocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1516222F199F95B2006099B8 /* libcocos3d iOS.a */; }; + 151622C819A0F689006099B8 /* libluacocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 151622C319A0F66B006099B8 /* libluacocos3d Mac.a */; }; + 151622C919A0F692006099B8 /* libcocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1516222D199F95B2006099B8 /* libcocos3d Mac.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 */; }; 15427B7D198B880100DC375D /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427B7B198B880100DC375D /* lua_cocos2dx_controller_manual.cpp */; }; 15427B7E198B896D00DC375D /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */; }; 156EAE071977D0BD00F53709 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; + 158C129419A0FC6400781A76 /* libcocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1516222F199F95B2006099B8 /* libcocos3d iOS.a */; }; + 158C129519A0FC6400781A76 /* libluacocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 151622C519A0F66B006099B8 /* libluacocos3d iOS.a */; }; 15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; }; 15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; @@ -1032,6 +1036,34 @@ remoteGlobalIDString = 15162030199E7810006099B8; remoteInfo = "libcocos3d iOS"; }; + 151622BE19A0F66B006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1516224519A0F32D006099B8; + remoteInfo = "libluacocos3d Mac"; + }; + 151622C219A0F66B006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516227C19A0F32D006099B8; + remoteInfo = "libluacocos3d Mac"; + }; + 151622C419A0F66B006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 151622BB19A0F45E006099B8; + remoteInfo = "libluacocos3d iOS"; + }; + 151622C619A0F679006099B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15161E42199E7362006099B8; + remoteInfo = "libcocos3d Mac"; + }; 15427B80198B8ACB00DC375D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; @@ -1221,6 +1253,20 @@ remoteGlobalIDString = 15C1C255198748D200A46ACC; remoteInfo = "libluacocos2d Mac"; }; + 158C128B19A0FC4700781A76 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15162030199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 158C129219A0FC5300781A76 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1516228319A0F45E006099B8; + remoteInfo = "libluacocos3d iOS"; + }; 15CBA017196EE56C005877BB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; @@ -3816,6 +3862,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 151622C919A0F692006099B8 /* libcocos3d Mac.a in Frameworks */, + 151622C819A0F689006099B8 /* libluacocos3d Mac.a in Frameworks */, 15EFA27A198B269E000C57D3 /* libluaextension Mac.a in Frameworks */, 15EFA279198B268A000C57D3 /* libluanetwork Mac.a in Frameworks */, 15EFA278198B2673000C57D3 /* libluaspine Mac.a in Frameworks */, @@ -3850,6 +3898,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 158C129419A0FC6400781A76 /* libcocos3d iOS.a in Frameworks */, + 158C129519A0FC6400781A76 /* libluacocos3d iOS.a in Frameworks */, 15EFA66F198B356E000C57D3 /* libluacocos2d iOS.a in Frameworks */, 15EFA670198B356E000C57D3 /* libluacocosbuilder iOS.a in Frameworks */, 15EFA671198B356E000C57D3 /* libluacocosdenshion iOS.a in Frameworks */, @@ -6078,6 +6128,7 @@ 15EFA252198A4A24000C57D3 /* libluaspine Mac.a */, 15EFA254198A4A24000C57D3 /* libluanetwork Mac.a */, 15EFA256198A4A24000C57D3 /* libluacocosdenshion Mac.a */, + 151622C319A0F66B006099B8 /* libluacocos3d Mac.a */, 15EFA258198A4A24000C57D3 /* libluacocos2d Mac.a */, 15EFA25A198A4A24000C57D3 /* libluaextension iOS.a */, 15EFA659198B33EE000C57D3 /* libluaui iOS.a */, @@ -6086,6 +6137,7 @@ 15EFA65F198B33EE000C57D3 /* libluaspine iOS.a */, 15EFA661198B33EE000C57D3 /* libluanetwork iOS.a */, 15EFA663198B33EE000C57D3 /* libluacocosdenshion iOS.a */, + 151622C519A0F66B006099B8 /* libluacocos3d iOS.a */, 15EFA665198B33EE000C57D3 /* libluacocos2d iOS.a */, ); name = Products; @@ -8093,6 +8145,8 @@ buildRules = ( ); dependencies = ( + 151622C719A0F679006099B8 /* PBXTargetDependency */, + 151622BF19A0F66B006099B8 /* PBXTargetDependency */, 15427BA7198B8C5000DC375D /* PBXTargetDependency */, 15427BA9198B8C5000DC375D /* PBXTargetDependency */, 15427BAB198B8C5000DC375D /* PBXTargetDependency */, @@ -8127,6 +8181,8 @@ buildRules = ( ); dependencies = ( + 158C129319A0FC5300781A76 /* PBXTargetDependency */, + 158C128C19A0FC4700781A76 /* PBXTargetDependency */, 15427B87198B8BB400DC375D /* PBXTargetDependency */, 15427B89198B8BB400DC375D /* PBXTargetDependency */, 15427B8B198B8BB400DC375D /* PBXTargetDependency */, @@ -8290,6 +8346,20 @@ remoteRef = 1516222E199F95B2006099B8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 151622C319A0F66B006099B8 /* libluacocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libluacocos3d Mac.a"; + remoteRef = 151622C219A0F66B006099B8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 151622C519A0F66B006099B8 /* libluacocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libluacocos3d iOS.a"; + remoteRef = 151622C419A0F66B006099B8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 15EFA24A198A4A24000C57D3 /* libluaextension Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -9478,6 +9548,16 @@ name = "libcocos3d iOS"; targetProxy = 15162233199F97D1006099B8 /* PBXContainerItemProxy */; }; + 151622BF19A0F66B006099B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos3d Mac"; + targetProxy = 151622BE19A0F66B006099B8 /* PBXContainerItemProxy */; + }; + 151622C719A0F679006099B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d Mac"; + targetProxy = 151622C619A0F679006099B8 /* PBXContainerItemProxy */; + }; 15427B81198B8ACB00DC375D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libluanetwork iOS"; @@ -9613,6 +9693,16 @@ name = "libluacocos2d Mac"; targetProxy = 15427BB4198B8C5000DC375D /* PBXContainerItemProxy */; }; + 158C128C19A0FC4700781A76 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d iOS"; + targetProxy = 158C128B19A0FC4700781A76 /* PBXContainerItemProxy */; + }; + 158C129319A0FC5300781A76 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos3d iOS"; + targetProxy = 158C129219A0FC5300781A76 /* PBXContainerItemProxy */; + }; 15CBA016196EE56C005877BB /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx iOS"; diff --git a/cocos/scripting/lua-bindings/CMakeLists.txt b/cocos/scripting/lua-bindings/CMakeLists.txt index 6e78b906df..7da34f7b45 100644 --- a/cocos/scripting/lua-bindings/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/CMakeLists.txt @@ -205,3 +205,25 @@ set_target_properties(luaui ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) + +#luacocos3d +set(LIBLUA3D_SRC + auto/lua_cocos2dx_3d_auto.cpp + manual/3d/lua_cocos2dx_3d_manual.cpp +) + +include_directories( + auto + manual/3d + ../../../3d +) + +add_library(luacocos3d STATIC + ${LIBLUA3D_SRC} +) + +set_target_properties(luacocos3d + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" +) diff --git a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp new file mode 100644 index 0000000000..e23e93c7b2 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp @@ -0,0 +1,38 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#include "lua_cocos2dx_3d_manual.h" +#include "lua_cocos2dx_3d_auto.hpp" +#include "CCLuaEngine.h" + +int register_cocos3d_module(lua_State* L) +{ + lua_getglobal(L, "_G"); + if (lua_istable(L,-1))//stack:...,_G, + { + register_all_cocos2dx_3d(L); + } + lua_pop(L, 1); + + return 1; +} \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.h b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.h new file mode 100644 index 0000000000..abebac4974 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.h @@ -0,0 +1,38 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_COCOS3D_LUA_COCOS2DX_3D_MANUAL_H__ +#define COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_COCOS3D_LUA_COCOS2DX_3D_MANUAL_H__ + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +TOLUA_API int register_cocos3d_module(lua_State* L); + + +#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_3D_LUA_COCOS2DX_COCOSDENSHION_MANUAL_H__ diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 0f3db745eb..2d07f4a2f2 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -30,6 +30,7 @@ extern "C" { } #include "tolua_fix.h" #include "cocos2d.h" +#include "3d/cocos3d.h" using namespace cocos2d; diff --git a/cocos/scripting/lua-bindings/proj.android/Android.mk b/cocos/scripting/lua-bindings/proj.android/Android.mk index 80c5b7e017..2e6031074c 100644 --- a/cocos/scripting/lua-bindings/proj.android/Android.mk +++ b/cocos/scripting/lua-bindings/proj.android/Android.mk @@ -60,6 +60,28 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static include $(BUILD_STATIC_LIBRARY) +#libluacocos3d +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos3d_lua_static + +LOCAL_MODULE_FILENAME := libluacocos3d + +LOCAL_SRC_FILES := ../manual/3d/lua_cocos2dx_3d_manual.cpp \ + ../auto/lua_cocos2dx_3d_auto.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../auto \ + $(LOCAL_PATH)/../manual/3d \ + $(LOCAL_PATH)/../../../3d \ + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/3d + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static + +include $(BUILD_STATIC_LIBRARY) + +#libluacocosdenshion include $(CLEAR_VARS) LOCAL_MODULE := cocosdenshion_lua_static @@ -238,5 +260,6 @@ $(call import-module,editor-support/cocostudio) $(call import-module,editor-support/spine) $(call import-module,ui) $(call import-module,extensions) +$(call import-module,3d) diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index aecee79193..d5ce19e644 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -46,12 +46,20 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1516228119A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1516227F19A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp */; }; + 1516228219A0F3E3006099B8 /* lua_cocos2dx_3d_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1516228019A0F3E3006099B8 /* lua_cocos2dx_3d_auto.hpp */; }; + 151622BC19A0F4E3006099B8 /* lua_cocos2dx_3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1516227F19A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp */; }; + 151622BD19A0F4EC006099B8 /* lua_cocos2dx_3d_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1516228019A0F3E3006099B8 /* lua_cocos2dx_3d_auto.hpp */; }; 15427D44198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427D42198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.cpp */; }; 15427D45198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15427D42198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.cpp */; }; 15427D46198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 15427D43198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.h */; }; 15427D47198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 15427D43198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.h */; }; 155CA35F1988E261006E0A08 /* usocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 1ABCA22D18CD8F7D0087CE3A /* usocket.c */; }; 155CA3601988E26D006E0A08 /* usocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABCA22E18CD8F7D0087CE3A /* usocket.h */; }; + 158C128719A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 158C128519A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp */; }; + 158C128819A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 158C128519A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp */; }; + 158C128919A0FA1300781A76 /* lua_cocos2dx_3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 158C128619A0FA1300781A76 /* lua_cocos2dx_3d_manual.h */; }; + 158C128A19A0FA1300781A76 /* lua_cocos2dx_3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 158C128619A0FA1300781A76 /* lua_cocos2dx_3d_manual.h */; }; 15AC69D519876E9300D17520 /* lua_cocos2dx_physics_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE75218BC45C200215002 /* lua_cocos2dx_physics_auto.cpp */; }; 15AC69D619876EA200D17520 /* lua_cocos2dx_physics_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE75318BC45C200215002 /* lua_cocos2dx_physics_auto.hpp */; }; 15AC69D91987710400D17520 /* tolua_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 1ABCA1F918CD8F6E0087CE3A /* tolua_event.c */; }; @@ -405,6 +413,10 @@ 1503FA9E18DA8A1C00F6518C /* buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buffer.h; sourceTree = ""; }; 1503FA9F18DA8A1C00F6518C /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = ""; }; 1503FAA018DA8A1C00F6518C /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = ""; }; + 1516227C19A0F32D006099B8 /* libluacocos3d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluacocos3d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1516227F19A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_3d_auto.cpp; sourceTree = ""; }; + 1516228019A0F3E3006099B8 /* lua_cocos2dx_3d_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_3d_auto.hpp; sourceTree = ""; }; + 151622BB19A0F45E006099B8 /* libluacocos3d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluacocos3d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1540AF55193EC30500717D8E /* xxtea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xxtea.cpp; sourceTree = ""; }; 1540AF56193EC30500717D8E /* xxtea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xxtea.h; sourceTree = ""; }; 15427D42198F73F700DC375D /* lua_cocos2dx_cocosdenshion_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_cocosdenshion_manual.cpp; sourceTree = ""; }; @@ -414,6 +426,8 @@ 15622968197780DE009C9067 /* lua_cocos2dx_experimental_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_auto.hpp; sourceTree = ""; }; 156EADF11977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_auto.cpp; sourceTree = ""; }; 156EADF21977A2BA00F53709 /* lua_cocos2dx_experimental_video_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_auto.hpp; sourceTree = ""; }; + 158C128519A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_3d_manual.cpp; sourceTree = ""; }; + 158C128619A0FA1300781A76 /* lua_cocos2dx_3d_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_cocos2dx_3d_manual.h; sourceTree = ""; }; 15C1BCC019864D8700A46ACC /* lua_cocos2dx_cocosbuilder_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_cocosbuilder_auto.cpp; sourceTree = ""; }; 15C1BCC119864D8700A46ACC /* lua_cocos2dx_cocosbuilder_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_cocosbuilder_auto.hpp; sourceTree = ""; }; 15C1BCC219864D8700A46ACC /* lua_cocos2dx_cocosdenshion_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_cocosdenshion_auto.cpp; sourceTree = ""; }; @@ -540,6 +554,20 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 1516225E19A0F32D006099B8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1516229C19A0F45E006099B8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 155CA3021988C494006E0A08 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -700,9 +728,20 @@ 15EFA4FE198B2B9B000C57D3 /* libluanetwork iOS.a */, 15EFA59B198B2D13000C57D3 /* libluacocosdenshion iOS.a */, 15EFA616198B2DAA000C57D3 /* libluacocos2d iOS.a */, + 1516227C19A0F32D006099B8 /* libluacocos3d Mac.a */, + 151622BB19A0F45E006099B8 /* libluacocos3d iOS.a */, ); sourceTree = ""; }; + 158C128419A0FA1300781A76 /* 3d */ = { + isa = PBXGroup; + children = ( + 158C128519A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp */, + 158C128619A0FA1300781A76 /* lua_cocos2dx_3d_manual.h */, + ); + path = 3d; + sourceTree = ""; + }; 15C1BCD21986525900A46ACC /* cocos2d */ = { isa = PBXGroup; children = ( @@ -791,6 +830,8 @@ 1AACE74818BC45C200215002 /* auto */ = { isa = PBXGroup; children = ( + 1516227F19A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp */, + 1516228019A0F3E3006099B8 /* lua_cocos2dx_3d_auto.hpp */, 15C1BCC019864D8700A46ACC /* lua_cocos2dx_cocosbuilder_auto.cpp */, 15C1BCC119864D8700A46ACC /* lua_cocos2dx_cocosbuilder_auto.hpp */, 15C1BCC219864D8700A46ACC /* lua_cocos2dx_cocosdenshion_auto.cpp */, @@ -819,6 +860,7 @@ 1AACE75B18BC45C200215002 /* manual */ = { isa = PBXGroup; children = ( + 158C128419A0FA1300781A76 /* 3d */, 15427D41198F73F700DC375D /* cocosdenshion */, 15EFA400198B2AB2000C57D3 /* cocostudio */, 15C1BCF11986526C00A46ACC /* cocosbuilder */, @@ -970,6 +1012,24 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 1516226019A0F32D006099B8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1516228219A0F3E3006099B8 /* lua_cocos2dx_3d_auto.hpp in Headers */, + 158C128919A0FA1300781A76 /* lua_cocos2dx_3d_manual.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1516229F19A0F45E006099B8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 151622BD19A0F4EC006099B8 /* lua_cocos2dx_3d_auto.hpp in Headers */, + 158C128A19A0FA1300781A76 /* lua_cocos2dx_3d_manual.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 155CA3051988C494006E0A08 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1203,6 +1263,40 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 1516224519A0F32D006099B8 /* libluacocos3d Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1516227919A0F32D006099B8 /* Build configuration list for PBXNativeTarget "libluacocos3d Mac" */; + buildPhases = ( + 1516224619A0F32D006099B8 /* Sources */, + 1516225E19A0F32D006099B8 /* Frameworks */, + 1516226019A0F32D006099B8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libluacocos3d Mac"; + productName = cocos2dx; + productReference = 1516227C19A0F32D006099B8 /* libluacocos3d Mac.a */; + productType = "com.apple.product-type.library.static"; + }; + 1516228319A0F45E006099B8 /* libluacocos3d iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 151622B819A0F45E006099B8 /* Build configuration list for PBXNativeTarget "libluacocos3d iOS" */; + buildPhases = ( + 1516228419A0F45E006099B8 /* Sources */, + 1516229C19A0F45E006099B8 /* Frameworks */, + 1516229F19A0F45E006099B8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libluacocos3d iOS"; + productName = cocos2dx; + productReference = 151622BB19A0F45E006099B8 /* libluacocos3d iOS.a */; + productType = "com.apple.product-type.library.static"; + }; 155CA2C71988C494006E0A08 /* libluaextension iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 155CA3401988C494006E0A08 /* Build configuration list for PBXNativeTarget "libluaextension iOS" */; @@ -1504,6 +1598,7 @@ 15C1BFF819865E5F00A46ACC /* libluaspine Mac */, 15C1C1061987340C00A46ACC /* libluanetwork Mac */, 15C1BEEE19865A0600A46ACC /* libluacocosdenshion Mac */, + 1516224519A0F32D006099B8 /* libluacocos3d Mac */, 15C1C255198748D200A46ACC /* libluacocos2d Mac */, 15D1F2C01994B2DA00302043 /* build all lualibs iOS */, 155CA2C71988C494006E0A08 /* libluaextension iOS */, @@ -1513,12 +1608,31 @@ 15EFA407198B2AFD000C57D3 /* libluaspine iOS */, 15EFA486198B2B9B000C57D3 /* libluanetwork iOS */, 15EFA523198B2D13000C57D3 /* libluacocosdenshion iOS */, + 1516228319A0F45E006099B8 /* libluacocos3d iOS */, 15EFA59E198B2DAA000C57D3 /* libluacocos2d iOS */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ + 1516224619A0F32D006099B8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 158C128719A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp in Sources */, + 1516228119A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1516228419A0F45E006099B8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 158C128819A0FA1300781A76 /* lua_cocos2dx_3d_manual.cpp in Sources */, + 151622BC19A0F4E3006099B8 /* lua_cocos2dx_3d_auto.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 155CA2C81988C494006E0A08 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1833,6 +1947,94 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 1516227A19A0F32D006099B8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + EXECUTABLE_PREFIX = ""; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_MAC, + CC_KEYBOARD_SUPPORT, + ); + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ""; + PRODUCT_NAME = "libluacocos3d Mac"; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/mac $(SRCROOT)/../../../../external/glfw3/include/mac"; + }; + name = Debug; + }; + 1516227B19A0F32D006099B8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + EXECUTABLE_PREFIX = ""; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_MAC, + CC_KEYBOARD_SUPPORT, + ); + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ""; + PRODUCT_NAME = "libluacocos3d Mac"; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/mac $(SRCROOT)/../../../../external/glfw3/include/mac"; + }; + name = Release; + }; + 151622B919A0F45E006099B8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + EXECUTABLE_PREFIX = ""; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_IPHONE, + ); + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + LIBRARY_SEARCH_PATHS = ""; + PRODUCT_NAME = "libluacocos3d iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/ios"; + }; + name = Debug; + }; + 151622BA19A0F45E006099B8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + EXECUTABLE_PREFIX = ""; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_IPHONE, + ); + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + LIBRARY_SEARCH_PATHS = ""; + PRODUCT_NAME = "libluacocos3d iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/ios"; + }; + name = Release; + }; 1551A34A158F2AB200E66CFE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2671,6 +2873,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 1516227919A0F32D006099B8 /* Build configuration list for PBXNativeTarget "libluacocos3d Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1516227A19A0F32D006099B8 /* Debug */, + 1516227B19A0F32D006099B8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 151622B819A0F45E006099B8 /* Build configuration list for PBXNativeTarget "libluacocos3d iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 151622B919A0F45E006099B8 /* Debug */, + 151622BA19A0F45E006099B8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 1551A339158F2AB200E66CFE /* Build configuration list for PBXProject "cocos2d_lua_bindings" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2768,6 +2988,7 @@ 15D1F2AE1994B2AD00302043 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 15D1F2C11994B2DA00302043 /* Build configuration list for PBXAggregateTarget "build all lualibs iOS" */ = { isa = XCConfigurationList; @@ -2776,6 +2997,7 @@ 15D1F2C31994B2DA00302043 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 15EFA2F6198B2791000C57D3 /* Build configuration list for PBXNativeTarget "libluacocosbuilder iOS" */ = { isa = XCConfigurationList; diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj b/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj new file mode 100644 index 0000000000..723b917192 --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + {e24950fa-5bc1-4aee-a900-4f0259354bf0} + + + + {06840490-14A4-43D6-88BC-AAFA44D043EB} + libluacocos3d + Win32Proj + + + + StaticLibrary + Unicode + v100 + v110 + v110_xp + v120 + v120_xp + + + StaticLibrary + Unicode + v100 + v110 + v110_xp + v120 + v120_xp + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\$(ProjectName)\ + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\$(ProjectName)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + + Disabled + $(EngineRoot)cocos\3d;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocos2d;$(EngineRoot)cocos\scripting\lua-bindings\manual\3d;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + + + + + Level3 + OldStyle + 4800;4267;4251;4244;%(DisableSpecificWarnings) + true + + + %(AdditionalLibraryDirectories) + + + + + + + + + + + + + MinSpace + true + $(EngineRoot)cocos\3d;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocos2d;$(EngineRoot)cocos\scripting\lua-bindings\manual\3d;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + + + + + Level3 + None + 4800;4267;4251;4244;%(DisableSpecificWarnings) + true + false + + + libcocos2d.lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.filters b/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.filters new file mode 100644 index 0000000000..b75ad2da73 --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {8d269c90-26ad-4ce8-b355-d8df01d59914} + + + {25c7b94b-a9a1-4b93-b285-93c9b620e2ad} + + + {af4b7d5f-f563-4069-ade8-c1a954e6fe5e} + + + + + auto + + + manual + + + + + auto + + + manual + + + \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.user b/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.user new file mode 100644 index 0000000000..a375ae3527 --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tests/lua-tests/project/CMakeLists.txt b/tests/lua-tests/project/CMakeLists.txt index 1eba4feabc..0130a24fd8 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -27,7 +27,9 @@ target_link_libraries(${APP_NAME} luaspine luaextension luaui + luacocos3d cocos2d + cocos3d audio cocostudio spine diff --git a/tests/lua-tests/project/Classes/lua_module_register.h b/tests/lua-tests/project/Classes/lua_module_register.h index a8e9e6d6be..36ce8dff3c 100644 --- a/tests/lua-tests/project/Classes/lua_module_register.h +++ b/tests/lua-tests/project/Classes/lua_module_register.h @@ -8,6 +8,7 @@ #include "spine/lua_cocos2dx_spine_manual.hpp" #include "network/lua_cocos2dx_network_manual.h" #include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" +#include "3d/lua_cocos2dx_3d_manual.h" @@ -20,6 +21,7 @@ int lua_module_register(lua_State* L) register_spine_module(L); register_network_module(L); register_cocosdenshion_module(L); + register_cocos3d_module(L); return 1; } diff --git a/tests/lua-tests/project/proj.android/jni/Android.mk b/tests/lua-tests/project/proj.android/jni/Android.mk index 1d31e9c980..44aff93129 100644 --- a/tests/lua-tests/project/proj.android/jni/Android.mk +++ b/tests/lua-tests/project/proj.android/jni/Android.mk @@ -21,6 +21,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += spine_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += extension_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += ui_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj index 678f8b4197..a502ffc812 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -194,6 +194,9 @@ xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(ProjectDir)..\..\res" /e /Y {9f2d6ce6-c893-4400-b50c-6db70cc2562f} + + {06840490-14a4-43d6-88bc-aafa44d043eb} + {f8198014-f4f3-49f0-88ab-c1969a5829af} From cb3f20ed47ee52292817d6bc2980386e58a55d8d Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 15:16:57 +0800 Subject: [PATCH 110/147] Remove lib search paths for libcocos3d --- build/cocos2d_libs.xcodeproj/project.pbxproj | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index cb3e53540c..497aa3862f 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -8104,14 +8104,7 @@ GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../external/png/prebuilt/ios\"", - "\"$(SRCROOT)/../external/jpeg/prebuilt/ios\"", - "\"$(SRCROOT)/../external/tiff/prebuilt/ios\"", - "\"$(SRCROOT)/../external/webp/prebuilt/ios\"", - "\"$(SRCROOT)/../external/freetype2/prebuilt/ios\"", - "\"$(SRCROOT)/../external/curl/prebuilt/ios\"", - ); + LIBRARY_SEARCH_PATHS = ""; PRODUCT_NAME = "libcocos3d iOS"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -8136,14 +8129,7 @@ GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../external/png/prebuilt/ios\"", - "\"$(SRCROOT)/../external/jpeg/prebuilt/ios\"", - "\"$(SRCROOT)/../external/tiff/prebuilt/ios\"", - "\"$(SRCROOT)/../external/webp/prebuilt/ios\"", - "\"$(SRCROOT)/../external/freetype2/prebuilt/ios\"", - "\"$(SRCROOT)/../external/curl/prebuilt/ios\"", - ); + LIBRARY_SEARCH_PATHS = ""; PRODUCT_NAME = "libcocos3d iOS"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; From 91fd40dd3a690483967a5883f3d1d7291e5a513b Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 15:27:54 +0800 Subject: [PATCH 111/147] Add a newline for some files --- cocos/3d/3dExport.h | 2 +- cocos/3d/CMakeLists.txt | 2 +- .../scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/3d/3dExport.h b/cocos/3d/3dExport.h index 30b90d478e..2639bab2eb 100644 --- a/cocos/3d/3dExport.h +++ b/cocos/3d/3dExport.h @@ -25,4 +25,4 @@ #define CC_3D_DLL #endif -#endif // __COCOS_3D_3DEXPORT_H__ \ No newline at end of file +#endif // __COCOS_3D_3DEXPORT_H__ diff --git a/cocos/3d/CMakeLists.txt b/cocos/3d/CMakeLists.txt index 5d353f8874..28e0ac6970 100644 --- a/cocos/3d/CMakeLists.txt +++ b/cocos/3d/CMakeLists.txt @@ -34,4 +34,4 @@ set_target_properties(cocos3d PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" -) \ No newline at end of file +) diff --git a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp index e23e93c7b2..2064945f6f 100644 --- a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp @@ -35,4 +35,4 @@ int register_cocos3d_module(lua_State* L) lua_pop(L, 1); return 1; -} \ No newline at end of file +} From 6abaf27b14a82e0048bfc0ea0e12e9bb6227f77a Mon Sep 17 00:00:00 2001 From: "kaile.yin" Date: Mon, 18 Aug 2014 16:19:54 +0800 Subject: [PATCH 112/147] fixed ArmatureAnimation::setSpeedScale --- cocos/editor-support/cocostudio/CCArmatureAnimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index febd77e6f2..cf578879ae 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -153,7 +153,7 @@ void ArmatureAnimation::setSpeedScale(float speedScale) bone->getTween()->setProcessScale(_processScale); if (bone->getChildArmature()) { - bone->getChildArmature()->getAnimation()->setProcessScale(_processScale); + bone->getChildArmature()->getAnimation()->setSpeedScale(_processScale); } } } @@ -228,7 +228,7 @@ void ArmatureAnimation::play(const std::string& animationName, int durationTo, if (bone->getChildArmature()) { - bone->getChildArmature()->getAnimation()->setProcessScale(_processScale); + bone->getChildArmature()->getAnimation()->setSpeedScale(_processScale); } } else From 22a48fb76073f37615034e1906b421d1149c82ae Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 19:23:03 +0800 Subject: [PATCH 113/147] Update cpp and lua template to support cocos3d lib --- templates/cpp-template-default/CMakeLists.txt | 3 + .../proj.android/jni/Android.mk | 2 + .../HelloCpp.xcodeproj/project.pbxproj | 60 +++++++++ .../proj.win32/HelloCpp.sln | 6 + .../proj.win32/HelloCpp.vcxproj | 3 + .../frameworks/CMakeLists.txt | 5 + .../runtime-src/proj.android/jni/Android.mk | 1 + .../HelloLua.xcodeproj/project.pbxproj | 120 ++++++++++++++++++ .../runtime-src/proj.win32/HelloLua.sln | 12 ++ .../runtime-src/proj.win32/HelloLua.vcxproj | 3 + .../runtime-src/proj.android/jni/Android.mk | 1 + .../HelloLua.xcodeproj/project.pbxproj | 94 ++++++++++++++ .../runtime-src/proj.win32/HelloLua.sln | 12 ++ 13 files changed, 322 insertions(+) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index afee5d541d..1f709e0d8f 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -189,6 +189,9 @@ add_subdirectory(${COCOS2D_ROOT}/external/xxhash) # cocos2d add_subdirectory(${COCOS2D_ROOT}/cocos) +# cocos3d library +add_subdirectory(${COCOS2D_ROOT}/cocos/3d) + # network library add_subdirectory(${COCOS2D_ROOT}/cocos/network) diff --git a/templates/cpp-template-default/proj.android/jni/Android.mk b/templates/cpp-template-default/proj.android/jni/Android.mk index 55e22ede0b..41be6783d9 100644 --- a/templates/cpp-template-default/proj.android/jni/Android.mk +++ b/templates/cpp-template-default/proj.android/jni/Android.mk @@ -18,6 +18,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../src LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static # LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static # LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static @@ -31,6 +32,7 @@ include $(BUILD_SHARED_LIBRARY) $(call import-module,.) $(call import-module,audio/android) +$(call import-module,3d) # $(call import-module,Box2D) # $(call import-module,editor-support/cocosbuilder) diff --git a/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj b/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj index 8f4d492fbf..8e2481f6fe 100644 --- a/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj +++ b/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 158C12AB19A1E4DF00781A76 /* libcocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 158C12AA19A1E4C800781A76 /* libcocos3d iOS.a */; }; + 158C12AE19A1E4FE00781A76 /* libcocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 158C12A819A1E4C800781A76 /* libcocos3d Mac.a */; }; 15A6DA93199CFB1100B56DBF /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA8F199CFB1100B56DBF /* AppDelegate.cpp */; }; 15A6DA94199CFB1100B56DBF /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA8F199CFB1100B56DBF /* AppDelegate.cpp */; }; 15A6DA95199CFB1100B56DBF /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A6DA91199CFB1100B56DBF /* HelloWorldScene.cpp */; }; @@ -72,6 +74,34 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 158C129719A1E4C800781A76 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15162030199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 158C12A719A1E4C800781A76 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516200B199E7363006099B8; + remoteInfo = "libcocos3d Mac"; + }; + 158C12A919A1E4C800781A76 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 15162201199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 158C12AC19A1E4EB00781A76 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15161E42199E7362006099B8; + remoteInfo = "libcocos3d Mac"; + }; 15A6DA7A199CFAFD00B56DBF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; @@ -344,6 +374,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 158C12AB19A1E4DF00781A76 /* libcocos3d iOS.a in Frameworks */, 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */, 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */, 1AC6FB30180E99EB004C840B /* libcocos2d iOS.a in Frameworks */, @@ -366,6 +397,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 158C12AE19A1E4FE00781A76 /* libcocos3d Mac.a in Frameworks */, 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */, 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */, 1AC6FB21180E996B004C840B /* libcocos2d Mac.a in Frameworks */, @@ -446,6 +478,7 @@ 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */, 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */, 1AC6FB01180E9839004C840B /* libcocosdenshion Mac.a */, + 158C12A819A1E4C800781A76 /* libcocos3d Mac.a */, 1AC6FB07180E9839004C840B /* libcocos2d iOS.a */, 1AC6FB09180E9839004C840B /* libextension iOS.a */, 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */, @@ -456,6 +489,7 @@ 15A6DA89199CFAFD00B56DBF /* libcocosbuilder iOS.a */, 15A6DA8B199CFAFD00B56DBF /* libspine iOS.a */, 15A6DA8D199CFAFD00B56DBF /* libnetwork iOS.a */, + 158C12AA19A1E4C800781A76 /* libcocos3d iOS.a */, ); name = Products; sourceTree = ""; @@ -555,6 +589,7 @@ buildRules = ( ); dependencies = ( + 158C129819A1E4C800781A76 /* PBXTargetDependency */, 1AC6FB25180E99E1004C840B /* PBXTargetDependency */, 1AC6FB27180E99E1004C840B /* PBXTargetDependency */, 1AC6FB29180E99E1004C840B /* PBXTargetDependency */, @@ -577,6 +612,7 @@ buildRules = ( ); dependencies = ( + 158C12AD19A1E4EB00781A76 /* PBXTargetDependency */, 1AC6FB1E180E9963004C840B /* PBXTargetDependency */, 1AC6FB16180E9959004C840B /* PBXTargetDependency */, 1AC6FB18180E9959004C840B /* PBXTargetDependency */, @@ -628,6 +664,20 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 158C12A819A1E4C800781A76 /* libcocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d Mac.a"; + remoteRef = 158C12A719A1E4C800781A76 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 158C12AA19A1E4C800781A76 /* libcocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d iOS.a"; + remoteRef = 158C12A919A1E4C800781A76 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 15A6DA7B199CFAFD00B56DBF /* libui Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -836,6 +886,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 158C129819A1E4C800781A76 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d iOS"; + targetProxy = 158C129719A1E4C800781A76 /* PBXContainerItemProxy */; + }; + 158C12AD19A1E4EB00781A76 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d Mac"; + targetProxy = 158C12AC19A1E4EB00781A76 /* PBXContainerItemProxy */; + }; 1AC6FB16180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx Mac"; diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.sln b/templates/cpp-template-default/proj.win32/HelloCpp.sln index 3bc2c2704e..7aafa75920 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.sln +++ b/templates/cpp-template-default/proj.win32/HelloCpp.sln @@ -11,6 +11,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\co EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\cocos2d\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -29,6 +31,10 @@ Global {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.ActiveCfg = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj index a2eb592205..d1e3d869a2 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj +++ b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj @@ -151,6 +151,9 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)"{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} false + + {e24950fa-5bc1-4aee-a900-4f0259354bf0} + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/templates/lua-template-default/frameworks/CMakeLists.txt b/templates/lua-template-default/frameworks/CMakeLists.txt index 63cfe86d50..90b1390537 100644 --- a/templates/lua-template-default/frameworks/CMakeLists.txt +++ b/templates/lua-template-default/frameworks/CMakeLists.txt @@ -109,6 +109,9 @@ add_subdirectory(${COCOS2D_ROOT}/external/xxhash) # cocos 2d library add_subdirectory(${COCOS2D_ROOT}/cocos) +# cocos 3d library +add_subdirectory(${COCOS2D_ROOT}/cocos/3d) + # network library add_subdirectory(${COCOS2D_ROOT}/cocos/network) @@ -158,6 +161,7 @@ endif() target_link_libraries(${APP_NAME} luacocos2d + luacocos3d luacocosdenshion luanetwork luacocosbuilder @@ -166,6 +170,7 @@ target_link_libraries(${APP_NAME} luaextension luaui cocos2d + cocos3d audio cocostudio spine diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk index 7810103733..8515d2a334 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Android.mk @@ -20,6 +20,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += spine_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += extension_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += ui_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 4a0ea01ce4..a40809f76f 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -19,6 +19,10 @@ 15427C7B198F1FC100DC375D /* libluacocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C47198F1DE400DC375D /* libluacocosdenshion Mac.a */; }; 15427C7C198F1FCB00DC375D /* libnetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C1F198F1DE400DC375D /* libnetwork Mac.a */; }; 15427C7D198F1FD800DC375D /* libluanetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C45198F1DE400DC375D /* libluanetwork Mac.a */; }; + 156B43D419A1F224002CBF18 /* libcocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 156B43C919A1F1EF002CBF18 /* libcocos3d iOS.a */; }; + 156B43D519A1F236002CBF18 /* libluacocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 156B43D119A1F1EF002CBF18 /* libluacocos3d iOS.a */; }; + 156B43DA19A1F256002CBF18 /* libcocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 156B43C719A1F1EF002CBF18 /* libcocos3d Mac.a */; }; + 156B43DB19A1F262002CBF18 /* libluacocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 156B43CF19A1F1EF002CBF18 /* libluacocos3d Mac.a */; }; 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; 15AA968E199C627C00725633 /* libluaextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C4B198F1DE400DC375D /* libluaextension iOS.a */; }; @@ -567,6 +571,62 @@ remoteGlobalIDString = A03F2E9817814268006731B9; remoteInfo = "libcocosdenshion Mac"; }; + 156B43BC19A1F1EF002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1516228319A0F45E006099B8; + remoteInfo = "libluacocos3d iOS"; + }; + 156B43C619A1F1EF002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516200B199E7363006099B8; + remoteInfo = "libcocos3d Mac"; + }; + 156B43C819A1F1EF002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 15162201199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 156B43CE19A1F1EF002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516227C19A0F32D006099B8; + remoteInfo = "libluacocos3d Mac"; + }; + 156B43D019A1F1EF002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 151622BB19A0F45E006099B8; + remoteInfo = "libluacocos3d iOS"; + }; + 156B43D219A1F1FD002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15162030199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 156B43D619A1F243002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1516224519A0F32D006099B8; + remoteInfo = "libluacocos3d Mac"; + }; + 156B43D819A1F249002CBF18 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15161E42199E7362006099B8; + remoteInfo = "libcocos3d Mac"; + }; 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; @@ -736,6 +796,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 156B43DB19A1F262002CBF18 /* libluacocos3d Mac.a in Frameworks */, + 156B43DA19A1F256002CBF18 /* libcocos3d Mac.a in Frameworks */, 15AA96B1199C655A00725633 /* libluaui Mac.a in Frameworks */, 15AA96B0199C655200725633 /* libui Mac.a in Frameworks */, 15AA96AF199C653300725633 /* libluaextension Mac.a in Frameworks */, @@ -770,6 +832,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 156B43D519A1F236002CBF18 /* libluacocos3d iOS.a in Frameworks */, + 156B43D419A1F224002CBF18 /* libcocos3d iOS.a in Frameworks */, 15AA96A7199C62FE00725633 /* libui iOS.a in Frameworks */, 15AA96A6199C62F500725633 /* libluaui iOS.a in Frameworks */, 15AA96A5199C62CF00725633 /* libspine iOS.a in Frameworks */, @@ -816,6 +880,7 @@ 15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */, 15A8A41D1834BDA200142BE0 /* libbox2d Mac.a */, 15A8A41F1834BDA200142BE0 /* libcocosdenshion Mac.a */, + 156B43C719A1F1EF002CBF18 /* libcocos3d Mac.a */, 15A8A4251834BDA200142BE0 /* libcocos2d iOS.a */, 15A8A4271834BDA200142BE0 /* libextension iOS.a */, 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */, @@ -826,6 +891,7 @@ 15427C25198F1DE400DC375D /* libcocosbuilder iOS.a */, 15427C27198F1DE400DC375D /* libspine iOS.a */, 15427C29198F1DE400DC375D /* libnetwork iOS.a */, + 156B43C919A1F1EF002CBF18 /* libcocos3d iOS.a */, ); name = Products; sourceTree = ""; @@ -931,6 +997,7 @@ 15427C43198F1DE400DC375D /* libluaspine Mac.a */, 15427C45198F1DE400DC375D /* libluanetwork Mac.a */, 15427C47198F1DE400DC375D /* libluacocosdenshion Mac.a */, + 156B43CF19A1F1EF002CBF18 /* libluacocos3d Mac.a */, 15427C49198F1DE400DC375D /* libluacocos2d Mac.a */, 15427C4B198F1DE400DC375D /* libluaextension iOS.a */, 15427C4D198F1DE400DC375D /* libluaui iOS.a */, @@ -939,6 +1006,7 @@ 15427C53198F1DE400DC375D /* libluaspine iOS.a */, 15427C55198F1DE400DC375D /* libluanetwork iOS.a */, 15427C57198F1DE400DC375D /* libluacocosdenshion iOS.a */, + 156B43D119A1F1EF002CBF18 /* libluacocos3d iOS.a */, 15427C59198F1DE400DC375D /* libluacocos2d iOS.a */, ); name = Products; @@ -1028,6 +1096,8 @@ buildRules = ( ); dependencies = ( + 156B43D919A1F249002CBF18 /* PBXTargetDependency */, + 156B43D719A1F243002CBF18 /* PBXTargetDependency */, 152A3407199C93F4004B68DC /* PBXTargetDependency */, 152A3409199C93F4004B68DC /* PBXTargetDependency */, 152A340B199C93F4004B68DC /* PBXTargetDependency */, @@ -1062,6 +1132,8 @@ buildRules = ( ); dependencies = ( + 156B43D319A1F1FD002CBF18 /* PBXTargetDependency */, + 156B43BD19A1F1EF002CBF18 /* PBXTargetDependency */, 152A33F3199C93CD004B68DC /* PBXTargetDependency */, 152A33F5199C93CD004B68DC /* PBXTargetDependency */, 152A33F7199C93CD004B68DC /* PBXTargetDependency */, @@ -1308,6 +1380,34 @@ remoteRef = 15427C58198F1DE400DC375D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 156B43C719A1F1EF002CBF18 /* libcocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d Mac.a"; + remoteRef = 156B43C619A1F1EF002CBF18 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 156B43C919A1F1EF002CBF18 /* libcocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d iOS.a"; + remoteRef = 156B43C819A1F1EF002CBF18 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 156B43CF19A1F1EF002CBF18 /* libluacocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libluacocos3d Mac.a"; + remoteRef = 156B43CE19A1F1EF002CBF18 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 156B43D119A1F1EF002CBF18 /* libluacocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libluacocos3d iOS.a"; + remoteRef = 156B43D019A1F1EF002CBF18 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 15A8A4171834BDA200142BE0 /* libcocos2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1701,6 +1801,26 @@ name = "libcocosdenshion Mac"; targetProxy = 15427C76198F1F4D00DC375D /* PBXContainerItemProxy */; }; + 156B43BD19A1F1EF002CBF18 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos3d iOS"; + targetProxy = 156B43BC19A1F1EF002CBF18 /* PBXContainerItemProxy */; + }; + 156B43D319A1F1FD002CBF18 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d iOS"; + targetProxy = 156B43D219A1F1FD002CBF18 /* PBXContainerItemProxy */; + }; + 156B43D719A1F243002CBF18 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos3d Mac"; + targetProxy = 156B43D619A1F243002CBF18 /* PBXContainerItemProxy */; + }; + 156B43D919A1F249002CBF18 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d Mac"; + targetProxy = 156B43D819A1F249002CBF18 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln index 465e8e4547..c88e087e51 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -44,6 +44,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaui", "..\..\cocos2d-x EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\..\cocos2d-x\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos3d", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocos3d.vcxproj", "{06840490-14A4-43D6-88BC-AAFA44D043EB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -126,6 +130,14 @@ Global {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.ActiveCfg = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.ActiveCfg = Debug|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.Build.0 = Debug|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.ActiveCfg = Release|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 40b906b691..11a3924224 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -190,6 +190,9 @@ xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script\ui" "$(P {9f2d6ce6-c893-4400-b50c-6db70cc2562f} + + {06840490-14a4-43d6-88bc-aafa44d043eb} + {f8198014-f4f3-49f0-88ab-c1969a5829af} diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk index f007cdfe62..15ac1b1602 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk @@ -48,6 +48,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += spine_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += extension_lua_static LOCAL_WHOLE_STATIC_LIBRARIES += ui_lua_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index a74f2a5642..e18faea777 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -65,6 +65,10 @@ 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4171834BDA200142BE0 /* libcocos2d Mac.a */; }; 15427CEF198F24BD00DC375D /* libcocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A41F1834BDA200142BE0 /* libcocosdenshion Mac.a */; }; 15427CF0198F24C400DC375D /* libnetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427C98198F220600DC375D /* libnetwork Mac.a */; }; + 1571D9C219A1F733005A1DC2 /* libcocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1571D9B919A1F714005A1DC2 /* libcocos3d iOS.a */; }; + 1571D9C319A1F733005A1DC2 /* libluacocos3d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1571D9C119A1F714005A1DC2 /* libluacocos3d iOS.a */; }; + 1571D9C419A1F74B005A1DC2 /* libcocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1571D9B719A1F714005A1DC2 /* libcocos3d Mac.a */; }; + 1571D9C519A1F74B005A1DC2 /* libluacocos3d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1571D9BF19A1F714005A1DC2 /* libluacocos3d Mac.a */; }; 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; 15AA7D36199B513100725633 /* libluanetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15427CCE198F220600DC375D /* libluanetwork iOS.a */; }; @@ -609,6 +613,48 @@ remoteGlobalIDString = B2DB498D197686CB00411E16; remoteInfo = "libnetwork Mac"; }; + 1571D9AA19A1F714005A1DC2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1516228319A0F45E006099B8; + remoteInfo = "libluacocos3d iOS"; + }; + 1571D9AC19A1F714005A1DC2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 15162030199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 1571D9B619A1F714005A1DC2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516200B199E7363006099B8; + remoteInfo = "libcocos3d Mac"; + }; + 1571D9B819A1F714005A1DC2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 15162201199E7810006099B8; + remoteInfo = "libcocos3d iOS"; + }; + 1571D9BE19A1F714005A1DC2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1516227C19A0F32D006099B8; + remoteInfo = "libluacocos3d Mac"; + }; + 1571D9C019A1F714005A1DC2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 151622BB19A0F45E006099B8; + remoteInfo = "libluacocos3d iOS"; + }; 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; @@ -875,6 +921,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1571D9C419A1F74B005A1DC2 /* libcocos3d Mac.a in Frameworks */, + 1571D9C519A1F74B005A1DC2 /* libluacocos3d Mac.a in Frameworks */, 152A3486199CE6B4004B68DC /* libcocosbuilder Mac.a in Frameworks */, 152A3487199CE6B4004B68DC /* libcocostudio Mac.a in Frameworks */, 152A3488199CE6B4004B68DC /* libextension Mac.a in Frameworks */, @@ -909,6 +957,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1571D9C219A1F733005A1DC2 /* libcocos3d iOS.a in Frameworks */, + 1571D9C319A1F733005A1DC2 /* libluacocos3d iOS.a in Frameworks */, 152A3484199CE64A004B68DC /* libspine iOS.a in Frameworks */, 152A3485199CE64A004B68DC /* libui iOS.a in Frameworks */, 152A3483199CE63A004B68DC /* libextension iOS.a in Frameworks */, @@ -955,6 +1005,7 @@ 15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */, 15A8A41D1834BDA200142BE0 /* libbox2d Mac.a */, 15A8A41F1834BDA200142BE0 /* libcocosdenshion Mac.a */, + 1571D9B719A1F714005A1DC2 /* libcocos3d Mac.a */, 15A8A4251834BDA200142BE0 /* libcocos2d iOS.a */, 15A8A4271834BDA200142BE0 /* libextension iOS.a */, 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */, @@ -965,6 +1016,7 @@ 15427C9E198F220600DC375D /* libcocosbuilder iOS.a */, 15427CA0198F220600DC375D /* libspine iOS.a */, 15427CA2198F220600DC375D /* libnetwork iOS.a */, + 1571D9B919A1F714005A1DC2 /* libcocos3d iOS.a */, ); name = Products; sourceTree = ""; @@ -1181,6 +1233,7 @@ 15427CBC198F220600DC375D /* libluaspine Mac.a */, 15427CBE198F220600DC375D /* libluanetwork Mac.a */, 15427CC0198F220600DC375D /* libluacocosdenshion Mac.a */, + 1571D9BF19A1F714005A1DC2 /* libluacocos3d Mac.a */, 15427CC2198F220600DC375D /* libluacocos2d Mac.a */, 15427CC4198F220600DC375D /* libluaextension iOS.a */, 15427CC6198F220600DC375D /* libluaui iOS.a */, @@ -1189,6 +1242,7 @@ 15427CCC198F220600DC375D /* libluaspine iOS.a */, 15427CCE198F220600DC375D /* libluanetwork iOS.a */, 15427CD0198F220600DC375D /* libluacocosdenshion iOS.a */, + 1571D9C119A1F714005A1DC2 /* libluacocos3d iOS.a */, 15427CD2198F220600DC375D /* libluacocos2d iOS.a */, ); name = Products; @@ -1320,6 +1374,8 @@ buildRules = ( ); dependencies = ( + 1571D9AB19A1F714005A1DC2 /* PBXTargetDependency */, + 1571D9AD19A1F714005A1DC2 /* PBXTargetDependency */, 152A349B199CE72E004B68DC /* PBXTargetDependency */, 152A349D199CE72E004B68DC /* PBXTargetDependency */, 152A349F199CE72E004B68DC /* PBXTargetDependency */, @@ -1566,6 +1622,34 @@ remoteRef = 15427CD1198F220600DC375D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 1571D9B719A1F714005A1DC2 /* libcocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d Mac.a"; + remoteRef = 1571D9B619A1F714005A1DC2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1571D9B919A1F714005A1DC2 /* libcocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos3d iOS.a"; + remoteRef = 1571D9B819A1F714005A1DC2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1571D9BF19A1F714005A1DC2 /* libluacocos3d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libluacocos3d Mac.a"; + remoteRef = 1571D9BE19A1F714005A1DC2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1571D9C119A1F714005A1DC2 /* libluacocos3d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libluacocos3d iOS.a"; + remoteRef = 1571D9C019A1F714005A1DC2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 15A8A4171834BDA200142BE0 /* libcocos2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -2009,6 +2093,16 @@ name = "libnetwork Mac"; targetProxy = 15427CE6198F23E600DC375D /* PBXContainerItemProxy */; }; + 1571D9AB19A1F714005A1DC2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libluacocos3d iOS"; + targetProxy = 1571D9AA19A1F714005A1DC2 /* PBXContainerItemProxy */; + }; + 1571D9AD19A1F714005A1DC2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libcocos3d iOS"; + targetProxy = 1571D9AC19A1F714005A1DC2 /* PBXContainerItemProxy */; + }; 15D1F3091994BBCA00302043 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libcocos2d iOS"; diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln index c3c7e7e29e..9951b3aa26 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -44,6 +44,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\..\cocos2 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaui", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluaui.vcxproj", "{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\..\cocos2d-x\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos3d", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocos3d.vcxproj", "{06840490-14A4-43D6-88BC-AAFA44D043EB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -126,6 +130,14 @@ Global {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.Build.0 = Debug|Win32 {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.ActiveCfg = Release|Win32 {FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.Build.0 = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.ActiveCfg = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.ActiveCfg = Debug|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.Build.0 = Debug|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.ActiveCfg = Release|Win32 + {06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From f36e7c66171b8f2a7bd36c41550526452bf7c3f8 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 18 Aug 2014 19:46:11 +0800 Subject: [PATCH 114/147] Add register_cocos3d_module for lua template --- .../frameworks/runtime-src/Classes/lua_module_register.h | 2 ++ .../frameworks/runtime-src/Classes/lua_module_register.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h index 0de6e7001c..7e0ca6169e 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h @@ -8,6 +8,7 @@ #include "extension/lua_cocos2dx_extension_manual.h" #include "ui/lua_cocos2dx_ui_manual.hpp" #include "spine/lua_cocos2dx_spine_manual.hpp" +#include "3d/lua_cocos2dx_3d_manual.h" int lua_module_register(lua_State* L) @@ -19,6 +20,7 @@ int lua_module_register(lua_State* L) register_extension_module(L); register_ui_moudle(L); register_spine_module(L); + register_cocos3d_module(L); return 1; } diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h index 43a2c175b2..a69dba2671 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/lua_module_register.h @@ -8,6 +8,7 @@ #include "extension/lua_cocos2dx_extension_manual.h" #include "ui/lua_cocos2dx_ui_manual.hpp" #include "spine/lua_cocos2dx_spine_manual.hpp" +#include "3d/lua_cocos2dx_3d_manual.h" int lua_module_register(lua_State* L) @@ -19,6 +20,7 @@ int lua_module_register(lua_State* L) register_extension_module(L); register_ui_moudle(L); register_spine_module(L); + register_cocos3d_module(L); return 1; } From 94b45d55ef1273b651e868412986d8a4597dd9af Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 18 Aug 2014 14:43:41 +0000 Subject: [PATCH 115/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 1652b0fb8f..79b110b636 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -192,6 +192,8 @@ "cocos/2d/cocos2dx.props", "cocos/2d/libcocos2d.vcxproj", "cocos/2d/libcocos2d.vcxproj.filters", + "cocos/3d/3dExport.h", + "cocos/3d/Android.mk", "cocos/3d/CCAABB.cpp", "cocos/3d/CCAABB.h", "cocos/3d/CCAnimate3D.cpp", @@ -228,6 +230,10 @@ "cocos/3d/CCSubMeshState.cpp", "cocos/3d/CCSubMeshState.h", "cocos/3d/CMakeLists.txt", + "cocos/3d/cocos3d.h", + "cocos/3d/proj.win32/libcocos3d.vcxproj", + "cocos/3d/proj.win32/libcocos3d.vcxproj.filters", + "cocos/3d/proj.win32/libcocos3d.vcxproj.user", "cocos/Android.mk", "cocos/CMakeLists.txt", "cocos/audio/CMakeLists.txt", @@ -4010,6 +4016,8 @@ "cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp", + "cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp", + "cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.h", "cocos/scripting/lua-bindings/manual/CCLuaBridge.cpp", "cocos/scripting/lua-bindings/manual/CCLuaBridge.h", "cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp", @@ -4076,6 +4084,9 @@ "cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj", "cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj", "cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters", + "cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj", + "cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.filters", + "cocos/scripting/lua-bindings/proj.win32/libluacocos3d.vcxproj.user", "cocos/scripting/lua-bindings/proj.win32/libluacocosbuilder.vcxproj", "cocos/scripting/lua-bindings/proj.win32/libluacocosbuilder.vcxproj.filters", "cocos/scripting/lua-bindings/proj.win32/libluacocosdenshion.vcxproj", @@ -4506,6 +4517,7 @@ "tools/bindings-generator/tools/win32/cygwin1.dll", "tools/tolua/README.mdown", "tools/tolua/cocos2dx.ini", + "tools/tolua/cocos2dx_3d.ini", "tools/tolua/cocos2dx_cocosbuilder.ini", "tools/tolua/cocos2dx_cocosdenshion.ini", "tools/tolua/cocos2dx_controller.ini", From 85d505b4277837276346741fb7a07b9793c8ae37 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 18 Aug 2014 14:47:35 +0000 Subject: [PATCH 116/147] [AUTO]: updating luabinding automatically --- .../auto/api/lua_cocos2dx_3d_auto_api.lua | 39 + .../auto/api/lua_cocos2dx_auto_api.lua | 35 - .../auto/lua_cocos2dx_3d_auto.cpp | 1911 +++++++++++++++++ .../auto/lua_cocos2dx_3d_auto.hpp | 60 + .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 1895 ---------------- .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 45 - 6 files changed, 2010 insertions(+), 1975 deletions(-) create mode 100644 cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua create mode 100644 cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp create mode 100644 cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.hpp diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua new file mode 100644 index 0000000000..0fe586cd21 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua @@ -0,0 +1,39 @@ +-------------------------------- +-- @module cc + +-------------------------------------------------------- +-- the cc Sprite3D +-- @field [parent=#cc] Sprite3D#Sprite3D Sprite3D preloaded module + + +-------------------------------------------------------- +-- the cc Mesh +-- @field [parent=#cc] Mesh#Mesh Mesh preloaded module + + +-------------------------------------------------------- +-- the cc Skeleton3D +-- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module + + +-------------------------------------------------------- +-- the cc Animation3D +-- @field [parent=#cc] Animation3D#Animation3D Animation3D preloaded module + + +-------------------------------------------------------- +-- the cc Animate3D +-- @field [parent=#cc] Animate3D#Animate3D Animate3D preloaded module + + +-------------------------------------------------------- +-- the cc SubMeshState +-- @field [parent=#cc] SubMeshState#SubMeshState SubMeshState preloaded module + + +-------------------------------------------------------- +-- the cc AttachNode +-- @field [parent=#cc] AttachNode#AttachNode AttachNode preloaded module + + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index 1a9c6ff721..f16e53e365 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -1206,41 +1206,6 @@ -- @field [parent=#cc] Component#Component Component preloaded module --------------------------------------------------------- --- the cc Sprite3D --- @field [parent=#cc] Sprite3D#Sprite3D Sprite3D preloaded module - - --------------------------------------------------------- --- the cc Mesh --- @field [parent=#cc] Mesh#Mesh Mesh preloaded module - - --------------------------------------------------------- --- the cc Skeleton3D --- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module - - --------------------------------------------------------- --- the cc Animation3D --- @field [parent=#cc] Animation3D#Animation3D Animation3D preloaded module - - --------------------------------------------------------- --- the cc Animate3D --- @field [parent=#cc] Animate3D#Animate3D Animate3D preloaded module - - --------------------------------------------------------- --- the cc SubMeshState --- @field [parent=#cc] SubMeshState#SubMeshState SubMeshState preloaded module - - --------------------------------------------------------- --- the cc AttachNode --- @field [parent=#cc] AttachNode#AttachNode AttachNode preloaded module - - -------------------------------------------------------- -- the cc ProtectedNode -- @field [parent=#cc] ProtectedNode#ProtectedNode ProtectedNode preloaded module diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp new file mode 100644 index 0000000000..8869f34c70 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp @@ -0,0 +1,1911 @@ +#include "lua_cocos2dx_3d_auto.hpp" +#include "cocos3d.h" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" + + + +int lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFaceEnabled"); + if(!ok) + return 0; + cobj->setCullFaceEnabled(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFaceEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + + if (!ok) { break; } + cobj->setTexture(arg0); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:setTexture"); + + if (!ok) { break; } + cobj->setTexture(arg0); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_removeAllAttachNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_removeAllAttachNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->removeAllAttachNode(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAllAttachNode",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_removeAllAttachNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + #pragma warning NO CONVERSION TO NATIVE FOR BlendFunc; + if(!ok) + return 0; + cobj->setBlendFunc(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getMesh(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMesh'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Mesh* ret = cobj->getMesh(); + object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMesh",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMesh'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_setCullFace(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace"); + if(!ok) + return 0; + cobj->setCullFace(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_removeAttachNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_removeAttachNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:removeAttachNode"); + if(!ok) + return 0; + cobj->removeAttachNode(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAttachNode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_removeAttachNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getAttachNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getAttachNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:getAttachNode"); + if(!ok) + return 0; + cocos2d::AttachNode* ret = cobj->getAttachNode(arg0); + object_to_luaval(tolua_S, "cc.AttachNode",(cocos2d::AttachNode*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getAttachNode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getAttachNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 2) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Sprite3D:create"); + if (!ok) { break; } + cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); + if (!ok) { break; } + cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0); + object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); + return 1; + } + } while (0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite3D:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_3d_Sprite3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Sprite3D)"); + return 0; +} + +int lua_register_cocos2dx_3d_Sprite3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Sprite3D"); + tolua_cclass(tolua_S,"Sprite3D","cc.Sprite3D","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"Sprite3D"); + tolua_function(tolua_S,"setCullFaceEnabled",lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_3d_Sprite3D_setTexture); + tolua_function(tolua_S,"removeAllAttachNode",lua_cocos2dx_3d_Sprite3D_removeAllAttachNode); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_3d_Sprite3D_setBlendFunc); + tolua_function(tolua_S,"getMesh",lua_cocos2dx_3d_Sprite3D_getMesh); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_3d_Sprite3D_getBlendFunc); + tolua_function(tolua_S,"setCullFace",lua_cocos2dx_3d_Sprite3D_setCullFace); + tolua_function(tolua_S,"removeAttachNode",lua_cocos2dx_3d_Sprite3D_removeAttachNode); + tolua_function(tolua_S,"getAttachNode",lua_cocos2dx_3d_Sprite3D_getAttachNode); + tolua_function(tolua_S,"create", lua_cocos2dx_3d_Sprite3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Sprite3D).name(); + g_luaType[typeName] = "cc.Sprite3D"; + g_typeCast["Sprite3D"] = "cc.Sprite3D"; + return 1; +} + +int lua_cocos2dx_3d_Mesh_restore(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_restore'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->restore(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:restore",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_restore'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_getMeshVertexAttribCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getMeshVertexAttribCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getMeshVertexAttribCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getMeshVertexAttribCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getMeshVertexAttribCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_getSubMesh(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getSubMesh'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Mesh:getSubMesh"); + if(!ok) + return 0; + cocos2d::SubMesh* ret = cobj->getSubMesh(arg0); + object_to_luaval(tolua_S, "cc.SubMesh",(cocos2d::SubMesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getSubMesh",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getSubMesh'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_getVertexSizeInBytes(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getVertexSizeInBytes'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getVertexSizeInBytes(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getVertexSizeInBytes",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getVertexSizeInBytes'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_getVertexBuffer(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getVertexBuffer'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + unsigned int ret = cobj->getVertexBuffer(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getVertexBuffer",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getVertexBuffer'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_getSubMeshCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getSubMeshCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getSubMeshCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getSubMeshCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getSubMeshCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_hasVertexAttrib(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_hasVertexAttrib'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Mesh:hasVertexAttrib"); + if(!ok) + return 0; + bool ret = cobj->hasVertexAttrib(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:hasVertexAttrib",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_hasVertexAttrib'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Mesh_getMeshVertexAttribute(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getMeshVertexAttribute'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Mesh:getMeshVertexAttribute"); + if(!ok) + return 0; + const cocos2d::MeshVertexAttrib& ret = cobj->getMeshVertexAttribute(arg0); + mesh_vertex_attrib_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getMeshVertexAttribute",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getMeshVertexAttribute'.",&tolua_err); +#endif + + return 0; +} +static int lua_cocos2dx_3d_Mesh_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Mesh)"); + return 0; +} + +int lua_register_cocos2dx_3d_Mesh(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Mesh"); + tolua_cclass(tolua_S,"Mesh","cc.Mesh","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Mesh"); + tolua_function(tolua_S,"restore",lua_cocos2dx_3d_Mesh_restore); + tolua_function(tolua_S,"getMeshVertexAttribCount",lua_cocos2dx_3d_Mesh_getMeshVertexAttribCount); + tolua_function(tolua_S,"getSubMesh",lua_cocos2dx_3d_Mesh_getSubMesh); + tolua_function(tolua_S,"getVertexSizeInBytes",lua_cocos2dx_3d_Mesh_getVertexSizeInBytes); + tolua_function(tolua_S,"getVertexBuffer",lua_cocos2dx_3d_Mesh_getVertexBuffer); + tolua_function(tolua_S,"getSubMeshCount",lua_cocos2dx_3d_Mesh_getSubMeshCount); + tolua_function(tolua_S,"hasVertexAttrib",lua_cocos2dx_3d_Mesh_hasVertexAttrib); + tolua_function(tolua_S,"getMeshVertexAttribute",lua_cocos2dx_3d_Mesh_getMeshVertexAttribute); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Mesh).name(); + g_luaType[typeName] = "cc.Mesh"; + g_typeCast["Mesh"] = "cc.Mesh"; + return 1; +} + +int lua_cocos2dx_3d_Skeleton3D_getBoneByName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByName"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getBoneByName(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getRootBone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getRootBone'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getRootBone(); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootBone",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getRootBone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->updateBoneMatrix(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:updateBoneMatrix",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getBoneByIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByIndex"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getBoneByIndex(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_setRootBone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_setRootBone'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Bone3D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + if(!ok) + return 0; + cobj->setRootBone(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:setRootBone",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_setRootBone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getBoneIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Bone3D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + if(!ok) + return 0; + int ret = cobj->getBoneIndex(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getBoneCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getBoneCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 2) + { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Skeleton3D:create"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Skeleton3D:create"); + if(!ok) + return 0; + cocos2d::Skeleton3D* ret = cocos2d::Skeleton3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Skeleton3D:create",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_3d_Skeleton3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Skeleton3D)"); + return 0; +} + +int lua_register_cocos2dx_3d_Skeleton3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Skeleton3D"); + tolua_cclass(tolua_S,"Skeleton3D","cc.Skeleton3D","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Skeleton3D"); + tolua_function(tolua_S,"getBoneByName",lua_cocos2dx_3d_Skeleton3D_getBoneByName); + tolua_function(tolua_S,"getRootBone",lua_cocos2dx_3d_Skeleton3D_getRootBone); + tolua_function(tolua_S,"updateBoneMatrix",lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix); + tolua_function(tolua_S,"getBoneByIndex",lua_cocos2dx_3d_Skeleton3D_getBoneByIndex); + tolua_function(tolua_S,"setRootBone",lua_cocos2dx_3d_Skeleton3D_setRootBone); + tolua_function(tolua_S,"getBoneIndex",lua_cocos2dx_3d_Skeleton3D_getBoneIndex); + tolua_function(tolua_S,"getBoneCount",lua_cocos2dx_3d_Skeleton3D_getBoneCount); + tolua_function(tolua_S,"create", lua_cocos2dx_3d_Skeleton3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Skeleton3D).name(); + g_luaType[typeName] = "cc.Skeleton3D"; + g_typeCast["Skeleton3D"] = "cc.Skeleton3D"; + return 1; +} + +int lua_cocos2dx_3d_Animation3D_getDuration(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animation3D* 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.Animation3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animation3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Animation3D_getDuration'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getDuration(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animation3D:getDuration",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animation3D_getDuration'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Animation3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Animation3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Animation3D:create"); + if(!ok) + return 0; + cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0); + object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); + return 1; + } + if (argc == 2) + { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Animation3D:create"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Animation3D:create"); + if(!ok) + return 0; + cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Animation3D:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animation3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_3d_Animation3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Animation3D)"); + return 0; +} + +int lua_register_cocos2dx_3d_Animation3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Animation3D"); + tolua_cclass(tolua_S,"Animation3D","cc.Animation3D","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Animation3D"); + tolua_function(tolua_S,"getDuration",lua_cocos2dx_3d_Animation3D_getDuration); + tolua_function(tolua_S,"create", lua_cocos2dx_3d_Animation3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Animation3D).name(); + g_luaType[typeName] = "cc.Animation3D"; + g_typeCast["Animation3D"] = "cc.Animation3D"; + return 1; +} + +int lua_cocos2dx_3d_Animate3D_setSpeed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Animate3D_setSpeed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Animate3D:setSpeed"); + if(!ok) + return 0; + cobj->setSpeed(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:setSpeed",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animate3D_setSpeed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Animate3D_setWeight(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Animate3D_setWeight'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Animate3D:setWeight"); + if(!ok) + return 0; + cobj->setWeight(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:setWeight",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animate3D_setWeight'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Animate3D_getSpeed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Animate3D_getSpeed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getSpeed(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:getSpeed",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animate3D_getSpeed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Animate3D_getWeight(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Animate3D_getWeight'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getWeight(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:getWeight",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animate3D_getWeight'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Animate3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 3) + { + cocos2d::Animation3D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Animate3D:create"); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.Animate3D:create"); + if (!ok) { break; } + cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0, arg1, arg2); + object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Animation3D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + if (!ok) { break; } + cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0); + object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); + return 1; + } + } while (0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Animate3D:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animate3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_3d_Animate3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Animate3D)"); + return 0; +} + +int lua_register_cocos2dx_3d_Animate3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Animate3D"); + tolua_cclass(tolua_S,"Animate3D","cc.Animate3D","cc.ActionInterval",nullptr); + + tolua_beginmodule(tolua_S,"Animate3D"); + tolua_function(tolua_S,"setSpeed",lua_cocos2dx_3d_Animate3D_setSpeed); + tolua_function(tolua_S,"setWeight",lua_cocos2dx_3d_Animate3D_setWeight); + tolua_function(tolua_S,"getSpeed",lua_cocos2dx_3d_Animate3D_getSpeed); + tolua_function(tolua_S,"getWeight",lua_cocos2dx_3d_Animate3D_getWeight); + tolua_function(tolua_S,"create", lua_cocos2dx_3d_Animate3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Animate3D).name(); + g_luaType[typeName] = "cc.Animate3D"; + g_typeCast["Animate3D"] = "cc.Animate3D"; + return 1; +} + +int lua_cocos2dx_3d_SubMeshState_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_SubMeshState_setTexture'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Texture2D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + if(!ok) + return 0; + cobj->setTexture(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_SubMeshState_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_SubMeshState_getTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_SubMeshState_getTexture'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Texture2D* ret = cobj->getTexture(); + object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:getTexture",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_SubMeshState_getTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_SubMeshState_isVisible(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_SubMeshState_isVisible'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isVisible(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:isVisible",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_SubMeshState_isVisible'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_SubMeshState_setVisible(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_SubMeshState_setVisible'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.SubMeshState:setVisible"); + if(!ok) + return 0; + cobj->setVisible(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:setVisible",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_SubMeshState_setVisible'.",&tolua_err); +#endif + + return 0; +} +static int lua_cocos2dx_3d_SubMeshState_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (SubMeshState)"); + return 0; +} + +int lua_register_cocos2dx_3d_SubMeshState(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.SubMeshState"); + tolua_cclass(tolua_S,"SubMeshState","cc.SubMeshState","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"SubMeshState"); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_3d_SubMeshState_setTexture); + tolua_function(tolua_S,"getTexture",lua_cocos2dx_3d_SubMeshState_getTexture); + tolua_function(tolua_S,"isVisible",lua_cocos2dx_3d_SubMeshState_isVisible); + tolua_function(tolua_S,"setVisible",lua_cocos2dx_3d_SubMeshState_setVisible); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::SubMeshState).name(); + g_luaType[typeName] = "cc.SubMeshState"; + g_typeCast["SubMeshState"] = "cc.SubMeshState"; + return 1; +} + +int lua_cocos2dx_3d_AttachNode_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.AttachNode",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Bone3D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + if(!ok) + return 0; + cocos2d::AttachNode* ret = cocos2d::AttachNode::create(arg0); + object_to_luaval(tolua_S, "cc.AttachNode",(cocos2d::AttachNode*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.AttachNode:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_AttachNode_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_3d_AttachNode_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (AttachNode)"); + return 0; +} + +int lua_register_cocos2dx_3d_AttachNode(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.AttachNode"); + tolua_cclass(tolua_S,"AttachNode","cc.AttachNode","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"AttachNode"); + tolua_function(tolua_S,"create", lua_cocos2dx_3d_AttachNode_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::AttachNode).name(); + g_luaType[typeName] = "cc.AttachNode"; + g_typeCast["AttachNode"] = "cc.AttachNode"; + return 1; +} +TOLUA_API int register_all_cocos2dx_3d(lua_State* tolua_S) +{ + tolua_open(tolua_S); + + tolua_module(tolua_S,"cc",0); + tolua_beginmodule(tolua_S,"cc"); + + lua_register_cocos2dx_3d_Animate3D(tolua_S); + lua_register_cocos2dx_3d_Sprite3D(tolua_S); + lua_register_cocos2dx_3d_AttachNode(tolua_S); + lua_register_cocos2dx_3d_SubMeshState(tolua_S); + lua_register_cocos2dx_3d_Animation3D(tolua_S); + lua_register_cocos2dx_3d_Skeleton3D(tolua_S); + lua_register_cocos2dx_3d_Mesh(tolua_S); + + tolua_endmodule(tolua_S); + return 1; +} + diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.hpp new file mode 100644 index 0000000000..3742d98d03 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.hpp @@ -0,0 +1,60 @@ +#include "base/ccConfig.h" +#ifndef __cocos2dx_3d_h__ +#define __cocos2dx_3d_h__ + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +int register_all_cocos2dx_3d(lua_State* tolua_S); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#endif // __cocos2dx_3d_h__ diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 44115b5555..8617dfb7b3 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -1,8 +1,6 @@ #include "lua_cocos2dx_auto.hpp" #include "cocos2d.h" #include "CCProtectedNode.h" -#include "CCAnimation3D.h" -#include "CCAnimate3D.h" #include "tolua_fix.h" #include "LuaBasicConversions.h" @@ -63918,1892 +63916,6 @@ int lua_register_cocos2dx_Component(lua_State* tolua_S) return 1; } -int lua_cocos2dx_Sprite3D_setCullFaceEnabled(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setCullFaceEnabled'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFaceEnabled"); - if(!ok) - return 0; - cobj->setCullFaceEnabled(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFaceEnabled",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setCullFaceEnabled'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); - - if (!ok) { break; } - cobj->setTexture(arg0); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_removeAllAttachNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_removeAllAttachNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->removeAllAttachNode(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAllAttachNode",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_removeAllAttachNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_setBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::BlendFunc arg0; - - #pragma warning NO CONVERSION TO NATIVE FOR BlendFunc; - if(!ok) - return 0; - cobj->setBlendFunc(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setBlendFunc",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_getMesh(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_getMesh'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Mesh* ret = cobj->getMesh(); - object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMesh",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_getMesh'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_getBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_getBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); - blendfunc_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getBlendFunc",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_getBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_setCullFace(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setCullFace'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - unsigned int arg0; - - ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace"); - if(!ok) - return 0; - cobj->setCullFace(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setCullFace'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_removeAttachNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_removeAttachNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:removeAttachNode"); - if(!ok) - return 0; - cobj->removeAttachNode(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAttachNode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_removeAttachNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_getAttachNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_getAttachNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:getAttachNode"); - if(!ok) - return 0; - cocos2d::AttachNode* ret = cobj->getAttachNode(arg0); - object_to_luaval(tolua_S, "cc.AttachNode",(cocos2d::AttachNode*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getAttachNode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_getAttachNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite3D_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Sprite3D:create"); - if (!ok) { break; } - cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); - if (!ok) { break; } - cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0); - object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite3D:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_Sprite3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Sprite3D)"); - return 0; -} - -int lua_register_cocos2dx_Sprite3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Sprite3D"); - tolua_cclass(tolua_S,"Sprite3D","cc.Sprite3D","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"Sprite3D"); - tolua_function(tolua_S,"setCullFaceEnabled",lua_cocos2dx_Sprite3D_setCullFaceEnabled); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite3D_setTexture); - tolua_function(tolua_S,"removeAllAttachNode",lua_cocos2dx_Sprite3D_removeAllAttachNode); - tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite3D_setBlendFunc); - tolua_function(tolua_S,"getMesh",lua_cocos2dx_Sprite3D_getMesh); - tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite3D_getBlendFunc); - tolua_function(tolua_S,"setCullFace",lua_cocos2dx_Sprite3D_setCullFace); - tolua_function(tolua_S,"removeAttachNode",lua_cocos2dx_Sprite3D_removeAttachNode); - tolua_function(tolua_S,"getAttachNode",lua_cocos2dx_Sprite3D_getAttachNode); - tolua_function(tolua_S,"create", lua_cocos2dx_Sprite3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Sprite3D).name(); - g_luaType[typeName] = "cc.Sprite3D"; - g_typeCast["Sprite3D"] = "cc.Sprite3D"; - return 1; -} - -int lua_cocos2dx_Mesh_restore(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_restore'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->restore(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:restore",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_restore'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_getMeshVertexAttribCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getMeshVertexAttribCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getMeshVertexAttribCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getMeshVertexAttribCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getMeshVertexAttribCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_getSubMesh(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getSubMesh'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Mesh:getSubMesh"); - if(!ok) - return 0; - cocos2d::SubMesh* ret = cobj->getSubMesh(arg0); - object_to_luaval(tolua_S, "cc.SubMesh",(cocos2d::SubMesh*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getSubMesh",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getSubMesh'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_getVertexSizeInBytes(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getVertexSizeInBytes'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = cobj->getVertexSizeInBytes(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getVertexSizeInBytes",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getVertexSizeInBytes'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_getVertexBuffer(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getVertexBuffer'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - unsigned int ret = cobj->getVertexBuffer(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getVertexBuffer",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getVertexBuffer'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_getSubMeshCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getSubMeshCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getSubMeshCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getSubMeshCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getSubMeshCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_hasVertexAttrib(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_hasVertexAttrib'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Mesh:hasVertexAttrib"); - if(!ok) - return 0; - bool ret = cobj->hasVertexAttrib(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:hasVertexAttrib",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_hasVertexAttrib'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Mesh_getMeshVertexAttribute(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Mesh* 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.Mesh",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getMeshVertexAttribute'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Mesh:getMeshVertexAttribute"); - if(!ok) - return 0; - const cocos2d::MeshVertexAttrib& ret = cobj->getMeshVertexAttribute(arg0); - mesh_vertex_attrib_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getMeshVertexAttribute",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getMeshVertexAttribute'.",&tolua_err); -#endif - - return 0; -} -static int lua_cocos2dx_Mesh_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Mesh)"); - return 0; -} - -int lua_register_cocos2dx_Mesh(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Mesh"); - tolua_cclass(tolua_S,"Mesh","cc.Mesh","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"Mesh"); - tolua_function(tolua_S,"restore",lua_cocos2dx_Mesh_restore); - tolua_function(tolua_S,"getMeshVertexAttribCount",lua_cocos2dx_Mesh_getMeshVertexAttribCount); - tolua_function(tolua_S,"getSubMesh",lua_cocos2dx_Mesh_getSubMesh); - tolua_function(tolua_S,"getVertexSizeInBytes",lua_cocos2dx_Mesh_getVertexSizeInBytes); - tolua_function(tolua_S,"getVertexBuffer",lua_cocos2dx_Mesh_getVertexBuffer); - tolua_function(tolua_S,"getSubMeshCount",lua_cocos2dx_Mesh_getSubMeshCount); - tolua_function(tolua_S,"hasVertexAttrib",lua_cocos2dx_Mesh_hasVertexAttrib); - tolua_function(tolua_S,"getMeshVertexAttribute",lua_cocos2dx_Mesh_getMeshVertexAttribute); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Mesh).name(); - g_luaType[typeName] = "cc.Mesh"; - g_typeCast["Mesh"] = "cc.Mesh"; - return 1; -} - -int lua_cocos2dx_Skeleton3D_getBoneByName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneByName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByName"); - if(!ok) - return 0; - cocos2d::Bone3D* ret = cobj->getBoneByName(arg0); - object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneByName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_getRootBone(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getRootBone'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Bone3D* ret = cobj->getRootBone(); - object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootBone",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getRootBone'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_updateBoneMatrix(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_updateBoneMatrix'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->updateBoneMatrix(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:updateBoneMatrix",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_updateBoneMatrix'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_getBoneByIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneByIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - unsigned int arg0; - - ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByIndex"); - if(!ok) - return 0; - cocos2d::Bone3D* ret = cobj->getBoneByIndex(arg0); - object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneByIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_setRootBone(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_setRootBone'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Bone3D* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); - if(!ok) - return 0; - cobj->setRootBone(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:setRootBone",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_setRootBone'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_getBoneIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Bone3D* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); - if(!ok) - return 0; - int ret = cobj->getBoneIndex(arg0); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_getBoneCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Skeleton3D_getBoneCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getBoneCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_getBoneCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Skeleton3D_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 2) - { - std::string arg0; - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Skeleton3D:create"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Skeleton3D:create"); - if(!ok) - return 0; - cocos2d::Skeleton3D* ret = cocos2d::Skeleton3D::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Skeleton3D:create",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Skeleton3D_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_Skeleton3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Skeleton3D)"); - return 0; -} - -int lua_register_cocos2dx_Skeleton3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Skeleton3D"); - tolua_cclass(tolua_S,"Skeleton3D","cc.Skeleton3D","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"Skeleton3D"); - tolua_function(tolua_S,"getBoneByName",lua_cocos2dx_Skeleton3D_getBoneByName); - tolua_function(tolua_S,"getRootBone",lua_cocos2dx_Skeleton3D_getRootBone); - tolua_function(tolua_S,"updateBoneMatrix",lua_cocos2dx_Skeleton3D_updateBoneMatrix); - tolua_function(tolua_S,"getBoneByIndex",lua_cocos2dx_Skeleton3D_getBoneByIndex); - tolua_function(tolua_S,"setRootBone",lua_cocos2dx_Skeleton3D_setRootBone); - tolua_function(tolua_S,"getBoneIndex",lua_cocos2dx_Skeleton3D_getBoneIndex); - tolua_function(tolua_S,"getBoneCount",lua_cocos2dx_Skeleton3D_getBoneCount); - tolua_function(tolua_S,"create", lua_cocos2dx_Skeleton3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Skeleton3D).name(); - g_luaType[typeName] = "cc.Skeleton3D"; - g_typeCast["Skeleton3D"] = "cc.Skeleton3D"; - return 1; -} - -int lua_cocos2dx_Animation3D_getDuration(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animation3D* 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.Animation3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animation3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animation3D_getDuration'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getDuration(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animation3D:getDuration",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_getDuration'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animation3D_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Animation3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Animation3D:create"); - if(!ok) - return 0; - cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0); - object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); - return 1; - } - if (argc == 2) - { - std::string arg0; - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Animation3D:create"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Animation3D:create"); - if(!ok) - return 0; - cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Animation3D:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_Animation3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Animation3D)"); - return 0; -} - -int lua_register_cocos2dx_Animation3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Animation3D"); - tolua_cclass(tolua_S,"Animation3D","cc.Animation3D","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"Animation3D"); - tolua_function(tolua_S,"getDuration",lua_cocos2dx_Animation3D_getDuration); - tolua_function(tolua_S,"create", lua_cocos2dx_Animation3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Animation3D).name(); - g_luaType[typeName] = "cc.Animation3D"; - g_typeCast["Animation3D"] = "cc.Animation3D"; - return 1; -} - -int lua_cocos2dx_Animate3D_setSpeed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setSpeed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Animate3D:setSpeed"); - if(!ok) - return 0; - cobj->setSpeed(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:setSpeed",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setSpeed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_setWeight(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setWeight'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Animate3D:setWeight"); - if(!ok) - return 0; - cobj->setWeight(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:setWeight",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setWeight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_getSpeed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getSpeed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getSpeed(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:getSpeed",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getSpeed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_getWeight(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* 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.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getWeight'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getWeight(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:getWeight",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getWeight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 3) - { - cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Animate3D:create"); - if (!ok) { break; } - double arg2; - ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.Animate3D:create"); - if (!ok) { break; } - cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); - if (!ok) { break; } - cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0); - object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Animate3D:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_Animate3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Animate3D)"); - return 0; -} - -int lua_register_cocos2dx_Animate3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Animate3D"); - tolua_cclass(tolua_S,"Animate3D","cc.Animate3D","cc.ActionInterval",nullptr); - - tolua_beginmodule(tolua_S,"Animate3D"); - tolua_function(tolua_S,"setSpeed",lua_cocos2dx_Animate3D_setSpeed); - tolua_function(tolua_S,"setWeight",lua_cocos2dx_Animate3D_setWeight); - tolua_function(tolua_S,"getSpeed",lua_cocos2dx_Animate3D_getSpeed); - tolua_function(tolua_S,"getWeight",lua_cocos2dx_Animate3D_getWeight); - tolua_function(tolua_S,"create", lua_cocos2dx_Animate3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Animate3D).name(); - g_luaType[typeName] = "cc.Animate3D"; - g_typeCast["Animate3D"] = "cc.Animate3D"; - return 1; -} - -int lua_cocos2dx_SubMeshState_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SubMeshState_setTexture'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Texture2D* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); - if(!ok) - return 0; - cobj->setTexture(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SubMeshState_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SubMeshState_getTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SubMeshState_getTexture'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Texture2D* ret = cobj->getTexture(); - object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:getTexture",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SubMeshState_getTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SubMeshState_isVisible(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SubMeshState_isVisible'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - bool ret = cobj->isVisible(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:isVisible",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SubMeshState_isVisible'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SubMeshState_setVisible(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SubMeshState* 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.SubMeshState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SubMeshState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SubMeshState_setVisible'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.SubMeshState:setVisible"); - if(!ok) - return 0; - cobj->setVisible(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.SubMeshState:setVisible",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SubMeshState_setVisible'.",&tolua_err); -#endif - - return 0; -} -static int lua_cocos2dx_SubMeshState_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (SubMeshState)"); - return 0; -} - -int lua_register_cocos2dx_SubMeshState(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.SubMeshState"); - tolua_cclass(tolua_S,"SubMeshState","cc.SubMeshState","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"SubMeshState"); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_SubMeshState_setTexture); - tolua_function(tolua_S,"getTexture",lua_cocos2dx_SubMeshState_getTexture); - tolua_function(tolua_S,"isVisible",lua_cocos2dx_SubMeshState_isVisible); - tolua_function(tolua_S,"setVisible",lua_cocos2dx_SubMeshState_setVisible); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::SubMeshState).name(); - g_luaType[typeName] = "cc.SubMeshState"; - g_typeCast["SubMeshState"] = "cc.SubMeshState"; - return 1; -} - -int lua_cocos2dx_AttachNode_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.AttachNode",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::Bone3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); - if(!ok) - return 0; - cocos2d::AttachNode* ret = cocos2d::AttachNode::create(arg0); - object_to_luaval(tolua_S, "cc.AttachNode",(cocos2d::AttachNode*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.AttachNode:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AttachNode_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_AttachNode_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (AttachNode)"); - return 0; -} - -int lua_register_cocos2dx_AttachNode(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.AttachNode"); - tolua_cclass(tolua_S,"AttachNode","cc.AttachNode","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"AttachNode"); - tolua_function(tolua_S,"create", lua_cocos2dx_AttachNode_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::AttachNode).name(); - g_luaType[typeName] = "cc.AttachNode"; - g_typeCast["AttachNode"] = "cc.AttachNode"; - return 1; -} - int lua_cocos2dx_ProtectedNode_addProtectedChild(lua_State* tolua_S) { int argc = 0; @@ -66425,7 +64537,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_Application(tolua_S); lua_register_cocos2dx_Camera(tolua_S); lua_register_cocos2dx_LabelAtlas(tolua_S); - lua_register_cocos2dx_AttachNode(tolua_S); lua_register_cocos2dx_ParticleSnow(tolua_S); lua_register_cocos2dx_EaseElasticIn(tolua_S); lua_register_cocos2dx_EaseCircleActionInOut(tolua_S); @@ -66468,7 +64579,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_NodeGrid(tolua_S); lua_register_cocos2dx_TMXLayerInfo(tolua_S); lua_register_cocos2dx_EaseSineIn(tolua_S); - lua_register_cocos2dx_Sprite3D(tolua_S); lua_register_cocos2dx_EaseBounceIn(tolua_S); lua_register_cocos2dx_TiledGrid3D(tolua_S); lua_register_cocos2dx_ParticleGalaxy(tolua_S); @@ -66491,7 +64601,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_TransitionFadeBL(tolua_S); lua_register_cocos2dx_TargetedAction(tolua_S); lua_register_cocos2dx_DrawNode(tolua_S); - lua_register_cocos2dx_Mesh(tolua_S); lua_register_cocos2dx_TransitionTurnOffTiles(tolua_S); lua_register_cocos2dx_RotateTo(tolua_S); lua_register_cocos2dx_TransitionSplitRows(tolua_S); @@ -66508,7 +64617,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EventFocus(tolua_S); lua_register_cocos2dx_EaseQuinticActionInOut(tolua_S); lua_register_cocos2dx_SpriteFrameCache(tolua_S); - lua_register_cocos2dx_Skeleton3D(tolua_S); lua_register_cocos2dx_TransitionCrossFade(tolua_S); lua_register_cocos2dx_Ripple3D(tolua_S); lua_register_cocos2dx_Lens3D(tolua_S); @@ -66517,9 +64625,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_Spawn(tolua_S); lua_register_cocos2dx_EaseQuarticActionInOut(tolua_S); lua_register_cocos2dx_GLProgramState(tolua_S); - lua_register_cocos2dx_Animation3D(tolua_S); lua_register_cocos2dx_PageTurn3D(tolua_S); - lua_register_cocos2dx_SubMeshState(tolua_S); lua_register_cocos2dx_TransitionSlideInL(tolua_S); lua_register_cocos2dx_TransitionSlideInT(tolua_S); lua_register_cocos2dx_Grid3D(tolua_S); @@ -66557,7 +64663,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_ParticleRain(tolua_S); lua_register_cocos2dx_Waves(tolua_S); lua_register_cocos2dx_EaseOut(tolua_S); - lua_register_cocos2dx_Animate3D(tolua_S); lua_register_cocos2dx_MenuItemFont(tolua_S); lua_register_cocos2dx_TransitionFadeUp(tolua_S); lua_register_cocos2dx_EaseSineOut(tolua_S); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index a951802a00..b75ae767aa 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1537,51 +1537,6 @@ int register_all_cocos2dx(lua_State* tolua_S); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 218cee5e05901ad6e415051f36ec8dd9cd6e1106 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 18 Aug 2014 14:55:40 +0000 Subject: [PATCH 117/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 79b110b636..f0764a2285 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -3983,6 +3983,7 @@ "cocos/scripting/lua-bindings/auto/api/WavesTiles3D.lua", "cocos/scripting/lua-bindings/auto/api/Widget.lua", "cocos/scripting/lua-bindings/auto/api/ZOrderFrame.lua", + "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_cocosbuilder_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_cocosdenshion_auto_api.lua", @@ -3994,6 +3995,8 @@ "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_spine_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_studio_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_ui_auto_api.lua", + "cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp", + "cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.hpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_cocosbuilder_auto.cpp", From 36113c65ac1a7d034218cc9fc7c673ef29aa4d89 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 18 Aug 2014 22:56:47 +0800 Subject: [PATCH 118/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index c7a4200e53..bc7dbd38df 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,7 @@ cocos2d-x-3.3 ?? [NEW] ui::PageView: added `customScrollThreshold`, could determine the swipe distance to trigger a PageView scroll event [NEW] ui::TextField: support utf8 [NEW] ui::TextField: support set color and placehold color + [NEW] ui::Widget: support swallowing touch events [NEW] Text: added getter and setter for TextColor [FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X From 4236e892455484435ccf1c6d4cf1b12aebaf3c91 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 18 Aug 2014 15:26:32 +0000 Subject: [PATCH 119/147] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/CheckBox.lua | 20 +- .../lua-bindings/auto/api/Widget.lua | 22 +- .../auto/lua_cocos2dx_ui_auto.cpp | 380 +++++++++++++----- .../auto/lua_cocos2dx_ui_auto.hpp | 4 + 4 files changed, 317 insertions(+), 109 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/CheckBox.lua b/cocos/scripting/lua-bindings/auto/api/CheckBox.lua index fe0f55b6f8..cdbab92888 100644 --- a/cocos/scripting/lua-bindings/auto/api/CheckBox.lua +++ b/cocos/scripting/lua-bindings/auto/api/CheckBox.lua @@ -4,11 +4,6 @@ -- @extend Widget -- @parent_module ccui --------------------------------- --- @function [parent=#CheckBox] getSelectedState --- @param self --- @return bool#bool ret (return value: bool) - -------------------------------- -- @function [parent=#CheckBox] loadTextureBackGroundSelected -- @param self @@ -21,6 +16,11 @@ -- @param #string str -- @param #int texturerestype +-------------------------------- +-- @function [parent=#CheckBox] setSelected +-- @param self +-- @param #bool bool + -------------------------------- -- @function [parent=#CheckBox] addEventListener -- @param self @@ -32,6 +32,11 @@ -- @param #string str -- @param #int texturerestype +-------------------------------- +-- @function [parent=#CheckBox] isSelected +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- @function [parent=#CheckBox] loadTextures -- @param self @@ -48,11 +53,6 @@ -- @param #string str -- @param #int texturerestype --------------------------------- --- @function [parent=#CheckBox] setSelectedState --- @param self --- @param #bool bool - -------------------------------- -- @function [parent=#CheckBox] loadTextureFrontCrossDisabled -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/Widget.lua b/cocos/scripting/lua-bindings/auto/api/Widget.lua index 4cb3995919..8f3f43b6b8 100644 --- a/cocos/scripting/lua-bindings/auto/api/Widget.lua +++ b/cocos/scripting/lua-bindings/auto/api/Widget.lua @@ -29,6 +29,11 @@ -- @param self -- @return Node#Node ret (return value: cc.Node) +-------------------------------- +-- @function [parent=#Widget] setPropagateTouchEvents +-- @param self +-- @param #bool bool + -------------------------------- -- @function [parent=#Widget] getSizePercent -- @param self @@ -39,6 +44,11 @@ -- @param self -- @param #vec2_table vec2 +-------------------------------- +-- @function [parent=#Widget] setSwallowTouches +-- @param self +-- @param #bool bool + -------------------------------- -- @function [parent=#Widget] getLayoutSize -- @param self @@ -126,6 +136,11 @@ -- @param self -- @return vec2_table#vec2_table ret (return value: vec2_table) +-------------------------------- +-- @function [parent=#Widget] isFocusEnabled +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- @function [parent=#Widget] setFocused -- @param self @@ -186,6 +201,11 @@ -- @param self -- @return bool#bool ret (return value: bool) +-------------------------------- +-- @function [parent=#Widget] isPropagateTouchEvents +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- @function [parent=#Widget] getCurrentFocusedWidget -- @param self @@ -260,7 +280,7 @@ -- @param #bool bool -------------------------------- --- @function [parent=#Widget] isFocusEnabled +-- @function [parent=#Widget] isSwallowTouches -- @param self -- @return bool#bool ret (return value: bool) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 6774030a18..d94dd2ccf2 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -1039,6 +1039,52 @@ int lua_cocos2dx_ui_Widget_getVirtualRenderer(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Widget_setPropagateTouchEvents(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Widget* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_setPropagateTouchEvents'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccui.Widget:setPropagateTouchEvents"); + if(!ok) + return 0; + cobj->setPropagateTouchEvents(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:setPropagateTouchEvents",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_setPropagateTouchEvents'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Widget_getSizePercent(lua_State* tolua_S) { int argc = 0; @@ -1129,6 +1175,52 @@ int lua_cocos2dx_ui_Widget_setPositionPercent(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Widget_setSwallowTouches(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Widget* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_setSwallowTouches'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccui.Widget:setSwallowTouches"); + if(!ok) + return 0; + cobj->setSwallowTouches(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:setSwallowTouches",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_setSwallowTouches'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Widget_getLayoutSize(lua_State* tolua_S) { int argc = 0; @@ -1889,6 +1981,50 @@ int lua_cocos2dx_ui_Widget_getWorldPosition(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Widget_isFocusEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Widget* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_isFocusEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isFocusEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:isFocusEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_isFocusEnabled'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Widget_setFocused(lua_State* tolua_S) { int argc = 0; @@ -2431,6 +2567,50 @@ int lua_cocos2dx_ui_Widget_isBright(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Widget_isPropagateTouchEvents(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Widget* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_isPropagateTouchEvents'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isPropagateTouchEvents(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:isPropagateTouchEvents",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_isPropagateTouchEvents'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Widget_getCurrentFocusedWidget(lua_State* tolua_S) { int argc = 0; @@ -3067,7 +3247,7 @@ int lua_cocos2dx_ui_Widget_setBright(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_Widget_isFocusEnabled(lua_State* tolua_S) +int lua_cocos2dx_ui_Widget_isSwallowTouches(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Widget* cobj = nullptr; @@ -3087,7 +3267,7 @@ int lua_cocos2dx_ui_Widget_isFocusEnabled(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_isFocusEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_isSwallowTouches'", nullptr); return 0; } #endif @@ -3097,16 +3277,16 @@ int lua_cocos2dx_ui_Widget_isFocusEnabled(lua_State* tolua_S) { if(!ok) return 0; - bool ret = cobj->isFocusEnabled(); + bool ret = cobj->isSwallowTouches(); tolua_pushboolean(tolua_S,(bool)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:isFocusEnabled",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:isSwallowTouches",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_isFocusEnabled'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_isSwallowTouches'.",&tolua_err); #endif return 0; @@ -3226,8 +3406,10 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S) tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_ui_Widget_setFlippedY); tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_ui_Widget_setFlippedX); tolua_function(tolua_S,"getVirtualRenderer",lua_cocos2dx_ui_Widget_getVirtualRenderer); + tolua_function(tolua_S,"setPropagateTouchEvents",lua_cocos2dx_ui_Widget_setPropagateTouchEvents); tolua_function(tolua_S,"getSizePercent",lua_cocos2dx_ui_Widget_getSizePercent); tolua_function(tolua_S,"setPositionPercent",lua_cocos2dx_ui_Widget_setPositionPercent); + tolua_function(tolua_S,"setSwallowTouches",lua_cocos2dx_ui_Widget_setSwallowTouches); tolua_function(tolua_S,"getLayoutSize",lua_cocos2dx_ui_Widget_getLayoutSize); tolua_function(tolua_S,"setHighlighted",lua_cocos2dx_ui_Widget_setHighlighted); tolua_function(tolua_S,"setPositionType",lua_cocos2dx_ui_Widget_setPositionType); @@ -3245,6 +3427,7 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S) tolua_function(tolua_S,"isTouchEnabled",lua_cocos2dx_ui_Widget_isTouchEnabled); tolua_function(tolua_S,"getActionTag",lua_cocos2dx_ui_Widget_getActionTag); tolua_function(tolua_S,"getWorldPosition",lua_cocos2dx_ui_Widget_getWorldPosition); + tolua_function(tolua_S,"isFocusEnabled",lua_cocos2dx_ui_Widget_isFocusEnabled); tolua_function(tolua_S,"setFocused",lua_cocos2dx_ui_Widget_setFocused); tolua_function(tolua_S,"setActionTag",lua_cocos2dx_ui_Widget_setActionTag); tolua_function(tolua_S,"setTouchEnabled",lua_cocos2dx_ui_Widget_setTouchEnabled); @@ -3257,6 +3440,7 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S) tolua_function(tolua_S,"setFocusEnabled",lua_cocos2dx_ui_Widget_setFocusEnabled); tolua_function(tolua_S,"getBottomBoundary",lua_cocos2dx_ui_Widget_getBottomBoundary); tolua_function(tolua_S,"isBright",lua_cocos2dx_ui_Widget_isBright); + tolua_function(tolua_S,"isPropagateTouchEvents",lua_cocos2dx_ui_Widget_isPropagateTouchEvents); tolua_function(tolua_S,"getCurrentFocusedWidget",lua_cocos2dx_ui_Widget_getCurrentFocusedWidget); tolua_function(tolua_S,"requestFocus",lua_cocos2dx_ui_Widget_requestFocus); tolua_function(tolua_S,"updateSizeAndPosition",lua_cocos2dx_ui_Widget_updateSizeAndPosition); @@ -3271,7 +3455,7 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S) tolua_function(tolua_S,"isClippingParentContainsPoint",lua_cocos2dx_ui_Widget_isClippingParentContainsPoint); tolua_function(tolua_S,"setSizeType",lua_cocos2dx_ui_Widget_setSizeType); tolua_function(tolua_S,"setBright",lua_cocos2dx_ui_Widget_setBright); - tolua_function(tolua_S,"isFocusEnabled",lua_cocos2dx_ui_Widget_isFocusEnabled); + tolua_function(tolua_S,"isSwallowTouches",lua_cocos2dx_ui_Widget_isSwallowTouches); tolua_function(tolua_S,"enableDpadNavigation", lua_cocos2dx_ui_Widget_enableDpadNavigation); tolua_function(tolua_S,"create", lua_cocos2dx_ui_Widget_create); tolua_endmodule(tolua_S); @@ -6309,50 +6493,6 @@ int lua_register_cocos2dx_ui_Button(lua_State* tolua_S) return 1; } -int lua_cocos2dx_ui_CheckBox_getSelectedState(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ui::CheckBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccui.CheckBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ui::CheckBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_CheckBox_getSelectedState'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - bool ret = cobj->getSelectedState(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.CheckBox:getSelectedState",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_CheckBox_getSelectedState'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_ui_CheckBox_loadTextureBackGroundSelected(lua_State* tolua_S) { int argc = 0; @@ -6471,6 +6611,52 @@ int lua_cocos2dx_ui_CheckBox_loadTextureBackGroundDisabled(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_CheckBox_setSelected(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::CheckBox* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.CheckBox",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::CheckBox*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_CheckBox_setSelected'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccui.CheckBox:setSelected"); + if(!ok) + return 0; + cobj->setSelected(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.CheckBox:setSelected",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_CheckBox_setSelected'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_CheckBox_addEventListener(lua_State* tolua_S) { int argc = 0; @@ -6580,6 +6766,50 @@ int lua_cocos2dx_ui_CheckBox_loadTextureFrontCross(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_CheckBox_isSelected(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::CheckBox* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.CheckBox",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::CheckBox*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_CheckBox_isSelected'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isSelected(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.CheckBox:isSelected",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_CheckBox_isSelected'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_CheckBox_loadTextures(lua_State* tolua_S) { int argc = 0; @@ -6722,52 +6952,6 @@ int lua_cocos2dx_ui_CheckBox_loadTextureBackGround(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_CheckBox_setSelectedState(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ui::CheckBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccui.CheckBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ui::CheckBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_CheckBox_setSelectedState'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccui.CheckBox:setSelectedState"); - if(!ok) - return 0; - cobj->setSelectedState(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccui.CheckBox:setSelectedState",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_CheckBox_setSelectedState'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_ui_CheckBox_loadTextureFrontCrossDisabled(lua_State* tolua_S) { int argc = 0; @@ -6990,14 +7174,14 @@ int lua_register_cocos2dx_ui_CheckBox(lua_State* tolua_S) tolua_beginmodule(tolua_S,"CheckBox"); tolua_function(tolua_S,"new",lua_cocos2dx_ui_CheckBox_constructor); - tolua_function(tolua_S,"getSelectedState",lua_cocos2dx_ui_CheckBox_getSelectedState); tolua_function(tolua_S,"loadTextureBackGroundSelected",lua_cocos2dx_ui_CheckBox_loadTextureBackGroundSelected); tolua_function(tolua_S,"loadTextureBackGroundDisabled",lua_cocos2dx_ui_CheckBox_loadTextureBackGroundDisabled); + tolua_function(tolua_S,"setSelected",lua_cocos2dx_ui_CheckBox_setSelected); tolua_function(tolua_S,"addEventListener",lua_cocos2dx_ui_CheckBox_addEventListener); tolua_function(tolua_S,"loadTextureFrontCross",lua_cocos2dx_ui_CheckBox_loadTextureFrontCross); + tolua_function(tolua_S,"isSelected",lua_cocos2dx_ui_CheckBox_isSelected); tolua_function(tolua_S,"loadTextures",lua_cocos2dx_ui_CheckBox_loadTextures); tolua_function(tolua_S,"loadTextureBackGround",lua_cocos2dx_ui_CheckBox_loadTextureBackGround); - tolua_function(tolua_S,"setSelectedState",lua_cocos2dx_ui_CheckBox_setSelectedState); tolua_function(tolua_S,"loadTextureFrontCrossDisabled",lua_cocos2dx_ui_CheckBox_loadTextureFrontCrossDisabled); tolua_function(tolua_S,"create", lua_cocos2dx_ui_CheckBox_create); tolua_function(tolua_S,"createInstance", lua_cocos2dx_ui_CheckBox_createInstance); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index fa92d1bdaa..10bfa1f16b 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -406,6 +406,10 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + + + + From db805ee2c8b4a5f3629e00820b8bdda1592e3307 Mon Sep 17 00:00:00 2001 From: teivaz Date: Tue, 19 Aug 2014 19:24:56 +0300 Subject: [PATCH 120/147] * Fixed WP8 cocos library project * Fixed profiling macros --- cocos/2d/cocos2d_wp8.vcxproj | 2 ++ cocos/2d/cocos2d_wp8.vcxproj.filters | 6 ++++++ cocos/base/CCPlatformMacros.h | 2 ++ cocos/base/ccMacros.h | 22 +++++++++++----------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index 950d79440a..ba6dbc0623 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -277,6 +277,7 @@ NotUsing + @@ -488,6 +489,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index 9db875128a..2a8cead521 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -647,6 +647,9 @@ renderer + + base + @@ -1322,6 +1325,9 @@ renderer + + base + diff --git a/cocos/base/CCPlatformMacros.h b/cocos/base/CCPlatformMacros.h index 4d7c837ff2..2e91a5fda2 100644 --- a/cocos/base/CCPlatformMacros.h +++ b/cocos/base/CCPlatformMacros.h @@ -104,10 +104,12 @@ It's new in cocos2d-x since v0.99.5 #define NS_CC_BEGIN namespace cocos2d { #define NS_CC_END } #define USING_NS_CC using namespace cocos2d + #define NS_CC ::cocos2d #else #define NS_CC_BEGIN #define NS_CC_END #define USING_NS_CC + #define NS_CC #endif /** CC_PROPERTY_READONLY is used to declare a protected variable. diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index 165dbab7cf..1fe096e45b 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -203,20 +203,20 @@ It should work same as apples CFSwapInt32LittleToHost(..) /**********************/ #if CC_ENABLE_PROFILERS -#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers() -#define CC_PROFILER_PURGE_ALL() Profiler::getInstance()->releaseAllTimers() +#define CC_PROFILER_DISPLAY_TIMERS() NS_CC::Profiler::getInstance()->displayTimers() +#define CC_PROFILER_PURGE_ALL() NS_CC::Profiler::getInstance()->releaseAllTimers() -#define CC_PROFILER_START(__name__) ProfilingBeginTimingBlock(__name__) -#define CC_PROFILER_STOP(__name__) ProfilingEndTimingBlock(__name__) -#define CC_PROFILER_RESET(__name__) ProfilingResetTimingBlock(__name__) +#define CC_PROFILER_START(__name__) NS_CC::ProfilingBeginTimingBlock(__name__) +#define CC_PROFILER_STOP(__name__) NS_CC::ProfilingEndTimingBlock(__name__) +#define CC_PROFILER_RESET(__name__) NS_CC::ProfilingResetTimingBlock(__name__) -#define CC_PROFILER_START_CATEGORY(__cat__, __name__) do{ if(__cat__) ProfilingBeginTimingBlock(__name__); } while(0) -#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) do{ if(__cat__) ProfilingEndTimingBlock(__name__); } while(0) -#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) do{ if(__cat__) ProfilingResetTimingBlock(__name__); } while(0) +#define CC_PROFILER_START_CATEGORY(__cat__, __name__) do{ if(__cat__) NS_CC::ProfilingBeginTimingBlock(__name__); } while(0) +#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) do{ if(__cat__) NS_CC::ProfilingEndTimingBlock(__name__); } while(0) +#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) do{ if(__cat__) NS_CC::ProfilingResetTimingBlock(__name__); } while(0) -#define CC_PROFILER_START_INSTANCE(__id__, __name__) do{ ProfilingBeginTimingBlock( String::createWithFormat("%08X - %s", __id__, __name__)->getCString() ); } while(0) -#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) do{ ProfilingEndTimingBlock( String::createWithFormat("%08X - %s", __id__, __name__)->getCString() ); } while(0) -#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) do{ ProfilingResetTimingBlock( String::createWithFormat("%08X - %s", __id__, __name__)->getCString() ); } while(0) +#define CC_PROFILER_START_INSTANCE(__id__, __name__) do{ NS_CC::ProfilingBeginTimingBlock( NS_CC::String::createWithFormat("%08X - %s", __id__, __name__)->getCString() ); } while(0) +#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) do{ NS_CC::ProfilingEndTimingBlock( NS_CC::String::createWithFormat("%08X - %s", __id__, __name__)->getCString() ); } while(0) +#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) do{ NS_CC::ProfilingResetTimingBlock( NS_CC::String::createWithFormat("%08X - %s", __id__, __name__)->getCString() ); } while(0) #else From 5cdbf4c04c4ac3df26b8ed75990ecc144936c01c Mon Sep 17 00:00:00 2001 From: teivaz Date: Tue, 19 Aug 2014 19:57:06 +0300 Subject: [PATCH 121/147] * [WP8] Fixed paths in template --- .../AppComponent/HelloCppComponent.vcxproj | 16 +++---- .../HelloCppComponent.vcxproj.filters | 48 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj index e325b74d52..bbe7540816 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj @@ -90,7 +90,7 @@ true pch.h /Zm200 %(AdditionalOptions) - $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\src;%(AdditionalIncludeDirectories) Console @@ -110,7 +110,7 @@ true pch.h /Zm200 %(AdditionalOptions) - $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\src;%(AdditionalIncludeDirectories) Console @@ -130,7 +130,7 @@ true pch.h /Zm200 %(AdditionalOptions) - $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\src;%(AdditionalIncludeDirectories) Console @@ -150,7 +150,7 @@ true pch.h /Zm200 %(AdditionalOptions) - $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\src;%(AdditionalIncludeDirectories) Console @@ -203,8 +203,8 @@ - - + + Create Create @@ -218,8 +218,8 @@ - - + + diff --git a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj.filters b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj.filters index 04b763cb76..58d94a3a9a 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj.filters +++ b/templates/cpp-template-default/proj.wp8-xaml/AppComponent/HelloCppComponent.vcxproj.filters @@ -2,61 +2,61 @@ - - Classes - - - Classes - - src + platform_src - src + platform_src - src + platform_src - src + platform_src + platform_src + + + src + + src - - Classes - - - Classes - - src + platform_src - src + platform_src - src + platform_src - src + platform_src - src + platform_src + platform_src + + + src + + src - - {facbd0ff-d271-46ef-8324-beff0cbcb424} + + {6fcff44b-bb9f-4ed9-8553-558855bc91e3} - {6fcff44b-bb9f-4ed9-8553-558855bc91e3} + {6e41adf9-1cf5-4085-ae27-accb4c9eab3d} From ebb0876d291ace168242aa9108b58e8fb5c4ce43 Mon Sep 17 00:00:00 2001 From: teivaz Date: Tue, 19 Aug 2014 21:44:46 +0300 Subject: [PATCH 122/147] * [WP8] Fixed resource search path in template --- .../cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj b/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj index 8d686b7879..19d93505a5 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj +++ b/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj @@ -156,8 +156,8 @@ - - Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + + Assets\res\%(RecursiveDir)%(FileName)%(Extension) PreserveNewest From de004e80c246e4c680f5eb3a9d7da30f109c9a65 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 19 Aug 2014 09:53:18 +0800 Subject: [PATCH 123/147] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 1b20f6df42..d01ef93c82 100644 --- a/AUTHORS +++ b/AUTHORS @@ -804,6 +804,7 @@ Developers: Android jni error clear & more readable log Add support of software PVRTC v1 decompression Fixed a bug that ttf font have not effect on Mac OS X + Fixed a bug that before touchMove Touch::_prevPoint contains junk youknowone Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView From bef6a2a7f1f3ca020ca8d9806876aecb3dc24254 Mon Sep 17 00:00:00 2001 From: xiangxw Date: Tue, 19 Aug 2014 11:46:30 +0800 Subject: [PATCH 124/147] fix sendPrompt() a extra '\0' will be sent when sizeof() is used --- cocos/base/CCConsole.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 3e02abbd2d..85775dbaad 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -131,7 +131,7 @@ static ssize_t mydprintf(int sock, const char *format, ...) static void sendPrompt(int fd) { const char prompt[] = "> "; - send(fd, prompt, sizeof(prompt),0); + send(fd, prompt, strlen(prompt),0); } static int printSceneGraph(int fd, Node* node, int level) From deb7ff64d46ada5171d55008e08fa55944035405 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 19 Aug 2014 15:14:07 +0800 Subject: [PATCH 125/147] fix pageView touch location --- cocos/ui/UIPageView.cpp | 3 +++ cocos/ui/UIScrollView.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index 3f7bf90c78..f7b98d22a5 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -533,6 +533,7 @@ void PageView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch * { case TouchEventType::BEGAN: { + _touchBeganPosition = touch->getLocation(); _isInterceptTouch = true; } break; @@ -540,6 +541,7 @@ void PageView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch * { float offset = 0; offset = fabs(sender->getTouchBeganPosition().x - touchPoint.x); + _touchMovePosition = touch->getLocation(); if (offset > _childFocusCancelOffset) { sender->setHighlighted(false); @@ -550,6 +552,7 @@ void PageView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch * case TouchEventType::CANCELED: case TouchEventType::ENDED: { + _touchEndPosition = touch->getLocation(); handleReleaseLogic(touch); if (sender->isSwallowTouches()) { diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index d3b39ad2fe..a9451fd813 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -1573,10 +1573,10 @@ void ScrollView::interceptTouchEvent(Widget::TouchEventType event, Widget *sende case TouchEventType::MOVED: { float offset = (sender->getTouchBeganPosition() - touchPoint).getLength(); + _touchMovePosition = touch->getLocation(); if (offset > _childFocusCancelOffset) { sender->setHighlighted(false); - _touchMovePosition = touch->getLocation(); handleMoveLogic(touch); } } From d884054ec9f33184b847eb3a9f195a88401af9d4 Mon Sep 17 00:00:00 2001 From: "kaile.yin" Date: Tue, 19 Aug 2014 15:19:47 +0800 Subject: [PATCH 126/147] remove cascade color for CorlorFrame --- cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp index b97cb461ed..917cadd851 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp @@ -516,9 +516,6 @@ void ColorFrame::onEnter(Frame *nextFrame) _betweenGreen = color.g - _color.g; _betweenBlue = color.b - _color.b; } - - _node->setCascadeColorEnabled(true); - _node->setCascadeOpacityEnabled(true); } void ColorFrame::apply(float percent) From dab6e5fb70b8182c9eef4eabf05aa2501bea602e Mon Sep 17 00:00:00 2001 From: zhangbin Date: Tue, 19 Aug 2014 15:21:43 +0800 Subject: [PATCH 127/147] Update the reference of submodule cocos2d-console. --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index b2a0338f0a..196bb42c4f 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit b2a0338f0a6d51878ce96c4e0521d083e232e67b +Subproject commit 196bb42c4fb72442230685fda0f100540052d60d From cdd67be77a49d6803e6bdcff30081a4b02262ff0 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 19 Aug 2014 15:29:40 +0800 Subject: [PATCH 128/147] use LOCAL_STATIC_LIBRARIES instead of LOCAL_WHOLE_STATIC_LIBRARIES --- cocos/Android.mk | 8 ++--- cocos/editor-support/cocosbuilder/Android.mk | 2 +- cocos/editor-support/cocostudio/Android.mk | 4 +-- cocos/editor-support/spine/Android.mk | 2 +- cocos/network/Android.mk | 6 ++-- .../lua-bindings/proj.android/Android.mk | 36 +++++++++---------- cocos/storage/local-storage/Android.mk | 2 +- cocos/ui/Android.mk | 4 +-- .../proj.android/jni/Android.mk | 2 +- tests/cpp-tests/Android.mk | 16 ++++----- tests/cpp-tests/proj.android/jni/Android.mk | 2 +- .../proj.android/jni/Android.mk | 2 +- .../project/proj.android/jni/Android.mk | 6 ++-- .../project/proj.android/jni/Android.mk | 4 +-- .../project/proj.android/jni/Android.mk | 18 +++++----- 15 files changed, 57 insertions(+), 57 deletions(-) diff --git a/cocos/Android.mk b/cocos/Android.mk index fc522d5810..511ebd5804 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -210,10 +210,10 @@ LOCAL_EXPORT_LDLIBS := -lGLESv2 \ -lz \ -landroid -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_freetype2_static -LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_png_static +LOCAL_STATIC_LIBRARIES := cocos_freetype2_static +LOCAL_STATIC_LIBRARIES += chipmunk_static +LOCAL_STATIC_LIBRARIES += cocos_png_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dxandroid_static # define the macro to compile through support/zip_support/ioapi.c LOCAL_CFLAGS := -DUSE_FILE32API diff --git a/cocos/editor-support/cocosbuilder/Android.mk b/cocos/editor-support/cocosbuilder/Android.mk index 52863eda24..5bde8a025b 100644 --- a/cocos/editor-support/cocosbuilder/Android.mk +++ b/cocos/editor-support/cocosbuilder/Android.mk @@ -36,7 +36,7 @@ $(LOCAL_PATH) \ $(LOCAL_PATH)/../../.. -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_extension_static +LOCAL_STATIC_LIBRARIES := cocos_extension_static include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index 3ae4b7fe27..39fecd8321 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -71,8 +71,8 @@ $(LOCAL_PATH)/../.. LOCAL_CFLAGS += -fexceptions -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_ui_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_STATIC_LIBRARIES := cocos_ui_static +LOCAL_STATIC_LIBRARIES += cocosdenshion_static include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/editor-support/spine/Android.mk b/cocos/editor-support/spine/Android.mk index afdbad89a3..b7f3446e1b 100644 --- a/cocos/editor-support/spine/Android.mk +++ b/cocos/editor-support/spine/Android.mk @@ -36,7 +36,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. \ $(LOCAL_PATH)/.. -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_STATIC_LIBRARIES := cocos2dx_static include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/network/Android.mk b/cocos/network/Android.mk index 045a8d5eab..b47964af29 100644 --- a/cocos/network/Android.mk +++ b/cocos/network/Android.mk @@ -16,9 +16,9 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. \ $(LOCAL_PATH)/.. -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static -LOCAL_WHOLE_STATIC_LIBRARIES += libwebsockets_static +LOCAL_STATIC_LIBRARIES := cocos2dx_static +LOCAL_STATIC_LIBRARIES += cocos_curl_static +LOCAL_STATIC_LIBRARIES += libwebsockets_static include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/scripting/lua-bindings/proj.android/Android.mk b/cocos/scripting/lua-bindings/proj.android/Android.mk index 2e6031074c..84a8fafa63 100644 --- a/cocos/scripting/lua-bindings/proj.android/Android.mk +++ b/cocos/scripting/lua-bindings/proj.android/Android.mk @@ -55,8 +55,8 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../external/lua/tolua \ $(LOCAL_PATH)/../manual/cocos2d -LOCAL_WHOLE_STATIC_LIBRARIES := luajit_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static +LOCAL_STATIC_LIBRARIES := luajit_static +LOCAL_STATIC_LIBRARIES += cocos2dx_static include $(BUILD_STATIC_LIBRARY) @@ -76,8 +76,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../auto \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/3d -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocos3d_static include $(BUILD_STATIC_LIBRARY) @@ -97,8 +97,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../auto \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/cocosdenshion -LOCAL_WHOLE_STATIC_LIBRARIES := cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2d_lua_static +LOCAL_STATIC_LIBRARIES := cocosdenshion_static +LOCAL_STATIC_LIBRARIES += cocos2d_lua_static include $(BUILD_STATIC_LIBRARY) @@ -134,8 +134,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual/network \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/network -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocos_network_static include $(BUILD_STATIC_LIBRARY) @@ -156,8 +156,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual/cocosbuilder \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/cocosbuilder -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocosbuilder_static include $(BUILD_STATIC_LIBRARY) @@ -179,8 +179,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual/cocostudio \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/cocostudio -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocostudio_static include $(BUILD_STATIC_LIBRARY) @@ -201,8 +201,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual/spine \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/spine -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += spine_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += spine_static include $(BUILD_STATIC_LIBRARY) @@ -223,8 +223,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual/extension \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/extension -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocos_extension_static include $(BUILD_STATIC_LIBRARY) @@ -246,8 +246,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual/ui \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual/ui -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_ui_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocos_ui_static include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/storage/local-storage/Android.mk b/cocos/storage/local-storage/Android.mk index c1351e7fb5..3a7a2604ee 100644 --- a/cocos/storage/local-storage/Android.mk +++ b/cocos/storage/local-storage/Android.mk @@ -17,7 +17,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_STATIC_LIBRARIES := cocos2dx_static include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index 40f4cb6a31..ab417448f1 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -42,8 +42,8 @@ $(LOCAL_PATH)/../.. \ $(LOCAL_PATH)/../editor-support -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_STATIC_LIBRARIES := cocos2dx_static +LOCAL_STATIC_LIBRARIES += cocos_extension_static include $(BUILD_STATIC_LIBRARY) diff --git a/tests/cpp-empty-test/proj.android/jni/Android.mk b/tests/cpp-empty-test/proj.android/jni/Android.mk index 5917f78021..66788e1c7f 100644 --- a/tests/cpp-empty-test/proj.android/jni/Android.mk +++ b/tests/cpp-empty-test/proj.android/jni/Android.mk @@ -12,7 +12,7 @@ LOCAL_SRC_FILES := main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static +LOCAL_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static include $(BUILD_SHARED_LIBRARY) diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index c1fcaefe21..3fd81f2445 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -188,14 +188,14 @@ Classes/ZwoptexTest/ZwoptexTest.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocosbuilder_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += spine_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static +LOCAL_STATIC_LIBRARIES := cocosbuilder_static +LOCAL_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_STATIC_LIBRARIES += spine_static +LOCAL_STATIC_LIBRARIES += cocostudio_static +LOCAL_STATIC_LIBRARIES += cocos_network_static +LOCAL_STATIC_LIBRARIES += cocos_extension_static +LOCAL_STATIC_LIBRARIES += box2d_static +LOCAL_STATIC_LIBRARIES += cocos3d_static LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes diff --git a/tests/cpp-tests/proj.android/jni/Android.mk b/tests/cpp-tests/proj.android/jni/Android.mk index 75950d8494..bb2c8fb025 100644 --- a/tests/cpp-tests/proj.android/jni/Android.mk +++ b/tests/cpp-tests/proj.android/jni/Android.mk @@ -10,7 +10,7 @@ LOCAL_SRC_FILES := main.cpp LOCAL_C_INCLUDES := ../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_cpp_tests_common +LOCAL_STATIC_LIBRARIES := cocos_cpp_tests_common include $(BUILD_SHARED_LIBRARY) diff --git a/tests/game-controller-test/proj.android/jni/Android.mk b/tests/game-controller-test/proj.android/jni/Android.mk index 9aff92cd27..fbb8613e91 100644 --- a/tests/game-controller-test/proj.android/jni/Android.mk +++ b/tests/game-controller-test/proj.android/jni/Android.mk @@ -13,7 +13,7 @@ LOCAL_SRC_FILES := main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ $(LOCAL_PATH)/../../../../external -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static +LOCAL_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static include $(BUILD_SHARED_LIBRARY) diff --git a/tests/lua-empty-test/project/proj.android/jni/Android.mk b/tests/lua-empty-test/project/proj.android/jni/Android.mk index 61c5baf884..98cbf8f9c4 100644 --- a/tests/lua-empty-test/project/proj.android/jni/Android.mk +++ b/tests/lua-empty-test/project/proj.android/jni/Android.mk @@ -12,9 +12,9 @@ LOCAL_SRC_FILES := main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ $(LOCAL_PATH)/../../../../../external/lua/tolua \ -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocosdenshion_lua_static +LOCAL_STATIC_LIBRARIES += network_lua_static include $(BUILD_SHARED_LIBRARY) diff --git a/tests/lua-game-controller-test/project/proj.android/jni/Android.mk b/tests/lua-game-controller-test/project/proj.android/jni/Android.mk index c1f283cb9f..9b9640e484 100644 --- a/tests/lua-game-controller-test/project/proj.android/jni/Android.mk +++ b/tests/lua-game-controller-test/project/proj.android/jni/Android.mk @@ -17,8 +17,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ $(LOCAL_PATH)/../../../../../cocos/scripting/lua-bindings/manual\controller \ $(LOCAL_PATH)/../../../../../cocos/base -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocosdenshion_static include $(BUILD_SHARED_LIBRARY) diff --git a/tests/lua-tests/project/proj.android/jni/Android.mk b/tests/lua-tests/project/proj.android/jni/Android.mk index 44aff93129..77cb96921f 100644 --- a/tests/lua-tests/project/proj.android/jni/Android.mk +++ b/tests/lua-tests/project/proj.android/jni/Android.mk @@ -13,15 +13,15 @@ LOCAL_SRC_FILES += main.cpp \ LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += network_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += spine_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += extension_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += ui_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_lua_static +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocosdenshion_lua_static +LOCAL_STATIC_LIBRARIES += network_lua_static +LOCAL_STATIC_LIBRARIES += cocosbuilder_lua_static +LOCAL_STATIC_LIBRARIES += cocostudio_lua_static +LOCAL_STATIC_LIBRARIES += spine_lua_static +LOCAL_STATIC_LIBRARIES += extension_lua_static +LOCAL_STATIC_LIBRARIES += ui_lua_static +LOCAL_STATIC_LIBRARIES += cocos3d_lua_static include $(BUILD_SHARED_LIBRARY) From 0e7ec265ee04a5044ab323b2992fd6ec3308a4f5 Mon Sep 17 00:00:00 2001 From: teivaz Date: Wed, 20 Aug 2014 11:54:41 +0300 Subject: [PATCH 129/147] * [WP8] Fixed default search path: renamed "Assets\Resources" to "Assets\res" --- cocos/platform/winrt/CCFileUtilsWinRT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp index 736a597504..a5b0e7214c 100644 --- a/cocos/platform/winrt/CCFileUtilsWinRT.cpp +++ b/cocos/platform/winrt/CCFileUtilsWinRT.cpp @@ -53,7 +53,7 @@ static void _checkPath() if (s_pszResourcePath.empty()) { // TODO: needs to be tested - s_pszResourcePath = convertPathFormatToUnixStyle(CCFileUtilsWinRT::getAppPath() + '\\' + "Assets\\Resources" + '\\'); + s_pszResourcePath = convertPathFormatToUnixStyle(CCFileUtilsWinRT::getAppPath() + '\\' + "Assets\\res" + '\\'); } } From bfe6513706a353fcd9fd3e3e673feebdc23f0496 Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 18 Aug 2014 16:41:12 +0400 Subject: [PATCH 130/147] setKeepScreenOn method --- cocos/platform/CCDevice.h | 2 ++ cocos/platform/android/CCDevice.cpp | 6 ++++++ .../java/src/org/cocos2dx/lib/Cocos2dxActivity.java | 11 +++++++++++ .../java/src/org/cocos2dx/lib/Cocos2dxHelper.java | 4 ++++ .../jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp | 10 ++++++++++ .../jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h | 1 + cocos/platform/ios/CCDevice.mm | 5 +++++ cocos/platform/linux/CCDevice.cpp | 4 ++++ cocos/platform/mac/CCDevice.mm | 5 +++++ cocos/platform/win32/CCDevice.cpp | 4 ++++ cocos/platform/winrt/CCDevice.cpp | 4 ++++ 11 files changed, 56 insertions(+) diff --git a/cocos/platform/CCDevice.h b/cocos/platform/CCDevice.h index 1affa43e7b..91e6485559 100644 --- a/cocos/platform/CCDevice.h +++ b/cocos/platform/CCDevice.h @@ -65,6 +65,8 @@ public: static void setAccelerometerInterval(float interval); static Data getTextureDataForText(const char * text, const FontDefinition& textDefinition, TextAlign align, int &width, int &height, bool& hasPremultipliedAlpha); + + static void setKeepScreenOn(bool value); private: CC_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); diff --git a/cocos/platform/android/CCDevice.cpp b/cocos/platform/android/CCDevice.cpp index fc5a0902f8..3ccb441d19 100644 --- a/cocos/platform/android/CCDevice.cpp +++ b/cocos/platform/android/CCDevice.cpp @@ -202,6 +202,12 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text return ret; } + +void Device::setKeepScreenOn(bool value) +{ + setKeepScreenOnJni(value); +} + NS_CC_END #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index 78929fb300..9ae61cc165 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -34,6 +34,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Message; import android.view.ViewGroup; +import android.view.WindowManager; import android.util.Log; import android.widget.FrameLayout; import android.preference.PreferenceManager.OnActivityResultListener; @@ -58,6 +59,16 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe return sContext; } + public void setKeepScreenOn(boolean value) { + final boolean newValue = value; + runOnUiThread(new Runnable() { + @Override + public void run() { + mGLSurfaceView.setKeepScreenOn(newValue); + } + }); + } + protected void onLoadNativeLibraries() { try { ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index 3cabec4822..ea102e7f73 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -167,6 +167,10 @@ public class Cocos2dxHelper { Cocos2dxHelper.sAccelerometerEnabled = false; Cocos2dxHelper.sCocos2dxAccelerometer.disable(); } + + public static void setKeepScreenOn(boolean value) { + ((Cocos2dxActivity)sActivity).setKeepScreenOn(value); + } public static void preloadBackgroundMusic(final String pPath) { Cocos2dxHelper.sCocos2dMusic.preloadBackgroundMusic(pPath); diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp index 3449bbbc9d..ef9fac20a4 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp @@ -209,6 +209,16 @@ void disableAccelerometerJni() { } } +void setKeepScreenOnJni(bool value) { + JniMethodInfo t; + + if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setKeepScreenOn", "(Z)V")) { + t.env->CallStaticVoidMethod(t.classID, t.methodID, value); + + t.env->DeleteLocalRef(t.classID); + } +} + // functions for UserDefault bool getBoolForKeyJNI(const char* key, bool defaultValue) { diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h index 34d521a911..7044a4e5e4 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h @@ -39,6 +39,7 @@ extern std::string getFileDirectoryJNI(); extern void enableAccelerometerJni(); extern void disableAccelerometerJni(); extern void setAccelerometerIntervalJni(float interval); +extern void setKeepScreenOnJni(bool value); // functions for UserDefault extern bool getBoolForKeyJNI(const char* key, bool defaultValue); extern int getIntegerForKeyJNI(const char* key, int defaultValue); diff --git a/cocos/platform/ios/CCDevice.mm b/cocos/platform/ios/CCDevice.mm index 607d95340b..28438ea897 100644 --- a/cocos/platform/ios/CCDevice.mm +++ b/cocos/platform/ios/CCDevice.mm @@ -477,6 +477,11 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text return ret; } +void Device::setKeepScreenOn(bool value) +{ + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; +} + NS_CC_END #endif // CC_PLATFORM_IOS diff --git a/cocos/platform/linux/CCDevice.cpp b/cocos/platform/linux/CCDevice.cpp index 5536c87d81..24b70d05b2 100644 --- a/cocos/platform/linux/CCDevice.cpp +++ b/cocos/platform/linux/CCDevice.cpp @@ -499,6 +499,10 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text return ret; } +void Device::setKeepScreenOn(bool value) +{ +} + NS_CC_END #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/platform/mac/CCDevice.mm b/cocos/platform/mac/CCDevice.mm index 185dded81d..885a643bc6 100644 --- a/cocos/platform/mac/CCDevice.mm +++ b/cocos/platform/mac/CCDevice.mm @@ -247,6 +247,11 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text return ret; } + +void Device::setKeepScreenOn(bool value) +{ +} + NS_CC_END #endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/platform/win32/CCDevice.cpp b/cocos/platform/win32/CCDevice.cpp index f6bce3bac5..ed69905ab1 100644 --- a/cocos/platform/win32/CCDevice.cpp +++ b/cocos/platform/win32/CCDevice.cpp @@ -451,6 +451,10 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text return ret; } +void Device::setKeepScreenOn(bool value) +{ +} + NS_CC_END #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/platform/winrt/CCDevice.cpp b/cocos/platform/winrt/CCDevice.cpp index edf747764a..eedd87cd87 100644 --- a/cocos/platform/winrt/CCDevice.cpp +++ b/cocos/platform/winrt/CCDevice.cpp @@ -163,6 +163,10 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text return ret; } +void Device::setKeepScreenOn(bool value) +{ +} + NS_CC_END #endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) From 055a143f9d033325e8a771c64596120278f985b4 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 19 Aug 2014 14:50:47 +0400 Subject: [PATCH 131/147] Label performance problem --- cocos/2d/CCLabel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 9eaf5ee5f1..3ad34b2acf 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1023,7 +1023,8 @@ void Label::updateFont() void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags) { - if (_fontDefinition._fontFillColor != _textColor) + if (_fontDefinition._fontFillColor.r != _textColor.r || _fontDefinition._fontFillColor.g != _textColor.g + || _fontDefinition._fontFillColor.b != _textColor.b) { updateContent(); } From eecaac3384a2aac900148afe476aa5cb556fe49e Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 09:48:39 +0800 Subject: [PATCH 132/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index bc7dbd38df..7926008d81 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ cocos2d-x-3.3 ?? [NEW] Added Camera, AABB, OBB and Ray [NEW] Added render primitive and render primitive command, support passing point, line and triangle data [NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop + [NEW] Device: added setKeepScreenOn() for iOS and Android [NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions [NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile() getFileSize() From 83ccfa0faa4215209657863d0671a616fbeaa6a5 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 09:50:39 +0800 Subject: [PATCH 133/147] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index d01ef93c82..feb91b4de3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -805,6 +805,7 @@ Developers: Add support of software PVRTC v1 decompression Fixed a bug that ttf font have not effect on Mac OS X Fixed a bug that before touchMove Touch::_prevPoint contains junk + Added Device::setKeepScreenOn() youknowone Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView From 2fe45ec6ccea0600affecfda6d7bfc5564a2d96a Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 10:26:53 +0800 Subject: [PATCH 134/147] [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index feb91b4de3..951e9cbb69 100644 --- a/AUTHORS +++ b/AUTHORS @@ -980,6 +980,9 @@ Developers: zaWasp Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32 + + xiangxw + Fixed the bug that Console::sendPrompt() will send extra `\0` Retired Core Developers: WenSheng Yang From 2c4fe854fbdd51a6a70c0cbc1545c134980c0ff4 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 10:28:48 +0800 Subject: [PATCH 135/147] [ --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 951e9cbb69..325fac3d05 100644 --- a/AUTHORS +++ b/AUTHORS @@ -806,6 +806,7 @@ Developers: Fixed a bug that ttf font have not effect on Mac OS X Fixed a bug that before touchMove Touch::_prevPoint contains junk Added Device::setKeepScreenOn() + Fixed Label performance problem youknowone Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView From 0e5a79d486d3f584af021b66ccfa949a06fca14b Mon Sep 17 00:00:00 2001 From: teivaz Date: Wed, 20 Aug 2014 12:02:16 +0300 Subject: [PATCH 136/147] + [WP8] Added method for custom precompiled shader program loading --- cocos/platform/winrt/CCPrecompiledShaders.cpp | 19 +++++++++++++++++++ cocos/platform/winrt/CCPrecompiledShaders.h | 1 + 2 files changed, 20 insertions(+) diff --git a/cocos/platform/winrt/CCPrecompiledShaders.cpp b/cocos/platform/winrt/CCPrecompiledShaders.cpp index 3ec3131651..da7c40080b 100644 --- a/cocos/platform/winrt/CCPrecompiledShaders.cpp +++ b/cocos/platform/winrt/CCPrecompiledShaders.cpp @@ -135,6 +135,25 @@ void CCPrecompiledShaders::loadPrecompiledPrograms() #endif } +void CCPrecompiledShaders::addPrecompiledProgram(const char* key, const unsigned char* program, int programLength) +{ + std::string id = key; + PrecompiledProgram* p = nullptr; + auto it = m_precompiledPrograms.find(id); + if (it != m_precompiledPrograms.end()) + { + p = it->second; + } + else + { + p = new PrecompiledProgram(); + m_precompiledPrograms[id] = p; + } + p->key = key; + p->program = program; + p->length = programLength; +} + bool CCPrecompiledShaders::loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray) { std::string id = computeHash(vShaderByteArray, fShaderByteArray); diff --git a/cocos/platform/winrt/CCPrecompiledShaders.h b/cocos/platform/winrt/CCPrecompiledShaders.h index dd619b0dd9..d1dba0896a 100644 --- a/cocos/platform/winrt/CCPrecompiledShaders.h +++ b/cocos/platform/winrt/CCPrecompiledShaders.h @@ -70,6 +70,7 @@ public: */ static CCPrecompiledShaders* getInstance(); + void addPrecompiledProgram(const char* key, const unsigned char* program, int programLength); std::string addShaders(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray); bool addProgram(GLuint program, const std::string& id); From fa95bda6296f7b23aefba5b321b284ff9ae77db7 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 11:23:50 +0800 Subject: [PATCH 137/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 7926008d81..dad8e382d8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ cocos2d-x-3.3 ?? [NEW] Added Camera, AABB, OBB and Ray [NEW] Added render primitive and render primitive command, support passing point, line and triangle data [NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop + [NEW] Added method for custom precompiled shader program loading on WP8 [NEW] Device: added setKeepScreenOn() for iOS and Android [NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions [NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile() From 01165951dea0dead6f237f3b5f750a9a6dc4b45b Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 11:24:53 +0800 Subject: [PATCH 138/147] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 325fac3d05..8a64066b20 100644 --- a/AUTHORS +++ b/AUTHORS @@ -924,6 +924,7 @@ Developers: Teivaz Custom uniform search optimization Fixed compiling error on WP8. + Added method for custom precompiled shader program loading on WP8 chareice Make `setup.py` work on zsh From 8f30a7eeffee0c160091cd41d45a104b652791b8 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 20 Aug 2014 11:41:58 +0800 Subject: [PATCH 139/147] Update the reference of submodule cocos2d-console. --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 196bb42c4f..f8f912183a 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 196bb42c4fb72442230685fda0f100540052d60d +Subproject commit f8f912183afd6276156b989f5e14b1cea7db8962 From 34629f10148c093d981f9ca02b7eb37d15d1967e Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 20 Aug 2014 12:02:12 +0800 Subject: [PATCH 140/147] fix windows & win8 & wp8 compile error --- cocos/2d/cocos2d_wp8.vcxproj | 8 +++++++ cocos/2d/cocos2d_wp8.vcxproj.filters | 24 +++++++++++++++++++ cocos/2d/libcocos2d.vcxproj | 2 ++ cocos/2d/libcocos2d.vcxproj.filters | 6 +++++ cocos/base/ccRandom.h | 2 +- .../cpp-testsComponent.vcxproj | 4 ++++ .../cpp-testsComponent.vcxproj.filters | 15 ++++++++++++ 7 files changed, 60 insertions(+), 1 deletion(-) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index ba6dbc0623..07a0aefc46 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -222,6 +222,7 @@ NotUsing NotUsing + @@ -229,7 +230,9 @@ + + @@ -280,6 +283,7 @@ + @@ -442,6 +446,7 @@ + @@ -451,7 +456,9 @@ + + @@ -495,6 +502,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index 2a8cead521..5a53e1329e 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -650,6 +650,18 @@ base + + base + + + 3d + + + 3d + + + 3d + @@ -1328,6 +1340,18 @@ base + + base + + + 3d + + + 3d + + + 3d + diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 91e74ad18a..457a0acc95 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -213,6 +213,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -399,6 +400,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index eb482baa59..b7bbac671f 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -586,6 +586,9 @@ base + + base + @@ -1189,6 +1192,9 @@ base + + base + diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h index 5d3a7ab2e0..272da902b2 100644 --- a/cocos/base/ccRandom.h +++ b/cocos/base/ccRandom.h @@ -32,7 +32,7 @@ THE SOFTWARE. NS_CC_BEGIN -class RandomHelper { +class CC_DLL RandomHelper { public: template static inline T random_real(T min, T max) { diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index c152ba0746..16806e1f8c 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -185,6 +185,7 @@ + @@ -228,6 +229,7 @@ + @@ -383,6 +385,7 @@ + @@ -429,6 +432,7 @@ + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters index 5959863578..44d9ce5bea 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters @@ -325,6 +325,9 @@ {dff38415-43e7-4aff-98ec-c6094899d142} + + {d17dc00f-2b4d-46af-a1ff-c3f4d937d621} + @@ -858,6 +861,12 @@ Classes\UITest\CocosStudioGUITest + + Classes\Sprite3DTest + + + Classes\Camera3DTest + @@ -1590,6 +1599,12 @@ Classes\UITest\CocosStudioGUITest + + Classes\Sprite3DTest + + + Classes\Camera3DTest + From 9c2cbaf742a819206e612e5c46eebb68712e5cbf Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 20 Aug 2014 05:37:22 +0000 Subject: [PATCH 141/147] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 3a8a2d9444..c1e45b22d8 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -360,8 +360,6 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", - "cocos/base/ccRandom.cpp", - "cocos/base/ccRandom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", "cocos/base/CCRefPtr.h", @@ -395,6 +393,8 @@ "cocos/base/ccFPSImages.c", "cocos/base/ccFPSImages.h", "cocos/base/ccMacros.h", + "cocos/base/ccRandom.cpp", + "cocos/base/ccRandom.h", "cocos/base/ccTypes.cpp", "cocos/base/ccTypes.h", "cocos/base/ccUTF8.cpp", From 6458a1fc6da735de466c31cdbe06bbd58361e8c3 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 13:37:23 +0800 Subject: [PATCH 142/147] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 8a64066b20..93f56e9cbd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -917,6 +917,7 @@ Developers: Fix a bug that crash happened when try to remove videoView(STATE_PLAYBACK_COMPLETED) in android Fix video scale issue in iOS Fix iOS VideoPlayer memory leak + Added c++11 random library support billtt Fixed a bug that Node::setScale(float) may not work properly From 8034b5429ef2389cb2662ffb8423296c9efce517 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 20 Aug 2014 13:45:01 +0800 Subject: [PATCH 143/147] Update the reference of submodule cocos2d-console. --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index f8f912183a..802e261172 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit f8f912183afd6276156b989f5e14b1cea7db8962 +Subproject commit 802e261172e2f3b49d1feed20935a53820694ab2 From 5ef89382174159409887ecf5f54ffc84bbc1610b Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 20 Aug 2014 13:45:08 +0800 Subject: [PATCH 144/147] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index dad8e382d8..83072a1e9a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ cocos2d-x-3.3 ?? [NEW] Added render primitive and render primitive command, support passing point, line and triangle data [NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop [NEW] Added method for custom precompiled shader program loading on WP8 + [NEW] Added c++11 random support [NEW] Device: added setKeepScreenOn() for iOS and Android [NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions [NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile() From 22db2abcaf09a3edc3d86e1d1e2c1e549b2c30f9 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Wed, 20 Aug 2014 14:21:13 +0800 Subject: [PATCH 145/147] add != operator in Blendfunc --- cocos/base/ccTypes.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index 3a8e990b4e..8e75b828a8 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -348,6 +348,11 @@ struct CC_DLL BlendFunc return src == a.src && dst == a.dst; } + bool operator!=(const BlendFunc &a) const + { + return src != a.src || dst != a.dst; + } + bool operator<(const BlendFunc &a) const { return src < a.src || (src == a.src && dst < a.dst); From b5e5e2d8d55cd98f18bdfe1b73077e2952a5d66e Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Wed, 20 Aug 2014 14:48:50 +0800 Subject: [PATCH 146/147] add primitive head file to cocos2d.h --- cocos/cocos2d.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 96158acfcf..f3ec0cece8 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -154,6 +154,10 @@ THE SOFTWARE. #include "renderer/ccShaders.h" #include "renderer/CCTexture2D.h" #include "renderer/CCTextureCache.h" +#include "renderer/CCVertexIndexBuffer.h" +#include "renderer/CCVertexIndexData.h" +#include "renderer/CCPrimitive.h" +#include "renderer/CCPrimitiveCommand.h" // physics #include "physics/CCPhysicsBody.h" From 4697cb07e663f540ba7647ae76860027dd5c07a0 Mon Sep 17 00:00:00 2001 From: teivaz Date: Thu, 21 Aug 2014 18:04:46 +0300 Subject: [PATCH 147/147] ! Set version to 3.3 (as it is no longer 3.2) --- cocos/cocos2d.cpp | 2 +- cocos/cocos2d.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/cocos2d.cpp b/cocos/cocos2d.cpp index 7e4cb18e48..83c40ab695 100644 --- a/cocos/cocos2d.cpp +++ b/cocos/cocos2d.cpp @@ -31,7 +31,7 @@ NS_CC_BEGIN CC_DLL const char* cocos2dVersion() { - return "cocos2d-x 3.2"; + return "cocos2d-x 3.3"; } NS_CC_END diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index f3ec0cece8..2998a244b6 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -29,8 +29,8 @@ THE SOFTWARE. #define __COCOS2D_H__ // 0x00 HI ME LO -// 00 03 02 00 -#define COCOS2D_VERSION 0x00030200 +// 00 03 03 00 +#define COCOS2D_VERSION 0x00030300 // // all cocos2d include files