diff --git a/AUTHORS b/AUTHORS index ba8e4686d9..c81497d25f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -809,6 +809,7 @@ Developers: Added Device::setKeepScreenOn() Fixed Label performance problem Added Node::stopAllActionsByTag && ActionManager::removeAllActionsByTag + Added getAllTouches() in GLViewProtocol youknowone Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView @@ -896,6 +897,7 @@ Developers: kezhuw AutoReleasePool manager improvement + Fixed a bug that condition variable sleep on unrelated mutex in HttpClient zhouxiaoxiaoxujian Added TextField::getStringLength() diff --git a/CHANGELOG b/CHANGELOG index 58c9390ddf..128c864ddc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,12 @@ cocos2d-x-3.3?? ?? [NEW] ActionManager: added removeAllActionsByTag() + [NEW] GLViewProtocol: added getAllTouches() [NEW] Node: added stopAllActionsByTag() + [NEW] Renderer: added TriangleCommand [NEW] UI: added `WebView` on iOS and Android [FIX] EditBox: moved to ui:EditBox + [FIX] HttpClient: condition variable sleep on unrelated mutex [FIX] Node: create unneeded temple `Vec2` object in `setPosition(int, int)`, `setPositionX()` and `setPositionY()` [FIX] Node: skew effect is wrong [FIX] Node: setNormalizedPosition can not take effect if parent position is not changed diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index f23109c90c..45dcf34217 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 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}") = "lua-tests", "..\tests\lua-tests\project\proj.win32\lua-tests.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" @@ -13,40 +15,76 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\l EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj", "{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{92D54E36-7916-48EF-A951-224DD3B25442}" +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|ARM = Debug|ARM Debug|Win32 = Debug|Win32 + Release|ARM = Release|ARM Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|ARM.ActiveCfg = Debug|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|ARM.ActiveCfg = Release|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|ARM.ActiveCfg = Debug|Win32 {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32 {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|ARM.ActiveCfg = Release|Win32 {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32 {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|ARM.ActiveCfg = Debug|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|ARM.ActiveCfg = Release|Win32 {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32 {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.Build.0 = Release|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|ARM.ActiveCfg = Debug|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.ActiveCfg = Debug|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|ARM.ActiveCfg = Release|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.Build.0 = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|ARM.ActiveCfg = Debug|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|ARM.ActiveCfg = Release|Win32 {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 + {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|ARM.ActiveCfg = Debug|Win32 {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|Win32.ActiveCfg = Debug|Win32 {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|Win32.Build.0 = Debug|Win32 + {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|ARM.ActiveCfg = Release|Win32 {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.ActiveCfg = Release|Win32 {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.Build.0 = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|ARM.ActiveCfg = Debug|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|ARM.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|ARM.ActiveCfg = Debug|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|ARM.ActiveCfg = Release|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 EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {929480E7-23C0-4DF6-8456-096D71547116} = {92D54E36-7916-48EF-A951-224DD3B25442} + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {92D54E36-7916-48EF-A951-224DD3B25442} + EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} EndGlobalSection diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index dcf250b68c..6f0291e781 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1827,6 +1827,10 @@ B21770471977ED34009EE11B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B21770461977ED34009EE11B /* QuartzCore.framework */; }; B21770491977ED4C009EE11B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B21770481977ED4C009EE11B /* libz.dylib */; }; B217704E1977ED9F009EE11B /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B217704C1977ED8B009EE11B /* libsqlite3.dylib */; }; + B230ED7119B417AE00364AA8 /* CCTrianglesCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B230ED6F19B417AE00364AA8 /* CCTrianglesCommand.cpp */; }; + B230ED7219B417AE00364AA8 /* CCTrianglesCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B230ED6F19B417AE00364AA8 /* CCTrianglesCommand.cpp */; }; + B230ED7319B417AE00364AA8 /* CCTrianglesCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B230ED7019B417AE00364AA8 /* CCTrianglesCommand.h */; }; + B230ED7419B417AE00364AA8 /* CCTrianglesCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B230ED7019B417AE00364AA8 /* CCTrianglesCommand.h */; }; B24AA985195A675C007B4522 /* CCFastTMXLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B24AA981195A675C007B4522 /* CCFastTMXLayer.cpp */; }; B24AA986195A675C007B4522 /* CCFastTMXLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B24AA981195A675C007B4522 /* CCFastTMXLayer.cpp */; }; B24AA987195A675C007B4522 /* CCFastTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = B24AA982195A675C007B4522 /* CCFastTMXLayer.h */; }; @@ -2865,6 +2869,8 @@ B21770481977ED4C009EE11B /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; B217704A1977ED55009EE11B /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; B217704C1977ED8B009EE11B /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + B230ED6F19B417AE00364AA8 /* CCTrianglesCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTrianglesCommand.cpp; sourceTree = ""; }; + B230ED7019B417AE00364AA8 /* CCTrianglesCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTrianglesCommand.h; sourceTree = ""; }; B24AA981195A675C007B4522 /* CCFastTMXLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFastTMXLayer.cpp; sourceTree = ""; }; B24AA982195A675C007B4522 /* CCFastTMXLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFastTMXLayer.h; sourceTree = ""; }; B24AA983195A675C007B4522 /* CCFastTMXTiledMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFastTMXTiledMap.cpp; sourceTree = ""; }; @@ -4613,6 +4619,8 @@ 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */, B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */, B29594B31926D5EC003EEF37 /* CCMeshCommand.h */, + B230ED6F19B417AE00364AA8 /* CCTrianglesCommand.cpp */, + B230ED7019B417AE00364AA8 /* CCTrianglesCommand.h */, 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */, 50ABBD751925AB4100A911A9 /* CCQuadCommand.h */, 50ABBD761925AB4100A911A9 /* CCRenderCommand.cpp */, @@ -5009,6 +5017,7 @@ 15AE1BE519AAE01E00C27E9E /* CCTableView.h in Headers */, 15AE1BD319AAE01E00C27E9E /* CCControlPotentiometer.h in Headers */, 15AE1B6E19AADA9900C27E9E /* UIHelper.h in Headers */, + B230ED7319B417AE00364AA8 /* CCTrianglesCommand.h in Headers */, 15AE187F19AAD33D00C27E9E /* CCBKeyframe.h in Headers */, 1A570073180BC5A10088DEC7 /* CCActionGrid.h in Headers */, 15AE1BCC19AAE01E00C27E9E /* CCControlButton.h in Headers */, @@ -5589,6 +5598,7 @@ 15AE181D19AAD2F700C27E9E /* CCBundle3D.h in Headers */, 15AE192519AAD35100C27E9E /* CocoLoader.h in Headers */, 15AE1BBB19AADFF000C27E9E /* HttpRequest.h in Headers */, + B230ED7419B417AE00364AA8 /* CCTrianglesCommand.h in Headers */, 15AE1A0019AAD3A700C27E9E /* AtlasAttachmentLoader.h in Headers */, 15AE1ACB19AAD40300C27E9E /* b2MouseJoint.h in Headers */, 50ABBD3F1925AB0000A911A9 /* CCGeometry.h in Headers */, @@ -6271,6 +6281,7 @@ 15AE1A7819AAD40300C27E9E /* b2PolygonAndCircleContact.cpp in Sources */, 15AE1A3419AAD3D500C27E9E /* b2EdgeShape.cpp in Sources */, 15AE1BA319AADFDF00C27E9E /* UILayoutManager.cpp in Sources */, + B230ED7119B417AE00364AA8 /* CCTrianglesCommand.cpp in Sources */, 1A5702F2180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */, 15AE1A5B19AAD40300C27E9E /* b2Timer.cpp in Sources */, 15AE1B1219AAD43700C27E9E /* cpGearJoint.c in Sources */, @@ -6466,6 +6477,7 @@ 1A01C6A518F58F7500EFE3A6 /* CCNotificationCenter.cpp in Sources */, 292DB14E19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */, 15AE1BFB19AAE01E00C27E9E /* CCControlUtils.cpp in Sources */, + B230ED7219B417AE00364AA8 /* CCTrianglesCommand.cpp in Sources */, 15AE1B9019AADA9A00C27E9E /* UIWidget.cpp in Sources */, ED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */, 1A01C68F18F57BE800EFE3A6 /* CCDictionary.cpp in Sources */, diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme new file mode 100644 index 0000000000..644f4fba3f --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme new file mode 100644 index 0000000000..3f87120c62 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 index 784723fab8..4242da5f8d 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme @@ -31,8 +31,8 @@ $(EngineRoot)cocos;$(EngineRoot)cocos\platform\win32;$(EngineRoot)cocos\platform\desktop;$(EngineRoot)external\glfw3\include\win32;$(EngineRoot)external\win32-specific\gles\include\OGLES _VARIADIC_MAX=10;%(PreprocessorDefinitions) + + false + diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index bd9eafacf0..58078bb03d 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -230,6 +230,7 @@ + @@ -367,6 +368,7 @@ + @@ -453,6 +455,7 @@ + @@ -596,6 +599,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index 154b65da34..0634b1b385 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -653,6 +653,12 @@ 3d + + renderer + + + 3d + @@ -1334,6 +1340,12 @@ 3d + + renderer + + + 3d + diff --git a/cocos/2d/cocos2dx.props b/cocos/2d/cocos2dx.props index 543f4ab5cc..a0a234ee9f 100644 --- a/cocos/2d/cocos2dx.props +++ b/cocos/2d/cocos2dx.props @@ -7,11 +7,14 @@ - opengl32.lib;glew32.lib;libzlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;libwebp.lib;libiconv.lib;glfw3.lib;freetype250.lib;winmm.lib;ws2_32.lib;libchipmunk.lib;libbox2d.lib;libspine.lib;%(AdditionalDependencies) + opengl32.lib;glew32.lib;libzlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;libwebp.lib;libiconv.lib;glfw3.lib;freetype250.lib;winmm.lib;ws2_32.lib;libchipmunk.lib;libbox2d.lib;libSpine.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) false + + false + \ No newline at end of file diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 7c61bf42bb..8c7eaf7504 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -24,7 +24,7 @@ v110 v110_xp v120 - v110_xp + v120_xp DynamicLibrary @@ -33,7 +33,7 @@ v110 v110_xp v120 - v110_xp + v120_xp @@ -77,7 +77,7 @@ Disabled - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\Box2d;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external;$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories) + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\box2d;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external;$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories) WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) false EnableFastChecks @@ -104,9 +104,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\zlib\prebuilt\*.*" "$(Ou 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)" -xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\debug-lib\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\box2d\prebuilt\debug-lib\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\debug-lib\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\debug-lib\*.*" "$(OutDir)" $(OutDir)$(ProjectName).dll @@ -158,8 +156,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\zlib\prebuilt\*.*" "$(Ou 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\win32-specific\chipmunk\prebuilt\release-lib\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\box2d\prebuilt\release-lib\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-lib\*.*" "$(OutDir)" + sqlite3.lib;libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) @@ -401,6 +398,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l + @@ -775,6 +773,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l + @@ -885,6 +884,14 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l + + + {929480e7-23c0-4df6-8456-096d71547116} + + + {b7c2a162-dec9-4418-972e-240ab3cbfcae} + + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index d918da6cc1..71ff22990a 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -589,6 +589,9 @@ renderer + + renderer + renderer @@ -1585,6 +1588,9 @@ renderer + + renderer + renderer diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index 0c524e4af2..f683caf684 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -144,10 +144,7 @@ Mesh* Mesh::create(const std::vector& vertices, int perVertexSizeInFloat, meshdata.subMeshIndices.push_back(indices); meshdata.subMeshIds.push_back(""); auto meshvertexdata = MeshVertexData::create(meshdata); - auto indexbuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_SHORT_16, (int)indices.size()); - - AABB aabb = MeshVertexData::calculateAABB(meshdata.vertex, meshdata.getPerVertexSize(), indices); - auto indexData = MeshIndexData::create("", meshvertexdata, indexbuffer, aabb); + auto indexData = meshvertexdata->getMeshIndexDataByIndex(0); return create("", indexData); } diff --git a/cocos/Android.mk b/cocos/Android.mk index 94c14a9824..87573c5ce1 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -159,6 +159,7 @@ renderer/CCVertexIndexBuffer.cpp \ renderer/CCVertexIndexData.cpp \ renderer/CCPrimitive.cpp \ renderer/CCPrimitiveCommand.cpp \ +renderer/CCTrianglesCommand.cpp \ deprecated/CCArray.cpp \ deprecated/CCSet.cpp \ deprecated/CCString.cpp \ diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 0bd428f97d..4f06a692d7 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -158,6 +158,7 @@ THE SOFTWARE. #include "renderer/CCVertexIndexData.h" #include "renderer/CCPrimitive.h" #include "renderer/CCPrimitiveCommand.h" +#include "renderer/CCTrianglesCommand.h" // physics #include "physics/CCPhysicsBody.h" diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index d1dfa4f438..aa30b2b2fe 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -313,18 +313,14 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root) } void ActionNode::initActionNodeFromRoot(Ref* root) -{ - Node* rootNode = dynamic_cast(root); - if (rootNode != nullptr) +{ + Widget* rootWidget = dynamic_cast(root); + if (rootWidget != nullptr) { - Widget* rootWidget = dynamic_cast(root); - if (rootWidget != nullptr) + Widget* widget = Helper::seekActionWidgetByActionTag(rootWidget, getActionTag()); + if (widget != nullptr) { - Widget* widget = Helper::seekActionWidgetByActionTag(rootWidget, getActionTag()); - if (widget != nullptr) - { - setObject(widget); - } + setObject(widget); } } } @@ -367,14 +363,6 @@ Node* ActionNode::getActionNode() { return cNode; } - else - { - Widget* rootWidget = dynamic_cast(_object); - if (rootWidget != nullptr) - { - return rootWidget; - } - } return nullptr; } diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj new file mode 100644 index 0000000000..2f033657b8 --- /dev/null +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj @@ -0,0 +1,152 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} + libSpine + + + + 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);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(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 + + + 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 + + + true + true + true + + + + + + \ No newline at end of file diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj.filters b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj.filters new file mode 100644 index 0000000000..a6f105d4bc --- /dev/null +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj.filters @@ -0,0 +1,170 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index c2a0440b99..4640258c2a 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -47,16 +47,13 @@ namespace network { static std::mutex s_requestQueueMutex; static std::mutex s_responseQueueMutex; -static std::mutex s_SleepMutex; -static std::condition_variable s_SleepCondition; +static std::condition_variable_any s_SleepCondition; #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) typedef int int32_t; #endif -static bool s_need_quit = false; - static Vector* s_requestQueue = nullptr; static Vector* s_responseQueue = nullptr; @@ -102,43 +99,31 @@ static int processDeleteTask(HttpRequest *request, write_callback callback, void // int processDownloadTask(HttpRequest *task, write_callback callback, void *stream, int32_t *errorCode); static void processResponse(HttpResponse* response, char* errorBuffer); +static HttpRequest *s_requestSentinel = new HttpRequest; + // Worker thread void HttpClient::networkThread() { - HttpRequest *request = nullptr; - auto scheduler = Director::getInstance()->getScheduler(); while (true) { - if (s_need_quit) - { - break; - } - + HttpRequest *request; + // step 1: send http request if the requestQueue isn't empty - request = nullptr; - - s_requestQueueMutex.lock(); - - //Get request task from queue - - if (!s_requestQueue->empty()) { + std::lock_guard lock(s_requestQueueMutex); + while (s_requestQueue->empty()) { + s_SleepCondition.wait(s_requestQueueMutex); + } request = s_requestQueue->at(0); s_requestQueue->erase(0); } - - s_requestQueueMutex.unlock(); - - if (nullptr == request) - { - // Wait for http request tasks from main thread - std::unique_lock lk(s_SleepMutex); - s_SleepCondition.wait(lk); - continue; + + if (request == s_requestSentinel) { + break; } - + // step 2: libcurl sync access // Create a HttpResponse object, the default setting is http access failed @@ -462,12 +447,14 @@ HttpClient::HttpClient() HttpClient::~HttpClient() { - s_need_quit = true; - if (s_requestQueue != nullptr) { + { + std::lock_guard lock(s_requestQueueMutex); + s_requestQueue->pushBack(s_requestSentinel); + } s_SleepCondition.notify_one(); } - + s_pHttpClient = nullptr; } @@ -480,9 +467,7 @@ bool HttpClient::lazyInitThreadSemphore() s_requestQueue = new (std::nothrow) Vector(); s_responseQueue = new (std::nothrow) Vector(); - - s_need_quit = false; - + auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this)); t.detach(); } diff --git a/cocos/platform/CCGLView.cpp b/cocos/platform/CCGLView.cpp index e2d5ebb0f7..83709f06b8 100644 --- a/cocos/platform/CCGLView.cpp +++ b/cocos/platform/CCGLView.cpp @@ -56,6 +56,21 @@ namespace { return -1; } + static std::vector getAllTouchesVector() + { + std::vector ret; + int i; + int temp = g_indexBitsUsed; + + for (i = 0; i < EventTouch::MAX_TOUCHES; i++) { + if ( temp & 0x00000001) { + ret.push_back(g_touches[i]); + } + temp >>= 1; + } + return ret; + } + static void removeUsedIndexBit(int index) { if (index < 0 || index >= EventTouch::MAX_TOUCHES) @@ -423,6 +438,11 @@ const Rect& GLView::getViewPortRect() const return _viewPortRect; } +std::vector GLView::getAllTouches() const +{ + return getAllTouchesVector(); +} + float GLView::getScaleX() const { return _scaleX; diff --git a/cocos/platform/CCGLView.h b/cocos/platform/CCGLView.h index f8243770ed..030def1ee8 100644 --- a/cocos/platform/CCGLView.h +++ b/cocos/platform/CCGLView.h @@ -220,6 +220,11 @@ public: * Get the opengl view port rectangle. */ const Rect& getViewPortRect() const; + + /** + * Get list of all active touches + */ + std::vector getAllTouches() const; /** * Get scale factor of the horizontal direction. diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index ea102e7f73..ebbc5bdc75 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -91,7 +91,6 @@ public class Cocos2dxHelper { Cocos2dxHelper.nativeSetContext((Context)activity, Cocos2dxHelper.sAssetManager); Cocos2dxBitmap.setContext(activity); - Cocos2dxETCLoader.setContext(activity); sActivity = activity; sInited = true; diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp index a5b0e7214c..736a597504 100644 --- a/cocos/platform/winrt/CCFileUtilsWinRT.cpp +++ b/cocos/platform/winrt/CCFileUtilsWinRT.cpp @@ -53,7 +53,7 @@ static void _checkPath() if (s_pszResourcePath.empty()) { // TODO: needs to be tested - s_pszResourcePath = convertPathFormatToUnixStyle(CCFileUtilsWinRT::getAppPath() + '\\' + "Assets\\res" + '\\'); + s_pszResourcePath = convertPathFormatToUnixStyle(CCFileUtilsWinRT::getAppPath() + '\\' + "Assets\\Resources" + '\\'); } } diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index ac52bb0f1a..5b910e7e89 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -28,16 +28,12 @@ #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "xxhash.h" +#include "renderer/CCRenderer.h" NS_CC_BEGIN - QuadCommand::QuadCommand() -:_materialID(0) -,_textureID(0) -,_glProgramState(nullptr) -,_blendType(BlendFunc::DISABLE) -,_quads(nullptr) +:_quads(nullptr) ,_quadsCount(0) { _type = RenderCommand::Type::QUAD_COMMAND; @@ -52,6 +48,29 @@ void QuadCommand::init(float globalOrder, GLuint textureID, GLProgramState* glPr _quadsCount = quadCount; _quads = quad; + + //generate triangles + { + static std::vector QUADINDICESMAX; + if(QUADINDICESMAX.size() == 0) + { + QUADINDICESMAX.resize(Renderer::INDEX_VBO_SIZE); + for(ssize_t i = 0; i < Renderer::INDEX_VBO_SIZE / 6; ++i) + { + QUADINDICESMAX[ 6 * i + 0] = 4 * i + 0; + QUADINDICESMAX[ 6 * i + 1] = 4 * i + 1; + QUADINDICESMAX[ 6 * i + 2] = 4 * i + 2; + QUADINDICESMAX[ 6 * i + 3] = 4 * i + 3; + QUADINDICESMAX[ 6 * i + 4] = 4 * i + 2; + QUADINDICESMAX[ 6 * i + 5] = 4 * i + 1; + } + } + + _triangles.vertCount = quadCount * 4; + _triangles.indexCount = quadCount * 6; + _triangles.indices = &QUADINDICESMAX[0]; + _triangles.verts = &quad->tl; + } _mv = mv; @@ -69,31 +88,4 @@ QuadCommand::~QuadCommand() { } -void QuadCommand::generateMaterialID() -{ - - if(_glProgramState->getUniformCount() > 0) - { - _materialID = QuadCommand::MATERIAL_ID_DO_NOT_BATCH; - } - else - { - int glProgram = (int)_glProgramState->getGLProgram()->getProgram(); - int intArray[4] = { glProgram, (int)_textureID, (int)_blendType.src, (int)_blendType.dst}; - - _materialID = XXH32((const void*)intArray, sizeof(intArray), 0); - } -} - -void QuadCommand::useMaterial() const -{ - //Set texture - GL::bindTexture2D(_textureID); - - //set blend mode - GL::blendFunc(_blendType.src, _blendType.dst); - - _glProgramState->apply(_mv); -} - NS_CC_END diff --git a/cocos/renderer/CCQuadCommand.h b/cocos/renderer/CCQuadCommand.h index 25e003b4a5..bacd8528b3 100644 --- a/cocos/renderer/CCQuadCommand.h +++ b/cocos/renderer/CCQuadCommand.h @@ -27,14 +27,14 @@ #include "renderer/CCRenderCommand.h" #include "renderer/CCGLProgramState.h" +#include "renderer/CCTrianglesCommand.h" NS_CC_BEGIN /** Command used to render one or more Quads */ -class CC_DLL QuadCommand : public RenderCommand +class CC_DLL QuadCommand : public TrianglesCommand { public: - static const int MATERIAL_ID_DO_NOT_BATCH = 0; QuadCommand(); ~QuadCommand(); @@ -44,26 +44,12 @@ public: void init(float globalOrder, GLuint texutreID, GLProgramState* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quads, ssize_t quadCount, const Mat4& mv); - void useMaterial() const; - - inline uint32_t getMaterialID() const { return _materialID; } - inline GLuint getTextureID() const { return _textureID; } - inline V3F_C4B_T2F_Quad* getQuads() const { return _quads; } + inline const V3F_C4B_T2F_Quad* getQuads() const { return _quads; } inline ssize_t getQuadCount() const { return _quadsCount; } - inline GLProgramState* getGLProgramState() const { return _glProgramState; } - inline BlendFunc getBlendType() const { return _blendType; } - inline const Mat4& getModelView() const { return _mv; } protected: - void generateMaterialID(); - - uint32_t _materialID; - GLuint _textureID; - GLProgramState* _glProgramState; - BlendFunc _blendType; V3F_C4B_T2F_Quad* _quads; ssize_t _quadsCount; - Mat4 _mv; }; NS_CC_END diff --git a/cocos/renderer/CCRenderCommand.h b/cocos/renderer/CCRenderCommand.h index 77332e01b0..882cc3518e 100644 --- a/cocos/renderer/CCRenderCommand.h +++ b/cocos/renderer/CCRenderCommand.h @@ -50,6 +50,7 @@ public: GROUP_COMMAND, MESH_COMMAND, PRIMITIVE_COMMAND, + TRIANGLES_COMMAND }; /** Get Render Command Id */ diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index a34cb4c736..59f39482b6 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -26,6 +26,7 @@ #include +#include "renderer/CCTrianglesCommand.h" #include "renderer/CCQuadCommand.h" #include "renderer/CCBatchCommand.h" #include "renderer/CCCustomCommand.h" @@ -112,7 +113,8 @@ static const int DEFAULT_RENDER_QUEUE = 0; Renderer::Renderer() :_lastMaterialID(0) ,_lastBatchedMeshCommand(nullptr) -,_numQuads(0) +,_filledVertex(0) +,_filledIndex(0) ,_glViewAssigned(false) ,_isRendering(false) #if CC_ENABLE_CACHE_TEXTURE_DATA @@ -125,7 +127,7 @@ Renderer::Renderer() RenderQueue defaultRenderQueue; _renderGroups.push_back(defaultRenderQueue); - _batchedQuadCommands.reserve(BATCH_QUADCOMMAND_RESEVER_SIZE); + _batchedCommands.reserve(BATCH_QUADCOMMAND_RESEVER_SIZE); } Renderer::~Renderer() @@ -155,27 +157,12 @@ void Renderer::initGLView() Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_cacheTextureListener, -1); #endif - - setupIndices(); setupBuffer(); _glViewAssigned = true; } -void Renderer::setupIndices() -{ - for( int i=0; i < VBO_SIZE; i++) - { - _indices[i*6+0] = (GLushort) (i*4+0); - _indices[i*6+1] = (GLushort) (i*4+1); - _indices[i*6+2] = (GLushort) (i*4+2); - _indices[i*6+3] = (GLushort) (i*4+3); - _indices[i*6+4] = (GLushort) (i*4+2); - _indices[i*6+5] = (GLushort) (i*4+1); - } -} - void Renderer::setupBuffer() { if(Configuration::getInstance()->supportsShareableVAO()) @@ -196,7 +183,7 @@ void Renderer::setupVBOAndVAO() glGenBuffers(2, &_buffersVBO[0]); glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * VBO_SIZE, _quads, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * VBO_SIZE, _verts, GL_DYNAMIC_DRAW); // vertices glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); @@ -211,7 +198,7 @@ void Renderer::setupVBOAndVAO() glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * VBO_SIZE * 6, _indices, GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * INDEX_VBO_SIZE, _indices, GL_STATIC_DRAW); // Must unbind the VAO before changing the element buffer. GL::bindVAO(0); @@ -234,11 +221,11 @@ void Renderer::mapBuffers() GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * VBO_SIZE, _quads, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * VBO_SIZE, _verts, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * VBO_SIZE * 6, _indices, GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * INDEX_VBO_SIZE, _indices, GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); CHECK_GL_ERROR_DEBUG(); @@ -285,25 +272,22 @@ void Renderer::visitRenderQueue(const RenderQueue& queue) { auto command = queue[index]; auto commandType = command->getType(); - if(RenderCommand::Type::QUAD_COMMAND == commandType) + if(RenderCommand::Type::QUAD_COMMAND == commandType || RenderCommand::Type::TRIANGLES_COMMAND == commandType) { flush3D(); - auto cmd = static_cast(command); + auto cmd = static_cast(command); //Batch quads - if(_numQuads + cmd->getQuadCount() > VBO_SIZE) + if( _filledVertex + cmd->getVertexCount() > VBO_SIZE || _filledIndex + cmd->getIndexCount() > INDEX_VBO_SIZE) { - CCASSERT(cmd->getQuadCount()>= 0 && cmd->getQuadCount() < VBO_SIZE, "VBO is not big enough for quad data, please break the quad data down or use customized render command"); - + CCASSERT(cmd->getVertexCount()>= 0 && cmd->getVertexCount() < VBO_SIZE, "VBO for vertex is not big enough, please break the data down or use customized render command"); + CCASSERT(cmd->getIndexCount()>= 0 && cmd->getIndexCount() < INDEX_VBO_SIZE, "VBO for index is not big enough, please break the data down or use customized render command"); //Draw batched quads if VBO is full drawBatchedQuads(); } - _batchedQuadCommands.push_back(cmd); + _batchedCommands.push_back(cmd); - memcpy(_quads + _numQuads, cmd->getQuads(), sizeof(V3F_C4B_T2F_Quad) * cmd->getQuadCount()); - convertToWorldCoordinates(_quads + _numQuads, cmd->getQuadCount(), cmd->getModelView()); - - _numQuads += cmd->getQuadCount(); + fillVerticesAndIndices(cmd); } else if(RenderCommand::Type::GROUP_COMMAND == commandType) @@ -393,50 +377,53 @@ void Renderer::clean() } // Clear batch quad commands - _batchedQuadCommands.clear(); - _numQuads = 0; - + _batchedCommands.clear(); + _filledVertex = 0; + _filledIndex = 0; _lastMaterialID = 0; _lastBatchedMeshCommand = nullptr; } -void Renderer::convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const Mat4& modelView) +void Renderer::fillVerticesAndIndices(const TrianglesCommand* cmd) { -// kmMat4 matrixP, mvp; -// kmGLGetMatrix(KM_GL_PROJECTION, &matrixP); -// kmMat4Multiply(&mvp, &matrixP, &modelView); - for(ssize_t i=0; igetVertices(), sizeof(V3F_C4B_T2F) * cmd->getVertexCount()); + const Mat4& modelView = cmd->getModelView(); + + for(ssize_t i=0; i< cmd->getVertexCount(); ++i) { - V3F_C4B_T2F_Quad *q = &quads[i]; - Vec3 *vec1 = (Vec3*)&q->bl.vertices; + V3F_C4B_T2F *q = &_verts[i + _filledVertex]; + Vec3 *vec1 = (Vec3*)&q->vertices; modelView.transformPoint(vec1); - - Vec3 *vec2 = (Vec3*)&q->br.vertices; - modelView.transformPoint(vec2); - - Vec3 *vec3 = (Vec3*)&q->tr.vertices; - modelView.transformPoint(vec3); - - Vec3 *vec4 = (Vec3*)&q->tl.vertices; - modelView.transformPoint(vec4); } + + const unsigned short* indices = cmd->getIndices(); + //fill index + for(ssize_t i=0; i< cmd->getIndexCount(); ++i) + { + _indices[_filledIndex + i] = _filledVertex + indices[i]; + } + + _filledVertex += cmd->getVertexCount(); + _filledIndex += cmd->getIndexCount(); } void Renderer::drawBatchedQuads() { //TODO: we can improve the draw performance by insert material switching command before hand. - int quadsToDraw = 0; - int startQuad = 0; + int indexToDraw = 0; + int startIndex = 0; //Upload buffer to VBO - if(_numQuads <= 0 || _batchedQuadCommands.empty()) + if(_filledVertex <= 0 || _filledIndex <= 0 || _batchedCommands.empty()) { return; } if (Configuration::getInstance()->supportsShareableVAO()) { + //Bind VAO + GL::bindVAO(_quadVAO); //Set VBO data glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); @@ -447,22 +434,22 @@ void Renderer::drawBatchedQuads() // glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW); // option 3: orphaning + glMapBuffer - glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (_numQuads), nullptr, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * _filledVertex, nullptr, GL_DYNAMIC_DRAW); void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); - memcpy(buf, _quads, sizeof(_quads[0])* (_numQuads)); + memcpy(buf, _verts, sizeof(_verts[0])* _filledVertex); glUnmapBuffer(GL_ARRAY_BUFFER); glBindBuffer(GL_ARRAY_BUFFER, 0); - - //Bind VAO - GL::bindVAO(_quadVAO); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _filledIndex, _indices, GL_STATIC_DRAW); } else { -#define kQuadSize sizeof(_quads[0].bl) +#define kQuadSize sizeof(_verts[0]) glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _numQuads , _quads, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * _filledVertex , _verts, GL_DYNAMIC_DRAW); GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); @@ -476,23 +463,24 @@ void Renderer::drawBatchedQuads() glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, texCoords)); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _filledIndex, _indices, GL_STATIC_DRAW); } //Start drawing verties in batch - for(const auto& cmd : _batchedQuadCommands) + for(const auto& cmd : _batchedCommands) { auto newMaterialID = cmd->getMaterialID(); - if(_lastMaterialID != newMaterialID || newMaterialID == QuadCommand::MATERIAL_ID_DO_NOT_BATCH) + if(_lastMaterialID != newMaterialID || newMaterialID == TrianglesCommand::MATERIAL_ID_DO_NOT_BATCH) { //Draw quads - if(quadsToDraw > 0) + if(indexToDraw > 0) { - glDrawElements(GL_TRIANGLES, (GLsizei) quadsToDraw*6, GL_UNSIGNED_SHORT, (GLvoid*) (startQuad*6*sizeof(_indices[0])) ); + glDrawElements(GL_TRIANGLES, (GLsizei) indexToDraw, GL_UNSIGNED_SHORT, (GLvoid*) (startIndex*sizeof(_indices[0])) ); _drawnBatches++; - _drawnVertices += quadsToDraw*6; + _drawnVertices += indexToDraw; - startQuad += quadsToDraw; - quadsToDraw = 0; + startIndex += indexToDraw; + indexToDraw = 0; } //Use new material @@ -500,15 +488,15 @@ void Renderer::drawBatchedQuads() _lastMaterialID = newMaterialID; } - quadsToDraw += cmd->getQuadCount(); + indexToDraw += cmd->getIndexCount(); } //Draw any remaining quad - if(quadsToDraw > 0) + if(indexToDraw > 0) { - glDrawElements(GL_TRIANGLES, (GLsizei) quadsToDraw*6, GL_UNSIGNED_SHORT, (GLvoid*) (startQuad*6*sizeof(_indices[0])) ); + glDrawElements(GL_TRIANGLES, (GLsizei) indexToDraw, GL_UNSIGNED_SHORT, (GLvoid*) (startIndex*sizeof(_indices[0])) ); _drawnBatches++; - _drawnVertices += quadsToDraw*6; + _drawnVertices += indexToDraw; } if (Configuration::getInstance()->supportsShareableVAO()) @@ -522,8 +510,9 @@ void Renderer::drawBatchedQuads() glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } - _batchedQuadCommands.clear(); - _numQuads = 0; + _batchedCommands.clear(); + _filledVertex = 0; + _filledIndex = 0; } void Renderer::flush() diff --git a/cocos/renderer/CCRenderer.h b/cocos/renderer/CCRenderer.h index 44a9755a5e..35da31e076 100644 --- a/cocos/renderer/CCRenderer.h +++ b/cocos/renderer/CCRenderer.h @@ -38,6 +38,7 @@ NS_CC_BEGIN class EventListenerCustom; class QuadCommand; +class TrianglesCommand; class MeshCommand; /** Class that knows how to sort `RenderCommand` objects. @@ -75,7 +76,9 @@ Whenever possible prefer to use `QuadCommand` objects since the renderer will au class CC_DLL Renderer { public: - static const int VBO_SIZE = 65536 / 6; + static const int VBO_SIZE = 65536; + static const int INDEX_VBO_SIZE = VBO_SIZE * 6 / 4; + static const int BATCH_QUADCOMMAND_RESEVER_SIZE = 64; Renderer(); @@ -121,7 +124,6 @@ public: protected: - void setupIndices(); //Setup VBO or VAO based on OpenGL extensions void setupBuffer(); void setupVBOAndVAO(); @@ -139,7 +141,7 @@ protected: void visitRenderQueue(const RenderQueue& queue); - void convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const Mat4& modelView); + void fillVerticesAndIndices(const TrianglesCommand* cmd); std::stack _commandGroupStack; @@ -148,14 +150,15 @@ protected: uint32_t _lastMaterialID; MeshCommand* _lastBatchedMeshCommand; - std::vector _batchedQuadCommands; + std::vector _batchedCommands; - V3F_C4B_T2F_Quad _quads[VBO_SIZE]; - GLushort _indices[6 * VBO_SIZE]; + V3F_C4B_T2F _verts[VBO_SIZE]; + GLushort _indices[INDEX_VBO_SIZE]; GLuint _quadVAO; GLuint _buffersVBO[2]; //0: vertex 1: indices - int _numQuads; + int _filledVertex; + int _filledIndex; bool _glViewAssigned; diff --git a/cocos/renderer/CCTrianglesCommand.cpp b/cocos/renderer/CCTrianglesCommand.cpp new file mode 100644 index 0000000000..8f46ef9c6a --- /dev/null +++ b/cocos/renderer/CCTrianglesCommand.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** + 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 "renderer/CCTrianglesCommand.h" +#include "renderer/ccGLStateCache.h" +#include "renderer/CCGLProgram.h" +#include "renderer/CCGLProgramState.h" +#include "xxhash.h" +#include "renderer/CCRenderer.h" + +NS_CC_BEGIN + +TrianglesCommand::TrianglesCommand() +:_materialID(0) +,_textureID(0) +,_glProgramState(nullptr) +,_blendType(BlendFunc::DISABLE) +{ + _type = RenderCommand::Type::TRIANGLES_COMMAND; +} + +void TrianglesCommand::init(float globalOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, const Triangles& triangles,const Mat4& mv) +{ + CCASSERT(glProgramState, "Invalid GLProgramState"); + CCASSERT(glProgramState->getVertexAttribsFlags() == 0, "No custom attributes are supported in QuadCommand"); + + _globalOrder = globalOrder; + + _triangles = triangles; + if(_triangles.indexCount % 3 != 0) + { + ssize_t count = _triangles.indexCount; + _triangles.indexCount = count / 3 * 3; + CCLOGERROR("Resize indexCount from %zd to %zd, size must be multiple times of 3", count, _triangles.indexCount); + } + _mv = mv; + + if( _textureID != textureID || _blendType.src != blendType.src || _blendType.dst != blendType.dst || _glProgramState != glProgramState) { + + _textureID = textureID; + _blendType = blendType; + _glProgramState = glProgramState; + + generateMaterialID(); + } +} + +TrianglesCommand::~TrianglesCommand() +{ +} + +void TrianglesCommand::generateMaterialID() +{ + + if(_glProgramState->getUniformCount() > 0) + { + _materialID = TrianglesCommand::MATERIAL_ID_DO_NOT_BATCH; + } + else + { + int glProgram = (int)_glProgramState->getGLProgram()->getProgram(); + int intArray[4] = { glProgram, (int)_textureID, (int)_blendType.src, (int)_blendType.dst}; + + _materialID = XXH32((const void*)intArray, sizeof(intArray), 0); + } +} + +void TrianglesCommand::useMaterial() const +{ + //Set texture + GL::bindTexture2D(_textureID); + + //set blend mode + GL::blendFunc(_blendType.src, _blendType.dst); + + _glProgramState->apply(_mv); +} + +NS_CC_END diff --git a/cocos/renderer/CCTrianglesCommand.h b/cocos/renderer/CCTrianglesCommand.h new file mode 100644 index 0000000000..71cd1cca25 --- /dev/null +++ b/cocos/renderer/CCTrianglesCommand.h @@ -0,0 +1,79 @@ +/**************************************************************************** + 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 __CC_TRIANGLES_COMMAND__ +#define __CC_TRIANGLES_COMMAND__ + +#include "renderer/CCRenderCommand.h" +#include "renderer/CCGLProgramState.h" + +NS_CC_BEGIN +class CC_DLL TrianglesCommand : public RenderCommand +{ +public: + static const int MATERIAL_ID_DO_NOT_BATCH = 0; + +public: + struct Triangles + { + V3F_C4B_T2F* verts; + unsigned short* indices; + ssize_t vertCount; + ssize_t indexCount; + }; + + TrianglesCommand(); + ~TrianglesCommand(); + + /** Initializes the command with a globalZOrder, a texture ID, a `GLProgram`, a blending function, a pointer to triangles, + * quantity of quads, and the Model View transform to be used for the quads */ + void init(float globalOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, const Triangles& triangles,const Mat4& mv); + + void useMaterial() const; + + inline uint32_t getMaterialID() const { return _materialID; } + inline GLuint getTextureID() const { return _textureID; } + inline const Triangles& getTriangles() const { return _triangles; } + inline ssize_t getVertexCount() const { return _triangles.vertCount; } + inline ssize_t getIndexCount() const { return _triangles.indexCount; } + inline const V3F_C4B_T2F* getVertices() const { return _triangles.verts; } + inline const unsigned short* getIndices() const { return _triangles.indices; } + inline GLProgramState* getGLProgramState() const { return _glProgramState; } + inline BlendFunc getBlendType() const { return _blendType; } + inline const Mat4& getModelView() const { return _mv; } + +protected: + void generateMaterialID(); + + uint32_t _materialID; + GLuint _textureID; + GLProgramState* _glProgramState; + BlendFunc _blendType; + Triangles _triangles; + Mat4 _mv; +}; + +NS_CC_END + +#endif // defined(__CC_TRIANGLES_COMMAND__) diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp index b700761f7e..ba320b61eb 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp @@ -5163,7 +5163,7 @@ static int tolua_cocos2dx_EventListenerMouse_create(lua_State* tolua_S) argc = lua_gettop(tolua_S) - 1; - if (argc == 1) + if (argc == 0) { cocos2d::EventListenerMouse* tolua_ret = cocos2d::EventListenerMouse::create(); if(nullptr == tolua_ret) @@ -5176,7 +5176,7 @@ static int tolua_cocos2dx_EventListenerMouse_create(lua_State* tolua_S) return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n", "cc.EventListenerMouse:create",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n", "cc.EventListenerMouse:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 @@ -6505,6 +6505,80 @@ static void extendTextureCache(lua_State* tolua_S) lua_pop(tolua_S, 1); } +int lua_cocos2dx_GLView_getAllTouches(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_getAllTouches'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + + std::vector ret = cobj->getAllTouches(); + lua_newtable(tolua_S); + if (ret.empty()) + return 1; + + int index = 1; + for (const auto& obj : ret) + { + if (nullptr == obj) + continue; + + lua_pushnumber(tolua_S, (lua_Number)index); + int ID = (obj) ? (int)obj->_ID : -1; + int* luaID = (obj) ? &obj->_luaID : nullptr; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)obj, "cc.Touch"); + lua_rawset(tolua_S, -3); + ++index; + } + + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:getAllTouches",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_getAllTouches'.",&tolua_err); +#endif + + return 0; +} + +static void extendGLView(lua_State* tolua_S) +{ + lua_pushstring(tolua_S, "cc.GLView"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "getAllTouches", lua_cocos2dx_GLView_getAllTouches); + } + lua_pop(tolua_S, 1); +} + int register_all_cocos2dx_manual(lua_State* tolua_S) { if (NULL == tolua_S) @@ -6559,6 +6633,7 @@ int register_all_cocos2dx_manual(lua_State* tolua_S) extendEventListenerFocus(tolua_S); extendApplication(tolua_S); extendTextureCache(tolua_S); + extendGLView(tolua_S); return 0; } diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/libluacocos2d Mac.xcscheme b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/libluacocos2d Mac.xcscheme new file mode 100644 index 0000000000..3b46b52285 --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/libluacocos2d Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/libluacocos2d iOS.xcscheme b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/libluacocos2d iOS.xcscheme new file mode 100644 index 0000000000..92d78c231c --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/libluacocos2d iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj index 5dcc558ab4..774b9914ec 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -210,7 +210,7 @@ v110 v110_xp v120 - v110_xp + v120_xp StaticLibrary @@ -219,7 +219,7 @@ v110 v110_xp v120 - v110_xp + v120_xp diff --git a/extensions/proj.wp8/libExtensions.vcxproj b/extensions/proj.wp8/libExtensions.vcxproj index 451b0d11ef..72380f216e 100644 --- a/extensions/proj.wp8/libExtensions.vcxproj +++ b/extensions/proj.wp8/libExtensions.vcxproj @@ -176,9 +176,6 @@ - - - @@ -208,10 +205,6 @@ - - - - diff --git a/extensions/proj.wp8/libExtensions.vcxproj.filters b/extensions/proj.wp8/libExtensions.vcxproj.filters index 57969f624b..2a3c131354 100644 --- a/extensions/proj.wp8/libExtensions.vcxproj.filters +++ b/extensions/proj.wp8/libExtensions.vcxproj.filters @@ -13,9 +13,6 @@ {d5806151-7ae1-4fef-af5a-2fa1d1c7377b} - - {5d186e3d-0aaf-4904-a5d8-e5cb0f35f4cc} - {49487dbe-5758-436a-b014-8e2edc6b33ae} @@ -57,27 +54,18 @@ GUI\CCControlExtension - - GUI\CCControlExtension - GUI\CCControlExtension GUI\CCControlExtension - - GUI\CCEditBox - physics_nodes physics_nodes - - GUI\CCEditBox - @@ -125,27 +113,15 @@ GUI\CCControlExtension - - GUI\CCControlExtension - GUI\CCControlExtension - - GUI\CCEditBox - - - GUI\CCEditBox - physics_nodes physics_nodes - - GUI\CCEditBox - \ No newline at end of file diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index fce55eac65..8371a753c1 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -640,6 +640,8 @@ "cocos/editor-support/spine/SlotData.h", "cocos/editor-support/spine/extension.cpp", "cocos/editor-support/spine/extension.h", + "cocos/editor-support/spine/proj.win32/libSpine.vcxproj", + "cocos/editor-support/spine/proj.win32/libSpine.vcxproj.filters", "cocos/editor-support/spine/proj.wp8/libSpine.vcxproj", "cocos/editor-support/spine/proj.wp8/libSpine.vcxproj.filters", "cocos/editor-support/spine/proj.wp8/libSpine.vcxproj.user", @@ -946,6 +948,8 @@ "cocos/renderer/CCTextureAtlas.h", "cocos/renderer/CCTextureCache.cpp", "cocos/renderer/CCTextureCache.h", + "cocos/renderer/CCTrianglesCommand.cpp", + "cocos/renderer/CCTrianglesCommand.h", "cocos/renderer/CCVertexIndexBuffer.cpp", "cocos/renderer/CCVertexIndexBuffer.h", "cocos/renderer/CCVertexIndexData.cpp", diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj b/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj index 19d93505a5..2f4cec563c 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj +++ b/templates/cpp-template-default/proj.wp8-xaml/App/HelloCpp.csproj @@ -102,12 +102,24 @@ + + Assets\Resources\fonts\Marker Felt.ttf + Designer + + Assets\Resources\CloseNormal.png + + + Assets\Resources\CloseSelected.png + + + Assets\Resources\HelloWorld.png + PreserveNewest @@ -154,14 +166,7 @@ Designer - - - - Assets\res\%(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - + - - + \ No newline at end of file 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 4bc89fa9de..22c42ff781 100644 --- a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj +++ b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -24,7 +24,7 @@ v110 v110_xp v120 - v110_xp + v120_xp Application @@ -33,7 +33,7 @@ v110 v110_xp v120 - v110_xp + v120_xp diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 7f132bd32d..9d6c17fcfe 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -24,7 +24,7 @@ v110 v110_xp v120 - v110_xp + v120_xp Application @@ -33,7 +33,7 @@ v110 v110_xp v120 - v110_xp + v120_xp 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 60ea821193..b1c32cce74 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 @@ -207,11 +207,9 @@ - - @@ -411,11 +409,9 @@ - - 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 44d9ce5bea..3a2638f4ef 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 @@ -199,9 +199,6 @@ {a4c2111f-cf9f-492c-884d-3de24715adce} - - {18a69e7e-8ca7-475a-bfbb-7296baab16ce} - {0ef55f53-411a-4661-b5d5-13930da52e68} @@ -217,9 +214,6 @@ {81ec2355-7efd-49e0-b6cb-b1bba23fbbc8} - - {3d73aa04-d66e-43d3-921f-b867a753c113} - {a6e7d28e-46a3-46c4-9735-b39e96f776f0} @@ -582,9 +576,6 @@ Classes\FileUtilsTest - - Classes\ExtensionsTest\EditBoxTest - Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest @@ -600,9 +591,6 @@ Classes - - Classes\ExtensionsTest\Scale9SpriteTest - Classes\LabelTest @@ -867,6 +855,7 @@ Classes\Camera3DTest + @@ -1298,9 +1287,6 @@ Classes\FileUtilsTest - - Classes\ExtensionsTest\EditBoxTest - Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest @@ -1322,9 +1308,6 @@ Classes - - Classes\ExtensionsTest\Scale9SpriteTest - Classes\LabelTest @@ -1605,6 +1588,7 @@ Classes\Camera3DTest + 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 7d24ad16dc..a9dbfd77e9 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 @@ -1,5 +1,5 @@  - + Debug @@ -22,7 +22,7 @@ v110 v110_xp v120 - v110_xp + v120_xp Application @@ -31,7 +31,7 @@ v110 v110_xp v120 - v110_xp + v120_xp 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 f4592847dd..547770c554 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -23,7 +23,7 @@ v110 v110_xp v120 - v110_xp + v120_xp Application @@ -33,7 +33,7 @@ v110 v110_xp v120 - v110_xp + v120_xp diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 2d59d96980..d6894e123b 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -108,7 +108,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS ccFontDefinition::[*], Ref::[autorelease isEqual acceptVisitor update], UserDefault::[getInstance (s|g)etDataForKey], - GLView::[setTouchDelegate], + GLView::[setTouchDelegate getAllTouches], GLViewImpl::[end swapBuffers], NewTextureAtlas::[*], DisplayLinkDirector::[mainLoop setAnimationInterval startAnimation stopAnimation],