diff --git a/.gitignore b/.gitignore index 0fe28724f7..9d95296627 100644 --- a/.gitignore +++ b/.gitignore @@ -136,4 +136,5 @@ project.properties /external/version.json /templates/lua-template-runtime/runtime /v*-deps-*.zip -/v*-lua-runtime-*.zip \ No newline at end of file +/v*-lua-runtime-*.zip +/tools/fbx-conv/ diff --git a/AUTHORS b/AUTHORS index 046d590a54..0542560f6a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,7 +25,7 @@ Developers: longlene Improve android project creation script - simpliplant + reneklacan Hardware keyboard support liuyq @@ -797,6 +797,7 @@ Developers: Adds support for get response when Activity's onActivityResult is triggered Improve Android projects Android jni error clear & more readable log + Add support of software PVRTC v1 decompression youknowone Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView diff --git a/CHANGELOG b/CHANGELOG index 59368916b3..e8a4a4033e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ cocos2d-x-3.3 ?? + [NEW] CCImage: support of software PVRTC v1 decompression + + [FIX] Label: can not set charmap after it is created + [FIX] Scale9Sprite: new added sprite will be hidden [FIX] UIListView: can not insert an item in specific position, it is added at bottom [FIX] TextField: can not use backspace to delete a character + [FIX] Others: can not import java library shift by engine correctly when using Eclispe on Android cocos2d-x-3.2 Jul.17 2014 diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 8c661cfacc..5bc79f08d7 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -4,9 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" - ProjectSection(ProjectDependencies) = postProject - {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" EndProject @@ -14,8 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" @@ -37,6 +32,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-empty-test", "..\tests\lua-empty-test\project\proj.win32\lua-empty-test.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -63,10 +60,6 @@ Global {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 - {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 - {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 - {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 - {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32 {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32 {811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32 @@ -103,6 +96,10 @@ Global {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32 {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.Build.0 = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index c70b86024e..70d59ef168 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -631,8 +631,6 @@ 460E47B31808090B000CDD6D /* CCEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */; }; 460E47B41808090B000CDD6D /* CCEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */; }; 460E47B51808090B000CDD6D /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */; }; - 460E47B61808090B000CDD6D /* CCEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */; }; - 460E47B71808090B000CDD6D /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */; }; 460E47B81808090B000CDD6D /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */; }; 460E47BB1808090B000CDD6D /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */; }; 460E47BC1808090B000CDD6D /* CCEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */; }; @@ -643,8 +641,6 @@ 460E47C11808090D000CDD6D /* CCEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */; }; 460E47C21808090D000CDD6D /* CCEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */; }; 460E47C31808090D000CDD6D /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */; }; - 460E47C41808090D000CDD6D /* CCEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */; }; - 460E47C51808090D000CDD6D /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */; }; 460E47C61808090D000CDD6D /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */; }; 460E47C91808090D000CDD6D /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */; }; 460E47CA1808090D000CDD6D /* CCEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */; }; @@ -660,6 +656,10 @@ 460E47D818080914000CDD6D /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168631807AF4E005B8026 /* CCTableView.h */; }; 460E47D918080914000CDD6D /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */; }; 460E47DA18080914000CDD6D /* CCTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168651807AF4E005B8026 /* CCTableViewCell.h */; }; + 464AD6E5197EBB1400E502D8 /* pvr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 464AD6E3197EBB1400E502D8 /* pvr.cpp */; }; + 464AD6E6197EBB1400E502D8 /* pvr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 464AD6E3197EBB1400E502D8 /* pvr.cpp */; }; + 464AD6E7197EBB1400E502D8 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 464AD6E4197EBB1400E502D8 /* pvr.h */; }; + 464AD6E8197EBB1400E502D8 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 464AD6E4197EBB1400E502D8 /* pvr.h */; }; 46A160421807A5D4005B8026 /* Export.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE11807A56F005B8026 /* Export.h */; }; 46A160431807A5D4005B8026 /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE21807A56F005B8026 /* SimpleAudioEngine.h */; }; 46A160441807A5D4005B8026 /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FF41807A56F005B8026 /* CDAudioManager.h */; }; @@ -1957,7 +1957,7 @@ 06CAAABF186AD63B0012A414 /* TriggerMng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerMng.h; sourceTree = ""; }; 06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerObj.cpp; sourceTree = ""; }; 06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.h; sourceTree = ""; }; - 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.dylib */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2dx Mac.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2dx Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1551A342158F2AB200E66CFE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1A01C67618F57BE800EFE3A6 /* CCArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArray.cpp; sourceTree = ""; }; 1A01C67718F57BE800EFE3A6 /* CCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArray.h; sourceTree = ""; }; @@ -2374,6 +2374,8 @@ 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIVideoPlayerIOS.mm; sourceTree = ""; }; 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBundleReader.cpp; sourceTree = ""; }; 3EA4786F195478E00068D9D1 /* CCBundleReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBundleReader.h; sourceTree = ""; }; + 464AD6E3197EBB1400E502D8 /* pvr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pvr.cpp; path = ../base/pvr.cpp; sourceTree = ""; }; + 464AD6E4197EBB1400E502D8 /* pvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pvr.h; path = ../base/pvr.h; sourceTree = ""; }; 46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = ""; }; 46A15FCE1807A544005B8026 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; 46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; @@ -2434,8 +2436,6 @@ 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = ""; }; 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = ""; }; 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = ""; }; - 46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = ""; }; - 46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = CCEditBoxImplMac.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = ""; }; 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = ""; }; 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = ""; }; @@ -3160,7 +3160,7 @@ 1551A340158F2AB200E66CFE /* Products */ = { isa = PBXGroup; children = ( - 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.dylib */, + 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.a */, A03F2CB81780BD04006731B9 /* libchipmunk Mac.a */, A03F2D9B1780BDF7006731B9 /* libbox2d Mac.a */, A03F2ED617814268006731B9 /* libCocosDenshion Mac.a */, @@ -3284,6 +3284,8 @@ 1A5700A2180BC5E60088DEC7 /* base */ = { isa = PBXGroup; children = ( + 464AD6E3197EBB1400E502D8 /* pvr.cpp */, + 464AD6E4197EBB1400E502D8 /* pvr.h */, 3E61781C1966A5A300DE83F5 /* CCController.cpp */, 3E6176551960F89B00DE83F5 /* CCController-iOS.mm */, 3E6176561960F89B00DE83F5 /* CCController.h */, @@ -4383,8 +4385,6 @@ 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */, 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */, 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */, - 46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */, - 46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */, 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */, 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */, 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */, @@ -5329,6 +5329,7 @@ 50ABBE531925AB6F00A911A9 /* CCEventDispatcher.h in Headers */, B6B2633F19381FBF0088FE25 /* CCAnimationCurve.h in Headers */, B6B26345193884D60088FE25 /* CCAnimation3D.h in Headers */, + 464AD6E7197EBB1400E502D8 /* pvr.h in Headers */, B6ACD899193D6693005E0B8A /* CCMeshSkin.h in Headers */, B6ACD8A0193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, B6AAF84319404E0D0069DE01 /* CCBundle3D.h in Headers */, @@ -5445,7 +5446,6 @@ 460E477E18080902000CDD6D /* CCControl.h in Headers */, 460E47B11808090B000CDD6D /* CCEditBoxImpl.h in Headers */, 460E47B31808090B000CDD6D /* CCEditBoxImplAndroid.h in Headers */, - 460E47B61808090B000CDD6D /* CCEditBoxImplMac.h in Headers */, 460E477B180808F5000CDD6D /* ExtensionMacros.h in Headers */, 460E479118080902000CDD6D /* CCControlUtils.h in Headers */, 460E468118080832000CDD6D /* cocos-ext.h in Headers */, @@ -5673,6 +5673,7 @@ 50ABBD471925AB0000A911A9 /* CCVertex.h in Headers */, 1A9DCA2A180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */, 1A01C69F18F57BE800EFE3A6 /* CCString.h in Headers */, + 464AD6E8197EBB1400E502D8 /* pvr.h in Headers */, 1A01C69118F57BE800EFE3A6 /* CCDictionary.h in Headers */, 5034CA36191D591100CE6051 /* ccShader_PositionTexture.frag in Headers */, B24AA98C195A675C007B4522 /* CCFastTMXTiledMap.h in Headers */, @@ -5718,7 +5719,6 @@ 460E47A418080904000CDD6D /* CCControlSlider.h in Headers */, 460E479E18080904000CDD6D /* CCControlHuePicker.h in Headers */, 460E468218080836000CDD6D /* cocos-ext.h in Headers */, - 460E47C41808090D000CDD6D /* CCEditBoxImplMac.h in Headers */, 460E47BF1808090D000CDD6D /* CCEditBoxImpl.h in Headers */, 460E47AE18080904000CDD6D /* CCScale9Sprite.h in Headers */, 460E477C180808F7000CDD6D /* ExtensionMacros.h in Headers */, @@ -6212,7 +6212,7 @@ ); name = "cocos2dx Mac"; productName = cocos2dx; - productReference = 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.dylib */; + productReference = 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.a */; productType = "com.apple.product-type.library.static"; }; A03F2B781780BD04006731B9 /* chipmunk Mac */ = { @@ -6723,6 +6723,7 @@ 50ABBE831925AB6F00A911A9 /* ccFPSImages.c in Sources */, 50ABBEA71925AB6F00A911A9 /* CCTouch.cpp in Sources */, 50ABBD8B1925AB4100A911A9 /* CCGLProgram.cpp in Sources */, + 464AD6E5197EBB1400E502D8 /* pvr.cpp in Sources */, 50ABBDA31925AB4100A911A9 /* CCQuadCommand.cpp in Sources */, B29594C61926D61F003EEF37 /* CCObjLoader.cpp in Sources */, 50ABC01D1926664800A911A9 /* CCThread.cpp in Sources */, @@ -6898,7 +6899,6 @@ 460E478E18080902000CDD6D /* CCControlSwitch.cpp in Sources */, 460E479218080902000CDD6D /* CCInvocation.cpp in Sources */, 460E477F18080902000CDD6D /* CCControlButton.cpp in Sources */, - 460E47B71808090B000CDD6D /* CCEditBoxImplMac.mm in Sources */, 460E47AF1808090B000CDD6D /* CCEditBox.cpp in Sources */, 460E479418080902000CDD6D /* CCScale9Sprite.cpp in Sources */, 460E478118080902000CDD6D /* CCControlColourPicker.cpp in Sources */, @@ -7039,6 +7039,7 @@ 1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */, 1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */, 1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */, + 464AD6E6197EBB1400E502D8 /* pvr.cpp in Sources */, 1A570311180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */, 50ABBE2C1925AB6F00A911A9 /* ccCArray.cpp in Sources */, 50ABC0061926664800A911A9 /* CCThread.mm in Sources */, @@ -7121,7 +7122,6 @@ 460E47D718080914000CDD6D /* CCTableView.cpp in Sources */, 460E479F18080904000CDD6D /* CCControlPotentiometer.cpp in Sources */, 460E479818080904000CDD6D /* CCControlButton.cpp in Sources */, - 460E47C51808090D000CDD6D /* CCEditBoxImplMac.mm in Sources */, 460E479D18080904000CDD6D /* CCControlHuePicker.cpp in Sources */, 460E47A318080904000CDD6D /* CCControlSlider.cpp in Sources */, 460E47AB18080904000CDD6D /* CCInvocation.cpp in Sources */, @@ -7635,7 +7635,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -7673,7 +7673,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -7708,8 +7708,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - EXECUTABLE_EXTENSION = dylib; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + EXECUTABLE_EXTENSION = a; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -7731,7 +7731,7 @@ "\"$(SRCROOT)/../external/freetype2/prebuilt/mac\"", "\"$(SRCROOT)/../external/websockets/prebuilt/mac\"", ); - MACH_O_TYPE = mh_dylib; + MACH_O_TYPE = staticlib; 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/glfw3/include/mac"; }; name = Debug; @@ -7740,8 +7740,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - EXECUTABLE_EXTENSION = dylib; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + EXECUTABLE_EXTENSION = a; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; @@ -7764,7 +7764,7 @@ "\"$(SRCROOT)/../external/freetype2/prebuilt/mac\"", "\"$(SRCROOT)/../external/websockets/prebuilt/mac\"", ); - MACH_O_TYPE = mh_dylib; + MACH_O_TYPE = staticlib; 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/glfw3/include/mac"; }; name = Release; @@ -7870,6 +7870,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -7886,6 +7887,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme index 2e571bd188..4c1792021c 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme @@ -15,7 +15,7 @@ diff --git a/cocos/2d/CCComponentContainer.cpp b/cocos/2d/CCComponentContainer.cpp index 64b76aa915..a309329011 100644 --- a/cocos/2d/CCComponentContainer.cpp +++ b/cocos/2d/CCComponentContainer.cpp @@ -89,12 +89,33 @@ bool ComponentContainer::remove(const std::string& name) com->setOwner(nullptr); _components->erase(iter); - ret = true; } while(0); return ret; } +bool ComponentContainer::remove(Component *com) +{ + bool ret = false; + do + { + CC_BREAK_IF(!_components); + + for (auto iter = _components->begin(); iter != _components->end(); ++iter) + { + if (iter->second == com) + { + com->onExit(); + com->setOwner(nullptr); + _components->erase(iter); + break; + } + } + ret = true; + } while(0); + return ret; +} + void ComponentContainer::removeAll() { if (_components != nullptr) diff --git a/cocos/2d/CCComponentContainer.h b/cocos/2d/CCComponentContainer.h index e924c35f25..94677c73f0 100644 --- a/cocos/2d/CCComponentContainer.h +++ b/cocos/2d/CCComponentContainer.h @@ -50,6 +50,7 @@ public: virtual Component* get(const std::string& name) const; virtual bool add(Component *com); virtual bool remove(const std::string& name); + virtual bool remove(Component *com); virtual void removeAll(); virtual void visit(float delta); public: diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index f088da6319..4708744221 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -178,7 +178,10 @@ FontAtlas * FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidt FontAtlas * FontAtlasCache::getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap) { - std::string atlasName = generateFontName(charMapFile, 0, GlyphCollection::CUSTOM,false); + char tmp[255]; + snprintf(tmp,250,"name:%s_%d_%d_%d",charMapFile.c_str(),itemWidth,itemHeight,startCharMap); + + std::string atlasName = generateFontName(tmp, 0, GlyphCollection::CUSTOM,false); auto it = _atlasMap.find(atlasName); if ( it == _atlasMap.end() ) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 2a52bd1a2d..f90c87b8e5 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1850,6 +1850,11 @@ bool Node::removeComponent(const std::string& name) return false; } +bool Node::removeComponent(Component *component) +{ + return _componentContainer->remove(component); +} + void Node::removeAllComponents() { if( _componentContainer ) diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index d4d9982308..8b3354d65f 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1433,6 +1433,10 @@ public: */ virtual bool removeComponent(const std::string& name); + /** + * removes a component by its pointer + */ + virtual bool removeComponent(Component *component); /** * removes all components */ diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj index 4df07428bd..7e8469382a 100644 --- a/cocos/2d/cocos2d.vcxproj +++ b/cocos/2d/cocos2d.vcxproj @@ -78,7 +78,7 @@ Disabled $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_USRDLL;_DEBUG;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -112,7 +112,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou ;%(IgnoreSpecificDefaultLibraries) true Windows - $(TargetDir)$(TargetName).lib + $(OutDir)$(TargetName).lib MachineX86 cocos2d.def libchipmunk.lib;sqlite3.lib;%(AdditionalDependencies) @@ -129,7 +129,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_USRDLL;NDEBUG;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) MultiThreadedDLL @@ -165,7 +165,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou Windows true true - $(TargetDir)$(TargetName).lib + $(OutDir)$(TargetName).lib MachineX86 cocos2d.def @@ -229,6 +229,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -422,6 +423,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -571,6 +573,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} + + diff --git a/cocos/2d/cocos2d.vcxproj.filters b/cocos/2d/cocos2d.vcxproj.filters index b264b0caa8..af5fa51213 100644 --- a/cocos/2d/cocos2d.vcxproj.filters +++ b/cocos/2d/cocos2d.vcxproj.filters @@ -418,6 +418,9 @@ base + + platform + base @@ -991,6 +994,9 @@ base + + platform + base diff --git a/cocos/Android.mk b/cocos/Android.mk index 990ee16aaa..740d7952ca 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -140,6 +140,7 @@ base/ccTypes.cpp \ base/ccUTF8.cpp \ base/ccUtils.cpp \ base/etc1.cpp \ +base/pvr.cpp \ base/s3tc.cpp \ base/CCController.cpp \ base/CCController-android.cpp \ diff --git a/cocos/audio/include/Export.h b/cocos/audio/include/Export.h index 86ca3b7845..bf6972ec1b 100644 --- a/cocos/audio/include/Export.h +++ b/cocos/audio/include/Export.h @@ -30,11 +30,11 @@ THE SOFTWARE. #define EXPORT_DLL _EXPORT_ #elif defined(_WIN32) #if defined(_EXPORT_DLL_) - #define EXPORT_DLL// __declspec(dllexport) + #define EXPORT_DLL __declspec(dllexport) #elif defined(IGNORE_EXPORT) #define EXPORT_DLL #else /* use a DLL library */ - #define EXPORT_DLL// __declspec(dllimport) + #define EXPORT_DLL __declspec(dllimport) #endif #else #if defined(_SHARED_) diff --git a/cocos/audio/proj.win32/CocosDenshion.vcxproj b/cocos/audio/proj.win32/CocosDenshion.vcxproj index 836fc86ec5..90589fba1b 100644 --- a/cocos/audio/proj.win32/CocosDenshion.vcxproj +++ b/cocos/audio/proj.win32/CocosDenshion.vcxproj @@ -18,7 +18,7 @@ - StaticLibrary + DynamicLibrary NotSet v100 v110 @@ -27,7 +27,7 @@ v120_xp - StaticLibrary + DynamicLibrary NotSet v100 v110 @@ -74,7 +74,7 @@ Disabled $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_EXPORT_DLL_;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -90,7 +90,7 @@ $(OutDir)$(ProjectName).dll true Windows - $(TargetDir)$(TargetName).lib + $(OutDir)$(TargetName).lib MachineX86 $(OutDir) @@ -98,7 +98,7 @@ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_EXPORT_DLL_;%(PreprocessorDefinitions) MultiThreadedDLL @@ -116,7 +116,7 @@ Windows true true - $(TargetDir)$(TargetName).lib + $(OutDir)$(TargetName).lib MachineX86 $(OutDir) diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 701c8ba5a6..e57058fd5a 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -40,6 +40,7 @@ set(COCOS_BASE_SRC base/ccUTF8.cpp base/ccUtils.cpp base/etc1.cpp + base/pvr.cpp base/s3tc.cpp base/ObjectFactory.cpp ) diff --git a/cocos/base/ccConfig.h b/cocos/base/ccConfig.h index 3e36c6c702..2225998746 100644 --- a/cocos/base/ccConfig.h +++ b/cocos/base/ccConfig.h @@ -283,5 +283,5 @@ To enable set it to a value different than 0. Disabled by default. #ifndef CC_CONSTRUCTOR_ACCESS #define CC_CONSTRUCTOR_ACCESS protected #endif - + #endif // __CCCONFIG_H__ diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index f9bf620f47..3a8e990b4e 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -184,7 +184,7 @@ struct CC_DLL Color4F /** A texcoord composed of 2 floats: u, y @since v3.0 */ -struct Tex2F { +struct CC_DLL Tex2F { Tex2F(float _u, float _v): u(_u), v(_v) {} Tex2F(): u(0.f), v(0.f) {} @@ -195,7 +195,7 @@ struct Tex2F { //! Vec2 Sprite component -struct PointSprite +struct CC_DLL PointSprite { Vec2 pos; // 8 bytes Color4B color; // 4 bytes @@ -203,7 +203,7 @@ struct PointSprite }; //! A 2D Quad. 4 * 2 floats -struct Quad2 +struct CC_DLL Quad2 { Vec2 tl; Vec2 tr; @@ -213,7 +213,7 @@ struct Quad2 //! A 3D Quad. 4 * 3 floats -struct Quad3 { +struct CC_DLL Quad3 { Vec3 bl; Vec3 br; Vec3 tl; @@ -232,7 +232,7 @@ struct V2F_C4B_T2F }; //! a Vec2 with a vertex point, a tex coord point and a color 4F -struct V2F_C4F_T2F +struct CC_DLL V2F_C4F_T2F { //! vertices (2F) Vec2 vertices; @@ -243,7 +243,7 @@ struct V2F_C4F_T2F }; //! a Vec2 with a vertex point, a tex coord point and a color 4B -struct V3F_C4B_T2F +struct CC_DLL V3F_C4B_T2F { //! vertices (3F) Vec3 vertices; // 12 bytes @@ -256,7 +256,7 @@ struct V3F_C4B_T2F }; //! a Vec2 with a vertex point, a tex coord point -struct V3F_T2F +struct CC_DLL V3F_T2F { //! vertices (2F) Vec3 vertices; @@ -265,7 +265,7 @@ struct V3F_T2F }; //! A Triangle of V2F_C4B_T2F -struct V2F_C4B_T2F_Triangle +struct CC_DLL V2F_C4B_T2F_Triangle { //! Vec2 A V2F_C4B_T2F a; @@ -276,7 +276,7 @@ struct V2F_C4B_T2F_Triangle }; //! A Quad of V2F_C4B_T2F -struct V2F_C4B_T2F_Quad +struct CC_DLL V2F_C4B_T2F_Quad { //! bottom left V2F_C4B_T2F bl; @@ -289,7 +289,7 @@ struct V2F_C4B_T2F_Quad }; //! 4 Vertex3FTex2FColor4B -struct V3F_C4B_T2F_Quad +struct CC_DLL V3F_C4B_T2F_Quad { //! top left V3F_C4B_T2F tl; @@ -302,7 +302,7 @@ struct V3F_C4B_T2F_Quad }; //! 4 Vertex2FTex2FColor4F Quad -struct V2F_C4F_T2F_Quad +struct CC_DLL V2F_C4F_T2F_Quad { //! bottom left V2F_C4F_T2F bl; @@ -314,7 +314,7 @@ struct V2F_C4F_T2F_Quad V2F_C4F_T2F tr; }; -struct V3F_T2F_Quad +struct CC_DLL V3F_T2F_Quad { //! bottom left V3F_T2F bl; @@ -359,7 +359,7 @@ struct CC_DLL BlendFunc // XXX: If any of these enums are edited and/or reordered, update Texture2D.m //! Vertical text alignment type -enum class TextVAlignment +enum class CC_DLL TextVAlignment { TOP, CENTER, @@ -368,7 +368,7 @@ enum class TextVAlignment // XXX: If any of these enums are edited and/or reordered, update Texture2D.m //! Horizontal text alignment type -enum class TextHAlignment +enum class CC_DLL TextHAlignment { LEFT, CENTER, @@ -378,7 +378,7 @@ enum class TextHAlignment // types for animation in particle systems // texture coordinates for a quad -struct T2F_Quad +struct CC_DLL T2F_Quad { //! bottom left Tex2F bl; @@ -391,7 +391,7 @@ struct T2F_Quad }; // struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad -struct AnimationFrameData +struct CC_DLL AnimationFrameData { T2F_Quad texCoords; float delay; @@ -404,7 +404,7 @@ struct AnimationFrameData // shadow attributes -struct FontShadow +struct CC_DLL FontShadow { public: @@ -426,7 +426,7 @@ public: }; // stroke attributes -struct FontStroke +struct CC_DLL FontStroke { public: @@ -447,7 +447,7 @@ public: }; // font attributes -struct FontDefinition +struct CC_DLL FontDefinition { public: /** diff --git a/cocos/base/pvr.cpp b/cocos/base/pvr.cpp new file mode 100644 index 0000000000..3a59860c6f --- /dev/null +++ b/cocos/base/pvr.cpp @@ -0,0 +1,713 @@ +/****************************************************************************** + + @File PVRTDecompress.cpp + + @Title + + @Copyright Copyright (C) 2000 - 2008 by Imagination Technologies Limited. + + @Platform ANSI compatible + + @Description PVRTC Texture Decompression. + + ******************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include "pvr.h" + +#define PVRT_MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define PVRT_MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define PVRT_CLAMP(x, l, h) (PVRT_MIN((h), PVRT_MAX((x), (l)))) + +/***************************************************************************** + * defines and consts + *****************************************************************************/ +#define PT_INDEX (2) // The Punch-through index + +#define BLK_Y_SIZE (4) // always 4 for all 2D block types + +#define BLK_X_MAX (8) // Max X dimension for blocks + +#define BLK_X_2BPP (8) // dimensions for the two formats +#define BLK_X_4BPP (4) + +#define WRAP_COORD(Val, Size) ((Val) & ((Size)-1)) + +#define POWER_OF_2(X) util_number_is_power_2(X) + +/* + Define an expression to either wrap or clamp large or small vals to the + legal coordinate range + */ +#define LIMIT_COORD(Val, Size, AssumeImageTiles) \ +((AssumeImageTiles)? WRAP_COORD((Val), (Size)): PVRT_CLAMP((Val), 0, (Size)-1)) + +/***************************************************************************** + * Useful typedefs + *****************************************************************************/ + +typedef uint32_t U32; +typedef uint8_t U8; + +/*********************************************************** + DECOMPRESSION ROUTINES + ************************************************************/ + +/*!*********************************************************************** + @Struct AMTC_BLOCK_STRUCT + @Brief + *************************************************************************/ +typedef struct +{ + // Uses 64 bits pre block + U32 PackedData[2]; +}AMTC_BLOCK_STRUCT; + + +static void PVRDecompress(AMTC_BLOCK_STRUCT *pCompressedData, + const bool Do2bitMode, + const int XDim, + const int YDim, + const int AssumeImageTiles, + unsigned char* pResultImage); + +/*!*********************************************************************** + @Function PVRTDecompressPVRTC + @Input pCompressedData The PVRTC texture data to decompress + @Input Do2bitMode Signifies whether the data is PVRTC2 or PVRTC4 + @Input XDim X dimension of the texture + @Input YDim Y dimension of the texture + @Modified pResultImage The decompressed texture data + @Description Decompresses PVRTC to RGBA 8888 + *************************************************************************/ +int PVRTDecompressPVRTC(const void * const pCompressedData,const int XDim,const int YDim, void *pDestData,const bool Do2bitMode) +{ + PVRDecompress((AMTC_BLOCK_STRUCT*)pCompressedData,Do2bitMode,XDim,YDim,1,(unsigned char*)pDestData); + + return XDim*YDim/2; +} + +/*!*********************************************************************** + @Function util_number_is_power_2 + @Input input A number + @Returns TRUE if the number is an integer power of two, else FALSE. + @Description Check that a number is an integer power of two, i.e. + 1, 2, 4, 8, ... etc. + Returns FALSE for zero. + *************************************************************************/ +int util_number_is_power_2( unsigned input ) +{ + unsigned minus1; + + if( !input ) return 0; + + minus1 = input - 1; + return ( (input | minus1) == (input ^ minus1) ) ? 1 : 0; +} + + +/*!*********************************************************************** + @Function Unpack5554Colour + @Input pBlock + @Input ABColours + @Description Given a block, extract the colour information and convert + to 5554 formats + *************************************************************************/ +static void Unpack5554Colour(const AMTC_BLOCK_STRUCT *pBlock, + int ABColours[2][4]) +{ + U32 RawBits[2]; + + int i; + + // Extract A and B + RawBits[0] = pBlock->PackedData[1] & (0xFFFE); // 15 bits (shifted up by one) + RawBits[1] = pBlock->PackedData[1] >> 16; // 16 bits + + // step through both colours + for(i = 0; i < 2; i++) + { + // If completely opaque + if(RawBits[i] & (1<<15)) + { + // Extract R and G (both 5 bit) + ABColours[i][0] = (RawBits[i] >> 10) & 0x1F; + ABColours[i][1] = (RawBits[i] >> 5) & 0x1F; + + /* + The precision of Blue depends on A or B. If A then we need to + replicate the top bit to get 5 bits in total + */ + ABColours[i][2] = RawBits[i] & 0x1F; + if(i==0) + { + ABColours[0][2] |= ABColours[0][2] >> 4; + } + + // set 4bit alpha fully on... + ABColours[i][3] = 0xF; + } + else // Else if colour has variable translucency + { + /* + Extract R and G (both 4 bit). + (Leave a space on the end for the replication of bits + */ + ABColours[i][0] = (RawBits[i] >> (8-1)) & 0x1E; + ABColours[i][1] = (RawBits[i] >> (4-1)) & 0x1E; + + // replicate bits to truly expand to 5 bits + ABColours[i][0] |= ABColours[i][0] >> 4; + ABColours[i][1] |= ABColours[i][1] >> 4; + + // grab the 3(+padding) or 4 bits of blue and add an extra padding bit + ABColours[i][2] = (RawBits[i] & 0xF) << 1; + + /* + expand from 3 to 5 bits if this is from colour A, or 4 to 5 bits if from + colour B + */ + if(i==0) + { + ABColours[0][2] |= ABColours[0][2] >> 3; + } + else + { + ABColours[0][2] |= ABColours[0][2] >> 4; + } + + // Set the alpha bits to be 3 + a zero on the end + ABColours[i][3] = (RawBits[i] >> 11) & 0xE; + } + } +} + +/*!*********************************************************************** + @Function UnpackModulations + @Input pBlock + @Input Do2bitMode + @Input ModulationVals + @Input ModulationModes + @Input StartX + @Input StartY + @Description Given the block and the texture type and it's relative + position in the 2x2 group of blocks, extract the bit + patterns for the fully defined pixels. + *************************************************************************/ +static void UnpackModulations(const AMTC_BLOCK_STRUCT *pBlock, + const int Do2bitMode, + int ModulationVals[8][16], + int ModulationModes[8][16], + int StartX, + int StartY) +{ + int BlockModMode; + U32 ModulationBits; + + int x, y; + + BlockModMode= pBlock->PackedData[1] & 1; + ModulationBits = pBlock->PackedData[0]; + + // if it's in an interpolated mode + if(Do2bitMode && BlockModMode) + { + /* + run through all the pixels in the block. Note we can now treat all the + "stored" values as if they have 2bits (even when they didn't!) + */ + for(y = 0; y < BLK_Y_SIZE; y++) + { + for(x = 0; x < BLK_X_2BPP; x++) + { + ModulationModes[y+StartY][x+StartX] = BlockModMode; + + // if this is a stored value... + if(((x^y)&1) == 0) + { + ModulationVals[y+StartY][x+StartX] = ModulationBits & 3; + ModulationBits >>= 2; + } + } + } + } + else if(Do2bitMode) // else if direct encoded 2bit mode - i.e. 1 mode bit per pixel + { + for(y = 0; y < BLK_Y_SIZE; y++) + { + for(x = 0; x < BLK_X_2BPP; x++) + { + ModulationModes[y+StartY][x+StartX] = BlockModMode; + + // double the bits so 0=> 00, and 1=>11 + if(ModulationBits & 1) + { + ModulationVals[y+StartY][x+StartX] = 0x3; + } + else + { + ModulationVals[y+StartY][x+StartX] = 0x0; + } + ModulationBits >>= 1; + } + } + } + else // else its the 4bpp mode so each value has 2 bits + { + for(y = 0; y < BLK_Y_SIZE; y++) + { + for(x = 0; x < BLK_X_4BPP; x++) + { + ModulationModes[y+StartY][x+StartX] = BlockModMode; + + ModulationVals[y+StartY][x+StartX] = ModulationBits & 3; + ModulationBits >>= 2; + } + } + } + + // make sure nothing is left over + assert(ModulationBits==0); +} + +/*!*********************************************************************** + @Function InterpolateColours + @Input ColourP + @Input ColourQ + @Input ColourR + @Input ColourS + @Input Do2bitMode + @Input x + @Input y + @Modified Result + @Description This performs a HW bit accurate interpolation of either the + A or B colours for a particular pixel. + + NOTE: It is assumed that the source colours are in ARGB 5554 + format - This means that some "preparation" of the values will + be necessary. + *************************************************************************/ +static void InterpolateColours(const int ColourP[4], + const int ColourQ[4], + const int ColourR[4], + const int ColourS[4], + const int Do2bitMode, + const int x, + const int y, + int Result[4]) +{ + int u, v, uscale; + int k; + + int tmp1, tmp2; + + int P[4], Q[4], R[4], S[4]; + + // Copy the colours + for(k = 0; k < 4; k++) + { + P[k] = ColourP[k]; + Q[k] = ColourQ[k]; + R[k] = ColourR[k]; + S[k] = ColourS[k]; + } + + // put the x and y values into the right range + v = (y & 0x3) | ((~y & 0x2) << 1); + + if(Do2bitMode) + u = (x & 0x7) | ((~x & 0x4) << 1); + else + u = (x & 0x3) | ((~x & 0x2) << 1); + + // get the u and v scale amounts + v = v - BLK_Y_SIZE/2; + + if(Do2bitMode) + { + u = u - BLK_X_2BPP/2; + uscale = 8; + } + else + { + u = u - BLK_X_4BPP/2; + uscale = 4; + } + + for(k = 0; k < 4; k++) + { + tmp1 = P[k] * uscale + u * (Q[k] - P[k]); + tmp2 = R[k] * uscale + u * (S[k] - R[k]); + + tmp1 = tmp1 * 4 + v * (tmp2 - tmp1); + + Result[k] = tmp1; + } + + // Lop off the appropriate number of bits to get us to 8 bit precision + if(Do2bitMode) + { + // do RGB + for(k = 0; k < 3; k++) + { + Result[k] >>= 2; + } + + Result[3] >>= 1; + } + else + { + // do RGB (A is ok) + for(k = 0; k < 3; k++) + { + Result[k] >>= 1; + } + } + + // sanity check + for(k = 0; k < 4; k++) + { + assert(Result[k] < 256); + } + + + /* + Convert from 5554 to 8888 + + do RGB 5.3 => 8 + */ + for(k = 0; k < 3; k++) + { + Result[k] += Result[k] >> 5; + } + + Result[3] += Result[3] >> 4; + + // 2nd sanity check + for(k = 0; k < 4; k++) + { + assert(Result[k] < 256); + } + +} + +/*!*********************************************************************** + @Function GetModulationValue + @Input x + @Input y + @Input Do2bitMode + @Input ModulationVals + @Input ModulationModes + @Input Mod + @Input DoPT + @Description Get the modulation value as a numerator of a fraction of 8ths + *************************************************************************/ +static void GetModulationValue(int x, + int y, + const int Do2bitMode, + const int ModulationVals[8][16], + const int ModulationModes[8][16], + int *Mod, + int *DoPT) +{ + static const int RepVals0[4] = {0, 3, 5, 8}; + static const int RepVals1[4] = {0, 4, 4, 8}; + + int ModVal; + + // Map X and Y into the local 2x2 block + y = (y & 0x3) | ((~y & 0x2) << 1); + + if(Do2bitMode) + x = (x & 0x7) | ((~x & 0x4) << 1); + else + x = (x & 0x3) | ((~x & 0x2) << 1); + + // assume no PT for now + *DoPT = 0; + + // extract the modulation value. If a simple encoding + if(ModulationModes[y][x]==0) + { + ModVal = RepVals0[ModulationVals[y][x]]; + } + else if(Do2bitMode) + { + // if this is a stored value + if(((x^y)&1)==0) + ModVal = RepVals0[ModulationVals[y][x]]; + else if(ModulationModes[y][x] == 1) // else average from the neighbours if H&V interpolation.. + { + ModVal = (RepVals0[ModulationVals[y-1][x]] + + RepVals0[ModulationVals[y+1][x]] + + RepVals0[ModulationVals[y][x-1]] + + RepVals0[ModulationVals[y][x+1]] + 2) / 4; + } + else if(ModulationModes[y][x] == 2) // else if H-Only + { + ModVal = (RepVals0[ModulationVals[y][x-1]] + + RepVals0[ModulationVals[y][x+1]] + 1) / 2; + } + else // else it's V-Only + { + ModVal = (RepVals0[ModulationVals[y-1][x]] + + RepVals0[ModulationVals[y+1][x]] + 1) / 2; + } + } + else // else it's 4BPP and PT encoding + { + ModVal = RepVals1[ModulationVals[y][x]]; + + *DoPT = ModulationVals[y][x] == PT_INDEX; + } + + *Mod =ModVal; +} + +/*!*********************************************************************** + @Function TwiddleUV + @Input YSize Y dimension of the texture in pixels + @Input XSize X dimension of the texture in pixels + @Input YPos Pixel Y position + @Input XPos Pixel X position + @Returns The twiddled offset of the pixel + @Description Given the Block (or pixel) coordinates and the dimension of + the texture in blocks (or pixels) this returns the twiddled + offset of the block (or pixel) from the start of the map. + + NOTE the dimensions of the texture must be a power of 2 + *************************************************************************/ +static int DisableTwiddlingRoutine = 0; + +static U32 TwiddleUV(U32 YSize, U32 XSize, U32 YPos, U32 XPos) +{ + U32 Twiddled; + + U32 MinDimension; + U32 MaxValue; + + U32 SrcBitPos; + U32 DstBitPos; + + int ShiftCount; + + assert(YPos < YSize); + assert(XPos < XSize); + + assert(POWER_OF_2(YSize)); + assert(POWER_OF_2(XSize)); + + if(YSize < XSize) + { + MinDimension = YSize; + MaxValue = XPos; + } + else + { + MinDimension = XSize; + MaxValue = YPos; + } + + // Nasty hack to disable twiddling + if(DisableTwiddlingRoutine) + return (YPos* XSize + XPos); + + // Step through all the bits in the "minimum" dimension + SrcBitPos = 1; + DstBitPos = 1; + Twiddled = 0; + ShiftCount = 0; + + while(SrcBitPos < MinDimension) + { + if(YPos & SrcBitPos) + { + Twiddled |= DstBitPos; + } + + if(XPos & SrcBitPos) + { + Twiddled |= (DstBitPos << 1); + } + + + SrcBitPos <<= 1; + DstBitPos <<= 2; + ShiftCount += 1; + + } + + // prepend any unused bits + MaxValue >>= ShiftCount; + + Twiddled |= (MaxValue << (2*ShiftCount)); + + return Twiddled; +} + +/*!*********************************************************************** + @Function Decompress + @Input pCompressedData The PVRTC texture data to decompress + @Input Do2BitMode Signifies whether the data is PVRTC2 or PVRTC4 + @Input XDim X dimension of the texture + @Input YDim Y dimension of the texture + @Input AssumeImageTiles Assume the texture data tiles + @Modified pResultImage The decompressed texture data + @Description Decompresses PVRTC to RGBA 8888 + *************************************************************************/ +static void PVRDecompress(AMTC_BLOCK_STRUCT *pCompressedData, + const bool Do2bitMode, + const int XDim, + const int YDim, + const int AssumeImageTiles, + unsigned char* pResultImage) +{ + int x, y; + int i, j; + + int BlkX, BlkY; + int BlkXp1, BlkYp1; + int XBlockSize; + int BlkXDim, BlkYDim; + + int StartX, StartY; + + int ModulationVals[8][16]; + int ModulationModes[8][16]; + + int Mod, DoPT; + + unsigned int uPosition; + + // local neighbourhood of blocks + AMTC_BLOCK_STRUCT *pBlocks[2][2]; + + AMTC_BLOCK_STRUCT *pPrevious[2][2] = {{NULL, NULL}, {NULL, NULL}}; + + // Low precision colours extracted from the blocks + struct + { + int Reps[2][4]; + }Colours5554[2][2]; + + // Interpolated A and B colours for the pixel + int ASig[4], BSig[4]; + + int Result[4]; + + if(Do2bitMode) + XBlockSize = BLK_X_2BPP; + else + XBlockSize = BLK_X_4BPP; + + // For MBX don't allow the sizes to get too small + BlkXDim = PVRT_MAX(2, XDim / XBlockSize); + BlkYDim = PVRT_MAX(2, YDim / BLK_Y_SIZE); + + /* + Step through the pixels of the image decompressing each one in turn + + Note that this is a hideously inefficient way to do this! + */ + for(y = 0; y < YDim; y++) + { + for(x = 0; x < XDim; x++) + { + // map this pixel to the top left neighbourhood of blocks + BlkX = (x - XBlockSize/2); + BlkY = (y - BLK_Y_SIZE/2); + + BlkX = LIMIT_COORD(BlkX, XDim, AssumeImageTiles); + BlkY = LIMIT_COORD(BlkY, YDim, AssumeImageTiles); + + + BlkX /= XBlockSize; + BlkY /= BLK_Y_SIZE; + + // compute the positions of the other 3 blocks + BlkXp1 = LIMIT_COORD(BlkX+1, BlkXDim, AssumeImageTiles); + BlkYp1 = LIMIT_COORD(BlkY+1, BlkYDim, AssumeImageTiles); + + // Map to block memory locations + pBlocks[0][0] = pCompressedData +TwiddleUV(BlkYDim, BlkXDim, BlkY, BlkX); + pBlocks[0][1] = pCompressedData +TwiddleUV(BlkYDim, BlkXDim, BlkY, BlkXp1); + pBlocks[1][0] = pCompressedData +TwiddleUV(BlkYDim, BlkXDim, BlkYp1, BlkX); + pBlocks[1][1] = pCompressedData +TwiddleUV(BlkYDim, BlkXDim, BlkYp1, BlkXp1); + + + /* + extract the colours and the modulation information IF the previous values + have changed. + */ + if(memcmp(pPrevious, pBlocks, 4*sizeof(void*)) != 0) + { + StartY = 0; + for(i = 0; i < 2; i++) + { + StartX = 0; + for(j = 0; j < 2; j++) + { + Unpack5554Colour(pBlocks[i][j], Colours5554[i][j].Reps); + + UnpackModulations(pBlocks[i][j], + Do2bitMode, + ModulationVals, + ModulationModes, + StartX, StartY); + + StartX += XBlockSize; + } + + StartY += BLK_Y_SIZE; + } + + // make a copy of the new pointers + memcpy(pPrevious, pBlocks, 4*sizeof(void*)); + } + + // decompress the pixel. First compute the interpolated A and B signals + InterpolateColours(Colours5554[0][0].Reps[0], + Colours5554[0][1].Reps[0], + Colours5554[1][0].Reps[0], + Colours5554[1][1].Reps[0], + Do2bitMode, x, y, + ASig); + + InterpolateColours(Colours5554[0][0].Reps[1], + Colours5554[0][1].Reps[1], + Colours5554[1][0].Reps[1], + Colours5554[1][1].Reps[1], + Do2bitMode, x, y, + BSig); + + GetModulationValue(x,y, Do2bitMode, (const int (*)[16])ModulationVals, (const int (*)[16])ModulationModes, + &Mod, &DoPT); + + // compute the modulated colour + for(i = 0; i < 4; i++) + { + Result[i] = ASig[i] * 8 + Mod * (BSig[i] - ASig[i]); + Result[i] >>= 3; + } + + if(DoPT) + Result[3] = 0; + + // Store the result in the output image + uPosition = (x+y*XDim)<<2; + pResultImage[uPosition+0] = (U8)Result[0]; + pResultImage[uPosition+1] = (U8)Result[1]; + pResultImage[uPosition+2] = (U8)Result[2]; + pResultImage[uPosition+3] = (U8)Result[3]; + } + } +} + +/***************************************************************************** + End of file (pvr.cpp) + *****************************************************************************/ \ No newline at end of file diff --git a/cocos/base/pvr.h b/cocos/base/pvr.h new file mode 100644 index 0000000000..33c14a4e06 --- /dev/null +++ b/cocos/base/pvr.h @@ -0,0 +1,22 @@ +/****************************************************************************** + + @File PVRTDecompress.h + + @Title + + @Copyright Copyright (C) 2000 - 2008 by Imagination Technologies Limited. + + @Platform ANSI compatible + + @Description PVRTC Texture Decompression. + + ******************************************************************************/ + +#ifndef __PVR_H__ +#define __PVR_H__ + + +int PVRTDecompressPVRTC(const void * const pCompressedData,const int XDim,const int YDim,void *pDestData,const bool Do2bitMode); + + +#endif //__PVR_H__ diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj index 1c4ac42ad3..ba6db8f16c 100644 --- a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj +++ b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj @@ -63,7 +63,7 @@ $(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) true 4267;4251;4244;%(DisableSpecificWarnings) false @@ -82,7 +82,7 @@ $(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) None false diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp index 4c123c2f30..0eca4088a7 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -215,13 +215,17 @@ void ActionTimeline::startWithTarget(Node *target) [this, target](Node* child) { ActionTimelineData* data = dynamic_cast(child->getUserObject()); - int actionTag = data->getActionTag(); - if(_timelineMap.find(actionTag) != _timelineMap.end()) + + if(data) { - auto timelines = this->_timelineMap[actionTag]; - for (auto timeline : timelines) + int actionTag = data->getActionTag(); + if(_timelineMap.find(actionTag) != _timelineMap.end()) { - timeline->setNode(child); + auto timelines = this->_timelineMap[actionTag]; + for (auto timeline : timelines) + { + timeline->setNode(child); + } } } }); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h index 211f1d290a..ae8427002b 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h @@ -27,10 +27,11 @@ THE SOFTWARE. #include "CCTimeLine.h" #include "renderer/CCRenderer.h" +#include "cocostudio/CocosStudioExport.h" NS_TIMELINE_BEGIN -class ActionTimelineData : public cocos2d::Ref +class CC_STUDIO_DLL ActionTimelineData : public cocos2d::Ref { public: static ActionTimelineData* create(int actionTag); @@ -45,7 +46,7 @@ protected: }; -class ActionTimeline : public cocos2d::Action +class CC_STUDIO_DLL ActionTimeline : public cocos2d::Action { public: friend class Frame; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h index 3f9547e822..c2b2ec4fe0 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocos2d.h" #include "cocostudio/DictionaryHelper.h" #include "CCTimelineMacro.h" +#include "cocostudio/CocosStudioExport.h" NS_TIMELINE_BEGIN @@ -35,7 +36,7 @@ class ActionTimeline; class Timeline; class Frame; -class ActionTimelineCache +class CC_STUDIO_DLL ActionTimelineCache { public: /** Gets the singleton */ diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h index c049eebd66..c0e28ec1a7 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h @@ -27,12 +27,13 @@ THE SOFTWARE. #include "cocos2d.h" #include "CCTimelineMacro.h" +#include "cocostudio/CocosStudioExport.h" NS_TIMELINE_BEGIN class Timeline; -class Frame : public cocos2d::Ref +class CC_STUDIO_DLL Frame : public cocos2d::Ref { public: @@ -68,7 +69,7 @@ protected: }; -class VisibleFrame : public Frame +class CC_STUDIO_DLL VisibleFrame : public Frame { public: static VisibleFrame* create(); @@ -86,7 +87,7 @@ protected: }; -class TextureFrame : public Frame +class CC_STUDIO_DLL TextureFrame : public Frame { public: static TextureFrame* create(); @@ -106,7 +107,7 @@ protected: std::string _textureName; }; -class RotationFrame : public Frame +class CC_STUDIO_DLL RotationFrame : public Frame { public: static RotationFrame* create(); @@ -125,7 +126,7 @@ protected: float _betwennRotation; }; -class SkewFrame : public Frame +class CC_STUDIO_DLL SkewFrame : public Frame { public: static SkewFrame* create(); @@ -150,7 +151,7 @@ protected: }; -class RotationSkewFrame : public SkewFrame +class CC_STUDIO_DLL RotationSkewFrame : public SkewFrame { public: static RotationSkewFrame* create(); @@ -163,7 +164,7 @@ public: }; -class PositionFrame : public Frame +class CC_STUDIO_DLL PositionFrame : public Frame { public: static PositionFrame* create(); @@ -189,7 +190,7 @@ protected: }; -class ScaleFrame : public Frame +class CC_STUDIO_DLL ScaleFrame : public Frame { public: static ScaleFrame* create(); @@ -216,7 +217,7 @@ protected: }; -class AnchorPointFrame : public Frame +class CC_STUDIO_DLL AnchorPointFrame : public Frame { public: static AnchorPointFrame* create(); @@ -242,7 +243,7 @@ enum InnerActionType SingleFrame }; -class InnerActionFrame : public Frame +class CC_STUDIO_DLL InnerActionFrame : public Frame { public: static InnerActionFrame* create(); @@ -263,7 +264,7 @@ protected: }; -class ColorFrame : public Frame +class CC_STUDIO_DLL ColorFrame : public Frame { public: static ColorFrame* create(); @@ -290,7 +291,7 @@ protected: }; -class EventFrame : public Frame +class CC_STUDIO_DLL EventFrame : public Frame { public: static EventFrame* create(); @@ -307,7 +308,7 @@ protected: std::string _event; }; -class ZOrderFrame : public Frame +class CC_STUDIO_DLL ZOrderFrame : public Frame { public: static ZOrderFrame* create(); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp index 6d180fc4e2..c90ea748dc 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp @@ -236,8 +236,20 @@ Node* NodeReader::loadNode(const rapidjson::Value& json) { const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, CHILDREN, i); Node* child = loadNode(dic); - if (child) + if (child) { + auto widgetChild = dynamic_cast(child); + if (widgetChild + && dynamic_cast(node) + && !dynamic_cast(node)) + { + if (widgetChild->getPositionType() == ui::Widget::PositionType::PERCENT) + { + widgetChild->setPositionPercent(Vec2(widgetChild->getPositionPercent().x + node->getAnchorPoint().x, widgetChild->getPositionPercent().y + node->getAnchorPoint().y)); + } + widgetChild->setPosition(Vec2(widgetChild->getPositionX() + node->getAnchorPointInPoints().x, widgetChild->getPositionY() + node->getAnchorPointInPoints().y)); + } + node->addChild(child); child->release(); } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h index 669a3123ed..c45b99638c 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __CC_NODE_CACHE_H__ #include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CocosStudioExport.h" #include "cocos2d.h" namespace cocostudio { @@ -33,7 +34,7 @@ namespace cocostudio { namespace timeline{ -class NodeReader +class CC_STUDIO_DLL NodeReader { public: static NodeReader* getInstance(); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.h b/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.h index d81f44488f..8228baed89 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.h @@ -27,12 +27,13 @@ THE SOFTWARE. #include "CCFrame.h" #include "CCTimelineMacro.h" +#include "cocostudio/CocosStudioExport.h" NS_TIMELINE_BEGIN class ActionTimeline; -class Timeline : public cocos2d::Ref +class CC_STUDIO_DLL Timeline : public cocos2d::Ref { public: static Timeline* create(); diff --git a/cocos/editor-support/cocostudio/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h index 367aeb59ba..f8954b7839 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/CCActionFrame.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "math/CCGeometry.h" #include "2d/CCActionInterval.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -92,7 +93,7 @@ enum class FrameEaseType * @js NA * @lua NA */ -class ActionFrame: public cocos2d::Ref +class CC_STUDIO_DLL ActionFrame: public cocos2d::Ref { public: @@ -210,7 +211,7 @@ protected: * @js NA * @lua NA */ -class ActionMoveFrame:public ActionFrame +class CC_STUDIO_DLL ActionMoveFrame:public ActionFrame { public: @@ -254,7 +255,7 @@ protected: * @js NA * @lua NA */ -class ActionScaleFrame:public ActionFrame +class CC_STUDIO_DLL ActionScaleFrame:public ActionFrame { public: diff --git a/cocos/editor-support/cocostudio/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/CCActionFrameEasing.h index 122f2dd219..ea67bf0500 100644 --- a/cocos/editor-support/cocostudio/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __ActionFrameEasing_H__ #include "base/CCRef.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -56,7 +57,7 @@ enum FrameEasingType * @js NA * @lua NA */ -class ActionFrameEasing:public cocos2d::Ref +class CC_STUDIO_DLL ActionFrameEasing:public cocos2d::Ref { protected: FrameEasingType _type; diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.h b/cocos/editor-support/cocostudio/CCActionManagerEx.h index ebea434825..5b4622c6cd 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.h @@ -27,13 +27,14 @@ THE SOFTWARE. #include "cocostudio/CCActionObject.h" #include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { class CocoLoader; struct stExpCocoNode; -class ActionManagerEx:public cocos2d::Ref +class CC_STUDIO_DLL ActionManagerEx:public cocos2d::Ref { public: diff --git a/cocos/editor-support/cocostudio/CCActionNode.h b/cocos/editor-support/cocostudio/CCActionNode.h index 5b6da79620..f862bed64e 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.h +++ b/cocos/editor-support/cocostudio/CCActionNode.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "cocostudio/CCActionFrame.h" #include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -36,7 +37,7 @@ struct stExpCocoNode; * @js NA * @lua NA */ -class ActionNode : public cocos2d::Ref +class CC_STUDIO_DLL ActionNode : public cocos2d::Ref { public: diff --git a/cocos/editor-support/cocostudio/CCActionObject.h b/cocos/editor-support/cocostudio/CCActionObject.h index 401a18431d..045c5a403d 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.h +++ b/cocos/editor-support/cocostudio/CCActionObject.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocostudio/CCActionNode.h" #include "2d/CCActionInstant.h" #include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -38,7 +39,7 @@ struct stExpCocoNode; * @js NA * @lua NA */ -class ActionObject : public cocos2d::Ref +class CC_STUDIO_DLL ActionObject : public cocos2d::Ref { public: diff --git a/cocos/editor-support/cocostudio/CCArmature.h b/cocos/editor-support/cocostudio/CCArmature.h index 09cd53da8e..3ce0a58ac7 100644 --- a/cocos/editor-support/cocostudio/CCArmature.h +++ b/cocos/editor-support/cocostudio/CCArmature.h @@ -31,6 +31,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureAnimation.h" #include "cocostudio/CCSpriteFrameCacheHelper.h" #include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CocosStudioExport.h" #include "math/CCMath.h" class b2Body; @@ -67,7 +68,7 @@ CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; CC_DEPRECATED_ATTRIBUTE typedef cocos2d::tweenfunc::TweenType CCTweenType; -class Armature : public cocos2d::Node, public cocos2d::BlendProtocol +class CC_STUDIO_DLL Armature : public cocos2d::Node, public cocos2d::BlendProtocol { public: diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/CCArmatureAnimation.h index 6514694419..04ab3af4f1 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocostudio/CCProcessBase.h" #include "cocostudio/CCTween.h" +#include "cocostudio/CocosStudioExport.h" #include namespace cocostudio { @@ -65,7 +66,7 @@ struct MovementEvent std::string movementID; }; -class ArmatureAnimation : public ProcessBase +class CC_STUDIO_DLL ArmatureAnimation : public ProcessBase { public: /** diff --git a/cocos/editor-support/cocostudio/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/CCArmatureDataManager.h index 0375890180..a42072528f 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" - +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -42,7 +42,7 @@ struct RelativeData /** * @brief format and manage armature configuration and armature animation */ -class ArmatureDataManager : public cocos2d::Ref +class CC_STUDIO_DLL ArmatureDataManager : public cocos2d::Ref { public: /** @deprecated Use getInstance() instead */ diff --git a/cocos/editor-support/cocostudio/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h index 031a939f00..bb52eba815 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CocosStudioExport.h" namespace cocos2d { class GroupCommand; @@ -34,7 +35,7 @@ namespace cocos2d { namespace cocostudio { -class BatchNode : public cocos2d::Node +class CC_STUDIO_DLL BatchNode : public cocos2d::Node { public: static BatchNode *create(); diff --git a/cocos/editor-support/cocostudio/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h index bda4366fce..ec7661b380 100644 --- a/cocos/editor-support/cocostudio/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -30,6 +30,7 @@ THE SOFTWARE. #include "cocostudio/CCTween.h" #include "cocostudio/CCDecorativeDisplay.h" #include "cocostudio/CCDisplayManager.h" +#include "cocostudio/CocosStudioExport.h" #include "2d/CCNode.h" #include "math/CCMath.h" @@ -37,7 +38,7 @@ namespace cocostudio { class Armature; -class Bone : public cocos2d::Node +class CC_STUDIO_DLL Bone : public cocos2d::Node { public: /** diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h index 91ed2dc26a..3ddc289a6e 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" +#include "cocostudio/CocosStudioExport.h" #ifndef PT_RATIO #define PT_RATIO 32 @@ -48,7 +49,7 @@ class Bone; * @js NA * @lua NA */ -class ColliderFilter +class CC_STUDIO_DLL ColliderFilter { public: virtual ~ColliderFilter() { } @@ -85,7 +86,7 @@ protected: #endif }; -class ColliderBody : public cocos2d::Ref +class CC_STUDIO_DLL ColliderBody : public cocos2d::Ref { public: ColliderBody(ContourData *contourData); @@ -130,7 +131,7 @@ private: * @js NA * @lua NA */ -class ColliderDetector : public cocos2d::Ref +class CC_STUDIO_DLL ColliderDetector : public cocos2d::Ref { public: static ColliderDetector *create(); diff --git a/cocos/editor-support/cocostudio/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h index 5feecf2595..b97a000f73 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -28,13 +28,14 @@ THE SOFTWARE. #include "CCComBase.h" #include "2d/CCComponent.h" #include "base/CCValue.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { -class ComAttribute : public cocos2d::Component +class CC_STUDIO_DLL ComAttribute : public cocos2d::Component { DECLARE_CLASS_COMPONENT_INFO -protected: +public: /** * @js ctor */ diff --git a/cocos/editor-support/cocostudio/CCComAudio.h b/cocos/editor-support/cocostudio/CCComAudio.h index 1643082307..d91dbe7bee 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.h +++ b/cocos/editor-support/cocostudio/CCComAudio.h @@ -27,14 +27,16 @@ THE SOFTWARE. #include "CCComBase.h" #include "2d/CCComponent.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { -class ComAudio : public cocos2d::Component +class CC_STUDIO_DLL ComAudio : public cocos2d::Component { DECLARE_CLASS_COMPONENT_INFO -protected: + +public: /** * @js ctor */ diff --git a/cocos/editor-support/cocostudio/CCComBase.h b/cocos/editor-support/cocostudio/CCComBase.h index 6d526b60ce..21750ab22b 100644 --- a/cocos/editor-support/cocostudio/CCComBase.h +++ b/cocos/editor-support/cocostudio/CCComBase.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include #include "DictionaryHelper.h" +#include "cocostudio/CocosStudioExport.h" #include "base/ObjectFactory.h" #include "CocoLoader.h" @@ -46,7 +47,7 @@ THE SOFTWARE. #define CREATE_CLASS_COMPONENT_INFO(className) \ cocos2d::ObjectFactory::TInfo(#className, &className::createInstance) -struct SerData +struct CC_STUDIO_DLL SerData { const rapidjson::Value *_rData; cocostudio::stExpCocoNode *_cocoNode; diff --git a/cocos/editor-support/cocostudio/CCComController.h b/cocos/editor-support/cocostudio/CCComController.h index 4428d93f89..8a3ad4f32a 100644 --- a/cocos/editor-support/cocostudio/CCComController.h +++ b/cocos/editor-support/cocostudio/CCComController.h @@ -27,11 +27,12 @@ THE SOFTWARE. #include "CCComBase.h" #include "cocostudio/CCInputDelegate.h" +#include "cocostudio/CocosStudioExport.h" #include "2d/CCComponent.h" namespace cocostudio { -class ComController : public cocos2d::Component, public InputDelegate +class CC_STUDIO_DLL ComController : public cocos2d::Component, public InputDelegate { DECLARE_CLASS_COMPONENT_INFO diff --git a/cocos/editor-support/cocostudio/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h index 9598ec57ab..0ff90d979c 100644 --- a/cocos/editor-support/cocostudio/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -27,10 +27,11 @@ THE SOFTWARE. #include "CCComBase.h" #include "2d/CCComponent.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { -class ComRender : public cocos2d::Component +class CC_STUDIO_DLL ComRender : public cocos2d::Component { DECLARE_CLASS_COMPONENT_INFO protected: diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h index 2401d710d0..4e8b941f5a 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -29,6 +29,7 @@ THE SOFTWARE. #include "cocostudio/CCDatas.h" #include "cocostudio/CCArmature.h" #include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CocosStudioExport.h" #include "json/document.h" #include "DictionaryHelper.h" @@ -52,7 +53,7 @@ namespace cocostudio { * @js NA * @lua NA */ -class DataReaderHelper : cocos2d::Ref +class CC_STUDIO_DLL DataReaderHelper : cocos2d::Ref { protected: diff --git a/cocos/editor-support/cocostudio/CCDatas.h b/cocos/editor-support/cocostudio/CCDatas.h index 84eb57679d..2eac5f9511 100644 --- a/cocos/editor-support/cocostudio/CCDatas.h +++ b/cocos/editor-support/cocostudio/CCDatas.h @@ -33,6 +33,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "2d/CCTweenFunction.h" +#include "cocostudio/CocosStudioExport.h" #define CC_CREATE_NO_PARAM_NO_INIT(varType)\ @@ -68,7 +69,7 @@ namespace cocostudio { * @js NA * @lua NA */ -class BaseData : public cocos2d::Ref +class CC_STUDIO_DLL BaseData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM_NO_INIT(BaseData) @@ -137,7 +138,7 @@ enum DisplayType * @js NA * @lua NA */ -class DisplayData : public cocos2d::Ref +class CC_STUDIO_DLL DisplayData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM_NO_INIT(DisplayData) @@ -165,7 +166,7 @@ public: * @js NA * @lua NA */ -class SpriteDisplayData : public DisplayData +class CC_STUDIO_DLL SpriteDisplayData : public DisplayData { public: CC_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) @@ -189,7 +190,7 @@ public: * @js NA * @lua NA */ -class ArmatureDisplayData : public DisplayData +class CC_STUDIO_DLL ArmatureDisplayData : public DisplayData { public: CC_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) @@ -209,7 +210,7 @@ public: * @js NA * @lua NA */ -class ParticleDisplayData : public DisplayData +class CC_STUDIO_DLL ParticleDisplayData : public DisplayData { public: CC_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) @@ -234,7 +235,7 @@ public: * @js NA * @lua NA */ -class BoneData : public BaseData +class CC_STUDIO_DLL BoneData : public BaseData { public: CC_CREATE_NO_PARAM(BoneData) @@ -268,7 +269,7 @@ public: * @js NA * @lua NA */ -class ArmatureData : public cocos2d::Ref +class CC_STUDIO_DLL ArmatureData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM(ArmatureData) @@ -314,7 +315,7 @@ enum BlendType * @js NA * @lua NA */ -class FrameData : public BaseData +class CC_STUDIO_DLL FrameData : public BaseData { public: CC_CREATE_NO_PARAM_NO_INIT(FrameData) @@ -361,7 +362,7 @@ public: * @js NA * @lua NA */ -class MovementBoneData : public cocos2d::Ref +class CC_STUDIO_DLL MovementBoneData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM(MovementBoneData) @@ -393,7 +394,7 @@ public: * @js NA * @lua NA */ -class MovementData : public cocos2d::Ref +class CC_STUDIO_DLL MovementData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM_NO_INIT(MovementData) @@ -455,7 +456,7 @@ public: * @js NA * @lua NA */ -class AnimationData : public cocos2d::Ref +class CC_STUDIO_DLL AnimationData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM_NO_INIT(AnimationData) @@ -486,7 +487,7 @@ public: * @js NA * @lua NA */ -class ContourData : public cocos2d::Ref +class CC_STUDIO_DLL ContourData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM(ContourData) @@ -515,7 +516,7 @@ public: * @js NA * @lua NA */ -class TextureData : public cocos2d::Ref +class CC_STUDIO_DLL TextureData : public cocos2d::Ref { public: CC_CREATE_NO_PARAM(TextureData) diff --git a/cocos/editor-support/cocostudio/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h index 1902565550..9a880b385f 100644 --- a/cocos/editor-support/cocostudio/CCDecorativeDisplay.h +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDisplayFactory.h" #include "cocostudio/CCDatas.h" +#include "cocostudio/CocosStudioExport.h" #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX @@ -43,7 +44,7 @@ namespace cocostudio { * @js NA * @lua NA */ -class DecorativeDisplay: public cocos2d::Ref +class CC_STUDIO_DLL DecorativeDisplay: public cocos2d::Ref { public: static DecorativeDisplay *create(); diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.h b/cocos/editor-support/cocostudio/CCDisplayFactory.h index 3c94dc8d3b..037395bc31 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.h @@ -27,6 +27,8 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" +#include "cocostudio/CocosStudioExport.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -38,7 +40,7 @@ class DisplayData; * @js NA * @lua NA */ -class DisplayFactory +class CC_STUDIO_DLL DisplayFactory { public: static void addDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h index b4010c4eac..2f7b5e0f60 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDecorativeDisplay.h" #include "cocostudio/CCDatas.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -37,7 +38,7 @@ class Bone; * @js NA * @lua NA */ -class DisplayManager : public cocos2d::Ref +class CC_STUDIO_DLL DisplayManager : public cocos2d::Ref { public: static DisplayManager *create(Bone *bone); diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h index 89ef95b6c2..fb41d543d0 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.h +++ b/cocos/editor-support/cocostudio/CCInputDelegate.h @@ -31,6 +31,7 @@ THE SOFTWARE. #include "base/ccTypes.h" #include "base/CCEventKeyboard.h" #include "base/CCEventListener.h" +#include "cocostudio/CocosStudioExport.h" namespace cocos2d { class __Set; @@ -41,7 +42,7 @@ namespace cocostudio { /** * @lua NA */ -class InputDelegate +class CC_STUDIO_DLL InputDelegate { protected: /** diff --git a/cocos/editor-support/cocostudio/CCProcessBase.h b/cocos/editor-support/cocostudio/CCProcessBase.h index 59f0824f6b..b2acabee6b 100644 --- a/cocos/editor-support/cocostudio/CCProcessBase.h +++ b/cocos/editor-support/cocostudio/CCProcessBase.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -50,7 +51,7 @@ enum AnimationType * @js NA * @lua NA */ -class ProcessBase : public cocos2d::Ref +class CC_STUDIO_DLL ProcessBase : public cocos2d::Ref { public: ProcessBase(void); diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index c5a798a878..89f27a6a1b 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -25,10 +25,11 @@ THE SOFTWARE. #ifndef __CCSGUIREADER_H__ #define __CCSGUIREADER_H__ -#include "ui/UIWidget.h" +#include "ui/UILayout.h" #include "cocostudio/DictionaryHelper.h" #include "WidgetReader/WidgetReaderProtocol.h" #include "base/ObjectFactory.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -41,7 +42,7 @@ namespace cocostudio { typedef void (cocos2d::Ref::*SEL_ParseEvent)(const std::string&, cocos2d::Ref*, const rapidjson::Value&); #define parseselector(_SELECTOR) (SEL_ParseEvent)(&_SELECTOR) -class GUIReader : public cocos2d::Ref +class CC_STUDIO_DLL GUIReader : public cocos2d::Ref { public: CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; @@ -89,7 +90,7 @@ public: }; -class WidgetPropertiesReader : public cocos2d::Ref +class CC_STUDIO_DLL WidgetPropertiesReader : public cocos2d::Ref { public: virtual cocos2d::ui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName)=0; @@ -124,7 +125,7 @@ protected: }; -class WidgetPropertiesReader0250 : public WidgetPropertiesReader +class CC_STUDIO_DLL WidgetPropertiesReader0250 : public WidgetPropertiesReader { @@ -171,7 +172,7 @@ public: const rapidjson::Value& customOptions); }; -class WidgetPropertiesReader0300 : public WidgetPropertiesReader +class CC_STUDIO_DLL WidgetPropertiesReader0300 : public WidgetPropertiesReader { diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 7d982858b2..e4fa36087d 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -26,12 +26,12 @@ THE SOFTWARE. #define __CCSSCENEREADER_H__ #include "cocostudio/DictionaryHelper.h" - +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { -class SceneReader +class CC_STUDIO_DLL SceneReader { public: diff --git a/cocos/editor-support/cocostudio/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h index 67f409274c..1987eb968a 100644 --- a/cocos/editor-support/cocostudio/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -30,10 +30,11 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCBone.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { -class Skin : public cocos2d::Sprite +class CC_STUDIO_DLL Skin : public cocos2d::Sprite { public: static Skin *create(); diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 3c50ae7e4b..6a98a8ead5 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -26,6 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformMacros.h" #include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CocosStudioExport.h" #include #include @@ -35,7 +36,7 @@ namespace cocostudio { * @js NA * @lua NA */ -class SpriteFrameCacheHelper +class CC_STUDIO_DLL SpriteFrameCacheHelper { public: /** @deprecated Use getInstance() instead */ diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.h b/cocos/editor-support/cocostudio/CCTransformHelp.h index ec93a2ac55..452257fb3e 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/CCTransformHelp.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -35,7 +36,7 @@ namespace cocostudio { * @js NA * @lua NA */ -class TransformHelp +class CC_STUDIO_DLL TransformHelp { public: TransformHelp(); diff --git a/cocos/editor-support/cocostudio/CCTween.h b/cocos/editor-support/cocostudio/CCTween.h index c12f9c7b46..1eeda5da47 100644 --- a/cocos/editor-support/cocostudio/CCTween.h +++ b/cocos/editor-support/cocostudio/CCTween.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocostudio/CCProcessBase.h" #include "2d/CCTweenFunction.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { @@ -39,7 +40,7 @@ using cocos2d::tweenfunc::TweenType; * @js NA * @lua NA */ -class Tween : public ProcessBase +class CC_STUDIO_DLL Tween : public ProcessBase { public: /** diff --git a/cocos/editor-support/cocostudio/CCUtilMath.h b/cocos/editor-support/cocostudio/CCUtilMath.h index 5a4827bf44..46868313b5 100644 --- a/cocos/editor-support/cocostudio/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/CCUtilMath.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "2d/CCSprite.h" #include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CocosStudioExport.h" #include namespace cocostudio { @@ -37,18 +38,18 @@ namespace cocostudio { //! hit test function -bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vec2 point); -bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vec2 point, cocos2d::Vec2 &outPoint); +bool CC_STUDIO_DLL isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vec2 point); +bool CC_STUDIO_DLL isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vec2 point, cocos2d::Vec2 &outPoint); #define CC_SPRITE_CONTAIN_POINT(sprite, point) isSpriteContainPoint((sprite), (point)) #define CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint) isSpriteContainPoint((sprite), (point), outPoint) //! motion curve function -cocos2d::Vec2 bezierTo(float t, cocos2d::Vec2 &point1, cocos2d::Vec2 &point2, cocos2d::Vec2 &point3); -cocos2d::Vec2 bezierTo(float t, cocos2d::Vec2 &point1, cocos2d::Vec2 &point2, cocos2d::Vec2 &point3, cocos2d::Vec2 &point4); +cocos2d::Vec2 CC_STUDIO_DLL bezierTo(float t, cocos2d::Vec2 &point1, cocos2d::Vec2 &point2, cocos2d::Vec2 &point3); +cocos2d::Vec2 CC_STUDIO_DLL bezierTo(float t, cocos2d::Vec2 &point1, cocos2d::Vec2 &point2, cocos2d::Vec2 &point3, cocos2d::Vec2 &point4); -cocos2d::Vec2 circleTo(float t, cocos2d::Vec2 ¢er, float radius, float fromRadian, float radianDif); +cocos2d::Vec2 CC_STUDIO_DLL circleTo(float t, cocos2d::Vec2 ¢er, float radius, float fromRadian, float radianDif); } diff --git a/cocos/editor-support/cocostudio/CocoLoader.h b/cocos/editor-support/cocostudio/CocoLoader.h index b54681aaa6..29d0983e4d 100644 --- a/cocos/editor-support/cocostudio/CocoLoader.h +++ b/cocos/editor-support/cocostudio/CocoLoader.h @@ -31,6 +31,7 @@ #include #include "json/rapidjson.h" #include "json/document.h" +#include "cocostudio/CocosStudioExport.h" #pragma pack (4) @@ -38,7 +39,7 @@ namespace cocostudio{ class CocoLoader; -struct stExpCocoAttribDesc +struct CC_STUDIO_DLL stExpCocoAttribDesc { char m_cTypeName; uint32_t m_szName; @@ -46,7 +47,7 @@ public: char* GetName(CocoLoader* pCoco); }; -struct stExpCocoObjectDesc +struct CC_STUDIO_DLL stExpCocoObjectDesc { unsigned char m_cAttribNum; uint32_t m_szName; @@ -57,7 +58,7 @@ public: stExpCocoAttribDesc* GetAttribDescArray(CocoLoader* pCoco); }; -struct stExpCocoNode +struct CC_STUDIO_DLL stExpCocoNode { public: int16_t m_ObjIndex; @@ -75,7 +76,7 @@ public: void WriteJson(CocoLoader* pCoco,void* pFileName = nullptr, int vLayer = 0, bool bEndNode = false, bool bParentNodeIsArray = false); }; -struct stCocoFileHeader +struct CC_STUDIO_DLL stCocoFileHeader { char m_FileDesc[32]; char m_Version[32]; @@ -88,7 +89,7 @@ struct stCocoFileHeader }; -class CocoLoader +class CC_STUDIO_DLL CocoLoader { stCocoFileHeader* m_pFileHeader; stExpCocoNode* m_pRootNode; diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h index 29d8319a38..ea49115db8 100644 --- a/cocos/editor-support/cocostudio/CocoStudio.h +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -63,5 +63,6 @@ THE SOFTWARE. #include "cocostudio/ActionTimeline/CCFrame.h" #include "cocostudio/ActionTimeline/CCTimeLine.h" #include "cocostudio/ActionTimeline/CCActionTimeline.h" +#include "cocostudio/CocosStudioExport.h" #endif diff --git a/cocos/editor-support/cocostudio/CocosStudioExport.h b/cocos/editor-support/cocostudio/CocosStudioExport.h new file mode 100644 index 0000000000..552aad7519 --- /dev/null +++ b/cocos/editor-support/cocostudio/CocosStudioExport.h @@ -0,0 +1,28 @@ +#ifndef __CCCOCOSSTUDIO_H__ +#define __CCCOCOSSTUDIO_H__ + +#if defined(WIN32) && defined(_WINDOWS) + #ifdef __MINGW32__ + #include + #endif + + #if defined(_USRSTUDIODLL) + #define CC_STUDIO_DLL __declspec(dllexport) + #else /* use a DLL library */ + #define CC_STUDIO_DLL __declspec(dllimport) + #endif + + + /* Define NULL pointer value */ + #ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif + #endif +#else + #define CC_STUDIO_DLL +#endif + +#endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/DictionaryHelper.h b/cocos/editor-support/cocostudio/DictionaryHelper.h index cefb9610ff..2107008818 100644 --- a/cocos/editor-support/cocostudio/DictionaryHelper.h +++ b/cocos/editor-support/cocostudio/DictionaryHelper.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __DICTIONARYHELPER_H__ #include "json/document.h" +#include "cocostudio/CocosStudioExport.h" #define DICTOOL DictionaryHelper::getInstance() @@ -34,7 +35,7 @@ namespace cocostudio { * @js NA * @lua NA */ -class DictionaryHelper +class CC_STUDIO_DLL DictionaryHelper { public: DictionaryHelper(); diff --git a/cocos/editor-support/cocostudio/TriggerBase.h b/cocos/editor-support/cocostudio/TriggerBase.h index c5c6fe5c6f..31dc0c0308 100755 --- a/cocos/editor-support/cocostudio/TriggerBase.h +++ b/cocos/editor-support/cocostudio/TriggerBase.h @@ -30,6 +30,7 @@ THE SOFTWARE. #include "base/ObjectFactory.h" #include "TriggerObj.h" #include "TriggerMng.h" +#include "cocostudio/CocosStudioExport.h" #define DECLARE_CLASS_INFO \ @@ -47,7 +48,7 @@ THE SOFTWARE. cocos2d::ObjectFactory::TInfo className::Type(#className, &className::createInstance); \ -void sendEvent(unsigned int event); +void CC_STUDIO_DLL sendEvent(unsigned int event); #endif diff --git a/cocos/editor-support/cocostudio/TriggerMng.h b/cocos/editor-support/cocostudio/TriggerMng.h index afae1d2eb5..7d43eb5e74 100755 --- a/cocos/editor-support/cocostudio/TriggerMng.h +++ b/cocos/editor-support/cocostudio/TriggerMng.h @@ -36,7 +36,7 @@ namespace cocostudio { class TriggerObj; -class ArmatureMovementDispatcher : public cocos2d::Ref +class CC_STUDIO_DLL ArmatureMovementDispatcher : public cocos2d::Ref { public: ArmatureMovementDispatcher(void); @@ -51,7 +51,7 @@ private: }; -class TriggerMng +class CC_STUDIO_DLL TriggerMng { public: TriggerMng(void); diff --git a/cocos/editor-support/cocostudio/TriggerObj.h b/cocos/editor-support/cocostudio/TriggerObj.h index e026cc738a..464c0d98f7 100755 --- a/cocos/editor-support/cocostudio/TriggerObj.h +++ b/cocos/editor-support/cocostudio/TriggerObj.h @@ -35,7 +35,7 @@ class EventListenerCustom; namespace cocostudio { -class BaseTriggerCondition : public cocos2d::Ref +class CC_STUDIO_DLL BaseTriggerCondition : public cocos2d::Ref { protected: BaseTriggerCondition(void); @@ -48,7 +48,7 @@ public: virtual void removeAll(); }; -class BaseTriggerAction : public cocos2d::Ref +class CC_STUDIO_DLL BaseTriggerAction : public cocos2d::Ref { protected: BaseTriggerAction(void); @@ -62,7 +62,7 @@ public: }; -class TriggerObj : public cocos2d::Ref +class CC_STUDIO_DLL TriggerObj : public cocos2d::Ref { public: TriggerObj(void); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index d2ba76cbde..4b9bb4f91d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -26,10 +26,11 @@ #define __TestCpp__ButtonReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class ButtonReader : public WidgetReader + class CC_STUDIO_DLL ButtonReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index 1c934dfb99..f512b08b2d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -26,10 +26,11 @@ #define __TestCpp__CheckBoxReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class CheckBoxReader : public WidgetReader + class CC_STUDIO_DLL CheckBoxReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 27dd31eab5..2d890eaf14 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -26,10 +26,11 @@ #define __TestCpp__ImageViewReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class ImageViewReader : public WidgetReader + class CC_STUDIO_DLL ImageViewReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 77518df738..3b39a6a106 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -26,10 +26,11 @@ #define __TestCpp__LayoutReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class LayoutReader : public WidgetReader + class CC_STUDIO_DLL LayoutReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index 226ac4fac8..97564e614a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -26,10 +26,11 @@ #define __TestCpp__ListViewReader__ #include "../ScrollViewReader/ScrollViewReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class ListViewReader : public ScrollViewReader + class CC_STUDIO_DLL ListViewReader : public ScrollViewReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 7a08aa7e04..e77beb22ab 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -26,10 +26,11 @@ #define __TestCpp__LoadingBarReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class LoadingBarReader : public WidgetReader + class CC_STUDIO_DLL LoadingBarReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index 63f6f446ab..975049bd1a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -26,10 +26,11 @@ #define __TestCpp__PageViewReader__ #include "../LayoutReader/LayoutReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class PageViewReader : public LayoutReader + class CC_STUDIO_DLL PageViewReader : public LayoutReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index ce95c3b5f7..a50d45d8b2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -26,10 +26,11 @@ #define __TestCpp__ScrollViewReader__ #include "../LayoutReader/LayoutReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class ScrollViewReader : public LayoutReader + class CC_STUDIO_DLL ScrollViewReader : public LayoutReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h index 2ea5f002ff..ab025eb87d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -26,10 +26,11 @@ #define __TestCpp__SliderReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class SliderReader : public WidgetReader + class CC_STUDIO_DLL SliderReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 99a00444c1..b104fb8af1 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -26,10 +26,11 @@ #define __TestCpp__TextAtlasReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class TextAtlasReader : public WidgetReader + class CC_STUDIO_DLL TextAtlasReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index 4fdc193a40..a08f39876d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -26,10 +26,11 @@ #define __TestCpp__TextBMFontReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class TextBMFontReader : public WidgetReader + class CC_STUDIO_DLL TextBMFontReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index bcd01d0021..d8b96f5a8e 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -26,10 +26,11 @@ #define __TestCpp__TextFieldReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class TextFieldReader : public WidgetReader + class CC_STUDIO_DLL TextFieldReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h index 9482ecbe60..0f7337360a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h @@ -26,10 +26,11 @@ #define __TestCpp__TextReader__ #include "../WidgetReader.h" +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { - class TextReader : public WidgetReader + class CC_STUDIO_DLL TextReader : public WidgetReader { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h index ca62aab066..31dc939da2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h @@ -29,14 +29,14 @@ #include "cocostudio/CCSGUIReader.h" #include "ui/GUIDefine.h" #include "ui/UIWidget.h" - +#include "cocostudio/CocosStudioExport.h" namespace cocostudio { class CocoLoader; struct stExpCocoNode; - class WidgetReader : public cocos2d::Ref, public WidgetReaderProtocol + class CC_STUDIO_DLL WidgetReader : public cocos2d::Ref, public WidgetReaderProtocol { public: DECLARE_CLASS_WIDGET_READER_INFO diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReaderProtocol.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReaderProtocol.h index 0461ca5cec..c663ae3535 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReaderProtocol.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReaderProtocol.h @@ -27,8 +27,7 @@ #include "cocos2d.h" #include "cocostudio/DictionaryHelper.h" - - +#include "cocostudio/CocosStudioExport.h" namespace cocos2d { @@ -43,7 +42,7 @@ namespace cocostudio class CocoLoader; struct stExpCocoNode; - class WidgetReaderProtocol + class CC_STUDIO_DLL WidgetReaderProtocol { public: virtual ~WidgetReaderProtocol() {}; diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index 684f848d8d..44f343ed68 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -117,6 +117,7 @@ + @@ -142,7 +143,7 @@ - StaticLibrary + DynamicLibrary true v100 v110 @@ -152,7 +153,7 @@ Unicode - StaticLibrary + DynamicLibrary false v100 v110 @@ -189,7 +190,7 @@ $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\win32-specific\zlib\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRSTUDIODLL;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;COCOS2DXWIN32_EXPORTS;%(PreprocessorDefinitions) true 4267;4251;4244;%(DisableSpecificWarnings) false @@ -197,6 +198,8 @@ true + $(OutDir);%(AdditionalLibraryDirectories) + libcocos2d.lib;libExtensions.lib;libGUI.lib;libBox2d.lib;libchipmunk.lib;libzlib.lib;libAudio.lib;%(AdditionalDependencies) @@ -207,7 +210,7 @@ true - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USRSTUDIODLL;%(PreprocessorDefinitions) $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\win32-specific\zlib\include;%(AdditionalIncludeDirectories) None false @@ -216,6 +219,8 @@ true true true + libcocos2d.lib;libExtensions.lib;libGUI.lib;libBox2d.lib;libchipmunk.lib;libzlib.lib;libAudio.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters index 8e91fb082e..3102335bfe 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters @@ -455,5 +455,6 @@ TimelineAction + \ No newline at end of file diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj index 2f033657b8..df94855ceb 100644 --- a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj @@ -118,7 +118,7 @@ $(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) true 4267;4251;4244;%(DisableSpecificWarnings) false @@ -135,7 +135,7 @@ true - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) $(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) None false diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index f4c8604b3a..07335110cd 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -41,7 +41,7 @@ extern "C" { // To resolve link error when building 32bits with Xcode 6. // More information please refer to the discussion in https://github.com/cocos2d/cocos2d-x/pull/6986 -#if defined(__APPLE__) || defined(__unix) +#if defined (__unix) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #include @@ -66,6 +66,7 @@ extern "C" } #include "base/s3tc.h" #include "base/atitc.h" +#include "base/pvr.h" #include "base/TGAlib.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) @@ -141,6 +142,34 @@ namespace PVRTC2BPP_RGBA = 1ULL, PVRTC4BPP_RGB = 2ULL, PVRTC4BPP_RGBA = 3ULL, + PVRTC2_2BPP_RGBA = 4ULL, + PVRTC2_4BPP_RGBA = 5ULL, + ETC1 = 6ULL, + DXT1 = 7ULL, + DXT2 = 8ULL, + DXT3 = 9ULL, + DXT4 = 10ULL, + DXT5 = 11ULL, + BC1 = 7ULL, + BC2 = 9ULL, + BC3 = 11ULL, + BC4 = 12ULL, + BC5 = 13ULL, + BC6 = 14ULL, + BC7 = 15ULL, + UYVY = 16ULL, + YUY2 = 17ULL, + BW1bpp = 18ULL, + R9G9B9E5 = 19ULL, + RGBG8888 = 20ULL, + GRGB8888 = 21ULL, + ETC2_RGB = 22ULL, + ETC2_RGBA = 23ULL, + ETC2_RGBA1 = 24ULL, + EAC_R11_Unsigned = 25ULL, + EAC_R11_Signed = 26ULL, + EAC_RG11_Unsigned = 27ULL, + EAC_RG11_Signed = 28ULL, BGRA8888 = 0x0808080861726762ULL, RGBA8888 = 0x0808080861626772ULL, @@ -169,10 +198,8 @@ namespace _pixel2_formathash::value_type(PVR2TexturePixelFormat::I8, Texture2D::PixelFormat::I8), _pixel2_formathash::value_type(PVR2TexturePixelFormat::AI88, Texture2D::PixelFormat::AI88), -#ifdef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC2BPP_RGBA, Texture2D::PixelFormat::PVRTC2A), _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC4BPP_RGBA, Texture2D::PixelFormat::PVRTC4A), -#endif }; static const int PVR2_MAX_TABLE_ELEMENTS = sizeof(v2_pixel_formathash_value) / sizeof(v2_pixel_formathash_value[0]); @@ -192,12 +219,12 @@ namespace _pixel3_formathash::value_type(PVR3TexturePixelFormat::L8, Texture2D::PixelFormat::I8), _pixel3_formathash::value_type(PVR3TexturePixelFormat::LA88, Texture2D::PixelFormat::AI88), -#ifdef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGB, Texture2D::PixelFormat::PVRTC2), _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGBA, Texture2D::PixelFormat::PVRTC2A), _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGB, Texture2D::PixelFormat::PVRTC4), _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGBA, Texture2D::PixelFormat::PVRTC4A), -#endif + + _pixel3_formathash::value_type(PVR3TexturePixelFormat::ETC1, Texture2D::PixelFormat::ETC), }; static const int PVR3_MAX_TABLE_ELEMENTS = sizeof(v3_pixel_formathash_value) / sizeof(v3_pixel_formathash_value[0]); @@ -395,6 +422,27 @@ namespace } } +Texture2D::PixelFormat getDevicePixelFormat(Texture2D::PixelFormat format) +{ + switch (format) { + case Texture2D::PixelFormat::PVRTC4: + case Texture2D::PixelFormat::PVRTC4A: + case Texture2D::PixelFormat::PVRTC2: + case Texture2D::PixelFormat::PVRTC2A: + if(Configuration::getInstance()->supportsPVRTC()) + return format; + else + return Texture2D::PixelFormat::RGBA8888; + case Texture2D::PixelFormat::ETC: + if(Configuration::getInstance()->supportsETC()) + return format; + else + return Texture2D::PixelFormat::RGB888; + default: + return format; + } +} + ////////////////////////////////////////////////////////////////////////// // Implement Image ////////////////////////////////////////////////////////////////////////// @@ -404,6 +452,7 @@ Image::Image() , _dataLen(0) , _width(0) , _height(0) +, _unpack(false) , _fileType(Format::UNKOWN) , _renderFormat(Texture2D::PixelFormat::NONE) , _preMulti(false) @@ -415,7 +464,13 @@ Image::Image() Image::~Image() { - CC_SAFE_FREE(_data); + if(_unpack) + { + for (unsigned int i = 0; i < _numberOfMipmaps; ++i) + CC_SAFE_DELETE_ARRAY(_mipmaps[i].address); + } + else + CC_SAFE_FREE(_data); } bool Image::initWithImageFile(const std::string& path) @@ -1181,32 +1236,38 @@ namespace { bool testFormatForPvr2TCSupport(PVR2TexturePixelFormat format) { - if (!Configuration::getInstance()->supportsPVRTC()) - { - if (format == PVR2TexturePixelFormat::PVRTC2BPP_RGBA || - format == PVR2TexturePixelFormat::PVRTC4BPP_RGBA) - { - return false; - } - } - return true; } bool testFormatForPvr3TCSupport(PVR3TexturePixelFormat format) { - if (!Configuration::getInstance()->supportsPVRTC()) - { - if (format == PVR3TexturePixelFormat::PVRTC2BPP_RGB || - format == PVR3TexturePixelFormat::PVRTC2BPP_RGBA || - format == PVR3TexturePixelFormat::PVRTC4BPP_RGB || - format == PVR3TexturePixelFormat::PVRTC4BPP_RGBA) - { + switch (format) { + case PVR3TexturePixelFormat::DXT1: + case PVR3TexturePixelFormat::DXT3: + case PVR3TexturePixelFormat::DXT5: + return Configuration::getInstance()->supportsS3TC(); + + case PVR3TexturePixelFormat::BGRA8888: + return Configuration::getInstance()->supportsBGRA8888(); + + case PVR3TexturePixelFormat::PVRTC2BPP_RGB: + case PVR3TexturePixelFormat::PVRTC2BPP_RGBA: + case PVR3TexturePixelFormat::PVRTC4BPP_RGB: + case PVR3TexturePixelFormat::PVRTC4BPP_RGBA: + case PVR3TexturePixelFormat::ETC1: + case PVR3TexturePixelFormat::RGBA8888: + case PVR3TexturePixelFormat::RGBA4444: + case PVR3TexturePixelFormat::RGBA5551: + case PVR3TexturePixelFormat::RGB565: + case PVR3TexturePixelFormat::RGB888: + case PVR3TexturePixelFormat::A8: + case PVR3TexturePixelFormat::L8: + case PVR3TexturePixelFormat::LA88: + return true; + + default: return false; - } } - - return true; } } @@ -1256,7 +1317,7 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) return false; } - auto it = Texture2D::getPixelFormatInfoMap().find(v2_pixel_formathash.at(formatFlags)); + auto it = Texture2D::getPixelFormatInfoMap().find(getDevicePixelFormat(v2_pixel_formathash.at(formatFlags))); if (it == Texture2D::getPixelFormatInfoMap().end()) { @@ -1265,6 +1326,7 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) } _renderFormat = it->first; + int bpp = it->second.bpp; //Reset num of mipmaps _numberOfMipmaps = 0; @@ -1285,29 +1347,47 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) while (dataOffset < dataLength) { switch (formatFlags) { - case PVR2TexturePixelFormat::PVRTC2BPP_RGBA: - blockSize = 8 * 4; // Pixel by pixel block size for 2bpp - widthBlocks = width / 8; - heightBlocks = height / 4; - break; - case PVR2TexturePixelFormat::PVRTC4BPP_RGBA: - blockSize = 4 * 4; // Pixel by pixel block size for 4bpp - widthBlocks = width / 4; - heightBlocks = height / 4; - break; - case PVR2TexturePixelFormat::BGRA8888: - if (Configuration::getInstance()->supportsBGRA8888() == false) - { - CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); - return false; - } - default: - blockSize = 1; - widthBlocks = width; - heightBlocks = height; - break; + case PVR2TexturePixelFormat::PVRTC2BPP_RGBA: + if(!Configuration::getInstance()->supportsPVRTC()) + { + CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + _unpack = true; + _mipmaps[_numberOfMipmaps].len = width*height*4; + _mipmaps[_numberOfMipmaps].address = new unsigned char[width*height*4]; + PVRTDecompressPVRTC(_data+dataOffset,width,height,_mipmaps[_numberOfMipmaps].address, true); + bpp = 2; + } + blockSize = 8 * 4; // Pixel by pixel block size for 2bpp + widthBlocks = width / 8; + heightBlocks = height / 4; + break; + case PVR2TexturePixelFormat::PVRTC4BPP_RGBA: + if(!Configuration::getInstance()->supportsPVRTC()) + { + CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + _unpack = true; + _mipmaps[_numberOfMipmaps].len = width*height*4; + _mipmaps[_numberOfMipmaps].address = new unsigned char[width*height*4]; + PVRTDecompressPVRTC(_data+dataOffset,width,height,_mipmaps[_numberOfMipmaps].address, false); + bpp = 4; + } + blockSize = 4 * 4; // Pixel by pixel block size for 4bpp + widthBlocks = width / 4; + heightBlocks = height / 4; + break; + case PVR2TexturePixelFormat::BGRA8888: + if (Configuration::getInstance()->supportsBGRA8888() == false) + { + CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); + return false; + } + default: + blockSize = 1; + widthBlocks = width; + heightBlocks = height; + break; } - + // Clamp to minimum number of blocks if (widthBlocks < 2) { @@ -1317,22 +1397,31 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) { heightBlocks = 2; } - - dataSize = widthBlocks * heightBlocks * ((blockSize * it->second.bpp) / 8); + + dataSize = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); int packetLength = (dataLength - dataOffset); packetLength = packetLength > dataSize ? dataSize : packetLength; - + //Make record to the mipmaps array and increment counter - _mipmaps[_numberOfMipmaps].address = _data + dataOffset; - _mipmaps[_numberOfMipmaps].len = packetLength; + if(!_unpack) + { + _mipmaps[_numberOfMipmaps].address = _data + dataOffset; + _mipmaps[_numberOfMipmaps].len = packetLength; + } _numberOfMipmaps++; - + dataOffset += packetLength; - + //Update width and height to the next lower power of two width = MAX(width >> 1, 1); height = MAX(height >> 1, 1); } + + if(_unpack) + { + _data = _mipmaps[0].address; + _dataLen = _mipmaps[0].len; + } return true; } @@ -1371,7 +1460,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) return false; } - auto it = Texture2D::getPixelFormatInfoMap().find(v3_pixel_formathash.at(pixelFormat)); + auto it = Texture2D::getPixelFormatInfoMap().find(getDevicePixelFormat(v3_pixel_formathash.at(pixelFormat))); if (it == Texture2D::getPixelFormatInfoMap().end()) { @@ -1381,6 +1470,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) } _renderFormat = it->first; + int bpp = it->second.bpp; // flags int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); @@ -1410,29 +1500,65 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) { switch ((PVR3TexturePixelFormat)pixelFormat) { - case PVR3TexturePixelFormat::PVRTC2BPP_RGB : - case PVR3TexturePixelFormat::PVRTC2BPP_RGBA : - blockSize = 8 * 4; // Pixel by pixel block size for 2bpp - widthBlocks = width / 8; - heightBlocks = height / 4; - break; - case PVR3TexturePixelFormat::PVRTC4BPP_RGB : - case PVR3TexturePixelFormat::PVRTC4BPP_RGBA : - blockSize = 4 * 4; // Pixel by pixel block size for 4bpp - widthBlocks = width / 4; - heightBlocks = height / 4; - break; - case PVR3TexturePixelFormat::BGRA8888: - if( ! Configuration::getInstance()->supportsBGRA8888()) + case PVR3TexturePixelFormat::PVRTC2BPP_RGB : + case PVR3TexturePixelFormat::PVRTC2BPP_RGBA : + if(!Configuration::getInstance()->supportsPVRTC()) { - CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); - return false; - } - default: - blockSize = 1; - widthBlocks = width; - heightBlocks = height; - break; + CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + _unpack = true; + _mipmaps[i].len = width*height*4; + _mipmaps[i].address = new unsigned char[width*height*4]; + PVRTDecompressPVRTC(_data+dataOffset,width,height,_mipmaps[i].address, true); + bpp = 2; + } + blockSize = 8 * 4; // Pixel by pixel block size for 2bpp + widthBlocks = width / 8; + heightBlocks = height / 4; + break; + case PVR3TexturePixelFormat::PVRTC4BPP_RGB : + case PVR3TexturePixelFormat::PVRTC4BPP_RGBA : + if(!Configuration::getInstance()->supportsPVRTC()) + { + CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + _unpack = true; + _mipmaps[i].len = width*height*4; + _mipmaps[i].address = new unsigned char[width*height*4]; + PVRTDecompressPVRTC(_data+dataOffset,width,height,_mipmaps[i].address, false); + bpp = 4; + } + blockSize = 4 * 4; // Pixel by pixel block size for 4bpp + widthBlocks = width / 4; + heightBlocks = height / 4; + break; + case PVR3TexturePixelFormat::ETC1: + if(!Configuration::getInstance()->supportsETC()) + { + CCLOG("cocos2d: Hardware ETC1 decoder not present. Using software decoder"); + int bytePerPixel = 3; + unsigned int stride = width * bytePerPixel; + _unpack = true; + _mipmaps[i].len = width*height*bytePerPixel; + _mipmaps[i].address = new unsigned char[width*height*bytePerPixel]; + if (etc1_decode_image(static_cast(_data+dataOffset), static_cast(_mipmaps[i].address), width, height, bytePerPixel, stride) != 0) + { + return false; + } + } + blockSize = 4 * 4; // Pixel by pixel block size for 4bpp + widthBlocks = width / 4; + heightBlocks = height / 4; + break; + case PVR3TexturePixelFormat::BGRA8888: + if( ! Configuration::getInstance()->supportsBGRA8888()) + { + CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); + return false; + } + default: + blockSize = 1; + widthBlocks = width; + heightBlocks = height; + break; } // Clamp to minimum number of blocks @@ -1445,12 +1571,15 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) heightBlocks = 2; } - dataSize = widthBlocks * heightBlocks * ((blockSize * it->second.bpp) / 8); + dataSize = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); auto packetLength = _dataLen - dataOffset; packetLength = packetLength > dataSize ? dataSize : packetLength; - _mipmaps[i].address = _data + dataOffset; - _mipmaps[i].len = static_cast(packetLength); + if(!_unpack) + { + _mipmaps[i].address = _data + dataOffset; + _mipmaps[i].len = static_cast(packetLength); + } dataOffset += packetLength; CCAssert(dataOffset <= _dataLen, "CCTexurePVR: Invalid lenght"); @@ -1459,6 +1588,12 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) width = MAX(width >> 1, 1); height = MAX(height >> 1, 1); } + + if(_unpack) + { + _data = _mipmaps[0].address; + _dataLen = _mipmaps[0].len; + } return true; } diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index 5c37da9436..9cb49f63d1 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -51,6 +51,7 @@ typedef struct _MipmapInfo { unsigned char* address; int len; + _MipmapInfo():address(NULL),len(0){} }MipmapInfo; class CC_DLL Image : public Ref @@ -167,6 +168,7 @@ protected: ssize_t _dataLen; int _width; int _height; + bool _unpack; Format _fileType; Texture2D::PixelFormat _renderFormat; bool _preMulti; diff --git a/cocos/platform/mac/CCDevice.mm b/cocos/platform/mac/CCDevice.mm index 34c6f8b9ca..e1f3ec3e5c 100644 --- a/cocos/platform/mac/CCDevice.mm +++ b/cocos/platform/mac/CCDevice.mm @@ -128,7 +128,7 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch if ([@"!?.,-= " rangeOfString:character].location != NSNotFound) { lastBreakLocation = i + insertCount; } - textSize = [lineBreak sizeWithAttributes:tokenAttributesDict]; + //textSize = [lineBreak sizeWithAttributes:tokenAttributesDict]; if(textSize.height > info->height) break; if (textSize.width > info->width) { diff --git a/cocos/platform/win32/CCGL.h b/cocos/platform/win32/CCGL.h index 4ec822b630..2ed38288bc 100644 --- a/cocos/platform/win32/CCGL.h +++ b/cocos/platform/win32/CCGL.h @@ -33,12 +33,6 @@ THE SOFTWARE. #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8 -// These macros are only for making TexturePVR.cpp complied without errors since they are not included in GLEW. -#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 - #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #endif // __CCGL_H__ diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index e41a610dd5..d120aa3112 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -79,7 +79,7 @@ namespace { #endif #ifdef GL_ETC1_RGB8_OES - PixelFormatInfoMapValue(Texture2D::PixelFormat::ETC, Texture2D::PixelFormatInfo(GL_ETC1_RGB8_OES, 0xFFFFFFFF, 0xFFFFFFFF, 24, true, false)), + PixelFormatInfoMapValue(Texture2D::PixelFormat::ETC, Texture2D::PixelFormatInfo(GL_ETC1_RGB8_OES, 0xFFFFFFFF, 0xFFFFFFFF, 4, true, false)), #endif #ifdef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT diff --git a/cocos/scripting/lua-bindings/auto/api/Layout.lua b/cocos/scripting/lua-bindings/auto/api/Layout.lua index a16923e4dc..fc0c574ce7 100644 --- a/cocos/scripting/lua-bindings/auto/api/Layout.lua +++ b/cocos/scripting/lua-bindings/auto/api/Layout.lua @@ -141,6 +141,10 @@ -- @param self -- @return size_table#size_table ret (return value: size_table) +-------------------------------- +-- @function [parent=#Layout] forceDoLayout +-- @param self + -------------------------------- -- @function [parent=#Layout] getLayoutType -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/Node.lua b/cocos/scripting/lua-bindings/auto/api/Node.lua index 33f956653b..f07a3b0682 100644 --- a/cocos/scripting/lua-bindings/auto/api/Node.lua +++ b/cocos/scripting/lua-bindings/auto/api/Node.lua @@ -16,11 +16,13 @@ -- @param #string str -------------------------------- --- @function [parent=#Node] removeComponent +-- @overload self, cc.Component +-- @overload self, string +-- @function [parent=#Node] removeComponent -- @param self -- @param #string str --- @return bool#bool ret (return value: bool) - +-- @return bool#bool ret (retunr value: bool) + -------------------------------- -- @function [parent=#Node] setPhysicsBody -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index a77738e434..17c00abb38 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -3714,38 +3714,46 @@ int lua_cocos2dx_Node_removeComponent(lua_State* tolua_S) int argc = 0; cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); - #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_removeComponent'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; + do{ + if (argc == 1) { + cocos2d::Component* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Component",&arg0); - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - if(!ok) - return 0; - bool ret = cobj->removeComponent(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } + if (!ok) { break; } + bool ret = cobj->removeComponent(arg0); + tolua_pushboolean(tolua_S,(bool)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; } + bool ret = cobj->removeComponent(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "removeComponent",argc, 1); return 0; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 0b309b14cd..d604eeb923 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -4513,6 +4513,49 @@ int lua_cocos2dx_ui_Layout_getBackGroundImageTextureSize(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Layout_forceDoLayout(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Layout* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Layout",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Layout*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Layout_forceDoLayout'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->forceDoLayout(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "forceDoLayout",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Layout_forceDoLayout'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Layout_getLayoutType(lua_State* tolua_S) { int argc = 0; @@ -4875,6 +4918,7 @@ int lua_register_cocos2dx_ui_Layout(lua_State* tolua_S) tolua_function(tolua_S,"isPassFocusToChild",lua_cocos2dx_ui_Layout_isPassFocusToChild); tolua_function(tolua_S,"setBackGroundImageCapInsets",lua_cocos2dx_ui_Layout_setBackGroundImageCapInsets); tolua_function(tolua_S,"getBackGroundImageTextureSize",lua_cocos2dx_ui_Layout_getBackGroundImageTextureSize); + tolua_function(tolua_S,"forceDoLayout",lua_cocos2dx_ui_Layout_forceDoLayout); tolua_function(tolua_S,"getLayoutType",lua_cocos2dx_ui_Layout_getLayoutType); tolua_function(tolua_S,"setPassFocusToChild",lua_cocos2dx_ui_Layout_setPassFocusToChild); tolua_function(tolua_S,"getBackGroundStartColor",lua_cocos2dx_ui_Layout_getBackGroundStartColor); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index a894093755..97b5ec8651 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -396,6 +396,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + #endif // __cocos2dx_ui_h__ diff --git a/cocos/ui/CCProtectedNode.h b/cocos/ui/CCProtectedNode.h index bd54dce028..f8ad28f42c 100644 --- a/cocos/ui/CCProtectedNode.h +++ b/cocos/ui/CCProtectedNode.h @@ -31,10 +31,11 @@ #include "2d/CCNode.h" +#include "ui/GUIExport.h" NS_CC_BEGIN - -class ProtectedNode : public Node + +class CC_GUI_DLL ProtectedNode : public Node { public: static ProtectedNode * create(void); diff --git a/cocos/ui/CocosGUI.h b/cocos/ui/CocosGUI.h index 5a6c1810bb..9f72d0eb32 100644 --- a/cocos/ui/CocosGUI.h +++ b/cocos/ui/CocosGUI.h @@ -49,12 +49,13 @@ THE SOFTWARE. #include "ui/UIVideoPlayer.h" #endif #include "ui/UIDeprecated.h" +#include "ui/GUIExport.h" NS_CC_BEGIN namespace ui { -const char* CocosGUIVersion(); +CC_GUI_DLL const char* CocosGUIVersion(); } NS_CC_END diff --git a/cocos/ui/GUIExport.h b/cocos/ui/GUIExport.h new file mode 100644 index 0000000000..aec8809e0f --- /dev/null +++ b/cocos/ui/GUIExport.h @@ -0,0 +1,28 @@ +#ifndef __CCLIBGUI_H__ +#define __CCLIBGUI_H__ + +#if defined(WIN32) && defined(_WINDOWS) + #ifdef __MINGW32__ + #include + #endif + + #if defined(_USEGUIDLL) + #define CC_GUI_DLL __declspec(dllexport) + #else /* use a DLL library */ + #define CC_GUI_DLL __declspec(dllimport) + #endif + + + /* Define NULL pointer value */ + #ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif + #endif +#else + #define CC_GUI_DLL +#endif + +#endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/cocos/ui/UIButton.h b/cocos/ui/UIButton.h index 0510717c56..07a8e0de4b 100644 --- a/cocos/ui/UIButton.h +++ b/cocos/ui/UIButton.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UIBUTTON_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -37,7 +38,7 @@ namespace ui{ * @js NA * @lua NA */ -class Button : public Widget +class CC_GUI_DLL Button : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UICheckBox.h b/cocos/ui/UICheckBox.h index db7900fcbf..c90ab7b235 100644 --- a/cocos/ui/UICheckBox.h +++ b/cocos/ui/UICheckBox.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UICHECKBOX_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -46,7 +47,7 @@ typedef void (Ref::*SEL_SelectedStateEvent)(Ref*,CheckBoxEventType); * @js NA * @lua NA */ -class CheckBox : public Widget +class CC_GUI_DLL CheckBox : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UIHBox.h b/cocos/ui/UIHBox.h index 1b6cf95ae9..872fe90664 100644 --- a/cocos/ui/UIHBox.h +++ b/cocos/ui/UIHBox.h @@ -26,12 +26,13 @@ #define __UIHBox_H__ #include "ui/UILayout.h" +#include "ui/GUIExport.h" NS_CC_BEGIN namespace ui { -class HBox : public Layout{ +class CC_GUI_DLL HBox : public Layout{ public: diff --git a/cocos/ui/UIHelper.h b/cocos/ui/UIHelper.h index 68fa8dbfb9..edef683da6 100644 --- a/cocos/ui/UIHelper.h +++ b/cocos/ui/UIHelper.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include #include "base/CCPlatformMacros.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -38,7 +39,7 @@ namespace ui { * @js NA * @lua NA */ -class Helper +class CC_GUI_DLL Helper { public: /** diff --git a/cocos/ui/UIImageView.h b/cocos/ui/UIImageView.h index ada869b34a..d0c4f06560 100644 --- a/cocos/ui/UIImageView.h +++ b/cocos/ui/UIImageView.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UIIMAGEVIEW_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -35,7 +36,7 @@ namespace ui { * @js NA * @lua NA */ -class ImageView : public Widget +class CC_GUI_DLL ImageView : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 620a310bbb..30900fe515 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -948,6 +948,12 @@ Layout::Type Layout::getLayoutType() const { return _layoutType; } + +void Layout::forceDoLayout() +{ + this->requestDoLayout(); + this->doLayout(); +} void Layout::requestDoLayout() { diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index e43df22522..96cf7ba137 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __LAYOUT_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" #include "renderer/CCCustomCommand.h" #include "renderer/CCGroupCommand.h" @@ -40,7 +41,7 @@ namespace ui { class LayoutManager; -class LayoutProtocol +class CC_GUI_DLL LayoutProtocol { public: LayoutProtocol(){} @@ -62,7 +63,7 @@ public: #endif #endif -class Layout : public Widget, public LayoutProtocol +class CC_GUI_DLL Layout : public Widget, public LayoutProtocol { DECLARE_CLASS_GUI_INFO @@ -265,7 +266,14 @@ public: */ virtual void removeAllChildrenWithCleanup(bool cleanup) override; + /** + * force refresh widget layout + */ + void forceDoLayout(); + /** + * request to refresh widget layout + */ void requestDoLayout(); virtual void onEnter() override; diff --git a/cocos/ui/UILayoutManager.h b/cocos/ui/UILayoutManager.h index 5f82b3c39b..cbeefa5589 100644 --- a/cocos/ui/UILayoutManager.h +++ b/cocos/ui/UILayoutManager.h @@ -27,6 +27,7 @@ #include "base/CCRef.h" #include "base/CCVector.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -36,7 +37,7 @@ class LayoutProtocol; class Widget; class RelativeLayoutParameter; -class LayoutManager : public Ref +class CC_GUI_DLL LayoutManager : public Ref { public: virtual ~LayoutManager(){}; @@ -47,7 +48,7 @@ public: friend class Layout; }; -class LinearVerticalLayoutManager : public LayoutManager +class CC_GUI_DLL LinearVerticalLayoutManager : public LayoutManager { private: LinearVerticalLayoutManager(){}; @@ -58,7 +59,7 @@ private: friend class Layout; }; -class LinearHorizontalLayoutManager : public LayoutManager +class CC_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager { private: LinearHorizontalLayoutManager(){}; @@ -69,7 +70,7 @@ private: friend class Layout; }; -class RelativeLayoutManager : public LayoutManager +class CC_GUI_DLL RelativeLayoutManager : public LayoutManager { private: RelativeLayoutManager() diff --git a/cocos/ui/UILayoutParameter.h b/cocos/ui/UILayoutParameter.h index 4681c82d3b..4862e91e68 100644 --- a/cocos/ui/UILayoutParameter.h +++ b/cocos/ui/UILayoutParameter.h @@ -27,7 +27,7 @@ #include #include "base/CCRef.h" - +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -37,7 +37,7 @@ namespace ui { * @js NA * @lua NA */ -class Margin +class CC_GUI_DLL Margin { public: float left; @@ -69,7 +69,7 @@ public: #endif #endif -class LayoutParameter : public Ref +class CC_GUI_DLL LayoutParameter : public Ref { public: enum class Type @@ -146,7 +146,7 @@ public: * @js NA * @lua NA */ -class LinearLayoutParameter : public LayoutParameter +class CC_GUI_DLL LinearLayoutParameter : public LayoutParameter { public: enum class LinearGravity @@ -209,7 +209,7 @@ protected: */ -class RelativeLayoutParameter : public LayoutParameter +class CC_GUI_DLL RelativeLayoutParameter : public LayoutParameter { public: enum class RelativeAlign diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index 53737812a6..65856ff1f7 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -27,6 +27,7 @@ THE SOFTWARE. #define __UILISTVIEW_H__ #include "ui/UIScrollView.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -41,7 +42,7 @@ typedef enum typedef void (Ref::*SEL_ListViewEvent)(Ref*,ListViewEventType); #define listvieweventselector(_SELECTOR) (SEL_ListViewEvent)(&_SELECTOR) -class ListView : public ScrollView +class CC_GUI_DLL ListView : public ScrollView { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UILoadingBar.h b/cocos/ui/UILoadingBar.h index 6fe4910130..bfc4137eaa 100644 --- a/cocos/ui/UILoadingBar.h +++ b/cocos/ui/UILoadingBar.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UILOADINGBAR_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -35,7 +36,7 @@ namespace ui { * @js NA * @lua NA */ -class LoadingBar : public Widget +class CC_GUI_DLL LoadingBar : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 52df2509ef..96d01c98df 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UIPAGEVIEW_H__ #include "ui/UILayout.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -39,7 +40,7 @@ typedef enum typedef void (Ref::*SEL_PageViewEvent)(Ref*, PageViewEventType); #define pagevieweventselector(_SELECTOR)(SEL_PageViewEvent)(&_SELECTOR) -class PageView : public Layout +class CC_GUI_DLL PageView : public Layout { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UIRelativeBox.h b/cocos/ui/UIRelativeBox.h index b4e7082b6d..ffef51b215 100644 --- a/cocos/ui/UIRelativeBox.h +++ b/cocos/ui/UIRelativeBox.h @@ -26,12 +26,13 @@ #define __UIRelativeBox_H__ #include "ui/UILayout.h" +#include "ui/GUIExport.h" NS_CC_BEGIN namespace ui { -class RelativeBox : public Layout{ +class CC_GUI_DLL RelativeBox : public Layout{ public: diff --git a/cocos/ui/UIRichText.h b/cocos/ui/UIRichText.h index cab8927b5c..aa0ad7c410 100644 --- a/cocos/ui/UIRichText.h +++ b/cocos/ui/UIRichText.h @@ -26,12 +26,13 @@ #define __UIRICHTEXT_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN namespace ui { -class RichElement : public Ref +class CC_GUI_DLL RichElement : public Ref { public: enum class Type @@ -51,7 +52,7 @@ protected: friend class RichText; }; -class RichElementText : public RichElement +class CC_GUI_DLL RichElementText : public RichElement { public: RichElementText(){_type = Type::TEXT;}; @@ -66,7 +67,7 @@ protected: }; -class RichElementImage : public RichElement +class CC_GUI_DLL RichElementImage : public RichElement { public: RichElementImage(){_type = Type::IMAGE;}; @@ -80,7 +81,7 @@ protected: friend class RichText; }; -class RichElementCustomNode : public RichElement +class CC_GUI_DLL RichElementCustomNode : public RichElement { public: RichElementCustomNode(){_type = Type::CUSTOM;}; @@ -92,7 +93,7 @@ protected: friend class RichText; }; -class RichText : public Widget +class CC_GUI_DLL RichText : public Widget { public: RichText(); diff --git a/cocos/ui/UIScrollView.h b/cocos/ui/UIScrollView.h index ae2bd6ab43..cc0dd25d45 100644 --- a/cocos/ui/UIScrollView.h +++ b/cocos/ui/UIScrollView.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UISCROLLVIEW_H__ #include "ui/UILayout.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -50,7 +51,7 @@ typedef void (Ref::*SEL_ScrollViewEvent)(Ref*, ScrollviewEventType); #define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR) -class ScrollView : public Layout +class CC_GUI_DLL ScrollView : public Layout { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index de8ed765b2..8212dd9026 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UISLIDER_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*,SliderEventType); * @js NA * @lua NA */ -class Slider : public Widget +class CC_GUI_DLL Slider : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 3c38101abd..7012694260 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UILABEL_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -38,7 +39,7 @@ namespace ui { *@js *@lua NA */ -class Text : public Widget +class CC_GUI_DLL Text : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UITextAtlas.h b/cocos/ui/UITextAtlas.h index 8058aa4d7d..cf00db4cfe 100644 --- a/cocos/ui/UITextAtlas.h +++ b/cocos/ui/UITextAtlas.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UILABELATLAS_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -37,7 +38,7 @@ namespace ui { * @js NA * @lua NA */ -class TextAtlas : public Widget +class CC_GUI_DLL TextAtlas : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UITextBMFont.h b/cocos/ui/UITextBMFont.h index 707f42382c..5d3c7955fb 100644 --- a/cocos/ui/UITextBMFont.h +++ b/cocos/ui/UITextBMFont.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UILABELBMFONT_H__ #include "ui/UIWidget.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -37,7 +38,7 @@ namespace ui { * @js NA * @lua NA */ -class TextBMFont : public Widget +class CC_GUI_DLL TextBMFont : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UITextField.h b/cocos/ui/UITextField.h index b26456fd33..eaea50d952 100644 --- a/cocos/ui/UITextField.h +++ b/cocos/ui/UITextField.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "ui/UIWidget.h" #include "2d/CCTextFieldTTF.h" +#include "ui/GUIExport.h" NS_CC_BEGIN @@ -36,7 +37,7 @@ namespace ui { * @js NA * @lua NA */ -class UICCTextField: public TextFieldTTF, public TextFieldDelegate +class CC_GUI_DLL UICCTextField: public TextFieldTTF, public TextFieldDelegate { public: UICCTextField(); @@ -106,7 +107,7 @@ typedef void (Ref::*SEL_TextFieldEvent)(Ref*, TextFiledEventType); * @js NA * @lua NA */ -class TextField : public Widget +class CC_GUI_DLL TextField : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/cocos/ui/UIVBox.h b/cocos/ui/UIVBox.h index 216234f47f..dae3bf149b 100644 --- a/cocos/ui/UIVBox.h +++ b/cocos/ui/UIVBox.h @@ -26,12 +26,13 @@ #define __UIVBox_H__ #include "ui/UILayout.h" +#include "ui/GUIExport.h" NS_CC_BEGIN namespace ui { -class VBox : public Layout{ +class CC_GUI_DLL VBox : public Layout{ public: diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 8ea40cc9d5..a06aaad5b8 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "ui/CCProtectedNode.h" #include "ui/UILayoutParameter.h" #include "ui/GUIDefine.h" +#include "ui/GUIExport.h" #include "base/CCMap.h" NS_CC_BEGIN @@ -61,7 +62,7 @@ typedef void (Ref::*SEL_TouchEvent)(Ref*,TouchEventType); #endif -class Widget : public ProtectedNode, public LayoutParameterProtocol +class CC_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol { public: enum class FocusDirection diff --git a/cocos/ui/proj.win32/libGUI.vcxproj b/cocos/ui/proj.win32/libGUI.vcxproj index 2483ce7005..1701d425e3 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj +++ b/cocos/ui/proj.win32/libGUI.vcxproj @@ -13,6 +13,7 @@ + @@ -68,7 +69,7 @@ - StaticLibrary + DynamicLibrary true v100 v110 @@ -78,7 +79,7 @@ Unicode - StaticLibrary + DynamicLibrary false v100 v110 @@ -115,7 +116,7 @@ $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USEGUIDLL;%(PreprocessorDefinitions) true 4267;4251;4244;%(DisableSpecificWarnings) false @@ -123,6 +124,8 @@ true + $(OutDir);%(AdditionalLibraryDirectories) + libcocos2d.lib;opengl32.lib;glew32.lib;libExtensions.lib;%(AdditionalDependencies) @@ -133,7 +136,7 @@ true - WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USEGUIDLL;%(PreprocessorDefinitions) $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) None false @@ -142,6 +145,8 @@ true true true + $(OutDir);%(AdditionalLibraryDirectories) + libcocos2d.lib;opengl32.lib;glew32.lib;libExtensions.lib;%(AdditionalDependencies) diff --git a/cocos/ui/proj.win32/libGUI.vcxproj.filters b/cocos/ui/proj.win32/libGUI.vcxproj.filters index 66f11c6cdd..52a45d5fe0 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj.filters +++ b/cocos/ui/proj.win32/libGUI.vcxproj.filters @@ -90,6 +90,9 @@ System + + System + diff --git a/extensions/ExtensionExport.h b/extensions/ExtensionExport.h new file mode 100644 index 0000000000..da01ffc98e --- /dev/null +++ b/extensions/ExtensionExport.h @@ -0,0 +1,28 @@ +#ifndef __CCEXTENSIONEXPORT_H__ +#define __CCEXTENSIONEXPORT_H__ + +#if defined(WIN32) && defined(_WINDOWS) + #ifdef __MINGW32__ + #include + #endif + + #if defined(_USREXDLL) + #define CC_EX_DLL __declspec(dllexport) + #else /* use a DLL library */ + #define CC_EX_DLL __declspec(dllimport) + #endif + + + /* Define NULL pointer value */ + #ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif + #endif +#else + #define CC_EX_DLL +#endif + +#endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/GUI/CCControlExtension/CCControl.h b/extensions/GUI/CCControlExtension/CCControl.h index cf6efa865d..1f7192a170 100644 --- a/extensions/GUI/CCControlExtension/CCControl.h +++ b/extensions/GUI/CCControlExtension/CCControl.h @@ -32,6 +32,7 @@ #include "CCControlUtils.h" #include "2d/CCLayer.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -61,11 +62,11 @@ class Invocation; * * To use the Control you have to subclass it. */ -class Control : public Layer +class CC_EX_DLL Control : public Layer { public: /** Kinds of possible events for the control objects. */ - enum class EventType + enum class CC_EX_DLL EventType { TOUCH_DOWN = 1 << 0, // A touch-down event in the control. DRAG_INSIDE = 1 << 1, // An event where a finger is dragged inside the bounds of the control. @@ -266,7 +267,7 @@ private: CC_DISALLOW_COPY_AND_ASSIGN(Control); }; -Control::EventType operator|(Control::EventType a, Control::EventType b); +CC_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); // end of GUI group /// @} diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index cd73e63c5a..f7484e2172 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -34,6 +34,7 @@ #include "CCInvocation.h" #include "CCScale9Sprite.h" #include "base/CCMap.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -51,7 +52,7 @@ NS_CC_EXT_BEGIN */ /** @class ControlButton Button control for Cocos2D. */ -class ControlButton : public Control +class CC_EX_DLL ControlButton : public Control { public: static ControlButton* create(); diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/extensions/GUI/CCControlExtension/CCControlColourPicker.h index 2cb09328c7..df282adda8 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -37,6 +37,7 @@ #include "CCControlUtils.h" #include "CCControlHuePicker.h" #include "CCControlSaturationBrightnessPicker.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -47,7 +48,7 @@ NS_CC_EXT_BEGIN * @{ */ -class ControlColourPicker: public Control +class CC_EX_DLL ControlColourPicker: public Control { public: static ControlColourPicker* create(); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.h b/extensions/GUI/CCControlExtension/CCControlHuePicker.h index 9f007a2092..06e6371efd 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.h @@ -35,6 +35,7 @@ #include "CCControl.h" #include "CCInvocation.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -45,7 +46,7 @@ NS_CC_EXT_BEGIN * @{ */ -class ControlHuePicker : public Control +class CC_EX_DLL ControlHuePicker : public Control { public: static ControlHuePicker* create(Node* target, Vec2 pos); diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index fc8156a8b8..c70ec15e06 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h @@ -29,6 +29,7 @@ #include "CCControl.h" #include "2d/CCProgressTimer.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -40,7 +41,7 @@ NS_CC_EXT_BEGIN */ /** @class ControlPotentiometer Potentiometer control for Cocos2D. */ -class ControlPotentiometer : public Control +class CC_EX_DLL ControlPotentiometer : public Control { public: /** diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index 0ae9cbeaa1..cff046281d 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -35,6 +35,7 @@ #include "CCControl.h" #include "CCInvocation.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -45,7 +46,7 @@ NS_CC_EXT_BEGIN * @{ */ -class ControlSaturationBrightnessPicker : public Control +class CC_EX_DLL ControlSaturationBrightnessPicker : public Control { /** Contains the receiver's current saturation value. */ CC_SYNTHESIZE_READONLY(float, _saturation, Saturation); diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index eeca322c25..03bb5d9543 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -32,6 +32,7 @@ #include "CCControl.h" #include "CCInvocation.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -42,7 +43,7 @@ NS_CC_EXT_BEGIN * @{ */ -class ControlSlider: public Control +class CC_EX_DLL ControlSlider: public Control { public: /** diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.h b/extensions/GUI/CCControlExtension/CCControlStepper.h index 1b45a497f6..ae9bdaa22d 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -30,6 +30,7 @@ #include "CCControl.h" #include "2d/CCLabel.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -40,7 +41,7 @@ NS_CC_EXT_BEGIN * @{ */ -class ControlStepper : public Control +class CC_EX_DLL ControlStepper : public Control { public: enum class Part diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.h b/extensions/GUI/CCControlExtension/CCControlSwitch.h index 6575937e13..98e67d77e2 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.h @@ -29,7 +29,7 @@ #define __CCCONTROLSWITCH_H__ #include "CCControl.h" - +#include "extensions/ExtensionExport.h" namespace cocos2d { class Sprite; } namespace cocos2d { class Label; } @@ -46,7 +46,7 @@ class ControlSwitchSprite; */ /** @class ControlSwitch Switch control for Cocos2D. */ -class ControlSwitch : public Control +class CC_EX_DLL ControlSwitch : public Control { public: /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 4df2a0f125..abc6abd894 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -36,6 +36,7 @@ #include "2d/CCSprite.h" #include "../../ExtensionMacros.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -62,7 +63,7 @@ typedef struct */ //helper class to store Color3B's in mutable arrays -class Color3bObject : public Ref +class CC_EX_DLL Color3bObject : public Ref { public: Color3B value; @@ -73,7 +74,7 @@ public: Color3bObject(Color3B s_value):value(s_value){} }; -class ControlUtils +class CC_EX_DLL ControlUtils { public: /** diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index e8a2a12b8d..015f582a23 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.h +++ b/extensions/GUI/CCControlExtension/CCInvocation.h @@ -32,6 +32,7 @@ #include "base/CCRef.h" #include "../../ExtensionMacros.h" +#include "extensions/ExtensionExport.h" #include "CCControl.h" NS_CC_EXT_BEGIN @@ -45,7 +46,7 @@ NS_CC_EXT_BEGIN #define cccontrol_selector(_SELECTOR) static_cast(&_SELECTOR) -class Invocation : public Ref +class CC_EX_DLL Invocation : public Ref { public: /** diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index 8d55e46003..099b1f128b 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -131,8 +131,6 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& o return false; } - _scale9Image->removeAllChildrenWithCleanup(true); - _capInsets = capInsets; _spriteFrameRotated = rotated; @@ -238,48 +236,48 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& o // Centre _centre = Sprite::createWithTexture(_scale9Image->getTexture(), centerbounds); _centre->retain(); - this->addChild(_centre, 0); + this->addChild(_centre); // Top _top = Sprite::createWithTexture(_scale9Image->getTexture(), centertopbounds); _top->retain(); - this->addChild(_top, 1); + this->addChild(_top); // Bottom _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), centerbottombounds); _bottom->retain(); - this->addChild(_bottom, 1); + this->addChild(_bottom); // Left _left = Sprite::createWithTexture(_scale9Image->getTexture(), leftcenterbounds); _left->retain(); - this->addChild(_left, 1); + this->addChild(_left); // Right _right = Sprite::createWithTexture(_scale9Image->getTexture(), rightcenterbounds); _right->retain(); - this->addChild(_right, 1); + this->addChild(_right); // Top left _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), lefttopbounds); _topLeft->retain(); - this->addChild(_topLeft, 2); + this->addChild(_topLeft); // Top right _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), righttopbounds); _topRight->retain(); - this->addChild(_topRight, 2); + this->addChild(_topRight); // Bottom left _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), leftbottombounds); _bottomLeft->retain(); - this->addChild(_bottomLeft, 2); + this->addChild(_bottomLeft); // Bottom right _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rightbottombounds); _bottomRight->retain(); - this->addChild(_bottomRight, 2); + this->addChild(_bottomRight); } else { // set up transformation of coordinates // to handle the case where the sprite is stored rotated @@ -329,46 +327,46 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& o // Top _top = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcentertopbounds, true); _top->retain(); - this->addChild(_top, 1); + this->addChild(_top); // Bottom _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbottombounds, true); _bottom->retain(); - this->addChild(_bottom, 1); + this->addChild(_bottom); // Left _left = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftcenterbounds, true); _left->retain(); - this->addChild(_left, 1); + this->addChild(_left); // Right _right = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightcenterbounds, true); _right->retain(); - this->addChild(_right, 1); + this->addChild(_right); // Top left _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedlefttopbounds, true); _topLeft->retain(); - this->addChild(_topLeft, 2); + this->addChild(_topLeft); // Top right _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrighttopbounds, true); _topRight->retain(); - this->addChild(_topRight, 2); + this->addChild(_topRight); // Bottom left _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftbottombounds, true); _bottomLeft->retain(); - this->addChild(_bottomLeft, 2); + this->addChild(_bottomLeft); // Bottom right _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightbottombounds, true); _bottomRight->retain(); - this->addChild(_bottomRight, 2); + this->addChild(_bottomRight); } this->setContentSize(rect.size); - this->addChild(_scale9Image); +// this->addChild(_scale9Image); if (_spritesGenerated) { diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h index dc3c6b8696..fc1dea95ba 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "2d/CCSpriteFrame.h" #include "2d/CCSpriteBatchNode.h" - +#include "extensions/ExtensionExport.h" #include "../../ExtensionMacros.h" NS_CC_EXT_BEGIN @@ -53,7 +53,7 @@ NS_CC_EXT_BEGIN * * @see http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCScale9Sprite.html */ -class Scale9Sprite : public Node +class CC_EX_DLL Scale9Sprite : public Node { public: /** diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index f6a12dbf46..9203cbfaac 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -29,6 +29,7 @@ #include "base/CCIMEDelegate.h" #include "extensions/ExtensionMacros.h" #include "../CCControlExtension/CCControlExtensions.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -36,7 +37,7 @@ class EditBox; class EditBoxImpl; -class EditBoxDelegate +class CC_EX_DLL EditBoxDelegate { public: /** @@ -88,7 +89,7 @@ public: * */ -class EditBox +class CC_EX_DLL EditBox : public ControlButton , public IMEDelegate { diff --git a/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/extensions/GUI/CCEditBox/CCEditBoxImpl.h index 44118c1c0b..79d3d8f3fa 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImpl.h @@ -28,11 +28,12 @@ #include "extensions/ExtensionMacros.h" #include "CCEditBox.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN -class EditBoxImpl +class CC_EX_DLL EditBoxImpl { public: /** @@ -62,7 +63,7 @@ public: virtual void setPlaceHolder(const char* pText) = 0; virtual void doAnimationWhenKeyboardMove(float duration, float distance) = 0; - virtual void openKeyboard() = 0; + virtual void openKeyboard() = 0; virtual void closeKeyboard() = 0; virtual void setPosition(const Vec2& pos) = 0; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index a5b93c4f58..34085e8278 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -39,6 +39,8 @@ @interface CCEditBoxImplMac : NSObject { + NSTextField* textField_; + NSSecureTextField* secureTextField_; void* editBox_; BOOL editState_; NSMutableDictionary* placeholderAttributes_; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h index 7b29251644..4d04fb6cce 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h @@ -32,12 +32,13 @@ #include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN class EditBox; -class EditBoxImplWin : public EditBoxImpl +class CC_EX_DLL EditBoxImplWin : public EditBoxImpl { public: /** diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index 2f4c224418..b8df096ef1 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -30,6 +30,7 @@ #include "base/CCEventListenerTouch.h" #include "2d/CCActionTween.h" #include "extensions/ExtensionMacros.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN @@ -65,7 +66,7 @@ public: * ScrollView support for cocos2d-x. * It provides scroll view functionalities to cocos2d projects natively. */ -class ScrollView : public Layer, public ActionTweenDelegate +class CC_EX_DLL ScrollView : public Layer, public ActionTweenDelegate { public: enum class Direction diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index c4d89b33a9..018c653110 100644 --- a/extensions/GUI/CCScrollView/CCTableView.h +++ b/extensions/GUI/CCScrollView/CCTableView.h @@ -28,6 +28,7 @@ #include "CCScrollView.h" #include "CCTableViewCell.h" +#include "extensions/ExtensionExport.h" #include #include @@ -39,7 +40,7 @@ class TableView; /** * Sole purpose of this delegate is to single touch event in this version. */ -class TableViewDelegate : public ScrollViewDelegate +class CC_EX_DLL TableViewDelegate : public ScrollViewDelegate { public: /** @@ -90,7 +91,7 @@ public: /** * Data source that governs table backend data. */ -class TableViewDataSource +class CC_EX_DLL TableViewDataSource { public: /** @@ -139,7 +140,7 @@ public: * * This is a very basic, minimal implementation to bring UITableView-like component into cocos2d world. */ -class TableView : public ScrollView, public ScrollViewDelegate +class CC_EX_DLL TableView : public ScrollView, public ScrollViewDelegate { public: diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index 9d45d665d8..4bc594db66 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -28,13 +28,14 @@ #include "extensions/ExtensionMacros.h" #include "2d/CCNode.h" +#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN /** * Abstract class for SWTableView cell node */ -class TableViewCell: public Node +class CC_EX_DLL TableViewCell: public Node { public: CREATE_FUNC(TableViewCell); diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index 390f24bfaa..16c0f56400 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -25,6 +25,7 @@ #include "extensions/ExtensionMacros.h" #include "2d/CCDrawNode.h" +#include "extensions/ExtensionExport.h" struct cpSpace; @@ -40,7 +41,7 @@ NS_CC_EXT_BEGIN @since v2.1 */ -class PhysicsDebugNode : public DrawNode +class CC_EX_DLL PhysicsDebugNode : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index fa1f0489d0..33f48a20b0 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -25,6 +25,7 @@ #include "2d/CCSprite.h" #include "extensions/ExtensionMacros.h" +#include "extensions/ExtensionExport.h" struct cpBody; class b2Body; @@ -43,7 +44,7 @@ NS_CC_EXT_BEGIN - If you update the rotation or position manually, the physics body will be updated - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time */ -class PhysicsSprite : public Sprite +class CC_EX_DLL PhysicsSprite : public Sprite { public: diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index b3a911b84e..0e4d44ebe1 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -17,7 +17,7 @@ - StaticLibrary + DynamicLibrary Unicode v100 v110 @@ -26,7 +26,7 @@ v120_xp - StaticLibrary + DynamicLibrary Unicode v100 v110 @@ -69,7 +69,7 @@ Disabled $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\unzip;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\win32-specific\zlib\include;..\;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_DEBUG;_LIB;COCOS2D_DEBUG=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USREXDLL;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -80,13 +80,21 @@ 4267;4251;4244;%(DisableSpecificWarnings) true + + libcocos2d.lib + $(OutDir);%(AdditionalLibraryDirectories) + + + $(OutDir);%(AdditionalLibraryDirectories) + libcocos2d.lib;opengl32.lib;glew32.lib;libcurl_imp.lib;libchipmunk.lib;libBox2D.lib;glfw3.lib;%(AdditionalDependencies) + MinSpace true $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\unzip;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\win32-specific\zlib\include;..\;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;NDEBUG;_LIB;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;NDEBUG;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USREXDLL;%(PreprocessorDefinitions) MultiThreadedDLL true @@ -97,6 +105,10 @@ true false + + $(OutDir);%(AdditionalLibraryDirectories) + libcocos2d.lib;opengl32.lib;glew32.lib;libcurl_imp.lib;libchipmunk.lib;libBox2D.lib;glfw3.lib;%(AdditionalDependencies) + @@ -123,6 +135,7 @@ + diff --git a/extensions/proj.win32/libExtensions.vcxproj.filters b/extensions/proj.win32/libExtensions.vcxproj.filters index fe37d0def2..fcad0bd423 100644 --- a/extensions/proj.win32/libExtensions.vcxproj.filters +++ b/extensions/proj.win32/libExtensions.vcxproj.filters @@ -157,5 +157,6 @@ physics_nodes + \ No newline at end of file diff --git a/external/config.json b/external/config.json index 9b6c874d88..9448062a1d 100644 --- a/external/config.json +++ b/external/config.json @@ -1,5 +1,5 @@ { - "version":"v3-deps-6", + "version":"v3-deps-7", "zip_file_size":"67964573", "repo_name":"cocos2d-x-3rd-party-libs-bin", "repo_parent":"https://github.com/cocos2d/", diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index c484b98f55..637fb5bf6b 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -378,6 +378,8 @@ "cocos/base/etc1.cpp", "cocos/base/etc1.h", "cocos/base/firePngData.h", + "cocos/base/pvr.cpp", + "cocos/base/pvr.h", "cocos/base/s3tc.cpp", "cocos/base/s3tc.h", "cocos/base/uthash.h", @@ -538,6 +540,7 @@ "cocos/editor-support/cocostudio/CocoLoader.cpp", "cocos/editor-support/cocostudio/CocoLoader.h", "cocos/editor-support/cocostudio/CocoStudio.h", + "cocos/editor-support/cocostudio/CocosStudioExport.h", "cocos/editor-support/cocostudio/DictionaryHelper.cpp", "cocos/editor-support/cocostudio/DictionaryHelper.h", "cocos/editor-support/cocostudio/TriggerBase.cpp", @@ -990,6 +993,7 @@ "cocos/ui/CocosGUI.cpp", "cocos/ui/CocosGUI.h", "cocos/ui/GUIDefine.h", + "cocos/ui/GUIExport.h", "cocos/ui/UIButton.cpp", "cocos/ui/UIButton.h", "cocos/ui/UICheckBox.cpp", @@ -1051,6 +1055,7 @@ "download-deps.py", "extensions/Android.mk", "extensions/CMakeLists.txt", + "extensions/ExtensionExport.h", "extensions/ExtensionMacros.h", "extensions/GUI/CCControlExtension/CCControl.cpp", "extensions/GUI/CCControlExtension/CCControl.h", @@ -3552,6 +3557,9 @@ "plugin/tools/toolsForPublish/checkEnvironment.sh", "plugin/tools/toolsForPublish/genPrebuildMK.sh", "plugin/tools/toolsForPublish/publishPlugin.sh", + "tools/fbx-conv/README.md", + "tools/fbx-conv/mac/fbx-conv", + "tools/fbx-conv/mac/libfbxsdk.dylib", "tools/particle/convert_YCoordFlipped.py" ], "lua": [ diff --git a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj index 0bd4855f12..a4ebe80659 100644 --- a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj +++ b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj @@ -23,8 +23,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp Application @@ -32,8 +32,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp @@ -73,7 +73,7 @@ Disabled ..\Classes;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;CC_CONSTRUCTOR_ACCESS=public;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL diff --git a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp index 8f86aae1c7..cd64c3a8e3 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp @@ -46,7 +46,9 @@ static std::function createFunctions[] = { CL(S9_TexturePacker), CL(S9FrameNameSpriteSheetRotatedInsetsScaled), CL(S9FrameNameSpriteSheetRotatedSetCapInsetLater), - CL(S9CascadeOpacityAndColor) + CL(S9CascadeOpacityAndColor), + CL(S9ZOrder), + CL(S9Flip) }; static int sceneIdx=-1; @@ -679,3 +681,104 @@ std::string S9CascadeOpacityAndColor::subtitle() const { return "when parent change color/opacity, Scale9Sprite should also change"; } + +// +//// S9ZOrder +// + +void S9ZOrder::onEnter() +{ + S9SpriteTestDemo::onEnter(); + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + blocks_scaled_with_insets->setPosition(Vec2(x, y)); + this->addChild(blocks_scaled_with_insets); + + Sprite *normalSprite = Sprite::createWithSpriteFrameName("blocks9r.png"); + normalSprite->setColor(Color3B::RED); + blocks_scaled_with_insets->addChild(normalSprite); + + auto topLabel = Label::createWithSystemFont("I Must be On the Top", "Arial", 15); + topLabel->setPosition(Vec2(20,20)); + blocks_scaled_with_insets->addChild(topLabel); + + auto bottomLabel = Label::createWithSystemFont("I Must be On the Bottom", "Arial", 15); + bottomLabel->setPosition(Vec2(80,80)); + bottomLabel->setColor(Color3B::BLUE); + blocks_scaled_with_insets->addChild(bottomLabel,-1); + +} + +std::string S9ZOrder::title() const +{ + return "Scale9Sprite ZOrder issue"; +} + +std::string S9ZOrder::subtitle() const +{ + return "When adding nodes to Scale9Sprite, it should be added on top itself"; +} + +// +//// S9Flip +// + +void S9Flip::onEnter() +{ + S9SpriteTestDemo::onEnter(); + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + + auto normalSprite = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + normalSprite->setPosition(Vec2(x, y )); + this->addChild(normalSprite); + + + auto normalLabel = Label::createWithSystemFont("Normal Sprite","Airal",10); + normalLabel->setPosition(normalSprite->getPosition() + Vec2(0, normalSprite->getContentSize().height/2 + 10)); + this->addChild(normalLabel); + + + + auto flipXSprite = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + flipXSprite->setPosition(Vec2(x - 120, y )); + this->addChild(flipXSprite); + + flipXSprite->setScaleX(-1); + + auto flipXLabel = Label::createWithSystemFont("Sprite FlipX","Airal",10); + flipXLabel->setPosition(flipXSprite->getPosition() + Vec2(0, flipXSprite->getContentSize().height/2 + 10)); + this->addChild(flipXLabel); + + + auto flipYSprite = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + + flipYSprite->setPosition(Vec2(x + 120, y)); + this->addChild(flipYSprite); + + flipYSprite->setScaleY(-1); + + auto flipYLabel = Label::createWithSystemFont("Sprite FlipY","Airal",10); + flipYLabel->setPosition(flipYSprite->getPosition() + Vec2(0, flipYSprite->getContentSize().height/2 + 10)); + this->addChild(flipYLabel); + + +} + +std::string S9Flip::title() const +{ + return "Scale9Sprite Flip issue"; +} + +std::string S9Flip::subtitle() const +{ + return "When Flipped, the scale9Sprite should behavior like a normal node"; +} diff --git a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h index edde512780..a5448fb86e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h @@ -227,3 +227,29 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; }; + +// Scale9Sprite ZOrder + +class S9ZOrder : public S9SpriteTestDemo +{ +public: + CREATE_FUNC(S9ZOrder); + + virtual void onEnter() override; + + virtual std::string title() const override; + virtual std::string subtitle() const override; +}; + +// Scale9Sprite Flip + +class S9Flip : public S9SpriteTestDemo +{ +public: + CREATE_FUNC(S9Flip); + + virtual void onEnter() override; + + virtual std::string title() const override; + virtual std::string subtitle() const override; +}; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp index 6c392cc8a6..fdef802b13 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp @@ -49,7 +49,7 @@ void CustomImageView::initRenderer() ImageView::initRenderer(); _label = Label::create(); - ProtectedNode::addChild(_label, getLocalZOrder() + 1, -1); + addChild(_label, getLocalZOrder() + 1, -1); } void CustomImageView::setText(const std::string &text) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp index 43ec7bcc2d..af2f041c81 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp @@ -75,7 +75,7 @@ void CustomParticleWidget::setParticlePlist(const char *plist) _emitter = ParticleSystemQuad::create(plist); } //Warning!!! don't forget to set the position - addProtectedChild(_emitter , getLocalZOrder() + 1, -1); + addChild(_emitter , getLocalZOrder() + 1, -1); this->setParticlePosition(Vec2::ZERO); _emitterPlist = plist; diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index b842c9b028..14952e3914 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -74,7 +74,7 @@ Disabled ..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\network;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\win32\include;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;COCOS2DXWIN32_EXPORTS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -90,7 +90,7 @@ true Windows MachineX86 - libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;libcocos2d.lib;libExtensions.lib;libAudio.lib;libGUI.lib;libCocosStudio.lib;opengl32.lib;glew32.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies) @@ -106,7 +106,7 @@ MaxSpeed true ..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\network;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\win32\include;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions) MultiThreadedDLL true @@ -118,7 +118,7 @@ false - libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;libcocos2d.lib;libExtensions.lib;libAudio.lib;libGUI.lib;libCocosStudio.lib;opengl32.lib;glew32.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName).exe $(OutDir);%(AdditionalLibraryDirectories) false @@ -581,9 +581,6 @@ {df2638c0-8128-4847-867c-6eafe3dee7b5} - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - {21b2c324-891f-48ea-ad1a-5ae13de12e28} false diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 3404238b21..2133d49f72 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -738,21 +738,6 @@ Classes\UITest\CocostudioGUISceneTest\CustomTest\CustomParticleWidgetTest - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - Classes\UITest\CocostudioGUISceneTest\UIButtonTest @@ -855,6 +840,21 @@ Classes\UITest\CocostudioGUISceneTest + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + @@ -1463,21 +1463,6 @@ Classes\UITest\CocostudioGUISceneTest\CustomTest\CustomParticleWidgetTest - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - - - Classes\UITest\CocostudioGUISceneTest\CustomWidget - Classes\UITest\CocostudioGUISceneTest\UIButtonTest @@ -1580,5 +1565,20 @@ Classes\UITest\CocostudioGUISceneTest + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + + + Classes\UITest\CocostudioGUISceneTest\CustomWidget + \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj index c54bd5bfc6..b6b87c3e0f 100644 --- a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj +++ b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj @@ -21,8 +21,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp Application @@ -30,8 +30,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp @@ -199,9 +199,6 @@ xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\*.lua" "$(ProjectDir)..\. {df2638c0-8128-4847-867c-6eafe3dee7b5} - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - {21b2c324-891f-48ea-ad1a-5ae13de12e28} diff --git a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj index 7d5ab0cb3a..e094ca0c26 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -22,8 +22,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp Application @@ -32,8 +32,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp @@ -202,9 +202,6 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" {df2638c0-8128-4847-867c-6eafe3dee7b5} - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - {21b2c324-891f-48ea-ad1a-5ae13de12e28} diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 751afb6fb1..97a87d1a93 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 751afb6fb1cc20665990157530890a6f3200e0d7 +Subproject commit 97a87d1a93bd34be8bb8efdf6acfa35ddf7997b4