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

This commit is contained in:
kaile.yin 2014-10-25 23:02:38 +08:00
commit dd517813a8
275 changed files with 10657 additions and 6643 deletions

1
.gitignore vendored
View File

@ -36,6 +36,7 @@ ipch/
*.opensdf
SubmissionInfo
Generated Files
AppPackages
# Ignore files build by ndk and eclipse
libs/

View File

@ -1013,6 +1013,7 @@ Developers:
zhongfq
Optimize decompress jpg data
Fixed memory leak of TextureCache::reloadTexture()
wohaaitinciu
WebView support on windows

View File

@ -1,3 +1,8 @@
cocos2d-x-3.3 ??
[FIX] WP/WinRT: Windows 8.1 universal app support; `UIEditBox` support
[FIX] Label: label shifting when outline feature enabled
[FIX] Sprite3D: did not create attached sprite from cache
cocos2d-x-3.3-rc0 Oct.21 2014
[NEW] 3d: added light support: direction light, point light, spot light and ambient light
[NEW] Added ClippingRectangleNode
@ -34,6 +39,7 @@ cocos2d-x-3.3-rc0 Oct.21 2014
[FIX] Node: unscheduleAllSelectors() deprecated in favor of unscheudleAllCallbacks()
[FIX] Node: crashed if remove/add child too quickly when using integrated physics
[FIX] TextFieldTTF: will get wrong characters if using Chinese input method on WP8
[FIX] TextureCache: memory leak in reloadTexture()
[FIX] UI: Button: button remains gray when releasing it, this issue only happened if enable scale9 and only has one texture
[FIX] UI: Button: when creating a button with a title only, button content size is not immediately updated
[FIX] UI: EditBox: setMaxLength is invalid on mac

View File

@ -204,9 +204,9 @@ def build_samples(target,ndk_build_param,android_platform,build_mode):
exit(1)
if build_mode is None:
build_mode = 'release'
elif build_mode != 'debug':
build_mode = 'release'
build_mode = 'debug'
elif build_mode != 'release':
build_mode = 'debug'
app_android_root = ''

View File

@ -0,0 +1,228 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{B3F299D4-B4CA-4F0B-8BE2-FB328483BC13}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Shared", "..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems", "{5D6F020F-7E72-4494-90A0-2DF11D235DF9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", "..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj", "{9335005F-678E-4E8E-9B84-50037216AEC8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.WindowsPhone", "..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.WindowsPhone\libcocos2d_8_1.WindowsPhone.vcxproj", "{22F3B9DF-1209-4574-8331-003966F562BF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-tests", "cpp-tests", "{572742C5-9322-4548-AB8B-96C3750A1B5D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests.Shared", "..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems", "{BE3A1791-5BCE-4CEA-92CD-0E2D86DDE27A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests.Windows", "..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Windows\cpp-tests.Windows.vcxproj", "{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests.WindowsPhone", "..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.WindowsPhone\cpp-tests.WindowsPhone.vcxproj", "{15247C71-5289-4913-B88F-E253CC353720}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{85630454-74EA-4B5B-9B62-0E459B4476CB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbox2d", "libbox2d", "{B3D1A3D5-9F54-43AF-9322-230B53242B78}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Shared", "..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems", "{4A3C6BA8-C227-498B-AA21-40BDA27B461F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Windows", "..\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj", "{3B26A12D-3A44-47EA-82D2-282660FC844D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.WindowsPhone", "..\external\Box2D\proj.win8.1-universal\libbox2d.WindowsPhone\libbox2d.WindowsPhone.vcxproj", "{22F798D8-BFFF-4754-996F-A5395343D5EC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libSpine", "libSpine", "{6FEB795C-C98C-4C8C-A88B-A35DEE205348}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems", "{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.WindowsPhone", "..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.WindowsPhone\libSpine.WindowsPhone.vcxproj", "{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-empty-test", "cpp-empty-test", "{B70EF25E-E352-4020-BCDF-388973E44637}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Shared", "..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems", "{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Windows", "..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Windows\HelloCpp.Windows.vcxproj", "{79A8FCDA-4B12-4DD1-B676-FF148D651638}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.WindowsPhone", "..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.WindowsPhone\HelloCpp.WindowsPhone.vcxproj", "{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4
..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems*{15247c71-5289-4913-b88f-e253cc353720}*SharedItemsImports = 4
..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9
..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4
..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9
..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4
..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9
..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems*{be3a1791-5bce-4cea-92cd-0e2d86dde27a}*SharedItemsImports = 9
..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9
..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4
..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{22f3b9df-1209-4574-8331-003966f562bf}*SharedItemsImports = 4
..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{22f798d8-bfff-4754-996f-a5395343d5ec}*SharedItemsImports = 4
..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4
..\tests\cpp-tests\proj.win8.1-universal\cpp-tests.Shared\cpp-tests.Shared.vcxitems*{f2bae06b-caae-43ee-b21b-57fa48db04fa}*SharedItemsImports = 4
..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{396fe85e-bb05-4b92-bccb-f89aed4ea41a}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|ARM = Release|ARM
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.ActiveCfg = Debug|ARM
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.Build.0 = Debug|ARM
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.ActiveCfg = Debug|Win32
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.Build.0 = Debug|Win32
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.ActiveCfg = Debug|x64
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.Build.0 = Debug|x64
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.ActiveCfg = Release|ARM
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.Build.0 = Release|ARM
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.ActiveCfg = Release|Win32
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.Build.0 = Release|Win32
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.ActiveCfg = Release|x64
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.Build.0 = Release|x64
{22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.ActiveCfg = Debug|ARM
{22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.Build.0 = Debug|ARM
{22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.ActiveCfg = Debug|Win32
{22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.Build.0 = Debug|Win32
{22F3B9DF-1209-4574-8331-003966F562BF}.Debug|x64.ActiveCfg = Debug|Win32
{22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.ActiveCfg = Release|ARM
{22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.Build.0 = Release|ARM
{22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.ActiveCfg = Release|Win32
{22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.Build.0 = Release|Win32
{22F3B9DF-1209-4574-8331-003966F562BF}.Release|x64.ActiveCfg = Release|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|ARM.ActiveCfg = Debug|ARM
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|ARM.Build.0 = Debug|ARM
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|ARM.Deploy.0 = Debug|ARM
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|Win32.ActiveCfg = Debug|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|Win32.Build.0 = Debug|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|Win32.Deploy.0 = Debug|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|x64.ActiveCfg = Debug|x64
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|x64.Build.0 = Debug|x64
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Debug|x64.Deploy.0 = Debug|x64
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|ARM.ActiveCfg = Release|ARM
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|ARM.Build.0 = Release|ARM
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|ARM.Deploy.0 = Release|ARM
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|Win32.ActiveCfg = Release|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|Win32.Build.0 = Release|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|Win32.Deploy.0 = Release|Win32
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|x64.ActiveCfg = Release|x64
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|x64.Build.0 = Release|x64
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA}.Release|x64.Deploy.0 = Release|x64
{15247C71-5289-4913-B88F-E253CC353720}.Debug|ARM.ActiveCfg = Debug|ARM
{15247C71-5289-4913-B88F-E253CC353720}.Debug|ARM.Build.0 = Debug|ARM
{15247C71-5289-4913-B88F-E253CC353720}.Debug|ARM.Deploy.0 = Debug|ARM
{15247C71-5289-4913-B88F-E253CC353720}.Debug|Win32.ActiveCfg = Debug|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Debug|Win32.Build.0 = Debug|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Debug|Win32.Deploy.0 = Debug|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Debug|x64.ActiveCfg = Debug|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Release|ARM.ActiveCfg = Release|ARM
{15247C71-5289-4913-B88F-E253CC353720}.Release|ARM.Build.0 = Release|ARM
{15247C71-5289-4913-B88F-E253CC353720}.Release|ARM.Deploy.0 = Release|ARM
{15247C71-5289-4913-B88F-E253CC353720}.Release|Win32.ActiveCfg = Release|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Release|Win32.Build.0 = Release|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Release|Win32.Deploy.0 = Release|Win32
{15247C71-5289-4913-B88F-E253CC353720}.Release|x64.ActiveCfg = Release|Win32
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.ActiveCfg = Debug|ARM
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.Build.0 = Debug|ARM
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.ActiveCfg = Debug|Win32
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.Build.0 = Debug|Win32
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.ActiveCfg = Debug|x64
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.Build.0 = Debug|x64
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.ActiveCfg = Release|ARM
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.Build.0 = Release|ARM
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.ActiveCfg = Release|Win32
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.Build.0 = Release|Win32
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.ActiveCfg = Release|x64
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.Build.0 = Release|x64
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.ActiveCfg = Debug|ARM
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.Build.0 = Debug|ARM
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.ActiveCfg = Debug|Win32
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.Build.0 = Debug|Win32
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|x64.ActiveCfg = Debug|Win32
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.ActiveCfg = Release|ARM
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.Build.0 = Release|ARM
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.ActiveCfg = Release|Win32
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.Build.0 = Release|Win32
{22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|x64.ActiveCfg = Release|Win32
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.ActiveCfg = Debug|ARM
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.Build.0 = Debug|ARM
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.ActiveCfg = Debug|Win32
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.Build.0 = Debug|Win32
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.ActiveCfg = Debug|x64
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.Build.0 = Debug|x64
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.ActiveCfg = Release|ARM
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.Build.0 = Release|ARM
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.ActiveCfg = Release|Win32
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.ActiveCfg = Debug|ARM
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.Build.0 = Debug|ARM
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.ActiveCfg = Debug|Win32
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.Build.0 = Debug|Win32
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|x64.ActiveCfg = Debug|Win32
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.ActiveCfg = Release|ARM
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.Build.0 = Release|ARM
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.ActiveCfg = Release|Win32
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.Build.0 = Release|Win32
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|x64.ActiveCfg = Release|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.ActiveCfg = Debug|ARM
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Build.0 = Debug|ARM
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Deploy.0 = Debug|ARM
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.ActiveCfg = Debug|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Build.0 = Debug|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Deploy.0 = Debug|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.ActiveCfg = Debug|x64
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Build.0 = Debug|x64
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Deploy.0 = Debug|x64
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.ActiveCfg = Release|ARM
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Build.0 = Release|ARM
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Deploy.0 = Release|ARM
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.ActiveCfg = Release|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Build.0 = Release|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Deploy.0 = Release|Win32
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.ActiveCfg = Release|x64
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Build.0 = Release|x64
{79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Deploy.0 = Release|x64
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.ActiveCfg = Debug|ARM
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Build.0 = Debug|ARM
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Deploy.0 = Debug|ARM
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.ActiveCfg = Debug|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Build.0 = Debug|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Deploy.0 = Debug|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|x64.ActiveCfg = Debug|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.ActiveCfg = Release|ARM
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Build.0 = Release|ARM
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Deploy.0 = Release|ARM
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.ActiveCfg = Release|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Build.0 = Release|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Deploy.0 = Release|Win32
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5D6F020F-7E72-4494-90A0-2DF11D235DF9} = {B3F299D4-B4CA-4F0B-8BE2-FB328483BC13}
{9335005F-678E-4E8E-9B84-50037216AEC8} = {B3F299D4-B4CA-4F0B-8BE2-FB328483BC13}
{22F3B9DF-1209-4574-8331-003966F562BF} = {B3F299D4-B4CA-4F0B-8BE2-FB328483BC13}
{BE3A1791-5BCE-4CEA-92CD-0E2D86DDE27A} = {572742C5-9322-4548-AB8B-96C3750A1B5D}
{F2BAE06B-CAAE-43EE-B21B-57FA48DB04FA} = {572742C5-9322-4548-AB8B-96C3750A1B5D}
{15247C71-5289-4913-B88F-E253CC353720} = {572742C5-9322-4548-AB8B-96C3750A1B5D}
{B3D1A3D5-9F54-43AF-9322-230B53242B78} = {85630454-74EA-4B5B-9B62-0E459B4476CB}
{4A3C6BA8-C227-498B-AA21-40BDA27B461F} = {B3D1A3D5-9F54-43AF-9322-230B53242B78}
{3B26A12D-3A44-47EA-82D2-282660FC844D} = {B3D1A3D5-9F54-43AF-9322-230B53242B78}
{22F798D8-BFFF-4754-996F-A5395343D5EC} = {B3D1A3D5-9F54-43AF-9322-230B53242B78}
{6FEB795C-C98C-4C8C-A88B-A35DEE205348} = {85630454-74EA-4B5B-9B62-0E459B4476CB}
{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {6FEB795C-C98C-4C8C-A88B-A35DEE205348}
{F3550FE0-C795-44F6-8FEB-093EB68143AE} = {6FEB795C-C98C-4C8C-A88B-A35DEE205348}
{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF} = {6FEB795C-C98C-4C8C-A88B-A35DEE205348}
{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E} = {B70EF25E-E352-4020-BCDF-388973E44637}
{79A8FCDA-4B12-4DD1-B676-FF148D651638} = {B70EF25E-E352-4020-BCDF-388973E44637}
{396FE85E-BB05-4B92-BCCB-F89AED4EA41A} = {B70EF25E-E352-4020-BCDF-388973E44637}
EndGlobalSection
EndGlobal

View File

@ -1291,14 +1291,14 @@
3E6176771960F89B00DE83F5 /* CCEventListenerController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */; };
3E6176781960F89B00DE83F5 /* CCGameController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176651960F89B00DE83F5 /* CCGameController.h */; };
3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61781C1966A5A300DE83F5 /* CCController.cpp */; };
3EA1072F19D7F37700CAB794 /* CCLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA1072D19D7F37700CAB794 /* CCLight.cpp */; };
3EA1073019D7F37700CAB794 /* CCLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA1072D19D7F37700CAB794 /* CCLight.cpp */; };
3EA1073119D7F37700CAB794 /* CCLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA1072E19D7F37700CAB794 /* CCLight.h */; };
3EA1073219D7F37700CAB794 /* CCLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA1072E19D7F37700CAB794 /* CCLight.h */; };
3EA3EDBC1991CDFA00645534 /* CCCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA3EDBA1991CDFA00645534 /* CCCamera.cpp */; };
3EA3EDBD1991CDFA00645534 /* CCCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA3EDBA1991CDFA00645534 /* CCCamera.cpp */; };
3EA3EDBE1991CDFA00645534 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA3EDBB1991CDFA00645534 /* CCCamera.h */; };
3EA3EDBF1991CDFA00645534 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA3EDBB1991CDFA00645534 /* CCCamera.h */; };
3EACC9A019F5014D00EB3C5E /* CCCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EACC99C19F5014D00EB3C5E /* CCCamera.cpp */; };
3EACC9A119F5014D00EB3C5E /* CCCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EACC99C19F5014D00EB3C5E /* CCCamera.cpp */; };
3EACC9A219F5014D00EB3C5E /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EACC99D19F5014D00EB3C5E /* CCCamera.h */; };
3EACC9A319F5014D00EB3C5E /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EACC99D19F5014D00EB3C5E /* CCCamera.h */; };
3EACC9A419F5014D00EB3C5E /* CCLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EACC99E19F5014D00EB3C5E /* CCLight.cpp */; };
3EACC9A519F5014D00EB3C5E /* CCLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EACC99E19F5014D00EB3C5E /* CCLight.cpp */; };
3EACC9A619F5014D00EB3C5E /* CCLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EACC99F19F5014D00EB3C5E /* CCLight.h */; };
3EACC9A719F5014D00EB3C5E /* CCLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EACC99F19F5014D00EB3C5E /* CCLight.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 */; };
@ -2462,10 +2462,10 @@
3E61781C1966A5A300DE83F5 /* CCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCController.cpp; path = ../base/CCController.cpp; sourceTree = "<group>"; };
3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayer.h; sourceTree = "<group>"; };
3EA0FB6A191C841D00B170C8 /* UIVideoPlayer-ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIVideoPlayer-ios.mm"; sourceTree = "<group>"; };
3EA1072D19D7F37700CAB794 /* CCLight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCLight.cpp; path = ../base/CCLight.cpp; sourceTree = "<group>"; };
3EA1072E19D7F37700CAB794 /* CCLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCLight.h; path = ../base/CCLight.h; sourceTree = "<group>"; };
3EA3EDBA1991CDFA00645534 /* CCCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCCamera.cpp; path = ../base/CCCamera.cpp; sourceTree = "<group>"; };
3EA3EDBB1991CDFA00645534 /* CCCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCCamera.h; path = ../base/CCCamera.h; sourceTree = "<group>"; };
3EACC99C19F5014D00EB3C5E /* CCCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCCamera.cpp; sourceTree = "<group>"; };
3EACC99D19F5014D00EB3C5E /* CCCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCamera.h; sourceTree = "<group>"; };
3EACC99E19F5014D00EB3C5E /* CCLight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLight.cpp; sourceTree = "<group>"; };
3EACC99F19F5014D00EB3C5E /* CCLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLight.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>"; };
@ -3222,12 +3222,8 @@
1A5700A2180BC5E60088DEC7 /* base */ = {
isa = PBXGroup;
children = (
3EA1072D19D7F37700CAB794 /* CCLight.cpp */,
3EA1072E19D7F37700CAB794 /* CCLight.h */,
299CF1F919A434BC00C378C1 /* ccRandom.cpp */,
299CF1FA19A434BC00C378C1 /* ccRandom.h */,
3EA3EDBA1991CDFA00645534 /* CCCamera.cpp */,
3EA3EDBB1991CDFA00645534 /* CCCamera.h */,
464AD6E3197EBB1400E502D8 /* pvr.cpp */,
464AD6E4197EBB1400E502D8 /* pvr.h */,
3E61781C1966A5A300DE83F5 /* CCController.cpp */,
@ -4637,6 +4633,10 @@
46A169A11807B037005B8026 /* 2d */ = {
isa = PBXGroup;
children = (
3EACC99C19F5014D00EB3C5E /* CCCamera.cpp */,
3EACC99D19F5014D00EB3C5E /* CCCamera.h */,
3EACC99E19F5014D00EB3C5E /* CCLight.cpp */,
3EACC99F19F5014D00EB3C5E /* CCLight.h */,
1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */,
1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */,
1A570046180BC59A0088DEC7 /* actions */,
@ -5129,7 +5129,6 @@
38B8E2E319E671D2002D7CE7 /* UILayoutComponent.h in Headers */,
5034CA39191D591100CE6051 /* ccShader_PositionColorLengthTexture.frag in Headers */,
292DB14B19B4574100A80320 /* UIEditBoxImpl-mac.h in Headers */,
3EA1073119D7F37700CAB794 /* CCLight.h in Headers */,
B29A7E3F19EE1B7700872B35 /* AnimationState.h in Headers */,
50ABBE891925AB6F00A911A9 /* CCMap.h in Headers */,
50ABBE8D1925AB6F00A911A9 /* CCNS.h in Headers */,
@ -5518,7 +5517,6 @@
15AE189E19AAD33D00C27E9E /* CCNodeLoader.h in Headers */,
50ABBE7B1925AB6F00A911A9 /* CCEventMouse.h in Headers */,
503DD8F91926B0DB00CD74DD /* CCIMEDispatcher.h in Headers */,
3EA3EDBE1991CDFA00645534 /* CCCamera.h in Headers */,
15AE1B6619AADA9900C27E9E /* UIImageView.h in Headers */,
15AE1BB419AADFEF00C27E9E /* HttpResponse.h in Headers */,
15AE1A8519AAD40300C27E9E /* b2Joint.h in Headers */,
@ -5557,6 +5555,7 @@
50ABBEC91925AB6F00A911A9 /* firePngData.h in Headers */,
292DB16119B461CA00A80320 /* ExtensionDeprecated.h in Headers */,
503DD8F51926B0DB00CD74DD /* CCIMEDelegate.h in Headers */,
3EACC9A619F5014D00EB3C5E /* CCLight.h in Headers */,
50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */,
15AE1BDB19AAE01E00C27E9E /* CCControlSwitch.h in Headers */,
B24AA987195A675C007B4522 /* CCFastTMXLayer.h in Headers */,
@ -5630,6 +5629,7 @@
15AE190219AAD35000C27E9E /* CCComController.h in Headers */,
15AE18DE19AAD35000C27E9E /* TriggerObj.h in Headers */,
15AE183E19AAD2F700C27E9E /* CCSkeleton3D.h in Headers */,
3EACC9A219F5014D00EB3C5E /* CCCamera.h in Headers */,
50ABBECD1925AB6F00A911A9 /* s3tc.h in Headers */,
15AE1BD119AAE01E00C27E9E /* CCControlHuePicker.h in Headers */,
50ABBE771925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */,
@ -5652,6 +5652,7 @@
503DD8F01926736A00CD74DD /* CCStdC-ios.h in Headers */,
15AE1A9A19AAD40300C27E9E /* b2Math.h in Headers */,
46A170FF1807CECB005B8026 /* CCPhysicsContact.h in Headers */,
3EACC9A319F5014D00EB3C5E /* CCCamera.h in Headers */,
B29A7E1A19EE1B7700872B35 /* Event.h in Headers */,
15AE1AC719AAD40300C27E9E /* b2GearJoint.h in Headers */,
50ABBDA21925AB4100A911A9 /* CCGroupCommand.h in Headers */,
@ -5689,7 +5690,6 @@
15B3708719EE414C00ABE682 /* Downloader.h in Headers */,
15AE192619AAD35100C27E9E /* TriggerObj.h in Headers */,
50ABBE2E1925AB6F00A911A9 /* ccCArray.h in Headers */,
15AE1A0C19AAD3A700C27E9E /* CCSkeletonAnimation.h in Headers */,
15B3707B19EE414C00ABE682 /* AssetsManagerEx.h in Headers */,
15AE1B9119AADA9A00C27E9E /* UIWidget.h in Headers */,
50ABC0041926664800A911A9 /* CCLock-apple.h in Headers */,
@ -5820,7 +5820,6 @@
50ED2BE119BEAF7900A0AB90 /* UIEditBoxImpl-win32.h in Headers */,
15AE1ACB19AAD40300C27E9E /* b2MouseJoint.h in Headers */,
50ABBD3F1925AB0000A911A9 /* CCGeometry.h in Headers */,
3EA3EDBF1991CDFA00645534 /* CCCamera.h in Headers */,
B29A7DD019EE1B7700872B35 /* RegionAttachment.h in Headers */,
15AE1AD319AAD40300C27E9E /* b2RopeJoint.h in Headers */,
50ABBFFE1926664800A911A9 /* CCFileUtils-apple.h in Headers */,
@ -5872,6 +5871,7 @@
15AE1BFA19AAE01E00C27E9E /* CCControlSwitch.h in Headers */,
15AE182F19AAD2F700C27E9E /* CCMeshVertexIndexData.h in Headers */,
15AE1BAA19AADFDF00C27E9E /* UIVBox.h in Headers */,
3EACC9A719F5014D00EB3C5E /* CCLight.h in Headers */,
15AE194E19AAD35100C27E9E /* CCDataReaderHelper.h in Headers */,
3828C0A419EB8ACA002AB57B /* coded_stream_inl.h in Headers */,
15AE1ADB19AAD41000C27E9E /* b2Rope.h in Headers */,
@ -6129,7 +6129,6 @@
3828C0E219EB8ACA002AB57B /* stringprintf.h in Headers */,
50ABBEDA1925AB6F00A911A9 /* ZipUtils.h in Headers */,
50ABBDC01925AB4100A911A9 /* CCTextureCache.h in Headers */,
3EA1073219D7F37700CAB794 /* CCLight.h in Headers */,
B276EF641988D1D500CD400F /* CCVertexIndexBuffer.h in Headers */,
ED9C6A9718599AD8000A5232 /* CCNodeGrid.h in Headers */,
50ABC0201926664800A911A9 /* CCThread.h in Headers */,
@ -6251,7 +6250,6 @@
50ABBE2B1925AB6F00A911A9 /* ccCArray.cpp in Sources */,
B29A7E3B19EE1B7700872B35 /* Animation.c in Sources */,
15AE1BDE19AAE01E00C27E9E /* CCInvocation.cpp in Sources */,
3EA3EDBC1991CDFA00645534 /* CCCamera.cpp in Sources */,
292DB14F19B4574100A80320 /* UIEditBoxImpl-stub.cpp in Sources */,
B29A7E0B19EE1B7700872B35 /* Atlas.c in Sources */,
15AE199419AAD39600C27E9E /* LayoutReader.cpp in Sources */,
@ -6426,6 +6424,7 @@
1A5701DE180BCB8C0088DEC7 /* CCLayer.cpp in Sources */,
15AE1B5919AADA9900C27E9E /* UIText.cpp in Sources */,
15B3707C19EE414C00ABE682 /* CCEventAssetsManagerEx.cpp in Sources */,
3EACC9A419F5014D00EB3C5E /* CCLight.cpp in Sources */,
1A5701E2180BCB8C0088DEC7 /* CCScene.cpp in Sources */,
15AE1B9919AADFDF00C27E9E /* UIHBox.cpp in Sources */,
15AE199C19AAD39600C27E9E /* ScrollViewReader.cpp in Sources */,
@ -6435,7 +6434,6 @@
1A5701E6180BCB8C0088DEC7 /* CCTransition.cpp in Sources */,
B24AA985195A675C007B4522 /* CCFastTMXLayer.cpp in Sources */,
15AE1A6A19AAD40300C27E9E /* b2ChainAndCircleContact.cpp in Sources */,
15AE19BE19AAD3A700C27E9E /* Event.cpp in Sources */,
15B3708819EE414C00ABE682 /* Manifest.cpp in Sources */,
1A5701EA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */,
3828C0D719EB8ACA002AB57B /* once.cc in Sources */,
@ -6458,6 +6456,7 @@
292DB14D19B4574100A80320 /* UIEditBoxImpl-mac.mm in Sources */,
50ABBDB51925AB4100A911A9 /* CCTexture2D.cpp in Sources */,
B29A7DD719EE1B7700872B35 /* SkeletonData.c in Sources */,
3EACC9A019F5014D00EB3C5E /* CCCamera.cpp in Sources */,
1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */,
15AE1BD019AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */,
15AE18F219AAD35000C27E9E /* CCArmatureDataManager.cpp in Sources */,
@ -6558,7 +6557,6 @@
1A57034B180BD09B0088DEC7 /* tinyxml2.cpp in Sources */,
1A570354180BD0B00088DEC7 /* ioapi.cpp in Sources */,
15B3707819EE414C00ABE682 /* AssetsManagerEx.cpp in Sources */,
15AE19E419AAD3A700C27E9E /* SkeletonJson.cpp in Sources */,
1A570358180BD0B00088DEC7 /* unzip.cpp in Sources */,
3828C0CF19EB8ACA002AB57B /* common.cc in Sources */,
B29A7DCB19EE1B7700872B35 /* Skeleton.c in Sources */,
@ -6596,7 +6594,6 @@
15AE199819AAD39600C27E9E /* LoadingBarReader.cpp in Sources */,
503DD8F71926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */,
50ABBE751925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */,
3EA1072F19D7F37700CAB794 /* CCLight.cpp in Sources */,
15AE18F019AAD35000C27E9E /* CCArmatureAnimation.cpp in Sources */,
50ABBE511925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */,
50ABC0051926664800A911A9 /* CCThread-apple.mm in Sources */,
@ -6808,6 +6805,7 @@
15AE184119AAD2F700C27E9E /* CCSprite3D.cpp in Sources */,
50ABBE5A1925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */,
15AE193A19AAD35100C27E9E /* CCArmatureDataManager.cpp in Sources */,
3EACC9A519F5014D00EB3C5E /* CCLight.cpp in Sources */,
15AE1B7A19AADA9A00C27E9E /* UIScrollView.cpp in Sources */,
1A570076180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */,
15AE19B219AAD39700C27E9E /* SliderReader.cpp in Sources */,
@ -6956,6 +6954,7 @@
15AE194919AAD35100C27E9E /* CCComController.cpp in Sources */,
1A57022A180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */,
15AE182919AAD2F700C27E9E /* CCMeshSkin.cpp in Sources */,
3EACC9A119F5014D00EB3C5E /* CCCamera.cpp in Sources */,
15AE1BBD19AADFF000C27E9E /* SocketIO.cpp in Sources */,
15AE1A4319AAD3D500C27E9E /* b2DynamicTree.cpp in Sources */,
15AE1A3A19AAD3D500C27E9E /* b2BroadPhase.cpp in Sources */,
@ -6988,7 +6987,6 @@
15AE194D19AAD35100C27E9E /* CCDataReaderHelper.cpp in Sources */,
15AE1B8C19AADA9A00C27E9E /* UIScale9Sprite.cpp in Sources */,
15AE19AE19AAD39700C27E9E /* PageViewReader.cpp in Sources */,
3EA3EDBD1991CDFA00645534 /* CCCamera.cpp in Sources */,
1A570297180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */,
50ABBE321925AB6F00A911A9 /* CCConfiguration.cpp in Sources */,
15AE1A9F19AAD40300C27E9E /* b2Timer.cpp in Sources */,
@ -7095,7 +7093,6 @@
50ABBE201925AB6F00A911A9 /* atitc.cpp in Sources */,
50CB248019D9C5A100687767 /* AudioPlayer.mm in Sources */,
50ABBE9A1925AB6F00A911A9 /* CCRef.cpp in Sources */,
3EA1073019D7F37700CAB794 /* CCLight.cpp in Sources */,
15AE18BF19AAD33D00C27E9E /* CCLabelTTFLoader.cpp in Sources */,
15AE1B9519AADA9A00C27E9E /* CocosGUI.cpp in Sources */,
15AE180919AAD2F700C27E9E /* CCAABB.cpp in Sources */,

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

View File

@ -234,6 +234,7 @@
<ClInclude Include="..\..\..\cocos\2d\CCAnimation.h" />
<ClInclude Include="..\..\..\cocos\2d\CCAnimationCache.h" />
<ClInclude Include="..\..\..\cocos\2d\CCAtlasNode.h" />
<ClInclude Include="..\..\..\cocos\2d\CCCamera.h" />
<ClInclude Include="..\..\..\cocos\2d\CCClippingNode.h" />
<ClInclude Include="..\..\..\cocos\2d\CCComponent.h" />
<ClInclude Include="..\..\..\cocos\2d\CCComponentContainer.h" />
@ -256,6 +257,7 @@
<ClInclude Include="..\..\..\cocos\2d\CCLabelTextFormatter.h" />
<ClInclude Include="..\..\..\cocos\2d\CCLabelTTF.h" />
<ClInclude Include="..\..\..\cocos\2d\CCLayer.h" />
<ClInclude Include="..\..\..\cocos\2d\CCLight.h" />
<ClInclude Include="..\..\..\cocos\2d\CCMenu.h" />
<ClInclude Include="..\..\..\cocos\2d\CCMenuItem.h" />
<ClInclude Include="..\..\..\cocos\2d\CCMotionStreak.h" />
@ -287,7 +289,6 @@
<ClInclude Include="..\..\..\cocos\base\atitc.h" />
<ClInclude Include="..\..\..\cocos\base\base64.h" />
<ClInclude Include="..\..\..\cocos\base\CCAutoreleasePool.h" />
<ClInclude Include="..\..\..\cocos\base\CCCamera.h" />
<ClInclude Include="..\..\..\cocos\base\ccCArray.h" />
<ClInclude Include="..\..\..\cocos\base\ccConfig.h" />
<ClInclude Include="..\..\..\cocos\base\CCConfiguration.h" />
@ -318,7 +319,6 @@
<ClInclude Include="..\..\..\cocos\base\CCGameController.h" />
<ClInclude Include="..\..\..\cocos\base\CCIMEDelegate.h" />
<ClInclude Include="..\..\..\cocos\base\CCIMEDispatcher.h" />
<ClInclude Include="..\..\..\cocos\base\CCLight.h" />
<ClInclude Include="..\..\..\cocos\base\ccMacros.h" />
<ClInclude Include="..\..\..\cocos\base\CCMap.h" />
<ClInclude Include="..\..\..\cocos\base\CCNS.h" />
@ -432,6 +432,7 @@
<ClCompile Include="..\..\..\cocos\2d\CCAnimation.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCAnimationCache.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCAtlasNode.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCCamera.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCClippingNode.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCComponent.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCComponentContainer.cpp" />
@ -454,6 +455,7 @@
<ClCompile Include="..\..\..\cocos\2d\CCLabelTextFormatter.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCLabelTTF.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCLayer.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCLight.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCMenu.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCMenuItem.cpp" />
<ClCompile Include="..\..\..\cocos\2d\CCMotionStreak.cpp" />
@ -485,7 +487,6 @@
<ClCompile Include="..\..\..\cocos\base\atitc.cpp" />
<ClCompile Include="..\..\..\cocos\base\base64.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCCamera.cpp" />
<ClCompile Include="..\..\..\cocos\base\ccCArray.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCConfiguration.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCConsole.cpp" />
@ -519,7 +520,6 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\..\..\cocos\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCLight.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCNS.cpp" />
<ClCompile Include="..\..\..\cocos\base\CCProfiling.cpp" />
<ClCompile Include="..\..\..\cocos\base\ccRandom.cpp" />

View File

@ -94,9 +94,6 @@
<ClCompile Include="..\..\..\cocos\base\CCAutoreleasePool.cpp">
<Filter>libcoco2d\base</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cocos\base\CCCamera.cpp">
<Filter>libcoco2d\base</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cocos\base\ccCArray.cpp">
<Filter>libcoco2d\base</Filter>
</ClCompile>
@ -175,9 +172,6 @@
<ClCompile Include="..\..\..\cocos\base\CCIMEDispatcher.cpp">
<Filter>libcoco2d\base</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cocos\base\CCLight.cpp">
<Filter>libcoco2d\base</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cocos\base\CCNS.cpp">
<Filter>libcoco2d\base</Filter>
</ClCompile>
@ -583,6 +577,12 @@
<ClCompile Include="..\..\..\external\unzip\ioapi_mem.cpp">
<Filter>libcoco2d\external\unzip</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cocos\2d\CCCamera.cpp">
<Filter>libcoco2d\2d</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cocos\2d\CCLight.cpp">
<Filter>libcoco2d\2d</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="App.xaml.h" />
@ -615,9 +615,6 @@
<ClInclude Include="..\..\..\cocos\base\CCAutoreleasePool.h">
<Filter>libcoco2d\base</Filter>
</ClInclude>
<ClInclude Include="..\..\..\cocos\base\CCCamera.h">
<Filter>libcoco2d\base</Filter>
</ClInclude>
<ClInclude Include="..\..\..\cocos\base\ccCArray.h">
<Filter>libcoco2d\base</Filter>
</ClInclude>
@ -708,9 +705,6 @@
<ClInclude Include="..\..\..\cocos\base\CCIMEDispatcher.h">
<Filter>libcoco2d\base</Filter>
</ClInclude>
<ClInclude Include="..\..\..\cocos\base\CCLight.h">
<Filter>libcoco2d\base</Filter>
</ClInclude>
<ClInclude Include="..\..\..\cocos\base\ccMacros.h">
<Filter>libcoco2d\base</Filter>
</ClInclude>
@ -1155,6 +1149,12 @@
<ClInclude Include="..\..\..\external\unzip\ioapi_mem.h">
<Filter>libcoco2d\external\unzip</Filter>
</ClInclude>
<ClInclude Include="..\..\..\cocos\2d\CCCamera.h">
<Filter>libcoco2d\2d</Filter>
</ClInclude>
<ClInclude Include="..\..\..\cocos\2d\CCLight.h">
<Filter>libcoco2d\2d</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />

View File

@ -28,7 +28,6 @@ THE SOFTWARE.
#include "CCPrecompiledShaders.h"
using namespace Concurrency;
using namespace DirectX;
using namespace Microsoft::WRL;
using namespace Windows::Foundation;
using namespace Windows::UI::Core;

View File

@ -1,4 +1,5 @@
How to compile precompiled shaders for Windows Phone 8.0 (WP8)
You need to use VS2013 with update 3.
1. Open the VS project Cocos2dShaderCompiler\Cocos2dShaderCompiler.sln
2. Build and run the project

View File

@ -21,7 +21,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "base/CCCamera.h"
#include "2d/CCCamera.h"
#include "base/CCDirector.h"
#include "platform/CCGLView.h"
#include "2d/CCScene.h"

View File

@ -67,7 +67,7 @@ FontAtlas::FontAtlas(Font &theFont)
auto outlineSize = fontTTf->getOutlineSize();
if(outlineSize > 0)
{
_commonLineHeight += 2 * outlineSize * CC_CONTENT_SCALE_FACTOR();
_commonLineHeight += 2 * outlineSize;
_currentPageDataSize *= 2;
}

View File

@ -95,12 +95,12 @@ FT_Library FontFreeType::getFTLibrary()
FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */,int outline /* = 0 */)
: _fontRef(nullptr)
,_distanceFieldEnabled(distanceFieldEnabled)
,_outlineSize(outline)
,_outlineSize(0.0f)
,_stroker(nullptr)
{
if (_outlineSize > 0)
if (outline > 0)
{
_outlineSize *= CC_CONTENT_SCALE_FACTOR();
_outlineSize = outline * CC_CONTENT_SCALE_FACTOR();
FT_Stroker_New(FontFreeType::getFTLibrary(), &_stroker);
FT_Stroker_Set(_stroker,
(int)(_outlineSize * 64),
@ -328,8 +328,6 @@ unsigned char* FontFreeType::getGlyphBitmap(unsigned short theChar, long &outWid
}
}
outRect.origin.x = bbox.xMin >> 6;
outRect.origin.y = - (bbox.yMax >> 6);
xAdvance += 2 * _outlineSize;
outRect.size.width = blendWidth;
outRect.size.height = blendHeight;

View File

@ -151,15 +151,15 @@ bool LabelTextFormatter::multilineText(Label *theLabel)
else
{
StringUtils::trimUTF16Vector(last_word);
if (isStartOfLine)
//issue #8492:endless loop if not using system font, and constrained length is less than one character width
if (isStartOfLine && last_word.size() == 0)
last_word.push_back(character);
else
--j;
last_word.push_back('\n');
multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());
last_word.clear();
if (!isStartOfLine)
--j;
isStartOfWord = false;
isStartOfLine = false;

View File

@ -1,4 +1,4 @@
#include "base/CCLight.h"
#include "2d/CCLight.h"
#include "2d/CCScene.h"
NS_CC_BEGIN

View File

@ -37,7 +37,7 @@ THE SOFTWARE.
#include "base/CCDirector.h"
#include "base/CCScheduler.h"
#include "base/CCEventDispatcher.h"
#include "base/CCCamera.h"
#include "2d/CCCamera.h"
#include "2d/CCActionManager.h"
#include "2d/CCScene.h"
#include "2d/CCComponent.h"

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
#include "2d/CCScene.h"
#include "base/CCDirector.h"
#include "base/CCCamera.h"
#include "2d/CCCamera.h"
#include "base/CCEventDispatcher.h"
#include "base/CCEventListenerCustom.h"
#include "renderer/CCRenderer.h"

View File

@ -195,7 +195,6 @@ void TextFieldTTF::insertText(const char * text, size_t len)
if (len > 0)
{
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8 && CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
if (_delegate && _delegate->onTextFieldInsertText(this, insert.c_str(), len))
{
// delegate doesn't want to insert text
@ -206,15 +205,6 @@ void TextFieldTTF::insertText(const char * text, size_t len)
std::string sText(_inputText);
sText.append(insert);
setString(sText);
#else
size_t existlen = _inputText.length();
if (_delegate && _delegate->onTextFieldInsertText(this, insert.c_str() + existlen, len - existlen))
{
// delegate doesn't want to insert text
return;
}
setString(insert);
#endif
}
if ((int)insert.npos == pos) {

View File

@ -20,6 +20,7 @@ set(COCOS_2D_SRC
2d/CCAnimationCache.cpp
2d/CCAnimation.cpp
2d/CCAtlasNode.cpp
2d/CCCamera.cpp
2d/CCClippingNode.cpp
2d/CCClippingRectangleNode.cpp
2d/CCComponentContainer.cpp
@ -43,6 +44,7 @@ set(COCOS_2D_SRC
2d/CCLabelTextFormatter.cpp
2d/CCLabelTTF.cpp
2d/CCLayer.cpp
2d/CCLight.cpp
2d/CCMenu.cpp
2d/CCMenuItem.cpp
2d/CCMotionStreak.cpp

View File

@ -253,7 +253,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\base64.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCCamera.cpp" />
<ClCompile Include="..\base\ccCArray.cpp" />
<ClCompile Include="..\base\CCConfiguration.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
@ -277,7 +276,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\base\CCEventTouch.cpp" />
<ClCompile Include="..\base\ccFPSImages.c" />
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\base\CCLight.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCProfiling.cpp" />
<ClCompile Include="..\base\ccRandom.cpp" />
@ -481,6 +479,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="CCAnimation.cpp" />
<ClCompile Include="CCAnimationCache.cpp" />
<ClCompile Include="CCAtlasNode.cpp" />
<ClCompile Include="CCCamera.cpp" />
<ClCompile Include="CCClippingNode.cpp" />
<ClCompile Include="CCClippingRectangleNode.cpp" />
<ClCompile Include="CCComponent.cpp" />
@ -504,6 +503,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="CCLabelTextFormatter.cpp" />
<ClCompile Include="CCLabelTTF.cpp" />
<ClCompile Include="CCLayer.cpp" />
<ClCompile Include="CCLight.cpp" />
<ClCompile Include="CCMenu.cpp" />
<ClCompile Include="CCMenuItem.cpp" />
<ClCompile Include="CCMotionStreak.cpp" />
@ -637,7 +637,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\base64.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCCamera.h" />
<ClInclude Include="..\base\ccCArray.h" />
<ClInclude Include="..\base\ccConfig.h" />
<ClInclude Include="..\base\CCConfiguration.h" />
@ -664,7 +663,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\base\ccFPSImages.h" />
<ClInclude Include="..\base\CCIMEDelegate.h" />
<ClInclude Include="..\base\CCIMEDispatcher.h" />
<ClInclude Include="..\base\CCLight.h" />
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCNS.h" />
@ -905,6 +903,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="CCAnimation.h" />
<ClInclude Include="CCAnimationCache.h" />
<ClInclude Include="CCAtlasNode.h" />
<ClInclude Include="CCCamera.h" />
<ClInclude Include="CCClippingNode.h" />
<ClInclude Include="CCClippingRectangleNode.h" />
<ClInclude Include="CCComponent.h" />
@ -928,6 +927,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="CCLabelTextFormatter.h" />
<ClInclude Include="CCLabelTTF.h" />
<ClInclude Include="CCLayer.h" />
<ClInclude Include="CCLight.h" />
<ClInclude Include="CCMenu.h" />
<ClInclude Include="CCMenuItem.h" />
<ClInclude Include="CCMotionStreak.h" />

View File

@ -727,9 +727,6 @@
<ClCompile Include="CCProtectedNode.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="..\base\CCCamera.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitive.cpp">
<Filter>renderer</Filter>
</ClCompile>
@ -1198,9 +1195,6 @@
<ClCompile Include="..\ui\UIWebView.cpp">
<Filter>ui\UIWidgets</Filter>
</ClCompile>
<ClCompile Include="..\base\CCLight.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\audio\AudioEngine.cpp">
<Filter>audioengine</Filter>
</ClCompile>
@ -1265,6 +1259,12 @@
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.cc">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="CCCamera.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCLight.cpp">
<Filter>2d</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1841,9 +1841,6 @@
<ClInclude Include="CCProtectedNode.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="..\base\CCCamera.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitive.h">
<Filter>renderer</Filter>
</ClInclude>
@ -2414,9 +2411,6 @@
<ClInclude Include="..\ui\UIWebView.h">
<Filter>ui\UIWidgets</Filter>
</ClInclude>
<ClInclude Include="..\base\CCLight.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\audio\include\AudioEngine.h">
<Filter>audioengine</Filter>
</ClInclude>
@ -2529,6 +2523,12 @@
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\type_traits.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="CCCamera.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCLight.h">
<Filter>2d</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -115,7 +115,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\atitc.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\base64.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCAutoreleasePool.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCCamera.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccCArray.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccConfig.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCConfiguration.h" />
@ -146,7 +145,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCGameController.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCIMEDelegate.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCIMEDispatcher.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCLight.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccMacros.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCMap.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNS.h" />
@ -328,6 +326,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\inet_ntop_winrt.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\InputEvent.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\InputEventTypes.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\Keyboard-winrt.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\pch.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\sha1.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCBatchCommand.h" />
@ -359,6 +358,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UICheckBox.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIDeprecated.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIEditBox\UIEditBox.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIEditBox\UIEditBoxImpl-winrt.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIEditBox\UIEditBoxImpl.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIHBox.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIHelper.h" />
@ -397,6 +397,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCAnimation.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCAnimationCache.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCAtlasNode.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCCamera.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingNode.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingRectangleNode.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCComponent.h" />
@ -420,6 +421,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCLabelTextFormatter.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCLabelTTF.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCLayer.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCLight.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCMenu.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCMenuItem.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCMotionStreak.h" />
@ -532,7 +534,6 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\atitc.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\base64.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCCamera.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccCArray.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCConfiguration.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCConsole.cpp" />
@ -559,13 +560,11 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCEventTouch.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccFPSImages.c">
<CompileAsWinRT>false</CompileAsWinRT>
<CompileAs>CompileAsCpp</CompileAs>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCLight.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNS.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCProfiling.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccRandom.cpp" />
@ -709,6 +708,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCWinRTUtils.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\inet_ntop_winrt.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\InputEvent.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\Keyboard-winrt.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
<ForcedIncludeFiles>
@ -742,7 +742,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UICheckBox.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIDeprecated.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIEditBox\UIEditBox.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIEditBox\UIEditBoxImpl-stub.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIEditBox\UIEditBoxImpl-winrt.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIHBox.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIHelper.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIImageView.cpp" />
@ -780,6 +780,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCAnimation.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCAnimationCache.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCAtlasNode.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCCamera.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingNode.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingRectangleNode.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCComponent.cpp" />
@ -803,6 +804,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCLabelTextFormatter.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCLabelTTF.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCLayer.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCLight.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCMenu.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCMenuItem.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCMotionStreak.cpp" />
@ -867,8 +869,13 @@
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\ccShader_PositionTextureColor_noMVP.vert" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\ccShader_PositionTexture_uColor.frag" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\ccShader_PositionTexture_uColor.vert" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\ccShader_Position_uColor-no-gl_PointSize.vert">
<FileType>Document</FileType>
</None>
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\ccShader_Position_uColor.frag" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\ccShader_Position_uColor.vert" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\cocos2d.def" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\libcocos2d.vcxproj.filters" />
<None Include="$(MSBuildThisFileDirectory)..\..\..\libcocos2d_wp8.vcxproj.filters" />
</ItemGroup>
</Project>

View File

@ -109,7 +109,7 @@
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -127,7 +127,7 @@
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -145,7 +145,7 @@
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -163,7 +163,7 @@
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CC_NO_GL_POINTSIZE;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

View File

@ -266,7 +266,6 @@
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\base64.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCCamera.h" />
<ClInclude Include="..\base\ccCArray.h" />
<ClInclude Include="..\base\ccConfig.h" />
<ClInclude Include="..\base\CCConfiguration.h" />
@ -293,7 +292,6 @@
<ClInclude Include="..\base\ccFPSImages.h" />
<ClInclude Include="..\base\CCIMEDelegate.h" />
<ClInclude Include="..\base\CCIMEDispatcher.h" />
<ClInclude Include="..\base\CCLight.h" />
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCNS.h" />
@ -542,6 +540,7 @@
<ClInclude Include="CCAnimation.h" />
<ClInclude Include="CCAnimationCache.h" />
<ClInclude Include="CCAtlasNode.h" />
<ClInclude Include="CCCamera.h" />
<ClInclude Include="CCClippingNode.h" />
<ClInclude Include="CCClippingRectangleNode.h" />
<ClInclude Include="CCComponent.h" />
@ -565,6 +564,7 @@
<ClInclude Include="CCLabelTextFormatter.h" />
<ClInclude Include="CCLabelTTF.h" />
<ClInclude Include="CCLayer.h" />
<ClInclude Include="CCLight.h" />
<ClInclude Include="CCMenu.h" />
<ClInclude Include="CCMenuItem.h" />
<ClInclude Include="CCMotionStreak.h" />
@ -733,7 +733,6 @@
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\base64.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCCamera.cpp" />
<ClCompile Include="..\base\ccCArray.cpp" />
<ClCompile Include="..\base\CCConfiguration.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
@ -782,7 +781,6 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\base\CCLight.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCProfiling.cpp" />
<ClCompile Include="..\base\ccRandom.cpp" />
@ -1000,6 +998,7 @@
<ClCompile Include="CCAnimation.cpp" />
<ClCompile Include="CCAnimationCache.cpp" />
<ClCompile Include="CCAtlasNode.cpp" />
<ClCompile Include="CCCamera.cpp" />
<ClCompile Include="CCClippingNode.cpp" />
<ClCompile Include="CCClippingRectangleNode.cpp" />
<ClCompile Include="CCComponent.cpp" />
@ -1023,6 +1022,7 @@
<ClCompile Include="CCLabelTextFormatter.cpp" />
<ClCompile Include="CCLabelTTF.cpp" />
<ClCompile Include="CCLayer.cpp" />
<ClCompile Include="CCLight.cpp" />
<ClCompile Include="CCMenu.cpp" />
<ClCompile Include="CCMenuItem.cpp" />
<ClCompile Include="CCMotionStreak.cpp" />

View File

@ -286,6 +286,9 @@
<ClCompile Include="CCAtlasNode.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCCamera.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCClippingNode.cpp">
<Filter>2d</Filter>
</ClCompile>
@ -352,6 +355,9 @@
<ClCompile Include="CCLayer.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCLight.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCMenu.cpp">
<Filter>2d</Filter>
</ClCompile>
@ -493,9 +499,6 @@
<ClCompile Include="..\base\CCAutoreleasePool.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCCamera.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\ccCArray.cpp">
<Filter>base</Filter>
</ClCompile>
@ -565,9 +568,6 @@
<ClCompile Include="..\base\CCIMEDispatcher.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCLight.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCNS.cpp">
<Filter>base</Filter>
</ClCompile>
@ -1343,6 +1343,9 @@
<ClInclude Include="CCAtlasNode.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCCamera.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCClippingNode.h">
<Filter>2d</Filter>
</ClInclude>
@ -1409,6 +1412,9 @@
<ClInclude Include="CCLayer.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCLight.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCMenu.h">
<Filter>2d</Filter>
</ClInclude>
@ -1556,9 +1562,6 @@
<ClInclude Include="..\base\CCAutoreleasePool.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCCamera.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\ccCArray.h">
<Filter>base</Filter>
</ClInclude>
@ -1637,9 +1640,6 @@
<ClInclude Include="..\base\CCIMEDispatcher.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCLight.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\ccMacros.h">
<Filter>base</Filter>
</ClInclude>

View File

@ -25,7 +25,7 @@
#include "3d/CCBillBoard.h"
#include "2d/CCSpriteFrameCache.h"
#include "base/CCDirector.h"
#include "base/CCCamera.h"
#include "2d/CCCamera.h"
#include "renderer/CCRenderer.h"
#include "renderer/CCGLProgramCache.h"

View File

@ -354,11 +354,11 @@ bool Bundle3D::loadAnimationData(const std::string& id, Animation3DData* animati
if (_isBinary)
{
return loadAnimationDataBinary(animationdata);
return loadAnimationDataBinary(id,animationdata);
}
else
{
return loadAnimationDataJson(animationdata);
return loadAnimationDataJson(id,animationdata);
}
}
@ -1189,7 +1189,7 @@ bool Bundle3D::loadMaterialDataJson_0_2(MaterialDatas& materialdatas)
return true;
}
bool Bundle3D::loadAnimationDataJson(Animation3DData* animationdata)
bool Bundle3D::loadAnimationDataJson(const std::string& id, Animation3DData* animationdata)
{
std::string anim = "";
if (_version == "1.2" || _version == "0.2")
@ -1198,11 +1198,26 @@ bool Bundle3D::loadAnimationDataJson(Animation3DData* animationdata)
anim = ANIMATIONS;
if (!_jsonReader.HasMember(anim.c_str())) return false;
int the_index = -1;
const rapidjson::Value& animation_data_array = _jsonReader[anim.c_str()];
if (animation_data_array.Size()==0) return false;
const rapidjson::Value& animation_data_array_val_0 = animation_data_array[(rapidjson::SizeType)0];
if(!id.empty())
{
for(int i=0 ;i<animation_data_array.Size();i++)
{
if(animation_data_array[i][ID].GetString() ==id )
{
the_index = i;
}
}
if(the_index < 0) return false;
}else{
the_index = 0;
}
const rapidjson::Value& animation_data_array_val_0 = animation_data_array[(rapidjson::SizeType)the_index];
animationdata->_totalTime = animation_data_array_val_0[LENGTH].GetDouble();
@ -1609,11 +1624,11 @@ bool Bundle3D::loadMaterialDataBinary(MaterialData* materialdata)
return true;
}
bool Bundle3D::loadAnimationDataBinary(Animation3DData* animationdata)
bool Bundle3D::loadAnimationDataBinary(const std::string& id, Animation3DData* animationdata)
{
if (!seekToFirstType(BUNDLE_TYPE_ANIMATIONS))
return false;
unsigned int animNum=0;
unsigned int animNum = 1;
if( _version == "0.3"|| _version == "0.4")
{
if (!_binaryReader.read(&animNum))
@ -1622,106 +1637,124 @@ bool Bundle3D::loadAnimationDataBinary(Animation3DData* animationdata)
return false;
}
}
std::string id = _binaryReader.readString();
if (!_binaryReader.read(&animationdata->_totalTime))
bool has_found =false;
for(unsigned int k = 0; k < animNum ; k++ )
{
CCLOG("warning: Failed to read AnimationData: totalTime '%s'.", _path.c_str());
return false;
}
animationdata->resetData();
std::string animId = _binaryReader.readString();
unsigned int nodeAnimationNum;
if (!_binaryReader.read(&nodeAnimationNum))
{
CCLOG("warning: Failed to read AnimationData: animNum '%s'.", _path.c_str());
return false;
}
for (unsigned int i = 0; i < nodeAnimationNum; ++i)
{
std::string boneName = _binaryReader.readString();
unsigned int keyframeNum;
if (!_binaryReader.read(&keyframeNum))
if (!_binaryReader.read(&animationdata->_totalTime))
{
CCLOG("warning: Failed to read AnimationData: keyframeNum '%s'.", _path.c_str());
CCLOG("warning: Failed to read AnimationData: totalTime '%s'.", _path.c_str());
return false;
}
animationdata->_rotationKeys[boneName].reserve(keyframeNum);
animationdata->_scaleKeys[boneName].reserve(keyframeNum);
animationdata->_translationKeys[boneName].reserve(keyframeNum);
for (unsigned int j = 0; j < keyframeNum; ++j)
unsigned int nodeAnimationNum;
if (!_binaryReader.read(&nodeAnimationNum))
{
float keytime;
if (!_binaryReader.read(&keytime))
CCLOG("warning: Failed to read AnimationData: animNum '%s'.", _path.c_str());
return false;
}
for (unsigned int i = 0; i < nodeAnimationNum; ++i)
{
std::string boneName = _binaryReader.readString();
unsigned int keyframeNum;
if (!_binaryReader.read(&keyframeNum))
{
CCLOG("warning: Failed to read AnimationData: keytime '%s'.", _path.c_str());
CCLOG("warning: Failed to read AnimationData: keyframeNum '%s'.", _path.c_str());
return false;
}
// transform flag
unsigned char transformFlag(0);
if (_version == "0.4")
animationdata->_rotationKeys[boneName].reserve(keyframeNum);
animationdata->_scaleKeys[boneName].reserve(keyframeNum);
animationdata->_translationKeys[boneName].reserve(keyframeNum);
for (unsigned int j = 0; j < keyframeNum; ++j)
{
if (!_binaryReader.read(&transformFlag))
float keytime;
if (!_binaryReader.read(&keytime))
{
CCLOG("warning: Failed to read AnimationData: transformFlag '%s'.", _path.c_str());
CCLOG("warning: Failed to read AnimationData: keytime '%s'.", _path.c_str());
return false;
}
// transform flag
unsigned char transformFlag(0);
if (_version == "0.4")
{
if (!_binaryReader.read(&transformFlag))
{
CCLOG("warning: Failed to read AnimationData: transformFlag '%s'.", _path.c_str());
return false;
}
}
// rotation
bool hasRotate = true;
if (_version == "0.4")
hasRotate = transformFlag & 0x01;
if (hasRotate)
{
Quaternion rotate;
if (_binaryReader.read(&rotate, 4, 4) != 4)
{
CCLOG("warning: Failed to read AnimationData: rotate '%s'.", _path.c_str());
return false;
}
animationdata->_rotationKeys[boneName].push_back(Animation3DData::QuatKey(keytime, rotate));
}
// scale
bool hasScale = true;
if (_version == "0.4")
hasScale = (transformFlag >> 1) & 0x01;
if (hasScale)
{
Vec3 scale;
if (_binaryReader.read(&scale, 4, 3) != 3)
{
CCLOG("warning: Failed to read AnimationData: scale '%s'.", _path.c_str());
return false;
}
animationdata->_scaleKeys[boneName].push_back(Animation3DData::Vec3Key(keytime, scale));
}
// translation
bool hasTranslation = true;
if (_version == "0.4")
hasTranslation = (transformFlag >> 2) & 0x01;
if (hasTranslation)
{
Vec3 position;
if (_binaryReader.read(&position, 4, 3) != 3)
{
CCLOG("warning: Failed to read AnimationData: position '%s'.", _path.c_str());
return false;
}
animationdata->_translationKeys[boneName].push_back(Animation3DData::Vec3Key(keytime, position));
}
}
// rotation
bool hasRotate = true;
if (_version == "0.4")
hasRotate = transformFlag & 0x01;
if (hasRotate)
{
Quaternion rotate;
if (_binaryReader.read(&rotate, 4, 4) != 4)
{
CCLOG("warning: Failed to read AnimationData: rotate '%s'.", _path.c_str());
return false;
}
animationdata->_rotationKeys[boneName].push_back(Animation3DData::QuatKey(keytime, rotate));
}
// scale
bool hasScale = true;
if (_version == "0.4")
hasScale = (transformFlag >> 1) & 0x01;
if (hasScale)
{
Vec3 scale;
if (_binaryReader.read(&scale, 4, 3) != 3)
{
CCLOG("warning: Failed to read AnimationData: scale '%s'.", _path.c_str());
return false;
}
animationdata->_scaleKeys[boneName].push_back(Animation3DData::Vec3Key(keytime, scale));
}
// translation
bool hasTranslation = true;
if (_version == "0.4")
hasTranslation = (transformFlag >> 2) & 0x01;
if (hasTranslation)
{
Vec3 position;
if (_binaryReader.read(&position, 4, 3) != 3)
{
CCLOG("warning: Failed to read AnimationData: position '%s'.", _path.c_str());
return false;
}
animationdata->_translationKeys[boneName].push_back(Animation3DData::Vec3Key(keytime, position));
}
}
if( id == animId || id.empty())
{
has_found = true;
break;
}
}
if(!has_found)
{
animationdata->resetData();
return false;
}
return true;
}
bool Bundle3D::loadNodesJson(NodeDatas& nodedatas)
{
if (!_jsonReader.HasMember(NODES)) return false;

View File

@ -114,7 +114,7 @@ protected:
bool loadMaterialDataJson(MaterialData* materialdata){return true;}
bool loadMaterialDataJson_0_1(MaterialData* materialdata){return true;}
bool loadMaterialDataJson_0_2(MaterialData* materialdata){return true;}
bool loadAnimationDataJson(Animation3DData* animationdata);
bool loadAnimationDataJson(const std::string& id,Animation3DData* animationdata);
/**
* load data in binary
* @param path The c3b file path
@ -145,7 +145,7 @@ protected:
* load animation data in binary
* @param animationdata The animation data pointer
*/
bool loadAnimationDataBinary(Animation3DData* animationdata);
bool loadAnimationDataBinary(const std::string& id,Animation3DData* animationdata);
bool checkIsBone(const std::string& name);

View File

@ -230,10 +230,31 @@ void Mesh::calcuateAABB()
_aabb = _meshIndexData->getAABB();
if (_skin)
{
Bone3D* root = _skin->getRootBone();
//get skin root
Bone3D* root = nullptr;
Mat4 invBindPose;
if (_skin->_skinBones.size())
{
root = _skin->_skinBones.at(0);
while (root) {
auto parent = root->getParentBone();
bool parentInSkinBone = false;
for (const auto& bone : _skin->_skinBones) {
if (bone == parent)
{
parentInSkinBone = true;
break;
}
}
if (!parentInSkinBone)
break;
root = parent;
}
}
if (root)
{
_aabb.transform(root->getWorldMat());
_aabb.transform(root->getWorldMat() * _skin->getInvBindPose(root));
}
}
}

View File

@ -146,4 +146,15 @@ Bone3D* MeshSkin::getRootBone() const
return root;
}
const Mat4& MeshSkin::getInvBindPose(const Bone3D* bone)
{
for (ssize_t i = 0; i < _skinBones.size(); i++) {
if (_skinBones.at(i) == bone)
{
return _invBindPoses.at(i);
}
}
return Mat4::IDENTITY;
}
NS_CC_END

View File

@ -42,6 +42,7 @@ class Skeleton3D;
*/
class CC_DLL MeshSkin: public Ref
{
friend class Mesh;
public:
/**create a new meshskin if do not want to share meshskin*/
@ -80,6 +81,9 @@ CC_CONSTRUCTOR_ACCESS:
/**add skin bone*/
void addSkinBone(Bone3D* bone);
/** get inverse bind pose */
const Mat4& getInvBindPose(const Bone3D* bone);
protected:
Vector<Bone3D*> _skinBones; // bones with skin

View File

@ -31,8 +31,8 @@
#include "3d/CCMesh.h"
#include "base/CCDirector.h"
#include "base/CCLight.h"
#include "base/CCCamera.h"
#include "2d/CCLight.h"
#include "2d/CCCamera.h"
#include "base/ccMacros.h"
#include "platform/CCPlatformMacros.h"
#include "platform/CCFileUtils.h"
@ -92,6 +92,14 @@ bool Sprite3D::loadFromCache(const std::string& path)
}
}
for(const auto& it : spritedata->nodedatas->skeleton)
{
if(it)
{
createAttachSprite3DNode(it,*(spritedata->materialdatas));
}
}
for (ssize_t i = 0; i < _meshes.size(); i++) {
_meshes.at(i)->setGLProgramState(spritedata->glProgramStates.at(i));
}

View File

@ -69,6 +69,9 @@ public:
/**get mesh*/
Mesh* getMesh() const { return _meshes.at(0); }
/** get mesh count */
ssize_t getMeshCount() const { return _meshes.size(); }
/**get skin*/
CC_DEPRECATED_ATTRIBUTE MeshSkin* getSkin() const;

View File

@ -24,6 +24,7 @@ cocos2d.cpp \
2d/CCAnimation.cpp \
2d/CCAnimationCache.cpp \
2d/CCAtlasNode.cpp \
2d/CCCamera.cpp \
2d/CCClippingNode.cpp \
2d/CCClippingRectangleNode.cpp \
2d/CCComponent.cpp \
@ -45,6 +46,7 @@ cocos2d.cpp \
2d/CCLabelTTF.cpp \
2d/CCLabelTextFormatter.cpp \
2d/CCLayer.cpp \
2d/CCLight.cpp \
2d/CCMenu.cpp \
2d/CCMenuItem.cpp \
2d/CCMotionStreak.cpp \
@ -91,7 +93,6 @@ math/Vec2.cpp \
math/Vec3.cpp \
math/Vec4.cpp \
base/CCAutoreleasePool.cpp \
base/CCCamera.cpp \
base/CCConfiguration.cpp \
base/CCConsole.cpp \
base/CCData.cpp \
@ -115,7 +116,6 @@ base/CCEventListenerTouch.cpp \
base/CCEventMouse.cpp \
base/CCEventTouch.cpp \
base/CCIMEDispatcher.cpp \
base/CCLight.cpp \
base/CCNS.cpp \
base/CCProfiling.cpp \
base/ccRandom.cpp \

View File

@ -145,7 +145,7 @@ if(MINGW)
elseif(WINDOWS)
set(PLATFORM_SPECIFIC_LIBS libjpeg libpng libwebp libtiff libcurl_imp libwebsockets freetype250 glfw3 glew32 opengl32 libiconv libzlib)
elseif(LINUX)
set(PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets
set(PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets ssl crypto
fontconfig png pthread glfw GLEW GL X11 rt z protobuf ${FMOD_LIB})
elseif(MACOSX OR APPLE)
INCLUDE_DIRECTORIES ( /System/Library/Frameworks )

View File

@ -217,7 +217,7 @@ bool AudioEngineImpl::init()
return ret;
}
int AudioEngineImpl::play2d(const std::string &fileFullPath ,bool loop ,float volume)
int AudioEngineImpl::play2d(const std::string &filePath ,bool loop ,float volume)
{
auto audioId = AudioEngine::INVAILD_AUDIO_ID;
@ -227,10 +227,10 @@ int AudioEngineImpl::play2d(const std::string &fileFullPath ,bool loop ,float vo
break;
auto& player = _audioPlayers[currentAudioID];
auto initPlayer = player.init( _engineEngine, _outputMixObject, fileFullPath, volume, loop);
auto initPlayer = player.init( _engineEngine, _outputMixObject, FileUtils::getInstance()->fullPathForFilename(filePath), volume, loop);
if (!initPlayer){
_audioPlayers.erase(currentAudioID);
log("%s,%d message:create player for %s fail", __func__, __LINE__, fileFullPath.c_str());
log("%s,%d message:create player for %s fail", __func__, __LINE__, filePath.c_str());
break;
}

View File

@ -47,7 +47,7 @@ THE SOFTWARE.
#include "renderer/CCTextureCache.h"
#include "renderer/ccGLStateCache.h"
#include "renderer/CCRenderer.h"
#include "base/CCCamera.h"
#include "2d/CCCamera.h"
#include "base/CCUserDefault.h"
#include "base/ccFPSImages.h"
#include "base/CCScheduler.h"
@ -155,9 +155,8 @@ bool Director::init(void)
_renderer = new (std::nothrow) Renderer;
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
_console = new (std::nothrow) Console;
#endif
return true;
}
@ -181,9 +180,8 @@ Director::~Director(void)
delete _renderer;
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
delete _console;
#endif
CC_SAFE_RELEASE(_eventDispatcher);

View File

@ -8,10 +8,8 @@ endif()
# todo: also base/CCController-android.cpp
set(COCOS_BASE_SRC
base/CCLight.cpp
base/ccFPSImages.c
base/CCAutoreleasePool.cpp
base/CCCamera.cpp
base/CCConfiguration.cpp
base/CCConsole.cpp
base/CCController.cpp

View File

@ -86,7 +86,7 @@ namespace utils
/**
* calculate all children's boundingBox
*/
Rect getCascadeBoundingBox(Node *node);
Rect CC_DLL getCascadeBoundingBox(Node *node);
}
NS_CC_END

View File

@ -61,8 +61,6 @@ THE SOFTWARE.
#include "base/CCIMEDelegate.h"
#include "base/CCIMEDispatcher.h"
#include "base/ccUtils.h"
#include "base/CCCamera.h"
#include "base/CCLight.h"
// EventDispatcher
#include "base/CCEventType.h"
@ -140,6 +138,9 @@ THE SOFTWARE.
#include "2d/CCGrabber.h"
#include "2d/CCGrid.h"
#include "2d/CCCamera.h"
#include "2d/CCLight.h"
// include
#include "base/CCProtocols.h"

View File

@ -47,7 +47,7 @@ static const char* FrameType_ScaleFrame = "ScaleFrame";
static const char* FrameType_RotationFrame = "RotationFrame";
static const char* FrameType_SkewFrame = "SkewFrame";
static const char* FrameType_RotationSkewFrame = "RotationSkewFrame";
static const char* FrameType_AnchorFrame = "AnchorFrame";
static const char* FrameType_AnchorFrame = "AnchorPointFrame";
static const char* FrameType_InnerActionFrame = "InnerActionFrame";
static const char* FrameType_ColorFrame = "ColorFrame";
static const char* FrameType_TextureFrame = "TextureFrame";

View File

@ -208,8 +208,6 @@ void Timeline::binarySearchKeyFrame(int frameIndex)
void Timeline::updateCurrentKeyFrame(int frameIndex)
{
if(frameIndex > 60)
int a = 0;
//! If play to current frame's front or back, then find current frame again
if (frameIndex < _currentKeyFrameIndex || frameIndex >= _currentKeyFrameIndex + _betweenDuration)
{

View File

@ -141,7 +141,7 @@ void CSLoader::destroyInstance()
CSLoader::CSLoader()
: _recordJsonPath(true)
, _jsonPath("")
, _recordProtocolBuffersPath(true)
, _recordProtocolBuffersPath(false)
, _protocolBuffersPath("")
, _monoCocos2dxVersion("")
{

View File

@ -128,8 +128,7 @@ bool ComAudio::serialize(void* r)
}
if (strcmp(className, "CCBackgroundAudio") == 0)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
// no MP3 support for CC_PLATFORM_WP8
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
std::string::size_type pos = filePath.find(".mp3");
if (pos == filePath.npos)
{

View File

@ -199,6 +199,10 @@ namespace cocostudio
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
bool barTextureScale9Enable = options.scale9enable();
if (barTextureScale9Enable)
{
slider->setUnifySizeEnabled(false);
}
slider->setScale9Enabled(barTextureScale9Enable);
slider->setPercent(options.percent());

View File

@ -133,7 +133,4 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\spine-cocos2dx.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\spine.h" />
</ItemGroup>
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)..\..\CMakeLists.txt" />
</ItemGroup>
</Project>

View File

@ -65,7 +65,4 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\spine.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\spine-cocos2dx.h" />
</ItemGroup>
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)..\..\CMakeLists.txt" />
</ItemGroup>
</Project>

View File

@ -79,27 +79,27 @@ NS_CC_BEGIN
int Device::getDPI()
{
static int dpi = -1;
if (dpi == -1)
{
Display *dpy;
char *displayname = NULL;
int scr = 0; /* Screen number */
dpy = XOpenDisplay (displayname);
/*
* there are 2.54 centimeters to an inch; so there are 25.4 millimeters.
*
* dpi = N pixels / (M millimeters / (25.4 millimeters / 1 inch))
* = N pixels / (M inch / 25.4)
* = N * 25.4 pixels / M inch
*/
double xres = ((((double) DisplayWidth(dpy,scr)) * 25.4) /
((double) DisplayWidthMM(dpy,scr)));
dpi = (int) (xres + 0.5);
//printf("dpi = %d\n", dpi);
XCloseDisplay (dpy);
}
return dpi;
static int dpi = -1;
if (dpi == -1)
{
Display *dpy;
char *displayname = NULL;
int scr = 0; /* Screen number */
dpy = XOpenDisplay (displayname);
/*
* there are 2.54 centimeters to an inch; so there are 25.4 millimeters.
*
* dpi = N pixels / (M millimeters / (25.4 millimeters / 1 inch))
* = N pixels / (M inch / 25.4)
* = N * 25.4 pixels / M inch
*/
double xres = ((((double) DisplayWidth(dpy,scr)) * 25.4) /
((double) DisplayWidthMM(dpy,scr)));
dpi = (int) (xres + 0.5);
//printf("dpi = %d\n", dpi);
XCloseDisplay (dpy);
}
return dpi;
}
void Device::setAccelerometerEnabled(bool isEnabled)
@ -115,25 +115,25 @@ void Device::setAccelerometerInterval(float interval)
class BitmapDC
{
public:
BitmapDC() {
libError = FT_Init_FreeType( &library );
FcInit();
_data = NULL;
reset();
}
BitmapDC() {
libError = FT_Init_FreeType( &library );
FcInit();
_data = NULL;
reset();
}
~BitmapDC() {
FT_Done_FreeType(library);
FcFini();
~BitmapDC() {
FT_Done_FreeType(library);
FcFini();
reset();
}
}
void reset() {
iMaxLineWidth = 0;
iMaxLineHeight = 0;
textLines.clear();
}
void reset() {
iMaxLineWidth = 0;
iMaxLineHeight = 0;
textLines.clear();
}
int utf8(char **p)
{
@ -171,268 +171,268 @@ public:
}
bool isBreakPoint(FT_UInt currentCharacter, FT_UInt previousCharacter) {
if ( previousCharacter == '-' || previousCharacter == '/' || previousCharacter == '\\' ) {
// we can insert a line break after one of these characters
return true;
}
return false;
if ( previousCharacter == '-' || previousCharacter == '/' || previousCharacter == '\\' ) {
// we can insert a line break after one of these characters
return true;
}
return false;
}
bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) {
const char* pText = sText;
textLines.clear();
iMaxLineWidth = 0;
bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) {
const char* pText = sText;
textLines.clear();
iMaxLineWidth = 0;
FT_UInt unicode;
FT_UInt prevCharacter = 0;
FT_UInt glyphIndex = 0;
FT_UInt prevGlyphIndex = 0;
FT_Vector delta;
LineBreakLine currentLine;
FT_UInt unicode;
FT_UInt prevCharacter = 0;
FT_UInt glyphIndex = 0;
FT_UInt prevGlyphIndex = 0;
FT_Vector delta;
LineBreakLine currentLine;
int currentPaintPosition = 0;
int lastBreakIndex = -1;
bool hasKerning = FT_HAS_KERNING( face );
int currentPaintPosition = 0;
int lastBreakIndex = -1;
bool hasKerning = FT_HAS_KERNING( face );
while ((unicode=utf8((char**)&pText))) {
if (unicode == '\n') {
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
currentLine.reset();
prevGlyphIndex = 0;
prevCharacter = 0;
lastBreakIndex = -1;
currentPaintPosition = 0;
continue;
}
if ( isBreakPoint(unicode, prevCharacter) ) {
lastBreakIndex = currentLine.glyphs.size() - 1;
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
currentLine.reset();
prevGlyphIndex = 0;
prevCharacter = 0;
lastBreakIndex = -1;
currentPaintPosition = 0;
continue;
}
glyphIndex = FT_Get_Char_Index(face, unicode);
if (FT_Load_Glyph(face, glyphIndex, FT_LOAD_DEFAULT)) {
return false;
}
if ( isBreakPoint(unicode, prevCharacter) ) {
lastBreakIndex = currentLine.glyphs.size() - 1;
}
if (iswspace(unicode)) {
currentPaintPosition += face->glyph->metrics.horiAdvance >> 6;
prevGlyphIndex = glyphIndex;
prevCharacter = unicode;
lastBreakIndex = currentLine.glyphs.size();
continue;
}
glyphIndex = FT_Get_Char_Index(face, unicode);
if (FT_Load_Glyph(face, glyphIndex, FT_LOAD_DEFAULT)) {
return false;
}
LineBreakGlyph glyph;
glyph.glyphIndex = glyphIndex;
glyph.glyphWidth = face->glyph->metrics.width >> 6;
glyph.bearingX = face->glyph->metrics.horiBearingX >> 6;
glyph.horizAdvance = face->glyph->metrics.horiAdvance >> 6;
glyph.kerning = 0;
if (iswspace(unicode)) {
currentPaintPosition += face->glyph->metrics.horiAdvance >> 6;
prevGlyphIndex = glyphIndex;
prevCharacter = unicode;
lastBreakIndex = currentLine.glyphs.size();
continue;
}
if (prevGlyphIndex != 0 && hasKerning) {
FT_Get_Kerning(face, prevGlyphIndex, glyphIndex, FT_KERNING_DEFAULT, &delta);
glyph.kerning = delta.x >> 6;
}
LineBreakGlyph glyph;
glyph.glyphIndex = glyphIndex;
glyph.glyphWidth = face->glyph->metrics.width >> 6;
glyph.bearingX = face->glyph->metrics.horiBearingX >> 6;
glyph.horizAdvance = face->glyph->metrics.horiAdvance >> 6;
glyph.kerning = 0;
if (iMaxWidth > 0 && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth > iMaxWidth) {
if (prevGlyphIndex != 0 && hasKerning) {
FT_Get_Kerning(face, prevGlyphIndex, glyphIndex, FT_KERNING_DEFAULT, &delta);
glyph.kerning = delta.x >> 6;
}
int glyphCount = currentLine.glyphs.size();
if ( lastBreakIndex >= 0 && lastBreakIndex < glyphCount && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth - currentLine.glyphs.at(lastBreakIndex).paintPosition < iMaxWidth ) {
// we insert a line break at our last break opportunity
std::vector<LineBreakGlyph> tempGlyphs;
std::vector<LineBreakGlyph>::iterator it = currentLine.glyphs.begin();
std::advance(it, lastBreakIndex);
tempGlyphs.insert(tempGlyphs.begin(), it, currentLine.glyphs.end());
currentLine.glyphs.erase(it, currentLine.glyphs.end());
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
currentLine.reset();
currentPaintPosition = 0;
for ( it = tempGlyphs.begin(); it != tempGlyphs.end(); it++ ) {
if ( currentLine.glyphs.empty() ) {
currentPaintPosition = -(*it).bearingX;
(*it).kerning = 0;
}
(*it).paintPosition = currentPaintPosition + (*it).bearingX + (*it).kerning;
currentLine.glyphs.push_back((*it));
currentPaintPosition += (*it).kerning + (*it).horizAdvance;
}
} else {
// the current word is too big to fit into one line, insert line break right here
currentPaintPosition = 0;
glyph.kerning = 0;
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
currentLine.reset();
}
if (iMaxWidth > 0 && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth > iMaxWidth) {
prevGlyphIndex = 0;
prevCharacter = 0;
lastBreakIndex = -1;
} else {
prevGlyphIndex = glyphIndex;
prevCharacter = unicode;
}
int glyphCount = currentLine.glyphs.size();
if ( lastBreakIndex >= 0 && lastBreakIndex < glyphCount && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth - currentLine.glyphs.at(lastBreakIndex).paintPosition < iMaxWidth ) {
// we insert a line break at our last break opportunity
std::vector<LineBreakGlyph> tempGlyphs;
std::vector<LineBreakGlyph>::iterator it = currentLine.glyphs.begin();
std::advance(it, lastBreakIndex);
tempGlyphs.insert(tempGlyphs.begin(), it, currentLine.glyphs.end());
currentLine.glyphs.erase(it, currentLine.glyphs.end());
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
currentLine.reset();
currentPaintPosition = 0;
for ( it = tempGlyphs.begin(); it != tempGlyphs.end(); it++ ) {
if ( currentLine.glyphs.empty() ) {
currentPaintPosition = -(*it).bearingX;
(*it).kerning = 0;
}
(*it).paintPosition = currentPaintPosition + (*it).bearingX + (*it).kerning;
currentLine.glyphs.push_back((*it));
currentPaintPosition += (*it).kerning + (*it).horizAdvance;
}
} else {
// the current word is too big to fit into one line, insert line break right here
currentPaintPosition = 0;
glyph.kerning = 0;
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
currentLine.reset();
}
if ( currentLine.glyphs.empty() ) {
currentPaintPosition = -glyph.bearingX;
}
glyph.paintPosition = currentPaintPosition + glyph.bearingX + glyph.kerning;
currentLine.glyphs.push_back(glyph);
currentPaintPosition += glyph.kerning + glyph.horizAdvance;
}
prevGlyphIndex = 0;
prevCharacter = 0;
lastBreakIndex = -1;
} else {
prevGlyphIndex = glyphIndex;
prevCharacter = unicode;
}
if ( currentLine.glyphs.empty() == false ) {
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
}
return true;
}
if ( currentLine.glyphs.empty() ) {
currentPaintPosition = -glyph.bearingX;
}
glyph.paintPosition = currentPaintPosition + glyph.bearingX + glyph.kerning;
currentLine.glyphs.push_back(glyph);
currentPaintPosition += glyph.kerning + glyph.horizAdvance;
}
/**
* compute the start pos of every line
*/
int computeLineStart(FT_Face face, Device::TextAlign eAlignMask, int line) {
int lineWidth = textLines.at(line).lineWidth;
if (eAlignMask == Device::TextAlign::CENTER || eAlignMask == Device::TextAlign::TOP || eAlignMask == Device::TextAlign::BOTTOM) {
return (iMaxLineWidth - lineWidth) / 2;
} else if (eAlignMask == Device::TextAlign::RIGHT || eAlignMask == Device::TextAlign::TOP_RIGHT || eAlignMask == Device::TextAlign::BOTTOM_RIGHT) {
return (iMaxLineWidth - lineWidth);
}
// left or other situation
return 0;
}
int computeLineStartY( FT_Face face, Device::TextAlign eAlignMask, int txtHeight, int borderHeight ){
int baseLinePos = ceilf(FT_MulFix( face->bbox.yMax, face->size->metrics.y_scale )/64.0f);
if (eAlignMask == Device::TextAlign::CENTER || eAlignMask == Device::TextAlign::LEFT || eAlignMask == Device::TextAlign::RIGHT) {
//vertical center
return (borderHeight - txtHeight) / 2 + baseLinePos;
} else if (eAlignMask == Device::TextAlign::BOTTOM_RIGHT || eAlignMask == Device::TextAlign::BOTTOM || eAlignMask == Device::TextAlign::BOTTOM_LEFT) {
//vertical bottom
return borderHeight - txtHeight + baseLinePos;
}
// top alignment
return baseLinePos;
}
std::string getFontFile(const char* family_name) {
std::string fontPath = family_name;
std::map<std::string, std::string>::iterator it = fontCache.find(family_name);
if ( it != fontCache.end() ) {
return it->second;
}
// check if the parameter is a font file shipped with the application
std::string lowerCasePath = fontPath;
std::transform(lowerCasePath.begin(), lowerCasePath.end(), lowerCasePath.begin(), ::tolower);
if ( lowerCasePath.find(".ttf") != std::string::npos ) {
fontPath = cocos2d::FileUtils::getInstance()->fullPathForFilename(fontPath.c_str());
FILE *f = fopen(fontPath.c_str(), "r");
if ( f ) {
fclose(f);
fontCache.insert(std::pair<std::string, std::string>(family_name, fontPath));
return fontPath;
}
}
// use fontconfig to match the parameter against the fonts installed on the system
FcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, family_name, (char *) 0);
FcConfigSubstitute(0, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
FcResult result;
FcPattern *font = FcFontMatch(0, pattern, &result);
if ( font ) {
FcChar8 *s = NULL;
if ( FcPatternGetString(font, FC_FILE, 0, &s) == FcResultMatch ) {
fontPath = (const char*)s;
FcPatternDestroy(font);
FcPatternDestroy(pattern);
fontCache.insert(std::pair<std::string, std::string>(family_name, fontPath));
return fontPath;
}
FcPatternDestroy(font);
}
FcPatternDestroy(pattern);
return family_name;
if ( currentLine.glyphs.empty() == false ) {
currentLine.calculateWidth();
iMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);
textLines.push_back(currentLine);
}
return true;
}
bool getBitmap(const char *text, int nWidth, int nHeight, Device::TextAlign eAlignMask, const char * pFontName, float fontSize) {
if (libError) {
return false;
}
/**
* compute the start pos of every line
*/
int computeLineStart(FT_Face face, Device::TextAlign eAlignMask, int line) {
int lineWidth = textLines.at(line).lineWidth;
if (eAlignMask == Device::TextAlign::CENTER || eAlignMask == Device::TextAlign::TOP || eAlignMask == Device::TextAlign::BOTTOM) {
return (iMaxLineWidth - lineWidth) / 2;
} else if (eAlignMask == Device::TextAlign::RIGHT || eAlignMask == Device::TextAlign::TOP_RIGHT || eAlignMask == Device::TextAlign::BOTTOM_RIGHT) {
return (iMaxLineWidth - lineWidth);
}
FT_Face face;
std::string fontfile = getFontFile(pFontName);
if ( FT_New_Face(library, fontfile.c_str(), 0, &face) ) {
//no valid font found use default
if ( FT_New_Face(library, "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", 0, &face) ) {
return false;
}
}
// left or other situation
return 0;
}
//select utf8 charmap
if ( FT_Select_Charmap(face, FT_ENCODING_UNICODE) ) {
FT_Done_Face(face);
return false;
}
int computeLineStartY( FT_Face face, Device::TextAlign eAlignMask, int txtHeight, int borderHeight ){
int baseLinePos = ceilf(FT_MulFix( face->bbox.yMax, face->size->metrics.y_scale )/64.0f);
if (eAlignMask == Device::TextAlign::CENTER || eAlignMask == Device::TextAlign::LEFT || eAlignMask == Device::TextAlign::RIGHT) {
//vertical center
return (borderHeight - txtHeight) / 2 + baseLinePos;
} else if (eAlignMask == Device::TextAlign::BOTTOM_RIGHT || eAlignMask == Device::TextAlign::BOTTOM || eAlignMask == Device::TextAlign::BOTTOM_LEFT) {
//vertical bottom
return borderHeight - txtHeight + baseLinePos;
}
if ( FT_Set_Pixel_Sizes(face, fontSize, fontSize) ) {
FT_Done_Face(face);
return false;
}
// top alignment
return baseLinePos;
}
if ( divideString(face, text, nWidth, nHeight) == false ) {
FT_Done_Face(face);
return false;
}
std::string getFontFile(const char* family_name) {
std::string fontPath = family_name;
//compute the final line width
iMaxLineWidth = MAX(iMaxLineWidth, nWidth);
std::map<std::string, std::string>::iterator it = fontCache.find(family_name);
if ( it != fontCache.end() ) {
return it->second;
}
//compute the final line height
iMaxLineHeight = ceilf(FT_MulFix( face->bbox.yMax - face->bbox.yMin, face->size->metrics.y_scale )/64.0f);
int lineHeight = face->size->metrics.height>>6;
if ( textLines.size() > 0 ) {
iMaxLineHeight += (lineHeight * (textLines.size() -1));
}
int txtHeight = iMaxLineHeight;
iMaxLineHeight = MAX(iMaxLineHeight, nHeight);
// check if the parameter is a font file shipped with the application
std::string lowerCasePath = fontPath;
std::transform(lowerCasePath.begin(), lowerCasePath.end(), lowerCasePath.begin(), ::tolower);
if ( lowerCasePath.find(".ttf") != std::string::npos ) {
fontPath = cocos2d::FileUtils::getInstance()->fullPathForFilename(fontPath.c_str());
_data = (unsigned char*)malloc(sizeof(unsigned char) * (iMaxLineWidth * iMaxLineHeight * 4));
memset(_data,0, iMaxLineWidth * iMaxLineHeight*4);
FILE *f = fopen(fontPath.c_str(), "r");
if ( f ) {
fclose(f);
fontCache.insert(std::pair<std::string, std::string>(family_name, fontPath));
return fontPath;
}
}
int iCurYCursor = computeLineStartY(face, eAlignMask, txtHeight, iMaxLineHeight);
// use fontconfig to match the parameter against the fonts installed on the system
FcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, family_name, (char *) 0);
FcConfigSubstitute(0, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
int lineCount = textLines.size();
for (int line = 0; line < lineCount; line++) {
int iCurXCursor = computeLineStart(face, eAlignMask, line);
FcResult result;
FcPattern *font = FcFontMatch(0, pattern, &result);
if ( font ) {
FcChar8 *s = NULL;
if ( FcPatternGetString(font, FC_FILE, 0, &s) == FcResultMatch ) {
fontPath = (const char*)s;
int glyphCount = textLines.at(line).glyphs.size();
for (int i = 0; i < glyphCount; i++) {
LineBreakGlyph glyph = textLines.at(line).glyphs.at(i);
FcPatternDestroy(font);
FcPatternDestroy(pattern);
if (FT_Load_Glyph(face, glyph.glyphIndex, FT_LOAD_RENDER)) {
continue;
}
fontCache.insert(std::pair<std::string, std::string>(family_name, fontPath));
return fontPath;
}
FcPatternDestroy(font);
}
FcPatternDestroy(pattern);
FT_Bitmap& bitmap = face->glyph->bitmap;
int yoffset = iCurYCursor - (face->glyph->metrics.horiBearingY >> 6);
int xoffset = iCurXCursor + glyph.paintPosition;
return family_name;
}
for (int y = 0; y < bitmap.rows; ++y) {
bool getBitmap(const char *text, const FontDefinition& textDefinition, Device::TextAlign eAlignMask) {
if (libError) {
return false;
}
FT_Face face;
std::string fontfile = getFontFile(textDefinition._fontName.c_str());
if ( FT_New_Face(library, fontfile.c_str(), 0, &face) ) {
//no valid font found use default
if ( FT_New_Face(library, "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", 0, &face) ) {
return false;
}
}
//select utf8 charmap
if ( FT_Select_Charmap(face, FT_ENCODING_UNICODE) ) {
FT_Done_Face(face);
return false;
}
if ( FT_Set_Pixel_Sizes(face, textDefinition._fontSize, textDefinition._fontSize) ) {
FT_Done_Face(face);
return false;
}
if ( divideString(face, text, textDefinition._dimensions.width, textDefinition._dimensions.height) == false ) {
FT_Done_Face(face);
return false;
}
//compute the final line width
iMaxLineWidth = MAX(iMaxLineWidth, textDefinition._dimensions.width);
//compute the final line height
iMaxLineHeight = ceilf(FT_MulFix( face->bbox.yMax - face->bbox.yMin, face->size->metrics.y_scale )/64.0f);
int lineHeight = face->size->metrics.height>>6;
if ( textLines.size() > 0 ) {
iMaxLineHeight += (lineHeight * (textLines.size() -1));
}
int txtHeight = iMaxLineHeight;
iMaxLineHeight = MAX(iMaxLineHeight, textDefinition._dimensions.height);
_data = (unsigned char*)malloc(sizeof(unsigned char) * (iMaxLineWidth * iMaxLineHeight * 4));
memset(_data,0, iMaxLineWidth * iMaxLineHeight*4);
int iCurYCursor = computeLineStartY(face, eAlignMask, txtHeight, iMaxLineHeight);
int lineCount = textLines.size();
for (int line = 0; line < lineCount; line++) {
int iCurXCursor = computeLineStart(face, eAlignMask, line);
int glyphCount = textLines.at(line).glyphs.size();
for (int i = 0; i < glyphCount; i++) {
LineBreakGlyph glyph = textLines.at(line).glyphs.at(i);
if (FT_Load_Glyph(face, glyph.glyphIndex, FT_LOAD_RENDER)) {
continue;
}
FT_Bitmap& bitmap = face->glyph->bitmap;
int yoffset = iCurYCursor - (face->glyph->metrics.horiBearingY >> 6);
int xoffset = iCurXCursor + glyph.paintPosition;
for (int y = 0; y < bitmap.rows; ++y) {
int iY = yoffset + y;
if (iY>=iMaxLineHeight) {
//exceed the height truncate
@ -442,42 +442,42 @@ public:
int bitmap_y = y * bitmap.width;
for (int x = 0; x < bitmap.width; ++x) {
unsigned char cTemp = bitmap.buffer[bitmap_y + x];
if (cTemp == 0) {
continue;
}
for (int x = 0; x < bitmap.width; ++x) {
unsigned char cTemp = bitmap.buffer[bitmap_y + x];
if (cTemp == 0) {
continue;
}
int iX = xoffset + x;
int iX = xoffset + x;
//FIXME:wrong text color
int iTemp = cTemp << 24 | cTemp << 16 | cTemp << 8 | cTemp;
*(int*) &_data[(iY + iX) * 4 + 0] = iTemp;
}
}
}
// step to next line
iCurYCursor += lineHeight;
}
int iTemp = cTemp << 24 | cTemp << 16 | cTemp << 8 | cTemp;
*(int*) &_data[(iY + iX) * 4 + 0] = iTemp;
}
}
}
// step to next line
iCurYCursor += lineHeight;
}
// free face
FT_Done_Face(face);
return true;
}
// free face
FT_Done_Face(face);
return true;
}
public:
FT_Library library;
FT_Library library;
unsigned char *_data;
int libError;
std::vector<LineBreakLine> textLines;
int iMaxLineWidth;
int iMaxLineHeight;
unsigned char *_data;
int libError;
std::vector<LineBreakLine> textLines;
int iMaxLineWidth;
int iMaxLineHeight;
};
static BitmapDC& sharedBitmapDC()
{
static BitmapDC s_BmpDC;
return s_BmpDC;
static BitmapDC s_BmpDC;
return s_BmpDC;
}
Data Device::getTextureDataForText(const char * text, const FontDefinition& textDefinition, TextAlign align, int &width, int &height, bool& hasPremultipliedAlpha)
@ -487,7 +487,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
{
BitmapDC &dc = sharedBitmapDC();
CC_BREAK_IF(! dc.getBitmap(text, textDefinition._dimensions.width, textDefinition._dimensions.height, align, textDefinition._fontName.c_str(), textDefinition._fontSize));
CC_BREAK_IF(! dc.getBitmap(text, textDefinition, align));
CC_BREAK_IF(! dc._data);
width = dc.iMaxLineWidth;
height = dc.iMaxLineHeight;

View File

@ -131,7 +131,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

@ -431,7 +431,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
GetDIBits(dc.getDC(), dc.getBitmap(), 0, height, dataBuf,
(LPBITMAPINFO)&bi, DIB_RGB_COLORS);
// change pixel's alpha value to 255, when it's RGB != 0
COLORREF textColor = (textDefinition._fontFillColor.b << 16 | textDefinition._fontFillColor.g << 8 | textDefinition._fontFillColor.r) & 0x00ffffff;
COLORREF * pPixel = nullptr;
for (int y = 0; y < height; ++y)
{
@ -439,7 +439,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
for (int x = 0; x < width; ++x)
{
COLORREF& clr = *pPixel;
clr = (0xffffff | (GetRValue(clr) << 24));
clr = (GetRValue(clr) << 24) | textColor;
++pPixel;
}
}

View File

@ -0,0 +1,85 @@
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#include "Cocos2dRenderer.h"
#include "AppDelegate.h"
#include "CCGLViewImpl-winrt.h"
#include "CCApplication.h"
#include "cocos2d.h"
// These are used by the shader compilation methods.
#include <vector>
#include <iostream>
#include <fstream>
using namespace Platform;
using namespace Windows::UI::Core;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Graphics::Display;
USING_NS_CC;
Cocos2dRenderer::Cocos2dRenderer(const int width, const int height, CoreDispatcher^ dispatcher, Panel^ panel)
: mApp(nullptr)
, mWidth(width)
, mHeight(height)
, m_dispatcher(dispatcher)
, m_panel(panel)
{
mApp = new AppDelegate();
auto director = cocos2d::Director::getInstance();
GLViewImpl* glview = GLViewImpl::create("Test Cpp");
glview->setDispatcher(dispatcher);
glview->setPanel(panel);
glview->Create(static_cast<float>(width), static_cast<float>(height), DisplayOrientations::Landscape);
director->setOpenGLView(glview);
CCApplication::getInstance()->run();
}
Cocos2dRenderer::~Cocos2dRenderer()
{
delete mApp;
}
// Draws a basic triangle
void Cocos2dRenderer::Draw(GLsizei width, GLsizei height)
{
if (width != mWidth || height != mHeight)
{
mWidth = width;
mHeight = height;
GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(static_cast<float>(width), static_cast<float>(height));
}
GLViewImpl::sharedOpenGLView()->ProcessEvents();
GLViewImpl::sharedOpenGLView()->Render();
}
void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args)
{
GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args);
}
void Cocos2dRenderer::QueueKeyBoardEvent(cocos2d::Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e)
{
//GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, e);
}

View File

@ -0,0 +1,47 @@
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#pragma once
#include <agile.h>
#include "cocos2d.h"
class AppDelegate;
namespace cocos2d
{
class Cocos2dRenderer
{
public:
Cocos2dRenderer(const int width, const int height, Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel);
~Cocos2dRenderer();
void Draw(GLsizei width, GLsizei height);
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
void QueueKeyBoardEvent(Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e);
private:
int mWidth;
int mHeight;
// The AppDelegate for the Cocos2D app
AppDelegate* mApp;
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
};
}

View File

@ -1,5 +1,22 @@
#include "pch.h"
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#include "OpenGLES.h"
using namespace Platform;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Foundation;
@ -36,8 +53,13 @@ void OpenGLES::Initialize()
// This can be used to configure D3D11. For example, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE could be used.
// This would ask the graphics card to use D3D11 Feature Level 9_3 instead of Feature Level 11_0+.
// On Windows Phone, this would allow the Phone Emulator to act more like the GPUs that are available on real Phone devices.
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE,
EGL_NONE,
#else
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_NONE,
#endif
};
const EGLint contextAttributes[] =

View File

@ -0,0 +1,52 @@
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#pragma once
// OpenGL ES includes
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
// EGL includes
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <EGL/eglplatform.h>
#include <angle_windowsstore.h>
class OpenGLES
{
public:
OpenGLES();
~OpenGLES();
EGLSurface CreateSurface(Windows::UI::Xaml::Controls::SwapChainPanel^ panel, const Windows::Foundation::Size* renderSurfaceSize);
void DestroySurface(const EGLSurface surface);
void MakeCurrent(const EGLSurface surface);
EGLBoolean SwapBuffers(const EGLSurface surface);
void Reset();
private:
void Initialize();
void Cleanup();
private:
EGLDisplay mEglDisplay;
EGLContext mEglContext;
EGLConfig mEglConfig;
};

View File

@ -0,0 +1,28 @@
<Page
x:Class="cocos2d.OpenGLESPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:cocos2d"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<SwapChainPanel x:Name="swapChainPanel">
<Button x:Name="cocos2d_editbox" Visibility="Collapsed" Height="1">
<Button.Flyout>
<Flyout x:Name="cocos2d_editbox_flyout">
<Grid VerticalAlignment="Top" x:Name="cocos2d_editbox_grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="120" />
<ColumnDefinition Width="120" />
</Grid.ColumnDefinitions>
<Button x:Name="cocos2d_editbox_done" Grid.Column="1" VerticalAlignment="Center">Done</Button>
<Button x:Name="cocos2d_editbox_cancel" Grid.Column="2" VerticalAlignment="Center">Cancel</Button>
</Grid>
</Flyout>
</Button.Flyout>
</Button>
</SwapChainPanel>
</Page>

View File

@ -1,10 +1,40 @@
#include "pch.h"
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#include "App.xaml.h"
#include "OpenGLESPage.xaml.h"
using namespace cpp_tests;
using namespace cocos2d;
using namespace Platform;
using namespace Concurrency;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Graphics::Display;
using namespace Windows::System::Threading;
using namespace Windows::UI::Core;
using namespace Windows::UI::Input;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
OpenGLESPage::OpenGLESPage() :
OpenGLESPage(nullptr)
@ -16,7 +46,8 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
mOpenGLES(openGLES),
mRenderSurface(EGL_NO_SURFACE),
mCustomRenderSurfaceSize(0,0),
mUseCustomRenderSurfaceSize(false)
mUseCustomRenderSurfaceSize(false),
m_coreInput(nullptr)
{
InitializeComponent();
@ -31,7 +62,11 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
this->Loaded +=
ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded);
#if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height };
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync();
#else
// Disable all pointer visual feedback for better performance when touching.
// This is not supported on Windows Phone applications.
auto pointerVisualizationSettings = Windows::UI::Input::PointerVisualizationSettings::GetForCurrentView();
@ -39,7 +74,28 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
#endif
mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height };
// Register our SwapChainPanel to get independent input pointer events
auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^)
{
// The CoreIndependentInputSource will raise pointer events for the specified device types on whichever thread it's created on.
m_coreInput = swapChainPanel->CreateCoreIndependentInputSource(
Windows::UI::Core::CoreInputDeviceTypes::Mouse |
Windows::UI::Core::CoreInputDeviceTypes::Touch |
Windows::UI::Core::CoreInputDeviceTypes::Pen
);
// Register for pointer events, which will be raised on the background thread.
m_coreInput->PointerPressed += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerPressed);
m_coreInput->PointerMoved += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerMoved);
m_coreInput->PointerReleased += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerReleased);
// Begin processing input messages as they're delivered.
m_coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
});
// Run task on a dedicated high priority background thread.
m_inputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
}
OpenGLESPage::~OpenGLESPage()
@ -55,6 +111,32 @@ void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::Rou
StartRenderLoop();
}
void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e)
{
if (m_renderer)
{
m_renderer->QueuePointerEvent(PointerEventType::PointerPressed, e);
}
}
void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e)
{
if (m_renderer)
{
m_renderer->QueuePointerEvent(PointerEventType::PointerMoved, e);
}
}
void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e)
{
if (m_renderer)
{
m_renderer->QueuePointerEvent(PointerEventType::PointerReleased, e);
}
}
void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args)
{
if (args->Visible && mRenderSurface != EGL_NO_SURFACE)
@ -143,21 +225,29 @@ void OpenGLESPage::StartRenderLoop()
return;
}
auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher;
// Create a task for rendering that will be run on a background thread.
auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this](Windows::Foundation::IAsyncAction ^ action)
auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this, dispatcher](Windows::Foundation::IAsyncAction ^ action)
{
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
mOpenGLES->MakeCurrent(mRenderSurface);
HelloTriangleRenderer renderer;
GLsizei panelWidth = 0;
GLsizei panelHeight = 0;
GetSwapChainPanelSize(&panelWidth, &panelHeight);
if (m_renderer.get() == nullptr)
{
m_renderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, dispatcher, swapChainPanel);
}
while (action->Status == Windows::Foundation::AsyncStatus::Started)
{
GLsizei panelWidth = 0;
GLsizei panelHeight = 0;
GetSwapChainPanelSize(&panelWidth, &panelHeight);
renderer.Draw(panelWidth, panelHeight);
m_renderer.get()->Draw(panelWidth, panelHeight);
// The call to eglSwapBuffers might not be successful (i.e. due to Device Lost)
// If the call fails, then we must reinitialize EGL and the GL resources.
@ -165,6 +255,7 @@ void OpenGLESPage::StartRenderLoop()
{
// XAML objects like the SwapChainPanel must only be manipulated on the UI thread.
swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]()
//swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]()
{
RecoverFromLostDevice();
}, CallbackContext::Any));

View File

@ -0,0 +1,71 @@
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#pragma once
#include "OpenGLES.h"
#include "OpenGLESPage.g.h"
#include <memory>
#include "Cocos2dRenderer.h"
namespace cocos2d
{
public ref class OpenGLESPage sealed
{
public:
OpenGLESPage();
virtual ~OpenGLESPage();
internal:
OpenGLESPage(OpenGLES* openGLES);
private:
void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
void GetSwapChainPanelSize(GLsizei* width, GLsizei* height);
void CreateRenderSurface();
void DestroyRenderSurface();
void RecoverFromLostDevice();
void StartRenderLoop();
void StopRenderLoop();
OpenGLES* mOpenGLES;
std::shared_ptr<cocos2d::Cocos2dRenderer> m_renderer;
Windows::Foundation::Size mSwapChainPanelSize;
Concurrency::critical_section mSwapChainPanelSizeCriticalSection;
Windows::Foundation::Size mCustomRenderSurfaceSize;
bool mUseCustomRenderSurfaceSize;
EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page
Concurrency::critical_section mRenderSurfaceCriticalSection;
Windows::Foundation::IAsyncAction^ mRenderLoopWorker;
// Track user input on a background worker thread.
Windows::Foundation::IAsyncAction^ m_inputLoopWorker;
Windows::UI::Core::CoreIndependentInputSource^ m_coreInput;
// Independent input handling functions.
void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
};
}

View File

@ -0,0 +1,14 @@
//
// pch.h
// Header for standard system include files.
//
#pragma once
#include <collection.h>
#include <ppltasks.h>
#include "cocos2d.h"
#include "cocos-ext.h"

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#include "platform/CCStdC.h"
#include "CCWinRTUtils.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || defined(WP8_SHADER_COMPILER)
#include "platform/wp8/CCGLViewImpl-wp8.h"
#endif
@ -42,17 +42,9 @@ void MessageBox(const char * pszMsg, const char * pszTitle)
// Create the message dialog and set its content
Platform::String^ message = ref new Platform::String(CCUtf8ToUnicode(pszMsg, -1).c_str());
Platform::String^ title = ref new Platform::String(CCUtf8ToUnicode(pszTitle, -1).c_str());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
Windows::UI::Popups::MessageDialog^ msg = ref new Windows::UI::Popups::MessageDialog(message, title);
// Set the command to be invoked when a user presses 'ESC'
msg->CancelCommandIndex = 1;
// Show the message dialog
msg->ShowAsync();
#else
#ifndef WP8_SHADER_COMPILER
GLViewImpl::sharedOpenGLView()->ShowMessageBox(title, message);
#endif
}

View File

@ -51,6 +51,7 @@ static Accelerometer^ sAccelerometer = nullptr;
void Device::setAccelerometerEnabled(bool isEnabled)
{
#ifndef WP8_SHADER_COMPILER
static Windows::Foundation::EventRegistrationToken sToken;
static bool sEnabled = false;
@ -91,7 +92,6 @@ void Device::setAccelerometerEnabled(bool isEnabled)
acc.z = reading->AccelerationZ;
acc.timestamp = 0;
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
auto orientation = GLViewImpl::sharedOpenGLView()->getDeviceOrientation();
switch (orientation)
@ -121,14 +121,12 @@ void Device::setAccelerometerEnabled(bool isEnabled)
acc.y = reading->AccelerationY;
break;
}
#endif
#ifndef WP8_SHADER_COMPILER
std::shared_ptr<cocos2d::InputEvent> event(new AccelerometerEvent(acc));
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(event);
#endif
});
}
#endif
}
void Device::setAccelerometerInterval(float interval)

View File

@ -24,7 +24,6 @@ THE SOFTWARE.
****************************************************************************/
#include "CCGLViewImpl-winrt.h"
#include "deprecated/CCSet.h"
#include "base/ccMacros.h"
#include "base/CCDirector.h"
#include "base/CCTouch.h"
@ -40,7 +39,9 @@ using namespace Windows::Graphics::Display;
using namespace Windows::UI::Input;
using namespace Windows::UI::Core;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::System;
using namespace Windows::UI::ViewManagement;
using namespace Windows::ApplicationModel;
@ -48,7 +49,6 @@ using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Platform;
using namespace Microsoft::WRL;
using namespace PhoneDirect3DXamlAppComponent;
NS_CC_BEGIN
@ -79,8 +79,6 @@ GLViewImpl::GLViewImpl()
, m_windowVisible(true)
, m_width(0)
, m_height(0)
, m_delegate(nullptr)
, m_messageBoxDelegate(nullptr)
, m_orientation(DisplayOrientations::Landscape)
{
s_pEglView = this;
@ -116,6 +114,16 @@ bool GLViewImpl::Create(float width, float height, DisplayOrientations orientati
return true;
}
void GLViewImpl::setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher)
{
m_dispatcher = dispatcher;
}
void GLViewImpl::setPanel(Windows::UI::Xaml::Controls::Panel^ panel)
{
m_panel = panel;
}
void GLViewImpl::setIMEKeyboardState(bool bOpen)
@ -124,44 +132,55 @@ void GLViewImpl::setIMEKeyboardState(bool bOpen)
setIMEKeyboardState(bOpen, str);
}
bool GLViewImpl::ShowMessageBox(Platform::String^ title, Platform::String^ message)
{
if (m_dispatcher.Get())
{
m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([title, message]()
{
// Show the message dialog
auto msg = ref new Windows::UI::Popups::MessageDialog(message, title);
// Set the command to be invoked when a user presses 'ESC'
msg->CancelCommandIndex = 1;
msg->ShowAsync();
}));
return true;
}
return false;
}
void GLViewImpl::setIMEKeyboardState(bool bOpen, std::string str)
{
if(m_delegate)
if(bOpen)
{
if(bOpen)
if (m_keyboard == nullptr)
{
m_delegate->Invoke(Cocos2dEvent::ShowKeyboard, stringToPlatformString(str));
m_keyboard = ref new KeyBoardWinRT(m_dispatcher.Get(), m_panel.Get());
}
else
m_keyboard->ShowKeyboard(PlatformStringFromString(str));
}
else
{
if (m_keyboard != nullptr)
{
m_delegate->Invoke(Cocos2dEvent::HideKeyboard, stringToPlatformString(str));
m_keyboard->HideKeyboard(PlatformStringFromString(str));
}
m_keyboard = nullptr;
}
}
Platform::String^ GLViewImpl::stringToPlatformString(std::string strSrc)
{
// to wide char
int strLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0);
wchar_t* wstr = new wchar_t[strLen + 1];
memset(wstr, 0, strLen + 1);
MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, wstr, strLen);
Platform::String^ strDst = ref new Platform::String(wstr);
delete[] wstr;
return strDst;
}
void GLViewImpl::swapBuffers()
{
//eglSwapBuffers(m_eglDisplay, m_eglSurface);
}
bool GLViewImpl::isOpenGLReady()
{
return true;
// TODO: need to revisit this
//return (m_eglDisplay && m_orientation != DisplayOrientations::None);
}
void GLViewImpl::end()
@ -184,7 +203,7 @@ void GLViewImpl::OnBackKeyPress()
std::string str;
if(m_delegate)
{
m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str));
//m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str));
}
}
@ -308,30 +327,6 @@ void GLViewImpl::OnRendering()
}
}
bool GLViewImpl::ShowMessageBox(Platform::String^ title, Platform::String^ message)
{
if(m_messageBoxDelegate)
{
m_messageBoxDelegate->Invoke(title, message);
return true;
}
return false;
}
bool GLViewImpl::OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler)
{
if(m_editBoxDelegate)
{
m_editBoxDelegate->Invoke(strPlaceHolder, strText, maxLength, inputMode, inputFlag, receiveHandler);
return true;
}
return false;
}
// called by orientation change from WP8 XAML
void GLViewImpl::UpdateOrientation(DisplayOrientations orientation)
{
@ -345,9 +340,12 @@ void GLViewImpl::UpdateOrientation(DisplayOrientations orientation)
// called by size change from WP8 XAML
void GLViewImpl::UpdateForWindowSizeChange(float width, float height)
{
m_width = width;
m_height = height;
UpdateWindowSize();
if (width != m_width || height != m_height)
{
m_width = width;
m_height = height;
UpdateWindowSize();
}
}
#if 0
@ -371,18 +369,9 @@ void GLViewImpl::UpdateWindowSize()
{
float width, height;
if(m_orientation == DisplayOrientations::Landscape || m_orientation == DisplayOrientations::LandscapeFlipped)
{
width = m_height;
height = m_width;
}
else
{
width = m_width;
height = m_height;
}
width = m_width;
height = m_height;
UpdateOrientationMatrix();
//CCSize designSize = getDesignResolutionSize();
if(!m_initialized)
@ -403,45 +392,15 @@ void GLViewImpl::UpdateWindowSize()
}
}
const Mat4& GLViewImpl::getOrientationMatrix() const
{
return m_orientationMatrix;
};
void GLViewImpl::UpdateOrientationMatrix()
{
kmMat4Identity(&m_orientationMatrix);
kmMat4Identity(&m_reverseOrientationMatrix);
switch(m_orientation)
{
case Windows::Graphics::Display::DisplayOrientations::PortraitFlipped:
kmMat4RotationZ(&m_orientationMatrix, static_cast<float>(M_PI));
kmMat4RotationZ(&m_reverseOrientationMatrix, static_cast<float>(-M_PI));
break;
case Windows::Graphics::Display::DisplayOrientations::Landscape:
kmMat4RotationZ(&m_orientationMatrix, static_cast<float>(-M_PI_2));
kmMat4RotationZ(&m_reverseOrientationMatrix, static_cast<float>(M_PI_2));
break;
case Windows::Graphics::Display::DisplayOrientations::LandscapeFlipped:
kmMat4RotationZ(&m_orientationMatrix, static_cast<float>(M_PI_2));
kmMat4RotationZ(&m_reverseOrientationMatrix, static_cast<float>(-M_PI_2));
break;
default:
break;
}
}
cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p)
{
cocos2d::Vec2 returnValue;
float x = p.X;
float y = p.Y;
returnValue = Vec2(x, y);
#if 0
switch (m_orientation)
{
case DisplayOrientations::Portrait:
@ -458,6 +417,7 @@ cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p)
returnValue = Vec2(m_height - y, x);
break;
}
#endif
float zoomFactor = GLViewImpl::sharedOpenGLView()->getFrameZoomFactor();
if(zoomFactor > 0.0f) {
@ -473,48 +433,23 @@ cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p)
Vec2 GLViewImpl::GetPoint(PointerEventArgs^ args) {
return TransformToOrientation(args->CurrentPoint->Position);
}
void GLViewImpl::setViewPortInPoints(float x , float y , float w , float h)
{
switch(m_orientation)
{
case DisplayOrientations::Landscape:
case DisplayOrientations::LandscapeFlipped:
glViewport((GLint)(y * _scaleY + _viewPortRect.origin.y),
(GLint)(x * _scaleX + _viewPortRect.origin.x),
(GLsizei)(h * _scaleY),
(GLsizei)(w * _scaleX));
break;
default:
glViewport((GLint)(x * _scaleX + _viewPortRect.origin.x),
(GLint)(y * _scaleY + _viewPortRect.origin.y),
(GLsizei)(w * _scaleX),
(GLsizei)(h * _scaleY));
}
glViewport((GLint) (x * _scaleX + _viewPortRect.origin.x),
(GLint) (y * _scaleY + _viewPortRect.origin.y),
(GLsizei) (w * _scaleX),
(GLsizei) (h * _scaleY));
}
void GLViewImpl::setScissorInPoints(float x , float y , float w , float h)
{
switch(m_orientation)
{
case DisplayOrientations::Landscape:
case DisplayOrientations::LandscapeFlipped:
glScissor((GLint)(y * _scaleX + _viewPortRect.origin.y),
(GLint)((_viewPortRect.size.width - ((x + w) * _scaleX)) + _viewPortRect.origin.x),
(GLsizei)(h * _scaleY),
(GLsizei)(w * _scaleX));
break;
default:
glScissor((GLint)(x * _scaleX + _viewPortRect.origin.x),
(GLint)(y * _scaleY + _viewPortRect.origin.y),
(GLsizei)(w * _scaleX),
(GLsizei)(h * _scaleY));
}
glScissor((GLint) (x * _scaleX + _viewPortRect.origin.x),
(GLint) (y * _scaleY + _viewPortRect.origin.y),
(GLsizei) (w * _scaleX),
(GLsizei) (h * _scaleY));
}
void GLViewImpl::QueueBackKeyPress()

View File

@ -33,21 +33,16 @@ THE SOFTWARE.
#include <agile.h>
#include <string>
#include <wrl/client.h>
#include <d3d11_1.h>
#include <mutex>
#include <queue>
#include <agile.h>
#include <DirectXMath.h>
#include <Keyboard-winrt.h>
NS_CC_BEGIN
class GLViewImpl;
class CC_DLL GLViewImpl : public GLView
{
public:
@ -59,20 +54,20 @@ public:
virtual void swapBuffers();
virtual void setViewPortInPoints(float x , float y , float w , float h);
virtual void setScissorInPoints(float x , float y , float w , float h);
const Mat4& getOrientationMatrix() const;
const Mat4& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;};
Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;};
Size getRenerTargetSize() const { return Size(m_width, m_height); }
virtual void setIMEKeyboardState(bool bOpen);
virtual void setIMEKeyboardState(bool bOpen, std::string str);
Platform::String^ stringToPlatformString(std::string strSrc);
void ShowKeyboard(Windows::Foundation::Rect r);
void HideKeyboard(Windows::Foundation::Rect r);
// WP8 XAML app
virtual bool Create(float width, float height, Windows::Graphics::Display::DisplayOrientations orientation);
virtual bool Create(float width, float height ,Windows::Graphics::Display::DisplayOrientations orientation);
void setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher);
Windows::UI::Core::CoreDispatcher^ getDispatcher() {return m_dispatcher.Get();}
void setPanel(Windows::UI::Xaml::Controls::Panel^ panel);
Windows::UI::Xaml::Controls::Panel^ getPanel() {return m_panel.Get();}
void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args);
void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args);
@ -89,14 +84,9 @@ public:
void QueueBackKeyPress();
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event);
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; };
void QueueEvent(std::shared_ptr<InputEvent>& event);
bool ShowMessageBox(Platform::String^ title, Platform::String^ message);
bool OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
int Run();
void Render();
@ -116,9 +106,6 @@ public:
static GLViewImpl* sharedOpenGLView();
void ProcessEvents();
void AddPointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
protected:
GLViewImpl();
@ -144,7 +131,6 @@ private:
void OnRendering();
void UpdateWindowSize();
void UpdateOrientationMatrix();
cocos2d::Vec2 TransformToOrientation(Windows::Foundation::Point point);
cocos2d::Vec2 GetPoint(Windows::UI::Core::PointerEventArgs^ args);
@ -162,20 +148,20 @@ private:
bool m_lastPointValid;
bool m_windowClosed;
bool m_windowVisible;
Mat4 m_orientationMatrix;
Mat4 m_reverseOrientationMatrix;
bool m_running;
bool m_initialized;
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
Cocos2dEventDelegate^ m_delegate;
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
std::mutex mMutex;
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
KeyBoardWinRT^ m_keyboard;
};
NS_CC_END

View File

@ -32,6 +32,11 @@ THE SOFTWARE.
#include <ppltasks.h>
#include <sstream>
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
#endif
NS_CC_BEGIN
using namespace Windows::Graphics::Display;
@ -153,6 +158,103 @@ std::string CC_DLL getDeviceIPAddresses()
return result.str();
}
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
Platform::Object^ findXamlElement(Platform::Object^ parent, Platform::String^ name)
{
if (parent == nullptr || name == nullptr || name->Length() == 0)
{
return nullptr;
}
FrameworkElement^ element = dynamic_cast<FrameworkElement^>(parent);
if (element == nullptr)
{
return nullptr;
}
if (element->Name == name)
{
return element;
}
Panel^ panel = dynamic_cast<Panel^>(element);
if (panel == nullptr)
{
return nullptr;
}
int count = panel->Children->Size;
for (int i = 0; i < count; i++)
{
auto result = findXamlElement(panel->Children->GetAt(i), name);
if (result != nullptr)
{
return result;
}
}
return nullptr;
}
bool removeXamlElement(Platform::Object^ parent, Platform::Object^ element)
{
Panel^ panel = dynamic_cast<Panel^>(parent);
if (panel == nullptr)
{
return false;
}
UIElement^ uiElement = dynamic_cast<UIElement^>(element);
if (uiElement == nullptr)
{
return false;
}
unsigned int index;
if (!panel->Children->IndexOf(uiElement, &index))
{
return false;
}
panel->Children->RemoveAt(index);
return true;
}
bool replaceXamlElement(Platform::Object^ parent, Platform::Object^ add, Platform::Object^ remove)
{
Panel^ panel = dynamic_cast<Panel^>(parent);
if (panel == nullptr)
{
return false;
}
UIElement^ addElement = dynamic_cast<UIElement^>(add);
if (addElement == nullptr)
{
return false;
}
UIElement^ removeElement = dynamic_cast<UIElement^>(remove);
if (removeElement == nullptr)
{
return false;
}
unsigned int index;
if (!panel->Children->IndexOf(removeElement, &index))
{
return false;
}
panel->Children->RemoveAt(index);
panel->Children->InsertAt(index, addElement);
return true;
}
#endif

View File

@ -40,6 +40,12 @@ NS_CC_BEGIN
std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1);
std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr);
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
Platform::Object^ findXamlElement(Platform::Object^ parent, Platform::String^ name);
bool removeXamlElement(Platform::Object^ parent, Platform::Object^ element);
bool replaceXamlElement(Platform::Object^ parent, Platform::Object^ add, Platform::Object^ remove);
#endif
std::string PlatformStringToString(Platform::String^ s);
Platform::String^ PlatformStringFromString(const std::string& s);

View File

@ -24,6 +24,7 @@ THE SOFTWARE.
****************************************************************************/
#include "InputEvent.h"
#include "CCWinRTUtils.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#include "CCGLViewImpl-wp8.h"
@ -35,9 +36,6 @@ THE SOFTWARE.
NS_CC_BEGIN
using namespace PhoneDirect3DXamlAppComponent;
AccelerometerEvent::AccelerometerEvent(const Acceleration& event)
: m_event(event)
{
@ -92,9 +90,11 @@ void KeyboardEvent::execute()
{
case Cocos2dKeyEvent::Text:
{
char szUtf8[256] = { 0 };
int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) m_text.Get()->Data(), -1, szUtf8, sizeof(szUtf8), NULL, NULL);
IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen - 1);
std::wstring w(m_text.Get()->Data());
std::u16string s16(w.begin(),w.end());
std::string utf8String;
StringUtils::UTF16ToUTF8(s16, utf8String);
IMEDispatcher::sharedDispatcher()->dispatchInsertText(utf8String.c_str(), utf8String.size());
break;
}
@ -108,7 +108,6 @@ void KeyboardEvent::execute()
IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();
break;
case Cocos2dKeyEvent::Enter:
//SetFocus(false);
IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1);
break;
default:
@ -133,12 +132,27 @@ CustomInputEvent::CustomInputEvent(const std::function<void()>& fun)
: m_fun(fun)
{
}
void CustomInputEvent::execute()
{
m_fun();
}
UIEditBoxEvent::UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler<Platform::String^>^ handle)
: m_sender(sender)
, m_text(text)
, m_handler(handle)
{
}
void UIEditBoxEvent::execute()
{
if (m_handler.Get())
{
m_handler.Get()->Invoke(m_sender.Get(), m_text.Get());
}
}
NS_CC_END

View File

@ -30,17 +30,13 @@ THE SOFTWARE.
#include "InputEventTypes.h"
#include <agile.h>
namespace PhoneDirect3DXamlAppComponent
{
public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text);
public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text);
public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
public delegate void Cocos2dOpenURLDelegate(Platform::String^ url);
}
NS_CC_BEGIN
public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text);
public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text);
public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
public delegate void Cocos2dOpenURLDelegate(Platform::String^ url);
enum PointerEventType
{
PointerPressed,
@ -83,12 +79,12 @@ class CC_DLL KeyboardEvent : public InputEvent
{
public:
KeyboardEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent type);
KeyboardEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent type, Platform::String^ text);
KeyboardEvent(Cocos2dKeyEvent type);
KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text);
virtual void execute();
private:
PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent m_type;
Cocos2dKeyEvent m_type;
Platform::Agile<Platform::String> m_text;
};
@ -108,6 +104,19 @@ private:
std::function<void()> m_fun;
};
class UIEditBoxEvent : public cocos2d::InputEvent
{
public:
UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler<Platform::String^>^ handle);
virtual void execute();
private:
Platform::Agile<Platform::Object^> m_sender;
Platform::Agile<Platform::String^> m_text;
Platform::Agile<Windows::Foundation::EventHandler<Platform::String^>^> m_handler;
};
NS_CC_END
#endif // #ifndef __INPUT_EVENT__

View File

@ -27,8 +27,8 @@ THE SOFTWARE.
#define __INPUT_EVENT_TYPES__
namespace PhoneDirect3DXamlAppComponent
{
NS_CC_BEGIN
public enum class Cocos2dEvent
{
@ -46,7 +46,8 @@ public enum class Cocos2dKeyEvent : int
Enter
};
}
NS_CC_END
#endif // #ifndef __INPUT_EVENT_TYPES__

View File

@ -0,0 +1,157 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "Keyboard-winrt.h"
using namespace cocos2d;
using namespace Platform;
using namespace Concurrency;
using namespace Windows::System;
using namespace Windows::System::Threading;
using namespace Windows::UI::Core;
using namespace Windows::UI::Input;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Input;
NS_CC_BEGIN
KeyBoardWinRT::KeyBoardWinRT()
{
}
KeyBoardWinRT::~KeyBoardWinRT()
{
}
KeyBoardWinRT::KeyBoardWinRT(Windows::UI::Core::CoreDispatcher^ dispatcher, Windows::UI::Xaml::Controls::Panel^ panel)
: m_dispatcher(dispatcher)
, m_panel(panel)
{
}
void KeyBoardWinRT::ShowKeyboard(Platform::String^ text)
{
if (m_dispatcher.Get() && m_panel.Get())
{
// run on main UI thread
m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, text]()
{
if (m_textBox == nullptr)
{
m_textBox = ref new TextBox();
m_textBox->Opacity = 0.0;
m_textBox->Width = 1;
m_textBox->Height = 1;
m_textBox->AddHandler(UIElement::KeyDownEvent, ref new KeyEventHandler(this, &KeyBoardWinRT::OnKeyPressed), true);
m_textBox->AddHandler(UIElement::KeyUpEvent, ref new KeyEventHandler(this, &KeyBoardWinRT::OnKeyReleased), true);
m_textBox->TextChanged += ref new TextChangedEventHandler(this, &KeyBoardWinRT::OnTextChanged);
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
// Need to use InputScopeNameValue::Search to prevent auto-capitalize
m_textBox->InputScope = ref new InputScope();
auto n = m_textBox->InputScope->Names;
n->Append(ref new InputScopeName(InputScopeNameValue::Search));
#endif
m_panel.Get()->Children->Append(m_textBox);
}
m_textBox->SelectionLength = 0;
m_textBox->SelectionStart = 32768;
m_textBox->Focus(FocusState::Programmatic);
}));
}
}
void KeyBoardWinRT::HideKeyboard(Platform::String^ text)
{
if (m_dispatcher.Get() && m_panel.Get())
{
// run on main UI thread
m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, text]()
{
if (m_textBox != nullptr)
{
unsigned int index;
if (m_panel->Children->IndexOf(m_textBox, &index))
{
m_panel->Children->RemoveAt(index);
}
}
m_textBox = nullptr;
}));
}
}
void KeyBoardWinRT::QueueKeyEvent(Cocos2dKeyEvent key)
{
std::shared_ptr<cocos2d::InputEvent> e(new cocos2d::KeyboardEvent(key));
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
}
void KeyBoardWinRT::OnKeyPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args)
{
switch (args->Key)
{
case VirtualKey::Escape:
QueueKeyEvent(Cocos2dKeyEvent::Escape);
args->Handled = true;
break;
case VirtualKey::Back:
QueueKeyEvent(Cocos2dKeyEvent::Back);
args->Handled = true;
break;
case VirtualKey::Enter:
QueueKeyEvent(Cocos2dKeyEvent::Enter);
args->Handled = true;
break;
default:
break;
}
}
void KeyBoardWinRT::OnTextChanged(Platform::Object^ sender, TextChangedEventArgs^ args)
{
auto text = m_textBox->Text;
if (text)
{
std::shared_ptr<cocos2d::InputEvent> e(new cocos2d::KeyboardEvent(Cocos2dKeyEvent::Text, text));
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
m_textBox->Text = L"";
}
}
void KeyBoardWinRT::OnKeyReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args)
{
//m_textBox->Text = L"";
}
NS_CC_END

View File

@ -0,0 +1,58 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#pragma once
#include <agile.h>
NS_CC_BEGIN
ref class KeyBoardWinRT sealed
{
public:
KeyBoardWinRT();
virtual ~KeyBoardWinRT();
void ShowKeyboard(Platform::String^ text);
void HideKeyboard(Platform::String^ text);
internal:
KeyBoardWinRT(Windows::UI::Core::CoreDispatcher^ dispatcher, Windows::UI::Xaml::Controls::Panel^ panel);
private:
void QueueKeyEvent(Cocos2dKeyEvent key);
void OnKeyPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args);
void OnKeyReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ args);
void OnTextChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::TextChangedEventArgs^ args);
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
Windows::UI::Xaml::Controls::TextBox^ m_textBox;
};
NS_CC_END

View File

@ -35,7 +35,6 @@ using namespace DirectX;
using namespace Microsoft::WRL;
using namespace Windows::Foundation;
using namespace Windows::UI::Core;
using namespace PhoneDirect3DXamlAppComponent;
USING_NS_CC;
@ -151,7 +150,7 @@ void Cocos2dRenderer::OnCocos2dKeyEvent(Cocos2dKeyEvent event)
}
void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate)
void Cocos2dRenderer::SetXamlEventDelegate(Cocos2dEventDelegate^ delegate)
{
m_delegate = delegate;
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
@ -161,7 +160,7 @@ void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2
}
}
void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate)
void Cocos2dRenderer::SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate)
{
m_messageBoxDelegate = delegate;
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
@ -171,7 +170,7 @@ void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::C
}
}
void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate)
void Cocos2dRenderer::SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate)
{
m_editBoxDelegate = delegate;
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
@ -181,7 +180,7 @@ void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Coco
}
}
void Cocos2dRenderer::SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate)
void Cocos2dRenderer::SetXamlOpenURLDelegate(Cocos2dOpenURLDelegate^ delegate)
{
m_openURLDelegate = delegate;
Application* app = Application::getInstance();

View File

@ -41,11 +41,11 @@ public:
void OnBackButton();
void OnKeyPressed(Platform::String^ text);
void OnCocos2dKeyEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent event);
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
void SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate);
void OnCocos2dKeyEvent(cocos2d::Cocos2dKeyEvent event);
void SetXamlEventDelegate(cocos2d::Cocos2dEventDelegate^ delegate);
void SetXamlMessageBoxDelegate(cocos2d::Cocos2dMessageBoxDelegate^ delegate);
void SetXamlEditBoxDelegate(cocos2d::Cocos2dEditBoxDelegate^ delegate);
void SetXamlOpenURLDelegate(cocos2d::Cocos2dOpenURLDelegate^ delegate);
Windows::Foundation::IAsyncAction^ OnSuspending();
void Connect();
@ -59,10 +59,10 @@ private:
bool m_loadingComplete;
bool mInitialized;
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ m_openURLDelegate;
cocos2d::Cocos2dEventDelegate^ m_delegate;
cocos2d::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
cocos2d::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
cocos2d::Cocos2dOpenURLDelegate^ m_openURLDelegate;
// The AppDelegate for the Cocos2D app
AppDelegate* mApp;

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#include "Direct3DContentProvider.h"
#include "Direct3DInterop.h"
using namespace PhoneDirect3DXamlAppComponent;
using namespace cocos2d;
Direct3DContentProvider::Direct3DContentProvider(Direct3DInterop^ controller) :
m_controller(controller)

View File

@ -37,7 +37,7 @@ class Direct3DContentProvider : public Microsoft::WRL::RuntimeClass<
IDrawingSurfaceBackgroundContentProviderNative>
{
public:
Direct3DContentProvider(PhoneDirect3DXamlAppComponent::Direct3DInterop^ controller);
Direct3DContentProvider(cocos2d::Direct3DInterop^ controller);
// IDrawingSurfaceContentProviderNative
HRESULT STDMETHODCALLTYPE Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device);
@ -47,6 +47,6 @@ public:
HRESULT STDMETHODCALLTYPE Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView);
private:
PhoneDirect3DXamlAppComponent::Direct3DInterop^ m_controller;
cocos2d::Direct3DInterop^ m_controller;
Microsoft::WRL::ComPtr<IDrawingSurfaceRuntimeHostNative> m_host;
};

View File

@ -35,9 +35,8 @@ using namespace Windows::Phone::Graphics::Interop;
using namespace Windows::Phone::Input::Interop;
using namespace Windows::Graphics::Display;
using namespace DirectX;
using namespace PhoneDirect3DXamlAppComponent;
namespace PhoneDirect3DXamlAppComponent
namespace cocos2d
{
Direct3DInterop::Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation)

View File

@ -34,7 +34,7 @@ THE SOFTWARE.
#include <DrawingSurfaceNative.h>
namespace PhoneDirect3DXamlAppComponent
namespace cocos2d
{
public delegate void RequestAdditionalFrameHandler();

View File

@ -26,9 +26,9 @@ THE SOFTWARE.
using namespace Platform;
namespace PhoneDirect3DXamlAppComponent
namespace cocos2d
{
EditBoxEvent::EditBoxEvent( Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle ):
EditBoxEvent::EditBoxEvent( Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle ):
m_sender(sender),
m_args(arg),
m_handler(handle)

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
#include <agile.h>
namespace PhoneDirect3DXamlAppComponent
namespace cocos2d
{
class EditBoxEvent : public cocos2d::InputEvent
{

View File

@ -1,5 +1,5 @@
<Application
x:Class="PhoneDirect3DXamlAppInterop.App"
x:Class="cocos2d.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
@ -7,7 +7,7 @@
<!--Application Resources-->
<Application.Resources>
<local:LocalizedStrings xmlns:local="clr-namespace:PhoneDirect3DXamlAppInterop" x:Key="LocalizedStrings"/>
<local:LocalizedStrings xmlns:local="clr-namespace:cocos2d" x:Key="LocalizedStrings"/>
</Application.Resources>
<Application.ApplicationLifetimeObjects>

View File

@ -7,9 +7,8 @@ using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.IO.IsolatedStorage;
using PhoneDirect3DXamlAppInterop.Resources;
namespace PhoneDirect3DXamlAppInterop
namespace cocos2d
{
public partial class App : Application
{

View File

@ -1,4 +1,4 @@
<UserControl x:Class="PhoneDirect3DXamlAppInterop.EditBox"
<UserControl x:Class="cocos2d.EditBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

View File

@ -31,11 +31,10 @@ using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using PhoneDirect3DXamlAppComponent;
using System.Windows.Media;
using System.Windows.Input;
namespace PhoneDirect3DXamlAppInterop
namespace cocos2d
{
public partial class EditBox : UserControl
{

View File

@ -1,5 +1,5 @@
<phone:PhoneApplicationPage
x:Class="PhoneDirect3DXamlAppInterop.MainPage"
x:Class="cocos2d.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"

View File

@ -16,7 +16,6 @@ using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using PhoneDirect3DXamlAppComponent;
using System.Threading;
using System.Diagnostics;
using System.Threading.Tasks;
@ -27,7 +26,7 @@ using Microsoft.Phone.Info;
using Windows.Graphics.Display;
using Microsoft.Phone.Tasks;
namespace PhoneDirect3DXamlAppInterop
namespace cocos2d
{
public partial class MainPage : PhoneApplicationPage
{
@ -141,13 +140,15 @@ namespace PhoneDirect3DXamlAppInterop
public void OnKeyUp(object sender, KeyEventArgs e)
{
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
m_textBox.Text = "";
}
public void OnTextChanged(object sender, TextChangedEventArgs e)
{
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
if (m_textBox.Text.Length > 0)
{
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
m_textBox.Text = "";
}
}
// Called by the Cocos2d-x C++ engine to display a MessageBox
@ -181,7 +182,6 @@ namespace PhoneDirect3DXamlAppInterop
m_textBox.TextChanged += OnTextChanged;
DrawingSurfaceBackground.Children.Add(m_textBox);
}
m_textBox.Text = text;
m_textBox.SelectionLength = 0;
m_textBox.SelectionStart = int.MaxValue;
m_textBox.Focus();

View File

@ -49,7 +49,6 @@ using namespace Windows::ApplicationModel::Activation;
using namespace Windows::Phone::UI::Core;
using namespace Platform;
using namespace Microsoft::WRL;
using namespace PhoneDirect3DXamlAppComponent;
NS_CC_BEGIN

View File

@ -95,9 +95,9 @@ public:
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event);
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; };
void SetXamlEventDelegate(Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
void SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
void SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; };
bool ShowMessageBox(Platform::String^ title, Platform::String^ message);
bool OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
@ -178,9 +178,9 @@ private:
EGLDisplay m_eglDisplay;
EGLContext m_eglContext;
EGLSurface m_eglSurface;
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
Cocos2dEventDelegate^ m_delegate;
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
std::mutex mMutex;

File diff suppressed because it is too large Load Diff

View File

@ -45,13 +45,6 @@ THE SOFTWARE.
NS_CC_BEGIN
typedef struct _hashUniformEntry
{
GLvoid* value; // value
unsigned int location; // Key
UT_hash_handle hh; // hash entry
} tHashUniformEntry;
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR = "ShaderPositionTextureColor";
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP = "ShaderPositionTextureColor_noMVP";
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST = "ShaderPositionTextureColorAlphaTest";
@ -136,7 +129,6 @@ GLProgram::GLProgram()
: _program(0)
, _vertShader(0)
, _fragShader(0)
, _hashForUniforms(nullptr)
, _flags()
{
memset(_builtInUniforms, 0, sizeof(_builtInUniforms));
@ -163,15 +155,11 @@ GLProgram::~GLProgram()
GL::deleteProgram(_program);
}
tHashUniformEntry *current_element, *tmp;
// Purge uniform hash
HASH_ITER(hh, _hashForUniforms, current_element, tmp)
for (auto e : _hashForUniforms)
{
HASH_DEL(_hashForUniforms, current_element);
free(current_element->value);
free(current_element);
free(e.second);
}
_hashForUniforms.clear();
}
bool GLProgram::initWithByteArrays(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray)
@ -222,7 +210,8 @@ bool GLProgram::initWithByteArrays(const GLchar* vShaderByteArray, const GLchar*
{
glAttachShader(_program, _fragShader);
}
_hashForUniforms = nullptr;
_hashForUniforms.clear();
CHECK_GL_ERROR_DEBUG();
@ -260,7 +249,7 @@ bool GLProgram::initWithPrecompiledProgramByteArray(const GLchar* vShaderByteArr
haveProgram = CCPrecompiledShaders::getInstance()->loadProgram(_program, vShaderByteArray, fShaderByteArray);
CHECK_GL_ERROR_DEBUG();
_hashForUniforms = nullptr;
_hashForUniforms.clear();
CHECK_GL_ERROR_DEBUG();
@ -418,7 +407,9 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source
}
const GLchar *sources[] = {
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
(type == GL_VERTEX_SHADER ? "precision mediump float;\n precision mediump int;\n" : "precision mediump float;\n precision mediump int;\n"),
#elif (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)
(type == GL_VERTEX_SHADER ? "precision highp float;\n precision highp int;\n" : "precision mediump float;\n precision mediump int;\n"),
#endif
"uniform mat4 CC_PMatrix;\n"
@ -562,7 +553,7 @@ bool GLProgram::link()
_vertShader = _fragShader = 0;
#if DEBUG || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#if DEBUG || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
glGetProgramiv(_program, GL_LINK_STATUS, &status);
if (status == GL_FALSE)
@ -631,31 +622,23 @@ bool GLProgram::updateUniformLocation(GLint location, const GLvoid* data, unsign
}
bool updated = true;
tHashUniformEntry *element = nullptr;
HASH_FIND_INT(_hashForUniforms, &location, element);
if (! element)
auto element = _hashForUniforms.find(location);
if (element == _hashForUniforms.end())
{
element = (tHashUniformEntry*)malloc( sizeof(*element) );
// key
element->location = location;
// value
element->value = malloc( bytes );
memcpy(element->value, data, bytes );
HASH_ADD_INT(_hashForUniforms, location, element);
GLvoid* value = malloc(bytes);
memcpy(value, data, bytes );
_hashForUniforms.insert(std::make_pair(location, value));
}
else
{
if (memcmp(element->value, data, bytes) == 0)
if (memcmp(element->second, data, bytes) == 0)
{
updated = false;
}
else
{
memcpy(element->value, data, bytes);
memcpy(element->second, data, bytes);
}
}
@ -921,17 +904,12 @@ void GLProgram::reset()
//GL::deleteProgram(_program);
_program = 0;
tHashUniformEntry *current_element, *tmp;
// Purge uniform hash
HASH_ITER(hh, _hashForUniforms, current_element, tmp)
for (auto e: _hashForUniforms)
{
HASH_DEL(_hashForUniforms, current_element);
free(current_element->value);
free(current_element);
free(e.second);
}
_hashForUniforms = nullptr;
_hashForUniforms.clear();
}
NS_CC_END

View File

@ -45,7 +45,6 @@ NS_CC_BEGIN
* @{
*/
struct _hashUniformEntry;
class GLProgram;
typedef void (*GLInfoFunction)(GLuint program, GLenum pname, GLint* params);
@ -340,7 +339,6 @@ protected:
GLuint _vertShader;
GLuint _fragShader;
GLint _builtInUniforms[UNIFORM_MAX];
struct _hashUniformEntry* _hashForUniforms;
bool _hasShaderCompiler;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || defined(WP8_SHADER_COMPILER)
@ -360,6 +358,7 @@ protected:
std::unordered_map<std::string, Uniform> _userUniforms;
std::unordered_map<std::string, VertexAttrib> _vertexAttribs;
std::unordered_map<GLint, GLvoid*> _hashForUniforms;
};
NS_CC_END

View File

@ -31,7 +31,7 @@
#include "base/CCEventDispatcher.h"
#include "base/CCEventType.h"
#include "base/CCConfiguration.h"
#include "base/CCLight.h"
#include "2d/CCLight.h"
#include "renderer/ccGLStateCache.h"
#include "renderer/CCGLProgramState.h"
#include "renderer/CCRenderer.h"

View File

@ -40,7 +40,7 @@
#include "base/CCEventDispatcher.h"
#include "base/CCEventListenerCustom.h"
#include "base/CCEventType.h"
#include "base/CCCamera.h"
#include "2d/CCCamera.h"
#include "2d/CCScene.h"
NS_CC_BEGIN

View File

@ -406,6 +406,7 @@ Texture2D* TextureCache::addImage(Image *image, const std::string &key)
bool TextureCache::reloadTexture(const std::string& fileName)
{
Texture2D * texture = nullptr;
Image * image = nullptr;
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(fileName);
if (fullpath.size() == 0)
@ -426,7 +427,7 @@ bool TextureCache::reloadTexture(const std::string& fileName)
else
{
do {
Image* image = new (std::nothrow) Image();
image = new (std::nothrow) Image();
CC_BREAK_IF(nullptr == image);
bool bRet = image->initWithImageFile(fullpath);
@ -436,6 +437,8 @@ bool TextureCache::reloadTexture(const std::string& fileName)
} while (0);
}
CC_SAFE_RELEASE(image);
return ret;
}

View File

@ -100,29 +100,26 @@ void getPositionAndNormal(out vec4 position, out vec3 normal)
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
blendWeight = a_blendWeight[2];
if (blendWeight > 0.0)
{
matrixIndex = int(a_blendIndex[2]) * 3;
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
blendWeight = a_blendWeight[3];
if (blendWeight > 0.0)
{
matrixIndex = int(a_blendIndex[3]) * 3;
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
}
}
blendWeight = a_blendWeight[2];
if (blendWeight > 0.0)
{
matrixIndex = int(a_blendIndex[2]) * 3;
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
blendWeight = a_blendWeight[3];
if (blendWeight > 0.0)
{
matrixIndex = int(a_blendIndex[3]) * 3;
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
vec4 p = vec4(a_position, 1.0);
position.x = dot(p, matrixPalette1);
position.y = dot(p, matrixPalette2);

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