Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3_conversion

This commit is contained in:
samuele3hu 2014-07-23 11:57:56 +08:00
commit 6d678ce443
158 changed files with 1792 additions and 452 deletions

3
.gitignore vendored
View File

@ -136,4 +136,5 @@ project.properties
/external/version.json
/templates/lua-template-runtime/runtime
/v*-deps-*.zip
/v*-lua-runtime-*.zip
/v*-lua-runtime-*.zip
/tools/fbx-conv/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 = "<group>"; };
06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerObj.cpp; sourceTree = "<group>"; };
06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.h; sourceTree = "<group>"; };
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 = "<group>"; };
1A01C67718F57BE800EFE3A6 /* CCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArray.h; sourceTree = "<group>"; };
@ -2374,6 +2374,8 @@
3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIVideoPlayerIOS.mm; sourceTree = "<group>"; };
3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBundleReader.cpp; sourceTree = "<group>"; };
3EA4786F195478E00068D9D1 /* CCBundleReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBundleReader.h; sourceTree = "<group>"; };
464AD6E3197EBB1400E502D8 /* pvr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pvr.cpp; path = ../base/pvr.cpp; sourceTree = "<group>"; };
464AD6E4197EBB1400E502D8 /* pvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pvr.h; path = ../base/pvr.h; sourceTree = "<group>"; };
46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = "<group>"; };
46A15FCE1807A544005B8026 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = "<group>"; };
46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = "<group>"; };
@ -2434,8 +2436,6 @@
46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = "<group>"; };
46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = "<group>"; };
46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = "<group>"; };
46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = "<group>"; };
46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = CCEditBoxImplMac.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = "<group>"; };
46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = "<group>"; };
46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = "<group>"; };
@ -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)",

View File

@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1551A33E158F2AB200E66CFE"
BuildableName = "libcocos2dx Mac.dylib"
BuildableName = "libcocos2dx Mac.a"
BlueprintName = "cocos2dx Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>

View File

@ -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)

View File

@ -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:

View File

@ -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() )

View File

@ -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 )

View File

@ -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
*/

View File

@ -78,7 +78,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -112,7 +112,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<IgnoreSpecificDefaultLibraries> ;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ModuleDefinitionFile>cocos2d.def</ModuleDefinitionFile>
<AdditionalDependencies>libchipmunk.lib;sqlite3.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -129,7 +129,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_USRDLL;NDEBUG;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@ -165,7 +165,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ModuleDefinitionFile>cocos2d.def</ModuleDefinitionFile>
</Link>
@ -229,6 +229,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\base\ccUtils.cpp" />
<ClCompile Include="..\base\CCValue.cpp" />
<ClCompile Include="..\base\etc1.cpp" />
<ClCompile Include="..\base\pvr.cpp" />
<ClCompile Include="..\base\ObjectFactory.cpp" />
<ClCompile Include="..\base\s3tc.cpp" />
<ClCompile Include="..\base\TGAlib.cpp" />
@ -422,6 +423,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\base\etc1.h" />
<ClInclude Include="..\base\firePngData.h" />
<ClInclude Include="..\base\ObjectFactory.h" />
<ClInclude Include="..\base\pvr.h" />
<ClInclude Include="..\base\s3tc.h" />
<ClInclude Include="..\base\TGAlib.h" />
<ClInclude Include="..\base\uthash.h" />
@ -571,6 +573,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<None Include="..\math\Vec4.inl" />
<None Include="cocos2d.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\chipmunk\proj.win32\chipmunk.vcxproj">
<Project>{207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -418,6 +418,9 @@
<ClCompile Include="..\base\etc1.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\pvr.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\base\s3tc.cpp">
<Filter>base</Filter>
</ClCompile>
@ -991,6 +994,9 @@
<ClInclude Include="..\base\etc1.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\pvr.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\base\firePngData.h">
<Filter>base</Filter>
</ClInclude>

View File

@ -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 \

View File

@ -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_)

View File

@ -18,7 +18,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
@ -27,7 +27,7 @@
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
@ -74,7 +74,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_EXPORT_DLL_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -90,7 +90,7 @@
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
@ -98,7 +98,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_EXPORT_DLL_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@ -116,7 +116,7 @@
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>

View File

@ -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
)

View File

@ -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__

View File

@ -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:
/**

713
cocos/base/pvr.cpp Normal file
View File

@ -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 <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <cstdint>
#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)
*****************************************************************************/

22
cocos/base/pvr.h Normal file
View File

@ -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__

View File

@ -63,7 +63,7 @@
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MinimalRebuild>false</MinimalRebuild>
@ -82,7 +82,7 @@
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>

View File

@ -215,13 +215,17 @@ void ActionTimeline::startWithTarget(Node *target)
[this, target](Node* child)
{
ActionTimelineData* data = dynamic_cast<ActionTimelineData*>(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);
}
}
}
});

View File

@ -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;

View File

@ -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 */

View File

@ -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();

View File

@ -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<Widget*>(child);
if (widgetChild
&& dynamic_cast<Widget*>(node)
&& !dynamic_cast<Layout*>(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();
}

View File

@ -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();

View File

@ -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();

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -28,6 +28,7 @@ THE SOFTWARE.
#include "cocostudio/CCProcessBase.h"
#include "cocostudio/CCTween.h"
#include "cocostudio/CocosStudioExport.h"
#include <queue>
namespace cocostudio {
@ -65,7 +66,7 @@ struct MovementEvent
std::string movementID;
};
class ArmatureAnimation : public ProcessBase
class CC_STUDIO_DLL ArmatureAnimation : public ProcessBase
{
public:
/**

View File

@ -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 */

View File

@ -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();

View File

@ -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:
/**

View File

@ -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();

View File

@ -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
*/

View File

@ -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
*/

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
#include <string>
#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;

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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)

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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:
/**

View File

@ -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);

View File

@ -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
{

View File

@ -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:

View File

@ -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();

View File

@ -26,6 +26,7 @@ THE SOFTWARE.
#include "base/CCPlatformMacros.h"
#include "cocostudio/CCArmatureDefine.h"
#include "cocostudio/CocosStudioExport.h"
#include <stack>
#include <string>
@ -35,7 +36,7 @@ namespace cocostudio {
* @js NA
* @lua NA
*/
class SpriteFrameCacheHelper
class CC_STUDIO_DLL SpriteFrameCacheHelper
{
public:
/** @deprecated Use getInstance() instead */

View File

@ -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();

View File

@ -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:
/**

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
#include "2d/CCSprite.h"
#include "cocostudio/CCArmatureDefine.h"
#include "cocostudio/CocosStudioExport.h"
#include <math.h>
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 &center, float radius, float fromRadian, float radianDif);
cocos2d::Vec2 CC_STUDIO_DLL circleTo(float t, cocos2d::Vec2 &center, float radius, float fromRadian, float radianDif);
}

View File

@ -31,6 +31,7 @@
#include <stdint.h>
#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;

View File

@ -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

View File

@ -0,0 +1,28 @@
#ifndef __CCCOCOSSTUDIO_H__
#define __CCCOCOSSTUDIO_H__
#if defined(WIN32) && defined(_WINDOWS)
#ifdef __MINGW32__
#include <string.h>
#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__*/

View File

@ -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();

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() {};

View File

@ -117,6 +117,7 @@
<ClInclude Include="..\CocoLoader.h" />
<ClInclude Include="..\CocoStudio.h" />
<ClInclude Include="..\DictionaryHelper.h" />
<ClInclude Include="..\CocosStudioExport.h" />
<ClInclude Include="..\TriggerBase.h" />
<ClInclude Include="..\TriggerMng.h" />
<ClInclude Include="..\TriggerObj.h" />
@ -142,7 +143,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
@ -152,7 +153,7 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
@ -189,7 +190,7 @@
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MinimalRebuild>false</MinimalRebuild>
@ -197,6 +198,8 @@
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcocos2d.lib;libExtensions.lib;libGUI.lib;libBox2d.lib;libchipmunk.lib;libzlib.lib;libAudio.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -207,7 +210,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;_USRSTUDIODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<DebugInformationFormat>None</DebugInformationFormat>
<WholeProgramOptimization>false</WholeProgramOptimization>
@ -216,6 +219,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libcocos2d.lib;libExtensions.lib;libGUI.lib;libBox2d.lib;libchipmunk.lib;libzlib.lib;libAudio.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -455,5 +455,6 @@
<ClInclude Include="..\ActionTimeline\CCTimelineMacro.h">
<Filter>TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\CocosStudioExport.h" />
</ItemGroup>
</Project>

View File

@ -118,7 +118,7 @@
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MinimalRebuild>false</MinimalRebuild>
@ -135,7 +135,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_CONSTRUCTOR_ACCESS=public;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>None</DebugInformationFormat>
<WholeProgramOptimization>false</WholeProgramOptimization>

View File

@ -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 <stdio.h>
@ -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<const unsigned char*>(_data+dataOffset), static_cast<etc1_byte*>(_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<int>(packetLength);
if(!_unpack)
{
_mipmaps[i].address = _data + dataOffset;
_mipmaps[i].len = static_cast<int>(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;
}

View File

@ -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;

View File

@ -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) {

View File

@ -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__

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<cocos2d::Component>(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;

View File

@ -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);

View File

@ -396,6 +396,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S);
#endif // __cocos2dx_ui_h__

View File

@ -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);

View File

@ -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

28
cocos/ui/GUIExport.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef __CCLIBGUI_H__
#define __CCLIBGUI_H__
#if defined(WIN32) && defined(_WINDOWS)
#ifdef __MINGW32__
#include <string.h>
#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__*/

View File

@ -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

View File

@ -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

View File

@ -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:

Some files were not shown because too many files have changed in this diff Show More