From 7f5782c207377311d3ca8f5a78bec42830b1022e Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 09:20:02 +0800 Subject: [PATCH 01/57] chang module name for windows project file --- cocos/audio/proj.win32/CocosDenshion.vcxproj | 2 +- .../cocostudio/proj.win32/libCocosStudio.vcxproj | 5 +++-- cocos/ui/proj.win32/libGUI.vcxproj | 5 +++-- extensions/proj.win32/libExtensions.vcxproj | 1 + tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj | 4 ++-- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cocos/audio/proj.win32/CocosDenshion.vcxproj b/cocos/audio/proj.win32/CocosDenshion.vcxproj index e2d7f20825..6a43e792c7 100644 --- a/cocos/audio/proj.win32/CocosDenshion.vcxproj +++ b/cocos/audio/proj.win32/CocosDenshion.vcxproj @@ -11,7 +11,7 @@ - libAudio + libcocosdenshion {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} CocosDenshion.win32 Win32Proj diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index c60c6de5ca..465482dfcb 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -151,6 +151,7 @@ {B57CF53F-2E49-4031-9822-047CC0E6BDE2} libCocosStudio + libcocostudio @@ -210,7 +211,7 @@ true $(OutDir);%(AdditionalLibraryDirectories) - libcocos2d.lib;libExtensions.lib;libGUI.lib;libBox2d.lib;libchipmunk.lib;libzlib.lib;libAudio.lib;%(AdditionalDependencies) + libzlib.lib;%(AdditionalDependencies) @@ -230,7 +231,7 @@ true true true - libcocos2d.lib;libExtensions.lib;libGUI.lib;libBox2d.lib;libchipmunk.lib;libzlib.lib;libAudio.lib;%(AdditionalDependencies) + libzlib.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) diff --git a/cocos/ui/proj.win32/libGUI.vcxproj b/cocos/ui/proj.win32/libGUI.vcxproj index 969aa1ed5c..059d20ea82 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj +++ b/cocos/ui/proj.win32/libGUI.vcxproj @@ -74,6 +74,7 @@ {7E06E92C-537A-442B-9E4A-4761C84F8A1A} libGUI + libui @@ -133,7 +134,7 @@ true $(OutDir);%(AdditionalLibraryDirectories) - libcocos2d.lib;opengl32.lib;glew32.lib;libExtensions.lib;%(AdditionalDependencies) + opengl32.lib;glew32.lib;%(AdditionalDependencies) @@ -154,7 +155,7 @@ true true $(OutDir);%(AdditionalLibraryDirectories) - libcocos2d.lib;opengl32.lib;glew32.lib;libExtensions.lib;%(AdditionalDependencies) + opengl32.lib;glew32.lib;%(AdditionalDependencies) diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index dc1a283282..594d90140b 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -14,6 +14,7 @@ {21B2C324-891F-48EA-AD1A-5AE13DE12E28} Extensions.win32 Win32Proj + libextension diff --git a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj index 87410d9263..50060e483e 100644 --- a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj +++ b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj @@ -89,7 +89,7 @@ true Windows MachineX86 - libcocos2d.lib;libchipmunk.lib;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -111,7 +111,7 @@ 4267;4251;4244;%(DisableSpecificWarnings) - libcocos2d.lib;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)$(ProjectName).exe $(OutDir);%(AdditionalLibraryDirectories) true diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 14520e39ae..c6690f22bc 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -90,7 +90,7 @@ true Windows MachineX86 - libcurl_imp.lib;websockets.lib;libcocos2d.lib;libExtensions.lib;libAudio.lib;libGUI.lib;libCocosStudio.lib;opengl32.lib;glew32.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;opengl32.lib;glew32.lib;%(AdditionalDependencies) @@ -118,7 +118,7 @@ false - libcurl_imp.lib;websockets.lib;libcocos2d.lib;libExtensions.lib;libAudio.lib;libGUI.lib;libCocosStudio.lib;opengl32.lib;glew32.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;opengl32.lib;glew32.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName).exe $(OutDir);%(AdditionalLibraryDirectories) false From 2795c10627031442f5eb6a8f7a9f12e1f1d35a73 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 12:05:58 +0800 Subject: [PATCH 02/57] rename box2d->libbox2d --- build/cocos2d-win32.vc2012.sln | 20 +++++++++---------- extensions/proj.win32/libExtensions.vcxproj | 3 --- .../{Box2D.vcxproj => libbox2d.vcxproj} | 0 ...xproj.filters => libbox2d.vcxproj.filters} | 0 tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 3 +-- 5 files changed, 11 insertions(+), 15 deletions(-) rename external/Box2D/proj.win32/{Box2D.vcxproj => libbox2d.vcxproj} (100%) rename external/Box2D/proj.win32/{Box2D.vcxproj.filters => libbox2d.vcxproj.filters} (100%) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 8c661cfacc..865e791a1a 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -1,24 +1,22 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" ProjectSection(ProjectDependencies) = postProject {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" EndProject @@ -28,7 +26,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scriptin EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-tests", "..\tests\lua-tests\project\proj.win32\lua-tests.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos\ui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\cocos\ui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" ProjectSection(ProjectDependencies) = postProject {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} EndProjectSection @@ -37,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-empty-test", "..\tests\lua-empty-test\project\proj.win32\lua-empty-test.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -51,10 +51,6 @@ Global {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.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 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 @@ -103,6 +99,10 @@ Global {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.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/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index 594d90140b..ea56136ca4 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -166,9 +166,6 @@ {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - {929480e7-23c0-4df6-8456-096d71547116} - diff --git a/external/Box2D/proj.win32/Box2D.vcxproj b/external/Box2D/proj.win32/libbox2d.vcxproj similarity index 100% rename from external/Box2D/proj.win32/Box2D.vcxproj rename to external/Box2D/proj.win32/libbox2d.vcxproj diff --git a/external/Box2D/proj.win32/Box2D.vcxproj.filters b/external/Box2D/proj.win32/libbox2d.vcxproj.filters similarity index 100% rename from external/Box2D/proj.win32/Box2D.vcxproj.filters rename to external/Box2D/proj.win32/libbox2d.vcxproj.filters diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index c6690f22bc..8aaf6cd3bd 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -585,9 +585,8 @@ {21b2c324-891f-48ea-ad1a-5ae13de12e28} false - + {929480e7-23c0-4df6-8456-096d71547116} - false {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} From 030d48ea321f6088ad9ec5f78e32849520b1dc49 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 12:13:52 +0800 Subject: [PATCH 03/57] change Project name to libbox2d --- external/Box2D/proj.win32/libbox2d.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/Box2D/proj.win32/libbox2d.vcxproj b/external/Box2D/proj.win32/libbox2d.vcxproj index 8193b38dff..188b960501 100644 --- a/external/Box2D/proj.win32/libbox2d.vcxproj +++ b/external/Box2D/proj.win32/libbox2d.vcxproj @@ -11,9 +11,9 @@ - libBox2D + libbox2d {929480E7-23C0-4DF6-8456-096D71547116} - Box2D.win32 + libbox2d.win32 Win32Proj From 4a4f05c827e43c56dc668ba230e0eb026ab6b0da Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 20:55:58 +0800 Subject: [PATCH 04/57] change cocos2d to libcocos2d for windows --- build/cocos2d-win32.vc2012.sln | 17 +++++++---------- .../2d/{cocos2d.vcxproj => libcocos2d.vcxproj} | 0 ...xproj.filters => libcocos2d.vcxproj.filters} | 0 cocos/audio/proj.win32/CocosDenshion.vcxproj | 2 +- .../proj.win32/libCocosBuilder.vcxproj | 2 +- .../proj.win32/libCocosStudio.vcxproj | 2 +- .../spine/proj.win32/libSpine.vcxproj | 5 +++++ cocos/network/proj.win32/libNetwork.vcxproj | 2 +- .../lua-bindings/proj.win32/liblua.vcxproj | 5 +++++ cocos/ui/proj.win32/libGUI.vcxproj | 2 +- extensions/proj.win32/libExtensions.vcxproj | 2 +- .../proj.win32/cpp-empty-test.vcxproj | 3 +-- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 3 +-- .../project/proj.win32/lua-empty-test.vcxproj | 2 +- .../project/proj.win32/lua-tests.win32.vcxproj | 6 +++--- 15 files changed, 29 insertions(+), 24 deletions(-) rename cocos/2d/{cocos2d.vcxproj => libcocos2d.vcxproj} (100%) rename cocos/2d/{cocos2d.vcxproj.filters => libcocos2d.vcxproj.filters} (100%) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 865e791a1a..c03eb6cad4 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -3,11 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" - ProjectSection(ProjectDependencies) = postProject - {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" @@ -35,7 +30,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-empty-test", "..\tests\lua-empty-test\project\proj.win32\lua-empty-test.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -47,10 +44,6 @@ Global {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 - {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 - {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 - {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 - {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 @@ -103,6 +96,10 @@ 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 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj similarity index 100% rename from cocos/2d/cocos2d.vcxproj rename to cocos/2d/libcocos2d.vcxproj diff --git a/cocos/2d/cocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters similarity index 100% rename from cocos/2d/cocos2d.vcxproj.filters rename to cocos/2d/libcocos2d.vcxproj.filters diff --git a/cocos/audio/proj.win32/CocosDenshion.vcxproj b/cocos/audio/proj.win32/CocosDenshion.vcxproj index 6a43e792c7..ecb37bbc32 100644 --- a/cocos/audio/proj.win32/CocosDenshion.vcxproj +++ b/cocos/audio/proj.win32/CocosDenshion.vcxproj @@ -131,7 +131,7 @@ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj index ed92699ef1..7092308706 100644 --- a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj +++ b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj @@ -149,7 +149,7 @@ {21b2c324-891f-48ea-ad1a-5ae13de12e28} - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index 465482dfcb..6aec00e5b4 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -138,7 +138,7 @@ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj index 723adeec4b..ff57d458af 100644 --- a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj @@ -65,6 +65,11 @@ + + + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} libSpine diff --git a/cocos/network/proj.win32/libNetwork.vcxproj b/cocos/network/proj.win32/libNetwork.vcxproj index 703bf1ea1b..e78b616607 100644 --- a/cocos/network/proj.win32/libNetwork.vcxproj +++ b/cocos/network/proj.win32/libNetwork.vcxproj @@ -23,7 +23,7 @@ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} diff --git a/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj b/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj index 8afd7fae0a..17d4be7a0a 100644 --- a/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/liblua.vcxproj @@ -134,6 +134,11 @@ + + + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + {DDC3E27F-004D-4DD4-9DD3-931A013D2159} liblua diff --git a/cocos/ui/proj.win32/libGUI.vcxproj b/cocos/ui/proj.win32/libGUI.vcxproj index 059d20ea82..7516a1cf57 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj +++ b/cocos/ui/proj.win32/libGUI.vcxproj @@ -67,7 +67,7 @@ {21b2c324-891f-48ea-ad1a-5ae13de12e28} - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index ea56136ca4..af5c6a7710 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -163,7 +163,7 @@ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} diff --git a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj index 50060e483e..cb5221ad76 100644 --- a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj +++ b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj @@ -137,9 +137,8 @@ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - false {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 8aaf6cd3bd..793bcf9d23 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -558,9 +558,8 @@ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - false {f8edd7fa-9a51-4e80-baeb-860825d2eac6} 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 b6b87c3e0f..bbe0227bcb 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 @@ -175,7 +175,7 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} 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 e094ca0c26..8ab333821e 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -178,12 +178,12 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} From 8f9ce2e282ea2b5c1357c85e6f8f7a496d09d96d Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 21:09:43 +0800 Subject: [PATCH 05/57] change cocosbuilder to lowercase --- .../cocosbuilder/proj.win32/libCocosBuilder.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj index 7092308706..eacfb65847 100644 --- a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj +++ b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj @@ -12,7 +12,7 @@ {811C0DAB-7B96-4BD3-A154-B7572B58E4AB} - libCocosBuilder + libcocosbuilder From c6956504bfad86c6ad2bed1e29c4b5f2ab36af8f Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 21:35:16 +0800 Subject: [PATCH 06/57] change CocosDenshion to libcocosdenshion --- build/cocos2d-win32.vc2012.sln | 12 ++++++------ ...ocosDenshion.vcxproj => libcocosdenshion.vcxproj} | 0 ...proj.filters => libcocosdenshion.vcxproj.filters} | 0 ...on.vcxproj.user => libcocosdenshion.vcxproj.user} | 0 .../cocostudio/proj.win32/libCocosStudio.vcxproj | 2 +- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 3 +-- .../project/proj.win32/lua-empty-test.vcxproj | 2 +- .../project/proj.win32/lua-tests.win32.vcxproj | 6 +++--- 8 files changed, 12 insertions(+), 13 deletions(-) rename cocos/audio/proj.win32/{CocosDenshion.vcxproj => libcocosdenshion.vcxproj} (100%) rename cocos/audio/proj.win32/{CocosDenshion.vcxproj.filters => libcocosdenshion.vcxproj.filters} (100%) rename cocos/audio/proj.win32/{CocosDenshion.vcxproj.user => libcocosdenshion.vcxproj.user} (100%) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index c03eb6cad4..3d893c7866 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -1,8 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" @@ -34,16 +32,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\cocos\audio\proj.win32\libcocosdenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {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 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 @@ -100,6 +96,10 @@ Global {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.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/cocos/audio/proj.win32/CocosDenshion.vcxproj b/cocos/audio/proj.win32/libcocosdenshion.vcxproj similarity index 100% rename from cocos/audio/proj.win32/CocosDenshion.vcxproj rename to cocos/audio/proj.win32/libcocosdenshion.vcxproj diff --git a/cocos/audio/proj.win32/CocosDenshion.vcxproj.filters b/cocos/audio/proj.win32/libcocosdenshion.vcxproj.filters similarity index 100% rename from cocos/audio/proj.win32/CocosDenshion.vcxproj.filters rename to cocos/audio/proj.win32/libcocosdenshion.vcxproj.filters diff --git a/cocos/audio/proj.win32/CocosDenshion.vcxproj.user b/cocos/audio/proj.win32/libcocosdenshion.vcxproj.user similarity index 100% rename from cocos/audio/proj.win32/CocosDenshion.vcxproj.user rename to cocos/audio/proj.win32/libcocosdenshion.vcxproj.user diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index 6aec00e5b4..29471721e3 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -141,7 +141,7 @@ {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 793bcf9d23..1dc95b708f 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -561,9 +561,8 @@ {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - false {811c0dab-7b96-4bd3-a154-b7572b58e4ab} 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 bbe0227bcb..f29de529f2 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 @@ -178,7 +178,7 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} 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 8ab333821e..e3cc9db705 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -181,12 +181,12 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} + {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} From d6bc2f4998760ebc1af9afbd06e239a80e488511 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 28 Jul 2014 22:12:07 +0800 Subject: [PATCH 07/57] liuGUI->libui for windows --- build/cocos2d-win32.vc2012.sln | 15 ++++++--------- .../cocostudio/proj.win32/libCocosStudio.vcxproj | 2 +- .../proj.win32/{libGUI.vcxproj => libui.vcxproj} | 2 +- ...bGUI.vcxproj.filters => libui.vcxproj.filters} | 0 .../{libGUI.vcxproj.user => libui.vcxproj.user} | 0 tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 6 +++--- .../project/proj.win32/lua-empty-test.vcxproj | 6 +++--- .../project/proj.win32/lua-tests.win32.vcxproj | 6 +++--- 8 files changed, 17 insertions(+), 20 deletions(-) rename cocos/ui/proj.win32/{libGUI.vcxproj => libui.vcxproj} (99%) rename cocos/ui/proj.win32/{libGUI.vcxproj.filters => libui.vcxproj.filters} (100%) rename cocos/ui/proj.win32/{libGUI.vcxproj.user => libui.vcxproj.user} (100%) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 3d893c7866..1966f8d09f 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -19,11 +19,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scriptin EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-tests", "..\tests\lua-tests\project\proj.win32\lua-tests.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\cocos\ui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" - ProjectSection(ProjectDependencies) = postProject - {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\cpp-empty-test\proj.win32\cpp-empty-test.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-empty-test", "..\tests\lua-empty-test\project\proj.win32\lua-empty-test.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" @@ -34,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\l EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\cocos\audio\proj.win32\libcocosdenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\cocos\ui\proj.win32\libui.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -76,10 +73,6 @@ Global {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32 {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32 {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.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 {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.ActiveCfg = Debug|Win32 {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.Build.0 = Debug|Win32 {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32 @@ -100,6 +93,10 @@ Global {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 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index 29471721e3..ddd8a32392 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -144,7 +144,7 @@ {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} diff --git a/cocos/ui/proj.win32/libGUI.vcxproj b/cocos/ui/proj.win32/libui.vcxproj similarity index 99% rename from cocos/ui/proj.win32/libGUI.vcxproj rename to cocos/ui/proj.win32/libui.vcxproj index 7516a1cf57..fa14bab3e5 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj +++ b/cocos/ui/proj.win32/libui.vcxproj @@ -73,7 +73,7 @@ {7E06E92C-537A-442B-9E4A-4761C84F8A1A} - libGUI + libui libui diff --git a/cocos/ui/proj.win32/libGUI.vcxproj.filters b/cocos/ui/proj.win32/libui.vcxproj.filters similarity index 100% rename from cocos/ui/proj.win32/libGUI.vcxproj.filters rename to cocos/ui/proj.win32/libui.vcxproj.filters diff --git a/cocos/ui/proj.win32/libGUI.vcxproj.user b/cocos/ui/proj.win32/libui.vcxproj.user similarity index 100% rename from cocos/ui/proj.win32/libGUI.vcxproj.user rename to cocos/ui/proj.win32/libui.vcxproj.user diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 1dc95b708f..74793e208a 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -573,12 +573,12 @@ {b7c2a162-dec9-4418-972e-240ab3cbfcae} - - {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - {df2638c0-8128-4847-867c-6eafe3dee7b5} + + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} + {21b2c324-891f-48ea-ad1a-5ae13de12e28} false 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 f29de529f2..bf5bddd30a 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 @@ -193,12 +193,12 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - - {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - {df2638c0-8128-4847-867c-6eafe3dee7b5} + + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} + {21b2c324-891f-48ea-ad1a-5ae13de12e28} 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 e3cc9db705..e13814efab 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -196,12 +196,12 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {b7c2a162-dec9-4418-972e-240ab3cbfcae} - - {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - {df2638c0-8128-4847-867c-6eafe3dee7b5} + + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} + {21b2c324-891f-48ea-ad1a-5ae13de12e28} From 3da15a7f9282deed4fbecdbe91a07a95b9425a7b Mon Sep 17 00:00:00 2001 From: shinriyo Date: Tue, 29 Jul 2014 00:37:55 +0900 Subject: [PATCH 08/57] typo function however it is not the dog. squirrel.... --- templates/lua-template-default/src/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/lua-template-default/src/main.lua b/templates/lua-template-default/src/main.lua index b33be1cbca..4b1e4d37c6 100644 --- a/templates/lua-template-default/src/main.lua +++ b/templates/lua-template-default/src/main.lua @@ -58,7 +58,7 @@ local function main() local origin = cc.Director:getInstance():getVisibleOrigin() -- add the moving dog - local function creatDog() + local function createDog() local frameWidth = 105 local frameHeight = 95 @@ -130,7 +130,7 @@ local function main() end -- add moving dog - local spriteDog = creatDog() + local spriteDog = createDog() layerFarm:addChild(spriteDog) -- handing touch events From bf287252dfd33d68d4658c44894bef574ec96a23 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 09:31:52 +0800 Subject: [PATCH 09/57] change libnetwork and libSpine --- cocos/editor-support/spine/proj.win32/libSpine.vcxproj | 2 +- .../proj.win32/{libNetwork.vcxproj => libnetwork.vcxproj} | 4 ++-- ...{libNetwork.vcxproj.filters => libnetwork.vcxproj.filters} | 0 .../{libNetwork.vcxproj.user => libnetwork.vcxproj.user} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename cocos/network/proj.win32/{libNetwork.vcxproj => libnetwork.vcxproj} (98%) rename cocos/network/proj.win32/{libNetwork.vcxproj.filters => libnetwork.vcxproj.filters} (100%) rename cocos/network/proj.win32/{libNetwork.vcxproj.user => libnetwork.vcxproj.user} (100%) diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj index ff57d458af..60941a0cb1 100644 --- a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj @@ -72,7 +72,7 @@ {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} - libSpine + libspine diff --git a/cocos/network/proj.win32/libNetwork.vcxproj b/cocos/network/proj.win32/libnetwork.vcxproj similarity index 98% rename from cocos/network/proj.win32/libNetwork.vcxproj rename to cocos/network/proj.win32/libnetwork.vcxproj index e78b616607..4716547e07 100644 --- a/cocos/network/proj.win32/libNetwork.vcxproj +++ b/cocos/network/proj.win32/libnetwork.vcxproj @@ -28,9 +28,9 @@ - libNetwork + libnetwork {DF2638C0-8128-4847-867C-6EAFE3DEE7B5} - network.win32 + libnetwork.win32 Win32Proj diff --git a/cocos/network/proj.win32/libNetwork.vcxproj.filters b/cocos/network/proj.win32/libnetwork.vcxproj.filters similarity index 100% rename from cocos/network/proj.win32/libNetwork.vcxproj.filters rename to cocos/network/proj.win32/libnetwork.vcxproj.filters diff --git a/cocos/network/proj.win32/libNetwork.vcxproj.user b/cocos/network/proj.win32/libnetwork.vcxproj.user similarity index 100% rename from cocos/network/proj.win32/libNetwork.vcxproj.user rename to cocos/network/proj.win32/libnetwork.vcxproj.user From eacf003eed3f765db20b268c6eb4ffff1ad2bc9d Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 10:07:46 +0800 Subject: [PATCH 10/57] change libExtensions for windows --- build/cocos2d-win32.vc2012.sln | 14 +++++++------- .../proj.win32/libCocosBuilder.vcxproj | 2 +- cocos/ui/proj.win32/libui.vcxproj | 2 +- ...{libExtensions.vcxproj => libextension.vcxproj} | 2 +- ...cxproj.filters => libextension.vcxproj.filters} | 0 ...ions.vcxproj.user => libextension.vcxproj.user} | 0 tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 3 +-- .../project/proj.win32/lua-empty-test.vcxproj | 2 +- .../project/proj.win32/lua-tests.win32.vcxproj | 2 +- 9 files changed, 13 insertions(+), 14 deletions(-) rename extensions/proj.win32/{libExtensions.vcxproj => libextension.vcxproj} (99%) rename extensions/proj.win32/{libExtensions.vcxproj.filters => libextension.vcxproj.filters} (100%) rename extensions/proj.win32/{libExtensions.vcxproj.user => libextension.vcxproj.user} (100%) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 1966f8d09f..bdc360a5a2 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -3,15 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" EndProject @@ -31,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\coco EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\cocos\ui\proj.win32\libui.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libextension.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -41,10 +41,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 - {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 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 @@ -97,6 +93,10 @@ Global {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 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj index eacfb65847..ffdfd9ff9a 100644 --- a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj +++ b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj @@ -146,7 +146,7 @@ - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} diff --git a/cocos/ui/proj.win32/libui.vcxproj b/cocos/ui/proj.win32/libui.vcxproj index fa14bab3e5..689fcf70d2 100644 --- a/cocos/ui/proj.win32/libui.vcxproj +++ b/cocos/ui/proj.win32/libui.vcxproj @@ -64,7 +64,7 @@ - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libextension.vcxproj similarity index 99% rename from extensions/proj.win32/libExtensions.vcxproj rename to extensions/proj.win32/libextension.vcxproj index af5c6a7710..ba58ce11f1 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libextension.vcxproj @@ -12,7 +12,7 @@ {21B2C324-891F-48EA-AD1A-5AE13DE12E28} - Extensions.win32 + libextension.win32 Win32Proj libextension diff --git a/extensions/proj.win32/libExtensions.vcxproj.filters b/extensions/proj.win32/libextension.vcxproj.filters similarity index 100% rename from extensions/proj.win32/libExtensions.vcxproj.filters rename to extensions/proj.win32/libextension.vcxproj.filters diff --git a/extensions/proj.win32/libExtensions.vcxproj.user b/extensions/proj.win32/libextension.vcxproj.user similarity index 100% rename from extensions/proj.win32/libExtensions.vcxproj.user rename to extensions/proj.win32/libextension.vcxproj.user diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 74793e208a..e83756b3ba 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -579,9 +579,8 @@ {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} - false {929480e7-23c0-4df6-8456-096d71547116} 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 bf5bddd30a..ced03150ca 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 @@ -199,7 +199,7 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} 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 e13814efab..0244ea9b9c 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -202,7 +202,7 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} From c63d64e3858bb63f1cd6cc7e64adca695d4f73b1 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Tue, 29 Jul 2014 10:48:20 +0800 Subject: [PATCH 11/57] set emission rate when setTotalParticles() --- cocos/2d/CCParticleSystemQuad.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 44f707a46f..3773ad668f 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -449,6 +449,10 @@ void ParticleSystemQuad::setTotalParticles(int tp) _totalParticles = tp; } + // fixed issue #5762 + // reset the emission rate + setEmissionRate(_totalParticles / _life); + resetSystem(); } From 6d0b8852d17ba8ef6d874da393819f65ee895f98 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 10:53:39 +0800 Subject: [PATCH 12/57] libSpine rename for windows --- build/cocos2d-win32.vc2012.sln | 12 ++++++------ tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 +- .../project/proj.win32/lua-empty-test.vcxproj | 2 +- .../project/proj.win32/lua-tests.win32.vcxproj | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index bdc360a5a2..f08315e355 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -11,8 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scripting\lua-bindings\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-tests", "..\tests\lua-tests\project\proj.win32\lua-tests.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" @@ -31,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\cocos\ui\proj.w EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libextension.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspine", "..\cocos\editor-support\spine\proj.win32\libspine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -57,10 +57,6 @@ Global {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 - {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 {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.ActiveCfg = Debug|Win32 {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.Build.0 = Debug|Win32 {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.ActiveCfg = Release|Win32 @@ -97,6 +93,10 @@ Global {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 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index e83756b3ba..d8b21f81e1 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -570,7 +570,7 @@ {b57cf53f-2e49-4031-9822-047cc0e6bde2} - + {b7c2a162-dec9-4418-972e-240ab3cbfcae} 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 ced03150ca..da8fdef82c 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 @@ -187,7 +187,7 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {b57cf53f-2e49-4031-9822-047cc0e6bde2} - + {b7c2a162-dec9-4418-972e-240ab3cbfcae} 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 0244ea9b9c..34338eea8b 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -184,6 +184,9 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {f8edd7fa-9a51-4e80-baeb-860825d2eac6} + + {b7c2a162-dec9-4418-972e-240ab3cbfcae} + {ddc3e27f-004d-4dd4-9dd3-931a013d2159} @@ -193,9 +196,6 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {b57cf53f-2e49-4031-9822-047cc0e6bde2} - - {b7c2a162-dec9-4418-972e-240ab3cbfcae} - {df2638c0-8128-4847-867c-6eafe3dee7b5} From e91fa0e9fcafb7f18d72a41a243aa97dd3a78732 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 11:09:02 +0800 Subject: [PATCH 13/57] libcocosbuilder rename for windows --- .../{libCocosBuilder.vcxproj => libcocosbuilder.vcxproj} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cocos/editor-support/cocosbuilder/proj.win32/{libCocosBuilder.vcxproj => libcocosbuilder.vcxproj} (100%) diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj similarity index 100% rename from cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj rename to cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj From d53ce4d6640ff95e0818cc2d687e12ec736e5be6 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 11:09:17 +0800 Subject: [PATCH 14/57] libcocosbuilder rename for windows --- build/cocos2d-win32.vc2012.sln | 12 ++++++------ tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 +- .../project/proj.win32/lua-empty-test.vcxproj | 2 +- .../project/proj.win32/lua-tests.win32.vcxproj | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index f08315e355..46ae732633 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -5,8 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" @@ -31,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensio EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspine", "..\cocos\editor-support\spine\proj.win32\libspine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosbuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libcocosbuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -45,10 +45,6 @@ Global {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.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 @@ -97,6 +93,10 @@ Global {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 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index d8b21f81e1..3683948b09 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -564,7 +564,7 @@ {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} 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 da8fdef82c..0e6c633a57 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 @@ -181,7 +181,7 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} 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 34338eea8b..cf30f93966 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -184,15 +184,15 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {f8edd7fa-9a51-4e80-baeb-860825d2eac6} + + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} + {b7c2a162-dec9-4418-972e-240ab3cbfcae} {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - {b57cf53f-2e49-4031-9822-047cc0e6bde2} From 1b6cda488a2334cdb0b98de798e7c42c22deac2b Mon Sep 17 00:00:00 2001 From: boyu0 Date: Tue, 29 Jul 2014 11:21:11 +0800 Subject: [PATCH 15/57] add ParticleResetTotalParticles test. --- .../Classes/ParticleTest/ParticleTest.cpp | 49 ++++++++++++++++++- .../Classes/ParticleTest/ParticleTest.h | 8 +++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index 5f3beb9d31..b12946a99c 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -1012,13 +1012,14 @@ Layer* createParticleLayer(int nIndex) case 46: return new Issue3990(); case 47: return new ParticleAutoBatching(); case 48: return new ParticleVisibleTest(); + case 49: return new ParticleResetTotalParticles(); default: break; } return nullptr; } -#define MAX_LAYER 49 +#define MAX_LAYER 50 Layer* nextParticleAction() @@ -2005,6 +2006,52 @@ std::string ParticleAutoBatching::subtitle() const return "All 10 particles should be drawin in one batch"; } + +// +// ParticleResetTotalParticles +// +void ParticleResetTotalParticles::onEnter() +{ + ParticleDemo::onEnter(); + + _color->setColor(Color3B::BLACK); + removeChild(_background, true); + _background = nullptr; + + auto p = ParticleFire::createWithTotalParticles(10); + this->addChild(p); + + auto add = MenuItemFont::create("add 10 particles", + [p](Ref*)->void + { + p->setTotalParticles(p->getTotalParticles() + 10 ); + }); + add->setPosition(Vec2(0, 25)); + auto remove = MenuItemFont::create("remove 10 particles", + [p](Ref*)->void + { + int count = p->getTotalParticles() - 10; + if (count < 0) { count = 0; } + p->setTotalParticles(count); + }); + remove->setPosition(Vec2(0, -25)); + + auto menu = Menu::create(add, remove, nullptr); + menu->setPosition(Vec2(VisibleRect::center())); + this->addChild(menu); + +} + +std::string ParticleResetTotalParticles::title() const +{ + return "reset total particles"; +} + +std::string ParticleResetTotalParticles::subtitle() const +{ + return "it should work as well"; +} + // // main // diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h index ba3adb9058..c18d00be62 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h @@ -328,4 +328,12 @@ public: virtual std::string subtitle() const override; }; +class ParticleResetTotalParticles : public ParticleDemo +{ +public: + virtual void onEnter() override; + virtual std::string title() const override; + virtual std::string subtitle() const override; +}; + #endif From c722c0fcd096fa44e6bf3c64737129e7abac5d41 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 11:31:37 +0800 Subject: [PATCH 16/57] libcocostudio for windows --- build/cocos2d-win32.vc2012.sln | 12 ++++++------ ...{libCocosStudio.vcxproj => libcocostudio.vcxproj} | 2 +- ...vcxproj.filters => libcocostudio.vcxproj.filters} | 0 ...tudio.vcxproj.user => libcocostudio.vcxproj.user} | 0 tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 +- .../project/proj.win32/lua-empty-test.vcxproj | 2 +- .../project/proj.win32/lua-tests.win32.vcxproj | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) rename cocos/editor-support/cocostudio/proj.win32/{libCocosStudio.vcxproj => libcocostudio.vcxproj} (99%) rename cocos/editor-support/cocostudio/proj.win32/{libCocosStudio.vcxproj.filters => libcocostudio.vcxproj.filters} (100%) rename cocos/editor-support/cocostudio/proj.win32/{libCocosStudio.vcxproj.user => libcocostudio.vcxproj.user} (100%) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 46ae732633..74d3130b20 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -5,8 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scripting\lua-bindings\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" @@ -31,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspine", "..\cocos\editor EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosbuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libcocosbuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\editor-support\cocostudio\proj.win32\libcocostudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -45,10 +45,6 @@ Global {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.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 {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 @@ -97,6 +93,10 @@ Global {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj similarity index 99% rename from cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj rename to cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj index ddd8a32392..4b77d77a26 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj @@ -150,7 +150,7 @@ {B57CF53F-2E49-4031-9822-047CC0E6BDE2} - libCocosStudio + libcocostudio libcocostudio diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters b/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj.filters similarity index 100% rename from cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters rename to cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj.filters diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.user b/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj.user similarity index 100% rename from cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.user rename to cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj.user diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 3683948b09..3fe5678a28 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -567,7 +567,7 @@ {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - + {b57cf53f-2e49-4031-9822-047cc0e6bde2} 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 0e6c633a57..234a4bee40 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 @@ -184,7 +184,7 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - + {b57cf53f-2e49-4031-9822-047cc0e6bde2} 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 cf30f93966..0e3fb6f8e3 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -187,15 +187,15 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {811c0dab-7b96-4bd3-a154-b7572b58e4ab} + + {b57cf53f-2e49-4031-9822-047cc0e6bde2} + {b7c2a162-dec9-4418-972e-240ab3cbfcae} {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - - {b57cf53f-2e49-4031-9822-047cc0e6bde2} - {df2638c0-8128-4847-867c-6eafe3dee7b5} From 21ea77fb6f4616c489da88b3d72f3aad0e7d2f48 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 29 Jul 2014 14:04:36 +0800 Subject: [PATCH 17/57] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 8b48f633e7..df58c668cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ cocos2d-x-3.3 ?? [FIX] Label: can not set charmap after it is created [FIX] Label: setTextColor does not have any effect on Mac OS X [FIX] ParticleSystem: effect is wrong if scene scaled + [FIX] ParticleSystemQuad: setTotalParticles() can't set a value larger than initialized value [FIX] Scale9Sprite: new added sprite will be hidden [FIX] UIListView: can not insert an item in specific position, it is added at bottom [FIX] TabelView: can handle touch event though its parents are invisible From 3d7cced94e55802c6657fa827a34bc14172c5c6c Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 29 Jul 2014 06:30:39 +0000 Subject: [PATCH 18/57] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 2b3e3a1eae..75cca60273 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -181,8 +181,6 @@ "cocos/2d/CCTweenFunction.h", "cocos/2d/CMakeLists.txt", "cocos/2d/cocos2d.def", - "cocos/2d/cocos2d.vcxproj", - "cocos/2d/cocos2d.vcxproj.filters", "cocos/2d/cocos2d_headers.props", "cocos/2d/cocos2d_winrt.props", "cocos/2d/cocos2d_winrt.vcxproj", @@ -192,6 +190,8 @@ "cocos/2d/cocos2d_wp8.vcxproj.filters", "cocos/2d/cocos2d_wp8_headers.props", "cocos/2d/cocos2dx.props", + "cocos/2d/libcocos2d.vcxproj", + "cocos/2d/libcocos2d.vcxproj.filters", "cocos/3d/CCAnimate3D.cpp", "cocos/3d/CCAnimate3D.h", "cocos/3d/CCAnimation3D.cpp", @@ -254,9 +254,9 @@ "cocos/audio/openal/OpenALDecoder.cpp", "cocos/audio/openal/OpenALDecoder.h", "cocos/audio/openal/SimpleAudioEngineOpenAL.cpp", - "cocos/audio/proj.win32/CocosDenshion.vcxproj", - "cocos/audio/proj.win32/CocosDenshion.vcxproj.filters", - "cocos/audio/proj.win32/CocosDenshion.vcxproj.user", + "cocos/audio/proj.win32/libcocosdenshion.vcxproj", + "cocos/audio/proj.win32/libcocosdenshion.vcxproj.filters", + "cocos/audio/proj.win32/libcocosdenshion.vcxproj.user", "cocos/audio/proj.wp8/CocosDenshion.vcxproj", "cocos/audio/proj.wp8/CocosDenshion.vcxproj.filters", "cocos/audio/proj.wp8/CocosDenshion.vcxproj.user", @@ -455,9 +455,9 @@ "cocos/editor-support/cocosbuilder/CCSpriteLoader.h", "cocos/editor-support/cocosbuilder/CMakeLists.txt", "cocos/editor-support/cocosbuilder/CocosBuilder.h", - "cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj", "cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj.filters", "cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj.user", + "cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj", "cocos/editor-support/cocosbuilder/proj.wp8/libCocosBuilder.vcxproj", "cocos/editor-support/cocosbuilder/proj.wp8/libCocosBuilder.vcxproj.filters", "cocos/editor-support/cocosbuilder/proj.wp8/libCocosBuilder.vcxproj.user", @@ -578,9 +578,9 @@ "cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp", "cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h", "cocos/editor-support/cocostudio/WidgetReader/WidgetReaderProtocol.h", - "cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj", - "cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters", - "cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.user", + "cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj", + "cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj.filters", + "cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj.user", "cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj", "cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj.filters", "cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj.user", @@ -687,9 +687,9 @@ "cocos/network/SocketIO.h", "cocos/network/WebSocket.cpp", "cocos/network/WebSocket.h", - "cocos/network/proj.win32/libNetwork.vcxproj", - "cocos/network/proj.win32/libNetwork.vcxproj.filters", - "cocos/network/proj.win32/libNetwork.vcxproj.user", + "cocos/network/proj.win32/libnetwork.vcxproj", + "cocos/network/proj.win32/libnetwork.vcxproj.filters", + "cocos/network/proj.win32/libnetwork.vcxproj.user", "cocos/network/proj.wp8/libNetwork.vcxproj", "cocos/network/proj.wp8/libNetwork.vcxproj.filters", "cocos/physics/CCPhysicsBody.cpp", @@ -1041,9 +1041,9 @@ "cocos/ui/UIVideoPlayerIOS.mm", "cocos/ui/UIWidget.cpp", "cocos/ui/UIWidget.h", - "cocos/ui/proj.win32/libGUI.vcxproj", - "cocos/ui/proj.win32/libGUI.vcxproj.filters", - "cocos/ui/proj.win32/libGUI.vcxproj.user", + "cocos/ui/proj.win32/libui.vcxproj", + "cocos/ui/proj.win32/libui.vcxproj.filters", + "cocos/ui/proj.win32/libui.vcxproj.user", "cocos/ui/proj.wp8/libGUI.vcxproj", "cocos/ui/proj.wp8/libGUI.vcxproj.filters", "docs/CODING_STYLE.md", @@ -1111,9 +1111,9 @@ "extensions/physics-nodes/CCPhysicsSprite.h", "extensions/proj.win32/Win32InputBox.cpp", "extensions/proj.win32/Win32InputBox.h", - "extensions/proj.win32/libExtensions.vcxproj", - "extensions/proj.win32/libExtensions.vcxproj.filters", - "extensions/proj.win32/libExtensions.vcxproj.user", + "extensions/proj.win32/libextension.vcxproj", + "extensions/proj.win32/libextension.vcxproj.filters", + "extensions/proj.win32/libextension.vcxproj.user", "extensions/proj.wp8/libExtensions.vcxproj", "extensions/proj.wp8/libExtensions.vcxproj.filters", "extensions/proj.wp8/pch.cpp", @@ -1213,8 +1213,8 @@ "external/Box2D/Dynamics/b2WorldCallbacks.h", "external/Box2D/Rope/b2Rope.cpp", "external/Box2D/Rope/b2Rope.h", - "external/Box2D/proj.win32/Box2D.vcxproj", - "external/Box2D/proj.win32/Box2D.vcxproj.filters", + "external/Box2D/proj.win32/libbox2d.vcxproj", + "external/Box2D/proj.win32/libbox2d.vcxproj.filters", "external/Box2D/proj.wp8/Box2D.vcxproj", "external/Box2D/proj.wp8/Box2D.vcxproj.filters", "external/ConvertUTF/ConvertUTF.c", From ea802580a2c700526c1e5665e45979d9aef05b55 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 15:02:34 +0800 Subject: [PATCH 19/57] add script to copy sqllite3.dll to output dir on windows --- cocos/2d/libcocos2d.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index a80983576c..9556b9f757 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -103,6 +103,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\websockets\prebuilt\win32\*.*" "$(OutDi xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\zlib\prebuilt\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\icon\prebuilt\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)" From bca92772dda63a98a2d61cb051bd622cd94f7759 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 15:23:07 +0800 Subject: [PATCH 20/57] remove unused windows localstorage project file --- .../proj.win32/libLocalStorage.vcxproj | 103 ------------------ .../libLocalStorage.vcxproj.filters | 21 ---- .../proj.win32/libLocalStorage.vcxproj.user | 4 - 3 files changed, 128 deletions(-) delete mode 100644 cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj delete mode 100644 cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters delete mode 100644 cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.user diff --git a/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj b/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj deleted file mode 100644 index 2f37b0f0fd..0000000000 --- a/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - {632A8F38-D0F0-4D22-86B3-D69F5E6BF63A} - libLocalStorage - - - - StaticLibrary - true - v100 - v110 - v110_xp - v120 - v120_xp - Unicode - - - StaticLibrary - false - v100 - v110 - v110_xp - v120 - v120_xp - true - Unicode - - - - - - - - - - - - - - - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - - - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - - - - Level3 - Disabled - - - $(EngineRoot)external\sqlite3\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - 4267;4251;4244;%(DisableSpecificWarnings) - false - - - true - - - - - Level3 - MinSpace - true - true - - - $(EngineRoot)external\sqlite3\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - None - false - - - true - true - true - - - - - - \ No newline at end of file diff --git a/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters b/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters deleted file mode 100644 index b23d606b74..0000000000 --- a/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {0310200c-b520-4f77-85f6-46f568b10f4d} - - - {69cfa37c-4b20-409e-ad74-a26314878d8a} - - - - - Source Files - - - - - Header Files - - - \ No newline at end of file diff --git a/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.user b/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.user deleted file mode 100644 index a375ae3527..0000000000 --- a/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From cfe7e57561b7c68b34d71cc666479104744d7bff Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 15:48:12 +0800 Subject: [PATCH 21/57] fix binding generator can nott regonize unsigned long arguments --- cocos/scripting/lua-bindings/manual/LuaBasicConversions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 8c200a4bd9..951dc8feb9 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -47,6 +47,7 @@ cocos2d::log(__VA_ARGS__); \ extern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def); // to native +extern bool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue, const char* funcName); extern bool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue, const char* funcName = ""); extern bool luaval_to_int32(lua_State* L,int lo,int* outValue, const char* funcName = ""); extern bool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue, const char* funcName = ""); From 98ef180ca8b386385373e8eaf9c7bf7d8424db90 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 15:59:49 +0800 Subject: [PATCH 22/57] add default value to luaval_to_ulong --- cocos/scripting/lua-bindings/manual/LuaBasicConversions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 951dc8feb9..0f3db745eb 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -47,7 +47,7 @@ cocos2d::log(__VA_ARGS__); \ extern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def); // to native -extern bool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue, const char* funcName); +extern bool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue, const char* funcName=""); extern bool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue, const char* funcName = ""); extern bool luaval_to_int32(lua_State* L,int lo,int* outValue, const char* funcName = ""); extern bool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue, const char* funcName = ""); From a743590ac5df273bd3533e564e5c06b4284d1153 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 29 Jul 2014 08:09:10 +0000 Subject: [PATCH 23/57] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 75cca60273..9c26b3c877 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -981,9 +981,6 @@ "cocos/storage/local-storage/LocalStorage.cpp", "cocos/storage/local-storage/LocalStorage.h", "cocos/storage/local-storage/LocalStorageAndroid.cpp", - "cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj", - "cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters", - "cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.user", "cocos/storage/local-storage/proj.wp8/libLocalStorage.vcxproj", "cocos/storage/local-storage/proj.wp8/libLocalStorage.vcxproj.filters", "cocos/ui/Android.mk", From 32ed796657117bdb85e6efb994f11f016ff3383f Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 10:26:53 +0800 Subject: [PATCH 24/57] add UIScale9Sprite --- build/cocos2d_libs.xcodeproj/project.pbxproj | 12 ++++++++ cocos/ui/UIScale9Sprite.cpp | 25 ++++++++++++++++ cocos/ui/UIScale9Sprite.h | 30 ++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 cocos/ui/UIScale9Sprite.cpp create mode 100644 cocos/ui/UIScale9Sprite.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index e0e6014740..015274b795 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -553,6 +553,10 @@ 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 */; }; + 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 */; }; + 2958244E19873D8E00F9746D /* UIScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 2958244A19873D8E00F9746D /* UIScale9Sprite.h */; }; 2986667F18B1B246000E39CA /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2986667818B1B079000E39CA /* CCTweenFunction.cpp */; }; 299754F4193EC95400A54AC3 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */; }; 299754F5193EC95400A54AC3 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */; }; @@ -2329,6 +2333,8 @@ 2905FA1318CF08D100240AA3 /* UIWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidget.cpp; sourceTree = ""; }; 2905FA1418CF08D100240AA3 /* UIWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidget.h; sourceTree = ""; }; 29080DEB191B82CE0066F8DF /* UIDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIDeprecated.h; sourceTree = ""; }; + 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScale9Sprite.cpp; sourceTree = ""; }; + 2958244A19873D8E00F9746D /* UIScale9Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScale9Sprite.h; sourceTree = ""; }; 2986667818B1B079000E39CA /* CCTweenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = ""; }; 2986667918B1B079000E39CA /* CCTweenFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = ""; }; 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectFactory.cpp; path = ../base/ObjectFactory.cpp; sourceTree = ""; }; @@ -4247,6 +4253,8 @@ 2905F9F318CF08D000240AA3 /* UICheckBox.h */, 2905F9F618CF08D000240AA3 /* UIImageView.cpp */, 2905F9F718CF08D000240AA3 /* UIImageView.h */, + 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */, + 2958244A19873D8E00F9746D /* UIScale9Sprite.h */, ); name = widgets; sourceTree = ""; @@ -5853,6 +5861,7 @@ B2DB4767197664EE00411E16 /* CCProtectedNode.h in Headers */, B2DB47861976662D00411E16 /* UILoadingBar.h in Headers */, B2DB47681976650A00411E16 /* UIWidget.h in Headers */, + 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */, B2DB47691976651E00411E16 /* UIHBox.h in Headers */, B2DB478F1976666100411E16 /* UIText.h in Headers */, B2DB47901976666100411E16 /* UITextAtlas.h in Headers */, @@ -5897,6 +5906,7 @@ B2C59A4719777ECF00B452DF /* UIHBox.h in Headers */, B2C59A4819777ECF00B452DF /* UIRelativeBox.h in Headers */, B2C59A4919777ECF00B452DF /* UIVBox.h in Headers */, + 2958244E19873D8E00F9746D /* UIScale9Sprite.h in Headers */, B2C59A4A19777ECF00B452DF /* UILayout.h in Headers */, B2C59A4B19777ECF00B452DF /* UILayoutParameter.h in Headers */, B2C59A4C19777ECF00B452DF /* UILayoutManager.h in Headers */, @@ -7248,6 +7258,7 @@ B2DB47711976657A00411E16 /* UIVBox.cpp in Sources */, B2DB47731976658E00411E16 /* CocosGUI.cpp in Sources */, B2DB4775197665A500411E16 /* UIDeprecated.cpp in Sources */, + 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */, B2DB47891976664200411E16 /* UISlider.cpp in Sources */, B2DB4779197665CD00411E16 /* UIListView.cpp in Sources */, B2DB47851976662B00411E16 /* UILoadingBar.cpp in Sources */, @@ -7268,6 +7279,7 @@ buildActionMask = 2147483647; files = ( B2C59A1C19777E7500B452DF /* UIListView.cpp in Sources */, + 2958244C19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */, B2C59A1D19777E7500B452DF /* UILoadingBar.cpp in Sources */, B2C59A1E19777E7500B452DF /* UIPageView.cpp in Sources */, B2C59A1F19777E7500B452DF /* UIRichText.cpp in Sources */, diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp new file mode 100644 index 0000000000..9489f4a8a3 --- /dev/null +++ b/cocos/ui/UIScale9Sprite.cpp @@ -0,0 +1,25 @@ +/**************************************************************************** + 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 "UIScale9Sprite.h" diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h new file mode 100644 index 0000000000..0b5fc46703 --- /dev/null +++ b/cocos/ui/UIScale9Sprite.h @@ -0,0 +1,30 @@ +/**************************************************************************** + 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 __cocos2d_libs__UIScale9Sprite__ +#define __cocos2d_libs__UIScale9Sprite__ + +#include + +#endif /* defined(__cocos2d_libs__UIScale9Sprite__) */ From 717f20571bc7bd3a649fe4a86dfdb6d87e3f33f0 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 10:39:38 +0800 Subject: [PATCH 25/57] add UIScale9Sprite implementation --- build/cocos2d_libs.xcodeproj/project.pbxproj | 4 +- cocos/ui/UIScale9Sprite.cpp | 918 +++++++++++++++++++ cocos/ui/UIScale9Sprite.h | 343 ++++++- 3 files changed, 1262 insertions(+), 3 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 015274b795..d19c499053 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -4202,6 +4202,8 @@ 29CB8F511929D64500C841D6 /* base */ = { isa = PBXGroup; children = ( + 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */, + 2958244A19873D8E00F9746D /* UIScale9Sprite.h */, 29080DEB191B82CE0066F8DF /* UIDeprecated.h */, 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */, 2905FA1318CF08D100240AA3 /* UIWidget.cpp */, @@ -4253,8 +4255,6 @@ 2905F9F318CF08D000240AA3 /* UICheckBox.h */, 2905F9F618CF08D000240AA3 /* UIImageView.cpp */, 2905F9F718CF08D000240AA3 /* UIImageView.h */, - 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */, - 2958244A19873D8E00F9746D /* UIScale9Sprite.h */, ); name = widgets; sourceTree = ""; diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 9489f4a8a3..97ac0326b8 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -23,3 +23,921 @@ ****************************************************************************/ #include "UIScale9Sprite.h" +#include "2d/CCSprite.h" +#include "2d/CCSpriteFrameCache.h" +#include "base/CCVector.h" +#include "base/CCDirector.h" + +NS_CC_BEGIN +namespace ui { + + Scale9Sprite::Scale9Sprite() + : _spritesGenerated(false) + , _spriteFrameRotated(false) + , _positionsAreDirty(false) + , _scale9Image(nullptr) + , _topLeft(nullptr) + , _top(nullptr) + , _topRight(nullptr) + , _left(nullptr) + , _centre(nullptr) + , _right(nullptr) + , _bottomLeft(nullptr) + , _bottom(nullptr) + , _bottomRight(nullptr) + , _insetLeft(0) + , _insetTop(0) + , _insetRight(0) + , _insetBottom(0), + _scale9Enabled(true) + { + this->setAnchorPoint(Vec2(0.5,0.5)); + } + + Scale9Sprite::~Scale9Sprite() + { + this->cleanupSlicedSprites(); + CC_SAFE_RELEASE(_scale9Image); + } + + void Scale9Sprite::cleanupSlicedSprites() + { + CC_SAFE_RELEASE(_topLeft); + CC_SAFE_RELEASE(_top); + CC_SAFE_RELEASE(_topRight); + CC_SAFE_RELEASE(_left); + CC_SAFE_RELEASE(_centre); + CC_SAFE_RELEASE(_right); + CC_SAFE_RELEASE(_bottomLeft); + CC_SAFE_RELEASE(_bottom); + CC_SAFE_RELEASE(_bottomRight); + } + + bool Scale9Sprite::init() + { + return this->init(NULL, Rect::ZERO, Rect::ZERO); + } + + bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, const Rect& capInsets) + { + return this->init(sprite, rect, false, capInsets); + } + + bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets) + { + if(sprite) + { + this->updateWithSprite(sprite, rect, rotated, capInsets); + } + this->setCascadeColorEnabled(true); + this->setCascadeOpacityEnabled(true); + this->setAnchorPoint(Vec2(0.5f, 0.5f)); + this->_positionsAreDirty = true; + + return true; + } + +#define TRANSLATE_X(x, y, xtranslate) \ +x+=xtranslate; \ + +#define TRANSLATE_Y(x, y, ytranslate) \ +y+=ytranslate; \ + + bool Scale9Sprite::updateWithSprite(Sprite* sprite, const Rect& originalRect, bool rotated, const Rect& capInsets) + { + GLubyte opacity = getOpacity(); + Color3B color = getColor(); + Rect rect(originalRect); + + // Release old sprites + _protectedChildren.clear(); + + this->cleanupSlicedSprites(); + + + if(this->_scale9Image != sprite) + { + CC_SAFE_RELEASE(this->_scale9Image); + _scale9Image = sprite; + CC_SAFE_RETAIN(_scale9Image); + } + + if (!_scale9Image) + { + return false; + } + + _capInsets = capInsets; + _spriteFrameRotated = rotated; + + // If there is no given rect + if ( rect.equals(Rect::ZERO) ) + { + // Get the texture size as original + Size textureSize = _scale9Image->getTexture()->getContentSize(); + + rect = Rect(0, 0, textureSize.width, textureSize.height); + } + + // Set the given rect's size as original size + _spriteRect = rect; + _originalSize = rect.size; + _preferredSize = _originalSize; + _capInsetsInternal = capInsets; + + + this->createSlicedSprites(rect, rotated); + + this->setContentSize(rect.size); + + if (_spritesGenerated) + { + // Restore color and opacity + this->setOpacity(opacity); + this->setColor(color); + } + _spritesGenerated = true; + + return true; + } + + void Scale9Sprite::createSlicedSprites(const Rect& rect, bool rotated) + { + float w = rect.size.width; + float h = rect.size.height; + + // If there is no specified center region + if ( _capInsetsInternal.equals(Rect::ZERO) ) + { + // log("... cap insets not specified : using default cap insets ..."); + _capInsetsInternal = Rect(w/3, h/3, w/3, h/3); + } + + float left_w = _capInsetsInternal.origin.x; + float center_w = _capInsetsInternal.size.width; + float right_w = rect.size.width - (left_w + center_w); + + float top_h = _capInsetsInternal.origin.y; + float center_h = _capInsetsInternal.size.height; + float bottom_h = rect.size.height - (top_h + center_h); + + // calculate rects + + // ... top row + float x = 0.0; + float y = 0.0; + + // top left + Rect lefttopbounds = Rect(x, y, left_w, top_h); + + // top center + TRANSLATE_X(x, y, left_w); + Rect centertopbounds = Rect(x, y, center_w, top_h); + + // top right + TRANSLATE_X(x, y, center_w); + Rect righttopbounds = Rect(x, y, right_w, top_h); + + // ... center row + x = 0.0; + y = 0.0; + TRANSLATE_Y(x, y, top_h); + + // center left + Rect leftcenterbounds = Rect(x, y, left_w, center_h); + + // center center + TRANSLATE_X(x, y, left_w); + Rect centerbounds = Rect(x, y, center_w, center_h); + + // center right + TRANSLATE_X(x, y, center_w); + Rect rightcenterbounds = Rect(x, y, right_w, center_h); + + // ... bottom row + x = 0.0; + y = 0.0; + TRANSLATE_Y(x, y, top_h); + TRANSLATE_Y(x, y, center_h); + + // bottom left + Rect leftbottombounds = Rect(x, y, left_w, bottom_h); + + // bottom center + TRANSLATE_X(x, y, left_w); + Rect centerbottombounds = Rect(x, y, center_w, bottom_h); + + // bottom right + TRANSLATE_X(x, y, center_w); + Rect rightbottombounds = Rect(x, y, right_w, bottom_h); + + + Rect rotatedcenterbounds = centerbounds; + Rect rotatedrightbottombounds = rightbottombounds; + Rect rotatedleftbottombounds = leftbottombounds; + Rect rotatedrighttopbounds = righttopbounds; + Rect rotatedlefttopbounds = lefttopbounds; + Rect rotatedrightcenterbounds = rightcenterbounds; + Rect rotatedleftcenterbounds = leftcenterbounds; + Rect rotatedcenterbottombounds = centerbottombounds; + Rect rotatedcentertopbounds = centertopbounds; + + if (!rotated) { + // log("!rotated"); + + AffineTransform t = AffineTransform::IDENTITY; + t = AffineTransformTranslate(t, rect.origin.x, rect.origin.y); + + rotatedcenterbounds = RectApplyAffineTransform(rotatedcenterbounds, t); + rotatedrightbottombounds = RectApplyAffineTransform(rotatedrightbottombounds, t); + rotatedleftbottombounds = RectApplyAffineTransform(rotatedleftbottombounds, t); + rotatedrighttopbounds = RectApplyAffineTransform(rotatedrighttopbounds, t); + rotatedlefttopbounds = RectApplyAffineTransform(rotatedlefttopbounds, t); + rotatedrightcenterbounds = RectApplyAffineTransform(rotatedrightcenterbounds, t); + rotatedleftcenterbounds = RectApplyAffineTransform(rotatedleftcenterbounds, t); + rotatedcenterbottombounds = RectApplyAffineTransform(rotatedcenterbottombounds, t); + rotatedcentertopbounds = RectApplyAffineTransform(rotatedcentertopbounds, t); + + + } else { + // set up transformation of coordinates + // to handle the case where the sprite is stored rotated + // in the spritesheet + // log("rotated"); + + AffineTransform t = AffineTransform::IDENTITY; + + t = AffineTransformTranslate(t, rect.size.height+rect.origin.x, rect.origin.y); + t = AffineTransformRotate(t, 1.57079633f); + + centerbounds = RectApplyAffineTransform(centerbounds, t); + rightbottombounds = RectApplyAffineTransform(rightbottombounds, t); + leftbottombounds = RectApplyAffineTransform(leftbottombounds, t); + righttopbounds = RectApplyAffineTransform(righttopbounds, t); + lefttopbounds = RectApplyAffineTransform(lefttopbounds, t); + rightcenterbounds = RectApplyAffineTransform(rightcenterbounds, t); + leftcenterbounds = RectApplyAffineTransform(leftcenterbounds, t); + centerbottombounds = RectApplyAffineTransform(centerbottombounds, t); + centertopbounds = RectApplyAffineTransform(centertopbounds, t); + + rotatedcenterbounds.origin = centerbounds.origin; + rotatedrightbottombounds.origin = rightbottombounds.origin; + rotatedleftbottombounds.origin = leftbottombounds.origin; + rotatedrighttopbounds.origin = righttopbounds.origin; + rotatedlefttopbounds.origin = lefttopbounds.origin; + rotatedrightcenterbounds.origin = rightcenterbounds.origin; + rotatedleftcenterbounds.origin = leftcenterbounds.origin; + rotatedcenterbottombounds.origin = centerbottombounds.origin; + rotatedcentertopbounds.origin = centertopbounds.origin; + + + } + + + // Centre + _centre = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbounds, rotated); + _centre->retain(); + this->addProtectedChild(_centre); + + + // Top + _top = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcentertopbounds, rotated); + _top->retain(); + this->addProtectedChild(_top); + + // Bottom + _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbottombounds, rotated); + _bottom->retain(); + this->addProtectedChild(_bottom); + + // Left + _left = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftcenterbounds, rotated); + _left->retain(); + this->addProtectedChild(_left); + + // Right + _right = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightcenterbounds, rotated); + _right->retain(); + this->addProtectedChild(_right); + + // Top left + _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedlefttopbounds, rotated); + _topLeft->retain(); + this->addProtectedChild(_topLeft); + + // Top right + _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrighttopbounds, rotated); + _topRight->retain(); + this->addProtectedChild(_topRight); + + // Bottom left + _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftbottombounds, rotated); + _bottomLeft->retain(); + this->addProtectedChild(_bottomLeft); + + // Bottom right + _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightbottombounds, rotated); + _bottomRight->retain(); + this->addProtectedChild(_bottomRight); + } + + void Scale9Sprite::setContentSize(const Size &size) + { + Node::setContentSize(size); + this->_positionsAreDirty = true; + } + + void Scale9Sprite::updatePositions() + { + // Check that instances are non-NULL + if(!((_topLeft) && + (_topRight) && + (_bottomRight) && + (_bottomLeft) && + (_centre))) { + // if any of the above sprites are NULL, return + return; + } + + Size size = this->_contentSize; + + float sizableWidth = size.width - _topLeft->getContentSize().width - _topRight->getContentSize().width; + float sizableHeight = size.height - _topLeft->getContentSize().height - _bottomRight->getContentSize().height; + + float horizontalScale = sizableWidth/_centre->getContentSize().width; + float verticalScale = sizableHeight/_centre->getContentSize().height; + + _centre->setScaleX(horizontalScale); + _centre->setScaleY(verticalScale); + + float rescaledWidth = _centre->getContentSize().width * horizontalScale; + float rescaledHeight = _centre->getContentSize().height * verticalScale; + + float leftWidth = _bottomLeft->getContentSize().width; + float bottomHeight = _bottomLeft->getContentSize().height; + + _bottomLeft->setAnchorPoint(Vec2(0,0)); + _bottomRight->setAnchorPoint(Vec2(0,0)); + _topLeft->setAnchorPoint(Vec2(0,0)); + _topRight->setAnchorPoint(Vec2(0,0)); + _left->setAnchorPoint(Vec2(0,0)); + _right->setAnchorPoint(Vec2(0,0)); + _top->setAnchorPoint(Vec2(0,0)); + _bottom->setAnchorPoint(Vec2(0,0)); + _centre->setAnchorPoint(Vec2(0,0)); + + // Position corners + _bottomLeft->setPosition(Vec2(0,0)); + _bottomRight->setPosition(Vec2(leftWidth+rescaledWidth,0)); + _topLeft->setPosition(Vec2(0, bottomHeight+rescaledHeight)); + _topRight->setPosition(Vec2(leftWidth+rescaledWidth, bottomHeight+rescaledHeight)); + + // Scale and position borders + _left->setPosition(Vec2(0, bottomHeight)); + _left->setScaleY(verticalScale); + _right->setPosition(Vec2(leftWidth+rescaledWidth,bottomHeight)); + _right->setScaleY(verticalScale); + _bottom->setPosition(Vec2(leftWidth,0)); + _bottom->setScaleX(horizontalScale); + _top->setPosition(Vec2(leftWidth,bottomHeight+rescaledHeight)); + _top->setScaleX(horizontalScale); + + // Position centre + _centre->setPosition(Vec2(leftWidth, bottomHeight)); + } + + bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect, const Rect& capInsets) + { + Sprite *sprite = Sprite::create(file); + bool pReturn = this->init(sprite, rect, capInsets); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect, const Rect& capInsets) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(file, rect, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect) + { + bool pReturn = this->initWithFile(file, rect, Rect::ZERO); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(file, rect) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + + bool Scale9Sprite::initWithFile(const Rect& capInsets, const std::string& file) + { + bool pReturn = this->initWithFile(file, Rect::ZERO, capInsets); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& file) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(capInsets, file) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + bool Scale9Sprite::initWithFile(const std::string& file) + { + bool pReturn = this->initWithFile(file, Rect::ZERO); + return pReturn; + + } + + Scale9Sprite* Scale9Sprite::create(const std::string& file) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(file) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) + { + Texture2D* texture = spriteFrame->getTexture(); + CCASSERT(texture != NULL, "CCTexture must be not nil"); + + Sprite *sprite = Sprite::createWithSpriteFrame(spriteFrame); + CCASSERT(sprite != NULL, "sprite must be not nil"); + + bool pReturn = this->init(sprite, spriteFrame->getRect(), spriteFrame->isRotated(), capInsets); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) + { + CCASSERT(spriteFrame != NULL, "Invalid spriteFrame for sprite"); + bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) + { + CCASSERT((SpriteFrameCache::getInstance()) != NULL, "SpriteFrameCache::getInstance() must be non-NULL"); + + SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); + CCASSERT(frame != NULL, "CCSpriteFrame must be non-NULL"); + + if (NULL == frame) return false; + + bool pReturn = this->initWithSpriteFrame(frame, capInsets); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) + { + bool pReturn = this->initWithSpriteFrameName(spriteFrameName, Rect::ZERO); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + + log("Could not allocate Scale9Sprite()"); + return NULL; + + } + + Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) + { + Scale9Sprite* pReturn = new Scale9Sprite(); + if ( pReturn && pReturn->init(_scale9Image, _spriteRect, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + Scale9Sprite* Scale9Sprite::create() + { + Scale9Sprite *pReturn = new Scale9Sprite(); + if (pReturn && pReturn->init()) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + /** sets the opacity. + @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. + Values goes from 0 to 255, where 255 means fully opaque. + */ + + + + void Scale9Sprite::updateCapInset() + { + Rect insets; + if (this->_insetLeft == 0 && this->_insetTop == 0 && this->_insetRight == 0 && this->_insetBottom == 0) + { + insets = Rect::ZERO; + } + else + { + insets = Rect(_insetLeft, + _insetTop, + _spriteRect.size.width-_insetLeft-_insetRight, + _spriteRect.size.height-_insetTop-_insetBottom); + } + this->setCapInsets(insets); + } + + + void Scale9Sprite::setSpriteFrame(SpriteFrame * spriteFrame) + { + Sprite * sprite = Sprite::createWithTexture(spriteFrame->getTexture()); + this->updateWithSprite(sprite, spriteFrame->getRect(), spriteFrame->isRotated(), Rect::ZERO); + + // Reset insets + this->_insetLeft = 0; + this->_insetTop = 0; + this->_insetRight = 0; + this->_insetBottom = 0; + } + + void Scale9Sprite::setPreferredSize(const Size& preferedSize) + { + this->setContentSize(preferedSize); + this->_preferredSize = preferedSize; + } + + + void Scale9Sprite::setCapInsets(const Rect& capInsets) + { + Size contentSize = this->_contentSize; + this->updateWithSprite(this->_scale9Image, this->_spriteRect, _spriteFrameRotated, capInsets); + this->setContentSize(contentSize); + } + + + void Scale9Sprite::setInsetLeft(float insetLeft) + { + this->_insetLeft = insetLeft; + this->updateCapInset(); + } + + void Scale9Sprite::setInsetTop(float insetTop) + { + this->_insetTop = insetTop; + this->updateCapInset(); + } + + void Scale9Sprite::setInsetRight(float insetRight) + { + this->_insetRight = insetRight; + this->updateCapInset(); + } + + void Scale9Sprite::setInsetBottom(float insetBottom) + { + this->_insetBottom = insetBottom; + this->updateCapInset(); + } + + void Scale9Sprite::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) + { + + // quick return if not visible. children won't be drawn. + if (!_visible) + { + return; + } + + uint32_t flags = processParentFlags(parentTransform, parentFlags); + + // IMPORTANT: + // To ease the migration to v3.0, we still support the Mat4 stack, + // but it is deprecated and your code should not rely on it + Director* director = Director::getInstance(); + CCASSERT(nullptr != director, "Director is null when seting matrix stack"); + director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); + + int i = 0; // used by _children + int j = 0; // used by _protectedChildren + + sortAllChildren(); + sortAllProtectedChildren(); + + // + // draw children and protectedChildren zOrder < 0 + // + for( ; i < _children.size(); i++ ) + { + auto node = _children.at(i); + + if ( node && node->getLocalZOrder() < 0 ) + node->visit(renderer, _modelViewTransform, flags); + else + break; + } + if (_scale9Enabled) { + for( ; j < _protectedChildren.size(); j++ ) + { + auto node = _protectedChildren.at(j); + + if ( node && node->getLocalZOrder() < 0 ) + node->visit(renderer, _modelViewTransform, flags); + else + break; + } + }else{ + if (_scale9Image) { + _scale9Image->visit(renderer, _modelViewTransform, flags); + } + } + + + + + + // + // draw self + // + this->draw(renderer, _modelViewTransform, flags); + + // + // draw children and protectedChildren zOrder >= 0 + // + if (_scale9Enabled) { + for(auto it=_protectedChildren.cbegin()+j; it != _protectedChildren.cend(); ++it) + (*it)->visit(renderer, _modelViewTransform, flags); + }else{ + if (_scale9Image) { + _scale9Image->visit(renderer, _modelViewTransform, flags); + } + } + + + + for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) + (*it)->visit(renderer, _modelViewTransform, flags); + + // reset for next frame + _orderOfArrival = 0; + + director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + + } + + Size Scale9Sprite::getOriginalSize()const + { + return _originalSize; + } + + + Size Scale9Sprite::getPreferredSize() const + { + return _preferredSize; + } + + Rect Scale9Sprite::getCapInsets()const + { + return _capInsets; + } + + + float Scale9Sprite::getInsetLeft()const + { + return this->_insetLeft; + } + + float Scale9Sprite::getInsetTop()const + { + return this->_insetTop; + } + + float Scale9Sprite::getInsetRight()const + { + return this->_insetRight; + } + + float Scale9Sprite::getInsetBottom()const + { + return this->_insetBottom; + } + + void Scale9Sprite::setScale9Enabled(bool enabled) + { + _scale9Enabled = enabled; + _reorderProtectedChildDirty = true; + } + + bool Scale9Sprite::getScale9Enabled() const + { + return _scale9Enabled; + } + + void Scale9Sprite::addProtectedChild(cocos2d::Node *child) + { + _reorderProtectedChildDirty = true; + _protectedChildren.pushBack(child); + } + + void Scale9Sprite::sortAllProtectedChildren() + { + if(this->_positionsAreDirty) + { + this->updatePositions(); + this->_positionsAreDirty = false; + } + if( _reorderProtectedChildDirty ) { + if (!_scale9Enabled) { + this->adjustScale9ImagePosition(); + } + std::sort( std::begin(_protectedChildren), std::end(_protectedChildren), nodeComparisonLess ); + _reorderProtectedChildDirty = false; + } + } + + void Scale9Sprite::adjustScale9ImagePosition() + { + if (_scale9Image) { + _scale9Image->setPosition(_scale9Image->getPosition() + Vec2(_originalSize.width/2, _originalSize.height/2)); + } + } + + void Scale9Sprite::cleanup() + { + Node::cleanup(); + // timers + for( const auto &child: _protectedChildren) + child->cleanup(); + } + + void Scale9Sprite::onEnter() + { +#if CC_ENABLE_SCRIPT_BINDING + if (_scriptType == kScriptTypeJavascript) + { + if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) + return; + } +#endif + Node::onEnter(); + for( const auto &child: _protectedChildren) + child->onEnter(); + } + + void Scale9Sprite::onExit() + { + Node::onExit(); + for( const auto &child: _protectedChildren) + child->onExit(); + } + + void Scale9Sprite::onEnterTransitionDidFinish() + { + Node::onEnterTransitionDidFinish(); + for( const auto &child: _protectedChildren) + child->onEnterTransitionDidFinish(); + } + + void Scale9Sprite::onExitTransitionDidStart() + { + Node::onExitTransitionDidStart(); + for( const auto &child: _protectedChildren) + child->onExitTransitionDidStart(); + } + + void Scale9Sprite::updateDisplayedColor(const cocos2d::Color3B &parentColor) + { + _displayedColor.r = _realColor.r * parentColor.r/255.0; + _displayedColor.g = _realColor.g * parentColor.g/255.0; + _displayedColor.b = _realColor.b * parentColor.b/255.0; + updateColor(); + + if (_scale9Image) { + _scale9Image->updateDisplayedColor(_displayedColor); + } + + for(const auto &child : _protectedChildren){ + child->updateDisplayedColor(_displayedColor); + } + + if (_cascadeColorEnabled) + { + for(const auto &child : _children){ + child->updateDisplayedColor(_displayedColor); + } + + + } + } + + void Scale9Sprite::updateDisplayedOpacity(GLubyte parentOpacity) + { + _displayedOpacity = _realOpacity * parentOpacity/255.0; + updateColor(); + + if (_scale9Image) { + _scale9Image->updateDisplayedOpacity(_displayedOpacity); + } + + for(auto child : _protectedChildren){ + child->updateDisplayedOpacity(_displayedOpacity); + } + + if (_cascadeOpacityEnabled) + { + for(auto child : _children){ + child->updateDisplayedOpacity(_displayedOpacity); + } + + + } + } + + void Scale9Sprite::disableCascadeColor() + { + for(auto child : _children){ + child->updateDisplayedColor(Color3B::WHITE); + } + for(auto child : _protectedChildren){ + child->updateDisplayedColor(Color3B::WHITE); + } + if (_scale9Image) { + _scale9Image->updateDisplayedColor(Color3B::WHITE); + } + } + + Sprite* Scale9Sprite::getSprite()const + { + return _scale9Image; + } +}} diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 0b5fc46703..6396c09c98 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -25,6 +25,347 @@ #ifndef __cocos2d_libs__UIScale9Sprite__ #define __cocos2d_libs__UIScale9Sprite__ -#include +#include "2d/CCNode.h" +#include "2d/CCSpriteFrame.h" +#include "2d/CCSpriteBatchNode.h" +#include "base/CCPlatformMacros.h" + +NS_CC_BEGIN +namespace ui { + + /** + * A 9-slice sprite for cocos2d. + * + * 9-slice scaling allows you to specify how scaling is applied + * to specific areas of a sprite. With 9-slice scaling (3x3 grid), + * you can ensure that the sprite does not become distorted when + * scaled. + * + */ + class Scale9Sprite : public Node + { + public: + /** + * @js ctor + */ + Scale9Sprite(); + /** + * @js NA + * @lua NA + */ + virtual ~Scale9Sprite(); + + public: + static Scale9Sprite* create(); + + /** + * Creates a 9-slice sprite with a texture file, a delimitation zone and + * with the specified cap insets. + * + * @see initWithFile(const char *file, const Rect& rect, const Rect& capInsets) + */ + static Scale9Sprite* create(const std::string& file, const Rect& rect, const Rect& capInsets); + + /** + * Creates a 9-slice sprite with a texture file. The whole texture will be + * broken down into a 3×3 grid of equal blocks. + * + * @see initWithFile(const Rect& capInsets, const char *file) + */ + static Scale9Sprite* create(const Rect& capInsets, const std::string& file); + + /** + * Creates a 9-slice sprite with a texture file and a delimitation zone. The + * texture will be broken down into a 3×3 grid of equal blocks. + * + * @see initWithFile(const char *file, const Rect& rect) + */ + static Scale9Sprite* create(const std::string& file, const Rect& rect); + + /** + * Creates a 9-slice sprite with a texture file. The whole texture will be + * broken down into a 3×3 grid of equal blocks. + * + * @see initWithFile(const char *file) + */ + static Scale9Sprite* create(const std::string& file); + + /** + * Creates a 9-slice sprite with an sprite frame. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @see initWithSpriteFrame(SpriteFrame *spriteFrame) + */ + static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame); + + /** + * Creates a 9-slice sprite with an sprite frame and the centre of its zone. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @see initWithSpriteFrame(SpriteFrame *spriteFrame, const Rect& capInsets) + */ + static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets); + + /** + * Creates a 9-slice sprite with an sprite frame name. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @see initWithSpriteFrameName(const char *spriteFrameName) + */ + static Scale9Sprite* createWithSpriteFrameName(const std::string& spriteFrameName); + + /** + * Creates a 9-slice sprite with an sprite frame name and the centre of its + * zone. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @see initWithSpriteFrameName(const char *spriteFrameName, const Rect& capInsets) + */ + static Scale9Sprite* createWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets); + + /** + * Initializes a 9-slice sprite with a texture file, a delimitation zone and + * with the specified cap insets. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param file The name of the texture file. + * @param rect The rectangle that describes the sub-part of the texture that + * is the whole image. If the shape is the whole texture, set this to the + * texture's full rect. + * @param capInsets The values to use for the cap insets. + */ + virtual bool initWithFile(const std::string& file, const Rect& rect, const Rect& capInsets); + + /** + * Initializes a 9-slice sprite with a texture file and a delimitation zone. The + * texture will be broken down into a 3×3 grid of equal blocks. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param file The name of the texture file. + * @param rect The rectangle that describes the sub-part of the texture that + * is the whole image. If the shape is the whole texture, set this to the + * texture's full rect. + */ + virtual bool initWithFile(const std::string& file, const Rect& rect); + + /** + * Initializes a 9-slice sprite with a texture file and with the specified cap + * insets. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param file The name of the texture file. + * @param capInsets The values to use for the cap insets. + */ + virtual bool initWithFile(const Rect& capInsets, const std::string& file); + + /** + * Initializes a 9-slice sprite with a texture file. The whole texture will be + * broken down into a 3×3 grid of equal blocks. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param file The name of the texture file. + */ + virtual bool initWithFile(const std::string& file); + + /** + * Initializes a 9-slice sprite with an sprite frame and with the specified + * cap insets. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param spriteFrame The sprite frame object. + * @param capInsets The values to use for the cap insets. + */ + virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets); + + /** + * Initializes a 9-slice sprite with an sprite frame. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param spriteFrame The sprite frame object. + */ + virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame); + + /** + * Initializes a 9-slice sprite with an sprite frame name and with the specified + * cap insets. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param spriteFrameName The sprite frame name. + * @param capInsets The values to use for the cap insets. + */ + virtual bool initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets); + + /** + * Initializes a 9-slice sprite with an sprite frame name. + * Once the sprite is created, you can then call its "setContentSize:" method + * to resize the sprite will all it's 9-slice goodness intract. + * It respects the anchorPoint too. + * + * @param spriteFrameName The sprite frame name. + */ + virtual bool initWithSpriteFrameName(const std::string& spriteFrameName); + + virtual bool init(); + virtual bool init(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets); + virtual bool init(Sprite* sprite, const Rect& rect, const Rect& capInsets); + /** + * Creates and returns a new sprite object with the specified cap insets. + * You use this method to add cap insets to a sprite or to change the existing + * cap insets of a sprite. In both cases, you get back a new image and the + * original sprite remains untouched. + * + * @param capInsets The values to use for the cap insets. + */ + Scale9Sprite* resizableSpriteWithCapInsets(const Rect& capInsets); + + virtual bool updateWithSprite(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets); + virtual void setSpriteFrame(SpriteFrame * spriteFrame); + + // overrides + virtual void setContentSize(const Size & size) override; + + + Size getOriginalSize() const; + void setPreferredSize(const Size& size); + Size getPreferredSize() const; + void setCapInsets(const Rect& rect); + Rect getCapInsets()const; + void setInsetLeft(float leftInset); + float getInsetLeft()const; + void setInsetTop(float topInset); + float getInsetTop()const; + void setInsetRight(float rightInset); + float getInsetRight()const; + void setInsetBottom(float bottomInset); + float getInsetBottom()const; + void setScale9Enabled(bool enabled); + bool getScale9Enabled()const; + + + + /// @} end of Children and Parent + + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; + + virtual void cleanup() override; + + virtual void onEnter() override; + + /** Event callback that is invoked when the Node enters in the 'stage'. + * If the Node enters the 'stage' with a transition, this event is called when the transition finishes. + * If you override onEnterTransitionDidFinish, you shall call its parent's one, e.g. Node::onEnterTransitionDidFinish() + * @js NA + * @lua NA + */ + virtual void onEnterTransitionDidFinish() override; + + /** + * Event callback that is invoked every time the Node leaves the 'stage'. + * If the Node leaves the 'stage' with a transition, this event is called when the transition finishes. + * During onExit you can't access a sibling node. + * If you override onExit, you shall call its parent's one, e.g., Node::onExit(). + * @js NA + * @lua NA + */ + virtual void onExit() override; + + /** + * Event callback that is called every time the Node leaves the 'stage'. + * If the Node leaves the 'stage' with a transition, this callback is called when the transition starts. + * @js NA + * @lua NA + */ + virtual void onExitTransitionDidStart() override; + + virtual void updateDisplayedOpacity(GLubyte parentOpacity) override; + virtual void updateDisplayedColor(const Color3B& parentColor) override; + virtual void disableCascadeColor() override; + + Sprite* getSprite()const; + + + protected: + void updateCapInset(); + void updatePositions(); + void createSlicedSprites(const Rect& rect, bool rotated); + void cleanupSlicedSprites(); + void adjustScale9ImagePosition(); + /** + * Sorts the children array once before drawing, instead of every time when a child is added or reordered. + * This appraoch can improves the performance massively. + * @note Don't call this manually unless a child added needs to be removed in the same frame + */ + virtual void sortAllProtectedChildren(); + + bool _spritesGenerated; + Rect _spriteRect; + bool _spriteFrameRotated; + Rect _capInsetsInternal; + bool _positionsAreDirty; + + Sprite* _scale9Image; //the original sprite + Sprite* _topLeft; + Sprite* _top; + Sprite* _topRight; + Sprite* _left; + Sprite* _centre; + Sprite* _right; + Sprite* _bottomLeft; + Sprite* _bottom; + Sprite* _bottomRight; + + bool _scale9Enabled; + + /** Original sprite's size. */ + Size _originalSize; + /** Prefered sprite's size. By default the prefered size is the original size. */ + + //if the preferredSize component is given as -1, it is ignored + Size _preferredSize; + /** + * The end-cap insets. + * On a non-resizeable sprite, this property is set to CGRect::ZERO; the sprite + * does not use end caps and the entire sprite is subject to stretching. + */ + Rect _capInsets; + /** Sets the left side inset */ + float _insetLeft; + /** Sets the top side inset */ + float _insetTop; + /** Sets the right side inset */ + float _insetRight; + /** Sets the bottom side inset */ + float _insetBottom; + + /// helper that reorder a child + void addProtectedChild(Node* child); + + Vector _protectedChildren; ///holds the 9 sprites + bool _reorderProtectedChildDirty; + }; + +}} //end of namespace #endif /* defined(__cocos2d_libs__UIScale9Sprite__) */ From ebf05d1acc41e462e1d32c816c3b06b05e4c57d9 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 14:33:22 +0800 Subject: [PATCH 26/57] add UIScale9Sprite tests --- build/cocos2d_tests.xcodeproj/project.pbxproj | 364 +++++----- cocos/ui/CocosGUI.h | 1 + cocos/ui/UIScale9Sprite.cpp | 30 + cocos/ui/UIScale9Sprite.h | 40 ++ .../CocoStudioGUITest/CocosGUIScene.cpp | 12 + .../CocoStudioGUITest/UIScale9SpriteTest.cpp | 661 ++++++++++++++++++ .../CocoStudioGUITest/UIScale9SpriteTest.h | 259 +++++++ .../CocoStudioGUITest/UISceneManager.cpp | 58 ++ .../UITest/CocoStudioGUITest/UISceneManager.h | 19 + 9 files changed, 1266 insertions(+), 178 deletions(-) create mode 100644 tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp create mode 100644 tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 76baf0ed45..87aaaf3ad1 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -112,8 +112,8 @@ 15CBA9B8196EE8D9005877BB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA54C196EE671005877BB /* main.m */; }; 15CBA9B9196EE8D9005877BB /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA54E196EE671005877BB /* RootViewController.mm */; }; 15CBA9BB196EE910005877BB /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; - 15CBA9BD196EE910005877BB /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; }; - 15CBA9BE196EE910005877BB /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; }; + 15CBA9BD196EE910005877BB /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libextension iOS.a */; }; + 15CBA9BE196EE910005877BB /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */; }; 15CBA9BF196EE910005877BB /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28018CD90A50087CE3A /* libluabindings iOS.a */; }; 15CBA9CF196EE9FB005877BB /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C2196EE951005877BB /* AVFoundation.framework */; }; 15CBA9D0196EEA05005877BB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C4196EE962005877BB /* UIKit.framework */; }; @@ -126,7 +126,7 @@ 15CBA9DB196EEA90005877BB /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9DA196EEA90005877BB /* CoreMotion.framework */; }; 15CBA9DD196EEAA6005877BB /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9DC196EEAA6005877BB /* libz.dylib */; }; 15CBA9DE196EEAF8005877BB /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E61773C1960FBD100DE83F5 /* GameController.framework */; }; - 15CBA9DF196EEBB3005877BB /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; + 15CBA9DF196EEBB3005877BB /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; 15CBA9E0196EEBD4005877BB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 15CBA9ED196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA9EB196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp */; }; 15CBA9F0196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA9EE196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp */; }; @@ -135,8 +135,8 @@ 15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 1A0EE2A118CDF6DA004CD58F /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; }; - 1A0EE2A218CDF6DA004CD58F /* libcocos2dx Mac.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - 1A0EE2A418CDF6DA004CD58F /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; }; + 1A0EE2A218CDF6DA004CD58F /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + 1A0EE2A418CDF6DA004CD58F /* libcocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */; }; 1A0EE2A518CDF6DA004CD58F /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; }; 1A0EE2A618CDF6DA004CD58F /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; }; 1A0EE2A718CDF6DA004CD58F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; }; @@ -157,14 +157,14 @@ 1A0EE2D018CDF733004CD58F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA35618CD9A890087CE3A /* QuartzCore.framework */; }; 1A0EE2D118CDF733004CD58F /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA35418CD9A820087CE3A /* OpenGL.framework */; }; 1A0EE2D218CDF733004CD58F /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; }; - 1A0EE2D318CDF733004CD58F /* libcocos2dx Mac.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - 1A0EE2D418CDF733004CD58F /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; }; - 1A0EE2D518CDF733004CD58F /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; }; + 1A0EE2D318CDF733004CD58F /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + 1A0EE2D418CDF733004CD58F /* libextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libextension Mac.a */; }; + 1A0EE2D518CDF733004CD58F /* libcocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */; }; 1A0EE2D618CDF733004CD58F /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA27E18CD90A50087CE3A /* libluabindings Mac.a */; }; 1A0EE2D718CDF733004CD58F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; }; 1A0EE40218CDF775004CD58F /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; - 1A0EE40318CDF775004CD58F /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; - 1A0EE40518CDF775004CD58F /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; }; + 1A0EE40318CDF775004CD58F /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; + 1A0EE40518CDF775004CD58F /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */; }; 1A0EE40618CDF775004CD58F /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; }; 1A0EE40718CDF775004CD58F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; }; 1A0EE40818CDF775004CD58F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; @@ -186,9 +186,9 @@ 1A0EE43418CDF799004CD58F /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39C18CD9ED80087CE3A /* AVFoundation.framework */; }; 1A0EE43518CDF799004CD58F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; 1A0EE43618CDF799004CD58F /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; - 1A0EE43718CDF799004CD58F /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; - 1A0EE43818CDF799004CD58F /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; }; - 1A0EE43918CDF799004CD58F /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; }; + 1A0EE43718CDF799004CD58F /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; + 1A0EE43818CDF799004CD58F /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libextension iOS.a */; }; + 1A0EE43918CDF799004CD58F /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */; }; 1A0EE43A18CDF799004CD58F /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28018CD90A50087CE3A /* libluabindings iOS.a */; }; 1A0EE55C18CDFBBD004CD58F /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36618CD9E180087CE3A /* AudioEngine.lua */; }; 1A0EE55D18CDFBBD004CD58F /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36718CD9E180087CE3A /* CCBReaderLoad.lua */; }; @@ -233,25 +233,25 @@ 1A9F808D177E98A600D9A1CB /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; }; 1AAF534B180E2F4E000584C8 /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB61807A4F9005B8026 /* libbox2d Mac.a */; }; 1AAF534C180E2F4E000584C8 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; }; - 1AAF534D180E2F4E000584C8 /* libcocos2dx Mac.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - 1AAF534E180E2F4E000584C8 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; }; - 1AAF534F180E2F4E000584C8 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; }; + 1AAF534D180E2F4E000584C8 /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + 1AAF534E180E2F4E000584C8 /* libextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libextension Mac.a */; }; + 1AAF534F180E2F4E000584C8 /* libcocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */; }; 1AAF53FE180E39D4000584C8 /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC41807A4F9005B8026 /* libbox2d iOS.a */; }; 1AAF53FF180E39D4000584C8 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; - 1AAF5400180E39D4000584C8 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; - 1AAF5401180E39D4000584C8 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; }; - 1AAF5402180E39D4000584C8 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; }; + 1AAF5400180E39D4000584C8 /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; + 1AAF5401180E39D4000584C8 /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libextension iOS.a */; }; + 1AAF5402180E39D4000584C8 /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */; }; 1ABCA28718CD91510087CE3A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; }; 1ABCA2C218CD92420087CE3A /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; }; - 1ABCA2C318CD92420087CE3A /* libcocos2dx Mac.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - 1ABCA2C418CD92420087CE3A /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; }; - 1ABCA2C518CD92420087CE3A /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; }; + 1ABCA2C318CD92420087CE3A /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + 1ABCA2C418CD92420087CE3A /* libextension Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libextension Mac.a */; }; + 1ABCA2C518CD92420087CE3A /* libcocosdenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */; }; 1ABCA2C618CD92420087CE3A /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA27E18CD90A50087CE3A /* libluabindings Mac.a */; }; 1ABCA2CE18CD93580087CE3A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; 1ABCA30118CD93940087CE3A /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; - 1ABCA30218CD93940087CE3A /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; - 1ABCA30318CD93940087CE3A /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; }; - 1ABCA30418CD93940087CE3A /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; }; + 1ABCA30218CD93940087CE3A /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; + 1ABCA30318CD93940087CE3A /* libextension iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libextension iOS.a */; }; + 1ABCA30418CD93940087CE3A /* libcocosdenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */; }; 1ABCA30518CD93940087CE3A /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28018CD90A50087CE3A /* libluabindings iOS.a */; }; 1ABCA35518CD9A820087CE3A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA35418CD9A820087CE3A /* OpenGL.framework */; }; 1ABCA35718CD9A890087CE3A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA35618CD9A890087CE3A /* QuartzCore.framework */; }; @@ -853,6 +853,8 @@ 29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; 290E94B5196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; 290E94B6196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; + 295824591987415900F9746D /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; + 2958245A1987415900F9746D /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; 29FBBBFE196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; 29FBBBFF196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; 38FA2E73194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */; }; @@ -860,7 +862,7 @@ 38FA2E76194AECF800FF2BE4 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; 38FA2E77194AECF800FF2BE4 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; 3E6177211960FAED00DE83F5 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; - 3E6177221960FAED00DE83F5 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; + 3E6177221960FAED00DE83F5 /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; 3E6177241960FAED00DE83F5 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; }; 3E6177251960FAED00DE83F5 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; }; 3E6177261960FAED00DE83F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; @@ -914,47 +916,47 @@ A07A52BF1783AF210073F6A7 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; }; A07A52C01783AF250073F6A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; }; A07A52C31783B02C0073F6A7 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; }; - B24024DB1978DE1000FDE433 /* libcocos2dx Mac.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - B24024DD1978EC0700FDE433 /* libcocos2dx Mac.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - B24024E31978ED5200FDE433 /* libcocos2dx Mac.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - B24024E51978ED5F00FDE433 /* libcocos2dx Mac.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */; }; - B2411C9E19822FBD00E093E2 /* libcocosStudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocosStudio iOS.a */; }; - B2411CA119822FDD00E093E2 /* libcocosBuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosBuilder iOS.a */; }; - B2411CA419822FF100E093E2 /* libcocosSpine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libcocosSpine iOS.a */; }; - B2411CA71982301400E093E2 /* libcocosGUI iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libcocosGUI iOS.a */; }; - B2411CAA1982302700E093E2 /* libcocosNetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libcocosNetwork iOS.a */; }; - B244F3171976878E00ED1926 /* libcocosNetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B244F3161976878700ED1926 /* libcocosNetwork Mac.a */; }; + B24024DB1978DE1000FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + B24024DD1978EC0700FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + B24024E31978ED5200FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + B24024E51978ED5F00FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; + B2411C9E19822FBD00E093E2 /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocostudio iOS.a */; }; + B2411CA119822FDD00E093E2 /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosbuilder iOS.a */; }; + B2411CA419822FF100E093E2 /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libspine iOS.a */; }; + B2411CA71982301400E093E2 /* libui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libui iOS.a */; }; + B2411CAA1982302700E093E2 /* libnetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libnetwork iOS.a */; }; + B244F3171976878E00ED1926 /* libnetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B244F3161976878700ED1926 /* libnetwork Mac.a */; }; B2507B6B192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; }; B2507B6C192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; }; - B27AEE0719768950008BD575 /* libcocosNetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B244F3161976878700ED1926 /* libcocosNetwork Mac.a */; }; - B27AEE0A1976896B008BD575 /* libcocosNetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B244F3161976878700ED1926 /* libcocosNetwork Mac.a */; }; - B2C59AC8197782B900B452DF /* libcocosBuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosBuilder iOS.a */; }; - B2C59AC9197782B900B452DF /* libcocosGUI iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libcocosGUI iOS.a */; }; - B2C59ACA197782B900B452DF /* libcocosStudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocosStudio iOS.a */; }; - B2C59AD619779CEB00B452DF /* libcocosBuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosBuilder iOS.a */; }; - B2C59AD719779CEB00B452DF /* libcocosGUI iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libcocosGUI iOS.a */; }; - B2C59AD819779CEB00B452DF /* libcocosNetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libcocosNetwork iOS.a */; }; - B2C59AD919779CEB00B452DF /* libcocosSpine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libcocosSpine iOS.a */; }; - B2C59ADA19779CEB00B452DF /* libcocosStudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocosStudio iOS.a */; }; - B2C59AE519779D5D00B452DF /* libcocosBuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosBuilder iOS.a */; }; - B2C59AE619779D5D00B452DF /* libcocosGUI iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libcocosGUI iOS.a */; }; - B2C59AE719779D5D00B452DF /* libcocosNetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libcocosNetwork iOS.a */; }; - B2C59AE819779D5D00B452DF /* libcocosSpine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libcocosSpine iOS.a */; }; - B2C59AE919779D5D00B452DF /* libcocosStudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocosStudio iOS.a */; }; - B2CC5045197766F70041958E /* libcocosNetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libcocosNetwork iOS.a */; }; - B2CC507B19776D8B0041958E /* libcocosSpine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libcocosSpine iOS.a */; }; - B2DB479A197668D500411E16 /* libcocosGUI Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB4799197668CA00411E16 /* libcocosGUI Mac.a */; }; - B2DB480919766E4800411E16 /* libcocosBuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB480819766E3C00411E16 /* libcocosBuilder Mac.a */; }; - B2DB480E197670F500411E16 /* libcocosBuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB480819766E3C00411E16 /* libcocosBuilder Mac.a */; }; - B2DB480F197670F500411E16 /* libcocosGUI Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB4799197668CA00411E16 /* libcocosGUI Mac.a */; }; - B2DB48141976711A00411E16 /* libcocosBuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB480819766E3C00411E16 /* libcocosBuilder Mac.a */; }; - B2DB48151976711A00411E16 /* libcocosGUI Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB4799197668CA00411E16 /* libcocosGUI Mac.a */; }; - B2DB48C319767D3D00411E16 /* libcocosStudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB48C219767D3600411E16 /* libcocosStudio Mac.a */; }; - B2DB48C619767DAC00411E16 /* libcocosStudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB48C219767D3600411E16 /* libcocosStudio Mac.a */; }; - B2DB48C919767EB700411E16 /* libcocosStudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB48C219767D3600411E16 /* libcocosStudio Mac.a */; }; - B2DB493A197681E500411E16 /* libcocosSpine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB49391976819900411E16 /* libcocosSpine Mac.a */; }; - B2DB49401976826000411E16 /* libcocosSpine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB49391976819900411E16 /* libcocosSpine Mac.a */; }; - B2DB49431976826E00411E16 /* libcocosSpine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB49391976819900411E16 /* libcocosSpine Mac.a */; }; + B27AEE0719768950008BD575 /* libnetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B244F3161976878700ED1926 /* libnetwork Mac.a */; }; + B27AEE0A1976896B008BD575 /* libnetwork Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B244F3161976878700ED1926 /* libnetwork Mac.a */; }; + B2C59AC8197782B900B452DF /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosbuilder iOS.a */; }; + B2C59AC9197782B900B452DF /* libui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libui iOS.a */; }; + B2C59ACA197782B900B452DF /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocostudio iOS.a */; }; + B2C59AD619779CEB00B452DF /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosbuilder iOS.a */; }; + B2C59AD719779CEB00B452DF /* libui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libui iOS.a */; }; + B2C59AD819779CEB00B452DF /* libnetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libnetwork iOS.a */; }; + B2C59AD919779CEB00B452DF /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libspine iOS.a */; }; + B2C59ADA19779CEB00B452DF /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocostudio iOS.a */; }; + B2C59AE519779D5D00B452DF /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosbuilder iOS.a */; }; + B2C59AE619779D5D00B452DF /* libui iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5039197763A20041958E /* libui iOS.a */; }; + B2C59AE719779D5D00B452DF /* libnetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libnetwork iOS.a */; }; + B2C59AE819779D5D00B452DF /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libspine iOS.a */; }; + B2C59AE919779D5D00B452DF /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocostudio iOS.a */; }; + B2CC5045197766F70041958E /* libnetwork iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC5041197763A20041958E /* libnetwork iOS.a */; }; + B2CC507B19776D8B0041958E /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libspine iOS.a */; }; + B2DB479A197668D500411E16 /* libui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB4799197668CA00411E16 /* libui Mac.a */; }; + B2DB480919766E4800411E16 /* libcocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB480819766E3C00411E16 /* libcocosbuilder Mac.a */; }; + B2DB480E197670F500411E16 /* libcocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB480819766E3C00411E16 /* libcocosbuilder Mac.a */; }; + B2DB480F197670F500411E16 /* libui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB4799197668CA00411E16 /* libui Mac.a */; }; + B2DB48141976711A00411E16 /* libcocosbuilder Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB480819766E3C00411E16 /* libcocosbuilder Mac.a */; }; + B2DB48151976711A00411E16 /* libui Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB4799197668CA00411E16 /* libui Mac.a */; }; + B2DB48C319767D3D00411E16 /* libcocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB48C219767D3600411E16 /* libcocostudio Mac.a */; }; + B2DB48C619767DAC00411E16 /* libcocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB48C219767D3600411E16 /* libcocostudio Mac.a */; }; + B2DB48C919767EB700411E16 /* libcocostudio Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB48C219767D3600411E16 /* libcocostudio Mac.a */; }; + B2DB493A197681E500411E16 /* libspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB49391976819900411E16 /* libspine Mac.a */; }; + B2DB49401976826000411E16 /* libspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB49391976819900411E16 /* libspine Mac.a */; }; + B2DB49431976826E00411E16 /* libspine Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DB49391976819900411E16 /* libspine Mac.a */; }; C04F935A1941B05400E9FEAB /* TileMapTest2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C04F93581941B05400E9FEAB /* TileMapTest2.cpp */; }; C04F935B1941B05400E9FEAB /* TileMapTest2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C04F93581941B05400E9FEAB /* TileMapTest2.cpp */; }; C08689C118D370C90093E810 /* background.caf in Resources */ = {isa = PBXBuildFile; fileRef = C08689C018D370C90093E810 /* background.caf */; }; @@ -1731,7 +1733,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - B24024DB1978DE1000FDE433 /* libcocos2dx Mac.dylib in CopyFiles */, + B24024DB1978DE1000FDE433 /* libcocos2d Mac.a in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1741,7 +1743,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - B24024DD1978EC0700FDE433 /* libcocos2dx Mac.dylib in CopyFiles */, + B24024DD1978EC0700FDE433 /* libcocos2d Mac.a in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1751,7 +1753,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - B24024E31978ED5200FDE433 /* libcocos2dx Mac.dylib in CopyFiles */, + B24024E31978ED5200FDE433 /* libcocos2d Mac.a in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1761,7 +1763,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - B24024E51978ED5F00FDE433 /* libcocos2dx Mac.dylib in CopyFiles */, + B24024E51978ED5F00FDE433 /* libcocos2d Mac.a in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3500,6 +3502,8 @@ 29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest_Editor.h; sourceTree = ""; }; 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CocostudioParserTest.cpp; path = ../CocostudioParserTest.cpp; sourceTree = ""; }; 290E94B4196FC16900694919 /* CocostudioParserTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CocostudioParserTest.h; path = ../CocostudioParserTest.h; sourceTree = ""; }; + 295824571987415900F9746D /* UIScale9SpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScale9SpriteTest.cpp; sourceTree = ""; }; + 295824581987415900F9746D /* UIScale9SpriteTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScale9SpriteTest.h; sourceTree = ""; }; 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocostudioParserJsonTest.cpp; sourceTree = ""; }; 29FBBBFD196A9ECD00E65826 /* CocostudioParserJsonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocostudioParserJsonTest.h; sourceTree = ""; }; 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionTimelineTestScene.cpp; sourceTree = ""; }; @@ -3569,11 +3573,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B2411CAA1982302700E093E2 /* libcocosNetwork iOS.a in Frameworks */, - B2411CA71982301400E093E2 /* libcocosGUI iOS.a in Frameworks */, - B2411CA419822FF100E093E2 /* libcocosSpine iOS.a in Frameworks */, - B2411CA119822FDD00E093E2 /* libcocosBuilder iOS.a in Frameworks */, - B2411C9E19822FBD00E093E2 /* libcocosStudio iOS.a in Frameworks */, + B2411CAA1982302700E093E2 /* libnetwork iOS.a in Frameworks */, + B2411CA71982301400E093E2 /* libui iOS.a in Frameworks */, + B2411CA419822FF100E093E2 /* libspine iOS.a in Frameworks */, + B2411CA119822FDD00E093E2 /* libcocosbuilder iOS.a in Frameworks */, + B2411C9E19822FBD00E093E2 /* libcocostudio iOS.a in Frameworks */, 15CBA9E0196EEBD4005877BB /* MediaPlayer.framework in Frameworks */, 15CBA9DE196EEAF8005877BB /* GameController.framework in Frameworks */, 15CBA9DD196EEAA6005877BB /* libz.dylib in Frameworks */, @@ -3587,9 +3591,9 @@ 15CBA9CF196EE9FB005877BB /* AVFoundation.framework in Frameworks */, 15CBA9D1196EEA1D005877BB /* Foundation.framework in Frameworks */, 15CBA9BB196EE910005877BB /* libchipmunk iOS.a in Frameworks */, - 15CBA9DF196EEBB3005877BB /* libcocos2dx iOS.a in Frameworks */, - 15CBA9BD196EE910005877BB /* libcocos2dx-extensions iOS.a in Frameworks */, - 15CBA9BE196EE910005877BB /* libCocosDenshion iOS.a in Frameworks */, + 15CBA9DF196EEBB3005877BB /* libcocos2d iOS.a in Frameworks */, + 15CBA9BD196EE910005877BB /* libextension iOS.a in Frameworks */, + 15CBA9BE196EE910005877BB /* libcocosdenshion iOS.a in Frameworks */, 15CBA9BF196EE910005877BB /* libluabindings iOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3599,8 +3603,8 @@ buildActionMask = 2147483647; files = ( 1A0EE2A118CDF6DA004CD58F /* libchipmunk Mac.a in Frameworks */, - 1A0EE2A218CDF6DA004CD58F /* libcocos2dx Mac.dylib in Frameworks */, - 1A0EE2A418CDF6DA004CD58F /* libCocosDenshion Mac.a in Frameworks */, + 1A0EE2A218CDF6DA004CD58F /* libcocos2d Mac.a in Frameworks */, + 1A0EE2A418CDF6DA004CD58F /* libcocosdenshion Mac.a in Frameworks */, 1A0EE2A518CDF6DA004CD58F /* IOKit.framework in Frameworks */, 1A0EE2A618CDF6DA004CD58F /* libcurl.dylib in Frameworks */, 1A0EE2A718CDF6DA004CD58F /* libz.dylib in Frameworks */, @@ -3618,11 +3622,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B27AEE0A1976896B008BD575 /* libcocosNetwork Mac.a in Frameworks */, - B2DB49431976826E00411E16 /* libcocosSpine Mac.a in Frameworks */, - B2DB48C919767EB700411E16 /* libcocosStudio Mac.a in Frameworks */, - B2DB480E197670F500411E16 /* libcocosBuilder Mac.a in Frameworks */, - B2DB480F197670F500411E16 /* libcocosGUI Mac.a in Frameworks */, + B27AEE0A1976896B008BD575 /* libnetwork Mac.a in Frameworks */, + B2DB49431976826E00411E16 /* libspine Mac.a in Frameworks */, + B2DB48C919767EB700411E16 /* libcocostudio Mac.a in Frameworks */, + B2DB480E197670F500411E16 /* libcocosbuilder Mac.a in Frameworks */, + B2DB480F197670F500411E16 /* libui Mac.a in Frameworks */, 1A0EE2C918CDF733004CD58F /* libcurl.dylib in Frameworks */, 1A0EE2CA18CDF733004CD58F /* libz.dylib in Frameworks */, 1A0EE2CB18CDF733004CD58F /* IOKit.framework in Frameworks */, @@ -3633,9 +3637,9 @@ 1A0EE2D018CDF733004CD58F /* QuartzCore.framework in Frameworks */, 1A0EE2D118CDF733004CD58F /* OpenGL.framework in Frameworks */, 1A0EE2D218CDF733004CD58F /* libchipmunk Mac.a in Frameworks */, - 1A0EE2D318CDF733004CD58F /* libcocos2dx Mac.dylib in Frameworks */, - 1A0EE2D418CDF733004CD58F /* libcocos2dx-extensions Mac.a in Frameworks */, - 1A0EE2D518CDF733004CD58F /* libCocosDenshion Mac.a in Frameworks */, + 1A0EE2D318CDF733004CD58F /* libcocos2d Mac.a in Frameworks */, + 1A0EE2D418CDF733004CD58F /* libextension Mac.a in Frameworks */, + 1A0EE2D518CDF733004CD58F /* libcocosdenshion Mac.a in Frameworks */, 1A0EE2D618CDF733004CD58F /* libluabindings Mac.a in Frameworks */, 1A0EE2D718CDF733004CD58F /* Cocoa.framework in Frameworks */, ); @@ -3646,8 +3650,8 @@ buildActionMask = 2147483647; files = ( 1A0EE40218CDF775004CD58F /* libchipmunk iOS.a in Frameworks */, - 1A0EE40318CDF775004CD58F /* libcocos2dx iOS.a in Frameworks */, - 1A0EE40518CDF775004CD58F /* libCocosDenshion iOS.a in Frameworks */, + 1A0EE40318CDF775004CD58F /* libcocos2d iOS.a in Frameworks */, + 1A0EE40518CDF775004CD58F /* libcocosdenshion iOS.a in Frameworks */, 1A0EE40618CDF775004CD58F /* CoreMotion.framework in Frameworks */, 1A0EE40718CDF775004CD58F /* libz.dylib in Frameworks */, 1A0EE40818CDF775004CD58F /* Foundation.framework in Frameworks */, @@ -3665,11 +3669,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B2C59AD619779CEB00B452DF /* libcocosBuilder iOS.a in Frameworks */, - B2C59AD719779CEB00B452DF /* libcocosGUI iOS.a in Frameworks */, - B2C59AD819779CEB00B452DF /* libcocosNetwork iOS.a in Frameworks */, - B2C59AD919779CEB00B452DF /* libcocosSpine iOS.a in Frameworks */, - B2C59ADA19779CEB00B452DF /* libcocosStudio iOS.a in Frameworks */, + B2C59AD619779CEB00B452DF /* libcocosbuilder iOS.a in Frameworks */, + B2C59AD719779CEB00B452DF /* libui iOS.a in Frameworks */, + B2C59AD819779CEB00B452DF /* libnetwork iOS.a in Frameworks */, + B2C59AD919779CEB00B452DF /* libspine iOS.a in Frameworks */, + B2C59ADA19779CEB00B452DF /* libcocostudio iOS.a in Frameworks */, 15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */, 1A0EE42C18CDF799004CD58F /* libz.dylib in Frameworks */, 1A0EE42D18CDF799004CD58F /* CoreMotion.framework in Frameworks */, @@ -3682,9 +3686,9 @@ 1A0EE43418CDF799004CD58F /* AVFoundation.framework in Frameworks */, 1A0EE43518CDF799004CD58F /* Foundation.framework in Frameworks */, 1A0EE43618CDF799004CD58F /* libchipmunk iOS.a in Frameworks */, - 1A0EE43718CDF799004CD58F /* libcocos2dx iOS.a in Frameworks */, - 1A0EE43818CDF799004CD58F /* libcocos2dx-extensions iOS.a in Frameworks */, - 1A0EE43918CDF799004CD58F /* libCocosDenshion iOS.a in Frameworks */, + 1A0EE43718CDF799004CD58F /* libcocos2d iOS.a in Frameworks */, + 1A0EE43818CDF799004CD58F /* libextension iOS.a in Frameworks */, + 1A0EE43918CDF799004CD58F /* libcocosdenshion iOS.a in Frameworks */, 1A0EE43A18CDF799004CD58F /* libluabindings iOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3693,11 +3697,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B27AEE0719768950008BD575 /* libcocosNetwork Mac.a in Frameworks */, - B2DB49401976826000411E16 /* libcocosSpine Mac.a in Frameworks */, - B2DB48C319767D3D00411E16 /* libcocosStudio Mac.a in Frameworks */, - B2DB48141976711A00411E16 /* libcocosBuilder Mac.a in Frameworks */, - B2DB48151976711A00411E16 /* libcocosGUI Mac.a in Frameworks */, + B27AEE0719768950008BD575 /* libnetwork Mac.a in Frameworks */, + B2DB49401976826000411E16 /* libspine Mac.a in Frameworks */, + B2DB48C319767D3D00411E16 /* libcocostudio Mac.a in Frameworks */, + B2DB48141976711A00411E16 /* libcocosbuilder Mac.a in Frameworks */, + B2DB48151976711A00411E16 /* libui Mac.a in Frameworks */, 1ABCA36218CD9AC60087CE3A /* libcurl.dylib in Frameworks */, 1ABCA36118CD9AC00087CE3A /* libz.dylib in Frameworks */, 1ABCA35F18CD9AAE0087CE3A /* IOKit.framework in Frameworks */, @@ -3708,9 +3712,9 @@ 1ABCA35718CD9A890087CE3A /* QuartzCore.framework in Frameworks */, 1ABCA35518CD9A820087CE3A /* OpenGL.framework in Frameworks */, 1ABCA2C218CD92420087CE3A /* libchipmunk Mac.a in Frameworks */, - 1ABCA2C318CD92420087CE3A /* libcocos2dx Mac.dylib in Frameworks */, - 1ABCA2C418CD92420087CE3A /* libcocos2dx-extensions Mac.a in Frameworks */, - 1ABCA2C518CD92420087CE3A /* libCocosDenshion Mac.a in Frameworks */, + 1ABCA2C318CD92420087CE3A /* libcocos2d Mac.a in Frameworks */, + 1ABCA2C418CD92420087CE3A /* libextension Mac.a in Frameworks */, + 1ABCA2C518CD92420087CE3A /* libcocosdenshion Mac.a in Frameworks */, 1ABCA2C618CD92420087CE3A /* libluabindings Mac.a in Frameworks */, 1ABCA28718CD91510087CE3A /* Cocoa.framework in Frameworks */, ); @@ -3720,11 +3724,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B2C59AE519779D5D00B452DF /* libcocosBuilder iOS.a in Frameworks */, - B2C59AE619779D5D00B452DF /* libcocosGUI iOS.a in Frameworks */, - B2C59AE719779D5D00B452DF /* libcocosNetwork iOS.a in Frameworks */, - B2C59AE819779D5D00B452DF /* libcocosSpine iOS.a in Frameworks */, - B2C59AE919779D5D00B452DF /* libcocosStudio iOS.a in Frameworks */, + B2C59AE519779D5D00B452DF /* libcocosbuilder iOS.a in Frameworks */, + B2C59AE619779D5D00B452DF /* libui iOS.a in Frameworks */, + B2C59AE719779D5D00B452DF /* libnetwork iOS.a in Frameworks */, + B2C59AE819779D5D00B452DF /* libspine iOS.a in Frameworks */, + B2C59AE919779D5D00B452DF /* libcocostudio iOS.a in Frameworks */, 15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */, 1ABCA3B018CDA06D0087CE3A /* libz.dylib in Frameworks */, 1ABCA3AA18CD9F1A0087CE3A /* CoreMotion.framework in Frameworks */, @@ -3737,9 +3741,9 @@ 1ABCA39D18CD9ED80087CE3A /* AVFoundation.framework in Frameworks */, 1ABCA2CE18CD93580087CE3A /* Foundation.framework in Frameworks */, 1ABCA30118CD93940087CE3A /* libchipmunk iOS.a in Frameworks */, - 1ABCA30218CD93940087CE3A /* libcocos2dx iOS.a in Frameworks */, - 1ABCA30318CD93940087CE3A /* libcocos2dx-extensions iOS.a in Frameworks */, - 1ABCA30418CD93940087CE3A /* libCocosDenshion iOS.a in Frameworks */, + 1ABCA30218CD93940087CE3A /* libcocos2d iOS.a in Frameworks */, + 1ABCA30318CD93940087CE3A /* libextension iOS.a in Frameworks */, + 1ABCA30418CD93940087CE3A /* libcocosdenshion iOS.a in Frameworks */, 1ABCA30518CD93940087CE3A /* libluabindings iOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3748,16 +3752,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B244F3171976878E00ED1926 /* libcocosNetwork Mac.a in Frameworks */, - B2DB493A197681E500411E16 /* libcocosSpine Mac.a in Frameworks */, - B2DB48C619767DAC00411E16 /* libcocosStudio Mac.a in Frameworks */, - B2DB480919766E4800411E16 /* libcocosBuilder Mac.a in Frameworks */, - B2DB479A197668D500411E16 /* libcocosGUI Mac.a in Frameworks */, + B244F3171976878E00ED1926 /* libnetwork Mac.a in Frameworks */, + B2DB493A197681E500411E16 /* libspine Mac.a in Frameworks */, + B2DB48C619767DAC00411E16 /* libcocostudio Mac.a in Frameworks */, + B2DB480919766E4800411E16 /* libcocosbuilder Mac.a in Frameworks */, + B2DB479A197668D500411E16 /* libui Mac.a in Frameworks */, 1AAF534B180E2F4E000584C8 /* libbox2d Mac.a in Frameworks */, 1AAF534C180E2F4E000584C8 /* libchipmunk Mac.a in Frameworks */, - 1AAF534D180E2F4E000584C8 /* libcocos2dx Mac.dylib in Frameworks */, - 1AAF534E180E2F4E000584C8 /* libcocos2dx-extensions Mac.a in Frameworks */, - 1AAF534F180E2F4E000584C8 /* libCocosDenshion Mac.a in Frameworks */, + 1AAF534D180E2F4E000584C8 /* libcocos2d Mac.a in Frameworks */, + 1AAF534E180E2F4E000584C8 /* libextension Mac.a in Frameworks */, + 1AAF534F180E2F4E000584C8 /* libcocosdenshion Mac.a in Frameworks */, EDCC747F17C455FD007B692C /* IOKit.framework in Frameworks */, 1A9F808D177E98A600D9A1CB /* libcurl.dylib in Frameworks */, 15C6482F165F399D007D4F18 /* libz.dylib in Frameworks */, @@ -3777,7 +3781,7 @@ files = ( 3E61773D1960FBD200DE83F5 /* GameController.framework in Frameworks */, 3E6177211960FAED00DE83F5 /* libchipmunk iOS.a in Frameworks */, - 3E6177221960FAED00DE83F5 /* libcocos2dx iOS.a in Frameworks */, + 3E6177221960FAED00DE83F5 /* libcocos2d iOS.a in Frameworks */, 3E6177241960FAED00DE83F5 /* CoreMotion.framework in Frameworks */, 3E6177251960FAED00DE83F5 /* libz.dylib in Frameworks */, 3E6177261960FAED00DE83F5 /* Foundation.framework in Frameworks */, @@ -3795,17 +3799,17 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B2C59AC8197782B900B452DF /* libcocosBuilder iOS.a in Frameworks */, - B2C59AC9197782B900B452DF /* libcocosGUI iOS.a in Frameworks */, - B2C59ACA197782B900B452DF /* libcocosStudio iOS.a in Frameworks */, - B2CC507B19776D8B0041958E /* libcocosSpine iOS.a in Frameworks */, - B2CC5045197766F70041958E /* libcocosNetwork iOS.a in Frameworks */, + B2C59AC8197782B900B452DF /* libcocosbuilder iOS.a in Frameworks */, + B2C59AC9197782B900B452DF /* libui iOS.a in Frameworks */, + B2C59ACA197782B900B452DF /* libcocostudio iOS.a in Frameworks */, + B2CC507B19776D8B0041958E /* libspine iOS.a in Frameworks */, + B2CC5045197766F70041958E /* libnetwork iOS.a in Frameworks */, 3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */, 1AAF53FE180E39D4000584C8 /* libbox2d iOS.a in Frameworks */, 1AAF53FF180E39D4000584C8 /* libchipmunk iOS.a in Frameworks */, - 1AAF5400180E39D4000584C8 /* libcocos2dx iOS.a in Frameworks */, - 1AAF5401180E39D4000584C8 /* libcocos2dx-extensions iOS.a in Frameworks */, - 1AAF5402180E39D4000584C8 /* libCocosDenshion iOS.a in Frameworks */, + 1AAF5400180E39D4000584C8 /* libcocos2d iOS.a in Frameworks */, + 1AAF5401180E39D4000584C8 /* libextension iOS.a in Frameworks */, + 1AAF5402180E39D4000584C8 /* libcocosdenshion iOS.a in Frameworks */, D60AE43417F7FFE100757E4B /* CoreMotion.framework in Frameworks */, A07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */, A07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */, @@ -7639,6 +7643,8 @@ 29FBBC00196A9F0D00E65826 /* UIAndEditorTests */ = { isa = PBXGroup; children = ( + 295824571987415900F9746D /* UIScale9SpriteTest.cpp */, + 295824581987415900F9746D /* UIScale9SpriteTest.h */, 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */, 29080D20191B595E0066F8DF /* CocosGUIScene.h */, 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */, @@ -7763,26 +7769,26 @@ 46A15F9D1807A4F8005B8026 /* Products */ = { isa = PBXGroup; children = ( - 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */, - 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */, - B2DB4799197668CA00411E16 /* libcocosGUI Mac.a */, - B2DB48C219767D3600411E16 /* libcocosStudio Mac.a */, - B2DB480819766E3C00411E16 /* libcocosBuilder Mac.a */, - B2DB49391976819900411E16 /* libcocosSpine Mac.a */, - B244F3161976878700ED1926 /* libcocosNetwork Mac.a */, + 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */, + 46A15FB21807A4F9005B8026 /* libextension Mac.a */, + B2DB4799197668CA00411E16 /* libui Mac.a */, + B2DB48C219767D3600411E16 /* libcocostudio Mac.a */, + B2DB480819766E3C00411E16 /* libcocosbuilder Mac.a */, + B2DB49391976819900411E16 /* libspine Mac.a */, + B244F3161976878700ED1926 /* libnetwork Mac.a */, 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */, 46A15FB61807A4F9005B8026 /* libbox2d Mac.a */, - 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */, - 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */, - 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */, + 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */, + 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */, + 46A15FC01807A4F9005B8026 /* libextension iOS.a */, 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */, 46A15FC41807A4F9005B8026 /* libbox2d iOS.a */, - 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */, - B2CC5039197763A20041958E /* libcocosGUI iOS.a */, - B2CC503B197763A20041958E /* libcocosStudio iOS.a */, - B2CC503D197763A20041958E /* libcocosBuilder iOS.a */, - B2CC503F197763A20041958E /* libcocosSpine iOS.a */, - B2CC5041197763A20041958E /* libcocosNetwork iOS.a */, + 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */, + B2CC5039197763A20041958E /* libui iOS.a */, + B2CC503B197763A20041958E /* libcocostudio iOS.a */, + B2CC503D197763A20041958E /* libcocosbuilder iOS.a */, + B2CC503F197763A20041958E /* libspine iOS.a */, + B2CC5041197763A20041958E /* libnetwork iOS.a */, ); name = Products; sourceTree = ""; @@ -8107,17 +8113,17 @@ remoteRef = 1ABCA27F18CD90A50087CE3A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.dylib */ = { + 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx Mac.dylib"; + path = "libcocos2d Mac.a"; remoteRef = 46A15FAF1807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */ = { + 46A15FB21807A4F9005B8026 /* libextension Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx-extensions Mac.a"; + path = "libextension Mac.a"; remoteRef = 46A15FB11807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -8135,24 +8141,24 @@ remoteRef = 46A15FB51807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */ = { + 46A15FB81807A4F9005B8026 /* libcocosdenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libCocosDenshion Mac.a"; + path = "libcocosdenshion Mac.a"; remoteRef = 46A15FB71807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */ = { + 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx iOS.a"; + path = "libcocos2d iOS.a"; remoteRef = 46A15FBD1807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */ = { + 46A15FC01807A4F9005B8026 /* libextension iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocos2dx-extensions iOS.a"; + path = "libextension iOS.a"; remoteRef = 46A15FBF1807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -8170,80 +8176,80 @@ remoteRef = 46A15FC31807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */ = { + 46A15FC61807A4F9005B8026 /* libcocosdenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libCocosDenshion iOS.a"; + path = "libcocosdenshion iOS.a"; remoteRef = 46A15FC51807A4F9005B8026 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B244F3161976878700ED1926 /* libcocosNetwork Mac.a */ = { + B244F3161976878700ED1926 /* libnetwork Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosNetwork Mac.a"; + path = "libnetwork Mac.a"; remoteRef = B244F3151976878700ED1926 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2CC5039197763A20041958E /* libcocosGUI iOS.a */ = { + B2CC5039197763A20041958E /* libui iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosGUI iOS.a"; + path = "libui iOS.a"; remoteRef = B2CC5038197763A20041958E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2CC503B197763A20041958E /* libcocosStudio iOS.a */ = { + B2CC503B197763A20041958E /* libcocostudio iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosStudio iOS.a"; + path = "libcocostudio iOS.a"; remoteRef = B2CC503A197763A20041958E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2CC503D197763A20041958E /* libcocosBuilder iOS.a */ = { + B2CC503D197763A20041958E /* libcocosbuilder iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosBuilder iOS.a"; + path = "libcocosbuilder iOS.a"; remoteRef = B2CC503C197763A20041958E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2CC503F197763A20041958E /* libcocosSpine iOS.a */ = { + B2CC503F197763A20041958E /* libspine iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosSpine iOS.a"; + path = "libspine iOS.a"; remoteRef = B2CC503E197763A20041958E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2CC5041197763A20041958E /* libcocosNetwork iOS.a */ = { + B2CC5041197763A20041958E /* libnetwork iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosNetwork iOS.a"; + path = "libnetwork iOS.a"; remoteRef = B2CC5040197763A20041958E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2DB4799197668CA00411E16 /* libcocosGUI Mac.a */ = { + B2DB4799197668CA00411E16 /* libui Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosGUI Mac.a"; + path = "libui Mac.a"; remoteRef = B2DB4798197668CA00411E16 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2DB480819766E3C00411E16 /* libcocosBuilder Mac.a */ = { + B2DB480819766E3C00411E16 /* libcocosbuilder Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosBuilder Mac.a"; + path = "libcocosbuilder Mac.a"; remoteRef = B2DB480719766E3C00411E16 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2DB48C219767D3600411E16 /* libcocosStudio Mac.a */ = { + B2DB48C219767D3600411E16 /* libcocostudio Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosStudio Mac.a"; + path = "libcocostudio Mac.a"; remoteRef = B2DB48C119767D3600411E16 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - B2DB49391976819900411E16 /* libcocosSpine Mac.a */ = { + B2DB49391976819900411E16 /* libspine Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "libcocosSpine Mac.a"; + path = "libspine Mac.a"; remoteRef = B2DB49381976819900411E16 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -8880,6 +8886,7 @@ 1AC35B8118CECF0C00F37B72 /* SceneController.cpp in Sources */, 1AC35B3318CECF0C00F37B72 /* Test.cpp in Sources */, 1AC35C2318CECF0C00F37B72 /* ParticleTest.cpp in Sources */, + 295824591987415900F9746D /* UIScale9SpriteTest.cpp in Sources */, 1AC35C6118CECF0C00F37B72 /* TouchesTest.cpp in Sources */, 1AC35C6318CECF0C00F37B72 /* TransitionsTest.cpp in Sources */, 29080DB3191B595E0066F8DF /* UILayoutTest_Editor.cpp in Sources */, @@ -8962,6 +8969,7 @@ 1AC35BFA18CECF0C00F37B72 /* WebSocketTest.cpp in Sources */, 1AC35BF218CECF0C00F37B72 /* EditBoxTest.cpp in Sources */, 38FA2E74194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */, + 2958245A1987415900F9746D /* UIScale9SpriteTest.cpp in Sources */, 1AC35B3A18CECF0C00F37B72 /* Bug-1174.cpp in Sources */, 1AC35BE418CECF0C00F37B72 /* CCControlColourPickerTest.cpp in Sources */, 29080DD4191B595E0066F8DF /* UITextAtlasTest.cpp in Sources */, diff --git a/cocos/ui/CocosGUI.h b/cocos/ui/CocosGUI.h index 9f72d0eb32..5fc08abefc 100644 --- a/cocos/ui/CocosGUI.h +++ b/cocos/ui/CocosGUI.h @@ -50,6 +50,7 @@ THE SOFTWARE. #endif #include "ui/UIDeprecated.h" #include "ui/GUIExport.h" +#include "ui/UIScale9Sprite.h" NS_CC_BEGIN diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 97ac0326b8..35a767a69e 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -940,4 +940,34 @@ y+=ytranslate; \ { return _scale9Image; } + + void Scale9Sprite::setFlippedX(bool flippedX) + { + _flippedX = flippedX; + if (_scale9Enabled) { + this->setScaleX(-1); + }else{ + _scale9Image->setFlippedX(flippedX); + } + } + + void Scale9Sprite::setFlippedY(bool flippedY) + { + _flippedY = flippedY; + if (_scale9Enabled) { + this->setScaleY(-1); + }else{ + _scale9Image->setFlippedY(flippedY); + } + } + + bool Scale9Sprite::isFlippedX()const + { + return _flippedX; + } + + bool Scale9Sprite::isFlippedY()const + { + return _flippedY; + } }} diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 6396c09c98..c43ca7aab1 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -305,6 +305,43 @@ namespace ui { Sprite* getSprite()const; + /** + * Sets whether the widget should be flipped horizontally or not. + * + * @param bFlippedX true if the widget should be flipped horizaontally, false otherwise. + */ + virtual void setFlippedX(bool flippedX); + + /** + * Returns the flag which indicates whether the widget is flipped horizontally or not. + * + * It only flips the texture of the widget, and not the texture of the widget's children. + * Also, flipping the texture doesn't alter the anchorPoint. + * If you want to flip the anchorPoint too, and/or to flip the children too use: + * widget->setScaleX(sprite->getScaleX() * -1); + * + * @return true if the widget is flipped horizaontally, false otherwise. + */ + virtual bool isFlippedX()const; + + /** + * Sets whether the widget should be flipped vertically or not. + * + * @param bFlippedY true if the widget should be flipped vertically, flase otherwise. + */ + virtual void setFlippedY(bool flippedY); + + /** + * Return the flag which indicates whether the widget is flipped vertically or not. + * + * It only flips the texture of the widget, and not the texture of the widget's children. + * Also, flipping the texture doesn't alter the anchorPoint. + * If you want to flip the anchorPoint too, and/or to flip the children too use: + * widget->setScaleY(widget->getScaleY() * -1); + * + * @return true if the widget is flipped vertically, flase otherwise. + */ + virtual bool isFlippedY()const; protected: void updateCapInset(); @@ -364,6 +401,9 @@ namespace ui { Vector _protectedChildren; ///holds the 9 sprites bool _reorderProtectedChildDirty; + + bool _flippedX; + bool _flippedY; }; }} //end of namespace diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 0868b2f6a9..29fa20b5e6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -42,6 +42,18 @@ g_guisTests[] = Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } + }, + { + "Scale9 Sprite Test", + [](Ref* sender) + { + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIScale9SpriteTest); + sceneManager->setMinUISceneId(kUIScale9SpriteTest); + sceneManager->setMaxUISceneId(kUIS9Flip); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); + } }, { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp new file mode 100644 index 0000000000..9f595f617b --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -0,0 +1,661 @@ +/**************************************************************************** + 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 "UIScale9SpriteTest.h" +#include "testResource.h" + +// UIScale9SpriteTest +UIScale9SpriteTest::UIScale9SpriteTest() +{ + +} + +UIScale9SpriteTest::~UIScale9SpriteTest() +{ +} + +bool UIScale9SpriteTest::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + auto moveTo = MoveBy::create(1.0, Vec2(30,0)); + auto moveBack = moveTo->reverse(); + auto rotateBy = RotateBy::create(1.0, 180); + auto action = Sequence::create(moveTo,moveBack, rotateBy, NULL); + + + Sprite *normalSprite1 = Sprite::create("cocosui/animationbuttonnormal.png"); + normalSprite1->setPosition(100, 270); +// normalSprite1->setAnchorPoint(Vec2(0.5,0.5)); +// normalSprite1->setContentSize(Size(100,100)); + + this->addChild(normalSprite1); + normalSprite1->runAction((FiniteTimeAction*)action->clone()); + + ui::Scale9Sprite *normalSprite2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); + normalSprite2->setPosition(120, 270); + normalSprite2->setScale9Enabled(false); +// normalSprite2->setContentSize(Size(100,100)); +// normalSprite2->setAnchorPoint(Vec2(0.5,0.5)); + normalSprite2->setOpacity(100); + this->addChild(normalSprite2); + normalSprite2->setColor(Color3B::GREEN); + normalSprite2->runAction(action); + + auto action2 = action->clone(); + ui::Scale9Sprite *sp1 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); + sp1->setPosition(100, 160); + sp1->setScale(1.2); + sp1->setContentSize(Size(100,100)); + sp1->setColor(Color3B::GREEN); +// sp1->setScale9Enabled(false); + this->addChild(sp1); + sp1->runAction((FiniteTimeAction*)action2); + + cocos2d::ui::Scale9Sprite *sp2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); + sp2->setPosition(350, 160); + sp2->setPreferredSize(sp1->getContentSize() * 1.2); + sp2->setColor(Color3B::GREEN); + sp2->setContentSize(Size(100,100)); + + this->addChild(sp2); + auto action3 = action->clone(); + sp2->runAction((FiniteTimeAction*)action3); + + return true; + } + return false; +} + + +UIScale9SpriteHierarchialTest::UIScale9SpriteHierarchialTest() +{ + +} + +UIScale9SpriteHierarchialTest::~UIScale9SpriteHierarchialTest() +{ +} + +bool UIScale9SpriteHierarchialTest::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + auto moveTo = MoveBy::create(1.0, Vec2(30,0)); + auto moveBack = moveTo->reverse(); + auto rotateBy = RotateBy::create(1.0, 180); + auto fadeOut = FadeOut::create(2.0); + auto action = Sequence::create(moveTo,moveBack, rotateBy,fadeOut, NULL); + + + Sprite *normalSprite1 = Sprite::create("cocosui/animationbuttonnormal.png"); + normalSprite1->setPosition(100, 270); + // normalSprite1->setAnchorPoint(Vec2(0.5,0.5)); + // normalSprite1->setContentSize(Size(100,100)); + +// Sprite *childSprite = Sprite::create("cocosui/animationbuttonnormal.png"); + normalSprite1->setCascadeColorEnabled(true); + normalSprite1->setCascadeOpacityEnabled(true); + normalSprite1->setColor(Color3B::GREEN); + + + + this->addChild(normalSprite1); + normalSprite1->runAction((FiniteTimeAction*)action->clone()); + + ui::Scale9Sprite *normalSprite2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); +// normalSprite2->setPosition(120, 270); + normalSprite2->setScale9Enabled(false); + // normalSprite2->setContentSize(Size(100,100)); + // normalSprite2->setAnchorPoint(Vec2(0.5,0.5)); + normalSprite2->setOpacity(100); + normalSprite1->addChild(normalSprite2); + + auto action2 = action->clone(); + ui::Scale9Sprite *sp1 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); + sp1->setPosition(200, 160); + sp1->setScale(1.2); + sp1->setContentSize(Size(100,100)); + sp1->setColor(Color3B::GREEN); + // sp1->setScale9Enabled(false); + this->addChild(sp1); + sp1->runAction((FiniteTimeAction*)action2); + + cocos2d::ui::Scale9Sprite *sp2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); +// sp2->setPosition(350, 160); + sp2->setPreferredSize(sp1->getContentSize() * 1.2); + sp2->setColor(Color3B::GREEN); + sp2->setContentSize(Size(100,100)); + + sp1->addChild(sp2); +// auto action3 = action->clone(); +// sp2->runAction((FiniteTimeAction*)action3); + + return true; + } + return false; +} + +UIScale9SpriteTouchTest::UIScale9SpriteTouchTest() +{ + +} + +UIScale9SpriteTouchTest::~UIScale9SpriteTouchTest() +{ +} + +bool UIScale9SpriteTouchTest::init() +{ + if (UIScene::init()) + { + + Vec2 origin = Director::getInstance()->getVisibleOrigin(); + Size size = Director::getInstance()->getVisibleSize(); + + auto containerForSprite1 = Node::create(); + auto sprite1 = cocos2d::ui::Scale9Sprite::create("Images/CyanSquare.png"); +// sprite1->setScale9Enabled(false); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2) + Vec2(-80, 80)); + containerForSprite1->addChild(sprite1); + addChild(containerForSprite1, 10); + + auto sprite2 = ui::Scale9Sprite::create("Images/MagentaSquare.png"); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); +// sprite2->setCascadeOpacityEnabled(false); +// sprite2->setScale9Enabled(false); + + addChild(sprite2, 20); + + auto sprite3 = ui::Scale9Sprite::create("Images/YellowSquare.png"); + sprite3->setPosition(Vec2(0, 0)); + sprite3->setCascadeOpacityEnabled(false); + sprite2->addChild(sprite3, 1); +// sprite3->setScale9Enabled(false); + + + // Make sprite1 touchable + auto listener1 = EventListenerTouchOneByOne::create(); + listener1->setSwallowTouches(true); + + listener1->onTouchBegan = [](Touch* touch, Event* event){ + auto target = static_cast(event->getCurrentTarget()); + + Vec2 locationInNode = target->convertToNodeSpace(touch->getLocation()); + Size s = target->getContentSize(); + Rect rect = Rect(0, 0, s.width, s.height); + + if (rect.containsPoint(locationInNode)) + { + log("sprite began... x = %f, y = %f", locationInNode.x, locationInNode.y); + target->setOpacity(180); + return true; + } + return false; + }; + + listener1->onTouchMoved = [](Touch* touch, Event* event){ + auto target = static_cast(event->getCurrentTarget()); + target->setPosition(target->getPosition() + touch->getDelta()); + }; + + listener1->onTouchEnded = [=](Touch* touch, Event* event){ + auto target = static_cast(event->getCurrentTarget()); + log("sprite onTouchesEnded.. "); + target->setOpacity(255); + if (target == sprite2) + { + containerForSprite1->setLocalZOrder(100); + } + else if(target == sprite1) + { + containerForSprite1->setLocalZOrder(0); + } + }; + + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1, sprite1); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1->clone(), sprite2); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1->clone(), sprite3); + + return true; + } + return false; +} + +bool UIS9BatchNodeBasic::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + + auto sprite = Sprite::create("Images/blocks9.png"); + + auto blocks = ui::Scale9Sprite::create(); + + blocks->updateWithSprite(sprite, Rect(0, 0, 96, 96), false, Rect(0, 0, 96, 96)); + + blocks->setPosition(Vec2(x, y)); + + this->addChild(blocks); + + + return true; + } + + + return false; +} + +bool UIS9FrameNameSpriteSheet::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + + auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9.png"); + + blocks->setPosition(Vec2(x, y)); + + this->addChild(blocks); + + + return true; + } + + return false; +} + + +bool UIS9FrameNameSpriteSheetRotated::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + blocks->setPosition(Vec2(x, y)); + + this->addChild(blocks); + + return true; + } + + return false; +} + + +bool UIS9BatchNodeScaledNoInsets::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + // scaled without insets + auto sprite_scaled = Sprite::create("Images/blocks9.png"); + + auto blocks_scaled = ui::Scale9Sprite::create(); + blocks_scaled->updateWithSprite(sprite_scaled, Rect(0, 0, 96, 96), false, Rect(0, 0, 96, 96)); + + blocks_scaled->setPosition(Vec2(x, y)); + + blocks_scaled->setContentSize(Size(96 * 4, 96*2)); + + this->addChild(blocks_scaled); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetScaledNoInsets::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto blocks_scaled = ui::Scale9Sprite::createWithSpriteFrameName("blocks9.png"); + + blocks_scaled->setPosition(Vec2(x, y)); + + blocks_scaled->setContentSize(Size(96 * 4, 96*2)); + + this->addChild(blocks_scaled); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetRotatedScaledNoInsets::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + + auto blocks_scaled = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + blocks_scaled->setPosition(Vec2(x, y)); + + blocks_scaled->setContentSize(Size(96 * 4, 96*2)); + + this->addChild(blocks_scaled); + + return true; + } + return false; +} + + +bool UIS9BatchNodeScaleWithCapInsets::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + + auto sprite_scaled_with_insets = Sprite::create("Images/blocks9.png"); + + auto blocks_scaled_with_insets = ui::Scale9Sprite::create(); + + blocks_scaled_with_insets->updateWithSprite(sprite_scaled_with_insets, Rect(0, 0, 96, 96), false, Rect(32, 32, 32, 32)); + + blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); + + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + + this->addChild(blocks_scaled_with_insets); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetInsets::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + + auto blocks_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); + + blocks_with_insets->setPosition(Vec2(x, y)); + + this->addChild(blocks_with_insets); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetInsetsScaled::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); + + blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); + + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + + this->addChild(blocks_scaled_with_insets); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetRotatedInsets::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + auto blocks_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png", Rect(32, 32, 32, 32)); + + blocks_with_insets->setPosition(Vec2(x, y)); + + this->addChild(blocks_with_insets); + return true; + } + return false; +} + +bool UIS9_TexturePacker::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_ui_plist); + + float x = winSize.width / 4; + float y = 0 + (winSize.height / 2); + + auto s = ui::Scale9Sprite::createWithSpriteFrameName("button_normal.png"); + + s->setPosition(Vec2(x, y)); + + s->setContentSize(Size(14 * 16, 10 * 16)); + + this->addChild(s); + + x = winSize.width * 3/4; + + auto s2 = ui::Scale9Sprite::createWithSpriteFrameName("button_actived.png"); + + s2->setPosition(Vec2(x, y)); + + s2->setContentSize(Size(14 * 16, 10 * 16)); + + this->addChild(s2); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetRotatedInsetsScaled::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); + + blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); + + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + + this->addChild(blocks_scaled_with_insets); + return true; + } + return false; +} + +bool UIS9FrameNameSpriteSheetRotatedSetCapInsetLater::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + blocks_scaled_with_insets->setInsetLeft(32); + blocks_scaled_with_insets->setInsetRight(32); + + blocks_scaled_with_insets->setPreferredSize(Size(32*5.5f, 32*4)); + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + + this->addChild(blocks_scaled_with_insets); + return true; + } + return false; +} + +bool UIS9CascadeOpacityAndColor::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + auto rgba = Layer::create(); + rgba->setCascadeColorEnabled(true); + rgba->setCascadeOpacityEnabled(true); + this->addChild(rgba); + + + auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + + rgba->addChild(blocks_scaled_with_insets); + auto actions = Sequence::create(FadeIn::create(1), + TintTo::create(1, 0, 255, 0), + TintTo::create(1, 255, 255, 255), + FadeOut::create(1), + nullptr); + auto repeat = RepeatForever::create(actions); + rgba->runAction(repeat); + return true; + } + return false; +} + +bool UIS9ZOrder::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + this->addChild(blocks_scaled_with_insets); + + Sprite *normalSprite = Sprite::createWithSpriteFrameName("blocks9r.png"); + normalSprite->setColor(Color3B::RED); + blocks_scaled_with_insets->addChild(normalSprite); + + auto topLabel = Label::createWithSystemFont("I Must be On the Top", "Arial", 15); + topLabel->setPosition(Vec2(20,20)); + blocks_scaled_with_insets->addChild(topLabel); + + auto bottomLabel = Label::createWithSystemFont("I Must be On the Bottom", "Arial", 15); + bottomLabel->setPosition(Vec2(80,80)); + bottomLabel->setColor(Color3B::BLUE); + blocks_scaled_with_insets->addChild(bottomLabel,-1); + + return true; + } + return false; +} + +bool UIS9Flip::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + + auto normalSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + normalSprite->setPosition(Vec2(x, y )); + this->addChild(normalSprite); + + + auto normalLabel = Label::createWithSystemFont("Normal Sprite","Airal",10); + normalLabel->setPosition(normalSprite->getPosition() + Vec2(0, normalSprite->getContentSize().height/2 + 10)); + this->addChild(normalLabel); + + + + auto flipXSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + flipXSprite->setPosition(Vec2(x - 120, y )); + this->addChild(flipXSprite); + + flipXSprite->setFlippedX(true); + + auto flipXLabel = Label::createWithSystemFont("Sprite FlipX","Airal",10); + flipXLabel->setPosition(flipXSprite->getPosition() + Vec2(0, flipXSprite->getContentSize().height/2 + 10)); + this->addChild(flipXLabel); + + + auto flipYSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + flipYSprite->setPosition(Vec2(x + 120, y)); + this->addChild(flipYSprite); + + flipYSprite->setFlippedY(true); + + auto flipYLabel = Label::createWithSystemFont("Sprite FlipY","Airal",10); + flipYLabel->setPosition(flipYSprite->getPosition() + Vec2(0, flipYSprite->getContentSize().height/2 + 10)); + this->addChild(flipYLabel); + + return true; + } + return false; +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h new file mode 100644 index 0000000000..f57827ca35 --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h @@ -0,0 +1,259 @@ +/**************************************************************************** + 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 __cocos2d_tests__UIScale9SpriteTest__ +#define __cocos2d_tests__UIScale9SpriteTest__ +#include "UIScene.h" + +class UIScale9SpriteTest : public UIScene +{ +public: + UIScale9SpriteTest(); + ~UIScale9SpriteTest(); + bool init(); + +protected: + UI_SCENE_CREATE_FUNC(UIScale9SpriteTest) +}; + +class UIScale9SpriteHierarchialTest : public UIScene +{ +public: + UIScale9SpriteHierarchialTest(); + ~UIScale9SpriteHierarchialTest(); + bool init(); + +protected: + UI_SCENE_CREATE_FUNC(UIScale9SpriteHierarchialTest) +}; + +class UIScale9SpriteTouchTest : public UIScene +{ +public: + UIScale9SpriteTouchTest(); + ~UIScale9SpriteTouchTest(); + bool init(); + +protected: + UI_SCENE_CREATE_FUNC(UIScale9SpriteTouchTest) +}; + +// S9BatchNodeBasic + +class UIS9BatchNodeBasic : public UIScene +{ +public: + CREATE_FUNC(UIS9BatchNodeBasic); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9BatchNodeBasic) +}; + +// S9FrameNameSpriteSheet + +class UIS9FrameNameSpriteSheet : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheet); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheet) + +}; + +// S9FrameNameSpriteSheetRotated + +class UIS9FrameNameSpriteSheetRotated : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetRotated); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetRotated) +}; + +// S9BatchNodeScaledNoInsets + +class UIS9BatchNodeScaledNoInsets : public UIScene +{ +public: + CREATE_FUNC(UIS9BatchNodeScaledNoInsets); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9BatchNodeScaledNoInsets) +}; + +// S9FrameNameSpriteSheetScaledNoInsets + +class UIS9FrameNameSpriteSheetScaledNoInsets : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetScaledNoInsets); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetScaledNoInsets) +}; + +// S9FrameNameSpriteSheetRotatedScaledNoInsets + +class UIS9FrameNameSpriteSheetRotatedScaledNoInsets : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedScaledNoInsets); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedScaledNoInsets) +}; + + +// S9BatchNodeScaleWithCapInsets + +class UIS9BatchNodeScaleWithCapInsets : public UIScene +{ +public: + CREATE_FUNC(UIS9BatchNodeScaleWithCapInsets); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9BatchNodeScaleWithCapInsets) +}; + +// S9FrameNameSpriteSheetInsets + +class UIS9FrameNameSpriteSheetInsets : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetInsets); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetInsets) +}; + +// S9FrameNameSpriteSheetInsetsScaled + +class UIS9FrameNameSpriteSheetInsetsScaled : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetInsetsScaled); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetInsetsScaled) +}; + +// S9FrameNameSpriteSheetRotatedInsets + +class UIS9FrameNameSpriteSheetRotatedInsets : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedInsets); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedInsets) +}; + +// S9_TexturePacker + +class UIS9_TexturePacker : public UIScene +{ +public: + CREATE_FUNC(UIS9_TexturePacker); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9_TexturePacker) + +}; + +// S9FrameNameSpriteSheetRotatedInsetsScaled + +class UIS9FrameNameSpriteSheetRotatedInsetsScaled : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedInsetsScaled); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedInsetsScaled) +}; + +// S9FrameNameSpriteSheetRotatedInsetsScaled + +class UIS9FrameNameSpriteSheetRotatedSetCapInsetLater : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedSetCapInsetLater); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9FrameNameSpriteSheetRotatedSetCapInsetLater) +}; + +// S9CascadeOpacityAndColor + +class UIS9CascadeOpacityAndColor : public UIScene +{ +public: + CREATE_FUNC(UIS9CascadeOpacityAndColor); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9CascadeOpacityAndColor) +}; + +// Scale9Sprite ZOrder + +class UIS9ZOrder : public UIScene +{ +public: + CREATE_FUNC(UIS9ZOrder); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9ZOrder) + +}; + +// Scale9Sprite Flip + +class UIS9Flip : public UIScene +{ +public: + CREATE_FUNC(UIS9Flip); + + bool init(); +protected: + UI_SCENE_CREATE_FUNC(UIS9Flip) +}; + + +#endif /* defined(__cocos2d_tests__UIScale9SpriteTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 05b505b6cd..532e36be2b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -21,6 +21,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif +#include "UIScale9SpriteTest.h" /* #include "UISwitchTest/UISwitchTest.h" */ @@ -126,6 +127,25 @@ static const char* s_testArray[] = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) "UIVideoPlayerTest" #endif + "UIScale9SpriteTest", + "UIScale9SpriteHierarchialTest", + "UIScale9SpriteTouchTest", + "UIS9BatchNodeBasic", + "UIS9FrameNameSpriteSheet", + "UIS9FrameNameSpriteSheetRotated", + "UIS9BatchNodeScaledNoInsets", + "UIS9FrameNameSpriteSheetScaledNoInsets", + "UIS9FrameNameSpriteSheetRotatedScaledNoInsets", + "UIS9BatchNodeScaleWithCapInsets", + "UIS9FrameNameSpriteSheetInsets", + "UIS9FrameNameSpriteSheetInsetsScaled", + "UIS9FrameNameSpriteSheetRotatedInsets", + "UIS9_TexturePacker", + "UIS9FrameNameSpriteSheetRotatedInsetsScaled", + "UIS9FrameNameSpriteSheetRotatedSetCapInsetLater", + "UIS9CascadeOpacityAndColor", + "UIS9ZOrder", + "UIS9Flip", }; static UISceneManager *sharedInstance = nullptr; @@ -329,6 +349,44 @@ Scene *UISceneManager::currentUIScene() case kUIVideoPlayerTest: return VideoPlayerTest::sceneWithTitle(s_testArray[_currentUISceneId]); #endif + case kUIScale9SpriteTest: + return UIScale9SpriteTest::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIScale9SpriteHierarchialTest: + return UIScale9SpriteHierarchialTest::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIScale9SpriteTouchTest: + return UIScale9SpriteTouchTest::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9BatchNodeBasic: + return UIS9BatchNodeBasic::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheet: + return UIS9FrameNameSpriteSheet::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetRotated: + return UIS9FrameNameSpriteSheetRotated::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9BatchNodeScaledNoInsets: + return UIS9BatchNodeScaledNoInsets::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetScaledNoInsets: + return UIS9FrameNameSpriteSheetScaledNoInsets::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetRotatedScaledNoInsets: + return UIS9FrameNameSpriteSheetRotatedScaledNoInsets::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9BatchNodeScaleWithCapInsets: + return UIS9BatchNodeScaleWithCapInsets::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetInsets: + return UIS9FrameNameSpriteSheetInsets::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetInsetsScaled: + return UIS9FrameNameSpriteSheetInsetsScaled::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetRotatedInsets: + return UIS9FrameNameSpriteSheetRotatedInsets::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9_TexturePacker: + return UIS9_TexturePacker::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetRotatedInsetsScaled: + return UIS9FrameNameSpriteSheetRotatedInsetsScaled::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9FrameNameSpriteSheetRotatedSetCapInsetLater: + return UIS9FrameNameSpriteSheetRotatedSetCapInsetLater::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9CascadeOpacityAndColor: + return UIS9CascadeOpacityAndColor::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9ZOrder: + return UIS9ZOrder::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIS9Flip: + return UIS9Flip::sceneWithTitle(s_testArray[_currentUISceneId]); } return nullptr; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index bbdf68dec1..a9df5c9437 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -113,6 +113,25 @@ enum #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) kUIVideoPlayerTest, #endif + kUIScale9SpriteTest, + kUIScale9SpriteHierarchialTest, + kUIScale9SpriteTouchTest, + kUIS9BatchNodeBasic, + kUIS9FrameNameSpriteSheet, + kUIS9FrameNameSpriteSheetRotated, + kUIS9BatchNodeScaledNoInsets, + kUIS9FrameNameSpriteSheetScaledNoInsets, + kUIS9FrameNameSpriteSheetRotatedScaledNoInsets, + kUIS9BatchNodeScaleWithCapInsets, + kUIS9FrameNameSpriteSheetInsets, + kUIS9FrameNameSpriteSheetInsetsScaled, + kUIS9FrameNameSpriteSheetRotatedInsets, + kUIS9_TexturePacker, + kUIS9FrameNameSpriteSheetRotatedInsetsScaled, + kUIS9FrameNameSpriteSheetRotatedSetCapInsetLater, + kUIS9CascadeOpacityAndColor, + kUIS9ZOrder, + kUIS9Flip, kUITestMax }; From 1daaea14109311d04af59503cc510ca2a53e63fb Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 14:57:45 +0800 Subject: [PATCH 27/57] remove extension::Scale9Sprite dependency --- cocos/ui/UIButton.cpp | 26 ++++++++++++------------- cocos/ui/UIImageView.cpp | 12 ++++++------ cocos/ui/UILayout.cpp | 12 ++++++------ cocos/ui/UIListView.cpp | 2 +- cocos/ui/UILoadingBar.cpp | 12 ++++++------ cocos/ui/UISlider.cpp | 24 +++++++++++------------ tests/cpp-tests/Classes/AppDelegate.cpp | 2 +- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 6cfdbecc86..3aba1b3cf8 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ui/UIButton.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" #include "2d/CCLabel.h" #include "2d/CCSprite.h" #include "2d/CCActionInterval.h" @@ -163,9 +163,9 @@ void Button::setScale9Enabled(bool able) _buttonDisableRenderer = nullptr; if (_scale9Enabled) { - _buttonNormalRenderer = extension::Scale9Sprite::create(); - _buttonClickedRenderer = extension::Scale9Sprite::create(); - _buttonDisableRenderer = extension::Scale9Sprite::create(); + _buttonNormalRenderer = Scale9Sprite::create(); + _buttonClickedRenderer = Scale9Sprite::create(); + _buttonDisableRenderer = Scale9Sprite::create(); } else { @@ -230,7 +230,7 @@ void Button::loadTextureNormal(const std::string& normal,TextureResType texType) _normalTexType = texType; if (_scale9Enabled) { - extension::Scale9Sprite* normalRendererScale9 = static_cast(_buttonNormalRenderer); + Scale9Sprite* normalRendererScale9 = static_cast(_buttonNormalRenderer); switch (_normalTexType) { case TextureResType::LOCAL: @@ -278,7 +278,7 @@ void Button::loadTexturePressed(const std::string& selected,TextureResType texTy _pressedTexType = texType; if (_scale9Enabled) { - extension::Scale9Sprite* clickedRendererScale9 = static_cast(_buttonClickedRenderer); + Scale9Sprite* clickedRendererScale9 = static_cast(_buttonClickedRenderer); switch (_pressedTexType) { case TextureResType::LOCAL: @@ -325,7 +325,7 @@ void Button::loadTextureDisabled(const std::string& disabled,TextureResType texT _disabledTexType = texType; if (_scale9Enabled) { - extension::Scale9Sprite* disabledScale9 = static_cast(_buttonDisableRenderer); + Scale9Sprite* disabledScale9 = static_cast(_buttonDisableRenderer); switch (_disabledTexType) { case TextureResType::LOCAL: @@ -376,7 +376,7 @@ void Button::setCapInsetsNormalRenderer(const Rect &capInsets) { return; } - static_cast(_buttonNormalRenderer)->setCapInsets(capInsets); + static_cast(_buttonNormalRenderer)->setCapInsets(capInsets); } const Rect& Button::getCapInsetsNormalRenderer()const @@ -391,7 +391,7 @@ void Button::setCapInsetsPressedRenderer(const Rect &capInsets) { return; } - static_cast(_buttonClickedRenderer)->setCapInsets(capInsets); + static_cast(_buttonClickedRenderer)->setCapInsets(capInsets); } const Rect& Button::getCapInsetsPressedRenderer()const @@ -406,7 +406,7 @@ void Button::setCapInsetsDisabledRenderer(const Rect &capInsets) { return; } - static_cast(_buttonDisableRenderer)->setCapInsets(capInsets); + static_cast(_buttonDisableRenderer)->setCapInsets(capInsets); } const Rect& Button::getCapInsetsDisabledRenderer()const @@ -605,7 +605,7 @@ void Button::normalTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_buttonNormalRenderer)->setPreferredSize(_contentSize); + static_cast(_buttonNormalRenderer)->setPreferredSize(_contentSize); _normalTextureScaleXInSize = _normalTextureScaleYInSize = 1.0f; } else @@ -641,7 +641,7 @@ void Button::pressedTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_buttonClickedRenderer)->setPreferredSize(_contentSize); + static_cast(_buttonClickedRenderer)->setPreferredSize(_contentSize); _pressedTextureScaleXInSize = _pressedTextureScaleYInSize = 1.0f; } else @@ -676,7 +676,7 @@ void Button::disabledTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_buttonDisableRenderer)->setPreferredSize(_contentSize); + static_cast(_buttonDisableRenderer)->setPreferredSize(_contentSize); } else { diff --git a/cocos/ui/UIImageView.cpp b/cocos/ui/UIImageView.cpp index 6f3471e0b7..13e374fc4d 100644 --- a/cocos/ui/UIImageView.cpp +++ b/cocos/ui/UIImageView.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ui/UIImageView.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" #include "2d/CCSprite.h" NS_CC_BEGIN @@ -32,7 +32,7 @@ namespace ui { #define STATIC_CAST_CCSPRITE static_cast(_imageRenderer) -#define STATIC_CAST_SCALE9SPRITE static_cast(_imageRenderer) +#define STATIC_CAST_SCALE9SPRITE static_cast(_imageRenderer) static const int IMAGE_RENDERER_Z = (-1); @@ -125,7 +125,7 @@ void ImageView::loadTexture(const std::string& fileName, TextureResType texType) case TextureResType::LOCAL: if (_scale9Enabled) { - extension::Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE; + Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE; imageRendererScale9->initWithFile(fileName); imageRendererScale9->setCapInsets(_capInsets); } @@ -138,7 +138,7 @@ void ImageView::loadTexture(const std::string& fileName, TextureResType texType) case TextureResType::PLIST: if (_scale9Enabled) { - extension::Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE; + Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE; imageRendererScale9->initWithSpriteFrameName(fileName); imageRendererScale9->setCapInsets(_capInsets); } @@ -210,7 +210,7 @@ void ImageView::setScale9Enabled(bool able) _imageRenderer = nullptr; if (_scale9Enabled) { - _imageRenderer = extension::Scale9Sprite::create(); + _imageRenderer = Scale9Sprite::create(); } else { @@ -298,7 +298,7 @@ void ImageView::imageTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_imageRenderer)->setPreferredSize(_contentSize); + static_cast(_imageRenderer)->setPreferredSize(_contentSize); } else { diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 30900fe515..9c0074867a 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "ui/UILayout.h" #include "ui/UIHelper.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" #include "base/CCDirector.h" @@ -577,7 +577,7 @@ void Layout::onSizeChanged() _backGroundImage->setPosition(Vec2(_contentSize.width/2.0f, _contentSize.height/2.0f)); if (_backGroundScale9Enabled && _backGroundImage) { - static_cast(_backGroundImage)->setPreferredSize(_contentSize); + static_cast(_backGroundImage)->setPreferredSize(_contentSize); } } if (_colorRender) @@ -623,7 +623,7 @@ void Layout::setBackGroundImage(const std::string& fileName,TextureResType texTy _bgImageTexType = texType; if (_backGroundScale9Enabled) { - extension::Scale9Sprite* bgiScale9 = static_cast(_backGroundImage); + Scale9Sprite* bgiScale9 = static_cast(_backGroundImage); switch (_bgImageTexType) { case TextureResType::LOCAL: @@ -661,7 +661,7 @@ void Layout::setBackGroundImageCapInsets(const Rect &capInsets) _backGroundImageCapInsets = capInsets; if (_backGroundScale9Enabled && _backGroundImage) { - static_cast(_backGroundImage)->setCapInsets(capInsets); + static_cast(_backGroundImage)->setCapInsets(capInsets); } } @@ -708,9 +708,9 @@ void Layout::addBackGroundImage() { if (_backGroundScale9Enabled) { - _backGroundImage = extension::Scale9Sprite::create(); + _backGroundImage = Scale9Sprite::create(); addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); - static_cast(_backGroundImage)->setPreferredSize(_contentSize); + static_cast(_backGroundImage)->setPreferredSize(_contentSize); } else { diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index 5689f49be1..3927243c7f 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "ui/UIListView.h" #include "ui/UIHelper.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" NS_CC_BEGIN diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index 6e7e34415d..f5644dbf9c 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ui/UILoadingBar.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" #include "2d/CCSprite.h" NS_CC_BEGIN @@ -136,7 +136,7 @@ void LoadingBar::loadTexture(const std::string& texture,TextureResType texType) case TextureResType::LOCAL: if (_scale9Enabled) { - extension::Scale9Sprite* barRendererScale9 = static_cast(_barRenderer); + Scale9Sprite* barRendererScale9 = static_cast(_barRenderer); barRendererScale9->initWithFile(texture); barRendererScale9->setCapInsets(_capInsets); } @@ -148,7 +148,7 @@ void LoadingBar::loadTexture(const std::string& texture,TextureResType texType) case TextureResType::PLIST: if (_scale9Enabled) { - extension::Scale9Sprite* barRendererScale9 = static_cast(_barRenderer); + Scale9Sprite* barRendererScale9 = static_cast(_barRenderer); barRendererScale9->initWithSpriteFrameName(texture); barRendererScale9->setCapInsets(_capInsets); } @@ -196,7 +196,7 @@ void LoadingBar::setScale9Enabled(bool enabled) _barRenderer = nullptr; if (_scale9Enabled) { - _barRenderer = extension::Scale9Sprite::create(); + _barRenderer = Scale9Sprite::create(); } else { @@ -230,7 +230,7 @@ void LoadingBar::setCapInsets(const Rect &capInsets) { return; } - static_cast(_barRenderer)->setCapInsets(capInsets); + static_cast(_barRenderer)->setCapInsets(capInsets); } const Rect& LoadingBar::getCapInsets()const @@ -351,7 +351,7 @@ void LoadingBar::barRendererScaleChangedWithSize() void LoadingBar::setScale9Scale() { float width = (float)(_percent) / 100.0f * _totalLength; - static_cast(_barRenderer)->setPreferredSize(Size(width, _contentSize.height)); + static_cast(_barRenderer)->setPreferredSize(Size(width, _contentSize.height)); } std::string LoadingBar::getDescription() const diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 642749d540..0ed75696c2 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ui/UISlider.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" #include "2d/CCSprite.h" NS_CC_BEGIN @@ -128,7 +128,7 @@ void Slider::loadBarTexture(const std::string& fileName, TextureResType texType) case TextureResType::LOCAL: if (_scale9Enabled) { - static_cast(_barRenderer)->initWithFile(fileName); + static_cast(_barRenderer)->initWithFile(fileName); } else { @@ -138,7 +138,7 @@ void Slider::loadBarTexture(const std::string& fileName, TextureResType texType) case TextureResType::PLIST: if (_scale9Enabled) { - static_cast(_barRenderer)->initWithSpriteFrameName(fileName); + static_cast(_barRenderer)->initWithSpriteFrameName(fileName); } else { @@ -167,7 +167,7 @@ void Slider::loadProgressBarTexture(const std::string& fileName, TextureResType case TextureResType::LOCAL: if (_scale9Enabled) { - static_cast(_progressBarRenderer)->initWithFile(fileName); + static_cast(_progressBarRenderer)->initWithFile(fileName); } else { @@ -177,7 +177,7 @@ void Slider::loadProgressBarTexture(const std::string& fileName, TextureResType case TextureResType::PLIST: if (_scale9Enabled) { - static_cast(_progressBarRenderer)->initWithSpriteFrameName(fileName); + static_cast(_progressBarRenderer)->initWithSpriteFrameName(fileName); } else { @@ -207,8 +207,8 @@ void Slider::setScale9Enabled(bool able) _progressBarRenderer = nullptr; if (_scale9Enabled) { - _barRenderer = extension::Scale9Sprite::create(); - _progressBarRenderer = extension::Scale9Sprite::create(); + _barRenderer = Scale9Sprite::create(); + _progressBarRenderer = Scale9Sprite::create(); } else { @@ -260,7 +260,7 @@ void Slider::setCapInsetsBarRenderer(const Rect &capInsets) { return; } - static_cast(_barRenderer)->setCapInsets(capInsets); + static_cast(_barRenderer)->setCapInsets(capInsets); } const Rect& Slider::getCapInsetsBarRenderer()const @@ -275,7 +275,7 @@ void Slider::setCapInsetProgressBarRebderer(const Rect &capInsets) { return; } - static_cast(_progressBarRenderer)->setCapInsets(capInsets); + static_cast(_progressBarRenderer)->setCapInsets(capInsets); } const Rect& Slider::getCapInsetsProgressBarRebderer()const @@ -369,7 +369,7 @@ void Slider::setPercent(int percent) _slidBallRenderer->setPosition(Vec2(dis, _contentSize.height / 2.0f)); if (_scale9Enabled) { - static_cast(_progressBarRenderer)->setPreferredSize(Size(dis,_progressBarTextureSize.height)); + static_cast(_progressBarRenderer)->setPreferredSize(Size(dis,_progressBarTextureSize.height)); } else { @@ -497,7 +497,7 @@ void Slider::barRendererScaleChangedWithSize() _barLength = _contentSize.width; if (_scale9Enabled) { - static_cast(_barRenderer)->setPreferredSize(_contentSize); + static_cast(_barRenderer)->setPreferredSize(_contentSize); } else { @@ -534,7 +534,7 @@ void Slider::progressBarRendererScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_progressBarRenderer)->setPreferredSize(_contentSize); + static_cast(_progressBarRenderer)->setPreferredSize(_contentSize); _progressBarTextureSize = _progressBarRenderer->getContentSize(); } else diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index 1ca5f4ba2d..c794e23f51 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -108,7 +108,7 @@ bool AppDelegate::applicationDidFinishLaunching() // a bug in DirectX 11 level9-x on the device prevents ResolutionPolicy::NO_BORDER from working correctly glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL); #else - glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); + glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL); #endif auto scene = Scene::create(); From c5ca0dbf10511628964ffc996d80c4bd895f9891 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 15:25:50 +0800 Subject: [PATCH 28/57] fix android and linux compile error --- cocos/ui/Android.mk | 1 + cocos/ui/CMakeLists.txt | 1 + tests/cpp-tests/Android.mk | 1 + tests/cpp-tests/CMakeLists.txt | 1 + .../CocoStudioGUITest/UISceneManager.cpp | 2 +- .../UITest/CocoStudioGUITest/UISceneManager.h | 26 ------------------- 6 files changed, 5 insertions(+), 27 deletions(-) diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index fed4a17385..3b5645ec2a 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -31,6 +31,7 @@ UIVBox.cpp \ UIRelativeBox.cpp \ UIVideoPlayerAndroid.cpp \ UIDeprecated.cpp \ +UIScale9Sprite.cpp \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/../editor-support diff --git a/cocos/ui/CMakeLists.txt b/cocos/ui/CMakeLists.txt index cd7066589d..4c7db6c1fd 100644 --- a/cocos/ui/CMakeLists.txt +++ b/cocos/ui/CMakeLists.txt @@ -23,5 +23,6 @@ set(COCOS_UI_SRC ui/UIVBox.cpp ui/UIWidget.cpp ui/UIDeprecated.cpp + ui/UIScale9Sprite.cpp ) diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 63b7f7ac82..64e2f581fe 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -68,6 +68,7 @@ Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp \ Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp \ Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp \ Classes/UITest/CocoStudioGUITest/UIScene.cpp \ +Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp \ Classes/UITest/CocoStudioGUITest/UISceneManager.cpp \ Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp \ diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 48267493f4..4fa705d785 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -80,6 +80,7 @@ set(SAMPLE_SRC Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp Classes/UITest/CocoStudioGUITest/UIScene.cpp + Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp Classes/UITest/CocoStudioGUITest/UISceneManager.cpp Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 532e36be2b..a7873d9b69 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -125,7 +125,7 @@ static const char* s_testArray[] = "UIFocusTest-NestedLayout3", "UIFocusTest-ListView", #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - "UIVideoPlayerTest" + "UIVideoPlayerTest", #endif "UIScale9SpriteTest", "UIScale9SpriteHierarchialTest", diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index a9df5c9437..43ba39534e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -39,14 +39,6 @@ enum kUICheckBoxTest, kUISliderTest, kUISliderTest_Scale9, - /* - kUIPotentiometerTest, - */ - /* - kUISwitchTest_Horizontal, - kUISwitchTest_Vertical, - kUISwitchTest_VerticalAndTitleVertical, - */ kUIImageViewTest, kUIImageViewTest_Scale9, kUIImageViewTest_ContentSize, @@ -54,15 +46,6 @@ enum kUILoadingBarTest_Right, kUILoadingBarTest_Left_Scale9, kUILoadingBarTest_Right_Scale9, - /* - kUIProgressTimerTest_Radial, - kUIProgressTimerTest_Horizontal, - kUIProgressTimerTest_Vertical, - kUIProgressTimerTest_RadialMidpointChanged, - kUIProgressTimerTest_BarVarious, - kUIProgressTimerTest_BarTintAndFade, - kUIProgressTimerTest_WithSpriteFrame, - */ kUITextAtlasTest, kUITextTest, kUITextTest_LineWrap, @@ -84,9 +67,6 @@ enum kUILayoutTest_Layout_Linear_Horizontal, kUILayoutTest_Layout_Relative_Align_Parent, kUILayoutTest_Layout_Relative_Location, - /* - kUILayoutTest_Layout_Grid, - */ kUIScrollViewTest_Vertical, kUIScrollViewTest_Horizontal, kUIScrollViewTest_Both, @@ -96,12 +76,6 @@ enum kUIPageViewButtonTest, kUIListViewTest_Vertical, kUIListViewTest_Horizontal, - /* - kUIGridViewTest_Mode_Column, - kUIGridViewTest_Mode_Row, - kUIPickerViewTest_Vertical, - kUIPickerViewTest_Horizontal, - */ kUIWidgetAddNodeTest, kUIRichTextTest, KUIFocusTest_HBox, From 3bee93a156a5aca57555b066863a99a052c6fb90 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 16:43:20 +0800 Subject: [PATCH 29/57] add target to build All target --- build/cocos2d_libs.xcodeproj/project.pbxproj | 130 +++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index e0e6014740..5cd6f2cac0 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -13,6 +13,11 @@ buildPhases = ( ); dependencies = ( + B2F0AFEC198794EE002FE562 /* PBXTargetDependency */, + B2F0AFEE198794EE002FE562 /* PBXTargetDependency */, + B2F0AFF0198794EE002FE562 /* PBXTargetDependency */, + B2F0AFF2198794EE002FE562 /* PBXTargetDependency */, + B2F0AFF4198794EE002FE562 /* PBXTargetDependency */, A03F31FF178147CB006731B9 /* PBXTargetDependency */, A03F2FC01781458C006731B9 /* PBXTargetDependency */, A03F2E93178141D1006731B9 /* PBXTargetDependency */, @@ -28,6 +33,11 @@ buildPhases = ( ); dependencies = ( + B2F0AFF619879508002FE562 /* PBXTargetDependency */, + B2F0AFF819879508002FE562 /* PBXTargetDependency */, + B2F0AFFA19879508002FE562 /* PBXTargetDependency */, + B2F0AFFC19879508002FE562 /* PBXTargetDependency */, + B2F0AFFE19879508002FE562 /* PBXTargetDependency */, A07A4E10178386520073F6A7 /* PBXTargetDependency */, A07A5047178389710073F6A7 /* PBXTargetDependency */, A07A5049178389710073F6A7 /* PBXTargetDependency */, @@ -1932,6 +1942,76 @@ remoteGlobalIDString = A07A4F9F178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; + B2F0AFEB198794EE002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B245F10019766132001920FD; + remoteInfo = "libui Mac"; + }; + B2F0AFED198794EE002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B2DB48161976716E00411E16; + remoteInfo = "libcocostudio Mac"; + }; + B2F0AFEF198794EE002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B2DB479B197669A100411E16; + remoteInfo = "libcocosbuilder Mac"; + }; + B2F0AFF1198794EE002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B2DB48CA19767F1F00411E16; + remoteInfo = "libspine Mac"; + }; + B2F0AFF3198794EE002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B2DB498D197686CB00411E16; + remoteInfo = "libnetwork Mac"; + }; + B2F0AFF519879508002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B24EEA2C19775E92004493CC; + remoteInfo = "libui iOS"; + }; + B2F0AFF719879508002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B24EEA6719775EBB004493CC; + remoteInfo = "libcocostudio iOS"; + }; + B2F0AFF919879508002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B24EEA6F19775ECE004493CC; + remoteInfo = "libcocosbuilder iOS"; + }; + B2F0AFFB19879508002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B24EEA7719775EE1004493CC; + remoteInfo = "libspine iOS"; + }; + B2F0AFFD19879508002FE562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1551A336158F2AB200E66CFE /* Project object */; + proxyType = 1; + remoteGlobalIDString = B24EEA7F19775EF3004493CC; + remoteInfo = "libnetwork iOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -7622,6 +7702,56 @@ target = A07A4F9F178387730073F6A7 /* libcocosdenshion iOS */; targetProxy = A07A504C178389710073F6A7 /* PBXContainerItemProxy */; }; + B2F0AFEC198794EE002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B245F10019766132001920FD /* libui Mac */; + targetProxy = B2F0AFEB198794EE002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFEE198794EE002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B2DB48161976716E00411E16 /* libcocostudio Mac */; + targetProxy = B2F0AFED198794EE002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFF0198794EE002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B2DB479B197669A100411E16 /* libcocosbuilder Mac */; + targetProxy = B2F0AFEF198794EE002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFF2198794EE002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B2DB48CA19767F1F00411E16 /* libspine Mac */; + targetProxy = B2F0AFF1198794EE002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFF4198794EE002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B2DB498D197686CB00411E16 /* libnetwork Mac */; + targetProxy = B2F0AFF3198794EE002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFF619879508002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B24EEA2C19775E92004493CC /* libui iOS */; + targetProxy = B2F0AFF519879508002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFF819879508002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B24EEA6719775EBB004493CC /* libcocostudio iOS */; + targetProxy = B2F0AFF719879508002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFFA19879508002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B24EEA6F19775ECE004493CC /* libcocosbuilder iOS */; + targetProxy = B2F0AFF919879508002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFFC19879508002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B24EEA7719775EE1004493CC /* libspine iOS */; + targetProxy = B2F0AFFB19879508002FE562 /* PBXContainerItemProxy */; + }; + B2F0AFFE19879508002FE562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B24EEA7F19775EF3004493CC /* libnetwork iOS */; + targetProxy = B2F0AFFD19879508002FE562 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ From 5a226364414fa6b777299879ade2310ac0023930 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 17:51:34 +0800 Subject: [PATCH 30/57] fix windows compile error --- cocos/ui/UIScale9Sprite.h | 3 ++- cocos/ui/proj.win32/libui.vcxproj | 2 ++ cocos/ui/proj.win32/libui.vcxproj.filters | 6 ++++++ cocos/ui/proj.wp8/libGUI.vcxproj | 2 ++ cocos/ui/proj.wp8/libGUI.vcxproj.filters | 6 ++++++ tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 ++ tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters | 6 ++++++ .../cpp-testsComponent/cpp-testsComponent.vcxproj | 2 ++ .../cpp-testsComponent/cpp-testsComponent.vcxproj.filters | 6 ++++++ 9 files changed, 34 insertions(+), 1 deletion(-) diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index c43ca7aab1..f20f1ec803 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -29,6 +29,7 @@ #include "2d/CCSpriteFrame.h" #include "2d/CCSpriteBatchNode.h" #include "base/CCPlatformMacros.h" +#include "ui/GUIExport.h" NS_CC_BEGIN namespace ui { @@ -42,7 +43,7 @@ namespace ui { * scaled. * */ - class Scale9Sprite : public Node + class CC_GUI_DLL Scale9Sprite : public Node { public: /** diff --git a/cocos/ui/proj.win32/libui.vcxproj b/cocos/ui/proj.win32/libui.vcxproj index 689fcf70d2..aca6916e12 100644 --- a/cocos/ui/proj.win32/libui.vcxproj +++ b/cocos/ui/proj.win32/libui.vcxproj @@ -28,6 +28,7 @@ + @@ -54,6 +55,7 @@ + diff --git a/cocos/ui/proj.win32/libui.vcxproj.filters b/cocos/ui/proj.win32/libui.vcxproj.filters index 52a45d5fe0..16d4aa4cbc 100644 --- a/cocos/ui/proj.win32/libui.vcxproj.filters +++ b/cocos/ui/proj.win32/libui.vcxproj.filters @@ -93,6 +93,9 @@ System + + BaseClasses + @@ -167,5 +170,8 @@ System + + BaseClasses + \ No newline at end of file diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj b/cocos/ui/proj.wp8/libGUI.vcxproj index 461ca405b9..69d0320b3a 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj +++ b/cocos/ui/proj.wp8/libGUI.vcxproj @@ -188,6 +188,7 @@ + @@ -214,5 +215,6 @@ + \ No newline at end of file diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj.filters b/cocos/ui/proj.wp8/libGUI.vcxproj.filters index 0513dc6afb..29bc02c4f4 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj.filters +++ b/cocos/ui/proj.wp8/libGUI.vcxproj.filters @@ -87,6 +87,9 @@ System + + BaseClasses + @@ -161,5 +164,8 @@ System + + BaseClasses + \ No newline at end of file diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 3fe5678a28..d397774922 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -214,6 +214,7 @@ + @@ -399,6 +400,7 @@ + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 2133d49f72..a2efb55b47 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -855,6 +855,9 @@ Classes\UITest\CocostudioGUISceneTest\CustomWidget + + Classes\UITest\CocostudioGUISceneTest + @@ -1580,5 +1583,8 @@ Classes\UITest\CocostudioGUISceneTest\CustomWidget + + Classes\UITest\CocostudioGUISceneTest + \ No newline at end of file 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 f360d9d55e..c152ba0746 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 @@ -260,6 +260,7 @@ + @@ -460,6 +461,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 7cc4e29a0a..5959863578 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 @@ -855,6 +855,9 @@ Classes\UITest\CocosStudioGUITest + + Classes\UITest\CocosStudioGUITest + @@ -1584,6 +1587,9 @@ Classes\UITest\CocosStudioGUITest + + Classes\UITest\CocosStudioGUITest + From d86cc0a811070ed8996b2a947a009729d2b7b282 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 29 Jul 2014 18:08:40 +0800 Subject: [PATCH 31/57] decouple libcocos2d and cocosdenshion --- cocos/cocos2d.h | 3 --- .../TimelineCallbackTest/TimelineCallbackTestLayer.h | 1 + tests/cpp-tests/Classes/testBasic.h | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index db8e89fa4c..d0b439406f 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -268,9 +268,6 @@ THE SOFTWARE. #include "3d/CCAnimation3D.h" #include "3d/CCSprite3DMaterial.h" -// Audio -#include "audio/include/SimpleAudioEngine.h" - // Deprecated include #include "deprecated/CCDictionary.h" #include "deprecated/CCArray.h" diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h index ed55549d88..3cd549716a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h @@ -2,6 +2,7 @@ #define _TIMELINE_TESTLAYER_H_ #include "cocos2d.h" +#include "audio/include/SimpleAudioEngine.h" #include "extensions/cocos-ext.h" #include "cocosbuilder/CocosBuilder.h" diff --git a/tests/cpp-tests/Classes/testBasic.h b/tests/cpp-tests/Classes/testBasic.h index d86aed6e26..5da3ba1a11 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 "audio/include/SimpleAudioEngine.h" #include "VisibleRect.h" USING_NS_CC; From 77a8d96f372ebe8be671f0142c0d9fd064780ceb Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 29 Jul 2014 18:39:16 +0800 Subject: [PATCH 32/57] remove xcode shared scheme from code base --- .../xcschemes/CocosDenshion Mac.xcscheme | 59 ------------- .../xcschemes/CocosDenshion iOS.xcscheme | 59 ------------- .../xcshareddata/xcschemes/box2d Mac.xcscheme | 59 ------------- .../xcshareddata/xcschemes/box2d iOS.xcscheme | 59 ------------- .../xcschemes/build all libs Mac.xcscheme | 59 ------------- .../xcschemes/build all libs iOS.xcscheme | 59 ------------- .../xcschemes/chipmunk Mac.xcscheme | 59 ------------- .../xcschemes/chipmunk iOS.xcscheme | 59 ------------- .../xcschemes/cocos2dx Mac.xcscheme | 59 ------------- .../xcschemes/cocos2dx iOS.xcscheme | 59 ------------- .../cocos2dx-extensions Mac.xcscheme | 59 ------------- .../cocos2dx-extensions iOS.xcscheme | 59 ------------- .../xcschemes/build all tests Mac.xcscheme | 59 ------------- .../xcschemes/build all tests iOS.xcscheme | 59 ------------- .../xcschemes/cpp-empty-test Mac.xcscheme | 86 ------------------- .../xcschemes/cpp-empty-test iOS.xcscheme | 86 ------------------- .../xcschemes/cpp-tests Mac.xcscheme | 86 ------------------- .../xcschemes/cpp-tests iOS.xcscheme | 86 ------------------- .../game-controller-test IOS.xcscheme | 86 ------------------- .../xcschemes/lua-empty-test Mac.xcscheme | 86 ------------------- .../xcschemes/lua-empty-test iOS.xcscheme | 86 ------------------- .../lua-game-controller-test iOS.xcscheme | 86 ------------------- .../xcschemes/lua-tests Mac.xcscheme | 86 ------------------- .../xcschemes/lua-tests iOS.xcscheme | 86 ------------------- tools/jenkins-scripts/ios-build.sh | 4 +- 25 files changed, 2 insertions(+), 1688 deletions(-) delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test iOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests Mac.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests iOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/game-controller-test IOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test Mac.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test iOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests Mac.xcscheme delete mode 100644 build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests iOS.xcscheme diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme deleted file mode 100644 index dbf36bb025..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme deleted file mode 100644 index c74eed7e60..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme deleted file mode 100644 index f0be0b3387..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme deleted file mode 100644 index 5e6d46462b..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme deleted file mode 100644 index 25dbc11dbb..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme deleted file mode 100644 index 170dc164b6..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme deleted file mode 100644 index cae588170f..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme deleted file mode 100644 index e433af4505..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme deleted file mode 100644 index 1edbfaa4c2..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme deleted file mode 100644 index 82675f8fea..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme deleted file mode 100644 index 6f6c9a919d..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme deleted file mode 100644 index 9d554e8913..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme deleted file mode 100644 index 2937783395..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme deleted file mode 100644 index ecc2fd2528..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme deleted file mode 100644 index 17cd1fc940..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test iOS.xcscheme deleted file mode 100644 index aab30a1190..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test iOS.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests Mac.xcscheme deleted file mode 100644 index 7800fa7d35..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests Mac.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests iOS.xcscheme deleted file mode 100644 index f1e8d92423..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-tests iOS.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/game-controller-test IOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/game-controller-test IOS.xcscheme deleted file mode 100644 index 5cbd917515..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/game-controller-test IOS.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test Mac.xcscheme deleted file mode 100644 index fb21a7fceb..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test Mac.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test iOS.xcscheme deleted file mode 100644 index b52e4ca590..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-empty-test iOS.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme deleted file mode 100644 index c13623f4a0..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests Mac.xcscheme deleted file mode 100644 index 95b039fef9..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests Mac.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests iOS.xcscheme deleted file mode 100644 index 2a5c326fa1..0000000000 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-tests iOS.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/jenkins-scripts/ios-build.sh b/tools/jenkins-scripts/ios-build.sh index a328c30120..887306d6ef 100755 --- a/tools/jenkins-scripts/ios-build.sh +++ b/tools/jenkins-scripts/ios-build.sh @@ -1,5 +1,5 @@ #put xctool.sh into your PATH DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR"/../.. -xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -scheme "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" clean -xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -scheme "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build +xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -target "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" clean +xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -target "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build From 06d43ed2fd67f7bebffa9d8e54881d5573d89c34 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 30 Jul 2014 01:28:27 +0000 Subject: [PATCH 33/57] [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 9c26b3c877..8dacdf02d2 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -1019,6 +1019,8 @@ "cocos/ui/UIRelativeBox.h", "cocos/ui/UIRichText.cpp", "cocos/ui/UIRichText.h", + "cocos/ui/UIScale9Sprite.cpp", + "cocos/ui/UIScale9Sprite.h", "cocos/ui/UIScrollView.cpp", "cocos/ui/UIScrollView.h", "cocos/ui/UISlider.cpp", From 57859beb68866ba82c90a3ecde4c5d19976b81fa Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 30 Jul 2014 09:51:18 +0800 Subject: [PATCH 34/57] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index df58c668cb..5407ce55e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ cocos2d-x-3.3 ?? + [NEW] Added UIScale9Sprite [NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile() getFileSize() [NEW] FileUtilsApple: allow setting bundle to use in file utils on iOS and Mac OS X From 4a4060495577ecce8400c36e24ffae40dd2ae9a0 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 10:31:40 +0800 Subject: [PATCH 35/57] refactor getScale9Enabled to isScale9Enabled --- cocos/ui/UIScale9Sprite.cpp | 2 +- cocos/ui/UIScale9Sprite.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 35a767a69e..3c9e3b7574 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -798,7 +798,7 @@ y+=ytranslate; \ _reorderProtectedChildDirty = true; } - bool Scale9Sprite::getScale9Enabled() const + bool Scale9Sprite::isScale9Enabled() const { return _scale9Enabled; } diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index f20f1ec803..af7e919ddf 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -262,7 +262,7 @@ namespace ui { void setInsetBottom(float bottomInset); float getInsetBottom()const; void setScale9Enabled(bool enabled); - bool getScale9Enabled()const; + bool isScale9Enabled()const; From 955da5d3ccd2dba6cda11b59f429e2bff6d18397 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 28 Jul 2014 17:24:37 +0800 Subject: [PATCH 36/57] move utf8_substr to ui::helper class. --- cocos/ui/UIHelper.cpp | 37 +++++++++++++++ cocos/ui/UIHelper.h | 12 +++++ cocos/ui/UIRichText.cpp | 47 +++---------------- .../UIRichTextTest/UIRichTextTest.cpp | 16 ++++++- 4 files changed, 69 insertions(+), 43 deletions(-) diff --git a/cocos/ui/UIHelper.cpp b/cocos/ui/UIHelper.cpp index 11b44c6b1d..fa5077c670 100644 --- a/cocos/ui/UIHelper.cpp +++ b/cocos/ui/UIHelper.cpp @@ -108,6 +108,43 @@ Widget* Helper::seekActionWidgetByActionTag(Widget* root, int tag) } return nullptr; } + +std::string Helper::utf8_substr(const std::string& str, unsigned long start, unsigned long length) +{ + if (length==0) + { + return ""; + } + unsigned long c, i, ix, q, min=std::string::npos, max=std::string::npos; + for (q=0, i=0, ix=str.length(); i < ix; i++, q++) + { + if (q==start) + { + min = i; + } + if (q <= start+length || length==std::string::npos) + { + max = i; + } + + c = (unsigned char) str[i]; + + if (c<=127) i+=0; + else if ((c & 0xE0) == 0xC0) i+=1; + else if ((c & 0xF0) == 0xE0) i+=2; + else if ((c & 0xF8) == 0xF0) i+=3; + else return "";//invalid utf8 + } + if (q <= start+length || length == std::string::npos) + { + max = i; + } + if (min==std::string::npos || max==std::string::npos) + { + return ""; + } + return str.substr(min,max); +} } diff --git a/cocos/ui/UIHelper.h b/cocos/ui/UIHelper.h index edef683da6..5bb874aaef 100644 --- a/cocos/ui/UIHelper.h +++ b/cocos/ui/UIHelper.h @@ -66,6 +66,18 @@ public: /*temp action*/ static Widget* seekActionWidgetByActionTag(Widget* root, int tag); + + /** + * @brief Get a utf8 substring from a std::string with a given start position and length + * Sample: std::string str = "中国中国中国”; substr = utf8_substr(str,0,2) will = "中国" + * @param start The start position of the substring. + * @param length The length of the substring in utf8 count + * @return a utf8 substring + */ + static std::string utf8_substr(const std::string& str, + unsigned long start, + unsigned long length); + }; } diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 9f24571d79..b443cffba2 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -27,47 +27,12 @@ #include "2d/CCLabel.h" #include "2d/CCSprite.h" #include "base/ccUTF8.h" +#include "ui/UIHelper.h" NS_CC_BEGIN namespace ui { - -static std::string utf8_substr(const std::string& str, unsigned long start, unsigned long leng) -{ - if (leng==0) - { - return ""; - } - unsigned long c, i, ix, q, min=std::string::npos, max=std::string::npos; - for (q=0, i=0, ix=str.length(); i < ix; i++, q++) - { - if (q==start) - { - min = i; - } - if (q <= start+leng || leng==std::string::npos) - { - max = i; - } - - c = (unsigned char) str[i]; - - if (c<=127) i+=0; - else if ((c & 0xE0) == 0xC0) i+=1; - else if ((c & 0xF0) == 0xE0) i+=2; - else if ((c & 0xF8) == 0xF0) i+=3; - else return "";//invalid utf8 - } - if (q <= start+leng || leng == std::string::npos) - { - max = i; - } - if (min==std::string::npos || max==std::string::npos) - { - return ""; - } - return str.substr(min,max); -} + bool RichElement::init(int tag, const Color3B &color, GLubyte opacity) { @@ -318,18 +283,18 @@ void RichText::handleTextRenderer(const std::string& text, const std::string& fo std::string curText = text; size_t stringLength = StringUtils::getCharacterCountInUTF8String(text); int leftLength = stringLength * (1.0f - overstepPercent); - std::string leftWords = utf8_substr(curText,0,leftLength); - std::string cutWords = utf8_substr(curText, leftLength, stringLength - leftLength); + std::string leftWords = Helper::utf8_substr(curText,0,leftLength); + std::string cutWords = Helper::utf8_substr(curText, leftLength, stringLength - leftLength); if (leftLength > 0) { Label* leftRenderer = nullptr; if (fileExist) { - leftRenderer = Label::createWithTTF(utf8_substr(leftWords, 0, leftLength), fontName, fontSize); + leftRenderer = Label::createWithTTF(Helper::utf8_substr(leftWords, 0, leftLength), fontName, fontSize); } else { - leftRenderer = Label::createWithSystemFont(utf8_substr(leftWords, 0, leftLength), fontName, fontSize); + leftRenderer = Label::createWithSystemFont(Helper::utf8_substr(leftWords, 0, leftLength), fontName, fontSize); } if (leftRenderer) { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index 16c69fec84..23174dc551 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -20,6 +20,19 @@ bool UIRichTextTest::init() { Size widgetSize = _widget->getContentSize(); + std::string str1 = "中国中国中"; + std::string str2 = "ご静聴ありがとうございました!!ご静聴ありがとうございました!!"; + CCLOG("str1:%s ascii length = %ld, utf8 length = %ld, substr = %s", + str1.c_str(), + str1.length(), + StringUtils::getCharacterCountInUTF8String(str1), + Helper::utf8_substr(str1, 0, 5).c_str()); + CCLOG("str2:%s ascii length = %ld, utf8 length = %ld, substr = %s", + str2.c_str(), + str2.length(), + StringUtils::getCharacterCountInUTF8String(str2), + Helper::utf8_substr(str2, 0, 2).c_str()); + // Add the alert Text *alert = Text::create("RichText", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); @@ -31,7 +44,6 @@ bool UIRichTextTest::init() button->setTouchEnabled(true); button->setTitleText("switch"); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); -// button->addTouchEventListener(this, toucheventselector(UIRichTextTest::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -45,7 +57,7 @@ bool UIRichTextTest::init() RichElementText* re1 = RichElementText::create(1, Color3B::WHITE, 255, "中国中国中国中国中国中国中国中国中国中国", "Marker Felt", 10); RichElementText* re2 = RichElementText::create(2, Color3B::YELLOW, 255, "And this is yellow. ", "Helvetica", 10); RichElementText* re3 = RichElementText::create(3, Color3B::GRAY, 255, "ご静聴ありがとうございました!!ご静聴ありがとうございました!!", "Helvetica", 10); - RichElementText* re4 = RichElementText::create(4, Color3B::GREEN, 255, "And green. ", "Helvetica", 10); + RichElementText* re4 = RichElementText::create(4, Color3B::GREEN, 255, "And green with TTF support. ", "fonts/Marker Felt.ttf", 10); RichElementText* re5 = RichElementText::create(5, Color3B::RED, 255, "Last one is red ", "Helvetica", 10); RichElementImage* reimg = RichElementImage::create(6, Color3B::WHITE, 255, "cocosui/sliderballnormal.png"); From 7abea5dc58fcf5b89325d3dd71dafe379dda264b Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 09:56:33 +0800 Subject: [PATCH 37/57] add utf8 support for UITextField --- cocos/ui/UITextField.cpp | 123 ++---------------- .../UITextFieldTest/UITextFieldTest.cpp | 11 +- 2 files changed, 19 insertions(+), 115 deletions(-) diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index 8b70bb5297..88cca2d6f5 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -24,27 +24,12 @@ THE SOFTWARE. #include "ui/UITextField.h" #include "platform/CCFileUtils.h" +#include "ui/UIHelper.h" +#include "base/ccUTF8.h" NS_CC_BEGIN namespace ui { - -static int _calcCharCount(const char * pszText) -{ - int n = 0; - char ch = 0; - while ((ch = *pszText)) - { - CC_BREAK_IF(! ch); - - if (0x80 != (0xC0 & ch)) - { - ++n; - } - ++pszText; - } - return n; -} UICCTextField::UICCTextField() : _maxLengthEnabled(false) @@ -130,7 +115,7 @@ void UICCTextField::insertText(const char* text, size_t len) { if (_maxLengthEnabled) { - int text_count = _calcCharCount(getString().c_str()); + long text_count = StringUtils::getCharacterCountInUTF8String(getString()); if (text_count >= _maxLength) { // password @@ -141,69 +126,16 @@ void UICCTextField::insertText(const char* text, size_t len) return; } -#if ((CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)) - int input_count = _calcCharCount(text); - int total = total = text_count + input_count; + long input_count = StringUtils::getCharacterCountInUTF8String(text); + long total = text_count + input_count; if (total > _maxLength) { - int end = 0; - int length = _maxLength - text_count; + long length = _maxLength - text_count; - for (int i = 0; i < length; ++i) - { - char value = text[i]; - - if (value >= 0 && value <= 127) // ascii - { - end++; - } - else - { - end += 3; - } - } - input_text = input_text.substr(0, end); - len = end; + input_text = Helper::utf8_substr(input_text, 0, length); + len = input_text.length(); } -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - int input_count = _calcCharCount(text); - int total = text_count + input_count; - if (total > _maxLength) - { - int ascii = 0; - int unicode = 0; - int end = 0; - int count = 0; - - for (int i = 0; i < total * 3; ++i) - { - char value = text[i]; - - if (value >= 0 && value <= 127) // ascii - { - ascii++; - count++; - } - else - { - unicode++; - if (unicode % 3 == 0) - { - count++; - } - } - - if (count == _maxLength) - { - break; - } - } - end = ascii + unicode; - input_text = input_text.substr(0, end); - len = end; - } -#endif } } TextFieldTTF::insertText(input_text.c_str(), len); @@ -294,8 +226,8 @@ void UICCTextField::setPasswordStyleText(const std::string& styleText) void UICCTextField::setPasswordText(const std::string& text) { std::string tempStr = ""; - int text_count = _calcCharCount(text.c_str()); - int max = text_count; + long text_count = StringUtils::getCharacterCountInUTF8String(text); + long max = text_count; if (_maxLengthEnabled) { @@ -479,40 +411,11 @@ void TextField::setText(const std::string& text) if (isMaxLengthEnabled()) { int max = _textFieldRenderer->getMaxLength(); - int text_count = _calcCharCount(text.c_str()); - int total = text_count + _calcCharCount(getStringValue().c_str()); + long text_count = StringUtils::getCharacterCountInUTF8String(text); + long total = text_count + StringUtils::getCharacterCountInUTF8String(getStringValue()); if (total > max) { - int ascii = 0; - int unicode = 0; - int end = 0; - int count = 0; - - for (int i = 0; i < total * 3; ++i) - { - char value = text[i]; - - if (value >= 0 && value <= 127) // ascii - { - ascii++; - count++; - } - else - { - unicode++; - if (unicode % 3 == 0) - { - count++; - } - } - - if (count == max) - { - break; - } - } - end = ascii + unicode; - strText = strText.substr(0, end); + strText = Helper::utf8_substr(strText, 0, max); } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 29e14b8389..66048484b8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -32,7 +32,7 @@ bool UITextFieldTest::init() _uiLayer->addChild(alert); // Create the textfield - TextField* textField = TextField::create("input words here","fonts/Marker Felt.ttf",30); + TextField* textField = TextField::create("input words here","Arial",30); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); textField->addEventListener(CC_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); @@ -110,7 +110,7 @@ bool UITextFieldTest_MaxLength::init() _uiLayer->addChild(alert); // Create the textfield - TextField* textField = TextField::create("input words here","fonts/Marker Felt.ttf",30); + TextField* textField = TextField::create("input words here","Arial",30); textField->setMaxLengthEnabled(true); textField->setMaxLength(3); textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); @@ -194,7 +194,7 @@ bool UITextFieldTest_Password::init() _uiLayer->addChild(alert); // Create the textfield - TextField* textField = TextField::create("input password here","fonts/Marker Felt.ttf",30); + TextField* textField = TextField::create("input password here","Arial",30); textField->setPasswordEnabled(true); textField->setPasswordStyleText("*"); textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); @@ -276,7 +276,8 @@ bool UITextFieldTest_LineWrap::init() TextField* textField = TextField::create("input words here","fonts/Marker Felt.ttf",30); textField->ignoreContentAdaptWithSize(false); ((Label*)(textField->getVirtualRenderer()))->setLineBreakWithoutSpace(true); - textField->setContentSize(Size(240, 70)); + textField->setContentSize(Size(240, 170)); + textField->setText("input words hereinput words hereinput words hereinput words hereinput words hereinput words here"); textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); @@ -297,7 +298,7 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextField::EventType TextField* textField = dynamic_cast(pSender); Size widgetSize = _widget->getContentSize(); textField->runAction(CCMoveTo::create(0.225f, - Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + textField->getContentSize().height / 2))); + Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 30))); textField->setTextHorizontalAlignment(TextHAlignment::LEFT); textField->setTextVerticalAlignment(TextVAlignment::TOP); From e7da7b3e42bafe3d798bac5c2b6d4251a2a0b200 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 29 Jul 2014 16:17:10 +0800 Subject: [PATCH 38/57] change unsigned long to size_type --- cocos/ui/UIHelper.cpp | 4 ++-- cocos/ui/UIHelper.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UIHelper.cpp b/cocos/ui/UIHelper.cpp index fa5077c670..01ef4362ac 100644 --- a/cocos/ui/UIHelper.cpp +++ b/cocos/ui/UIHelper.cpp @@ -109,13 +109,13 @@ Widget* Helper::seekActionWidgetByActionTag(Widget* root, int tag) return nullptr; } -std::string Helper::utf8_substr(const std::string& str, unsigned long start, unsigned long length) +std::string Helper::utf8_substr(const std::string& str, std::string::size_type start, std::string::size_type length) { if (length==0) { return ""; } - unsigned long c, i, ix, q, min=std::string::npos, max=std::string::npos; + std::string::size_type c, i, ix, q, min=std::string::npos, max=std::string::npos; for (q=0, i=0, ix=str.length(); i < ix; i++, q++) { if (q==start) diff --git a/cocos/ui/UIHelper.h b/cocos/ui/UIHelper.h index 5bb874aaef..7d174735e0 100644 --- a/cocos/ui/UIHelper.h +++ b/cocos/ui/UIHelper.h @@ -75,8 +75,8 @@ public: * @return a utf8 substring */ static std::string utf8_substr(const std::string& str, - unsigned long start, - unsigned long length); + std::string::size_type start, + std::string::size_type length); }; } From f2b0528cc93c356b9a1d74e3dd49260fbb44b80d Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 10:45:35 +0800 Subject: [PATCH 39/57] refactor --- cocos/ui/UIHelper.cpp | 2 +- cocos/ui/UIHelper.h | 10 +++++----- cocos/ui/UIRichText.cpp | 8 ++++---- cocos/ui/UITextField.cpp | 4 ++-- .../UIRichTextTest/UIRichTextTest.cpp | 4 ++-- .../UITextFieldTest/UITextFieldTest.cpp | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cocos/ui/UIHelper.cpp b/cocos/ui/UIHelper.cpp index 01ef4362ac..73f1fdbabc 100644 --- a/cocos/ui/UIHelper.cpp +++ b/cocos/ui/UIHelper.cpp @@ -109,7 +109,7 @@ Widget* Helper::seekActionWidgetByActionTag(Widget* root, int tag) return nullptr; } -std::string Helper::utf8_substr(const std::string& str, std::string::size_type start, std::string::size_type length) +std::string Helper::getSubStringOfUTF8String(const std::string& str, std::string::size_type start, std::string::size_type length) { if (length==0) { diff --git a/cocos/ui/UIHelper.h b/cocos/ui/UIHelper.h index 7d174735e0..fb6136e7c7 100644 --- a/cocos/ui/UIHelper.h +++ b/cocos/ui/UIHelper.h @@ -68,13 +68,13 @@ public: static Widget* seekActionWidgetByActionTag(Widget* root, int tag); /** - * @brief Get a utf8 substring from a std::string with a given start position and length - * Sample: std::string str = "中国中国中国”; substr = utf8_substr(str,0,2) will = "中国" + * @brief Get a UTF8 substring from a std::string with a given start position and length + * Sample: std::string str = "中国中国中国”; substr = getSubStringOfUTF8String(str,0,2) will = "中国" * @param start The start position of the substring. - * @param length The length of the substring in utf8 count - * @return a utf8 substring + * @param length The length of the substring in UTF8 count + * @return a UTF8 substring */ - static std::string utf8_substr(const std::string& str, + static std::string getSubStringOfUTF8String(const std::string& str, std::string::size_type start, std::string::size_type length); diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index b443cffba2..e6d53993d2 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -283,18 +283,18 @@ void RichText::handleTextRenderer(const std::string& text, const std::string& fo std::string curText = text; size_t stringLength = StringUtils::getCharacterCountInUTF8String(text); int leftLength = stringLength * (1.0f - overstepPercent); - std::string leftWords = Helper::utf8_substr(curText,0,leftLength); - std::string cutWords = Helper::utf8_substr(curText, leftLength, stringLength - leftLength); + std::string leftWords = Helper::getSubStringOfUTF8String(curText,0,leftLength); + std::string cutWords = Helper::getSubStringOfUTF8String(curText, leftLength, stringLength - leftLength); if (leftLength > 0) { Label* leftRenderer = nullptr; if (fileExist) { - leftRenderer = Label::createWithTTF(Helper::utf8_substr(leftWords, 0, leftLength), fontName, fontSize); + leftRenderer = Label::createWithTTF(Helper::getSubStringOfUTF8String(leftWords, 0, leftLength), fontName, fontSize); } else { - leftRenderer = Label::createWithSystemFont(Helper::utf8_substr(leftWords, 0, leftLength), fontName, fontSize); + leftRenderer = Label::createWithSystemFont(Helper::getSubStringOfUTF8String(leftWords, 0, leftLength), fontName, fontSize); } if (leftRenderer) { diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index 88cca2d6f5..eda603d421 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -133,7 +133,7 @@ void UICCTextField::insertText(const char* text, size_t len) { long length = _maxLength - text_count; - input_text = Helper::utf8_substr(input_text, 0, length); + input_text = Helper::getSubStringOfUTF8String(input_text, 0, length); len = input_text.length(); } } @@ -415,7 +415,7 @@ void TextField::setText(const std::string& text) long total = text_count + StringUtils::getCharacterCountInUTF8String(getStringValue()); if (total > max) { - strText = Helper::utf8_substr(strText, 0, max); + strText = Helper::getSubStringOfUTF8String(strText, 0, max); } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index 23174dc551..ae7d403f4e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -26,12 +26,12 @@ bool UIRichTextTest::init() str1.c_str(), str1.length(), StringUtils::getCharacterCountInUTF8String(str1), - Helper::utf8_substr(str1, 0, 5).c_str()); + Helper::getSubStringOfUTF8String(str1, 0, 5).c_str()); CCLOG("str2:%s ascii length = %ld, utf8 length = %ld, substr = %s", str2.c_str(), str2.length(), StringUtils::getCharacterCountInUTF8String(str2), - Helper::utf8_substr(str2, 0, 2).c_str()); + Helper::getSubStringOfUTF8String(str2, 0, 2).c_str()); // Add the alert Text *alert = Text::create("RichText", "fonts/Marker Felt.ttf", 30); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 66048484b8..9f3b8485e6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -277,7 +277,7 @@ bool UITextFieldTest_LineWrap::init() textField->ignoreContentAdaptWithSize(false); ((Label*)(textField->getVirtualRenderer()))->setLineBreakWithoutSpace(true); textField->setContentSize(Size(240, 170)); - textField->setText("input words hereinput words hereinput words hereinput words hereinput words hereinput words here"); + textField->setText("input words here"); textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); From a6e376f93c4b5d488927b0636799219f00f8a7c2 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 15:19:39 +0800 Subject: [PATCH 40/57] refactor UIButton --- cocos/ui/UIButton.cpp | 226 ++++++++++-------------------------- cocos/ui/UIButton.h | 14 +-- cocos/ui/UIScale9Sprite.cpp | 103 ++++++++++++---- cocos/ui/UIScale9Sprite.h | 2 +- 4 files changed, 150 insertions(+), 195 deletions(-) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 3aba1b3cf8..c7fa5ff57d 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -135,9 +135,13 @@ bool Button::init() void Button::initRenderer() { - _buttonNormalRenderer = Sprite::create(); - _buttonClickedRenderer = Sprite::create(); - _buttonDisableRenderer = Sprite::create(); + _buttonNormalRenderer = Scale9Sprite::create(); + _buttonClickedRenderer = Scale9Sprite::create(); + _buttonDisableRenderer = Scale9Sprite::create(); + _buttonClickedRenderer->setScale9Enabled(false); + _buttonNormalRenderer->setScale9Enabled(false); + _buttonDisableRenderer->setScale9Enabled(false); + _titleRenderer = Label::create(); _titleRenderer->setAnchorPoint(Vec2::ANCHOR_MIDDLE); @@ -153,33 +157,13 @@ void Button::setScale9Enabled(bool able) { return; } - _brightStyle = BrightStyle::NONE; + _scale9Enabled = able; - removeProtectedChild(_buttonNormalRenderer); - removeProtectedChild(_buttonClickedRenderer); - removeProtectedChild(_buttonDisableRenderer); - _buttonNormalRenderer = nullptr; - _buttonClickedRenderer = nullptr; - _buttonDisableRenderer = nullptr; - if (_scale9Enabled) - { - _buttonNormalRenderer = Scale9Sprite::create(); - _buttonClickedRenderer = Scale9Sprite::create(); - _buttonDisableRenderer = Scale9Sprite::create(); - } - else - { - _buttonNormalRenderer = Sprite::create(); - _buttonClickedRenderer = Sprite::create(); - _buttonDisableRenderer = Sprite::create(); - } - - loadTextureNormal(_normalFileName, _normalTexType); - loadTexturePressed(_clickedFileName, _pressedTexType); - loadTextureDisabled(_disabledFileName, _disabledTexType); - addProtectedChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1); - addProtectedChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1); - addProtectedChild(_buttonDisableRenderer, DISABLED_RENDERER_Z, -1); + + _buttonNormalRenderer->setScale9Enabled(_scale9Enabled); + _buttonClickedRenderer->setScale9Enabled(_scale9Enabled); + _buttonDisableRenderer->setScale9Enabled(_scale9Enabled); + if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; @@ -190,9 +174,12 @@ void Button::setScale9Enabled(bool able) { ignoreContentAdaptWithSize(_prevIgnoreSize); } + setCapInsetsNormalRenderer(_capInsetsNormal); setCapInsetsPressedRenderer(_capInsetsPressed); setCapInsetsDisabledRenderer(_capInsetsDisabled); + + _brightStyle = BrightStyle::NONE; setBright(_bright); } @@ -228,37 +215,19 @@ void Button::loadTextureNormal(const std::string& normal,TextureResType texType) } _normalFileName = normal; _normalTexType = texType; - if (_scale9Enabled) + + switch (_normalTexType) { - Scale9Sprite* normalRendererScale9 = static_cast(_buttonNormalRenderer); - switch (_normalTexType) - { - case TextureResType::LOCAL: - normalRendererScale9->initWithFile(normal); - break; - case TextureResType::PLIST: - normalRendererScale9->initWithSpriteFrameName(normal); - break; - default: - break; - } - normalRendererScale9->setCapInsets(_capInsetsNormal); - } - else - { - Sprite* normalRenderer = static_cast(_buttonNormalRenderer); - switch (_normalTexType) - { - case TextureResType::LOCAL: - normalRenderer->setTexture(normal); - break; - case TextureResType::PLIST: - normalRenderer->setSpriteFrame(normal); - break; - default: - break; - } + case TextureResType::LOCAL: + _buttonNormalRenderer->initWithFile(normal); + break; + case TextureResType::PLIST: + _buttonNormalRenderer->initWithSpriteFrameName(normal); + break; + default: + break; } + _normalTextureSize = _buttonNormalRenderer->getContentSize(); updateFlippedX(); updateFlippedY(); @@ -276,38 +245,21 @@ void Button::loadTexturePressed(const std::string& selected,TextureResType texTy } _clickedFileName = selected; _pressedTexType = texType; - if (_scale9Enabled) + + switch (_pressedTexType) { - Scale9Sprite* clickedRendererScale9 = static_cast(_buttonClickedRenderer); - switch (_pressedTexType) - { - case TextureResType::LOCAL: - clickedRendererScale9->initWithFile(selected); - break; - case TextureResType::PLIST: - clickedRendererScale9->initWithSpriteFrameName(selected); - break; - default: - break; - } - clickedRendererScale9->setCapInsets(_capInsetsPressed); - } - else - { - Sprite* clickedRenderer = static_cast(_buttonClickedRenderer); - switch (_pressedTexType) - { - case TextureResType::LOCAL: - clickedRenderer->setTexture(selected); - break; - case TextureResType::PLIST: - clickedRenderer->setSpriteFrame(selected); - break; - default: - break; - } + case TextureResType::LOCAL: + _buttonClickedRenderer->initWithFile(selected); + break; + case TextureResType::PLIST: + _buttonClickedRenderer->initWithSpriteFrameName(selected); + break; + default: + break; } + _pressedTextureSize = _buttonClickedRenderer->getContentSize(); + //TODO: mark as dirty updateFlippedX(); updateFlippedY(); @@ -323,37 +275,19 @@ void Button::loadTextureDisabled(const std::string& disabled,TextureResType texT } _disabledFileName = disabled; _disabledTexType = texType; - if (_scale9Enabled) + + switch (_disabledTexType) { - Scale9Sprite* disabledScale9 = static_cast(_buttonDisableRenderer); - switch (_disabledTexType) - { - case TextureResType::LOCAL: - disabledScale9->initWithFile(disabled); - break; - case TextureResType::PLIST: - disabledScale9->initWithSpriteFrameName(disabled); - break; - default: - break; - } - disabledScale9->setCapInsets(_capInsetsDisabled); - } - else - { - Sprite* disabledRenderer = static_cast(_buttonDisableRenderer); - switch (_disabledTexType) - { - case TextureResType::LOCAL: - disabledRenderer->setTexture(disabled); - break; - case TextureResType::PLIST: - disabledRenderer->setSpriteFrame(disabled); - break; - default: - break; - } + case TextureResType::LOCAL: + _buttonDisableRenderer->initWithFile(disabled); + break; + case TextureResType::PLIST: + _buttonDisableRenderer->initWithSpriteFrameName(disabled); + break; + default: + break; } + _disabledTextureSize = _buttonDisableRenderer->getContentSize(); updateFlippedX(); updateFlippedY(); @@ -376,7 +310,7 @@ void Button::setCapInsetsNormalRenderer(const Rect &capInsets) { return; } - static_cast(_buttonNormalRenderer)->setCapInsets(capInsets); + _buttonNormalRenderer->setCapInsets(capInsets); } const Rect& Button::getCapInsetsNormalRenderer()const @@ -391,7 +325,7 @@ void Button::setCapInsetsPressedRenderer(const Rect &capInsets) { return; } - static_cast(_buttonClickedRenderer)->setCapInsets(capInsets); + _buttonClickedRenderer->setCapInsets(capInsets); } const Rect& Button::getCapInsetsPressedRenderer()const @@ -406,7 +340,7 @@ void Button::setCapInsetsDisabledRenderer(const Rect &capInsets) { return; } - static_cast(_buttonDisableRenderer)->setCapInsets(capInsets); + _buttonDisableRenderer->setCapInsets(capInsets); } const Rect& Button::getCapInsetsDisabledRenderer()const @@ -432,28 +366,10 @@ void Button::onPressStateChangedToNormal() } else { - if (_scale9Enabled) - { - updateTexturesRGBA(); - } - else - { - _buttonNormalRenderer->stopAllActions(); - _buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize); - } + _buttonNormalRenderer->stopAllActions(); + _buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize); } } - -void Button::updateTexturesRGBA() -{ - _buttonNormalRenderer->setColor(this->getColor()); - _buttonClickedRenderer->setColor(this->getColor()); - _buttonDisableRenderer->setColor(this->getColor()); - - _buttonNormalRenderer->setOpacity(this->getOpacity()); - _buttonClickedRenderer->setOpacity(this->getOpacity()); - _buttonDisableRenderer->setOpacity(this->getOpacity()); -} void Button::onPressStateChangedToPressed() { @@ -462,6 +378,7 @@ void Button::onPressStateChangedToPressed() _buttonNormalRenderer->setVisible(false); _buttonClickedRenderer->setVisible(true); _buttonDisableRenderer->setVisible(false); + if (_pressedActionEnabled) { _buttonNormalRenderer->stopAllActions(); @@ -501,36 +418,19 @@ void Button::updateFlippedX() { float flip = _flippedX ? -1.0f : 1.0f; _titleRenderer->setScaleX(flip); - if (_scale9Enabled) - { - _buttonNormalRenderer->setScaleX(flip); - _buttonClickedRenderer->setScaleX(flip); - _buttonDisableRenderer->setScaleX(flip); - } - else - { - static_cast(_buttonNormalRenderer)->setFlippedX(_flippedX); - static_cast(_buttonClickedRenderer)->setFlippedX(_flippedX); - static_cast(_buttonDisableRenderer)->setFlippedX(_flippedX); - } + + _buttonNormalRenderer->setFlippedX(_flippedX); + _buttonClickedRenderer->setFlippedX(_flippedX); + _buttonDisableRenderer->setFlippedX(_flippedX); } void Button::updateFlippedY() { float flip = _flippedY ? -1.0f : 1.0f; _titleRenderer->setScaleY(flip); - if (_scale9Enabled) - { - _buttonNormalRenderer->setScaleY(flip); - _buttonClickedRenderer->setScaleY(flip); - _buttonDisableRenderer->setScaleY(flip); - } - else - { - static_cast(_buttonNormalRenderer)->setFlippedY(_flippedY); - static_cast(_buttonClickedRenderer)->setFlippedY(_flippedY); - static_cast(_buttonDisableRenderer)->setFlippedY(_flippedY); - } + _buttonNormalRenderer->setFlippedY(_flippedY); + _buttonClickedRenderer->setFlippedY(_flippedY); + _buttonDisableRenderer->setFlippedY(_flippedY); } void Button::updateTitleLocation() diff --git a/cocos/ui/UIButton.h b/cocos/ui/UIButton.h index 07a8e0de4b..e44e148024 100644 --- a/cocos/ui/UIButton.h +++ b/cocos/ui/UIButton.h @@ -33,7 +33,8 @@ NS_CC_BEGIN class Label; namespace ui{ - + + class Scale9Sprite; /** * @js NA * @lua NA @@ -205,9 +206,7 @@ protected: virtual void updateFlippedX() override; virtual void updateFlippedY() override; - - void updateTexturesRGBA(); - + void normalTextureScaleChangedWithSize(); void pressedTextureScaleChangedWithSize(); void disabledTextureScaleChangedWithSize(); @@ -219,10 +218,11 @@ protected: virtual void copySpecialProperties(Widget* model) override; protected: - Node* _buttonNormalRenderer; - Node* _buttonClickedRenderer; - Node* _buttonDisableRenderer; + Scale9Sprite* _buttonNormalRenderer; + Scale9Sprite* _buttonClickedRenderer; + Scale9Sprite* _buttonDisableRenderer; Label* _titleRenderer; + std::string _normalFileName; std::string _clickedFileName; std::string _disabledFileName; diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 3c9e3b7574..042a33b3da 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -62,6 +62,49 @@ namespace ui { void Scale9Sprite::cleanupSlicedSprites() { + if (_topLeft) + { + _topLeft->onExit(); + } + if (_top) + { + _top->onExit(); + } + if (_topRight) + { + _topRight->onExit(); + } + + if (_left) + { + _left->onExit(); + } + + if (_centre) + { + _centre->onExit(); + } + + if (_right) + { + _right->onExit(); + } + + if (_bottomLeft) + { + _bottomLeft->onExit(); + } + + if (_bottomRight) + { + _bottomRight->onExit(); + } + + if (_bottom) + { + _bottom->onExit(); + } + CC_SAFE_RELEASE(_topLeft); CC_SAFE_RELEASE(_top); CC_SAFE_RELEASE(_topRight); @@ -722,10 +765,6 @@ y+=ytranslate; \ } } - - - - // // draw self // @@ -744,7 +783,6 @@ y+=ytranslate; \ } - for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) (*it)->visit(renderer, _modelViewTransform, flags); @@ -882,21 +920,22 @@ y+=ytranslate; \ _displayedColor.b = _realColor.b * parentColor.b/255.0; updateColor(); - if (_scale9Image) { + if (_scale9Image) + { _scale9Image->updateDisplayedColor(_displayedColor); } - for(const auto &child : _protectedChildren){ + for(const auto &child : _protectedChildren) + { child->updateDisplayedColor(_displayedColor); } if (_cascadeColorEnabled) { - for(const auto &child : _children){ + for(const auto &child : _children) + { child->updateDisplayedColor(_displayedColor); } - - } } @@ -905,33 +944,37 @@ y+=ytranslate; \ _displayedOpacity = _realOpacity * parentOpacity/255.0; updateColor(); - if (_scale9Image) { + if (_scale9Image) + { _scale9Image->updateDisplayedOpacity(_displayedOpacity); } - for(auto child : _protectedChildren){ + for(auto child : _protectedChildren) + { child->updateDisplayedOpacity(_displayedOpacity); } if (_cascadeOpacityEnabled) { - for(auto child : _children){ + for(auto child : _children) + { child->updateDisplayedOpacity(_displayedOpacity); } - - } } void Scale9Sprite::disableCascadeColor() { - for(auto child : _children){ + for(auto child : _children) + { child->updateDisplayedColor(Color3B::WHITE); } - for(auto child : _protectedChildren){ + for(auto child : _protectedChildren) + { child->updateDisplayedColor(Color3B::WHITE); } - if (_scale9Image) { + if (_scale9Image) + { _scale9Image->updateDisplayedColor(Color3B::WHITE); } } @@ -944,20 +987,32 @@ y+=ytranslate; \ void Scale9Sprite::setFlippedX(bool flippedX) { _flippedX = flippedX; - if (_scale9Enabled) { + if (_scale9Enabled) + { this->setScaleX(-1); - }else{ - _scale9Image->setFlippedX(flippedX); + } + else + { + if (_scale9Image) + { + _scale9Image->setFlippedX(flippedX); + } } } void Scale9Sprite::setFlippedY(bool flippedY) { _flippedY = flippedY; - if (_scale9Enabled) { + if (_scale9Enabled) + { this->setScaleY(-1); - }else{ - _scale9Image->setFlippedY(flippedY); + } + else + { + if (_scale9Image) + { + _scale9Image->setFlippedY(flippedY); + } } } diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index af7e919ddf..2080137672 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -246,7 +246,7 @@ namespace ui { // overrides virtual void setContentSize(const Size & size) override; - + Size getOriginalSize() const; void setPreferredSize(const Size& size); From 64921679743205911e0e4053639ab931391d4e7f Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 15:27:18 +0800 Subject: [PATCH 41/57] refactor ImageView --- cocos/ui/UIImageView.cpp | 72 +++++++--------------------------------- cocos/ui/UIImageView.h | 4 +-- 2 files changed, 14 insertions(+), 62 deletions(-) diff --git a/cocos/ui/UIImageView.cpp b/cocos/ui/UIImageView.cpp index 13e374fc4d..e35c1d355f 100644 --- a/cocos/ui/UIImageView.cpp +++ b/cocos/ui/UIImageView.cpp @@ -29,10 +29,6 @@ THE SOFTWARE. NS_CC_BEGIN namespace ui { - - -#define STATIC_CAST_CCSPRITE static_cast(_imageRenderer) -#define STATIC_CAST_SCALE9SPRITE static_cast(_imageRenderer) static const int IMAGE_RENDERER_Z = (-1); @@ -108,7 +104,7 @@ bool ImageView::init(const std::string &imageFileName, TextureResType texType) void ImageView::initRenderer() { - _imageRenderer = Sprite::create(); + _imageRenderer = Scale9Sprite::create(); addProtectedChild(_imageRenderer, IMAGE_RENDERER_Z, -1); } @@ -123,34 +119,15 @@ void ImageView::loadTexture(const std::string& fileName, TextureResType texType) switch (_imageTexType) { case TextureResType::LOCAL: - if (_scale9Enabled) - { - Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE; - imageRendererScale9->initWithFile(fileName); - imageRendererScale9->setCapInsets(_capInsets); - } - else - { - Sprite* imageRenderer = STATIC_CAST_CCSPRITE; - imageRenderer->setTexture(fileName); - } + _imageRenderer->initWithFile(fileName); break; case TextureResType::PLIST: - if (_scale9Enabled) - { - Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE; - imageRendererScale9->initWithSpriteFrameName(fileName); - imageRendererScale9->setCapInsets(_capInsets); - } - else - { - Sprite* imageRenderer = STATIC_CAST_CCSPRITE; - imageRenderer->setSpriteFrame(fileName); - } + _imageRenderer->initWithSpriteFrameName(fileName); break; default: break; } + _imageTextureSize = _imageRenderer->getContentSize(); updateFlippedX(); updateFlippedY(); @@ -161,39 +138,24 @@ void ImageView::loadTexture(const std::string& fileName, TextureResType texType) void ImageView::setTextureRect(const Rect &rect) { + //This API should be refactor if (_scale9Enabled) { } else { - STATIC_CAST_CCSPRITE->setTextureRect(rect); + _imageRenderer->getSprite()->setTextureRect(rect); } } void ImageView::updateFlippedX() { - if (_scale9Enabled) - { - int flip = _flippedX ? -1 : 1; - STATIC_CAST_SCALE9SPRITE->setScaleX(flip); - } - else - { - STATIC_CAST_CCSPRITE->setFlippedX(_flippedX); - } + _imageRenderer->setFlippedX(_flippedX); } void ImageView::updateFlippedY() { - if (_scale9Enabled) - { - int flip = _flippedY ? -1 : 1; - STATIC_CAST_SCALE9SPRITE->setScaleY(flip); - } - else - { - STATIC_CAST_CCSPRITE->setFlippedY(_flippedY); - } + _imageRenderer->setFlippedY(_flippedY); } @@ -206,18 +168,8 @@ void ImageView::setScale9Enabled(bool able) _scale9Enabled = able; - removeProtectedChild(_imageRenderer); - _imageRenderer = nullptr; - if (_scale9Enabled) - { - _imageRenderer = Scale9Sprite::create(); - } - else - { - _imageRenderer = Sprite::create(); - } - loadTexture(_textureFile,_imageTexType); - addProtectedChild(_imageRenderer, IMAGE_RENDERER_Z, -1); + _imageRenderer->setScale9Enabled(_scale9Enabled); + if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; @@ -252,7 +204,7 @@ void ImageView::setCapInsets(const Rect &capInsets) { return; } - STATIC_CAST_SCALE9SPRITE->setCapInsets(capInsets); + _imageRenderer->setCapInsets(capInsets); } const Rect& ImageView::getCapInsets()const @@ -298,7 +250,7 @@ void ImageView::imageTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_imageRenderer)->setPreferredSize(_contentSize); + _imageRenderer->setPreferredSize(_contentSize); } else { diff --git a/cocos/ui/UIImageView.h b/cocos/ui/UIImageView.h index d0c4f06560..a3150a8de4 100644 --- a/cocos/ui/UIImageView.h +++ b/cocos/ui/UIImageView.h @@ -31,7 +31,7 @@ THE SOFTWARE. NS_CC_BEGIN namespace ui { - + class Scale9Sprite; /** * @js NA * @lua NA @@ -132,7 +132,7 @@ protected: bool _scale9Enabled; bool _prevIgnoreSize; Rect _capInsets; - Node* _imageRenderer; + Scale9Sprite* _imageRenderer; std::string _textureFile; TextureResType _imageTexType; Size _imageTextureSize; From f8a7e7000024c67abfa58eb89e2e26a29a9ef100 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 30 Jul 2014 15:44:15 +0800 Subject: [PATCH 42/57] Add tools to generate prebuilt engine for Cocos Engine. --- tools/gen-prebuilt/.gitignore | 4 + tools/gen-prebuilt/README.md | 41 +++ tools/gen-prebuilt/build_config.json | 19 ++ tools/gen-prebuilt/excopy.py | 100 +++++++ tools/gen-prebuilt/gen_prebuilt_libs.py | 361 ++++++++++++++++++++++++ tools/gen-prebuilt/module_config.json | 329 +++++++++++++++++++++ tools/gen-prebuilt/module_organize.py | 239 ++++++++++++++++ 7 files changed, 1093 insertions(+) create mode 100644 tools/gen-prebuilt/.gitignore create mode 100644 tools/gen-prebuilt/README.md create mode 100644 tools/gen-prebuilt/build_config.json create mode 100644 tools/gen-prebuilt/excopy.py create mode 100644 tools/gen-prebuilt/gen_prebuilt_libs.py create mode 100644 tools/gen-prebuilt/module_config.json create mode 100644 tools/gen-prebuilt/module_organize.py diff --git a/tools/gen-prebuilt/.gitignore b/tools/gen-prebuilt/.gitignore new file mode 100644 index 0000000000..71c422c076 --- /dev/null +++ b/tools/gen-prebuilt/.gitignore @@ -0,0 +1,4 @@ +.idea/* +build/* +prebuilt* +cocos2d-x/* diff --git a/tools/gen-prebuilt/README.md b/tools/gen-prebuilt/README.md new file mode 100644 index 0000000000..e762a37e06 --- /dev/null +++ b/tools/gen-prebuilt/README.md @@ -0,0 +1,41 @@ + +# Generate prebuilt engine + +## Purpose + +The tools in `gen-prebuilt` are used for generating prebuilt engine. + +## Steps + +1. Generate prebuilt libs + * First, build libs for `Mac, iOS & android`: Run `python gen_prebuilt_libs.py` on Mac. + * Second, build libs for `Windows`: Run `python gen_prebuilt_libs.py -n` on Windows. +2. Organize the prebuilt libs with modules + Run command `python module_organize.py` on Windows or Mac. + +## Script Details + +1. gen_prebuilt_libs.py + + ``` + Usage: gen_prebuilt_libs.py [options] + + Options: + -c Remove the "prebuilt" directory first. + -n, --no-android Not build android libs. + -s, --strip Enable strip when generating iOS, Mac & Android libs. + -i, --incredibuild Use incredibuild to build win32 projects. Only available on windows. + ``` + + The result of the script is : A folder named `prebuilt` which contains prebuilt libs will generated. + +2. module_organize.py + + ``` + Usage: module_organize.py [options] + + Options: + -d, --dst-root Specify a path where to place the engine organized by modules. Default value is the same path with `module_organize.py`. + ``` + + The result of the script is : A folder named `cocos2d-x` will generated in the `dst-root`. \ No newline at end of file diff --git a/tools/gen-prebuilt/build_config.json b/tools/gen-prebuilt/build_config.json new file mode 100644 index 0000000000..e41969c1cd --- /dev/null +++ b/tools/gen-prebuilt/build_config.json @@ -0,0 +1,19 @@ +{ + "xcode_proj_info" : { + "build/cocos2d_libs.xcodeproj" : { + "outputdir" : "prebuilt", + "targets" :[ "build all libs" ] + } + }, + "win32_proj_info" : { + "build/cocos2d-win32.vc2012.sln" : { + "outputdir" : "prebuilt/win32", + "targets" : [ + "libcocosdenshion", "libbox2d", "libchipmunk", + "libcocos2d", "libcocosbuilder", "libcocostudio", + "libextension", "libui", "liblua", + "libnetwork", "libspine" + ] + } + } +} diff --git a/tools/gen-prebuilt/excopy.py b/tools/gen-prebuilt/excopy.py new file mode 100644 index 0000000000..4b4877d726 --- /dev/null +++ b/tools/gen-prebuilt/excopy.py @@ -0,0 +1,100 @@ +#!/usr/bin/python +# ---------------------------------------------------------------------------- +# extend methods for copy files/dirs +# +# Copyright 2014 (C) zhangbin +# +# License: MIT +# ---------------------------------------------------------------------------- + +import os +import shutil + +def copy_files_in_dir(src, dst): + + for item in os.listdir(src): + path = os.path.join(src, item) + if os.path.isfile(path): + shutil.copy(path, dst) + if os.path.isdir(path): + new_dst = os.path.join(dst, item) + if not os.path.isdir(new_dst): + os.makedirs(new_dst) + copy_files_in_dir(path, new_dst) + +def copy_files_with_config(config, src_root, dst_root): + src_dir = config["from"] + dst_dir = config["to"] + + src_dir = os.path.join(src_root, src_dir) + dst_dir = os.path.join(dst_root, dst_dir) + + include_rules = None + if config.has_key("include"): + include_rules = config["include"] + include_rules = convert_rules(include_rules) + + exclude_rules = None + if config.has_key("exclude"): + exclude_rules = config["exclude"] + exclude_rules = convert_rules(exclude_rules) + + copy_files_with_rules(src_dir, src_dir, dst_dir, include_rules, exclude_rules) + +def copy_files_with_rules(src_rootDir, src, dst, include = None, exclude = None): + if os.path.isfile(src): + if not os.path.exists(dst): + os.makedirs(dst) + shutil.copy(src, dst) + return + + if (include is None) and (exclude is None): + if not os.path.exists(dst): + os.makedirs(dst) + copy_files_in_dir(src, dst) + elif (include is not None): + # have include + for name in os.listdir(src): + abs_path = os.path.join(src, name) + rel_path = os.path.relpath(abs_path, src_rootDir) + if os.path.isdir(abs_path): + sub_dst = os.path.join(dst, name) + copy_files_with_rules(src_rootDir, abs_path, sub_dst, include = include) + elif os.path.isfile(abs_path): + if _in_rules(rel_path, include): + if not os.path.exists(dst): + os.makedirs(dst) + shutil.copy(abs_path, dst) + elif (exclude is not None): + # have exclude + for name in os.listdir(src): + abs_path = os.path.join(src, name) + rel_path = os.path.relpath(abs_path, src_rootDir) + if os.path.isdir(abs_path): + sub_dst = os.path.join(dst, name) + copy_files_with_rules(src_rootDir, abs_path, sub_dst, exclude = exclude) + elif os.path.isfile(abs_path): + if not _in_rules(rel_path, exclude): + if not os.path.exists(dst): + os.makedirs(dst) + shutil.copy(abs_path, dst) + +def _in_rules(rel_path, rules): + import re + ret = False + path_str = rel_path.replace("\\", "/") + for rule in rules: + if re.match(rule, path_str): + ret = True + + return ret + +def convert_rules(rules): + ret_rules = [] + for rule in rules: + ret = rule.replace('.', '\\.') + ret = ret.replace('*', '.*') + ret = "%s" % ret + ret_rules.append(ret) + + return ret_rules diff --git a/tools/gen-prebuilt/gen_prebuilt_libs.py b/tools/gen-prebuilt/gen_prebuilt_libs.py new file mode 100644 index 0000000000..d8d3e06119 --- /dev/null +++ b/tools/gen-prebuilt/gen_prebuilt_libs.py @@ -0,0 +1,361 @@ +#!/usr/bin/python +# ---------------------------------------------------------------------------- +# generate the prebuilt libs of engine +# +# Copyright 2014 (C) zhangbin +# +# License: MIT +# ---------------------------------------------------------------------------- +''' +Generate the prebuilt libs of engine +''' + +import os +import subprocess +import shutil +import sys +import excopy +import json + +from argparse import ArgumentParser + +if sys.platform == 'win32': + import _winreg + +ANDROID_SO_PATH = "frameworks/runtime-src/proj.android/libs" +ANDROID_A_PATH = "frameworks/runtime-src/proj.android/obj/local" +MK_PATH = "frameworks/runtime-src/proj.android/jni/Application.mk" +CONSOLE_PATH = "tools/cocos2d-console/bin" + +def os_is_win32(): + return sys.platform == 'win32' + +def os_is_mac(): + return sys.platform == 'darwin' + +def run_shell(cmd, cwd=None): + p = subprocess.Popen(cmd, shell=True, cwd=cwd) + p.wait() + + if p.returncode: + raise subprocess.CalledProcessError(returncode=p.returncode, cmd=cmd) + + return p.returncode + +class Generator(object): + + XCODE_CMD_FMT = "xcodebuild -project \"%s\" -configuration Release -target \"%s\" %s CONFIGURATION_BUILD_DIR=%s" + + CONFIG_FILE = "build_config.json" + KEY_XCODE_PROJ_INFO = "xcode_proj_info" + KEY_WIN32_PROJ_INFO = "win32_proj_info" + + KEY_OUTPUT_DIR = "outputdir" + KEY_TARGETS = "targets" + + def __init__(self, args): + self.need_clean = args.need_clean + self.enable_strip = args.enable_strip + self.use_incredibuild = args.use_incredibuild + self.tool_dir = os.path.realpath(os.path.dirname(__file__)) + self.no_android = args.no_android + + self.engine_dir = os.path.join(self.tool_dir, os.path.pardir, os.path.pardir) + + self.load_config() + + def load_config(self): + cfg_json = os.path.join(self.tool_dir, Generator.CONFIG_FILE) + f = open(cfg_json) + cfg_info = json.load(f) + f.close() + + self.xcode_proj_info = cfg_info[Generator.KEY_XCODE_PROJ_INFO] + self.win32_proj_info = cfg_info[Generator.KEY_WIN32_PROJ_INFO] + + def modify_mk(self, mk_file): + if os.path.isfile(mk_file): + file_obj = open(mk_file, "a") + file_obj.write("\nAPP_ABI :=armeabi armeabi-v7a\n") + file_obj.close() + + def build_android(self): + # build .so for android + language = "lua" + + console_dir = os.path.join(self.engine_dir, CONSOLE_PATH) + cmd_path = os.path.join(console_dir, "cocos") + proj_name = "My%sGame" % language + proj_path = os.path.join(self.engine_dir, proj_name) + if os.path.exists(proj_path): + shutil.rmtree(proj_path) + + # create a runtime project + create_cmd = "%s new -l %s -t runtime -d %s %s" % (cmd_path, language, self.engine_dir, proj_name) + run_shell(create_cmd) + + # Add multi ABI in Application.mk + mk_file = os.path.join(proj_path, MK_PATH) + self.modify_mk(mk_file) + + # build it + build_cmd = "%s compile -s %s -p android --ndk-mode release -j 4" % (cmd_path, proj_path) + run_shell(build_cmd) + + # copy .a to prebuilt dir + obj_dir = os.path.join(proj_path, ANDROID_A_PATH) + prebuilt_dir = os.path.join(self.tool_dir, "prebuilt", "android") + copy_cfg = { + "from": obj_dir, + "to": prebuilt_dir, + "include": [ + "*.a$" + ] + } + excopy.copy_files_with_config(copy_cfg, obj_dir, prebuilt_dir) + + if self.enable_strip: + # strip the android libs + ndk_root = os.environ["NDK_ROOT"] + if os_is_win32(): + if self.is_32bit_windows(): + bit_str = "x86" + else: + bit_str = "x86_64" + + sys_folder_name = "windows-%s" % bit_str + elif os_is_mac(): + sys_folder_name = "darwin-x86_64" + + strip_cmd_path = os.path.join(ndk_root, "toolchains/arm-linux-androideabi-4.8/prebuilt/%s/arm-linux-androideabi/bin/strip" % sys_folder_name) + if os.path.exists(strip_cmd_path): + strip_cmd = "%s -S %s/armeabi*/*.a" % (strip_cmd_path, prebuilt_dir) + run_shell(strip_cmd) + + # remove the project + shutil.rmtree(proj_path) + + def get_required_vs_version(self, proj_file): + # get the VS version required by the project + import re + file_obj = open(proj_file) + pattern = re.compile(r"^# Visual Studio.+(\d{4})") + num = None + for line in file_obj: + match = pattern.match(line) + if match is not None: + num = match.group(1) + break + + if num is not None: + if num == "2012": + ret = "11.0" + elif num == "2013": + ret = "12.0" + else: + ret = None + else: + ret = None + + return ret + + def get_vs_cmd_path(self, require_version): + # find the VS in register, if system is 64bit, should find vs in both 32bit & 64bit register + if self.is_32bit_windows(): + reg_flag_list = [ _winreg.KEY_WOW64_32KEY ] + else: + reg_flag_list = [ _winreg.KEY_WOW64_64KEY, _winreg.KEY_WOW64_32KEY ] + + needUpgrade = False + vsPath = None + + try: + for reg_flag in reg_flag_list: + print("find vs in reg : %s" % ("32bit" if reg_flag == _winreg.KEY_WOW64_32KEY else "64bit")) + vs = _winreg.OpenKey( + _winreg.HKEY_LOCAL_MACHINE, + r"SOFTWARE\Microsoft\VisualStudio", + 0, + _winreg.KEY_READ | reg_flag + ) + + try: + i = 0 + while True: + try: + # enum the keys in vs reg + version = _winreg.EnumKey(vs, i) + find_ver = float(version) + + # find the vs which version >= required version + if find_ver >= float(require_version): + key = _winreg.OpenKey(vs, r"SxS\VS7") + vsPath, type = _winreg.QueryValueEx(key, version) + + if os.path.exists(vsPath): + if float(version) > float(require_version): + needUpgrade = True + break + else: + vsPath = None + except: + continue + finally: + i += 1 + except: + pass + + # if find one right vs, break + if vsPath is not None: + break + except WindowsError as e: + message = "Visual Studio wasn't installed" + print(e) + raise Exception(message) + + commandPath = os.path.join(vsPath, "Common7", "IDE", "devenv") + return (needUpgrade, commandPath) + + def is_32bit_windows(self): + arch = os.environ['PROCESSOR_ARCHITECTURE'].lower() + archw = os.environ.has_key("PROCESSOR_ARCHITEW6432") + return (arch == "x86" and not archw) + + def build_win32_proj(self, cmd_path, sln_path, proj_name, mode): + build_cmd = " ".join([ + "\"%s\"" % cmd_path, + "\"%s\"" % sln_path, + "/%s \"Release|Win32\"" % mode, + "/Project \"%s\"" % proj_name + ]) + run_shell(build_cmd) + + def build_win32(self): + print("Building Win32") + + for key in self.win32_proj_info.keys(): + output_dir = self.win32_proj_info[key][Generator.KEY_OUTPUT_DIR] + proj_path = os.path.join(self.engine_dir, key) + require_vs_version = self.get_required_vs_version(proj_path) + needUpgrade, vs_command = self.get_vs_cmd_path(require_vs_version) + + # get the build folder & win32 output folder + build_folder_path = os.path.join(os.path.dirname(proj_path), "Release.win32") + if os.path.exists(build_folder_path): + shutil.rmtree(build_folder_path) + os.makedirs(build_folder_path) + + win32_output_dir = os.path.join(self.tool_dir, output_dir) + if os.path.exists(win32_output_dir): + shutil.rmtree(win32_output_dir) + os.makedirs(win32_output_dir) + + # upgrade projects + if needUpgrade: + commandUpgrade = ' '.join([ + "\"%s\"" % vs_command, + "\"%s\"" % proj_path, + "/Upgrade" + ]) + run_shell(commandUpgrade) + + if self.use_incredibuild: + # use incredibuild, build whole sln + build_cmd = " ".join([ + "BuildConsole", + "%s" % proj_path, + "/build", + "/cfg=\"Release|Win32\"" + ]) + run_shell(build_cmd) + + if not self.use_incredibuild: + # build the projects + for proj_name in self.win32_proj_info[key][Generator.KEY_TARGETS]: + self.build_win32_proj(vs_command, proj_path, proj_name, "build") + + lib_file_path = os.path.join(build_folder_path, "%s.lib" % proj_name) + if not os.path.exists(lib_file_path): + # if the lib is not generated, rebuild the project + self.build_win32_proj(vs_command, proj_path, proj_name, "rebuild") + + if not os.path.exists(lib_file_path): + raise Exception("Library %s not generated as expected!" % lib_file_path) + + # copy the libs into prebuilt dir + for file_name in os.listdir(build_folder_path): + file_path = os.path.join(build_folder_path, file_name) + shutil.copy(file_path, win32_output_dir) + + print("Win32 build succeeded.") + + def build_ios_mac(self): + for key in self.xcode_proj_info.keys(): + output_dir = self.xcode_proj_info[key][Generator.KEY_OUTPUT_DIR] + proj_path = os.path.join(self.engine_dir, key) + ios_out_dir = os.path.join(self.tool_dir, output_dir, "ios") + mac_out_dir = os.path.join(self.tool_dir, output_dir, "mac") + + ios_sim_libs_dir = os.path.join(ios_out_dir, "simulator") + ios_dev_libs_dir = os.path.join(ios_out_dir, "device") + for target in self.xcode_proj_info[key][Generator.KEY_TARGETS]: + build_cmd = Generator.XCODE_CMD_FMT % (proj_path, "%s iOS" % target, "-sdk iphonesimulator", ios_sim_libs_dir) + run_shell(build_cmd, self.tool_dir) + + build_cmd = Generator.XCODE_CMD_FMT % (proj_path, "%s iOS" % target, "-sdk iphoneos", ios_dev_libs_dir) + run_shell(build_cmd, self.tool_dir) + + build_cmd = Generator.XCODE_CMD_FMT % (proj_path, "%s Mac" % target, "", mac_out_dir) + run_shell(build_cmd, self.tool_dir) + + # generate fat libs for iOS + for lib in os.listdir(ios_sim_libs_dir): + sim_lib = os.path.join(ios_sim_libs_dir, lib) + dev_lib = os.path.join(ios_dev_libs_dir, lib) + output_lib = os.path.join(ios_out_dir, lib) + lipo_cmd = "lipo -create -output \"%s\" \"%s\" \"%s\"" % (output_lib, sim_lib, dev_lib) + + run_shell(lipo_cmd) + + # remove the simulator & device libs in iOS + shutil.rmtree(ios_sim_libs_dir) + shutil.rmtree(ios_dev_libs_dir) + + if self.enable_strip: + # strip the libs + ios_strip_cmd = "xcrun -sdk iphoneos strip -S %s/*.a" % ios_out_dir + run_shell(ios_strip_cmd) + mac_strip_cmd = "xcrun strip -S %s/*.a" % mac_out_dir + run_shell(mac_strip_cmd) + + def build_all_libs(self): + if os_is_mac(): + # build for iOS & Mac + self.build_ios_mac() + + if os_is_win32(): + # build for win32 + self.build_win32() + + if not self.no_android: + self.build_android() + + def do_generate(self): + output_dir = os.path.join(self.tool_dir, "prebuilt") + if self.need_clean and os.path.exists(output_dir): + shutil.rmtree(output_dir) + self.build_all_libs() + +if __name__ == "__main__": + parser = ArgumentParser(description="Generate prebuilt engine for Cocos Engine.") + parser.add_argument('-c', dest='need_clean', action="store_true", help='Remove the \"prebuilt\" directory first.') + parser.add_argument('-n', "--no-android", dest='no_android', action="store_true", help='Not build android libs.') + parser.add_argument('-s', "--strip", dest='enable_strip', action="store_true", help='Strip the generated libs.') + parser.add_argument('-i', "--incredibuild", dest='use_incredibuild', action="store_true", help='Use incredibuild to build win32 projects. Only available on windows.') + (args, unknown) = parser.parse_known_args() + + if len(unknown) > 0: + print("unknown arguments: %s" % unknown) + + gen_obj = Generator(args) + gen_obj.do_generate() diff --git a/tools/gen-prebuilt/module_config.json b/tools/gen-prebuilt/module_config.json new file mode 100644 index 0000000000..3e787f9f8b --- /dev/null +++ b/tools/gen-prebuilt/module_config.json @@ -0,0 +1,329 @@ +{ + "cocos2d" : { + "module_type" : "compiled", + "target_dir" : "cocos", + "win32_lib_file_name" : "libcocos2d", + "ios_lib_file_name" : "libcocos2d iOS.a", + "mac_lib_file_name" : "libcocos2d Mac.a", + "android_lib_name" : "cocos2dx_static", + "android_lib_file_name" : "libcocos2d", + "include" : [ + { + "from": "cocos", + "to": "cocos/include", + "include" : [ + "2d/*.h", "3d/*.h", "3d/*.inl", "base/*.h", + "deprecated/*.h", "math/*.h", "math/*.inl", + "physics/*.h", "platform/*.h", "renderer/*.h", + "storage/*.h", "cocos2d.h", "2d/*.props" + ] + }, + { + "from": "cocos/platform/android/java", + "to": "cocos/include/platform/android/java" + }, + { + "from": "external", + "to": "external", + "include": [ + "tinyxml2/*.h", + "unzip/*.h", + "xxhash/*.h", + "json/*.h", + "win32-specific/*" + ] + } + ], + "export_include" : [ + "../../include", + "../../../modules", + "../../../external/tinyxml2", + "../../../external/unzip", + "../../../external/chipmunk/include/chipmunk", + "../../../external/edtaa3func", + "../../../external/xxhash", + "../../../external/ConvertUTF", + "../../../external" + ], + "depend_modules" : [ + "chipmunk", "freetype", "jpeg", + "png", "webp", "tiff", + "cocos_android", "curl", "websockets" + ], + "export_ldlibs" : [ + "GLESv2", "log", "z", "android" + ], + "export_cflags" : [ + "-Wno-psabi", "-DUSE_FILE32API" + ], + "export_cppflags" : [ + "-Wno-literal-suffix", "-Wno-deprecated-declarations" + ] + }, + "freetype" : { + "module_type" : "prebuilt", + "from_dir" : "external/freetype2", + "target_dir" : "external/freetype2", + "android_lib_name" : "cocos_freetype2_static" + }, + "jpeg" : { + "module_type" : "prebuilt", + "from_dir" : "external/jpeg", + "target_dir" : "external/jpeg", + "android_lib_name" : "cocos_jpeg_static" + }, + "png" : { + "module_type" : "prebuilt", + "from_dir" : "external/png", + "target_dir" : "external/png", + "android_lib_name" : "cocos_png_static" + }, + "webp" : { + "module_type" : "prebuilt", + "from_dir" : "external/webp", + "target_dir" : "external/webp", + "android_lib_name" : "cocos_webp_static" + }, + "tiff" : { + "module_type" : "prebuilt", + "from_dir" : "external/tiff", + "target_dir" : "external/tiff", + "android_lib_name" : "cocos_tiff_static" + }, + "curl" : { + "module_type" : "prebuilt", + "from_dir" : "external/curl", + "target_dir" : "external/curl", + "android_lib_name" : "cocos_curl_static" + }, + "websockets" : { + "module_type" : "prebuilt", + "from_dir" : "external/websockets", + "target_dir" : "external/websockets", + "android_lib_name" : "websockets_static" + }, + "glfw3": { + "module_type" : "prebuilt", + "from_dir" : "external/glfw3", + "target_dir" : "external/glfw3" + }, + "cocos_android" : { + "module_type" : "compiled", + "target_dir" : "cocos/include/platform/android", + "android_lib_name" : "cocos2dxandroid_static", + "android_lib_file_name" : "libcocos2dandroid", + "export_include" : [ + "../../" + ], + "export_ldlibs" : [ + "GLESv1_CM", "GLESv2", "EGL", "log", "z", "android" + ] + }, + "chipmunk" : { + "module_type" : "compiled", + "target_dir" : "modules/chipmunk", + "win32_lib_file_name" : "libchipmunk", + "ios_lib_file_name" : "libchipmunk iOS.a", + "mac_lib_file_name" : "libchipmunk Mac.a", + "android_lib_name" : "chipmunk_static", + "android_lib_file_name" : "libchipmunk", + "include" : [ + { + "from": "external/chipmunk", + "to": "modules/chipmunk", + "include" : [ + "include/*.h" + ] + } + ], + "export_include" : [ + "../../include/chipmunk" + ] + }, + "box2d" : { + "module_type" : "compiled", + "target_dir" : "modules/Box2D", + "win32_lib_file_name" : "libbox2d", + "ios_lib_file_name" : "libbox2d iOS.a", + "mac_lib_file_name" : "libbox2d Mac.a", + "android_lib_name" : "box2d_static", + "android_lib_file_name" : "libbox2d", + "include" : [ + { + "from": "external/Box2D", + "to": "modules/Box2D/include/Box2D", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ] + }, + "audio" : { + "module_type" : "compiled", + "target_dir" : "modules/audio", + "win32_lib_file_name" : "libcocosdenshion", + "ios_lib_file_name" : "libcocosdenshion iOS.a", + "mac_lib_file_name" : "libcocosdenshion Mac.a", + "android_lib_name" : "cocosdenshion_static", + "android_lib_file_name" : "libcocosdenshion", + "include" : [ + { + "from": "cocos/audio", + "to": "modules/audio", + "include" : [ + "include/*.h" + ] + } + ], + "export_include" : [ + "../../include" + ] + }, + "network" : { + "module_type" : "compiled", + "target_dir" : "modules/network", + "win32_lib_file_name" : "libnetwork", + "ios_lib_file_name" : "libnetwork iOS.a", + "mac_lib_file_name" : "libnetwork Mac.a", + "android_lib_name" : "cocos_network_static", + "android_lib_file_name" : "libnetwork", + "include" : [ + { + "from": "cocos/network", + "to": "modules/network/include/network", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ], + "depend_modules" : [ + "cocos2d", "curl", "websockets" + ] + }, + "ui" : { + "module_type" : "compiled", + "target_dir" : "modules/ui", + "win32_lib_file_name" : "libui", + "ios_lib_file_name" : "libui iOS.a", + "mac_lib_file_name" : "libui Mac.a", + "android_lib_name" : "cocos_ui_static", + "android_lib_file_name" : "libui", + "include" : [ + { + "from": "cocos/ui", + "to": "modules/ui/include/ui", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ], + "depend_modules" : [ + "cocos2d", "extensions" + ] + }, + "extensions" : { + "module_type" : "compiled", + "target_dir" : "modules/extensions", + "win32_lib_file_name" : "libextension", + "ios_lib_file_name" : "libextension iOS.a", + "mac_lib_file_name" : "libextension Mac.a", + "android_lib_name" : "cocos_extension_static", + "android_lib_file_name" : "libextension", + "include" : [ + { + "from": "extensions", + "to": "modules/extensions/include/extensions", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ], + "depend_modules" : [ + "cocos2d", "curl", "box2d" + ] + }, + "cocostudio" : { + "module_type" : "compiled", + "target_dir" : "modules/cocostudio", + "win32_lib_file_name" : "libcocostudio", + "ios_lib_file_name" : "libcocostudio iOS.a", + "mac_lib_file_name" : "libcocostudio Mac.a", + "android_lib_name" : "cocostudio_static", + "android_lib_file_name" : "libcocostudio", + "include" : [ + { + "from": "cocos/editor-support/cocostudio", + "to": "modules/cocostudio/include/cocostudio", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ], + "depend_modules" : [ + "ui", "audio" + ] + }, + "spine" : { + "module_type" : "compiled", + "target_dir" : "modules/spine", + "win32_lib_file_name" : "libspine", + "ios_lib_file_name" : "libspine iOS.a", + "mac_lib_file_name" : "libspine Mac.a", + "android_lib_name" : "spine_static", + "android_lib_file_name" : "libspine", + "include" : [ + { + "from": "cocos/editor-support/spine", + "to": "modules/spine/include/spine", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ], + "depend_modules" : [ + "cocos2d" + ] + }, + "cocosbuilder" : { + "module_type" : "compiled", + "target_dir" : "modules/cocosbuilder", + "win32_lib_file_name" : "libcocosbuilder", + "ios_lib_file_name" : "libcocosbuilder iOS.a", + "mac_lib_file_name" : "libcocosbuilder Mac.a", + "android_lib_name" : "cocosbuilder_static", + "android_lib_file_name" : "libcocosbuilder", + "include" : [ + { + "from": "cocos/editor-support/cocosbuilder", + "to": "modules/cocosbuilder/include/cocosbuilder", + "include" : [ + "*.h" + ] + } + ], + "export_include" : [ + "../../include" + ], + "depend_modules" : [ + "extensions" + ] + } +} diff --git a/tools/gen-prebuilt/module_organize.py b/tools/gen-prebuilt/module_organize.py new file mode 100644 index 0000000000..ee3f32514a --- /dev/null +++ b/tools/gen-prebuilt/module_organize.py @@ -0,0 +1,239 @@ +import os +import shutil +import json +import excopy + +from argparse import ArgumentParser + +class ModuleOrganizer(object): + + CFG_FILE = "module_config.json" + + KEY_MODULE_TYPE = "module_type" + MODULE_TYPE_COMPILED = "compiled" + MODULE_TYPE_PREBUILT = "prebuilt" + + KEY_MODULE_FROM_DIR = "from_dir" + KEY_MODULE_TARGET_DIR = "target_dir" + KEY_MODULE_INCLUDE = "include" + KEY_MODULE_ANDROID_LIB_NAME = "android_lib_name" + KEY_MODULE_ANDROID_LIB_FILE_NAME = "android_lib_file_name" + KEY_MODULE_EXPORT_INCLUDE = "export_include" + KEY_MODULE_DEPEND_MODULES = "depend_modules" + KEY_MODULE_EXPORT_LDLIBS = "export_ldlibs" + KEY_MODULE_EXPORT_CFLAGS = "export_cflags" + KEY_MODULE_EXPORT_CPPFLAGS = "export_cppflags" + KEY_MODULE_WIN32_LIB_FILE_NAME = "win32_lib_file_name" + KEY_MODULE_IOS_LIB_FILE_NAME = "ios_lib_file_name" + KEY_MODULE_MAC_LIB_FILE_NAME = "mac_lib_file_name" + + # Parameter 5--9 means: + # 5. LOCAL_EXPORT_LDLIBS + # 6. LOCAL_EXPORT_CFLAGS + # 7. LOCAL_EXPORT_CPPFLAGS + # 8. LOCAL_WHOLE_STATIC_LIBRARIES + # 9. $(call import-module, xxx) + MK_FORMAT = "LOCAL_PATH := $(call my-dir)\n\n" \ + "include $(CLEAR_VARS)\n\n" \ + "LOCAL_MODULE := %s\n" \ + "LOCAL_MODULE_FILENAME := %s\n\n" \ + "LOCAL_SRC_FILES := %s\n\n" \ + "LOCAL_EXPORT_C_INCLUDES := %s\n\n" \ + "%s" \ + "%s" \ + "%s" \ + "%s" \ + "include $(PREBUILT_STATIC_LIBRARY)\n\n" \ + "%s\n" + + def __init__(self, dst_root): + self.local_path = os.path.realpath(os.path.dirname(__file__)) + self.modules_info = self._parse_modules() + + self.src_root = os.path.join(self.local_path, os.path.pardir, os.path.pardir) + self.prebuilt_dir = os.path.join(self.local_path, "prebuilt") + + if dst_root is None: + dst = self.local_path + else: + if os.path.isabs(dst_root): + dst = dst_root + else: + dst = os.path.abspath(dst_root) + self.dst_root = os.path.join(dst, "cocos2d-x") + + def _parse_modules(self): + cfg_path = os.path.join(self.local_path, ModuleOrganizer.CFG_FILE) + f = open(cfg_path) + cfg_info = json.load(f) + f.close() + + return cfg_info + + def gen_android_depend_str(self, depends): + whole_libs_str = "" + call_import_str = "" + i = 0 + for module in depends: + depend_info = self.modules_info[module] + if i == 0: + flag = ":" + else: + flag = "+" + whole_libs_str += ("LOCAL_WHOLE_STATIC_LIBRARIES %s= %s\n" % (flag, depend_info[ModuleOrganizer.KEY_MODULE_ANDROID_LIB_NAME])) + call_import_str += ("$(call import-module,%s/prebuilt/android)\n" % depend_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR]) + i += 1 + + whole_libs_str += "\n" + return (whole_libs_str, call_import_str) + + def handle_for_android(self, module_info): + # copy libs file + android_lib_file_name = module_info[ModuleOrganizer.KEY_MODULE_ANDROID_LIB_FILE_NAME] + copy_android_lib_cfg = {} + copy_android_lib_cfg["from"] = "android" + copy_android_lib_cfg["to"] = "%s/prebuilt/android" % module_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR] + copy_android_lib_cfg["include"] = [ + "*/%s.a" % android_lib_file_name + ] + excopy.copy_files_with_config(copy_android_lib_cfg, self.prebuilt_dir, self.dst_root) + + # generate the prebuilt Android.mk for the module + android_lib_name = module_info[ModuleOrganizer.KEY_MODULE_ANDROID_LIB_NAME] + local_src_file = "./$(TARGET_ARCH_ABI)/%s.a" % android_lib_file_name + export_include_paths = [] + for include_path in module_info[ModuleOrganizer.KEY_MODULE_EXPORT_INCLUDE]: + temp_path = "${LOCAL_PATH}/%s" % include_path + export_include_paths.append(temp_path) + export_include_str = " \\\n".join(export_include_paths) + + export_ldlibs_str = "" + if module_info.has_key(ModuleOrganizer.KEY_MODULE_EXPORT_LDLIBS): + export_ldlibs_str = "LOCAL_EXPORT_LDLIBS := " + for ldlib in module_info[ModuleOrganizer.KEY_MODULE_EXPORT_LDLIBS]: + export_ldlibs_str += ("-l%s " % ldlib) + export_ldlibs_str += "\n\n" + + export_cflags_str = "" + if module_info.has_key(ModuleOrganizer.KEY_MODULE_EXPORT_CFLAGS): + export_cflags_str = "LOCAL_EXPORT_CFLAGS := " + export_cflags_str += " ".join(module_info[ModuleOrganizer.KEY_MODULE_EXPORT_CFLAGS]) + export_cflags_str += "\n\n" + + export_cppflags_str = "" + if module_info.has_key(ModuleOrganizer.KEY_MODULE_EXPORT_CPPFLAGS): + export_cppflags_str = "LOCAL_EXPORT_CPPFLAGS := " + export_cppflags_str += " ".join(module_info[ModuleOrganizer.KEY_MODULE_EXPORT_CPPFLAGS]) + export_cppflags_str += "\n\n" + + whole_libs = "" + call_libs = "" + if module_info.has_key(ModuleOrganizer.KEY_MODULE_DEPEND_MODULES): + whole_libs, call_libs = self.gen_android_depend_str(module_info[ModuleOrganizer.KEY_MODULE_DEPEND_MODULES]) + + mk_content = ModuleOrganizer.MK_FORMAT % \ + (android_lib_name, + android_lib_file_name, + local_src_file, + export_include_str, + export_ldlibs_str, + export_cflags_str, + export_cppflags_str, + whole_libs, + call_libs + ) + + mk_file_path = os.path.join(self.dst_root, module_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR], "prebuilt/android/Android.mk") + mk_dir = os.path.dirname(mk_file_path) + if not os.path.exists(mk_dir): + os.makedirs(mk_dir) + mk_obj = open(mk_file_path, "w") + mk_obj.write(mk_content) + mk_obj.close() + + def handle_for_win32(self, module_info): + if module_info.has_key(ModuleOrganizer.KEY_MODULE_WIN32_LIB_FILE_NAME): + dst_dir = os.path.join(self.dst_root, module_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR], "prebuilt", "win32") + src_lib_file = os.path.join(self.prebuilt_dir, "win32", "%s.lib" % module_info[ModuleOrganizer.KEY_MODULE_WIN32_LIB_FILE_NAME]) + src_dll_file = os.path.join(self.prebuilt_dir, "win32", "%s.dll" % module_info[ModuleOrganizer.KEY_MODULE_WIN32_LIB_FILE_NAME]) + if not os.path.exists(dst_dir): + os.makedirs(dst_dir) + + if os.path.exists(src_lib_file): + shutil.copy(src_lib_file, dst_dir) + else: + print("\t%s is not existed" % src_lib_file) + + if os.path.exists(src_dll_file): + shutil.copy(src_dll_file, dst_dir) + + def handle_for_ios_mac(self, module_info): + if module_info.has_key(ModuleOrganizer.KEY_MODULE_IOS_LIB_FILE_NAME): + dst_dir = os.path.join(self.dst_root, module_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR], "prebuilt", "ios") + src_lib_file = os.path.join(self.prebuilt_dir, "ios", module_info[ModuleOrganizer.KEY_MODULE_IOS_LIB_FILE_NAME]) + if not os.path.exists(dst_dir): + os.makedirs(dst_dir) + + if os.path.exists(src_lib_file): + shutil.copy(src_lib_file, dst_dir) + else: + print("\t%s is not existed" % src_lib_file) + + if module_info.has_key(ModuleOrganizer.KEY_MODULE_MAC_LIB_FILE_NAME): + dst_dir = os.path.join(self.dst_root, module_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR], "prebuilt", "mac") + src_lib_file = os.path.join(self.prebuilt_dir, "mac", module_info[ModuleOrganizer.KEY_MODULE_MAC_LIB_FILE_NAME]) + if not os.path.exists(dst_dir): + os.makedirs(dst_dir) + + if os.path.exists(src_lib_file): + shutil.copy(src_lib_file, dst_dir) + else: + print("\t%s is not existed" % src_lib_file) + + def gen_compiled_module(self, module_name): + print("generate compiled module : %s" % module_name) + module_info = self.modules_info[module_name] + # copy the include files + if module_info.has_key(ModuleOrganizer.KEY_MODULE_INCLUDE): + for inclue_cfg in module_info[ModuleOrganizer.KEY_MODULE_INCLUDE]: + excopy.copy_files_with_config(inclue_cfg, self.src_root, self.dst_root) + + # handle the process for android + self.handle_for_android(module_info) + + # handle the process for win32 + self.handle_for_win32(module_info) + + # handle the process for ios and mac + self.handle_for_ios_mac(module_info) + + def gen_prebuilt_module(self, module_name): + print("generate prebuilt module : %s" % module_name) + module_info = self.modules_info[module_name] + copy_cfg = { + "from" : module_info[ModuleOrganizer.KEY_MODULE_FROM_DIR], + "to": module_info[ModuleOrganizer.KEY_MODULE_TARGET_DIR] + } + excopy.copy_files_with_config(copy_cfg, self.src_root, self.dst_root) + + def gen_modules(self): + if os.path.exists(self.dst_root): + shutil.rmtree(self.dst_root) + + for module in self.modules_info.keys(): + module_info = self.modules_info[module] + if module_info[ModuleOrganizer.KEY_MODULE_TYPE] == ModuleOrganizer.MODULE_TYPE_COMPILED: + self.gen_compiled_module(module) + elif module_info[ModuleOrganizer.KEY_MODULE_TYPE] == ModuleOrganizer.MODULE_TYPE_PREBUILT: + self.gen_prebuilt_module(module) + +if __name__ == '__main__': + parser = ArgumentParser(description="Organize the modules of engine from prebuilt engine.") + parser.add_argument('-d', "--dst-root", dest='dst_root', help='The path where to place the engine organized by modules.') + (args, unknown) = parser.parse_known_args() + + if len(unknown) > 0: + print("unknown arguments: %s" % unknown) + + organizer = ModuleOrganizer(args.dst_root) + organizer.gen_modules() From 6dd02ade694f2d9e0f7ed7ac6ea01ea502d89a67 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 30 Jul 2014 07:51:17 +0000 Subject: [PATCH 43/57] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 8dacdf02d2..4219c2ffeb 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -3560,6 +3560,12 @@ "tools/fbx-conv/README.md", "tools/fbx-conv/mac/fbx-conv", "tools/fbx-conv/mac/libfbxsdk.dylib", + "tools/gen-prebuilt/README.md", + "tools/gen-prebuilt/build_config.json", + "tools/gen-prebuilt/excopy.py", + "tools/gen-prebuilt/gen_prebuilt_libs.py", + "tools/gen-prebuilt/module_config.json", + "tools/gen-prebuilt/module_organize.py", "tools/particle/convert_YCoordFlipped.py" ], "lua": [ From c5d2585049550237fcd2a250af782265bddd7b2d Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 15:52:27 +0800 Subject: [PATCH 44/57] refactor Slider control --- cocos/ui/UIImageView.cpp | 2 + cocos/ui/UIScale9Sprite.cpp | 22 +++++++++- cocos/ui/UIScale9Sprite.h | 2 +- cocos/ui/UISlider.cpp | 81 +++++++++++-------------------------- cocos/ui/UISlider.h | 7 ++-- 5 files changed, 51 insertions(+), 63 deletions(-) diff --git a/cocos/ui/UIImageView.cpp b/cocos/ui/UIImageView.cpp index e35c1d355f..f9c16ccc48 100644 --- a/cocos/ui/UIImageView.cpp +++ b/cocos/ui/UIImageView.cpp @@ -105,6 +105,8 @@ bool ImageView::init(const std::string &imageFileName, TextureResType texType) void ImageView::initRenderer() { _imageRenderer = Scale9Sprite::create(); + _imageRenderer->setScale9Enabled(false); + addProtectedChild(_imageRenderer, IMAGE_RENDERER_Z, -1); } diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 042a33b3da..518b710c8c 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -390,6 +390,25 @@ y+=ytranslate; \ this->_positionsAreDirty = true; } + void Scale9Sprite::setAnchorPoint(const cocos2d::Vec2 &anchorPoint) + { + Node::setAnchorPoint(anchorPoint); + + if (_scale9Enabled) { + for(const auto& node : _protectedChildren) + { + node->setAnchorPoint(anchorPoint); + } + } + else + { + if (_scale9Image) { + _scale9Image->setAnchorPoint(anchorPoint); + } + + } + } + void Scale9Sprite::updatePositions() { // Check that instances are non-NULL @@ -866,7 +885,8 @@ y+=ytranslate; \ void Scale9Sprite::adjustScale9ImagePosition() { if (_scale9Image) { - _scale9Image->setPosition(_scale9Image->getPosition() + Vec2(_originalSize.width/2, _originalSize.height/2)); + _scale9Image->setPosition(_scale9Image->getPosition() + Vec2(_originalSize.width * _anchorPoint.x, + _originalSize.height * _anchorPoint.y)); } } diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 2080137672..8a616a35c6 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -246,7 +246,7 @@ namespace ui { // overrides virtual void setContentSize(const Size & size) override; - + virtual void setAnchorPoint(const Vec2& anchorPoint) override; Size getOriginalSize() const; void setPreferredSize(const Size& size); diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 0ed75696c2..963f32e74f 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -98,20 +98,28 @@ bool Slider::init() void Slider::initRenderer() { - _barRenderer = Sprite::create(); - _progressBarRenderer = Sprite::create(); + _barRenderer = Scale9Sprite::create(); + _progressBarRenderer = Scale9Sprite::create(); + _barRenderer->setScale9Enabled(false); + _progressBarRenderer->setScale9Enabled(false); + _progressBarRenderer->setAnchorPoint(Vec2(0.0f, 0.5f)); + addProtectedChild(_barRenderer, BASEBAR_RENDERER_Z, -1); addProtectedChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1); + _slidBallNormalRenderer = Sprite::create(); _slidBallPressedRenderer = Sprite::create(); _slidBallPressedRenderer->setVisible(false); _slidBallDisabledRenderer = Sprite::create(); _slidBallDisabledRenderer->setVisible(false); + _slidBallRenderer = Node::create(); + _slidBallRenderer->addChild(_slidBallNormalRenderer); _slidBallRenderer->addChild(_slidBallPressedRenderer); _slidBallRenderer->addChild(_slidBallDisabledRenderer); + addProtectedChild(_slidBallRenderer, SLIDBALL_RENDERER_Z, -1); } @@ -126,24 +134,10 @@ void Slider::loadBarTexture(const std::string& fileName, TextureResType texType) switch (_barTexType) { case TextureResType::LOCAL: - if (_scale9Enabled) - { - static_cast(_barRenderer)->initWithFile(fileName); - } - else - { - static_cast(_barRenderer)->setTexture(fileName); - } + _barRenderer->initWithFile(fileName); break; case TextureResType::PLIST: - if (_scale9Enabled) - { - static_cast(_barRenderer)->initWithSpriteFrameName(fileName); - } - else - { - static_cast(_barRenderer)->setSpriteFrame(fileName); - } + _barRenderer->initWithSpriteFrameName(fileName); break; default: break; @@ -165,24 +159,10 @@ void Slider::loadProgressBarTexture(const std::string& fileName, TextureResType switch (_progressBarTexType) { case TextureResType::LOCAL: - if (_scale9Enabled) - { - static_cast(_progressBarRenderer)->initWithFile(fileName); - } - else - { - static_cast(_progressBarRenderer)->setTexture(fileName); - } + _progressBarRenderer->initWithFile(fileName); break; case TextureResType::PLIST: - if (_scale9Enabled) - { - static_cast(_progressBarRenderer)->initWithSpriteFrameName(fileName); - } - else - { - static_cast(_progressBarRenderer)->setSpriteFrame(fileName); - } + _progressBarRenderer->initWithSpriteFrameName(fileName); break; default: break; @@ -201,24 +181,9 @@ void Slider::setScale9Enabled(bool able) } _scale9Enabled = able; - removeProtectedChild(_barRenderer); - removeProtectedChild(_progressBarRenderer); - _barRenderer = nullptr; - _progressBarRenderer = nullptr; - if (_scale9Enabled) - { - _barRenderer = Scale9Sprite::create(); - _progressBarRenderer = Scale9Sprite::create(); - } - else - { - _barRenderer = Sprite::create(); - _progressBarRenderer = Sprite::create(); - } - loadBarTexture(_textureFile, _barTexType); - loadProgressBarTexture(_progressBarTextureFile, _progressBarTexType); - addProtectedChild(_barRenderer, BASEBAR_RENDERER_Z, -1); - addProtectedChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1); + _barRenderer->setScale9Enabled(_scale9Enabled); + _progressBarRenderer->setScale9Enabled(_scale9Enabled); + if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; @@ -260,7 +225,7 @@ void Slider::setCapInsetsBarRenderer(const Rect &capInsets) { return; } - static_cast(_barRenderer)->setCapInsets(capInsets); + _barRenderer->setCapInsets(capInsets); } const Rect& Slider::getCapInsetsBarRenderer()const @@ -275,7 +240,7 @@ void Slider::setCapInsetProgressBarRebderer(const Rect &capInsets) { return; } - static_cast(_progressBarRenderer)->setCapInsets(capInsets); + _progressBarRenderer->setCapInsets(capInsets); } const Rect& Slider::getCapInsetsProgressBarRebderer()const @@ -369,11 +334,11 @@ void Slider::setPercent(int percent) _slidBallRenderer->setPosition(Vec2(dis, _contentSize.height / 2.0f)); if (_scale9Enabled) { - static_cast(_progressBarRenderer)->setPreferredSize(Size(dis,_progressBarTextureSize.height)); + _progressBarRenderer->setPreferredSize(Size(dis,_progressBarTextureSize.height)); } else { - Sprite* spriteRenderer = static_cast(_progressBarRenderer); + Sprite* spriteRenderer = _progressBarRenderer->getSprite(); Rect rect = spriteRenderer->getTextureRect(); rect.size.width = _progressBarTextureSize.width * res; spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size); @@ -497,7 +462,7 @@ void Slider::barRendererScaleChangedWithSize() _barLength = _contentSize.width; if (_scale9Enabled) { - static_cast(_barRenderer)->setPreferredSize(_contentSize); + _barRenderer->setPreferredSize(_contentSize); } else { @@ -534,7 +499,7 @@ void Slider::progressBarRendererScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_progressBarRenderer)->setPreferredSize(_contentSize); + _progressBarRenderer->setPreferredSize(_contentSize); _progressBarTextureSize = _progressBarRenderer->getContentSize(); } else diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index 8212dd9026..5c64aa32b9 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -33,7 +33,8 @@ NS_CC_BEGIN class Sprite; namespace ui { - + class Scale9Sprite; + typedef enum { SLIDER_PERCENTCHANGED @@ -226,8 +227,8 @@ protected: virtual void copySpecialProperties(Widget* model) override; virtual void adaptRenderers() override; protected: - Node* _barRenderer; - Node* _progressBarRenderer; + Scale9Sprite* _barRenderer; + Scale9Sprite* _progressBarRenderer; Size _progressBarTextureSize; Sprite* _slidBallNormalRenderer; From 7bcb31f2255f28b74e0b470cd7e7fc4f65e09a8f Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 16:08:29 +0800 Subject: [PATCH 45/57] refactor loadingBar --- cocos/ui/UILoadingBar.cpp | 67 +++++++++++---------------------------- cocos/ui/UILoadingBar.h | 4 +-- 2 files changed, 21 insertions(+), 50 deletions(-) diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index f5644dbf9c..a1197e30ee 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -81,7 +81,8 @@ LoadingBar* LoadingBar::create(const std::string &textureName, float percentage) void LoadingBar::initRenderer() { - _barRenderer = Sprite::create(); + _barRenderer = Scale9Sprite::create(); + _barRenderer->setScale9Enabled(false); addProtectedChild(_barRenderer, BAR_RENDERER_Z, -1); _barRenderer->setAnchorPoint(Vec2(0.0,0.5)); } @@ -100,17 +101,15 @@ void LoadingBar::setDirection(cocos2d::ui::LoadingBar::Direction direction) case Direction::LEFT: _barRenderer->setAnchorPoint(Vec2(0.0f,0.5f)); _barRenderer->setPosition(Vec2(-_totalLength*0.5f,0.0f)); - if (!_scale9Enabled) - { - static_cast(_barRenderer)->setFlippedX(false); + if (!_scale9Enabled) { + _barRenderer->setFlippedX(false); } break; case Direction::RIGHT: _barRenderer->setAnchorPoint(Vec2(1.0f,0.5f)); _barRenderer->setPosition(Vec2(_totalLength*0.5f,0.0f)); - if (!_scale9Enabled) - { - static_cast(_barRenderer)->setFlippedX(true); + if (!_scale9Enabled) { + _barRenderer->setFlippedX(true); } break; } @@ -134,28 +133,10 @@ void LoadingBar::loadTexture(const std::string& texture,TextureResType texType) switch (_renderBarTexType) { case TextureResType::LOCAL: - if (_scale9Enabled) - { - Scale9Sprite* barRendererScale9 = static_cast(_barRenderer); - barRendererScale9->initWithFile(texture); - barRendererScale9->setCapInsets(_capInsets); - } - else - { - static_cast(_barRenderer)->setTexture(texture); - } + _barRenderer->initWithFile(texture); break; case TextureResType::PLIST: - if (_scale9Enabled) - { - Scale9Sprite* barRendererScale9 = static_cast(_barRenderer); - barRendererScale9->initWithSpriteFrameName(texture); - barRendererScale9->setCapInsets(_capInsets); - } - else - { - static_cast(_barRenderer)->setSpriteFrame(texture); - } + _barRenderer->initWithSpriteFrameName(texture); break; default: break; @@ -167,19 +148,19 @@ void LoadingBar::loadTexture(const std::string& texture,TextureResType texType) { case Direction::LEFT: _barRenderer->setAnchorPoint(Vec2(0.0f,0.5f)); - if (!_scale9Enabled) - { - static_cast(_barRenderer)->setFlippedX(false); + if (!_scale9Enabled) { + _barRenderer->setFlippedX(false); } break; case Direction::RIGHT: _barRenderer->setAnchorPoint(Vec2(1.0f,0.5f)); - if (!_scale9Enabled) - { - static_cast(_barRenderer)->setFlippedX(true); + if (!_scale9Enabled) { + _barRenderer->setFlippedX(true); } break; } + _barRenderer->setCapInsets(_capInsets); + barRendererScaleChangedWithSize(); updateContentSizeWithTextureSize(_barRendererTextureSize); _barRendererAdaptDirty = true; @@ -192,18 +173,8 @@ void LoadingBar::setScale9Enabled(bool enabled) return; } _scale9Enabled = enabled; - removeProtectedChild(_barRenderer); - _barRenderer = nullptr; - if (_scale9Enabled) - { - _barRenderer = Scale9Sprite::create(); - } - else - { - _barRenderer = Sprite::create(); - } - loadTexture(_textureFile,_renderBarTexType); - addProtectedChild(_barRenderer, BAR_RENDERER_Z, -1); + _barRenderer->setScale9Enabled(_scale9Enabled); + if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; @@ -230,7 +201,7 @@ void LoadingBar::setCapInsets(const Rect &capInsets) { return; } - static_cast(_barRenderer)->setCapInsets(capInsets); + _barRenderer->setCapInsets(capInsets); } const Rect& LoadingBar::getCapInsets()const @@ -257,7 +228,7 @@ void LoadingBar::setPercent(float percent) } else { - Sprite* spriteRenderer = static_cast(_barRenderer); + Sprite* spriteRenderer = _barRenderer->getSprite(); Rect rect = spriteRenderer->getTextureRect(); rect.size.width = _barRendererTextureSize.width * res; spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size); @@ -351,7 +322,7 @@ void LoadingBar::barRendererScaleChangedWithSize() void LoadingBar::setScale9Scale() { float width = (float)(_percent) / 100.0f * _totalLength; - static_cast(_barRenderer)->setPreferredSize(Size(width, _contentSize.height)); + _barRenderer->setPreferredSize(Size(width, _contentSize.height)); } std::string LoadingBar::getDescription() const diff --git a/cocos/ui/UILoadingBar.h b/cocos/ui/UILoadingBar.h index bfc4137eaa..be68f76306 100644 --- a/cocos/ui/UILoadingBar.h +++ b/cocos/ui/UILoadingBar.h @@ -31,7 +31,7 @@ THE SOFTWARE. NS_CC_BEGIN namespace ui { - + class Scale9Sprite; /** * @js NA * @lua NA @@ -154,7 +154,7 @@ protected: Direction _direction; float _percent; float _totalLength; - Node* _barRenderer; + Scale9Sprite* _barRenderer; TextureResType _renderBarTexType; Size _barRendererTextureSize; bool _scale9Enabled; From add9e3a63ef02875579313b5a434688419ff97a3 Mon Sep 17 00:00:00 2001 From: heliclei Date: Wed, 30 Jul 2014 16:11:07 +0800 Subject: [PATCH 46/57] fix typo:V3->v3 --- tools/jenkins-scripts/pull-request-builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 6df4550d8f..6df99fb569 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -132,7 +132,7 @@ def main(): #reset path to workspace root os.system("cd " + os.environ['WORKSPACE']); #pull latest code - os.system("git pull origin V3") + os.system("git pull origin v3") os.system("git checkout v3") os.system("git branch -D pull" + str(pr_num)) #clean workspace From 83298171d94cb689d167a879d6129681884ecfb1 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 16:33:37 +0800 Subject: [PATCH 47/57] refactor Layout --- cocos/ui/UILayout.cpp | 70 ++++++++++++++++--------------------------- cocos/ui/UILayout.h | 5 ++-- 2 files changed, 29 insertions(+), 46 deletions(-) diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 9c0074867a..9d767a3f73 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -577,7 +577,7 @@ void Layout::onSizeChanged() _backGroundImage->setPosition(Vec2(_contentSize.width/2.0f, _contentSize.height/2.0f)); if (_backGroundScale9Enabled && _backGroundImage) { - static_cast(_backGroundImage)->setPreferredSize(_contentSize); + _backGroundImage->setPreferredSize(_contentSize); } } if (_colorRender) @@ -596,11 +596,13 @@ void Layout::setBackGroundImageScale9Enabled(bool able) { return; } - removeProtectedChild(_backGroundImage); - _backGroundImage = nullptr; _backGroundScale9Enabled = able; - addBackGroundImage(); - setBackGroundImage(_backGroundImageFileName,_bgImageTexType); + if (nullptr == _backGroundImage) + { + addBackGroundImage(); + setBackGroundImage(_backGroundImageFileName,_bgImageTexType); + } + _backGroundImage->setScale9Enabled(_backGroundScale9Enabled); setBackGroundImageCapInsets(_backGroundImageCapInsets); } @@ -621,36 +623,22 @@ void Layout::setBackGroundImage(const std::string& fileName,TextureResType texTy } _backGroundImageFileName = fileName; _bgImageTexType = texType; - if (_backGroundScale9Enabled) + + switch (_bgImageTexType) { - Scale9Sprite* bgiScale9 = static_cast(_backGroundImage); - switch (_bgImageTexType) - { - case TextureResType::LOCAL: - bgiScale9->initWithFile(fileName); - break; - case TextureResType::PLIST: - bgiScale9->initWithSpriteFrameName(fileName); - break; - default: - break; - } - bgiScale9->setPreferredSize(_contentSize); + case TextureResType::LOCAL: + _backGroundImage->initWithFile(fileName); + break; + case TextureResType::PLIST: + _backGroundImage->initWithSpriteFrameName(fileName); + break; + default: + break; } - else - { - switch (_bgImageTexType) - { - case TextureResType::LOCAL: - static_cast(_backGroundImage)->setTexture(fileName); - break; - case TextureResType::PLIST: - static_cast(_backGroundImage)->setSpriteFrame(fileName); - break; - default: - break; - } + if (_backGroundScale9Enabled) { + _backGroundImage->setPreferredSize(_contentSize); } + _backGroundImageTextureSize = _backGroundImage->getContentSize(); _backGroundImage->setPosition(Vec2(_contentSize.width/2.0f, _contentSize.height/2.0f)); updateBackGroundImageRGBA(); @@ -661,7 +649,7 @@ void Layout::setBackGroundImageCapInsets(const Rect &capInsets) _backGroundImageCapInsets = capInsets; if (_backGroundScale9Enabled && _backGroundImage) { - static_cast(_backGroundImage)->setCapInsets(capInsets); + _backGroundImage->setCapInsets(capInsets); } } @@ -706,17 +694,11 @@ void Layout::supplyTheLayoutParameterLackToChild(Widget *child) void Layout::addBackGroundImage() { - if (_backGroundScale9Enabled) - { - _backGroundImage = Scale9Sprite::create(); - addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); - static_cast(_backGroundImage)->setPreferredSize(_contentSize); - } - else - { - _backGroundImage = Sprite::create(); - addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); - } + _backGroundImage = Scale9Sprite::create(); + _backGroundImage->setScale9Enabled(false); + + addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); + _backGroundImage->setPosition(Vec2(_contentSize.width/2.0f, _contentSize.height/2.0f)); } diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 96cf7ba137..63a986f511 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -36,10 +36,11 @@ class DrawNode; class LayerColor; class LayerGradient; + namespace ui { class LayoutManager; - +class Scale9Sprite; class CC_GUI_DLL LayoutProtocol { @@ -466,7 +467,7 @@ protected: //background bool _backGroundScale9Enabled; - Node* _backGroundImage; + Scale9Sprite* _backGroundImage; std::string _backGroundImageFileName; Rect _backGroundImageCapInsets; BackGroundColorType _colorType; From 65775f2d3050e9fddc141c7d9b25de9e0f71f228 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Wed, 30 Jul 2014 16:39:21 +0800 Subject: [PATCH 48/57] remove CC_CONSTUCTOR_ACCESS fow win32 release --- .../cocosbuilder/proj.win32/libcocosbuilder.vcxproj | 2 +- .../editor-support/cocostudio/proj.win32/libcocostudio.vcxproj | 2 +- cocos/editor-support/spine/proj.win32/libSpine.vcxproj | 2 +- cocos/ui/proj.win32/libui.vcxproj | 2 +- extensions/proj.win32/libextension.vcxproj | 2 +- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj index ffdfd9ff9a..c19e5572e8 100644 --- a/cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj +++ b/cocos/editor-support/cocosbuilder/proj.win32/libcocosbuilder.vcxproj @@ -82,7 +82,7 @@ $(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) None false diff --git a/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj index 4b77d77a26..53888d21ad 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libcocostudio.vcxproj @@ -222,7 +222,7 @@ true - WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USRSTUDIODLL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USRSTUDIODLL;%(PreprocessorDefinitions) $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\win32-specific\zlib\include;%(AdditionalIncludeDirectories) None false diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj index 60941a0cb1..c5d85d8d2e 100644 --- a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj @@ -140,7 +140,7 @@ true - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) None false diff --git a/cocos/ui/proj.win32/libui.vcxproj b/cocos/ui/proj.win32/libui.vcxproj index aca6916e12..3ac7d64b8a 100644 --- a/cocos/ui/proj.win32/libui.vcxproj +++ b/cocos/ui/proj.win32/libui.vcxproj @@ -147,7 +147,7 @@ true - WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USEGUIDLL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USEGUIDLL;%(PreprocessorDefinitions) $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) None false diff --git a/extensions/proj.win32/libextension.vcxproj b/extensions/proj.win32/libextension.vcxproj index ba58ce11f1..067f36876f 100644 --- a/extensions/proj.win32/libextension.vcxproj +++ b/extensions/proj.win32/libextension.vcxproj @@ -95,7 +95,7 @@ MinSpace true $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\unzip;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\win32-specific\zlib\include;..\;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;NDEBUG;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USREXDLL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;NDEBUG;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USREXDLL;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index d397774922..51add3e3cd 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -106,7 +106,7 @@ MaxSpeed true ..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\network;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\win32\include;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) + 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 From e6b85fbd771f7c01cc441977c20a9264b733b06e Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 16:55:16 +0800 Subject: [PATCH 49/57] fix minor bugs of UISlider and remove unused header include in ListView --- cocos/ui/UIListView.cpp | 1 - cocos/ui/UISlider.cpp | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index 3927243c7f..447366c718 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -24,7 +24,6 @@ THE SOFTWARE. #include "ui/UIListView.h" #include "ui/UIHelper.h" -#include "ui/UIScale9Sprite.h" NS_CC_BEGIN diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 963f32e74f..a2909b8d9d 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -339,9 +339,12 @@ void Slider::setPercent(int percent) else { Sprite* spriteRenderer = _progressBarRenderer->getSprite(); - Rect rect = spriteRenderer->getTextureRect(); - rect.size.width = _progressBarTextureSize.width * res; - spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size); + + if (nullptr != spriteRenderer) { + Rect rect = spriteRenderer->getTextureRect(); + rect.size.width = _progressBarTextureSize.width * res; + spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size); + } } } From 03368d42f21cda933c2741dde7e628378ed19052 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 30 Jul 2014 17:29:22 +0800 Subject: [PATCH 50/57] refactor, improve imageView stability --- cocos/ui/UIImageView.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cocos/ui/UIImageView.cpp b/cocos/ui/UIImageView.cpp index f9c16ccc48..1f048638a0 100644 --- a/cocos/ui/UIImageView.cpp +++ b/cocos/ui/UIImageView.cpp @@ -146,7 +146,15 @@ void ImageView::setTextureRect(const Rect &rect) } else { - _imageRenderer->getSprite()->setTextureRect(rect); + auto sprite = _imageRenderer->getSprite(); + if (sprite) + { + sprite->setTextureRect(rect); + } + else + { + CCLOG("Warning!! you should load texture before set the texture's rect!"); + } } } From 26cf4321d291d6cacc3f7d6ed4b5578be9b4868c Mon Sep 17 00:00:00 2001 From: heliclei Date: Wed, 30 Jul 2014 23:59:19 +0800 Subject: [PATCH 51/57] fix ios build code sign --- tools/jenkins-scripts/ios-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/jenkins-scripts/ios-build.sh b/tools/jenkins-scripts/ios-build.sh index 887306d6ef..a328c30120 100755 --- a/tools/jenkins-scripts/ios-build.sh +++ b/tools/jenkins-scripts/ios-build.sh @@ -1,5 +1,5 @@ #put xctool.sh into your PATH DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR"/../.. -xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -target "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" clean -xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -target "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build +xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -scheme "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" clean +xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_tests.xcodeproj -scheme "build all tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build From 1de2b78d618373535679347f426b04f4b56dcc71 Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 31 Jul 2014 11:07:20 +0800 Subject: [PATCH 52/57] refactor, optimize Scale9Sprite --- cocos/ui/UIButton.cpp | 9 +- cocos/ui/UIScale9Sprite.cpp | 48 +++++----- cocos/ui/UIScale9Sprite.h | 2 + .../CocoStudioGUITest/CocosGUIScene.cpp | 2 +- .../UIButtonTest/UIButtonTest.cpp | 96 ++++++++++++++++++- .../UIButtonTest/UIButtonTest.h | 13 +++ .../CocoStudioGUITest/UISceneManager.cpp | 51 ++-------- .../UITest/CocoStudioGUITest/UISceneManager.h | 1 + 8 files changed, 149 insertions(+), 73 deletions(-) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index c7fa5ff57d..bdd72c7b8a 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -505,8 +505,9 @@ void Button::normalTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_buttonNormalRenderer)->setPreferredSize(_contentSize); + _buttonNormalRenderer->setPreferredSize(_contentSize); _normalTextureScaleXInSize = _normalTextureScaleYInSize = 1.0f; + _buttonNormalRenderer->setScale(_normalTextureScaleXInSize,_normalTextureScaleYInSize); } else { @@ -541,8 +542,9 @@ void Button::pressedTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_buttonClickedRenderer)->setPreferredSize(_contentSize); + _buttonClickedRenderer->setPreferredSize(_contentSize); _pressedTextureScaleXInSize = _pressedTextureScaleYInSize = 1.0f; + _buttonClickedRenderer->setScale(_pressedTextureScaleXInSize,_pressedTextureScaleYInSize); } else { @@ -576,7 +578,8 @@ void Button::disabledTextureScaleChangedWithSize() { if (_scale9Enabled) { - static_cast(_buttonDisableRenderer)->setPreferredSize(_contentSize); + _buttonDisableRenderer->setScale(1.0); + _buttonDisableRenderer->setPreferredSize(_contentSize); } else { diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 518b710c8c..13bb0eef4f 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -62,58 +62,58 @@ namespace ui { void Scale9Sprite::cleanupSlicedSprites() { - if (_topLeft) + if (_topLeft && _top->isRunning()) { _topLeft->onExit(); } - if (_top) + if (_top && _top->isRunning()) { _top->onExit(); } - if (_topRight) + if (_topRight && _top->isRunning()) { _topRight->onExit(); } - if (_left) + if (_left && _top->isRunning()) { _left->onExit(); } - if (_centre) + if (_centre && _top->isRunning()) { _centre->onExit(); } - if (_right) + if (_right && _top->isRunning()) { _right->onExit(); } - if (_bottomLeft) + if (_bottomLeft && _top->isRunning()) { _bottomLeft->onExit(); } - if (_bottomRight) + if (_bottomRight && _top->isRunning()) { _bottomRight->onExit(); } - if (_bottom) + if (_bottom && _top->isRunning()) { _bottom->onExit(); } - CC_SAFE_RELEASE(_topLeft); - CC_SAFE_RELEASE(_top); - CC_SAFE_RELEASE(_topRight); - CC_SAFE_RELEASE(_left); - CC_SAFE_RELEASE(_centre); - CC_SAFE_RELEASE(_right); - CC_SAFE_RELEASE(_bottomLeft); - CC_SAFE_RELEASE(_bottom); - CC_SAFE_RELEASE(_bottomRight); + CC_SAFE_RELEASE_NULL(_topLeft); + CC_SAFE_RELEASE_NULL(_top); + CC_SAFE_RELEASE_NULL(_topRight); + CC_SAFE_RELEASE_NULL(_left); + CC_SAFE_RELEASE_NULL(_centre); + CC_SAFE_RELEASE_NULL(_right); + CC_SAFE_RELEASE_NULL(_bottomLeft); + CC_SAFE_RELEASE_NULL(_bottom); + CC_SAFE_RELEASE_NULL(_bottomRight); } bool Scale9Sprite::init() @@ -188,8 +188,9 @@ y+=ytranslate; \ _preferredSize = _originalSize; _capInsetsInternal = capInsets; - - this->createSlicedSprites(rect, rotated); + if (_scale9Enabled) { + this->createSlicedSprites(rect, rotated); + } this->setContentSize(rect.size); @@ -852,6 +853,9 @@ y+=ytranslate; \ void Scale9Sprite::setScale9Enabled(bool enabled) { _scale9Enabled = enabled; + if (!_scale9Enabled) { + this->cleanupSlicedSprites(); + } _reorderProtectedChildDirty = true; } @@ -885,8 +889,8 @@ y+=ytranslate; \ void Scale9Sprite::adjustScale9ImagePosition() { if (_scale9Image) { - _scale9Image->setPosition(_scale9Image->getPosition() + Vec2(_originalSize.width * _anchorPoint.x, - _originalSize.height * _anchorPoint.y)); + _scale9Image->setPosition(Vec2(_contentSize.width * _anchorPoint.x, + _contentSize.height * _anchorPoint.y)); } } diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 8a616a35c6..1db19b9e1d 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -41,6 +41,8 @@ namespace ui { * to specific areas of a sprite. With 9-slice scaling (3x3 grid), * you can ensure that the sprite does not become distorted when * scaled. + * Note: When you set _scale9Enabled to false, then you could call scale9Sprite->getSprite() to return a new Sprite pointer. + * Then you could call any methods of Sprite class with the return pointers. * */ class CC_GUI_DLL Scale9Sprite : public Node diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 29fa20b5e6..055bbc2fa3 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(kUIButtonTest_RemoveSelf); + sceneManager->setMaxUISceneId(kUIButtonTestSwitchScale9); 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 8b8e7959dd..aad498fcd0 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -378,13 +378,23 @@ bool UIButtonTestRemoveSelf::init() _uiLayer->addChild(alert); + Layout *layout = Layout::create(); + layout->setContentSize(widgetSize * 0.6); + layout->setBackGroundColor(Color3B::GREEN); + layout->setBackGroundColorType(Layout::BackGroundColorType::SOLID); + layout->setBackGroundColorOpacity(100); + layout->setPosition(Size(widgetSize.width/2, widgetSize.height/2)); + layout->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + layout->setTag(12); + _uiLayer->addChild(layout); + // Create the button Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + button->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); - _uiLayer->addChild(button); + layout->addChild(button); @@ -408,8 +418,86 @@ void UIButtonTestRemoveSelf::touchEvent(Ref *pSender, Widget::TouchEventType typ case Widget::TouchEventType::ENDED: { _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); - - _uiLayer->removeFromParentAndCleanup(true); + auto layout = _uiLayer->getChildByTag(12); + layout->removeFromParentAndCleanup(true); + } + break; + + case Widget::TouchEventType::CANCELED: + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); + break; + + default: + break; + } +} + +// UIButtonTestSwitchScale9 +UIButtonTestSwitchScale9::UIButtonTestSwitchScale9() +: _displayValueLabel(nullptr) +{ + +} + +UIButtonTestSwitchScale9::~UIButtonTestSwitchScale9() +{ +} + +bool UIButtonTestSwitchScale9::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the button events will be displayed + _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf",32); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _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)); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); + button->ignoreContentAdaptWithSize(false); + + _uiLayer->addChild(button); + + + + return true; + } + return false; +} + +void UIButtonTestSwitchScale9::touchEvent(Ref *pSender, Widget::TouchEventType type) +{ + switch (type) + { + case Widget::TouchEventType::BEGAN: + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); + break; + + case Widget::TouchEventType::MOVED: + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); + break; + + case Widget::TouchEventType::ENDED: + { + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + auto btn = ((Button*)pSender); + btn->setScale9Enabled(!btn->isScale9Enabled()); + btn->setContentSize(Size(200,100)); } break; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index 48031ba3b3..c9f7be36f7 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -92,4 +92,17 @@ protected: Text* _displayValueLabel; }; +class UIButtonTestSwitchScale9 : public UIScene +{ +public: + UIButtonTestSwitchScale9(); + ~UIButtonTestSwitchScale9(); + bool init(); + void touchEvent(Ref *pSender, Widget::TouchEventType type); + +protected: + UI_SCENE_CREATE_FUNC(UIButtonTestSwitchScale9) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIButtonTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index a7873d9b69..0216a22967 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -22,21 +22,7 @@ #include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif #include "UIScale9SpriteTest.h" -/* -#include "UISwitchTest/UISwitchTest.h" - */ - /* -#include "UIProgressTimerTest/UIProgressTimerTest.h" - */ -/* -#include "UIPotentiometerTest/UIPotentiometerTest.h" - */ -/* -#include "UIGridViewTest/UIGridViewTest.h" - */ -/* -#include "UIPickerViewTest/UIPickerViewTest.h" - */ + USING_NS_CC; @@ -47,17 +33,11 @@ static const char* s_testArray[] = "UIButtonTest_PressedAction", "UIButtonTest_Title", "UIButtonTest_RemoveSelf", + "UIButtonTestSwitchScale9", "UICheckBoxTest", "UISliderTest", "UISliderTest_Scale9", - /* - "UIPotentiometerTest", - */ - /* - "UISwitchTest_Horizontal", - "UISwitchTest_Vertical", - "UISwitchTest_VerticalAndTitleVertical", - */ + "UIImageViewTest", "UIImageViewTest_Scale9", "UIImageViewTest_ContentSize", @@ -65,15 +45,7 @@ static const char* s_testArray[] = "UILoadingBarTest_Right", "UILoadingBarTest_Left_Scale9", "UILoadingBarTest_Right_Scale9", - /* - "UIProgressTimerTest_Radial", - "UIProgressTimerTest_Horizontal", - "UIProgressTimerTest_Vertical", - "UIProgressTimerTest_RadialMidpointChanged", - "UIProgressTimerTest_BarVarious", - "UIProgressTimerTest_BarTintAndFade", - "UIProgressTimerTest_WithSpriteFrame", - */ + "UITextAtlasTest", "UITextTest", "UITextTest_LineWrap", @@ -96,9 +68,7 @@ static const char* s_testArray[] = "UILayoutTest_Layout_Linear_Horizontal", "UILayoutTest_Layout_Relative_Align_Parent", "UILayoutTest_Layout_Relative_Location", - /* - "UILayoutTest_Layout_Grid", - */ + "UIScrollViewTest_Vertical", "UIScrollViewTest_Horizontal", "UIScrollViewTest_Both", @@ -108,14 +78,7 @@ static const char* s_testArray[] = "UIPageViewButtonTest", "UIListViewTest_Vertical", "UIListViewTest_Horizontal", - /* - "UIGridViewTest_Mode_Column", - "UIGridViewTest_Mode_Row", - */ - /* - "UIPickerViewTest_Vertical", - "UIPickerViewTest_Horizontal", - */ + "UIWidgetAddNodeTest", "UIRichTextTest", "UIFocusTest-HBox", @@ -214,6 +177,8 @@ Scene *UISceneManager::currentUIScene() return UIButtonTest_Title::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIButtonTest_RemoveSelf: return UIButtonTestRemoveSelf::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIButtonTestSwitchScale9: + return UIButtonTestSwitchScale9::sceneWithTitle(s_testArray[_currentUISceneId]); case kUICheckBoxTest: return UICheckBoxTest::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 43ba39534e..f316bb12cf 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -36,6 +36,7 @@ enum kUIButtonTest_PressedAction, kUIButtonTest_Title, kUIButtonTest_RemoveSelf, + kUIButtonTestSwitchScale9, kUICheckBoxTest, kUISliderTest, kUISliderTest_Scale9, From eb3b58edc478cbf2dc7546a17e47b264cbc6573d Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 31 Jul 2014 13:44:22 +0800 Subject: [PATCH 53/57] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 5407ce55e8..cc5c8ed654 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,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] TextField: support utf8 [FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X [FIX] Label: can not set charmap after it is created From 095d4ed3c5436894e78e19b4cef7f2a2c724859a Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 31 Jul 2014 05:49:25 +0000 Subject: [PATCH 54/57] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/Helper.lua | 8 ++++ .../auto/lua_cocos2dx_ui_auto.cpp | 38 +++++++++++++++++++ .../auto/lua_cocos2dx_ui_auto.hpp | 1 + 3 files changed, 47 insertions(+) diff --git a/cocos/scripting/lua-bindings/auto/api/Helper.lua b/cocos/scripting/lua-bindings/auto/api/Helper.lua index bc0337fd7b..f7d6579957 100644 --- a/cocos/scripting/lua-bindings/auto/api/Helper.lua +++ b/cocos/scripting/lua-bindings/auto/api/Helper.lua @@ -3,6 +3,14 @@ -- @module Helper -- @parent_module ccui +-------------------------------- +-- @function [parent=#Helper] getSubStringOfUTF8String +-- @param self +-- @param #string str +-- @param #unsigned long long +-- @param #unsigned long long +-- @return string#string ret (return value: string) + -------------------------------- -- @function [parent=#Helper] seekWidgetByTag -- @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 5f5c7f0e32..bf865d8ee3 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -15722,6 +15722,43 @@ int lua_register_cocos2dx_ui_PageView(lua_State* tolua_S) return 1; } +int lua_cocos2dx_ui_Helper_getSubStringOfUTF8String(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,"ccui.Helper",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 3) + { + std::string arg0; + unsigned long arg1; + unsigned long arg2; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccui.Helper:getSubStringOfUTF8String"); + ok &= luaval_to_ulong(tolua_S, 3, &arg1, "ccui.Helper:getSubStringOfUTF8String"); + ok &= luaval_to_ulong(tolua_S, 4, &arg2, "ccui.Helper:getSubStringOfUTF8String"); + if(!ok) + return 0; + std::string ret = cocos2d::ui::Helper::getSubStringOfUTF8String(arg0, arg1, arg2); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccui.Helper:getSubStringOfUTF8String",argc, 3); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Helper_getSubStringOfUTF8String'.",&tolua_err); +#endif + return 0; +} int lua_cocos2dx_ui_Helper_seekWidgetByTag(lua_State* tolua_S) { int argc = 0; @@ -15839,6 +15876,7 @@ int lua_register_cocos2dx_ui_Helper(lua_State* tolua_S) tolua_cclass(tolua_S,"Helper","ccui.Helper","",nullptr); tolua_beginmodule(tolua_S,"Helper"); + tolua_function(tolua_S,"getSubStringOfUTF8String", lua_cocos2dx_ui_Helper_getSubStringOfUTF8String); tolua_function(tolua_S,"seekWidgetByTag", lua_cocos2dx_ui_Helper_seekWidgetByTag); tolua_function(tolua_S,"seekActionWidgetByActionTag", lua_cocos2dx_ui_Helper_seekActionWidgetByActionTag); tolua_function(tolua_S,"seekWidgetByName", lua_cocos2dx_ui_Helper_seekWidgetByName); 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 97b5ec8651..288410d65d 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -397,6 +397,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + #endif // __cocos2dx_ui_h__ From 2bf2bbeed7f747706617e2be4bcacb674b0f22c1 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 31 Jul 2014 15:46:16 +0800 Subject: [PATCH 55/57] 1. remove mac 32bit 2. remove copy files for mac(because of mac use .a instead of dylib) --- build/cocos2d_libs.xcodeproj/project.pbxproj | 24 ++++++- build/cocos2d_tests.xcodeproj/project.pbxproj | 67 +++---------------- 2 files changed, 30 insertions(+), 61 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 985a35ce78..33346e6166 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -7844,7 +7844,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_EXTENSION = a; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -7877,7 +7877,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_EXTENSION = a; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -7910,6 +7910,7 @@ A03F2CB61780BD04006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; HEADER_SEARCH_PATHS = ""; @@ -7920,6 +7921,7 @@ A03F2CB71780BD04006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -7931,6 +7933,7 @@ A03F2D991780BDF7006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -7946,6 +7949,7 @@ A03F2D9A1780BDF7006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; EXECUTABLE_PREFIX = ""; @@ -7962,6 +7966,7 @@ A03F2E90178141C1006731B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "COCOS2D_DEBUG=1", @@ -7978,6 +7983,7 @@ A03F2E91178141C1006731B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; HEADER_SEARCH_PATHS = ( "$(inherited)", "/Applications/Xcode\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", @@ -7989,6 +7995,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; @@ -8001,6 +8008,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; @@ -8014,6 +8022,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = ""; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8032,6 +8041,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = ""; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -8278,6 +8288,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8296,6 +8307,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8536,6 +8548,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8554,6 +8567,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8573,6 +8587,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8591,6 +8606,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8610,6 +8626,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8628,6 +8645,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -8647,6 +8665,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD)"; EXECUTABLE_PREFIX = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -8668,6 +8687,7 @@ 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 87aaaf3ad1..953553e7d1 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -916,10 +916,6 @@ A07A52BF1783AF210073F6A7 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; }; A07A52C01783AF250073F6A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; }; A07A52C31783B02C0073F6A7 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; }; - B24024DB1978DE1000FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; - B24024DD1978EC0700FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; - B24024E31978ED5200FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; - B24024E51978ED5F00FDE433 /* libcocos2d Mac.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; B2411C9E19822FBD00E093E2 /* libcocostudio iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503B197763A20041958E /* libcocostudio iOS.a */; }; B2411CA119822FDD00E093E2 /* libcocosbuilder iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503D197763A20041958E /* libcocosbuilder iOS.a */; }; B2411CA419822FF100E093E2 /* libspine iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2CC503F197763A20041958E /* libspine iOS.a */; }; @@ -1726,49 +1722,6 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - B24024D81978DE0800FDE433 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - B24024DB1978DE1000FDE433 /* libcocos2d Mac.a in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B24024DC1978EBFE00FDE433 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - B24024DD1978EC0700FDE433 /* libcocos2d Mac.a in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B24024E21978ED4B00FDE433 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - B24024E31978ED5200FDE433 /* libcocos2d Mac.a in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B24024E41978ED5800FDE433 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - B24024E51978ED5F00FDE433 /* libcocos2d Mac.a in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 1503FAA918DA8B6C00F6518C /* ftp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ftp.lua; path = ../external/lua/luasocket/ftp.lua; sourceTree = ""; }; 1503FAAA18DA8B6C00F6518C /* headers.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = headers.lua; path = ../external/lua/luasocket/headers.lua; sourceTree = ""; }; @@ -7830,7 +7783,6 @@ 1A0EE1D118CDF6DA004CD58F /* Resources */, 1A0EE1F618CDF6DA004CD58F /* Sources */, 1A0EE29F18CDF6DA004CD58F /* Frameworks */, - B24024D81978DE0800FDE433 /* CopyFiles */, ); buildRules = ( ); @@ -7851,7 +7803,6 @@ 1A0EE2C318CDF733004CD58F /* Sources */, 1A0EE2C818CDF733004CD58F /* Frameworks */, 1A0EE2D818CDF733004CD58F /* Resources */, - B24024E21978ED4B00FDE433 /* CopyFiles */, ); buildRules = ( ); @@ -7926,7 +7877,6 @@ 1ABCA28218CD91510087CE3A /* Sources */, 1ABCA28318CD91510087CE3A /* Frameworks */, 1ABCA28418CD91510087CE3A /* Resources */, - B24024E41978ED5800FDE433 /* CopyFiles */, ); buildRules = ( ); @@ -7981,7 +7931,6 @@ 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, - B24024DC1978EBFE00FDE433 /* CopyFiles */, ); buildRules = ( ); @@ -9697,7 +9646,7 @@ 1A0EE2B018CDF6DA004CD58F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -9712,7 +9661,7 @@ 1A0EE2B118CDF6DA004CD58F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -9728,7 +9677,7 @@ 1A0EE31218CDF733004CD58F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -9748,7 +9697,7 @@ 1A0EE31318CDF733004CD58F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -9835,7 +9784,7 @@ 1ABCA2B318CD91520087CE3A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -9855,7 +9804,7 @@ 1ABCA2B418CD91520087CE3A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -9909,7 +9858,7 @@ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -9923,7 +9872,7 @@ 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, From ee4e479ce1769cf0a8345be7b3ae4dbb0f250ad3 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 31 Jul 2014 16:38:55 +0800 Subject: [PATCH 56/57] Remove CCProtectedNode.h/.cpp from ui/base to 2d and modify the related project setting --- build/cocos2d_libs.xcodeproj/project.pbxproj | 24 ++++++++++---------- cocos/{ui => 2d}/CCProtectedNode.cpp | 0 cocos/{ui => 2d}/CCProtectedNode.h | 3 +-- cocos/2d/CMakeLists.txt | 1 + cocos/2d/libcocos2d.vcxproj | 2 ++ cocos/2d/libcocos2d.vcxproj.filters | 6 +++++ cocos/Android.mk | 1 + cocos/ui/Android.mk | 1 - cocos/ui/CMakeLists.txt | 1 - cocos/ui/UIWidget.h | 2 +- cocos/ui/proj.win32/libui.vcxproj | 2 -- cocos/ui/proj.win32/libui.vcxproj.filters | 6 ----- tools/tolua/cocos2dx.ini | 2 +- 13 files changed, 25 insertions(+), 26 deletions(-) rename cocos/{ui => 2d}/CCProtectedNode.cpp (100%) rename cocos/{ui => 2d}/CCProtectedNode.h (99%) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 985a35ce78..ee9765ede5 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -50,6 +50,10 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 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 */; }; + 15EFA214198A2BB5000C57D3 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */; }; 1A01C68418F57BE800EFE3A6 /* CCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A01C67618F57BE800EFE3A6 /* CCArray.cpp */; }; 1A01C68518F57BE800EFE3A6 /* CCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A01C67618F57BE800EFE3A6 /* CCArray.cpp */; }; 1A01C68618F57BE800EFE3A6 /* CCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A01C67718F57BE800EFE3A6 /* CCArray.h */; }; @@ -1340,7 +1344,6 @@ B2C59A2919777E7A00B452DF /* CocosGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905F9E918CF08D000240AA3 /* CocosGUI.cpp */; }; B2C59A2A19777E8300B452DF /* UIDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */; }; B2C59A2B19777E8300B452DF /* UIWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FA1318CF08D100240AA3 /* UIWidget.cpp */; }; - B2C59A2C19777E8300B452DF /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */; }; B2C59A2D19777E8300B452DF /* UIHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905F9F418CF08D000240AA3 /* UIHelper.cpp */; }; B2C59A2E19777E8C00B452DF /* UIHBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D32E18E174130051CA34 /* UIHBox.cpp */; }; B2C59A2F19777E8C00B452DF /* UIRelativeBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D33018E174130051CA34 /* UIRelativeBox.cpp */; }; @@ -1364,7 +1367,6 @@ B2C59A4119777EBC00B452DF /* UIVideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */; }; B2C59A4219777EC700B452DF /* UIDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 29080DEB191B82CE0066F8DF /* UIDeprecated.h */; }; B2C59A4319777EC700B452DF /* UIWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905FA1418CF08D100240AA3 /* UIWidget.h */; }; - B2C59A4419777EC700B452DF /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E6D30D18DADB5D0051CA34 /* CCProtectedNode.h */; }; B2C59A4519777EC700B452DF /* UIHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905F9F518CF08D000240AA3 /* UIHelper.h */; }; B2C59A4619777EC700B452DF /* GUIDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905F9EB18CF08D000240AA3 /* GUIDefine.h */; }; B2C59A4719777ECF00B452DF /* UIHBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E6D32F18E174130051CA34 /* UIHBox.h */; }; @@ -1549,11 +1551,9 @@ 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 */; }; - B2DB4763197661CD00411E16 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */; }; 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 */; }; - B2DB4767197664EE00411E16 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E6D30D18DADB5D0051CA34 /* CCProtectedNode.h */; }; B2DB47681976650A00411E16 /* UIWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905FA1418CF08D100240AA3 /* UIWidget.h */; }; B2DB47691976651E00411E16 /* UIHBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E6D32F18E174130051CA34 /* UIHBox.h */; }; B2DB476A1976653000411E16 /* UILayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905F9F918CF08D000240AA3 /* UILayout.h */; }; @@ -2038,6 +2038,8 @@ 06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.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 = ""; }; + 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtectedNode.h; sourceTree = ""; }; 1A01C67618F57BE800EFE3A6 /* CCArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArray.cpp; sourceTree = ""; }; 1A01C67718F57BE800EFE3A6 /* CCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArray.h; sourceTree = ""; }; 1A01C67818F57BE800EFE3A6 /* CCBool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBool.h; sourceTree = ""; }; @@ -2913,8 +2915,6 @@ 50ABBF541926664700A911A9 /* CCPlatformDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; 50ABBF551926664700A911A9 /* CCStdC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; 50DC5180187B817900A9C23F /* RELEASE_NOTES.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = RELEASE_NOTES.md; path = ../docs/RELEASE_NOTES.md; sourceTree = ""; }; - 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProtectedNode.cpp; sourceTree = ""; }; - 50E6D30D18DADB5D0051CA34 /* CCProtectedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtectedNode.h; sourceTree = ""; }; 50E6D32E18E174130051CA34 /* UIHBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIHBox.cpp; sourceTree = ""; }; 50E6D32F18E174130051CA34 /* UIHBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIHBox.h; sourceTree = ""; }; 50E6D33018E174130051CA34 /* UIRelativeBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIRelativeBox.cpp; sourceTree = ""; }; @@ -3356,6 +3356,8 @@ 1A570095180BC5B00088DEC7 /* base-nodes */ = { isa = PBXGroup; children = ( + 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */, + 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */, 1A57009C180BC5D20088DEC7 /* CCNode.cpp */, 1A57009D180BC5D20088DEC7 /* CCNode.h */, 1A570096180BC5C10088DEC7 /* CCAtlasNode.cpp */, @@ -4288,8 +4290,6 @@ 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */, 2905FA1318CF08D100240AA3 /* UIWidget.cpp */, 2905FA1418CF08D100240AA3 /* UIWidget.h */, - 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */, - 50E6D30D18DADB5D0051CA34 /* CCProtectedNode.h */, 2905F9F418CF08D000240AA3 /* UIHelper.cpp */, 2905F9F518CF08D000240AA3 /* UIHelper.h */, 2905F9EB18CF08D000240AA3 /* GUIDefine.h */, @@ -5322,6 +5322,7 @@ 50ABBE431925AB6F00A911A9 /* CCDirector.h in Headers */, 1A12775B18DFCC540005F345 /* CCTweenFunction.h in Headers */, 1A5702CA180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */, + 15EFA213198A2BB5000C57D3 /* CCProtectedNode.h in Headers */, 1A5702EC180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */, 1A5702F0180BCE750088DEC7 /* CCTMXLayer.h in Headers */, 50ABC01B1926664800A911A9 /* CCSAXParser.h in Headers */, @@ -5677,6 +5678,7 @@ 5034CA2C191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */, 50ABBE981925AB6F00A911A9 /* CCProtocols.h in Headers */, 50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */, + 15EFA214198A2BB5000C57D3 /* CCProtectedNode.h in Headers */, 50ABBE441925AB6F00A911A9 /* CCDirector.h in Headers */, 5034CA4A191D591100CE6051 /* ccShader_Label_df.frag in Headers */, 1A570281180BCC900088DEC7 /* CCSprite.h in Headers */, @@ -5938,7 +5940,6 @@ B2DB47881976663A00411E16 /* UIRichText.h in Headers */, B2DB47801976660200411E16 /* UIButton.h in Headers */, B2DB47821976660C00411E16 /* UICheckBox.h in Headers */, - B2DB4767197664EE00411E16 /* CCProtectedNode.h in Headers */, B2DB47861976662D00411E16 /* UILoadingBar.h in Headers */, B2DB47681976650A00411E16 /* UIWidget.h in Headers */, 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */, @@ -5980,7 +5981,6 @@ B2C59A4119777EBC00B452DF /* UIVideoPlayer.h in Headers */, B2C59A4219777EC700B452DF /* UIDeprecated.h in Headers */, B2C59A4319777EC700B452DF /* UIWidget.h in Headers */, - B2C59A4419777EC700B452DF /* CCProtectedNode.h in Headers */, B2C59A4519777EC700B452DF /* UIHelper.h in Headers */, B2C59A4619777EC700B452DF /* GUIDefine.h in Headers */, B2C59A4719777ECF00B452DF /* UIHBox.h in Headers */, @@ -6696,6 +6696,7 @@ 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 */, 50ABBE271925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */, 50ABBE8B1925AB6F00A911A9 /* CCNS.cpp in Sources */, @@ -7183,6 +7184,7 @@ 1A1645B3191B726C008C7C7F /* ConvertUTFWrapper.cpp in Sources */, 1ABA68AF1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */, 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 */, @@ -7326,7 +7328,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B2DB4763197661CD00411E16 /* CCProtectedNode.cpp in Sources */, B2DB4764197661D500411E16 /* UIWidget.cpp in Sources */, B2DB4765197661E400411E16 /* UIHBox.cpp in Sources */, B2DB4766197661EE00411E16 /* UILayout.cpp in Sources */, @@ -7375,7 +7376,6 @@ B2C59A2819777E7500B452DF /* UIImageView.cpp in Sources */, B2C59A2A19777E8300B452DF /* UIDeprecated.cpp in Sources */, B2C59A2B19777E8300B452DF /* UIWidget.cpp in Sources */, - B2C59A2C19777E8300B452DF /* CCProtectedNode.cpp in Sources */, B2C59A2D19777E8300B452DF /* UIHelper.cpp in Sources */, B2C59A2E19777E8C00B452DF /* UIHBox.cpp in Sources */, B2C59A2F19777E8C00B452DF /* UIRelativeBox.cpp in Sources */, diff --git a/cocos/ui/CCProtectedNode.cpp b/cocos/2d/CCProtectedNode.cpp similarity index 100% rename from cocos/ui/CCProtectedNode.cpp rename to cocos/2d/CCProtectedNode.cpp diff --git a/cocos/ui/CCProtectedNode.h b/cocos/2d/CCProtectedNode.h similarity index 99% rename from cocos/ui/CCProtectedNode.h rename to cocos/2d/CCProtectedNode.h index f8ad28f42c..dcc3ff5463 100644 --- a/cocos/ui/CCProtectedNode.h +++ b/cocos/2d/CCProtectedNode.h @@ -31,11 +31,10 @@ #include "2d/CCNode.h" -#include "ui/GUIExport.h" NS_CC_BEGIN -class CC_GUI_DLL ProtectedNode : public Node +class CC_DLL ProtectedNode : public Node { public: static ProtectedNode * create(void); diff --git a/cocos/2d/CMakeLists.txt b/cocos/2d/CMakeLists.txt index df2077e60e..2a7ac4d6e6 100644 --- a/cocos/2d/CMakeLists.txt +++ b/cocos/2d/CMakeLists.txt @@ -58,6 +58,7 @@ set(COCOS_2D_SRC 2d/CCParticleSystem.cpp 2d/CCParticleSystemQuad.cpp 2d/CCProgressTimer.cpp + 2d/CCProtectedNode.cpp 2d/CCRenderTexture.cpp 2d/CCScene.cpp 2d/CCSpriteBatchNode.cpp diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 9556b9f757..833c88ee40 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -339,6 +339,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -546,6 +547,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 af5fa51213..c48e0ee402 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -595,6 +595,9 @@ storage + + 2d + @@ -1210,6 +1213,9 @@ storage + + 2d + diff --git a/cocos/Android.mk b/cocos/Android.mk index 740d7952ca..01a4442da0 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -55,6 +55,7 @@ cocos2d.cpp \ 2d/CCParticleSystem.cpp \ 2d/CCParticleSystemQuad.cpp \ 2d/CCProgressTimer.cpp \ +2d/CCProtectedNode.cpp \ 2d/CCRenderTexture.cpp \ 2d/CCScene.cpp \ 2d/CCSprite.cpp \ diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index 3b5645ec2a..40f4cb6a31 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -25,7 +25,6 @@ UILoadingBar.cpp \ UISlider.cpp \ UITextField.cpp \ UIRichText.cpp \ -CCProtectedNode.cpp \ UIHBox.cpp \ UIVBox.cpp \ UIRelativeBox.cpp \ diff --git a/cocos/ui/CMakeLists.txt b/cocos/ui/CMakeLists.txt index 4c7db6c1fd..02829ab86a 100644 --- a/cocos/ui/CMakeLists.txt +++ b/cocos/ui/CMakeLists.txt @@ -1,5 +1,4 @@ set(COCOS_UI_SRC - ui/CCProtectedNode.cpp ui/CocosGUI.cpp ui/UIButton.cpp ui/UICheckBox.cpp diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index a06aaad5b8..f22b9718c1 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __UIWIDGET_H__ #define __UIWIDGET_H__ -#include "ui/CCProtectedNode.h" +#include "2d/CCProtectedNode.h" #include "ui/UILayoutParameter.h" #include "ui/GUIDefine.h" #include "ui/GUIExport.h" diff --git a/cocos/ui/proj.win32/libui.vcxproj b/cocos/ui/proj.win32/libui.vcxproj index 3ac7d64b8a..ed67cf90df 100644 --- a/cocos/ui/proj.win32/libui.vcxproj +++ b/cocos/ui/proj.win32/libui.vcxproj @@ -11,7 +11,6 @@ - @@ -39,7 +38,6 @@ - diff --git a/cocos/ui/proj.win32/libui.vcxproj.filters b/cocos/ui/proj.win32/libui.vcxproj.filters index 16d4aa4cbc..c51a43c85d 100644 --- a/cocos/ui/proj.win32/libui.vcxproj.filters +++ b/cocos/ui/proj.win32/libui.vcxproj.filters @@ -72,9 +72,6 @@ UIWidgets - - BaseClasses - Layouts @@ -152,9 +149,6 @@ UIWidgets - - BaseClasses - Layouts diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 5a81a03b9a..a243114786 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -22,7 +22,7 @@ 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/audio/include/SimpleAudioEngine.h %(cocosdir)s/cocos/ui/CCProtectedNode.h %(cocosdir)s/cocos/3d/CCAnimation3D.h %(cocosdir)s/cocos/3d/CCAnimate3D.h +headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %(cocosdir)s/cocos/3d/CCAnimation3D.h %(cocosdir)s/cocos/3d/CCAnimate3D.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*$". From d224c77bd418bd8d80d2e4af712043df71671931 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Thu, 31 Jul 2014 17:51:06 +0800 Subject: [PATCH 57/57] Move the CCProtectedNode.cpp & .h from ui to cocos2d on wp8. --- cocos/2d/cocos2d_wp8.vcxproj | 2 ++ cocos/2d/cocos2d_wp8.vcxproj.filters | 9 ++++++--- cocos/ui/proj.wp8/libGUI.vcxproj | 2 -- cocos/ui/proj.wp8/libGUI.vcxproj.filters | 6 ------ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index f6416d1bca..de069cf89b 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -406,6 +406,7 @@ + @@ -622,6 +623,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index a00fbb84f3..30c158ceac 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -490,9 +490,6 @@ base - - base - base @@ -617,6 +614,9 @@ 2d + + 2d + @@ -1259,6 +1259,9 @@ 2d + + 2d + diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj b/cocos/ui/proj.wp8/libGUI.vcxproj index 69d0320b3a..5e2e4e6453 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj +++ b/cocos/ui/proj.wp8/libGUI.vcxproj @@ -165,7 +165,6 @@ - @@ -191,7 +190,6 @@ - diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj.filters b/cocos/ui/proj.wp8/libGUI.vcxproj.filters index 29bc02c4f4..7a7b4ae6b4 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj.filters +++ b/cocos/ui/proj.wp8/libGUI.vcxproj.filters @@ -69,9 +69,6 @@ BaseClasses - - BaseClasses - Layouts @@ -146,9 +143,6 @@ BaseClasses - - BaseClasses - Layouts