diff --git a/AUTHORS b/AUTHORS index 7036ad40b0..ddc9082dd2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Core Developers: Huabing Xu (dabingnn) Bo Yu (boyu0) Wenhai Lin(Dhilan007) + Guanghui Qu(andyque) Developers: @@ -843,6 +844,8 @@ Developers: zifter Fixed a bug that the effect of particle loaded from CocosBuilder is incorrectly Fix twice calling onExit + Fixed bug with cascade opacity and color for control button + Fix Progress Action. Not working with charging from 100 to 0. twhittock Fixed a bug that Application::run returns wrong value on Mac platform @@ -855,6 +858,9 @@ Developers: NatWeiss Fix compilation error using arch i386 + + favorcode + Correct some doxygen comment Retired Core Developers: WenSheng Yang diff --git a/CHANGELOG b/CHANGELOG index 5586115a68..31038df902 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,18 @@ -cocos2d-x-3.1-rc0 May.16 2014 +cocos2d-x-3.1 ??? + [FIX] Label: may crash when using outline effect + [FIX] Label: using outline and invoking 'Director::setContentScaleFactor' cause label show nothing + [FIX] ProgressTo: will start from 0 when it reaches 100 + [FIX] Physics integration: may crashes if remove bodies at physics contact callback + [FIX] WP8: orientation is not correct when it is set to portrait + [FIX] WP8: fix for precompiled shaders and precompiled headers + +cocos2d-x-3.1-rc0 May.18 2014 [NEW] Cocos2dxActivity: Adds a virtual method to load native libraries. + [NEW] Directory Structure: reorder some files within the cocos/ folder + [NEW] Sprite3D: a node that renders 3d models [NEW] EditBox: support secure input on Mac + [FIX] ControlButton: cascade opacity and color error [FIX] Director: twice calling of onExit [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 [FIX] GLProgram: uniform CC_Texture0 is pre-defined by cocos2d. MUST NOT be defined in shaders diff --git a/build/cocos2d-wp8.vc2012.sln b/build/cocos2d-wp8.vc2012.sln index 1f3e8ba26c..bd66958f7e 100644 --- a/build/cocos2d-wp8.vc2012.sln +++ b/build/cocos2d-wp8.vc2012.sln @@ -1,7 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30324.0 -MinimumVisualStudioVersion = 10.0.40219.1 +# Visual Studio 2012 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d_wp8.vcxproj", "{B5AF91B3-64EA-44E1-84B0-D759E93758FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.wp8\libSpine.vcxproj", "{7D4FC6EB-9497-4804-98F3-3EAEDC896154}" @@ -46,9 +44,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-tests", "..\tests\cpp-t EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-testsComponent", "..\tests\cpp-tests\proj.wp8-xaml\cpp-testsComponent\cpp-testsComponent.vcxproj", "{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}" - ProjectSection(ProjectDependencies) = postProject - {271FEE84-9198-4C26-8567-4247C563B0B1} = {271FEE84-9198-4C26-8567-4247C563B0B1} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\network\proj.wp8\libNetwork.vcxproj", "{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}" ProjectSection(ProjectDependencies) = postProject @@ -63,9 +58,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-empty-test", "..\tests\ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-testComponent", "..\tests\cpp-empty-test\proj-wp8-xaml\cpp-empty-testComponent\cpp-empty-testComponent.vcxproj", "{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}" - ProjectSection(ProjectDependencies) = postProject - {271FEE84-9198-4C26-8567-4247C563B0B1} = {271FEE84-9198-4C26-8567-4247C563B0B1} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos\ui\proj.wp8\libGUI.vcxproj", "{08FB23E4-1517-4EDC-B682-DA238CDAA83D}" ProjectSection(ProjectDependencies) = postProject @@ -73,6 +65,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos\ui\proj. EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CopyTemplateFiles", "..\cocos\platform\wp8-xaml\CopyTemplateFiles.vcxproj", "{271FEE84-9198-4C26-8567-4247C563B0B1}" + ProjectSection(ProjectDependencies) = postProject + {5921FE12-7EF3-4847-8453-42EF286DDBE7} = {5921FE12-7EF3-4847-8453-42EF286DDBE7} + {60D53713-1675-4466-81DC-D67A031C3D21} = {60D53713-1675-4466-81DC-D67A031C3D21} + {86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9} = {86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9} + {F5D665F8-AE19-4F3F-99A7-230A1E8305D2} = {F5D665F8-AE19-4F3F-99A7-230A1E8305D2} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index cb9b553f43..2da14e8baf 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1723,6 +1723,26 @@ 50FCEBCB18C72017004AD434 /* WidgetReaderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */; }; 50FCEBCC18C72017004AD434 /* WidgetReaderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */; }; A07A4CAF1783777C0073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; }; + B29594B41926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */; }; + B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */; }; + B29594B61926D5EC003EEF37 /* CCMeshCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594B31926D5EC003EEF37 /* CCMeshCommand.h */; }; + B29594B71926D5EC003EEF37 /* CCMeshCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594B31926D5EC003EEF37 /* CCMeshCommand.h */; }; + B29594C21926D61F003EEF37 /* CCMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B91926D61F003EEF37 /* CCMesh.cpp */; }; + B29594C31926D61F003EEF37 /* CCMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B91926D61F003EEF37 /* CCMesh.cpp */; }; + B29594C41926D61F003EEF37 /* CCMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BA1926D61F003EEF37 /* CCMesh.h */; }; + B29594C51926D61F003EEF37 /* CCMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BA1926D61F003EEF37 /* CCMesh.h */; }; + B29594C61926D61F003EEF37 /* CCObjLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */; }; + B29594C71926D61F003EEF37 /* CCObjLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */; }; + B29594C81926D61F003EEF37 /* CCObjLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BC1926D61F003EEF37 /* CCObjLoader.h */; }; + B29594C91926D61F003EEF37 /* CCObjLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BC1926D61F003EEF37 /* CCObjLoader.h */; }; + B29594CA1926D61F003EEF37 /* CCSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */; }; + B29594CB1926D61F003EEF37 /* CCSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */; }; + B29594CC1926D61F003EEF37 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; + B29594CD1926D61F003EEF37 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; + B29594CE1926D61F003EEF37 /* CCSprite3DDataCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BF1926D61F003EEF37 /* CCSprite3DDataCache.cpp */; }; + B29594CF1926D61F003EEF37 /* CCSprite3DDataCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594BF1926D61F003EEF37 /* CCSprite3DDataCache.cpp */; }; + B29594D01926D61F003EEF37 /* CCSprite3DDataCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DDataCache.h */; }; + B29594D11926D61F003EEF37 /* CCSprite3DDataCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DDataCache.h */; }; B37510711823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */; }; B37510721823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */; }; B37510731823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */; }; @@ -2473,20 +2493,6 @@ 46A169981807AFD6005B8026 /* cpSweep1D.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSweep1D.c; sourceTree = ""; }; 46A169991807AFD6005B8026 /* cpVect.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpVect.c; sourceTree = ""; }; 46A1699A1807AFD6005B8026 /* prime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = ""; }; - 46A16E1B1807C948005B8026 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../cocos/2d/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; - 46A16E1C1807C948005B8026 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../cocos/2d/platform/third_party/ios/libraries/libfreetype.a; sourceTree = ""; }; - 46A16E1D1807C948005B8026 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjpeg.a; path = ../cocos/2d/platform/third_party/ios/libraries/libjpeg.a; sourceTree = ""; }; - 46A16E1E1807C948005B8026 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = ../cocos/2d/platform/third_party/ios/libraries/libpng.a; sourceTree = ""; }; - 46A16E1F1807C948005B8026 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtiff.a; path = ../cocos/2d/platform/third_party/ios/libraries/libtiff.a; sourceTree = ""; }; - 46A16E201807C948005B8026 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebp.a; path = ../cocos/2d/platform/third_party/ios/libraries/libwebp.a; sourceTree = ""; }; - 46A16E211807C95C005B8026 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../cocos/2d/platform/third_party/mac/libraries/libfreetype.a; sourceTree = ""; }; - 46A16E221807C95C005B8026 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = ../cocos/2d/platform/third_party/mac/libraries/libglfw3.a; sourceTree = ""; }; - 46A16E231807C95C005B8026 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjpeg.a; path = ../cocos/2d/platform/third_party/mac/libraries/libjpeg.a; sourceTree = ""; }; - 46A16E241807C95C005B8026 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = ../cocos/2d/platform/third_party/mac/libraries/libpng.a; sourceTree = ""; }; - 46A16E251807C95C005B8026 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtiff.a; path = ../cocos/2d/platform/third_party/mac/libraries/libtiff.a; sourceTree = ""; }; - 46A16E261807C95C005B8026 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebp.a; path = ../cocos/2d/platform/third_party/mac/libraries/libwebp.a; sourceTree = ""; }; - 46A16E271807C992005B8026 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebsockets.a; path = ../external/libwebsockets/ios/lib/libwebsockets.a; sourceTree = ""; }; - 46A16E281807C99F005B8026 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebsockets.a; path = ../external/libwebsockets/mac/lib/libwebsockets.a; sourceTree = ""; }; 46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsBody.cpp; sourceTree = ""; }; 46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsBody.h; sourceTree = ""; }; 46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsContact.cpp; sourceTree = ""; }; @@ -2772,6 +2778,19 @@ A07A4F3B178387670073F6A7 /* libchipmunk iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libchipmunk iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A4F9E1783876B0073F6A7 /* libbox2d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbox2d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A4FB4178387730073F6A7 /* libCocosDenshion iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCocosDenshion iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + B29594AF1926D5D9003EEF37 /* ccShader_3D_Color.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Color.frag; sourceTree = ""; }; + B29594B01926D5D9003EEF37 /* ccShader_3D_ColorTex.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorTex.frag; sourceTree = ""; }; + B29594B11926D5D9003EEF37 /* ccShader_3D_PositionTex.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_PositionTex.vert; sourceTree = ""; }; + B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMeshCommand.cpp; sourceTree = ""; }; + B29594B31926D5EC003EEF37 /* CCMeshCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMeshCommand.h; sourceTree = ""; }; + B29594B91926D61F003EEF37 /* CCMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMesh.cpp; sourceTree = ""; }; + B29594BA1926D61F003EEF37 /* CCMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMesh.h; sourceTree = ""; }; + B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCObjLoader.cpp; sourceTree = ""; }; + B29594BC1926D61F003EEF37 /* CCObjLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCObjLoader.h; sourceTree = ""; }; + B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSprite3D.cpp; sourceTree = ""; }; + B29594BE1926D61F003EEF37 /* CCSprite3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite3D.h; sourceTree = ""; }; + B29594BF1926D61F003EEF37 /* CCSprite3DDataCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSprite3DDataCache.cpp; sourceTree = ""; }; + B29594C01926D61F003EEF37 /* CCSprite3DDataCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite3DDataCache.h; sourceTree = ""; }; B37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsBodyInfo_chipmunk.cpp; sourceTree = ""; }; B37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsBodyInfo_chipmunk.h; sourceTree = ""; }; B37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsContactInfo_chipmunk.cpp; sourceTree = ""; }; @@ -2886,10 +2905,12 @@ children = ( 46A15FCC1807A544005B8026 /* AUTHORS */, 1A57FFF7180BC5160088DEC7 /* CHANGELOG */, + 50272539190BF1B900AAF4ED /* cocos2d.cpp */, + 50272538190BF1B900AAF4ED /* cocos2d.h */, 46A15FCE1807A544005B8026 /* README.md */, 50DC5180187B817900A9C23F /* RELEASE_NOTES.md */, 46A169A11807B037005B8026 /* 2d */, - 50ABBEDB1926664700A911A9 /* platform */, + B29594B81926D61F003EEF37 /* 3d */, 46A15FD01807A56F005B8026 /* audio */, 1A5700A2180BC5E60088DEC7 /* base */, 1A01C67518F57BE800EFE3A6 /* deprecated */, @@ -2900,12 +2921,11 @@ 46A170851807CE87005B8026 /* math */, 1AAF5360180E3374000584C8 /* network */, 46A170611807CE7A005B8026 /* physics */, + 50ABBEDB1926664700A911A9 /* platform */, 1551A340158F2AB200E66CFE /* Products */, 500DC89819105D41007B91BF /* renderer */, 1AAF5849180E40B8000584C8 /* storage */, 2905F9E618CF08D000240AA3 /* ui */, - 50272538190BF1B900AAF4ED /* cocos2d.h */, - 50272539190BF1B900AAF4ED /* cocos2d.cpp */, ); sourceTree = ""; }; @@ -2929,8 +2949,6 @@ 1551A341158F2AB200E66CFE /* Frameworks */ = { isa = PBXGroup; children = ( - B3D8D44B179921D50039C204 /* ios */, - B3D8D4471799219B0039C204 /* mac */, 1551A342158F2AB200E66CFE /* Foundation.framework */, ); name = Frameworks; @@ -4464,7 +4482,6 @@ 500DC89819105D41007B91BF /* renderer */ = { isa = PBXGroup; children = ( - 5034CA5D191D591900CE6051 /* shaders */, 50ABBD641925AB4100A911A9 /* CCBatchCommand.cpp */, 50ABBD651925AB4100A911A9 /* CCBatchCommand.h */, 50ABBD661925AB4100A911A9 /* CCCustomCommand.cpp */, @@ -4481,6 +4498,8 @@ 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */, 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */, 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */, + B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */, + B29594B31926D5EC003EEF37 /* CCMeshCommand.h */, 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */, 50ABBD751925AB4100A911A9 /* CCQuadCommand.h */, 50ABBD761925AB4100A911A9 /* CCRenderCommand.cpp */, @@ -4496,6 +4515,7 @@ 50ABBD801925AB4100A911A9 /* CCTextureAtlas.h */, 50ABBD811925AB4100A911A9 /* CCTextureCache.cpp */, 50ABBD821925AB4100A911A9 /* CCTextureCache.h */, + 5034CA5D191D591900CE6051 /* shaders */, ); name = renderer; path = ../cocos/renderer; @@ -4504,6 +4524,9 @@ 5034CA5D191D591900CE6051 /* shaders */ = { isa = PBXGroup; children = ( + B29594AF1926D5D9003EEF37 /* ccShader_3D_Color.frag */, + B29594B01926D5D9003EEF37 /* ccShader_3D_ColorTex.frag */, + B29594B11926D5D9003EEF37 /* ccShader_3D_PositionTex.vert */, 5034CA60191D91CF00CE6051 /* ccShader_PositionTextureColor.vert */, 5034CA61191D91CF00CE6051 /* ccShader_PositionTextureColor.frag */, 5034CA62191D91CF00CE6051 /* ccShader_PositionTextureColor_noMVP.vert */, @@ -4755,32 +4778,20 @@ path = TextReader; sourceTree = ""; }; - B3D8D4471799219B0039C204 /* mac */ = { + B29594B81926D61F003EEF37 /* 3d */ = { isa = PBXGroup; children = ( - 46A16E281807C99F005B8026 /* libwebsockets.a */, - 46A16E211807C95C005B8026 /* libfreetype.a */, - 46A16E221807C95C005B8026 /* libglfw3.a */, - 46A16E231807C95C005B8026 /* libjpeg.a */, - 46A16E241807C95C005B8026 /* libpng.a */, - 46A16E251807C95C005B8026 /* libtiff.a */, - 46A16E261807C95C005B8026 /* libwebp.a */, + B29594B91926D61F003EEF37 /* CCMesh.cpp */, + B29594BA1926D61F003EEF37 /* CCMesh.h */, + B29594BB1926D61F003EEF37 /* CCObjLoader.cpp */, + B29594BC1926D61F003EEF37 /* CCObjLoader.h */, + B29594BD1926D61F003EEF37 /* CCSprite3D.cpp */, + B29594BE1926D61F003EEF37 /* CCSprite3D.h */, + B29594BF1926D61F003EEF37 /* CCSprite3DDataCache.cpp */, + B29594C01926D61F003EEF37 /* CCSprite3DDataCache.h */, ); - name = mac; - sourceTree = ""; - }; - B3D8D44B179921D50039C204 /* ios */ = { - isa = PBXGroup; - children = ( - 46A16E271807C992005B8026 /* libwebsockets.a */, - 46A16E1B1807C948005B8026 /* libcurl.a */, - 46A16E1C1807C948005B8026 /* libfreetype.a */, - 46A16E1D1807C948005B8026 /* libjpeg.a */, - 46A16E1E1807C948005B8026 /* libpng.a */, - 46A16E1F1807C948005B8026 /* libtiff.a */, - 46A16E201807C948005B8026 /* libwebp.a */, - ); - name = ios; + name = 3d; + path = ../cocos/3d; sourceTree = ""; }; /* End PBXGroup section */ @@ -4803,6 +4814,7 @@ 06CAAAC9186AD7EE0012A414 /* TriggerMng.h in Headers */, 2905FA6018CF08D100240AA3 /* UILayoutParameter.h in Headers */, 50ABBEA51925AB6F00A911A9 /* CCScriptSupport.h in Headers */, + B29594D01926D61F003EEF37 /* CCSprite3DDataCache.h in Headers */, 1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */, 5034CA3F191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, 50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */, @@ -4929,6 +4941,7 @@ 50ABBD421925AB0000A911A9 /* CCMathBase.h in Headers */, 1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */, 50FCEB9D18C72017004AD434 /* ImageViewReader.h in Headers */, + B29594C81926D61F003EEF37 /* CCObjLoader.h in Headers */, 50ABBE911925AB6F00A911A9 /* CCPlatformMacros.h in Headers */, 50ABC05D1926664800A911A9 /* CCApplication.h in Headers */, 50ABC0071926664800A911A9 /* CCApplicationProtocol.h in Headers */, @@ -4963,6 +4976,7 @@ 2905FA5818CF08D100240AA3 /* UILayout.h in Headers */, 1A57034D180BD09B0088DEC7 /* tinyxml2.h in Headers */, 1A570356180BD0B00088DEC7 /* ioapi.h in Headers */, + B29594C41926D61F003EEF37 /* CCMesh.h in Headers */, 50ABBE331925AB6F00A911A9 /* CCConfiguration.h in Headers */, 50ABC01F1926664800A911A9 /* CCThread.h in Headers */, 1A57035A180BD0B00088DEC7 /* unzip.h in Headers */, @@ -5017,6 +5031,7 @@ 1A01C69218F57BE800EFE3A6 /* CCDouble.h in Headers */, 50ABBE251925AB6F00A911A9 /* base64.h in Headers */, 50ABBEC91925AB6F00A911A9 /* firePngData.h in Headers */, + B29594CC1926D61F003EEF37 /* CCSprite3D.h in Headers */, 1AD71E9F180E26E600808F54 /* AnimationStateData.h in Headers */, 1AD71EA3180E26E600808F54 /* Atlas.h in Headers */, 1AD71EA7180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */, @@ -5081,6 +5096,7 @@ 50ABBE211925AB6F00A911A9 /* atitc.h in Headers */, 1A8C5999180E930E00EF57C3 /* CCActionNode.h in Headers */, 1A8C599D180E930E00EF57C3 /* CCActionObject.h in Headers */, + B29594B61926D5EC003EEF37 /* CCMeshCommand.h in Headers */, 50ABBE371925AB6F00A911A9 /* CCConsole.h in Headers */, 1A8C59A1180E930E00EF57C3 /* CCArmature.h in Headers */, 1A8C59A5180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */, @@ -5287,9 +5303,11 @@ 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 5034CA38191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */, 50ABBE7C1925AB6F00A911A9 /* CCEventMouse.h in Headers */, + B29594D11926D61F003EEF37 /* CCSprite3DDataCache.h in Headers */, 46A171011807CECB005B8026 /* CCPhysicsJoint.h in Headers */, 46A170FD1807CECB005B8026 /* CCPhysicsBody.h in Headers */, 2905FA6118CF08D100240AA3 /* UILayoutParameter.h in Headers */, + B29594C51926D61F003EEF37 /* CCMesh.h in Headers */, 50ABBE9C1925AB6F00A911A9 /* CCRef.h in Headers */, 50ABBD961925AB4100A911A9 /* CCGLProgramState.h in Headers */, 46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */, @@ -5493,11 +5511,13 @@ 1AD71DEE180E26E600808F54 /* CCMenuLoader.h in Headers */, 1AD71DF2180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */, 50ABBDB01925AB4100A911A9 /* CCRenderer.h in Headers */, + B29594B71926D5EC003EEF37 /* CCMeshCommand.h in Headers */, 1AD71DF6180E26E600808F54 /* CCNodeLoader.h in Headers */, 50ABBD861925AB4100A911A9 /* CCBatchCommand.h in Headers */, 1AD71DFA180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */, 50ABBE481925AB6F00A911A9 /* CCEvent.h in Headers */, 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */, + B29594CD1926D61F003EEF37 /* CCSprite3D.h in Headers */, 1AD71DFC180E26E600808F54 /* CCNodeLoaderListener.h in Headers */, 3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */, 50ABBE641925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */, @@ -5507,6 +5527,7 @@ 1AD71E0C180E26E600808F54 /* CCSpriteLoader.h in Headers */, 50ABBD921925AB4100A911A9 /* CCGLProgramCache.h in Headers */, 1AD71E0E180E26E600808F54 /* CocosBuilder.h in Headers */, + B29594C91926D61F003EEF37 /* CCObjLoader.h in Headers */, 1AD71E98180E26E600808F54 /* Animation.h in Headers */, 1AD71E9C180E26E600808F54 /* AnimationState.h in Headers */, 50ABBE961925AB6F00A911A9 /* CCProfiling.h in Headers */, @@ -6098,6 +6119,7 @@ 50FCEBBF18C72017004AD434 /* TextFieldReader.cpp in Sources */, 50FCEBAF18C72017004AD434 /* ScrollViewReader.cpp in Sources */, 50ABC0111926664800A911A9 /* CCGLViewProtocol.cpp in Sources */, + B29594C21926D61F003EEF37 /* CCMesh.cpp in Sources */, 50ABBE3D1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, 1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */, 50ABBE7D1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, @@ -6147,6 +6169,7 @@ 1AD71DE9180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */, 50ABBDA31925AB4100A911A9 /* CCQuadCommand.cpp in Sources */, 2905FA6A18CF08D100240AA3 /* UIPageView.cpp in Sources */, + B29594C61926D61F003EEF37 /* CCObjLoader.cpp in Sources */, 06CAAAC7186AD7E90012A414 /* TriggerObj.cpp in Sources */, 1AD71DEF180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */, 50ABC01D1926664800A911A9 /* CCThread.cpp in Sources */, @@ -6185,6 +6208,7 @@ 1AD71ECD180E26E600808F54 /* Skeleton.cpp in Sources */, 1AD71ED1180E26E600808F54 /* SkeletonData.cpp in Sources */, 1AD71ED5180E26E600808F54 /* SkeletonJson.cpp in Sources */, + B29594CA1926D61F003EEF37 /* CCSprite3D.cpp in Sources */, 1AD71ED9180E26E600808F54 /* Skin.cpp in Sources */, 1AD71EDD180E26E600808F54 /* Slot.cpp in Sources */, 1AD71EE1180E26E600808F54 /* SlotData.cpp in Sources */, @@ -6229,6 +6253,7 @@ 1A8C59C3180E930E00EF57C3 /* CCComController.cpp in Sources */, 2905FA5218CF08D100240AA3 /* UIImageView.cpp in Sources */, 50ABBDBD1925AB4100A911A9 /* CCTextureCache.cpp in Sources */, + B29594CE1926D61F003EEF37 /* CCSprite3DDataCache.cpp in Sources */, 2905FA7C18CF08D100240AA3 /* UIText.cpp in Sources */, 50FCEB9F18C72017004AD434 /* LayoutReader.cpp in Sources */, 50ABC0211926664800A911A9 /* CCGLView.cpp in Sources */, @@ -6255,6 +6280,7 @@ 1A8C59EF180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */, 1A8C59F3180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */, 2905FA6E18CF08D100240AA3 /* UIRichText.cpp in Sources */, + B29594B41926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */, 1A01C68E18F57BE800EFE3A6 /* CCDictionary.cpp in Sources */, 1A8C59F7180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */, 50ABBD381925AB0000A911A9 /* CCAffineTransform.cpp in Sources */, @@ -6442,6 +6468,7 @@ 50ABBE621925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, B37510811823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */, 2905FA8D18CF08D100240AA3 /* UIWidget.cpp in Sources */, + B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */, 50ABBE7E1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, 50FCEB9818C72017004AD434 /* CheckBoxReader.cpp in Sources */, 50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, @@ -6461,6 +6488,7 @@ 1A570082180BC5A10088DEC7 /* CCActionManager.cpp in Sources */, 1A570086180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */, 1A57008A180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */, + B29594CB1926D61F003EEF37 /* CCSprite3D.cpp in Sources */, 2905FA6F18CF08D100240AA3 /* UIRichText.cpp in Sources */, 50ABBED81925AB6F00A911A9 /* ZipUtils.cpp in Sources */, 1A57008E180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */, @@ -6470,6 +6498,7 @@ 50ABBE3E1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, 1A57009F180BC5D20088DEC7 /* CCNode.cpp in Sources */, B37510831823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */, + B29594CF1926D61F003EEF37 /* CCSprite3DDataCache.cpp in Sources */, 1A57010F180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */, 1A570113180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */, 1A57011C180BC90D0088DEC7 /* CCGrabber.cpp in Sources */, @@ -6572,6 +6601,7 @@ 1AD71DDA180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */, 50FCEBC018C72017004AD434 /* TextFieldReader.cpp in Sources */, 1AD71DDE180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */, + B29594C31926D61F003EEF37 /* CCMesh.cpp in Sources */, 1AD71DE2180E26E600808F54 /* CCLayerLoader.cpp in Sources */, 1AD71DE6180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */, 50ABBEA81925AB6F00A911A9 /* CCTouch.cpp in Sources */, @@ -6600,6 +6630,7 @@ 1AD71EB2180E26E600808F54 /* Bone.cpp in Sources */, 50ABBD451925AB0000A911A9 /* CCVertex.cpp in Sources */, 2905FA8118CF08D100240AA3 /* UITextAtlas.cpp in Sources */, + B29594C71926D61F003EEF37 /* CCObjLoader.cpp in Sources */, 50ABBEB01925AB6F00A911A9 /* CCUserDefault.cpp in Sources */, 50FCEBB818C72017004AD434 /* TextAtlasReader.cpp in Sources */, 1AD71EB6180E26E600808F54 /* BoneData.cpp in Sources */, @@ -6997,7 +7028,7 @@ "\"$(SRCROOT)/../external/freetype2/prebuilt/mac\"", "\"$(SRCROOT)/../external/websockets/prebuilt/mac\"", ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac"; }; name = Debug; }; @@ -7023,7 +7054,7 @@ "\"$(SRCROOT)/../external/freetype2/prebuilt/mac\"", "\"$(SRCROOT)/../external/websockets/prebuilt/mac\"", ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac"; }; name = Release; }; @@ -7183,7 +7214,7 @@ ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; }; name = Debug; }; @@ -7221,7 +7252,7 @@ ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; }; name = Release; }; diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 11c134ac8a..479ff9081c 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -85,6 +85,8 @@ 15C90B4A18E66C2B00D69802 /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; }; 15C90B4B18E66C2F00D69802 /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 15C90B4C18E66C3100D69802 /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; + 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.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; }; 1A0EE2A418CDF6DA004CD58F /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; }; @@ -812,6 +814,10 @@ 29080DE4191B595E0066F8DF /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */; }; 29080DE5191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; 29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; + 3E92EA821921A1400094CD21 /* Sprite3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E92EA801921A1400094CD21 /* Sprite3DTest.cpp */; }; + 3E92EA831921A1400094CD21 /* Sprite3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E92EA801921A1400094CD21 /* Sprite3DTest.cpp */; }; + 3E92EA851921A7720094CD21 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; + 3E92EA861921A7720094CD21 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; }; 3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */; }; @@ -827,6 +833,8 @@ 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 */; }; + B2507B6B192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; }; + B2507B6C192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; }; C08689C118D370C90093E810 /* background.caf in Resources */ = {isa = PBXBuildFile; fileRef = C08689C018D370C90093E810 /* background.caf */; }; C08689C218D370C90093E810 /* background.caf in Resources */ = {isa = PBXBuildFile; fileRef = C08689C018D370C90093E810 /* background.caf */; }; C08689C318D370C90093E810 /* background.caf in Resources */ = {isa = PBXBuildFile; fileRef = C08689C018D370C90093E810 /* background.caf */; }; @@ -1849,6 +1857,9 @@ 29080D8A191B595E0066F8DF /* UIWidgetAddNodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest.h; sourceTree = ""; }; 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidgetAddNodeTest_Editor.cpp; sourceTree = ""; }; 29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest_Editor.h; sourceTree = ""; }; + 3E92EA801921A1400094CD21 /* Sprite3DTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sprite3DTest.cpp; path = Sprite3DTest/Sprite3DTest.cpp; sourceTree = ""; }; + 3E92EA811921A1400094CD21 /* Sprite3DTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sprite3DTest.h; path = Sprite3DTest/Sprite3DTest.h; sourceTree = ""; }; + 3E92EA841921A7720094CD21 /* Sprite3DTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Sprite3DTest; path = "../tests/cpp-tests/Resources/Sprite3DTest"; sourceTree = ""; }; 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; name = cocosvideo.mp4; path = "../tests/cpp-tests/Resources/cocosvideo.mp4"; sourceTree = ""; }; 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIVideoPlayerTest.cpp; sourceTree = ""; }; @@ -1864,6 +1875,7 @@ A07A52B91783AE900073F6A7 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; }; A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; A07A52C11783B01F0073F6A7 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; + B2507B6A192589AF00FA4972 /* Shaders3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Shaders3D; path = "../tests/cpp-tests/Resources/Shaders3D"; sourceTree = ""; }; C08689C018D370C90093E810 /* background.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = background.caf; path = "../tests/cpp-tests/Resources/background.caf"; sourceTree = ""; }; D60AE43317F7FFE100757E4B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; EDCC747E17C455FD007B692C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; @@ -2258,6 +2270,7 @@ 1AC35AE918CECF0C00F37B72 /* SchedulerTest */, 1AC35AEC18CECF0C00F37B72 /* ShaderTest */, 1AC35AF118CECF0C00F37B72 /* SpineTest */, + 3E92EA7D1921A0C60094CD21 /* Sprite3DTest */, 1AC35AF418CECF0C00F37B72 /* SpriteTest */, 1AC35AF718CECF0C00F37B72 /* testBasic.cpp */, 1AC35AF818CECF0C00F37B72 /* testBasic.h */, @@ -3274,6 +3287,8 @@ 1AC35CA818CED83500F37B72 /* Resources */ = { isa = PBXGroup; children = ( + B2507B6A192589AF00FA4972 /* Shaders3D */, + 3E92EA841921A7720094CD21 /* Sprite3DTest */, 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */, 1AC35CA918CED84500F37B72 /* animations */, 1AC35CAE18CED84500F37B72 /* ccb */, @@ -3790,6 +3805,15 @@ name = Frameworks; sourceTree = ""; }; + 3E92EA7D1921A0C60094CD21 /* Sprite3DTest */ = { + isa = PBXGroup; + children = ( + 3E92EA801921A1400094CD21 /* Sprite3DTest.cpp */, + 3E92EA811921A1400094CD21 /* Sprite3DTest.h */, + ); + name = Sprite3DTest; + sourceTree = ""; + }; 3EA0FB6F191C844400B170C8 /* UIVideoPlayerTest */ = { isa = PBXGroup; children = ( @@ -4264,6 +4288,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */, 1AC35DC318CEE65100F37B72 /* Misc in Resources */, 1AC35DC618CEE65100F37B72 /* Shaders in Resources */, 1AC35DBB18CEE65100F37B72 /* components in Resources */, @@ -4332,6 +4357,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */, 15C90B4418E66C1800D69802 /* mime.lua in Resources */, 15C90B4C18E66C3100D69802 /* url.lua in Resources */, 1AC35DD618CEE65200F37B72 /* Misc in Resources */, @@ -4415,6 +4441,7 @@ 1AC35D0418CED84500F37B72 /* Shaders in Resources */, 1AC35CD818CED84500F37B72 /* CocosBuilderExample.ccbresourcelog in Resources */, 1AC35CDC18CED84500F37B72 /* commonly_used_words.txt in Resources */, + B2507B6B192589AF00FA4972 /* Shaders3D in Resources */, 1AC35D0618CED84500F37B72 /* spine in Resources */, 1AC35CE818CED84500F37B72 /* extensions in Resources */, 1AC35CDE18CED84500F37B72 /* components in Resources */, @@ -4433,6 +4460,7 @@ 1AC35D0018CED84500F37B72 /* pew-pew-lei.wav in Resources */, 1AC35CD018CED84500F37B72 /* background.mp3 in Resources */, 1AC35CD618CED84500F37B72 /* CocosBuilderExample.ccbproj in Resources */, + 3E92EA851921A7720094CD21 /* Sprite3DTest in Resources */, 1AC35CA318CECF1E00F37B72 /* InfoPlist.strings in Resources */, 1AC35CA418CECF1E00F37B72 /* MainMenu.xib in Resources */, 1AC35CD418CED84500F37B72 /* ccb in Resources */, @@ -4471,6 +4499,7 @@ 1AC35CD318CED84500F37B72 /* background.ogg in Resources */, 1AC35CCB18CED84500F37B72 /* animations in Resources */, 3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */, + 3E92EA861921A7720094CD21 /* Sprite3DTest in Resources */, 1AC35C8C18CECF1400F37B72 /* Icon-114.png in Resources */, 1AC35CF118CED84500F37B72 /* hd in Resources */, 1AC35C9318CECF1400F37B72 /* Icon-57.png in Resources */, @@ -4486,6 +4515,7 @@ 1AC35C9418CECF1400F37B72 /* Icon-58.png in Resources */, 1AC35CD118CED84500F37B72 /* background.mp3 in Resources */, 1AC35CD918CED84500F37B72 /* CocosBuilderExample.ccbresourcelog in Resources */, + B2507B6C192589AF00FA4972 /* Shaders3D in Resources */, 1AC35CED18CED84500F37B72 /* fonts in Resources */, 1AC35CD718CED84500F37B72 /* CocosBuilderExample.ccbproj in Resources */, 1AC35CDD18CED84500F37B72 /* commonly_used_words.txt in Resources */, @@ -4574,6 +4604,7 @@ 1AC35BE118CECF0C00F37B72 /* CCControlButtonTest.cpp in Sources */, 1AC35BEB18CECF0C00F37B72 /* CCControlSliderTest.cpp in Sources */, 1AC35C4D18CECF0C00F37B72 /* SpineTest.cpp in Sources */, + 3E92EA821921A1400094CD21 /* Sprite3DTest.cpp in Sources */, 1AC35C1D18CECF0C00F37B72 /* NewRendererTest.cpp in Sources */, 1AC35B6718CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, 29080DB7191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */, @@ -4906,6 +4937,7 @@ 1AC35B5418CECF0C00F37B72 /* CocosDenshionTest.cpp in Sources */, 1AC35B8018CECF0C00F37B72 /* ProjectileController.cpp in Sources */, 1AC35C2618CECF0C00F37B72 /* PerformanceAllocTest.cpp in Sources */, + 3E92EA831921A1400094CD21 /* Sprite3DTest.cpp in Sources */, 1AC35B5A18CECF0C00F37B72 /* controller.cpp in Sources */, 1AC35C2A18CECF0C00F37B72 /* PerformanceEventDispatcherTest.cpp in Sources */, 1AC35BEA18CECF0C00F37B72 /* CCControlSceneManager.cpp in Sources */, diff --git a/cocos/2d/CCActionProgressTimer.cpp b/cocos/2d/CCActionProgressTimer.cpp index 68b87fe6d2..0ad0558e90 100644 --- a/cocos/2d/CCActionProgressTimer.cpp +++ b/cocos/2d/CCActionProgressTimer.cpp @@ -72,13 +72,6 @@ void ProgressTo::startWithTarget(Node *target) { ActionInterval::startWithTarget(target); _from = ((kProgressTimerCast)(target))->getPercentage(); - - // XXX: Is this correct ? - // Adding it to support Repeat - if (_from == 100) - { - _from = 0; - } } void ProgressTo::update(float time) diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index 683f825071..bad6c9f733 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -69,8 +69,8 @@ FontAtlas * FontAtlasCache::getFontAtlasTTF(const TTFConfig & config) if ( it == _atlasMap.end() ) { - auto font = FontFreeType::create(config.fontFilePath, fontSize * contentScaleFactor, config.glyphs, - config.customGlyphs,useDistanceField,config.outlineSize * contentScaleFactor); + auto font = FontFreeType::create(config.fontFilePath, fontSize, config.glyphs, + config.customGlyphs, useDistanceField, config.outlineSize); if (font) { auto tempAtlas = font->createFontAtlas(); diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index adae2b9ac3..8c5cb16389 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -695,12 +695,12 @@ FontFNT::FontFNT(BMFontConfiguration *theContfig, const Vec2& imageOffset /* = V :_configuration(theContfig) ,_imageOffset(CC_POINT_PIXELS_TO_POINTS(imageOffset)) { - + _configuration->retain(); } FontFNT::~FontFNT() { - + _configuration->release(); } void FontFNT::purgeCachedData() diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index c99269bcdd..48ce2d8bba 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include #include - +#include "base/CCDirector.h" #include "base/ccUTF8.h" #include "platform/CCFileUtils.h" #include "edtaa3func.h" @@ -102,6 +102,7 @@ FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */,int outline / { if (_outlineSize > 0) { + _outlineSize *= CC_CONTENT_SCALE_FACTOR(); FT_Stroker_New(FontFreeType::getFTLibrary(), &_stroker); FT_Stroker_Set(_stroker, (int)(_outlineSize * 64), @@ -142,7 +143,7 @@ bool FontFreeType::createFontObject(const std::string &fontName, int fontSize) // set the requested font size int dpi = 72; - int fontSizePoints = (int)(64.f * fontSize); + int fontSizePoints = (int)(64.f * fontSize * CC_CONTENT_SCALE_FACTOR()); if (FT_Set_Char_Size(face, fontSizePoints, fontSizePoints, dpi, dpi)) return false; @@ -286,8 +287,6 @@ unsigned char* FontFreeType::getGlyphBitmap(unsigned short theChar, long &outWid auto copyBitmap = new unsigned char[outWidth * outHeight]; memcpy(copyBitmap,ret,outWidth * outHeight * sizeof(unsigned char)); - long bitmapWidth; - long bitmapHeight; FT_BBox bbox; auto outlineBitmap = getGlyphBitmapWithOutline(theChar,bbox); if(outlineBitmap == nullptr) @@ -297,42 +296,47 @@ unsigned char* FontFreeType::getGlyphBitmap(unsigned short theChar, long &outWid break; } - bitmapWidth = (bbox.xMax - bbox.xMin)>>6; - bitmapHeight = (bbox.yMax - bbox.yMin)>>6; + long outlineWidth = (bbox.xMax - bbox.xMin)>>6; + long outlineHeight = (bbox.yMax - bbox.yMin)>>6; - long index; - auto blendImage = new unsigned char[bitmapWidth * bitmapHeight * 2]; - memset(blendImage, 0, bitmapWidth * bitmapHeight * 2); - for (int x = 0; x < bitmapWidth; ++x) + long blendWidth = outlineWidth > outWidth ? outlineWidth : outWidth; + long blendHeight = outlineHeight > outHeight ? outlineHeight : outHeight; + + long index,index2; + auto blendImage = new unsigned char[blendWidth * blendHeight * 2]; + memset(blendImage, 0, blendWidth * blendHeight * 2); + + int px = (blendWidth - outlineWidth) / 2; + int py = (blendHeight - outlineHeight) / 2; + for (int x = 0; x < outlineWidth; ++x) { - for (int y = 0; y < bitmapHeight; ++y) + for (int y = 0; y < outlineHeight; ++y) { - index = x + ( y * bitmapWidth ); - blendImage[2 * index] = outlineBitmap[index]; + index = px + x + ( (py + y) * blendWidth ); + index2 = x + (y * outlineWidth); + blendImage[2 * index] = outlineBitmap[index2]; } } - long maxX = outWidth + _outlineSize; - long maxY = outHeight + _outlineSize; - for (int x = _outlineSize; x < maxX; ++x) + px = (blendWidth - outWidth) / 2; + py = (blendHeight - outHeight) / 2; + for (int x = 0; x < outWidth; ++x) { - for (int y = _outlineSize; y < maxY; ++y) + for (int y = 0; y < outHeight; ++y) { - index = x + ( y * bitmapWidth ); - - blendImage[2 * index + 1] = copyBitmap[outWidth * (y - _outlineSize) + x - _outlineSize]; + index = px + x + ( (y + py) * blendWidth ); + index2 = x + (y * outWidth); + blendImage[2 * index + 1] = copyBitmap[index2]; } } outRect.origin.x = bbox.xMin >> 6; outRect.origin.y = - (bbox.yMax >> 6); - - xAdvance += bitmapWidth - outRect.size.width; - - outRect.size.width = bitmapWidth; - outRect.size.height = bitmapHeight; - outWidth = bitmapWidth; - outHeight = bitmapHeight; + xAdvance += 2 * _outlineSize; + outRect.size.width = blendWidth; + outRect.size.height = blendHeight; + outWidth = blendWidth; + outHeight = blendHeight; delete [] outlineBitmap; delete [] copyBitmap; diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 9c38e979b8..681f009a3b 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -58,7 +58,7 @@ public: static void shutdownFreeType(); bool isDistanceFieldEnabled() const { return _distanceFieldEnabled;} - int getOutlineSize() const { return _outlineSize; } + float getOutlineSize() const { return _outlineSize; } void renderCharAt(unsigned char *dest,int posX, int posY, unsigned char* bitmap,long bitmapWidth,long bitmapHeight); virtual FontAtlas * createFontAtlas() override; @@ -89,7 +89,7 @@ private: FT_Stroker _stroker; std::string _fontName; bool _distanceFieldEnabled; - int _outlineSize; + float _outlineSize; }; NS_CC_END diff --git a/cocos/2d/CCLabelBMFont.cpp b/cocos/2d/CCLabelBMFont.cpp index 7dfe8b846c..e81d57a2dc 100644 --- a/cocos/2d/CCLabelBMFont.cpp +++ b/cocos/2d/CCLabelBMFont.cpp @@ -181,7 +181,7 @@ const BlendFunc &LabelBMFont::getBlendFunc() const return _label->getBlendFunc(); } -Node* LabelBMFont::getChildByTag(int tag) +Node* LabelBMFont::getChildByTag(int tag) const { return _label->getLetter(tag); } diff --git a/cocos/2d/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h index 5479adf0a3..595ce7cbb2 100644 --- a/cocos/2d/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -115,7 +115,7 @@ public: virtual const BlendFunc &getBlendFunc() const override; virtual Sprite * getLetter(int ID); - virtual Node * getChildByTag(int tag) override; + virtual Node * getChildByTag(int tag) const override; virtual void setColor(const Color3B& color) override; diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index d7451357ac..3fa0df21c5 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -718,7 +718,7 @@ void Node::childrenAlloc(void) _children.reserve(4); } -Node* Node::getChildByTag(int tag) +Node* Node::getChildByTag(int tag) const { CCASSERT( tag != Node::INVALID_TAG, "Invalid tag"); diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index e08fa3d779..d29a589728 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -643,7 +643,7 @@ public: * * @return a Node object whose tag equals to the input parameter */ - virtual Node * getChildByTag(int tag); + virtual Node * getChildByTag(int tag) const; /** * Returns the array of the node's children * diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj index d7f58d5390..08ffc2fc9e 100644 --- a/cocos/2d/cocos2d.vcxproj +++ b/cocos/2d/cocos2d.vcxproj @@ -175,6 +175,10 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + + @@ -263,6 +267,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -341,6 +346,10 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + + @@ -452,6 +461,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + diff --git a/cocos/2d/cocos2d.vcxproj.filters b/cocos/2d/cocos2d.vcxproj.filters index 5c2b8adc1e..8b792ef611 100644 --- a/cocos/2d/cocos2d.vcxproj.filters +++ b/cocos/2d/cocos2d.vcxproj.filters @@ -52,6 +52,9 @@ {b4e2b1e5-2d79-44a3-af45-728d47b7bdb2} + + {a20c4bdc-bd4c-40c1-a78a-fe31cd3ec76a} + @@ -547,6 +550,21 @@ base + + renderer + + + 3d + + + 3d + + + 3d + + + 3d + @@ -1111,6 +1129,21 @@ base + + renderer + + + 3d + + + 3d + + + 3d + + + 3d + diff --git a/cocos/2d/cocos2d_winrt.vcxproj b/cocos/2d/cocos2d_winrt.vcxproj index e65209978d..c78b1a2102 100644 --- a/cocos/2d/cocos2d_winrt.vcxproj +++ b/cocos/2d/cocos2d_winrt.vcxproj @@ -265,6 +265,18 @@ + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + true + true + true + true + true + true CompileAsCpp CompileAsCpp CompileAsCpp @@ -278,34 +290,33 @@ - false - false - false - false - false - false NotUsing NotUsing NotUsing NotUsing NotUsing NotUsing - - - - - - - - - - - - + true + true + true + true + true + true + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + + + + + @@ -326,15 +337,30 @@ + + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + + + + + + + + @@ -345,13 +371,14 @@ + + - - - - + + + @@ -362,6 +389,32 @@ + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + Create + + @@ -370,10 +423,14 @@ + + + + @@ -390,7 +447,6 @@ - @@ -402,36 +458,9 @@ - - false - false - false - false - false - false - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - - - + - - @@ -442,6 +471,7 @@ + @@ -450,15 +480,11 @@ - - - - @@ -468,37 +494,6 @@ - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - Create - Create - - - @@ -507,9 +502,14 @@ + + + + + @@ -532,21 +532,33 @@ + + + - - + + + + + + + + + + + @@ -563,13 +575,14 @@ + + - - - - + + + @@ -581,6 +594,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -589,11 +627,15 @@ + + + + @@ -610,56 +652,44 @@ - - - - - + - - - - + - - - - - @@ -668,53 +698,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + + + + + diff --git a/cocos/2d/cocos2d_winrt.vcxproj.filters b/cocos/2d/cocos2d_winrt.vcxproj.filters index 77d7af3277..b641582cb4 100644 --- a/cocos/2d/cocos2d_winrt.vcxproj.filters +++ b/cocos/2d/cocos2d_winrt.vcxproj.filters @@ -1,536 +1,340 @@  - - {cc64f5ad-2234-494c-9c51-b7a20c8887aa} - - - {736cf4ab-e0d6-40ba-912a-b062d28d318a} - - - {1c7c61b8-3d36-4ba0-a87c-457eb4c782d0} - - - {0b3a64bd-79fa-476a-a461-6b97e5072453} - - - {e455af5e-da09-4f41-b79f-df4dd311820d} - - - {206bd96b-f80e-4722-8675-d7c6ff9b3639} - - - {075492ba-08bc-404c-92da-32029797a600} - - - {41abe422-1602-4fe0-ac1c-6b04a14c1abb} - - - {8bf0f517-2ac3-4fc3-a1ad-999d9ea103cd} - {926fc31c-8742-4984-9940-c972dd02fc8a} - - {755e5282-111e-46a5-9169-7c12b37f5ffc} - - - {d94bbf20-8de9-49a7-ae20-6a1140cf633b} - - - {4a64789e-cc8d-4f84-a869-e6dae2e0d58c} - - - {bb98a889-9a48-4e31-af2f-117f14da388a} - - - {fdea327e-b905-47db-8c33-b70d7866166b} - - - {46c8d130-b8b5-47f5-a063-ca700e1c32cc} - - - {f2671200-b2d8-4d2e-9728-06719cf6f835} - - - {535c04b0-fe2b-44c9-9a8c-9029e2b6de5c} - - - {5b082c5c-d396-43ca-b3b1-997d0f6247d0} - - - {1179d205-d065-49f0-8457-bc4c3f1d0cb3} - - - {cc25bb83-527d-4218-8d68-ebf963ce7698} - - - {caa78ce0-9b58-4314-b117-1acae278691e} - - - {47fda93e-6eb4-4abc-b5bc-725bf667a395} - - - {08593631-5bf5-46aa-9436-62595c4f7bf6} - - - {aeadfa95-9c89-4212-98ae-89ad57db596a} - - - {aec8225f-81a7-4213-b97b-7004d5535398} - - - {cba0f362-878c-438b-ad0f-43d287516357} - - - {6e394a3e-2c57-4988-bc51-bea18e491559} - - - {0f5d437f-e972-4b3c-9e01-11802af452dc} - - - {c45b97e8-fa1f-4e58-8ec5-d46371c2dd26} - - - {8357726f-36e1-4e1c-9fac-c86601307b1e} - - + {66fe0560-cca4-4b0c-a192-44aca8ad82af} - - {b14b4bf9-3bc3-499b-b7a1-5e054aaf2ab0} + + {d3c53fc9-8678-4801-9a24-a619be0e761e} + + + {929b5dfc-73f5-4094-9036-051078571248} + + + {c883205c-736d-46a1-8626-8307d7c1967b} + + + {ff74d35d-9d65-44b8-8569-36197c006c41} + + + {8e9c8baf-8264-4016-bc90-ed547dfb524d} + + + {6063a842-a931-44fe-aea7-605af02302a4} + + + {ebd488cd-3f7b-4d28-adfc-e70980a65199} + + + {b31e69bf-1430-4938-81a4-b88019ba6f70} + + + {364e5ee6-3dee-4d24-baee-a59dd3519e8b} + + + {7532fb96-9b65-44e6-a165-b78eb67e14e2} + + + {bb9fdcc1-d324-4e79-9d10-8698b0ea583d} + + + {7ca64aa2-f350-4bc9-a046-d24c4df4f0ad} + + + {261eb0ec-d921-49ec-8ccd-f528d5a91abd} + + + {bb14c2af-576d-4274-a21e-c518397fa0cf} + + + {4626742b-b8a8-4626-ac6c-17be46e1c3c1} - - physics + + + + platform\winrt - - physics + + platform\winrt - - physics + + platform\winrt - - physics + + platform\winrt - - physics + + platform\winrt - - base_nodes + + platform\winrt - - base_nodes + + platform\winrt - - effects + + platform\winrt - - effects + + platform\winrt - - layers_scenes_transitions_nodes + + platform\winrt - - layers_scenes_transitions_nodes + + platform\winrt - - layers_scenes_transitions_nodes + + platform\winrt - - layers_scenes_transitions_nodes + + platform\winrt - - layers_scenes_transitions_nodes + + platform - - menu_nodes + + platform - - menu_nodes + + platform - - misc_nodes + + platform - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - script_support + + platform - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions - - - draw_nodes - - - draw_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - platform\etc - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes + 2d - sprite_nodes + 2d - sprite_nodes + 2d - - text_input_node + + 2d - - text_input_node - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - - support - - - support + + 2d - support\component + 2d - support\component + 2d - - support\data_support + + 2d - - support\image_support + + 2d - - support\tinyxml2 + + 2d - - support\tinyxml2\user_default + + 2d - - support\zip_support + + 2d - - support\zip_support + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 3d + + + 3d + + + 3d + + + 3d + + + base + + + base base + + base + + + base + + + base + base base - - base - - - base - - - support - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - base - - - misc_nodes - - - label_nodes - - - label_nodes - - - platform - - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - base - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - - base - - - base - base @@ -579,541 +383,494 @@ base + + base + + + base + + + base + base + + base + base + + base + base base + + base + + + base + + + base + + + base + + + base + + + base + + + base + + + base + base + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + - ConvertUTF + external\ConvertUTF - ConvertUTF + external\ConvertUTF - - platform\etc\winrt + + external\edtaa + + + external\tinyxml2 + + + external\unzip + + + external\unzip - - xxhash + external\xxhash + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics + + + physics + + + physics + + + physics + + + physics - - physics + + + + platform\winrt - - physics + + platform\winrt - - physics + + platform\winrt - - physics + + platform\winrt - - physics + + platform\winrt - - base_nodes + + platform\winrt - - base_nodes + + platform\winrt - - effects + + platform\winrt - - effects + + platform\winrt - - include + + platform\winrt - - include + + platform\winrt - - include + + platform\winrt - - include + + platform\winrt - - include + + platform\winrt - - include + + platform\winrt - - include + + platform\winrt - - layers_scenes_transitions_nodes + + platform - - layers_scenes_transitions_nodes + + platform - - layers_scenes_transitions_nodes + + platform - - layers_scenes_transitions_nodes + + platform - - layers_scenes_transitions_nodes + + platform - - menu_nodes + + platform - - menu_nodes + + platform - - misc_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - script_support + + platform - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions + 2d - actions - - - draw_nodes - - - draw_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - platform\etc - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes + 2d - sprite_nodes + 2d - sprite_nodes + 2d - - text_input_node + + 2d - - text_input_node - - - text_input_node - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - - support - - - support - - - support + + 2d - support\component + 2d - support\component + 2d - - support\data_support + + 2d - - support\data_support + + 2d - - support\data_support + + 2d - - support\image_support + + 2d - - support\tinyxml2 + + 2d - - support\tinyxml2\user_default + + 2d - - support\zip_support + + 2d - - support\zip_support + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 3d + + + 3d + + + 3d + + + 3d + + + base + + + base base - - base - - - base - - - base - - - base - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - physics\chipmunk - - - base - - - base - - - base - - - misc_nodes - - - label_nodes - - - label_nodes - - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - platform\etc\winrt - - - base - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - deprecated - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - + base @@ -1122,6 +879,15 @@ base + + base + + + base + + + base + base @@ -1173,68 +939,293 @@ base + + base + + + base + + + base + base + + base + + + base + + + base + + + base + base + + base + + + base + base base + + base + base base + + base + + + base + + + base + + + base + + + base + + + base + + + base + + + base + + + base + + + base + + + base + base + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + + + deprecated + - ConvertUTF + external\ConvertUTF - - platform\etc\winrt + + external\edtaa - - platform\etc\winrt + + external\tinyxml2 + + + external\unzip + + + external\unzip - - xxhash + external\xxhash + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics\chipmunk + + + physics + + + physics + + + physics + + + physics + + + physics - + + base + + math - - - + math math - - math - math - + math - + math - + math + + renderer + + + renderer + + + renderer + renderer diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index 8b74b9ac1c..af64540683 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -75,7 +75,7 @@ %(PreprocessorDefinitions) - NotUsing + Use pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) $(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories) @@ -100,7 +100,7 @@ _LIB;NDEBUG;%(PreprocessorDefinitions) - NotUsing + Use pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) $(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories) @@ -125,7 +125,7 @@ _LIB;%(PreprocessorDefinitions) - NotUsing + Use pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) $(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories) @@ -151,7 +151,7 @@ _LIB;NDEBUG;%(PreprocessorDefinitions) - NotUsing + Use pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) $(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories) @@ -222,6 +222,10 @@ NotUsing NotUsing + + + + @@ -257,6 +261,10 @@ + NotUsing + NotUsing + NotUsing + NotUsing @@ -318,11 +326,16 @@ - + + Create + Create + Create + Create + @@ -331,6 +344,7 @@ + @@ -409,6 +423,10 @@ + + + + @@ -518,11 +536,11 @@ - + @@ -531,6 +549,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index a7a56641cf..e7f75c3fd6 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -571,15 +571,28 @@ platform\winrt - - platform\winrt - platform\winrt base + + 3d + + + 3d + + + 3d + + + 3d + + + renderer + + @@ -1167,9 +1180,6 @@ platform\winrt - - platform\winrt - platform\winrt @@ -1179,6 +1189,22 @@ base + + 3d + + + 3d + + + 3d + + + 3d + + + renderer + + diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp new file mode 100644 index 0000000000..d7b61e22d1 --- /dev/null +++ b/cocos/3d/CCMesh.cpp @@ -0,0 +1,214 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "CCMesh.h" + +#include +#include +#include +#include + +#include "base/ccMacros.h" +#include "renderer/ccGLStateCache.h" +#include "CCObjLoader.h" +#include "CCSprite3DDataCache.h" + +using namespace std; + +NS_CC_BEGIN + +bool RenderMeshData::hasVertexAttrib(int attrib) +{ + for (auto itr = _vertexAttribs.begin(); itr != _vertexAttribs.end(); itr++) + { + if ((*itr).vertexAttrib == attrib) + return true; //already has + } + return false; +} + +bool RenderMeshData::initFrom(const std::vector& positions, + const std::vector& normals, + const std::vector& texs, + const std::vector& indices) +{ + CC_ASSERT(positions.size()<65536 * 3 && "index may out of bound"); + + _vertexAttribs.clear(); + _vertexsizeBytes = 0; + + _vertexNum = positions.size() / 3; //number of vertex + if (_vertexNum == 0) + return false; + + if ((normals.size() != 0 && _vertexNum * 3 != normals.size()) || (texs.size() != 0 && _vertexNum * 2 != texs.size())) + return false; + + _vertexsizeBytes += 3; + MeshVertexAttrib meshvertexattrib; + meshvertexattrib.size = 3; + meshvertexattrib.type = GL_FLOAT; + meshvertexattrib.attribSizeBytes = meshvertexattrib.size * sizeof(float); + meshvertexattrib.vertexAttrib = GLProgram::VERTEX_ATTRIB_POSITION; + _vertexAttribs.push_back(meshvertexattrib); + + //normal + if (normals.size()) + { + //add normal flag + _vertexsizeBytes += 3; + meshvertexattrib.vertexAttrib = GLProgram::VERTEX_ATTRIB_NORMAL; + _vertexAttribs.push_back(meshvertexattrib); + } + // + if (texs.size()) + { + _vertexsizeBytes += 2; + meshvertexattrib.size = 2; + meshvertexattrib.vertexAttrib = GLProgram::VERTEX_ATTRIB_TEX_COORD; + meshvertexattrib.attribSizeBytes = meshvertexattrib.size * sizeof(float); + _vertexAttribs.push_back(meshvertexattrib); + } + + _vertexs.clear(); + _vertexs.reserve(_vertexNum * _vertexsizeBytes); + _vertexsizeBytes *= sizeof(float); + + bool hasNormal = hasVertexAttrib(GLProgram::VERTEX_ATTRIB_NORMAL); + bool hasTexCoord = hasVertexAttrib(GLProgram::VERTEX_ATTRIB_TEX_COORD); + //position, normal, texCoordinate into _vertexs + for(int i = 0; i < _vertexNum; i++) + { + _vertexs.push_back(positions[i * 3]); + _vertexs.push_back(positions[i * 3 + 1]); + _vertexs.push_back(positions[i * 3 + 2]); + + if (hasNormal) + { + _vertexs.push_back(normals[i * 3]); + _vertexs.push_back(normals[i * 3 + 1]); + _vertexs.push_back(normals[i * 3 + 2]); + } + + if (hasTexCoord) + { + _vertexs.push_back(texs[i * 2]); + _vertexs.push_back(texs[i * 2 + 1]); + } + } + _indices = indices; + + return true; +} + +Mesh::Mesh() +:_vertexBuffer(0) +, _indexBuffer(0) +, _primitiveType(PrimitiveType::TRIANGLES) +, _indexFormat(IndexFormat::INDEX16) +, _indexCount(0) +{ +} + +Mesh::~Mesh() +{ + cleanAndFreeBuffers(); +} + +Mesh* Mesh::create(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices) +{ + auto mesh = new Mesh(); + if(mesh && mesh->init(positions, normals, texs, indices)) + { + mesh->autorelease(); + return mesh; + } + CC_SAFE_DELETE(mesh); + return nullptr; +} + +bool Mesh::init(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices) +{ + bool bRet = _renderdata.initFrom(positions, normals, texs, indices); + if (!bRet) + return false; + + restore(); + return true; +} + +void Mesh::cleanAndFreeBuffers() +{ + if(glIsBuffer(_vertexBuffer)) + { + glDeleteBuffers(1, &_vertexBuffer); + _vertexBuffer = 0; + } + + if(glIsBuffer(_indexBuffer)) + { + glDeleteBuffers(1, &_indexBuffer); + _indexBuffer = 0; + } + _primitiveType = PrimitiveType::TRIANGLES; + _indexFormat = IndexFormat::INDEX16; + _indexCount = 0; +} + +void Mesh::buildBuffer() +{ + cleanAndFreeBuffers(); + + glGenBuffers(1, &_vertexBuffer); + glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); + + glBufferData(GL_ARRAY_BUFFER, + _renderdata._vertexs.size() * sizeof(_renderdata._vertexs[0]), + &_renderdata._vertexs[0], + GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + + glGenBuffers(1, &_indexBuffer); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); + + unsigned int indexSize = 2; + IndexFormat indexformat = IndexFormat::INDEX16; + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexSize * _renderdata._indices.size(), &_renderdata._indices[0], GL_STATIC_DRAW); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + + _primitiveType = PrimitiveType::TRIANGLES; + _indexFormat = indexformat; + _indexCount = _renderdata._indices.size(); +} + +void Mesh::restore() +{ + cleanAndFreeBuffers(); + buildBuffer(); +} + +NS_CC_END diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h new file mode 100644 index 0000000000..1d0db67785 --- /dev/null +++ b/cocos/3d/CCMesh.h @@ -0,0 +1,133 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CCMESH_H__ +#define __CCMESH_H__ + +#include +#include + +#include "base/CCRef.h" +#include "base/ccTypes.h" +#include "math/CCMath.h" +#include "renderer/CCGLProgram.h" + +NS_CC_BEGIN + +//mesh vertex attribute +struct MeshVertexAttrib +{ + //attribute size + GLint size; + //GL_FLOAT + GLenum type; + //VERTEX_ATTRIB_POSITION,VERTEX_ATTRIB_COLOR,VERTEX_ATTRIB_TEX_COORD,VERTEX_ATTRIB_NORMAL, GLProgram for detail + int vertexAttrib; + //size in bytes + int attribSizeBytes; +}; + +class RenderMeshData +{ + friend class Mesh; +public: + RenderMeshData(): _vertexsizeBytes(0) + { + } + bool hasVertexAttrib(int attrib); + bool initFrom(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices); + +protected: + int _vertexsizeBytes; + ssize_t _vertexNum; + std::vector _vertexs; + std::vector _indices; + std::vector _vertexAttribs; +}; + +/** Mesh: TODO, add description of Mesh */ +class Mesh : public Ref +{ +public: + /** Defines supported index formats. */ + enum class IndexFormat + { + INDEX8 = GL_UNSIGNED_BYTE, + INDEX16 = GL_UNSIGNED_SHORT, + }; + + /** Defines supported primitive types. */ + enum class PrimitiveType + { + TRIANGLES = GL_TRIANGLES, + TRIANGLE_STRIP = GL_TRIANGLE_STRIP, + LINES = GL_LINES, + LINE_STRIP = GL_LINE_STRIP, + POINTS = GL_POINTS + }; + + //create + static Mesh* create(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices); + + //get vertex buffer + inline GLuint getVertexBuffer() const { return _vertexBuffer; } + + //get mesh vertex attribute count + ssize_t getMeshVertexAttribCount() const { return _renderdata._vertexAttribs.size(); } + //get MeshVertexAttribute by index + const MeshVertexAttrib& getMeshVertexAttribute(int idx) const { return _renderdata._vertexAttribs[idx]; } + //has vertex attribute? + bool hasVertexAttrib(int attrib) { return _renderdata.hasVertexAttrib(attrib); } + //get per vertex size in bytes + int getVertexSizeInBytes() const { return _renderdata._vertexsizeBytes; } + + PrimitiveType getPrimitiveType() const { return _primitiveType; } + ssize_t getIndexCount() const { return _indexCount; } + IndexFormat getIndexFormat() const { return _indexFormat; } + GLuint getIndexBuffer() const {return _indexBuffer; } + + //build vertex buffer from renderdata + void restore(); + +protected: + Mesh(); + virtual ~Mesh(); + bool init(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices); + + //build buffer + void buildBuffer(); + void cleanAndFreeBuffers(); + + PrimitiveType _primitiveType; + IndexFormat _indexFormat; + GLuint _vertexBuffer; + GLuint _indexBuffer; + ssize_t _indexCount; + + RenderMeshData _renderdata; +}; + +NS_CC_END + +#endif // __CCMESH_H_ diff --git a/cocos/3d/CCObjLoader.cpp b/cocos/3d/CCObjLoader.cpp new file mode 100644 index 0000000000..939de77984 --- /dev/null +++ b/cocos/3d/CCObjLoader.cpp @@ -0,0 +1,714 @@ +// +// Copyright 2012-2013, Syoyo Fujita. +// +// Licensed under 2-clause BSD liecense. +// + +// +// version 0.9.6: Support Ni(index of refraction) mtl parameter. +// Parse transmittance material parameter correctly. +// version 0.9.5: Parse multiple group name. +// Add support of specifying the base path to load material file. +// version 0.9.4: Initial suupport of group tag(g) +// version 0.9.3: Fix parsing triple 'x/y/z' +// version 0.9.2: Add more .mtl load support +// version 0.9.1: Add initial .mtl load support +// version 0.9.0: Initial +// + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "CCObjLoader.h" +#include "platform/CCFileUtils.h" + +NS_CC_BEGIN + +struct vertex_index +{ + int v_idx, vt_idx, vn_idx; + vertex_index() {}; + vertex_index(int idx) : v_idx(idx), vt_idx(idx), vn_idx(idx) {}; + vertex_index(int vidx, int vtidx, int vnidx) : v_idx(vidx), vt_idx(vtidx), vn_idx(vnidx) {}; + +}; +// for std::map +static inline bool operator<(const vertex_index& a, const vertex_index& b) +{ + if (a.v_idx != b.v_idx) return (a.v_idx < b.v_idx); + if (a.vn_idx != b.vn_idx) return (a.vn_idx < b.vn_idx); + if (a.vt_idx != b.vt_idx) return (a.vt_idx < b.vt_idx); + return false; +} + +struct obj_shape +{ + std::vector v; + std::vector vn; + std::vector vt; +}; + +static inline bool isSpace(const char c) +{ + return (c == ' ') || (c == '\t'); +} + +static inline bool isNewLine(const char c) +{ + return (c == '\r') || (c == '\n') || (c == '\0'); +} + +// Make index zero-base, and also support relative index. +static inline int fixIndex(int idx, int n) +{ + int i; + + if (idx > 0) { + i = idx - 1; + } else if (idx == 0) { + i = 0; + } else { // negative value = relative + i = n + idx; + } + return i; +} + +static inline std::string parseString(const char*& token) +{ + std::string s; + auto b = strspn(token, " \t"); + auto e = strcspn(token, " \t\r"); + s = std::string(&token[b], &token[e]); + + token += (e - b); + return s; +} + +static inline int parseInt(const char*& token) +{ + token += strspn(token, " \t"); + int i = atoi(token); + token += strcspn(token, " \t\r"); + return i; +} + +static inline float parseFloat(const char*& token) +{ + token += strspn(token, " \t"); + float f = (float)atof(token); + token += strcspn(token, " \t\r"); + return f; +} + +static inline void parseFloat2(float& x, float& y, const char*& token) +{ + x = parseFloat(token); + y = parseFloat(token); +} + +static inline void parseFloat3(float& x, float& y, float& z, const char*& token) +{ + x = parseFloat(token); + y = parseFloat(token); + z = parseFloat(token); +} + +// Parse triples: i, i/j/k, i//k, i/j +static vertex_index parseTriple(const char* &token, int vsize, int vnsize, int vtsize) +{ + vertex_index vi(-1); + + vi.v_idx = fixIndex(atoi(token), vsize); + token += strcspn(token, "/ \t\r"); + if (token[0] != '/') { + return vi; + } + token++; + + // i//k + if (token[0] == '/') { + token++; + vi.vn_idx = fixIndex(atoi(token), vnsize); + token += strcspn(token, "/ \t\r"); + return vi; + } + + // i/j/k or i/j + vi.vt_idx = fixIndex(atoi(token), vtsize); + token += strcspn(token, "/ \t\r"); + if (token[0] != '/') { + return vi; + } + + // i/j/k + token++; // skip '/' + vi.vn_idx = fixIndex(atoi(token), vnsize); + token += strcspn(token, "/ \t\r"); + return vi; +} + +static ssize_t updateVertex( std::map& vertexCache, std::vector& positions, std::vector& normals, + std::vector& texcoords, const std::vector& in_positions, const std::vector& in_normals, const std::vector& in_texcoords, + const vertex_index& i) +{ + const auto it = vertexCache.find(i); + + if (it != vertexCache.end()) + { + // found cache + return it->second; + } + + assert(in_positions.size() > (3*i.v_idx+2)); + + positions.push_back(in_positions[3*i.v_idx+0]); + positions.push_back(in_positions[3*i.v_idx+1]); + positions.push_back(in_positions[3*i.v_idx+2]); + + if (i.vn_idx >= 0) + { + normals.push_back(in_normals[3*i.vn_idx+0]); + normals.push_back(in_normals[3*i.vn_idx+1]); + normals.push_back(in_normals[3*i.vn_idx+2]); + } + + if (i.vt_idx >= 0) + { + texcoords.push_back(in_texcoords[2*i.vt_idx+0]); + texcoords.push_back(in_texcoords[2*i.vt_idx+1]); + } + + auto idx = positions.size() / 3 - 1; + vertexCache[i] = idx; + + return idx; +} + +static bool exportFaceGroupToShape( std::map& vertexCache, ObjLoader::shapes_t& shapes, const std::vector &in_positions, + const std::vector &in_normals, const std::vector &in_texcoords, const std::vector >& faceGroup, + const ObjLoader::material_t &material, const std::string &name) +{ + if (faceGroup.empty()) + { + return false; + } + + // Flattened version of vertex data + std::vector& positions = shapes.positions; + std::vector& normals = shapes.normals; + std::vector& texcoords = shapes.texcoords; + std::vector indices; + + // Flatten vertices and indices + for (size_t i = 0; i < faceGroup.size(); i++) + { + const std::vector& face = faceGroup[i]; + + vertex_index i0 = face[0]; + vertex_index i1(-1); + vertex_index i2 = face[1]; + + size_t npolys = face.size(); + + // Polygon -> triangle fan conversion + for (size_t k = 2; k < npolys; k++) + { + i1 = i2; + i2 = face[k]; + + unsigned short v0 = updateVertex(vertexCache, positions, normals, texcoords, in_positions, in_normals, in_texcoords, i0); + unsigned short v1 = updateVertex(vertexCache, positions, normals, texcoords, in_positions, in_normals, in_texcoords, i1); + unsigned short v2 = updateVertex(vertexCache, positions, normals, texcoords, in_positions, in_normals, in_texcoords, i2); + + indices.push_back(v0); + indices.push_back(v1); + indices.push_back(v2); + } + } + + ObjLoader::shape_t shape; + shape.name = name; + shape.material = material; + shape.mesh.indices.swap(indices); + + shapes.shapes.push_back(shape); + return true; + +} + +std::string trim(const std::string& str) +{ + if (str.empty()) + return str; + auto len = str.length(); + char c = str[len - 1]; + while (c == '\r' || c == '\n') + { + len--; + c = str[len - 1]; + } + return str.substr(0, len); +} + +void InitMaterial(ObjLoader::material_t& material) +{ + material.name = ""; + material.ambient_texname = ""; + material.diffuse_texname = ""; + material.specular_texname = ""; + material.normal_texname = ""; + for (int i = 0; i < 3; i ++) + { + material.ambient[i] = 0.f; + material.diffuse[i] = 0.f; + material.specular[i] = 0.f; + material.transmittance[i] = 0.f; + material.emission[i] = 0.f; + } + material.illum = 0; + material.dissolve = 1.f; + material.shininess = 1.f; + material.unknown_parameter.clear(); +} + +std::string LoadMtl ( std::map& material_map, const char* filename, const char* mtl_basepath) +{ + material_map.clear(); + std::stringstream err; + + std::string filepath; + + if (mtl_basepath) + { + filepath = std::string(mtl_basepath) + std::string(filename); + } + else + { + filepath = std::string(filename); + } + + std::ifstream ifs(filepath.c_str()); + if (!ifs) + { + err << "Cannot open file [" << filepath << "]" << std::endl; + return err.str(); + } + + ObjLoader::material_t material; + + int maxchars = 8192; // Alloc enough size. + std::vector buf(maxchars); // Alloc enough size. + while (ifs.peek() != -1) + { + ifs.getline(&buf[0], maxchars); + + std::string linebuf(&buf[0]); + + // Trim newline '\r\n' or '\r' + if (linebuf.size() > 0) + { + if (linebuf[linebuf.size()-1] == '\n') linebuf.erase(linebuf.size()-1); + } + if (linebuf.size() > 0) + { + if (linebuf[linebuf.size()-1] == '\n') linebuf.erase(linebuf.size()-1); + } + + // Skip if empty line. + if (linebuf.empty()) + { + continue; + } + + // Skip leading space. + const char* token = linebuf.c_str(); + token += strspn(token, " \t"); + + assert(token); + if (token[0] == '\0') continue; // empty line + + if (token[0] == '#') continue; // comment line + + // new mtl + if ((0 == strncmp(token, "newmtl", 6)) && isSpace((token[6]))) + { + // flush previous material. + material_map.insert(std::pair(material.name, material)); + + // initial temporary material + InitMaterial(material); + + // set new mtl name + char namebuf[4096]; + token += 7; + sscanf(token, "%s", namebuf); + material.name = namebuf; + continue; + } + + // ambient + if (token[0] == 'K' && token[1] == 'a' && isSpace((token[2]))) + { + token += 2; + float r, g, b; + parseFloat3(r, g, b, token); + material.ambient[0] = r; + material.ambient[1] = g; + material.ambient[2] = b; + continue; + } + + // diffuse + if (token[0] == 'K' && token[1] == 'd' && isSpace((token[2]))) + { + token += 2; + float r, g, b; + parseFloat3(r, g, b, token); + material.diffuse[0] = r; + material.diffuse[1] = g; + material.diffuse[2] = b; + continue; + } + + // specular + if (token[0] == 'K' && token[1] == 's' && isSpace((token[2]))) + { + token += 2; + float r, g, b; + parseFloat3(r, g, b, token); + material.specular[0] = r; + material.specular[1] = g; + material.specular[2] = b; + continue; + } + + // transmittance + if (token[0] == 'K' && token[1] == 't' && isSpace((token[2]))) + { + token += 2; + float r, g, b; + parseFloat3(r, g, b, token); + material.transmittance[0] = r; + material.transmittance[1] = g; + material.transmittance[2] = b; + continue; + } + + // ior(index of refraction) + if (token[0] == 'N' && token[1] == 'i' && isSpace((token[2]))) + { + token += 2; + material.ior = parseFloat(token); + continue; + } + + // emission + if(token[0] == 'K' && token[1] == 'e' && isSpace(token[2])) + { + token += 2; + float r, g, b; + parseFloat3(r, g, b, token); + material.emission[0] = r; + material.emission[1] = g; + material.emission[2] = b; + continue; + } + + // shininess + if(token[0] == 'N' && token[1] == 's' && isSpace(token[2])) + { + token += 2; + material.shininess = parseFloat(token); + continue; + } + + // illum model + if (0 == strncmp(token, "illum", 5) && isSpace(token[5])) + { + token += 6; + material.illum = parseInt(token); + continue; + } + + // dissolve + if ((token[0] == 'd' && isSpace(token[1]))) + { + token += 1; + material.dissolve = parseFloat(token); + continue; + } + if (token[0] == 'T' && token[1] == 'r' && isSpace(token[2])) + { + token += 2; + material.dissolve = parseFloat(token); + continue; + } + + // ambient texture + if ((0 == strncmp(token, "map_Ka", 6)) && isSpace(token[6])) + { + token += 7; + material.ambient_texname = trim(token); + continue; + } + + // diffuse texture + if ((0 == strncmp(token, "map_Kd", 6)) && isSpace(token[6])) + { + token += 7; + material.diffuse_texname = trim(token); + continue; + } + + // specular texture + if ((0 == strncmp(token, "map_Ks", 6)) && isSpace(token[6])) + { + token += 7; + material.specular_texname = trim(token); + continue; + } + + // normal texture + if ((0 == strncmp(token, "map_Ns", 6)) && isSpace(token[6])) + { + token += 7; + material.normal_texname = trim(token); + continue; + } + + // unknown parameter + const char* _space = strchr(token, ' '); + if(!_space) + { + _space = strchr(token, '\t'); + } + if(_space) + { + auto len = _space - token; + std::string key(token, len); + std::string value = _space + 1; + material.unknown_parameter.insert(std::pair(key, value)); + } + } + // flush last material. + material_map.insert(std::pair(material.name, material)); + return err.str(); +} + +std::string ObjLoader::LoadObj(shapes_t& shapes, const char* filename, const char* mtl_basepath) +{ + shapes.reset(); + + std::stringstream err; + std::istringstream ifs(FileUtils::getInstance()->getStringFromFile(filename)); + std::map vertexCache; + //std::ifstream ifs(filename); + + if (!ifs) + { + err << "Cannot open file [" << filename << "]" << std::endl; + return err.str(); + } + + std::vector v; + std::vector vn; + std::vector vt; + std::vector > faceGroup; + std::string name; + + // material + std::map material_map; + material_t material; + + int maxchars = 8192; // Alloc enough size. + std::vector buf(maxchars); // Alloc enough size. + while (ifs.peek() != -1) + { + ifs.getline(&buf[0], maxchars); + + std::string linebuf(&buf[0]); + + // Trim newline '\r\n' or '\r' + if (linebuf.size() > 0) + { + if (linebuf[linebuf.size()-1] == '\n') linebuf.erase(linebuf.size()-1); + } + if (linebuf.size() > 0) + { + if (linebuf[linebuf.size()-1] == '\n') linebuf.erase(linebuf.size()-1); + } + + // Skip if empty line. + if (linebuf.empty()) + { + continue; + } + + // Skip leading space. + const char* token = linebuf.c_str(); + token += strspn(token, " \t"); + + assert(token); + if (token[0] == '\0') continue; // empty line + + if (token[0] == '#') continue; // comment line + + // vertex + if (token[0] == 'v' && isSpace((token[1]))) + { + token += 2; + float x, y, z; + parseFloat3(x, y, z, token); + v.push_back(x); + v.push_back(y); + v.push_back(z); + continue; + } + + // normal + if (token[0] == 'v' && token[1] == 'n' && isSpace((token[2]))) + { + token += 3; + float x, y, z; + parseFloat3(x, y, z, token); + vn.push_back(x); + vn.push_back(y); + vn.push_back(z); + continue; + } + + // texcoord + if (token[0] == 'v' && token[1] == 't' && isSpace((token[2]))) + { + token += 3; + float x, y; + parseFloat2(x, y, token); + vt.push_back(x); + vt.push_back(y); + continue; + } + + // face + if (token[0] == 'f' && isSpace((token[1]))) + { + token += 2; + token += strspn(token, " \t"); + + std::vector face; + while (!isNewLine(token[0])) { + vertex_index vi = parseTriple(token, v.size() / 3, vn.size() / 3, vt.size() / 2); + face.push_back(vi); + auto n = strspn(token, " \t\r"); + token += n; + } + + faceGroup.push_back(face); + + continue; + } + + // use mtl + if ((0 == strncmp(token, "usemtl", 6)) && isSpace((token[6]))) + { + + char namebuf[4096]; + token += 7; + sscanf(token, "%s", namebuf); + + if (material_map.find(namebuf) != material_map.end()) + { + material = material_map[namebuf]; + } + else + { + // { error!! material not found } + InitMaterial(material); + } + continue; + + } + + // load mtl + if ((0 == strncmp(token, "mtllib", 6)) && isSpace((token[6]))) + { + char namebuf[4096]; + token += 7; + sscanf(token, "%s", namebuf); + + std::string err_mtl = LoadMtl(material_map, namebuf, mtl_basepath); + if (!err_mtl.empty()) + { + faceGroup.clear(); // for safety + //return err_mtl; + } + continue; + } + + // group name + if (token[0] == 'g' && isSpace((token[1]))) + { + // flush previous face group. + shape_t shape; + exportFaceGroupToShape(vertexCache, shapes, v, vn, vt, faceGroup, material, name); + + faceGroup.clear(); + + std::vector names; + while (!isNewLine(token[0])) + { + std::string str = parseString(token); + names.push_back(str); + token += strspn(token, " \t\r"); // skip tag + } + + assert(names.size() > 0); + + // names[0] must be 'g', so skipt 0th element. + if (names.size() > 1) + { + name = names[1]; + } + else + { + name = ""; + } + + continue; + } + + // object name + if (token[0] == 'o' && isSpace((token[1]))) + { + // flush previous face group. + shape_t shape; + exportFaceGroupToShape(vertexCache, shapes, v, vn, vt, faceGroup, material, name); + + faceGroup.clear(); + + // @todo { multiple object name? } + char namebuf[4096]; + token += 2; + sscanf(token, "%s", namebuf); + name = std::string(namebuf); + + continue; + } + + // Ignore unknown command. + } + + shape_t shape; + exportFaceGroupToShape(vertexCache, shapes, v, vn, vt, faceGroup, material, name); + faceGroup.clear(); // for safety + + return err.str(); +} + +NS_CC_END diff --git a/cocos/3d/CCObjLoader.h b/cocos/3d/CCObjLoader.h new file mode 100644 index 0000000000..a0ef97cb4d --- /dev/null +++ b/cocos/3d/CCObjLoader.h @@ -0,0 +1,87 @@ +// +// Copyright 2012-2013, Syoyo Fujita. +// +// Licensed under 2-clause BSD liecense. +// +// copied from Syoyo Fujita +// https://github.com/syoyo/tinyobjloader + +#ifndef __CCOBJLOADER_H__ +#define __CCOBJLOADER_H__ + +#include +#include +#include +#include "base/ccTypes.h" + +NS_CC_BEGIN + +class ObjLoader +{ +public: + typedef struct + { + std::string name; + + float ambient[3]; + float diffuse[3]; + float specular[3]; + float transmittance[3]; + float emission[3]; + float shininess; + float ior; // index of refraction + float dissolve; // 1 == opaque; 0 == fully transparent + // illumination model (see http://www.fileformat.info/format/material/) + int illum; + + std::string ambient_texname; + std::string diffuse_texname; + std::string specular_texname; + std::string normal_texname; + std::map unknown_parameter; + } material_t; + + typedef struct + { + std::vector indices; + } mesh_t; + + typedef struct + { + std::string name; + material_t material; + mesh_t mesh; + } shape_t; + + typedef struct + { + std::vector positions; + std::vector normals; + std::vector texcoords; + + std::vector shapes; + + void reset() + { + positions.clear(); + normals.clear(); + texcoords.clear(); + shapes.clear(); + } + }shapes_t; + + /// Loads .obj from a file. + /// 'shapes' will be filled with parsed shape data + /// The function returns error string. + /// Returns empty string when loading .obj success. + /// 'mtl_basepath' is optional, and used for base path for .mtl file. + static std::string LoadObj( + shapes_t& shapes, // [output] + const char* filename, + const char* mtl_basepath = NULL); + +}; + +NS_CC_END + +#endif // _TINY_OBJ_LOADER_H diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp new file mode 100644 index 0000000000..06d9b1be7e --- /dev/null +++ b/cocos/3d/CCSprite3D.cpp @@ -0,0 +1,271 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "3d/CCSprite3D.h" +#include "3d/CCSprite3DDataCache.h" +#include "3d/CCMesh.h" +#include "3d/CCObjLoader.h" + +#include "base/CCDirector.h" +#include "base/CCPlatformMacros.h" +#include "base/ccMacros.h" +#include "platform/CCFileUtils.h" +#include "renderer/CCTextureCache.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCGLProgramState.h" +#include "renderer/CCGLProgramCache.h" + +#include "deprecated/CCString.h" // For StringUtils::format + +NS_CC_BEGIN + +std::string s_attributeNames[] = {GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::ATTRIBUTE_NAME_NORMAL}; + +Sprite3D* Sprite3D::create(const std::string &modelPath) +{ + if (modelPath.length() < 4) + CCASSERT(false, "improper name specified when creating Sprite3D"); + + auto sprite = new Sprite3D(); + if (sprite && sprite->initWithFile(modelPath)) + { + sprite->autorelease(); + return sprite; + } + CC_SAFE_DELETE(sprite); + return nullptr; +} + +Sprite3D* Sprite3D::create(const std::string &modelPath, const std::string &texturePath) +{ + auto sprite = create(modelPath); + if (sprite) + { + sprite->setTexture(texturePath); + } + + return sprite; +} + +// Sprite3D* Sprite3D::create(Mesh* mesh, const std::string& texturePath) +// { +// CCASSERT(nullptr != mesh, "Could not create a Sprite3D from a null Mesh"); +// auto sprite = new Sprite3D(); +// if(sprite) +// { +// sprite->_mesh = mesh; +// sprite->_mesh->retain(); +// sprite->setTexture(texturePath); +// sprite->autorelease(); +// return sprite; +// } +// CC_SAFE_DELETE(sprite); +// return nullptr; +// } + +//.mtl file should at the same directory with the same name if exist +bool Sprite3D::loadFromObj(const std::string& path) +{ + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path); + + //.mtl file directory + std::string dir = ""; + auto last = fullPath.rfind("/"); + if (last != -1) + dir = fullPath.substr(0, last + 1); + + ObjLoader::shapes_t shapes; + std::string errstr = ObjLoader::LoadObj(shapes, fullPath.c_str(), dir.c_str()); + if (!errstr.empty()) + return false; + + //convert to mesh and material + std::vector indices; + std::vector matnames; + std::string texname; + for (auto it = shapes.shapes.begin(); it != shapes.shapes.end(); it++) + { + indices.insert(indices.end(), (*it).mesh.indices.begin(),(*it).mesh.indices.end()); + //indices.push_back((*it).mesh.indices); + if (texname.empty()) + texname = (*it).material.diffuse_texname; + else if (texname != (*it).material.diffuse_texname) + { + CCLOGWARN("cocos2d:WARNING: more than one texture in %s", path.c_str()); + } + + matnames.push_back(dir + (*it).material.diffuse_texname); + } + _mesh = Mesh::create(shapes.positions, shapes.normals, shapes.texcoords, indices); + + _mesh->retain(); + if (_mesh == nullptr) + return false; + + if (matnames.size()) + { + setTexture(matnames[0]); + } + genGLProgramState(); + + //add to cache + Sprite3DDataCache::getInstance()->addSprite3D(fullPath, _mesh, matnames.size() > 0 ? matnames[0] : ""); + + return true; +} + +Sprite3D::Sprite3D() +: _mesh(nullptr) +, _texture(nullptr) +, _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED) +{ +} + +Sprite3D::~Sprite3D() +{ + CC_SAFE_RELEASE_NULL(_texture); + CC_SAFE_RELEASE_NULL(_mesh); +} + +bool Sprite3D::initWithFile(const std::string &path) +{ + CC_SAFE_RELEASE_NULL(_mesh); + + CC_SAFE_RELEASE_NULL(_texture); + + //find from the cache + Mesh* mesh = Sprite3DDataCache::getInstance()->getSprite3DMesh(path); + if (mesh) + { + _mesh = mesh; + _mesh->retain(); + + auto tex = Sprite3DDataCache::getInstance()->getSprite3DTexture(path); + setTexture(tex); + + genGLProgramState(); + + return true; + } + else + { + //load from file + std::string ext = path.substr(path.length() - 4, 4); + if (ext != ".obj" || !loadFromObj(path)) + { + return false; + } + return true; + } +} + +void Sprite3D::genGLProgramState() +{ + auto programstate = GLProgramState::getOrCreateWithGLProgram(getDefaultGLProgram(_mesh->hasVertexAttrib(GLProgram::VERTEX_ATTRIB_TEX_COORD))); + long offset = 0; + auto attributeCount = _mesh->getMeshVertexAttribCount(); + for (auto k = 0; k < attributeCount; k++) { + auto meshattribute = _mesh->getMeshVertexAttribute(k); + programstate->setVertexAttribPointer(s_attributeNames[meshattribute.vertexAttrib], + meshattribute.size, + meshattribute.type, + GL_FALSE, + _mesh->getVertexSizeInBytes(), + (GLvoid*)offset); + offset += meshattribute.attribSizeBytes; + } + + setGLProgramState(programstate); +} + +GLProgram* Sprite3D::getDefaultGLProgram(bool textured) +{ + if(textured) + { + return GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_3D_POSITION_TEXTURE); + } + else + { + return GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_3D_POSITION); + } +} + +void Sprite3D::setTexture(const std::string& texFile) +{ + auto tex = Director::getInstance()->getTextureCache()->addImage(texFile); + if( tex && _texture != tex ) { + CC_SAFE_RETAIN(tex); + CC_SAFE_RELEASE_NULL(_texture); + _texture = tex; + } +} + +void Sprite3D::setTexture(Texture2D* texture) +{ + if(_texture != texture) { + CC_SAFE_RETAIN(texture); + CC_SAFE_RELEASE_NULL(_texture); + _texture = texture; + } +} + +void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) +{ + GLProgramState* programstate = getGLProgramState(); + Color4F color(getDisplayedColor()); + color.a = getDisplayedOpacity() / 255.0f; + + GLuint textureID = _texture ? _texture->getName() : 0; + _meshCommand.init(_globalZOrder, + textureID, + programstate, + _blend, + _mesh->getVertexBuffer(), + _mesh->getIndexBuffer(), + (GLenum)_mesh->getPrimitiveType(), + (GLenum)_mesh->getIndexFormat(), + _mesh->getIndexCount(), + transform); + + _meshCommand.setCullFaceEnabled(true); + _meshCommand.setDepthTestEnabled(true); + //support tint and fade + _meshCommand.setDisplayColor(Vec4(color.r, color.g, color.b, color.a)); + Director::getInstance()->getRenderer()->addCommand(&_meshCommand); +} + +void Sprite3D::setBlendFunc(const BlendFunc &blendFunc) +{ + if(_blend.src != blendFunc.src || _blend.dst != blendFunc.dst) + { + _blend = blendFunc; + } +} + +const BlendFunc& Sprite3D::getBlendFunc() const +{ + return _blend; +} + +NS_CC_END diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h new file mode 100644 index 0000000000..3d6559f662 --- /dev/null +++ b/cocos/3d/CCSprite3D.h @@ -0,0 +1,85 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CCSPRITE3D_H__ +#define __CCSPRITE3D_H__ + +#include + +#include "base/CCVector.h" +#include "base/ccTypes.h" +#include "base/CCProtocols.h" +#include "2d/CCNode.h" +#include "renderer/CCMeshCommand.h" + +NS_CC_BEGIN + +class GLProgramState; +class Mesh; +class Texture2D; + +/** Sprite3D: TODO add description */ +class Sprite3D : public Node, public BlendProtocol +{ +public: + /// creates a Sprite3D + static Sprite3D* create(const std::string &modelPath); + + // creates a Sprite3D. It only supports one texture, and overrides the internal texture with 'texturePath' + static Sprite3D* create(const std::string &modelPath, const std::string &texturePath); + + //set texture + void setTexture(const std::string& texFile); + void setTexture(Texture2D* texture); + + Mesh* getMesh() const { return _mesh; } + + // overrides + virtual void setBlendFunc(const BlendFunc &blendFunc) override; + virtual const BlendFunc &getBlendFunc() const override; + +protected: + Sprite3D(); + virtual ~Sprite3D(); + bool initWithFile(const std::string &path); + + //.mtl file should at the same directory with the same name if exist + bool loadFromObj(const std::string& path); + + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; + + virtual GLProgram* getDefaultGLProgram(bool textured = true); + + void genGLProgramState(); + + Mesh *_mesh; + MeshCommand _meshCommand; + Texture2D* _texture; + BlendFunc _blend; +}; + +extern std::string s_attributeNames[]; + +NS_CC_END +#endif // __SPRITE3D_H_ diff --git a/cocos/3d/CCSprite3DDataCache.cpp b/cocos/3d/CCSprite3DDataCache.cpp new file mode 100644 index 0000000000..3b5748b49f --- /dev/null +++ b/cocos/3d/CCSprite3DDataCache.cpp @@ -0,0 +1,145 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "3d/CCSprite3DDataCache.h" + +#include "3d/CCMesh.h" +#include "platform/CCFileUtils.h" +#include "renderer/CCTextureCache.h" +#include "base/CCEventCustom.h" +#include "base/CCEventListenerCustom.h" +#include "base/CCEventDispatcher.h" +#include "base/CCEventType.h" +#include "base/CCDirector.h" + +NS_CC_BEGIN + +Sprite3DDataCache* Sprite3DDataCache::_cacheInstance = nullptr; + +Sprite3DDataCache::Sprite3DDataCache() +{ + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + // listen the event when app go to foreground + _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(Sprite3DDataCache::listenBackToForeground, this)); + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); + #endif +} + +Sprite3DDataCache::~Sprite3DDataCache() +{ + removeAllSprite3DData(); + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener); + #endif +} + +Sprite3DDataCache* Sprite3DDataCache::getInstance() +{ + if (! _cacheInstance) + { + _cacheInstance = new Sprite3DDataCache(); + } + + return _cacheInstance; +} + +void Sprite3DDataCache::purgeMeshCache() +{ + if (_cacheInstance) + { + CC_SAFE_DELETE(_cacheInstance); + } +} + +bool Sprite3DDataCache::addSprite3D(const std::string& fileName, Mesh* mesh, const std::string& texture) +{ + const std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); + auto itr = _sprite3DDatas.find(fullPath); + if (itr == _sprite3DDatas.end()) + { + Sprite3DData data; + data.mesh = mesh; + CC_SAFE_RETAIN(mesh); + data.texture = texture; + _sprite3DDatas[fullPath] = data; + return true; + } + return false; +} + +Mesh* Sprite3DDataCache::getSprite3DMesh(const std::string& fileName) +{ + const std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); + auto itr = _sprite3DDatas.find(fullPath); + if (itr != _sprite3DDatas.end()) + return itr->second.mesh; + return nullptr; +} + +Texture2D* Sprite3DDataCache::getSprite3DTexture(const std::string& fileName) +{ + const std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); + auto itr = _sprite3DDatas.find(fullPath); + if (itr != _sprite3DDatas.end()) + { + auto cache = Director::getInstance()->getTextureCache(); + return cache->addImage(itr->second.texture); + } + return nullptr; +} + +void Sprite3DDataCache::removeAllSprite3DData() +{ + for (auto itr = _sprite3DDatas.begin(); itr != _sprite3DDatas.end(); itr++) { + CC_SAFE_RELEASE_NULL(itr->second.mesh); + } + _sprite3DDatas.clear(); +} +void Sprite3DDataCache::removeUnusedSprite3DData() +{ + for( auto it=_sprite3DDatas.cbegin(); it!=_sprite3DDatas.cend(); /* nothing */) { + auto value = it->second; + if( value.mesh->getReferenceCount() == 1 ) { + CCLOG("cocos2d: GLProgramStateCache: removing unused GLProgramState"); + + value.mesh->release(); + _sprite3DDatas.erase(it++); + } else { + ++it; + } + } +} + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +void Sprite3DDataCache::listenBackToForeground(EventCustom* event) +{ + for (auto iter = _sprite3DDatas.begin(); iter != _sprite3DDatas.end(); ++iter) + { + auto mesh = iter->second.mesh; + mesh->restore(); + } +} +#endif + +NS_CC_END diff --git a/cocos/3d/CCSprite3DDataCache.h b/cocos/3d/CCSprite3DDataCache.h new file mode 100644 index 0000000000..f6e80fb489 --- /dev/null +++ b/cocos/3d/CCSprite3DDataCache.h @@ -0,0 +1,83 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CCSPRIT3DDATA_CACHE_H__ +#define __CCSPRIT3DDATA_CACHE_H__ + +#include +#include +#include "base/ccTypes.h" +#include "base/CCMap.h" + +NS_CC_BEGIN + +class Sprite3D; +class Mesh; +class EventListenerCustom; +class EventCustom; +class Texture2D; + +class Sprite3DDataCache +{ +public: + struct Sprite3DData + { + Mesh* mesh; + std::string texture; + }; + + static Sprite3DDataCache* getInstance(); + static void purgeMeshCache(); + + bool addSprite3D(const std::string& fileName, Mesh* mesh, const std::string& texture); + + Mesh* getSprite3DMesh(const std::string& fileName); + + Texture2D* getSprite3DTexture(const std::string& fileName); + + void removeAllSprite3DData(); + void removeUnusedSprite3DData(); + + + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + void listenBackToForeground(EventCustom* event); + #endif + +protected: + Sprite3DDataCache(); + + ~Sprite3DDataCache(); + + static Sprite3DDataCache* _cacheInstance; + + std::unordered_map _sprite3DDatas; //sprites + + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + EventListenerCustom* _backToForegroundlistener; + #endif +}; + +NS_CC_END + +#endif // __CCSPRIT3DDATA_CACHE_H__ diff --git a/cocos/3d/CMakeLists.txt b/cocos/3d/CMakeLists.txt new file mode 100644 index 0000000000..cb7d6a9de3 --- /dev/null +++ b/cocos/3d/CMakeLists.txt @@ -0,0 +1,7 @@ +set(COCOS_3D_SRC + 3d/CCMesh.cpp + 3d/CCObjLoader.cpp + 3d/CCSprite3D.cpp + 3d/CCSprite3DDataCache.cpp +) + diff --git a/cocos/Android.mk b/cocos/Android.mk index 22112f4be5..70603cfd6a 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -71,6 +71,10 @@ cocos2d.cpp \ 2d/CCTransitionPageTurn.cpp \ 2d/CCTransitionProgress.cpp \ 2d/CCTweenFunction.cpp \ +3d/CCMesh.cpp \ +3d/CCSprite3DDataCache.cpp \ +3d/CCObjLoader.cpp \ +3d/CCSprite3D.cpp \ platform/CCGLViewProtocol.cpp \ platform/CCFileUtils.cpp \ platform/CCSAXParser.cpp \ @@ -136,6 +140,7 @@ renderer/CCGLProgramState.cpp \ renderer/CCGLProgramStateCache.cpp \ renderer/CCGroupCommand.cpp \ renderer/CCQuadCommand.cpp \ +renderer/CCMeshCommand.cpp \ renderer/CCRenderCommand.cpp \ renderer/CCRenderer.cpp \ renderer/CCTexture2D.cpp \ diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 7541b3c039..1479931bc8 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -8,6 +8,7 @@ set(COCOS_SRC ) include(2d/CMakeLists.txt) +include(3d/CMakeLists.txt) include(platform/CMakeLists.txt) include(physics/CMakeLists.txt) include(math/CMakeLists.txt) @@ -21,6 +22,7 @@ include(storage/CMakeLists.txt) add_library(cocos2d STATIC ${COCOS_SRC} ${COCOS_2D_SRC} + ${COCOS_3D_SRC} ${COCOS_PLATFORM_SRC} ${COCOS_BASE_SRC} ${COCOS_RENDERER_SRC} diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index b26c4026e1..41b3a0a89f 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -257,6 +257,10 @@ THE SOFTWARE. #include "2d/CCComponent.h" #include "2d/CCComponentContainer.h" +//3d +#include "3d/CCSprite3D.h" +#include "3d/CCMesh.h" + // Audio #include "audio/include/SimpleAudioEngine.h" diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index e8b154e6b5..685a47fc4b 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -771,7 +771,6 @@ CC_DEPRECATED_ATTRIBUTE typedef GLView CCEGLView; CC_DEPRECATED_ATTRIBUTE typedef Component CCComponent; CC_DEPRECATED_ATTRIBUTE typedef AffineTransform CCAffineTransform; CC_DEPRECATED_ATTRIBUTE typedef Vec2 CCPoint; -CC_DEPRECATED_ATTRIBUTE typedef Vec2 Point; CC_DEPRECATED_ATTRIBUTE typedef Size CCSize; CC_DEPRECATED_ATTRIBUTE typedef Rect CCRect; CC_DEPRECATED_ATTRIBUTE typedef Color3B ccColor3B; diff --git a/cocos/math/Vec2.h b/cocos/math/Vec2.h index 059d646c88..85a93e5815 100644 --- a/cocos/math/Vec2.h +++ b/cocos/math/Vec2.h @@ -743,7 +743,7 @@ public: */ inline const Vec2 operator*(float x, const Vec2& v); -typedef Vec2 Point2; +typedef Vec2 Point; NS_CC_MATH_END diff --git a/cocos/math/Vec3.h b/cocos/math/Vec3.h index 5521ab1505..165af010f3 100644 --- a/cocos/math/Vec3.h +++ b/cocos/math/Vec3.h @@ -467,7 +467,7 @@ public: */ inline const Vec3 operator*(float x, const Vec3& v); -typedef Vec3 Point3; +//typedef Vec3 Point3; NS_CC_MATH_END diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index f62a715b63..be97f220c6 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -526,18 +526,20 @@ void PhysicsWorld::updateBodies() return; } - for (auto& body : _delayAddBodies) + // issue #4944, contact callback will be invoked when add/remove body, _delayAddBodies maybe changed, so we need make a copy. + auto addCopy = _delayAddBodies; + _delayAddBodies.clear(); + for (auto& body : addCopy) { doAddBody(body); } - for (auto& body : _delayRemoveBodies) + auto removeCopy = _delayRemoveBodies; + _delayRemoveBodies.clear(); + for (auto& body : removeCopy) { doRemoveBody(body); } - - _delayAddBodies.clear(); - _delayRemoveBodies.clear(); } void PhysicsWorld::removeBody(int tag) @@ -668,12 +670,16 @@ void PhysicsWorld::updateJoints() return; } - for (auto joint : _delayAddJoints) + auto addCopy = _delayAddJoints; + _delayAddJoints.clear(); + for (auto joint : addCopy) { doAddJoint(joint); } - for (auto joint : _delayRemoveJoints) + auto removeCopy = _delayRemoveJoints; + _delayRemoveJoints.clear(); + for (auto joint : removeCopy) { doRemoveJoint(joint); @@ -682,9 +688,6 @@ void PhysicsWorld::updateJoints() delete joint; } } - - _delayAddJoints.clear(); - _delayRemoveJoints.clear(); } void PhysicsWorld::removeShape(PhysicsShape* shape) @@ -878,7 +881,7 @@ void PhysicsWorld::setGravity(const Vect& gravity) void PhysicsWorld::update(float delta) { - if (_delayDirty) + while (_delayDirty) { // the updateJoints must run before the updateBodies. updateJoints(); diff --git a/cocos/platform/winrt/CCGLView.cpp b/cocos/platform/winrt/CCGLView.cpp index 118449fa25..7fb7e1b9fd 100644 --- a/cocos/platform/winrt/CCGLView.cpp +++ b/cocos/platform/winrt/CCGLView.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCDirector.h" #include "base/CCTouch.h" -#include "2d/CCIMEDispatcher.h" +#include "base/CCIMEDispatcher.h" #include "CCApplication.h" #include "CCWinRTUtils.h" diff --git a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp index 3a048a40fc..24090e043b 100644 --- a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp +++ b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp @@ -39,9 +39,10 @@ using namespace PhoneDirect3DXamlAppComponent; USING_NS_CC; -Cocos2dRenderer::Cocos2dRenderer(): mInitialized(false), m_loadingComplete(false), m_delegate(nullptr), m_messageBoxDelegate(nullptr) +Cocos2dRenderer::Cocos2dRenderer(Windows::Graphics::Display::DisplayOrientations orientation): mInitialized(false), m_loadingComplete(false), m_delegate(nullptr), m_messageBoxDelegate(nullptr) { mApp = new AppDelegate(); + m_orientation = orientation; } // Creates and restores Cocos2d-x after DirectX and Angle contexts are created or updated @@ -53,7 +54,7 @@ void Cocos2dRenderer::CreateGLResources() { mInitialized = true; GLView* glview = GLView::create("Test Cpp"); - glview->Create(m_eglDisplay, m_eglContext, m_eglSurface, m_renderTargetSize.Width, m_renderTargetSize.Height); + glview->Create(m_eglDisplay, m_eglContext, m_eglSurface, m_renderTargetSize.Width, m_renderTargetSize.Height,m_orientation); director->setOpenGLView(glview); CCApplication::getInstance()->run(); glview->SetXamlEventDelegate(m_delegate); diff --git a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h index 796cc6e526..41c3ddd144 100644 --- a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h +++ b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h @@ -32,7 +32,7 @@ class AppDelegate; ref class Cocos2dRenderer sealed : public DirectXBase { public: - Cocos2dRenderer(); + Cocos2dRenderer(Windows::Graphics::Display::DisplayOrientations orientation); // Direct3DBase methods. virtual void OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation) override; @@ -64,4 +64,5 @@ private: // The AppDelegate for the Cocos2D app AppDelegate* mApp; + Windows::Graphics::Display::DisplayOrientations m_orientation; }; diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp index cddd4763f9..b2af8676b8 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp +++ b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp @@ -40,10 +40,10 @@ using namespace PhoneDirect3DXamlAppComponent; namespace PhoneDirect3DXamlAppComponent { -Direct3DInterop::Direct3DInterop() - : mCurrentOrientation(DisplayOrientations::Portrait), m_delegate(nullptr) +Direct3DInterop::Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation) + : mCurrentOrientation(orientation), m_delegate(nullptr) { - m_renderer = ref new Cocos2dRenderer(); + m_renderer = ref new Cocos2dRenderer(mCurrentOrientation); } IDrawingSurfaceBackgroundContentProvider^ Direct3DInterop::CreateContentProvider() diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h index ca9b90f75c..8c6bbad3ba 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h +++ b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h @@ -43,7 +43,7 @@ public delegate void RequestAdditionalFrameHandler(); public ref class Direct3DInterop sealed : public Windows::Phone::Input::Interop::IDrawingSurfaceManipulationHandler { public: - Direct3DInterop(); + Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation); Windows::Phone::Graphics::Interop::IDrawingSurfaceBackgroundContentProvider^ CreateContentProvider(); diff --git a/cocos/platform/wp8-xaml/xaml/MainPage.xaml.cs b/cocos/platform/wp8-xaml/xaml/MainPage.xaml.cs index a4500a00d9..70d50eb5ee 100644 --- a/cocos/platform/wp8-xaml/xaml/MainPage.xaml.cs +++ b/cocos/platform/wp8-xaml/xaml/MainPage.xaml.cs @@ -24,6 +24,7 @@ using Microsoft.Phone.Shell; using Windows.UI.Input; using System.Windows.Threading; using Microsoft.Phone.Info; +using Windows.Graphics.Display; namespace PhoneDirect3DXamlAppInterop { @@ -53,7 +54,30 @@ namespace PhoneDirect3DXamlAppInterop { if (m_d3dInterop == null) { - m_d3dInterop = new Direct3DInterop(); + PageOrientation pageOrientation = (PageOrientation)GetValue(OrientationProperty); + DisplayOrientations displayOrientation; + + switch(pageOrientation) + { + case PageOrientation.Portrait: + case PageOrientation.PortraitUp: + displayOrientation = DisplayOrientations.Portrait; + break; + case PageOrientation.PortraitDown: + displayOrientation = DisplayOrientations.PortraitFlipped; + break; + case PageOrientation.Landscape: + case PageOrientation.LandscapeLeft: + displayOrientation = DisplayOrientations.Landscape; + break; + case PageOrientation.LandscapeRight: + displayOrientation = DisplayOrientations.LandscapeFlipped; + break; + default: + displayOrientation = DisplayOrientations.Landscape; + break; + } + m_d3dInterop = new Direct3DInterop(displayOrientation); // Set WindowBounds to size of DrawingSurface m_d3dInterop.WindowBounds = new Windows.Foundation.Size( diff --git a/cocos/platform/wp8/CCGLView.cpp b/cocos/platform/wp8/CCGLView.cpp index c6869b3fe8..b2350f92a5 100644 --- a/cocos/platform/wp8/CCGLView.cpp +++ b/cocos/platform/wp8/CCGLView.cpp @@ -89,7 +89,6 @@ GLView::GLView() { s_pEglView = this; _viewName = "cocos2dx"; - UpdateOrientationMatrix(); } GLView::~GLView() @@ -114,8 +113,9 @@ bool GLView::initWithFullScreen(const std::string& viewName) } -bool GLView::Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height) +bool GLView::Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height, DisplayOrientations orientation) { + m_orientation = orientation; m_eglDisplay = eglDisplay; m_eglContext = eglContext; m_eglSurface = eglSurface; diff --git a/cocos/platform/wp8/CCGLView.h b/cocos/platform/wp8/CCGLView.h index 69914a8aa2..422d003122 100644 --- a/cocos/platform/wp8/CCGLView.h +++ b/cocos/platform/wp8/CCGLView.h @@ -71,7 +71,8 @@ public: void HideKeyboard(Windows::Foundation::Rect r); // WP8 XAML app - virtual bool Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height); + virtual bool Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height + ,Windows::Graphics::Display::DisplayOrientations orientation); virtual void UpdateDevice(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface); void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args); diff --git a/cocos/platform/wp8/DirectXBase.cpp b/cocos/platform/wp8/DirectXBase.cpp index 0682646062..416106ce8b 100644 --- a/cocos/platform/wp8/DirectXBase.cpp +++ b/cocos/platform/wp8/DirectXBase.cpp @@ -1,4 +1,8 @@ -#include +// XXX: For some reason, this file must not be compiled +// XXX: Ask MS why +#if 0 + +#include #include #include "DirectXBase.h" @@ -275,4 +279,6 @@ void DirectXBase::SetDpi(float dpi) // will not change, and the window resize code will only be executed once. UpdateForWindowSizeChange(); } -} \ No newline at end of file +} + +#endif //0 diff --git a/cocos/platform/wp8/DirectXBase.h b/cocos/platform/wp8/DirectXBase.h index 0749973da6..72187253a5 100644 --- a/cocos/platform/wp8/DirectXBase.h +++ b/cocos/platform/wp8/DirectXBase.h @@ -1,4 +1,8 @@ -#pragma once +// XXX: For some reason, this file must not be compiled +// XXX: Ask MS why +#if 0 + +#pragma once #include "DirectXHelper.h" #include @@ -37,4 +41,6 @@ protected private: Platform::Agile m_window; float m_dpi; -}; \ No newline at end of file +}; + +#endif // 0 \ No newline at end of file diff --git a/cocos/platform/wp8/pch.cpp b/cocos/platform/wp8/pch.cpp new file mode 100644 index 0000000000..bcb5590be1 --- /dev/null +++ b/cocos/platform/wp8/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/cocos/platform/wp8/pch.h b/cocos/platform/wp8/pch.h new file mode 100644 index 0000000000..842a70abec --- /dev/null +++ b/cocos/platform/wp8/pch.h @@ -0,0 +1,3 @@ +#pragma once + +#include "cocos2d.h" \ No newline at end of file diff --git a/cocos/platform/wp8/shaders/precompiledshaders.h b/cocos/platform/wp8/shaders/precompiledshaders.h index 389aa191f8..09de1b560f 100644 --- a/cocos/platform/wp8/shaders/precompiledshaders.h +++ b/cocos/platform/wp8/shaders/precompiledshaders.h @@ -2777,6 +2777,719 @@ const unsigned char s_7B67DD242152D35ACC079265FAD9D03DC98182DE[] = { 111, 110, 0, 171, 171, 171, }; +const unsigned char s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D[] = { + +166, 147, 0, 0, 142, 9, 2, 1, + 0, 128, 0, 0, 82, 139, 0, 0, + 10, 0, 0, 0, 97, 95, 112, 111, +115, 105, 116, 105, 111, 110, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, 80, 139, + 0, 0, 10, 0, 0, 0, 97, 95, +116, 101, 120, 67, 111, 111, 114, 100, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 3, 0, 0, 0, 92, 139, 0, + 0, 242, 141, 0, 0, 12, 0, 0, + 0, 67, 67, 95, 77, 86, 80, 77, + 97, 116, 114, 105, 120, 0, 0, 0, + 0, 255, 255, 255, 255, 0, 0, 0, + 0, 4, 0, 0, 0, 94, 139, 0, + 0, 0, 0, 0, 0, 11, 0, 0, + 0, 67, 67, 95, 84, 101, 120, 116, +117, 114, 101, 48, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 1, 0, 0, 0, 82, 139, 0, 0, +241, 141, 0, 0, 7, 0, 0, 0, +117, 95, 99, 111, 108, 111, 114, 0, + 0, 0, 0, 0, 0, 0, 0, 255, +255, 255, 255, 1, 0, 0, 0, 3, + 0, 0, 0, 12, 0, 0, 0, 67, + 67, 95, 77, 86, 80, 77, 97, 116, +114, 105, 120, 0, 0, 0, 0, 0, + 0, 0, 0, 11, 0, 0, 0, 67, + 67, 95, 84, 101, 120, 116, 117, 114, +101, 48, 0, 0, 0, 0, 1, 0, + 0, 0, 7, 0, 0, 0, 117, 95, + 99, 111, 108, 111, 114, 0, 0, 0, + 0, 2, 0, 0, 0, 96, 4, 0, + 0, 192, 4, 0, 0, 0, 0, 0, + 0, 20, 134, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 68, 88, 66, 67, 157, 116, 105, + 89, 118, 135, 249, 239, 42, 226, 184, + 78, 220, 105, 236, 28, 1, 0, 0, + 0, 96, 4, 0, 0, 6, 0, 0, + 0, 56, 0, 0, 0, 228, 0, 0, + 0, 252, 1, 0, 0, 120, 2, 0, + 0, 176, 3, 0, 0, 228, 3, 0, + 0, 65, 111, 110, 57, 164, 0, 0, + 0, 164, 0, 0, 0, 0, 2, 255, +255, 112, 0, 0, 0, 52, 0, 0, + 0, 1, 0, 40, 0, 0, 0, 52, + 0, 0, 0, 52, 0, 1, 0, 36, + 0, 0, 0, 52, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 1, 2, 255, +255, 31, 0, 0, 2, 0, 0, 0, +128, 0, 0, 3, 176, 31, 0, 0, + 2, 0, 0, 0, 144, 0, 8, 15, +160, 66, 0, 0, 3, 0, 0, 15, +128, 0, 0, 228, 176, 0, 8, 228, +160, 5, 0, 0, 3, 0, 0, 15, +128, 0, 0, 228, 128, 0, 0, 228, +160, 1, 0, 0, 2, 0, 8, 15, +128, 0, 0, 228, 128, 1, 0, 0, + 2, 1, 8, 15, 128, 0, 0, 228, +128, 1, 0, 0, 2, 2, 8, 15, +128, 0, 0, 228, 128, 1, 0, 0, + 2, 3, 8, 15, 128, 0, 0, 228, +128, 255, 255, 0, 0, 83, 72, 68, + 82, 16, 1, 0, 0, 64, 0, 0, + 0, 68, 0, 0, 0, 89, 0, 0, + 4, 70, 142, 32, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 90, 0, 0, + 3, 0, 96, 16, 0, 0, 0, 0, + 0, 88, 24, 0, 4, 0, 112, 16, + 0, 0, 0, 0, 0, 85, 85, 0, + 0, 98, 16, 0, 3, 50, 16, 16, + 0, 0, 0, 0, 0, 101, 0, 0, + 3, 242, 32, 16, 0, 0, 0, 0, + 0, 101, 0, 0, 3, 242, 32, 16, + 0, 1, 0, 0, 0, 101, 0, 0, + 3, 242, 32, 16, 0, 2, 0, 0, + 0, 101, 0, 0, 3, 242, 32, 16, + 0, 3, 0, 0, 0, 104, 0, 0, + 2, 1, 0, 0, 0, 69, 0, 0, + 9, 242, 0, 16, 0, 0, 0, 0, + 0, 70, 16, 16, 0, 0, 0, 0, + 0, 70, 126, 16, 0, 0, 0, 0, + 0, 0, 96, 16, 0, 0, 0, 0, + 0, 56, 0, 0, 8, 242, 0, 16, + 0, 0, 0, 0, 0, 70, 14, 16, + 0, 0, 0, 0, 0, 70, 142, 32, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 54, 0, 0, 5, 242, 32, 16, + 0, 0, 0, 0, 0, 70, 14, 16, + 0, 0, 0, 0, 0, 54, 0, 0, + 5, 242, 32, 16, 0, 1, 0, 0, + 0, 70, 14, 16, 0, 0, 0, 0, + 0, 54, 0, 0, 5, 242, 32, 16, + 0, 2, 0, 0, 0, 70, 14, 16, + 0, 0, 0, 0, 0, 54, 0, 0, + 5, 242, 32, 16, 0, 3, 0, 0, + 0, 70, 14, 16, 0, 0, 0, 0, + 0, 62, 0, 0, 1, 83, 84, 65, + 84, 116, 0, 0, 0, 7, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 5, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 82, 68, 69, 70, 48, 1, 0, + 0, 1, 0, 0, 0, 176, 0, 0, + 0, 3, 0, 0, 0, 28, 0, 0, + 0, 0, 4, 255, 255, 0, 65, 0, + 0, 252, 0, 0, 0, 124, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, 145, 0, 0, + 0, 2, 0, 0, 0, 5, 0, 0, + 0, 4, 0, 0, 0, 255, 255, 255, +255, 0, 0, 0, 0, 1, 0, 0, + 0, 13, 0, 0, 0, 166, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 115, 97, 109, +112, 108, 101, 114, 95, 95, 67, 67, + 95, 84, 101, 120, 116, 117, 114, 101, + 48, 0, 116, 101, 120, 116, 117, 114, +101, 95, 95, 67, 67, 95, 84, 101, +120, 116, 117, 114, 101, 48, 0, 36, + 71, 108, 111, 98, 97, 108, 115, 0, +171, 166, 0, 0, 0, 1, 0, 0, + 0, 200, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 224, 0, 0, 0, 0, 0, 0, + 0, 16, 0, 0, 0, 2, 0, 0, + 0, 236, 0, 0, 0, 0, 0, 0, + 0, 95, 117, 95, 99, 111, 108, 111, +114, 0, 171, 171, 171, 1, 0, 3, + 0, 1, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 77, 105, 99, +114, 111, 115, 111, 102, 116, 32, 40, + 82, 41, 32, 72, 76, 83, 76, 32, + 83, 104, 97, 100, 101, 114, 32, 67, +111, 109, 112, 105, 108, 101, 114, 32, + 54, 46, 51, 46, 57, 54, 48, 48, + 46, 49, 54, 51, 56, 52, 0, 171, +171, 73, 83, 71, 78, 44, 0, 0, + 0, 1, 0, 0, 0, 8, 0, 0, + 0, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 3, 3, 0, + 0, 84, 69, 88, 67, 79, 79, 82, + 68, 0, 171, 171, 171, 79, 83, 71, + 78, 116, 0, 0, 0, 4, 0, 0, + 0, 8, 0, 0, 0, 104, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 104, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 1, 0, 0, + 0, 15, 0, 0, 0, 104, 0, 0, + 0, 2, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 2, 0, 0, + 0, 15, 0, 0, 0, 104, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 3, 0, 0, + 0, 15, 0, 0, 0, 83, 86, 95, + 84, 97, 114, 103, 101, 116, 0, 171, +171, 68, 88, 66, 67, 183, 109, 16, +202, 49, 89, 17, 26, 134, 90, 213, +163, 143, 192, 250, 93, 1, 0, 0, + 0, 192, 4, 0, 0, 6, 0, 0, + 0, 56, 0, 0, 0, 76, 1, 0, + 0, 204, 2, 0, 0, 72, 3, 0, + 0, 28, 4, 0, 0, 104, 4, 0, + 0, 65, 111, 110, 57, 12, 1, 0, + 0, 12, 1, 0, 0, 0, 2, 254, +255, 216, 0, 0, 0, 52, 0, 0, + 0, 1, 0, 36, 0, 0, 0, 48, + 0, 0, 0, 48, 0, 0, 0, 36, + 0, 1, 0, 48, 0, 0, 0, 0, + 0, 4, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 2, 254, +255, 81, 0, 0, 5, 5, 0, 15, +160, 0, 0, 0, 63, 0, 0, 128, + 63, 0, 0, 128, 191, 0, 0, 0, + 0, 31, 0, 0, 2, 5, 0, 0, +128, 0, 0, 15, 144, 31, 0, 0, + 2, 5, 0, 1, 128, 1, 0, 15, +144, 9, 0, 0, 3, 0, 0, 1, +128, 3, 0, 228, 160, 0, 0, 228, +144, 9, 0, 0, 3, 0, 0, 2, +128, 4, 0, 228, 160, 0, 0, 228, +144, 2, 0, 0, 3, 0, 0, 1, +128, 0, 0, 85, 128, 0, 0, 0, +128, 5, 0, 0, 3, 0, 0, 4, +192, 0, 0, 0, 128, 5, 0, 0, +160, 9, 0, 0, 3, 0, 0, 1, +128, 2, 0, 228, 160, 0, 0, 228, +144, 1, 0, 0, 2, 1, 0, 2, +128, 0, 0, 0, 129, 9, 0, 0, + 3, 1, 0, 1, 128, 1, 0, 228, +160, 0, 0, 228, 144, 4, 0, 0, + 4, 0, 0, 3, 192, 0, 0, 85, +128, 0, 0, 228, 160, 1, 0, 228, +128, 1, 0, 0, 2, 0, 0, 8, +192, 0, 0, 85, 128, 4, 0, 0, + 4, 0, 0, 3, 224, 1, 0, 228, +144, 5, 0, 233, 160, 5, 0, 231, +160, 255, 255, 0, 0, 83, 72, 68, + 82, 120, 1, 0, 0, 64, 0, 1, + 0, 94, 0, 0, 0, 89, 0, 0, + 4, 70, 142, 32, 0, 0, 0, 0, + 0, 4, 0, 0, 0, 95, 0, 0, + 3, 242, 16, 16, 0, 0, 0, 0, + 0, 95, 0, 0, 3, 50, 16, 16, + 0, 1, 0, 0, 0, 101, 0, 0, + 3, 50, 32, 16, 0, 0, 0, 0, + 0, 103, 0, 0, 4, 242, 32, 16, + 0, 1, 0, 0, 0, 1, 0, 0, + 0, 104, 0, 0, 2, 1, 0, 0, + 0, 50, 0, 0, 15, 50, 32, 16, + 0, 0, 0, 0, 0, 70, 16, 16, + 0, 1, 0, 0, 0, 2, 64, 0, + 0, 0, 0, 128, 63, 0, 0, 128, +191, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 64, 0, 0, 0, 0, 0, + 0, 0, 0, 128, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 0, + 8, 18, 0, 16, 0, 0, 0, 0, + 0, 70, 142, 32, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 70, 30, 16, + 0, 0, 0, 0, 0, 54, 0, 0, + 6, 34, 32, 16, 0, 1, 0, 0, + 0, 10, 0, 16, 128, 65, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 0, + 8, 18, 0, 16, 0, 0, 0, 0, + 0, 70, 142, 32, 0, 0, 0, 0, + 0, 2, 0, 0, 0, 70, 30, 16, + 0, 0, 0, 0, 0, 17, 0, 0, + 8, 34, 0, 16, 0, 0, 0, 0, + 0, 70, 142, 32, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 70, 30, 16, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 18, 0, 16, 0, 0, 0, 0, + 0, 26, 0, 16, 0, 0, 0, 0, + 0, 10, 0, 16, 0, 0, 0, 0, + 0, 54, 0, 0, 5, 130, 32, 16, + 0, 1, 0, 0, 0, 26, 0, 16, + 0, 0, 0, 0, 0, 56, 0, 0, + 7, 66, 32, 16, 0, 1, 0, 0, + 0, 10, 0, 16, 0, 0, 0, 0, + 0, 1, 64, 0, 0, 0, 0, 0, + 63, 17, 0, 0, 8, 18, 32, 16, + 0, 1, 0, 0, 0, 70, 142, 32, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 70, 30, 16, 0, 0, 0, 0, + 0, 62, 0, 0, 1, 83, 84, 65, + 84, 116, 0, 0, 0, 10, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 0, 0, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 82, 68, 69, 70, 204, 0, 0, + 0, 1, 0, 0, 0, 72, 0, 0, + 0, 1, 0, 0, 0, 28, 0, 0, + 0, 0, 4, 254, 255, 0, 65, 0, + 0, 152, 0, 0, 0, 60, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 36, 71, 108, +111, 98, 97, 108, 115, 0, 171, 171, +171, 60, 0, 0, 0, 1, 0, 0, + 0, 96, 0, 0, 0, 64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 120, 0, 0, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 2, 0, 0, + 0, 136, 0, 0, 0, 0, 0, 0, + 0, 95, 67, 67, 95, 77, 86, 80, + 77, 97, 116, 114, 105, 120, 0, 171, +171, 3, 0, 3, 0, 4, 0, 4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 77, 105, 99, 114, 111, 115, 111, +102, 116, 32, 40, 82, 41, 32, 72, + 76, 83, 76, 32, 83, 104, 97, 100, +101, 114, 32, 67, 111, 109, 112, 105, +108, 101, 114, 32, 54, 46, 51, 46, + 57, 54, 48, 48, 46, 49, 54, 51, + 56, 52, 0, 171, 171, 73, 83, 71, + 78, 68, 0, 0, 0, 2, 0, 0, + 0, 8, 0, 0, 0, 56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 15, 15, 0, 0, 56, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 1, 0, 0, + 0, 3, 3, 0, 0, 84, 69, 88, + 67, 79, 79, 82, 68, 0, 171, 171, +171, 79, 83, 71, 78, 80, 0, 0, + 0, 2, 0, 0, 0, 8, 0, 0, + 0, 56, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 3, 12, 0, + 0, 65, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 3, 0, 0, + 0, 1, 0, 0, 0, 15, 0, 0, + 0, 84, 69, 88, 67, 79, 79, 82, + 68, 0, 83, 86, 95, 80, 111, 115, +105, 116, 105, 111, 110, 0, 171, 171, +171, +}; + +const unsigned char s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C[] = { + +166, 147, 0, 0, 142, 9, 2, 1, + 0, 128, 0, 0, 82, 139, 0, 0, + 10, 0, 0, 0, 97, 95, 112, 111, +115, 105, 116, 105, 111, 110, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, 80, 139, + 0, 0, 10, 0, 0, 0, 97, 95, +116, 101, 120, 67, 111, 111, 114, 100, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 0, 92, 139, 0, + 0, 242, 141, 0, 0, 12, 0, 0, + 0, 67, 67, 95, 77, 86, 80, 77, + 97, 116, 114, 105, 120, 0, 0, 0, + 0, 255, 255, 255, 255, 0, 0, 0, + 0, 4, 0, 0, 0, 82, 139, 0, + 0, 241, 141, 0, 0, 7, 0, 0, + 0, 117, 95, 99, 111, 108, 111, 114, + 0, 0, 0, 0, 0, 0, 0, 0, +255, 255, 255, 255, 1, 0, 0, 0, + 2, 0, 0, 0, 12, 0, 0, 0, + 67, 67, 95, 77, 86, 80, 77, 97, +116, 114, 105, 120, 0, 0, 0, 0, + 0, 0, 0, 0, 7, 0, 0, 0, +117, 95, 99, 111, 108, 111, 114, 0, + 0, 0, 0, 1, 0, 0, 0, 52, + 3, 0, 0, 40, 4, 0, 0, 0, + 0, 0, 0, 20, 134, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 88, 66, 67, 153, + 8, 62, 201, 202, 170, 111, 182, 149, +120, 120, 178, 230, 43, 232, 244, 1, + 0, 0, 0, 52, 3, 0, 0, 6, + 0, 0, 0, 56, 0, 0, 0, 168, + 0, 0, 0, 92, 1, 0, 0, 216, + 1, 0, 0, 168, 2, 0, 0, 184, + 2, 0, 0, 65, 111, 110, 57, 104, + 0, 0, 0, 104, 0, 0, 0, 0, + 2, 255, 255, 56, 0, 0, 0, 48, + 0, 0, 0, 1, 0, 36, 0, 0, + 0, 48, 0, 0, 0, 48, 0, 0, + 0, 36, 0, 0, 0, 48, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 1, 2, 255, 255, 1, + 0, 0, 2, 0, 8, 15, 128, 0, + 0, 228, 160, 1, 0, 0, 2, 1, + 8, 15, 128, 0, 0, 228, 160, 1, + 0, 0, 2, 2, 8, 15, 128, 0, + 0, 228, 160, 1, 0, 0, 2, 3, + 8, 15, 128, 0, 0, 228, 160, 255, +255, 0, 0, 83, 72, 68, 82, 172, + 0, 0, 0, 64, 0, 0, 0, 43, + 0, 0, 0, 89, 0, 0, 4, 70, +142, 32, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 101, 0, 0, 3, 242, + 32, 16, 0, 0, 0, 0, 0, 101, + 0, 0, 3, 242, 32, 16, 0, 1, + 0, 0, 0, 101, 0, 0, 3, 242, + 32, 16, 0, 2, 0, 0, 0, 101, + 0, 0, 3, 242, 32, 16, 0, 3, + 0, 0, 0, 54, 0, 0, 6, 242, + 32, 16, 0, 0, 0, 0, 0, 70, +142, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 54, 0, 0, 6, 242, + 32, 16, 0, 1, 0, 0, 0, 70, +142, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 54, 0, 0, 6, 242, + 32, 16, 0, 2, 0, 0, 0, 70, +142, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 54, 0, 0, 6, 242, + 32, 16, 0, 3, 0, 0, 0, 70, +142, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 62, 0, 0, 1, 83, + 84, 65, 84, 116, 0, 0, 0, 5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 82, 68, 69, 70, 200, + 0, 0, 0, 1, 0, 0, 0, 72, + 0, 0, 0, 1, 0, 0, 0, 28, + 0, 0, 0, 0, 4, 255, 255, 0, + 65, 0, 0, 148, 0, 0, 0, 60, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 36, + 71, 108, 111, 98, 97, 108, 115, 0, +171, 171, 171, 60, 0, 0, 0, 1, + 0, 0, 0, 96, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 120, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 2, + 0, 0, 0, 132, 0, 0, 0, 0, + 0, 0, 0, 95, 117, 95, 99, 111, +108, 111, 114, 0, 171, 171, 171, 1, + 0, 3, 0, 1, 0, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 77, +105, 99, 114, 111, 115, 111, 102, 116, + 32, 40, 82, 41, 32, 72, 76, 83, + 76, 32, 83, 104, 97, 100, 101, 114, + 32, 67, 111, 109, 112, 105, 108, 101, +114, 32, 54, 46, 51, 46, 57, 54, + 48, 48, 46, 49, 54, 51, 56, 52, + 0, 171, 171, 73, 83, 71, 78, 8, + 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 79, 83, 71, 78, 116, + 0, 0, 0, 4, 0, 0, 0, 8, + 0, 0, 0, 104, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 104, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 1, 0, 0, 0, 15, + 0, 0, 0, 104, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 2, 0, 0, 0, 15, + 0, 0, 0, 104, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 3, 0, 0, 0, 15, + 0, 0, 0, 83, 86, 95, 84, 97, +114, 103, 101, 116, 0, 171, 171, 68, + 88, 66, 67, 127, 38, 114, 44, 227, +180, 68, 44, 235, 149, 12, 244, 164, +251, 61, 185, 1, 0, 0, 0, 40, + 4, 0, 0, 6, 0, 0, 0, 56, + 0, 0, 0, 44, 1, 0, 0, 88, + 2, 0, 0, 212, 2, 0, 0, 168, + 3, 0, 0, 244, 3, 0, 0, 65, +111, 110, 57, 236, 0, 0, 0, 236, + 0, 0, 0, 0, 2, 254, 255, 184, + 0, 0, 0, 52, 0, 0, 0, 1, + 0, 36, 0, 0, 0, 48, 0, 0, + 0, 48, 0, 0, 0, 36, 0, 1, + 0, 48, 0, 0, 0, 0, 0, 4, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 2, 254, 255, 81, + 0, 0, 5, 5, 0, 15, 160, 0, + 0, 0, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, + 0, 0, 2, 5, 0, 0, 128, 0, + 0, 15, 144, 9, 0, 0, 3, 0, + 0, 1, 128, 3, 0, 228, 160, 0, + 0, 228, 144, 9, 0, 0, 3, 0, + 0, 2, 128, 4, 0, 228, 160, 0, + 0, 228, 144, 2, 0, 0, 3, 0, + 0, 1, 128, 0, 0, 85, 128, 0, + 0, 0, 128, 5, 0, 0, 3, 0, + 0, 4, 192, 0, 0, 0, 128, 5, + 0, 0, 160, 9, 0, 0, 3, 0, + 0, 1, 128, 2, 0, 228, 160, 0, + 0, 228, 144, 1, 0, 0, 2, 1, + 0, 2, 128, 0, 0, 0, 129, 9, + 0, 0, 3, 1, 0, 1, 128, 1, + 0, 228, 160, 0, 0, 228, 144, 4, + 0, 0, 4, 0, 0, 3, 192, 0, + 0, 85, 128, 0, 0, 228, 160, 1, + 0, 228, 128, 1, 0, 0, 2, 0, + 0, 8, 192, 0, 0, 85, 128, 255, +255, 0, 0, 83, 72, 68, 82, 36, + 1, 0, 0, 64, 0, 1, 0, 73, + 0, 0, 0, 89, 0, 0, 4, 70, +142, 32, 0, 0, 0, 0, 0, 4, + 0, 0, 0, 95, 0, 0, 3, 242, + 16, 16, 0, 0, 0, 0, 0, 103, + 0, 0, 4, 242, 32, 16, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 104, + 0, 0, 2, 1, 0, 0, 0, 17, + 0, 0, 8, 18, 0, 16, 0, 0, + 0, 0, 0, 70, 142, 32, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 70, + 30, 16, 0, 0, 0, 0, 0, 54, + 0, 0, 6, 34, 32, 16, 0, 0, + 0, 0, 0, 10, 0, 16, 128, 65, + 0, 0, 0, 0, 0, 0, 0, 17, + 0, 0, 8, 18, 0, 16, 0, 0, + 0, 0, 0, 70, 142, 32, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 70, + 30, 16, 0, 0, 0, 0, 0, 17, + 0, 0, 8, 34, 0, 16, 0, 0, + 0, 0, 0, 70, 142, 32, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 70, + 30, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 18, 0, 16, 0, 0, + 0, 0, 0, 26, 0, 16, 0, 0, + 0, 0, 0, 10, 0, 16, 0, 0, + 0, 0, 0, 54, 0, 0, 5, 130, + 32, 16, 0, 0, 0, 0, 0, 26, + 0, 16, 0, 0, 0, 0, 0, 56, + 0, 0, 7, 66, 32, 16, 0, 0, + 0, 0, 0, 10, 0, 16, 0, 0, + 0, 0, 0, 1, 64, 0, 0, 0, + 0, 0, 63, 17, 0, 0, 8, 18, + 32, 16, 0, 0, 0, 0, 0, 70, +142, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 70, 30, 16, 0, 0, + 0, 0, 0, 62, 0, 0, 1, 83, + 84, 65, 84, 116, 0, 0, 0, 9, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 82, 68, 69, 70, 204, + 0, 0, 0, 1, 0, 0, 0, 72, + 0, 0, 0, 1, 0, 0, 0, 28, + 0, 0, 0, 0, 4, 254, 255, 0, + 65, 0, 0, 152, 0, 0, 0, 60, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 36, + 71, 108, 111, 98, 97, 108, 115, 0, +171, 171, 171, 60, 0, 0, 0, 1, + 0, 0, 0, 96, 0, 0, 0, 64, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 120, 0, 0, 0, 0, + 0, 0, 0, 64, 0, 0, 0, 2, + 0, 0, 0, 136, 0, 0, 0, 0, + 0, 0, 0, 95, 67, 67, 95, 77, + 86, 80, 77, 97, 116, 114, 105, 120, + 0, 171, 171, 3, 0, 3, 0, 4, + 0, 4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 77, 105, 99, 114, 111, +115, 111, 102, 116, 32, 40, 82, 41, + 32, 72, 76, 83, 76, 32, 83, 104, + 97, 100, 101, 114, 32, 67, 111, 109, +112, 105, 108, 101, 114, 32, 54, 46, + 51, 46, 57, 54, 48, 48, 46, 49, + 54, 51, 56, 52, 0, 171, 171, 73, + 83, 71, 78, 68, 0, 0, 0, 2, + 0, 0, 0, 8, 0, 0, 0, 56, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 15, 15, 0, 0, 56, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 1, + 0, 0, 0, 3, 0, 0, 0, 84, + 69, 88, 67, 79, 79, 82, 68, 0, +171, 171, 171, 79, 83, 71, 78, 44, + 0, 0, 0, 1, 0, 0, 0, 8, + 0, 0, 0, 32, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 83, 86, 95, 80, 111, +115, 105, 116, 105, 111, 110, 0, +}; + const unsigned char s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5[] = { 166, 147, 0, 0, 142, 9, 2, 1, @@ -5929,7 +6642,7 @@ const unsigned char s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6[] = { 105, 111, 110, 0, 171, 171, 171, }; -const int s_numPrograms = 15; -const int s_programLengths[] = {2990,2528,4102,3022,2996,3358,2982,3300,3350,3025,3556,2502,2675,3746,2775}; -const unsigned char* s_programs[] = {s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873,s_13E33F532157A58EC77EDE3B3112560A89D272B2,s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE,s_53938AB67AD93ABA0DDB87F3C9889304284E011E,s_67837675F2BB48C0E926316F505FC1538228E0FA,s_78250E25D1929D4A842050738140787BE42541C6,s_7B67DD242152D35ACC079265FAD9D03DC98182DE,s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5,s_92BE325B516F887D2C928EDE20ADF428DB01C038,s_A2377A827972A5466DA8637681045D32DA8A817D,s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86,s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893,s_E2D56227712263272BD5218FEA117CD06180F81B,s_F46558C274182079784898CF4968CF431593D5E2,s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6}; -const char* s_programKeys[] = {"133478C5A874C1E6F59B418CE6C7C39F1AE0F873","13E33F532157A58EC77EDE3B3112560A89D272B2","1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE","53938AB67AD93ABA0DDB87F3C9889304284E011E","67837675F2BB48C0E926316F505FC1538228E0FA","78250E25D1929D4A842050738140787BE42541C6","7B67DD242152D35ACC079265FAD9D03DC98182DE","847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5","92BE325B516F887D2C928EDE20ADF428DB01C038","A2377A827972A5466DA8637681045D32DA8A817D","B5E27B4F3CF7236633255B28CBA530D6EE5CED86","E2C7CE1244DE9C76688EFA9463B2A130B6A08893","E2D56227712263272BD5218FEA117CD06180F81B","F46558C274182079784898CF4968CF431593D5E2","F6BA4519AF2653A53D57FB5D5508F0D8617105D6"}; +const int s_numPrograms = 17; +const int s_programLengths[] = {2990,2528,4102,3022,2996,3358,2982,3073,2559,3300,3350,3025,3556,2502,2675,3746,2775}; +const unsigned char* s_programs[] = {s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873,s_13E33F532157A58EC77EDE3B3112560A89D272B2,s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE,s_53938AB67AD93ABA0DDB87F3C9889304284E011E,s_67837675F2BB48C0E926316F505FC1538228E0FA,s_78250E25D1929D4A842050738140787BE42541C6,s_7B67DD242152D35ACC079265FAD9D03DC98182DE,s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D,s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C,s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5,s_92BE325B516F887D2C928EDE20ADF428DB01C038,s_A2377A827972A5466DA8637681045D32DA8A817D,s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86,s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893,s_E2D56227712263272BD5218FEA117CD06180F81B,s_F46558C274182079784898CF4968CF431593D5E2,s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6}; +const char* s_programKeys[] = {"133478C5A874C1E6F59B418CE6C7C39F1AE0F873","13E33F532157A58EC77EDE3B3112560A89D272B2","1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE","53938AB67AD93ABA0DDB87F3C9889304284E011E","67837675F2BB48C0E926316F505FC1538228E0FA","78250E25D1929D4A842050738140787BE42541C6","7B67DD242152D35ACC079265FAD9D03DC98182DE","7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D","7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C","847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5","92BE325B516F887D2C928EDE20ADF428DB01C038","A2377A827972A5466DA8637681045D32DA8A817D","B5E27B4F3CF7236633255B28CBA530D6EE5CED86","E2C7CE1244DE9C76688EFA9463B2A130B6A08893","E2D56227712263272BD5218FEA117CD06180F81B","F46558C274182079784898CF4968CF431593D5E2","F6BA4519AF2653A53D57FB5D5508F0D8617105D6"}; diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 9806874f03..e198cfa2c4 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -71,6 +71,9 @@ const char* GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW = "ShaderLabelDFGlow const char* GLProgram::SHADER_NAME_LABEL_NORMAL = "ShaderLabelNormal"; const char* GLProgram::SHADER_NAME_LABEL_OUTLINE = "ShaderLabelOutline"; +const char* GLProgram::SHADER_3D_POSITION = "Shader3DPosition"; +const char* GLProgram::SHADER_3D_POSITION_TEXTURE = "Shader3DPositionTexture"; + // uniform names const char* GLProgram::UNIFORM_NAME_P_MATRIX = "CC_PMatrix"; @@ -501,6 +504,10 @@ bool GLProgram::link() if(!_hasShaderCompiler) { // precompiled shader program is already linked + + //bindPredefinedVertexAttribs(); + parseVertexAttribs(); + parseUniforms(); return true; } #endif diff --git a/cocos/renderer/CCGLProgram.h b/cocos/renderer/CCGLProgram.h index 0958ed8ebb..eb20990219 100644 --- a/cocos/renderer/CCGLProgram.h +++ b/cocos/renderer/CCGLProgram.h @@ -127,6 +127,9 @@ public: static const char* SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL; static const char* SHADER_NAME_LABEL_DISTANCEFIELD_GLOW; + //3D + static const char* SHADER_3D_POSITION; + static const char* SHADER_3D_POSITION_TEXTURE; // uniform names static const char* UNIFORM_NAME_P_MATRIX; diff --git a/cocos/renderer/CCGLProgramCache.cpp b/cocos/renderer/CCGLProgramCache.cpp index c2ce9c9dbf..a47e3a5842 100644 --- a/cocos/renderer/CCGLProgramCache.cpp +++ b/cocos/renderer/CCGLProgramCache.cpp @@ -49,6 +49,8 @@ enum { kShaderType_LabelDistanceFieldGlow, kShaderType_LabelNormal, kShaderType_LabelOutline, + kShaderType_3DPosition, + kShaderType_3DPositionTex, kShaderType_MAX, }; @@ -189,6 +191,15 @@ void GLProgramCache::loadDefaultGLPrograms() p = new GLProgram(); loadDefaultGLProgram(p, kShaderType_LabelOutline); _programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_OUTLINE, p) ); + + p = new GLProgram(); + loadDefaultGLProgram(p, kShaderType_3DPosition); + _programs.insert( std::make_pair(GLProgram::SHADER_3D_POSITION, p) ); + + p = new GLProgram(); + loadDefaultGLProgram(p, kShaderType_3DPositionTex); + _programs.insert( std::make_pair(GLProgram::SHADER_3D_POSITION_TEXTURE, p) ); + } void GLProgramCache::reloadDefaultGLPrograms() @@ -277,6 +288,15 @@ void GLProgramCache::reloadDefaultGLPrograms() p = getGLProgram(GLProgram::SHADER_NAME_LABEL_OUTLINE); p->reset(); loadDefaultGLProgram(p, kShaderType_LabelOutline); + + p = getGLProgram(GLProgram::SHADER_3D_POSITION); + p->reset(); + loadDefaultGLProgram(p, kShaderType_3DPosition); + + p = getGLProgram(GLProgram::SHADER_3D_POSITION_TEXTURE); + p->reset(); + loadDefaultGLProgram(p, kShaderType_3DPositionTex); + } void GLProgramCache::loadDefaultGLProgram(GLProgram *p, int type) @@ -330,6 +350,12 @@ void GLProgramCache::loadDefaultGLProgram(GLProgram *p, int type) case kShaderType_LabelOutline: p->initWithByteArrays(ccLabel_vert, ccLabelOutline_frag); break; + case kShaderType_3DPosition: + p->initWithByteArrays(cc3D_PositionTex_vert, cc3D_Color_frag); + break; + case kShaderType_3DPositionTex: + p->initWithByteArrays(cc3D_PositionTex_vert, cc3D_ColorTex_frag); + break; default: CCLOG("cocos2d: %s:%d, error shader type", __FUNCTION__, __LINE__); return; diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp new file mode 100644 index 0000000000..974fecfcc0 --- /dev/null +++ b/cocos/renderer/CCMeshCommand.cpp @@ -0,0 +1,164 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "base/ccMacros.h" +#include "base/CCDirector.h" +#include "renderer/CCMeshCommand.h" +#include "renderer/ccGLStateCache.h" +#include "renderer/CCGLProgramState.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCTextureAtlas.h" +#include "renderer/CCTexture2D.h" + +NS_CC_BEGIN + +MeshCommand::MeshCommand() +: _textureID(0) +, _blendType(BlendFunc::DISABLE) +, _glProgramState(nullptr) +, _cullFaceEnabled(false) +, _cullFace(GL_BACK) +, _depthTestEnabled(false) +, _depthWriteEnabled(false) +, _displayColor(1.0f, 1.0f, 1.0f, 1.0f) +{ + _type = RenderCommand::Type::MESH_COMMAND; +} + +void MeshCommand::init(float globalOrder, + GLuint textureID, + GLProgramState* glProgramState, + BlendFunc blendType, + GLuint vertexBuffer, + GLuint indexBuffer, + GLenum primitive, + GLenum indexFormat, + ssize_t indexCount, + const Mat4 &mv) +{ + CCASSERT(glProgramState, "GLProgramState cannot be nill"); + + _globalOrder = globalOrder; + _textureID = textureID; + _blendType = blendType; + _glProgramState = glProgramState; + + _vertexBuffer = vertexBuffer; + _indexBuffer = indexBuffer; + _primitive = primitive; + _indexFormat = indexFormat; + _indexCount = indexCount; + _mv = mv; +} + +void MeshCommand::setCullFaceEnabled(bool enable) +{ + _cullFaceEnabled = enable; +} + +void MeshCommand::setCullFace(GLenum cullFace) +{ + _cullFace = cullFace; +} + +void MeshCommand::setDepthTestEnabled(bool enable) +{ + _depthTestEnabled = enable; +} + +void MeshCommand::setDepthWriteEnabled(bool enable) +{ + _depthWriteEnabled = enable; +} + +void MeshCommand::setDisplayColor(const Vec4& color) +{ + _displayColor = color; +} + +MeshCommand::~MeshCommand() +{ +} + +void MeshCommand::applyRenderState() +{ + if (_cullFaceEnabled) + { + glEnable(GL_CULL_FACE); + glCullFace(_cullFace); + } + if (_depthTestEnabled) + { + glEnable(GL_DEPTH_TEST); + } + if (_depthWriteEnabled) + { + glDepthMask(GL_TRUE); + } +} + +void MeshCommand::restoreRenderState() +{ + if (_cullFaceEnabled) + { + glDisable(GL_CULL_FACE); + } + if (_depthTestEnabled) + { + glDisable(GL_DEPTH_TEST); + } + if (_depthWriteEnabled) + { + glDepthMask(GL_FALSE); + } +} + +void MeshCommand::execute() +{ + // set render state + applyRenderState(); + + // Set material + GL::bindTexture2D(_textureID); + GL::blendFunc(_blendType.src, _blendType.dst); + + glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); + _glProgramState->setUniformVec4("u_color", _displayColor); + _glProgramState->apply(_mv); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); + + // Draw + glDrawElements(_primitive, (GLsizei)_indexCount, _indexFormat, 0); + + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _indexCount); + + //restore render state + restoreRenderState(); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); +} + +NS_CC_END \ No newline at end of file diff --git a/cocos/renderer/CCMeshCommand.h b/cocos/renderer/CCMeshCommand.h new file mode 100644 index 0000000000..b99793f40c --- /dev/null +++ b/cocos/renderer/CCMeshCommand.h @@ -0,0 +1,91 @@ +/**************************************************************************** + 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_MESHCOMMAND_H_ +#define _CC_MESHCOMMAND_H_ + +#include "CCRenderCommand.h" +#include "renderer/CCGLProgram.h" +#include "math/CCMath.h" +#include "CCRenderCommandPool.h" + +NS_CC_BEGIN + +class GLProgramState; + +//it is a common mesh +class MeshCommand : public RenderCommand +{ +public: + + MeshCommand(); + ~MeshCommand(); + + void init(float globalOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, GLuint vertexBuffer, GLuint indexBuffer, GLenum primitive, GLenum indexType, ssize_t indexCount, const Mat4 &mv); + + void setCullFaceEnabled(bool enable); + + void setCullFace(GLenum cullFace); + + void setDepthTestEnabled(bool enable); + + void setDepthWriteEnabled(bool enable); + + void setDisplayColor(const Vec4& color); + + void execute(); + +protected: + // apply renderstate + void applyRenderState(); + + //restore to all false + void restoreRenderState(); + + GLuint _textureID; + GLProgramState* _glProgramState; + BlendFunc _blendType; + + GLuint _textrueID; + + Vec4 _displayColor; // in order to support tint and fade in fade out + + GLuint _vertexBuffer; + GLuint _indexBuffer; + GLenum _primitive; + GLenum _indexFormat; + ssize_t _indexCount; + + // States, default value all false + bool _cullFaceEnabled; + GLenum _cullFace; + bool _depthTestEnabled; + bool _depthWriteEnabled; + + // ModelView transform + Mat4 _mv; +}; +NS_CC_END + +#endif //_CC_MESHCOMMAND_H_ diff --git a/cocos/renderer/CCRenderCommand.h b/cocos/renderer/CCRenderCommand.h index 2caf58e2a0..01611aea7b 100644 --- a/cocos/renderer/CCRenderCommand.h +++ b/cocos/renderer/CCRenderCommand.h @@ -48,6 +48,7 @@ public: CUSTOM_COMMAND, BATCH_COMMAND, GROUP_COMMAND, + MESH_COMMAND, }; /** Get Render Command Id */ diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index f090b2e941..222118da6f 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -32,6 +32,7 @@ #include "renderer/CCGroupCommand.h" #include "renderer/CCGLProgramCache.h" #include "renderer/ccGLStateCache.h" +#include "renderer/CCMeshCommand.h" #include "base/CCConfiguration.h" #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" @@ -318,6 +319,12 @@ void Renderer::visitRenderQueue(const RenderQueue& queue) auto cmd = static_cast(command); cmd->execute(); } + else if (RenderCommand::Type::MESH_COMMAND == commandType) + { + flush(); + auto cmd = static_cast(command); + cmd->execute(); + } else { CCLOGERROR("Unknown commands in renderQueue"); diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 87ebe6195d..99f7dc4624 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -268,7 +268,11 @@ void TextureCache::addImageAsyncCallBack(float dt) texture = it->second; } - asyncStruct->callback(texture); + if (asyncStruct->callback) + { + asyncStruct->callback(texture); + } + if(image) { image->release(); diff --git a/cocos/renderer/CMakeLists.txt b/cocos/renderer/CMakeLists.txt index 42a78f3c23..b86e1aed6c 100644 --- a/cocos/renderer/CMakeLists.txt +++ b/cocos/renderer/CMakeLists.txt @@ -1,6 +1,7 @@ set(COCOS_RENDERER_SRC renderer/CCBatchCommand.cpp renderer/CCCustomCommand.cpp + renderer/CCMeshCommand.cpp renderer/CCGLProgramCache.cpp renderer/CCGLProgram.cpp renderer/CCGLProgramStateCache.cpp diff --git a/cocos/renderer/ccShader_3D_Color.frag b/cocos/renderer/ccShader_3D_Color.frag new file mode 100644 index 0000000000..d5f5913f97 --- /dev/null +++ b/cocos/renderer/ccShader_3D_Color.frag @@ -0,0 +1,15 @@ + +const char* cc3D_Color_frag = STRINGIFY( + +\n#ifdef GL_ES\n +varying lowp vec4 DestinationColor; +\n#else\n +varying vec4 DestinationColor; +\n#endif\n +uniform vec4 u_color; + +void main(void) +{ + gl_FragColor = u_color; +} +); diff --git a/cocos/renderer/ccShader_3D_ColorTex.frag b/cocos/renderer/ccShader_3D_ColorTex.frag new file mode 100644 index 0000000000..d7465c9013 --- /dev/null +++ b/cocos/renderer/ccShader_3D_ColorTex.frag @@ -0,0 +1,15 @@ + +const char* cc3D_ColorTex_frag = STRINGIFY( + +\n#ifdef GL_ES\n +varying mediump vec2 TextureCoordOut; +\n#else\n +varying vec2 TextureCoordOut; +\n#endif\n +uniform vec4 u_color; + +void main(void) +{ + gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color; +} +); diff --git a/cocos/renderer/ccShader_3D_PositionTex.vert b/cocos/renderer/ccShader_3D_PositionTex.vert new file mode 100644 index 0000000000..0cc61a9643 --- /dev/null +++ b/cocos/renderer/ccShader_3D_PositionTex.vert @@ -0,0 +1,15 @@ + +const char* cc3D_PositionTex_vert = STRINGIFY( + +attribute vec4 a_position; +attribute vec2 a_texCoord; + +varying vec2 TextureCoordOut; + +void main(void) +{ + gl_Position = CC_MVPMatrix * a_position; + TextureCoordOut = a_texCoord; + TextureCoordOut.y = 1.0 - TextureCoordOut.y; +} +); diff --git a/cocos/renderer/ccShaders.cpp b/cocos/renderer/ccShaders.cpp index 4f825e9c75..8da8ba88c6 100644 --- a/cocos/renderer/ccShaders.cpp +++ b/cocos/renderer/ccShaders.cpp @@ -70,4 +70,9 @@ NS_CC_BEGIN #include "ccShader_Label_normal.frag" #include "ccShader_Label_outline.frag" +// +#include "ccShader_3D_PositionTex.vert" +#include "ccShader_3D_Color.frag" +#include "ccShader_3D_ColorTex.frag" + NS_CC_END diff --git a/cocos/renderer/ccShaders.h b/cocos/renderer/ccShaders.h index 77784deba4..4c9c832b9d 100644 --- a/cocos/renderer/ccShaders.h +++ b/cocos/renderer/ccShaders.h @@ -69,6 +69,9 @@ extern CC_DLL const GLchar * ccLabelOutline_frag; extern CC_DLL const GLchar * ccLabel_vert; +extern CC_DLL const GLchar * cc3D_PositionTex_vert; +extern CC_DLL const GLchar * cc3D_ColorTex_frag; +extern CC_DLL const GLchar * cc3D_Color_frag; // end of shaders group /// @} diff --git a/cocos/scripting/lua-bindings/auto/api/ControlButton.lua b/cocos/scripting/lua-bindings/auto/api/ControlButton.lua index a8ac2f0373..df6d07b9ee 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlButton.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlButton.lua @@ -250,11 +250,6 @@ -- @param self -- @param #color3b_table color3b --------------------------------- --- @function [parent=#ControlButton] getColor --- @param self --- @return color3b_table#color3b_table ret (return value: color3b_table) - -------------------------------- -- @function [parent=#ControlButton] onTouchCancelled -- @param self @@ -267,9 +262,14 @@ -- @param #unsigned char char -------------------------------- --- @function [parent=#ControlButton] getOpacity +-- @function [parent=#ControlButton] updateDisplayedOpacity -- @param self --- @return unsigned char#unsigned char ret (return value: unsigned char) +-- @param #unsigned char char + +-------------------------------- +-- @function [parent=#ControlButton] updateDisplayedColor +-- @param self +-- @param #color3b_table color3b -------------------------------- -- @function [parent=#ControlButton] onTouchBegan diff --git a/cocos/scripting/lua-bindings/auto/api/FileUtils.lua b/cocos/scripting/lua-bindings/auto/api/FileUtils.lua index 87586f26bf..f4af944969 100644 --- a/cocos/scripting/lua-bindings/auto/api/FileUtils.lua +++ b/cocos/scripting/lua-bindings/auto/api/FileUtils.lua @@ -41,6 +41,11 @@ -- @param #string str -- @return array_table#array_table ret (return value: array_table) +-------------------------------- +-- @function [parent=#FileUtils] getSearchPaths +-- @param self +-- @return array_table#array_table ret (return value: array_table) + -------------------------------- -- @function [parent=#FileUtils] writeToFile -- @param self @@ -54,6 +59,16 @@ -- @param #string str -- @return map_table#map_table ret (return value: map_table) +-------------------------------- +-- @function [parent=#FileUtils] setSearchPaths +-- @param self +-- @param #array_table array + +-------------------------------- +-- @function [parent=#FileUtils] setSearchResolutionsOrder +-- @param self +-- @param #array_table array + -------------------------------- -- @function [parent=#FileUtils] addSearchResolutionsOrder -- @param self @@ -86,6 +101,11 @@ -- @param self -- @param #bool bool +-------------------------------- +-- @function [parent=#FileUtils] getSearchResolutionsOrder +-- @param self +-- @return array_table#array_table ret (return value: array_table) + -------------------------------- -- @function [parent=#FileUtils] getWritablePath -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/GLProgramCache.lua b/cocos/scripting/lua-bindings/auto/api/GLProgramCache.lua new file mode 100644 index 0000000000..1f6f66d157 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/GLProgramCache.lua @@ -0,0 +1,39 @@ + +-------------------------------- +-- @module GLProgramCache +-- @extend Ref + +-------------------------------- +-- @function [parent=#GLProgramCache] addGLProgram +-- @param self +-- @param #cc.GLProgram glprogram +-- @param #string str + +-------------------------------- +-- @function [parent=#GLProgramCache] getGLProgram +-- @param self +-- @param #string str +-- @return GLProgram#GLProgram ret (return value: cc.GLProgram) + +-------------------------------- +-- @function [parent=#GLProgramCache] reloadDefaultGLPrograms +-- @param self + +-------------------------------- +-- @function [parent=#GLProgramCache] loadDefaultGLPrograms +-- @param self + +-------------------------------- +-- @function [parent=#GLProgramCache] destroyInstance +-- @param self + +-------------------------------- +-- @function [parent=#GLProgramCache] getInstance +-- @param self +-- @return GLProgramCache#GLProgramCache ret (return value: cc.GLProgramCache) + +-------------------------------- +-- @function [parent=#GLProgramCache] GLProgramCache +-- @param self + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua b/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua new file mode 100644 index 0000000000..c47765057e --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua @@ -0,0 +1,100 @@ + +-------------------------------- +-- @module GLProgramState +-- @extend Ref + +-------------------------------- +-- overload function: setUniformTexture(string, unsigned int) +-- +-- overload function: setUniformTexture(string, cc.Texture2D) +-- +-- @function [parent=#GLProgramState] setUniformTexture +-- @param self +-- @param #string str +-- @param #cc.Texture2D texture2d + +-------------------------------- +-- @function [parent=#GLProgramState] setUniformMat4 +-- @param self +-- @param #string str +-- @param #cc.Mat4 mat4 + +-------------------------------- +-- @function [parent=#GLProgramState] getUniformCount +-- @param self +-- @return long#long ret (return value: long) + +-------------------------------- +-- @function [parent=#GLProgramState] setUniformFloat +-- @param self +-- @param #string str +-- @param #float float + +-------------------------------- +-- @function [parent=#GLProgramState] setUniformVec3 +-- @param self +-- @param #string str +-- @param #cc.Vec3 vec3 + +-------------------------------- +-- @function [parent=#GLProgramState] setGLProgram +-- @param self +-- @param #cc.GLProgram glprogram + +-------------------------------- +-- @function [parent=#GLProgramState] setUniformVec4 +-- @param self +-- @param #string str +-- @param #cc.Vec4 vec4 + +-------------------------------- +-- @function [parent=#GLProgramState] getVertexAttribCount +-- @param self +-- @return long#long ret (return value: long) + +-------------------------------- +-- @function [parent=#GLProgramState] setUniformInt +-- @param self +-- @param #string str +-- @param #int int + +-------------------------------- +-- @function [parent=#GLProgramState] setUniformVec2 +-- @param self +-- @param #string str +-- @param #cc.Vec2 vec2 + +-------------------------------- +-- @function [parent=#GLProgramState] getVertexAttribsFlags +-- @param self +-- @return unsigned int#unsigned int ret (return value: unsigned int) + +-------------------------------- +-- @function [parent=#GLProgramState] apply +-- @param self +-- @param #cc.Mat4 mat4 + +-------------------------------- +-- @function [parent=#GLProgramState] getGLProgram +-- @param self +-- @return GLProgram#GLProgram ret (return value: cc.GLProgram) + +-------------------------------- +-- @function [parent=#GLProgramState] create +-- @param self +-- @param #cc.GLProgram glprogram +-- @return GLProgramState#GLProgramState ret (return value: cc.GLProgramState) + +-------------------------------- +-- @function [parent=#GLProgramState] getOrCreateWithGLProgramName +-- @param self +-- @param #string str +-- @return GLProgramState#GLProgramState ret (return value: cc.GLProgramState) + +-------------------------------- +-- @function [parent=#GLProgramState] getOrCreateWithGLProgram +-- @param self +-- @param #cc.GLProgram glprogram +-- @return GLProgramState#GLProgramState ret (return value: cc.GLProgramState) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/Mesh.lua b/cocos/scripting/lua-bindings/auto/api/Mesh.lua new file mode 100644 index 0000000000..5d2de87cff --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/Mesh.lua @@ -0,0 +1,66 @@ + +-------------------------------- +-- @module Mesh +-- @extend Ref + +-------------------------------- +-- @function [parent=#Mesh] restore +-- @param self + +-------------------------------- +-- @function [parent=#Mesh] getMeshVertexAttribCount +-- @param self +-- @return long#long ret (return value: long) + +-------------------------------- +-- @function [parent=#Mesh] getIndexFormat +-- @param self +-- @return Mesh::IndexFormat#Mesh::IndexFormat ret (return value: cc.Mesh::IndexFormat) + +-------------------------------- +-- @function [parent=#Mesh] getVertexSizeInBytes +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#Mesh] getPrimitiveType +-- @param self +-- @return Mesh::PrimitiveType#Mesh::PrimitiveType ret (return value: cc.Mesh::PrimitiveType) + +-------------------------------- +-- @function [parent=#Mesh] getIndexCount +-- @param self +-- @return long#long ret (return value: long) + +-------------------------------- +-- @function [parent=#Mesh] getVertexBuffer +-- @param self +-- @return unsigned int#unsigned int ret (return value: unsigned int) + +-------------------------------- +-- @function [parent=#Mesh] getMeshVertexAttribute +-- @param self +-- @param #int int +-- @return MeshVertexAttrib#MeshVertexAttrib ret (return value: cc.MeshVertexAttrib) + +-------------------------------- +-- @function [parent=#Mesh] getIndexBuffer +-- @param self +-- @return unsigned int#unsigned int ret (return value: unsigned int) + +-------------------------------- +-- @function [parent=#Mesh] hasVertexAttrib +-- @param self +-- @param #int int +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- @function [parent=#Mesh] create +-- @param self +-- @param #array_table array +-- @param #array_table array +-- @param #array_table array +-- @param #array_table vector > +-- @return Mesh#Mesh ret (return value: cc.Mesh) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua b/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua new file mode 100644 index 0000000000..5031415719 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/Sprite3D.lua @@ -0,0 +1,41 @@ + +-------------------------------- +-- @module Sprite3D +-- @extend Node,BlendProtocol + +-------------------------------- +-- overload function: setTexture(cc.Texture2D) +-- +-- overload function: setTexture(string) +-- +-- @function [parent=#Sprite3D] setTexture +-- @param self +-- @param #string str + +-------------------------------- +-- @function [parent=#Sprite3D] getMesh +-- @param self +-- @return Mesh#Mesh ret (return value: cc.Mesh) + +-------------------------------- +-- @function [parent=#Sprite3D] getBlendFunc +-- @param self +-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc) + +-------------------------------- +-- @function [parent=#Sprite3D] setBlendFunc +-- @param self +-- @param #cc.BlendFunc blendfunc + +-------------------------------- +-- overload function: create(string, string) +-- +-- overload function: create(string) +-- +-- @function [parent=#Sprite3D] create +-- @param self +-- @param #string str +-- @param #string str +-- @return Sprite3D#Sprite3D ret (retunr value: cc.Sprite3D) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index 19f899b61e..002779db85 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -51,6 +51,11 @@ -- @field [parent=#cc] Node#Node Node preloaded module +-------------------------------------------------------- +-- the cc GLProgramState +-- @field [parent=#cc] GLProgramState#GLProgramState GLProgramState preloaded module + + -------------------------------------------------------- -- the cc AtlasNode -- @field [parent=#cc] AtlasNode#AtlasNode AtlasNode preloaded module @@ -1126,6 +1131,11 @@ -- @field [parent=#cc] TiledGrid3D#TiledGrid3D TiledGrid3D preloaded module +-------------------------------------------------------- +-- the cc GLProgramCache +-- @field [parent=#cc] GLProgramCache#GLProgramCache GLProgramCache preloaded module + + -------------------------------------------------------- -- the cc TextureCache -- @field [parent=#cc] TextureCache#TextureCache TextureCache preloaded module @@ -1201,6 +1211,16 @@ -- @field [parent=#cc] Component#Component Component preloaded module +-------------------------------------------------------- +-- the cc Sprite3D +-- @field [parent=#cc] Sprite3D#Sprite3D Sprite3D preloaded module + + +-------------------------------------------------------- +-- the cc Mesh +-- @field [parent=#cc] Mesh#Mesh Mesh preloaded module + + -------------------------------------------------------- -- the cc SimpleAudioEngine -- @field [parent=#cc] SimpleAudioEngine#SimpleAudioEngine SimpleAudioEngine preloaded module diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index c3ea830b28..5415f2504e 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -9382,6 +9382,763 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) return 1; } +int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + if (!ok) { break; } + unsigned int arg1; + ok &= luaval_to_uint32(tolua_S, 3,&arg1); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + if (!ok) { break; } + cocos2d::Texture2D* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformTexture",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformMat4(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformMat4'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + cocos2d::Mat4 arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_mat4(tolua_S, 3, &arg1); + if(!ok) + return 0; + cobj->setUniformMat4(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformMat4",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformMat4'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getUniformCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getUniformCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getUniformCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getUniformCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getUniformCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformFloat(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloat'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + double arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_number(tolua_S, 3,&arg1); + if(!ok) + return 0; + cobj->setUniformFloat(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformFloat",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloat'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec3(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + cocos2d::Vec3 arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_vec3(tolua_S, 3, &arg1); + if(!ok) + return 0; + cobj->setUniformVec3(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformVec3",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::GLProgram* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + if(!ok) + return 0; + cobj->setGLProgram(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setGLProgram",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec4(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + cocos2d::Vec4 arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_vec4(tolua_S, 3, &arg1); + if(!ok) + return 0; + cobj->setUniformVec4(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformVec4",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getVertexAttribCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getVertexAttribCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVertexAttribCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformInt'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + int arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1); + if(!ok) + return 0; + cobj->setUniformInt(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformInt",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformInt'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec2(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + cocos2d::Vec2 arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_vec2(tolua_S, 3, &arg1); + if(!ok) + return 0; + cobj->setUniformVec2(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setUniformVec2",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getVertexAttribsFlags(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + unsigned int ret = cobj->getVertexAttribsFlags(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVertexAttribsFlags",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_apply(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Mat4 arg0; + + ok &= luaval_to_mat4(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->apply(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "apply",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_apply'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::GLProgram* ret = cobj->getGLProgram(); + object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGLProgram",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::GLProgram* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + if(!ok) + return 0; + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_create'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getOrCreateWithGLProgramName",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::GLProgram* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + if(!ok) + return 0; + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getOrCreateWithGLProgram",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_GLProgramState_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (GLProgramState)"); + return 0; +} + +int lua_register_cocos2dx_GLProgramState(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.GLProgramState"); + tolua_cclass(tolua_S,"GLProgramState","cc.GLProgramState","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GLProgramState"); + tolua_function(tolua_S,"setUniformTexture",lua_cocos2dx_GLProgramState_setUniformTexture); + tolua_function(tolua_S,"setUniformMat4",lua_cocos2dx_GLProgramState_setUniformMat4); + tolua_function(tolua_S,"getUniformCount",lua_cocos2dx_GLProgramState_getUniformCount); + tolua_function(tolua_S,"setUniformFloat",lua_cocos2dx_GLProgramState_setUniformFloat); + tolua_function(tolua_S,"setUniformVec3",lua_cocos2dx_GLProgramState_setUniformVec3); + tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_GLProgramState_setGLProgram); + tolua_function(tolua_S,"setUniformVec4",lua_cocos2dx_GLProgramState_setUniformVec4); + tolua_function(tolua_S,"getVertexAttribCount",lua_cocos2dx_GLProgramState_getVertexAttribCount); + tolua_function(tolua_S,"setUniformInt",lua_cocos2dx_GLProgramState_setUniformInt); + tolua_function(tolua_S,"setUniformVec2",lua_cocos2dx_GLProgramState_setUniformVec2); + tolua_function(tolua_S,"getVertexAttribsFlags",lua_cocos2dx_GLProgramState_getVertexAttribsFlags); + tolua_function(tolua_S,"apply",lua_cocos2dx_GLProgramState_apply); + tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_GLProgramState_getGLProgram); + tolua_function(tolua_S,"create", lua_cocos2dx_GLProgramState_create); + tolua_function(tolua_S,"getOrCreateWithGLProgramName", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName); + tolua_function(tolua_S,"getOrCreateWithGLProgram", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::GLProgramState).name(); + g_luaType[typeName] = "cc.GLProgramState"; + g_typeCast["GLProgramState"] = "cc.GLProgramState"; + return 1; +} + int lua_cocos2dx_AtlasNode_updateAtlasValues(lua_State* tolua_S) { int argc = 0; @@ -13655,6 +14412,50 @@ int lua_cocos2dx_FileUtils_getValueVectorFromFile(lua_State* tolua_S) return 0; } +int lua_cocos2dx_FileUtils_getSearchPaths(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FileUtils* 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.FileUtils",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getSearchPaths'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::vector& ret = cobj->getSearchPaths(); + ccvector_std_string_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSearchPaths",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_getSearchPaths'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_FileUtils_writeToFile(lua_State* tolua_S) { int argc = 0; @@ -13752,6 +14553,98 @@ int lua_cocos2dx_FileUtils_getValueMapFromFile(lua_State* tolua_S) return 0; } +int lua_cocos2dx_FileUtils_setSearchPaths(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FileUtils* 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.FileUtils",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_setSearchPaths'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::vector arg0; + + ok &= luaval_to_std_vector_string(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setSearchPaths(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSearchPaths",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_setSearchPaths'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FileUtils_setSearchResolutionsOrder(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FileUtils* 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.FileUtils",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_setSearchResolutionsOrder'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::vector arg0; + + ok &= luaval_to_std_vector_string(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setSearchResolutionsOrder(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSearchResolutionsOrder",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_setSearchResolutionsOrder'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_FileUtils_addSearchResolutionsOrder(lua_State* tolua_S) { int argc = 0; @@ -14030,6 +14923,50 @@ int lua_cocos2dx_FileUtils_setPopupNotify(lua_State* tolua_S) return 0; } +int lua_cocos2dx_FileUtils_getSearchResolutionsOrder(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FileUtils* 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.FileUtils",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getSearchResolutionsOrder'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::vector& ret = cobj->getSearchResolutionsOrder(); + ccvector_std_string_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSearchResolutionsOrder",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_getSearchResolutionsOrder'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_FileUtils_getWritablePath(lua_State* tolua_S) { int argc = 0; @@ -14154,14 +15091,18 @@ int lua_register_cocos2dx_FileUtils(lua_State* tolua_S) tolua_function(tolua_S,"loadFilenameLookup",lua_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile); tolua_function(tolua_S,"isPopupNotify",lua_cocos2dx_FileUtils_isPopupNotify); tolua_function(tolua_S,"getValueVectorFromFile",lua_cocos2dx_FileUtils_getValueVectorFromFile); + tolua_function(tolua_S,"getSearchPaths",lua_cocos2dx_FileUtils_getSearchPaths); tolua_function(tolua_S,"writeToFile",lua_cocos2dx_FileUtils_writeToFile); tolua_function(tolua_S,"getValueMapFromFile",lua_cocos2dx_FileUtils_getValueMapFromFile); + tolua_function(tolua_S,"setSearchPaths",lua_cocos2dx_FileUtils_setSearchPaths); + tolua_function(tolua_S,"setSearchResolutionsOrder",lua_cocos2dx_FileUtils_setSearchResolutionsOrder); tolua_function(tolua_S,"addSearchResolutionsOrder",lua_cocos2dx_FileUtils_addSearchResolutionsOrder); tolua_function(tolua_S,"addSearchPath",lua_cocos2dx_FileUtils_addSearchPath); tolua_function(tolua_S,"isFileExist",lua_cocos2dx_FileUtils_isFileExist); tolua_function(tolua_S,"purgeCachedEntries",lua_cocos2dx_FileUtils_purgeCachedEntries); tolua_function(tolua_S,"fullPathFromRelativeFile",lua_cocos2dx_FileUtils_fullPathFromRelativeFile); tolua_function(tolua_S,"setPopupNotify",lua_cocos2dx_FileUtils_setPopupNotify); + tolua_function(tolua_S,"getSearchResolutionsOrder",lua_cocos2dx_FileUtils_getSearchResolutionsOrder); tolua_function(tolua_S,"getWritablePath",lua_cocos2dx_FileUtils_getWritablePath); tolua_function(tolua_S,"destroyInstance", lua_cocos2dx_FileUtils_destroyInstance); tolua_function(tolua_S,"getInstance", lua_cocos2dx_FileUtils_getInstance); @@ -55413,6 +56354,309 @@ int lua_register_cocos2dx_TiledGrid3D(lua_State* tolua_S) return 1; } +int lua_cocos2dx_GLProgramCache_addGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramCache* 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.GLProgramCache",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramCache*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramCache_addGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + cocos2d::GLProgram* arg0; + std::string arg1; + + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1); + if(!ok) + return 0; + cobj->addGLProgram(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "addGLProgram",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_addGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramCache_getGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramCache* 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.GLProgramCache",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramCache*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramCache_getGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::GLProgram* ret = cobj->getGLProgram(arg0); + object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGLProgram",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_getGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramCache_reloadDefaultGLPrograms(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramCache* 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.GLProgramCache",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramCache*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramCache_reloadDefaultGLPrograms'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->reloadDefaultGLPrograms(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "reloadDefaultGLPrograms",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_reloadDefaultGLPrograms'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramCache_loadDefaultGLPrograms(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramCache* 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.GLProgramCache",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramCache*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramCache_loadDefaultGLPrograms'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->loadDefaultGLPrograms(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "loadDefaultGLPrograms",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_loadDefaultGLPrograms'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramCache_destroyInstance(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramCache",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::GLProgramCache::destroyInstance(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "destroyInstance",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_destroyInstance'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramCache_getInstance(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramCache",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::GLProgramCache* ret = cocos2d::GLProgramCache::getInstance(); + object_to_luaval(tolua_S, "cc.GLProgramCache",(cocos2d::GLProgramCache*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getInstance",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_getInstance'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramCache_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramCache* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj = new cocos2d::GLProgramCache(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.GLProgramCache"); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "GLProgramCache",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramCache_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_GLProgramCache_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (GLProgramCache)"); + return 0; +} + +int lua_register_cocos2dx_GLProgramCache(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.GLProgramCache"); + tolua_cclass(tolua_S,"GLProgramCache","cc.GLProgramCache","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GLProgramCache"); + tolua_function(tolua_S,"addGLProgram",lua_cocos2dx_GLProgramCache_addGLProgram); + tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_GLProgramCache_getGLProgram); + tolua_function(tolua_S,"reloadDefaultGLPrograms",lua_cocos2dx_GLProgramCache_reloadDefaultGLPrograms); + tolua_function(tolua_S,"loadDefaultGLPrograms",lua_cocos2dx_GLProgramCache_loadDefaultGLPrograms); + tolua_function(tolua_S,"new",lua_cocos2dx_GLProgramCache_constructor); + tolua_function(tolua_S,"destroyInstance", lua_cocos2dx_GLProgramCache_destroyInstance); + tolua_function(tolua_S,"getInstance", lua_cocos2dx_GLProgramCache_getInstance); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::GLProgramCache).name(); + g_luaType[typeName] = "cc.GLProgramCache"; + g_typeCast["GLProgramCache"] = "cc.GLProgramCache"; + return 1; +} + int lua_cocos2dx_TextureCache_reloadTexture(lua_State* tolua_S) { int argc = 0; @@ -63487,6 +64731,782 @@ int lua_register_cocos2dx_Component(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Sprite3D_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + + if (!ok) { break; } + cobj->setTexture(arg0); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + if (!ok) { break; } + cobj->setTexture(arg0); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite3D_getMesh(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_getMesh'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Mesh* ret = cobj->getMesh(); + object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMesh",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_getMesh'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite3D_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_getBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite3D_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3D_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + #pragma warning NO CONVERSION TO NATIVE FOR BlendFunc; + if(!ok) + return 0; + cobj->setBlendFunc(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 2) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1); + if (!ok) { break; } + cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if (!ok) { break; } + cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0); + object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); + return 1; + } + } while (0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_Sprite3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Sprite3D)"); + return 0; +} + +int lua_register_cocos2dx_Sprite3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Sprite3D"); + tolua_cclass(tolua_S,"Sprite3D","cc.Sprite3D","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"Sprite3D"); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite3D_setTexture); + tolua_function(tolua_S,"getMesh",lua_cocos2dx_Sprite3D_getMesh); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite3D_getBlendFunc); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite3D_setBlendFunc); + tolua_function(tolua_S,"create", lua_cocos2dx_Sprite3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Sprite3D).name(); + g_luaType[typeName] = "cc.Sprite3D"; + g_typeCast["Sprite3D"] = "cc.Sprite3D"; + return 1; +} + +int lua_cocos2dx_Mesh_restore(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_restore'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->restore(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "restore",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_restore'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getMeshVertexAttribCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getMeshVertexAttribCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getMeshVertexAttribCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMeshVertexAttribCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getMeshVertexAttribCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getIndexFormat(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getIndexFormat'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = (int)cobj->getIndexFormat(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getIndexFormat",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getIndexFormat'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getVertexSizeInBytes(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getVertexSizeInBytes'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getVertexSizeInBytes(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVertexSizeInBytes",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getVertexSizeInBytes'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getPrimitiveType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getPrimitiveType'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = (int)cobj->getPrimitiveType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPrimitiveType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getPrimitiveType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getIndexCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getIndexCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getIndexCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getIndexCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getIndexCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getVertexBuffer(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getVertexBuffer'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + unsigned int ret = cobj->getVertexBuffer(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVertexBuffer",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getVertexBuffer'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getMeshVertexAttribute(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getMeshVertexAttribute'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + const cocos2d::MeshVertexAttrib& ret = cobj->getMeshVertexAttribute(arg0); + mesh_vertex_attrib_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMeshVertexAttribute",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getMeshVertexAttribute'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_getIndexBuffer(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_getIndexBuffer'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + unsigned int ret = cobj->getIndexBuffer(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getIndexBuffer",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_getIndexBuffer'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_hasVertexAttrib(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Mesh* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Mesh_hasVertexAttrib'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + bool ret = cobj->hasVertexAttrib(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "hasVertexAttrib",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_hasVertexAttrib'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Mesh_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 4) + { + std::vector > arg0; + std::vector > arg1; + std::vector > arg2; + std::vector > arg3; + ok &= luaval_to_std_vector_float(tolua_S, 2, &arg0); + ok &= luaval_to_std_vector_float(tolua_S, 3, &arg1); + ok &= luaval_to_std_vector_float(tolua_S, 4, &arg2); + ok &= luaval_to_std_vector_ushort(tolua_S, 5, &arg3); + if(!ok) + return 0; + cocos2d::Mesh* ret = cocos2d::Mesh::create(arg0, arg1, arg2, arg3); + object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 4); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Mesh_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_Mesh_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Mesh)"); + return 0; +} + +int lua_register_cocos2dx_Mesh(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Mesh"); + tolua_cclass(tolua_S,"Mesh","cc.Mesh","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Mesh"); + tolua_function(tolua_S,"restore",lua_cocos2dx_Mesh_restore); + tolua_function(tolua_S,"getMeshVertexAttribCount",lua_cocos2dx_Mesh_getMeshVertexAttribCount); + tolua_function(tolua_S,"getIndexFormat",lua_cocos2dx_Mesh_getIndexFormat); + tolua_function(tolua_S,"getVertexSizeInBytes",lua_cocos2dx_Mesh_getVertexSizeInBytes); + tolua_function(tolua_S,"getPrimitiveType",lua_cocos2dx_Mesh_getPrimitiveType); + tolua_function(tolua_S,"getIndexCount",lua_cocos2dx_Mesh_getIndexCount); + tolua_function(tolua_S,"getVertexBuffer",lua_cocos2dx_Mesh_getVertexBuffer); + tolua_function(tolua_S,"getMeshVertexAttribute",lua_cocos2dx_Mesh_getMeshVertexAttribute); + tolua_function(tolua_S,"getIndexBuffer",lua_cocos2dx_Mesh_getIndexBuffer); + tolua_function(tolua_S,"hasVertexAttrib",lua_cocos2dx_Mesh_hasVertexAttrib); + tolua_function(tolua_S,"create", lua_cocos2dx_Mesh_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Mesh).name(); + g_luaType[typeName] = "cc.Mesh"; + g_typeCast["Mesh"] = "cc.Mesh"; + return 1; +} + int lua_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic(lua_State* tolua_S) { int argc = 0; @@ -65217,6 +67237,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_Grid3DAction(tolua_S); lua_register_cocos2dx_FadeTo(tolua_S); lua_register_cocos2dx_FadeIn(tolua_S); + lua_register_cocos2dx_ShakyTiles3D(tolua_S); lua_register_cocos2dx_EventListenerCustom(tolua_S); lua_register_cocos2dx_FlipX3D(tolua_S); lua_register_cocos2dx_FlipY3D(tolua_S); @@ -65291,6 +67312,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_NodeGrid(tolua_S); lua_register_cocos2dx_TMXLayerInfo(tolua_S); lua_register_cocos2dx_EaseSineIn(tolua_S); + lua_register_cocos2dx_Sprite3D(tolua_S); lua_register_cocos2dx_EventListenerMouse(tolua_S); lua_register_cocos2dx_TiledGrid3D(tolua_S); lua_register_cocos2dx_ParticleGalaxy(tolua_S); @@ -65312,6 +67334,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_TransitionFadeBL(tolua_S); lua_register_cocos2dx_TargetedAction(tolua_S); lua_register_cocos2dx_DrawNode(tolua_S); + lua_register_cocos2dx_Mesh(tolua_S); lua_register_cocos2dx_TransitionTurnOffTiles(tolua_S); lua_register_cocos2dx_RotateTo(tolua_S); lua_register_cocos2dx_TransitionSplitRows(tolua_S); @@ -65334,7 +67357,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_ScaleTo(tolua_S); lua_register_cocos2dx_Spawn(tolua_S); lua_register_cocos2dx_EaseQuarticActionInOut(tolua_S); - lua_register_cocos2dx_ShakyTiles3D(tolua_S); + lua_register_cocos2dx_GLProgramState(tolua_S); lua_register_cocos2dx_PageTurn3D(tolua_S); lua_register_cocos2dx_TransitionSlideInL(tolua_S); lua_register_cocos2dx_TransitionSlideInT(tolua_S); @@ -65364,6 +67387,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_MenuItemAtlasFont(tolua_S); lua_register_cocos2dx_Liquid(tolua_S); lua_register_cocos2dx_OrbitCamera(tolua_S); + lua_register_cocos2dx_ParallaxNode(tolua_S); lua_register_cocos2dx_EventCustom(tolua_S); lua_register_cocos2dx_ParticleBatchNode(tolua_S); lua_register_cocos2dx_Component(tolua_S); @@ -65392,7 +67416,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_TransitionProgressRadialCW(tolua_S); lua_register_cocos2dx_EaseBounceInOut(tolua_S); lua_register_cocos2dx_TransitionSlideInR(tolua_S); - lua_register_cocos2dx_ParallaxNode(tolua_S); + lua_register_cocos2dx_GLProgramCache(tolua_S); lua_register_cocos2dx_EaseQuadraticActionIn(tolua_S); lua_register_cocos2dx_WavesTiles3D(tolua_S); lua_register_cocos2dx_TransitionSlideInB(tolua_S); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 682e55e5be..858c8078c8 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1543,6 +1543,53 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index ba90a32049..d443d4c78f 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -340,6 +340,48 @@ bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue) return ok; } +bool luaval_to_vec4(lua_State* L,int lo,cocos2d::Vec4* outValue) +{ + if (nullptr == L || nullptr == outValue) + return false; + + bool ok = true; + + tolua_Error tolua_err; + if (!tolua_istable(L, lo, 0, &tolua_err) ) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err); +#endif + ok = false; + } + + + if (ok) + { + lua_pushstring(L, "x"); + lua_gettable(L, lo); + outValue->x = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "y"); + lua_gettable(L, lo); + outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "z"); + lua_gettable(L, lo); + outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "w"); + lua_gettable(L, lo); + outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + } + return ok; +} + bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outValue) { if (nullptr == L || nullptr == outValue) @@ -1697,6 +1739,129 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector* ret) return ok; } +bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttrib* ret) +{ + if (nullptr == L || nullptr == ret || lua_gettop(L) < lo) + return false; + + tolua_Error tolua_err; + bool ok = true; + + if (!tolua_istable(L, lo, 0, &tolua_err)) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err); +#endif + ok = false; + } + + + if (ok) + { + lua_pushstring(L, "size"); /* L: paramStack key */ + lua_gettable(L,lo); /* L: paramStack paramStack[lo][key] */ + ret->size = (GLint)lua_tonumber(L, -1); + lua_pop(L,1); + + lua_pushstring(L, "type"); /* L: paramStack key */ + lua_gettable(L,lo); /* L: paramStack paramStack[lo][key] */ + ret->type = (GLenum)lua_tonumber(L, -1); + lua_pop(L,1); + + lua_pushstring(L, "vertexAttrib"); /* L: paramStack key */ + lua_gettable(L,lo); /* L: paramStack paramStack[lo][key] */ + ret->type = (GLenum)lua_tonumber(L, -1); + lua_pop(L,1); + + lua_pushstring(L, "vertexAttrib"); /* L: paramStack key */ + lua_gettable(L,lo); /* L: paramStack paramStack[lo][key] */ + ret->type = (GLenum)lua_tonumber(L, -1); + lua_pop(L,1); + } + + return ok; + +} + +bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector* ret) +{ + if (nullptr == L || nullptr == ret || lua_gettop(L) < lo) + return false; + + tolua_Error tolua_err; + bool ok = true; + + if (!tolua_istable(L, lo, 0, &tolua_err)) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err); +#endif + ok = false; + } + + if (ok) + { + size_t len = lua_objlen(L, lo); + for (int i = 0; i < len; i++) + { + lua_pushnumber(L, i + 1); + lua_gettable(L,lo); + if(lua_isnumber(L, -1)) + { + ret->push_back((float)tolua_tonumber(L, -1, 0)); + } + else + { + CCASSERT(false, "float type is needed"); + } + + lua_pop(L, 1); + } + } + + return ok; +} + + +bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector* ret) +{ + if (nullptr == L || nullptr == ret || lua_gettop(L) < lo) + return false; + + tolua_Error tolua_err; + bool ok = true; + + if (!tolua_istable(L, lo, 0, &tolua_err)) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err); +#endif + ok = false; + } + + if (ok) + { + size_t len = lua_objlen(L, lo); + for (int i = 0; i < len; i++) + { + lua_pushnumber(L, i + 1); + lua_gettable(L,lo); + if(lua_isnumber(L, -1)) + { + ret->push_back((unsigned short)tolua_tonumber(L, -1, 0)); + } + else + { + CCASSERT(false, "unsigned short type is needed"); + } + + lua_pop(L, 1); + } + } + + return ok; +} + void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) { if (NULL == L) @@ -1741,6 +1906,26 @@ void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3) lua_rawset(L, -3); } +void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec3) +{ + if (NULL == L) + return; + + lua_newtable(L); /* L: table */ + lua_pushstring(L, "x"); /* L: table key */ + lua_pushnumber(L, (lua_Number) vec3.x); /* L: table key value*/ + lua_rawset(L, -3); /* table[key] = value, L: table */ + lua_pushstring(L, "y"); /* L: table key */ + lua_pushnumber(L, (lua_Number) vec3.y); /* L: table key value*/ + lua_rawset(L, -3); + lua_pushstring(L, "z"); /* L: table key */ + lua_pushnumber(L, (lua_Number) vec3.z); /* L: table key value*/ + lua_rawset(L, -3); + lua_pushstring(L, "w"); /* L: table key */ + lua_pushnumber(L, (lua_Number) vec3.z); /* L: table key value*/ + lua_rawset(L, -3); +} + void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm) { if (nullptr == L) @@ -2476,3 +2661,97 @@ void ttfconfig_to_luaval(lua_State* L, const cocos2d::TTFConfig& config) lua_pushnumber(L, (lua_Number)config.outlineSize); lua_rawset(L, -3); } + +void mesh_vertex_attrib_to_luaval(lua_State* L, const cocos2d::MeshVertexAttrib& inValue) +{ + if (nullptr == L) + return; + + lua_newtable(L); + + lua_pushstring(L, "size"); + lua_pushnumber(L, (lua_Number)inValue.size); + lua_rawset(L, -3); + + lua_pushstring(L, "type"); + lua_pushnumber(L, (lua_Number)inValue.type); + lua_rawset(L, -3); + + lua_pushstring(L, "vertexAttrib"); + lua_pushnumber(L, (lua_Number)inValue.vertexAttrib); + lua_rawset(L, -3); + + lua_pushstring(L, "attribSizeBytes"); + lua_pushnumber(L, (lua_Number)inValue.attribSizeBytes); + lua_rawset(L, -3); +} + + +void ccvector_std_string_to_luaval(lua_State* L, const std::vector& inValue) +{ + if (nullptr == L) + return; + + lua_newtable(L); + + int index = 1; + + for (const std::string value : inValue) + { + lua_pushnumber(L, (lua_Number)index); + lua_pushstring(L, value.c_str()); + lua_rawset(L, -3); + ++index; + } +} + +void ccvector_int_to_luaval(lua_State* L, const std::vector& inValue) +{ + if (nullptr == L) + return; + + lua_newtable(L); + + int index = 1; + for (const int value : inValue) + { + lua_pushnumber(L, (lua_Number)index); + lua_pushnumber(L, (lua_Number)value); + lua_rawset(L, -3); + ++index; + } +} + +void ccvector_float_to_luaval(lua_State* L, const std::vector& inValue) +{ + if (nullptr == L) + return; + + lua_newtable(L); + + int index = 1; + for (const float value : inValue) + { + lua_pushnumber(L, (lua_Number)index); + lua_pushnumber(L, (lua_Number)value); + lua_rawset(L, -3); + ++index; + } +} + +void ccvector_ushort_to_luaval(lua_State* L, const std::vector& inValue) +{ + if (nullptr == L) + return; + + lua_newtable(L); + + int index = 1; + for (const unsigned short value : inValue) + { + lua_pushnumber(L, (lua_Number)index); + lua_pushnumber(L, (lua_Number)value); + lua_rawset(L, -3); + ++index; + } +} diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 6394ff5a6b..10c9ec07ae 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -73,6 +73,7 @@ extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret); extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret); extern bool luaval_to_vec2(lua_State* L,int lo,cocos2d::Vec2* outValue); extern bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue); +extern bool luaval_to_vec4(lua_State* L,int lo,cocos2d::Vec4* outValue); extern bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outValue); extern bool luaval_to_ttfconfig(lua_State* L, int lo, cocos2d::TTFConfig* outValue); @@ -228,10 +229,14 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) return true; } +extern bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttrib* ret); +extern bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector* ret); +extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector* ret); // from native extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2); extern void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3); +extern void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec3); extern void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count); extern void size_to_luaval(lua_State* L,const Size& sz); extern void rect_to_luaval(lua_State* L,const Rect& rt); @@ -372,4 +377,10 @@ void object_to_luaval(lua_State* L,const char* type, T* ret) } } +void mesh_vertex_attrib_to_luaval(lua_State* L, const cocos2d::MeshVertexAttrib& inValue); +void ccvector_std_string_to_luaval(lua_State* L, const std::vector& inValue); +void ccvector_int_to_luaval(lua_State* L, const std::vector& inValue); +void ccvector_float_to_luaval(lua_State* L, const std::vector& inValue); +void ccvector_ushort_to_luaval(lua_State* L, const std::vector& inValue); + #endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__ diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp index dd2ee1b0de..d07416b867 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp @@ -1447,7 +1447,7 @@ static int tolua_Cocos2d_glDrawElements00(lua_State* tolua_S) !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnumber(tolua_S,3,0,&tolua_err) || !tolua_isnumber(tolua_S,4,0,&tolua_err) || - !tolua_istable(tolua_S,5,0,&tolua_err) || + !tolua_istable(tolua_S,5,1,&tolua_err) || !tolua_isnoobj(tolua_S,6, &tolua_err) ) goto tolua_lerror; @@ -1460,45 +1460,70 @@ static int tolua_Cocos2d_glDrawElements00(lua_State* tolua_S) unsigned int arg3 = (unsigned int)tolua_tonumber(tolua_S, 4, 0); if (GL_UNSIGNED_BYTE == arg2) { - unsigned char* unit8Array = new unsigned char[arg3]; - if (NULL == unit8Array) + if (arg3 > 0) { - return 0; + unsigned char* unit8Array = new unsigned char[arg3]; + if (NULL == unit8Array) + { + return 0; + } + for (unsigned int i = 1; i <= arg3; i++) + { + unit8Array[i-1] = (unsigned char)tolua_tofieldnumber(tolua_S, 5, i, 0); + } + glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)unit8Array); + CC_SAFE_DELETE_ARRAY(unit8Array); + } - for (unsigned int i = 1; i <= arg3; i++) + else { - unit8Array[i-1] = (unsigned char)tolua_tofieldnumber(tolua_S, 5, i, 0); + glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , nullptr); } - glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)unit8Array); - CC_SAFE_DELETE_ARRAY(unit8Array); } else if(GL_UNSIGNED_SHORT == arg2) { - unsigned short* shortArray = new unsigned short[arg3]; - if (NULL == shortArray) + if (arg3 > 0) { - return 0; + unsigned short* shortArray = new unsigned short[arg3]; + if (NULL == shortArray) + { + return 0; + } + for (unsigned int i = 1; i <= arg3; i++) + { + shortArray[i-1] = (unsigned short)tolua_tofieldnumber(tolua_S, 5, i, 0); + } + + glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)shortArray); + + CC_SAFE_DELETE_ARRAY(shortArray); } - for (unsigned int i = 1; i <= arg3; i++) + else { - shortArray[i-1] = (unsigned short)tolua_tofieldnumber(tolua_S, 5, i, 0); + glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , nullptr); } - glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)shortArray); - CC_SAFE_DELETE_ARRAY(shortArray); } else if(GL_UNSIGNED_INT == arg2) { - unsigned int* intArray = new unsigned int[arg3]; - if (NULL == intArray) + if (arg3 > 0) { - return 0; + unsigned int* intArray = new unsigned int[arg3]; + if (NULL == intArray) + { + return 0; + } + for (unsigned int i = 1; i <= arg3; i++) + { + intArray[i-1] = (unsigned int)tolua_tofieldnumber(tolua_S, 5, i, 0); + } + glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)intArray); + CC_SAFE_DELETE_ARRAY(intArray); } - for (unsigned int i = 1; i <= arg3; i++) + else { - intArray[i-1] = (unsigned int)tolua_tofieldnumber(tolua_S, 5, i, 0); + glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , nullptr); + } - glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)intArray); - CC_SAFE_DELETE_ARRAY(intArray); } } return 0; diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp index 9e765728f1..0e16c074f5 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp @@ -5296,6 +5296,80 @@ static void extendConsole(lua_State* tolua_S) lua_pop(tolua_S, 1); } +static int lua_cocos2dx_GLProgramState_setVertexAttribPointer(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setVertexAttribPointer'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 6) + { + std::string arg0; + int arg1; + unsigned int arg2; + bool arg3; + int arg4; + int arg5; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1); + + ok &= luaval_to_uint32(tolua_S, 4,&arg2); + + ok &= luaval_to_boolean(tolua_S, 5, &arg3); + + ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4); + + ok &= luaval_to_int32(tolua_S, 7, (int *)&arg5); + + if(!ok) + return 0; + cobj->setVertexAttribPointer(arg0, arg1, arg2, arg3, arg4, (void*)arg5); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setVertexAttribPointer",argc, 6); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setVertexAttribPointer'.",&tolua_err); +#endif + + return 0; +} + +static void extendGLProgramState(lua_State* tolua_S) +{ + lua_pushstring(tolua_S, "cc.GLProgramState"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S,"setVertexAttribPointer", lua_cocos2dx_GLProgramState_setVertexAttribPointer); + } + lua_pop(tolua_S, 1); +} + int register_all_cocos2dx_manual(lua_State* tolua_S) { if (NULL == tolua_S) @@ -5344,5 +5418,7 @@ int register_all_cocos2dx_manual(lua_State* tolua_S) extendLabel(tolua_S); extendTMXTiledMap(tolua_S); extendConsole(tolua_S); + extendGLProgramState(tolua_S); + return 0; } diff --git a/cocos/ui/GUIDefine.h b/cocos/ui/GUIDefine.h index 1df8a99884..99207e3248 100644 --- a/cocos/ui/GUIDefine.h +++ b/cocos/ui/GUIDefine.h @@ -25,7 +25,6 @@ #ifndef __TestCpp__GUIDefine__ #define __TestCpp__GUIDefine__ -#include "cocos2d.h" #include #include "cocostudio/ObjectFactory.h" diff --git a/cocos/ui/UIHelper.cpp b/cocos/ui/UIHelper.cpp index 7e0e4ca169..11b44c6b1d 100644 --- a/cocos/ui/UIHelper.cpp +++ b/cocos/ui/UIHelper.cpp @@ -22,7 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CocosGUI.h" +#include "ui/UIHelper.h" +#include "ui/UIWidget.h" NS_CC_BEGIN diff --git a/cocos/ui/UIHelper.h b/cocos/ui/UIHelper.h index c16f90e669..68fa8dbfb9 100644 --- a/cocos/ui/UIHelper.h +++ b/cocos/ui/UIHelper.h @@ -25,9 +25,14 @@ THE SOFTWARE. #ifndef __UIHELPER_H__ #define __UIHELPER_H__ +#include +#include "base/CCPlatformMacros.h" + NS_CC_BEGIN namespace ui { + + class Widget; /** * @js NA diff --git a/cocos/ui/UIImageView.h b/cocos/ui/UIImageView.h index 2bf9bd43b3..26ce344704 100644 --- a/cocos/ui/UIImageView.h +++ b/cocos/ui/UIImageView.h @@ -59,7 +59,7 @@ public: /** * create a imageview * - * @param fileName file name of texture. + * @param imageFileName file name of texture. * * @param texType @see UI_TEX_TYPE_LOCAL */ @@ -84,7 +84,7 @@ public: /** * Sets if imageview is using scale9 renderer. * - * @param true that using scale9 renderer, false otherwise. + * @param able true that using scale9 renderer, false otherwise. */ void setScale9Enabled(bool able); diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index be628e30f9..243268be3e 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -705,7 +705,7 @@ bool Layout::isClippingEnabled() void Layout::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { - if (!_enabled) + if (!_visible) { return; } diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index 5407dd4b41..f3cbe11e8b 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -196,7 +196,7 @@ protected: virtual Vector& getChildren() override{return ScrollView::getChildren();}; virtual const Vector& getChildren() const override{return ScrollView::getChildren();}; virtual ssize_t getChildrenCount() const override {return ScrollView::getChildrenCount();}; - virtual Node * getChildByTag(int tag) override {return ScrollView::getChildByTag(tag);}; + virtual Node * getChildByTag(int tag) const override {return ScrollView::getChildByTag(tag);}; virtual Widget* getChildByName(const std::string& name) override {return ScrollView::getChildByName(name);}; void updateInnerContainerSize(); void remedyLayoutParameter(Widget* item); diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 75153408a4..ff180ded2f 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -183,7 +183,7 @@ protected: virtual Vector& getChildren() override{return Widget::getChildren();}; virtual const Vector& getChildren() const override{return Widget::getChildren();}; virtual ssize_t getChildrenCount() const override {return Widget::getChildrenCount();}; - virtual Node * getChildByTag(int tag) override {return Widget::getChildByTag(tag);}; + virtual Node * getChildByTag(int tag) const override {return Widget::getChildByTag(tag);}; virtual Widget* getChildByName(const std::string& name) override {return Widget::getChildByName(name);}; Layout* createPage(); diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 646f743bee..09d0275ab8 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -301,7 +301,7 @@ ssize_t ScrollView::getChildrenCount() const return _innerContainer->getChildrenCount(); } -Node* ScrollView::getChildByTag(int tag) +Node* ScrollView::getChildByTag(int tag) const { return _innerContainer->getChildByTag(tag); } diff --git a/cocos/ui/UIScrollView.h b/cocos/ui/UIScrollView.h index 2f986dfdeb..754e006290 100644 --- a/cocos/ui/UIScrollView.h +++ b/cocos/ui/UIScrollView.h @@ -296,7 +296,7 @@ public: virtual ssize_t getChildrenCount() const override; - virtual Node * getChildByTag(int tag) override; + virtual Node * getChildByTag(int tag) const override; virtual Widget* getChildByName(const std::string& name) override; diff --git a/cocos/ui/UIText.cpp b/cocos/ui/UIText.cpp index 1103b6ab6b..88b0aafa36 100644 --- a/cocos/ui/UIText.cpp +++ b/cocos/ui/UIText.cpp @@ -147,6 +147,7 @@ void Text::setFontName(const std::string& name) { TTFConfig config = _labelRenderer->getTTFConfig(); config.fontFilePath = name; + config.fontSize = _fontSize; _labelRenderer->setTTFConfig(config); _type = Type::TTF; } diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 93a8f89167..d0bc342a08 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -83,7 +83,7 @@ public: /** * Gets the string value of label. * - * @return text string value. + * @return string value. */ CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue(){ return this->getString();} const std::string& getString()const; @@ -100,7 +100,7 @@ public: /** * Sets the font size of label. * - * @param font size. + * @param size font size. */ void setFontSize(int size); @@ -113,7 +113,7 @@ public: * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText * text->setFontName("Marfelt"); // it will change the font to system font no matter the previous font type is TTF or system font * text->setFontName("xxxx/xxx.ttf"); //it will change the font to TTF font no matter the previous font type is TTF or system font - * @param font name. + * @param name font name. */ void setFontName(const std::string& name); @@ -124,7 +124,7 @@ public: /** * Sets the touch scale enabled of label. * - * @param touch scale enabled of label. + * @param enabled touch scale enabled of label. */ void setTouchScaleChangeEnabled(bool enabled); diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 10e66b06e9..ed234dd044 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,61 +1,31 @@ -# cocos2d-x v3.0 Release Notes # +# cocos2d-x v3.1 Release Notes # **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* -- [cocos2d-x v3.0 Release Notes](#user-content-cocos2d-x-v30-release-notes) - [Misc Information](#user-content-misc-information) - [Requirements](#user-content-requirements) - [Runtime Requirements](#user-content-runtime-requirements) - [Compiler Requirements](#user-content-compiler-requirements) - [How to run tests](#user-content-how-to-run-tests) - - [Mac OSX & iOS](#user-content-mac-osx--ios) - - [Android](#user-content-android) - - [Windows](#user-content-windows) - - [Linux](#user-content-linux) - [How to start a new game](#user-content-how-to-start-a-new-game) -- [Highlights of v3.0](#user-content-highlights-of-v30) +- [Highlights of v3.1](#user-content-highlights-of-v31) - [Features in detail](#user-content-features-in-detail) - - [C++11 features](#user-content-c11-features) - - [std::function](#user-content-stdfunction) - - [Strongly typed enums](#user-content-strongly-typed-enums) - - [override](#user-content-override) - - [Removed Objective-C patterns](#user-content-removed-objective-c-patterns) - - [No more 'CC' prefix for C++ classes and free functions](#user-content-no-more-cc-prefix-for-c-classes-and-free-functions) - - [clone() instead of copy()](#user-content-clone-instead-of-copy) - - [Singletons use getInstance() and destroyInstance()](#user-content-singletons-use-getinstance-and-destroyinstance) - - [Object is replaced with Ref](#user-content-object-is-replaced-with-ref) - - [getters](#user-content-getters) - - [POD types](#user-content-pod-types) - - [New Renderer](#user-content-new-renderer) - - [Renderer features](#user-content-renderer-features) - - [Auto-batching](#user-content-auto-batching) - - [Auto-culling](#user-content-auto-culling) - - [Global Z order](#user-content-global-z-order) - - [Sprite vs. SpriteBatchNode](#user-content-sprite-vs-spritebatchnode) - - [Improved LabelTTF / LabelBMFont / LabelAtlas](#user-content-improved-labelttf--labelbmfont--labelatlas) - - [New EventDispatcher](#user-content-new-eventdispatcher) - - [Physics Integration](#user-content-physics-integration) + - [Sprite3D](#user-content-sprite3d) + - [Improved Shader Subsystem](#user-content-improved-shader-subsystem) + - [New math library](#user-content-new-math-library) + - [New UIVideoPlayer](#user-content-new-uivideoplayer) + - [UI navigation](#user-content-ui-navigation) + - [Improved folder structure](#user-content-improved-folder-structure) + - [Particle System fixes](#user-content-particle-system-fixes) - [Misc API Changes](#user-content-misc-api-changes) - - [ccTypes.h](#user-content-cctypesh) - [deprecated functions and global variables](#user-content-deprecated-functions-and--global-variables) -- [Changes in the Lua bindings](#user-content-changes-in-the-lua-bindings) - - [Use bindings-generator tool for lua binding](#user-content-use-bindings-generator-tool-for-lua-binding) - - [Bind the classes with namespace to lua](#user-content-bind-the-classes-with-namespace-to-lua) - - [Use ScriptHandlerMgr to manage the register and unregister of Lua function](#user-content-use-scripthandlermgr-to-manage-the-register-and-unregister-of-lua-function) - - [Misc API changes](#user-content-misc-api-changes-1) - - [Use cc、ccs、ccui gl and sp as module name](#user-content-use-ccccsccui-gl-and-sp-as-module-name) - - [Modified functions](#user-content-modified-functions) - - [Add some modules](#user-content-add-some-modules) - - [Add more lua bindings](#user-content-add-more-lua-bindings) - - [Replace some lua-bindings of Class or Struct with lua table](#user-content-replace-some-lua-bindings-of-class-or-struct-with-lua-table) - - [Support lua script codes call Object-C codes and Java codes](#user-content-support-lua-script-codes-call-object-c-codes-and-java-codes) - - [Add some lua files to store the constants of different modules](#user-content-add-some-lua-files-to-store-the-constants-of-different-modules) # Misc Information -* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.0beta.zip -* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0beta/CHANGELOG -* API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0beta/index.html +* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.1rc0.zip +* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.1rc0/CHANGELOG +* ~~API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0/index.html~~ +* v3.0 Release Notes can be found here: [v3.0 Release Notes](https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0/docs/RELEASE_NOTES.md) # Requirements @@ -65,15 +35,17 @@ * iOS 5.0 or newer * OS X 10.7 or newer * Windows 7 or newer -* Windows Phone 8 or newer (initail version) -* Linux Ubuntu 12.04 (or newer) +* Windows Phone 8 or newer +* Linux Ubuntu 12.04 or newer * ~~Browsers via Emscripten~~ N/A for the moment ## Compiler Requirements -* Xcode 4.6 (for iOS or Mac) -* gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required. -* Visual Studio 2012 (for Windows) +* Xcode 4.6 or newer for iOS or Mac +* gcc 4.7 or newer for Linux +* gcc 4.7 and ndk-r9 or newer for Android +* Visual Studio 2012 or newer for Windows (win32) +* Visual Studio 2012 or newer for Windows Phone 8 ## How to run tests @@ -137,630 +109,260 @@ Run ## How to start a new game -Please refer to [ReadMe](../README.md). And there is a [document](https://github.com/chukong/cocos-docs/blob/master/manual/framework/native/getting-started/v3.0/how-to-start-a-new-game/en.md) for it. - +Please refer to this document: [ReadMe](../README.md) -# Highlights of v3.0 +# Highlights of v3.1 + +* `Sprite3D`, a new node to render 3D models +* Improved Shader subsystem +* New, unified, math library +* `ui::VideoPlayer`, a new node to play videos -* Replaced Objective-C patterns with C++ (C++11) patterns and best practices -* Improved Labels -* Improved renderer (much faster than in v2.2!!) -* New Event Dispatcher -* Physics integration -* New UI objects -* [JavaScript remote debugger](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/scripting/javascript/js-remote-debugger/en.md) -* Remote Console support -* Use [cocos console](https://github.com/cocos2d/cocos2d-console) to create and run project -* Refactor Image - release memory in time and uniform the api of supported file format -* Automatically generated Lua bindings, add LuaJavaBridge and LuaObjcBridge -* Templated containers - * `CCDictionary` is replaced by `cocos2d::Map<>`, [usage](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/data-structure/v3/map/en.md) - * `CCArray` is replaced by `cocos2d::Vector<>`, [usage](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/data-structure/v3/vector/en.md) - * `CCBool`, `CCFLoat`, `CCDouble` are replaced with `cocos2d::Value`, [usage](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/data-structure/v3/value/en.md) # Features in detail -## C++11 features +## Sprite3D -_Feature added in v3.0-pre-alpha0_ +cocos2d-x v3.0 replaced `Node`'s 2x3 transform matrix with a 4x4 one. This feature allows you to transform any node in a 3d space. -A subset of C++11 features are being used in cocos2d-x: +`Sprite3D` allows users to render a 3d model inside cocos2d. And since cocos2d-x already has 4x4 transform matrix, it is possible to move scale and rotate the `Sprite3D` in the x, y, and z axis. -* `std::function`, including lambda objects for callbacks -* strongly typed enums, for most of the cocos2d-x enums and constants -* `std::thread` for threading -* `override` and `final` context keywords, for overriden and final methods +The API is like `Sprite`: +```c++ +// v3.1 only supports the Wavefront file format +auto sprite3d = Sprite3D::create("mymodel.obj"); -### std::function +// if the material is not specified in .obj, you can override it with: +auto sprite3d = Sprite3D::create("mymodel.obj", "texture.png"); -* `CallFunc` can be created with an `std::function` -* `CallFuncN` can be created with an `std::function` -* `CallFuncND` and `CallFuncO` were removed since it can be created with simulated with `CallFuncN` and `CallFunc`. See ActionsTest.cpp for more examples -* `MenuItem` supports `std::function` as callbacks - -`CallFunc` example: - -```cpp -// in v2.1 -CCCallFunc *action1 = CCCallFunc::create( this, callfunc_selector( MyClass::callback_0 ) ); - -// in v3.0 (short version) -auto action1 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_0,this)); -auto action2 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_1,this, additional_parameters)); - -// in v3.0 (long version) -auto action1 = CallFunc::create( std::bind( &MyClass::callback_0, this)); -auto action2 = CallFunc::create( std::bind( &MyClass::callback_1, this, additional_parameters)); - -// in v3.0 you can also use lambdas or any other "Function" object -auto action1 = CallFunc::create( - [&](){ - auto s = Director::sharedDirector()->getWinSize(); - auto label = LabelTTF::create("called:lambda callback", "Marker Felt", 16); - label->setPosition(ccp( s.width/4*1,s.height/2-40)); - this->addChild(label); - } ); +// Since Sprite3D is a regular node, you can add it into the scene like any other node +scene->addChild(sprite3d); +sprite3d->setRotation3D(Vec3(x,y,z)); ``` -`MenuItem` example: +## Improved Shader Subsystem -```cpp -// in v2.1 -CCMenuItemLabel *item = CCMenuItemLabel::create(label, this, menu_selector(MyClass::callback)); +In order to support `Sprite3D`, we refactored our shader subsystem. The result is that we have an easier to use, yet more powerful shader system that can be used both for 2D and 3D. -// in v3.0 (short version) -auto item = MenuItemLabel::create(label, CC_CALLBACK_1(MyClass::callback, this)); -// in v3.0 (long version) -auto item = MenuItemLabel::create(label, std::bind(&MyClass::callback, this, std::placeholders::_1)); +In v3.0, the class `GLProgram` was used both for holdin the _OpenGL program_ (shader), and also the shader state (uniforms and attributes). -// in v3.0 you can use lambdas or any other "Function" object -auto item = MenuItemLabel::create(label, - [&](Object *sender) { - // do something. Item "sender" clicked - }); +That design had one big constraint: In order to add or remove an attribute or uniform, you had to subclass `GLProgram`. + +In v3.1, we decoupled the shader state from the shader. We added the `GLProgramState` class which holds the attributes and uniforms. + +The API is the following: + +```c++ +auto glprogram = GLProgram::create(...); + +// it will automatically parse all the attributes and uniforms +// used by glprogram, and it will populate the glprogramstate dictionary +// with them +auto glprogramstate = GLProgramState::create( glprogram ); + +// How to set a uniform for Vec2 (Int, Texture, Vec3, Vec4, Mat4, are all supported) +glprogramstate->setUniformVec2("u_my_uniform", Vec2(x,y)); +// or how to set it using a callback +glprogramstate->setUniformCallback("u_my_uniform", [](Uniform*uniform){ + // do something +}); + +// How to set an attribute +glprogramstate->setVertexAttribPointer("a_my_attrib", 4, GL_FLOAT, GL_FALSE, 0, vertex); +// or how to set it using a callback +glprogramstate->setVertexAttribCallback("a_my_attrib", [](VertexAttrib*attrib){ + // do something + }); ``` -### Strongly typed enums +By using this API it is possible to change the effect on a `Sprite3D` (or even an `Sprite`) without subclassing any cocos2d class! -_Feature added in v3.0-pre-alpha0_ +Possible examples: -Constants and enums that started with `k`, and that usually were defined as `int` or as simple `enum` where replaced with strongly typed enums ( `enum class` ) to prevent collisions and type errors. -The new format is: + - Outline / Shadow / Glow effects + - Multi-texturing effects + - Sepia, Grey or other color effects + - and more + +For a complete example, please see the [Shader - Sprite](https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.1rc0/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp) and [Shader - Basic](https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.1rc0/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp) examples. - | v2.1 | v3.0 | - | kTypeValue | Type::VALUE | -Examples: - | v2.1 | v3.0 | - | kCCTexture2DPixelFormat_RGBA8888 | Texture2D::PixelFormat::RGBA8888 | - | kCCDirectorProjectionCustom | Director::Projection::CUSTOM | - | ccGREEN | Color3B::GREEN | - | CCPointZero | Point::ZERO | - | CCSizeZero | Size::ZERO | +## New math library -The old values can still be used, but are deprecated. +cocos2d-x v1.0 only supported 2D features. So it made sense to use a 2x3 Transform matrix for the operations. -### override +In cocos2d-x v2.0 we added OpenGL ES 2.0 support (no more built-in OpenGL matrix operations) so it made sense to use [Kazmath](https://github.com/Kazade/kazmath), a math library that replaced the OpenGL ES 1.0 functionality. Kazmath was used internally, and most of the users never used the Kazmath API at all. -To catch possible errors while overriding methods, subclasses with override methods have the `override` context keyword. -Example: -```cpp -class Sprite : public Node { - bool isFlipY(void) const; - void setFlipY(bool bFlipY); +In cocos2d-x v3.0 we refactored the renderer and we exposed a bit more the Kazmath API to the users. - // Overrides - virtual void setTexture(Texture2D *texture) override; - virtual Texture2D* getTexture() const override; - inline void setBlendFunc(const BlendFunc &blendFunc) override; - inline const BlendFunc& getBlendFunc() const override; +And in v3.1, with `Sprite3D` we needed to expose even more the the Kazmath API. And it no longer made sense to have multiple math libraries inside cocos2d-x. + +The problems were: + + * Part of the code was using the old 2D math library + * Part of the code was using Kazmath + * Part of the code was using ad-hoc math code + +The goal was to use only one math library for cocos2d-x, with the following requirements: + * Easy to use, easy to mantain + * Proven + * In C++ if possible + +So we took the [GamePlay3D](http://gameplay3d.org/) math library, we did some minor changes, and the cocos2d-x math code with it. + +How to use it: + +```c++ +// vector2 +Vec2 vec2(10,20); +Vec2 other2(30,40); +auto ret = vec2.cross(other2); +auto ret2 = vec2 + other2; +auto ret3 = vec3 * scalar; + +node->setPosition(vec2); + +// vector3 +Vec3 vec3(30,40,50); +node->setPosition3D(vec3); + +// vector4 +Vec4 vec4 = Vec4::ZERO; + +// Matrix 4x4 +auto identity = Mat4::IDENTITY; +node->setNodeToParentTransform(identity); +``` + +The good news is that the old API still works since we `typedef` the old classes and structs to the new math classes. + + +## New UIVideoPlayer + +v3.1 has a new `Node` to play videos. The API is: + + +```c++ +// VideoPlayer is under the "experimental" namespace since +// it only works for iOS and Android, and we might change its +// API in the future +auto videoPlayer = cocos2d::experimental::ui::VideoPlayer::create(); +videoPlayer->setContentSize(Size(x,y)); +videoPlayer->setURL("http://example.com/video.mp4"); +//you could also play a local video file as follows: +//videoPlayer->setFileName("filepath/video.mp4"); +videoPlayer->play(); +``` + + +## UI navigation + +3.1 supports focus navigation of UI widget which is very useful for OTT manufacturer. + +###Usage +Suppose that your screen has 3 widgets layout horizontally. We could define it like this: + +```c++ +HBox(widget1, widget2, widget3) +``` + +If you want the `widget1` to get focused, you could call + +```c++ +widget1->setfocused(true) +``` + +If you want to move the focus to the next widget, you could just call + +```c++ +widget1->findNextFocusedWidget(Widget::FocusDirection::RIGHT, _firstFocusedWidget); +``` + +When the focus goes to `widget3`, if you call + +```c++ +widget3->findNextFocusedWidget(Widget::FocusDirection::RIGHT, _firstFocusedWidget); +``` +, the focus will stay there only when you call `HBox->setLoopFocus()` then the focus will move to `widget1` again. + +**Note:** + +The HBox and VBox could be nested in any ways and all the widgets should be added into the HBox/VBox if you want them to be focused later. + +When a focus moves from one widget to another, it will trigger a *focus event*. You could add the following code to handle these event: + +```c++ +auto eventListener = EventListenerFocus::create(); +eventListener->onFocusChanged = CC_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); +eventDispatcher->addEventListenerWithFixedPriority(_eventListener, 1); +``` + +The onFocusChanged callback, when the widget lose focus, we change its color to white, when the widget get focus, we change its color to red. You could add more complex animations to them when focus change happens. + +```c++ +void UIFocusTestBase::onFocusChanged(cocos2d::ui::Widget *widgetLostFocus, cocos2d::ui::Widget *widgetGetFocus) +{ + Layout *getLayout = dynamic_cast(widgetGetFocus); + if (!getLayout && widgetGetFocus && widgetGetFocus->isFocusEnabled()) { + widgetGetFocus->setColor(Color3B::RED); + } + Layout *loseLayout = dynamic_cast(widgetLostFocus); + if (!loseLayout && widgetLostFocus && widgetLostFocus->isFocusEnabled()) { + widgetLostFocus->setColor(Color3B::WHITE); + } } ``` - -## Removed Objective-C patterns - -_Feature added in v3.0-pre-alpha0_ - -### No more 'CC' prefix for C++ classes and free functions - -*Changes in classes* - -Since cocos2d-x already uses the `cocos2d` namespace, there is not need to add the prefix `CC` to all its classes. - -Examples: - - | v2.1 | v3.0 | - | CCSprite | Sprite | - | CCNode | Node | - | CCDirector | Director | - | etc... | - -v2.1 class names are still available, but they were tagged as deprecated. - -*Changes in free functions* - -For the *drawing primitives*: -* They were added in the `DrawPrimitives` namespace -* The `cc` prefix was removed - -For the *gl proxy functions*: -* They were added in the `GL` namespace -* The `ccGL` prefix was removed - -Examples: - - | v2.1 | v3.0 | - | ccDrawPoint() | DrawPrimitives::drawPoint() | - | ccDrawCircle() | DrawPrimitives::drawCircle() | - | ccGLBlendFunc() | GL::blendFunc() | - | ccGLBindTexture2D() | GL::bindTexture2D() | - | etc... | - -v2.1 free functions are still available, but they were tagged as deprecated. +For more usage information, please refer to [this file](https://github.com/cocos2d/cocos2d-x/blob/v3/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp) for more information. -### clone() instead of copy() +###Limitations +Only Layout type `HORIZONTAL` and `VERTICAL` is supported which means we could not treat Scrollview and PageView as a base layout. -`clone()` returns an autoreleased version of the copy. +The following layouts: -`copy()` is no longer supported. If you use it, it will compile, but the code will crash. - -Example: -```cpp -// v2.1 -CCMoveBy *action = (CCMoveBy*) move->copy(); -action->autorelease(); - -// v3.0 -// No need to do autorelease, no need to do casting. -auto action = move->clone(); +```c++ +HBox(VBox, ScrollView(HBox(VBox, VBox, VBox))) +VBox(HBox, PageView(VBox(HBox,HBox)))) ``` + are not supported yet, we will implement it in cocos2d-x v3.2. + + If you want to achieve the focus movement in scrollview, you could use a normal VBox or HBox to layout elements and call `setFocusEnabled(true/false)` manually to skip the unwanted widgets. + +## Improved folder structure -### Singletons use getInstance() and destroyInstance() +In v3.0 we started a folder re-organization for cocos2d-x. Unfortunately we didn't have the time to finish it on time. -All singletons use `getInstance()` and `destroyInstance()` (if applicable) to get and destroy the instance. +In v3.1 we finished the folder re-organization, and it looks like this: -Examples: + cocos/: includes cocos2d.cpp and other build files + cocos/2d/: includes base nodes, 2d nodes and related objects like Node, Scene, Sprite, etc. + cocos/3d/: includes 3d nodes and related objects like Sprite3D + cocos/audio/: sound and music related objects + cocos/math/: math related objects + cocos/platform/: platform specific objects + cocos/renderer/: GPU related objects like Renderer, Texture2D, Render Commands, etc. + cocos/physcis/: physics related objects + cocos/network/: network retlated objects + cocos/editor-support/: 3rd party editors file format - | v2.1 | v3.0 | - | CCDirector->sharedDirector() | Director->getInstance() | - | CCDirector->endDirector() | Director->destroyInstance() | - | etc... | +## Particle System fixes +cocos2d-x v3.0 and earlier versions had a bug in `ParticleSystem` where the the Y-flipped parameter was not calculated correctly. -v2.1 methods are still available, but they were tagged as deprecated. +We fixed that bug in v3.1. The problem is that fixing this bug breaks backward compatiblility in particles that were relying on the broken behavior. -### Object is replaced with Ref +In order to try to make the transition easier to v3.1, we created a tool that fixes the broken particle system files. How to use it: -Because the name `Object` is confused, so rename it to `Ref`, and remove functions that are not related with reference count. All classes that inherit from `Object` now inherit from `Ref`. - -### getters - -Getters now use the `get` prefix. - -Examples: - - | v2.1 | v3.0* | - | node->boundingBox() | node->getBoundingBox() | - | sprite->nodeToParentTransform() | sprite->getNodeToParentTransform() | - | etc... | - -And getters were also tagged as `const` in their declaration. Example: - -```cpp -// v2.1 -virtual float getScale(); - -// v3.0 -virtual float getScale() const; -``` - -v2.1 methods are still available, but they were tagged as deprecated. - -### POD types - -Methods that were receiving POD types as arguments (eg: `TexParams`, `Point`, `Size`, etc.) are being passed as `const` reference. - -Example: -```cpp -// v2.1 -void setTexParameters(ccTexParams* texParams); - -// v3.0 -void setTexParameters(const ccTexParams& texParams); -``` - - -## New Renderer - -_Feature added in v3.0-beta and improved in v3.0-beta2_ - -The way currently cocos2d-x v2.2 does rendering is OK but it is difficult to optimize, difficult to add new functionality and difficult to port to new platforms. -So cocos2d-x v3.0 has a new renderer that is more performing, elegant, scalable, flexible but still simple to use and to understand. Also existing cocos2d-x users will find the new API familiar and they will feel immediately comfortable with, without having to bother about what’s changed or what's new under the hood. - -Features of the new renderer: - -- It has been decoupled from the Scene Graph. The `draw()` method, instead of "drawing" it sends a `RenderCommand` to the `Renderer`, and `Renderer` is responsible for drawing the queued `RenderCommand` commands. -- `QuadCommands` (used by `Sprite` and `ParticleSystem` objects) will be automatically batched. -- `CustomCommand` objects allow the user to use custom OpenGL code, using a API similar to v2.2 -- `GroupCommand` objects allow to have "stacks" in the Renderer with different OpenGL values. -- Auto-culling for `Sprite` objects (although, technically, Auto-culling is not performed in `Renderer` code, but in the `Sprite` code) -- Global Z ordering (local Z ordering is still supported) - -For detailed information, please read the following doc: [Renderer Specification document](https://docs.google.com/document/d/17zjC55vbP_PYTftTZEuvqXuMb9PbYNxRFu0EGTULPK8/edit) - -### Renderer features - -#### Auto-batching - -Auto-batching means that the `Renderer` will package "multiple draw calls" in just one "big draw call" (AKA batch). In order to group "draw calls" certain conditions are needed: - -- It only works with `QuadCommand` commands (used by Sprite and ParticleSystem objects) -- The `QuadCommands` must share the same Material ID: same Texture ID, same GLProgram and same blending function -- The `QuadCommands` must consecutive - -If those conditions are met, the `Renderer` will create create a batch (one draw call) with all those `QuadCommand` objects. - -In case you are unfamiliar with the OpenGL best practices, batching is very important to have decent speed in your games. The less batches (draw calls) the more performance your game is going to be. - -#### Auto-culling - -For the moment auto-culling is only implemented on `Sprite` objects. - -When the method `Sprite::draw()` is called, it will check if the `Sprite` is outside the screen. If so, it won't send the `QuadCommand` command to the `Renderer`, and thus, it will gain some performance. - - -#### Global Z order - -A new method called `setGlobalZOrder()` / `getGlobalZOrder()` was added to `Node`, and the old methods `setZOrder()` / `getZOrder()` were renamed to `setLocalZOrder()` / `getLocalZOrder()`. - -`globalZOrder` receives a `float` (and not an `int`) as argument. And this value is used to sort the `RenderCommand` objects in the `Renderer`. Lower values have higher priority over higher values. That means that a Node with a `globalZOrder` of `-10` is going to be drawn BEFORE a Node with `globalZOrder` of `10`. - -Nodes that have a `globalZOrder` of `0` (default value) will be drawn according to the Scene Graph order. - -If the `globalZOrder` is not changed, cocos2d-x v3.0 will behave exactly as cocos2d-x v2.2. - -__`globalZOrder()` vs. `localZOrder()`__: - -* `globalZOrder` is used to sort the "draw commands" in the `Renderer` -* `localZOrder` is used to sort the `Node` objects in its parent's children Array - -__Exceptions__: - -TODO - -### Sprite vs. SpriteBatchNode - -In v2.2 the recommended way to have good performance was to parent `Sprite` objects to a `SpriteBatchNode` object. -Although the performance was (is still) very good by using `SpriteBatchNode` objects, they had (still have) some limitations like: - -- `Sprite` objects can only have `Sprite` objects as children (if not, cocos2d-x will raise an Assert) - - You cannot add a `ParticleSystem` as a child of `Sprite`, when the `Sprite` is parented to a `SpriteBatchNode` - - As a consequence of that, you cannot use `ParallaxNode` with `Sprites` parented to `SpriteBatchNode` -- All `Sprite` objects must share the same TextureId (if not, cocos2d-x will raise an Assert) -- `Sprite` objects use the `SpriteBatchNode`'s blending function and shader. - - -And although v3.0 still supports `SpriteBatchNode` (with the same features and limitations), we no longer encourage its usage. Instead, we recommend to use `Sprite` objects without parenting them to a `SpriteBatchNode`. - -But in order to have a very good performance in v3.0, you have to make sure that your `Sprite` objects: - -- Share the same TextureId (place them in a spritesheet, like if you were using a `SpriteBatchNode`) -- Make sure all of them use the same shader and blending function (like if you were using a `SpriteBatchNode`) - -If you do so, the `Sprites` will perform almost as fast as to using `SpriteBatchNode`... (about 10% slower on old devices. On newer devices the difference is almost imperceptible) - -The big differences between v2.2 and v3.0 are: - -- `Sprite` objects can have different Texture IDs. -- `Sprite` objects can have any kind of `Node` as children, including `ParticleSystem`. -- `Sprite` objects can have different blending functions and use different shaders. - -But if you do that, the `Renderer` might not be able to batch all its children (less performant). But the game will keep running, without raising any Assert. - -__To summarize__: - -- Keep putting all your sprites in a big spritesheet -- Use the same Blending Function (just use the default one) -- Use the same Shader (just use the default one) -- And don't parent your sprites to a `SpriteBatchNode` - -Only use `SpriteBatchNode` as the last resort, when you really need an extra (although minor) boost in performance (and you are OK with its limitations). - - -## Improved LabelTTF / LabelBMFont / LabelAtlas - -_Feature added in v3.0-alpha0_ - -`LabelTTF`, `LabelBMFont` and `LabelAtlas` will be replaced by new `Label`. The benefits of new `Label` are: - -* uniform api to create `LabelTTF`, `LabelBMFont` and `LabelAtlas` -* use `freetype` to generate texture for labels, which make sure that labels have the same effect on different platforms -* will cache textures to improve performance - -## New EventDispatcher - -_Feature added in v3.0-alpha0_ - -All events such as touch event, keyboard event, acceleration event and custom event are dispatched by `EventDispatcher`. -`TouchDispatcher`, `KeypadDispatcher`, `KeyboardDispatcher`, `AccelerometerDispatcher` were removed. - -Features of `EventDispatcher` are: - -* dispatch events based on rendering sequence -* all events are dispatched by `EventDispatcher` -* can use `EventDispatcher` to dispatch custom events -* can register a lambda as call back function - -Detail information of `EventDispatcher` can refer to [this document](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/input/event-dispatcher/en.md). - -## Physics Integration - -_Feature added in v3.0-pre-alpha0_ - -In v3.0, we integrate physics engine into cocos2d-x based on [Chipmunk2D](https://chipmunk-physics.net/). By using this feature, you can create physics based games without understanding physics engine. - -More detail information of this feature, please refer to [this document](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/physics/physics-integration/en.md) + # Will convert broken .plist files into fixed ones. + # Will generate a backup file of the converted files + $ cocos/tools/particle/convert_YCoordFlipped.py *.plist # Misc API Changes -## `ccTypes.h` - -Remove *cc* prefix for structure names in ccTypes.h, move global functions into static member functions, and move global constants into const static member variables. - - | v2.1 struct names | v3.0 struct names | - | ccColor3B | Color3B | - | ccColor4B | Color4B | - | ccColor4F | Color4F | - | ccVertex2F | Vertex2F | - | ccVertex3F | Vertex3F | - | ccTex2F | Tex2F | - | ccPointSprite | PointSprite | - | ccQuad2 | Quad2 | - | ccQuad3 | Quad3 | - | ccV2F_C4B_T2F | V2F_C4B_T2F | - | ccV2F_C4F_T2F | V2F_C4F_T2F | - | ccV3F_C4B_T2F | V3F_C4B_T2F | - | ccV2F_C4B_T2F_Triangle | V2F_C4B_T2F_Triangle | - | ccV2F_C4B_T2F_Quad | V2F_C4B_T2F_Quad | - | ccV3F_C4B_T2F_Quad | V3F_C4B_T2F_Quad | - | ccV2F_C4F_T2F_Quad | V2F_C4F_T2F_Quad | - | ccBlendFunc | BlendFunc | - | ccT2F_Quad | T2F_Quad | - | ccAnimationFrameData | AnimationFrameData | - -Global functions changed example -```c++ -// in v2.1 -ccColor3B color3B = ccc3(0, 0, 0); -ccc3BEqual(color3B, ccc3(1, 1, 1)); -ccColor4B color4B = ccc4(0, 0, 0, 0); -ccColor4F color4F = ccc4f(0, 0, 0, 0); -color4F = ccc4FFromccc3B(color3B); -color4F = ccc4FFromccc4B(color4B); -ccc4FEqual(color4F, ccc4F(1, 1, 1, 1)); -color4B = ccc4BFromccc4F(color4F); - -color3B = ccWHITE; - -// in v3.0 -Color3B color3B = Color3B(0, 0, 0); -color3B.equals(Color3B(1, 1, 1)); -Color4B color4B = Color4B(0, 0, 0, 0); -Color4F color4F = Color4F(0, 0, 0, 0); -color4F = Color4F(color3B); -color4F = Color4F(color4B); -color4F.equals(Color4F(1, 1, 1, 1)); -color4B = Color4B(color4F); - -color3B = Color3B::WHITE; -``` - ## deprecated functions and global variables - | v2.1 names | v3.0 names | - | ccp | Point | - | ccpNeg | Point::- | - | ccpAdd | Point::+ | - | ccpSub | Point::- | - | ccpMult | Point::* | - | ccpMidpoint | Point::getMidpoint | - | ccpDot | Point::dot | - | ccpCrosss | Point::cross | - | ccpPerp | Point::getPerp | - | ccpRPerp | Point::getRPerp | - | ccpProject | Point::project | - | ccpRotate | Point::rotate | - | ccpUnrotate | Point::unrotate | - | ccpLengthSQ | Point::getLengthSq() | - | ccpDistanceSQ | Point::getDistanceSq | - | ccpLength | Point::getLength | - | ccpDistance | Point::getDistance | - | ccpNormalize | Point::normalize | - | ccpForAngle | Point::forAngle | - | ccpToAngle | Point::getAngle | - | ccpClamp | Point::getClampPoint | - | ccpFromSize | Point::Point | - | ccpCompOp | Point::compOp | - | ccpLerp | Point::lerp | - | ccpFuzzyEqual | Point::fuzzyEqual | - | ccpCompMult | Point::Point | - | ccpAngleSigned | Point::getAngle | - | ccpAngle | Point::getAngle | - | ccpRotateByAngle | Point::rotateByAngle | - | ccpLineInersect | Point::isLineIntersect | - | ccpSegmentIntersect | Point::isSegmentIntersect | - | ccpIntersectPoint | Point::getIntersectPoint | - | CCPointMake | Point::Point | - | CCSizeMake | Size::Size | - | CCRectMake | Rect::Rect | - | PointZero | Point::ZERO | - | SizeZero | Size::ZERO | - | RectZero | Rect::ZERO | - | TiledGrid3DAction::tile | TiledGrid3DAction::getTile | - | TiledGrid3DAction::originalTile | TiledGrid3DAction::getOriginalTile | - | TiledGrid3D::tile | TiledGrid3D::getTile | - | TiledGrid3D::originalTile | TiledGrid3D::getOriginalTile | - | Grid3DAction::vertex | Grid3DAction::getVertex | - | Grid3DAction::originalVertex | Grid3DAction::getOriginalVertex | - | Grid3D::vertex | Grid3D::getVertex | - | Grid3D::originalVertex | Grid3D::getOriginalVertex | - | Configuration::sharedConfiguration | Configuration::getInstance | - | Configuration::purgeConfiguration | Configuration::destroyInstance() | - | Director::sharedDirector() | Director::getInstance() | - | FileUtils::sharedFileUtils | FileUtils::getInstance | - | FileUtils::purgeFileUtils | FileUtils::destroyInstance | - | GLView::sharedOpenGLView | GLView::getInstance | - | ShaderCache::sharedShaderCache | GLProgramCache::getInstance | - | ShaderCache::purgeSharedShaderCache | ShaderCache::destroyInstance | - | AnimationCache::sharedAnimationCache | AnimationCache::getInstance | - | AnimationCache::purgeSharedAnimationCache | AnimationCache::destroyInstance | - | SpriteFrameCache::sharedSpriteFrameCache | SpriteFrameCache::getInstance | - | SpriteFrameCache:: purgeSharedSpriteFrameCache | SpriteFrameCache::destroyInstance | - | NotificationCenter::sharedNotificationCenter | NotificationCenter::getInstance | - | NotificationCenter:: purgeNotificationCenter | NotificationCenter::destroyInstance | - | Profiler::sharedProfiler | Profiler::getInstance | - | UserDefault::sharedUserDefault | UserDefault::getInstance | - | UserDefault::purgeSharedUserDefault | UserDefault::destroyInstance | - | Application::sharedApplication | Application::getInstance | - | ccc3() | Color3B() | - | ccc3BEqual() | Color3B::equals() | - | ccc4() | Color4B() | - | ccc4FFromccc3B() | Color4F() | - | ccc4f() | Color4F() | - | ccc4FFromccc4B() | Color4F() | - | ccc4BFromccc4F() | Color4B() | - | ccc4FEqual() | Color4F::equals() | - | ccWHITE | Color3B::WHITE | - | ccYELLOW | Color3B::YELLOW | - | ccBLUE | Color3B::BLUE | - | ccGREEN | Color3B::GREEN | - | ccRED | Color3B::RED | - | ccMAGENTA | Color3B::MAGENTA | - | ccBLACK | Color3B::BLACK | - | ccORANGE | Color3B::ORANGE | - | ccGRAY | Color3B::GRAY | - | kBlendFuncDisable | BlendFunc::BLEND_FUNC_DISABLE | - -# Changes in the Lua bindings - -## Use bindings-generator tool for lua binding - -Only have to write an ini file for a module, don't have to write a lot of .pkg files - -### Bind the classes with namespace to lua - -In previous, the lua binding can not bind classes that have the same class name but different namespaces. In order to resolve this issue, now the metatable name of a class is changed. For example, `CCNode` will be changed to `cc.Node`. This modification will affect some APIs as follows: - - | v2.x | v3.0 | - | tolua_usertype(tolua_S,"CCNode") | tolua_usertype(tolua_S,"cc.Node") | - | tolua_isusertable(tolua_S,1,"CCNode",0,&tolua_err | tolua_isusertable(tolua_S,1,"cc.Node",0,&tolua_err | - | tolua_isusertype(tolua_S,1,"CCNode",0,&tolua_err) | tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err) | - | toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCNode") | toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.Node") | - | tolua_pushusertype(tolua_S,(void*)tolua_ret,"CCFileUtils") | tolua_pushusertype(tolua_S,(void*)tolua_ret,"cc.FileUtils") | - | tolua.cast(pChildren[i + 1], "CCNode") | tolua.cast(pChildren[i + 1], "cc.Node") | - -### Use ScriptHandlerMgr to manage the register and unregister of Lua function - -When we want to add register and unregister functions of Lua function for class, we need to change the declarative and defined files and then bind to Lua. -In v3.0, we use the `ScriptHandlerMgr`. As an example, lets see the `MenuItem` class: -In the 2.x version, we needed to add a declaration in the MenuItem header file: -```c++ - virtual void registerScriptTapHandler(int nHandler); - virtual void unregisterScriptTapHandler(void); -``` -then implement them in the .cpp file. In the Lua script ,we use it as follow: -```lua -menuItem:registerScriptTapHandler(luafunction) -``` - -In v3.0 version, we only need to add the `HandlerType` enum in the `ScriptHandlerMgr`, and the implementation in luascript as follow: -```lua -ScriptHandlerMgr:getInstance():registerScriptHandler(menuItem, luafunction,cc.HANDLERTYPE_MENU_CLICKED) -``` - -## Misc API changes - -### Use `cc`、`ccs`、`ccui` `gl` and `sp` as module name - -Now classes are bound into different modules instead of using global module. This will avoid conflicts with other codes. - -* classes in `cocos2d`、`cocos2d::extension`、`CocosDenshion` and `cocosbuilder` were bound to `cc` module -* classes in `cocos2d::ui` were bound to `ccui` module -* classes in `spine` were bound to `sp` module -* classes in `cocostudio` were bound to `ccs` module -* global variables are bound to corresponding modules -* all funcionts and constants about `openGl` were bound to `gl` module - -Examples: - - | v2.1 | v3.0 | - | CCDirector | cc.Director | - | CCArmature | ccs.Armature | - | kCCTextAlignmentLeft | cc.kCCTextAlignmentLeft | - -### Modified functions - -Some global function names are renamed: - -Examples: - - | v2.1 | v3.0 | - | CCPoint/ccp | cc.p | - | CCRect | cc.rect | - | CCColor3B | cc.c3b | - | CCColor4B | cc.c4b | - | CCColor4F | cc.c4f | - -### Add some modules - -In the version 3.0, more modules were bound to lua, specific as follows: - -* physics -* spine -* XMLHttpRequest -* OpenGL - -The `XMLHttpRequest` and `physics` are in the `cc` module, the `spine` is in the `sp` module, and the `OpenGL` is in the `gl` module. Related test cases located in: - -* physics ---> TestLua/PhysicsTest -* spine ---> TestLua/SpineTest -* XMLHttpRequest ---> TestLua/XMLHttpRequestTest -* openGL ---> TestLua/OpenGLTest - -### Add more lua bindings -Such as: New Label、New EventDispatcher and AssetsManager,etc.Related test cases located in: - -* New Label ---> TestLua/LabelTestNew -* New EventDispatcher --->TestLua/NewEventDispatcherTest -* AssetsManager ---> TestLua/AssetsManagerTest - -### Replace some lua-bindings of Class or Struct with lua table -In the version 3.0, all the lua-binding of Struct type were replaced with the lua table - -Examples: - - | v2.1 | v3.0 | - | CCPoint | lua table | - | CCRect | lua table | - | CCColor3B | lua table | - | CCColor4B | lua table | - | CCColor4F | lua table | - | CCAffineTransform | lua table | - | CCArray | lua table | - | CCDictionary | lua table | - | CCPointArray | lua table | - -### Support lua script codes call Object-C codes and Java codes -`LuaObjcBridge` and `LuaJavaBridge` bound to lua supported lua script codes calls Object-C codes and java codes. - -### Add some lua files to store the constants of different modules - -* Cocos2DConstants.lua store the constants of `cc` module -* StudioConstants.lua store the constants of `ccs` module -* GuiConstants.lua store the constants of `ccui` module -* OpenglConstants.lua store the constants of `gl` module +TODO: The old Math API diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 69617309c0..ff618a8ac2 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -656,30 +656,32 @@ void ControlButton::onTouchEnded(Touch *pTouch, Event *pEvent) void ControlButton::setOpacity(GLubyte opacity) { - // XXX fixed me if not correct Control::setOpacity(opacity); -// _opacity = opacity; -// -// Ref* child; -// Array* children=getChildren(); -// CCARRAY_FOREACH(children, child) -// { -// RGBAProtocol* pNode = dynamic_cast(child); -// if (pNode) -// { -// pNode->setOpacity(opacity); -// } -// } for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) { iter->second->setOpacity(opacity); } + + for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) + { + iter->second->setOpacity(opacity); + } } -GLubyte ControlButton::getOpacity() const +void ControlButton::updateDisplayedOpacity(GLubyte parentOpacity) { - return _realOpacity; + Control::updateDisplayedOpacity(parentOpacity); + + for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) + { + iter->second->updateDisplayedOpacity(parentOpacity); + } + + for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) + { + iter->second->updateDisplayedOpacity(parentOpacity); + } } void ControlButton::setColor(const Color3B & color) @@ -690,11 +692,26 @@ void ControlButton::setColor(const Color3B & color) { iter->second->setColor(color); } + + for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) + { + iter->second->setColor(color); + } } -const Color3B& ControlButton::getColor() const +void ControlButton::updateDisplayedColor(const Color3B& parentColor) { - return _realColor; + Control::updateDisplayedColor(parentColor); + + for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) + { + iter->second->updateDisplayedColor(parentColor); + } + + for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) + { + iter->second->updateDisplayedColor(parentColor); + } } void ControlButton::onTouchCancelled(Touch *pTouch, Event *pEvent) diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index f471cc039c..cd73e63c5a 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -181,11 +181,11 @@ public: virtual void onTouchMoved(Touch *touch, Event *event) override; virtual void onTouchEnded(Touch *touch, Event *event) override; virtual void onTouchCancelled(Touch *touch, Event *event) override; - virtual GLubyte getOpacity(void) const override; - virtual void setOpacity(GLubyte var) override; - virtual const Color3B& getColor(void) const override; - virtual void setColor(const Color3B&) override; + virtual void setOpacity(GLubyte var) override; + virtual void updateDisplayedOpacity(GLubyte parentOpacity) override; + virtual void setColor(const Color3B&) override; + virtual void updateDisplayedColor(const Color3B& parentColor) override; const std::string& getCurrentTitle() const { return _currentTitle; }; std::string getCurrentTitle() { return _currentTitle; }; diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index ae8ac00a5f..4411ec4210 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -185,6 +185,15 @@ "cocos/2d/cocos2d_wp8.vcxproj.filters", "cocos/2d/cocos2d_wp8_headers.props", "cocos/2d/cocos2dx.props", + "cocos/3d/CCMesh.cpp", + "cocos/3d/CCMesh.h", + "cocos/3d/CCObjLoader.cpp", + "cocos/3d/CCObjLoader.h", + "cocos/3d/CCSprite3D.cpp", + "cocos/3d/CCSprite3D.h", + "cocos/3d/CCSprite3DDataCache.cpp", + "cocos/3d/CCSprite3DDataCache.h", + "cocos/3d/CMakeLists.txt", "cocos/Android.mk", "cocos/CMakeLists.txt", "cocos/audio/CMakeLists.txt", @@ -839,6 +848,8 @@ "cocos/platform/wp8/Direct3DBase.h", "cocos/platform/wp8/DirectXBase.cpp", "cocos/platform/wp8/DirectXBase.h", + "cocos/platform/wp8/pch.cpp", + "cocos/platform/wp8/pch.h", "cocos/platform/wp8/shaders/precompiledshaders.h", "cocos/renderer/CCBatchCommand.cpp", "cocos/renderer/CCBatchCommand.h", @@ -854,6 +865,8 @@ "cocos/renderer/CCGLProgramStateCache.h", "cocos/renderer/CCGroupCommand.cpp", "cocos/renderer/CCGroupCommand.h", + "cocos/renderer/CCMeshCommand.cpp", + "cocos/renderer/CCMeshCommand.h", "cocos/renderer/CCQuadCommand.cpp", "cocos/renderer/CCQuadCommand.h", "cocos/renderer/CCRenderCommand.cpp", @@ -870,6 +883,9 @@ "cocos/renderer/CMakeLists.txt", "cocos/renderer/ccGLStateCache.cpp", "cocos/renderer/ccGLStateCache.h", + "cocos/renderer/ccShader_3D_Color.frag", + "cocos/renderer/ccShader_3D_ColorTex.frag", + "cocos/renderer/ccShader_3D_PositionTex.vert", "cocos/renderer/ccShader_Label.vert", "cocos/renderer/ccShader_Label_df.frag", "cocos/renderer/ccShader_Label_df_glow.frag", @@ -3614,6 +3630,8 @@ "cocos/scripting/lua-bindings/auto/api/Follow.lua", "cocos/scripting/lua-bindings/auto/api/FrameData.lua", "cocos/scripting/lua-bindings/auto/api/GLProgram.lua", + "cocos/scripting/lua-bindings/auto/api/GLProgramCache.lua", + "cocos/scripting/lua-bindings/auto/api/GLProgramState.lua", "cocos/scripting/lua-bindings/auto/api/GLView.lua", "cocos/scripting/lua-bindings/auto/api/GLViewProtocol.lua", "cocos/scripting/lua-bindings/auto/api/GUIReader.lua", @@ -3651,6 +3669,7 @@ "cocos/scripting/lua-bindings/auto/api/MenuItemLabel.lua", "cocos/scripting/lua-bindings/auto/api/MenuItemSprite.lua", "cocos/scripting/lua-bindings/auto/api/MenuItemToggle.lua", + "cocos/scripting/lua-bindings/auto/api/Mesh.lua", "cocos/scripting/lua-bindings/auto/api/MotionStreak.lua", "cocos/scripting/lua-bindings/auto/api/MoveBy.lua", "cocos/scripting/lua-bindings/auto/api/MoveTo.lua", @@ -3748,6 +3767,7 @@ "cocos/scripting/lua-bindings/auto/api/SplitCols.lua", "cocos/scripting/lua-bindings/auto/api/SplitRows.lua", "cocos/scripting/lua-bindings/auto/api/Sprite.lua", + "cocos/scripting/lua-bindings/auto/api/Sprite3D.lua", "cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua", "cocos/scripting/lua-bindings/auto/api/SpriteDisplayData.lua", "cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua", diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 9246c8519e..5a4dae3841 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -52,9 +52,9 @@ include_directories( ${COCOS2D_ROOT} ${COCOS2D_ROOT}/cocos ${COCOS2D_ROOT}/cocos/audio/include - ${COCOS2D_ROOT}/cocos/2d/platform - ${COCOS2D_ROOT}/cocos/2d/platform/desktop - ${COCOS2D_ROOT}/cocos/2d/platform/linux + ${COCOS2D_ROOT}/cocos/platform + ${COCOS2D_ROOT}/cocos/platform/desktop + ${COCOS2D_ROOT}/cocos/platform/linux ${COCOS2D_ROOT}/cocos/editor-support ${COCOS2D_ROOT}/extensions ${COCOS2D_ROOT}/external diff --git a/templates/cpp-template-default/proj.android/build_native.py b/templates/cpp-template-default/proj.android/build_native.py index d8d303498e..15fc6912c3 100755 --- a/templates/cpp-template-default/proj.android/build_native.py +++ b/templates/cpp-template-default/proj.android/build_native.py @@ -89,7 +89,7 @@ def do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,and raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") elif android_platform is not None: sdk_tool_path = os.path.join(sdk_root, "tools/android") - cocoslib_path = os.path.join(cocos_root, "cocos/2d/platform/android/java") + cocoslib_path = os.path.join(cocos_root, "cocos/platform/android/java") command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) if os.system(command) != 0: raise Exception("update cocos lib-project [ " + cocoslib_path + " ] fails!") diff --git a/templates/lua-template-default/frameworks/CMakeLists.txt b/templates/lua-template-default/frameworks/CMakeLists.txt index 1fa676bb57..cb1df16d4c 100644 --- a/templates/lua-template-default/frameworks/CMakeLists.txt +++ b/templates/lua-template-default/frameworks/CMakeLists.txt @@ -58,9 +58,9 @@ include_directories( ${COCOS2D_ROOT} ${COCOS2D_ROOT}/cocos ${COCOS2D_ROOT}/cocos/audio/include - ${COCOS2D_ROOT}/cocos/2d/platform - ${COCOS2D_ROOT}/cocos/2d/platform/desktop - ${COCOS2D_ROOT}/cocos/2d/platform/linux + ${COCOS2D_ROOT}/cocos/platform + ${COCOS2D_ROOT}/cocos/platform/desktop + ${COCOS2D_ROOT}/cocos/platform/linux ${COCOS2D_ROOT}/cocos/editor-support ${COCOS2D_ROOT}/extensions ${COCOS2D_ROOT}/external diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index fe0b0c07c0..a6c20e1960 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -5,13 +5,41 @@ "runtime/config.json", "runtime/version.json" ], + "append_from_template": { + "from": "frameworks/runtime-src/proj.android", + "to": "frameworks/runtime-src/proj.android", + "exclude": [ + "bin", + "assets" + ] + }, "project_replace_project_name": { "src_project_name": "HelloLua", "files": [ "config.json", - ".project"] + ".project", + "frameworks/runtime-src/proj.android/.project", + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android/build.xml", + "frameworks/runtime-src/proj.android/res/values/strings.xml" + ] }, "append_dir": [ + { + "from": "cocos/platform/android/java", + "to": "frameworks/cocos2d-x/cocos/platform/android/java" + }, + { + "from": "cocos/scripting/lua-bindings/script", + "to": "frameworks/cocos2d-x/cocos/scripting/lua-bindings/script" + }, + { + "from": "external/lua/luasocket", + "to": "frameworks/cocos2d-x/external/lua/luasocket", + "include": [ + "*.lua" + ] + }, { "from": "cocos/scripting/lua-bindings/script", "to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources", @@ -104,9 +132,7 @@ "from": "frameworks/runtime-src", "to": "frameworks/runtime-src", "exclude": [ - "proj.android/bin", - "proj.android/assets", - "proj.android/libs", + "proj.android", "proj.ios_mac/HelloLua.xcodeproj/project.xcworkspace", "proj.ios_mac/HelloLua.xcodeproj/xcuserdata", "proj.win32/Debug.win32", @@ -139,10 +165,6 @@ "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", "frameworks/runtime-src/proj.win32/main.cpp", "frameworks/runtime-src/proj.win32/Runtime_win32.cpp", - "frameworks/runtime-src/proj.android/.project", - "frameworks/runtime-src/proj.android/AndroidManifest.xml", - "frameworks/runtime-src/proj.android/build.xml", - "frameworks/runtime-src/proj.android/res/values/strings.xml", "frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj index 386162ebb1..f744a086b5 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj @@ -90,10 +90,16 @@ 4 - - + + App.xaml.cs + + + EditBox.xaml.cs + + + MainPage.xaml.cs + - True @@ -148,15 +154,18 @@ - + + App.xaml MSBuild:Compile Designer - + + EditBox.xaml MSBuild:Compile Designer - + + MainPage.xaml MSBuild:Compile Designer diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 572a970cbd..f678d83b32 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -166,6 +166,7 @@ Classes/ShaderTest/ShaderTest.cpp \ Classes/ShaderTest/ShaderTest2.cpp \ Classes/SpineTest/SpineTest.cpp \ Classes/SpriteTest/SpriteTest.cpp \ +Classes/Sprite3DTest/Sprite3DTest.cpp \ Classes/TextInputTest/TextInputTest.cpp \ Classes/Texture2dTest/Texture2dTest.cpp \ Classes/TextureCacheTest/TextureCacheTest.cpp \ diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index eeec422504..f0e70599e7 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -159,6 +159,7 @@ set(SAMPLE_SRC Classes/ShaderTest/ShaderTest.cpp Classes/ShaderTest/ShaderTest2.cpp Classes/SpriteTest/SpriteTest.cpp + Classes/Sprite3DTest/Sprite3DTest.cpp Classes/TextInputTest/TextInputTest.cpp Classes/Texture2dTest/Texture2dTest.cpp Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp diff --git a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp index b352c5df50..2ec0db333b 100644 --- a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp +++ b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp @@ -13,12 +13,11 @@ else if (_pos > _max) \ // AccelerometerTest // //------------------------------------------------------------------ -AccelerometerTest::AccelerometerTest(void) -: _lastTime(0.0) +AccelerometerTest::AccelerometerTest() { } -AccelerometerTest::~AccelerometerTest(void) +AccelerometerTest::~AccelerometerTest() { _ball->release(); Device::setAccelerometerEnabled(false); @@ -50,34 +49,21 @@ void AccelerometerTest::onEnter() void AccelerometerTest::onAcceleration(Acceleration* acc, Event* event) { -// double fNow = pAccelerationValue->timestamp; -// -// if (_lastTime > 0.0) -// { -// auto ptNow = convertToUI -// } -// -// _lastTime = fNow; - - auto pDir = Director::getInstance(); - /*FIXME: Testing on the Nexus S sometimes _ball is NULL */ - if ( _ball == NULL ) { + if ( _ball == nullptr ) { return; } auto ballSize = _ball->getContentSize(); - auto ptNow = _ball->getPosition(); - auto ptTemp = pDir->convertToUI(ptNow); + auto pos = _ball->getPosition(); - ptTemp.x += acc->x * 9.81f; - ptTemp.y -= acc->y * 9.81f; + pos.x += acc->x * 9.81f; + pos.y += acc->y * 9.81f; - auto ptNext = pDir->convertToGL(ptTemp); - FIX_POS(ptNext.x, (VisibleRect::left().x+ballSize.width / 2.0), (VisibleRect::right().x - ballSize.width / 2.0)); - FIX_POS(ptNext.y, (VisibleRect::bottom().y+ballSize.height / 2.0), (VisibleRect::top().y - ballSize.height / 2.0)); - _ball->setPosition(ptNext); + FIX_POS(pos.x, (VisibleRect::left().x+ballSize.width / 2.0), (VisibleRect::right().x - ballSize.width / 2.0)); + FIX_POS(pos.y, (VisibleRect::bottom().y+ballSize.height / 2.0), (VisibleRect::top().y - ballSize.height / 2.0)); + _ball->setPosition(pos); } //------------------------------------------------------------------ diff --git a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.h b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.h index 72f5b0132c..28669d6a1a 100644 --- a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.h +++ b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.h @@ -9,11 +9,10 @@ class AccelerometerTest: public Layer { protected: Sprite* _ball; - double _lastTime; public: - AccelerometerTest(void); - ~AccelerometerTest(void); + AccelerometerTest(); + ~AccelerometerTest(); void onAcceleration(Acceleration* acc, Event* event); diff --git a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp index 763b7ea587..8783884961 100644 --- a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -157,8 +157,8 @@ void SpriteProgressToRadial::onEnter() auto s = Director::getInstance()->getWinSize(); - auto to1 = ProgressTo::create(2, 100); - auto to2 = ProgressTo::create(2, 100); + auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); + auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType( ProgressTimer::Type::RADIAL ); @@ -192,8 +192,8 @@ void SpriteProgressToHorizontal::onEnter() auto s = Director::getInstance()->getWinSize(); - auto to1 = ProgressTo::create(2, 100); - auto to2 = ProgressTo::create(2, 100); + auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); + auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType(ProgressTimer::Type::BAR); @@ -232,8 +232,8 @@ void SpriteProgressToVertical::onEnter() auto s = Director::getInstance()->getWinSize(); - auto to1 = ProgressTo::create(2, 100); - auto to2 = ProgressTo::create(2, 100); + auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); + auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType(ProgressTimer::Type::BAR); @@ -273,7 +273,7 @@ void SpriteProgressToRadialMidpointChanged::onEnter() auto s = Director::getInstance()->getWinSize(); - auto action = ProgressTo::create(2, 100); + auto action = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); /** * Our image on the left should be a radial progress indicator, clockwise @@ -317,7 +317,7 @@ void SpriteProgressBarVarious::onEnter() auto s = Director::getInstance()->getWinSize(); - auto to = ProgressTo::create(2, 100); + auto to = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0)); auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType(ProgressTimer::Type::BAR); @@ -367,7 +367,7 @@ void SpriteProgressBarTintAndFade::onEnter() auto s = Director::getInstance()->getWinSize(); - auto to = ProgressTo::create(6, 100); + auto to = Sequence::createWithTwoActions(ProgressTo::create(6, 100), ProgressTo::create(0, 0)); auto tint = Sequence::create(TintTo::create(1, 255, 0, 0), TintTo::create(1, 0, 255, 0), TintTo::create(1, 0, 0, 255), @@ -434,7 +434,7 @@ void SpriteProgressWithSpriteFrame::onEnter() auto s = Director::getInstance()->getWinSize(); - auto to = ProgressTo::create(6, 100); + auto to = Sequence::createWithTwoActions(ProgressTo::create(6, 100), ProgressTo::create(0, 0)); SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist"); diff --git a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp index 4bac8b0ba4..de8ad35a0e 100644 --- a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp +++ b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp @@ -27,7 +27,7 @@ KeypadTest::~KeypadTest() void KeypadTest::onKeyReleased(EventKeyboard::KeyCode keycode, Event* event) { - if (keycode == EventKeyboard::KeyCode::KEY_BACKSPACE) + if (keycode == EventKeyboard::KeyCode::KEY_ESCAPE) { _label->setString("BACK clicked!"); } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp index 914bd46a87..745be44c23 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp @@ -31,7 +31,7 @@ struct { { "Texture Perf Test",[](Ref*sender){runTextureTest();} }, { "Touches Perf Test",[](Ref*sender){runTouchesTest();} }, { "Label Perf Test",[](Ref*sender){runLabelTest();} }, - { "Renderer Perf Test",[](Ref*sender){runRendererTest();} }, + //{ "Renderer Perf Test",[](Ref*sender){runRendererTest();} }, { "Container Perf Test", [](Ref* sender ) { runContainerPerformanceTest(); } }, { "EventDispatcher Perf Test", [](Ref* sender ) { runEventDispatcherPerformanceTest(); } }, { "Scenario Perf Test", [](Ref* sender ) { runScenarioTest(); } }, diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp new file mode 100644 index 0000000000..1554538efb --- /dev/null +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -0,0 +1,486 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "Sprite3DTest.h" + +#include +#include "../testResource.h" + +enum +{ + IDC_NEXT = 100, + IDC_BACK, + IDC_RESTART +}; + +static int sceneIdx = -1; + + +static std::function createFunctions[] = +{ + CL(Sprite3DBasicTest), + CL(Sprite3DEffectTest) +}; + +#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) + +static Layer* nextSpriteTestAction() +{ + sceneIdx++; + sceneIdx = sceneIdx % MAX_LAYER; + + auto layer = (createFunctions[sceneIdx])(); + return layer; +} + +static Layer* backSpriteTestAction() +{ + sceneIdx--; + int total = MAX_LAYER; + if( sceneIdx < 0 ) + sceneIdx += total; + + auto layer = (createFunctions[sceneIdx])(); + return layer; +} + +static Layer* restartSpriteTestAction() +{ + auto layer = (createFunctions[sceneIdx])(); + return layer; +} + +//------------------------------------------------------------------ +// +// SpriteTestDemo +// +//------------------------------------------------------------------ + +Sprite3DTestDemo::Sprite3DTestDemo(void) +: BaseTest() +{ +} + +Sprite3DTestDemo::~Sprite3DTestDemo(void) +{ +} + +std::string Sprite3DTestDemo::title() const +{ + return "No title"; +} + +std::string Sprite3DTestDemo::subtitle() const +{ + return ""; +} + +void Sprite3DTestDemo::onEnter() +{ + BaseTest::onEnter(); +} + +void Sprite3DTestDemo::restartCallback(Ref* sender) +{ + auto s = new Sprite3DTestScene(); + s->addChild(restartSpriteTestAction()); + + Director::getInstance()->replaceScene(s); + s->release(); +} + +void Sprite3DTestDemo::nextCallback(Ref* sender) +{ + auto s = new Sprite3DTestScene(); + s->addChild( nextSpriteTestAction() ); + Director::getInstance()->replaceScene(s); + s->release(); +} + +void Sprite3DTestDemo::backCallback(Ref* sender) +{ + auto s = new Sprite3DTestScene(); + s->addChild( backSpriteTestAction() ); + Director::getInstance()->replaceScene(s); + s->release(); +} + + +//------------------------------------------------------------------ +// +// Sprite3DBasicTest +// +//------------------------------------------------------------------ + +Sprite3DBasicTest::Sprite3DBasicTest() +{ + auto listener = EventListenerTouchAllAtOnce::create(); + listener->onTouchesEnded = CC_CALLBACK_2(Sprite3DBasicTest::onTouchesEnded, this); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); + + auto s = Director::getInstance()->getWinSize(); + addNewSpriteWithCoords( Vec2(s.width/2, s.height/2) ); +} + +void Sprite3DBasicTest::addNewSpriteWithCoords(Vec2 p) +{ + //int idx = (int)(CCRANDOM_0_1() * 1400.0f / 100.0f); + //int x = (idx%5) * 85; + //int y = (idx/5) * 121; + +// //option 1: load a obj that contain the texture in it +// auto sprite = Sprite3D::create("sprite3dTest/scene01.obj"); + + //option 2: load obj and assign the texture + auto sprite = Sprite3D::create("Sprite3DTest/boss1.obj"); + sprite->setScale(3.f); + sprite->setTexture("Sprite3DTest/boss.png"); + + // + //sprite->setEffect(cocos2d::EFFECT_OUTLINE); + + //add to scene + addChild( sprite ); + + sprite->setPosition( Vec2( p.x, p.y) ); + + ActionInterval* action; + float random = CCRANDOM_0_1(); + + if( random < 0.20 ) + action = ScaleBy::create(3, 2); + else if(random < 0.40) + action = RotateBy::create(3, 360); + else if( random < 0.60) + action = Blink::create(1, 3); + else if( random < 0.8 ) + action = TintBy::create(2, 0, -255, -255); + else + action = FadeOut::create(2); + auto action_back = action->reverse(); + auto seq = Sequence::create( action, action_back, NULL ); + + sprite->runAction( RepeatForever::create(seq) ); +} + +void Sprite3DBasicTest::onTouchesEnded(const std::vector& touches, Event* event) +{ + for (auto touch: touches) + { + auto location = touch->getLocation(); + + addNewSpriteWithCoords( location ); + } +} + +std::string Sprite3DBasicTest::title() const +{ + return "Testing Sprite3D"; +} + +std::string Sprite3DBasicTest::subtitle() const +{ + return "Tap screen to add more sprites"; +} + +void Sprite3DTestScene::runThisTest() +{ + auto layer = nextSpriteTestAction(); + addChild(layer); + + Director::getInstance()->replaceScene(this); +} + +static int tuple_sort( const std::tuple &tuple1, const std::tuple &tuple2 ) +{ + return std::get<0>(tuple1) < std::get<0>(tuple2); +} + +EffectSprite3D* EffectSprite3D::createFromObjFileAndTexture(const std::string &objFilePath, const std::string &textureFilePath) +{ + auto sprite = new EffectSprite3D(); + if (sprite && sprite->initWithFile(objFilePath)) + { + sprite->autorelease(); + sprite->setTexture(textureFilePath); + return sprite; + } + CC_SAFE_DELETE(sprite); + return nullptr; +} + +EffectSprite3D::EffectSprite3D() +: _defaultEffect(nullptr) +{ + +} + +EffectSprite3D::~EffectSprite3D() +{ + for(auto effect : _effects) + { + CC_SAFE_RELEASE_NULL(std::get<1>(effect)); + } + CC_SAFE_RELEASE(_defaultEffect); +} + +void EffectSprite3D::setEffect3D(Effect3D *effect) +{ + if(_defaultEffect == effect) return; + CC_SAFE_RETAIN(effect); + CC_SAFE_RELEASE(_defaultEffect); + _defaultEffect = effect; +} + +void EffectSprite3D::addEffect(Effect3DOutline* effect, ssize_t order) +{ + if(nullptr == effect) return; + effect->retain(); + + _effects.push_back(std::make_tuple(order,effect,CustomCommand())); + + std::sort(std::begin(_effects), std::end(_effects), tuple_sort); +} + +const std::string Effect3DOutline::_vertShaderFile = "Shaders3D/OutLine.vert"; +const std::string Effect3DOutline::_fragShaderFile = "Shaders3D/OutLine.frag"; +const std::string Effect3DOutline::_keyInGLProgramCache = "Effect3DLibrary_Outline"; +GLProgram* Effect3DOutline::getOrCreateProgram() +{ + auto program = GLProgramCache::getInstance()->getGLProgram(_keyInGLProgramCache); + if(program == nullptr) + { + program = GLProgram::createWithFilenames(_vertShaderFile, _fragShaderFile); + GLProgramCache::getInstance()->addGLProgram(program, _keyInGLProgramCache); + } + return program; +} + +Effect3DOutline* Effect3DOutline::create() +{ + Effect3DOutline* effect = new Effect3DOutline(); + if(effect && effect->init()) + { + effect->autorelease(); + return effect; + } + else + { + CC_SAFE_DELETE(effect); + return nullptr; + } +} + +bool Effect3DOutline::init() +{ + + GLProgram* glprogram = Effect3DOutline::getOrCreateProgram(); + if(nullptr == glprogram) + { + CC_SAFE_DELETE(glprogram); + return false; + } + _glProgramState = GLProgramState::create(glprogram); + if(nullptr == _glProgramState) + { + return false; + } + _glProgramState->retain(); + _glProgramState->setUniformVec3("OutLineColor", _outlineColor); + _glProgramState->setUniformFloat("OutlineWidth", _outlineWidth); + + return true; +} + +Effect3DOutline::Effect3DOutline() +: _outlineWidth(1.0f) +, _outlineColor(1, 1, 1) +{ + +} + +Effect3DOutline::~Effect3DOutline() +{ +} + +void Effect3DOutline::setOutlineColor(const Vec3& color) +{ + if(_outlineColor != color) + { + _outlineColor = color; + _glProgramState->setUniformVec3("OutLineColor", _outlineColor); + } +} + +void Effect3DOutline::setOutlineWidth(float width) +{ + if(_outlineWidth != width) + { + _outlineWidth = width; + _glProgramState->setUniformFloat("OutlineWidth", _outlineWidth); + } +} + +void Effect3DOutline::drawWithSprite(EffectSprite3D* sprite, const Mat4 &transform) +{ + auto mesh = sprite->getMesh(); + long offset = 0; + for (auto i = 0; i < mesh->getMeshVertexAttribCount(); i++) + { + auto meshvertexattrib = mesh->getMeshVertexAttribute(i); + + _glProgramState->setVertexAttribPointer(s_attributeNames[meshvertexattrib.vertexAttrib], + meshvertexattrib.size, + meshvertexattrib.type, + GL_FALSE, + mesh->getVertexSizeInBytes(), + (void*)offset); + offset += meshvertexattrib.attribSizeBytes; + } + //draw + { + glEnable(GL_CULL_FACE); + glCullFace(GL_FRONT); + glEnable(GL_DEPTH_TEST); + Color4F color(sprite->getDisplayedColor()); + color.a = sprite->getDisplayedOpacity() / 255.0f; + + _glProgramState->setUniformVec4("u_color", Vec4(color.r, color.g, color.b, color.a)); + + auto mesh = sprite->getMesh(); + glBindBuffer(GL_ARRAY_BUFFER, mesh->getVertexBuffer()); + _glProgramState->apply(transform); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh->getIndexBuffer()); + glDrawElements((GLenum)mesh->getPrimitiveType(), mesh->getIndexCount(), (GLenum)mesh->getIndexFormat(), 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glDisable(GL_DEPTH_TEST); + glCullFace(GL_BACK); + glDisable(GL_CULL_FACE); + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, mesh->getIndexCount()); + } +} + +void EffectSprite3D::draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, bool transformUpdated) +{ + for(auto &effect : _effects) + { + if(std::get<0>(effect) >=0) + break; + CustomCommand &cc = std::get<2>(effect); + cc.func = CC_CALLBACK_0(Effect3D::drawWithSprite,std::get<1>(effect),this,transform); + renderer->addCommand(&cc); + + } + + if(!_defaultEffect) + { + Sprite3D::draw(renderer, transform, transformUpdated); + } + else + { + _command.init(_globalZOrder); + _command.func = CC_CALLBACK_0(Effect3D::drawWithSprite, _defaultEffect, this, transform); + renderer->addCommand(&_command); + } + + for(auto &effect : _effects) + { + if(std::get<0>(effect) <=0) + continue; + CustomCommand &cc = std::get<2>(effect); + cc.func = CC_CALLBACK_0(Effect3D::drawWithSprite,std::get<1>(effect),this,transform); + renderer->addCommand(&cc); + + } +} + +Sprite3DEffectTest::Sprite3DEffectTest() +{ + auto s = Director::getInstance()->getWinSize(); + addNewSpriteWithCoords( Vec2(s.width/2, s.height/2) ); + + auto listener = EventListenerTouchAllAtOnce::create(); + listener->onTouchesEnded = CC_CALLBACK_2(Sprite3DEffectTest::onTouchesEnded, this); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); +} + +std::string Sprite3DEffectTest::title() const +{ + return "Testing Sprite3D"; +} +std::string Sprite3DEffectTest::subtitle() const +{ + return "Sprite3d with effects"; +} + +void Sprite3DEffectTest::addNewSpriteWithCoords(Vec2 p) +{ + //option 2: load obj and assign the texture + auto sprite = EffectSprite3D::createFromObjFileAndTexture("Sprite3DTest/boss1.obj", "Sprite3DTest/boss.png"); + Effect3DOutline* effect = Effect3DOutline::create(); + effect->setOutlineColor(Vec3(1,0,0)); + effect->setOutlineWidth(0.01f); + sprite->addEffect(effect, -1); + Effect3DOutline* effect2 = Effect3DOutline::create(); + effect2->setOutlineWidth(0.02f); + effect2->setOutlineColor(Vec3(1,1,0)); + sprite->addEffect(effect2, -2); + //sprite->setEffect3D(effect); + sprite->setScale(6.f); + + //add to scene + addChild( sprite ); + + sprite->setPosition( Vec2( p.x, p.y) ); + + ActionInterval* action; + float random = CCRANDOM_0_1(); + + if( random < 0.20 ) + action = ScaleBy::create(3, 2); + else if(random < 0.40) + action = RotateBy::create(3, 360); + else if( random < 0.60) + action = Blink::create(1, 3); + else if( random < 0.8 ) + action = TintBy::create(2, 0, -255, -255); + else + action = FadeOut::create(2); + auto action_back = action->reverse(); + auto seq = Sequence::create( action, action_back, NULL ); + + sprite->runAction( RepeatForever::create(seq) ); +} + +void Sprite3DEffectTest::onTouchesEnded(const std::vector& touches, Event* event) +{ + for (auto touch: touches) + { + auto location = touch->getLocation(); + + addNewSpriteWithCoords( location ); + } +} diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h new file mode 100644 index 0000000000..20a67bfd9e --- /dev/null +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -0,0 +1,142 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef _SPRITE3D_TEST_H_ +#define _SPRITE3D_TEST_H_ + +#include "../testBasic.h" +#include "../BaseTest.h" +#include + +class Sprite3DTestDemo : public BaseTest +{ +public: + Sprite3DTestDemo(void); + virtual ~Sprite3DTestDemo(void); + + void restartCallback(Ref* sender); + void nextCallback(Ref* sender); + void backCallback(Ref* sender); + + // overrides + virtual std::string title() const override; + virtual std::string subtitle() const override; + virtual void onEnter() override; + +protected: + std::string _title; +}; + +class Sprite3DBasicTest : public Sprite3DTestDemo +{ +public: + CREATE_FUNC(Sprite3DBasicTest); + Sprite3DBasicTest(); + virtual std::string title() const override; + virtual std::string subtitle() const override; + + void addNewSpriteWithCoords(Vec2 p); + void onTouchesEnded(const std::vector& touches, Event* event); +}; + +class EffectSprite3D; + +class Effect3D : public Ref +{ +public: + virtual void drawWithSprite(EffectSprite3D* sprite, const Mat4 &transform) = 0; +protected: + Effect3D() : _glProgramState(nullptr) {} + virtual ~Effect3D() + { + CC_SAFE_RELEASE(_glProgramState); + } +protected: + GLProgramState* _glProgramState; +}; + +class Effect3DOutline: public Effect3D +{ +public: + static Effect3DOutline* create(); + + void setOutlineColor(const Vec3& color); + + void setOutlineWidth(float width); + + void drawWithSprite(EffectSprite3D* sprite, const Mat4 &transform); + +protected: + + Effect3DOutline(); + virtual ~Effect3DOutline(); + + bool init(); + + Vec3 _outlineColor; + float _outlineWidth; + +protected: + static const std::string _vertShaderFile; + static const std::string _fragShaderFile; + static const std::string _keyInGLProgramCache; + static GLProgram* getOrCreateProgram(); +}; + +class EffectSprite3D : public Sprite3D +{ +public: + static EffectSprite3D* createFromObjFileAndTexture(const std::string& objFilePath, const std::string& textureFilePath); + void setEffect3D(Effect3D* effect); + void addEffect(Effect3DOutline* effect, ssize_t order); + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; +protected: + EffectSprite3D(); + virtual ~EffectSprite3D(); + + std::vector> _effects; + Effect3D* _defaultEffect; + CustomCommand _command; +}; + +class Sprite3DEffectTest : public Sprite3DTestDemo +{ +public: + CREATE_FUNC(Sprite3DEffectTest); + Sprite3DEffectTest(); + virtual std::string title() const override; + virtual std::string subtitle() const override; + + void addNewSpriteWithCoords(Vec2 p); + + void onTouchesEnded(const std::vector& touches, Event* event); +}; + +class Sprite3DTestScene : public TestScene +{ +public: + virtual void runThisTest(); +}; + +#endif diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index d7a0e0eef4..a3c4c749b9 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -1951,34 +1951,34 @@ void TextureMemoryAlloc::updateImage(cocos2d::Ref *sender) switch (tag) { case 0: - file = "Images/test_1021x1024.png"; + file = "Images/background.png"; break; #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) // android can not pack .gz file into apk file case 1: - file = "Images/test_1021x1024_rgba8888.pvr"; + file = "Images/fire_rgba8888.pvr"; break; case 2: - file = "Images/test_1021x1024_rgb888.pvr"; + file = "Images/grossini_prv_rgba8888.pvr"; break; case 3: - file = "Images/test_1021x1024_rgba4444.pvr"; + file = "Images/grossini_prv_rgba4444.pvr"; break; case 4: - file = "Images/test_1021x1024_a8.pvr"; + file = "Images/test_image_a8.pvr"; break; #else case 1: - file = "Images/test_1021x1024_rgba8888.pvr.gz"; + file = "Images/test_image_rgba4444.pvr.gz"; break; case 2: - file = "Images/test_1021x1024_rgb888.pvr.gz"; + file = "Images/test_image_rgba4444.pvr.gz"; break; case 3: - file = "Images/test_1021x1024_rgba4444.pvr.gz"; + file = "Images/test_image_rgba4444.pvr.gz"; break; case 4: - file = "Images/test_1021x1024_a8.pvr.gz"; + file = "Images/test_image_rgba4444.pvr.gz"; break; #endif } diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 2eb8c52ce7..5946fff6ee 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -34,7 +34,6 @@ Controller g_aTestNames[] = { // TESTS MUST BE ORDERED ALPHABETICALLY // violators will be prosecuted // - { "A new UI", [](){ return new UITestScene(); }}, { "Accelerometer", []() { return new AccelerometerTestScene(); } }, { "ActionManager", [](){return new ActionManagerTestScene(); } }, { "Actions - Basic", [](){ return new ActionsTestScene(); } }, @@ -87,8 +86,10 @@ Controller g_aTestNames[] = { { "Node: Scene", [](){return new SceneTestScene();} }, { "Node: Spine", []() { return new SpineTestScene(); } }, { "Node: Sprite", [](){return new SpriteTestScene(); } }, + { "Node: Sprite3D", [](){ return new Sprite3DTestScene(); }}, { "Node: TileMap", [](){return new TileMapTestScene(); } }, { "Node: Text Input", [](){return new TextInputTestScene(); } }, + { "Node: UI", [](){ return new UITestScene(); }}, { "Mouse", []() { return new MouseTestScene(); } }, { "MutiTouch", []() { return new MutiTouchTestScene(); } }, { "Performance tests", []() { return new PerformanceTestScene(); } }, diff --git a/tests/cpp-tests/Classes/tests.h b/tests/cpp-tests/Classes/tests.h index 9e20f96590..06ec824dc7 100644 --- a/tests/cpp-tests/Classes/tests.h +++ b/tests/cpp-tests/Classes/tests.h @@ -70,4 +70,6 @@ #include "PhysicsTest/PhysicsTest.h" #include "ReleasePoolTest/ReleasePoolTest.h" +#include "Sprite3DTest/Sprite3DTest.h" + #endif diff --git a/tests/cpp-tests/Resources/Images/test_image_a8.pvr b/tests/cpp-tests/Resources/Images/test_image_a8.pvr index c22a440b14..bcd6f26855 100755 Binary files a/tests/cpp-tests/Resources/Images/test_image_a8.pvr and b/tests/cpp-tests/Resources/Images/test_image_a8.pvr differ diff --git a/tests/cpp-tests/Resources/Shaders3D/OutLine.frag b/tests/cpp-tests/Resources/Shaders3D/OutLine.frag new file mode 100644 index 0000000000..dd6e60a6a7 --- /dev/null +++ b/tests/cpp-tests/Resources/Shaders3D/OutLine.frag @@ -0,0 +1,7 @@ +uniform vec3 OutLineColor; +uniform vec4 u_color; + +void main(void) +{ + gl_FragColor = vec4(OutLineColor,1.0) * u_color; +} diff --git a/tests/cpp-tests/Resources/Shaders3D/OutLine.vert b/tests/cpp-tests/Resources/Shaders3D/OutLine.vert new file mode 100644 index 0000000000..f4cd386b34 --- /dev/null +++ b/tests/cpp-tests/Resources/Shaders3D/OutLine.vert @@ -0,0 +1,13 @@ +attribute vec4 a_position; +attribute vec3 a_normal; +uniform float OutlineWidth; + +void main(void) +{ + vec4 pos = CC_MVPMatrix * a_position; + vec4 normalproj = CC_MVPMatrix * vec4(a_normal, 0); + normalproj = normalize(normalproj); + pos.xy += normalproj.xy * (OutlineWidth * (pos.z * 0.5 + 0.5)); + + gl_Position = pos; +} diff --git a/tests/cpp-tests/Resources/Sprite3DTest/boss.obj b/tests/cpp-tests/Resources/Sprite3DTest/boss.obj new file mode 100644 index 0000000000..97154a2568 --- /dev/null +++ b/tests/cpp-tests/Resources/Sprite3DTest/boss.obj @@ -0,0 +1,1575 @@ +# WaveFront *.obj file (generated by CINEMA 4D) + +g Object +v 2.152745 1.129535 -2.654346 +v 2.018903 1.184975 -2.654349 +v 2.018903 1.184975 -0.076443 +v 2.152745 1.129537 -0.076443 +v 1.885062 1.129535 -2.654346 +v 1.885062 1.129537 -0.076443 +v 1.829623 0.995695 -2.654346 +v 1.829623 0.995695 -0.076443 +v 1.885062 0.861856 -2.654346 +v 1.885062 0.861855 -0.076443 +v 2.018903 0.806415 -2.654346 +v 2.018903 0.806415 -0.076443 +v 2.152745 0.861856 -2.654346 +v 2.152745 0.861855 -0.076443 +v 2.208183 0.995695 -2.654346 +v 2.208183 0.995695 -0.076443 +v 2.018903 0.995695 0.076003 +v 2.018903 0.995931 -2.778477 +v -2.152745 1.129535 -2.654346 +v -2.018903 1.184975 -2.654349 +v -2.018903 1.184975 -0.076443 +v -2.152745 1.129537 -0.076443 +v -1.885062 1.129535 -2.654346 +v -1.885062 1.129537 -0.076443 +v -1.829623 0.995695 -2.654346 +v -1.829623 0.995695 -0.076443 +v -1.885062 0.861856 -2.654346 +v -1.885062 0.861855 -0.076443 +v -2.018903 0.806415 -2.654346 +v -2.018903 0.806415 -0.076443 +v -2.152745 0.861856 -2.654346 +v -2.152745 0.861855 -0.076443 +v -2.208183 0.995695 -2.654346 +v -2.208183 0.995695 -0.076443 +v -2.018903 0.995695 0.076003 +v -2.018903 0.995931 -2.778477 +v -0.549117 -0.880255 7.049499 +v -0.549117 -0.366897 7.049499 +v -0.549117 -0.231349 7.400979 +v -0.549117 -0.590024 7.42836 +v -2.221097 -0.740847 -0.204388 +v -4.208594 -0.740847 -0.896515 +v -2.221097 0.158004 -0.204388 +v -4.208594 0.158004 -0.896515 +v -2.221097 0.158004 -3.981237 +v -4.208594 0.158004 -3.516596 +v -2.221097 -0.740847 -3.981237 +v -4.208594 -0.740847 -3.516596 +v -2.032921 0.247995 3.029242 +v -1.460364 0.247995 2.792081 +v -0.887809 0.247995 3.029242 +v -0.650649 0.247995 3.601797 +v -0.887809 0.247995 4.174353 +v -1.460364 0.247995 4.411513 +v -2.032921 0.247995 4.174353 +v -2.270081 0.247995 3.601797 +v -2.538304 0.759102 -6.135367 +v -1.965749 0.759102 -6.372528 +v -1.393193 0.759102 -6.135367 +v -1.156033 0.759102 -5.562812 +v -1.393193 0.759102 -4.990256 +v -1.965749 0.759102 -4.753095 +v -2.538304 0.759102 -4.990255 +v -2.775465 0.759102 -5.562812 +v -2.538304 1.408424 -6.135367 +v -1.965749 1.408424 -6.372528 +v -1.393193 1.408424 -6.135367 +v -1.156033 1.408424 -5.562812 +v -1.393193 1.408424 -4.990256 +v -1.965749 1.408424 -4.753095 +v -2.538304 1.408424 -4.990255 +v -2.775465 1.408424 -5.562812 +v -1.965749 1.408424 -5.562812 +v -1.666678 1.334443 -5.145707 +v -2.299088 1.334443 -5.145707 +v -1.666678 1.966853 -5.145707 +v -2.299088 1.966853 -5.145707 +v -1.666678 1.966853 -5.778117 +v -2.299088 1.966853 -5.778117 +v -1.666678 1.334443 -5.778117 +v -2.299088 1.334443 -5.778117 +v -2.036188 1.638001 -5.21675 +v -1.963871 1.667955 -5.216752 +v -1.891555 1.638001 -5.21675 +v 1.735587 0.649931 2.372068 +v 2.276793 0.598225 2.359797 +v 0 -0.880255 7.049499 +v 1.813632 0.760322 -4.076154 +v 0 -0.865952 7.228139 +v 0.525472 0.759814 -4.076156 +v 0.52502 0.704589 1.837225 +v 1.043754 0.65004 2.37211 +v 1.735587 0.771575 2.372068 +v 1.813248 0.882105 0.751968 +v 2.276793 0.719869 2.359797 +v 3.007264 0.675615 0.751926 +v 1.813632 0.881966 -4.076154 +v 3.008201 0.675603 -4.076154 +v 0.525481 0.882195 0.75201 +v 0.525481 0.882292 -4.076154 +v 0.525481 0.826994 1.840059 +v 1.043754 0.771684 2.37211 +v 0.525011 0.758956 0.749175 +v 3.007732 0.553965 -0.738622 +v 3.007732 0.675609 -0.738622 +v 1.81344 0.882035 -0.738601 +v 0.525481 0.882244 -0.73858 +v 0.525241 0.759385 -0.739998 +v -0.549117 -0.399614 7.049499 +v 0.620102 1.844369 -3.601022 +v 0.846037 1.755779 -3.71401 +v 1.310041 0.672056 -4.076154 +v 1.16988 2.894725 -3.501955 +v 1.269897 2.855507 -3.551973 +v 1.132038 2.932909 -3.607564 +v 1.036546 0.428545 5.751309 +v 1.315024 0.760461 0.751968 +v 1.836507 0.376839 5.864282 +v 3.007264 0.553971 0.751926 +v 1.315409 0.760322 -4.076154 +v 3.008201 0.553959 -4.076154 +v 1.232055 2.893691 -3.657582 +v 0 0.760648 -4.076154 +v 0 0.428762 5.751394 +v 0.981744 -0.879086 7.062063 +v 0.981744 0.008673 7.062063 +v 0.534619 1.930626 -3.839588 +v 1.310041 -1.310041 -4.076154 +v 2.997463 -0.990787 -4.076154 +v 2.997463 0.46602 -4.076154 +v 2.997463 0.46602 0.749076 +v 1.310041 -1.310041 0.749076 +v 2.997463 -0.990787 0.749076 +v 1.827392 -0.716184 6.50097 +v 1.25879 -0.770909 7.062063 +v 1.827643 0.288876 5.858582 +v 1.254241 -0.019801 7.062063 +v 0.981744 -0.879086 -8.433464 +v 0.981744 0.879086 -8.433464 +v 1.310041 1.310041 -4.605186 +v 1.310041 -1.310041 -4.605186 +v 2.997463 -0.990787 -4.605186 +v 2.132894 -0.664855 -8.433464 +v 2.997463 0.990787 -4.605186 +v 2.132894 0.664855 -8.433464 +v 2.997463 0.990787 -6.807402 +v 1.310041 1.310041 -6.807402 +v 1.310041 -1.310041 -6.807402 +v 2.997463 -0.990787 -6.807402 +v 3.090473 -0.421017 -4.647384 +v 3.935092 -0.421017 -4.647384 +v 3.090473 0.421017 -4.647384 +v 3.935092 0.421017 -4.647384 +v 3.090473 0.421017 -7.4454 +v 3.935092 0.421017 -7.4454 +v 3.090473 -0.421017 -7.4454 +v 3.935092 -0.421017 -7.4454 +v 3.090473 0.421017 -8.572815 +v 3.620514 0.421017 -8.572815 +v 3.620514 -0.421017 -8.572815 +v 3.090473 -0.421017 -8.572815 +v 1.310041 0.670313 -2.111028 +v 0.655086 0.670313 -0.750658 +v 1.310041 1.517316 -2.111028 +v 0.655086 1.106749 -0.750658 +v 0.655086 1.517316 -4.069324 +v 1.310041 1.517316 -3.4212 +v 1.310041 0.670313 -3.4212 +v 0.655086 0.670313 -4.069324 +v -1.861601 1.565685 -5.216749 +v -1.891555 1.493369 -5.21675 +v -1.963871 1.463414 -5.21675 +v -2.036188 1.493369 -5.21675 +v -2.066142 1.565685 -5.216749 +v -2.036188 1.638001 -4.177855 +v -1.963871 1.667955 -4.177855 +v -1.891555 1.638001 -4.177855 +v -1.861601 1.565685 -4.177855 +v -1.891555 1.493369 -4.177855 +v -1.963871 1.463414 -4.177855 +v -2.036188 1.493369 -4.177855 +v -2.066142 1.565685 -4.177855 +v -1.963871 1.565685 -4.177855 +v -2.036188 1.877795 -5.21675 +v -1.963871 1.907749 -5.216752 +v -1.891555 1.877795 -5.21675 +v -1.861601 1.805479 -5.216749 +v -1.891555 1.733163 -5.21675 +v -1.963871 1.703208 -5.21675 +v -2.036188 1.733163 -5.21675 +v -2.066142 1.805479 -5.216749 +v -2.036188 1.877795 -4.177855 +v -1.963871 1.907749 -4.177855 +v -1.891555 1.877795 -4.177855 +v -1.861601 1.805479 -4.177855 +v -1.891555 1.733163 -4.177855 +v -1.963871 1.703208 -4.177855 +v -2.036188 1.733163 -4.177855 +v -2.066142 1.805479 -4.177855 +v -1.963871 1.805479 -4.177855 +v 0 -1.459791 -3.956097 +v -7.609053 -1.069013 0.551177 +v 1.209824 2.146268 -4.643119 +v 0.549117 -0.865952 7.228139 +v 0.549117 0.004196 7.228139 +v 0.549117 -0.017407 7.0495 +v 0.549117 -0.880255 7.049499 +v 0.549117 -0.366897 7.049499 +v 0.549117 -0.231349 7.400979 +v 0.549117 -0.590024 7.42836 +v 2.221097 -0.740847 -0.204388 +v 4.208594 -0.740847 -0.896515 +v 2.221097 0.158004 -0.204388 +v 4.208594 0.158004 -0.896515 +v 2.221097 0.158004 -3.981237 +v 4.208594 0.158004 -3.516596 +v 2.221097 -0.740847 -3.981237 +v 4.208594 -0.740847 -3.516596 +v 2.032921 0.247995 3.029242 +v 1.460364 0.247995 2.792081 +v 0.887809 0.247995 3.029242 +v 0.650649 0.247995 3.601797 +v 0.887809 0.247995 4.174353 +v 1.460364 0.247995 4.411513 +v 2.032921 0.247995 4.174353 +v 2.270081 0.247995 3.601797 +v -7.609053 -0.765268 0.551177 +v 0.522715 2.473121 -4.605861 +v -7.609053 -0.765268 -0.649518 +v 0.021794 2.612102 -4.048994 +v -7.609053 -1.069013 -0.649518 +v 0 -1.459791 6.071965 +v -5.143484 -1.069013 0.812165 +v 0 -0.765268 6.071965 +v -5.143484 -0.765268 0.812165 +v 2.538304 0.759102 -6.135367 +v 1.965749 0.759102 -6.372528 +v 1.393193 0.759102 -6.135367 +v 1.156033 0.759102 -5.562812 +v 1.393193 0.759102 -4.990256 +v 1.965749 0.759102 -4.753095 +v 2.538304 0.759102 -4.990255 +v 2.775465 0.759102 -5.562812 +v 2.538304 1.408424 -6.135367 +v 1.965749 1.408424 -6.372528 +v 1.393193 1.408424 -6.135367 +v 1.156033 1.408424 -5.562812 +v 1.393193 1.408424 -4.990256 +v 1.965749 1.408424 -4.753095 +v 2.538304 1.408424 -4.990255 +v 2.775465 1.408424 -5.562812 +v 1.965749 1.408424 -5.562812 +v 1.666678 1.334443 -5.145707 +v 2.299088 1.334443 -5.145707 +v 1.666678 1.966853 -5.145707 +v 2.299088 1.966853 -5.145707 +v 1.666678 1.966853 -5.778117 +v 2.299088 1.966853 -5.778117 +v 1.666678 1.334443 -5.778117 +v 2.299088 1.334443 -5.778117 +v 2.036188 1.638001 -5.21675 +v 1.963871 1.667955 -5.216752 +v 1.891555 1.638001 -5.21675 +v 1.861601 1.565685 -5.216749 +v 1.891555 1.493369 -5.21675 +v 1.963871 1.463414 -5.21675 +v 2.036188 1.493369 -5.21675 +v 2.066142 1.565685 -5.216749 +v 2.036188 1.638001 -4.177855 +v 1.963871 1.667955 -4.177855 +v 1.891555 1.638001 -4.177855 +v 1.861601 1.565685 -4.177855 +v 1.891555 1.493369 -4.177855 +v 1.963871 1.463414 -4.177855 +v 2.036188 1.493369 -4.177855 +v 2.066142 1.565685 -4.177855 +v 1.963871 1.565685 -4.177855 +v 2.036188 1.877795 -5.21675 +v 1.963871 1.907749 -5.216752 +v 1.891555 1.877795 -5.21675 +v 1.861601 1.805479 -5.216749 +v 1.891555 1.733163 -5.21675 +v 1.963871 1.703208 -5.21675 +v 2.036188 1.733163 -5.21675 +v 2.066142 1.805479 -5.216749 +v 2.036188 1.877795 -4.177855 +v 1.963871 1.907749 -4.177855 +v 1.891555 1.877795 -4.177855 +v 1.861601 1.805479 -4.177855 +v 1.891555 1.733163 -4.177855 +v 1.963871 1.703208 -4.177855 +v 2.036188 1.733163 -4.177855 +v 2.066142 1.805479 -4.177855 +v 1.963871 1.805479 -4.177855 +v 0.760554 1.842035 -3.952577 +v 7.609053 -1.069013 0.551177 +v 0 -0.765268 -3.956097 +v 7.609053 -0.765268 0.551177 +v 0 -0.765268 -7.732946 +v 7.609053 -0.765268 -0.649518 +v 0 -1.459791 -7.732946 +v 7.609053 -1.069013 -0.649518 +v 1.214601 2.038227 -4.805394 +v 5.143484 -1.069013 0.812165 +v 0.421783 2.415365 -4.762404 +v 5.143484 -0.765268 0.812165 +v 0 -0.765268 0.439388 +v 5.143484 -0.765268 -0.38853 +v -0.156203 2.575728 -4.119865 +v 5.143484 -1.069013 -0.38853 +v 1.032114 0.340364 5.745526 +v 0.964145 -1.094563 6.551094 +v 0 0.340364 5.745526 +v 0 0.008673 7.062063 +v -0.180782 2.425379 -3.254169 +v 0.362446 2.052389 -2.672427 +v 1.155263 1.675251 -2.715417 +v 0 -1.310041 -4.076154 +v 0 0.672056 -4.076154 +v 0 0.670313 -0.750658 +v 0 1.106749 -0.750658 +v 0 1.517316 -2.111028 +v 0 1.517316 -3.4212 +v 0 1.517316 -4.069324 +v 1.733249 1.514889 -3.357956 +v 1.757828 1.665238 -4.223653 +v 1.266634 2.145324 -4.785317 +v 0.473817 2.522462 -4.742327 +v -0.10417 2.682825 -4.099788 +v 0 -1.310041 -6.807402 +v 0 -1.310041 -4.605186 +v 1.543045 -1.342558 4.494025 +v 1.543045 -0.765268 4.494025 +v 1.543045 -0.765268 0.191013 +v 1.543045 -1.342558 0.191013 +v -0.128748 2.532475 -3.234091 +v 0.414479 2.159486 -2.652349 +v 0 -0.017407 7.0495 +v 0 0.004196 7.228139 +v 1.207297 1.782348 -2.69534 +v 1.785283 1.621985 -3.337879 +v 0.549117 -0.399614 7.049499 +v -1.735587 0.649931 2.372068 +v -2.276793 0.598225 2.359797 +v 1.809861 1.772335 -4.203576 +v -1.813632 0.760322 -4.076154 +v 0.937994 1.747884 -4.5237 +v -0.525472 0.759814 -4.076156 +v -0.52502 0.704589 1.837225 +v -1.043754 0.65004 2.37211 +v -1.735587 0.771575 2.372068 +v -1.813248 0.882105 0.751968 +v -2.276793 0.719869 2.359797 +v -3.007264 0.675615 0.751926 +v -1.813632 0.881966 -4.076154 +v -3.008201 0.675603 -4.076154 +v -0.525481 0.882195 0.75201 +v -0.525481 0.882292 -4.076154 +v -0.525481 0.826994 1.840059 +v -1.043754 0.771684 2.37211 +v -0.525011 0.758956 0.749175 +v -3.007732 0.553965 -0.738622 +v -3.007732 0.675609 -0.738622 +v -1.81344 0.882035 -0.738601 +v -0.525481 0.882244 -0.73858 +v -0.525241 0.759385 -0.739998 +v -1.032114 0.340364 5.745526 +v 0.583818 1.623981 -3.817896 +v 0.395361 2.00601 -4.494276 +v -1.310041 0.672056 -4.076154 +v -2.997463 0.46602 -4.076154 +v -0.000234 2.115768 -4.054499 +v -0.017056 2.012864 -3.461985 +v -1.036546 0.428545 5.751309 +v -1.315024 0.760461 0.751968 +v -1.836507 0.376839 5.864282 +v -3.007264 0.553971 0.751926 +v -1.315409 0.760322 -4.076154 +v -3.008201 0.553959 -4.076154 +v 0 0.760551 0.75201 +v 0.354749 1.757576 -3.06382 +v 0.897382 1.49945 -3.093244 +v -0.981744 -0.879086 7.062063 +v -0.981744 0.008673 7.062063 +v 1.292976 1.389691 -3.533021 +v -1.310041 -1.310041 -4.076154 +v -2.997463 -0.990787 -4.076154 +v 1.309798 1.492596 -4.125535 +v -2.997463 0.46602 0.749076 +v -1.310041 -1.310041 0.749076 +v -2.997463 -0.990787 0.749076 +v -1.827392 -0.716184 6.50097 +v -1.25879 -0.770909 7.062063 +v -1.827643 0.288876 5.858582 +v -1.254241 -0.019801 7.062063 +v -0.981744 -0.879086 -8.433464 +v -0.981744 0.879086 -8.433464 +v -1.310041 1.310041 -4.605186 +v -1.310041 -1.310041 -4.605186 +v -2.997463 -0.990787 -4.605186 +v -2.132894 -0.664855 -8.433464 +v -2.997463 0.990787 -4.605186 +v -2.132894 0.664855 -8.433464 +v -2.997463 0.990787 -6.807402 +v -1.310041 1.310041 -6.807402 +v -1.310041 -1.310041 -6.807402 +v -2.997463 -0.990787 -6.807402 +v -3.090473 -0.421017 -4.647384 +v -3.935092 -0.421017 -4.647384 +v -3.090473 0.421017 -4.647384 +v -3.935092 0.421017 -4.647384 +v -3.090473 0.421017 -7.4454 +v -3.935092 0.421017 -7.4454 +v -3.090473 -0.421017 -7.4454 +v -3.935092 -0.421017 -7.4454 +v -3.090473 0.421017 -8.572815 +v -3.620514 0.421017 -8.572815 +v -3.620514 -0.421017 -8.572815 +v -3.090473 -0.421017 -8.572815 +v -1.310041 0.670313 -2.111028 +v -0.655086 0.670313 -0.750658 +v -1.310041 1.517316 -2.111028 +v -0.655086 1.106749 -0.750658 +v -0.655086 1.517316 -4.069324 +v -1.310041 1.517316 -3.4212 +v -1.310041 0.670313 -3.4212 +v -0.655086 0.670313 -4.069324 +v 0.000493 2.481799 -3.298723 +v -5.143484 -0.765268 -0.38853 +v 0 -1.459791 0.439388 +v -5.143484 -1.069013 -0.38853 +v 0.47129 2.158541 -2.794548 +v -0.964145 -1.094563 6.551094 +v 1.158398 1.831689 -2.831806 +v 1.65932 1.692708 -3.388673 +v 0 -0.879086 7.062063 +v 0 -1.094563 6.551094 +v 0 -1.310041 0.749076 +v 1.680621 1.823011 -4.138944 +v 0.980091 1.966239 -4.324068 +v 0.702984 1.869251 -3.771916 +v 0.555579 2.168176 -4.301049 +v 0.246098 2.254042 -3.957004 +v 0.232938 2.173538 -3.493469 +v -0.549117 -0.865952 7.228139 +v 0.523807 1.973822 -3.181978 +v 0.948319 1.771885 -3.204996 +v 0 1.310041 -4.605186 +v 0 1.310041 -6.807402 +v 0 0.879086 -8.433464 +v -0.549117 0.004196 7.228139 +v -0.549117 -0.017407 7.0495 +v 0 -0.879086 -8.433464 +v 1.257799 1.686019 -3.549042 +v 1.27096 1.766523 -4.012577 +v -1.543045 -1.342558 4.494025 +v -1.543045 -0.765268 4.494025 +v -1.543045 -0.765268 0.191013 +v -1.543045 -1.342558 0.191013 +v 0 -0.590024 7.42836 +v 0 -0.231349 7.400979 + +vt 0.401122 0.24589 0 +vt 0.422237 0.155289 0 +vt 0.408574 0.264883 0 +vt 0.426978 0.155184 0 +vt 0.427029 0.272985 0 +vt 0.428212 0.21811 0 +vt 0.445931 0.265758 0 +vt 0.42348 0.218206 0 +vt 0.4272 0.27239 0 +vt 0.431721 0.155075 0 +vt 0.408554 0.26473 0 +vt 0.432943 0.218016 0 +vt 0.445663 0.265617 0 +vt 0.436468 0.154961 0 +vt 0.401327 0.245829 0 +vt 0.437675 0.217926 0 +vt 0.453094 0.247489 0 +vt 0.441219 0.154844 0 +vt 0.409582 0.227353 0 +vt 0.442407 0.217839 0 +vt 0.446378 0.229457 0 +vt 0.40802 0.155591 0 +vt 0.445975 0.154726 0 +vt 0.428835 0.22083 0 +vt 0.409279 0.218484 0 +vt 0.447548 0.217839 0 +vt 0.42874 0.221085 0 +vt 0.412758 0.155492 0 +vt 0.446431 0.229436 0 +vt 0.414015 0.218391 0 +vt 0.409701 0.227457 0 +vt 0.417497 0.155392 0 +vt 0.453306 0.247283 0 +vt 0.418748 0.218299 0 +vt 0.428284 0.246556 0 +vt 0.428479 0.246771 0 +vt 0.401122 0.24589 0 +vt 0.422237 0.155289 0 +vt 0.408574 0.264883 0 +vt 0.426978 0.155184 0 +vt 0.427029 0.272985 0 +vt 0.428212 0.21811 0 +vt 0.445931 0.265758 0 +vt 0.42348 0.218206 0 +vt 0.4272 0.27239 0 +vt 0.431721 0.155075 0 +vt 0.408554 0.26473 0 +vt 0.432943 0.218016 0 +vt 0.445663 0.265617 0 +vt 0.436468 0.154961 0 +vt 0.401327 0.245829 0 +vt 0.437675 0.217926 0 +vt 0.453094 0.247489 0 +vt 0.441219 0.154844 0 +vt 0.409582 0.227353 0 +vt 0.442407 0.217839 0 +vt 0.446378 0.229457 0 +vt 0.40802 0.155591 0 +vt 0.445975 0.154726 0 +vt 0.428835 0.22083 0 +vt 0.409279 0.218484 0 +vt 0.447548 0.217839 0 +vt 0.42874 0.221085 0 +vt 0.412758 0.155492 0 +vt 0.446431 0.229436 0 +vt 0.414015 0.218391 0 +vt 0.409701 0.227457 0 +vt 0.417497 0.155392 0 +vt 0.453306 0.247283 0 +vt 0.418748 0.218299 0 +vt 0.428284 0.246556 0 +vt 0.428479 0.246771 0 +vt 0.406674 0.167689 0 +vt 0.34778 0.206333 0 +vt 0.400506 0.092061 0 +vt 0.34714 0.076348 0 +vt 0.347422 0.129521 0 +vt 0.25309 0.155811 0 +vt 0.986632 0.334252 0 +vt 0.900869 0.480587 0 +vt 0.178263 0.12975 0 +vt 0.948411 0.446335 0 +vt 0.938762 0.317929 0 +vt 0.90054 0.43001 0 +vt 0.726249 0.319303 0 +vt 0.753116 0.430966 0 +vt 0.253094 0.013616 0 +vt 0.677076 0.331135 0 +vt 0.753444 0.48154 0 +vt 0.178266 0.031107 0 +vt 0.703943 0.442796 0 +vt 0.946295 0.240423 0 +vt 0.661994 0.243219 0 +vt 0.991137 0.240398 0 +vt 0.701254 0.243258 0 +vt 0.739885 0.243356 0 +vt 0.778704 0.243132 0 +vt 0.818178 0.242671 0 +vt 0.858856 0.241693 0 +vt 0.90173 0.240871 0 +vt 0.973266 0.207191 0 +vt 0.94624 0.287074 0 +vt 0.911901 0.23261 0 +vt 0.662047 0.284293 0 +vt 0.991082 0.287208 0 +vt 0.850535 0.207191 0 +vt 0.701289 0.284167 0 +vt 0.825117 0.145826 0 +vt 0.739912 0.284018 0 +vt 0.850535 0.084461 0 +vt 0.778729 0.284198 0 +vt 0.911901 0.059042 0 +vt 0.818183 0.284624 0 +vt 0.973266 0.084461 0 +vt 0.858836 0.28562 0 +vt 0.998684 0.145826 0 +vt 0.901683 0.286519 0 +vt 0.911901 0.142355 0 +vt 0.565962 0.396112 0 +vt 0.520712 0.441362 0 +vt 0.611211 0.396112 0 +vt 0.656461 0.441362 0 +vt 0.565962 0.441362 0 +vt 0.611211 0.441362 0 +vt 0.565962 0.486611 0 +vt 0.611211 0.486611 0 +vt 0.565962 0.531861 0 +vt 0.520712 0.486611 0 +vt 0.611211 0.531861 0 +vt 0.656461 0.486611 0 +vt 0.352159 0.224968 0 +vt 0.355175 0.224967 0 +vt 0.35819 0.224967 0 +vt 0.901262 0.530297 0 +vt 0.945558 0.536298 0 +vt 0.938872 0.531149 0 +vt 0.266663 0.206735 0 +vt 0.902345 0.986421 0 +vt 0.266539 0.18027 0 +vt 0.813927 0.986075 0 +vt 0.809312 0.573689 0 +vt 0.812099 0.56775 0 +vt 0.853688 0.529528 0 +vt 0.848087 0.53162 0 +vt 0.900755 0.538571 0 +vt 0.904638 0.649276 0 +vt 0.937884 0.539507 0 +vt 0.987257 0.649743 0 +vt 0.90173 0.978186 0 +vt 0.984307 0.979178 0 +vt 0.816956 0.648322 0 +vt 0.813964 0.977666 0 +vt 0.81769 0.573982 0 +vt 0.853542 0.537896 0 +vt 0.808549 0.64825 0 +vt 0.994729 0.751596 0 +vt 0.986429 0.751521 0 +vt 0.903756 0.750787 0 +vt 0.815903 0.749985 0 +vt 0.807509 0.749992 0 +vt 0.400909 0.096914 0 +vt 0.453481 0.393554 0 +vt 0.481795 0.340046 0 +vt 0.538348 0.389938 0 +vt 0.493884 0.33955 0 +vt 0.062187 0.98965 0 +vt 0.69945 0.98606 0 +vt 0.48742 0.393554 0 +vt 0.49267 0.393289 0 +vt 0.487583 0.397153 0 +vt 0.687993 0.503583 0 +vt 0.69842 0.750594 0 +vt 0.727594 0.498641 0 +vt 0.780939 0.750999 0 +vt 0.995564 0.649813 0 +vt 0.994931 0.646535 0 +vt 0.699276 0.981779 0 +vt 0.779679 0.980604 0 +vt 0.992605 0.979257 0 +vt 0.985632 0.987425 0 +vt 0.492708 0.397856 0 +vt 0.636086 0.982285 0 +vt 0.636859 0.503126 0 +vt 0.047272 0.488901 0 +vt 0.05879 0.007778 0 +vt 0.058235 0.053941 0 +vt 0.453908 0.401172 0 +vt 0.477006 0.449213 0 +vt 0.057779 0.913566 0 +vt 0.407615 0.505451 0 +vt 0.123087 0.916212 0 +vt 0.346673 0.542322 0 +vt 0.128965 0.974582 0 +vt 0.782818 0.981712 0 +vt 0.224808 0.340362 0 +vt 0.785169 0.750557 0 +vt 0.058749 0.73063 0 +vt 0.124342 0.730754 0 +vt 0.28587 0.303495 0 +vt 0.0814 0.510898 0 +vt 0.125459 0.063828 0 +vt 0.102683 0.029981 0 +vt 0.073324 0.01374 0 +vt 0.05933 0.488428 0 +vt 0.099108 0.116354 0 +vt 0.731869 0.49777 0 +vt 0.726871 0.494355 0 +vt 0.072323 0.053475 0 +vt 0.424823 0.351441 0 +vt 0.193953 0.981583 0 +vt 0.188639 0.887683 0 +vt 0.199784 0.698522 0 +vt 0.20532 0.571215 0 +vt 0.438044 0.211097 0 +vt 0.384199 0.711565 0 +vt 0.500316 0.212631 0 +vt 0.290876 0.593575 0 +vt 0.258604 0.963636 0 +vt 0.467461 0.353125 0 +vt 0.318819 0.910112 0 +vt 0.283877 0.695369 0 +vt 0.252001 0.887726 0 +vt 0.275255 0.80017 0 +vt 0.19945 0.803168 0 +vt 0.436354 0.290608 0 +vt 0.3662 0.823057 0 +vt 0.498348 0.292484 0 +vt 0.495948 0.957021 0 +vt 0.10292 0.392065 0 +vt 0.45675 0.997198 0 +vt 0.375916 0.956447 0 +vt 0.075154 0.42042 0 +vt 0.416227 0.997221 0 +vt 0.456712 0.956816 0 +vt 0.416225 0.956806 0 +vt 0.456172 0.82355 0 +vt 0.416731 0.824647 0 +vt 0.496678 0.822937 0 +vt 0.196696 0.483704 0 +vt 0.169196 0.512305 0 +vt 0.377041 0.822595 0 +vt 0.452832 0.768161 0 +vt 0.425823 0.769999 0 +vt 0.218443 0.537816 0 +vt 0.384197 0.764756 0 +vt 0.422662 0.726694 0 +vt 0.49481 0.766707 0 +vt 0.23535 0.519557 0 +vt 0.449921 0.724799 0 +vt 0.095834 0.208772 0 +vt 0.039343 0.137854 0 +vt 0.057027 0.147654 0 +vt 0.062632 0.222927 0 +vt 0.039308 0.158849 0 +vt 0.04078 0.315102 0 +vt 0.070835 0.280228 0 +vt 0.102932 0.307938 0 +vt 0.110762 0.270579 0 +vt 0.041282 0.358462 0 +vt 0.072792 0.342824 0 +vt 0.361206 0.224968 0 +vt 0.364222 0.224968 0 +vt 0.343112 0.224967 0 +vt 0.367238 0.224968 0 +vt 0.346128 0.224967 0 +vt 0.349143 0.224968 0 +vt 0.328345 0.296397 0 +vt 0.352159 0.264994 0 +vt 0.316111 0.301074 0 +vt 0.355175 0.264994 0 +vt 0.304153 0.295731 0 +vt 0.35819 0.264994 0 +vt 0.299475 0.283498 0 +vt 0.361206 0.264994 0 +vt 0.304818 0.271539 0 +vt 0.364222 0.264994 0 +vt 0.317052 0.266862 0 +vt 0.343112 0.264994 0 +vt 0.367238 0.264994 0 +vt 0.32901 0.272205 0 +vt 0.346128 0.264994 0 +vt 0.333688 0.284439 0 +vt 0.349143 0.264994 0 +vt 0.316582 0.283968 0 +vt 0.312838 0.224509 0 +vt 0.315906 0.22444 0 +vt 0.318977 0.22437 0 +vt 0.322049 0.224296 0 +vt 0.325124 0.22422 0 +vt 0.303636 0.224704 0 +vt 0.328202 0.224144 0 +vt 0.306703 0.22464 0 +vt 0.30977 0.224575 0 +vt 0.368307 0.296009 0 +vt 0.313643 0.265231 0 +vt 0.356074 0.300686 0 +vt 0.316705 0.265169 0 +vt 0.344115 0.295343 0 +vt 0.319768 0.265108 0 +vt 0.339438 0.28311 0 +vt 0.32283 0.26505 0 +vt 0.344781 0.271151 0 +vt 0.325893 0.264994 0 +vt 0.357015 0.266474 0 +vt 0.304451 0.265411 0 +vt 0.32922 0.264994 0 +vt 0.368973 0.271817 0 +vt 0.307516 0.265351 0 +vt 0.37365 0.284051 0 +vt 0.31058 0.265291 0 +vt 0.356544 0.28358 0 +vt 0.11116 0.337 0 +vt 0.614968 0.723363 0 +vt 0.608538 0.990523 0 +vt 0.29194 0.529223 0 +vt 0.62133 0.98202 0 +vt 0.369034 0.609455 0 +vt 0.380177 0.167709 0 +vt 0.347655 0.179822 0 +vt 0.369767 0.039595 0 +vt 0.346915 0.033192 0 +vt 0.396334 0.040637 0 +vt 0.346793 0.00661 0 +vt 0.406674 0.167689 0 +vt 0.34778 0.206333 0 +vt 0.400506 0.092061 0 +vt 0.34714 0.076348 0 +vt 0.347422 0.129521 0 +vt 0.25309 0.155811 0 +vt 0.986632 0.334252 0 +vt 0.900869 0.480587 0 +vt 0.178263 0.12975 0 +vt 0.948411 0.446335 0 +vt 0.938762 0.317929 0 +vt 0.90054 0.43001 0 +vt 0.726249 0.319303 0 +vt 0.753116 0.430966 0 +vt 0.253094 0.013616 0 +vt 0.677076 0.331135 0 +vt 0.753444 0.48154 0 +vt 0.178266 0.031107 0 +vt 0.703943 0.442796 0 +vt 0.612474 0.98263 0 +vt 0.34598 0.618839 0 +vt 0.581161 0.967031 0 +vt 0.323125 0.60923 0 +vt 0.577236 0.974932 0 +vt 0.301895 0.494844 0 +vt 0.57263 0.969518 0 +vt 0.510333 0.226098 0 +vt 0.382299 0.360197 0 +vt 0.667065 0.356807 0 +vt 0.610495 0.598294 0 +vt 0.614647 0.607502 0 +vt 0.360782 0.383711 0 +vt 0.601286 0.608074 0 +vt 0.946295 0.240423 0 +vt 0.661994 0.243219 0 +vt 0.991137 0.240398 0 +vt 0.701254 0.243258 0 +vt 0.739885 0.243356 0 +vt 0.778704 0.243132 0 +vt 0.818178 0.242671 0 +vt 0.858856 0.241693 0 +vt 0.90173 0.240871 0 +vt 0.973266 0.207191 0 +vt 0.94624 0.287074 0 +vt 0.911901 0.23261 0 +vt 0.662047 0.284293 0 +vt 0.991082 0.287208 0 +vt 0.850535 0.207191 0 +vt 0.701289 0.284167 0 +vt 0.825117 0.145826 0 +vt 0.739912 0.284018 0 +vt 0.850535 0.084461 0 +vt 0.778729 0.284198 0 +vt 0.911901 0.059042 0 +vt 0.818183 0.284624 0 +vt 0.973266 0.084461 0 +vt 0.858836 0.28562 0 +vt 0.998684 0.145826 0 +vt 0.901683 0.286519 0 +vt 0.911901 0.142355 0 +vt 0.520712 0.441362 0 +vt 0.565962 0.396112 0 +vt 0.656461 0.441362 0 +vt 0.611211 0.396112 0 +vt 0.565962 0.441362 0 +vt 0.611211 0.441362 0 +vt 0.565962 0.486611 0 +vt 0.611211 0.486611 0 +vt 0.520712 0.486611 0 +vt 0.565962 0.531861 0 +vt 0.656461 0.486611 0 +vt 0.611211 0.531861 0 +vt 0.352159 0.224968 0 +vt 0.355175 0.224967 0 +vt 0.35819 0.224967 0 +vt 0.361206 0.224968 0 +vt 0.364222 0.224968 0 +vt 0.343112 0.224967 0 +vt 0.367238 0.224968 0 +vt 0.346128 0.224967 0 +vt 0.349143 0.224968 0 +vt 0.328345 0.296397 0 +vt 0.352159 0.264994 0 +vt 0.316111 0.301074 0 +vt 0.355175 0.264994 0 +vt 0.304153 0.295731 0 +vt 0.35819 0.264994 0 +vt 0.299475 0.283498 0 +vt 0.361206 0.264994 0 +vt 0.304818 0.271539 0 +vt 0.364222 0.264994 0 +vt 0.317052 0.266862 0 +vt 0.343112 0.264994 0 +vt 0.367238 0.264994 0 +vt 0.32901 0.272205 0 +vt 0.346128 0.264994 0 +vt 0.333688 0.284439 0 +vt 0.349143 0.264994 0 +vt 0.316582 0.283968 0 +vt 0.312838 0.224509 0 +vt 0.315906 0.22444 0 +vt 0.318977 0.22437 0 +vt 0.322049 0.224296 0 +vt 0.325124 0.22422 0 +vt 0.303636 0.224704 0 +vt 0.328202 0.224144 0 +vt 0.306703 0.22464 0 +vt 0.30977 0.224575 0 +vt 0.368307 0.296009 0 +vt 0.313643 0.265231 0 +vt 0.356074 0.300686 0 +vt 0.316705 0.265169 0 +vt 0.344115 0.295343 0 +vt 0.319768 0.265108 0 +vt 0.339438 0.28311 0 +vt 0.32283 0.26505 0 +vt 0.344781 0.271151 0 +vt 0.325893 0.264994 0 +vt 0.357015 0.266474 0 +vt 0.304451 0.265411 0 +vt 0.32922 0.264994 0 +vt 0.368973 0.271817 0 +vt 0.307516 0.265351 0 +vt 0.37365 0.284051 0 +vt 0.31058 0.265291 0 +vt 0.356544 0.28358 0 +vt 0.538458 0.400243 0 +vt 0.488848 0.450839 0 +vt 0.608538 0.990523 0 +vt 0.29194 0.529223 0 +vt 0.62133 0.98202 0 +vt 0.594713 0.724759 0 +vt 0.612474 0.98263 0 +vt 0.49603 0.675106 0 +vt 0.581161 0.967031 0 +vt 0.142475 0.228861 0 +vt 0.476527 0.680791 0 +vt 0.577236 0.974932 0 +vt 0.301895 0.494844 0 +vt 0.57263 0.969518 0 +vt 0.367986 0.565002 0 +vt 0.425478 0.616457 0 +vt 0.425848 0.486287 0 +vt 0.667065 0.356807 0 +vt 0.610495 0.598294 0 +vt 0.614647 0.607502 0 +vt 0.345685 0.555992 0 +vt 0.425794 0.505287 0 +vt 0.601286 0.608074 0 +vt 0.374237 0.635974 0 +vt 0.603553 0.660983 0 +vt 0.324555 0.565556 0 +vt 0.425737 0.525603 0 +vt 0.670709 0.390276 0 +vt 0.602008 0.674295 0 +vt 0.616898 0.660405 0 +vt 0.059939 0.122085 0 +vt 0.687668 0.499238 0 +vt 0.045477 0.509967 0 +vt 0.008219 0.122247 0 +vt 0.636899 0.498768 0 +vt 0.008104 0.053923 0 +vt 0.316467 0.586764 0 +vt 0.425678 0.546256 0 +vt 0.325297 0.607393 0 +vt 0.425622 0.565813 0 +vt 0.345968 0.616042 0 +vt 0.425573 0.583176 0 +vt 0.008828 0.913903 0 +vt 0.008828 0.991382 0 +vt 0.636121 0.986565 0 +vt 0.007736 0.358786 0 +vt 0.007736 0.137802 0 +vt 0.007736 0.157777 0 +vt 0.007736 0.222377 0 +vt 0.007736 0.284298 0 +vt 0.007736 0.316526 0 +vt 0.366961 0.607857 0 +vt 0.425532 0.597655 0 +vt 0.376419 0.586974 0 +vt 0.4255 0.608967 0 +vt 0.372567 0.613026 0 +vt 0.418233 0.616858 0 +vt 0.418604 0.486279 0 +vt 0.345949 0.623829 0 +vt 0.41855 0.505269 0 +vt 0.319594 0.612732 0 +vt 0.418492 0.525551 0 +vt 0.389044 0.29016 0 +vt 0.137994 0.570166 0 +vt 0.390497 0.210232 0 +vt 0.557298 0.26537 0 +vt 0.453183 0.43316 0 +vt 0.435459 0.452036 0 +vt 0.443424 0.642622 0 +vt 0.569111 0.384092 0 +vt 0.44067 0.668067 0 +vt 0.308742 0.586347 0 +vt 0.418434 0.546192 0 +vt 0.319631 0.559984 0 +vt 0.418378 0.565797 0 +vt 0.26567 0.007003 0 +vt 0.265811 0.033587 0 +vt 0.345967 0.548943 0 +vt 0.418328 0.583226 0 +vt 0.372506 0.559731 0 +vt 0.418287 0.597784 0 +vt 0.400909 0.096914 0 +vt 0.901262 0.530297 0 +vt 0.945558 0.536298 0 +vt 0.938872 0.531149 0 +vt 0.383698 0.586308 0 +vt 0.418254 0.609248 0 +vt 0.902345 0.986421 0 +vt 0.359357 0.573792 0 +vt 0.813927 0.986075 0 +vt 0.809312 0.573689 0 +vt 0.812099 0.56775 0 +vt 0.853688 0.529528 0 +vt 0.848087 0.53162 0 +vt 0.900755 0.538571 0 +vt 0.904638 0.649276 0 +vt 0.937884 0.539507 0 +vt 0.987257 0.649743 0 +vt 0.90173 0.978186 0 +vt 0.984307 0.979178 0 +vt 0.816956 0.648322 0 +vt 0.813964 0.977666 0 +vt 0.81769 0.573982 0 +vt 0.853542 0.537896 0 +vt 0.808549 0.64825 0 +vt 0.994729 0.751596 0 +vt 0.986429 0.751521 0 +vt 0.903756 0.750787 0 +vt 0.815903 0.749985 0 +vt 0.807509 0.749992 0 +vt 0.059939 0.122085 0 +vt 0.687668 0.499238 0 +vt 0.346162 0.586441 0 +vt 0.345869 0.568161 0 +vt 0.062187 0.98965 0 +vt 0.69945 0.98606 0 +vt 0.346673 0.542322 0 +vt 0.128965 0.974582 0 +vt 0.782818 0.981712 0 +vt 0.333221 0.573771 0 +vt 0.328226 0.586552 0 +vt 0.687993 0.503583 0 +vt 0.69842 0.750594 0 +vt 0.727594 0.498641 0 +vt 0.780939 0.750999 0 +vt 0.995564 0.649813 0 +vt 0.994931 0.646535 0 +vt 0.699276 0.981779 0 +vt 0.779679 0.980604 0 +vt 0.992605 0.979257 0 +vt 0.985632 0.987425 0 +vt 0.634522 0.750265 0 +vt 0.333547 0.599086 0 +vt 0.346093 0.604325 0 +vt 0.05879 0.007778 0 +vt 0.047272 0.488901 0 +vt 0.058235 0.053941 0 +vt 0.358792 0.599285 0 +vt 0.057779 0.913566 0 +vt 0.407615 0.505451 0 +vt 0.123087 0.916212 0 +vt 0.364368 0.586675 0 +vt 0.224808 0.340362 0 +vt 0.785169 0.750557 0 +vt 0.058749 0.73063 0 +vt 0.28587 0.303495 0 +vt 0.124342 0.730754 0 +vt 0.125459 0.063828 0 +vt 0.0814 0.510898 0 +vt 0.102683 0.029981 0 +vt 0.073324 0.01374 0 +vt 0.05933 0.488428 0 +vt 0.099108 0.116354 0 +vt 0.731869 0.49777 0 +vt 0.726871 0.494355 0 +vt 0.072323 0.053475 0 +vt 0.193953 0.981583 0 +vt 0.424823 0.351441 0 +vt 0.188639 0.887683 0 +vt 0.199784 0.698522 0 +vt 0.438044 0.211097 0 +vt 0.20532 0.571215 0 +vt 0.384199 0.711565 0 +vt 0.500316 0.212631 0 +vt 0.290876 0.593575 0 +vt 0.258604 0.963636 0 +vt 0.467461 0.353125 0 +vt 0.318819 0.910112 0 +vt 0.283877 0.695369 0 +vt 0.252001 0.887726 0 +vt 0.275255 0.80017 0 +vt 0.19945 0.803168 0 +vt 0.436354 0.290608 0 +vt 0.3662 0.823057 0 +vt 0.498348 0.292484 0 +vt 0.495948 0.957021 0 +vt 0.10292 0.392065 0 +vt 0.45675 0.997198 0 +vt 0.375916 0.956447 0 +vt 0.075154 0.42042 0 +vt 0.416227 0.997221 0 +vt 0.456712 0.956816 0 +vt 0.416225 0.956806 0 +vt 0.456172 0.82355 0 +vt 0.416731 0.824647 0 +vt 0.496678 0.822937 0 +vt 0.196696 0.483704 0 +vt 0.169196 0.512305 0 +vt 0.377041 0.822595 0 +vt 0.452832 0.768161 0 +vt 0.425823 0.769999 0 +vt 0.218443 0.537816 0 +vt 0.384197 0.764756 0 +vt 0.422662 0.726694 0 +vt 0.49481 0.766707 0 +vt 0.23535 0.519557 0 +vt 0.449921 0.724799 0 +vt 0.095834 0.208772 0 +vt 0.057027 0.147654 0 +vt 0.039343 0.137854 0 +vt 0.062632 0.222927 0 +vt 0.039308 0.158849 0 +vt 0.04078 0.315102 0 +vt 0.070835 0.280228 0 +vt 0.102932 0.307938 0 +vt 0.110762 0.270579 0 +vt 0.072792 0.342824 0 +vt 0.041282 0.358462 0 +vt 0.313711 0.586352 0 +vt 0.603553 0.660983 0 +vt 0.525739 0.381449 0 +vt 0.371282 0.666665 0 +vt 0.670709 0.390276 0 +vt 0.602008 0.674295 0 +vt 0.616898 0.660405 0 +vt 0.323155 0.563492 0 +vt 0.045477 0.509967 0 +vt 0.345996 0.553927 0 +vt 0.368994 0.563294 0 +vt 0.007243 0.008448 0 +vt 0.008828 0.488425 0 +vt 0.008828 0.509895 0 +vt 0.008828 0.730482 0 +vt 0.378658 0.586315 0 +vt 0.359372 0.599752 0 +vt 0.346081 0.586365 0 +vt 0.346045 0.605197 0 +vt 0.332779 0.599642 0 +vt 0.327306 0.586362 0 +vt 0.380177 0.167709 0 +vt 0.347655 0.179822 0 +vt 0.332793 0.573092 0 +vt 0.346054 0.567553 0 +vt 0.137994 0.695528 0 +vt 0.137994 0.804199 0 +vt 0.137994 0.891424 0 +vt 0.369767 0.039595 0 +vt 0.346915 0.033192 0 +vt 0.396334 0.040637 0 +vt 0.346793 0.00661 0 +vt 0.389055 0.351447 0 +vt 0.137994 0.982716 0 +vt 0.359376 0.573 0 +vt 0.36494 0.586271 0 +vt 0.557298 0.26537 0 +vt 0.453183 0.43316 0 +vt 0.435459 0.452036 0 +vt 0.443424 0.642622 0 +vt 0.569111 0.384092 0 +vt 0.44067 0.668067 0 +vt 0.266302 0.129883 0 +vt 0.266035 0.076773 0 + +f 209/327 342/531 208/326 206/322 205/320 +f 452/688 38/75 109/161 39/76 451/686 +f 1/2 2/4 3/6 4/8 +f 2/4 5/10 6/12 3/6 +f 5/10 7/14 8/16 6/12 +f 7/14 9/18 10/20 8/16 +f 9/18 11/23 12/26 10/20 +f 11/22 13/28 14/30 12/25 +f 13/28 15/32 16/34 14/30 +f 15/32 1/2 4/8 16/34 +f 4/7 3/5 17/35 +f 3/5 6/11 17/35 +f 6/11 8/15 17/35 +f 8/15 10/19 17/35 +f 10/19 12/24 17/35 +f 12/24 14/29 17/35 +f 14/29 16/33 17/35 +f 16/33 4/7 17/35 +f 5/9 2/3 18/36 +f 18/36 2/3 1/1 +f 11/21 18/36 13/27 +f 9/17 18/36 11/21 +f 5/9 18/36 7/13 +f 7/13 18/36 9/17 +f 13/27 18/36 15/31 +f 15/31 18/36 1/1 +f 19/38 22/44 21/42 20/40 +f 20/40 21/42 24/48 23/46 +f 23/46 24/48 26/52 25/50 +f 25/50 26/52 28/56 27/54 +f 27/54 28/56 30/62 29/59 +f 29/58 30/61 32/66 31/64 +f 31/64 32/66 34/70 33/68 +f 33/68 34/70 22/44 19/38 +f 22/43 35/71 21/41 +f 21/41 35/71 24/47 +f 24/47 35/71 26/51 +f 26/51 35/71 28/55 +f 28/55 35/71 30/60 +f 30/60 35/71 32/65 +f 32/65 35/71 34/69 +f 34/69 35/71 22/43 +f 23/45 36/72 20/39 +f 36/72 19/37 20/39 +f 29/57 31/63 36/72 +f 27/53 29/57 36/72 +f 23/45 25/49 36/72 +f 25/49 27/53 36/72 +f 31/63 33/67 36/72 +f 33/67 19/37 36/72 +f 452/689 451/687 339/526 338/525 +f 451/687 39/76 461/701 339/526 +f 445/680 37/74 87/137 89/139 +f 40/77 445/680 89/139 460/700 +f 39/76 109/161 40/77 +f 40/77 109/161 37/73 445/679 +f 110/163 111/165 114/169 113/168 +f 113/168 114/169 122/181 115/170 +f 115/170 122/181 295/451 127/188 +f 111/164 295/450 122/181 114/169 +f 127/187 110/162 113/168 115/170 +f 327/507 303/466 305/471 328/509 +f 328/509 305/471 309/476 329/511 +f 75/122 77/124 79/126 81/130 +f 80/128 78/125 76/123 74/120 +f 82/131 175/268 176/270 83/132 +f 83/132 176/270 177/272 84/133 +f 84/133 177/272 178/274 170/261 +f 170/261 178/274 179/276 171/262 +f 171/262 179/276 180/279 172/264 +f 172/263 180/278 181/281 173/265 +f 173/265 181/281 182/283 174/266 +f 174/266 182/283 175/268 82/131 +f 175/267 183/284 176/269 +f 176/269 183/284 177/271 +f 177/271 183/284 178/273 +f 178/273 183/284 179/275 +f 179/275 183/284 180/277 +f 180/277 183/284 181/280 +f 94/146 93/145 95/147 96/148 +f 106/158 94/146 96/148 105/157 +f 99/151 94/146 106/158 107/159 +f 99/151 101/153 94/146 +f 85/134 86/136 95/147 93/145 +f 86/135 119/176 96/148 95/147 +f 119/175 104/156 105/157 96/148 +f 121/180 88/138 97/149 98/150 +f 88/138 90/140 100/152 97/149 +f 91/142 92/144 102/154 101/153 +f 92/143 85/134 93/145 102/154 +f 99/151 107/159 108/160 103/155 +f 101/153 99/151 103/155 91/141 +f 104/156 121/179 98/150 105/157 +f 97/149 106/158 105/157 98/150 +f 107/159 106/158 97/149 100/152 +f 117/172 116/171 118/173 119/174 +f 120/177 117/172 119/174 121/178 +f 380/581 117/172 120/177 123/182 +f 380/581 124/183 116/171 117/172 +f 311/481 136/207 118/173 116/171 +f 136/206 131/196 119/174 118/173 +f 131/196 130/194 121/178 119/174 +f 130/194 112/167 120/177 121/178 +f 112/167 319/494 123/182 120/177 +f 313/484 311/481 116/171 124/183 +f 436/669 125/185 126/186 314/485 +f 314/485 126/186 311/480 313/483 +f 319/493 112/166 128/189 318/492 +f 438/672 132/197 312/482 437/671 +f 136/205 134/201 133/199 131/195 +f 125/184 312/482 134/200 135/204 +f 128/189 112/166 130/193 129/191 +f 126/186 125/185 135/203 137/208 +f 318/492 128/189 132/197 438/672 +f 133/198 132/197 128/189 129/191 +f 131/195 133/199 129/190 130/192 +f 135/202 134/201 136/205 137/208 +f 143/220 145/222 146/223 149/226 +f 138/209 143/219 149/227 148/225 +f 141/213 142/217 144/221 140/212 +f 147/224 146/223 145/222 139/211 +f 139/211 145/222 143/218 138/210 +f 140/212 144/221 146/223 147/224 +f 149/227 142/216 141/214 148/225 +f 146/223 144/221 142/215 149/226 +f 150/230 151/233 153/235 152/234 +f 152/234 153/235 155/237 154/236 +f 158/242 159/243 160/246 161/249 +f 156/239 157/240 151/232 150/229 +f 151/231 157/241 155/237 153/235 +f 156/238 150/228 152/234 154/236 +f 154/236 155/237 159/243 158/242 +f 155/237 157/241 160/245 159/243 +f 157/240 156/239 161/248 160/244 +f 156/238 154/236 158/242 161/247 +f 164/253 162/250 168/258 167/256 +f 163/252 162/250 164/253 165/254 +f 166/255 167/256 168/257 169/260 +f 181/280 183/284 182/282 +f 182/282 183/284 175/267 +f 184/285 192/295 193/297 185/286 +f 185/286 193/297 194/299 186/287 +f 186/287 194/299 195/301 187/288 +f 187/288 195/301 196/303 188/289 +f 188/289 196/303 197/306 189/291 +f 189/290 197/305 198/308 190/292 +f 190/292 198/308 199/310 191/293 +f 191/293 199/310 192/295 184/285 +f 192/294 200/311 193/296 +f 193/296 200/311 194/298 +f 194/298 200/311 195/300 +f 195/300 200/311 196/302 +f 196/302 200/311 197/304 +f 197/304 200/311 198/307 +f 198/307 200/311 199/309 +f 199/309 200/311 192/294 +f 76/123 78/125 79/126 77/124 +f 227/343 202/316 201/313 297/455 +f 299/457 229/345 227/343 297/455 +f 301/460 231/349 229/345 299/457 +f 201/312 202/315 231/348 301/459 +f 202/314 227/343 229/345 231/347 +f 232/351 234/355 457/696 456/695 +f 307/473 430/661 459/699 458/697 +f 430/660 232/350 456/694 459/698 +f 233/354 235/356 429/659 431/664 +f 394/602 395/605 384/586 367/560 +f 437/671 436/670 383/585 433/666 +f 392/598 391/596 390/594 433/666 +f 321/497 423/651 421/649 320/496 +f 211/330 212/333 214/335 213/334 +f 213/334 214/335 216/337 215/336 +f 215/336 216/337 218/342 217/339 +f 217/338 218/341 212/332 211/329 +f 212/331 218/340 216/337 214/335 +f 322/498 422/650 423/651 321/497 +f 323/499 425/653 422/650 322/498 +f 324/500 424/652 425/653 323/499 +f 319/495 427/657 424/652 324/500 +f 449/684 405/621 398/609 448/683 +f 450/685 397/608 405/621 449/684 +f 453/691 396/606 397/608 450/685 +f 330/512 406/622 396/607 453/690 +f 331/514 399/610 406/622 330/512 +f 448/683 398/609 399/611 331/513 +f 456/695 457/696 235/356 233/353 +f 458/697 429/659 235/356 457/696 +f 459/699 431/663 429/659 458/697 +f 78/125 80/127 81/129 79/126 +f 456/694 233/352 431/662 459/698 +f 39/76 40/77 460/700 461/701 +f 236/357 237/359 245/370 244/367 +f 237/358 238/360 246/372 245/369 +f 238/360 239/361 247/374 246/372 +f 239/361 240/362 248/376 247/374 +f 240/362 241/363 249/378 248/376 +f 241/363 242/364 250/380 249/378 +f 242/364 243/365 251/382 250/380 +f 243/365 236/357 244/367 251/382 +f 244/366 245/368 252/383 +f 245/368 246/371 252/383 +f 246/371 247/373 252/383 +f 247/373 248/375 252/383 +f 248/375 249/377 252/383 +f 249/377 250/379 252/383 +f 250/379 251/381 252/383 +f 251/381 244/366 252/383 +f 253/385 254/387 256/389 255/388 +f 255/388 256/389 258/391 257/390 +f 257/390 258/391 260/395 259/393 +f 254/386 260/394 258/391 256/389 +f 259/392 253/384 255/388 257/390 +f 261/396 262/397 270/408 269/406 +f 262/397 263/398 271/410 270/408 +f 263/398 264/399 272/412 271/410 +f 264/399 265/400 273/414 272/412 +f 265/400 266/402 274/417 273/414 +f 266/401 267/403 275/419 274/416 +f 267/403 268/404 276/421 275/419 +f 268/404 261/396 269/406 276/421 +f 269/405 270/407 277/422 +f 270/407 271/409 277/422 +f 271/409 272/411 277/422 +f 272/411 273/413 277/422 +f 273/413 274/415 277/422 +f 274/415 275/418 277/422 +f 275/418 276/420 277/422 +f 276/420 269/405 277/422 +f 278/423 279/424 287/435 286/433 +f 279/424 280/425 288/437 287/435 +f 280/425 281/426 289/439 288/437 +f 281/426 282/427 290/441 289/439 +f 282/427 283/429 291/444 290/441 +f 283/428 284/430 292/446 291/443 +f 284/430 285/431 293/448 292/446 +f 285/431 278/423 286/433 293/448 +f 286/432 287/434 294/449 +f 287/434 288/436 294/449 +f 288/436 289/438 294/449 +f 289/438 290/440 294/449 +f 290/440 291/442 294/449 +f 291/442 292/445 294/449 +f 292/445 293/447 294/449 +f 293/447 286/432 294/449 +f 298/456 297/455 201/313 296/454 +f 299/457 297/455 298/456 300/458 +f 301/460 299/457 300/458 302/463 +f 201/312 301/459 302/462 296/453 +f 296/452 302/461 300/458 298/456 +f 232/351 332/516 333/517 234/355 +f 307/473 334/518 335/520 430/661 +f 430/660 335/519 332/515 232/350 +f 304/469 310/479 308/474 306/472 +f 136/205 311/480 126/186 137/208 +f 437/671 312/482 125/184 436/670 +f 134/200 312/482 132/197 133/198 +f 321/497 320/496 163/251 165/254 +f 322/498 321/497 165/254 164/253 +f 323/499 322/498 164/253 167/256 +f 324/500 323/499 167/256 166/255 +f 319/495 324/500 166/255 169/259 +f 449/684 448/683 140/212 147/224 +f 450/685 449/684 147/224 139/211 +f 453/691 450/685 139/211 138/210 +f 330/512 453/690 138/209 148/225 +f 331/514 330/512 148/225 141/214 +f 448/683 331/513 141/213 140/212 +f 332/516 304/468 306/472 333/517 +f 334/518 333/517 306/472 308/474 +f 335/520 334/518 308/474 310/478 +f 332/515 335/519 310/477 304/467 +f 209/327 461/701 460/700 210/328 +f 206/323 338/525 339/526 205/321 +f 205/321 339/526 461/701 209/327 +f 204/319 89/139 87/137 207/325 +f 210/328 460/700 89/139 204/319 +f 209/327 210/328 342/531 +f 210/328 204/318 207/324 342/531 +f 352/545 354/547 353/546 351/544 +f 364/557 363/556 354/547 352/545 +f 357/550 365/558 364/557 352/545 +f 359/552 352/545 351/544 360/553 +f 343/532 351/544 353/546 344/534 +f 344/533 353/546 354/547 377/576 +f 377/575 354/547 363/556 362/555 +f 379/580 356/549 355/548 346/537 +f 346/537 355/548 358/551 348/539 +f 349/541 359/552 360/553 350/543 +f 350/542 360/553 351/544 343/532 +f 357/550 361/554 366/559 365/558 +f 359/552 349/540 361/554 357/550 +f 362/555 363/556 356/549 379/579 +f 355/548 356/549 363/556 364/557 +f 365/558 358/551 355/548 364/557 +f 375/572 377/574 376/573 374/571 +f 378/577 379/578 377/574 375/572 +f 380/581 123/182 378/577 375/572 +f 380/581 375/572 374/571 124/183 +f 367/561 374/571 376/573 394/604 +f 394/603 376/573 377/574 389/593 +f 389/593 377/574 379/578 371/568 +f 371/568 379/578 378/577 370/565 +f 370/565 378/577 123/182 319/494 +f 313/484 124/183 374/571 367/561 +f 436/669 314/485 384/586 383/584 +f 314/485 313/483 367/560 384/586 +f 319/493 318/492 386/588 370/564 +f 438/672 437/671 433/666 390/594 +f 394/602 389/592 391/595 392/597 +f 383/585 393/601 392/598 433/666 +f 386/588 387/590 371/567 370/564 +f 384/586 395/605 393/600 383/584 +f 318/492 438/672 390/594 386/588 +f 391/596 387/590 386/588 390/594 +f 389/592 371/566 387/589 391/595 +f 393/599 395/605 394/602 392/597 +f 401/617 407/623 404/620 403/619 +f 396/607 406/622 407/624 401/616 +f 399/611 398/609 402/618 400/614 +f 405/621 397/608 403/619 404/620 +f 397/608 396/606 401/615 403/619 +f 398/609 405/621 404/620 402/618 +f 407/624 406/622 399/610 400/613 +f 404/620 407/623 400/612 402/618 +f 408/627 410/631 411/632 409/630 +f 410/631 412/633 413/634 411/632 +f 416/639 419/646 418/643 417/640 +f 414/636 408/626 409/629 415/637 +f 409/628 411/632 413/634 415/638 +f 414/635 412/633 410/631 408/625 +f 412/633 416/639 417/640 413/634 +f 413/634 417/640 418/642 415/638 +f 415/637 418/641 419/645 414/636 +f 414/635 419/644 416/639 412/633 +f 422/650 425/653 426/655 420/647 +f 421/648 423/651 422/650 420/647 +f 424/652 427/656 426/654 425/653 +f 329/511 309/476 315/487 336/522 +f 336/522 315/487 316/489 337/524 +f 337/524 316/489 317/491 340/528 +f 340/528 317/491 325/502 341/530 +f 341/530 325/502 326/504 345/536 +f 345/536 326/504 303/465 327/506 +f 347/538 368/562 369/563 +f 369/563 368/562 372/569 +f 372/569 368/562 373/570 +f 373/570 368/562 381/582 +f 381/582 368/562 382/583 +f 382/583 368/562 385/587 +f 385/587 368/562 388/591 +f 347/538 388/591 368/562 +f 441/675 440/674 442/676 +f 441/675 442/676 443/677 +f 441/675 443/677 444/678 +f 441/675 444/678 446/681 +f 441/675 446/681 447/682 +f 441/675 447/682 454/692 +f 441/675 454/692 455/693 +f 441/675 455/693 440/674 +f 347/538 303/464 326/503 388/591 +f 347/538 369/563 305/470 303/464 +f 369/563 372/569 309/475 305/470 +f 372/569 373/570 315/486 309/475 +f 373/570 381/582 316/488 315/486 +f 381/582 382/583 317/490 316/488 +f 382/583 385/587 325/501 317/490 +f 385/587 388/591 326/503 325/501 +f 203/317 327/505 328/508 228/344 +f 228/344 328/508 329/510 230/346 +f 41/79 43/83 44/84 42/82 +f 43/83 45/85 46/86 44/84 +f 45/85 47/88 48/91 46/86 +f 47/87 41/78 42/81 48/90 +f 42/80 44/84 46/86 48/89 +f 230/346 329/510 336/521 428/658 +f 428/658 336/521 337/523 432/665 +f 432/665 337/523 340/527 434/667 +f 434/667 340/527 341/529 435/668 +f 435/668 341/529 345/535 439/673 +f 439/673 345/535 327/505 203/317 +f 440/674 203/317 228/344 442/676 +f 442/676 228/344 230/346 443/677 +f 443/677 230/346 428/658 444/678 +f 444/678 428/658 432/665 446/681 +f 446/681 432/665 434/667 447/682 +f 447/682 434/667 435/668 454/692 +f 454/692 435/668 439/673 455/693 +f 440/674 455/693 439/673 203/317 +f 94/146 101/153 102/154 93/145 +f 357/550 352/545 359/552 +f 57/92 65/102 66/105 58/94 +f 58/93 66/104 67/107 59/95 +f 59/95 67/107 68/109 60/96 +f 60/96 68/109 69/111 61/97 +f 61/97 69/111 70/113 62/98 +f 62/98 70/113 71/115 63/99 +f 63/99 71/115 72/117 64/100 +f 64/100 72/117 65/102 57/92 +f 65/101 73/118 66/103 +f 66/103 73/118 67/106 +f 67/106 73/118 68/108 +f 68/108 73/118 69/110 +f 69/110 73/118 70/112 +f 70/112 73/118 71/114 +f 71/114 73/118 72/116 +f 72/116 73/118 65/101 +f 74/119 76/123 77/124 75/121 + diff --git a/tests/cpp-tests/Resources/Sprite3DTest/boss.png b/tests/cpp-tests/Resources/Sprite3DTest/boss.png new file mode 100644 index 0000000000..7073a9678c Binary files /dev/null and b/tests/cpp-tests/Resources/Sprite3DTest/boss.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/boss1.obj b/tests/cpp-tests/Resources/Sprite3DTest/boss1.obj new file mode 100644 index 0000000000..caa608af4b --- /dev/null +++ b/tests/cpp-tests/Resources/Sprite3DTest/boss1.obj @@ -0,0 +1,1614 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 15.05.2014 08:13:14 + +mtllib boo1.mtl + +# +# object Object +# + +v 0.5491 -0.2313 7.4010 +v 0.5491 -0.3996 7.0495 +v 0.5491 -0.3669 7.0495 +v 0.5491 -0.0174 7.0495 +v 0.5491 0.0042 7.2281 +v -0.5491 -0.3669 7.0495 +v -0.5491 -0.3996 7.0495 +v -0.5491 -0.2313 7.4010 +v -0.5491 -0.0174 7.0495 +v -0.5491 0.0042 7.2281 +v 2.0189 1.1850 -2.6543 +v 2.0189 1.1850 -0.0764 +v 2.1527 1.1295 -0.0764 +v 2.1527 1.1295 -2.6543 +v 1.8851 1.1295 -2.6543 +v 1.8851 1.1295 -0.0764 +v 1.8296 0.9957 -2.6543 +v 1.8296 0.9957 -0.0764 +v 1.8851 0.8619 -2.6543 +v 1.8851 0.8619 -0.0764 +v 2.0189 0.8064 -2.6543 +v 2.0189 0.8064 -0.0764 +v 2.1527 0.8619 -2.6543 +v 2.1527 0.8619 -0.0764 +v 2.2082 0.9957 -2.6543 +v 2.2082 0.9957 -0.0764 +v 2.0189 0.9957 0.0760 +v 2.0189 0.9959 -2.7785 +v -2.1527 1.1295 -0.0764 +v -2.0189 1.1850 -0.0764 +v -2.0189 1.1850 -2.6543 +v -2.1527 1.1295 -2.6543 +v -1.8851 1.1295 -0.0764 +v -1.8851 1.1295 -2.6543 +v -1.8296 0.9957 -0.0764 +v -1.8296 0.9957 -2.6543 +v -1.8851 0.8619 -0.0764 +v -1.8851 0.8619 -2.6543 +v -2.0189 0.8064 -0.0764 +v -2.0189 0.8064 -2.6543 +v -2.1527 0.8619 -0.0764 +v -2.1527 0.8619 -2.6543 +v -2.2082 0.9957 -0.0764 +v -2.2082 0.9957 -2.6543 +v -2.0189 0.9957 0.0760 +v -2.0189 0.9959 -2.7785 +v 0.0000 0.0042 7.2281 +v 0.0000 -0.0174 7.0495 +v 0.0000 -0.2313 7.4010 +v -0.5491 -0.8803 7.0495 +v 0.0000 -0.8803 7.0495 +v 0.0000 -0.8660 7.2281 +v -0.5491 -0.8660 7.2281 +v 0.0000 -0.5900 7.4284 +v -0.5491 -0.5900 7.4284 +v 0.8460 1.7558 -3.7140 +v 1.2699 2.8555 -3.5520 +v 1.1699 2.8947 -3.5020 +v 0.6201 1.8444 -3.6010 +v 1.2321 2.8937 -3.6576 +v 1.1320 2.9329 -3.6076 +v 0.7606 1.8420 -3.9526 +v 0.5346 1.9306 -3.8396 +v 1.2146 2.0382 -4.8054 +v 0.4218 2.4154 -4.7624 +v 0.4738 2.5225 -4.7423 +v 1.2666 2.1453 -4.7853 +v -0.1562 2.5757 -4.1199 +v -0.1042 2.6828 -4.0998 +v -2.2991 1.9669 -5.1457 +v -2.2991 1.9669 -5.7781 +v -2.2991 1.3344 -5.7781 +v -2.2991 1.3344 -5.1457 +v -1.6667 1.9669 -5.7781 +v -1.6667 1.9669 -5.1457 +v -1.6667 1.3344 -5.1457 +v -1.6667 1.3344 -5.7781 +v -2.0362 1.6380 -4.1779 +v -1.9639 1.6680 -4.1779 +v -1.9639 1.6680 -5.2168 +v -2.0362 1.6380 -5.2168 +v -1.8916 1.6380 -4.1779 +v -1.8916 1.6380 -5.2168 +v -1.8616 1.5657 -4.1779 +v -1.8616 1.5657 -5.2167 +v -1.8916 1.4934 -4.1779 +v -1.8916 1.4934 -5.2168 +v -1.9639 1.4634 -4.1779 +v -1.9639 1.4634 -5.2168 +v -2.0362 1.4934 -4.1779 +v -2.0362 1.4934 -5.2168 +v -2.0661 1.5657 -4.1779 +v -2.0661 1.5657 -5.2167 +v -1.9639 1.5657 -4.1779 +v 1.8132 0.8821 0.7520 +v 1.7356 0.7716 2.3721 +v 2.2768 0.7199 2.3598 +v 3.0073 0.6756 0.7519 +v 3.0077 0.6756 -0.7386 +v 1.8134 0.8820 -0.7386 +v 0.5255 0.8822 -0.7386 +v 0.5255 0.8822 0.7520 +v 0.5255 0.8270 1.8401 +v 1.7356 0.6499 2.3721 +v 2.2768 0.5982 2.3598 +v 3.0073 0.5540 0.7519 +v 3.0077 0.5540 -0.7386 +v 1.8136 0.7603 -4.0762 +v 1.8136 0.8820 -4.0762 +v 3.0082 0.6756 -4.0762 +v 3.0082 0.5540 -4.0762 +v 0.5255 0.7598 -4.0762 +v 0.5255 0.8823 -4.0762 +v 0.5250 0.7046 1.8372 +v 1.0438 0.6500 2.3721 +v 1.0438 0.7717 2.3721 +v 0.5252 0.7594 -0.7400 +v 0.5250 0.7590 0.7492 +v 1.3150 0.7605 0.7520 +v 1.0365 0.4285 5.7513 +v 1.8365 0.3768 5.8643 +v 1.3154 0.7603 -4.0762 +v 0.0000 0.7606 -4.0762 +v 0.0000 0.7606 0.7520 +v 0.0000 0.4288 5.7514 +v 1.8276 0.2889 5.8586 +v 1.0321 0.3404 5.7455 +v 2.9975 0.4660 0.7491 +v 2.9975 0.4660 -4.0762 +v 1.3100 0.6721 -4.0762 +v 0.0000 0.6721 -4.0762 +v 0.0000 0.3404 5.7455 +v 0.9817 -0.8791 7.0621 +v 0.9817 0.0087 7.0621 +v 0.0000 0.0087 7.0621 +v 0.0000 -0.8791 7.0621 +v 1.3100 -1.3100 -4.0762 +v 0.0000 -1.3100 -4.0762 +v 0.0000 -1.3100 0.7491 +v 1.3100 -1.3100 0.7491 +v 0.9641 -1.0946 6.5511 +v 0.0000 -1.0946 6.5511 +v 1.8274 -0.7162 6.5010 +v 2.9975 -0.9908 0.7491 +v 1.2588 -0.7709 7.0621 +v 2.9975 -0.9908 -4.0762 +v 1.2542 -0.0198 7.0621 +v 2.1329 0.6649 -8.4335 +v 2.9975 0.9908 -6.8074 +v 2.9975 -0.9908 -6.8074 +v 2.1329 -0.6649 -8.4335 +v 1.3100 -1.3100 -6.8074 +v 0.9817 -0.8791 -8.4335 +v 2.9975 -0.9908 -4.6052 +v 2.9975 0.9908 -4.6052 +v 1.3100 1.3100 -4.6052 +v 1.3100 -1.3100 -4.6052 +v 1.3100 1.3100 -6.8074 +v 0.9817 0.8791 -8.4335 +v 3.9351 -0.4210 -4.6474 +v 3.9351 0.4210 -4.6474 +v 3.0905 0.4210 -4.6474 +v 3.0905 -0.4210 -4.6474 +v 3.9351 0.4210 -7.4454 +v 3.0905 0.4210 -7.4454 +v 3.6205 0.4210 -8.5728 +v 3.6205 -0.4210 -8.5728 +v 3.0905 -0.4210 -8.5728 +v 3.0905 0.4210 -8.5728 +v 3.9351 -0.4210 -7.4454 +v 3.0905 -0.4210 -7.4454 +v 1.3100 0.6703 -2.1110 +v 1.3100 0.6703 -3.4212 +v 1.3100 1.5173 -3.4212 +v 1.3100 1.5173 -2.1110 +v 0.6551 1.1067 -0.7507 +v 0.6551 0.6703 -0.7507 +v 0.6551 0.6703 -4.0693 +v 0.6551 1.5173 -4.0693 +v -2.0362 1.8778 -4.1779 +v -1.9639 1.9077 -4.1779 +v -1.9639 1.9077 -5.2168 +v -2.0362 1.8778 -5.2168 +v -1.8916 1.8778 -4.1779 +v -1.8916 1.8778 -5.2168 +v -1.8616 1.8055 -4.1779 +v -1.8616 1.8055 -5.2167 +v -1.8916 1.7332 -4.1779 +v -1.8916 1.7332 -5.2168 +v -1.9639 1.7032 -4.1779 +v -1.9639 1.7032 -5.2168 +v -2.0362 1.7332 -4.1779 +v -2.0362 1.7332 -5.2168 +v -2.0661 1.8055 -4.1779 +v -2.0661 1.8055 -5.2167 +v -1.9639 1.8055 -4.1779 +v -7.6091 -1.0690 0.5512 +v 0.0000 -1.4598 -3.9561 +v 0.0000 -0.7653 -3.9561 +v -7.6091 -0.7653 0.5512 +v -7.6091 -0.7653 -0.6495 +v 0.0000 -0.7653 -7.7329 +v -7.6091 -1.0690 -0.6495 +v 0.0000 -1.4598 -7.7329 +v 0.0000 -0.7653 6.0720 +v -1.5430 -0.7653 4.4940 +v -1.5430 -1.3426 4.4940 +v 0.0000 -1.4598 6.0720 +v 0.0000 -0.7653 0.4394 +v 0.0000 -1.4598 0.4394 +v -1.5430 -1.3426 0.1910 +v -1.5430 -0.7653 0.1910 +v -5.1435 -0.7653 0.8122 +v -5.1435 -0.7653 -0.3885 +v -5.1435 -1.0690 -0.3885 +v -5.1435 -1.0690 0.8122 +v -1.2542 -0.0198 7.0621 +v -0.9817 0.0087 7.0621 +v -1.0321 0.3404 5.7455 +v -1.8276 0.2889 5.8586 +v -0.9817 -0.8791 7.0621 +v -0.9641 -1.0946 6.5511 +v -1.8274 -0.7162 6.5010 +v -2.9975 -0.9908 0.7491 +v -1.3100 -1.3100 0.7491 +v -0.6551 1.1067 -0.7507 +v -0.6551 0.6703 -0.7507 +v 0.0000 0.6703 -0.7507 +v 0.0000 1.1067 -0.7507 +v 4.2086 -0.7408 -0.8965 +v 4.2086 0.1580 -0.8965 +v 2.2211 0.1580 -0.2044 +v 2.2211 -0.7408 -0.2044 +v 4.2086 0.1580 -3.5166 +v 2.2211 0.1580 -3.9812 +v 4.2086 -0.7408 -3.5166 +v 2.2211 -0.7408 -3.9812 +v 0.0000 1.5173 -2.1110 +v -1.3100 1.5173 -2.1110 +v -1.3100 1.5173 -3.4212 +v 0.0000 1.5173 -3.4212 +v -0.6551 1.5173 -4.0693 +v 0.0000 1.5173 -4.0693 +v -0.6551 0.6703 -4.0693 +v -1.3100 1.3100 -6.8074 +v -1.3100 1.3100 -4.6052 +v 0.0000 1.3100 -4.6052 +v 0.0000 1.3100 -6.8074 +v -0.9817 0.8791 -8.4335 +v 0.0000 0.8791 -8.4335 +v -0.9817 -0.8791 -8.4335 +v 0.0000 -0.8791 -8.4335 +v 0.0000 -1.3100 -6.8074 +v -1.3100 -1.3100 -6.8074 +v -1.3100 -1.3100 -4.6052 +v 0.0000 -1.3100 -4.6052 +v 1.9657 0.7591 -6.3725 +v 1.9657 1.4084 -6.3725 +v 2.5383 1.4084 -6.1354 +v 2.5383 0.7591 -6.1354 +v 1.3932 0.7591 -6.1354 +v 1.3932 1.4084 -6.1354 +v 1.1560 0.7591 -5.5628 +v 1.1560 1.4084 -5.5628 +v 1.3932 0.7591 -4.9903 +v 1.3932 1.4084 -4.9903 +v 1.9657 0.7591 -4.7531 +v 1.9657 1.4084 -4.7531 +v 2.5383 0.7591 -4.9903 +v 2.5383 1.4084 -4.9903 +v 2.7755 0.7591 -5.5628 +v 2.7755 1.4084 -5.5628 +v 1.9657 1.4084 -5.5628 +v 2.2991 1.3344 -5.1457 +v 2.2991 1.9669 -5.1457 +v 1.6667 1.9669 -5.1457 +v 1.6667 1.3344 -5.1457 +v 2.2991 1.9669 -5.7781 +v 1.6667 1.9669 -5.7781 +v 2.2991 1.3344 -5.7781 +v 1.6667 1.3344 -5.7781 +v 1.9639 1.6680 -5.2168 +v 1.9639 1.6680 -4.1779 +v 2.0362 1.6380 -4.1779 +v 2.0362 1.6380 -5.2168 +v 1.8916 1.6380 -5.2168 +v 1.8916 1.6380 -4.1779 +v 1.8616 1.5657 -5.2167 +v 1.8616 1.5657 -4.1779 +v 1.8916 1.4934 -5.2168 +v 1.8916 1.4934 -4.1779 +v 1.9639 1.4634 -5.2168 +v 1.9639 1.4634 -4.1779 +v 2.0362 1.4934 -5.2168 +v 2.0362 1.4934 -4.1779 +v 2.0661 1.5657 -5.2167 +v 2.0661 1.5657 -4.1779 +v 1.9639 1.5657 -4.1779 +v 1.9639 1.9077 -5.2168 +v 1.9639 1.9077 -4.1779 +v 2.0362 1.8778 -4.1779 +v 2.0362 1.8778 -5.2168 +v 1.8916 1.8778 -5.2168 +v 1.8916 1.8778 -4.1779 +v 1.8616 1.8055 -5.2167 +v 1.8616 1.8055 -4.1779 +v 1.8916 1.7332 -5.2168 +v 1.8916 1.7332 -4.1779 +v 1.9639 1.7032 -5.2168 +v 1.9639 1.7032 -4.1779 +v 2.0362 1.7332 -5.2168 +v 2.0362 1.7332 -4.1779 +v 2.0661 1.8055 -5.2167 +v 2.0661 1.8055 -4.1779 +v 1.9639 1.8055 -4.1779 +v 7.6091 -1.0690 0.5512 +v 7.6091 -0.7653 0.5512 +v 7.6091 -0.7653 -0.6495 +v 7.6091 -1.0690 -0.6495 +v 1.5430 -1.3426 4.4940 +v 1.5430 -0.7653 4.4940 +v 1.5430 -0.7653 0.1910 +v 1.5430 -1.3426 0.1910 +v 5.1435 -1.0690 -0.3885 +v 5.1435 -0.7653 -0.3885 +v 5.1435 -0.7653 0.8122 +v 5.1435 -1.0690 0.8122 +v 0.5491 -0.5900 7.4284 +v 0.5491 -0.8803 7.0495 +v 0.5491 -0.8660 7.2281 +v -1.8132 0.8821 0.7520 +v -3.0073 0.6756 0.7519 +v -2.2768 0.7199 2.3598 +v -1.7356 0.7716 2.3721 +v -3.0077 0.6756 -0.7386 +v -1.8134 0.8820 -0.7386 +v -0.5255 0.8822 -0.7386 +v -0.5255 0.8822 0.7520 +v -0.5255 0.8270 1.8401 +v -1.0438 0.7717 2.3721 +v -1.7356 0.6499 2.3721 +v -2.2768 0.5982 2.3598 +v -3.0073 0.5540 0.7519 +v -3.0077 0.5540 -0.7386 +v -3.0082 0.6756 -4.0762 +v -1.8136 0.8820 -4.0762 +v -1.8136 0.7603 -4.0762 +v -3.0082 0.5540 -4.0762 +v -0.5255 0.8823 -4.0762 +v -0.5255 0.7598 -4.0762 +v -0.5250 0.7046 1.8372 +v -1.0438 0.6500 2.3721 +v -0.5250 0.7590 0.7492 +v -0.5252 0.7594 -0.7400 +v -1.3150 0.7605 0.7520 +v -1.8365 0.3768 5.8643 +v -1.0365 0.4285 5.7513 +v -1.3154 0.7603 -4.0762 +v -2.9975 0.4660 0.7491 +v -2.9975 0.4660 -4.0762 +v -1.3100 0.6721 -4.0762 +v -1.3100 -1.3100 -4.0762 +v -1.2588 -0.7709 7.0621 +v -2.9975 -0.9908 -4.0762 +v -2.9975 -0.9908 -6.8074 +v -2.9975 0.9908 -6.8074 +v -2.1329 0.6649 -8.4335 +v -2.1329 -0.6649 -8.4335 +v -2.9975 0.9908 -4.6052 +v -2.9975 -0.9908 -4.6052 +v -3.0905 0.4210 -4.6474 +v -3.9351 0.4210 -4.6474 +v -3.9351 -0.4210 -4.6474 +v -3.0905 -0.4210 -4.6474 +v -3.0905 0.4210 -7.4454 +v -3.9351 0.4210 -7.4454 +v -3.0905 -0.4210 -8.5728 +v -3.6205 -0.4210 -8.5728 +v -3.6205 0.4210 -8.5728 +v -3.0905 0.4210 -8.5728 +v -3.9351 -0.4210 -7.4454 +v -3.0905 -0.4210 -7.4454 +v -1.3100 0.6703 -3.4212 +v -1.3100 0.6703 -2.1110 +v -0.1808 2.4254 -3.2542 +v -0.1287 2.5325 -3.2341 +v 0.3624 2.0524 -2.6724 +v 0.4145 2.1595 -2.6523 +v 1.1553 1.6753 -2.7154 +v 1.2073 1.7823 -2.6953 +v 1.7332 1.5149 -3.3580 +v 1.7853 1.6220 -3.3379 +v 1.7578 1.6652 -4.2237 +v 1.8099 1.7723 -4.2036 +v 0.9380 1.7479 -4.5237 +v 0.5838 1.6240 -3.8179 +v 0.3954 2.0060 -4.4943 +v -0.0002 2.1158 -4.0545 +v -0.0171 2.0129 -3.4620 +v 0.3547 1.7576 -3.0638 +v 0.8974 1.4994 -3.0932 +v 1.2930 1.3897 -3.5330 +v 1.3098 1.4926 -4.1255 +v 0.7030 1.8693 -3.7719 +v 0.9801 1.9662 -4.3241 +v 0.5556 2.1682 -4.3010 +v 0.2461 2.2540 -3.9570 +v 0.2329 2.1735 -3.4935 +v 0.5238 1.9738 -3.1820 +v 0.9483 1.7719 -3.2050 +v 1.2578 1.6860 -3.5490 +v 1.2710 1.7665 -4.0126 +v 0.5227 2.4731 -4.6059 +v 1.2098 2.1463 -4.6431 +v 0.0218 2.6121 -4.0490 +v -2.2211 0.1580 -0.2044 +v -4.2086 0.1580 -0.8965 +v -4.2086 -0.7408 -0.8965 +v -2.2211 -0.7408 -0.2044 +v -2.2211 0.1580 -3.9812 +v -4.2086 0.1580 -3.5166 +v -2.2211 -0.7408 -3.9812 +v -4.2086 -0.7408 -3.5166 +v 0.0005 2.4818 -3.2987 +v 0.4713 2.1585 -2.7945 +v 1.1584 1.8317 -2.8318 +v 1.6593 1.6927 -3.3887 +v 1.6806 1.8230 -4.1389 +v -2.5383 1.4084 -6.1354 +v -1.9657 1.4084 -6.3725 +v -1.9657 0.7591 -6.3725 +v -2.5383 0.7591 -6.1354 +v -1.3932 1.4084 -6.1354 +v -1.3932 0.7591 -6.1354 +v -1.1560 1.4084 -5.5628 +v -1.1560 0.7591 -5.5628 +v -1.3932 1.4084 -4.9903 +v -1.3932 0.7591 -4.9903 +v -1.9657 1.4084 -4.7531 +v -1.9657 0.7591 -4.7531 +v -2.5383 1.4084 -4.9903 +v -2.5383 0.7591 -4.9903 +v -2.7755 1.4084 -5.5628 +v -2.7755 0.7591 -5.5628 +v -1.9657 1.4084 -5.5628 +# 445 vertices + +vn 0.6502 0.2638 0.7125 +vn 1.0000 0.0000 -0.0000 +vn 0.7327 0.6756 -0.0817 +vn 0.6092 0.7277 0.3152 +vn -1.0000 0.0000 -0.0000 +vn -0.6502 0.2638 0.7125 +vn -0.7327 0.6756 -0.0817 +vn -0.6092 0.7277 0.3152 +vn -0.0000 0.9018 -0.4322 +vn -0.0000 0.9185 0.3953 +vn 0.6495 0.6495 0.3953 +vn 0.6377 0.6376 -0.4323 +vn -0.6377 0.6376 -0.4323 +vn -0.6495 0.6495 0.3953 +vn -0.9017 -0.0001 -0.4324 +vn -0.9185 -0.0000 0.3953 +vn -0.6375 -0.6376 -0.4326 +vn -0.6495 -0.6495 0.3953 +vn -0.0000 -0.9016 -0.4326 +vn -0.0000 -0.9185 0.3953 +vn 0.6375 -0.6376 -0.4326 +vn 0.6495 -0.6495 0.3953 +vn 0.9017 -0.0001 -0.4324 +vn 0.9185 -0.0000 0.3953 +vn -0.0000 -0.0000 1.0000 +vn -0.0000 0.0006 -1.0000 +vn 0.0000 0.9185 0.3953 +vn 0.0000 0.9018 -0.4322 +vn 0.0000 -0.9185 0.3953 +vn 0.0000 -0.9016 -0.4326 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 0.0006 -1.0000 +vn 0.0000 0.9176 0.3974 +vn 0.0000 0.9928 -0.1201 +vn 0.0000 0.3472 0.9378 +vn -0.6884 -0.7230 0.0579 +vn 0.0000 -0.9968 0.0798 +vn 0.0000 -0.8720 0.4895 +vn -0.6240 -0.6814 0.3825 +vn 0.0000 -0.2723 0.9622 +vn -0.6371 -0.2099 0.7416 +vn 0.8576 -0.3814 0.3451 +vn 0.9146 0.1754 0.3642 +vn -0.0309 0.5461 0.8371 +vn -0.3313 0.0848 0.9397 +vn 0.5569 0.5364 -0.6342 +vn -0.3887 0.9071 -0.1613 +vn 0.4077 0.0725 -0.9102 +vn -0.7811 0.5387 -0.3157 +vn 0.1842 -0.3355 -0.9239 +vn -0.4566 -0.0306 -0.8891 +vn 0.0237 0.8092 -0.5871 +vn 0.5596 0.5542 -0.6162 +vn -0.9238 0.0990 -0.3697 +vn -0.3671 0.9176 -0.1527 +vn -0.5774 0.5774 0.5774 +vn -0.5774 0.5774 -0.5774 +vn -0.7071 0.0000 -0.7071 +vn -0.7071 0.0000 0.7071 +vn 0.5774 0.5774 -0.5774 +vn 0.5774 0.5774 0.5774 +vn 0.7071 0.0000 0.7071 +vn 0.7071 0.0000 -0.7071 +vn -0.5490 0.5490 0.6303 +vn 0.0000 0.7764 0.6303 +vn 0.0000 1.0000 -0.0000 +vn -0.7071 0.7071 -0.0000 +vn 0.5490 0.5490 0.6303 +vn 0.7071 0.7071 -0.0000 +vn 0.7764 0.0000 0.6303 +vn 0.5490 -0.5490 0.6303 +vn 0.7071 -0.7071 -0.0000 +vn 0.0000 -0.7764 0.6303 +vn 0.0000 -1.0000 -0.0000 +vn -0.5490 -0.5490 0.6303 +vn -0.7071 -0.7071 -0.0000 +vn -0.7764 0.0000 0.6303 +vn 0.0000 0.0000 1.0000 +vn 0.0848 0.9960 0.0288 +vn 0.0437 0.6873 0.7251 +vn 0.4732 0.5593 0.6806 +vn 0.7829 0.6009 0.1613 +vn 0.7650 0.6441 0.0002 +vn 0.0856 0.9963 -0.0000 +vn -0.4494 0.8934 -0.0001 +vn -0.7001 0.7138 0.0181 +vn -0.7097 0.6256 0.3239 +vn 0.0117 0.0000 0.9999 +vn 0.5713 0.0000 0.8207 +vn 0.9172 0.3679 0.1530 +vn 1.0000 0.0000 0.0002 +vn 0.0000 0.0000 -1.0000 +vn 0.0621 0.7227 -0.6884 +vn 0.6194 0.5215 -0.5868 +vn 0.7125 0.2937 -0.6373 +vn 0.0002 0.7071 -0.7071 +vn -0.9226 -0.0047 0.3857 +vn -0.3804 0.0000 0.9248 +vn -0.2993 0.5898 0.7501 +vn -1.0000 0.0020 -0.0002 +vn -1.0000 0.0038 0.0001 +vn 0.0600 0.9977 0.0322 +vn -0.0298 0.6843 0.7286 +vn 0.5055 0.5000 0.7032 +vn 0.0437 0.7189 -0.6937 +vn 0.0000 0.7072 -0.7071 +vn 0.0000 0.9995 0.0332 +vn 0.0000 0.6588 0.7523 +vn 0.7695 0.2745 0.5767 +vn -0.0367 0.5658 0.8237 +vn 0.9922 -0.0577 0.1104 +vn 0.6917 -0.0420 -0.7210 +vn 0.0000 0.0027 -1.0000 +vn 0.0000 0.5882 0.8087 +vn 0.1188 -0.5887 0.7996 +vn 0.0321 0.6256 0.7795 +vn 0.0000 0.6147 0.7888 +vn 0.0000 -0.5529 0.8332 +vn 0.0679 -0.7238 -0.6867 +vn 0.0000 -0.7071 -0.7071 +vn 0.0000 -0.9998 0.0186 +vn 0.1008 -0.9944 0.0303 +vn 0.1919 -0.9589 0.2090 +vn 0.0000 -0.9763 0.2164 +vn 0.8234 -0.4090 0.3934 +vn 0.7783 -0.6202 0.0974 +vn 0.4102 -0.4276 0.8055 +vn 0.6229 -0.5161 -0.5878 +vn 0.3724 0.5216 0.7676 +vn 0.4590 0.4578 -0.7614 +vn 0.7634 0.6050 -0.2262 +vn 0.7634 -0.6050 -0.2262 +vn 0.4590 -0.4578 -0.7614 +vn 0.0969 -0.9859 -0.1366 +vn 0.0512 -0.6235 -0.7801 +vn 0.6229 -0.5161 0.5878 +vn 0.6229 0.5161 0.5878 +vn 0.0679 0.7238 0.6867 +vn 0.0679 -0.7238 0.6867 +vn 0.0969 0.9859 -0.1366 +vn 0.0512 0.6235 -0.7801 +vn 0.5774 -0.5774 0.5774 +vn -0.5774 -0.5774 0.5774 +vn 0.7284 0.6778 -0.0997 +vn 0.4869 0.5930 -0.6413 +vn 0.4869 -0.5930 -0.6413 +vn -0.5774 -0.5774 -0.5774 +vn 0.7284 -0.6778 -0.0997 +vn 0.9749 0.0000 0.2225 +vn 0.9229 0.0000 -0.3851 +vn 0.7168 0.6298 -0.2991 +vn 0.6993 0.6775 0.2279 +vn 0.4259 0.4935 0.7583 +vn 0.5321 0.0000 0.8467 +vn 0.3834 0.0025 -0.9236 +vn 0.2951 0.6307 -0.7177 +vn -0.4196 -0.5423 0.7279 +vn -0.0000 -0.8481 0.5299 +vn -0.0000 0.8416 0.5402 +vn -0.4121 0.5543 0.7231 +vn -0.7140 0.6273 -0.3108 +vn 0.0000 0.5812 -0.8138 +vn -0.7312 -0.6081 -0.3090 +vn -0.0000 -0.5903 -0.8072 +vn -0.0000 0.0000 1.0000 +vn -0.6942 0.2393 0.6788 +vn -0.5446 -0.6867 0.4815 +vn -0.0000 -0.5890 0.8081 +vn -0.0000 -0.7596 -0.6504 +vn 0.0592 -0.7094 -0.7024 +vn 0.1392 0.4825 -0.8648 +vn -0.7182 0.6312 0.2928 +vn -0.5331 0.5694 -0.6258 +vn -0.5501 -0.5468 -0.6312 +vn -0.7435 -0.6026 0.2900 +vn -0.3724 0.5216 0.7676 +vn -0.0321 0.6256 0.7795 +vn 0.0367 0.5658 0.8237 +vn -0.7695 0.2745 0.5767 +vn -0.1188 -0.5887 0.7996 +vn -0.1919 -0.9589 0.2090 +vn -0.8234 -0.4090 0.3934 +vn -0.7783 -0.6202 0.0974 +vn -0.1008 -0.9944 0.0303 +vn -0.4259 0.4935 0.7583 +vn -0.5321 0.0000 0.8467 +vn 0.0000 0.5963 0.8028 +vn 0.6539 -0.5970 0.4647 +vn 0.6539 0.5970 0.4647 +vn 0.2585 0.6183 0.7422 +vn 0.2585 -0.6183 0.7422 +vn 0.6323 0.5904 -0.5016 +vn 0.1731 0.6493 -0.7405 +vn 0.6323 -0.5904 -0.5016 +vn 0.1731 -0.6493 -0.7405 +vn 0.0000 0.9893 0.1460 +vn -0.6993 0.6775 0.2279 +vn -0.7168 0.6298 -0.2991 +vn -0.2951 0.6307 -0.7177 +vn 0.0000 0.7083 -0.7059 +vn -0.3834 0.0025 -0.9236 +vn -0.0969 0.9859 -0.1366 +vn -0.0679 0.7238 0.6867 +vn 0.0000 0.7071 0.7071 +vn 0.0000 0.9916 -0.1292 +vn -0.0512 0.6235 -0.7801 +vn 0.0000 0.6098 -0.7925 +vn -0.0512 -0.6235 -0.7801 +vn 0.0000 -0.6098 -0.7925 +vn 0.0000 -0.9916 -0.1292 +vn -0.0969 -0.9859 -0.1366 +vn -0.0679 -0.7238 0.6867 +vn 0.0000 -0.7071 0.7071 +vn 0.0000 0.6303 -0.7764 +vn 0.5490 0.6303 -0.5490 +vn -0.5490 0.6303 -0.5490 +vn -0.7764 0.6303 -0.0000 +vn -0.5490 0.6303 0.5490 +vn -0.0000 0.6303 0.7764 +vn 0.5490 0.6303 0.5490 +vn 0.7764 0.6303 -0.0000 +vn -0.0000 1.0000 -0.0000 +vn -0.0000 0.7764 0.6303 +vn -0.0000 -1.0000 -0.0000 +vn -0.0000 -0.7764 0.6303 +vn 0.4196 -0.5423 0.7279 +vn 0.4121 0.5543 0.7231 +vn 0.7140 0.6273 -0.3108 +vn 0.7312 -0.6081 -0.3090 +vn 0.5446 -0.6867 0.4815 +vn 0.6942 0.2393 0.6788 +vn -0.1392 0.4825 -0.8648 +vn -0.0592 -0.7094 -0.7024 +vn 0.5501 -0.5468 -0.6312 +vn 0.5331 0.5694 -0.6258 +vn 0.7182 0.6312 0.2928 +vn 0.7435 -0.6026 0.2900 +vn 0.6371 -0.2099 0.7416 +vn 0.6884 -0.7230 0.0579 +vn 0.6240 -0.6814 0.3825 +vn -0.0848 0.9960 0.0288 +vn -0.7829 0.6009 0.1613 +vn -0.4732 0.5593 0.6806 +vn -0.0437 0.6873 0.7251 +vn -0.7650 0.6441 0.0002 +vn -0.0856 0.9963 -0.0000 +vn 0.4494 0.8934 -0.0001 +vn 0.7001 0.7138 0.0181 +vn 0.7097 0.6256 0.3239 +vn 0.2993 0.5898 0.7501 +vn -0.0117 0.0000 0.9999 +vn -0.5713 0.0000 0.8207 +vn -0.9172 0.3679 0.1530 +vn -1.0000 0.0000 0.0002 +vn -0.6194 0.5215 -0.5868 +vn -0.0621 0.7227 -0.6884 +vn -0.0000 0.0000 -1.0000 +vn -0.7125 0.2937 -0.6373 +vn -0.0002 0.7071 -0.7071 +vn 0.9226 -0.0047 0.3857 +vn 0.3804 0.0000 0.9248 +vn 1.0000 0.0038 0.0001 +vn 1.0000 0.0020 -0.0002 +vn -0.0600 0.9977 0.0322 +vn -0.5055 0.5000 0.7032 +vn 0.0298 0.6843 0.7286 +vn -0.0437 0.7189 -0.6937 +vn -0.9922 -0.0577 0.1104 +vn -0.6917 -0.0420 -0.7210 +vn -0.0679 -0.7238 -0.6867 +vn -0.4102 -0.4276 0.8055 +vn -0.6229 -0.5161 -0.5878 +vn -0.7634 -0.6050 -0.2262 +vn -0.7634 0.6050 -0.2262 +vn -0.4590 0.4578 -0.7614 +vn -0.4590 -0.4578 -0.7614 +vn -0.6229 0.5161 0.5878 +vn -0.6229 -0.5161 0.5878 +vn -0.7284 0.6778 -0.0997 +vn 0.5774 -0.5774 -0.5774 +vn -0.4869 -0.5930 -0.6413 +vn -0.4869 0.5930 -0.6413 +vn -0.7284 -0.6778 -0.0997 +vn -0.9229 0.0000 -0.3851 +vn -0.9749 0.0000 0.2225 +vn -0.9437 -0.0225 0.3300 +vn -0.3837 0.8159 0.4325 +vn -0.5046 -0.3240 0.8002 +vn -0.0164 0.5638 0.8258 +vn 0.1362 -0.6289 0.7655 +vn 0.5195 0.3088 0.7967 +vn 0.6034 -0.7585 0.2461 +vn 0.9102 0.2004 0.3623 +vn 0.6233 -0.6370 -0.4536 +vn 0.9269 0.3021 -0.2229 +vn -0.1903 -0.7733 -0.6049 +vn -0.4309 -0.8869 -0.1663 +vn -0.5326 -0.6104 -0.5863 +vn -0.7821 -0.5412 -0.3089 +vn -0.7927 -0.6061 0.0649 +vn -0.5582 -0.7672 0.3161 +vn -0.2159 -0.9300 0.2975 +vn 0.0337 -0.9992 0.0201 +vn 0.0443 -0.9343 -0.3537 +vn 0.4309 0.8869 0.1663 +vn 0.2651 0.8276 0.4949 +vn 0.5179 0.7073 0.4811 +vn 0.7023 0.6561 0.2762 +vn 0.7101 0.7041 0.0001 +vn 0.5369 0.8230 -0.1854 +vn 0.2840 0.9433 -0.1717 +vn 0.0997 0.9945 0.0332 +vn 0.0918 0.9465 0.3093 +vn 0.4828 0.8115 0.3292 +vn 0.3543 0.8726 0.3362 +vn 0.5765 0.7855 0.2251 +vn -0.2585 0.6183 0.7422 +vn -0.6539 0.5970 0.4647 +vn -0.6539 -0.5970 0.4647 +vn -0.2585 -0.6183 0.7422 +vn -0.1731 0.6493 -0.7405 +vn -0.6323 0.5904 -0.5016 +vn -0.1731 -0.6493 -0.7405 +vn -0.6323 -0.5904 -0.5016 +vn 0.5805 0.8098 0.0848 +vn 0.4924 0.8703 -0.0095 +vn 0.3640 0.9314 -0.0025 +vn 0.2703 0.9574 0.1016 +vn 0.2663 0.9330 0.2419 +vn -0.0000 0.6303 -0.7764 +vn 0.0000 0.6303 0.7764 +# 331 vertex normals + +vt 0.3471 0.0763 0.0000 +vt 0.4009 0.0969 0.0000 +vt 0.4005 0.0921 0.0000 +vt 0.3963 0.0406 0.0000 +vt 0.3698 0.0396 0.0000 +vt 0.4270 0.1552 0.0000 +vt 0.4282 0.2181 0.0000 +vt 0.4235 0.2182 0.0000 +vt 0.4222 0.1553 0.0000 +vt 0.4317 0.1551 0.0000 +vt 0.4329 0.2180 0.0000 +vt 0.4365 0.1550 0.0000 +vt 0.4377 0.2179 0.0000 +vt 0.4412 0.1548 0.0000 +vt 0.4424 0.2178 0.0000 +vt 0.4460 0.1547 0.0000 +vt 0.4475 0.2178 0.0000 +vt 0.4128 0.1555 0.0000 +vt 0.4140 0.2184 0.0000 +vt 0.4093 0.2185 0.0000 +vt 0.4080 0.1556 0.0000 +vt 0.4175 0.1554 0.0000 +vt 0.4187 0.2183 0.0000 +vt 0.4459 0.2658 0.0000 +vt 0.4270 0.2730 0.0000 +vt 0.4283 0.2466 0.0000 +vt 0.4086 0.2647 0.0000 +vt 0.4013 0.2458 0.0000 +vt 0.4096 0.2274 0.0000 +vt 0.4288 0.2208 0.0000 +vt 0.4464 0.2294 0.0000 +vt 0.4533 0.2473 0.0000 +vt 0.4272 0.2724 0.0000 +vt 0.4086 0.2649 0.0000 +vt 0.4285 0.2468 0.0000 +vt 0.4011 0.2459 0.0000 +vt 0.4464 0.2295 0.0000 +vt 0.4287 0.2211 0.0000 +vt 0.4531 0.2475 0.0000 +vt 0.4457 0.2656 0.0000 +vt 0.4097 0.2275 0.0000 +vt 0.3469 0.0332 0.0000 +vt 0.2658 0.0336 0.0000 +vt 0.2657 0.0070 0.0000 +vt 0.3468 0.0066 0.0000 +vt 0.2660 0.0768 0.0000 +vt 0.3478 0.2063 0.0000 +vt 0.2667 0.2067 0.0000 +vt 0.2665 0.1803 0.0000 +vt 0.3477 0.1798 0.0000 +vt 0.2663 0.1299 0.0000 +vt 0.3474 0.1295 0.0000 +vt 0.4067 0.1677 0.0000 +vt 0.3802 0.1677 0.0000 +vt 0.4939 0.3395 0.0000 +vt 0.4927 0.3933 0.0000 +vt 0.4874 0.3936 0.0000 +vt 0.4818 0.3400 0.0000 +vt 0.4927 0.3979 0.0000 +vt 0.4876 0.3972 0.0000 +vt 0.4888 0.4508 0.0000 +vt 0.4770 0.4492 0.0000 +vt 0.5385 0.4002 0.0000 +vt 0.5383 0.3899 0.0000 +vt 0.4535 0.3936 0.0000 +vt 0.4539 0.4012 0.0000 +vt 0.4258 0.4863 0.0000 +vt 0.4258 0.5053 0.0000 +vt 0.4186 0.5053 0.0000 +vt 0.4186 0.4863 0.0000 +vt 0.4257 0.5256 0.0000 +vt 0.4185 0.5256 0.0000 +vt 0.6112 0.4414 0.0000 +vt 0.6112 0.4866 0.0000 +vt 0.6565 0.4866 0.0000 +vt 0.6565 0.4414 0.0000 +vt 0.5660 0.4866 0.0000 +vt 0.5660 0.4414 0.0000 +vt 0.5207 0.4414 0.0000 +vt 0.5207 0.4866 0.0000 +vt 0.3522 0.2650 0.0000 +vt 0.3552 0.2650 0.0000 +vt 0.3552 0.2250 0.0000 +vt 0.3522 0.2250 0.0000 +vt 0.3582 0.2650 0.0000 +vt 0.3582 0.2250 0.0000 +vt 0.3612 0.2650 0.0000 +vt 0.3612 0.2250 0.0000 +vt 0.3642 0.2650 0.0000 +vt 0.3642 0.2250 0.0000 +vt 0.3672 0.2650 0.0000 +vt 0.3672 0.2250 0.0000 +vt 0.3431 0.2650 0.0000 +vt 0.3461 0.2650 0.0000 +vt 0.3461 0.2250 0.0000 +vt 0.3431 0.2250 0.0000 +vt 0.3491 0.2650 0.0000 +vt 0.3491 0.2250 0.0000 +vt 0.3283 0.2964 0.0000 +vt 0.3166 0.2840 0.0000 +vt 0.3161 0.3011 0.0000 +vt 0.3042 0.2957 0.0000 +vt 0.2995 0.2835 0.0000 +vt 0.3048 0.2715 0.0000 +vt 0.3171 0.2669 0.0000 +vt 0.3290 0.2722 0.0000 +vt 0.9046 0.6493 0.0000 +vt 0.9008 0.5386 0.0000 +vt 0.9379 0.5395 0.0000 +vt 0.9873 0.6497 0.0000 +vt 0.9864 0.7515 0.0000 +vt 0.9038 0.7508 0.0000 +vt 0.8159 0.7500 0.0000 +vt 0.8170 0.6483 0.0000 +vt 0.8177 0.5740 0.0000 +vt 0.9013 0.5303 0.0000 +vt 0.9389 0.5311 0.0000 +vt 0.9949 0.6465 0.0000 +vt 0.9456 0.5363 0.0000 +vt 0.9947 0.7516 0.0000 +vt 0.9956 0.6498 0.0000 +vt 0.9023 0.9864 0.0000 +vt 0.9017 0.9782 0.0000 +vt 0.9843 0.9792 0.0000 +vt 0.9856 0.9874 0.0000 +vt 0.8139 0.9861 0.0000 +vt 0.8140 0.9777 0.0000 +vt 0.8121 0.5677 0.0000 +vt 0.8481 0.5316 0.0000 +vt 0.8535 0.5379 0.0000 +vt 0.8537 0.5295 0.0000 +vt 0.8075 0.7500 0.0000 +vt 0.8085 0.6482 0.0000 +vt 0.8093 0.5737 0.0000 +vt 0.9926 0.9793 0.0000 +vt 0.6984 0.7506 0.0000 +vt 0.6880 0.5036 0.0000 +vt 0.7276 0.4986 0.0000 +vt 0.7809 0.7510 0.0000 +vt 0.7797 0.9806 0.0000 +vt 0.6993 0.9818 0.0000 +vt 0.6361 0.9823 0.0000 +vt 0.6345 0.7503 0.0000 +vt 0.6369 0.5031 0.0000 +vt 0.7269 0.4944 0.0000 +vt 0.6877 0.4992 0.0000 +vt 0.7852 0.7506 0.0000 +vt 0.7319 0.4978 0.0000 +vt 0.7828 0.9817 0.0000 +vt 0.6995 0.9861 0.0000 +vt 0.6361 0.9866 0.0000 +vt 0.6369 0.4988 0.0000 +vt 0.0588 0.0078 0.0000 +vt 0.0582 0.0539 0.0000 +vt 0.0081 0.0539 0.0000 +vt 0.0072 0.0084 0.0000 +vt 0.0599 0.1221 0.0000 +vt 0.0082 0.1222 0.0000 +vt 0.0622 0.9897 0.0000 +vt 0.0578 0.9136 0.0000 +vt 0.0088 0.9139 0.0000 +vt 0.0088 0.9914 0.0000 +vt 0.0088 0.7305 0.0000 +vt 0.0587 0.7306 0.0000 +vt 0.0455 0.5100 0.0000 +vt 0.0088 0.5099 0.0000 +vt 0.0991 0.1164 0.0000 +vt 0.1255 0.0638 0.0000 +vt 0.2859 0.3035 0.0000 +vt 0.2248 0.3404 0.0000 +vt 0.0814 0.5109 0.0000 +vt 0.0593 0.4884 0.0000 +vt 0.0473 0.4889 0.0000 +vt 0.1290 0.9746 0.0000 +vt 0.1231 0.9162 0.0000 +vt 0.0733 0.0137 0.0000 +vt 0.0723 0.0535 0.0000 +vt 0.1243 0.7308 0.0000 +vt 0.4076 0.5055 0.0000 +vt 0.3467 0.5423 0.0000 +vt 0.1027 0.0300 0.0000 +vt 0.2520 0.8877 0.0000 +vt 0.2753 0.8002 0.0000 +vt 0.3662 0.8231 0.0000 +vt 0.3188 0.9101 0.0000 +vt 0.4675 0.3531 0.0000 +vt 0.4983 0.2925 0.0000 +vt 0.4364 0.2906 0.0000 +vt 0.4248 0.3514 0.0000 +vt 0.2909 0.5936 0.0000 +vt 0.2839 0.6954 0.0000 +vt 0.1998 0.6985 0.0000 +vt 0.2053 0.5712 0.0000 +vt 0.1995 0.8032 0.0000 +vt 0.1886 0.8877 0.0000 +vt 0.2586 0.9636 0.0000 +vt 0.1940 0.9816 0.0000 +vt 0.5003 0.2126 0.0000 +vt 0.4380 0.2111 0.0000 +vt 0.3842 0.7116 0.0000 +vt 0.4162 0.9972 0.0000 +vt 0.4162 0.9568 0.0000 +vt 0.4567 0.9568 0.0000 +vt 0.4568 0.9972 0.0000 +vt 0.4167 0.8246 0.0000 +vt 0.4562 0.8235 0.0000 +vt 0.4258 0.7700 0.0000 +vt 0.4227 0.7267 0.0000 +vt 0.4499 0.7248 0.0000 +vt 0.4528 0.7682 0.0000 +vt 0.1692 0.5123 0.0000 +vt 0.0752 0.4204 0.0000 +vt 0.1029 0.3921 0.0000 +vt 0.1967 0.4837 0.0000 +vt 0.3770 0.8226 0.0000 +vt 0.3759 0.9564 0.0000 +vt 0.4959 0.9570 0.0000 +vt 0.4967 0.8229 0.0000 +vt 0.3842 0.7648 0.0000 +vt 0.2353 0.5196 0.0000 +vt 0.2184 0.5378 0.0000 +vt 0.4948 0.7667 0.0000 +vt 0.0958 0.2088 0.0000 +vt 0.1108 0.2706 0.0000 +vt 0.0708 0.2802 0.0000 +vt 0.0626 0.2229 0.0000 +vt 0.0393 0.1588 0.0000 +vt 0.0570 0.1477 0.0000 +vt 0.1029 0.3079 0.0000 +vt 0.0728 0.3428 0.0000 +vt 0.0408 0.3151 0.0000 +vt 0.3337 0.2844 0.0000 +vt 0.3136 0.2652 0.0000 +vt 0.3167 0.2652 0.0000 +vt 0.3159 0.2244 0.0000 +vt 0.3128 0.2245 0.0000 +vt 0.3198 0.2651 0.0000 +vt 0.3190 0.2244 0.0000 +vt 0.3228 0.2650 0.0000 +vt 0.3220 0.2243 0.0000 +vt 0.3259 0.2650 0.0000 +vt 0.3251 0.2242 0.0000 +vt 0.3292 0.2650 0.0000 +vt 0.3282 0.2241 0.0000 +vt 0.3045 0.2654 0.0000 +vt 0.3075 0.2654 0.0000 +vt 0.3067 0.2246 0.0000 +vt 0.3036 0.2247 0.0000 +vt 0.3106 0.2653 0.0000 +vt 0.3098 0.2246 0.0000 +vt 0.3683 0.2960 0.0000 +vt 0.3565 0.2836 0.0000 +vt 0.3561 0.3007 0.0000 +vt 0.3441 0.2953 0.0000 +vt 0.3394 0.2831 0.0000 +vt 0.3448 0.2712 0.0000 +vt 0.3570 0.2665 0.0000 +vt 0.3690 0.2718 0.0000 +vt 0.3737 0.2841 0.0000 +vt 0.6213 0.9820 0.0000 +vt 0.6150 0.7234 0.0000 +vt 0.5947 0.7248 0.0000 +vt 0.6125 0.9826 0.0000 +vt 0.5812 0.9670 0.0000 +vt 0.4960 0.6751 0.0000 +vt 0.5726 0.9695 0.0000 +vt 0.4765 0.6808 0.0000 +vt 0.1112 0.3370 0.0000 +vt 0.2919 0.5292 0.0000 +vt 0.3019 0.4948 0.0000 +vt 0.1425 0.2289 0.0000 +vt 0.5772 0.9749 0.0000 +vt 0.6085 0.9905 0.0000 +vt 0.3608 0.3837 0.0000 +vt 0.4355 0.4520 0.0000 +vt 0.4532 0.4332 0.0000 +vt 0.3823 0.3602 0.0000 +vt 0.3742 0.6360 0.0000 +vt 0.3713 0.6667 0.0000 +vt 0.4407 0.6681 0.0000 +vt 0.4434 0.6426 0.0000 +vt 0.5257 0.3814 0.0000 +vt 0.5103 0.2261 0.0000 +vt 0.5573 0.2654 0.0000 +vt 0.5691 0.3841 0.0000 +vt 0.6013 0.6081 0.0000 +vt 0.6036 0.6610 0.0000 +vt 0.6169 0.6604 0.0000 +vt 0.6146 0.6075 0.0000 +vt 0.0088 0.4884 0.0000 +vt 0.0393 0.1379 0.0000 +vt 0.0077 0.1378 0.0000 +vt 0.0077 0.1578 0.0000 +vt 0.9484 0.4463 0.0000 +vt 0.9005 0.4300 0.0000 +vt 0.9388 0.3179 0.0000 +vt 0.9866 0.3343 0.0000 +vt 0.7531 0.4310 0.0000 +vt 0.7262 0.3193 0.0000 +vt 0.7039 0.4428 0.0000 +vt 0.6771 0.3311 0.0000 +vt 0.2531 0.0136 0.0000 +vt 0.1783 0.0311 0.0000 +vt 0.1783 0.1297 0.0000 +vt 0.2531 0.1558 0.0000 +vt 0.7534 0.4815 0.0000 +vt 0.9009 0.4806 0.0000 +vt 0.0077 0.2224 0.0000 +vt 0.0077 0.2843 0.0000 +vt 0.0077 0.3165 0.0000 +vt 0.0413 0.3585 0.0000 +vt 0.0077 0.3588 0.0000 +vt 0.1380 0.6955 0.0000 +vt 0.1380 0.8042 0.0000 +vt 0.1380 0.8914 0.0000 +vt 0.1380 0.9827 0.0000 +vt 0.3890 0.2902 0.0000 +vt 0.3891 0.3514 0.0000 +vt 0.3905 0.2102 0.0000 +vt 0.1380 0.5702 0.0000 +vt 0.6105 0.5983 0.0000 +vt 0.6020 0.6743 0.0000 +vt 0.5660 0.5319 0.0000 +vt 0.6112 0.5319 0.0000 +vt 0.6671 0.3568 0.0000 +vt 0.6707 0.3903 0.0000 +vt 0.9911 0.2404 0.0000 +vt 0.9911 0.2872 0.0000 +vt 0.9462 0.2871 0.0000 +vt 0.9463 0.2404 0.0000 +vt 0.7013 0.2433 0.0000 +vt 0.7013 0.2842 0.0000 +vt 0.6620 0.2843 0.0000 +vt 0.6620 0.2432 0.0000 +vt 0.7399 0.2434 0.0000 +vt 0.7399 0.2840 0.0000 +vt 0.7787 0.2431 0.0000 +vt 0.7787 0.2842 0.0000 +vt 0.8182 0.2427 0.0000 +vt 0.8182 0.2846 0.0000 +vt 0.8589 0.2417 0.0000 +vt 0.8588 0.2856 0.0000 +vt 0.9017 0.2409 0.0000 +vt 0.9017 0.2865 0.0000 +vt 0.9733 0.2072 0.0000 +vt 0.9119 0.2326 0.0000 +vt 0.9119 0.1424 0.0000 +vt 0.8505 0.2072 0.0000 +vt 0.8251 0.1458 0.0000 +vt 0.8505 0.0845 0.0000 +vt 0.9119 0.0590 0.0000 +vt 0.9733 0.0845 0.0000 +vt 0.9987 0.1458 0.0000 +vt 0.6112 0.3961 0.0000 +vt 0.5660 0.3961 0.0000 +vt 0.4257 0.5463 0.0000 +vt 0.4184 0.5462 0.0000 +vt 0.4256 0.5658 0.0000 +vt 0.4184 0.5658 0.0000 +vt 0.4256 0.5832 0.0000 +vt 0.4183 0.5832 0.0000 +vt 0.4255 0.5977 0.0000 +vt 0.4183 0.5978 0.0000 +vt 0.4255 0.6090 0.0000 +vt 0.4183 0.6092 0.0000 +vt 0.4255 0.6165 0.0000 +vt 0.4182 0.6169 0.0000 +vt 0.3594 0.5738 0.0000 +vt 0.3462 0.5864 0.0000 +vt 0.3459 0.5682 0.0000 +vt 0.3332 0.5738 0.0000 +vt 0.3282 0.5866 0.0000 +vt 0.3335 0.5991 0.0000 +vt 0.3461 0.6043 0.0000 +vt 0.3588 0.5993 0.0000 +vt 0.3644 0.5867 0.0000 +vt 0.3461 0.5864 0.0000 +vt 0.3594 0.5998 0.0000 +vt 0.3460 0.6052 0.0000 +vt 0.3328 0.5996 0.0000 +vt 0.3273 0.5864 0.0000 +vt 0.3328 0.5731 0.0000 +vt 0.3461 0.5676 0.0000 +vt 0.3594 0.5730 0.0000 +vt 0.3649 0.5863 0.0000 +vt 0.3680 0.5650 0.0000 +vt 0.3764 0.5870 0.0000 +vt 0.3457 0.5560 0.0000 +vt 0.3246 0.5656 0.0000 +vt 0.3165 0.5868 0.0000 +vt 0.3253 0.6074 0.0000 +vt 0.3460 0.6160 0.0000 +vt 0.3670 0.6079 0.0000 +vt 0.3726 0.6130 0.0000 +vt 0.3459 0.6238 0.0000 +vt 0.3460 0.6188 0.0000 +vt 0.3690 0.6095 0.0000 +vt 0.3196 0.6127 0.0000 +vt 0.3231 0.6092 0.0000 +vt 0.3087 0.5863 0.0000 +vt 0.3137 0.5864 0.0000 +vt 0.3196 0.5600 0.0000 +vt 0.3232 0.5635 0.0000 +vt 0.3460 0.5489 0.0000 +vt 0.3460 0.5539 0.0000 +vt 0.3725 0.5597 0.0000 +vt 0.3690 0.5633 0.0000 +vt 0.3837 0.5863 0.0000 +vt 0.3787 0.5863 0.0000 +# 409 texture coords + +g Object +usemtl _bossdefault +s 1 +f 1/1/1 2/2/2 3/3/2 4/4/3 +f 1/1/1 4/4/3 5/5/4 +f 6/3/5 7/2/5 8/1/6 9/4/7 +f 9/4/7 8/1/6 10/5/8 +f 11/6/9 12/7/10 13/8/11 14/9/12 +f 15/10/13 16/11/14 12/7/10 11/6/9 +f 17/12/15 18/13/16 16/11/14 15/10/13 +f 19/14/17 20/15/18 18/13/16 17/12/15 +f 21/16/19 22/17/20 20/15/18 19/14/17 +f 23/18/21 24/19/22 22/20/20 21/21/19 +f 25/22/23 26/23/24 24/19/22 23/18/21 +f 14/9/12 13/8/11 26/23/24 25/22/23 +f 13/24/11 12/25/10 27/26/25 +f 12/25/10 16/27/14 27/26/25 +f 16/27/14 18/28/16 27/26/25 +f 18/28/16 20/29/18 27/26/25 +f 20/29/18 22/30/20 27/26/25 +f 22/30/20 24/31/22 27/26/25 +f 24/31/22 26/32/24 27/26/25 +f 26/32/24 13/24/11 27/26/25 +f 15/33/13 11/34/9 28/35/26 +f 28/35/26 11/34/9 14/36/12 +f 21/37/19 28/35/26 23/38/21 +f 19/39/17 28/35/26 21/37/19 +f 15/33/13 28/35/26 17/40/15 +f 17/40/15 28/35/26 19/39/17 +f 23/38/21 28/35/26 25/41/23 +f 25/41/23 28/35/26 14/36/12 +f 29/8/14 30/7/27 31/6/28 32/9/13 +f 30/7/27 33/11/11 34/10/12 31/6/28 +f 33/11/11 35/13/24 36/12/23 34/10/12 +f 35/13/24 37/15/22 38/14/21 36/12/23 +f 37/15/22 39/17/29 40/16/30 38/14/21 +f 39/20/29 41/19/18 42/18/17 40/21/30 +f 41/19/18 43/23/16 44/22/15 42/18/17 +f 43/23/16 29/8/14 32/9/13 44/22/15 +f 29/24/14 45/26/31 30/25/27 +f 30/25/27 45/26/31 33/27/11 +f 33/27/11 45/26/31 35/28/24 +f 35/28/24 45/26/31 37/29/22 +f 37/29/22 45/26/31 39/30/29 +f 39/30/29 45/26/31 41/31/18 +f 41/31/18 45/26/31 43/32/16 +f 43/32/16 45/26/31 29/24/14 +f 34/33/12 46/35/32 31/34/28 +f 46/35/32 32/36/13 31/34/28 +f 40/37/30 42/38/17 46/35/32 +f 38/39/21 40/37/30 46/35/32 +f 34/33/12 36/40/23 46/35/32 +f 36/40/23 38/39/21 46/35/32 +f 42/38/17 44/41/15 46/35/32 +f 44/41/15 32/36/13 46/35/32 +f 10/42/8 47/43/33 48/44/34 9/45/7 +f 8/1/6 49/46/35 47/43/33 10/42/8 +f 50/47/36 51/48/37 52/49/38 53/50/39 +f 53/50/39 52/49/38 54/51/40 55/52/41 +f 8/1/6 7/2/5 55/52/41 +f 55/52/41 7/2/5 50/53/36 53/54/39 +f 56/55/42 57/56/43 58/57/44 59/58/45 +f 57/56/43 60/59/46 61/60/47 58/57/44 +f 60/59/46 62/61/48 63/62/49 61/60/47 +f 62/63/48 60/59/46 57/56/43 56/64/42 +f 59/65/45 58/57/44 61/60/47 63/66/49 +f 64/67/50 65/68/51 66/69/52 67/70/53 +f 65/68/51 68/71/54 69/72/55 66/69/52 +f 70/73/56 71/74/57 72/75/58 73/76/59 +f 74/77/60 75/78/61 76/79/62 77/80/63 +f 78/81/64 79/82/65 80/83/66 81/84/67 +f 79/82/65 82/85/68 83/86/69 80/83/66 +f 82/85/68 84/87/70 85/88/2 83/86/69 +f 84/87/70 86/89/71 87/90/72 85/88/2 +f 86/89/71 88/91/73 89/92/74 87/90/72 +f 88/93/73 90/94/75 91/95/76 89/96/74 +f 90/94/75 92/97/77 93/98/5 91/95/76 +f 92/97/77 78/81/64 81/84/67 93/98/5 +f 78/99/64 94/100/78 79/101/65 +f 79/101/65 94/100/78 82/102/68 +f 82/102/68 94/100/78 84/103/70 +f 84/103/70 94/100/78 86/104/71 +f 86/104/71 94/100/78 88/105/73 +f 88/105/73 94/100/78 90/106/75 +f 95/107/79 96/108/80 97/109/81 98/110/82 +f 95/107/79 98/110/82 99/111/83 100/112/84 +f 95/107/79 100/112/84 101/113/85 102/114/86 +f 102/114/86 103/115/87 95/107/79 +f 104/116/88 105/117/89 97/109/81 96/108/80 +f 106/118/90 98/110/82 97/109/81 105/119/89 +f 107/120/91 99/111/83 98/110/82 106/121/90 +f 108/122/92 109/123/93 110/124/94 111/125/95 +f 112/126/92 113/127/96 109/123/93 108/122/92 +f 114/128/97 115/129/98 116/130/99 103/115/87 +f 104/116/88 96/108/80 116/130/99 115/131/98 +f 101/113/85 117/132/100 118/133/101 102/114/86 +f 103/115/87 102/114/86 118/133/101 114/134/97 +f 111/135/95 110/124/94 99/111/83 107/120/91 +f 100/112/84 99/111/83 110/124/94 109/123/93 +f 100/112/84 109/123/93 113/127/96 101/113/85 +f 119/136/102 120/137/103 121/138/104 106/139/90 +f 119/136/102 106/139/90 111/140/95 122/141/105 +f 119/136/102 122/141/105 123/142/106 124/143/107 +f 124/143/107 125/144/108 120/137/103 119/136/102 +f 126/145/109 121/138/104 120/137/103 127/146/110 +f 128/147/111 106/139/90 121/138/104 126/148/109 +f 129/149/112 111/140/95 106/139/90 128/147/111 +f 130/150/92 122/141/105 111/140/95 129/149/112 +f 131/151/113 123/142/106 122/141/105 130/150/92 +f 127/146/110 120/137/103 125/144/108 132/152/114 +f 133/153/115 134/154/116 135/155/117 136/156/118 +f 134/154/116 127/157/110 132/158/114 135/155/117 +f 130/159/92 137/160/119 138/161/120 131/162/113 +f 139/163/121 140/164/122 141/165/123 142/166/124 +f 126/167/109 143/168/125 144/169/126 128/170/111 +f 141/165/123 143/171/125 145/172/127 133/173/115 +f 130/159/92 129/174/112 146/175/128 137/160/119 +f 134/154/116 133/153/115 145/176/127 147/177/129 +f 137/160/119 140/164/122 139/163/121 138/161/120 +f 140/164/122 137/160/119 146/175/128 144/178/126 +f 144/169/126 146/179/128 129/180/112 128/170/111 +f 143/168/125 126/167/109 147/177/129 145/181/127 +f 148/182/130 149/183/131 150/184/132 151/185/133 +f 151/186/133 150/187/132 152/188/134 153/189/135 +f 154/190/136 155/191/137 156/192/138 157/193/139 +f 158/194/140 149/183/131 148/182/130 159/195/141 +f 148/182/130 151/196/133 153/197/135 159/195/141 +f 155/191/137 149/183/131 158/194/140 156/192/138 +f 154/198/136 157/199/139 152/188/134 150/187/132 +f 155/191/137 154/200/136 150/184/132 149/183/131 +f 160/201/142 161/202/61 162/203/56 163/204/143 +f 161/202/61 164/205/144 165/206/67 162/203/56 +f 166/207/145 167/208/146 168/209/147 169/210/57 +f 170/211/148 160/212/142 163/213/143 171/214/76 +f 170/215/148 164/205/144 161/202/61 160/216/142 +f 163/217/143 162/203/56 165/206/67 171/218/76 +f 165/206/67 164/205/144 166/207/145 169/210/57 +f 170/215/148 167/219/146 166/207/145 164/205/144 +f 171/214/76 168/220/147 167/221/146 170/211/148 +f 165/206/67 169/210/57 168/222/147 171/218/76 +f 172/223/149 173/224/150 174/225/151 175/226/152 +f 172/223/149 175/226/152 176/227/153 177/228/154 +f 174/225/151 173/229/150 178/230/155 179/231/156 +f 90/106/75 94/100/78 92/232/77 +f 92/232/77 94/100/78 78/99/64 +f 180/233/64 181/234/65 182/235/66 183/236/67 +f 181/234/65 184/237/68 185/238/69 182/235/66 +f 184/237/68 186/239/70 187/240/2 185/238/69 +f 186/239/70 188/241/71 189/242/72 187/240/2 +f 188/241/71 190/243/73 191/244/74 189/242/72 +f 190/245/73 192/246/75 193/247/76 191/248/74 +f 192/246/75 194/249/77 195/250/5 193/247/76 +f 194/249/77 180/233/64 183/236/67 195/250/5 +f 180/251/64 196/252/78 181/253/65 +f 181/253/65 196/252/78 184/254/68 +f 184/254/68 196/252/78 186/255/70 +f 186/255/70 196/252/78 188/256/71 +f 188/256/71 196/252/78 190/257/73 +f 190/257/73 196/252/78 192/258/75 +f 192/258/75 196/252/78 194/259/77 +f 194/259/77 196/252/78 180/251/64 +f 74/77/60 71/74/57 70/73/56 75/78/61 +f 197/260/157 198/261/158 199/262/159 200/263/160 +f 201/264/161 200/263/160 199/262/159 202/265/162 +f 203/266/163 201/264/161 202/265/162 204/267/164 +f 198/268/158 197/269/157 203/270/163 204/271/164 +f 200/263/160 201/264/161 203/272/163 197/273/157 +f 205/274/165 206/275/166 207/276/167 208/277/168 +f 209/278/92 210/279/169 211/280/170 212/281/171 +f 210/282/169 208/283/168 207/284/167 211/285/170 +f 213/286/172 214/287/173 215/288/174 216/289/175 +f 217/177/176 218/154/177 219/157/178 220/167/179 +f 136/290/118 221/173/180 222/165/181 142/166/124 +f 223/171/182 224/178/183 225/164/184 222/165/181 +f 226/227/185 227/291/186 228/292/78 229/293/187 +f 230/294/188 231/295/189 232/296/190 233/297/191 +f 231/295/189 234/298/192 235/299/193 232/296/190 +f 234/298/192 236/300/194 237/301/195 235/299/193 +f 237/302/195 236/303/194 230/304/188 233/305/191 +f 236/306/194 234/298/192 231/295/189 230/307/188 +f 238/308/196 239/226/197 226/227/185 229/293/187 +f 240/225/198 239/226/197 238/308/196 241/309/66 +f 242/231/199 240/225/198 241/309/66 243/310/200 +f 244/311/201 242/231/199 243/310/200 131/312/113 +f 245/194/202 246/192/203 247/313/204 248/314/205 +f 249/195/206 245/194/202 248/314/205 250/315/207 +f 251/197/208 249/195/206 250/315/207 252/316/209 +f 253/317/210 254/188/211 251/189/208 252/318/209 +f 255/199/212 254/188/211 253/317/210 256/319/213 +f 246/192/203 255/193/212 256/320/213 247/313/204 +f 206/275/166 213/286/172 216/321/175 207/276/167 +f 212/281/171 214/287/173 213/286/172 206/275/166 +f 215/322/174 214/287/173 212/281/171 211/280/170 +f 77/323/63 72/324/58 71/74/57 74/77/60 +f 216/325/175 215/326/174 211/285/170 207/284/167 +f 55/52/41 54/51/40 49/46/35 8/1/6 +f 257/327/92 258/328/214 259/329/215 260/330/63 +f 261/331/58 262/332/216 258/333/214 257/334/92 +f 263/335/5 264/336/217 262/332/216 261/331/58 +f 265/337/59 266/338/218 264/336/217 263/335/5 +f 267/339/165 268/340/219 266/338/218 265/337/59 +f 269/341/62 270/342/220 268/340/219 267/339/165 +f 271/343/2 272/344/221 270/342/220 269/341/62 +f 260/330/63 259/329/215 272/344/221 271/343/2 +f 259/345/215 258/346/214 273/347/66 +f 258/346/214 262/348/216 273/347/66 +f 262/348/216 264/349/217 273/347/66 +f 264/349/217 266/350/218 273/347/66 +f 266/350/218 268/351/219 273/347/66 +f 268/351/219 270/352/220 273/347/66 +f 270/352/220 272/353/221 273/347/66 +f 272/353/221 259/345/215 273/347/66 +f 274/354/62 275/73/61 276/78/56 277/355/59 +f 275/73/61 278/74/60 279/77/57 276/78/56 +f 278/74/60 280/324/63 281/323/58 279/77/57 +f 280/75/63 278/74/60 275/73/61 274/76/62 +f 277/79/59 276/78/56 279/77/57 281/80/58 +f 282/83/222 283/82/223 284/81/68 285/84/69 +f 286/86/67 287/85/64 283/82/223 282/83/222 +f 288/88/5 289/87/77 287/85/64 286/86/67 +f 290/90/76 291/89/75 289/87/77 288/88/5 +f 292/92/224 293/91/225 291/89/75 290/90/76 +f 294/95/72 295/94/71 293/93/225 292/96/224 +f 296/98/2 297/97/70 295/94/71 294/95/72 +f 285/84/69 284/81/68 297/97/70 296/98/2 +f 284/99/68 283/101/223 298/100/78 +f 283/101/223 287/102/64 298/100/78 +f 287/102/64 289/103/77 298/100/78 +f 289/103/77 291/104/75 298/100/78 +f 291/104/75 293/105/225 298/100/78 +f 293/105/225 295/106/71 298/100/78 +f 295/106/71 297/232/70 298/100/78 +f 297/232/70 284/99/68 298/100/78 +f 299/235/222 300/234/223 301/233/68 302/236/69 +f 303/238/67 304/237/64 300/234/223 299/235/222 +f 305/240/5 306/239/77 304/237/64 303/238/67 +f 307/242/76 308/241/75 306/239/77 305/240/5 +f 309/244/224 310/243/225 308/241/75 307/242/76 +f 311/247/72 312/246/71 310/245/225 309/248/224 +f 313/250/2 314/249/70 312/246/71 311/247/72 +f 302/236/69 301/233/68 314/249/70 313/250/2 +f 301/251/68 300/253/223 315/252/78 +f 300/253/223 304/254/64 315/252/78 +f 304/254/64 306/255/77 315/252/78 +f 306/255/77 308/256/75 315/252/78 +f 308/256/75 310/257/225 315/252/78 +f 310/257/225 312/258/71 315/252/78 +f 312/258/71 314/259/70 315/252/78 +f 314/259/70 301/251/68 315/252/78 +f 199/262/159 198/261/158 316/260/226 317/263/227 +f 199/262/159 317/263/227 318/264/228 202/265/162 +f 202/265/162 318/264/228 319/266/229 204/267/164 +f 198/268/158 204/271/164 319/270/229 316/269/226 +f 319/272/229 318/264/228 317/263/227 316/273/226 +f 320/276/230 321/275/231 205/274/165 208/277/168 +f 209/278/92 322/281/232 323/280/233 210/279/169 +f 210/282/169 323/285/233 320/284/230 208/283/168 +f 324/288/234 325/287/235 326/286/236 327/289/237 +f 127/157/110 134/154/116 147/177/129 126/167/109 +f 141/165/123 133/173/115 136/290/118 142/166/124 +f 143/171/125 141/165/123 140/164/122 144/178/126 +f 228/292/78 177/291/154 176/227/153 229/293/187 +f 238/308/196 229/293/187 176/227/153 175/226/152 +f 238/308/196 175/226/152 174/225/151 241/309/66 +f 241/309/66 174/225/151 179/231/156 243/310/200 +f 243/310/200 179/231/156 178/311/155 131/312/113 +f 247/313/204 156/192/138 158/194/140 248/314/205 +f 248/314/205 158/194/140 159/195/141 250/315/207 +f 250/315/207 159/195/141 153/197/135 252/316/209 +f 253/317/210 252/318/209 153/189/135 152/188/134 +f 253/317/210 152/188/134 157/199/139 256/319/213 +f 256/320/213 157/193/139 156/192/138 247/313/204 +f 327/321/237 326/286/236 321/275/231 320/276/230 +f 322/281/232 321/275/231 326/286/236 325/287/235 +f 322/281/232 325/287/235 324/322/234 323/280/233 +f 323/285/233 324/326/234 327/325/237 320/284/230 +f 49/46/35 54/51/40 328/52/238 1/1/1 +f 48/44/34 47/43/33 5/42/4 4/45/3 +f 47/43/33 49/46/35 1/1/1 5/42/4 +f 52/49/38 51/48/37 329/47/239 330/50/240 +f 54/51/40 52/49/38 330/50/240 328/52/238 +f 1/1/1 328/52/238 2/2/2 +f 328/52/238 330/54/240 329/53/239 2/2/2 +f 331/107/241 332/110/242 333/109/243 334/108/244 +f 335/111/245 332/110/242 331/107/241 336/112/246 +f 337/113/247 336/112/246 331/107/241 338/114/248 +f 339/115/249 331/107/241 334/108/244 340/130/250 +f 341/116/251 334/108/244 333/109/243 342/117/252 +f 333/109/243 332/110/242 343/118/253 342/119/252 +f 332/110/242 335/111/245 344/120/254 343/121/253 +f 345/124/255 346/123/256 347/122/257 348/125/258 +f 346/123/256 349/127/259 350/126/257 347/122/257 +f 351/128/260 339/115/249 340/130/250 352/129/261 +f 340/130/250 334/108/244 341/116/251 352/131/261 +f 353/133/262 354/132/263 337/113/247 338/114/248 +f 339/115/249 351/134/260 353/133/262 338/114/248 +f 335/111/245 345/124/255 348/135/258 344/120/254 +f 345/124/255 335/111/245 336/112/246 346/123/256 +f 349/127/259 346/123/256 336/112/246 337/113/247 +f 355/136/264 343/139/253 356/138/265 357/137/266 +f 348/140/258 343/139/253 355/136/264 358/141/267 +f 123/142/106 358/141/267 355/136/264 124/143/107 +f 124/143/107 355/136/264 357/137/266 125/144/108 +f 357/137/266 356/138/265 220/145/179 219/146/178 +f 356/138/265 343/139/253 359/147/268 220/148/179 +f 343/139/253 348/140/258 360/149/269 359/147/268 +f 348/140/258 358/141/267 361/150/92 360/149/269 +f 358/141/267 123/142/106 131/151/113 361/150/92 +f 125/144/108 357/137/266 219/146/178 132/152/114 +f 135/155/117 218/154/177 221/153/180 136/156/118 +f 132/158/114 219/157/178 218/154/177 135/155/117 +f 138/161/120 362/160/270 361/159/92 131/162/113 +f 139/163/121 142/166/124 222/165/181 225/164/184 +f 220/167/179 359/170/268 224/169/183 223/168/182 +f 363/172/271 223/171/182 222/165/181 221/173/180 +f 364/175/272 360/174/269 361/159/92 362/160/270 +f 218/154/177 217/177/176 363/176/271 221/153/180 +f 139/163/121 225/164/184 362/160/270 138/161/120 +f 364/175/272 362/160/270 225/164/184 224/178/183 +f 360/180/269 364/179/272 224/169/183 359/170/268 +f 217/177/176 220/167/179 223/168/182 363/181/271 +f 365/184/273 366/183/274 367/182/275 368/185/276 +f 254/188/211 365/187/273 368/186/276 251/189/208 +f 246/192/203 369/191/277 370/190/278 255/193/212 +f 245/194/202 249/195/206 367/182/275 366/183/274 +f 251/197/208 368/196/276 367/182/275 249/195/206 +f 245/194/202 366/183/274 369/191/277 246/192/203 +f 254/188/211 255/199/212 370/198/278 365/187/273 +f 365/184/273 370/200/278 369/191/277 366/183/274 +f 371/203/61 372/202/56 373/201/143 374/204/142 +f 375/206/69 376/205/279 372/202/56 371/203/61 +f 377/209/280 378/208/281 379/207/282 380/210/60 +f 374/213/142 373/212/143 381/211/283 382/214/72 +f 372/202/56 376/205/279 381/215/283 373/216/143 +f 375/206/69 371/203/61 374/217/142 382/218/72 +f 375/206/69 380/210/60 379/207/282 376/205/279 +f 379/207/282 378/219/281 381/215/283 376/205/279 +f 378/221/281 377/220/280 382/214/72 381/211/283 +f 377/222/280 380/210/60 375/206/69 382/218/72 +f 240/225/198 383/224/284 384/223/285 239/226/197 +f 226/227/185 239/226/197 384/223/285 227/228/186 +f 244/230/201 383/229/284 240/225/198 242/231/199 +f 68/71/54 385/356/286 386/357/287 69/72/55 +f 385/356/286 387/358/288 388/359/289 386/357/287 +f 387/358/288 389/360/290 390/361/291 388/359/289 +f 389/360/290 391/362/292 392/363/293 390/361/291 +f 391/362/292 393/364/294 394/365/295 392/363/293 +f 393/364/294 64/366/50 67/367/53 394/365/295 +f 395/368/296 396/369/297 397/370/298 +f 397/370/298 396/369/297 398/371/299 +f 398/371/299 396/369/297 399/372/300 +f 399/372/300 396/369/297 400/373/301 +f 400/373/301 396/369/297 401/374/302 +f 401/374/302 396/369/297 402/375/303 +f 402/375/303 396/369/297 403/376/304 +f 395/368/296 403/376/304 396/369/297 +f 404/377/305 405/378/306 406/379/307 +f 404/377/305 406/379/307 407/380/308 +f 404/377/305 407/380/308 408/381/309 +f 404/377/305 408/381/309 409/382/310 +f 404/377/305 409/382/310 410/383/311 +f 404/377/305 410/383/311 411/384/312 +f 404/377/305 411/384/312 412/385/313 +f 404/377/305 412/385/313 405/378/306 +f 64/386/50 393/387/294 403/376/304 395/368/296 +f 397/370/298 65/388/51 64/386/50 395/368/296 +f 398/371/299 68/389/54 65/388/51 397/370/298 +f 399/372/300 385/390/286 68/389/54 398/371/299 +f 400/373/301 387/391/288 385/390/286 399/372/300 +f 401/374/302 389/392/290 387/391/288 400/373/301 +f 402/375/303 391/393/292 389/392/290 401/374/302 +f 403/376/304 393/387/294 391/393/292 402/375/303 +f 67/394/53 66/395/52 413/396/314 414/397/315 +f 66/395/52 69/398/55 415/399/316 413/396/314 +f 416/296/317 417/295/318 418/294/319 419/297/320 +f 420/299/321 421/298/322 417/295/318 416/296/317 +f 422/301/323 423/300/324 421/298/322 420/299/321 +f 422/302/323 419/305/320 418/304/319 423/303/324 +f 417/295/318 421/298/322 423/306/324 418/307/319 +f 69/398/55 386/400/287 424/401/325 415/399/316 +f 386/400/287 388/402/289 425/403/326 424/401/325 +f 388/402/289 390/404/291 426/405/327 425/403/326 +f 390/404/291 392/406/293 427/407/328 426/405/327 +f 392/406/293 394/408/295 428/409/329 427/407/328 +f 394/408/295 67/394/53 414/397/315 428/409/329 +f 414/397/315 413/396/314 406/379/307 405/378/306 +f 413/396/314 415/399/316 407/380/308 406/379/307 +f 415/399/316 424/401/325 408/381/309 407/380/308 +f 424/401/325 425/403/326 409/382/310 408/381/309 +f 425/403/326 426/405/327 410/383/311 409/382/310 +f 426/405/327 427/407/328 411/384/312 410/383/311 +f 427/407/328 428/409/329 412/385/313 411/384/312 +f 412/385/313 428/409/329 414/397/315 405/378/306 +f 103/115/87 116/130/99 96/108/80 95/107/79 +f 338/114/248 331/107/241 339/115/249 +f 429/329/216 430/328/330 431/327/257 432/330/58 +f 430/333/330 433/332/215 434/331/63 431/334/257 +f 433/332/215 435/336/221 436/335/2 434/331/63 +f 435/336/221 437/338/220 438/337/62 436/335/2 +f 437/338/220 439/340/331 440/339/78 438/337/62 +f 439/340/331 441/342/218 442/341/59 440/339/78 +f 441/342/218 443/344/217 444/343/5 442/341/59 +f 443/344/217 429/329/216 432/330/58 444/343/5 +f 429/345/216 445/347/66 430/346/330 +f 430/346/330 445/347/66 433/348/215 +f 433/348/215 445/347/66 435/349/221 +f 435/349/221 445/347/66 437/350/220 +f 437/350/220 445/347/66 439/351/331 +f 439/351/331 445/347/66 441/352/218 +f 441/352/218 445/347/66 443/353/217 +f 443/353/217 445/347/66 429/345/216 +f 75/78/61 70/73/56 73/354/59 76/355/62 +# 307 polygons - 102 triangles + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index def15253e9..f309005911 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -184,6 +184,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou + @@ -367,6 +368,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index e14b692c16..b3b2ea21a9 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -331,6 +331,9 @@ {5bde63be-bdba-4155-a3a9-72f06c169768} + + {45e9becf-58e5-424e-903d-9bc7f9999d5b} + @@ -852,6 +855,9 @@ Classes\BugsTest + + Classes\Sprite3DTest + @@ -1571,5 +1577,8 @@ Classes\BugsTest + + Classes\Sprite3DTest + \ No newline at end of file diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj index cf217ba41c..203e3e5187 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/cpp-tests.csproj @@ -90,10 +90,16 @@ 4 - - + + App.xaml.cs + + + EditBox.xaml.cs + + + MainPage.xaml.cs + - True @@ -147,15 +153,18 @@ - + + App.xaml MSBuild:Compile Designer - + + EditBox.xaml MSBuild:Compile Designer - + + MainPage.xaml MSBuild:Compile Designer 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 fede0815b3..0108b08538 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 @@ -228,6 +228,7 @@ + @@ -426,6 +427,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 f05f94d939..556e8a3efc 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 @@ -328,6 +328,9 @@ {085acc82-08d1-46c1-affe-74af030ce284} + + {8c7572e8-5643-4301-b902-ff71f0cfca2d} + @@ -852,6 +855,9 @@ Classes\BugsTest + + Classes\Sprite3DTest + @@ -1575,6 +1581,9 @@ Classes\BugsTest + + Classes\Sprite3DTest + diff --git a/tests/lua-tests/project/Classes/AppDelegate.cpp b/tests/lua-tests/project/Classes/AppDelegate.cpp index a49f931cfe..cbcd0f6821 100644 --- a/tests/lua-tests/project/Classes/AppDelegate.cpp +++ b/tests/lua-tests/project/Classes/AppDelegate.cpp @@ -36,14 +36,9 @@ bool AppDelegate::applicationDidFinishLaunching() auto designSize = Size(480, 320); - auto pFileUtils = FileUtils::getInstance(); - if (screenSize.height > 320) { auto resourceSize = Size(960, 640); - std::vector searchPaths; - searchPaths.push_back("hd"); - pFileUtils->setSearchPaths(searchPaths); director->setContentScaleFactor(resourceSize.height/designSize.height); } @@ -58,51 +53,6 @@ bool AppDelegate::applicationDidFinishLaunching() register_assetsmanager_test_sample(stack->getLuaState()); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - std::string resPrefix(""); -#else - std::string resPrefix("res/"); -#endif - - std::vector searchPaths = pFileUtils->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), resPrefix); - - searchPaths.insert(searchPaths.begin(), resPrefix + "cocosbuilderRes"); - if (screenSize.height > 320) - { - searchPaths.insert(searchPaths.begin(), resPrefix + "hd"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/Images"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/ArmatureComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/AttributeComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/BackgroundComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/EffectComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/LoadSceneEdtiorFileTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/ParticleComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/SpriteComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/TmxMapComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/UIComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/hd/scenetest/TriggerTest"); - } - else - { - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/Images"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/ArmatureComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/AttributeComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/BackgroundComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/EffectComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/LoadSceneEdtiorFileTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/ParticleComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/SpriteComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/TmxMapComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/UIComponentTest"); - searchPaths.insert(searchPaths.begin(), resPrefix + "ccs-res/scenetest/TriggerTest"); - } - - - FileUtils::getInstance()->setSearchPaths(searchPaths); - pEngine->executeScriptFile("src/controller.lua"); return true; diff --git a/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua b/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua new file mode 100644 index 0000000000..78effa2d15 --- /dev/null +++ b/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua @@ -0,0 +1,74 @@ +local size = cc.Director:getInstance():getWinSize() + +---------------------------------------- +----Sprite3DBasicTest +---------------------------------------- + +local Sprite3DBasicTest = {} +Sprite3DBasicTest.__index = Sprite3DBasicTest + +function Sprite3DBasicTest.onTouchesEnd(touches, event) + for i = 1,table.getn(touches) do + local location = touches[i]:getLocation() + Sprite3DBasicTest.addNewSpriteWithCoords(Helper.currentLayer, location.x, location.y ) + end +end + +function Sprite3DBasicTest.addNewSpriteWithCoords(parent,x,y) + local sprite = cc.Sprite3D:create("Sprite3DTest/boss1.obj") + sprite:setScale(3.0) + sprite:setTexture("Sprite3DTest/boss.png") + + parent:addChild(sprite) + sprite:setPosition(cc.p(x,y)) + + local random = math.random(0, 1) + local action = nil + if random < 0.2 then + action = cc.ScaleBy:create(3,2) + elseif random < 0.4 then + action = cc.RotateBy:create(3, 360) + elseif random < 0.6 then + action = cc.Blink:create(1, 3) + elseif random < 0.8 then + action = cc.TintBy:create(2, 0, -255, -255) + else + action = cc.FadeOut:create(2) + end + + local action_back = action:reverse() + local seq = cc.Sequence:create(action, action_back) + + sprite:runAction(cc.RepeatForever:create(seq)) +end + +function Sprite3DBasicTest.create() + local layer = cc.Layer:create() + Helper.initWithLayer(layer) + Helper.titleLabel:setString("Testing Sprite3D") + Helper.subtitleLabel:setString("Tap screen to add more sprites") + + local listener = cc.EventListenerTouchAllAtOnce:create() + listener:registerScriptHandler(Sprite3DBasicTest.onTouchesEnd,cc.Handler.EVENT_TOUCHES_ENDED ) + + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layer) + + Sprite3DBasicTest.addNewSpriteWithCoords(layer, size.width / 2, size.height / 2) + return layer +end + + +function Sprite3DTest() + local scene = cc.Scene:create() + + Helper.createFunctionTable = + { + Sprite3DBasicTest.create, + } + + scene:addChild(Sprite3DBasicTest.create()) + scene:addChild(CreateBackMenuItem()) + + return scene +end diff --git a/tests/lua-tests/src/controller.lua b/tests/lua-tests/src/controller.lua index 2ccad7250d..9a9d863513 100644 --- a/tests/lua-tests/src/controller.lua +++ b/tests/lua-tests/src/controller.lua @@ -8,6 +8,61 @@ require "src/mainMenu" -- run + +local glView = cc.Director:getInstance():getOpenGLView() +local screenSize = glView:getFrameSize() +local designSize = {width = 480, height = 320} +local fileUtils = cc.FileUtils:getInstance() + +if screenSize.height > 320 then + local searchPaths = {} + table.insert(searchPaths, "hd") + fileUtils:setSearchPaths(searchPaths) +end + +local targetPlatform = cc.Application:getInstance():getTargetPlatform() +local resPrefix = "" +if cc.PLATFORM_OS_IPAD == targetPlatform or cc.PLATFORM_OS_IPHONE == targetPlatform or cc.PLATFORM_OS_MAC == targetPlatform then + resPrefix = "" +else + resPrefix = "res/" +end + +local searchPaths = fileUtils:getSearchPaths() +table.insert(searchPaths, 1, resPrefix) +table.insert(searchPaths, 1, "cocosbuilderRes") + +if screenSize.height > 320 then + table.insert(searchPaths, 1, resPrefix .. "hd") + table.insert(searchPaths, 1, resPrefix .. "ccs-res") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/Images") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/ArmatureComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/AttributeComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/BackgroundComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/EffectComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/LoadSceneEdtiorFileTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/ParticleComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/SpriteComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/TmxMapComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/UIComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/hd/scenetest/TriggerTest") +else + table.insert(searchPaths, 1, resPrefix .. "ccs-res/Images") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/ArmatureComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/AttributeComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/BackgroundComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/EffectComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/LoadSceneEdtiorFileTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/ParticleComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/SpriteComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/TmxMapComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/UIComponentTest") + table.insert(searchPaths, 1, resPrefix .. "ccs-res/scenetest/TriggerTest") +end + +fileUtils:setSearchPaths(searchPaths) + local scene = cc.Scene:create() scene:addChild(CreateTestMenu()) cc.Director:getInstance():runWithScene(scene) diff --git a/tests/lua-tests/src/mainMenu.lua b/tests/lua-tests/src/mainMenu.lua index 844fb7e1a5..8d2241a1f4 100644 --- a/tests/lua-tests/src/mainMenu.lua +++ b/tests/lua-tests/src/mainMenu.lua @@ -39,6 +39,7 @@ require "src/ParticleTest/ParticleTest" require "src/PerformanceTest/PerformanceTest" require "src/RenderTextureTest/RenderTextureTest" require "src/RotateWorldTest/RotateWorldTest" +require "src/Sprite3DTest/Sprite3DTest" require "src/SpriteTest/SpriteTest" require "src/SceneTest/SceneTest" require "src/SpineTest/SpineTest" @@ -102,6 +103,7 @@ local _allTests = { { isSupported = true, name = "SpineTest" , create_func = SpineTestMain }, { isSupported = false, name = "SchdulerTest" , create_func= SchdulerTestMain }, { isSupported = false, name = "ShaderTest" , create_func= ShaderTestMain }, + { isSupported = true, name = "Sprite3DTest" , create_func = Sprite3DTest }, { isSupported = true, name = "SpriteTest" , create_func = SpriteTest }, { isSupported = false, name = "TextInputTest" , create_func= TextInputTestMain }, { isSupported = true, name = "Texture2DTest" , create_func = Texture2dTestMain }, diff --git a/tools/bindings-generator b/tools/bindings-generator index 0aba499447..e9f1775eb8 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 0aba499447134661135f55e84681540ade4f766f +Subproject commit e9f1775eb85c4ccf429556199634048df920688d diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 9f8d41077f..edd24a1dcc 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 9f8d41077f67a81928acaa9bca4fea1c705b9104 +Subproject commit edd24a1dcc0d8344038e4d46367c603b2a846ab5 diff --git a/tools/jenkins-scripts/autotest.py b/tools/jenkins-scripts/autotest.py index b585cef14e..74857a17cf 100755 --- a/tools/jenkins-scripts/autotest.py +++ b/tools/jenkins-scripts/autotest.py @@ -118,7 +118,7 @@ def ANDROID_BUILD(): print 'clean **CLEAN FAILED**' time.sleep(sleep_time) def updateProperty(): - infoUpdate = os.system('android update project -p ./cocos/2d/platform/android/java/ -t 12') + infoUpdate = os.system('android update project -p ./cocos/platform/android/java/ -t 12') print 'cocos update:', infoUpdate infoUpdate = os.system('android update project -p '+PATH_ANDROID_SRC+' -t 12') print 'test update:', infoUpdate diff --git a/tools/jenkins-scripts/ci-release-test.py b/tools/jenkins-scripts/ci-release-test.py index e1c190f5a2..065fccf131 100644 --- a/tools/jenkins-scripts/ci-release-test.py +++ b/tools/jenkins-scripts/ci-release-test.py @@ -12,6 +12,7 @@ import traceback import platform import subprocess import codecs +from shutil import copy #set Jenkins build description using submitDescription to mock browser behavior #TODO: need to set parent build description @@ -121,9 +122,6 @@ def main(): if(ret != 0): return(2) - #copy check_current_3rd_libs - check_current_3rd_libs(branch) - #build #TODO: add android-linux build #TODO: add mac build @@ -139,6 +137,8 @@ def main(): os.system('git reset --hard') os.system("git clean -xdf -f") make_temp_dir() + #copy check_current_3rd_libs + check_current_3rd_libs(branch) if(branch == 'v3'): # Generate binding glue codes ret = os.system("python tools/jenkins-scripts/gen_jsb.py") @@ -149,7 +149,7 @@ def main(): ret = os.system("python build/android-build.py -b " + mode + " -n -j10 all") # create and save apk if(ret == 0): - os.system('android update project -p cocos/2d/platform/android/java/ -t android-13') + os.system('android update project -p cocos/platform/android/java/ -t android-13') for i, test in enumerate(tests_dirs): os.system('android update project -p ' + test + ' -t android-13') local_apk = test + '/' + tests_names[i] + '.apk' diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index ff238ce440..785679c7c7 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -194,7 +194,7 @@ def main(): # create and save apk if(ret == 0): sample_dir = 'tests/cpp-empty-test/proj.android/' - os.system('android update project -p cocos/2d/platform/android/java/ -t android-13') + os.system('android update project -p cocos/platform/android/java/ -t android-13') os.system('android update project -p ' + sample_dir + ' -t android-13') os.system('ant debug -f ' + sample_dir + 'build.xml') local_apk = sample_dir + 'bin/CppEmptyTest-debug.apk' diff --git a/tools/jenkins-scripts/watchdog.py b/tools/jenkins-scripts/watchdog.py index 99c2e7447f..61d5588fb0 100644 --- a/tools/jenkins-scripts/watchdog.py +++ b/tools/jenkins-scripts/watchdog.py @@ -1,8 +1,39 @@ import jenkinsapi from jenkinsapi.jenkins import Jenkins +from jenkinsapi.node import Node import sys import time import os +from email.mime.text import MIMEText +import smtplib + +def send_mail(sub,title,content): + to_list = os.environ['EMAIL_LIST'].split(' ') + mail_user = os.environ['EMAIL_USER'] + mail_pass = os.environ['EMAIL_PWD'] + mail_postfix = 'gmail.com' + me = mail_user + "<" + mail_user + "@" + mail_postfix + ">" + msg = MIMEText(content, _subtype='plain', _charset='gb2312') + msg['Subject'] = sub + msg['From'] = me + msg['To'] = " ".join(to_list) + print 'to users:', msg['To'] + msg['Content'] = 'test' + try: + s = smtplib.SMTP('smtp.gmail.com', 587) + s.ehlo() + s.starttls() + s.login(mail_user,mail_pass) + s.sendmail(me, to_list, str(msg)) + print 'info:', me, to_list, str(msg) + s.close() + return True + except Exception, e: + print str(e) + return False + +def sendEmail(msg): + send_mail("Jenkins node " + msg + " is offline", 'for offline.', msg + ' is offline') #check & kill dead buid def build_time(_job,_threshold): @@ -43,6 +74,16 @@ def main(): else: threshold = int(os.environ['jenkins-job-watchdog-threshold']) build_time(job,threshold) + + #check node status + node_names = os.environ['NODE_LIST'].split(' ') + for node_name in node_names: + node = J.get_node(node_name) + if node.is_online(): + print node_name, ' : is online' + else: + sendEmail(node_name) + print node_name, ' : is offline' return(0) diff --git a/tools/make-package/config.json b/tools/make-package/config.json index 6c8874deb8..08e78eed34 100644 --- a/tools/make-package/config.json +++ b/tools/make-package/config.json @@ -10,6 +10,11 @@ "zip_config_path": "../../templates/lua-template-runtime/runtime/config.json", "zip_file_path": "../../", "extract_to_zip_path": "templates/lua-template-runtime/runtime" + }, + { + "zip_config_path": "../cocos2d-console/config.json", + "zip_file_path": "../cocos2d-console", + "extract_to_zip_path": "tools/cocos2d-console" } ] } diff --git a/tools/make-package/git-archive-all b/tools/make-package/git-archive-all index 648e77b186..9af9b8622e 100755 --- a/tools/make-package/git-archive-all +++ b/tools/make-package/git-archive-all @@ -14,6 +14,11 @@ import traceback from os import path, extsep from subprocess import Popen, PIPE, CalledProcessError +class UnrecognizedFormat: + def __init__(self, prompt): + self._prompt = prompt + def __str__(self): + return self._prompt class GitArchiver(object): """ @@ -97,7 +102,7 @@ class GitArchiver(object): import zipfile if not zipfile.is_zipfile(zip_file_path): - raise UnrecognizedFormat("%s is not a zip file" % (self._filename)) + raise UnrecognizedFormat("%s is not a zip file" % zip_file_path) file_paths = [] print("==> Extracting files, please wait ...") @@ -204,6 +209,10 @@ class GitArchiver(object): import subprocess subprocess.call("python %s -d -f" % (path.join(self.main_repo_abspath, "download-deps.py")), shell=True, cwd=self.main_repo_abspath) + # Execute download-bin.py in cocos2d-console folder + console_path = path.join(self.main_repo_abspath, "tools", "cocos2d-console") + subprocess.call("python %s -d -f" % (path.join(console_path, "download-bin.py")), shell=True, cwd=console_path) + # Check config.json to insert a zip file content to the final generated zip file extra_folders = [] config_data = self.load_json_file("config.json") @@ -212,7 +221,7 @@ class GitArchiver(object): zip_config = self.load_json_file(zip_file["zip_config_path"]) zip_file_name = zip_config["version"] + '.zip' extra_to_zip_file = zip_file["extract_to_zip_path"] - zip_file_path = os.path.join(zip_file["zip_file_path"] + zip_file_name) + zip_file_path = os.path.join(zip_file["zip_file_path"], zip_file_name) # 'v' letter was swallowed by github, so we need to substring it from the 2nd letter extra_folder_name = zip_config["repo_name"] + '-' + zip_config["version"][1:] extra_folder_path = os.path.join(self.main_repo_abspath, extra_folder_name) diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index f787d63eb3..0e182c71e9 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAu # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewProtocol GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewProtocol GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console Mesh GLProgramCache GLProgramState # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -102,7 +102,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS TextureCache::[addPVRTCImage addImageAsync], Timer::[getSelector createWithScriptHandler], *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate onTouch.* onAcc.* onKey.* onRegisterTouchListener], - FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile getFullPathCache], + FileUtils::[getFileData getDataFromFile getFullPathCache], Application::[^application.* ^run$], Camera::[getEyeXYZ getCenterXYZ getUpXYZ], ccFontDefinition::[*], @@ -119,7 +119,8 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS Component::[serialize], Console::[addCommand], ParallaxNode::[getParallaxArray], - TileMapAtlas::[getTGAInfo] + TileMapAtlas::[getTGAInfo], + GLProgramState::[setVertexAttribCallback setUniformCallback setVertexAttribPointer] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection],