diff --git a/.gitignore b/.gitignore index 1f241f7eb9..4785e08370 100644 --- a/.gitignore +++ b/.gitignore @@ -116,6 +116,7 @@ tests/*/publish/ # Android project.properties +*.iml # Ignore prebuilt libraries folder /external/* diff --git a/AUTHORS b/AUTHORS index 4d820da895..604a521487 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1123,6 +1123,9 @@ Developers: Fixed crash on AssetsManager Fixed memory leak of WebView on iOS Fixed crahed that if url contains illegal characters on Android + + tankorsmash + Fixed the bug that ProgressTimer::setSprite() doesn't take effect Retired Core Developers: WenSheng Yang diff --git a/CHANGELOG b/CHANGELOG index fb9d6fca76..e6c8b7181b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,20 +1,28 @@ cocos2d-x-3.7 ?? + [NEW] 3rd: updated rapidjson to v1.0.2 [NEW] 3d: added physics3d support + [NEW] Audio: added support on WP8.1, now it supports wav format [NEW] C++: added ActionFloat [NEW] C++: support physical keyboard on WinRT [NEW] FileUtils: checked filename case characters on windows [NEW] FileUitls: added supporting loading files that which file path include utf-8 characters [NEW] PhysicsShape: added sensor property - + [NEW] Scale9Sprite: added Android 9-patch image support + [FIX] 3rd: fix PIE link error on iOS caused by libpng and libtiff [FIX] AssetsManager: crashed issue + [FIX] Audio: can not play large ogg files on windows [FIX] EaseRateAction: no way to create an `EaseRateAction` instance [FIX] Label: crashed if invoking `setString(text` after `getLetter(letterIndex)` and `letterIndex` is greater than the length of text [FIX] Label: position is wrong if label content is changed after invoking `getLetter(letterIndex)` [FIX] Label: shadow effect cause OpenGL error on iOS [FIX] Label: outline effect doesn't match characters well + [FIX] ProgressTimer: `setSprite()` doesn't take effect [FIX] Sprite3D: setGLProgram() does not work + [FIX] Sprite3D: transition breaks when there is a Sprite3D in the scene [FIX] Terrain: terrain is on top of particles, particles can not be seen + [FIX] TextureCache: unbindImageAsync failed to unbind all asynchronous callback for a specified bound image + [FIX] TileMap: crashed if a layer contains nothing [FIX] WebView: memory leak on iOS [FIX] WebView: crashed if url contains illegal characters on Android diff --git a/README.md b/README.md index de6121afb0..d0fcd5fcda 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ $ bin/lua-empty-test/lua-empty-test * For Windows -Open the `cocos2d-x/build/cocos2d-win32.vc2013.sln` +Open the `cocos2d-x/build/cocos2d-win32.sln` * For Windows 8.1 Universal Apps (Phone and Store) diff --git a/build/cocos2d-js-win32.vc2013.sln b/build/cocos2d-js-win32.sln similarity index 100% rename from build/cocos2d-js-win32.vc2013.sln rename to build/cocos2d-js-win32.sln diff --git a/build/cocos2d-js-win8.1-universal.sln b/build/cocos2d-js-win8.1-universal.sln index c7e811fd33..0b34f599a9 100644 --- a/build/cocos2d-js-win8.1-universal.sln +++ b/build/cocos2d-js-win8.1-universal.sln @@ -45,6 +45,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d.Windows", "..\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d.WindowsPhone", "..\cocos\scripting\js-bindings\proj.win8.1-universal\libjscocos2d\libjscocos2d.WindowsPhone\libjscocos2d.WindowsPhone.vcxproj", "{CA082EC4-17CE-430B-8207-D1E947A5D1E9}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbullet", "libbullet", "{9A66AB4C-057B-4675-849D-5D69B98C728C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Shared", "..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems", "{16AF311F-74CA-45A3-A82D-6334200FB124}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Windows", "..\external\bullet\proj.win8.1-universal\libbullet.Windows\libbullet.Windows.vcxproj", "{EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.WindowsPhone", "..\external\bullet\proj.win8.1-universal\libbullet.WindowsPhone\libbullet.WindowsPhone.vcxproj", "{E35634BD-B91B-4A6D-B957-96F56DD065F9}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution ..\tests\js-tests\project\proj.win8.1-universal\App.Shared\js-tests.Shared.vcxitems*{ae6763f6-1549-441e-afb5-377be1c776dc}*SharedItemsImports = 9 @@ -53,7 +61,10 @@ Global ..\tests\js-tests\project\proj.win8.1-universal\App.Shared\js-tests.Shared.vcxitems*{70914fc8-7709-4cd6-b86b-c63fde5478db}*SharedItemsImports = 4 ..\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 + ..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{e35634bd-b91b-4a6d-b957-96f56dd065f9}*SharedItemsImports = 4 + ..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{ec2b1292-2d8c-4feb-a84b-2550b32c1ae7}*SharedItemsImports = 4 ..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9 + ..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{16af311f-74ca-45a3-a82d-6334200fb124}*SharedItemsImports = 9 ..\cocos\scripting\js-bindings\proj.win8.1-universal\libjscocos2d\libjscocos2d.Shared\libjscocos2d.Shared.vcxitems*{ca082ec4-17ce-430b-8207-d1e947a5d1e9}*SharedItemsImports = 4 ..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9 ..\cocos\scripting\js-bindings\proj.win8.1-universal\libjscocos2d\libjscocos2d.Shared\libjscocos2d.Shared.vcxitems*{bea66276-51dd-4c53-92a8-f3d1fea50892}*SharedItemsImports = 9 @@ -192,6 +203,28 @@ Global {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|Win32.ActiveCfg = Release|Win32 {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|Win32.Build.0 = Release|Win32 {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|x64.ActiveCfg = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.ActiveCfg = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.Build.0 = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.ActiveCfg = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.Build.0 = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.ActiveCfg = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.Build.0 = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.ActiveCfg = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.Build.0 = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.ActiveCfg = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.Build.0 = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.ActiveCfg = Release|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.Build.0 = Release|x64 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.ActiveCfg = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.Build.0 = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.Build.0 = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|x64.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.ActiveCfg = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.Build.0 = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.ActiveCfg = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.Build.0 = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -214,5 +247,9 @@ Global {BEA66276-51DD-4C53-92A8-F3D1FEA50892} = {60DCAEA9-E344-40C0-B90C-82FB8E671BD5} {BCF5546D-66A0-4998-AFD6-C5514F618930} = {60DCAEA9-E344-40C0-B90C-82FB8E671BD5} {CA082EC4-17CE-430B-8207-D1E947A5D1E9} = {60DCAEA9-E344-40C0-B90C-82FB8E671BD5} + {9A66AB4C-057B-4675-849D-5D69B98C728C} = {85630454-74EA-4B5B-9B62-0E459B4476CB} + {16AF311F-74CA-45A3-A82D-6334200FB124} = {9A66AB4C-057B-4675-849D-5D69B98C728C} + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7} = {9A66AB4C-057B-4675-849D-5D69B98C728C} + {E35634BD-B91B-4A6D-B957-96F56DD065F9} = {9A66AB4C-057B-4675-849D-5D69B98C728C} EndGlobalSection EndGlobal diff --git a/build/cocos2d-win32.vc2013.sln b/build/cocos2d-win32.sln similarity index 100% rename from build/cocos2d-win32.vc2013.sln rename to build/cocos2d-win32.sln diff --git a/build/cocos2d-win8.1-universal.sln b/build/cocos2d-win8.1-universal.sln index 4ef61407d8..e850e1c542 100644 --- a/build/cocos2d-win8.1-universal.sln +++ b/build/cocos2d-win8.1-universal.sln @@ -45,6 +45,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Windows", "..\test 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 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbullet", "libbullet", "{0500043C-7E95-4351-97D6-0382A8C92DD3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Shared", "..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems", "{16AF311F-74CA-45A3-A82D-6334200FB124}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Windows", "..\external\bullet\proj.win8.1-universal\libbullet.Windows\libbullet.Windows.vcxproj", "{EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.WindowsPhone", "..\external\bullet\proj.win8.1-universal\libbullet.WindowsPhone\libbullet.WindowsPhone.vcxproj", "{E35634BD-B91B-4A6D-B957-96F56DD065F9}" +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 @@ -52,9 +60,12 @@ Global ..\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 + ..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{e35634bd-b91b-4a6d-b957-96f56dd065f9}*SharedItemsImports = 4 ..\tests\cpp-empty-test\proj.win8.1-universal\HelloCpp.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4 + ..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{ec2b1292-2d8c-4feb-a84b-2550b32c1ae7}*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 + ..\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{16af311f-74ca-45a3-a82d-6334200fb124}*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 @@ -202,6 +213,28 @@ Global {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 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.ActiveCfg = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.Build.0 = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.ActiveCfg = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.Build.0 = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.ActiveCfg = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.Build.0 = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.ActiveCfg = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.Build.0 = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.ActiveCfg = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.Build.0 = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.ActiveCfg = Release|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.Build.0 = Release|x64 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.ActiveCfg = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.Build.0 = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.Build.0 = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|x64.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.ActiveCfg = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.Build.0 = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.ActiveCfg = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.Build.0 = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -224,5 +257,9 @@ Global {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} + {0500043C-7E95-4351-97D6-0382A8C92DD3} = {85630454-74EA-4B5B-9B62-0E459B4476CB} + {16AF311F-74CA-45A3-A82D-6334200FB124} = {0500043C-7E95-4351-97D6-0382A8C92DD3} + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7} = {0500043C-7E95-4351-97D6-0382A8C92DD3} + {E35634BD-B91B-4A6D-B957-96F56DD065F9} = {0500043C-7E95-4351-97D6-0382A8C92DD3} EndGlobalSection EndGlobal diff --git a/build/cocos2d_js_tests.xcodeproj/project.pbxproj b/build/cocos2d_js_tests.xcodeproj/project.pbxproj index f69655eb62..20ca66c14a 100644 --- a/build/cocos2d_js_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_js_tests.xcodeproj/project.pbxproj @@ -821,7 +821,7 @@ ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/gui $(SRCROOT)/../cocos/network $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../cocos/scripting/js-bindings/auto $(SRCROOT)/../cocos/scripting/js-bindings/manual"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/gui $(SRCROOT)/../cocos/network $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../cocos/scripting/js-bindings/auto $(SRCROOT)/../cocos/scripting/js-bindings/manual"; }; name = Debug; }; @@ -845,7 +845,7 @@ HEADER_SEARCH_PATHS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/gui $(SRCROOT)/../cocos/network $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../cocos/scripting/js-bindings/auto $(SRCROOT)/../cocos/scripting/js-bindings/manual"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/gui $(SRCROOT)/../cocos/network $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../cocos/scripting/js-bindings/auto $(SRCROOT)/../cocos/scripting/js-bindings/manual"; }; name = Release; }; diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 3089622c2b..0329476755 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1190,6 +1190,10 @@ 1AC0269D1914068200FA920D /* ConvertUTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC026991914068200FA920D /* ConvertUTF.h */; }; 29031E0719BFE8D400EFA1DF /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 29031E0619BFE8D400EFA1DF /* libchipmunk.a */; }; 29031E0919BFE8DE00EFA1DF /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 29031E0819BFE8DE00EFA1DF /* libchipmunk.a */; }; + 291901431B05895600F8B4BA /* CCNinePatchImageParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 291901411B05895600F8B4BA /* CCNinePatchImageParser.h */; }; + 291901441B05895600F8B4BA /* CCNinePatchImageParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 291901411B05895600F8B4BA /* CCNinePatchImageParser.h */; }; + 291901451B05895600F8B4BA /* CCNinePatchImageParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 291901421B05895600F8B4BA /* CCNinePatchImageParser.cpp */; }; + 291901461B05895600F8B4BA /* CCNinePatchImageParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 291901421B05895600F8B4BA /* CCNinePatchImageParser.cpp */; }; 292DB13D19B4574100A80320 /* UIEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB12F19B4574100A80320 /* UIEditBox.cpp */; }; 292DB13E19B4574100A80320 /* UIEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB12F19B4574100A80320 /* UIEditBox.cpp */; }; 292DB13F19B4574100A80320 /* UIEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13019B4574100A80320 /* UIEditBox.h */; }; @@ -3925,6 +3929,8 @@ 2905FA1318CF08D100240AA3 /* UIWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidget.cpp; sourceTree = ""; }; 2905FA1418CF08D100240AA3 /* UIWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidget.h; sourceTree = ""; }; 29080DEB191B82CE0066F8DF /* UIDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIDeprecated.h; sourceTree = ""; }; + 291901411B05895600F8B4BA /* CCNinePatchImageParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCNinePatchImageParser.h; path = ../base/CCNinePatchImageParser.h; sourceTree = ""; }; + 291901421B05895600F8B4BA /* CCNinePatchImageParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCNinePatchImageParser.cpp; path = ../base/CCNinePatchImageParser.cpp; sourceTree = ""; }; 292DB12F19B4574100A80320 /* UIEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBox.cpp; sourceTree = ""; }; 292DB13019B4574100A80320 /* UIEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBox.h; sourceTree = ""; }; 292DB13119B4574100A80320 /* UIEditBoxImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImpl.h; sourceTree = ""; }; @@ -5626,6 +5632,8 @@ 1A5700A2180BC5E60088DEC7 /* base */ = { isa = PBXGroup; children = ( + 291901411B05895600F8B4BA /* CCNinePatchImageParser.h */, + 291901421B05895600F8B4BA /* CCNinePatchImageParser.cpp */, 505385001B01887A00793096 /* CCProperties.h */, 505385011B01887A00793096 /* CCProperties.cpp */, B63990CA1A490AFE00B07923 /* CCAsyncTaskPool.cpp */, @@ -9417,6 +9425,7 @@ 50ABBE211925AB6F00A911A9 /* atitc.h in Headers */, 15AE19A519AAD39600C27E9E /* TextFieldReader.h in Headers */, B665E3401AA80A6500DDB1C5 /* CCPUOnEventFlagObserverTranslator.h in Headers */, + 291901431B05895600F8B4BA /* CCNinePatchImageParser.h in Headers */, B24AA98B195A675C007B4522 /* CCFastTMXTiledMap.h in Headers */, B665E3A01AA80A6500DDB1C5 /* CCPUPositionEmitter.h in Headers */, B29594B61926D5EC003EEF37 /* CCMeshCommand.h in Headers */, @@ -10220,6 +10229,7 @@ 50ABBE481925AB6F00A911A9 /* CCEvent.h in Headers */, 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */, 15AE1A9719AAD40300C27E9E /* b2Draw.h in Headers */, + 291901441B05895600F8B4BA /* CCNinePatchImageParser.h in Headers */, 3E6176691960F89B00DE83F5 /* CCController.h in Headers */, B6CAB43E1AF9AA1A00B9B856 /* btGpuDefines.h in Headers */, 3823841D1A2590D2002C4610 /* ComAudioReader.h in Headers */, @@ -10693,6 +10703,7 @@ 50ED2BD919BE5D5D00A0AB90 /* CCEventListenerController.cpp in Sources */, B665E2321AA80A6500DDB1C5 /* CCPUBoxEmitter.cpp in Sources */, B257B460198A353E00D9A687 /* CCPrimitiveCommand.cpp in Sources */, + 291901451B05895600F8B4BA /* CCNinePatchImageParser.cpp in Sources */, 15AE19A419AAD39600C27E9E /* TextFieldReader.cpp in Sources */, 50ED2BDB19BE76D500A0AB90 /* UIVideoPlayer-ios.mm in Sources */, B665E32A1AA80A6500DDB1C5 /* CCPUOnCountObserver.cpp in Sources */, @@ -11653,6 +11664,7 @@ 15AE19AA19AAD39700C27E9E /* ListViewReader.cpp in Sources */, 1A5701C8180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */, 1A5701CC180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */, + 291901461B05895600F8B4BA /* CCNinePatchImageParser.cpp in Sources */, B665E39B1AA80A6500DDB1C5 /* CCPUPointEmitterTranslator.cpp in Sources */, 382384291A2590F9002C4610 /* NodeReader.cpp in Sources */, 15AE193419AAD35100C27E9E /* CCActionObject.cpp in Sources */, diff --git a/cocos/2d/CCActionCamera.h b/cocos/2d/CCActionCamera.h index 4ab7c1eac7..2dcc6c25e9 100644 --- a/cocos/2d/CCActionCamera.h +++ b/cocos/2d/CCActionCamera.h @@ -125,9 +125,9 @@ public: * @param t Duration in seconds. * @param radius The start radius. * @param deltaRadius The delta radius. - * @param angleZ The start Angel in Z. + * @param angleZ The start angle in Z. * @param deltaAngleZ The delta angle in Z. - * @param angleX The start Angel in X. + * @param angleX The start angle in X. * @param deltaAngleX The delta angle in X. * @return An OrbitCamera. */ diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 00236f8da1..712fc8ac3b 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -118,7 +118,7 @@ public: * * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param drawLineToCenter Whether or not draw the line from the origin to center. * @param scaleX The scale value in x. @@ -131,7 +131,7 @@ public: * * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param drawLineToCenter Whether or not draw the line from the origin to center. * @param color Set the circle color. @@ -216,7 +216,7 @@ public: /** Draws a solid circle given the center, radius and number of segments. * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param scaleX The scale value in x. * @param scaleY The scale value in y. @@ -228,7 +228,7 @@ public: /** Draws a solid circle given the center, radius and number of segments. * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param color The solid circle color. * @js NA diff --git a/cocos/2d/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h index eb13fb8348..38379c027d 100644 --- a/cocos/2d/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -153,7 +153,7 @@ namespace DrawPrimitives * * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param drawLineToCenter Whether or not draw the line from the origin to center. * @param scaleX The scale value in x. @@ -165,7 +165,7 @@ namespace DrawPrimitives * * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param drawLineToCenter Whether or not draw the line from the origin to center. */ @@ -174,7 +174,7 @@ namespace DrawPrimitives /** Draws a solid circle given the center, radius and number of segments. * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @param scaleX The scale value in x. * @param scaleY The scale value in y. @@ -185,7 +185,7 @@ namespace DrawPrimitives /** Draws a solid circle given the center, radius and number of segments. * @param center The circle center point. * @param radius The circle rotate of radius. - * @param angle The circle angel. + * @param angle The circle angle. * @param segments The number of segments. * @js NA */ diff --git a/cocos/2d/CCFastTMXTiledMap.cpp b/cocos/2d/CCFastTMXTiledMap.cpp index e444276ce1..3a13b0bebc 100644 --- a/cocos/2d/CCFastTMXTiledMap.cpp +++ b/cocos/2d/CCFastTMXTiledMap.cpp @@ -101,6 +101,9 @@ TMXTiledMap::~TMXTiledMap() TMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) { TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo); + if (tileset == nullptr) + return nullptr; + TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo); // tell the layerinfo to release the ownership of the tiles map. @@ -170,6 +173,10 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) if (layerInfo->_visible) { TMXLayer *child = parseLayer(layerInfo, mapInfo); + if (child == nullptr) { + idx++; + continue; + } addChild(child, idx, idx); // update content size with the max size diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index bb9115162f..423a60286e 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1314,9 +1314,12 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl _normalizedPositionDirty = false; } } + + //remove this two line given that isVisitableByVisitingCamera should not affect the calculation of transform given that we are visiting scene + //without involving view and projection matrix. - if (!isVisitableByVisitingCamera()) - return parentFlags; +// if (!isVisitableByVisitingCamera()) +// return parentFlags; uint32_t flags = parentFlags; flags |= (_transformUpdated ? FLAGS_TRANSFORM_DIRTY : 0); diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index d1b521d63f..9bf7e9f324 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -115,6 +115,8 @@ void ProgressTimer::setSprite(Sprite *sprite) CC_SAFE_FREE(_vertexData); _vertexDataCount = 0; } + + updateProgress(); } } diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index be359bd71d..656f4bf605 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -598,8 +598,8 @@ void Sprite::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) if(_insideBounds) #endif { - _quadCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, transform, flags); - renderer->addCommand(&_quadCommand); + _trianglesCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, getRenderedTriangles(), transform, flags); + renderer->addCommand(&_trianglesCommand); #if CC_SPRITE_DEBUG_DRAW _debugDrawNode->clear(); @@ -614,6 +614,17 @@ void Sprite::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) } } +TrianglesCommand::Triangles Sprite::getRenderedTriangles() const +{ + static unsigned short indices[6] = {0, 1, 2, 3, 2, 1}; + TrianglesCommand::Triangles result; + result.indices = indices; + result.verts = (V3F_C4B_T2F*)&_quad; + result.vertCount = 4; + result.indexCount = 6; + return result; +} + // MARK: visit, draw, transform void Sprite::addChild(Node *child, int zOrder, int tag) @@ -993,6 +1004,10 @@ bool Sprite::isFrameDisplayed(SpriteFrame *frame) const SpriteFrame* Sprite::getSpriteFrame() const { + if(nullptr != this->_spriteFrame) + { + return this->_spriteFrame; + } return SpriteFrame::createWithTexture(_texture, CC_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 66110f9a4b..2f6a65a36a 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include "2d/CCDrawNode.h" #include "base/CCProtocols.h" #include "renderer/CCTextureAtlas.h" -#include "renderer/CCQuadCommand.h" +#include "renderer/CCTrianglesCommand.h" #include "renderer/CCCustomCommand.h" NS_CC_BEGIN @@ -538,7 +538,8 @@ protected: virtual void updateBlendFunc(); virtual void setReorderChildDirtyRecursively(); virtual void setDirtyRecursively(bool value); - + + TrianglesCommand::Triangles getRenderedTriangles() const; // // Data used when the sprite is rendered using a SpriteSheet // @@ -557,7 +558,7 @@ protected: BlendFunc _blendFunc; /// It's required for TextureProtocol inheritance Texture2D* _texture; /// Texture2D object that is used to render the sprite SpriteFrame* _spriteFrame; - QuadCommand _quadCommand; /// quad command + TrianglesCommand _trianglesCommand; /// #if CC_SPRITE_DEBUG_DRAW DrawNode *_debugDrawNode; #endif //CC_SPRITE_DEBUG_DRAW diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index c7a56eecef..e83310db4b 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -39,7 +39,7 @@ THE SOFTWARE. #include "base/CCDirector.h" #include "renderer/CCTexture2D.h" #include "renderer/CCTextureCache.h" - +#include "base/CCNinePatchImageParser.h" #include "deprecated/CCString.h" @@ -104,6 +104,10 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu // check the format CCASSERT(format >=0 && format <= 3, "format is not supported for SpriteFrameCache addSpriteFramesWithDictionary:textureFilename:"); + auto textureFileName = Director::getInstance()->getTextureCache()->getTextureFilePath(texture); + auto image = new Image(); + image->initWithImageFile(textureFileName); + NinePatchImageParser parser(image); for (auto iter = framesDict.begin(); iter != framesDict.end(); ++iter) { ValueMap& frameDict = iter->second.asValueMap(); @@ -183,7 +187,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu _spriteFramesAliases[oneAlias] = Value(spriteFrameName); } - + // create frame spriteFrame = SpriteFrame::createWithTexture(texture, Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height), @@ -192,9 +196,16 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu spriteSourceSize); } + bool flag = NinePatchImageParser::isNinePatchImage(spriteFrameName); + if(flag) + { + parser.setSpriteFrameInfo(spriteFrame->getRectInPixels(), spriteFrame->isRotated()); + texture->addSpriteFrameCapInset(spriteFrame, parser.parseCapInset()); + } // add sprite frame _spriteFrames.insert(spriteFrameName, spriteFrame); } + CC_SAFE_DELETE(image); } void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture2D *texture) @@ -327,13 +338,14 @@ void SpriteFrameCache::removeUnusedSpriteFrames() if( spriteFrame->getReferenceCount() == 1 ) { toRemoveFrames.push_back(iter->first); + spriteFrame->getTexture()->removeSpriteFrameCapInset(spriteFrame); CCLOG("cocos2d: SpriteFrameCache: removing unused frame: %s", iter->first.c_str()); removed = true; } } _spriteFrames.erase(toRemoveFrames); - + // FIXME:. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache if( removed ) { diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index d5a3d842e8..773cf01d24 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -102,6 +102,9 @@ TMXTiledMap::~TMXTiledMap() TMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) { TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo); + if (tileset == nullptr) + return nullptr; + TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo); // tell the layerinfo to release the ownership of the tiles map. @@ -171,9 +174,12 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) auto& layers = mapInfo->getLayers(); for(const auto &layerInfo : layers) { - if (layerInfo->_visible) - { + if (layerInfo->_visible) { TMXLayer *child = parseLayer(layerInfo, mapInfo); + if (child == nullptr) { + idx++; + continue; + } addChild(child, idx, idx); // update content size with the max size diff --git a/cocos/2d/cocos2dx.props b/cocos/2d/cocos2dx.props index a0a234ee9f..f1a0af1cd4 100644 --- a/cocos/2d/cocos2dx.props +++ b/cocos/2d/cocos2dx.props @@ -7,7 +7,7 @@ - opengl32.lib;glew32.lib;libzlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;libwebp.lib;libiconv.lib;glfw3.lib;freetype250.lib;winmm.lib;ws2_32.lib;libchipmunk.lib;libbox2d.lib;libSpine.lib;%(AdditionalDependencies) + opengl32.lib;glew32.lib;libzlib.lib;libwebp.lib;libiconv.lib;freetype250.lib;winmm.lib;ws2_32.lib;libbox2d.lib;libSpine.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) false diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index fb05f4a5d9..66e821a166 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -432,6 +432,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.* + @@ -995,6 +996,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.* + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index 5f21b80697..0fa1979adb 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -1872,6 +1872,9 @@ renderer + + base + @@ -3662,6 +3665,9 @@ renderer + + base + diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems index 723413e8ac..11dd2de823 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems @@ -236,6 +236,9 @@ + + + @@ -282,6 +285,7 @@ + @@ -442,6 +446,14 @@ + + + + + + + + @@ -830,11 +842,15 @@ + NotUsing + + + NotUsing @@ -883,6 +899,7 @@ + @@ -892,7 +909,7 @@ - + @@ -1019,6 +1036,14 @@ + + + + + + + + @@ -1222,4 +1247,7 @@ + + + \ No newline at end of file diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters index d433b0f87d..bf8468a436 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters @@ -1791,6 +1791,42 @@ renderer + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + audioengine + + + audioengine + + + audioengine + + + audioengine + @@ -2776,9 +2812,6 @@ base - - base - base @@ -3405,6 +3438,45 @@ renderer + + audioengine + + + audioengine + + + audioengine + + + audioengine + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + physics3d + + + base + @@ -3662,6 +3734,12 @@ {932c5f6e-07b3-4b34-97ae-2f3d42024149} + + {bd1a6214-d6e0-4341-a1fc-79da99b55e35} + + + {e6f8ab69-f66f-48be-a40f-e33c08e77516} + @@ -3777,4 +3855,9 @@ 3d + + + physics3d + + \ No newline at end of file diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj index 7a5ccc03d0..aa50019dda 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj @@ -30,6 +30,9 @@ {3b26a12d-3a44-47ea-82d2-282660fc844d} + + {ec2b1292-2d8c-4feb-a84b-2550b32c1ae7} + {f3550fe0-c795-44f6-8feb-093eb68143ae} @@ -157,7 +160,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -177,7 +180,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -197,7 +200,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -217,7 +220,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -237,7 +240,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -257,7 +260,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories) - _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj index 9194a11930..d6f4970a79 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj @@ -22,6 +22,9 @@ {22f798d8-bfff-4754-996f-a5395343d5ec} + + {e35634bd-b91b-4a6d-b957-96f56dd065f9} + {cc1da216-a80d-4be4-b309-acb6af313aff} @@ -111,7 +114,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(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) - CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -131,7 +134,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(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) - CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -151,7 +154,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(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) - CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) @@ -171,7 +174,7 @@ /Zm384 /bigobj %(AdditionalOptions) pch.h $(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(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) - CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions) false %(DisableSpecificWarnings) diff --git a/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1.props b/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1.props index 672498aa94..b64561230f 100644 --- a/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1.props +++ b/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1.props @@ -15,7 +15,7 @@ true false OldStyle - 4056;4244;4251;4756;4453;28204; + 4056;4244;4251;4756;4453;28204;4099; libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;libcurl.lib;chipmunk.lib;zlib.lib;freetype.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies) diff --git a/cocos/3d/CCBillBoard.cpp b/cocos/3d/CCBillBoard.cpp index 95ec6aacd9..b8bbcb5238 100644 --- a/cocos/3d/CCBillBoard.cpp +++ b/cocos/3d/CCBillBoard.cpp @@ -230,10 +230,10 @@ void BillBoard::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { //FIXME: frustum culling here flags |= Node::FLAGS_RENDER_AS_3D; - _quadCommand.init(0, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, _modelViewTransform, flags); - _quadCommand.setTransparent(true); - _quadCommand.set3D(true); - renderer->addCommand(&_quadCommand); + _trianglesCommand.init(0, _texture->getName(), getGLProgramState(), _blendFunc, getRenderedTriangles(), _modelViewTransform, flags); + _trianglesCommand.setTransparent(true); + _trianglesCommand.set3D(true); + renderer->addCommand(&_trianglesCommand); } void BillBoard::setMode( Mode mode ) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index f50a2564c1..091ec7ddb2 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -701,7 +701,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { #if CC_USE_CULLING // camera clipping - if(!Camera::getVisitingCamera()->isVisibleInFrustum(&this->getAABB())) + if(Camera::getVisitingCamera() && !Camera::getVisitingCamera()->isVisibleInFrustum(&this->getAABB())) return; #endif diff --git a/cocos/3d/CCTerrain.cpp b/cocos/3d/CCTerrain.cpp index d8c9b13a4f..ee8ac3e864 100644 --- a/cocos/3d/CCTerrain.cpp +++ b/cocos/3d/CCTerrain.cpp @@ -33,6 +33,7 @@ USING_NS_CC; #include "renderer/CCRenderer.h" #include "renderer/CCGLProgramStateCache.h" #include "renderer/ccGLStateCache.h" +#include "renderer/CCRenderState.h" #include "base/CCDirector.h" #include "2d/CCCamera.h" @@ -79,6 +80,12 @@ bool Terrain::initProperties() auto state = GLProgramState::create(shader); setGLProgramState(state); + + _stateBlock->setBlend(false); + _stateBlock->setDepthWrite(true); + _stateBlock->setDepthTest(true); + _stateBlock->setCullFace(true); + setDrawWire(false); setIsEnableFrustumCull(true); setAnchorPoint(Vec2(0,0)); @@ -104,34 +111,16 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t flags) glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); } #endif - GLboolean blendCheck = glIsEnabled(GL_BLEND); - if(blendCheck) - { - glDisable(GL_BLEND); - } + + _stateBlock->bind(); + GL::enableVertexAttribs(1<<_positionLocation | 1 << _texcordLocation | 1<<_normalLocation); glProgram->setUniformsForBuiltins(transform); - GLboolean depthMaskCheck; - glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskCheck); - if(!depthMaskCheck) - { - glDepthMask(GL_TRUE); - } - GLboolean CullFaceCheck =glIsEnabled(GL_CULL_FACE); - if(!CullFaceCheck) - { - glEnable(GL_CULL_FACE); - } - GLboolean depthTestCheck; - depthTestCheck = glIsEnabled(GL_DEPTH_TEST); - if(!depthTestCheck) - { - glEnable(GL_DEPTH_TEST); - } + if(!_alphaMap) { glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D,_detailMapTextures[0]->getName()); + GL::bindTexture2D(_detailMapTextures[0]->getName()); glUniform1i(_detailMapLocation[0],0); glUniform1i(_alphaIsHasAlphaMapLocation,0); }else @@ -139,7 +128,7 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t flags) for(int i =0;i<_maxDetailMapValue;i++) { glActiveTexture(GL_TEXTURE0+i); - glBindTexture(GL_TEXTURE_2D,_detailMapTextures[i]->getName()); + GL::bindTexture2D(_detailMapTextures[i]->getName()); glUniform1i(_detailMapLocation[i],i); glUniform1f(_detailMapSizeLocation[i],_terrainData._detailMaps[i]._detailMapSize); @@ -148,7 +137,7 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t flags) glUniform1i(_alphaIsHasAlphaMapLocation,1); glActiveTexture(GL_TEXTURE4); - glBindTexture(GL_TEXTURE_2D,_alphaMap->getName()); + GL::bindTexture2D(_alphaMap->getName()); glUniform1i(_alphaMapLocation,4); } @@ -180,28 +169,7 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t flags) _isCameraViewChanged = false; } glActiveTexture(GL_TEXTURE0); - if(depthTestCheck) - { - }else - { - glDisable(GL_DEPTH_TEST); - } - if(depthMaskCheck) - { - }else - { - glDepthMask(GL_FALSE); - } - if(CullFaceCheck) - { - }else - { - glEnable(GL_CULL_FACE); - } - if(blendCheck) - { - glEnable(GL_BLEND); - } + #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) if(_isDrawWire)//reset state. { @@ -260,8 +228,12 @@ bool Terrain::initHeightMap(const char * heightMap) } Terrain::Terrain() +: _alphaMap(nullptr) +, _stateBlock(nullptr) { - _alphaMap = nullptr; + _stateBlock = RenderState::StateBlock::create(); + CC_SAFE_RETAIN(_stateBlock); + _customCommand.setTransparent(false); _customCommand.set3D(true); #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) @@ -453,6 +425,8 @@ void Terrain::setIsEnableFrustumCull(bool bool_value) Terrain::~Terrain() { + CC_SAFE_RELEASE(_stateBlock); + _alphaMap->release(); _heightMapImage->release(); delete _quadRoot; @@ -832,7 +806,6 @@ void Terrain::reload() } } - CCLOG("recreate"); initTextures(); _chunkLodIndicesSet.clear(); _chunkLodIndicesSkirtSet.clear(); diff --git a/cocos/3d/CCTerrain.h b/cocos/3d/CCTerrain.h index c348ecb22b..d06e1005d1 100644 --- a/cocos/3d/CCTerrain.h +++ b/cocos/3d/CCTerrain.h @@ -24,15 +24,18 @@ THE SOFTWARE. #ifndef CC_TERRAIN_H #define CC_TERRAIN_H +#include + #include "2d/CCNode.h" #include "2d/CCCamera.h" #include "renderer/CCTexture2D.h" #include "renderer/CCCustomCommand.h" +#include "renderer/CCRenderState.h" #include "3d/CCAABB.h" #include "3d/CCRay.h" -#include #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" + NS_CC_BEGIN /** @@ -81,7 +84,7 @@ NS_CC_BEGIN * We can use ray-terrain intersection to pick a point of the terrain; * Also we can get an arbitrary point of the terrain's height and normal vector for convenience . **/ -class CC_DLL Terrain :public Node +class CC_DLL Terrain : public Node { public: @@ -433,6 +436,7 @@ protected: ChunkIndices insertIndicesLOD(int neighborLod[4], int selfLod, GLushort * indices, int size); ChunkIndices insertIndicesLODSkirt(int selfLod, GLushort * indices, int size); + protected: std::vector _chunkLodIndicesSet; std::vector _chunkLodIndicesSkirtSet; @@ -469,6 +473,9 @@ protected: GLint _alphaMapLocation; GLint _alphaIsHasAlphaMapLocation; GLint _detailMapSizeLocation[4]; + + RenderState::StateBlock* _stateBlock; + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) EventListenerCustom* _backToForegroundListener; #endif diff --git a/cocos/Android.mk b/cocos/Android.mk index b0b466db76..9d12cf222e 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -103,6 +103,7 @@ math/TransformUtils.cpp \ math/Vec2.cpp \ math/Vec3.cpp \ math/Vec4.cpp \ +base/CCNinePatchImageParser.cpp \ base/CCAsyncTaskPool.cpp \ base/CCAutoreleasePool.cpp \ base/CCConfiguration.cpp \ diff --git a/cocos/audio/AudioEngine.cpp b/cocos/audio/AudioEngine.cpp index 3532870bea..252c8de835 100644 --- a/cocos/audio/AudioEngine.cpp +++ b/cocos/audio/AudioEngine.cpp @@ -24,7 +24,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "audio/include/AudioEngine.h" #include "platform/CCFileUtils.h" @@ -36,6 +36,8 @@ #include "apple/AudioEngine-inl.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "win32/AudioEngine-win32.h" +#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT +#include "winrt/AudioEngine-winrt.h" #endif #define TIME_DELAY_PRECISION 0.0001 diff --git a/cocos/audio/include/AudioEngine.h b/cocos/audio/include/AudioEngine.h index 7cad808f6f..f96fbe75e8 100644 --- a/cocos/audio/include/AudioEngine.h +++ b/cocos/audio/include/AudioEngine.h @@ -23,7 +23,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #ifndef __AUDIO_ENGINE_H_ #define __AUDIO_ENGINE_H_ diff --git a/cocos/audio/win32/AudioCache.h b/cocos/audio/win32/AudioCache.h index 9d27d7abd8..97896b2d15 100644 --- a/cocos/audio/win32/AudioCache.h +++ b/cocos/audio/win32/AudioCache.h @@ -38,7 +38,7 @@ #endif #include "CCPlatformMacros.h" -#define QUEUEBUFFER_NUM 3 +#define QUEUEBUFFER_NUM 5 #define QUEUEBUFFER_TIME_STEP 0.1f NS_CC_BEGIN diff --git a/cocos/audio/win32/AudioEngine-win32.cpp b/cocos/audio/win32/AudioEngine-win32.cpp index f131f7ed2c..573daa2867 100644 --- a/cocos/audio/win32/AudioEngine-win32.cpp +++ b/cocos/audio/win32/AudioEngine-win32.cpp @@ -62,6 +62,7 @@ namespace cocos2d { for (int index = 0; index < _numThread; ++index) { _tasks.push_back(nullptr); _threads.push_back( std::thread( std::bind(&AudioEngineThreadPool::threadFunc,this,index) ) ); + _threads[index].detach(); } } @@ -78,7 +79,7 @@ namespace cocos2d { if (targetIndex == -1) { _tasks.push_back(task); _threads.push_back( std::thread( std::bind(&AudioEngineThreadPool::threadFunc,this,_numThread) ) ); - + _threads[_numThread].detach(); _numThread++; } _taskMutex.unlock(); @@ -212,16 +213,14 @@ int AudioEngineImpl::play2d(const std::string &filePath ,bool loop ,float volume auto it = _audioCaches.find(filePath); if (it == _audioCaches.end()) { audioCache = &_audioCaches[filePath]; - - auto ext = filePath.substr(filePath.rfind('.')); - transform(ext.begin(), ext.end(), ext.begin(), tolower); - + auto ext = strchr(filePath.c_str(), '.'); bool eraseCache = true; - if (ext.compare(".ogg") == 0){ + + if (_stricmp(ext, ".ogg") == 0){ audioCache->_fileFormat = AudioCache::FileFormat::OGG; eraseCache = false; } - else if (ext.compare(".mp3") == 0){ + else if (_stricmp(ext, ".mp3") == 0){ audioCache->_fileFormat = AudioCache::FileFormat::MP3; if (MPG123_LAZYINIT){ @@ -239,7 +238,7 @@ int AudioEngineImpl::play2d(const std::string &filePath ,bool loop ,float volume } } else{ - log("unsupported media type:%s\n",ext.c_str()); + log("unsupported media type:%s\n", ext); } if (eraseCache){ @@ -380,7 +379,14 @@ bool AudioEngineImpl::stop(int audioID) alSourcei(player._alSource, AL_BUFFER, NULL); _alSourceUsed[player._alSource] = false; - _audioPlayers.erase(audioID); + if (player._streamingSource) + { + player.notifyExitThread(); + } + else + { + _audioPlayers.erase(audioID); + } return ret; } @@ -394,7 +400,19 @@ void AudioEngineImpl::stopAll() _alSourceUsed[_alSources[index]] = false; } - _audioPlayers.clear(); + for (auto it = _audioPlayers.begin(); it != _audioPlayers.end();) + { + auto& player = it->second; + if (player._streamingSource) + { + player.notifyExitThread(); + ++it; + } + else + { + it = _audioPlayers.erase(it); + } + } } float AudioEngineImpl::getDuration(int audioID) @@ -498,7 +516,11 @@ void AudioEngineImpl::update(float dt) auto& player = it->second; alGetSourcei(player._alSource, AL_SOURCE_STATE, &sourceState); - if (player._ready && sourceState == AL_STOPPED) { + if (player._readForRemove) + { + it = _audioPlayers.erase(it); + } + else if (player._ready && sourceState == AL_STOPPED) { _alSourceUsed[player._alSource] = false; if (player._finishCallbak) { auto& audioInfo = AudioEngine::_audioIDInfoMap[audioID]; @@ -507,7 +529,15 @@ void AudioEngineImpl::update(float dt) AudioEngine::remove(audioID); - it = _audioPlayers.erase(it); + if (player._streamingSource) + { + player.notifyExitThread(); + ++it; + } + else + { + it = _audioPlayers.erase(it); + } } else{ ++it; diff --git a/cocos/audio/win32/AudioPlayer.cpp b/cocos/audio/win32/AudioPlayer.cpp index e7225e5f04..a2a96363e7 100644 --- a/cocos/audio/win32/AudioPlayer.cpp +++ b/cocos/audio/win32/AudioPlayer.cpp @@ -42,6 +42,7 @@ AudioPlayer::AudioPlayer() , _finishCallbak(nullptr) , _ready(false) , _audioCache(nullptr) + , _readForRemove(false) { } @@ -59,13 +60,17 @@ AudioPlayer::AudioPlayer(const AudioPlayer& player) AudioPlayer::~AudioPlayer() { - _exitThread = true; if (_audioCache && _audioCache->_queBufferFrames > 0) { + alDeleteBuffers(QUEUEBUFFER_NUM, _bufferIds); + } +} + +void AudioPlayer::notifyExitThread() +{ + if (_audioCache && _audioCache->_queBufferFrames > 0) { + std::unique_lock lk(_sleepMutex); + _exitThread = true; _sleepCondition.notify_all(); - if (_rotateBufferThread.joinable()) { - _rotateBufferThread.join(); - } - alDeleteBuffers(3, _bufferIds); } } @@ -94,11 +99,9 @@ bool AudioPlayer::play2d(AudioCache* cache) alSourcei(_alSource, AL_LOOPING, AL_FALSE); auto alError = alGetError(); - alGenBuffers(3, _bufferIds); + alGenBuffers(QUEUEBUFFER_NUM, _bufferIds); alError = alGetError(); if (alError == AL_NO_ERROR) { - _rotateBufferThread = std::thread(&AudioPlayer::rotateBufferThread,this, _audioCache->_queBufferFrames * QUEUEBUFFER_NUM + 1); - for (int index = 0; index < QUEUEBUFFER_NUM; ++index) { alBufferData(_bufferIds[index], _audioCache->_alBufferFormat, _audioCache->_queBuffers[index], _audioCache->_queBufferSize[index], _audioCache->_sampleRate); } @@ -110,13 +113,22 @@ bool AudioPlayer::play2d(AudioCache* cache) } } - alSourcePlay(_alSource); - _ready = true; - auto alError = alGetError(); + if (_streamingSource) + { + _rotateBufferThread = std::thread(&AudioPlayer::rotateBufferThread, this, _audioCache->_queBufferFrames * QUEUEBUFFER_NUM + 1); + _rotateBufferThread.detach(); + } + else + { + alSourcePlay(_alSource); - if (alError != AL_NO_ERROR) { - log("%s:alSourcePlay error code:%x\n", __FUNCTION__,alError); - return false; + auto alError = alGetError(); + if (alError != AL_NO_ERROR) { + log("%s:alSourcePlay error code:%x\n", __FUNCTION__, alError); + return false; + } + + _ready = true; } return true; @@ -177,9 +189,13 @@ void AudioPlayer::rotateBufferThread(int offsetFrame) break; } + alSourcePlay(_alSource); + while (!_exitThread) { alGetSourcei(_alSource, AL_SOURCE_STATE, &sourceState); if (sourceState == AL_PLAYING) { + _ready = true; + alGetSourcei(_alSource, AL_BUFFERS_PROCESSED, &bufferProcessed); while (bufferProcessed > 0) { bufferProcessed--; @@ -250,11 +266,13 @@ void AudioPlayer::rotateBufferThread(int offsetFrame) } } - if (_exitThread){ + std::unique_lock lk(_sleepMutex); + if (_exitThread) + { break; } - std::unique_lock lk(_sleepMutex); - _sleepCondition.wait_for(lk,std::chrono::milliseconds(75)); + + _sleepCondition.wait_for(lk,std::chrono::milliseconds(35)); } ExitBufferThread: switch (audioFileFormat) @@ -272,6 +290,7 @@ ExitBufferThread: break; } free(tmpBuffer); + _readForRemove = true; } bool AudioPlayer::setLoop(bool loop) diff --git a/cocos/audio/win32/AudioPlayer.h b/cocos/audio/win32/AudioPlayer.h index 7c20ff3701..21ad5222a2 100644 --- a/cocos/audio/win32/AudioPlayer.h +++ b/cocos/audio/win32/AudioPlayer.h @@ -37,6 +37,7 @@ #include #endif #include "CCPlatformMacros.h" +#include "AudioCache.h" NS_CC_BEGIN namespace experimental{ @@ -55,7 +56,8 @@ public: bool setTime(float time); float getTime() { return _currTime;} bool setLoop(bool loop); - + void notifyExitThread(); + protected: void rotateBufferThread(int offsetFrame); bool play2d(AudioCache* cache); @@ -73,11 +75,12 @@ protected: float _currTime; bool _timeDirty; bool _streamingSource; - ALuint _bufferIds[3]; + ALuint _bufferIds[QUEUEBUFFER_NUM]; std::thread _rotateBufferThread; std::mutex _sleepMutex; std::condition_variable _sleepCondition; - bool _exitThread; + bool _exitThread; + bool _readForRemove; friend class AudioEngineImpl; }; diff --git a/cocos/audio/winrt/AudioCachePlayer.cpp b/cocos/audio/winrt/AudioCachePlayer.cpp new file mode 100644 index 0000000000..bf3efa1451 --- /dev/null +++ b/cocos/audio/winrt/AudioCachePlayer.cpp @@ -0,0 +1,568 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2011 - 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 "platform/CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + +#include "AudioCachePlayer.h" + +using namespace cocos2d; +using namespace cocos2d::experimental; + +inline void ThrowIfFailed(HRESULT hr) +{ + if (FAILED(hr)) { + // Set a breakpoint on this line to catch XAudio2 API errors. + throw Platform::Exception::CreateException(hr); + } +} + + +// AudioCache +AudioCache::AudioCache() + : _isReady(false) + , _fileFullPath("") + , _srcReader(nullptr) + , _fileFormat(FileFormat::UNKNOWN) +{ + _callbacks.clear(); + memset(&_audInfo, 0, sizeof(AudioInfo)); +} + +AudioCache::AudioCache(const AudioCache& obj) +{ + // TODO +} + +AudioCache& AudioCache::operator=(const AudioCache& rhs) +{ + // TODO + return *this; +} + +AudioCache::~AudioCache() +{ + _callbacks.clear(); + + if (nullptr != _srcReader) { + delete _srcReader; + _srcReader = nullptr; + } +} + +void AudioCache::readDataTask() +{ + std::wstring path(_fileFullPath.begin(), _fileFullPath.end()); + + if (nullptr != _srcReader) { + delete _srcReader; + _srcReader = nullptr; + } + + switch (_fileFormat) + { + case FileFormat::WAV: + _srcReader = new (std::nothrow) WAVReader(); + if (_srcReader->initialize(_fileFullPath)) { + _audInfo._totalAudioBytes = _srcReader->getTotalAudioBytes(); + _audInfo._wfx = _srcReader->getWaveFormatInfo(); + _isReady = true; + invokeCallbacks(); + } + break; + + case FileFormat::OGG: + break; + + case FileFormat::MP3: + break; + + case FileFormat::UNKNOWN: + default: + break; + } +} + +void AudioCache::addCallback(const std::function &callback) +{ + _cbMutex.lock(); + if (_isReady) { + callback(); + } + else { + _callbacks.push_back(callback); + } + _cbMutex.unlock(); +} + +void AudioCache::invokeCallbacks() +{ + _cbMutex.lock(); + auto cnt = _callbacks.size(); + for (size_t ind = 0; ind < cnt; ind++) + { + _callbacks[ind](); + } + _callbacks.clear(); + _cbMutex.unlock(); +} + +bool AudioCache::getChunk(AudioDataChunk& chunk) +{ + bool ret = false; + + if (nullptr != _srcReader) { + ret = _srcReader->consumeChunk(chunk); + } + + return ret; +} + +void AudioCache::doBuffering() +{ + if (isStreamingSource()){ + _srcReader->produceChunk(); + } +} + +bool AudioCache::isStreamingSource() +{ + if (nullptr != _srcReader) { + return _srcReader->isStreamingSource(); + } + + return false; +} + +void AudioCache::seek(const float ratio) +{ + if (nullptr != _srcReader){ + _srcReader->seekTo(ratio); + } +} + + +// AudioPlayer +AudioPlayer::AudioPlayer() + : _loop(false) + , _ready(false) + , _current(0.0) + , _volume(0.0) + , _duration(0.0) + , _cache(nullptr) + , _totalSamples(0) + , _samplesOffset(0) + , _criticalError(false) + , _isStreaming(false) + , _finishCallback(nullptr) + , _xaMasterVoice(nullptr) + , _xaSourceVoice(nullptr) + , _state(AudioPlayerState::INITIALZING) +{ + init(); +} + +AudioPlayer::~AudioPlayer() +{ + free(); +} + +void AudioPlayer::stop() +{ + _stop(); +} + +void AudioPlayer::pause() +{ + _stop(true); +} + +bool AudioPlayer::update() +{ + if (_criticalError){ + free(); + init(); + } + + if (_cache != nullptr) { + _cache->doBuffering(); + } + + //log("bufferQueued: %d, _current: %f", _cachedBufferQ.size(), _current); + return _criticalError; +} + +void AudioPlayer::resume() +{ + _play(true); +} + +bool AudioPlayer::isInError() +{ + return _criticalError; +} + +float AudioPlayer::getDuration() +{ + if (nullptr == _cache) { + return _duration; + } + + auto fmt = _cache->_audInfo._wfx; + + if (!fmt.nChannels) { + return _duration; + } + + if ((int)_duration <= 0) + { + switch (fmt.wFormatTag) + { + case WAVE_FORMAT_PCM: + case WAVE_FORMAT_ADPCM: + _duration = (float(_cache->_audInfo._totalAudioBytes / ((fmt.wBitsPerSample / 8) * fmt.nChannels)) / fmt.nSamplesPerSec) * 1000; + _totalSamples = fmt.nSamplesPerSec * _duration / 1000; + break; + + default: + break; + } + } + + return _duration; +} + +float AudioPlayer::getCurrentTime() +{ + _stMutex.lock(); + auto samplesPlayed = getSourceVoiceState().SamplesPlayed; + //log("_samplesOffset: %lu, samplesPlayed: %lu, _current: %f", (UINT32)_samplesOffset, (UINT32)samplesPlayed, _current); + _current += ((samplesPlayed - _samplesOffset) / (float)_totalSamples) * _duration; + _current = _current > _duration ? 0.0 : _current; + _samplesOffset = samplesPlayed; + _stMutex.unlock(); + return _current; +} + +bool AudioPlayer::setTime(float time) +{ + bool ret = true; + _stop(); + + if (!_isStreaming) { + auto fmt = _cache->_audInfo._wfx; + int seek = (time / _duration) * _totalSamples; + seek -= (seek % (fmt.nChannels * fmt.nBlockAlign)); + + _xaBuffer.LoopCount = 0; + _xaBuffer.PlayBegin = seek; + _xaBuffer.PlayLength = _totalSamples - seek; + + if (_xaBuffer.PlayBegin >= _totalSamples) { + _xaBuffer.PlayBegin = _totalSamples - (fmt.nChannels * fmt.nBlockAlign); + _xaBuffer.PlayLength = (fmt.nChannels * fmt.nBlockAlign); + } + } + + _stMutex.lock(); + _samplesOffset = getSourceVoiceState().SamplesPlayed; + _current = time; + _stMutex.unlock(); + _play(); + return ret; +} + +void AudioPlayer::setVolume(float volume) +{ + if (_xaMasterVoice != nullptr){ + if (FAILED(_xaMasterVoice->SetVolume(volume))) { + error(); + } + } +} + +bool AudioPlayer::play2d(AudioCache* cache) +{ + bool ret = false; + + if (cache != nullptr) + { + _cache = cache; + if (nullptr == _xaSourceVoice && _ready) { + + XAUDIO2_SEND_DESCRIPTOR descriptors[1]; + descriptors[0].pOutputVoice = _xaMasterVoice; + descriptors[0].Flags = 0; + XAUDIO2_VOICE_SENDS sends = { 0 }; + sends.SendCount = 1; + sends.pSends = descriptors; + ThrowIfFailed(_xaEngine->CreateSourceVoice(&_xaSourceVoice, &cache->_audInfo._wfx, 0, 1.0, this, &sends)); + } + + _isStreaming = _cache->isStreamingSource(); + _duration = getDuration(); + ret = _play(); + } + + return ret; +} + +void AudioPlayer::init() +{ + memset(&_xaBuffer, 0, sizeof(_xaBuffer)); + ThrowIfFailed(XAudio2Create(_xaEngine.ReleaseAndGetAddressOf())); + +#if defined(_DEBUG) + XAUDIO2_DEBUG_CONFIGURATION debugConfig = { 0 }; + debugConfig.BreakMask = XAUDIO2_LOG_ERRORS; + debugConfig.TraceMask = XAUDIO2_LOG_ERRORS; + _xaEngine->SetDebugConfiguration(&debugConfig); +#endif + + _xaEngine->RegisterForCallbacks(this); + ThrowIfFailed(_xaEngine->CreateMasteringVoice(&_xaMasterVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, nullptr, nullptr, AudioCategory_GameMedia)); + _ready = true; + _state = AudioPlayerState::READY; +} + +void AudioPlayer::free() +{ + _stop(); + memset(&_xaBuffer, 0, sizeof(_xaBuffer)); + + if (_xaEngine) { + _xaEngine->StopEngine(); + } + + if (_xaSourceVoice != nullptr) { + _xaSourceVoice->DestroyVoice(); + _xaSourceVoice = nullptr; + } + + if (_xaMasterVoice != nullptr) { + _xaMasterVoice->DestroyVoice(); + _xaMasterVoice = nullptr; + } + + while (!_cachedBufferQ.empty()) { + popBuffer(); + } +} + +bool AudioPlayer::_play(bool resume) +{ + do { + if (!resume) { + _cache->seek(_current / _duration); + submitBuffers(); + } + + if (_state == AudioPlayerState::PAUSED && !resume || nullptr == _xaSourceVoice) break; + + if (FAILED(_xaSourceVoice->Start())) { + error(); + } + else { + _state = AudioPlayerState::PLAYING; + } + } while (false); + + return !_criticalError; +} + +void AudioPlayer::_stop(bool pause) +{ + if (_xaSourceVoice != nullptr) { + + if (FAILED(_xaSourceVoice->Stop())) { + error(); + } + else { + if (!pause) { + _xaSourceVoice->FlushSourceBuffers(); + if (_state != AudioPlayerState::PAUSED) _state = AudioPlayerState::STOPPED; + } + else { + _state = AudioPlayerState::PAUSED; + } + } + } +} + +void AudioPlayer::error() +{ + _criticalError = true; + _ready = false; + _state = AudioPlayerState::ERRORED; +} + +void AudioPlayer::popBuffer() +{ + _bqMutex.lock(); + if (!_cachedBufferQ.empty()) { + delete[] _cachedBufferQ.front()._data; + _cachedBufferQ.pop(); + } + _bqMutex.unlock(); +} + +bool AudioPlayer::submitBuffers() +{ + bool ret = false; + + _bqMutex.lock(); + do { + if (nullptr == _xaSourceVoice) break; + if (!_cachedBufferQ.size() || (_isStreaming && _cachedBufferQ.size() < QUEUEBUFFER_NUM)) { + AudioDataChunk chunk; + if (_cache->getChunk(chunk)) { + _xaBuffer.AudioBytes = chunk._dataSize; + _xaBuffer.pAudioData = chunk._data; + _xaBuffer.Flags = chunk._endOfStream ? XAUDIO2_END_OF_STREAM : 0; + _cachedBufferQ.push(chunk); + ret = SUCCEEDED(_xaSourceVoice->SubmitSourceBuffer(&_xaBuffer)); + if (!_isStreaming) break; + } + else { + break; + } + } + else if (!_isStreaming) { + ret = SUCCEEDED(_xaSourceVoice->SubmitSourceBuffer(&_xaBuffer)); + break; + } + else { + break; + } + } while (ret); + _bqMutex.unlock(); + + return ret; +} + +void AudioPlayer::updateState() +{ + if (!_isStreaming) { + _stMutex.lock(); + _samplesOffset = getSourceVoiceState().SamplesPlayed; + _stMutex.unlock(); + } + else { + if (_cachedBufferQ.size() > getSourceVoiceState(true).BuffersQueued) { + popBuffer(); + } + } +} + +void AudioPlayer::onBufferRunOut() +{ + _stMutex.lock(); + _samplesOffset = 0; + _current = 0.0; + _xaBuffer.PlayBegin = _xaBuffer.PlayLength = 0; + _stMutex.unlock(); + + if (!_loop) { + _stop(); + //invokeFinishCallback(); + } + else { + _play(); + } +} + +void AudioPlayer::invokeFinishCallback() +{ + if (_finishCallback) { + _finishCallback(0, ""); + } +} + +XAUDIO2_VOICE_STATE AudioPlayer::getSourceVoiceState(bool fast) +{ + XAUDIO2_VOICE_STATE state; + memset(&state, 0, sizeof(XAUDIO2_VOICE_STATE)); + + if (_xaSourceVoice != nullptr) { + _xaSourceVoice->GetState(&state, fast ? XAUDIO2_VOICE_NOSAMPLESPLAYED : 0); + } + + return state; +} + +// IXAudio2EngineCallback +void AudioPlayer::OnProcessingPassStart() +{ +} + +void AudioPlayer::OnProcessingPassEnd() +{ +} + +void AudioPlayer::OnCriticalError(HRESULT err) +{ + UNREFERENCED_PARAMETER(err); + error(); +} + +// IXAudio2VoiceCallback +void AudioPlayer::OnVoiceProcessingPassStart(UINT32 uBytesRequired) +{ + if (uBytesRequired && _isStreaming){ + submitBuffers(); + } +} + +void AudioPlayer::OnVoiceProcessingPassEnd() +{ +} + +void AudioPlayer::OnStreamEnd() +{ + onBufferRunOut(); +} + +void AudioPlayer::OnBufferStart(void* pBufferContext) +{ + UNREFERENCED_PARAMETER(pBufferContext); +} + +void AudioPlayer::OnBufferEnd(void* pBufferContext) +{ + UNREFERENCED_PARAMETER(pBufferContext); + updateState(); +} + +void AudioPlayer::OnLoopEnd(void* pBufferContext) +{ + UNREFERENCED_PARAMETER(pBufferContext); + + if (!_loop) { + _stop(); + } +} + +void AudioPlayer::OnVoiceError(void* pBufferContext, HRESULT err) +{ + UNREFERENCED_PARAMETER(pBufferContext); + UNREFERENCED_PARAMETER(err); + error(); +} + +#endif diff --git a/cocos/audio/winrt/AudioCachePlayer.h b/cocos/audio/winrt/AudioCachePlayer.h new file mode 100644 index 0000000000..453a532f1d --- /dev/null +++ b/cocos/audio/winrt/AudioCachePlayer.h @@ -0,0 +1,159 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2011 - 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 "platform/CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + +#ifndef __AUDIO_CACHE_PLAYER_H_ +#define __AUDIO_CACHE_PLAYER_H_ + +#include "AudioSourceReader.h" + +NS_CC_BEGIN +namespace experimental{ + +typedef struct AudioInfo +{ + size_t _totalAudioBytes; + WAVEFORMATEX _wfx; +} AudioInfo; + +enum class AudioPlayerState +{ + ERRORED = -1, + INITIALZING, + READY, + PLAYING, + PAUSED, + STOPPED +}; + + class AudioCache +{ +public: + AudioCache(); + ~AudioCache(); + + void readDataTask(); + void addCallback(const std::function &callback); + bool getChunk(AudioDataChunk& chunk); + void doBuffering(); + bool isStreamingSource(); + void seek(const float ratio); + +protected: + AudioCache(const AudioCache&); + AudioCache& operator=(const AudioCache&); + void invokeCallbacks(); + +private: + bool _isReady; + AudioInfo _audInfo; + std::mutex _cbMutex; + FileFormat _fileFormat; + std::string _fileFullPath; + AudioSourceReader *_srcReader; + std::vector> _callbacks; + + + friend class AudioPlayer; + friend class AudioEngineImpl; + }; + + + class AudioPlayer : public IXAudio2EngineCallback, IXAudio2VoiceCallback + { + public: + AudioPlayer(); + virtual ~AudioPlayer(); + + void stop(); + void pause(); + bool update(); + void resume(); + bool isInError(); + float getDuration(); + float getCurrentTime(); + bool setTime(float time); + void setVolume(float volume); + bool play2d(AudioCache* cache); + AudioPlayerState getState() { return _state; } + + protected: + AudioPlayer(AudioPlayer&); + AudioPlayer& operator=(AudioPlayer&); + + void init(); + void free(); + void error(); + void popBuffer(); + void updateState(); + bool submitBuffers(); + void onBufferRunOut(); + void invokeFinishCallback(); + void _stop(bool pause = false); + bool _play(bool resume = false); + XAUDIO2_VOICE_STATE getSourceVoiceState(bool fast = false); + + // IXAudio2EngineCallback + STDMETHOD_(void, OnProcessingPassStart) () override; + STDMETHOD_(void, OnProcessingPassEnd) () override; + STDMETHOD_(void, OnCriticalError) (HRESULT error) override; + + // IXAudio2VoiceCallback + STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32 uBytesRequired) override; + STDMETHOD_(void, OnVoiceProcessingPassEnd) () override; + STDMETHOD_(void, OnStreamEnd) () override; + STDMETHOD_(void, OnBufferStart) (void* pBufferContext) override; + STDMETHOD_(void, OnBufferEnd) (void* pBufferContext) override; + STDMETHOD_(void, OnLoopEnd) (void* pBufferContext) override; + STDMETHOD_(void, OnVoiceError) (void *pBufferContext, HRESULT error) override; + + private: + bool _loop; + bool _ready; + float _volume; + float _current; + float _duration; + bool _criticalError; + bool _isStreaming; + UINT64 _totalSamples; + UINT64 _samplesOffset; + + XAUDIO2_BUFFER _xaBuffer; + IXAudio2SourceVoice *_xaSourceVoice; + IXAudio2MasteringVoice *_xaMasterVoice; + Microsoft::WRL::ComPtr _xaEngine; + + AudioCache *_cache; + std::mutex _stMutex; + std::mutex _bqMutex; + AudioPlayerState _state; + std::queue _cachedBufferQ; + std::function _finishCallback; + + + friend class AudioEngineImpl; + }; + +} +NS_CC_END +#endif // __AUDIO_CACHE_PLAYER_H_ +#endif + diff --git a/cocos/audio/winrt/AudioEngine-winrt.cpp b/cocos/audio/winrt/AudioEngine-winrt.cpp new file mode 100644 index 0000000000..a999cddcfc --- /dev/null +++ b/cocos/audio/winrt/AudioEngine-winrt.cpp @@ -0,0 +1,430 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2011 - 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 "platform/CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + +#include "AudioEngine-winrt.h" +#include + + +using namespace cocos2d; +using namespace cocos2d::experimental; + + +namespace cocos2d { + namespace experimental { + class AudioEngineThreadPool + { + public: + AudioEngineThreadPool() + : _running(true) + , _numThread(6) + { + _threads.reserve(_numThread); + _tasks.reserve(_numThread); + + for (int index = 0; index < _numThread; ++index) { + _tasks.push_back(nullptr); + _threads.push_back(std::thread(std::bind(&AudioEngineThreadPool::threadFunc, this, index))); + } + } + + void addTask(const std::function &task){ + _taskMutex.lock(); + int targetIndex = -1; + for (int index = 0; index < _numThread; ++index) { + if (_tasks[index] == nullptr) { + targetIndex = index; + _tasks[index] = task; + break; + } + } + if (targetIndex == -1) { + _tasks.push_back(task); + _threads.push_back(std::thread(std::bind(&AudioEngineThreadPool::threadFunc, this, _numThread))); + + _numThread++; + } + _taskMutex.unlock(); + _sleepCondition.notify_all(); + } + + void destroy() + { + _running = false; + _sleepCondition.notify_all(); + + for (int index = 0; index < _numThread; ++index) { + _threads[index].join(); + } + } + private: + bool _running; + std::vector _threads; + std::vector< std::function > _tasks; + + void threadFunc(int index) + { + while (_running) { + std::function task = nullptr; + _taskMutex.lock(); + task = _tasks[index]; + _taskMutex.unlock(); + + if (nullptr == task) + { + std::unique_lock lk(_sleepMutex); + _sleepCondition.wait(lk); + continue; + } + + task(); + + _taskMutex.lock(); + _tasks[index] = nullptr; + _taskMutex.unlock(); + } + } + + int _numThread; + + std::mutex _taskMutex; + std::mutex _sleepMutex; + std::condition_variable _sleepCondition; + }; + } +} + +AudioEngineImpl::AudioEngineImpl() + : _lazyInitLoop(true) + , _currentAudioID(0) + , _threadPool(nullptr) +{ + +} + +AudioEngineImpl::~AudioEngineImpl() +{ + _audioCaches.clear(); + + if (_threadPool) { + _threadPool->destroy(); + delete _threadPool; + } +} + +bool AudioEngineImpl::init() +{ + bool ret = false; + + if (nullptr == _threadPool) { + _threadPool = new (std::nothrow) AudioEngineThreadPool(); + } + + ret = true; + return ret; +} + +int AudioEngineImpl::play2d(const std::string &filePath, bool loop, float volume) +{ + AudioCache* audioCache = nullptr; + auto it = _audioCaches.find(filePath); + if (it == _audioCaches.end()) { + audioCache = &_audioCaches[filePath]; + + auto ext = filePath.substr(filePath.rfind('.')); + transform(ext.begin(), ext.end(), ext.begin(), tolower); + + bool eraseCache = true; + + if (ext.compare(".wav") == 0){ + audioCache->_fileFormat = FileFormat::WAV; + eraseCache = false; + } + else if (ext.compare(".ogg") == 0){ + audioCache->_fileFormat = FileFormat::OGG; + //eraseCache = false; //TODO add support for OGG + } + else if (ext.compare(".mp3") == 0){ + audioCache->_fileFormat = FileFormat::MP3; + //eraseCache = false; //TODO add support for MP3 + } + else{ + log("unsupported media type:%s\n", ext.c_str()); + eraseCache = false; + } + + if (eraseCache){ + _audioCaches.erase(filePath); + return AudioEngine::INVALID_AUDIO_ID; + } + + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); + audioCache->_fileFullPath = fullPath; + _threadPool->addTask(std::bind(&AudioCache::readDataTask, audioCache)); + } + else { + audioCache = &it->second; + } + + auto player = &_audioPlayers[_currentAudioID]; + player->_loop = loop; + player->_volume = volume; + audioCache->addCallback(std::bind(&AudioEngineImpl::_play2d, this, audioCache, _currentAudioID)); + + if (_lazyInitLoop) { + _lazyInitLoop = false; + + auto scheduler = cocos2d::Director::getInstance()->getScheduler(); + scheduler->schedule(schedule_selector(AudioEngineImpl::update), this, 0.05f, false); + } + + return _currentAudioID++; +} + +void AudioEngineImpl::_play2d(AudioCache *cache, int audioID) +{ + if (cache->_isReady){ + auto playerIt = _audioPlayers.find(audioID); + if (playerIt != _audioPlayers.end()) { + if (playerIt->second.play2d(cache)) { + AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PLAYING; + } + else{ + _threadMutex.lock(); + _toRemoveAudioIDs.push_back(audioID); + _threadMutex.unlock(); + } + } + } + else { + _threadMutex.lock(); + _toRemoveCaches.push_back(cache); + _toRemoveAudioIDs.push_back(audioID); + _threadMutex.unlock(); + } +} + +void AudioEngineImpl::setVolume(int audioID, float volume) +{ + auto& player = _audioPlayers[audioID]; + + if (player._ready){ + player.setVolume(volume); + } + + if (player.isInError()) { + log("%s: audio id = %d, error.\n", __FUNCTION__, audioID); + } +} + +void AudioEngineImpl::setLoop(int audioID, bool loop) +{ + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + player._loop = loop; + } + + if (player.isInError()) { + log("%s: audio id = %d, error.\n", __FUNCTION__, audioID); + } +} + +bool AudioEngineImpl::pause(int audioID) +{ + bool ret = false; + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + player.pause(); + AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PAUSED; + } + + ret = !player.isInError(); + + if (!ret) { + log("%s: audio id = %d, error.\n", __FUNCTION__, audioID); + } + + return ret; +} + +bool AudioEngineImpl::resume(int audioID) +{ + bool ret = false; + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + player.resume(); + AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PLAYING; + } + + ret = !player.isInError(); + + if (!ret) { + log("%s: audio id = %d, error.\n", __FUNCTION__, audioID); + } + + return ret; +} + +bool AudioEngineImpl::stop(int audioID) +{ + bool ret = false; + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + player.stop(); + ret = !player.isInError(); + } + + if (!ret) { + log("%s: audio id = %d, error.\n", __FUNCTION__, audioID); + } + + _audioPlayers.erase(audioID); + return ret; +} + +void AudioEngineImpl::stopAll() +{ + for (auto &player : _audioPlayers) { + player.second.stop(); + } + + _audioPlayers.clear(); +} + +float AudioEngineImpl::getDuration(int audioID) +{ + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + return player.getDuration(); + } + else { + return AudioEngine::TIME_UNKNOWN; + } +} + +float AudioEngineImpl::getCurrentTime(int audioID) +{ + float ret = 0.0f; + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + ret = player.getCurrentTime(); + } + + return ret; +} + +bool AudioEngineImpl::setCurrentTime(int audioID, float time) +{ + bool ret = false; + auto& player = _audioPlayers[audioID]; + + if (player._ready) { + ret = player.setTime(time); + } + + if (!ret) { + log("%s: audio id = %d, error.\n", __FUNCTION__, audioID); + } + + return ret; +} + +void AudioEngineImpl::setFinishCallback(int audioID, const std::function &callback) +{ + _audioPlayers[audioID]._finishCallback = callback; +} + +void AudioEngineImpl::update(float dt) +{ + int audioID; + + if (_threadMutex.try_lock()) { + size_t removeAudioCount = _toRemoveAudioIDs.size(); + for (size_t index = 0; index < removeAudioCount; ++index) { + audioID = _toRemoveAudioIDs[index]; + auto playerIt = _audioPlayers.find(audioID); + if (playerIt != _audioPlayers.end()) { + if (playerIt->second._finishCallback) { + auto& audioInfo = AudioEngine::_audioIDInfoMap[audioID]; + playerIt->second._finishCallback(audioID, *audioInfo.filePath); + } + _audioPlayers.erase(audioID); + AudioEngine::remove(audioID); + } + } + + size_t removeCacheCount = _toRemoveCaches.size(); + for (size_t index = 0; index < removeCacheCount; ++index) { + auto itEnd = _audioCaches.end(); + for (auto it = _audioCaches.begin(); it != itEnd; ++it) { + if (&it->second == _toRemoveCaches[index]) { + _audioCaches.erase(it); + break; + } + } + } + _threadMutex.unlock(); + } + + for (auto it = _audioPlayers.begin(); it != _audioPlayers.end();) { + audioID = it->first; + auto& player = it->second; + + if (player._ready && player._state == AudioPlayerState::STOPPED) { + if (player._finishCallback) { + auto& audioInfo = AudioEngine::_audioIDInfoMap[audioID]; + player._finishCallback(audioID, *audioInfo.filePath); + } + + AudioEngine::remove(audioID); + it = _audioPlayers.erase(it); + } + else{ + player.update(); + ++it; + } + } + + if (_audioPlayers.empty()){ + _lazyInitLoop = true; + + auto scheduler = cocos2d::Director::getInstance()->getScheduler(); + scheduler->unschedule(schedule_selector(AudioEngineImpl::update), this); + } +} + +void AudioEngineImpl::uncache(const std::string &filePath) +{ + _audioCaches.erase(filePath); +} + +void AudioEngineImpl::uncacheAll() +{ + _audioCaches.clear(); +} + +#endif diff --git a/cocos/audio/winrt/AudioEngine-winrt.h b/cocos/audio/winrt/AudioEngine-winrt.h new file mode 100644 index 0000000000..906ab7ff31 --- /dev/null +++ b/cocos/audio/winrt/AudioEngine-winrt.h @@ -0,0 +1,82 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2011 - 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 "platform/CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + +#ifndef __AUDIO_ENGINE_WINRT_H_ +#define __AUDIO_ENGINE_WINRT_H_ + +#define NEAR near + +#include + +#include "base/CCRef.h" +#include "AudioEngine.h" +#include "AudioCachePlayer.h" + +NS_CC_BEGIN + namespace experimental{ +#define MAX_AUDIOINSTANCES 32 + + + class AudioEngineThreadPool; + + class CC_DLL AudioEngineImpl : public cocos2d::Ref + { + public: + AudioEngineImpl(); + ~AudioEngineImpl(); + + bool init(); + int play2d(const std::string &fileFullPath, bool loop, float volume); + void setVolume(int audioID, float volume); + void setLoop(int audioID, bool loop); + bool pause(int audioID); + bool resume(int audioID); + bool stop(int audioID); + void stopAll(); + float getDuration(int audioID); + float getCurrentTime(int audioID); + bool setCurrentTime(int audioID, float time); + void setFinishCallback(int audioID, const std::function &callback); + void uncache(const std::string& filePath); + void uncacheAll(); + void update(float dt); + + private: + void _play2d(AudioCache *cache, int audioID); + + private: + std::unordered_map _audioPlayers; + std::unordered_map _audioCaches; + std::vector _toRemoveCaches; + + std::mutex _threadMutex; + std::vector _toRemoveAudioIDs; + bool _lazyInitLoop; + int _currentAudioID; + AudioEngineThreadPool* _threadPool; + }; +} + +NS_CC_END +#endif // __AUDIO_ENGINE_WINRT_H_ +#endif + diff --git a/cocos/audio/winrt/AudioSourceReader.cpp b/cocos/audio/winrt/AudioSourceReader.cpp new file mode 100644 index 0000000000..d43c67d356 --- /dev/null +++ b/cocos/audio/winrt/AudioSourceReader.cpp @@ -0,0 +1,198 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2011 - 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 "platform/CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + +#include "AudioSourceReader.h" + +using namespace cocos2d; +using namespace cocos2d::experimental; + + +// AudioFileReader +AudioSourceReader::AudioSourceReader() : +_isStreaming(false) +, _filePath("") +, _audioSize(0) +{ +} + +AudioSourceReader::~AudioSourceReader() +{ +} + + +// WAVFileReader +WAVReader::WAVReader() : +_bytesRead(0) +, _isDirty(false) +, _streamer(nullptr) +{ +} + +WAVReader::~WAVReader() +{ + flushChunks(); +} + +bool WAVReader::initialize(const std::string& filePath) +{ + bool ret = false; + _isStreaming = false; + _filePath = filePath; + + do { + auto fileSize = FileUtils::getInstance()->getFileSize(_filePath); + + if (fileSize <= 0) + break; + + flushChunks(); + + _rwMutex.lock(); + _streamer = ref new MediaStreamer; + _streamer->Initialize(std::wstring(_filePath.begin(), _filePath.end()).c_str(), true); + _rwMutex.unlock(); + _wfx = _streamer->GetOutputWaveFormatEx(); + UINT32 dataSize = _streamer->GetMaxStreamLengthInBytes(); + + if (dataSize <= 0) + break; + + _audioSize = dataSize; + if (_audioSize <= PCMDATA_CACHEMAXSIZE) { + produceChunk(); + } + else { + _isStreaming = true; + for (int i = 0; i < QUEUEBUFFER_NUM; i++) { + produceChunk(); + } + } + + ret = true; + } while (false); + + return ret; +} + +bool WAVReader::consumeChunk(AudioDataChunk& chunk) +{ + bool ret = false; + _isDirty = true; + + _rwMutex.lock(); + if (_chnkQ.size() > 0) { + chunk = _chnkQ.front(); + if (_isStreaming) { + _chnkQ.pop(); + } + else{ + // copy for future requests + auto cpy = new (std::nothrow) unsigned char[chunk._dataSize]; + memcpy(cpy, chunk._data, chunk._dataSize); + _chnkQ.front()._data = cpy; + } + ret = true; + } + _rwMutex.unlock(); + + return ret; +} + +void WAVReader::produceChunk() +{ + _rwMutex.lock(); + int chunkSize = _audioSize; + + do { + if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) { + break; + } + + if (_isStreaming) { + chunkSize = std::min(CHUNK_SIZE_MAX, _audioSize - _bytesRead); + } + + if (!chunkSize && !_chnkQ.size()) { + auto alignment = _wfx.nChannels * _wfx.nBlockAlign; + _bytesRead -= alignment; + chunkSize = alignment; + } + + UINT retSize = 0; + AudioDataChunk chunk = { 0 }; + chunk._data = new (std::nothrow) unsigned char[chunkSize]; + _streamer->ReadChunk(chunk._data, _bytesRead, chunkSize, &retSize); + + if (retSize <= 0) { + delete[] chunk._data; + chunk._data = nullptr; + break; + } + + _bytesRead += retSize; + chunk._dataSize = retSize; + chunk._seqNo = ((float)_bytesRead / _audioSize) * ((float)_audioSize / CHUNK_SIZE_MAX); + chunk._endOfStream = (_bytesRead >= _audioSize); + _chnkQ.push(chunk); + } while (false); + _rwMutex.unlock(); +} + +void WAVReader::seekTo(const float ratio) +{ + if (_isStreaming) { + _bytesRead = ratio * _audioSize; + + if (!_bytesRead && !_isDirty && _chnkQ.size()) // already in 0.0 position + return; + + flushChunks(); + + switch (_wfx.wFormatTag) + { + case WAVE_FORMAT_PCM: + case WAVE_FORMAT_ADPCM: { + auto alignment = _wfx.nChannels * _wfx.nBlockAlign; + _bytesRead = _bytesRead >= _audioSize ? (_audioSize - alignment) : _bytesRead - (_bytesRead % alignment); + } break; + + default: + break; + } + + for (int i = 0; i < QUEUEBUFFER_NUM; i++) { + produceChunk(); + } + } +} + +void WAVReader::flushChunks() +{ + _rwMutex.lock(); + while (!_chnkQ.empty()) { + delete[] _chnkQ.front()._data; + _chnkQ.pop(); + } + _rwMutex.unlock(); +} + +#endif diff --git a/cocos/audio/winrt/AudioSourceReader.h b/cocos/audio/winrt/AudioSourceReader.h new file mode 100644 index 0000000000..71166172a4 --- /dev/null +++ b/cocos/audio/winrt/AudioSourceReader.h @@ -0,0 +1,109 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2011 - 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 "platform/CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + +#ifndef __AUDIO_SOURCE_READER_H_ +#define __AUDIO_SOURCE_READER_H_ + +#define NEAR near +#include "MediaStreamer.h" + +NS_CC_BEGIN +namespace experimental{ + +const UINT PCMDATA_CACHEMAXSIZE = 2621440; +const UINT QUEUEBUFFER_NUM = 4; +const UINT CHUNK_SIZE_MAX = PCMDATA_CACHEMAXSIZE / QUEUEBUFFER_NUM; + +enum class FileFormat +{ + UNKNOWN, + WAV, + MP3, + OGG +}; + +typedef struct AudioDataChunk +{ + size_t _dataSize; + unsigned char *_data; + bool _endOfStream; + int _seqNo; +} AudioDataChunk; + + +class AudioSourceReader +{ +public: + AudioSourceReader(); + virtual ~AudioSourceReader(); + + bool isStreamingSource() { return _isStreaming; } + std::string getFilePath() { return _filePath; } + virtual size_t getTotalAudioBytes() { return _audioSize; } + + virtual bool initialize(const std::string& filePath) = 0; + virtual FileFormat getFileFormat() = 0; + virtual bool consumeChunk(AudioDataChunk& chunk) = 0; + virtual void produceChunk() = 0; + virtual void seekTo(const float ratio) = 0; + virtual const WAVEFORMATEX& getWaveFormatInfo() { return _wfx; } + +protected: + bool _isStreaming; + std::string _filePath; + size_t _audioSize; + WAVEFORMATEX _wfx; +}; + +class WAVReader : public AudioSourceReader + { + public: + WAVReader(); + ~WAVReader(); + + bool initialize(const std::string& filePath) override; + FileFormat getFileFormat() override { return FileFormat::WAV; } + bool consumeChunk(AudioDataChunk& chunk) override; + void produceChunk() override; + void seekTo(const float ratio) override; + + protected: + void enqueueChunk(const AudioDataChunk& chunk); + void flushChunks(); + + private: + bool _isDirty; + size_t _bytesRead; + std::mutex _rwMutex; + MediaStreamer^ _streamer; + std::queue _chnkQ; + }; + +class MP3Reader : public AudioSourceReader + { + }; + +} +NS_CC_END +#endif // __AUDIO_SOURCE_READER_H_ +#endif + diff --git a/cocos/audio/winrt/MediaStreamer.cpp b/cocos/audio/winrt/MediaStreamer.cpp index fc6287cd04..486c13c0d2 100644 --- a/cocos/audio/winrt/MediaStreamer.cpp +++ b/cocos/audio/winrt/MediaStreamer.cpp @@ -39,6 +39,8 @@ using namespace Concurrency; ((uint32)(byte)(ch2) << 16) | ((uint32)(byte)(ch3) << 24 )) #endif /* defined(MAKEFOURCC) */ +const int FMT_CHUNK_MAX = 256; + inline void ThrowIfFailed(HRESULT hr) { if (FAILED(hr)) @@ -50,6 +52,8 @@ inline void ThrowIfFailed(HRESULT hr) MediaStreamer::MediaStreamer() : m_offset(0) + , m_dataLen(0) + , m_filename(nullptr) { ZeroMemory(&m_waveFormat, sizeof(m_waveFormat)); m_location = Package::Current->InstalledLocation; @@ -59,9 +63,13 @@ MediaStreamer::MediaStreamer() : MediaStreamer::~MediaStreamer() { } -Platform::Array^ MediaStreamer::ReadData( - _In_ Platform::String^ filename - ) + +Platform::Array^ MediaStreamer::ReadData(_In_ Platform::String^ filename) +{ + return ReadData(filename, 0, 0); +} + +Platform::Array^ MediaStreamer::ReadData(_In_ Platform::String^ filename, uint32 from, uint32 length) { CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0}; extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); @@ -72,26 +80,16 @@ Platform::Array^ MediaStreamer::ReadData( extendedParams.hTemplateFile = nullptr; Wrappers::FileHandle file( - CreateFile2( - filename->Data(), - GENERIC_READ, - FILE_SHARE_READ, - OPEN_EXISTING, - &extendedParams - ) + CreateFile2(filename->Data(), GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, &extendedParams) ); + if (file.Get()==INVALID_HANDLE_VALUE) { throw ref new Platform::FailureException(); } - FILE_STANDARD_INFO fileInfo = {0}; - if (!GetFileInformationByHandleEx( - file.Get(), - FileStandardInfo, - &fileInfo, - sizeof(fileInfo) - )) + FILE_STANDARD_INFO fileInfo = { 0 }; + if (!GetFileInformationByHandleEx(file.Get(), FileStandardInfo, &fileInfo, sizeof(fileInfo))) { throw ref new Platform::FailureException(); } @@ -101,15 +99,21 @@ Platform::Array^ MediaStreamer::ReadData( throw ref new Platform::OutOfMemoryException(); } - Platform::Array^ fileData = ref new Platform::Array(fileInfo.EndOfFile.LowPart); + from += m_offset; + length = (length == 0 || from + length > fileInfo.EndOfFile.LowPart) ? fileInfo.EndOfFile.LowPart - from : length; + Platform::Array^ fileData = ref new Platform::Array(length); - if (!ReadFile( - file.Get(), - fileData->Data, - fileData->Length, - nullptr, - nullptr - ) ) + if (from) + { + LARGE_INTEGER pos = { 0 }; + pos.QuadPart = from; + if (!SetFilePointerEx(file.Get(), pos, nullptr, FILE_BEGIN)) + { + throw ref new Platform::FailureException(); + } + } + + if (!ReadFile(file.Get(), fileData->Data, fileData->Length, nullptr, nullptr)) { throw ref new Platform::FailureException(); } @@ -117,9 +121,9 @@ Platform::Array^ MediaStreamer::ReadData( return fileData; } -void MediaStreamer::Initialize(__in const WCHAR* url) +void MediaStreamer::Initialize(__in const WCHAR* url, bool lazy) { - + m_filename = ref new Platform::String(url); WCHAR filePath[MAX_PATH] = {0}; if ((wcslen(url) > 1 && url[1] == ':')) { @@ -139,8 +143,7 @@ void MediaStreamer::Initialize(__in const WCHAR* url) wcscat_s(filePath, url); } - - Platform::Array^ data = ReadData(ref new Platform::String(filePath)); + Platform::Array^ data = lazy ? ReadData(ref new Platform::String(filePath), 0, FMT_CHUNK_MAX) : ReadData(ref new Platform::String(filePath)); UINT32 length = data->Length; const byte * dataPtr = data->Data; UINT32 offset = 0; @@ -197,22 +200,45 @@ void MediaStreamer::Initialize(__in const WCHAR* url) // Locate the 'data' chunk and copy its contents to a buffer. ThrowIfFailed(ReadChunk(MAKEFOURCC('d', 'a', 't', 'a'), chunkSize, chunkPos)); - m_data.resize(chunkSize); - CopyMemory(m_data.data(), &dataPtr[chunkPos], chunkSize); + m_dataLen = chunkSize; + m_offset = chunkPos; - m_offset = 0; + if (!lazy) + { + m_data.resize(chunkSize); + CopyMemory(m_data.data(), &dataPtr[chunkPos], chunkSize); + m_offset = 0; + } } void MediaStreamer::ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferLength) { - UINT32 toCopy = m_data.size() - m_offset; - if (toCopy > maxBufferSize) toCopy = maxBufferSize; + if (!m_data.size()) + { + ReadChunk(buffer, 0, m_dataLen, bufferLength); + } + else + { + UINT32 toCopy = m_data.size() - m_offset; + if (toCopy > maxBufferSize) toCopy = maxBufferSize; - CopyMemory(buffer, m_data.data(), toCopy); - *bufferLength = toCopy; + CopyMemory(buffer, m_data.data(), toCopy); + *bufferLength = toCopy; - m_offset += toCopy; - if (m_offset > m_data.size()) m_offset = m_data.size(); + m_offset += toCopy; + if (m_offset > m_data.size()) m_offset = m_data.size(); + } +} + +void MediaStreamer::ReadChunk(uint8* buffer, uint32 from, uint32 length, uint32* bytesRead) +{ + Platform::Array^ data = ReadData(m_filename, from, length); + *bytesRead = data->Length; + + if (*bytesRead > 0) + { + CopyMemory(buffer, (byte*)data->Data, data->Length); + } } void MediaStreamer::Restart() diff --git a/cocos/audio/winrt/MediaStreamer.h b/cocos/audio/winrt/MediaStreamer.h index e72ac5974a..d2c46f613f 100644 --- a/cocos/audio/winrt/MediaStreamer.h +++ b/cocos/audio/winrt/MediaStreamer.h @@ -29,9 +29,12 @@ private: uint32 m_maxStreamLengthInBytes; std::vector m_data; UINT32 m_offset; - Platform::Array^ ReadData( - _In_ Platform::String^ filename - ); + UINT32 m_dataLen; + Platform::String^ m_filename; + + Platform::Array^ ReadData(_In_ Platform::String^ filename); + Platform::Array^ ReadData(_In_ Platform::String^ filename, uint32 from, uint32 length); + internal: Windows::Storage::StorageFolder^ m_location; Platform::String^ m_locationPath; @@ -49,10 +52,11 @@ internal: UINT32 GetMaxStreamLengthInBytes() { - return m_data.size(); + return m_dataLen; } - void Initialize(_In_ const WCHAR* url); - void ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferLength); + void Initialize(_In_ const WCHAR* url, bool lazy = false); + void ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferLength); + void ReadChunk(uint8* buffer, uint32 from, uint32 length, uint32* bytesRead); void Restart(); }; diff --git a/cocos/audio/winrt/SimpleAudioEngine.cpp b/cocos/audio/winrt/SimpleAudioEngine.cpp index 6a9b17354b..df69cf263c 100644 --- a/cocos/audio/winrt/SimpleAudioEngine.cpp +++ b/cocos/audio/winrt/SimpleAudioEngine.cpp @@ -18,10 +18,12 @@ #include "SimpleAudioEngine.h" #include "Audio.h" +#include "cocos2d.h" #include //#include "CCCommon.h" using namespace std; +USING_NS_CC; namespace CocosDenshion { @@ -81,7 +83,8 @@ void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) return; } - sharedAudioController()->PlayBackgroundMusic(pszFilePath, bLoop); + string fullPath = CCFileUtils::getInstance()->fullPathForFilename(pszFilePath); + sharedAudioController()->PlayBackgroundMusic(fullPath.c_str(), bLoop); } void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) @@ -121,8 +124,8 @@ bool SimpleAudioEngine::isBackgroundMusicPlaying() unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,float pitch, float pan, float gain) { unsigned int sound; - sharedAudioController()->PlaySoundEffect(pszFilePath, bLoop, sound); - // TODO: need to support playEffect parameters + string fullPath = CCFileUtils::getInstance()->fullPathForFilename(pszFilePath); + sharedAudioController()->PlaySoundEffect(fullPath.c_str(), bLoop, sound); // TODO: need to support playEffect parameters return sound; } @@ -133,7 +136,8 @@ void SimpleAudioEngine::stopEffect(unsigned int nSoundId) void SimpleAudioEngine::preloadEffect(const char* pszFilePath) { - sharedAudioController()->PreloadSoundEffect(pszFilePath); + string fullPath = CCFileUtils::getInstance()->fullPathForFilename(pszFilePath); + sharedAudioController()->PreloadSoundEffect(fullPath.c_str()); } void SimpleAudioEngine::pauseEffect(unsigned int nSoundId) @@ -168,7 +172,8 @@ void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) void SimpleAudioEngine::unloadEffect(const char* pszFilePath) { - sharedAudioController()->UnloadSoundEffect(pszFilePath); + string fullPath = CCFileUtils::getInstance()->fullPathForFilename(pszFilePath); + sharedAudioController()->UnloadSoundEffect(fullPath.c_str()); } ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index b72d301d4e..aa306ce6bc 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -354,10 +354,6 @@ bool Console::listenOnTCP(int port) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) WSADATA wsaData; n = WSAStartup(MAKEWORD(2, 2),&wsaData); - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) - CCLogIPAddresses(); -#endif #endif if ( (n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) { @@ -446,7 +442,10 @@ void Console::stop() { if( _running ) { _endThread = true; - _thread.join(); + if (_thread.joinable()) + { + _thread.join(); + } } } @@ -1056,6 +1055,17 @@ void Console::addClient() _maxfd = std::max(_maxfd,fd); sendPrompt(fd); + + /** + * A SIGPIPE is sent to a process if it tried to write to socket that had been shutdown for + * writing or isn't connected (anymore) on iOS. + * + * The default behaviour for this signal is to end the process.So we make the process ignore SIGPIPE. + */ +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + int set = 1; + setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); +#endif } } @@ -1155,14 +1165,16 @@ void Console::loop() /* Any message for the remote console ? send it! */ if( !_DebugStrings.empty() ) { - _DebugStringsMutex.lock(); - for(const auto &str : _DebugStrings) { - for(const auto &fd : _fds) { - send(fd, str.c_str(), str.length(),0); + if (_DebugStringsMutex.try_lock()) + { + for (const auto &str : _DebugStrings) { + for (auto fd : _fds) { + send(fd, str.c_str(), str.length(), 0); + } } + _DebugStrings.clear(); + _DebugStringsMutex.unlock(); } - _DebugStrings.clear(); - _DebugStringsMutex.unlock(); } } diff --git a/cocos/base/CCEventMouse.h b/cocos/base/CCEventMouse.h index 4f0980abda..8bfc72e463 100644 --- a/cocos/base/CCEventMouse.h +++ b/cocos/base/CCEventMouse.h @@ -81,12 +81,12 @@ public: * * @return The scroll data of x axis. */ - inline float getScrollX() { return _scrollX; }; + inline float getScrollX() const { return _scrollX; }; /** Get mouse scroll data of y axis. * * @return The scroll data of y axis. */ - inline float getScrollY() { return _scrollY; }; + inline float getScrollY() const { return _scrollY; }; /** Set the cursor position. * @@ -118,19 +118,19 @@ public: * @return The mouse button. * @js getButton */ - inline int getMouseButton() { return _mouseButton; }; + inline int getMouseButton() const { return _mouseButton; }; /** Get the cursor position of x axis. * * @return The x coordinate of cursor position. * @js getLocationX */ - inline float getCursorX() { return _x; }; + inline float getCursorX() const { return _x; }; /** Get the cursor position of y axis. * * @return The y coordinate of cursor position. * @js getLocationY */ - inline float getCursorY() { return _y; }; + inline float getCursorY() const { return _y; }; /** Returns the current touch location in OpenGL coordinates. * diff --git a/cocos/base/CCNinePatchImageParser.cpp b/cocos/base/CCNinePatchImageParser.cpp new file mode 100644 index 0000000000..a86bd23dc5 --- /dev/null +++ b/cocos/base/CCNinePatchImageParser.cpp @@ -0,0 +1,208 @@ +/**************************************************************************** + Copyright (c) 2013-2015 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +****************************************************************************/ +#include "CCNinePatchImageParser.h" +#include "platform/CCImage.h" +#include "base/CCDirector.h" + +NS_CC_BEGIN + +NinePatchImageParser::~NinePatchImageParser() +{ + +} + + +NinePatchImageParser::NinePatchImageParser(Image* image) +{ + this->_image = image; + this->_imageFrame = Rect(0,0,image->getWidth(), image->getHeight()); + CCASSERT(image->getRenderFormat()==Texture2D::PixelFormat::RGBA8888, + "unsupported format, currently only supports rgba8888"); + this->_isRotated = false; +} + +NinePatchImageParser::NinePatchImageParser(Image* image, const Rect& frame, bool rotated) +{ + this->_image = image; + CCASSERT(image->getRenderFormat()==Texture2D::PixelFormat::RGBA8888, + "unsupported format, currently only supports rgba8888"); + this->_imageFrame = frame; + this->_isRotated = rotated; +} + +int NinePatchImageParser::getFrameHeight()const +{ + if (_isRotated) + { + return _imageFrame.size.width; + } + return _imageFrame.size.height; +} + +int NinePatchImageParser::getFrameWidth()const +{ + if (_isRotated) + { + return _imageFrame.size.height; + } + return _imageFrame.size.width; +} + +int NinePatchImageParser::getPixelOriginOffset(Direction direction)const +{ + int imageWidth = _image->getWidth(); + int frameWidth = this->getFrameWidth(); + + int topLineLeftOffset = (int)_imageFrame.origin.y * imageWidth * 4 + (int)_imageFrame.origin.x * 4; + if(direction == Direction::HORIZONTAL) + { + return topLineLeftOffset; + } + else + { + if(_isRotated) + { + return topLineLeftOffset + (frameWidth - 1) * 4; + } + else + { + return topLineLeftOffset; + } + } +} + +Vec2 NinePatchImageParser::parseHorizontalMargin()const +{ + unsigned char* data = _image->getData(); + + data = data + this->getPixelOriginOffset(Direction::HORIZONTAL); + unsigned char lastPixel = *(data + 3); + int x1 = 0; + int x2 = 0; + + int length = _imageFrame.origin.x + this->getFrameWidth(); + for(int i = (int)_imageFrame.origin.x; i <= length ; i++) + { + unsigned char pixel = *(data + (i - (int)_imageFrame.origin.x) * 4 +3); + if(pixel != lastPixel) + { + if (pixel > 0) + { + x1 = (i - (int)_imageFrame.origin.x); + } + else + { + x2 = (i - (int)_imageFrame.origin.x); + break; + } + } + lastPixel = pixel; + } + return Vec2(x1,x2); +} + +Vec2 NinePatchImageParser::parseVerticalMargin()const +{ + unsigned char* data = _image->getData(); + int imageWidth = _image->getWidth(); + + int y1 = 0; + int y2 = 0; + + data = data + this->getPixelOriginOffset(Direction::VERTICAL); + unsigned char lastPixel = *(data + 3); + + int length = (int)(_imageFrame.origin.y + this->getFrameHeight()); + for(int i = _imageFrame.origin.y; i <= length; i++) + { + unsigned char pixel = *(data + (i - (int)_imageFrame.origin.y) * imageWidth * 4 + 3); + if(pixel != lastPixel) + { + if(pixel > 0) + { + y1 = (i - (int)_imageFrame.origin.y); + } + else + { + y2 = (i - (int)_imageFrame.origin.y); + break; + } + } + lastPixel = pixel; + } + return Vec2(y1,y2); +} + +Rect NinePatchImageParser::parseCapInset() const +{ + Rect capInsets; + Vec2 horizontalLine = this->parseHorizontalMargin(); + Vec2 verticalLine = this->parseVerticalMargin(); + + if(_isRotated) + { + capInsets = Rect(verticalLine.y, + _imageFrame.size.height - horizontalLine.y, + verticalLine.y - verticalLine.x, + horizontalLine.y - horizontalLine.x); + } + else + { + capInsets = Rect(horizontalLine.x, + verticalLine.x, + horizontalLine.y - horizontalLine.x, + verticalLine.y - verticalLine.x); + } + + capInsets = Rect(capInsets.origin.x / CC_CONTENT_SCALE_FACTOR(), + capInsets.origin.y / CC_CONTENT_SCALE_FACTOR(), + capInsets.size.width / CC_CONTENT_SCALE_FACTOR(), + capInsets.size.height / CC_CONTENT_SCALE_FACTOR()); + return capInsets; +} + +void NinePatchImageParser::setSpriteFrameInfo( const cocos2d::Rect& frameRect, bool rotated ) +{ + this->_imageFrame = frameRect; + this->_isRotated = rotated; +} + +bool NinePatchImageParser::isNinePatchImage(const std::string& filepath) +{ + size_t length = filepath.length(); + if(length <7 ) + { + return false; + } + if(filepath.compare(length-6, 6, ".9.png") == 0) + { + return true; + } + else + { + return false; + } +} + +NS_CC_END diff --git a/cocos/base/CCNinePatchImageParser.h b/cocos/base/CCNinePatchImageParser.h new file mode 100644 index 0000000000..ef357ea6e7 --- /dev/null +++ b/cocos/base/CCNinePatchImageParser.h @@ -0,0 +1,114 @@ +/**************************************************************************** + Copyright (c) 2013-2015 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +****************************************************************************/ +#include "platform/CCPlatformMacros.h" +#include "math/CCGeometry.h" + +NS_CC_BEGIN + +class Image; +class SpriteFrame; + + +/** + * A class for paring Android .9 patch image. + * For more about Android .9 patch image format, please refer to + * http://developer.android.com/tools/help/draw9patch.html + * + * The class could parse a single .9 patch image and produce the capInsets + * as well as a sprite atlas and store all the capInsets infos in a Texture2D. + * Note: + * - Currently only PixelFormat::RGBA8888 is supported. + * - TexturePacker Trim mode is not supported at the moment. + */ + +class CC_DLL NinePatchImageParser +{ +public: + /** + * Determines whether a filename contains ".9.png" suffix. + * @param filename A 9-patch image name. + * + * @return If the filename contains ".9.png", then return true, otherwise false. + */ + static bool isNinePatchImage(const std::string& filename); + + /** + * Instantiate a NinePatchImageParser with a Image object. + * + * @param image A Image object pointer. + * + * @return A NinePatchImageParser instance. + */ + NinePatchImageParser(Image* image); + + /** + * Instantiate a NinePatchImageParser with a Image object and the spriteFrame info. + * The spriteFrame contains the frame rect in the image atlas and whether it + * is rotated or not. + * + * @param image A Image object pointer. + * @param frameRect The sprite frame rect in the image atlas. + * @param ratated Whether is sprite frame is rotated in the image atlas. + * + * @return + */ + NinePatchImageParser(Image* image, const Rect& frameRect, bool ratated); + + /** + * Change the sprite frame info. + * It is useful when parsing multiple sprite frame with only on NinePatchImageParser. + * + * @param frameRect The sprite frame rect in the image atlas. + * @param rotated Whether is sprite frame is rotated in the image atlas. + */ + void setSpriteFrameInfo(const Rect& frameRect, bool rotated); + + /** + * Default destructor. + */ + virtual ~NinePatchImageParser(); + + /** + * Parsing the image data and extract the capInsets info. + * @return The capInsets Rect. + */ + Rect parseCapInset()const; +private: + enum class Direction + { + HORIZONTAL, + VERTICAL + }; + int getPixelOriginOffset(Direction direction)const; + Vec2 parseHorizontalMargin()const; + Vec2 parseVerticalMargin()const; + int getFrameWidth()const; + int getFrameHeight()const; + + Image* _image; + Rect _imageFrame; + bool _isRotated; +}; + +NS_CC_END diff --git a/cocos/base/CCProperties.cpp b/cocos/base/CCProperties.cpp index 46c4710660..407c460500 100644 --- a/cocos/base/CCProperties.cpp +++ b/cocos/base/CCProperties.cpp @@ -85,7 +85,7 @@ Properties::Properties(Data* data, ssize_t* dataIdx, const std::string& name, co rewind(); } -Properties* Properties::createWithoutAutorelease(const std::string& url) +Properties* Properties::createNonRefCounted(const std::string& url) { if (url.size() == 0) { @@ -419,24 +419,25 @@ signed char Properties::readChar() char* Properties::readLine(char* output, int num) { - int idx=0; - if (eof()) return nullptr; // little optimization: avoid uneeded dereferences - ssize_t dataIdx = *_dataIdx; + const ssize_t dataIdx = *_dataIdx; + int i; - while (dataIdx<_data->_size && _data->_bytes[dataIdx]!='\n' && idx-1_size; i++) { - dataIdx++; idx++; + auto c = _data->_bytes[dataIdx+i]; + if (c == '\n') + break; + output[i] = c; } - memcpy(output, &_data->_bytes[*_dataIdx], idx); - output[idx] = '\0'; + output[i] = '\0'; // restore value - *_dataIdx = dataIdx; + *_dataIdx = dataIdx+i; return output; } diff --git a/cocos/base/CCProperties.h b/cocos/base/CCProperties.h index 70cd2e48fb..5a60896477 100644 --- a/cocos/base/CCProperties.h +++ b/cocos/base/CCProperties.h @@ -105,7 +105,7 @@ class Data; @verbatim // Create the top-level Properties object. - Properties* properties = Properties::createWithoutAutorelease("example.properties"); + Properties* properties = Properties::createNonRefCounted("example.properties"); // Retrieve the "spriteTexture" namespace. Properties* spriteTexture = properties->getNamespace("spriteTexture"); @@ -187,7 +187,7 @@ public: * @return The created Properties or NULL if there was an error. * @script{create} */ - static Properties* createWithoutAutorelease(const std::string& url); + static Properties* createNonRefCounted(const std::string& url); /** * Destructor. @@ -579,7 +579,7 @@ private: bool seekFromCurrent(int offset); bool eof(); - // Called after createWithoutAutorelease(); copies info from parents into derived namespaces. + // Called after createNonRefCounted(); copies info from parents into derived namespaces. void resolveInheritance(const char* id = NULL); // Called by resolveInheritance(). diff --git a/cocos/base/CCUserDefault-winrt.cpp b/cocos/base/CCUserDefault-winrt.cpp new file mode 100644 index 0000000000..4279c67ecb --- /dev/null +++ b/cocos/base/CCUserDefault-winrt.cpp @@ -0,0 +1,334 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +#include "base/CCUserDefault.h" +#include "platform/CCCommon.h" +#include "base/base64.h" +#include "base/ccUtils.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#include "CCWinRTUtils.h" + +using namespace Windows::Storage; +using namespace Windows::Foundation; +using namespace std; + +#define XML_FILE_NAME "UserDefault.xml" + +NS_CC_BEGIN + + +/** + * WinRT implementation of UserDefault + */ + +UserDefault* UserDefault::_userDefault = nullptr; +string UserDefault::_filePath = string(""); +bool UserDefault::_isFilePathInitialized = false; + +UserDefault::~UserDefault() +{ +} + +UserDefault::UserDefault() +{ +} + +Platform::Object^ getPlatformKeyValue(const char* pKey) +{ + // check key + if (!pKey) + { + return nullptr; + } + + ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings; + auto key = PlatformStringFromString(pKey); + auto values = localSettings->Values; + + if (values->HasKey(key)) + { + return values->Lookup(key); + } + + return nullptr; +} + +void setPlatformKeyValue(const char* pKey, PropertyValue^ value) +{ + // check key + if (!pKey) + { + return; + } + + ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings; + auto values = localSettings->Values; + values->Insert(PlatformStringFromString(pKey), value); +} + +bool UserDefault::getBoolForKey(const char* pKey) +{ + return getBoolForKey(pKey, false); +} + +bool UserDefault::getBoolForKey(const char* pKey, bool defaultValue) +{ + bool ret = defaultValue; + auto value = getPlatformKeyValue(pKey); + if (value) + { + ret = safe_cast(value); + } + return ret; +} + +int UserDefault::getIntegerForKey(const char* pKey) +{ + return getIntegerForKey(pKey, 0); +} + +int UserDefault::getIntegerForKey(const char* pKey, int defaultValue) +{ + int ret = defaultValue; + auto value = getPlatformKeyValue(pKey); + if (value) + { + ret = safe_cast(value); + } + return ret; +} + +float UserDefault::getFloatForKey(const char* pKey) +{ + return getFloatForKey(pKey, 0.0f); +} + +float UserDefault::getFloatForKey(const char* pKey, float defaultValue) +{ + float ret = (float)getDoubleForKey(pKey, (double)defaultValue); + + return ret; +} + +double UserDefault::getDoubleForKey(const char* pKey) +{ + return getDoubleForKey(pKey, 0.0); +} + +double UserDefault::getDoubleForKey(const char* pKey, double defaultValue) +{ + double ret = defaultValue; + auto value = getPlatformKeyValue(pKey); + if (value) + { + ret = safe_cast(value); + } + return ret; +} + +std::string UserDefault::getStringForKey(const char* pKey) +{ + return getStringForKey(pKey, ""); +} + +string UserDefault::getStringForKey(const char* pKey, const std::string & defaultValue) +{ + string ret = defaultValue; + auto value = getPlatformKeyValue(pKey); + if (value) + { + auto result = safe_cast(value); + ret = PlatformStringToString(result); + } + + return ret; +} + +Data UserDefault::getDataForKey(const char* pKey) +{ + return getDataForKey(pKey, Data::Null); +} + +Data UserDefault::getDataForKey(const char* pKey, const Data& defaultValue) +{ + Data ret = defaultValue; + std::string encodedData = getStringForKey(pKey,""); + + if (!encodedData.empty()) + { + unsigned char* decodedData = nullptr; + int decodedDataLen = base64Decode((unsigned char*) encodedData.c_str(), (unsigned int) encodedData.length(), &decodedData); + if (decodedData && decodedDataLen > 0) + { + ret.fastSet(decodedData, decodedDataLen); + } + } + + return ret; +} + +void UserDefault::setBoolForKey(const char* pKey, bool value) +{ + // check key + if (!pKey) + { + return; + } + + setPlatformKeyValue(pKey, dynamic_cast(PropertyValue::CreateBoolean(value))); +} + +void UserDefault::setIntegerForKey(const char* pKey, int value) +{ + // check key + if (! pKey) + { + return; + } + + setPlatformKeyValue(pKey, dynamic_cast(PropertyValue::CreateInt32(value))); +} + +void UserDefault::setFloatForKey(const char* pKey, float value) +{ + setDoubleForKey(pKey, value); +} + +void UserDefault::setDoubleForKey(const char* pKey, double value) +{ + // check key + if (! pKey) + { + return; + } + + setPlatformKeyValue(pKey, dynamic_cast(PropertyValue::CreateDouble(value))); +} + +void UserDefault::setStringForKey(const char* pKey, const std::string & value) +{ + // check key + if (! pKey) + { + return; + } + + setPlatformKeyValue(pKey, dynamic_cast(PropertyValue::CreateString(PlatformStringFromString(value)))); +} + +void UserDefault::setDataForKey(const char* pKey, const Data& value) { + // check key + if (! pKey) + { + return; + } + + char *encodedData = 0; + base64Encode(value.getBytes(), static_cast(value.getSize()), &encodedData); + + setPlatformKeyValue(pKey, dynamic_cast(PropertyValue::CreateString(PlatformStringFromString(encodedData)))); + + if (encodedData) + free(encodedData); +} + +UserDefault* UserDefault::getInstance() +{ + if (!_userDefault) + { + initXMLFilePath(); + + // only create xml file one time + // the file exists after the program exit + if ((!isXMLFileExist()) && (!createXMLFile())) + { + return nullptr; + } + + _userDefault = new (std::nothrow) UserDefault(); + } + + return _userDefault; +} + +void UserDefault::destroyInstance() +{ + CC_SAFE_DELETE(_userDefault); +} + +void UserDefault::setDelegate(UserDefault *delegate) +{ + if (_userDefault) + delete _userDefault; + + _userDefault = delegate; +} + + +// FIXME:: deprecated +UserDefault* UserDefault::sharedUserDefault() +{ + return UserDefault::getInstance(); +} + +// FIXME:: deprecated +void UserDefault::purgeSharedUserDefault() +{ + return UserDefault::destroyInstance(); +} + +bool UserDefault::isXMLFileExist() +{ + //return FileUtils::getInstance()->isFileExist(_filePath); + return true; +} + +void UserDefault::initXMLFilePath() +{ + if (! _isFilePathInitialized) + { + _filePath += FileUtils::getInstance()->getWritablePath() + XML_FILE_NAME; + _isFilePathInitialized = true; + } +} + +// create new xml file +bool UserDefault::createXMLFile() +{ + return false; +} + +const string& UserDefault::getXMLFilePath() +{ + return _filePath; +} + +void UserDefault::flush() +{ +} + +NS_CC_END + +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/base/CCUserDefault.h b/cocos/base/CCUserDefault.h index 740fbb127f..5d080cbdb9 100644 --- a/cocos/base/CCUserDefault.h +++ b/cocos/base/CCUserDefault.h @@ -237,7 +237,7 @@ public: * @js NA */ static const std::string& getXMLFilePath(); - /** All supported platforms other iOS & Android use xml file to save values. This function checks whether the xml file exists or not. + /** All supported platforms other iOS & Android and CC_PLATFORM_WINRT use xml file to save values. This function checks whether the xml file exists or not. * @return True if the xml file exists, flase if not. * @js NA */ diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 9d6cee3a81..ec3884ddeb 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -15,6 +15,7 @@ set(COCOS_BASE_SRC base/CCController.cpp base/CCData.cpp base/CCDataVisitor.cpp + base/CCNinePatchImageParser.cpp base/CCDirector.cpp base/CCEvent.cpp base/CCEventAcceleration.cpp diff --git a/cocos/base/ccConfig.h b/cocos/base/ccConfig.h index aa494ba416..550b9ba7ac 100644 --- a/cocos/base/ccConfig.h +++ b/cocos/base/ccConfig.h @@ -254,7 +254,8 @@ THE SOFTWARE. /** Use 3d physics integration API. */ #ifndef CC_USE_3D_PHYSICS -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#define CC_USE_3D_PHYSICS 1 #define CC_USE_3D_PHYSICS 1 #endif #endif diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp index 45cf6f836f..f8f7628f7e 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp @@ -183,7 +183,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithContent(const std::s doc.Parse<0>(content.c_str()); if (doc.HasParseError()) { - CCLOG("GetParseError %s\n", doc.GetParseError()); + CCLOG("GetParseError %d\n", doc.GetParseError()); } const rapidjson::Value& json = DICTOOL->getSubDictionary_json(doc, ACTION); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index bee63a0aea..11b19c115d 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -376,7 +376,7 @@ Node* CSLoader::loadNodeWithContent(const std::string& content) doc.Parse<0>(content.c_str()); if (doc.HasParseError()) { - CCLOG("GetParseError %s\n", doc.GetParseError()); + CCLOG("GetParseError %d\n", doc.GetParseError()); } // cocos2dx version mono editor is based on @@ -724,7 +724,7 @@ Node* CSLoader::loadWidget(const rapidjson::Value& json) customJsonDict.Parse<0>(customProperty); if (customJsonDict.HasParseError()) { - CCLOG("GetParseError %s\n", customJsonDict.GetParseError()); + CCLOG("GetParseError %d\n", customJsonDict.GetParseError()); } widgetPropertiesReader->setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 041d2a2a74..dbeae98145 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -1247,7 +1247,7 @@ void DataReaderHelper::addDataFromJsonCache(const std::string& fileContent, Data json.ParseStream<0>(stream); if (json.HasParseError()) { - CCLOG("GetParseError %s\n",json.GetParseError()); + CCLOG("GetParseError %d\n",json.GetParseError()); } dataInfo->contentScale = DICTOOL->getFloatValue_json(json, CONTENT_SCALE, 1.0f); diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index e3ee2c5b19..5cda9f553d 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -212,7 +212,7 @@ Widget* GUIReader::widgetFromJsonFile(const char *fileName) jsonDict.Parse<0>(contentStr.c_str()); if (jsonDict.HasParseError()) { - CCLOG("GetParseError %s\n",jsonDict.GetParseError()); + CCLOG("GetParseError %d\n",jsonDict.GetParseError()); } Widget* widget = nullptr; const char* fileVersion = DICTOOL->getStringValue_json(jsonDict, "version"); @@ -1373,7 +1373,7 @@ Widget* WidgetPropertiesReader0300::widgetFromBinary(CocoLoader* cocoLoader, st customJsonDict.Parse<0>(customProperty); if (customJsonDict.HasParseError()) { - CCLOG("GetParseError %s\n", customJsonDict.GetParseError()); + CCLOG("GetParseError %d\n", customJsonDict.GetParseError()); } setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); }else{ @@ -1474,7 +1474,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va customJsonDict.Parse<0>(customProperty); if (customJsonDict.HasParseError()) { - CCLOG("GetParseError %s\n", customJsonDict.GetParseError()); + CCLOG("GetParseError %d\n", customJsonDict.GetParseError()); } setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); }else{ diff --git a/cocos/editor-support/cocostudio/TriggerMng.cpp b/cocos/editor-support/cocostudio/TriggerMng.cpp index deeeabbec6..4fcd142ead 100755 --- a/cocos/editor-support/cocostudio/TriggerMng.cpp +++ b/cocos/editor-support/cocostudio/TriggerMng.cpp @@ -236,7 +236,7 @@ void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader { if (str2 != nullptr) { - action.AddMember("classname", str2, allocator); + action.AddMember("classname", rapidjson::Value(str2,allocator), allocator); } } else if (key2.compare("dataitems") == 0) @@ -257,7 +257,7 @@ void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader { if (str3 != nullptr) { - dataitem.AddMember("key", str3, allocator); + dataitem.AddMember("key", rapidjson::Value(str3,allocator), allocator); } } else @@ -265,7 +265,7 @@ void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader rapidjson::Type type = pDataItemArray[i5].GetType(pCocoLoader); if (type == rapidjson::kStringType) { - dataitem.AddMember("value", str3, allocator); + dataitem.AddMember("value", rapidjson::Value(str3,allocator), allocator); } else { @@ -312,7 +312,7 @@ void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader { if (str4 != nullptr) { - cond.AddMember("classname", str4, allocator); + cond.AddMember("classname", rapidjson::Value(str4,allocator), allocator); } } else if (key4.compare("dataitems") == 0) @@ -333,7 +333,7 @@ void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader { if (str5 != nullptr) { - dataitem.AddMember("key", str5, allocator); + dataitem.AddMember("key", rapidjson::Value(str5,allocator), allocator); } } else @@ -341,7 +341,7 @@ void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader rapidjson::Type type = pDataItemArray[i9].GetType(pCocoLoader); if (type == rapidjson::kStringType) { - dataitem.AddMember("value", str5, allocator); + dataitem.AddMember("value", rapidjson::Value(str5,allocator), allocator); } else { diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 957293280a..27ff13c4cf 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -154,12 +154,12 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(cocos2d::Node *node, fileExist = false; } - if (!fileExist) - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", filepath.c_str())->getCString()); - custom->addChild(label); - } + //if (!fileExist) + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", filepath.c_str())->getCString()); + // custom->addChild(label); + //} } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 69ac8528ef..b1938bf081 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -706,12 +706,12 @@ namespace cocostudio { button->loadTextureNormal(normalTexturePath, (Widget::TextureResType)normalType); } - else if (!normalTexturePath.empty()) - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", normalErrorFilePath.c_str())->getCString()); - button->addChild(label); - } + //else if (!normalTexturePath.empty()) + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", normalErrorFilePath.c_str())->getCString()); + // button->addChild(label); + //} bool pressedFileExist = false; std::string pressedErrorFilePath = ""; @@ -770,12 +770,12 @@ namespace cocostudio { button->loadTexturePressed(pressedTexturePath, (Widget::TextureResType)pressedType); } - else if (!pressedTexturePath.empty()) - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", pressedErrorFilePath.c_str())->getCString()); - button->addChild(label); - } + //else if (!pressedTexturePath.empty()) + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", pressedErrorFilePath.c_str())->getCString()); + // button->addChild(label); + //} bool disabledFileExist = false; std::string disabledErrorFilePath = ""; @@ -834,12 +834,12 @@ namespace cocostudio { button->loadTextureDisabled(disabledTexturePath, (Widget::TextureResType)disabledType); } - else if (!disabledTexturePath.empty()) - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", disabledErrorFilePath.c_str())->getCString()); - button->addChild(label); - } + //else if (!disabledTexturePath.empty()) + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", disabledErrorFilePath.c_str())->getCString()); + // button->addChild(label); + //} std::string titleText = options->text()->c_str(); button->setTitleText(titleText); @@ -873,12 +873,12 @@ namespace cocostudio { button->setTitleFontName(path); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - button->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // button->addChild(label); + //} } bool displaystate = options->displaystate() != 0; diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index 09148b143d..0bead625f0 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -491,12 +491,12 @@ namespace cocostudio { checkBox->loadTextureBackGround(backGroundTexturePath, (Widget::TextureResType)backGroundType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", backGroundErrorFilePath.c_str())->getCString()); - checkBox->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", backGroundErrorFilePath.c_str())->getCString()); + // checkBox->addChild(label); + //} //load background selected image bool backGroundSelectedfileExist = false; @@ -556,12 +556,12 @@ namespace cocostudio { checkBox->loadTextureBackGroundSelected(backGroundSelectedTexturePath, (Widget::TextureResType)backGroundSelectedType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", backGroundSelectedErrorFilePath.c_str())->getCString()); - checkBox->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", backGroundSelectedErrorFilePath.c_str())->getCString()); + // checkBox->addChild(label); + //} //load frontCross image bool frontCrossFileExist = false; @@ -621,12 +621,12 @@ namespace cocostudio { checkBox->loadTextureFrontCross(frontCrossFileName, (Widget::TextureResType)frontCrossType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", frontCrossErrorFilePath.c_str())->getCString()); - checkBox->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", frontCrossErrorFilePath.c_str())->getCString()); + // checkBox->addChild(label); + //} //load backGroundBoxDisabledData bool backGroundBoxDisabledFileExist = false; @@ -686,12 +686,12 @@ namespace cocostudio { checkBox->loadTextureBackGroundDisabled(backGroundDisabledFileName, (Widget::TextureResType)backGroundDisabledType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", backGroundBoxDisabledErrorFilePath.c_str())->getCString()); - checkBox->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", backGroundBoxDisabledErrorFilePath.c_str())->getCString()); + // checkBox->addChild(label); + //} ///load frontCrossDisabledData bool frontCrossDisabledFileExist = false; @@ -751,12 +751,12 @@ namespace cocostudio { checkBox->loadTextureFrontCrossDisabled(frontCrossDisabledFileName, (Widget::TextureResType)frontCrossDisabledType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", frontCrossDisabledErrorFilePath.c_str())->getCString()); - checkBox->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", frontCrossDisabledErrorFilePath.c_str())->getCString()); + // checkBox->addChild(label); + //} bool selectedstate = options->selectedState() != 0; checkBox->setSelected(selectedstate); diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp index 10d7e0d938..903bba1811 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp @@ -238,15 +238,15 @@ namespace cocostudio setPropsWithFlatBuffers(tmx, (Table*)gameMapOptions); } } - else - { - Node* node = Node::create(); - setPropsWithFlatBuffers(node, (Table*)gameMapOptions); - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - node->addChild(label); - return node; - } + //else + //{ + // Node* node = Node::create(); + // setPropsWithFlatBuffers(node, (Table*)gameMapOptions); + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // node->addChild(label); + // return node; + //} return tmx; } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index f72f9802ec..d387a54bd1 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -353,12 +353,12 @@ namespace cocostudio { imageView->loadTexture(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - imageView->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // imageView->addChild(label); + //} bool scale9Enabled = options->scale9Enabled() != 0; imageView->setScale9Enabled(scale9Enabled); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 25b1708182..2c97f8f8e7 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -190,12 +190,21 @@ namespace cocostudio /* adapt screen gui */ float w = 0, h = 0; - bool adaptScrenn = DICTOOL->getBooleanValue_json(options, P_AdaptScreen); - if (adaptScrenn) + bool adaptScrennExsit = DICTOOL->checkObjectExist_json(options, P_AdaptScreen); + if (adaptScrennExsit) { - Size screenSize = CCDirector::getInstance()->getWinSize(); - w = screenSize.width; - h = screenSize.height; + bool adaptScrenn = DICTOOL->getBooleanValue_json(options, P_AdaptScreen); + if (adaptScrenn) + { + Size screenSize = Director::getInstance()->getWinSize(); + w = screenSize.width; + h = screenSize.height; + } + else + { + w = DICTOOL->getFloatValue_json(options, P_Width); + h = DICTOOL->getFloatValue_json(options, P_Height); + } } else { @@ -300,7 +309,11 @@ namespace cocostudio panel->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch)); } - panel->setLayoutType((Layout::Type)DICTOOL->getIntValue_json(options, P_LayoutType)); + bool layoutTypeExsit = DICTOOL->checkObjectExist_json(options, P_LayoutType); + if (layoutTypeExsit) + { + panel->setLayoutType((Layout::Type)DICTOOL->getIntValue_json(options, P_LayoutType)); + } int bgimgcr = DICTOOL->getIntValue_json(options, P_ColorR,255); int bgimgcg = DICTOOL->getIntValue_json(options, P_ColorG,255); @@ -662,12 +675,12 @@ namespace cocostudio { panel->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - panel->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // panel->addChild(label); + //} } auto widgetOptions = options->widgetOptions(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp index 6856a4432d..08eb06a3a5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp @@ -490,12 +490,12 @@ namespace cocostudio { listView->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - listView->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // listView->addChild(label); + //} } auto widgetOptions = options->widgetOptions(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index accff552ec..4e570fa655 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -303,12 +303,12 @@ namespace cocostudio { loadingBar->loadTexture(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - loadingBar->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // loadingBar->addChild(label); + //} int direction = options->direction(); loadingBar->setDirection(LoadingBar::Direction(direction)); diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp index 0fde47f3be..376d69ef53 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -403,12 +403,12 @@ namespace cocostudio { pageView->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - pageView->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // pageView->addChild(label); + //} } auto widgetOptions = options->widgetOptions(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index beae5bc194..51f4f79e25 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -208,15 +208,15 @@ namespace cocostudio particle->setPositionType(ParticleSystem::PositionType::GROUPED); } } - else - { - Node* node = Node::create(); - setPropsWithFlatBuffers(node, (Table*)particleOptions); - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - node->addChild(label); - return node; - } + //else + //{ + // Node* node = Node::create(); + // setPropsWithFlatBuffers(node, (Table*)particleOptions); + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // node->addChild(label); + // return node; + //} return particle; } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index 12e8a839f3..14914cd199 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -489,12 +489,12 @@ namespace cocostudio { scrollView->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - scrollView->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // scrollView->addChild(label); + //} } auto widgetOptions = options->widgetOptions(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index 1a40f4825b..4ca33378ce 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -525,12 +525,12 @@ namespace cocostudio { slider->loadBarTexture(imageFileName, (Widget::TextureResType)imageFileNameType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", imageErrorFilePath.c_str())->getCString()); - slider->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", imageErrorFilePath.c_str())->getCString()); + // slider->addChild(label); + //} //loading normal slider ball texture bool normalFileExist = false; @@ -590,12 +590,12 @@ namespace cocostudio { slider->loadSlidBallTextureNormal(normalFileName, (Widget::TextureResType)normalType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", normalErrorFilePath.c_str())->getCString()); - slider->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", normalErrorFilePath.c_str())->getCString()); + // slider->addChild(label); + //} //loading slider ball press texture bool pressedFileExist = false; @@ -655,12 +655,12 @@ namespace cocostudio { slider->loadSlidBallTexturePressed(pressedFileName, (Widget::TextureResType)pressedType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", pressedErrorFilePath.c_str())->getCString()); - slider->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", pressedErrorFilePath.c_str())->getCString()); + // slider->addChild(label); + //} //loading silder ball disable texture bool disabledFileExist = false; @@ -720,12 +720,12 @@ namespace cocostudio { slider->loadSlidBallTextureDisabled(disabledFileName, (Widget::TextureResType)disabledType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", disabledErrorFilePath.c_str())->getCString()); - slider->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", disabledErrorFilePath.c_str())->getCString()); + // slider->addChild(label); + //} //load slider progress texture bool progressFileExist = false; @@ -785,12 +785,12 @@ namespace cocostudio { slider->loadProgressBarTexture(progressBarFileName, (Widget::TextureResType)progressBarType); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", progressErrorFilePath.c_str())->getCString()); - slider->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", progressErrorFilePath.c_str())->getCString()); + // slider->addChild(label); + //} bool displaystate = options->displaystate() != 0; slider->setBright(displaystate); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index de217b8bb3..830a6a0d9f 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -226,12 +226,12 @@ namespace cocostudio default: break; } - if (!fileExist) - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - sprite->addChild(label); - } + //if (!fileExist) + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // sprite->addChild(label); + //} auto f_blendFunc = options->blendFunc(); if (f_blendFunc) diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index 6180d8fdda..93777b50e2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp @@ -275,12 +275,12 @@ namespace cocostudio fileExist = false; } - if (!fileExist) - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - labelAtlas->addChild(label); - } + //if (!fileExist) + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // labelAtlas->addChild(label); + //} break; } diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index 8ab76248ab..d457f0a88c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -218,11 +218,11 @@ namespace cocostudio fileExist = false; } } - else - { - errorContent = "missed"; - fileExist = false; - } + //else + //{ + // errorContent = "missed"; + // fileExist = false; + //} break; } @@ -235,10 +235,13 @@ namespace cocostudio } else { - errorFilePath = path; - auto label = Label::create(); - label->setString(__String::createWithFormat("%s %s", errorFilePath.c_str(), errorContent.c_str())->getCString()); - labelBMFont->addChild(label); + if (!errorContent.empty()) + { + errorFilePath = path; + auto label = Label::create(); + label->setString(__String::createWithFormat("%s %s", errorFilePath.c_str(), errorContent.c_str())->getCString()); + labelBMFont->addChild(label); + } } std::string text = options->text()->c_str(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index 6b808ebf82..81f2434a58 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -332,12 +332,12 @@ namespace cocostudio { textField->setFontName(path); } - else - { - auto label = Label::create(); - label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - textField->addChild(label); - } + //else + //{ + // auto label = Label::create(); + // label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // textField->addChild(label); + //} } auto widgetReader = WidgetReader::getInstance(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index f9d216bbf8..d53bfa4442 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -440,12 +440,12 @@ namespace cocostudio { label->setFontName(path); } - else - { - auto alert = Label::create(); - alert->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); - label->addChild(alert); - } + //else + //{ + // auto alert = Label::create(); + // alert->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString()); + // label->addChild(alert); + //} } bool outlineEnabled = options->outlineEnabled(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index 9b528021e4..612f417fec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -160,12 +160,22 @@ namespace cocostudio /* adapt screen */ float w = 0, h = 0; - bool adaptScrenn = DICTOOL->getBooleanValue_json(options, P_AdaptScreen); - if (adaptScrenn) + bool adaptScrennExsit = DICTOOL->checkObjectExist_json(options, P_AdaptScreen); + if (adaptScrennExsit) { - Size screenSize = CCDirector::getInstance()->getWinSize(); - w = screenSize.width; - h = screenSize.height; + bool adaptScrenn = DICTOOL->getBooleanValue_json(options, P_AdaptScreen); + if (adaptScrenn) + { + Size screenSize = Director::getInstance()->getWinSize(); + w = screenSize.width; + h = screenSize.height; + } + else + { + w = DICTOOL->getFloatValue_json(options, P_Width); + h = DICTOOL->getFloatValue_json(options, P_Height); + } + } else { diff --git a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Windows/libSpine.Windows.vcxproj b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Windows/libSpine.Windows.vcxproj index 933727d8ac..dce8fd1174 100644 --- a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Windows/libSpine.Windows.vcxproj +++ b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.Windows/libSpine.Windows.vcxproj @@ -128,6 +128,7 @@ false WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -145,6 +146,7 @@ false WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -162,6 +164,7 @@ false WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -179,6 +182,7 @@ false WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -196,6 +200,7 @@ false WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -213,6 +218,7 @@ false WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console diff --git a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.WindowsPhone/libSpine.WindowsPhone.vcxproj b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.WindowsPhone/libSpine.WindowsPhone.vcxproj index c5052f8f5c..f9a8f45178 100644 --- a/cocos/editor-support/spine/proj.win8.1-universal/libSpine.WindowsPhone/libSpine.WindowsPhone.vcxproj +++ b/cocos/editor-support/spine/proj.win8.1-universal/libSpine.WindowsPhone/libSpine.WindowsPhone.vcxproj @@ -93,6 +93,7 @@ false WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -110,6 +111,7 @@ false WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -127,6 +129,7 @@ false WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console @@ -144,6 +147,7 @@ false WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories) + 4996;%(DisableSpecificWarnings) Console diff --git a/cocos/network/HttpClient-android.cpp b/cocos/network/HttpClient-android.cpp index 421c2b35a9..0eeec87b5a 100644 --- a/cocos/network/HttpClient-android.cpp +++ b/cocos/network/HttpClient-android.cpp @@ -26,17 +26,12 @@ #include "HttpClient.h" -#include #include #include -#include #include #include -#include "base/CCVector.h" #include "base/CCDirector.h" -#include "base/CCScheduler.h" - #include "platform/CCFileUtils.h" #include "platform/android/jni/JniHelper.h" @@ -49,24 +44,7 @@ typedef HttpRequestHeaders::iterator HttpRequestHeadersIter; typedef std::vector HttpCookies; typedef HttpCookies::iterator HttpCookiesIter; -static std::mutex s_requestQueueMutex; -static std::mutex s_responseQueueMutex; -static std::mutex s_cookieFileMutex; - -static std::condition_variable_any s_sleepCondition; - -static Vector* s_requestQueue = nullptr; -static Vector* s_responseQueue = nullptr; - -static HttpClient *s_httpClient = nullptr; // pointer to singleton - -static std::string s_responseMessage = ""; - -static std::string s_cookieFilename = ""; - -static std::string s_sslCaFilename = ""; - -static HttpRequest *s_requestSentinel = new HttpRequest; +static HttpClient* _httpClient = nullptr; // pointer to singleton struct CookiesInfo @@ -98,16 +76,16 @@ size_t writeHeaderData(void* buffer, size_t sizes,HttpResponse* response) return sizes; } -static void processResponse(HttpResponse* response, std::string& responseMessage); - class HttpURLConnection { public: - HttpURLConnection():_httpURLConnection(nullptr), - _requestmethod(""), - _responseCookies(""), - _cookieFileName(""), - _contentLength(0) + HttpURLConnection(HttpClient* httpClient) + :_httpURLConnection(nullptr) + ,_client(httpClient) + ,_requestmethod("") + ,_responseCookies("") + ,_cookieFileName("") + ,_contentLength(0) { } @@ -120,7 +98,7 @@ public: void setRequestMethod(const char* method) { _requestmethod = method; - + JniMethodInfo methodInfo; if (JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxHttpURLConnection", @@ -139,7 +117,9 @@ public: { createHttpURLConnection(request->getUrl()); if(!configure()) + { return false; + } /* get custom header data (if set) */ HttpRequestHeaders headers=request->getHeaders(); if(!headers.empty()) @@ -259,15 +239,15 @@ public: size_t saveResponseCookies(const char* responseCookies, size_t count) { if (nullptr == responseCookies || strlen(responseCookies) == 0 || count == 0) + { return 0; + } if (_cookieFileName.empty()) { _cookieFileName = FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"; } - std::lock_guard lock(s_cookieFileMutex); - FILE* fp = fopen(_cookieFileName.c_str(), "w"); if (nullptr == fp) { @@ -307,7 +287,9 @@ public: char* getResponseContent(HttpResponse* response) { if (nullptr == response) + { return nullptr; + } char* content = nullptr; JniMethodInfo methodInfo; @@ -447,14 +429,14 @@ private: void addCookiesForRequestHeader() { - if(s_cookieFilename.empty()) + if(_client->getCookieFilename().empty()) + { return; + } - _cookieFileName = FileUtils::getInstance()->fullPathForFilename(s_cookieFilename.c_str()); + _cookieFileName = FileUtils::getInstance()->fullPathForFilename(_client->getCookieFilename()); - std::lock_guard lock(s_cookieFileMutex); - - std::string cookiesInfo = FileUtils::getInstance()->getStringFromFile(_cookieFileName.c_str()); + std::string cookiesInfo = FileUtils::getInstance()->getStringFromFile(_cookieFileName); if (cookiesInfo.empty()) return; @@ -550,10 +532,10 @@ private: void setVerifySSL() { - if(s_sslCaFilename.empty()) + if(_client->getSSLVerification().empty()) return; - std::string fullpath = FileUtils::getInstance()->fullPathForFilename(s_sslCaFilename.c_str()); + std::string fullpath = FileUtils::getInstance()->fullPathForFilename(_client->getSSLVerification()); JniMethodInfo methodInfo; if (JniHelper::getStaticMethodInfo(methodInfo, @@ -572,13 +554,16 @@ private: bool configure() { if(nullptr == _httpURLConnection) + { return false; + } - HttpClient* instnace = HttpClient::getInstance(); - if(nullptr == instnace) + if(nullptr == _client) + { return false; + } - setReadAndConnectTimeout(instnace->getTimeoutForRead() * 1000, instnace->getTimeoutForConnect() * 1000); + setReadAndConnectTimeout(_client->getTimeoutForRead() * 1000, _client->getTimeoutForConnect() * 1000); setVerifySSL(); @@ -587,7 +572,7 @@ private: char* getBufferFromJString(jstring jstr, JNIEnv* env) { - if (nullptr == jstr) + if (nullptr == jstr) { return nullptr; } @@ -595,7 +580,7 @@ private: const char* str = nullptr; char* ret = nullptr; str = env->GetStringUTFChars(jstr, nullptr); - if (nullptr != str) + if (nullptr != str) { ret = strdup(str); } @@ -605,9 +590,9 @@ private: return ret; } - int getCStrFromJByteArray(jbyteArray jba, JNIEnv* env, char** ppData) + int getCStrFromJByteArray(jbyteArray jba, JNIEnv* env, char** ppData) { - if (nullptr == jba) + if (nullptr == jba) { *ppData = nullptr; return 0; @@ -628,6 +613,7 @@ private: return _responseCookies; } private: + HttpClient* _client; jobject _httpURLConnection; std::string _requestmethod; std::string _responseCookies; @@ -637,13 +623,13 @@ private: }; // Process Response -static void processResponse(HttpResponse* response, std::string& responseMessage) +void HttpClient::processResponse(HttpResponse* response, char* responseMessage) { auto request = response->getHttpRequest(); HttpRequest::Type requestType = request->getRequestType(); - if (HttpRequest::Type::GET != requestType && - HttpRequest::Type::POST != requestType && + if (HttpRequest::Type::GET != requestType && + HttpRequest::Type::POST != requestType && HttpRequest::Type::PUT != requestType && HttpRequest::Type::DELETE != requestType) { @@ -654,7 +640,7 @@ static void processResponse(HttpResponse* response, std::string& responseMessage long responseCode = -1; int retValue = 0; - HttpURLConnection urlConnection; + HttpURLConnection urlConnection(this); if(!urlConnection.init(request)) { response->setSucceed(false); @@ -718,24 +704,24 @@ static void processResponse(HttpResponse* response, std::string& responseMessage //content len int contentLength = urlConnection.getResponseHeaderByKeyInt("Content-Length"); char* contentInfo = urlConnection.getResponseContent(response); - if (nullptr != contentInfo) { -// response->setResponseDataString(contentInfo, contentLength); + if (nullptr != contentInfo) + { std::vector * recvBuffer = (std::vector*)response->getResponseData(); recvBuffer->clear(); recvBuffer->insert(recvBuffer->begin(), (char*)contentInfo, ((char*)contentInfo) + urlConnection.getContentLength()); } free(contentInfo); - responseMessage = urlConnection.getResponseMessage(); + strcpy(responseMessage, urlConnection.getResponseMessage()); urlConnection.disconnect(); // write data to HttpResponse response->setResponseCode(responseCode); - if (responseCode == -1) + if (responseCode == -1) { response->setSucceed(false); - response->setErrorBuffer(responseMessage.c_str()); + response->setErrorBuffer(responseMessage); } else { @@ -746,174 +732,209 @@ static void processResponse(HttpResponse* response, std::string& responseMessage // Worker thread void HttpClient::networkThread() { - auto scheduler = Director::getInstance()->getScheduler(); - + increaseThreadCount(); + while (true) { HttpRequest *request; // step 1: send http request if the requestQueue isn't empty { - std::lock_guard lock(s_requestQueueMutex); - while (s_requestQueue->empty()) { - s_sleepCondition.wait(s_requestQueueMutex); + std::lock_guard lock(_requestQueueMutex); + while (_requestQueue.empty()) { + _sleepCondition.wait(_requestQueueMutex); } - request = s_requestQueue->at(0); - s_requestQueue->erase(0); + request = _requestQueue.at(0); + _requestQueue.erase(0); } - if (request == s_requestSentinel) { + if (request == _requestSentinel) { break; } // Create a HttpResponse object, the default setting is http access failed HttpResponse *response = new (std::nothrow) HttpResponse(request); - processResponse(response, s_responseMessage); + processResponse(response, _responseMessage); // add response packet into queue - s_responseQueueMutex.lock(); - s_responseQueue->pushBack(response); - s_responseQueueMutex.unlock(); + _responseQueueMutex.lock(); + _responseQueue.pushBack(response); + _responseQueueMutex.unlock(); - if (nullptr != s_httpClient) { - scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); + _schedulerMutex.lock(); + if (nullptr != _scheduler) + { + _scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); } + _schedulerMutex.unlock(); } // cleanup: if worker thread received quit signal, clean up un-completed request queue - s_requestQueueMutex.lock(); - s_requestQueue->clear(); - s_requestQueueMutex.unlock(); - - - if (s_requestQueue != nullptr) { - delete s_requestQueue; - s_requestQueue = nullptr; - delete s_responseQueue; - s_responseQueue = nullptr; - } + _requestQueueMutex.lock(); + _requestQueue.clear(); + _requestQueueMutex.unlock(); + _responseQueueMutex.lock(); + _responseQueue.clear(); + _responseQueueMutex.unlock(); + + decreaseThreadCountAndMayDeleteThis(); } // Worker thread void HttpClient::networkThreadAlone(HttpRequest* request, HttpResponse* response) { - std::string responseMessage = ""; + increaseThreadCount(); + + char responseMessage[RESPONSE_BUFFER_SIZE] = { 0 }; processResponse(response, responseMessage); - auto scheduler = Director::getInstance()->getScheduler(); - scheduler->performFunctionInCocosThread([response, request]{ - const ccHttpRequestCallback& callback = request->getCallback(); - Ref* pTarget = request->getTarget(); - SEL_HttpResponse pSelector = request->getSelector(); + _schedulerMutex.lock(); + if (_scheduler != nullptr) + { + _scheduler->performFunctionInCocosThread([this, response, request]{ + const ccHttpRequestCallback& callback = request->getCallback(); + Ref* pTarget = request->getTarget(); + SEL_HttpResponse pSelector = request->getSelector(); - if (callback != nullptr) - { - callback(s_httpClient, response); - } - else if (pTarget && pSelector) - { - (pTarget->*pSelector)(s_httpClient, response); - } - response->release(); - // do not release in other thread - request->release(); - }); + if (callback != nullptr) + { + callback(this, response); + } + else if (pTarget && pSelector) + { + (pTarget->*pSelector)(this, response); + } + response->release(); + // do not release in other thread + request->release(); + }); + } + _schedulerMutex.unlock(); + decreaseThreadCountAndMayDeleteThis(); } // HttpClient implementation HttpClient* HttpClient::getInstance() { - if (s_httpClient == nullptr) { - s_httpClient = new (std::nothrow) HttpClient(); + if (_httpClient == nullptr) + { + _httpClient = new (std::nothrow) HttpClient(); } - return s_httpClient; + return _httpClient; } void HttpClient::destroyInstance() { - CC_SAFE_DELETE(s_httpClient); + if (_httpClient == nullptr) + { + CCLOG("HttpClient singleton is nullptr"); + return; + } + + CCLOG("HttpClient::destroyInstance ..."); + + auto thiz = _httpClient; + _httpClient = nullptr; + + thiz->_scheduler->unscheduleAllForTarget(thiz); + + thiz->_schedulerMutex.lock(); + thiz->_scheduler = nullptr; + thiz->_schedulerMutex.unlock(); + + { + std::lock_guard lock(thiz->_requestQueueMutex); + thiz->_requestQueue.pushBack(thiz->_requestSentinel); + } + thiz->_sleepCondition.notify_one(); + + thiz->decreaseThreadCountAndMayDeleteThis(); + CCLOG("HttpClient::destroyInstance() finished!"); } -void HttpClient::enableCookies(const char* cookieFile) { - if (cookieFile) { - s_cookieFilename = std::string(cookieFile); +void HttpClient::enableCookies(const char* cookieFile) +{ + std::lock_guard lock(_cookieFileMutex); + if (cookieFile) + { + _cookieFilename = std::string(cookieFile); } - else { - s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); + else + { + _cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); } } void HttpClient::setSSLVerification(const std::string& caFile) { - s_sslCaFilename = caFile; + std::lock_guard lock(_sslCaFileMutex); + _sslCaFilename = caFile; } HttpClient::HttpClient() : _timeoutForConnect(30) , _timeoutForRead(60) +, _isInited(false) +, _threadCount(0) +, _requestSentinel(new HttpRequest()) +, _cookie(nullptr) { + CCLOG("In the constructor of HttpClient!"); + increaseThreadCount(); + _scheduler = Director::getInstance()->getScheduler(); } HttpClient::~HttpClient() { - if (s_requestQueue != nullptr) { - { - std::lock_guard lock(s_requestQueueMutex); - s_requestQueue->pushBack(s_requestSentinel); - } - s_sleepCondition.notify_one(); - } - - s_httpClient = nullptr; + CCLOG("In the destructor of HttpClient!"); + CC_SAFE_DELETE(_requestSentinel); } //Lazy create semaphore & mutex & thread bool HttpClient::lazyInitThreadSemphore() { - if (s_requestQueue != nullptr) { + if (_isInited) + { return true; - } else { - - s_requestQueue = new (std::nothrow) Vector(); - s_responseQueue = new (std::nothrow) Vector(); - + } + else + { auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this)); t.detach(); + _isInited = true; } - + return true; } //Add a get task to queue void HttpClient::send(HttpRequest* request) { - if (false == lazyInitThreadSemphore()) + if (!lazyInitThreadSemphore()) { return; } - if (!request) + if (nullptr == request) { return; } request->retain(); - if (nullptr != s_requestQueue) { - s_requestQueueMutex.lock(); - s_requestQueue->pushBack(request); - s_requestQueueMutex.unlock(); - - // Notify thread start to work - s_sleepCondition.notify_one(); - } + _requestQueueMutex.lock(); + _requestQueue.pushBack(request); + _requestQueueMutex.unlock(); + + // Notify thread start to work + _sleepCondition.notify_one(); } void HttpClient::sendImmediate(HttpRequest* request) { - if(!request) + if(nullptr == request) { return; } @@ -931,20 +952,17 @@ void HttpClient::dispatchResponseCallbacks() { // log("CCHttpClient::dispatchResponseCallbacks is running"); //occurs when cocos thread fires but the network thread has already quited - if (nullptr == s_responseQueue) { - return; - } HttpResponse* response = nullptr; - s_responseQueueMutex.lock(); + _responseQueueMutex.lock(); - if (!s_responseQueue->empty()) + if (!_responseQueue.empty()) { - response = s_responseQueue->at(0); - s_responseQueue->erase(0); + response = _responseQueue.at(0); + _responseQueue.erase(0); } - - s_responseQueueMutex.unlock(); + + _responseQueueMutex.unlock(); if (response) { @@ -968,6 +986,66 @@ void HttpClient::dispatchResponseCallbacks() } } +void HttpClient::increaseThreadCount() +{ + _threadCountMutex.lock(); + ++_threadCount; + _threadCountMutex.unlock(); +} + +void HttpClient::decreaseThreadCountAndMayDeleteThis() +{ + bool needDeleteThis = false; + _threadCountMutex.lock(); + --_threadCount; + if (0 == _threadCount) + { + needDeleteThis = true; + } + + _threadCountMutex.unlock(); + if (needDeleteThis) + { + delete this; + } +} + +void HttpClient::setTimeoutForConnect(int value) +{ + std::lock_guard lock(_timeoutForConnectMutex); + _timeoutForConnect = value; +} + +int HttpClient::getTimeoutForConnect() +{ + std::lock_guard lock(_timeoutForConnectMutex); + return _timeoutForConnect; +} + +void HttpClient::setTimeoutForRead(int value) +{ + std::lock_guard lock(_timeoutForReadMutex); + _timeoutForRead = value; +} + +int HttpClient::getTimeoutForRead() +{ + std::lock_guard lock(_timeoutForReadMutex); + return _timeoutForRead; +} + +const std::string& HttpClient::getCookieFilename() +{ + std::lock_guard lock(_cookieFileMutex); + return _cookieFilename; +} + +const std::string& HttpClient::getSSLVerification() +{ + std::lock_guard lock(_sslCaFileMutex); + return _sslCaFilename; +} + } NS_CC_END diff --git a/cocos/network/HttpClient-apple.mm b/cocos/network/HttpClient-apple.mm index 34c9f64d0e..0e144acb5c 100644 --- a/cocos/network/HttpClient-apple.mm +++ b/cocos/network/HttpClient-apple.mm @@ -26,56 +26,26 @@ #include "HttpClient.h" -#include #include -#include - #include -#import "HttpAsynConnection.h" -#include "HttpCookie.h" - -#include "base/CCVector.h" +#import "network/HttpAsynConnection.h" +#include "network/HttpCookie.h" #include "base/CCDirector.h" -#include "base/CCScheduler.h" - #include "platform/CCFileUtils.h" NS_CC_BEGIN namespace network { - -static std::mutex s_requestQueueMutex; -static std::mutex s_responseQueueMutex; - -static std::condition_variable_any s_SleepCondition; - -static Vector* s_requestQueue = nullptr; -static Vector* s_responseQueue = nullptr; - -static HttpClient *s_HttpClient = nullptr; // pointer to singleton -static HttpCookie *s_cookie = nullptr; - -static const int ERROR_SIZE = 256; +static HttpClient *_httpClient = nullptr; // pointer to singleton -static char s_errorBuffer[ERROR_SIZE] = {0}; - -static std::string s_cookieFilename = ""; - -static std::string s_sslCaFilename = ""; - - -static int processTask(HttpRequest *request, NSString *requestType, void *stream, long *errorCode, void *headerStream, char *errorBuffer); - -static void processResponse(HttpResponse* response, char* errorBuffer); - -static HttpRequest *s_requestSentinel = new HttpRequest; +static int processTask(HttpClient* client, HttpRequest *request, NSString *requestType, void *stream, long *errorCode, void *headerStream, char *errorBuffer); // Worker thread void HttpClient::networkThread() -{ - auto scheduler = Director::getInstance()->getScheduler(); +{ + increaseThreadCount(); while (true) @autoreleasepool { @@ -83,77 +53,90 @@ void HttpClient::networkThread() // step 1: send http request if the requestQueue isn't empty { - std::lock_guard lock(s_requestQueueMutex); - while (s_requestQueue->empty()) { - s_SleepCondition.wait(s_requestQueueMutex); + std::lock_guard lock(_requestQueueMutex); + while (_requestQueue.empty()) { + _sleepCondition.wait(_requestQueueMutex); } - request = s_requestQueue->at(0); - s_requestQueue->erase(0); + request = _requestQueue.at(0); + _requestQueue.erase(0); } - if (request == s_requestSentinel) { + if (request == _requestSentinel) { break; } // Create a HttpResponse object, the default setting is http access failed HttpResponse *response = new (std::nothrow) HttpResponse(request); - processResponse(response, s_errorBuffer); + processResponse(response, _responseMessage); // add response packet into queue - s_responseQueueMutex.lock(); - s_responseQueue->pushBack(response); - s_responseQueueMutex.unlock(); + _responseQueueMutex.lock(); + _responseQueue.pushBack(response); + _responseQueueMutex.unlock(); - if (nullptr != s_HttpClient) { - scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); + _schedulerMutex.lock(); + if (nullptr != _scheduler) + { + _scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); } + _schedulerMutex.unlock(); } // cleanup: if worker thread received quit signal, clean up un-completed request queue - s_requestQueueMutex.lock(); - s_requestQueue->clear(); - s_requestQueueMutex.unlock(); + _requestQueueMutex.lock(); + _requestQueue.clear(); + _requestQueueMutex.unlock(); + _responseQueueMutex.lock(); + _responseQueue.clear(); + _responseQueueMutex.unlock(); - if (s_requestQueue != nullptr) { - delete s_requestQueue; - s_requestQueue = nullptr; - delete s_responseQueue; - s_responseQueue = nullptr; - } - + decreaseThreadCountAndMayDeleteThis(); } // Worker thread void HttpClient::networkThreadAlone(HttpRequest* request, HttpResponse* response) { - char errorBuffer[ERROR_SIZE] = { 0 }; - processResponse(response, errorBuffer); - - auto scheduler = Director::getInstance()->getScheduler(); - scheduler->performFunctionInCocosThread([response, request]{ - const ccHttpRequestCallback& callback = request->getCallback(); - Ref* pTarget = request->getTarget(); - SEL_HttpResponse pSelector = request->getSelector(); - - if (callback != nullptr) - { - callback(s_HttpClient, response); - } - else if (pTarget && pSelector) - { - (pTarget->*pSelector)(s_HttpClient, response); - } - response->release(); - // do not release in other thread - request->release(); - }); + increaseThreadCount(); + + char responseMessage[RESPONSE_BUFFER_SIZE] = { 0 }; + processResponse(response, responseMessage); + + _schedulerMutex.lock(); + if (nullptr != _scheduler) + { + _scheduler->performFunctionInCocosThread([this, response, request]{ + const ccHttpRequestCallback& callback = request->getCallback(); + Ref* pTarget = request->getTarget(); + SEL_HttpResponse pSelector = request->getSelector(); + + if (callback != nullptr) + { + callback(this, response); + } + else if (pTarget && pSelector) + { + (pTarget->*pSelector)(this, response); + } + response->release(); + // do not release in other thread + request->release(); + }); + } + _schedulerMutex.unlock(); + decreaseThreadCountAndMayDeleteThis(); } //Process Request -static int processTask(HttpRequest *request, NSString* requestType, void *stream, long *responseCode, void *headerStream, char *errorBuffer) +static int processTask(HttpClient* client, HttpRequest* request, NSString* requestType, void* stream, long* responseCode, void* headerStream, char* errorBuffer) { + if (nullptr == client) + { + strcpy(errorBuffer, "client object is invalid"); + return 0; + } + //create request with url NSString* urlstring = [NSString stringWithUTF8String:request->getUrl()]; NSURL *url = [NSURL URLWithString:urlstring]; @@ -199,9 +182,10 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream } //read cookie propertities from file and set cookie - if(!s_cookieFilename.empty()) + std::string cookieFilename = client->getCookieFilename(); + if(!cookieFilename.empty() && nullptr != client->getCookie()) { - const CookiesInfo* cookieInfo = s_cookie->getMatchCookie(request->getUrl()); + const CookiesInfo* cookieInfo = client->getCookie()->getMatchCookie(request->getUrl()); if(cookieInfo != nullptr) { NSString *domain = [NSString stringWithCString:cookieInfo->domain.c_str() encoding:[NSString defaultCStringEncoding]]; @@ -227,12 +211,13 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream httpAsynConn.srcURL = urlstring; httpAsynConn.sslFile = nil; - if(!s_sslCaFilename.empty()) + std::string sslCaFileName = client->getSSLVerification(); + if(!sslCaFileName.empty()) { - long len = s_sslCaFilename.length(); - long pos = s_sslCaFilename.rfind('.', len-1); + long len = sslCaFileName.length(); + long pos = sslCaFileName.rfind('.', len-1); - httpAsynConn.sslFile = [NSString stringWithUTF8String:s_sslCaFilename.substr(0, pos-1).c_str()]; + httpAsynConn.sslFile = [NSString stringWithUTF8String:sslCaFileName.substr(0, pos-1).c_str()]; } [httpAsynConn startRequest:nsrequest]; @@ -259,7 +244,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream *responseCode = httpAsynConn.responseCode; //add cookie to cookies vector - if(!s_cookieFilename.empty()) + if(!cookieFilename.empty()) { NSArray *cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:httpAsynConn.responseHeader forURL:url]; for (NSHTTPCookie *cookie in cookies) @@ -282,7 +267,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream cookieInfo.value = [value cStringUsingEncoding: NSUTF8StringEncoding]; cookieInfo.tailmatch = true; - s_cookie->updateOrAddCookie(&cookieInfo); + client->getCookie()->updateOrAddCookie(&cookieInfo); } } @@ -313,131 +298,112 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream return 1; } -// Process Response -static void processResponse(HttpResponse* response, char* errorBuffer) -{ - auto request = response->getHttpRequest(); - long responseCode = -1; - int retValue = 0; - NSString* requestType = nil; - - // Process the request -> get response packet - switch (request->getRequestType()) - { - case HttpRequest::Type::GET: // HTTP GET - requestType = @"GET"; - break; - - case HttpRequest::Type::POST: // HTTP POST - requestType = @"POST"; - break; - - case HttpRequest::Type::PUT: - requestType = @"PUT"; - break; - - case HttpRequest::Type::DELETE: - requestType = @"DELETE"; - break; - - default: - CCASSERT(true, "CCHttpClient: unknown request type, only GET and POSt are supported"); - break; - } - - retValue = processTask(request, - requestType, - response->getResponseData(), - &responseCode, - response->getResponseHeader(), - errorBuffer); - - // write data to HttpResponse - response->setResponseCode(responseCode); - - if (retValue != 0) - { - response->setSucceed(true); - } - else - { - response->setSucceed(false); - response->setErrorBuffer(errorBuffer); - } -} - // HttpClient implementation HttpClient* HttpClient::getInstance() { - if (s_HttpClient == nullptr) { - s_HttpClient = new (std::nothrow) HttpClient(); + if (_httpClient == nullptr) + { + _httpClient = new (std::nothrow) HttpClient(); } - return s_HttpClient; + return _httpClient; } void HttpClient::destroyInstance() { - CC_SAFE_DELETE(s_HttpClient); -} - -void HttpClient::enableCookies(const char* cookieFile) { - if (cookieFile) { - s_cookieFilename = std::string(cookieFile); - s_cookieFilename = FileUtils::getInstance()->fullPathForFilename(s_cookieFilename); - } - else { - s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); + if (nullptr == _httpClient) + { + CCLOG("HttpClient singleton is nullptr"); + return; } - s_cookie = new(std::nothrow)HttpCookie; - s_cookie->setCookieFileName(s_cookieFilename); - s_cookie->readFile(); + CCLOG("HttpClient::destroyInstance begin"); + + auto thiz = _httpClient; + _httpClient = nullptr; + + thiz->_scheduler->unscheduleAllForTarget(thiz); + thiz->_schedulerMutex.lock(); + thiz->_scheduler = nullptr; + thiz->_schedulerMutex.unlock(); + + thiz->_requestQueueMutex.lock(); + thiz->_requestQueue.pushBack(thiz->_requestSentinel); + thiz->_requestQueueMutex.unlock(); + + thiz->_sleepCondition.notify_one(); + thiz->decreaseThreadCountAndMayDeleteThis(); + + CCLOG("HttpClient::destroyInstance() finished!"); +} + +void HttpClient::enableCookies(const char* cookieFile) +{ + _cookieFileMutex.lock(); + if (cookieFile) + { + _cookieFilename = std::string(cookieFile); + _cookieFilename = FileUtils::getInstance()->fullPathForFilename(_cookieFilename); + } + else + { + _cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); + } + _cookieFileMutex.unlock(); + + if (nullptr == _cookie) + { + _cookie = new(std::nothrow)HttpCookie; + } + _cookie->setCookieFileName(_cookieFilename); + _cookie->readFile(); } void HttpClient::setSSLVerification(const std::string& caFile) { - s_sslCaFilename = caFile; + std::lock_guard lock(_sslCaFileMutex); + _sslCaFilename = caFile; } HttpClient::HttpClient() : _timeoutForConnect(30) , _timeoutForRead(60) +, _isInited(false) +, _threadCount(0) +, _requestSentinel(new HttpRequest()) +, _cookie(nullptr) { + + CCLOG("In the constructor of HttpClient!"); + memset(_responseMessage, 0, sizeof(char) * RESPONSE_BUFFER_SIZE); + _scheduler = Director::getInstance()->getScheduler(); + increaseThreadCount(); } + HttpClient::~HttpClient() { - if (s_requestQueue != nullptr) { - { - std::lock_guard lock(s_requestQueueMutex); - s_requestQueue->pushBack(s_requestSentinel); - } - s_SleepCondition.notify_one(); - } - - s_HttpClient = nullptr; - - if(!s_cookieFilename.empty()) + CC_SAFE_DELETE(_requestSentinel); + if (!_cookieFilename.empty() && nullptr != _cookie) { - s_cookie->writeFile(); - //delete s_cookie; + _cookie->writeFile(); + CC_SAFE_DELETE(_cookie); } - //s_cookie = nullptr; + CCLOG("HttpClient destructor"); } //Lazy create semaphore & mutex & thread bool HttpClient::lazyInitThreadSemphore() { - if (s_requestQueue != nullptr) { + if (_isInited) + { return true; - } else { - - s_requestQueue = new (std::nothrow) Vector(); - s_responseQueue = new (std::nothrow) Vector(); - + } + else + { auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this)); t.detach(); + _isInited = true; } return true; @@ -458,14 +424,12 @@ void HttpClient::send(HttpRequest* request) request->retain(); - if (nullptr != s_requestQueue) { - s_requestQueueMutex.lock(); - s_requestQueue->pushBack(request); - s_requestQueueMutex.unlock(); - - // Notify thread start to work - s_SleepCondition.notify_one(); - } + _requestQueueMutex.lock(); + _requestQueue.pushBack(request); + _requestQueueMutex.unlock(); + + // Notify thread start to work + _sleepCondition.notify_one(); } void HttpClient::sendImmediate(HttpRequest* request) @@ -488,20 +452,14 @@ void HttpClient::dispatchResponseCallbacks() { // log("CCHttpClient::dispatchResponseCallbacks is running"); //occurs when cocos thread fires but the network thread has already quited - if (nullptr == s_responseQueue) { - return; - } HttpResponse* response = nullptr; - - s_responseQueueMutex.lock(); - - if (!s_responseQueue->empty()) + _responseQueueMutex.lock(); + if (!_responseQueue.empty()) { - response = s_responseQueue->at(0); - s_responseQueue->erase(0); + response = _responseQueue.at(0); + _responseQueue.erase(0); } - - s_responseQueueMutex.unlock(); + _responseQueueMutex.unlock(); if (response) { @@ -524,7 +482,122 @@ void HttpClient::dispatchResponseCallbacks() request->release(); } } + +// Process Response +void HttpClient::processResponse(HttpResponse* response, char* responseMessage) +{ + auto request = response->getHttpRequest(); + long responseCode = -1; + int retValue = 0; + NSString* requestType = nil; + + // Process the request -> get response packet + switch (request->getRequestType()) + { + case HttpRequest::Type::GET: // HTTP GET + requestType = @"GET"; + break; + + case HttpRequest::Type::POST: // HTTP POST + requestType = @"POST"; + break; + + case HttpRequest::Type::PUT: + requestType = @"PUT"; + break; + + case HttpRequest::Type::DELETE: + requestType = @"DELETE"; + break; + + default: + CCASSERT(true, "CCHttpClient: unknown request type, only GET and POSt are supported"); + break; + } + + retValue = processTask(this, + request, + requestType, + response->getResponseData(), + &responseCode, + response->getResponseHeader(), + responseMessage); + + // write data to HttpResponse + response->setResponseCode(responseCode); + + if (retValue != 0) + { + response->setSucceed(true); + } + else + { + response->setSucceed(false); + response->setErrorBuffer(responseMessage); + } +} + +void HttpClient::increaseThreadCount() +{ + _threadCountMutex.lock(); + ++_threadCount; + _threadCountMutex.unlock(); +} + +void HttpClient::decreaseThreadCountAndMayDeleteThis() +{ + bool needDeleteThis = false; + _threadCountMutex.lock(); + --_threadCount; + if (0 == _threadCount) + { + needDeleteThis = true; + } + + _threadCountMutex.unlock(); + if (needDeleteThis) + { + delete this; + } +} + +void HttpClient::setTimeoutForConnect(int value) +{ + std::lock_guard lock(_timeoutForConnectMutex); + _timeoutForConnect = value; +} + +int HttpClient::getTimeoutForConnect() +{ + std::lock_guard lock(_timeoutForConnectMutex); + return _timeoutForConnect; +} + +void HttpClient::setTimeoutForRead(int value) +{ + std::lock_guard lock(_timeoutForReadMutex); + _timeoutForRead = value; +} + +int HttpClient::getTimeoutForRead() +{ + std::lock_guard lock(_timeoutForReadMutex); + return _timeoutForRead; +} + +const std::string& HttpClient::getCookieFilename() +{ + std::lock_guard lock(_cookieFileMutex); + return _cookieFilename; +} + +const std::string& HttpClient::getSSLVerification() +{ + std::lock_guard lock(_sslCaFileMutex); + return _sslCaFilename; +} + } NS_CC_END diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index c53e3742d0..53f13907ae 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -25,48 +25,24 @@ ****************************************************************************/ #include "HttpClient.h" - -#include #include -#include - #include - #include - -#include "base/CCVector.h" #include "base/CCDirector.h" -#include "base/CCScheduler.h" - #include "platform/CCFileUtils.h" NS_CC_BEGIN namespace network { -static std::mutex s_requestQueueMutex; -static std::mutex s_responseQueueMutex; - -static std::condition_variable_any s_SleepCondition; - - #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) typedef int int32_t; #endif -static Vector* s_requestQueue = nullptr; -static Vector* s_responseQueue = nullptr; - -static HttpClient *s_pHttpClient = nullptr; // pointer to singleton - -static char s_errorBuffer[CURL_ERROR_SIZE] = {0}; +static HttpClient* _httpClient = nullptr; // pointer to singleton typedef size_t (*write_callback)(void *ptr, size_t size, size_t nmemb, void *stream); -static std::string s_cookieFilename = ""; - -static std::string s_sslCaFilename = ""; - // Callback function used by libcurl for collect response data static size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream) { @@ -94,19 +70,16 @@ static size_t writeHeaderData(void *ptr, size_t size, size_t nmemb, void *stream } -static int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer); -static int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer); -static int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer); -static int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer); +static int processGetTask(HttpClient* client, HttpRequest* request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char* errorBuffer); +static int processPostTask(HttpClient* client, HttpRequest* request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char* errorBuffer); +static int processPutTask(HttpClient* client, HttpRequest* request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char* errorBuffer); +static int processDeleteTask(HttpClient* client, HttpRequest* request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char* errorBuffer); // int processDownloadTask(HttpRequest *task, write_callback callback, void *stream, int32_t *errorCode); -static void processResponse(HttpResponse* response, char* errorBuffer); - -static HttpRequest *s_requestSentinel = new HttpRequest; // Worker thread void HttpClient::networkThread() -{ - auto scheduler = Director::getInstance()->getScheduler(); +{ + increaseThreadCount(); while (true) { @@ -114,15 +87,16 @@ void HttpClient::networkThread() // step 1: send http request if the requestQueue isn't empty { - std::lock_guard lock(s_requestQueueMutex); - while (s_requestQueue->empty()) { - s_SleepCondition.wait(s_requestQueueMutex); + std::lock_guard lock(_requestQueueMutex); + while (_requestQueue.empty()) + { + _sleepCondition.wait(_requestQueueMutex); } - request = s_requestQueue->at(0); - s_requestQueue->erase(0); + request = _requestQueue.at(0); + _requestQueue.erase(0); } - if (request == s_requestSentinel) { + if (request == _requestSentinel) { break; } @@ -131,62 +105,70 @@ void HttpClient::networkThread() // Create a HttpResponse object, the default setting is http access failed HttpResponse *response = new (std::nothrow) HttpResponse(request); - processResponse(response, s_errorBuffer); + processResponse(response, _responseMessage); // add response packet into queue - s_responseQueueMutex.lock(); - s_responseQueue->pushBack(response); - s_responseQueueMutex.unlock(); + _responseQueueMutex.lock(); + _responseQueue.pushBack(response); + _responseQueueMutex.unlock(); - if (nullptr != s_pHttpClient) { - scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); - } + _schedulerMutex.lock(); + if (nullptr != _scheduler) + { + _scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); + } + _schedulerMutex.unlock(); } // cleanup: if worker thread received quit signal, clean up un-completed request queue - s_requestQueueMutex.lock(); - s_requestQueue->clear(); - s_requestQueueMutex.unlock(); - - - if (s_requestQueue != nullptr) { - delete s_requestQueue; - s_requestQueue = nullptr; - delete s_responseQueue; - s_responseQueue = nullptr; - } + _requestQueueMutex.lock(); + _requestQueue.clear(); + _requestQueueMutex.unlock(); + _responseQueueMutex.lock(); + _responseQueue.clear(); + _responseQueueMutex.unlock(); + + decreaseThreadCountAndMayDeleteThis(); } // Worker thread void HttpClient::networkThreadAlone(HttpRequest* request, HttpResponse* response) { - char errorBuffer[CURL_ERROR_SIZE] = { 0 }; - processResponse(response, errorBuffer); + increaseThreadCount(); - auto scheduler = Director::getInstance()->getScheduler(); - scheduler->performFunctionInCocosThread([response, request]{ - const ccHttpRequestCallback& callback = request->getCallback(); - Ref* pTarget = request->getTarget(); - SEL_HttpResponse pSelector = request->getSelector(); + char responseMessage[RESPONSE_BUFFER_SIZE] = { 0 }; + processResponse(response, responseMessage); + + _schedulerMutex.lock(); + if (nullptr != _scheduler) + { + _scheduler->performFunctionInCocosThread([this, response, request]{ + const ccHttpRequestCallback& callback = request->getCallback(); + Ref* pTarget = request->getTarget(); + SEL_HttpResponse pSelector = request->getSelector(); - if (callback != nullptr) - { - callback(s_pHttpClient, response); - } - else if (pTarget && pSelector) - { - (pTarget->*pSelector)(s_pHttpClient, response); - } - response->release(); - // do not release in other thread - request->release(); - }); + if (callback != nullptr) + { + callback(this, response); + } + else if (pTarget && pSelector) + { + (pTarget->*pSelector)(this, response); + } + response->release(); + // do not release in other thread + request->release(); + }); + } + _schedulerMutex.unlock(); + + decreaseThreadCountAndMayDeleteThis(); } //Configure curl's timeout property -static bool configureCURL(CURL *handle, char *errorBuffer) +static bool configureCURL(HttpClient* client, CURL* handle, char* errorBuffer) { if (!handle) { return false; @@ -205,13 +187,15 @@ static bool configureCURL(CURL *handle, char *errorBuffer) if (code != CURLE_OK) { return false; } - if (s_sslCaFilename.empty()) { + + std::string sslCaFilename = client->getSSLVerification(); + if (sslCaFilename.empty()) { curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L); } else { curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L); curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L); - curl_easy_setopt(handle, CURLOPT_CAINFO, s_sslCaFilename.c_str()); + curl_easy_setopt(handle, CURLOPT_CAINFO, sslCaFilename.c_str()); } // FIXED #3224: The subthread of CCHttpClient interrupts main thread if timeout comes. @@ -255,11 +239,11 @@ public: * @param callback Response write callback * @param stream Response write stream */ - bool init(HttpRequest *request, write_callback callback, void *stream, write_callback headerCallback, void *headerStream, char *errorBuffer) + bool init(HttpClient* client, HttpRequest* request, write_callback callback, void* stream, write_callback headerCallback, void* headerStream, char* errorBuffer) { if (!_curl) return false; - if (!configureCURL(_curl, errorBuffer)) + if (!configureCURL(client, _curl, errorBuffer)) return false; /* get custom header data (if set) */ @@ -273,11 +257,12 @@ public: if (!setOption(CURLOPT_HTTPHEADER, _headers)) return false; } - if (!s_cookieFilename.empty()) { - if (!setOption(CURLOPT_COOKIEFILE, s_cookieFilename.c_str())) { + std::string cookieFilename = client->getCookieFilename(); + if (!cookieFilename.empty()) { + if (!setOption(CURLOPT_COOKIEFILE, cookieFilename.c_str())) { return false; } - if (!setOption(CURLOPT_COOKIEJAR, s_cookieFilename.c_str())) { + if (!setOption(CURLOPT_COOKIEJAR, cookieFilename.c_str())) { return false; } } @@ -307,20 +292,20 @@ public: }; //Process Get Request -static int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer) +static int processGetTask(HttpClient* client, HttpRequest* request, write_callback callback, void* stream, long* responseCode, write_callback headerCallback, void* headerStream, char* errorBuffer) { CURLRaii curl; - bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer) + bool ok = curl.init(client, request, callback, stream, headerCallback, headerStream, errorBuffer) && curl.setOption(CURLOPT_FOLLOWLOCATION, true) && curl.perform(responseCode); return ok ? 0 : 1; } //Process POST Request -static int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer) +static int processPostTask(HttpClient* client, HttpRequest* request, write_callback callback, void* stream, long* responseCode, write_callback headerCallback, void* headerStream, char* errorBuffer) { CURLRaii curl; - bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer) + bool ok = curl.init(client, request, callback, stream, headerCallback, headerStream, errorBuffer) && curl.setOption(CURLOPT_POST, 1) && curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData()) && curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize()) @@ -329,10 +314,10 @@ static int processPostTask(HttpRequest *request, write_callback callback, void * } //Process PUT Request -static int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer) +static int processPutTask(HttpClient* client, HttpRequest* request, write_callback callback, void* stream, long* responseCode, write_callback headerCallback, void* headerStream, char* errorBuffer) { CURLRaii curl; - bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer) + bool ok = curl.init(client, request, callback, stream, headerCallback, headerStream, errorBuffer) && curl.setOption(CURLOPT_CUSTOMREQUEST, "PUT") && curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData()) && curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize()) @@ -341,146 +326,105 @@ static int processPutTask(HttpRequest *request, write_callback callback, void *s } //Process DELETE Request -static int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer) +static int processDeleteTask(HttpClient* client, HttpRequest* request, write_callback callback, void* stream, long* responseCode, write_callback headerCallback, void* headerStream, char* errorBuffer) { CURLRaii curl; - bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer) + bool ok = curl.init(client, request, callback, stream, headerCallback, headerStream, errorBuffer) && curl.setOption(CURLOPT_CUSTOMREQUEST, "DELETE") && curl.setOption(CURLOPT_FOLLOWLOCATION, true) && curl.perform(responseCode); return ok ? 0 : 1; } - -// Process Response -static void processResponse(HttpResponse* response, char* errorBuffer) -{ - auto request = response->getHttpRequest(); - long responseCode = -1; - int retValue = 0; - - // Process the request -> get response packet - switch (request->getRequestType()) - { - case HttpRequest::Type::GET: // HTTP GET - retValue = processGetTask(request, - writeData, - response->getResponseData(), - &responseCode, - writeHeaderData, - response->getResponseHeader(), - errorBuffer); - break; - - case HttpRequest::Type::POST: // HTTP POST - retValue = processPostTask(request, - writeData, - response->getResponseData(), - &responseCode, - writeHeaderData, - response->getResponseHeader(), - errorBuffer); - break; - - case HttpRequest::Type::PUT: - retValue = processPutTask(request, - writeData, - response->getResponseData(), - &responseCode, - writeHeaderData, - response->getResponseHeader(), - errorBuffer); - break; - - case HttpRequest::Type::DELETE: - retValue = processDeleteTask(request, - writeData, - response->getResponseData(), - &responseCode, - writeHeaderData, - response->getResponseHeader(), - errorBuffer); - break; - - default: - CCASSERT(true, "CCHttpClient: unknown request type, only GET and POSt are supported"); - break; - } - - // write data to HttpResponse - response->setResponseCode(responseCode); - - if (retValue != 0) - { - response->setSucceed(false); - response->setErrorBuffer(errorBuffer); - } - else - { - response->setSucceed(true); - } -} - // HttpClient implementation HttpClient* HttpClient::getInstance() { - if (s_pHttpClient == nullptr) { - s_pHttpClient = new (std::nothrow) HttpClient(); + if (_httpClient == nullptr) + { + _httpClient = new (std::nothrow) HttpClient(); } - return s_pHttpClient; + return _httpClient; } void HttpClient::destroyInstance() { - CC_SAFE_DELETE(s_pHttpClient); + if (nullptr == _httpClient) + { + CCLOG("HttpClient singleton is nullptr"); + return; + } + + CCLOG("HttpClient::destroyInstance begin"); + auto thiz = _httpClient; + _httpClient = nullptr; + + thiz->_scheduler->unscheduleAllForTarget(thiz); + thiz->_schedulerMutex.lock(); + thiz->_scheduler = nullptr; + thiz->_schedulerMutex.unlock(); + + thiz->_requestQueueMutex.lock(); + thiz->_requestQueue.pushBack(thiz->_requestSentinel); + thiz->_requestQueueMutex.unlock(); + + thiz->_sleepCondition.notify_one(); + thiz->decreaseThreadCountAndMayDeleteThis(); + + CCLOG("HttpClient::destroyInstance() finished!"); } -void HttpClient::enableCookies(const char* cookieFile) { - if (cookieFile) { - s_cookieFilename = std::string(cookieFile); +void HttpClient::enableCookies(const char* cookieFile) +{ + std::lock_guard lock(_cookieFileMutex); + if (cookieFile) + { + _cookieFilename = std::string(cookieFile); } - else { - s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); + else + { + _cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); } } void HttpClient::setSSLVerification(const std::string& caFile) { - s_sslCaFilename = caFile; + std::lock_guard lock(_sslCaFileMutex); + _sslCaFilename = caFile; } HttpClient::HttpClient() : _timeoutForConnect(30) , _timeoutForRead(60) +, _isInited(false) +, _threadCount(0) +, _requestSentinel(new HttpRequest()) +, _cookie(nullptr) { + CCLOG("In the constructor of HttpClient!"); + memset(_responseMessage, 0, RESPONSE_BUFFER_SIZE * sizeof(char)); + _scheduler = Director::getInstance()->getScheduler(); + increaseThreadCount(); } HttpClient::~HttpClient() { - if (s_requestQueue != nullptr) { - { - std::lock_guard lock(s_requestQueueMutex); - s_requestQueue->pushBack(s_requestSentinel); - } - s_SleepCondition.notify_one(); - } - - s_pHttpClient = nullptr; + CC_SAFE_DELETE(_requestSentinel); + CCLOG("HttpClient destructor"); } //Lazy create semaphore & mutex & thread bool HttpClient::lazyInitThreadSemphore() { - if (s_requestQueue != nullptr) { + if (_isInited) + { return true; - } else { - - s_requestQueue = new (std::nothrow) Vector(); - s_responseQueue = new (std::nothrow) Vector(); - + } + else + { auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this)); t.detach(); + _isInited = true; } return true; @@ -500,15 +444,13 @@ void HttpClient::send(HttpRequest* request) } request->retain(); - - if (nullptr != s_requestQueue) { - s_requestQueueMutex.lock(); - s_requestQueue->pushBack(request); - s_requestQueueMutex.unlock(); - - // Notify thread start to work - s_SleepCondition.notify_one(); - } + + _requestQueueMutex.lock(); + _requestQueue.pushBack(request); + _requestQueueMutex.unlock(); + + // Notify thread start to work + _sleepCondition.notify_one(); } void HttpClient::sendImmediate(HttpRequest* request) @@ -531,20 +473,15 @@ void HttpClient::dispatchResponseCallbacks() { // log("CCHttpClient::dispatchResponseCallbacks is running"); //occurs when cocos thread fires but the network thread has already quited - if (nullptr == s_responseQueue) { - return; - } HttpResponse* response = nullptr; - - s_responseQueueMutex.lock(); - if (!s_responseQueue->empty()) + _responseQueueMutex.lock(); + if (!_responseQueue.empty()) { - response = s_responseQueue->at(0); - s_responseQueue->erase(0); + response = _responseQueue.at(0); + _responseQueue.erase(0); } - - s_responseQueueMutex.unlock(); + _responseQueueMutex.unlock(); if (response) { @@ -568,6 +505,134 @@ void HttpClient::dispatchResponseCallbacks() } } +// Process Response +void HttpClient::processResponse(HttpResponse* response, char* responseMessage) +{ + auto request = response->getHttpRequest(); + long responseCode = -1; + int retValue = 0; + + // Process the request -> get response packet + switch (request->getRequestType()) + { + case HttpRequest::Type::GET: // HTTP GET + retValue = processGetTask(this, request, + writeData, + response->getResponseData(), + &responseCode, + writeHeaderData, + response->getResponseHeader(), + responseMessage); + break; + + case HttpRequest::Type::POST: // HTTP POST + retValue = processPostTask(this, request, + writeData, + response->getResponseData(), + &responseCode, + writeHeaderData, + response->getResponseHeader(), + responseMessage); + break; + + case HttpRequest::Type::PUT: + retValue = processPutTask(this, request, + writeData, + response->getResponseData(), + &responseCode, + writeHeaderData, + response->getResponseHeader(), + responseMessage); + break; + + case HttpRequest::Type::DELETE: + retValue = processDeleteTask(this, request, + writeData, + response->getResponseData(), + &responseCode, + writeHeaderData, + response->getResponseHeader(), + responseMessage); + break; + + default: + CCASSERT(true, "CCHttpClient: unknown request type, only GET and POSt are supported"); + break; + } + + // write data to HttpResponse + response->setResponseCode(responseCode); + if (retValue != 0) + { + response->setSucceed(false); + response->setErrorBuffer(responseMessage); + } + else + { + response->setSucceed(true); + } +} + +void HttpClient::increaseThreadCount() +{ + _threadCountMutex.lock(); + ++_threadCount; + _threadCountMutex.unlock(); +} + +void HttpClient::decreaseThreadCountAndMayDeleteThis() +{ + bool needDeleteThis = false; + _threadCountMutex.lock(); + --_threadCount; + if (0 == _threadCount) + { + needDeleteThis = true; + } + + _threadCountMutex.unlock(); + if (needDeleteThis) + { + delete this; + } +} + +void HttpClient::setTimeoutForConnect(int value) +{ + std::lock_guard lock(_timeoutForConnectMutex); + _timeoutForConnect = value; +} + +int HttpClient::getTimeoutForConnect() +{ + std::lock_guard lock(_timeoutForConnectMutex); + return _timeoutForConnect; +} + +void HttpClient::setTimeoutForRead(int value) +{ + std::lock_guard lock(_timeoutForReadMutex); + _timeoutForRead = value; +} + +int HttpClient::getTimeoutForRead() +{ + std::lock_guard lock(_timeoutForReadMutex); + return _timeoutForRead; +} + +const std::string& HttpClient::getCookieFilename() +{ + std::lock_guard lock(_cookieFileMutex); + return _cookieFilename; +} + +const std::string& HttpClient::getSSLVerification() +{ + std::lock_guard lock(_sslCaFileMutex); + return _sslCaFilename; +} + } NS_CC_END diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index 9cc2119a6c..4424594b1a 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -27,8 +27,13 @@ #ifndef __CCHTTPCLIENT_H__ #define __CCHTTPCLIENT_H__ +#include +#include +#include "base/CCVector.h" +#include "base/CCScheduler.h" #include "network/HttpRequest.h" #include "network/HttpResponse.h" +#include "network/HttpCookie.h" /** * @addtogroup core @@ -38,6 +43,8 @@ NS_CC_BEGIN namespace network { + + /** Singleton that handles asynchrounous http requests. * @@ -48,6 +55,11 @@ namespace network { class CC_DLL HttpClient { public: + /** + * The buffer size of _responseMessage + */ + static const int RESPONSE_BUFFER_SIZE = 256; + /** * Get instance of HttpClient. * @@ -67,12 +79,26 @@ public: */ void enableCookies(const char* cookieFile); + /** + * Get the cookie filename + * + * @return the cookie filename + */ + const std::string& getCookieFilename(); + /** * Set root certificate path for SSL verification. * * @param caFile a full path of root certificate.if it is empty, SSL verification is disabled. */ void setSSLVerification(const std::string& caFile); + + /** + * Get ths ssl CA filename + * + * @return the ssl CA filename + */ + const std::string& getSSLVerification(); /** * Add a get request to task queue @@ -89,38 +115,40 @@ public: please make sure request->_requestData is clear before calling "sendImmediate" here. */ void sendImmediate(HttpRequest* request); - /** * Set the timeout value for connecting. * * @param value the timeout value for connecting. */ - inline void setTimeoutForConnect(int value) {_timeoutForConnect = value;}; + void setTimeoutForConnect(int value); /** * Get the timeout value for connecting. * * @return int the timeout value for connecting. */ - inline int getTimeoutForConnect() {return _timeoutForConnect;} - + int getTimeoutForConnect(); /** * Set the timeout value for reading. * * @param value the timeout value for reading. */ - inline void setTimeoutForRead(int value) {_timeoutForRead = value;}; - + void setTimeoutForRead(int value); /** * Get the timeout value for reading. * * @return int the timeout value for reading. */ - inline int getTimeoutForRead() {return _timeoutForRead;}; - + int getTimeoutForRead(); + + HttpCookie* getCookie() const {return _cookie; } + + std::mutex& getCookieFileMutex() {return _cookieFileMutex;} + + std::mutex& getSSLCaFileMutex() {return _sslCaFileMutex;} private: HttpClient(); virtual ~HttpClient(); @@ -136,9 +164,44 @@ private: /** Poll function called from main thread to dispatch callbacks when http requests finished **/ void dispatchResponseCallbacks(); + void processResponse(HttpResponse* response, char* responseMessage); + void increaseThreadCount(); + void decreaseThreadCountAndMayDeleteThis(); + private: + bool _isInited; + int _timeoutForConnect; + std::mutex _timeoutForConnectMutex; + int _timeoutForRead; + std::mutex _timeoutForReadMutex; + + int _threadCount; + std::mutex _threadCountMutex; + + Scheduler* _scheduler; + std::mutex _schedulerMutex; + + Vector _requestQueue; + std::mutex _requestQueueMutex; + + Vector _responseQueue; + std::mutex _responseQueueMutex; + + std::string _cookieFilename; + std::mutex _cookieFileMutex; + + std::string _sslCaFilename; + std::mutex _sslCaFileMutex; + + HttpCookie* _cookie; + + std::condition_variable_any _sleepCondition; + + char _responseMessage[RESPONSE_BUFFER_SIZE]; + + HttpRequest* _requestSentinel; }; } @@ -148,4 +211,4 @@ NS_CC_END // end group /// @} -#endif //__CCHTTPREQUEST_H__ +#endif //__CCHTTPCLIENT_H__ diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index e1599b8082..b5b502decd 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -941,23 +941,6 @@ std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& dir return ret; } -std::string FileUtils::searchFullPathForFilename(const std::string& filename) const -{ - if (isAbsolutePath(filename)) - { - return filename; - } - std::string path = fullPathForFilename(filename); - if (0 == path.compare(filename)) - { - return ""; - } - else - { - return path; - } -} - bool FileUtils::isFileExist(const std::string& filename) const { if (isAbsolutePath(filename)) @@ -966,7 +949,7 @@ bool FileUtils::isFileExist(const std::string& filename) const } else { - std::string fullpath = searchFullPathForFilename(filename); + std::string fullpath = fullPathForFilename(filename); if (fullpath.empty()) return false; else @@ -1327,7 +1310,7 @@ long FileUtils::getFileSize(const std::string &filepath) std::string fullpath = filepath; if (!isAbsolutePath(filepath)) { - fullpath = searchFullPathForFilename(filepath); + fullpath = fullPathForFilename(filepath); if (fullpath.empty()) return 0; } diff --git a/cocos/platform/CCFileUtils.h b/cocos/platform/CCFileUtils.h index 01505475f4..4646f1299a 100644 --- a/cocos/platform/CCFileUtils.h +++ b/cocos/platform/CCFileUtils.h @@ -478,16 +478,6 @@ protected: */ virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const; - /** - * Returns the fullpath for a given filename. - * This is an alternative for fullPathForFilename - * It returns empty string instead of the original filename when no file found for the given name. - * @param filename The file name to look up for - * @return The full path for the file, if not found, the return value will be an empty string - */ - virtual std::string searchFullPathForFilename(const std::string& filename) const; - - /** Dictionary used to lookup filenames based on a key. * It is used internally by the following methods: * diff --git a/cocos/platform/android/libcocos2dx-with-controller/.gitignore b/cocos/platform/android/libcocos2dx-with-controller/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/cocos/platform/android/libcocos2dx-with-controller/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/cocos/platform/android/libcocos2dx-with-controller/AndroidManifest.xml b/cocos/platform/android/libcocos2dx-with-controller/AndroidManifest.xml new file mode 100644 index 0000000000..bd550c5547 --- /dev/null +++ b/cocos/platform/android/libcocos2dx-with-controller/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cocos/platform/android/libcocos2dx-with-controller/build.gradle b/cocos/platform/android/libcocos2dx-with-controller/build.gradle new file mode 100644 index 0000000000..414f01b9e0 --- /dev/null +++ b/cocos/platform/android/libcocos2dx-with-controller/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDirs = ['../java/src','../ControllerManualAdapter/src'] + manifest.srcFile "AndroidManifest.xml" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: '../ControllerManualAdapter/libs', include: ['*.jar']) +} diff --git a/cocos/platform/android/libcocos2dx-with-controller/proguard-rules.pro b/cocos/platform/android/libcocos2dx-with-controller/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/cocos/platform/android/libcocos2dx-with-controller/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/cocos/platform/android/libcocos2dx/.gitignore b/cocos/platform/android/libcocos2dx/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/cocos/platform/android/libcocos2dx/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/cocos/platform/android/libcocos2dx/AndroidManifest.xml b/cocos/platform/android/libcocos2dx/AndroidManifest.xml new file mode 100644 index 0000000000..46f24443b4 --- /dev/null +++ b/cocos/platform/android/libcocos2dx/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cocos/platform/android/libcocos2dx/build.gradle b/cocos/platform/android/libcocos2dx/build.gradle new file mode 100644 index 0000000000..c1ba45da12 --- /dev/null +++ b/cocos/platform/android/libcocos2dx/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "../java/src" + manifest.srcFile "AndroidManifest.xml" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) +} diff --git a/cocos/platform/android/libcocos2dx/proguard-rules.pro b/cocos/platform/android/libcocos2dx/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/cocos/platform/android/libcocos2dx/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/cocos/platform/win32/CCPlatformDefine-win32.h b/cocos/platform/win32/CCPlatformDefine-win32.h index fe0559b5f7..0d6b52da36 100644 --- a/cocos/platform/win32/CCPlatformDefine-win32.h +++ b/cocos/platform/win32/CCPlatformDefine-win32.h @@ -60,6 +60,20 @@ THE SOFTWARE. #endif #endif +#if _MSC_VER > 1800 +#pragma comment(lib,"libpng-2015.lib") +#pragma comment(lib,"libjpeg-2015.lib") +#pragma comment(lib,"libtiff-2015.lib") +#pragma comment(lib,"glfw3-2015.lib") +#pragma comment(lib,"libchipmunk-2015.lib") +#else +#pragma comment(lib,"libpng.lib") +#pragma comment(lib,"libjpeg.lib") +#pragma comment(lib,"libtiff.lib") +#pragma comment(lib,"glfw3.lib") +#pragma comment(lib,"libchipmunk.lib") +#endif + #endif //s CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp index 1ceea45d1c..897d999f86 100644 --- a/cocos/platform/winrt/CCFileUtilsWinRT.cpp +++ b/cocos/platform/winrt/CCFileUtilsWinRT.cpp @@ -134,7 +134,10 @@ bool CCFileUtilsWinRT::isAbsolutePath(const std::string& strPath) const static Data getData(const std::string& filename, bool forString) { - CCASSERT(!filename.empty(), "Invalid filename!"); + if (filename.empty()) + { + CCASSERT(!filename.empty(), "Invalid filename!"); + } Data ret; unsigned char* buffer = nullptr; diff --git a/cocos/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp index 0e4c113f11..b7c1867bf4 100644 --- a/cocos/platform/winrt/CCWinRTUtils.cpp +++ b/cocos/platform/winrt/CCWinRTUtils.cpp @@ -104,6 +104,7 @@ Platform::String^ PlatformStringFromString(const std::string& s) return ref new Platform::String(ws.data(), ws.length()); } +#if 0 // Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels. float ConvertDipsToPixels(float dips) { @@ -115,7 +116,7 @@ float getScaledDPIValue(float v) { auto dipFactor = DisplayProperties::LogicalDpi / 96.0f; return v * dipFactor; } - +#endif void CC_DLL CCLogIPAddresses() { diff --git a/cocos/renderer/CCMaterial.cpp b/cocos/renderer/CCMaterial.cpp index d81d915dab..490e7e7727 100644 --- a/cocos/renderer/CCMaterial.cpp +++ b/cocos/renderer/CCMaterial.cpp @@ -110,7 +110,7 @@ bool Material::initWithFile(const std::string& validfilename) bytes[data.getSize()-1]='\0'; // Warning: properties is not a "Ref" object, must be manually deleted - Properties* properties = Properties::createWithoutAutorelease(validfilename); + Properties* properties = Properties::createNonRefCounted(validfilename); // get the first material parseProperties((strlen(properties->getNamespace()) > 0) ? properties : properties->getNextNamespace()); diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index d4698d1b48..3f1e8faa87 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -49,23 +49,16 @@ NS_CC_BEGIN MeshCommand::MeshCommand() : _textureID(0) , _glProgramState(nullptr) -, _blendType(BlendFunc::DISABLE) , _displayColor(1.0f, 1.0f, 1.0f, 1.0f) , _matrixPalette(nullptr) , _matrixPaletteSize(0) , _materialID(0) , _vao(0) -, _cullFaceEnabled(false) -, _cullFace(GL_BACK) -, _depthTestEnabled(false) -, _depthWriteEnabled(false) -, _forceDepthWrite(false) -, _renderStateCullFaceEnabled(false) -, _renderStateDepthTest(false) -, _renderStateDepthWrite(GL_FALSE) , _material(nullptr) +, _stateBlock(nullptr) { _type = RenderCommand::Type::MESH_COMMAND; + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) // listen the event that renderer was recreated on Android/WP8 _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, CC_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); @@ -100,40 +93,30 @@ void MeshCommand::init(float globalZOrder, _is3D = true; } -void MeshCommand::init(float globalOrder, - GLuint textureID, - GLProgramState* glProgramState, - BlendFunc blendType, - GLuint vertexBuffer, - GLuint indexBuffer, - GLenum primitive, - GLenum indexFormat, - ssize_t indexCount, - const Mat4 &mv) -{ - init(globalOrder, textureID, glProgramState, blendType, vertexBuffer, indexBuffer, primitive, indexFormat, indexCount, mv, 0); -} - void MeshCommand::init(float globalZOrder, GLuint textureID, - cocos2d::GLProgramState *glProgramState, - cocos2d::BlendFunc blendType, + GLProgramState* glProgramState, + RenderState::StateBlock* stateBlock, GLuint vertexBuffer, GLuint indexBuffer, GLenum primitive, GLenum indexFormat, ssize_t indexCount, - const cocos2d::Mat4 &mv, + const cocos2d::Mat4& mv, uint32_t flags) { CCASSERT(glProgramState, "GLProgramState cannot be nill"); - + CCASSERT(stateBlock, "StateBlock cannot be nill"); + CCASSERT(!_material, "cannot init with GLProgramState if previously inited without GLProgramState"); + RenderCommand::init(globalZOrder, mv, flags); _globalOrder = globalZOrder; _textureID = textureID; - _blendType = blendType; + + // weak ref _glProgramState = glProgramState; + _stateBlock = stateBlock; _vertexBuffer = vertexBuffer; _indexBuffer = indexBuffer; @@ -143,36 +126,9 @@ void MeshCommand::init(float globalZOrder, _mv.set(mv); _is3D = true; + } -void MeshCommand::setCullFaceEnabled(bool enable) -{ - CCASSERT(!_material, "If using material, you should call material->setCullFace()"); - - _cullFaceEnabled = enable; -} - -void MeshCommand::setCullFace(GLenum cullFace) -{ - CCASSERT(!_material, "If using material, you should call material->setCullFaceSide()"); - - _cullFace = cullFace; -} - -void MeshCommand::setDepthTestEnabled(bool enable) -{ - CCASSERT(!_material, "If using material, you should call material->setDepthTest()"); - - _depthTestEnabled = enable; -} - -void MeshCommand::setDepthWriteEnabled(bool enable) -{ - CCASSERT(!_material, "If using material, you should call material->setDepthWrite()"); - - _forceDepthWrite = enable; - _depthWriteEnabled = enable; -} void MeshCommand::setDisplayColor(const Vec4& color) { @@ -195,24 +151,6 @@ void MeshCommand::setMatrixPaletteSize(int size) _matrixPaletteSize = size; } -void MeshCommand::setTransparent(bool value) -{ - CCASSERT(!_material, "If using material, you shouldn't call setTransparent."); - - _isTransparent = value; - //Skip batching for transparent mesh - _skipBatching = value; - - if (_isTransparent && !_forceDepthWrite) - { - _depthWriteEnabled = false; - } - else - { - _depthWriteEnabled = true; - } -} - MeshCommand::~MeshCommand() { releaseVAO(); @@ -224,67 +162,12 @@ MeshCommand::~MeshCommand() void MeshCommand::applyRenderState() { CCASSERT(!_material, "Must not be called when using materials"); + CCASSERT(_stateBlock, "StateBlock must be non null"); // blend and texture GL::bindTexture2D(_textureID); - GL::blendFunc(_blendType.src, _blendType.dst); - // cull face - _renderStateCullFaceEnabled = glIsEnabled(GL_CULL_FACE) != GL_FALSE; - GLint cullface; - glGetIntegerv(GL_CULL_FACE_MODE, &cullface); - _renderStateCullFace = (GLenum)cullface; - - if (_cullFaceEnabled != _renderStateCullFaceEnabled) - { - _cullFaceEnabled ? glEnable(GL_CULL_FACE) : glDisable(GL_CULL_FACE); - } - - if (_cullFace != _renderStateCullFace) - { - glCullFace(_cullFace); - } - - // depth - _renderStateDepthTest = (glIsEnabled(GL_DEPTH_TEST) != GL_FALSE); - glGetBooleanv(GL_DEPTH_WRITEMASK, &_renderStateDepthWrite); - - if (_depthTestEnabled != _renderStateDepthTest) - { - _depthTestEnabled ? glEnable(GL_DEPTH_TEST) : glDisable(GL_DEPTH_TEST); - } - - if (_depthWriteEnabled != _renderStateDepthWrite) - { - glDepthMask(_depthWriteEnabled); - } -} - -void MeshCommand::restoreRenderState() -{ - CCASSERT(!_material, "Must not be called when using Material"); - - // cull - if (_cullFaceEnabled != _renderStateCullFaceEnabled) - { - _renderStateCullFaceEnabled ? glEnable(GL_CULL_FACE) : glDisable(GL_CULL_FACE); - } - - if (_cullFace != _renderStateCullFace) - { - glCullFace(_renderStateCullFace); - } - - // depth - if (_depthTestEnabled != _renderStateDepthTest) - { - _renderStateDepthTest ? glEnable(GL_DEPTH_TEST) : glDisable(GL_DEPTH_TEST); - } - - if (_depthWriteEnabled != _renderStateDepthWrite) - { - glDepthMask(_renderStateDepthWrite); - } + _stateBlock->bind(); } void MeshCommand::genMaterialID(GLuint texID, void* glProgramState, GLuint vertexBuffer, GLuint indexBuffer, BlendFunc blend) @@ -353,9 +236,6 @@ void MeshCommand::batchDraw() // Draw glDrawElements(_primitive, (GLsizei)_indexCount, _indexFormat, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _indexCount); - - //restore render state - restoreRenderState(); } } void MeshCommand::postBatchDraw() @@ -404,9 +284,6 @@ void MeshCommand::execute() glDrawElements(_primitive, (GLsizei)_indexCount, _indexFormat, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _indexCount); - - //restore render state - restoreRenderState(); } glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); diff --git a/cocos/renderer/CCMeshCommand.h b/cocos/renderer/CCMeshCommand.h index 729adc2abb..998708a629 100644 --- a/cocos/renderer/CCMeshCommand.h +++ b/cocos/renderer/CCMeshCommand.h @@ -28,13 +28,12 @@ #include #include "renderer/CCRenderCommand.h" #include "renderer/CCGLProgram.h" +#include "renderer/CCRenderState.h" #include "math/CCMath.h" NS_CC_BEGIN class GLProgramState; -class GLProgram; -struct Uniform; class EventListenerCustom; class EventCustom; class Material; @@ -45,32 +44,17 @@ class CC_DLL MeshCommand : public RenderCommand public: MeshCommand(); - ~MeshCommand(); + virtual ~MeshCommand(); void init(float globalZOrder, Material* material, GLuint vertexBuffer, GLuint indexBuffer, GLenum primitive, GLenum indexFormat, ssize_t indexCount, const Mat4 &mv, uint32_t flags); - void init(float globalZOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, GLuint vertexBuffer, GLuint indexBuffer, GLenum primitive, GLenum indexFormat, ssize_t indexCount, const Mat4 &mv, uint32_t flags); - - CC_DEPRECATED_ATTRIBUTE void init(float globalZOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, GLuint vertexBuffer, GLuint indexBuffer, GLenum primitive, GLenum indexType, ssize_t indexCount, const Mat4 &mv); - - void setCullFaceEnabled(bool enable); - - void setCullFace(GLenum cullFace); - - void setDepthTestEnabled(bool enable); - - void setDepthWriteEnabled(bool enable); - - void setDisplayColor(const Vec4& color); - - void setMatrixPalette(const Vec4* matrixPalette); - - void setMatrixPaletteSize(int size); + void init(float globalZOrder, GLuint textureID, GLProgramState* glProgramState, RenderState::StateBlock* stateBlock, GLuint vertexBuffer, GLuint indexBuffer, GLenum primitive, GLenum indexFormat, ssize_t indexCount, const Mat4 &mv, uint32_t flags); + void setDisplayColor(const Vec4& color); + void setMatrixPalette(const Vec4* matrixPalette); + void setMatrixPaletteSize(int size); void setLightMask(unsigned int lightmask); - - void setTransparent(bool value); - + void execute(); //used for batch @@ -93,12 +77,8 @@ protected: // apply renderstate, not used when using material void applyRenderState(); - void restoreRenderState(); - GLuint _textureID; - GLProgramState* _glProgramState; - BlendFunc _blendType; - + Vec4 _displayColor; // in order to support tint and fade in fade out // used for skin @@ -116,23 +96,22 @@ protected: ssize_t _indexCount; // States, default value all false - bool _cullFaceEnabled; - GLenum _cullFace; - bool _depthTestEnabled; - bool _depthWriteEnabled; - bool _forceDepthWrite; - - bool _renderStateCullFaceEnabled; - bool _renderStateDepthTest; - GLboolean _renderStateDepthWrite; - GLenum _renderStateCullFace; + // ModelView transform Mat4 _mv; + // Mode A: Material // weak ref Material* _material; + // Mode B: StateBlock + // weak ref + GLProgramState* _glProgramState; + RenderState::StateBlock* _stateBlock; + GLuint _textureID; + + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) EventListenerCustom* _rendererRecreatedListener; #endif diff --git a/cocos/renderer/CCRenderState.cpp b/cocos/renderer/CCRenderState.cpp index 5b447f39ee..d67482e4a4 100644 --- a/cocos/renderer/CCRenderState.cpp +++ b/cocos/renderer/CCRenderState.cpp @@ -83,7 +83,7 @@ void RenderState::initialize() void RenderState::finalize() { - CC_SAFE_RELEASE(StateBlock::_defaultState); + CC_SAFE_RELEASE_NULL(StateBlock::_defaultState); } bool RenderState::init(RenderState* parent) @@ -340,7 +340,8 @@ void RenderState::StateBlock::restore(long stateOverrideBits) CC_ASSERT(_defaultState); // If there is no state to restore (i.e. no non-default state), do nothing. - if (_defaultState->_bits == 0) +// if (_defaultState->_bits == 0) + if ( (stateOverrideBits | _defaultState->_bits) == stateOverrideBits) { return; } @@ -749,26 +750,8 @@ void RenderState::StateBlock::setBlend(bool enabled) void RenderState::StateBlock::setBlendFunc(const BlendFunc& blendFunc) { - if (blendFunc == BlendFunc::DISABLE) - { - setBlendSrc(BLEND_ONE); - setBlendDst(BLEND_ZERO); - } - else if (blendFunc == BlendFunc::ALPHA_PREMULTIPLIED) - { - setBlendSrc(BLEND_ONE); - setBlendDst(BLEND_ONE_MINUS_SRC_ALPHA); - } - else if (blendFunc == BlendFunc::ALPHA_NON_PREMULTIPLIED) - { - setBlendSrc(BLEND_SRC_ALPHA); - setBlendDst(BLEND_ONE_MINUS_SRC_ALPHA); - } - else if (blendFunc == BlendFunc::ADDITIVE) - { - setBlendSrc(BLEND_SRC_ALPHA); - setBlendDst(BLEND_ONE); - } + setBlendSrc((RenderState::Blend)blendFunc.src); + setBlendDst((RenderState::Blend)blendFunc.dst); } void RenderState::StateBlock::setBlendSrc(Blend blend) diff --git a/cocos/renderer/CCRenderState.h b/cocos/renderer/CCRenderState.h index 0a7649f079..088db5621c 100644 --- a/cocos/renderer/CCRenderState.h +++ b/cocos/renderer/CCRenderState.h @@ -352,6 +352,8 @@ public: uint32_t getHash() const; bool isDirty() const; + static StateBlock* _defaultState; + protected: StateBlock(); ~StateBlock(); @@ -382,8 +384,6 @@ public: long _bits; - static StateBlock* _defaultState; - mutable uint32_t _hash; mutable bool _hashDirty; }; diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index 240b947890..f51b5ae199 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -45,7 +45,7 @@ THE SOFTWARE. #include "renderer/CCGLProgram.h" #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramCache.h" - +#include "base/CCNinePatchImageParser.h" #include "deprecated/CCString.h" @@ -435,6 +435,7 @@ Texture2D::Texture2D() , _hasMipmaps(false) , _shaderProgram(nullptr) , _antialiasEnabled(true) +, _ninePatchInfo(nullptr) { } @@ -447,6 +448,8 @@ Texture2D::~Texture2D() CCLOGINFO("deallocing Texture2D: %p - id=%u", this, _name); CC_SAFE_RELEASE(_shaderProgram); + CC_SAFE_DELETE(_ninePatchInfo); + if(_name) { GL::deleteTexture(_name); @@ -1393,5 +1396,60 @@ const Texture2D::PixelFormatInfoMap& Texture2D::getPixelFormatInfoMap() return _pixelFormatInfoTables; } +void Texture2D::addSpriteFrameCapInset(SpriteFrame* spritframe, const Rect& capInsets) +{ + if(nullptr == _ninePatchInfo) + { + _ninePatchInfo = new NinePatchInfo; + } + if(nullptr == spritframe) + { + _ninePatchInfo->capInsetSize = capInsets; + } + else + { + _ninePatchInfo->capInsetMap[spritframe] = capInsets; + } +} + +bool Texture2D::isContain9PatchInfo()const +{ + return nullptr != _ninePatchInfo; +} + +const Rect& Texture2D::getSpriteFrameCapInset( cocos2d::SpriteFrame *spriteFrame )const +{ + CCASSERT(_ninePatchInfo != nullptr, + "Can't get the sprite frame capInset when the texture contains no 9-patch info."); + if(nullptr == spriteFrame) + { + return this->_ninePatchInfo->capInsetSize; + } + else + { + auto capInsetMap = this->_ninePatchInfo->capInsetMap; + if(capInsetMap.find(spriteFrame) != capInsetMap.end()) + { + return capInsetMap.at(spriteFrame); + } + else + { + return this->_ninePatchInfo->capInsetSize; + } + } +} + + +void Texture2D::removeSpriteFrameCapInset(SpriteFrame* spriteFrame) +{ + if(nullptr != this->_ninePatchInfo) + { + auto capInsetMap = this->_ninePatchInfo->capInsetMap; + if(capInsetMap.find(spriteFrame) != capInsetMap.end()) + { + capInsetMap.erase(spriteFrame); + } + } +} NS_CC_END diff --git a/cocos/renderer/CCTexture2D.h b/cocos/renderer/CCTexture2D.h index 46e0d18ebe..0da5bc2b81 100644 --- a/cocos/renderer/CCTexture2D.h +++ b/cocos/renderer/CCTexture2D.h @@ -29,6 +29,7 @@ THE SOFTWARE. #include #include +#include #include "base/CCRef.h" #include "math/CCGeometry.h" @@ -40,8 +41,15 @@ THE SOFTWARE. NS_CC_BEGIN class Image; +class NinePatchInfo; +class SpriteFrame; typedef struct _MipmapInfo MipmapInfo; +namespace ui +{ + class Scale9Sprite; +} + /** * @addtogroup _2d * @{ @@ -309,6 +317,7 @@ public: * @endcode */ void setTexParameters(const TexParams& texParams); + /** * @js NA * @lua NA @@ -402,12 +411,55 @@ public: /** Get a shader program from the texture.*/ GLProgram* getGLProgram() const; - + + public: /** Get pixel info map, the key-value pairs is PixelFormat and PixelFormatInfo.*/ static const PixelFormatInfoMap& getPixelFormatInfoMap(); private: + /** + * A struct for storing 9-patch image capInsets. + */ + + class NinePatchInfo + { + public: + Rect capInsetSize; + std::unordered_map capInsetMap; + }; + + /** + * Whether the texture contains a 9-patch capInset info or not. + * + * @return True is Texture contains a 9-patch info, false otherwise. + */ + bool isContain9PatchInfo()const; + + /** + * Get spriteFrame capInset, If spriteFrame can't be found in 9-patch info map, + * then single 9-patch texture capInset will be returned. + * If the arg is nullptr, the capInset of single 9-patch texture will be returned. + * + * @param spriteFrame A SpriteFrame object pointer. + * + * @return The capInset of the SpriteFrame object. + */ + const Rect& getSpriteFrameCapInset(SpriteFrame* spriteFrame)const; + /** + * Remove the spriteFrame capInset info when the spriteFrame is removed. + * + * @param spriteFrame A SpriteFrame object pointer. + */ + void removeSpriteFrameCapInset(SpriteFrame* spriteFrame); + /** + * Add capInset for sprite atlas. + * When handling single texture, pass nullptr in the first arg. + * + * @param spritframe The sprite frame object. + * @param capInsets The parsed capInset from a .9 patch image. + */ + void addSpriteFrameCapInset(SpriteFrame* spritframe, const Rect& capInsets); /**convert functions*/ @@ -490,6 +542,10 @@ protected: static const PixelFormatInfoMap _pixelFormatInfoTables; bool _antialiasEnabled; + NinePatchInfo* _ninePatchInfo; + friend class SpriteFrameCache; + friend class TextureCache; + friend class ui::Scale9Sprite; }; diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 239d4278e9..7afca3874e 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -40,6 +40,7 @@ THE SOFTWARE. #include "base/ccUtils.h" #include "deprecated/CCString.h" +#include "base/CCNinePatchImageParser.h" #ifdef EMSCRIPTEN @@ -114,8 +115,8 @@ void TextureCache::addImageAsync(const std::string &path, const std::function(); - _imageInfoQueue = new deque(); + _asyncStructQueue = new (std::nothrow) deque(); + _imageInfoQueue = new (std::nothrow) deque(); // create a new thread to load images _loadingThread = new std::thread(&TextureCache::loadImage, this); @@ -134,36 +135,62 @@ void TextureCache::addImageAsync(const std::string &path, const std::functionpush(data); - _asyncStructQueueMutex.unlock(); + _asyncMutex.lock(); + _asyncStructQueue->push_back(data); + _asyncMutex.unlock(); _sleepCondition.notify_one(); } void TextureCache::unbindImageAsync(const std::string& filename) { - _imageInfoMutex.lock(); - if (_imageInfoQueue && !_imageInfoQueue->empty()) + std::string fullpath = FileUtils::getInstance()->fullPathForFilename(filename); + + _asyncMutex.lock(); + + if (_asyncStructQueue && !_asyncStructQueue->empty()) { - std::string fullpath = FileUtils::getInstance()->fullPathForFilename(filename); - auto found = std::find_if(_imageInfoQueue->begin(), _imageInfoQueue->end(), [&fullpath](ImageInfo* ptr)->bool{ return ptr->asyncStruct->filename == fullpath; }); - if (found != _imageInfoQueue->end()) + for (auto it = _asyncStructQueue->begin(); it != _asyncStructQueue->end(); ++it) { - (*found)->asyncStruct->callback = nullptr; + if ((*it)->filename == fullpath) + { + (*it)->callback = nullptr; + } } } - _imageInfoMutex.unlock(); + + if (_imageInfoQueue && !_imageInfoQueue->empty()) + { + for (auto it = _imageInfoQueue->begin(); it != _imageInfoQueue->end(); ++it) + { + if ((*it)->asyncStruct->filename == fullpath) + { + (*it)->asyncStruct->callback = nullptr; + } + } + } + + _asyncMutex.unlock(); } void TextureCache::unbindAllImageAsync() { - _imageInfoMutex.lock(); + _asyncMutex.lock(); + if (_asyncStructQueue && !_asyncStructQueue->empty()) + { + for (auto it = _asyncStructQueue->begin(); it != _asyncStructQueue->end(); ++it) + { + (*it)->callback = nullptr; + } + } if (_imageInfoQueue && !_imageInfoQueue->empty()) { - std::for_each(_imageInfoQueue->begin(), _imageInfoQueue->end(), [](ImageInfo* ptr) { ptr->asyncStruct->callback = nullptr; }); + for (auto it = _imageInfoQueue->begin(); it != _imageInfoQueue->end(); ++it) + { + (*it)->asyncStruct->callback = nullptr; + } } - _imageInfoMutex.unlock(); + _asyncMutex.unlock(); } void TextureCache::loadImage() @@ -172,11 +199,10 @@ void TextureCache::loadImage() while (true) { - std::queue *pQueue = _asyncStructQueue; - _asyncStructQueueMutex.lock(); - if (pQueue->empty()) + _asyncMutex.lock(); + if (_asyncStructQueue->empty()) { - _asyncStructQueueMutex.unlock(); + _asyncMutex.unlock(); if (_needQuit) { break; } @@ -188,9 +214,8 @@ void TextureCache::loadImage() } else { - asyncStruct = pQueue->front(); - pQueue->pop(); - _asyncStructQueueMutex.unlock(); + asyncStruct = _asyncStructQueue->front(); + _asyncMutex.unlock(); } Image *image = nullptr; @@ -199,9 +224,9 @@ void TextureCache::loadImage() auto it = _textures.find(asyncStruct->filename); if( it == _textures.end() ) { - _imageInfoMutex.lock(); ImageInfo *imageInfo; size_t pos = 0; + _asyncMutex.lock(); size_t infoSize = _imageInfoQueue->size(); for (; pos < infoSize; pos++) { @@ -209,7 +234,7 @@ void TextureCache::loadImage() if(imageInfo->asyncStruct->filename.compare(asyncStruct->filename) == 0) break; } - _imageInfoMutex.unlock(); + _asyncMutex.unlock(); if(infoSize == 0 || pos == infoSize) generateImage = true; } @@ -223,6 +248,9 @@ void TextureCache::loadImage() { CC_SAFE_RELEASE(image); CCLOG("can not load %s", filename.c_str()); + _asyncMutex.lock(); + _asyncStructQueue->pop_front(); + _asyncMutex.unlock(); continue; } } @@ -233,9 +261,10 @@ void TextureCache::loadImage() imageInfo->image = image; // put the image info into the queue - _imageInfoMutex.lock(); + _asyncMutex.lock(); + _asyncStructQueue->pop_front(); _imageInfoQueue->push_back(imageInfo); - _imageInfoMutex.unlock(); + _asyncMutex.unlock(); } if(_asyncStructQueue != nullptr) @@ -252,16 +281,16 @@ void TextureCache::addImageAsyncCallBack(float dt) // the image is generated in loading thread std::deque *imagesQueue = _imageInfoQueue; - _imageInfoMutex.lock(); + _asyncMutex.lock(); if (imagesQueue->empty()) { - _imageInfoMutex.unlock(); + _asyncMutex.unlock(); } else { ImageInfo *imageInfo = imagesQueue->front(); imagesQueue->pop_front(); - _imageInfoMutex.unlock(); + _asyncMutex.unlock(); AsyncStruct *asyncStruct = imageInfo->asyncStruct; Image *image = imageInfo->image; @@ -275,7 +304,8 @@ void TextureCache::addImageAsyncCallBack(float dt) texture = new (std::nothrow) Texture2D(); texture->initWithImage(image); - + //parse 9-patch info + this->parseNinePatchImage(image, texture, filename); #if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, filename); @@ -351,6 +381,9 @@ Texture2D * TextureCache::addImage(const std::string &path) #endif // texture already retained, no need to re-retain it _textures.insert( std::make_pair(fullpath, texture) ); + + //parse 9-patch info + this->parseNinePatchImage(image, texture, path); } else { @@ -364,6 +397,17 @@ Texture2D * TextureCache::addImage(const std::string &path) return texture; } +void TextureCache::parseNinePatchImage(cocos2d::Image *image, cocos2d::Texture2D *texture,const std::string& path) +{ + if(NinePatchImageParser::isNinePatchImage(path)) + { + Rect frameRect = Rect(0,0,image->getWidth(), image->getHeight()); + NinePatchImageParser parser(image, frameRect, false); + texture->addSpriteFrameCapInset(nullptr, parser.parseCapInset()); + } + +} + Texture2D* TextureCache::addImage(Image *image, const std::string &key) { CCASSERT(image != nullptr, "TextureCache: image MUST not be nil"); @@ -524,6 +568,19 @@ void TextureCache::reloadAllTextures() // #endif } +const std::string TextureCache::getTextureFilePath( cocos2d::Texture2D *texture )const +{ + for(auto& item : _textures) + { + if(item.second == texture) + { + return item.first; + break; + } + } + return ""; +} + void TextureCache::waitForQuit() { // notify sub thread to quick diff --git a/cocos/renderer/CCTextureCache.h b/cocos/renderer/CCTextureCache.h index ac22103f4a..e393c8593c 100644 --- a/cocos/renderer/CCTextureCache.h +++ b/cocos/renderer/CCTextureCache.h @@ -195,10 +195,19 @@ public: /**Called by director, please do not called outside.*/ void waitForQuit(); + /** + * Get the file path of the texture + * + * @param texture A Texture2D object pointer. + * + * @return The full path of the file. + */ + const std::string getTextureFilePath(Texture2D* texture)const; + private: void addImageAsyncCallBack(float dt); void loadImage(); - + void parseNinePatchImage(Image* image, Texture2D* texture, const std::string& path); public: struct AsyncStruct { @@ -218,11 +227,10 @@ protected: std::thread* _loadingThread; - std::queue* _asyncStructQueue; + std::deque* _asyncStructQueue; std::deque* _imageInfoQueue; - std::mutex _asyncStructQueueMutex; - std::mutex _imageInfoMutex; + std::mutex _asyncMutex; std::mutex _sleepMutex; std::condition_variable _sleepCondition; diff --git a/cocos/renderer/ccGLStateCache.cpp b/cocos/renderer/ccGLStateCache.cpp index 25eedc382f..477976db82 100644 --- a/cocos/renderer/ccGLStateCache.cpp +++ b/cocos/renderer/ccGLStateCache.cpp @@ -28,6 +28,7 @@ THE SOFTWARE. #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" +#include "renderer/CCRenderState.h" #include "base/CCDirector.h" #include "base/ccConfig.h" #include "base/CCConfiguration.h" @@ -109,12 +110,17 @@ static void SetBlending(GLenum sfactor, GLenum dfactor) if (sfactor == GL_ONE && dfactor == GL_ZERO) { glDisable(GL_BLEND); + RenderState::StateBlock::_defaultState->setBlend(false); } else { glEnable(GL_BLEND); glBlendFunc(sfactor, dfactor); - } + + RenderState::StateBlock::_defaultState->setBlend(true); + RenderState::StateBlock::_defaultState->setBlendSrc((RenderState::Blend)sfactor); + RenderState::StateBlock::_defaultState->setBlendSrc((RenderState::Blend)dfactor); + } } void blendFunc(GLenum sfactor, GLenum dfactor) diff --git a/cocos/scripting/js-bindings/CMakeLists.txt b/cocos/scripting/js-bindings/CMakeLists.txt index 3f1a5d8f36..a233d6cf04 100644 --- a/cocos/scripting/js-bindings/CMakeLists.txt +++ b/cocos/scripting/js-bindings/CMakeLists.txt @@ -43,6 +43,7 @@ set(JSBINDING_SRC auto/jsb_cocos2dx_3d_auto.cpp auto/jsb_cocos2dx_3d_extension_auto.cpp auto/jsb_cocos2dx_experimental.cpp + auto/jsb_cocos2dx_physics3d_auto.cpp manual/ScriptingCore.cpp manual/cocos2d_specifics.cpp manual/js_manual_conversions.cpp @@ -69,6 +70,7 @@ set(JSBINDING_SRC manual/ui/jsb_cocos2dx_ui_manual.cpp manual/3d/jsb_cocos2dx_3d_manual.cpp manual/experimental/jsb_cocos2dx_experimental_manual.cpp + manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp ${cocos_root}/cocos/storage/local-storage/LocalStorage.cpp ) @@ -80,11 +82,13 @@ include_directories( ${cocos_root}/external/spidermonkey/include/${PLATFORM_FOLDER} ${cocos_root}/cocos/base ${cocos_root}/cocos/2d + ${cocos_root}/cocos/3d ${cocos_root}/cocos/ui ${cocos_root}/cocos/audio/include ${cocos_root}/cocos/storage ${cocos_root}/cocos/network ${cocos_root}/cocos/platform + ${cocos_root}/cocos/physics3d ${cocos_root}/extensions ${cocos_root}/external ${cocos_root}/cocos/editor-support diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js index b48e88a837..b7b36f805e 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js @@ -1520,3 +1520,143 @@ TextureCube : function ( }, }; + +/** + * @class Bundle3D + */ +jsb.Bundle3D = { + +/** + * @method load + * @param {String} arg0 + * @return {bool} + */ +load : function ( +str +) +{ + return false; +}, + +/** + * @method loadSkinData + * @param {String} arg0 + * @param {cc.SkinData} arg1 + * @return {bool} + */ +loadSkinData : function ( +str, +skindata +) +{ + return false; +}, + +/** + * @method clear + */ +clear : function ( +) +{ +}, + +/** + * @method loadMaterials + * @param {cc.MaterialDatas} arg0 + * @return {bool} + */ +loadMaterials : function ( +materialdatas +) +{ + return false; +}, + +/** + * @method loadMeshDatas + * @param {cc.MeshDatas} arg0 + * @return {bool} + */ +loadMeshDatas : function ( +meshdatas +) +{ + return false; +}, + +/** + * @method loadNodes + * @param {cc.NodeDatas} arg0 + * @return {bool} + */ +loadNodes : function ( +nodedatas +) +{ + return false; +}, + +/** + * @method loadAnimationData + * @param {String} arg0 + * @param {cc.Animation3DData} arg1 + * @return {bool} + */ +loadAnimationData : function ( +str, +animation3ddata +) +{ + return false; +}, + +/** + * @method createBundle + * @return {cc.Bundle3D} + */ +createBundle : function ( +) +{ + return cc.Bundle3D; +}, + +/** + * @method destroyBundle + * @param {cc.Bundle3D} arg0 + */ +destroyBundle : function ( +bundle3d +) +{ +}, + +/** + * @method loadObj + * @param {cc.MeshDatas} arg0 + * @param {cc.MaterialDatas} arg1 + * @param {cc.NodeDatas} arg2 + * @param {String} arg3 + * @param {char} arg4 + * @return {bool} + */ +loadObj : function ( +meshdatas, +materialdatas, +nodedatas, +str, +char +) +{ + return false; +}, + +/** + * @method Bundle3D + * @constructor + */ +Bundle3D : function ( +) +{ +}, + +}; diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index 9d77773463..db201859e9 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -5585,6 +5585,359 @@ getInstance : function ( }; +/** + * @class Properties + */ +cc.Properties = { + +/** + * @method getVariable + * @param {char} arg0 + * @param {char} arg1 + * @return {char} + */ +getVariable : function ( +char, +char +) +{ + return 0; +}, + +/** + * @method getString + * @return {char} + */ +getString : function ( +) +{ + return 0; +}, + +/** + * @method getLong + * @return {long} + */ +getLong : function ( +) +{ + return 0; +}, + +/** + * @method getNamespace +* @param {char} char +* @param {bool} bool +* @param {bool} bool +* @return {char|cc.Properties} +*/ +getNamespace : function( +char, +bool, +bool +) +{ + return cc.Properties; +}, + +/** + * @method getPath + * @param {char} arg0 + * @param {String} arg1 + * @return {bool} + */ +getPath : function ( +char, +str +) +{ + return false; +}, + +/** + * @method getMat4 + * @param {char} arg0 + * @param {mat4_object} arg1 + * @return {bool} + */ +getMat4 : function ( +char, +mat4 +) +{ + return false; +}, + +/** + * @method exists + * @param {char} arg0 + * @return {bool} + */ +exists : function ( +char +) +{ + return false; +}, + +/** + * @method setString + * @param {char} arg0 + * @param {char} arg1 + * @return {bool} + */ +setString : function ( +char, +char +) +{ + return false; +}, + +/** + * @method getId + * @return {char} + */ +getId : function ( +) +{ + return 0; +}, + +/** + * @method rewind + */ +rewind : function ( +) +{ +}, + +/** + * @method setVariable + * @param {char} arg0 + * @param {char} arg1 + */ +setVariable : function ( +char, +char +) +{ +}, + +/** + * @method getBool + * @return {bool} + */ +getBool : function ( +) +{ + return false; +}, + +/** + * @method getColor +* @param {char|char} char +* @param {vec4_object|vec3_object} vec4 +* @return {bool|bool} +*/ +getColor : function( +char, +vec3 +) +{ + return false; +}, + +/** + * @method getType + * @return {cc.Properties::Type} + */ +getType : function ( +) +{ + return 0; +}, + +/** + * @method getNextNamespace + * @return {cc.Properties} + */ +getNextNamespace : function ( +) +{ + return cc.Properties; +}, + +/** + * @method getInt + * @return {int} + */ +getInt : function ( +) +{ + return 0; +}, + +/** + * @method getVec3 + * @param {char} arg0 + * @param {vec3_object} arg1 + * @return {bool} + */ +getVec3 : function ( +char, +vec3 +) +{ + return false; +}, + +/** + * @method getVec2 + * @param {char} arg0 + * @param {vec2_object} arg1 + * @return {bool} + */ +getVec2 : function ( +char, +vec2 +) +{ + return false; +}, + +/** + * @method getVec4 + * @param {char} arg0 + * @param {vec4_object} arg1 + * @return {bool} + */ +getVec4 : function ( +char, +vec4 +) +{ + return false; +}, + +/** + * @method getNextProperty + * @return {char} + */ +getNextProperty : function ( +) +{ + return 0; +}, + +/** + * @method getFloat + * @return {float} + */ +getFloat : function ( +) +{ + return 0; +}, + +/** + * @method getQuaternionFromAxisAngle + * @param {char} arg0 + * @param {cc.Quaternion} arg1 + * @return {bool} + */ +getQuaternionFromAxisAngle : function ( +char, +quaternion +) +{ + return false; +}, + +/** + * @method parseColor +* @param {char|char} char +* @param {vec4_object|vec3_object} vec4 +* @return {bool|bool} +*/ +parseColor : function( +char, +vec3 +) +{ + return false; +}, + +/** + * @method parseVec3 + * @param {char} arg0 + * @param {vec3_object} arg1 + * @return {bool} + */ +parseVec3 : function ( +char, +vec3 +) +{ + return false; +}, + +/** + * @method parseAxisAngle + * @param {char} arg0 + * @param {cc.Quaternion} arg1 + * @return {bool} + */ +parseAxisAngle : function ( +char, +quaternion +) +{ + return false; +}, + +/** + * @method parseVec2 + * @param {char} arg0 + * @param {vec2_object} arg1 + * @return {bool} + */ +parseVec2 : function ( +char, +vec2 +) +{ + return false; +}, + +/** + * @method createNonRefCounted + * @param {String} arg0 + * @return {cc.Properties} + */ +createNonRefCounted : function ( +str +) +{ + return cc.Properties; +}, + +/** + * @method parseVec4 + * @param {char} arg0 + * @param {vec4_object} arg1 + * @return {bool} + */ +parseVec4 : function ( +char, +vec4 +) +{ + return false; +}, + +}; + /** * @class FileUtils */ @@ -18186,6 +18539,24 @@ vec3 return cc.Vec2; }, +/** + * @method initOrthographic + * @param {float} arg0 + * @param {float} arg1 + * @param {float} arg2 + * @param {float} arg3 + * @return {bool} + */ +initOrthographic : function ( +float, +float, +float, +float +) +{ + return false; +}, + /** * @method getDepthInView * @param {mat4_object} arg0 @@ -18221,21 +18592,13 @@ cameraflag }, /** - * @method initOrthographic + * @method clearBackground * @param {float} arg0 - * @param {float} arg1 - * @param {float} arg2 - * @param {float} arg3 - * @return {bool} */ -initOrthographic : function ( -float, -float, -float, +clearBackground : function ( float ) { - return false; }, /** @@ -19409,6 +19772,446 @@ GLProgramCache : function ( }; +/** + * @class RenderState + */ +cc.RenderState = { + +/** + * @method setTexture + * @param {cc.Texture2D} arg0 + */ +setTexture : function ( +texture2d +) +{ +}, + +/** + * @method getTopmost + * @param {cc.RenderState} arg0 + * @return {cc.RenderState} + */ +getTopmost : function ( +renderstate +) +{ + return cc.RenderState; +}, + +/** + * @method getTexture + * @return {cc.Texture2D} + */ +getTexture : function ( +) +{ + return cc.Texture2D; +}, + +/** + * @method bind + * @param {cc.Pass} arg0 + */ +bind : function ( +pass +) +{ +}, + +/** + * @method getName + * @return {String} + */ +getName : function ( +) +{ + return ; +}, + +/** + * @method getStateBlock + * @return {cc.RenderState::StateBlock} + */ +getStateBlock : function ( +) +{ + return cc.RenderState::StateBlock; +}, + +/** + * @method getTextures + * @return {Array} + */ +getTextures : function ( +) +{ + return new Array(); +}, + +/** + * @method initialize + */ +initialize : function ( +) +{ +}, + +/** + * @method finalize + */ +finalize : function ( +) +{ +}, + +}; + +/** + * @class Pass + */ +cc.Pass = { + +/** + * @method unbind + */ +unbind : function ( +) +{ +}, + +/** + * @method bind +* @param {mat4_object|mat4_object} mat4 +* @param {bool} bool +*/ +bind : function( +mat4, +bool +) +{ +}, + +/** + * @method clone + * @return {cc.Pass} + */ +clone : function ( +) +{ + return cc.Pass; +}, + +/** + * @method getGLProgramState + * @return {cc.GLProgramState} + */ +getGLProgramState : function ( +) +{ + return cc.GLProgramState; +}, + +/** + * @method getVertexAttributeBinding + * @return {cc.VertexAttribBinding} + */ +getVertexAttributeBinding : function ( +) +{ + return cc.VertexAttribBinding; +}, + +/** + * @method getHash + * @return {unsigned int} + */ +getHash : function ( +) +{ + return 0; +}, + +/** + * @method setVertexAttribBinding + * @param {cc.VertexAttribBinding} arg0 + */ +setVertexAttribBinding : function ( +vertexattribbinding +) +{ +}, + +/** + * @method create + * @param {cc.Technique} arg0 + * @return {cc.Pass} + */ +create : function ( +technique +) +{ + return cc.Pass; +}, + +/** + * @method createWithGLProgramState + * @param {cc.Technique} arg0 + * @param {cc.GLProgramState} arg1 + * @return {cc.Pass} + */ +createWithGLProgramState : function ( +technique, +glprogramstate +) +{ + return cc.Pass; +}, + +}; + +/** + * @class Technique + */ +cc.Technique = { + +/** + * @method getPassCount + * @return {long} + */ +getPassCount : function ( +) +{ + return 0; +}, + +/** + * @method clone + * @return {cc.Technique} + */ +clone : function ( +) +{ + return cc.Technique; +}, + +/** + * @method addPass + * @param {cc.Pass} arg0 + */ +addPass : function ( +pass +) +{ +}, + +/** + * @method getPasses + * @return {Array} + */ +getPasses : function ( +) +{ + return new Array(); +}, + +/** + * @method getName + * @return {String} + */ +getName : function ( +) +{ + return ; +}, + +/** + * @method getPassByIndex + * @param {long} arg0 + * @return {cc.Pass} + */ +getPassByIndex : function ( +long +) +{ + return cc.Pass; +}, + +/** + * @method create + * @param {cc.Material} arg0 + * @return {cc.Technique} + */ +create : function ( +material +) +{ + return cc.Technique; +}, + +/** + * @method createWithGLProgramState + * @param {cc.Material} arg0 + * @param {cc.GLProgramState} arg1 + * @return {cc.Technique} + */ +createWithGLProgramState : function ( +material, +glprogramstate +) +{ + return cc.Technique; +}, + +}; + +/** + * @class Material + */ +cc.Material = { + +/** + * @method clone + * @return {cc.Material} + */ +clone : function ( +) +{ + return cc.Material; +}, + +/** + * @method getTechniqueCount + * @return {long} + */ +getTechniqueCount : function ( +) +{ + return 0; +}, + +/** + * @method setName + * @param {String} arg0 + */ +setName : function ( +str +) +{ +}, + +/** + * @method getTechniqueByIndex + * @param {long} arg0 + * @return {cc.Technique} + */ +getTechniqueByIndex : function ( +long +) +{ + return cc.Technique; +}, + +/** + * @method getName + * @return {String} + */ +getName : function ( +) +{ + return ; +}, + +/** + * @method getTechniques + * @return {Array} + */ +getTechniques : function ( +) +{ + return new Array(); +}, + +/** + * @method setTechnique + * @param {String} arg0 + */ +setTechnique : function ( +str +) +{ +}, + +/** + * @method getTechniqueByName + * @param {String} arg0 + * @return {cc.Technique} + */ +getTechniqueByName : function ( +str +) +{ + return cc.Technique; +}, + +/** + * @method addTechnique + * @param {cc.Technique} arg0 + */ +addTechnique : function ( +technique +) +{ +}, + +/** + * @method getTechnique + * @return {cc.Technique} + */ +getTechnique : function ( +) +{ + return cc.Technique; +}, + +/** + * @method createWithFilename + * @param {String} arg0 + * @return {cc.Material} + */ +createWithFilename : function ( +str +) +{ + return cc.Material; +}, + +/** + * @method createWithGLStateProgram + * @param {cc.GLProgramState} arg0 + * @return {cc.Material} + */ +createWithGLStateProgram : function ( +glprogramstate +) +{ + return cc.Material; +}, + +/** + * @method createWithProperties + * @param {cc.Properties} arg0 + * @return {cc.Material} + */ +createWithProperties : function ( +properties +) +{ + return cc.Material; +}, + +}; + /** * @class TextureCache */ @@ -19520,6 +20323,18 @@ str return cc.Texture2D; }, +/** + * @method getTextureFilePath + * @param {cc.Texture2D} arg0 + * @return {String} + */ +getTextureFilePath : function ( +texture2d +) +{ + return ; +}, + /** * @method removeUnusedTextures */ diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js new file mode 100644 index 0000000000..db5be29414 --- /dev/null +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js @@ -0,0 +1,2603 @@ +/** + * @module cocos2dx_physics3d + */ +var cc = cc || {}; + +/** + * @class Physics3DShape + */ +cc.Physics3DShape = { + +/** + * @method getbtShape + * @return {btCollisionShape} + */ +getbtShape : function ( +) +{ + return btCollisionShape; +}, + +/** + * @method getShapeType + * @return {cc.Physics3DShape::ShapeType} + */ +getShapeType : function ( +) +{ + return 0; +}, + +/** + * @method createBox + * @param {vec3_object} arg0 + * @return {cc.Physics3DShape} + */ +createBox : function ( +vec3 +) +{ + return cc.Physics3DShape; +}, + +/** + * @method createCylinder + * @param {float} arg0 + * @param {float} arg1 + * @return {cc.Physics3DShape} + */ +createCylinder : function ( +float, +float +) +{ + return cc.Physics3DShape; +}, + +/** + * @method createConvexHull + * @param {vec3_object} arg0 + * @param {int} arg1 + * @return {cc.Physics3DShape} + */ +createConvexHull : function ( +vec3, +int +) +{ + return cc.Physics3DShape; +}, + +/** + * @method createCapsule + * @param {float} arg0 + * @param {float} arg1 + * @return {cc.Physics3DShape} + */ +createCapsule : function ( +float, +float +) +{ + return cc.Physics3DShape; +}, + +/** + * @method createSphere + * @param {float} arg0 + * @return {cc.Physics3DShape} + */ +createSphere : function ( +float +) +{ + return cc.Physics3DShape; +}, + +}; + +/** + * @class Physics3DObject + */ +cc.Physics3DObject = { + +/** + * @method setUserData + * @param {void} arg0 + */ +setUserData : function ( +void +) +{ +}, + +/** + * @method getUserData + * @return {void} + */ +getUserData : function ( +) +{ + return void; +}, + +/** + * @method getObjType + * @return {cc.Physics3DObject::PhysicsObjType} + */ +getObjType : function ( +) +{ + return 0; +}, + +/** + * @method setPhysicsWorld + * @param {cc.Physics3DWorld} arg0 + */ +setPhysicsWorld : function ( +physics3dworld +) +{ +}, + +/** + * @method getWorldTransform + * @return {mat4_object} + */ +getWorldTransform : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method getPhysicsWorld + * @return {cc.Physics3DWorld} + */ +getPhysicsWorld : function ( +) +{ + return cc.Physics3DWorld; +}, + +/** + * @method setMask + * @param {unsigned int} arg0 + */ +setMask : function ( +int +) +{ +}, + +/** + * @method getCollisionCallback + * @return {function} + */ +getCollisionCallback : function ( +) +{ + return std::function; +}, + +/** + * @method getMask + * @return {unsigned int} + */ +getMask : function ( +) +{ + return 0; +}, + +/** + * @method needCollisionCallback + * @return {bool} + */ +needCollisionCallback : function ( +) +{ + return false; +}, + +}; + +/** + * @class Physics3DRigidBody + */ +cc.Physics3DRigidBody = { + +/** + * @method setGravity + * @param {vec3_object} arg0 + */ +setGravity : function ( +vec3 +) +{ +}, + +/** + * @method getFriction + * @return {float} + */ +getFriction : function ( +) +{ + return 0; +}, + +/** + * @method setAngularFactor +* @param {float|vec3_object} float +*/ +setAngularFactor : function( +vec3 +) +{ +}, + +/** + * @method addConstraint + * @param {cc.Physics3DConstraint} arg0 + */ +addConstraint : function ( +physics3dconstraint +) +{ +}, + +/** + * @method getRigidBody + * @return {btRigidBody} + */ +getRigidBody : function ( +) +{ + return btRigidBody; +}, + +/** + * @method getTotalForce + * @return {vec3_object} + */ +getTotalForce : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getConstraintCount + * @return {unsigned int} + */ +getConstraintCount : function ( +) +{ + return 0; +}, + +/** + * @method applyCentralForce + * @param {vec3_object} arg0 + */ +applyCentralForce : function ( +vec3 +) +{ +}, + +/** + * @method setMassProps + * @param {float} arg0 + * @param {vec3_object} arg1 + */ +setMassProps : function ( +float, +vec3 +) +{ +}, + +/** + * @method setFriction + * @param {float} arg0 + */ +setFriction : function ( +float +) +{ +}, + +/** + * @method setKinematic + * @param {bool} arg0 + */ +setKinematic : function ( +bool +) +{ +}, + +/** + * @method setDamping + * @param {float} arg0 + * @param {float} arg1 + */ +setDamping : function ( +float, +float +) +{ +}, + +/** + * @method applyImpulse + * @param {vec3_object} arg0 + * @param {vec3_object} arg1 + */ +applyImpulse : function ( +vec3, +vec3 +) +{ +}, + +/** + * @method isKinematic + * @return {bool} + */ +isKinematic : function ( +) +{ + return false; +}, + +/** + * @method applyTorque + * @param {vec3_object} arg0 + */ +applyTorque : function ( +vec3 +) +{ +}, + +/** + * @method setCcdMotionThreshold + * @param {float} arg0 + */ +setCcdMotionThreshold : function ( +float +) +{ +}, + +/** + * @method setRollingFriction + * @param {float} arg0 + */ +setRollingFriction : function ( +float +) +{ +}, + +/** + * @method getCcdMotionThreshold + * @return {float} + */ +getCcdMotionThreshold : function ( +) +{ + return 0; +}, + +/** + * @method getLinearFactor + * @return {vec3_object} + */ +getLinearFactor : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method applyDamping + * @param {float} arg0 + */ +applyDamping : function ( +float +) +{ +}, + +/** + * @method getAngularVelocity + * @return {vec3_object} + */ +getAngularVelocity : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method init + * @param {cc.Physics3DRigidBodyDes} arg0 + * @return {bool} + */ +init : function ( +physics3drigidbodydes +) +{ + return false; +}, + +/** + * @method applyTorqueImpulse + * @param {vec3_object} arg0 + */ +applyTorqueImpulse : function ( +vec3 +) +{ +}, + +/** + * @method setActive + * @param {bool} arg0 + */ +setActive : function ( +bool +) +{ +}, + +/** + * @method setLinearFactor + * @param {vec3_object} arg0 + */ +setLinearFactor : function ( +vec3 +) +{ +}, + +/** + * @method setLinearVelocity + * @param {vec3_object} arg0 + */ +setLinearVelocity : function ( +vec3 +) +{ +}, + +/** + * @method getLinearVelocity + * @return {vec3_object} + */ +getLinearVelocity : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method setCcdSweptSphereRadius + * @param {float} arg0 + */ +setCcdSweptSphereRadius : function ( +float +) +{ +}, + +/** + * @method applyForce + * @param {vec3_object} arg0 + * @param {vec3_object} arg1 + */ +applyForce : function ( +vec3, +vec3 +) +{ +}, + +/** + * @method setAngularVelocity + * @param {vec3_object} arg0 + */ +setAngularVelocity : function ( +vec3 +) +{ +}, + +/** + * @method applyCentralImpulse + * @param {vec3_object} arg0 + */ +applyCentralImpulse : function ( +vec3 +) +{ +}, + +/** + * @method getGravity + * @return {vec3_object} + */ +getGravity : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getRollingFriction + * @return {float} + */ +getRollingFriction : function ( +) +{ + return 0; +}, + +/** + * @method setCenterOfMassTransform + * @param {mat4_object} arg0 + */ +setCenterOfMassTransform : function ( +mat4 +) +{ +}, + +/** + * @method setInvInertiaDiagLocal + * @param {vec3_object} arg0 + */ +setInvInertiaDiagLocal : function ( +vec3 +) +{ +}, + +/** + * @method removeConstraint +* @param {unsigned int|cc.Physics3DConstraint} int +*/ +removeConstraint : function( +physics3dconstraint +) +{ +}, + +/** + * @method getTotalTorque + * @return {vec3_object} + */ +getTotalTorque : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getInvMass + * @return {float} + */ +getInvMass : function ( +) +{ + return 0; +}, + +/** + * @method getConstraint + * @param {unsigned int} arg0 + * @return {cc.Physics3DConstraint} + */ +getConstraint : function ( +int +) +{ + return cc.Physics3DConstraint; +}, + +/** + * @method getRestitution + * @return {float} + */ +getRestitution : function ( +) +{ + return 0; +}, + +/** + * @method getCcdSweptSphereRadius + * @return {float} + */ +getCcdSweptSphereRadius : function ( +) +{ + return 0; +}, + +/** + * @method getHitFraction + * @return {float} + */ +getHitFraction : function ( +) +{ + return 0; +}, + +/** + * @method getAngularDamping + * @return {float} + */ +getAngularDamping : function ( +) +{ + return 0; +}, + +/** + * @method getInvInertiaDiagLocal + * @return {vec3_object} + */ +getInvInertiaDiagLocal : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getCenterOfMassTransform + * @return {mat4_object} + */ +getCenterOfMassTransform : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method getAngularFactor + * @return {vec3_object} + */ +getAngularFactor : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method setRestitution + * @param {float} arg0 + */ +setRestitution : function ( +float +) +{ +}, + +/** + * @method setHitFraction + * @param {float} arg0 + */ +setHitFraction : function ( +float +) +{ +}, + +/** + * @method getLinearDamping + * @return {float} + */ +getLinearDamping : function ( +) +{ + return 0; +}, + +/** + * @method Physics3DRigidBody + * @constructor + */ +Physics3DRigidBody : function ( +) +{ +}, + +}; + +/** + * @class Physics3DComponent + */ +cc.Physics3DComponent = { + +/** + * @method addToPhysicsWorld + * @param {cc.Physics3DWorld} arg0 + */ +addToPhysicsWorld : function ( +physics3dworld +) +{ +}, + +/** + * @method syncToPhysics + */ +syncToPhysics : function ( +) +{ +}, + +/** + * @method syncToNode + */ +syncToNode : function ( +) +{ +}, + +/** + * @method getPhysics3DObject + * @return {cc.Physics3DObject} + */ +getPhysics3DObject : function ( +) +{ + return cc.Physics3DObject; +}, + +/** + * @method setPhysics3DObject + * @param {cc.Physics3DObject} arg0 + */ +setPhysics3DObject : function ( +physics3dobject +) +{ +}, + +/** + * @method setSyncFlag + * @param {cc.Physics3DComponent::PhysicsSyncFlag} arg0 + */ +setSyncFlag : function ( +physicssyncflag +) +{ +}, + +/** + * @method setTransformInPhysics + * @param {vec3_object} arg0 + * @param {cc.Quaternion} arg1 + */ +setTransformInPhysics : function ( +vec3, +quaternion +) +{ +}, + +/** + * @method create +* @param {cc.Physics3DObject} physics3dobject +* @param {vec3_object} vec3 +* @param {cc.Quaternion} quaternion +* @return {cc.Physics3DComponent|cc.Physics3DComponent} +*/ +create : function( +physics3dobject, +vec3, +quaternion +) +{ + return cc.Physics3DComponent; +}, + +/** + * @method getPhysics3DComponentName + * @return {String} + */ +getPhysics3DComponentName : function ( +) +{ + return ; +}, + +/** + * @method Physics3DComponent + * @constructor + */ +Physics3DComponent : function ( +) +{ +}, + +}; + +/** + * @class PhysicsSprite3D + */ +cc.PhysicsSprite3D = { + +/** + * @method syncToPhysics + */ +syncToPhysics : function ( +) +{ +}, + +/** + * @method syncToNode + */ +syncToNode : function ( +) +{ +}, + +/** + * @method getPhysicsObj + * @return {cc.Physics3DObject} + */ +getPhysicsObj : function ( +) +{ + return cc.Physics3DObject; +}, + +/** + * @method setSyncFlag + * @param {cc.Physics3DComponent::PhysicsSyncFlag} arg0 + */ +setSyncFlag : function ( +physicssyncflag +) +{ +}, + +/** + * @method PhysicsSprite3D + * @constructor + */ +PhysicsSprite3D : function ( +) +{ +}, + +}; + +/** + * @class Physics3DWorld + */ +cc.Physics3DWorld = { + +/** + * @method stepSimulate + * @param {float} arg0 + */ +stepSimulate : function ( +float +) +{ +}, + +/** + * @method needCollisionChecking + * @return {bool} + */ +needCollisionChecking : function ( +) +{ + return false; +}, + +/** + * @method collisionChecking + */ +collisionChecking : function ( +) +{ +}, + +/** + * @method init + * @param {cc.Physics3DWorldDes} arg0 + * @return {bool} + */ +init : function ( +physics3dworlddes +) +{ + return false; +}, + +/** + * @method removePhysics3DConstraint + * @param {cc.Physics3DConstraint} arg0 + */ +removePhysics3DConstraint : function ( +physics3dconstraint +) +{ +}, + +/** + * @method isDebugDrawEnabled + * @return {bool} + */ +isDebugDrawEnabled : function ( +) +{ + return false; +}, + +/** + * @method removeAllPhysics3DConstraints + */ +removeAllPhysics3DConstraints : function ( +) +{ +}, + +/** + * @method rayCast + * @param {vec3_object} arg0 + * @param {vec3_object} arg1 + * @param {cc.Physics3DWorld::HitResult} arg2 + * @return {bool} + */ +rayCast : function ( +vec3, +vec3, +hitresult +) +{ + return false; +}, + +/** + * @method removeAllPhysics3DObjects + */ +removeAllPhysics3DObjects : function ( +) +{ +}, + +/** + * @method addPhysics3DObject + * @param {cc.Physics3DObject} arg0 + */ +addPhysics3DObject : function ( +physics3dobject +) +{ +}, + +/** + * @method setDebugDrawEnable + * @param {bool} arg0 + */ +setDebugDrawEnable : function ( +bool +) +{ +}, + +/** + * @method removePhysics3DObject + * @param {cc.Physics3DObject} arg0 + */ +removePhysics3DObject : function ( +physics3dobject +) +{ +}, + +/** + * @method getPhysicsObject + * @param {btCollisionObject} arg0 + * @return {cc.Physics3DObject} + */ +getPhysicsObject : function ( +btcollisionobject +) +{ + return cc.Physics3DObject; +}, + +/** + * @method addPhysics3DConstraint + * @param {cc.Physics3DConstraint} arg0 + * @param {bool} arg1 + */ +addPhysics3DConstraint : function ( +physics3dconstraint, +bool +) +{ +}, + +/** + * @method debugDraw + * @param {cc.Renderer} arg0 + */ +debugDraw : function ( +renderer +) +{ +}, + +/** + * @method sweepShape + * @param {cc.Physics3DShape} arg0 + * @param {mat4_object} arg1 + * @param {mat4_object} arg2 + * @param {cc.Physics3DWorld::HitResult} arg3 + * @return {bool} + */ +sweepShape : function ( +physics3dshape, +mat4, +mat4, +hitresult +) +{ + return false; +}, + +/** + * @method create + * @param {cc.Physics3DWorldDes} arg0 + * @return {cc.Physics3DWorld} + */ +create : function ( +physics3dworlddes +) +{ + return cc.Physics3DWorld; +}, + +/** + * @method Physics3DWorld + * @constructor + */ +Physics3DWorld : function ( +) +{ +}, + +}; + +/** + * @class Physics3DConstraint + */ +cc.Physics3DConstraint = { + +/** + * @method setEnabled + * @param {bool} arg0 + */ +setEnabled : function ( +bool +) +{ +}, + +/** + * @method setBreakingImpulse + * @param {float} arg0 + */ +setBreakingImpulse : function ( +float +) +{ +}, + +/** + * @method getUserData + * @return {void} + */ +getUserData : function ( +) +{ + return void; +}, + +/** + * @method getBreakingImpulse + * @return {float} + */ +getBreakingImpulse : function ( +) +{ + return 0; +}, + +/** + * @method getBodyA + * @return {cc.Physics3DRigidBody} + */ +getBodyA : function ( +) +{ + return cc.Physics3DRigidBody; +}, + +/** + * @method isEnabled + * @return {bool} + */ +isEnabled : function ( +) +{ + return false; +}, + +/** + * @method getOverrideNumSolverIterations + * @return {int} + */ +getOverrideNumSolverIterations : function ( +) +{ + return 0; +}, + +/** + * @method getBodyB + * @return {cc.Physics3DRigidBody} + */ +getBodyB : function ( +) +{ + return cc.Physics3DRigidBody; +}, + +/** + * @method setOverrideNumSolverIterations + * @param {int} arg0 + */ +setOverrideNumSolverIterations : function ( +int +) +{ +}, + +/** + * @method getConstraintType + * @return {cc.Physics3DConstraint::ConstraintType} + */ +getConstraintType : function ( +) +{ + return 0; +}, + +/** + * @method setUserData + * @param {void} arg0 + */ +setUserData : function ( +void +) +{ +}, + +/** + * @method getbtContraint + * @return {btTypedConstraint} + */ +getbtContraint : function ( +) +{ + return btTypedConstraint; +}, + +}; + +/** + * @class Physics3DPointToPointConstraint + */ +cc.Physics3DPointToPointConstraint = { + +/** + * @method getPivotPointInA + * @return {vec3_object} + */ +getPivotPointInA : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getPivotPointInB + * @return {vec3_object} + */ +getPivotPointInB : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method setPivotPointInA + * @param {vec3_object} arg0 + */ +setPivotPointInA : function ( +vec3 +) +{ +}, + +/** + * @method setPivotPointInB + * @param {vec3_object} arg0 + */ +setPivotPointInB : function ( +vec3 +) +{ +}, + +/** + * @method create +* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody +* @param {cc.Physics3DRigidBody|vec3_object} physics3drigidbody +* @param {vec3_object} vec3 +* @param {vec3_object} vec3 +* @return {cc.Physics3DPointToPointConstraint|cc.Physics3DPointToPointConstraint} +*/ +create : function( +physics3drigidbody, +physics3drigidbody, +vec3, +vec3 +) +{ + return cc.Physics3DPointToPointConstraint; +}, + +/** + * @method Physics3DPointToPointConstraint + * @constructor + */ +Physics3DPointToPointConstraint : function ( +) +{ +}, + +}; + +/** + * @class Physics3DHingeConstraint + */ +cc.Physics3DHingeConstraint = { + +/** + * @method getHingeAngle +* @param {mat4_object} mat4 +* @param {mat4_object} mat4 +* @return {float|float} +*/ +getHingeAngle : function( +mat4, +mat4 +) +{ + return 0; +}, + +/** + * @method getMotorTargetVelosity + * @return {float} + */ +getMotorTargetVelosity : function ( +) +{ + return 0; +}, + +/** + * @method getFrameOffsetA + * @return {mat4_object} + */ +getFrameOffsetA : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method getFrameOffsetB + * @return {mat4_object} + */ +getFrameOffsetB : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method setMaxMotorImpulse + * @param {float} arg0 + */ +setMaxMotorImpulse : function ( +float +) +{ +}, + +/** + * @method enableAngularMotor + * @param {bool} arg0 + * @param {float} arg1 + * @param {float} arg2 + */ +enableAngularMotor : function ( +bool, +float, +float +) +{ +}, + +/** + * @method getUpperLimit + * @return {float} + */ +getUpperLimit : function ( +) +{ + return 0; +}, + +/** + * @method getMaxMotorImpulse + * @return {float} + */ +getMaxMotorImpulse : function ( +) +{ + return 0; +}, + +/** + * @method getLowerLimit + * @return {float} + */ +getLowerLimit : function ( +) +{ + return 0; +}, + +/** + * @method setUseFrameOffset + * @param {bool} arg0 + */ +setUseFrameOffset : function ( +bool +) +{ +}, + +/** + * @method getEnableAngularMotor + * @return {bool} + */ +getEnableAngularMotor : function ( +) +{ + return false; +}, + +/** + * @method enableMotor + * @param {bool} arg0 + */ +enableMotor : function ( +bool +) +{ +}, + +/** + * @method getBFrame + * @return {mat4_object} + */ +getBFrame : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method setFrames + * @param {mat4_object} arg0 + * @param {mat4_object} arg1 + */ +setFrames : function ( +mat4, +mat4 +) +{ +}, + +/** + * @method getUseFrameOffset + * @return {bool} + */ +getUseFrameOffset : function ( +) +{ + return false; +}, + +/** + * @method setAngularOnly + * @param {bool} arg0 + */ +setAngularOnly : function ( +bool +) +{ +}, + +/** + * @method setLimit + * @param {float} arg0 + * @param {float} arg1 + * @param {float} arg2 + * @param {float} arg3 + * @param {float} arg4 + */ +setLimit : function ( +float, +float, +float, +float, +float +) +{ +}, + +/** + * @method setMotorTarget +* @param {float|cc.Quaternion} float +* @param {float|float} float +*/ +setMotorTarget : function( +quaternion, +float +) +{ +}, + +/** + * @method getAngularOnly + * @return {bool} + */ +getAngularOnly : function ( +) +{ + return false; +}, + +/** + * @method setAxis + * @param {vec3_object} arg0 + */ +setAxis : function ( +vec3 +) +{ +}, + +/** + * @method getAFrame + * @return {mat4_object} + */ +getAFrame : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method create +* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody|cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody +* @param {vec3_object|mat4_object|cc.Physics3DRigidBody|cc.Physics3DRigidBody} vec3 +* @param {vec3_object|bool|vec3_object|mat4_object} vec3 +* @param {bool|vec3_object|mat4_object} bool +* @param {vec3_object|bool} vec3 +* @param {vec3_object} vec3 +* @param {bool} bool +* @return {cc.Physics3DHingeConstraint|cc.Physics3DHingeConstraint|cc.Physics3DHingeConstraint|cc.Physics3DHingeConstraint} +*/ +create : function( +physics3drigidbody, +physics3drigidbody, +vec3, +vec3, +vec3, +vec3, +bool +) +{ + return cc.Physics3DHingeConstraint; +}, + +/** + * @method Physics3DHingeConstraint + * @constructor + */ +Physics3DHingeConstraint : function ( +) +{ +}, + +}; + +/** + * @class Physics3DSliderConstraint + */ +cc.Physics3DSliderConstraint = { + +/** + * @method setPoweredAngMotor + * @param {bool} arg0 + */ +setPoweredAngMotor : function ( +bool +) +{ +}, + +/** + * @method getDampingLimAng + * @return {float} + */ +getDampingLimAng : function ( +) +{ + return 0; +}, + +/** + * @method setRestitutionOrthoLin + * @param {float} arg0 + */ +setRestitutionOrthoLin : function ( +float +) +{ +}, + +/** + * @method setRestitutionDirLin + * @param {float} arg0 + */ +setRestitutionDirLin : function ( +float +) +{ +}, + +/** + * @method getLinearPos + * @return {float} + */ +getLinearPos : function ( +) +{ + return 0; +}, + +/** + * @method getFrameOffsetA + * @return {mat4_object} + */ +getFrameOffsetA : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method getFrameOffsetB + * @return {mat4_object} + */ +getFrameOffsetB : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method setPoweredLinMotor + * @param {bool} arg0 + */ +setPoweredLinMotor : function ( +bool +) +{ +}, + +/** + * @method getDampingDirAng + * @return {float} + */ +getDampingDirAng : function ( +) +{ + return 0; +}, + +/** + * @method getRestitutionLimLin + * @return {float} + */ +getRestitutionLimLin : function ( +) +{ + return 0; +}, + +/** + * @method getSoftnessOrthoAng + * @return {float} + */ +getSoftnessOrthoAng : function ( +) +{ + return 0; +}, + +/** + * @method setSoftnessOrthoLin + * @param {float} arg0 + */ +setSoftnessOrthoLin : function ( +float +) +{ +}, + +/** + * @method setSoftnessLimLin + * @param {float} arg0 + */ +setSoftnessLimLin : function ( +float +) +{ +}, + +/** + * @method getAngularPos + * @return {float} + */ +getAngularPos : function ( +) +{ + return 0; +}, + +/** + * @method setRestitutionLimAng + * @param {float} arg0 + */ +setRestitutionLimAng : function ( +float +) +{ +}, + +/** + * @method setUpperLinLimit + * @param {float} arg0 + */ +setUpperLinLimit : function ( +float +) +{ +}, + +/** + * @method setDampingDirLin + * @param {float} arg0 + */ +setDampingDirLin : function ( +float +) +{ +}, + +/** + * @method getUpperAngLimit + * @return {float} + */ +getUpperAngLimit : function ( +) +{ + return 0; +}, + +/** + * @method getDampingDirLin + * @return {float} + */ +getDampingDirLin : function ( +) +{ + return 0; +}, + +/** + * @method getSoftnessDirAng + * @return {float} + */ +getSoftnessDirAng : function ( +) +{ + return 0; +}, + +/** + * @method getPoweredAngMotor + * @return {bool} + */ +getPoweredAngMotor : function ( +) +{ + return false; +}, + +/** + * @method setLowerAngLimit + * @param {float} arg0 + */ +setLowerAngLimit : function ( +float +) +{ +}, + +/** + * @method setUpperAngLimit + * @param {float} arg0 + */ +setUpperAngLimit : function ( +float +) +{ +}, + +/** + * @method setTargetLinMotorVelocity + * @param {float} arg0 + */ +setTargetLinMotorVelocity : function ( +float +) +{ +}, + +/** + * @method setDampingLimAng + * @param {float} arg0 + */ +setDampingLimAng : function ( +float +) +{ +}, + +/** + * @method getRestitutionLimAng + * @return {float} + */ +getRestitutionLimAng : function ( +) +{ + return 0; +}, + +/** + * @method getUseFrameOffset + * @return {bool} + */ +getUseFrameOffset : function ( +) +{ + return false; +}, + +/** + * @method getSoftnessOrthoLin + * @return {float} + */ +getSoftnessOrthoLin : function ( +) +{ + return 0; +}, + +/** + * @method getDampingOrthoAng + * @return {float} + */ +getDampingOrthoAng : function ( +) +{ + return 0; +}, + +/** + * @method setUseFrameOffset + * @param {bool} arg0 + */ +setUseFrameOffset : function ( +bool +) +{ +}, + +/** + * @method setLowerLinLimit + * @param {float} arg0 + */ +setLowerLinLimit : function ( +float +) +{ +}, + +/** + * @method getRestitutionDirLin + * @return {float} + */ +getRestitutionDirLin : function ( +) +{ + return 0; +}, + +/** + * @method getTargetLinMotorVelocity + * @return {float} + */ +getTargetLinMotorVelocity : function ( +) +{ + return 0; +}, + +/** + * @method getLowerLinLimit + * @return {float} + */ +getLowerLinLimit : function ( +) +{ + return 0; +}, + +/** + * @method getSoftnessLimLin + * @return {float} + */ +getSoftnessLimLin : function ( +) +{ + return 0; +}, + +/** + * @method setDampingOrthoAng + * @param {float} arg0 + */ +setDampingOrthoAng : function ( +float +) +{ +}, + +/** + * @method setSoftnessDirAng + * @param {float} arg0 + */ +setSoftnessDirAng : function ( +float +) +{ +}, + +/** + * @method getPoweredLinMotor + * @return {bool} + */ +getPoweredLinMotor : function ( +) +{ + return false; +}, + +/** + * @method setRestitutionOrthoAng + * @param {float} arg0 + */ +setRestitutionOrthoAng : function ( +float +) +{ +}, + +/** + * @method setDampingDirAng + * @param {float} arg0 + */ +setDampingDirAng : function ( +float +) +{ +}, + +/** + * @method setFrames + * @param {mat4_object} arg0 + * @param {mat4_object} arg1 + */ +setFrames : function ( +mat4, +mat4 +) +{ +}, + +/** + * @method getRestitutionOrthoAng + * @return {float} + */ +getRestitutionOrthoAng : function ( +) +{ + return 0; +}, + +/** + * @method getMaxAngMotorForce + * @return {float} + */ +getMaxAngMotorForce : function ( +) +{ + return 0; +}, + +/** + * @method getDampingOrthoLin + * @return {float} + */ +getDampingOrthoLin : function ( +) +{ + return 0; +}, + +/** + * @method getUpperLinLimit + * @return {float} + */ +getUpperLinLimit : function ( +) +{ + return 0; +}, + +/** + * @method setMaxLinMotorForce + * @param {float} arg0 + */ +setMaxLinMotorForce : function ( +float +) +{ +}, + +/** + * @method getRestitutionOrthoLin + * @return {float} + */ +getRestitutionOrthoLin : function ( +) +{ + return 0; +}, + +/** + * @method setTargetAngMotorVelocity + * @param {float} arg0 + */ +setTargetAngMotorVelocity : function ( +float +) +{ +}, + +/** + * @method getSoftnessLimAng + * @return {float} + */ +getSoftnessLimAng : function ( +) +{ + return 0; +}, + +/** + * @method setRestitutionDirAng + * @param {float} arg0 + */ +setRestitutionDirAng : function ( +float +) +{ +}, + +/** + * @method getDampingLimLin + * @return {float} + */ +getDampingLimLin : function ( +) +{ + return 0; +}, + +/** + * @method getLowerAngLimit + * @return {float} + */ +getLowerAngLimit : function ( +) +{ + return 0; +}, + +/** + * @method getRestitutionDirAng + * @return {float} + */ +getRestitutionDirAng : function ( +) +{ + return 0; +}, + +/** + * @method getTargetAngMotorVelocity + * @return {float} + */ +getTargetAngMotorVelocity : function ( +) +{ + return 0; +}, + +/** + * @method setRestitutionLimLin + * @param {float} arg0 + */ +setRestitutionLimLin : function ( +float +) +{ +}, + +/** + * @method getMaxLinMotorForce + * @return {float} + */ +getMaxLinMotorForce : function ( +) +{ + return 0; +}, + +/** + * @method setDampingOrthoLin + * @param {float} arg0 + */ +setDampingOrthoLin : function ( +float +) +{ +}, + +/** + * @method setSoftnessOrthoAng + * @param {float} arg0 + */ +setSoftnessOrthoAng : function ( +float +) +{ +}, + +/** + * @method setDampingLimLin + * @param {float} arg0 + */ +setDampingLimLin : function ( +float +) +{ +}, + +/** + * @method setSoftnessDirLin + * @param {float} arg0 + */ +setSoftnessDirLin : function ( +float +) +{ +}, + +/** + * @method setMaxAngMotorForce + * @param {float} arg0 + */ +setMaxAngMotorForce : function ( +float +) +{ +}, + +/** + * @method getSoftnessDirLin + * @return {float} + */ +getSoftnessDirLin : function ( +) +{ + return 0; +}, + +/** + * @method setSoftnessLimAng + * @param {float} arg0 + */ +setSoftnessLimAng : function ( +float +) +{ +}, + +/** + * @method getUseLinearReferenceFrameA + * @return {bool} + */ +getUseLinearReferenceFrameA : function ( +) +{ + return false; +}, + +/** + * @method create + * @param {cc.Physics3DRigidBody} arg0 + * @param {cc.Physics3DRigidBody} arg1 + * @param {mat4_object} arg2 + * @param {mat4_object} arg3 + * @param {bool} arg4 + * @return {cc.Physics3DSliderConstraint} + */ +create : function ( +physics3drigidbody, +physics3drigidbody, +mat4, +mat4, +bool +) +{ + return cc.Physics3DSliderConstraint; +}, + +/** + * @method Physics3DSliderConstraint + * @constructor + */ +Physics3DSliderConstraint : function ( +) +{ +}, + +}; + +/** + * @class Physics3DConeTwistConstraint + */ +cc.Physics3DConeTwistConstraint = { + +/** + * @method getBFrame + * @return {mat4_object} + */ +getBFrame : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method setFixThresh + * @param {float} arg0 + */ +setFixThresh : function ( +float +) +{ +}, + +/** + * @method getFrameOffsetB + * @return {mat4_object} + */ +getFrameOffsetB : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method getFrameOffsetA + * @return {mat4_object} + */ +getFrameOffsetA : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method getFixThresh + * @return {float} + */ +getFixThresh : function ( +) +{ + return 0; +}, + +/** + * @method getSwingSpan2 + * @return {float} + */ +getSwingSpan2 : function ( +) +{ + return 0; +}, + +/** + * @method getSwingSpan1 + * @return {float} + */ +getSwingSpan1 : function ( +) +{ + return 0; +}, + +/** + * @method setMaxMotorImpulse + * @param {float} arg0 + */ +setMaxMotorImpulse : function ( +float +) +{ +}, + +/** + * @method setFrames + * @param {mat4_object} arg0 + * @param {mat4_object} arg1 + */ +setFrames : function ( +mat4, +mat4 +) +{ +}, + +/** + * @method getTwistAngle + * @return {float} + */ +getTwistAngle : function ( +) +{ + return 0; +}, + +/** + * @method GetPointForAngle + * @param {float} arg0 + * @param {float} arg1 + * @return {vec3_object} + */ +GetPointForAngle : function ( +float, +float +) +{ + return cc.Vec3; +}, + +/** + * @method setMaxMotorImpulseNormalized + * @param {float} arg0 + */ +setMaxMotorImpulseNormalized : function ( +float +) +{ +}, + +/** + * @method getTwistSpan + * @return {float} + */ +getTwistSpan : function ( +) +{ + return 0; +}, + +/** + * @method setDamping + * @param {float} arg0 + */ +setDamping : function ( +float +) +{ +}, + +/** + * @method setLimit + * @param {float} arg0 + * @param {float} arg1 + * @param {float} arg2 + * @param {float} arg3 + * @param {float} arg4 + * @param {float} arg5 + */ +setLimit : function ( +float, +float, +float, +float, +float, +float +) +{ +}, + +/** + * @method getAFrame + * @return {mat4_object} + */ +getAFrame : function ( +) +{ + return cc.Mat4; +}, + +/** + * @method enableMotor + * @param {bool} arg0 + */ +enableMotor : function ( +bool +) +{ +}, + +/** + * @method create +* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody +* @param {cc.Physics3DRigidBody|mat4_object} physics3drigidbody +* @param {mat4_object} mat4 +* @param {mat4_object} mat4 +* @return {cc.Physics3DConeTwistConstraint|cc.Physics3DConeTwistConstraint} +*/ +create : function( +physics3drigidbody, +physics3drigidbody, +mat4, +mat4 +) +{ + return cc.Physics3DConeTwistConstraint; +}, + +/** + * @method Physics3DConeTwistConstraint + * @constructor + */ +Physics3DConeTwistConstraint : function ( +) +{ +}, + +}; + +/** + * @class Physics3D6DofConstraint + */ +cc.Physics3D6DofConstraint = { + +/** + * @method setLinearLowerLimit + * @param {vec3_object} arg0 + */ +setLinearLowerLimit : function ( +vec3 +) +{ +}, + +/** + * @method getLinearLowerLimit + * @return {vec3_object} + */ +getLinearLowerLimit : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getAngularUpperLimit + * @return {vec3_object} + */ +getAngularUpperLimit : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method getUseFrameOffset + * @return {bool} + */ +getUseFrameOffset : function ( +) +{ + return false; +}, + +/** + * @method getLinearUpperLimit + * @return {vec3_object} + */ +getLinearUpperLimit : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method setAngularLowerLimit + * @param {vec3_object} arg0 + */ +setAngularLowerLimit : function ( +vec3 +) +{ +}, + +/** + * @method isLimited + * @param {int} arg0 + * @return {bool} + */ +isLimited : function ( +int +) +{ + return false; +}, + +/** + * @method setUseFrameOffset + * @param {bool} arg0 + */ +setUseFrameOffset : function ( +bool +) +{ +}, + +/** + * @method setLinearUpperLimit + * @param {vec3_object} arg0 + */ +setLinearUpperLimit : function ( +vec3 +) +{ +}, + +/** + * @method getAngularLowerLimit + * @return {vec3_object} + */ +getAngularLowerLimit : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method setAngularUpperLimit + * @param {vec3_object} arg0 + */ +setAngularUpperLimit : function ( +vec3 +) +{ +}, + +/** + * @method create +* @param {cc.Physics3DRigidBody|cc.Physics3DRigidBody} physics3drigidbody +* @param {mat4_object|cc.Physics3DRigidBody} mat4 +* @param {bool|mat4_object} bool +* @param {mat4_object} mat4 +* @param {bool} bool +* @return {cc.Physics3D6DofConstraint|cc.Physics3D6DofConstraint} +*/ +create : function( +physics3drigidbody, +physics3drigidbody, +mat4, +mat4, +bool +) +{ + return cc.Physics3D6DofConstraint; +}, + +/** + * @method Physics3D6DofConstraint + * @constructor + */ +Physics3D6DofConstraint : function ( +) +{ +}, + +}; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp index 5fb1448702..c66605a7a0 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -1,6 +1,7 @@ #include "jsb_cocos2dx_3d_auto.hpp" #include "cocos2d_specifics.hpp" #include "cocos2d.h" +#include "CCBundle3D.h" template static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) { @@ -4340,6 +4341,357 @@ void js_register_cocos2dx_3d_TextureCube(JSContext *cx, JS::HandleObject global) } } +JSClass *jsb_cocos2d_Bundle3D_class; +JSObject *jsb_cocos2d_Bundle3D_prototype; + +bool js_cocos2dx_3d_Bundle3D_load(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_load : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_load : Error processing arguments"); + bool ret = cobj->load(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_load : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_3d_Bundle3D_loadSkinData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_loadSkinData : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + cocos2d::SkinData* arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + #pragma warning NO CONVERSION TO NATIVE FOR SkinData* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadSkinData : Error processing arguments"); + bool ret = cobj->loadSkinData(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_loadSkinData : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_3d_Bundle3D_clear(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_clear : Invalid Native Object"); + if (argc == 0) { + cobj->clear(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_clear : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_3d_Bundle3D_loadMaterials(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_loadMaterials : Invalid Native Object"); + if (argc == 1) { + cocos2d::MaterialDatas arg0; + #pragma warning NO CONVERSION TO NATIVE FOR MaterialDatas + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadMaterials : Error processing arguments"); + bool ret = cobj->loadMaterials(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_loadMaterials : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_3d_Bundle3D_loadMeshDatas(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_loadMeshDatas : Invalid Native Object"); + if (argc == 1) { + cocos2d::MeshDatas arg0; + #pragma warning NO CONVERSION TO NATIVE FOR MeshDatas + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadMeshDatas : Error processing arguments"); + bool ret = cobj->loadMeshDatas(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_loadMeshDatas : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_3d_Bundle3D_loadNodes(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_loadNodes : Invalid Native Object"); + if (argc == 1) { + cocos2d::NodeDatas arg0; + #pragma warning NO CONVERSION TO NATIVE FOR NodeDatas + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadNodes : Error processing arguments"); + bool ret = cobj->loadNodes(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_loadNodes : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_3d_Bundle3D_loadAnimationData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Bundle3D* cobj = (cocos2d::Bundle3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Bundle3D_loadAnimationData : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + cocos2d::Animation3DData* arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + #pragma warning NO CONVERSION TO NATIVE FOR Animation3DData* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadAnimationData : Error processing arguments"); + bool ret = cobj->loadAnimationData(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_loadAnimationData : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_3d_Bundle3D_createBundle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (argc == 0) { + cocos2d::Bundle3D* ret = cocos2d::Bundle3D::createBundle(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Bundle3D*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_createBundle : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_3d_Bundle3D_destroyBundle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::Bundle3D* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Bundle3D*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_destroyBundle : Error processing arguments"); + cocos2d::Bundle3D::destroyBundle(arg0); + args.rval().setUndefined(); + return true; + } + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_destroyBundle : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_3d_Bundle3D_loadObj(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 4) { + cocos2d::MeshDatas arg0; + cocos2d::MaterialDatas arg1; + cocos2d::NodeDatas arg2; + std::string arg3; + #pragma warning NO CONVERSION TO NATIVE FOR MeshDatas + ok = false; + #pragma warning NO CONVERSION TO NATIVE FOR MaterialDatas + ok = false; + #pragma warning NO CONVERSION TO NATIVE FOR NodeDatas + ok = false; + ok &= jsval_to_std_string(cx, args.get(3), &arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadObj : Error processing arguments"); + bool ret = cocos2d::Bundle3D::loadObj(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + if (argc == 5) { + cocos2d::MeshDatas arg0; + cocos2d::MaterialDatas arg1; + cocos2d::NodeDatas arg2; + std::string arg3; + const char* arg4; + #pragma warning NO CONVERSION TO NATIVE FOR MeshDatas + ok = false; + #pragma warning NO CONVERSION TO NATIVE FOR MaterialDatas + ok = false; + #pragma warning NO CONVERSION TO NATIVE FOR NodeDatas + ok = false; + ok &= jsval_to_std_string(cx, args.get(3), &arg3); + std::string arg4_tmp; ok &= jsval_to_std_string(cx, args.get(4), &arg4_tmp); arg4 = arg4_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadObj : Error processing arguments"); + bool ret = cocos2d::Bundle3D::loadObj(arg0, arg1, arg2, arg3, arg4); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_3d_Bundle3D_loadObj : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_3d_Bundle3D_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Bundle3D* cobj = new (std::nothrow) cocos2d::Bundle3D(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Bundle3D"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + + +void js_cocos2d_Bundle3D_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Bundle3D)", obj); +} + +void js_register_cocos2dx_3d_Bundle3D(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Bundle3D_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Bundle3D_class->name = "Bundle3D"; + jsb_cocos2d_Bundle3D_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Bundle3D_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Bundle3D_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Bundle3D_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Bundle3D_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Bundle3D_class->resolve = JS_ResolveStub; + jsb_cocos2d_Bundle3D_class->convert = JS_ConvertStub; + jsb_cocos2d_Bundle3D_class->finalize = js_cocos2d_Bundle3D_finalize; + jsb_cocos2d_Bundle3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("load", js_cocos2dx_3d_Bundle3D_load, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("loadSkinData", js_cocos2dx_3d_Bundle3D_loadSkinData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("clear", js_cocos2dx_3d_Bundle3D_clear, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("loadMaterials", js_cocos2dx_3d_Bundle3D_loadMaterials, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("loadMeshDatas", js_cocos2dx_3d_Bundle3D_loadMeshDatas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("loadNodes", js_cocos2dx_3d_Bundle3D_loadNodes, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("loadAnimationData", js_cocos2dx_3d_Bundle3D_loadAnimationData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("createBundle", js_cocos2dx_3d_Bundle3D_createBundle, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("destroyBundle", js_cocos2dx_3d_Bundle3D_destroyBundle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("loadObj", js_cocos2dx_3d_Bundle3D_loadObj, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Bundle3D_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Bundle3D_class, + js_cocos2dx_3d_Bundle3D_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Bundle3D", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Bundle3D_class; + p->proto = jsb_cocos2d_Bundle3D_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj) { // Get the ns JS::RootedObject ns(cx); @@ -4352,6 +4704,7 @@ void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_3d_Sprite3DCache(cx, ns); js_register_cocos2dx_3d_Terrain(cx, ns); js_register_cocos2dx_3d_Skybox(cx, ns); + js_register_cocos2dx_3d_Bundle3D(cx, ns); js_register_cocos2dx_3d_Skeleton3D(cx, ns); js_register_cocos2dx_3d_BillBoard(cx, ns); js_register_cocos2dx_3d_Animation3D(cx, ns); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.hpp index 7ccbe87356..968737b2ac 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.hpp @@ -222,5 +222,24 @@ void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_3d_TextureCube_reloadTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_3d_TextureCube_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_3d_TextureCube_TextureCube(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Bundle3D_class; +extern JSObject *jsb_cocos2d_Bundle3D_prototype; + +bool js_cocos2dx_3d_Bundle3D_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_3d_Bundle3D_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_3d_Bundle3D(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_3d_Bundle3D_load(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_loadSkinData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_clear(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_loadMaterials(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_loadMeshDatas(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_loadNodes(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_loadAnimationData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_createBundle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_destroyBundle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_loadObj(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_3d_Bundle3D_Bundle3D(JSContext *cx, uint32_t argc, jsval *vp); #endif diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index c6ca7f4961..242fc87946 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -15876,6 +15876,990 @@ void js_register_cocos2dx_Configuration(JSContext *cx, JS::HandleObject global) } } +JSClass *jsb_cocos2d_Properties_class; +JSObject *jsb_cocos2d_Properties_prototype; + +bool js_cocos2dx_Properties_getVariable(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getVariable : Invalid Native Object"); + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getVariable : Error processing arguments"); + const char* ret = cobj->getVariable(arg0); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + if (argc == 2) { + const char* arg0; + const char* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getVariable : Error processing arguments"); + const char* ret = cobj->getVariable(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getVariable : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Properties_getString(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getString : Invalid Native Object"); + if (argc == 0) { + const char* ret = cobj->getString(); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getString : Error processing arguments"); + const char* ret = cobj->getString(arg0); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + if (argc == 2) { + const char* arg0; + const char* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getString : Error processing arguments"); + const char* ret = cobj->getString(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getString : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getLong(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getLong : Invalid Native Object"); + if (argc == 0) { + long ret = cobj->getLong(); + jsval jsret = JSVAL_NULL; + jsret = long_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getLong : Error processing arguments"); + long ret = cobj->getLong(arg0); + jsval jsret = JSVAL_NULL; + jsret = long_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getLong : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getNamespace(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Properties* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getNamespace : Invalid Native Object"); + do { + if (argc == 0) { + const char* ret = cobj->getNamespace(); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + cocos2d::Properties* ret = cobj->getNamespace(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 2) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + bool arg1; + arg1 = JS::ToBoolean(args.get(1)); + cocos2d::Properties* ret = cobj->getNamespace(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 3) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + bool arg1; + arg1 = JS::ToBoolean(args.get(1)); + bool arg2; + arg2 = JS::ToBoolean(args.get(2)); + cocos2d::Properties* ret = cobj->getNamespace(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_Properties_getNamespace : wrong number of arguments"); + return false; +} +bool js_cocos2dx_Properties_getPath(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getPath : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + std::string* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + #pragma warning NO CONVERSION TO NATIVE FOR std::string* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getPath : Error processing arguments"); + bool ret = cobj->getPath(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getPath : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_getMat4(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getMat4 : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + cocos2d::Mat4* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Mat4*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getMat4 : Error processing arguments"); + bool ret = cobj->getMat4(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getMat4 : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_exists(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_exists : Invalid Native Object"); + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_exists : Error processing arguments"); + bool ret = cobj->exists(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_exists : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Properties_setString(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_setString : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + const char* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_setString : Error processing arguments"); + bool ret = cobj->setString(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_setString : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_getId(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getId : Invalid Native Object"); + if (argc == 0) { + const char* ret = cobj->getId(); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getId : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_rewind(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_rewind : Invalid Native Object"); + if (argc == 0) { + cobj->rewind(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_rewind : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_setVariable(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_setVariable : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + const char* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_setVariable : Error processing arguments"); + cobj->setVariable(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_setVariable : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_getBool(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getBool : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getBool(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getBool : Error processing arguments"); + bool ret = cobj->getBool(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + if (argc == 2) { + const char* arg0; + bool arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + arg1 = JS::ToBoolean(args.get(1)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getBool : Error processing arguments"); + bool ret = cobj->getBool(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getBool : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getColor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Properties* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getColor : Invalid Native Object"); + do { + if (argc == 2) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + cocos2d::Vec4* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec4*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + bool ret = cobj->getColor(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 2) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + cocos2d::Vec3* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + bool ret = cobj->getColor(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_Properties_getColor : wrong number of arguments"); + return false; +} +bool js_cocos2dx_Properties_getType(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getType : Invalid Native Object"); + if (argc == 0) { + int ret = (int)cobj->getType(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getType : Error processing arguments"); + int ret = (int)cobj->getType(arg0); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getType : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getNextNamespace(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getNextNamespace : Invalid Native Object"); + if (argc == 0) { + cocos2d::Properties* ret = cobj->getNextNamespace(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getNextNamespace : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getInt(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getInt : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getInt(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getInt : Error processing arguments"); + int ret = cobj->getInt(arg0); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getInt : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getVec3(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getVec3 : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + cocos2d::Vec3* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getVec3 : Error processing arguments"); + bool ret = cobj->getVec3(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getVec3 : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_getVec2(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getVec2 : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + cocos2d::Vec2* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec2*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getVec2 : Error processing arguments"); + bool ret = cobj->getVec2(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getVec2 : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_getVec4(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getVec4 : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + cocos2d::Vec4* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec4*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getVec4 : Error processing arguments"); + bool ret = cobj->getVec4(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getVec4 : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_getNextProperty(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getNextProperty : Invalid Native Object"); + if (argc == 0) { + const char* ret = cobj->getNextProperty(); + jsval jsret = JSVAL_NULL; + jsret = c_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getNextProperty : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getFloat(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getFloat : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getFloat(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + if (argc == 1) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getFloat : Error processing arguments"); + double ret = cobj->getFloat(arg0); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getFloat : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Properties_getQuaternionFromAxisAngle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Properties* cobj = (cocos2d::Properties *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Properties_getQuaternionFromAxisAngle : Invalid Native Object"); + if (argc == 2) { + const char* arg0; + cocos2d::Quaternion* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Quaternion*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_getQuaternionFromAxisAngle : Error processing arguments"); + bool ret = cobj->getQuaternionFromAxisAngle(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Properties_getQuaternionFromAxisAngle : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_Properties_parseColor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + do { + if (argc == 2) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + cocos2d::Vec4* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec4*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + bool ret = cocos2d::Properties::parseColor(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 2) { + const char* arg0; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + if (!ok) { ok = true; break; } + cocos2d::Vec3* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + bool ret = cocos2d::Properties::parseColor(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while (0); + JS_ReportError(cx, "js_cocos2dx_Properties_parseColor : wrong number of arguments"); + return false; +} +bool js_cocos2dx_Properties_parseVec3(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + const char* arg0; + cocos2d::Vec3* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec3 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec3(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Properties_parseVec3 : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Properties_parseAxisAngle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + const char* arg0; + cocos2d::Quaternion* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Quaternion*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseAxisAngle : Error processing arguments"); + bool ret = cocos2d::Properties::parseAxisAngle(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Properties_parseAxisAngle : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Properties_parseVec2(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + const char* arg0; + cocos2d::Vec2* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec2*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec2 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec2(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Properties_parseVec2 : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Properties_createNonRefCounted(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_createNonRefCounted : Error processing arguments"); + cocos2d::Properties* ret = cocos2d::Properties::createNonRefCounted(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Properties_createNonRefCounted : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Properties_parseVec4(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + const char* arg0; + cocos2d::Vec4* arg1; + std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Vec4*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec4 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec4(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Properties_parseVec4 : wrong number of arguments"); + return false; +} + + + +void js_cocos2d_Properties_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Properties)", obj); +} + +void js_register_cocos2dx_Properties(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Properties_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Properties_class->name = "Properties"; + jsb_cocos2d_Properties_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Properties_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Properties_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Properties_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Properties_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Properties_class->resolve = JS_ResolveStub; + jsb_cocos2d_Properties_class->convert = JS_ConvertStub; + jsb_cocos2d_Properties_class->finalize = js_cocos2d_Properties_finalize; + jsb_cocos2d_Properties_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getVariable", js_cocos2dx_Properties_getVariable, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getString", js_cocos2dx_Properties_getString, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLong", js_cocos2dx_Properties_getLong, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getNamespace", js_cocos2dx_Properties_getNamespace, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPath", js_cocos2dx_Properties_getPath, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMat4", js_cocos2dx_Properties_getMat4, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("exists", js_cocos2dx_Properties_exists, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setString", js_cocos2dx_Properties_setString, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getId", js_cocos2dx_Properties_getId, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("rewind", js_cocos2dx_Properties_rewind, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setVariable", js_cocos2dx_Properties_setVariable, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBool", js_cocos2dx_Properties_getBool, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getColor", js_cocos2dx_Properties_getColor, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getType", js_cocos2dx_Properties_getType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getNextNamespace", js_cocos2dx_Properties_getNextNamespace, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getInt", js_cocos2dx_Properties_getInt, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVec3", js_cocos2dx_Properties_getVec3, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVec2", js_cocos2dx_Properties_getVec2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVec4", js_cocos2dx_Properties_getVec4, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getNextProperty", js_cocos2dx_Properties_getNextProperty, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFloat", js_cocos2dx_Properties_getFloat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getQuaternionFromAxisAngle", js_cocos2dx_Properties_getQuaternionFromAxisAngle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("parseColor", js_cocos2dx_Properties_parseColor, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("parseVec3", js_cocos2dx_Properties_parseVec3, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("parseAxisAngle", js_cocos2dx_Properties_parseAxisAngle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("parseVec2", js_cocos2dx_Properties_parseVec2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createNonRefCounted", js_cocos2dx_Properties_createNonRefCounted, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("parseVec4", js_cocos2dx_Properties_parseVec4, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Properties_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Properties_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Properties", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Properties_class; + p->proto = jsb_cocos2d_Properties_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + JSClass *jsb_cocos2d_FileUtils_class; JSObject *jsb_cocos2d_FileUtils_prototype; @@ -56444,6 +57428,34 @@ bool js_cocos2dx_Camera_project(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Camera_project : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_Camera_initOrthographic(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Camera* cobj = (cocos2d::Camera *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Camera_initOrthographic : Invalid Native Object"); + if (argc == 4) { + double arg0; + double arg1; + double arg2; + double arg3; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_initOrthographic : Error processing arguments"); + bool ret = cobj->initOrthographic(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Camera_initOrthographic : wrong number of arguments: %d, was expecting %d", argc, 4); + return false; +} bool js_cocos2dx_Camera_getDepthInView(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -56516,32 +57528,24 @@ bool js_cocos2dx_Camera_setCameraFlag(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Camera_setCameraFlag : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_Camera_initOrthographic(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_Camera_clearBackground(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::Camera* cobj = (cocos2d::Camera *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Camera_initOrthographic : Invalid Native Object"); - if (argc == 4) { + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Camera_clearBackground : Invalid Native Object"); + if (argc == 1) { double arg0; - double arg1; - double arg2; - double arg3; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_initOrthographic : Error processing arguments"); - bool ret = cobj->initOrthographic(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_clearBackground : Error processing arguments"); + cobj->clearBackground(arg0); + args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_Camera_initOrthographic : wrong number of arguments: %d, was expecting %d", argc, 4); + JS_ReportError(cx, "js_cocos2dx_Camera_clearBackground : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_Camera_setAdditionalProjection(JSContext *cx, uint32_t argc, jsval *vp) @@ -56791,10 +57795,11 @@ void js_register_cocos2dx_Camera(JSContext *cx, JS::HandleObject global) { JS_FN("getType", js_cocos2dx_Camera_getType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("initDefault", js_cocos2dx_Camera_initDefault, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("project", js_cocos2dx_Camera_project, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("initOrthographic", js_cocos2dx_Camera_initOrthographic, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getDepthInView", js_cocos2dx_Camera_getDepthInView, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("lookAt", js_cocos2dx_Camera_lookAt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setCameraFlag", js_cocos2dx_Camera_setCameraFlag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initOrthographic", js_cocos2dx_Camera_initOrthographic, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("clearBackground", js_cocos2dx_Camera_clearBackground, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAdditionalProjection", js_cocos2dx_Camera_setAdditionalProjection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getDepth", js_cocos2dx_Camera_getDepth, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setDepth", js_cocos2dx_Camera_setDepth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -59802,6 +60807,1273 @@ void js_register_cocos2dx_GLProgramCache(JSContext *cx, JS::HandleObject global) } } +JSClass *jsb_cocos2d_RenderState_class; +JSObject *jsb_cocos2d_RenderState_prototype; + +bool js_cocos2dx_RenderState_setTexture(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_setTexture : Invalid Native Object"); + if (argc == 1) { + cocos2d::Texture2D* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderState_setTexture : Error processing arguments"); + cobj->setTexture(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_setTexture : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_RenderState_getTopmost(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_getTopmost : Invalid Native Object"); + if (argc == 1) { + cocos2d::RenderState* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::RenderState*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderState_getTopmost : Error processing arguments"); + cocos2d::RenderState* ret = cobj->getTopmost(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_getTopmost : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_RenderState_getTexture(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_getTexture : Invalid Native Object"); + if (argc == 0) { + cocos2d::Texture2D* ret = cobj->getTexture(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_getTexture : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_RenderState_bind(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_bind : Invalid Native Object"); + if (argc == 1) { + cocos2d::Pass* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Pass*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderState_bind : Error processing arguments"); + cobj->bind(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_bind : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_RenderState_getName(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_getName : Invalid Native Object"); + if (argc == 0) { + std::string ret = cobj->getName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_getName : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_RenderState_getStateBlock(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_getStateBlock : Invalid Native Object"); + if (argc == 0) { + cocos2d::RenderState::StateBlock* ret = cobj->getStateBlock(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderState::StateBlock*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_getStateBlock : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_RenderState_getTextures(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_getTextures : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Vector& ret = cobj->getTextures(); + jsval jsret = JSVAL_NULL; + jsret = ccvector_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_RenderState_getTextures : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_RenderState_initialize(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (argc == 0) { + cocos2d::RenderState::initialize(); + args.rval().setUndefined(); + return true; + } + JS_ReportError(cx, "js_cocos2dx_RenderState_initialize : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_RenderState_finalize(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (argc == 0) { + cocos2d::RenderState::finalize(); + args.rval().setUndefined(); + return true; + } + JS_ReportError(cx, "js_cocos2dx_RenderState_finalize : wrong number of arguments"); + return false; +} + + + +void js_cocos2d_RenderState_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (RenderState)", obj); +} + +void js_register_cocos2dx_RenderState(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_RenderState_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_RenderState_class->name = "RenderState"; + jsb_cocos2d_RenderState_class->addProperty = JS_PropertyStub; + jsb_cocos2d_RenderState_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_RenderState_class->getProperty = JS_PropertyStub; + jsb_cocos2d_RenderState_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_RenderState_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_RenderState_class->resolve = JS_ResolveStub; + jsb_cocos2d_RenderState_class->convert = JS_ConvertStub; + jsb_cocos2d_RenderState_class->finalize = js_cocos2d_RenderState_finalize; + jsb_cocos2d_RenderState_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("setTexture", js_cocos2dx_RenderState_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTopmost", js_cocos2dx_RenderState_getTopmost, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTexture", js_cocos2dx_RenderState_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("bind", js_cocos2dx_RenderState_bind, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getName", js_cocos2dx_RenderState_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getStateBlock", js_cocos2dx_RenderState_getStateBlock, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTextures", js_cocos2dx_RenderState_getTextures, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("initialize", js_cocos2dx_RenderState_initialize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("finalize", js_cocos2dx_RenderState_finalize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_RenderState_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_RenderState_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "RenderState", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_RenderState_class; + p->proto = jsb_cocos2d_RenderState_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Pass_class; +JSObject *jsb_cocos2d_Pass_prototype; + +bool js_cocos2dx_Pass_unbind(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Pass* cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_unbind : Invalid Native Object"); + if (argc == 0) { + cobj->unbind(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Pass_unbind : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Pass_bind(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Pass* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_bind : Invalid Native Object"); + do { + if (argc == 2) { + cocos2d::Mat4 arg0; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + bool arg1; + arg1 = JS::ToBoolean(args.get(1)); + cobj->bind(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 1) { + cocos2d::Mat4 arg0; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cobj->bind(arg0); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_Pass_bind : wrong number of arguments"); + return false; +} +bool js_cocos2dx_Pass_clone(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Pass* cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_clone : Invalid Native Object"); + if (argc == 0) { + cocos2d::Pass* ret = cobj->clone(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Pass_clone : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Pass_getGLProgramState(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Pass* cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_getGLProgramState : Invalid Native Object"); + if (argc == 0) { + cocos2d::GLProgramState* ret = cobj->getGLProgramState(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Pass_getGLProgramState : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Pass_getVertexAttributeBinding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Pass* cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_getVertexAttributeBinding : Invalid Native Object"); + if (argc == 0) { + cocos2d::VertexAttribBinding* ret = cobj->getVertexAttributeBinding(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::VertexAttribBinding*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Pass_getVertexAttributeBinding : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Pass_getHash(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Pass* cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_getHash : Invalid Native Object"); + if (argc == 0) { + unsigned int ret = cobj->getHash(); + jsval jsret = JSVAL_NULL; + jsret = uint32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Pass_getHash : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Pass_setVertexAttribBinding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Pass* cobj = (cocos2d::Pass *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Pass_setVertexAttribBinding : Invalid Native Object"); + if (argc == 1) { + cocos2d::VertexAttribBinding* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::VertexAttribBinding*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_setVertexAttribBinding : Error processing arguments"); + cobj->setVertexAttribBinding(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Pass_setVertexAttribBinding : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Pass_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::Technique* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Technique*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_create : Error processing arguments"); + cocos2d::Pass* ret = cocos2d::Pass::create(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Pass_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Pass_createWithGLProgramState(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + cocos2d::Technique* arg0; + cocos2d::GLProgramState* arg1; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Technique*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::GLProgramState*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_createWithGLProgramState : Error processing arguments"); + cocos2d::Pass* ret = cocos2d::Pass::createWithGLProgramState(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Pass_createWithGLProgramState : wrong number of arguments"); + return false; +} + + +extern JSObject *jsb_cocos2d_RenderState_prototype; + +void js_cocos2d_Pass_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Pass)", obj); +} + +void js_register_cocos2dx_Pass(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Pass_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Pass_class->name = "Pass"; + jsb_cocos2d_Pass_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Pass_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Pass_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Pass_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Pass_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Pass_class->resolve = JS_ResolveStub; + jsb_cocos2d_Pass_class->convert = JS_ConvertStub; + jsb_cocos2d_Pass_class->finalize = js_cocos2d_Pass_finalize; + jsb_cocos2d_Pass_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("unbind", js_cocos2dx_Pass_unbind, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("bind", js_cocos2dx_Pass_bind, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("clone", js_cocos2dx_Pass_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getGLProgramState", js_cocos2dx_Pass_getGLProgramState, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVertexAttributeBinding", js_cocos2dx_Pass_getVertexAttributeBinding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getHash", js_cocos2dx_Pass_getHash, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setVertexAttribBinding", js_cocos2dx_Pass_setVertexAttribBinding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_Pass_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createWithGLProgramState", js_cocos2dx_Pass_createWithGLProgramState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Pass_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_RenderState_prototype), + jsb_cocos2d_Pass_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Pass", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Pass_class; + p->proto = jsb_cocos2d_Pass_prototype; + p->parentProto = jsb_cocos2d_RenderState_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Technique_class; +JSObject *jsb_cocos2d_Technique_prototype; + +bool js_cocos2dx_Technique_getPassCount(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Technique* cobj = (cocos2d::Technique *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Technique_getPassCount : Invalid Native Object"); + if (argc == 0) { + ssize_t ret = cobj->getPassCount(); + jsval jsret = JSVAL_NULL; + jsret = ssize_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Technique_getPassCount : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Technique_clone(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Technique* cobj = (cocos2d::Technique *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Technique_clone : Invalid Native Object"); + if (argc == 0) { + cocos2d::Technique* ret = cobj->clone(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Technique_clone : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Technique_addPass(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Technique* cobj = (cocos2d::Technique *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Technique_addPass : Invalid Native Object"); + if (argc == 1) { + cocos2d::Pass* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Pass*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_addPass : Error processing arguments"); + cobj->addPass(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Technique_addPass : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Technique_getPasses(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Technique* cobj = (cocos2d::Technique *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Technique_getPasses : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Vector& ret = cobj->getPasses(); + jsval jsret = JSVAL_NULL; + jsret = ccvector_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Technique_getPasses : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Technique_getName(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Technique* cobj = (cocos2d::Technique *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Technique_getName : Invalid Native Object"); + if (argc == 0) { + std::string ret = cobj->getName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Technique_getName : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Technique_getPassByIndex(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Technique* cobj = (cocos2d::Technique *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Technique_getPassByIndex : Invalid Native Object"); + if (argc == 1) { + ssize_t arg0; + ok &= jsval_to_ssize(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_getPassByIndex : Error processing arguments"); + cocos2d::Pass* ret = cobj->getPassByIndex(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Technique_getPassByIndex : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Technique_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::Material* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Material*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_create : Error processing arguments"); + cocos2d::Technique* ret = cocos2d::Technique::create(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Technique_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Technique_createWithGLProgramState(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + cocos2d::Material* arg0; + cocos2d::GLProgramState* arg1; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Material*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::GLProgramState*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_createWithGLProgramState : Error processing arguments"); + cocos2d::Technique* ret = cocos2d::Technique::createWithGLProgramState(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Technique_createWithGLProgramState : wrong number of arguments"); + return false; +} + + +extern JSObject *jsb_cocos2d_RenderState_prototype; + +void js_cocos2d_Technique_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Technique)", obj); +} + +void js_register_cocos2dx_Technique(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Technique_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Technique_class->name = "Technique"; + jsb_cocos2d_Technique_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Technique_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Technique_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Technique_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Technique_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Technique_class->resolve = JS_ResolveStub; + jsb_cocos2d_Technique_class->convert = JS_ConvertStub; + jsb_cocos2d_Technique_class->finalize = js_cocos2d_Technique_finalize; + jsb_cocos2d_Technique_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getPassCount", js_cocos2dx_Technique_getPassCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("clone", js_cocos2dx_Technique_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("addPass", js_cocos2dx_Technique_addPass, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPasses", js_cocos2dx_Technique_getPasses, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getName", js_cocos2dx_Technique_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPassByIndex", js_cocos2dx_Technique_getPassByIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_Technique_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createWithGLProgramState", js_cocos2dx_Technique_createWithGLProgramState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Technique_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_RenderState_prototype), + jsb_cocos2d_Technique_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Technique", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Technique_class; + p->proto = jsb_cocos2d_Technique_prototype; + p->parentProto = jsb_cocos2d_RenderState_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Material_class; +JSObject *jsb_cocos2d_Material_prototype; + +bool js_cocos2dx_Material_clone(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_clone : Invalid Native Object"); + if (argc == 0) { + cocos2d::Material* ret = cobj->clone(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_clone : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Material_getTechniqueCount(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_getTechniqueCount : Invalid Native Object"); + if (argc == 0) { + ssize_t ret = cobj->getTechniqueCount(); + jsval jsret = JSVAL_NULL; + jsret = ssize_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_getTechniqueCount : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Material_setName(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_setName : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_setName : Error processing arguments"); + cobj->setName(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_setName : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Material_getTechniqueByIndex(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_getTechniqueByIndex : Invalid Native Object"); + if (argc == 1) { + ssize_t arg0; + ok &= jsval_to_ssize(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_getTechniqueByIndex : Error processing arguments"); + cocos2d::Technique* ret = cobj->getTechniqueByIndex(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_getTechniqueByIndex : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Material_getName(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_getName : Invalid Native Object"); + if (argc == 0) { + std::string ret = cobj->getName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_getName : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Material_getTechniques(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_getTechniques : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Vector& ret = cobj->getTechniques(); + jsval jsret = JSVAL_NULL; + jsret = ccvector_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_getTechniques : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Material_setTechnique(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_setTechnique : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_setTechnique : Error processing arguments"); + cobj->setTechnique(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_setTechnique : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Material_getTechniqueByName(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_getTechniqueByName : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_getTechniqueByName : Error processing arguments"); + cocos2d::Technique* ret = cobj->getTechniqueByName(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_getTechniqueByName : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Material_addTechnique(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_addTechnique : Invalid Native Object"); + if (argc == 1) { + cocos2d::Technique* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Technique*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_addTechnique : Error processing arguments"); + cobj->addTechnique(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_addTechnique : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Material_getTechnique(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Material* cobj = (cocos2d::Material *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Material_getTechnique : Invalid Native Object"); + if (argc == 0) { + cocos2d::Technique* ret = cobj->getTechnique(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Material_getTechnique : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Material_createWithFilename(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithFilename : Error processing arguments"); + cocos2d::Material* ret = cocos2d::Material::createWithFilename(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Material_createWithFilename : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Material_createWithGLStateProgram(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::GLProgramState* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::GLProgramState*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithGLStateProgram : Error processing arguments"); + cocos2d::Material* ret = cocos2d::Material::createWithGLStateProgram(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Material_createWithGLStateProgram : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Material_createWithProperties(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::Properties* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Properties*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithProperties : Error processing arguments"); + cocos2d::Material* ret = cocos2d::Material::createWithProperties(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Material_createWithProperties : wrong number of arguments"); + return false; +} + + +extern JSObject *jsb_cocos2d_RenderState_prototype; + +void js_cocos2d_Material_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Material)", obj); +} + +void js_register_cocos2dx_Material(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Material_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Material_class->name = "Material"; + jsb_cocos2d_Material_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Material_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Material_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Material_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Material_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Material_class->resolve = JS_ResolveStub; + jsb_cocos2d_Material_class->convert = JS_ConvertStub; + jsb_cocos2d_Material_class->finalize = js_cocos2d_Material_finalize; + jsb_cocos2d_Material_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("clone", js_cocos2dx_Material_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTechniqueCount", js_cocos2dx_Material_getTechniqueCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setName", js_cocos2dx_Material_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTechniqueByIndex", js_cocos2dx_Material_getTechniqueByIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getName", js_cocos2dx_Material_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTechniques", js_cocos2dx_Material_getTechniques, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setTechnique", js_cocos2dx_Material_setTechnique, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTechniqueByName", js_cocos2dx_Material_getTechniqueByName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("addTechnique", js_cocos2dx_Material_addTechnique, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTechnique", js_cocos2dx_Material_getTechnique, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("createWithFilename", js_cocos2dx_Material_createWithFilename, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createWithGLStateProgram", js_cocos2dx_Material_createWithGLStateProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createWithProperties", js_cocos2dx_Material_createWithProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Material_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_RenderState_prototype), + jsb_cocos2d_Material_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Material", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Material_class; + p->proto = jsb_cocos2d_Material_prototype; + p->parentProto = jsb_cocos2d_RenderState_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + JSClass *jsb_cocos2d_TextureCache_class; JSObject *jsb_cocos2d_TextureCache_prototype; @@ -60078,6 +62350,35 @@ bool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_TextureCache_getTextureForKey : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_TextureCache_getTextureFilePath(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TextureCache_getTextureFilePath : Invalid Native Object"); + if (argc == 1) { + cocos2d::Texture2D* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TextureCache_getTextureFilePath : Error processing arguments"); + const std::string ret = cobj->getTextureFilePath(arg0); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_TextureCache_getTextureFilePath : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_TextureCache_removeUnusedTextures(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -60201,6 +62502,7 @@ void js_register_cocos2dx_TextureCache(JSContext *cx, JS::HandleObject global) { JS_FN("addImage", js_cocos2dx_TextureCache_addImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("unbindImageAsync", js_cocos2dx_TextureCache_unbindImageAsync, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTextureForKey", js_cocos2dx_TextureCache_getTextureForKey, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTextureFilePath", js_cocos2dx_TextureCache_getTextureFilePath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeUnusedTextures", js_cocos2dx_TextureCache_removeUnusedTextures, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeTexture", js_cocos2dx_TextureCache_removeTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("waitForQuit", js_cocos2dx_TextureCache_waitForQuit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -66274,6 +68576,8 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { JS::RootedObject ns(cx); get_or_create_js_obj(cx, obj, "cc", &ns); + js_register_cocos2dx_RenderState(cx, ns); + js_register_cocos2dx_Material(cx, ns); js_register_cocos2dx_Action(cx, ns); js_register_cocos2dx_FiniteTimeAction(cx, ns); js_register_cocos2dx_ActionInstant(cx, ns); @@ -66323,7 +68627,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_FadeOutUpTiles(cx, ns); js_register_cocos2dx_FadeOutDownTiles(cx, ns); js_register_cocos2dx_StopGrid(cx, ns); - js_register_cocos2dx_SimpleAudioEngine(cx, ns); + js_register_cocos2dx_Technique(cx, ns); js_register_cocos2dx_SkewTo(cx, ns); js_register_cocos2dx_SkewBy(cx, ns); js_register_cocos2dx_EaseQuadraticActionOut(cx, ns); @@ -66343,6 +68647,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_FlipY3D(cx, ns); js_register_cocos2dx_EaseSineInOut(cx, ns); js_register_cocos2dx_TransitionFlipAngular(cx, ns); + js_register_cocos2dx_SimpleAudioEngine(cx, ns); js_register_cocos2dx_EaseElasticInOut(cx, ns); js_register_cocos2dx_Show(cx, ns); js_register_cocos2dx_FadeOut(cx, ns); @@ -66410,6 +68715,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_JumpTo(cx, ns); js_register_cocos2dx_ParticleExplosion(cx, ns); js_register_cocos2dx_TransitionJumpZoom(cx, ns); + js_register_cocos2dx_Pass(cx, ns); js_register_cocos2dx_Touch(cx, ns); js_register_cocos2dx_SAXParser(cx, ns); js_register_cocos2dx_CardinalSplineBy(cx, ns); @@ -66444,6 +68750,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_TransitionProgressRadialCCW(cx, ns); js_register_cocos2dx_EventListenerFocus(cx, ns); js_register_cocos2dx_TransitionPageTurn(cx, ns); + js_register_cocos2dx_Properties(cx, ns); js_register_cocos2dx_BezierBy(cx, ns); js_register_cocos2dx_BezierTo(cx, ns); js_register_cocos2dx_ParticleMeteor(cx, ns); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index a82ee08eaa..e3d7778a34 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -871,6 +871,42 @@ bool js_cocos2dx_Configuration_gatherGPUInfo(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_Configuration_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Configuration_getInstance(JSContext *cx, uint32_t argc, jsval *vp); +extern JSClass *jsb_cocos2d_Properties_class; +extern JSObject *jsb_cocos2d_Properties_prototype; + +bool js_cocos2dx_Properties_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_Properties_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_Properties(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_Properties_getVariable(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getString(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getLong(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getNamespace(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getPath(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getMat4(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_exists(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_setString(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getId(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_rewind(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_setVariable(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getBool(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getColor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getType(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getNextNamespace(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getInt(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getVec3(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getVec2(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getVec4(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getNextProperty(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getFloat(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_getQuaternionFromAxisAngle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_parseColor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_parseVec3(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_parseAxisAngle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_parseVec2(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_createNonRefCounted(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Properties_parseVec4(JSContext *cx, uint32_t argc, jsval *vp); + extern JSClass *jsb_cocos2d_FileUtils_class; extern JSObject *jsb_cocos2d_FileUtils_prototype; @@ -3326,10 +3362,11 @@ bool js_cocos2dx_Camera_getCameraFlag(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_getType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_initDefault(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_project(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Camera_initOrthographic(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_getDepthInView(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_lookAt(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_setCameraFlag(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Camera_initOrthographic(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Camera_clearBackground(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_setAdditionalProjection(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_getDepth(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_setDepth(JSContext *cx, uint32_t argc, jsval *vp); @@ -3510,6 +3547,77 @@ bool js_cocos2dx_GLProgramCache_destroyInstance(JSContext *cx, uint32_t argc, js bool js_cocos2dx_GLProgramCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramCache_GLProgramCache(JSContext *cx, uint32_t argc, jsval *vp); +extern JSClass *jsb_cocos2d_RenderState_class; +extern JSObject *jsb_cocos2d_RenderState_prototype; + +bool js_cocos2dx_RenderState_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_RenderState_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_RenderState(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_RenderState_setTexture(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_getTopmost(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_getTexture(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_bind(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_getName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_getStateBlock(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_getTextures(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_initialize(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_RenderState_finalize(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Pass_class; +extern JSObject *jsb_cocos2d_Pass_prototype; + +bool js_cocos2dx_Pass_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_Pass_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_Pass(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_Pass_unbind(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_bind(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_clone(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_getGLProgramState(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_getVertexAttributeBinding(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_getHash(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_setVertexAttribBinding(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Pass_createWithGLProgramState(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Technique_class; +extern JSObject *jsb_cocos2d_Technique_prototype; + +bool js_cocos2dx_Technique_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_Technique_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_Technique(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_Technique_getPassCount(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_clone(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_addPass(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_getPasses(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_getName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_getPassByIndex(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Technique_createWithGLProgramState(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Material_class; +extern JSObject *jsb_cocos2d_Material_prototype; + +bool js_cocos2dx_Material_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_Material_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_Material(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_Material_clone(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_getTechniqueCount(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_setName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_getTechniqueByIndex(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_getName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_getTechniques(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_setTechnique(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_getTechniqueByName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_addTechnique(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_getTechnique(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_createWithFilename(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_createWithGLStateProgram(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Material_createWithProperties(JSContext *cx, uint32_t argc, jsval *vp); + extern JSClass *jsb_cocos2d_TextureCache_class; extern JSObject *jsb_cocos2d_TextureCache_prototype; @@ -3527,6 +3635,7 @@ bool js_cocos2dx_TextureCache_getCachedTextureInfo(JSContext *cx, uint32_t argc, bool js_cocos2dx_TextureCache_addImage(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TextureCache_unbindImageAsync(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_TextureCache_getTextureFilePath(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TextureCache_removeUnusedTextures(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TextureCache_removeTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TextureCache_waitForQuit(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp new file mode 100644 index 0000000000..c6648852ea --- /dev/null +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -0,0 +1,6718 @@ +#include "jsb_cocos2dx_physics3d_auto.hpp" +#include "cocos2d_specifics.hpp" +#include "CCPhysics3D.h" + +template +static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedValue initializing(cx); + bool isNewValid = true; + JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject()); + isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean(); + if (isNewValid) + { + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + + args.rval().set(OBJECT_TO_JSVAL(_tmp)); + return true; + } + + JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference."); + return false; +} + +static bool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) { + return false; +} + +static bool js_is_native_obj(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + args.rval().setBoolean(true); + return true; +} +JSClass *jsb_cocos2d_Physics3DShape_class; +JSObject *jsb_cocos2d_Physics3DShape_prototype; + +bool js_cocos2dx_physics3d_Physics3DShape_getbtShape(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DShape* cobj = (cocos2d::Physics3DShape *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DShape_getbtShape : Invalid Native Object"); + if (argc == 0) { + btCollisionShape* ret = cobj->getbtShape(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (btCollisionShape*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_getbtShape : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DShape_getShapeType(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DShape* cobj = (cocos2d::Physics3DShape *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DShape_getShapeType : Invalid Native Object"); + if (argc == 0) { + int ret = (int)cobj->getShapeType(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_getShapeType : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DShape_createBox(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createBox : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createBox(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createBox : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DShape_createCylinder(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + double arg0; + double arg1; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCylinder : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCylinder(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createCylinder : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DShape_createConvexHull(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + const cocos2d::Vec3* arg0; + int arg1; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (const cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createConvexHull : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createConvexHull(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createConvexHull : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DShape_createCapsule(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) { + double arg0; + double arg1; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCapsule : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCapsule(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createCapsule : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DShape_createSphere(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createSphere : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createSphere(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createSphere : wrong number of arguments"); + return false; +} + + + +void js_cocos2d_Physics3DShape_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DShape)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DShape(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DShape_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DShape_class->name = "Physics3DShape"; + jsb_cocos2d_Physics3DShape_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DShape_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DShape_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DShape_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DShape_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DShape_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DShape_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DShape_class->finalize = js_cocos2d_Physics3DShape_finalize; + jsb_cocos2d_Physics3DShape_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getbtShape", js_cocos2dx_physics3d_Physics3DShape_getbtShape, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getShapeType", js_cocos2dx_physics3d_Physics3DShape_getShapeType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("createBox", js_cocos2dx_physics3d_Physics3DShape_createBox, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createCylinder", js_cocos2dx_physics3d_Physics3DShape_createCylinder, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createConvexHull", js_cocos2dx_physics3d_Physics3DShape_createConvexHull, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createCapsule", js_cocos2dx_physics3d_Physics3DShape_createCapsule, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("createSphere", js_cocos2dx_physics3d_Physics3DShape_createSphere, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DShape_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Physics3DShape_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DShape", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DShape_class; + p->proto = jsb_cocos2d_Physics3DShape_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DObject_class; +JSObject *jsb_cocos2d_Physics3DObject_prototype; + +bool js_cocos2dx_physics3d_Physics3DObject_setUserData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_setUserData : Invalid Native Object"); + if (argc == 1) { + void* arg0; + #pragma warning NO CONVERSION TO NATIVE FOR void* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DObject_setUserData : Error processing arguments"); + cobj->setUserData(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_setUserData : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_getUserData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_getUserData : Invalid Native Object"); + if (argc == 0) { + void* ret = cobj->getUserData(); + jsval jsret = JSVAL_NULL; + #pragma warning NO CONVERSION FROM NATIVE FOR void*; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_getUserData : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_getObjType(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_getObjType : Invalid Native Object"); + if (argc == 0) { + int ret = (int)cobj->getObjType(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_getObjType : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_setPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_setPhysicsWorld : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DWorld* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DWorld*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DObject_setPhysicsWorld : Error processing arguments"); + cobj->setPhysicsWorld(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_setPhysicsWorld : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_getWorldTransform(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_getWorldTransform : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getWorldTransform(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_getWorldTransform : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_getPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_getPhysicsWorld : Invalid Native Object"); + if (argc == 0) { + cocos2d::Physics3DWorld* ret = cobj->getPhysicsWorld(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DWorld*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_getPhysicsWorld : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_setMask(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_setMask : Invalid Native Object"); + if (argc == 1) { + unsigned int arg0; + ok &= jsval_to_uint32(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DObject_setMask : Error processing arguments"); + cobj->setMask(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_setMask : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_getCollisionCallback(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_getCollisionCallback : Invalid Native Object"); + if (argc == 0) { + const std::function& ret = cobj->getCollisionCallback(); + jsval jsret = JSVAL_NULL; + #pragma warning NO CONVERSION FROM NATIVE FOR std::function; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_getCollisionCallback : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_getMask(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_getMask : Invalid Native Object"); + if (argc == 0) { + unsigned int ret = cobj->getMask(); + jsval jsret = JSVAL_NULL; + jsret = uint32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_getMask : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DObject_needCollisionCallback(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DObject_needCollisionCallback : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->needCollisionCallback(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DObject_needCollisionCallback : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} + + +void js_cocos2d_Physics3DObject_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DObject)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DObject(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DObject_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DObject_class->name = "Physics3DObject"; + jsb_cocos2d_Physics3DObject_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DObject_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DObject_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DObject_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DObject_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DObject_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DObject_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DObject_class->finalize = js_cocos2d_Physics3DObject_finalize; + jsb_cocos2d_Physics3DObject_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("setUserData", js_cocos2dx_physics3d_Physics3DObject_setUserData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUserData", js_cocos2dx_physics3d_Physics3DObject_getUserData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getObjType", js_cocos2dx_physics3d_Physics3DObject_getObjType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPhysicsWorld", js_cocos2dx_physics3d_Physics3DObject_setPhysicsWorld, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getWorldTransform", js_cocos2dx_physics3d_Physics3DObject_getWorldTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPhysicsWorld", js_cocos2dx_physics3d_Physics3DObject_getPhysicsWorld, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMask", js_cocos2dx_physics3d_Physics3DObject_setMask, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getCollisionCallback", js_cocos2dx_physics3d_Physics3DObject_getCollisionCallback, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMask", js_cocos2dx_physics3d_Physics3DObject_getMask, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("needCollisionCallback", js_cocos2dx_physics3d_Physics3DObject_needCollisionCallback, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + JSFunctionSpec *st_funcs = NULL; + + jsb_cocos2d_Physics3DObject_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Physics3DObject_class, + empty_constructor, 0, + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DObject", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DObject_class; + p->proto = jsb_cocos2d_Physics3DObject_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DRigidBody_class; +JSObject *jsb_cocos2d_Physics3DRigidBody_prototype; + +bool js_cocos2dx_physics3d_Physics3DRigidBody_setGravity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setGravity : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setGravity : Error processing arguments"); + cobj->setGravity(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setGravity : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getFriction(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getFriction : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getFriction(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getFriction : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setAngularFactor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Physics3DRigidBody* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setAngularFactor : Invalid Native Object"); + do { + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + if (!ok) { ok = true; break; } + cobj->setAngularFactor(arg0); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cobj->setAngularFactor(arg0); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setAngularFactor : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_addConstraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_addConstraint : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DConstraint* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_addConstraint : Error processing arguments"); + cobj->addConstraint(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_addConstraint : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getRigidBody(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getRigidBody : Invalid Native Object"); + if (argc == 0) { + btRigidBody* ret = cobj->getRigidBody(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (btRigidBody*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getRigidBody : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getTotalForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getTotalForce : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getTotalForce(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getTotalForce : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getConstraintCount(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getConstraintCount : Invalid Native Object"); + if (argc == 0) { + unsigned int ret = cobj->getConstraintCount(); + jsval jsret = JSVAL_NULL; + jsret = uint32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getConstraintCount : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralForce : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralForce : Error processing arguments"); + cobj->applyCentralForce(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralForce : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps : Invalid Native Object"); + if (argc == 2) { + double arg0; + cocos2d::Vec3 arg1; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps : Error processing arguments"); + cobj->setMassProps(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setFriction(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setFriction : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setFriction : Error processing arguments"); + cobj->setFriction(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setFriction : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setKinematic(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setKinematic : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setKinematic : Error processing arguments"); + cobj->setKinematic(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setKinematic : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setDamping(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setDamping : Invalid Native Object"); + if (argc == 2) { + double arg0; + double arg1; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setDamping : Error processing arguments"); + cobj->setDamping(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setDamping : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyImpulse : Invalid Native Object"); + if (argc == 2) { + cocos2d::Vec3 arg0; + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyImpulse : Error processing arguments"); + cobj->applyImpulse(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyImpulse : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_isKinematic(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_isKinematic : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isKinematic(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_isKinematic : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyTorque(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyTorque : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyTorque : Error processing arguments"); + cobj->applyTorque(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyTorque : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold : Error processing arguments"); + cobj->setCcdMotionThreshold(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction : Error processing arguments"); + cobj->setRollingFriction(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getCcdMotionThreshold(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getCcdMotionThreshold : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getCcdMotionThreshold(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getCcdMotionThreshold : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getLinearFactor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getLinearFactor : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getLinearFactor(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getLinearFactor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping : Error processing arguments"); + cobj->applyDamping(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getAngularVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getAngularVelocity : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getAngularVelocity(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getAngularVelocity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_init(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_init : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DRigidBodyDes* arg0; + #pragma warning NO CONVERSION TO NATIVE FOR Physics3DRigidBodyDes* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_init : Error processing arguments"); + bool ret = cobj->init(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_init : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyTorqueImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyTorqueImpulse : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyTorqueImpulse : Error processing arguments"); + cobj->applyTorqueImpulse(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyTorqueImpulse : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setActive(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setActive : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setActive : Error processing arguments"); + cobj->setActive(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setActive : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setLinearFactor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setLinearFactor : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setLinearFactor : Error processing arguments"); + cobj->setLinearFactor(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setLinearFactor : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setLinearVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setLinearVelocity : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setLinearVelocity : Error processing arguments"); + cobj->setLinearVelocity(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setLinearVelocity : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getLinearVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getLinearVelocity : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getLinearVelocity(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getLinearVelocity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius : Error processing arguments"); + cobj->setCcdSweptSphereRadius(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyForce : Invalid Native Object"); + if (argc == 2) { + cocos2d::Vec3 arg0; + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyForce : Error processing arguments"); + cobj->applyForce(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyForce : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setAngularVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setAngularVelocity : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setAngularVelocity : Error processing arguments"); + cobj->setAngularVelocity(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setAngularVelocity : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralImpulse : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralImpulse : Error processing arguments"); + cobj->applyCentralImpulse(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralImpulse : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getGravity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getGravity : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getGravity(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getGravity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getRollingFriction(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getRollingFriction : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRollingFriction(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getRollingFriction : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setCenterOfMassTransform(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCenterOfMassTransform : Invalid Native Object"); + if (argc == 1) { + cocos2d::Mat4 arg0; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCenterOfMassTransform : Error processing arguments"); + cobj->setCenterOfMassTransform(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setCenterOfMassTransform : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setInvInertiaDiagLocal(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setInvInertiaDiagLocal : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setInvInertiaDiagLocal : Error processing arguments"); + cobj->setInvInertiaDiagLocal(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setInvInertiaDiagLocal : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_removeConstraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Physics3DRigidBody* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_removeConstraint : Invalid Native Object"); + do { + if (argc == 1) { + unsigned int arg0; + ok &= jsval_to_uint32(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cobj->removeConstraint(arg0); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 1) { + cocos2d::Physics3DConstraint* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cobj->removeConstraint(arg0); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_removeConstraint : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getTotalTorque(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getTotalTorque : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getTotalTorque(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getTotalTorque : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getInvMass(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getInvMass : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getInvMass(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getInvMass : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint : Invalid Native Object"); + if (argc == 1) { + unsigned int arg0; + ok &= jsval_to_uint32(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint : Error processing arguments"); + cocos2d::Physics3DConstraint* ret = cobj->getConstraint(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getRestitution(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getRestitution : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitution(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getRestitution : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getCcdSweptSphereRadius(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getCcdSweptSphereRadius : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getCcdSweptSphereRadius(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getCcdSweptSphereRadius : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getHitFraction(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getHitFraction : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getHitFraction(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getHitFraction : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getAngularDamping(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getAngularDamping : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getAngularDamping(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getAngularDamping : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getInvInertiaDiagLocal(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getInvInertiaDiagLocal : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getInvInertiaDiagLocal(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getInvInertiaDiagLocal : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getCenterOfMassTransform(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getCenterOfMassTransform : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getCenterOfMassTransform(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getCenterOfMassTransform : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getAngularFactor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getAngularFactor : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getAngularFactor(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getAngularFactor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution : Error processing arguments"); + cobj->setRestitution(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction : Error processing arguments"); + cobj->setHitFraction(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_getLinearDamping(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DRigidBody* cobj = (cocos2d::Physics3DRigidBody *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getLinearDamping : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLinearDamping(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_getLinearDamping : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DRigidBody_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DRigidBody* cobj = new (std::nothrow) cocos2d::Physics3DRigidBody(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DRigidBody"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Physics3DObject_prototype; + +void js_cocos2d_Physics3DRigidBody_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DRigidBody)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DRigidBody(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DRigidBody_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DRigidBody_class->name = "Physics3DRigidBody"; + jsb_cocos2d_Physics3DRigidBody_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DRigidBody_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DRigidBody_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DRigidBody_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DRigidBody_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DRigidBody_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DRigidBody_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DRigidBody_class->finalize = js_cocos2d_Physics3DRigidBody_finalize; + jsb_cocos2d_Physics3DRigidBody_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("setGravity", js_cocos2dx_physics3d_Physics3DRigidBody_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFriction", js_cocos2dx_physics3d_Physics3DRigidBody_getFriction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setAngularFactor", js_cocos2dx_physics3d_Physics3DRigidBody_setAngularFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("addConstraint", js_cocos2dx_physics3d_Physics3DRigidBody_addConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRigidBody", js_cocos2dx_physics3d_Physics3DRigidBody_getRigidBody, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTotalForce", js_cocos2dx_physics3d_Physics3DRigidBody_getTotalForce, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getConstraintCount", js_cocos2dx_physics3d_Physics3DRigidBody_getConstraintCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyCentralForce", js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralForce, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMassProps", js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFriction", js_cocos2dx_physics3d_Physics3DRigidBody_setFriction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setKinematic", js_cocos2dx_physics3d_Physics3DRigidBody_setKinematic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDamping", js_cocos2dx_physics3d_Physics3DRigidBody_setDamping, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyImpulse", js_cocos2dx_physics3d_Physics3DRigidBody_applyImpulse, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isKinematic", js_cocos2dx_physics3d_Physics3DRigidBody_isKinematic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyTorque", js_cocos2dx_physics3d_Physics3DRigidBody_applyTorque, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setCcdMotionThreshold", js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRollingFriction", js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getCcdMotionThreshold", js_cocos2dx_physics3d_Physics3DRigidBody_getCcdMotionThreshold, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLinearFactor", js_cocos2dx_physics3d_Physics3DRigidBody_getLinearFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyDamping", js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularVelocity", js_cocos2dx_physics3d_Physics3DRigidBody_getAngularVelocity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("init", js_cocos2dx_physics3d_Physics3DRigidBody_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyTorqueImpulse", js_cocos2dx_physics3d_Physics3DRigidBody_applyTorqueImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setActive", js_cocos2dx_physics3d_Physics3DRigidBody_setActive, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLinearFactor", js_cocos2dx_physics3d_Physics3DRigidBody_setLinearFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLinearVelocity", js_cocos2dx_physics3d_Physics3DRigidBody_setLinearVelocity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLinearVelocity", js_cocos2dx_physics3d_Physics3DRigidBody_getLinearVelocity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setCcdSweptSphereRadius", js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyForce", js_cocos2dx_physics3d_Physics3DRigidBody_applyForce, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setAngularVelocity", js_cocos2dx_physics3d_Physics3DRigidBody_setAngularVelocity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyCentralImpulse", js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getGravity", js_cocos2dx_physics3d_Physics3DRigidBody_getGravity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRollingFriction", js_cocos2dx_physics3d_Physics3DRigidBody_getRollingFriction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setCenterOfMassTransform", js_cocos2dx_physics3d_Physics3DRigidBody_setCenterOfMassTransform, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setInvInertiaDiagLocal", js_cocos2dx_physics3d_Physics3DRigidBody_setInvInertiaDiagLocal, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeConstraint", js_cocos2dx_physics3d_Physics3DRigidBody_removeConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTotalTorque", js_cocos2dx_physics3d_Physics3DRigidBody_getTotalTorque, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getInvMass", js_cocos2dx_physics3d_Physics3DRigidBody_getInvMass, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getConstraint", js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitution", js_cocos2dx_physics3d_Physics3DRigidBody_getRestitution, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getCcdSweptSphereRadius", js_cocos2dx_physics3d_Physics3DRigidBody_getCcdSweptSphereRadius, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getHitFraction", js_cocos2dx_physics3d_Physics3DRigidBody_getHitFraction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularDamping", js_cocos2dx_physics3d_Physics3DRigidBody_getAngularDamping, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getInvInertiaDiagLocal", js_cocos2dx_physics3d_Physics3DRigidBody_getInvInertiaDiagLocal, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getCenterOfMassTransform", js_cocos2dx_physics3d_Physics3DRigidBody_getCenterOfMassTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularFactor", js_cocos2dx_physics3d_Physics3DRigidBody_getAngularFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitution", js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setHitFraction", js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLinearDamping", js_cocos2dx_physics3d_Physics3DRigidBody_getLinearDamping, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + JSFunctionSpec *st_funcs = NULL; + + jsb_cocos2d_Physics3DRigidBody_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Physics3DObject_prototype), + jsb_cocos2d_Physics3DRigidBody_class, + js_cocos2dx_physics3d_Physics3DRigidBody_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DRigidBody", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DRigidBody_class; + p->proto = jsb_cocos2d_Physics3DRigidBody_prototype; + p->parentProto = jsb_cocos2d_Physics3DObject_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DComponent_class; +JSObject *jsb_cocos2d_Physics3DComponent_prototype; + +bool js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DWorld* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DWorld*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld : Error processing arguments"); + cobj->addToPhysicsWorld(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics : Invalid Native Object"); + if (argc == 0) { + cobj->syncToPhysics(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_syncToNode(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_syncToNode : Invalid Native Object"); + if (argc == 0) { + cobj->syncToNode(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_syncToNode : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject : Invalid Native Object"); + if (argc == 0) { + cocos2d::Physics3DObject* ret = cobj->getPhysics3DObject(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DObject*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject : Error processing arguments"); + cobj->setPhysics3DObject(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DComponent::PhysicsSyncFlag arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag : Error processing arguments"); + cobj->setSyncFlag(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_setTransformInPhysics(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_setTransformInPhysics : Invalid Native Object"); + if (argc == 2) { + cocos2d::Vec3 arg0; + cocos2d::Quaternion arg1; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + ok &= jsval_to_quaternion(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_setTransformInPhysics : Error processing arguments"); + cobj->setTransformInPhysics(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_setTransformInPhysics : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + do { + if (argc == 1) { + cocos2d::Physics3DObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + do { + if (argc == 2) { + cocos2d::Physics3DObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + do { + if (argc == 3) { + cocos2d::Physics3DObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Quaternion arg2; + ok &= jsval_to_quaternion(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 0) { + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_create : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DComponentName(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (argc == 0) { + std::string& ret = cocos2d::Physics3DComponent::getPhysics3DComponentName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DComponentName : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DComponent_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DComponent* cobj = new (std::nothrow) cocos2d::Physics3DComponent(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DComponent"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Component_prototype; + +void js_cocos2d_Physics3DComponent_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DComponent)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DComponent_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DComponent_class->name = "Physics3DComponent"; + jsb_cocos2d_Physics3DComponent_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DComponent_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DComponent_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DComponent_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DComponent_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DComponent_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DComponent_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DComponent_class->finalize = js_cocos2d_Physics3DComponent_finalize; + jsb_cocos2d_Physics3DComponent_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("addToPhysicsWorld", js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("syncToPhysics", js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("syncToNode", js_cocos2dx_physics3d_Physics3DComponent_syncToNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPhysics3DObject", js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPhysics3DObject", js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSyncFlag", js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setTransformInPhysics", js_cocos2dx_physics3d_Physics3DComponent_setTransformInPhysics, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3DComponent_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPhysics3DComponentName", js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DComponentName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DComponent_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Component_prototype), + jsb_cocos2d_Physics3DComponent_class, + js_cocos2dx_physics3d_Physics3DComponent_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DComponent", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DComponent_class; + p->proto = jsb_cocos2d_Physics3DComponent_prototype; + p->parentProto = jsb_cocos2d_Component_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_PhysicsSprite3D_class; +JSObject *jsb_cocos2d_PhysicsSprite3D_prototype; + +bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::PhysicsSprite3D* cobj = (cocos2d::PhysicsSprite3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics : Invalid Native Object"); + if (argc == 0) { + cobj->syncToPhysics(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::PhysicsSprite3D* cobj = (cocos2d::PhysicsSprite3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode : Invalid Native Object"); + if (argc == 0) { + cobj->syncToNode(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::PhysicsSprite3D* cobj = (cocos2d::PhysicsSprite3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj : Invalid Native Object"); + if (argc == 0) { + cocos2d::Physics3DObject* ret = cobj->getPhysicsObj(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DObject*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::PhysicsSprite3D* cobj = (cocos2d::PhysicsSprite3D *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DComponent::PhysicsSyncFlag arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag : Error processing arguments"); + cobj->setSyncFlag(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_PhysicsSprite3D_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::PhysicsSprite3D* cobj = new (std::nothrow) cocos2d::PhysicsSprite3D(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::PhysicsSprite3D"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Sprite3D_prototype; + +void js_cocos2d_PhysicsSprite3D_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (PhysicsSprite3D)", obj); +} + +void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_PhysicsSprite3D_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_PhysicsSprite3D_class->name = "PhysicsSprite3D"; + jsb_cocos2d_PhysicsSprite3D_class->addProperty = JS_PropertyStub; + jsb_cocos2d_PhysicsSprite3D_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_PhysicsSprite3D_class->getProperty = JS_PropertyStub; + jsb_cocos2d_PhysicsSprite3D_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_PhysicsSprite3D_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_PhysicsSprite3D_class->resolve = JS_ResolveStub; + jsb_cocos2d_PhysicsSprite3D_class->convert = JS_ConvertStub; + jsb_cocos2d_PhysicsSprite3D_class->finalize = js_cocos2d_PhysicsSprite3D_finalize; + jsb_cocos2d_PhysicsSprite3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("syncToPhysics", js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("syncToNode", js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPhysicsObj", js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSyncFlag", js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + JSFunctionSpec *st_funcs = NULL; + + jsb_cocos2d_PhysicsSprite3D_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Sprite3D_prototype), + jsb_cocos2d_PhysicsSprite3D_class, + js_cocos2dx_physics3d_PhysicsSprite3D_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "PhysicsSprite3D", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_PhysicsSprite3D_class; + p->proto = jsb_cocos2d_PhysicsSprite3D_prototype; + p->parentProto = jsb_cocos2d_Sprite3D_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DWorld_class; +JSObject *jsb_cocos2d_Physics3DWorld_prototype; + +bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_stepSimulate : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_stepSimulate : Error processing arguments"); + cobj->stepSimulate(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_stepSimulate : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->needCollisionChecking(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_collisionChecking(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_collisionChecking : Invalid Native Object"); + if (argc == 0) { + cobj->collisionChecking(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_collisionChecking : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_init(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_init : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DWorldDes* arg0; + #pragma warning NO CONVERSION TO NATIVE FOR Physics3DWorldDes* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_init : Error processing arguments"); + bool ret = cobj->init(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_init : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DConstraint* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Error processing arguments"); + cobj->removePhysics3DConstraint(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isDebugDrawEnabled(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints : Invalid Native Object"); + if (argc == 0) { + cobj->removeAllPhysics3DConstraints(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_rayCast(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_rayCast : Invalid Native Object"); + if (argc == 3) { + cocos2d::Vec3 arg0; + cocos2d::Vec3 arg1; + cocos2d::Physics3DWorld::HitResult* arg2; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + #pragma warning NO CONVERSION TO NATIVE FOR HitResult* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_rayCast : Error processing arguments"); + bool ret = cobj->rayCast(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_rayCast : wrong number of arguments: %d, was expecting %d", argc, 3); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : Invalid Native Object"); + if (argc == 0) { + cobj->removeAllPhysics3DObjects(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject : Error processing arguments"); + cobj->addPhysics3DObject(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable : Error processing arguments"); + cobj->setDebugDrawEnable(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject : Error processing arguments"); + cobj->removePhysics3DObject(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject : Invalid Native Object"); + if (argc == 1) { + const btCollisionObject* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (const btCollisionObject*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject : Error processing arguments"); + cocos2d::Physics3DObject* ret = cobj->getPhysicsObject(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DObject*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DConstraint* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint : Error processing arguments"); + cobj->addPhysics3DConstraint(arg0); + args.rval().setUndefined(); + return true; + } + if (argc == 2) { + cocos2d::Physics3DConstraint* arg0; + bool arg1; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + arg1 = JS::ToBoolean(args.get(1)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint : Error processing arguments"); + cobj->addPhysics3DConstraint(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_debugDraw(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_debugDraw : Invalid Native Object"); + if (argc == 1) { + cocos2d::Renderer* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Renderer*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_debugDraw : Error processing arguments"); + cobj->debugDraw(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_debugDraw : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_sweepShape(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_sweepShape : Invalid Native Object"); + if (argc == 4) { + cocos2d::Physics3DShape* arg0; + cocos2d::Mat4 arg1; + cocos2d::Mat4 arg2; + cocos2d::Physics3DWorld::HitResult* arg3; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DShape*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + ok &= jsval_to_matrix(cx, args.get(2), &arg2); + #pragma warning NO CONVERSION TO NATIVE FOR HitResult* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_sweepShape : Error processing arguments"); + bool ret = cobj->sweepShape(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_sweepShape : wrong number of arguments: %d, was expecting %d", argc, 4); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::Physics3DWorldDes* arg0; + #pragma warning NO CONVERSION TO NATIVE FOR Physics3DWorldDes* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_create : Error processing arguments"); + cocos2d::Physics3DWorld* ret = cocos2d::Physics3DWorld::create(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DWorld*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DWorld_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DWorld* cobj = new (std::nothrow) cocos2d::Physics3DWorld(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DWorld"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + + +void js_cocos2d_Physics3DWorld_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DWorld)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DWorld_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DWorld_class->name = "Physics3DWorld"; + jsb_cocos2d_Physics3DWorld_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DWorld_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DWorld_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DWorld_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DWorld_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DWorld_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DWorld_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DWorld_class->finalize = js_cocos2d_Physics3DWorld_finalize; + jsb_cocos2d_Physics3DWorld_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("stepSimulate", js_cocos2dx_physics3d_Physics3DWorld_stepSimulate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("needCollisionChecking", js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("collisionChecking", js_cocos2dx_physics3d_Physics3DWorld_collisionChecking, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("init", js_cocos2dx_physics3d_Physics3DWorld_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removePhysics3DConstraint", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isDebugDrawEnabled", js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeAllPhysics3DConstraints", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("rayCast", js_cocos2dx_physics3d_Physics3DWorld_rayCast, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeAllPhysics3DObjects", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("addPhysics3DObject", js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDebugDrawEnable", js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removePhysics3DObject", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPhysicsObject", js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("addPhysics3DConstraint", js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("debugDraw", js_cocos2dx_physics3d_Physics3DWorld_debugDraw, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("sweepShape", js_cocos2dx_physics3d_Physics3DWorld_sweepShape, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3DWorld_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DWorld_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Physics3DWorld_class, + js_cocos2dx_physics3d_Physics3DWorld_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DWorld", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DWorld_class; + p->proto = jsb_cocos2d_Physics3DWorld_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DConstraint_class; +JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DConstraint_setEnabled(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setEnabled : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setEnabled : Error processing arguments"); + cobj->setEnabled(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_setEnabled : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse : Error processing arguments"); + cobj->setBreakingImpulse(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getUserData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getUserData : Invalid Native Object"); + if (argc == 0) { + void* ret = cobj->getUserData(); + jsval jsret = JSVAL_NULL; + #pragma warning NO CONVERSION FROM NATIVE FOR void*; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getUserData : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getBreakingImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getBreakingImpulse : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getBreakingImpulse(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getBreakingImpulse : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getBodyA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getBodyA : Invalid Native Object"); + if (argc == 0) { + cocos2d::Physics3DRigidBody* ret = cobj->getBodyA(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DRigidBody*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getBodyA : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_isEnabled(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_isEnabled : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isEnabled(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_isEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getOverrideNumSolverIterations(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getOverrideNumSolverIterations : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getOverrideNumSolverIterations(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getOverrideNumSolverIterations : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getBodyB(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getBodyB : Invalid Native Object"); + if (argc == 0) { + cocos2d::Physics3DRigidBody* ret = cobj->getBodyB(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DRigidBody*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getBodyB : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_setOverrideNumSolverIterations(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setOverrideNumSolverIterations : Invalid Native Object"); + if (argc == 1) { + int arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setOverrideNumSolverIterations : Error processing arguments"); + cobj->setOverrideNumSolverIterations(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_setOverrideNumSolverIterations : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getConstraintType(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getConstraintType : Invalid Native Object"); + if (argc == 0) { + int ret = (int)cobj->getConstraintType(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getConstraintType : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_setUserData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setUserData : Invalid Native Object"); + if (argc == 1) { + void* arg0; + #pragma warning NO CONVERSION TO NATIVE FOR void* + ok = false; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setUserData : Error processing arguments"); + cobj->setUserData(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_setUserData : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConstraint* cobj = (cocos2d::Physics3DConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint : Invalid Native Object"); + if (argc == 0) { + btTypedConstraint* ret = cobj->getbtContraint(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (btTypedConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} + + +void js_cocos2d_Physics3DConstraint_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DConstraint)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DConstraint(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DConstraint_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DConstraint_class->name = "Physics3DConstraint"; + jsb_cocos2d_Physics3DConstraint_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DConstraint_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DConstraint_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DConstraint_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DConstraint_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DConstraint_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DConstraint_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DConstraint_class->finalize = js_cocos2d_Physics3DConstraint_finalize; + jsb_cocos2d_Physics3DConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("setEnabled", js_cocos2dx_physics3d_Physics3DConstraint_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setBreakingImpulse", js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUserData", js_cocos2dx_physics3d_Physics3DConstraint_getUserData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBreakingImpulse", js_cocos2dx_physics3d_Physics3DConstraint_getBreakingImpulse, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBodyA", js_cocos2dx_physics3d_Physics3DConstraint_getBodyA, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isEnabled", js_cocos2dx_physics3d_Physics3DConstraint_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getOverrideNumSolverIterations", js_cocos2dx_physics3d_Physics3DConstraint_getOverrideNumSolverIterations, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBodyB", js_cocos2dx_physics3d_Physics3DConstraint_getBodyB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setOverrideNumSolverIterations", js_cocos2dx_physics3d_Physics3DConstraint_setOverrideNumSolverIterations, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getConstraintType", js_cocos2dx_physics3d_Physics3DConstraint_getConstraintType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUserData", js_cocos2dx_physics3d_Physics3DConstraint_setUserData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getbtContraint", js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + JSFunctionSpec *st_funcs = NULL; + + jsb_cocos2d_Physics3DConstraint_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Physics3DConstraint_class, + dummy_constructor, 0, // no constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DConstraint", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DConstraint_class; + p->proto = jsb_cocos2d_Physics3DConstraint_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DPointToPointConstraint_class; +JSObject *jsb_cocos2d_Physics3DPointToPointConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DPointToPointConstraint* cobj = (cocos2d::Physics3DPointToPointConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInA : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getPivotPointInA(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInA : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInB(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DPointToPointConstraint* cobj = (cocos2d::Physics3DPointToPointConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInB : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getPivotPointInB(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInB : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DPointToPointConstraint* cobj = (cocos2d::Physics3DPointToPointConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInA : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInA : Error processing arguments"); + cobj->setPivotPointInA(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInA : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInB(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DPointToPointConstraint* cobj = (cocos2d::Physics3DPointToPointConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInB : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInB : Error processing arguments"); + cobj->setPivotPointInB(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInB : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + do { + if (argc == 4) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg2; + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg3; + ok &= jsval_to_vector3(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + cocos2d::Physics3DPointToPointConstraint* ret = cocos2d::Physics3DPointToPointConstraint::create(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DPointToPointConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 2) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Physics3DPointToPointConstraint* ret = cocos2d::Physics3DPointToPointConstraint::create(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DPointToPointConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DPointToPointConstraint_create : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DPointToPointConstraint* cobj = new (std::nothrow) cocos2d::Physics3DPointToPointConstraint(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DPointToPointConstraint"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +void js_cocos2d_Physics3DPointToPointConstraint_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DPointToPointConstraint)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DPointToPointConstraint(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DPointToPointConstraint_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DPointToPointConstraint_class->name = "Physics3DPointToPointConstraint"; + jsb_cocos2d_Physics3DPointToPointConstraint_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DPointToPointConstraint_class->finalize = js_cocos2d_Physics3DPointToPointConstraint_finalize; + jsb_cocos2d_Physics3DPointToPointConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getPivotPointInA", js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInA, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPivotPointInB", js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPivotPointInA", js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInA, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPivotPointInB", js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3DPointToPointConstraint_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DPointToPointConstraint_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Physics3DConstraint_prototype), + jsb_cocos2d_Physics3DPointToPointConstraint_class, + js_cocos2dx_physics3d_Physics3DPointToPointConstraint_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DPointToPointConstraint", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DPointToPointConstraint_class; + p->proto = jsb_cocos2d_Physics3DPointToPointConstraint_prototype; + p->parentProto = jsb_cocos2d_Physics3DConstraint_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DHingeConstraint_class; +JSObject *jsb_cocos2d_Physics3DHingeConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getHingeAngle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Physics3DHingeConstraint* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getHingeAngle : Invalid Native Object"); + do { + if (argc == 2) { + cocos2d::Mat4 arg0; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + double ret = cobj->getHingeAngle(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 0) { + double ret = cobj->getHingeAngle(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getHingeAngle : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getMotorTargetVelosity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getMotorTargetVelosity : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getMotorTargetVelosity(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getMotorTargetVelosity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetA : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getFrameOffsetA(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetA : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetB(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetB : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getFrameOffsetB(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetB : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse : Error processing arguments"); + cobj->setMaxMotorImpulse(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor : Invalid Native Object"); + if (argc == 3) { + bool arg0; + double arg1; + double arg2; + arg0 = JS::ToBoolean(args.get(0)); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor : Error processing arguments"); + cobj->enableAngularMotor(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor : wrong number of arguments: %d, was expecting %d", argc, 3); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getUpperLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getUpperLimit : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getUpperLimit(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getUpperLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getMaxMotorImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getMaxMotorImpulse : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getMaxMotorImpulse(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getMaxMotorImpulse : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getLowerLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getLowerLimit : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLowerLimit(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getLowerLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setUseFrameOffset : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setUseFrameOffset : Error processing arguments"); + cobj->setUseFrameOffset(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setUseFrameOffset : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getEnableAngularMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getEnableAngularMotor : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getEnableAngularMotor(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getEnableAngularMotor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_enableMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableMotor : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableMotor : Error processing arguments"); + cobj->enableMotor(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableMotor : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getBFrame(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getBFrame : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getBFrame(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getBFrame : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setFrames(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setFrames : Invalid Native Object"); + if (argc == 2) { + cocos2d::Mat4 arg0; + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setFrames : Error processing arguments"); + cobj->setFrames(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setFrames : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getUseFrameOffset : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getUseFrameOffset(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getUseFrameOffset : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setAngularOnly(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setAngularOnly : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setAngularOnly : Error processing arguments"); + cobj->setAngularOnly(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setAngularOnly : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Invalid Native Object"); + if (argc == 2) { + double arg0; + double arg1; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1); + args.rval().setUndefined(); + return true; + } + if (argc == 3) { + double arg0; + double arg1; + double arg2; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + if (argc == 4) { + double arg0; + double arg1; + double arg2; + double arg3; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2, arg3); + args.rval().setUndefined(); + return true; + } + if (argc == 5) { + double arg0; + double arg1; + double arg2; + double arg3; + double arg4; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2, arg3, arg4); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + JS::RootedObject obj(cx); + cocos2d::Physics3DHingeConstraint* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget : Invalid Native Object"); + do { + if (argc == 2) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + if (!ok) { ok = true; break; } + double arg1; + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + if (!ok) { ok = true; break; } + cobj->setMotorTarget(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 2) { + cocos2d::Quaternion arg0; + ok &= jsval_to_quaternion(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + double arg1; + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + if (!ok) { ok = true; break; } + cobj->setMotorTarget(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getAngularOnly(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getAngularOnly : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getAngularOnly(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getAngularOnly : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setAxis(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setAxis : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setAxis : Error processing arguments"); + cobj->setAxis(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setAxis : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getAFrame(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DHingeConstraint* cobj = (cocos2d::Physics3DHingeConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getAFrame : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getAFrame(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_getAFrame : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + do { + if (argc == 3) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg2; + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + do { + if (argc == 4) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg2; + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + bool arg3; + arg3 = JS::ToBoolean(args.get(3)); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 2) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + do { + if (argc == 3) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + bool arg2; + arg2 = JS::ToBoolean(args.get(2)); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 6) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg2; + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg3; + ok &= jsval_to_vector3(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg4; + ok &= jsval_to_vector3(cx, args.get(4), &arg4); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg5; + ok &= jsval_to_vector3(cx, args.get(5), &arg5); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3, arg4, arg5); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + do { + if (argc == 7) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg2; + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg3; + ok &= jsval_to_vector3(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg4; + ok &= jsval_to_vector3(cx, args.get(4), &arg4); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg5; + ok &= jsval_to_vector3(cx, args.get(5), &arg5); + if (!ok) { ok = true; break; } + bool arg6; + arg6 = JS::ToBoolean(args.get(6)); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 4) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg2; + ok &= jsval_to_matrix(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg3; + ok &= jsval_to_matrix(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + do { + if (argc == 5) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg2; + ok &= jsval_to_matrix(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg3; + ok &= jsval_to_matrix(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + bool arg4; + arg4 = JS::ToBoolean(args.get(4)); + if (!ok) { ok = true; break; } + cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3, arg4); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DHingeConstraint_create : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DHingeConstraint* cobj = new (std::nothrow) cocos2d::Physics3DHingeConstraint(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DHingeConstraint"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +void js_cocos2d_Physics3DHingeConstraint_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DHingeConstraint)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DHingeConstraint(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DHingeConstraint_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DHingeConstraint_class->name = "Physics3DHingeConstraint"; + jsb_cocos2d_Physics3DHingeConstraint_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DHingeConstraint_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DHingeConstraint_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DHingeConstraint_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DHingeConstraint_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DHingeConstraint_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DHingeConstraint_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DHingeConstraint_class->finalize = js_cocos2d_Physics3DHingeConstraint_finalize; + jsb_cocos2d_Physics3DHingeConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getHingeAngle", js_cocos2dx_physics3d_Physics3DHingeConstraint_getHingeAngle, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMotorTargetVelosity", js_cocos2dx_physics3d_Physics3DHingeConstraint_getMotorTargetVelosity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameOffsetA", js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetA, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameOffsetB", js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMaxMotorImpulse", js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("enableAngularMotor", js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUpperLimit", js_cocos2dx_physics3d_Physics3DHingeConstraint_getUpperLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMaxMotorImpulse", js_cocos2dx_physics3d_Physics3DHingeConstraint_getMaxMotorImpulse, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLowerLimit", js_cocos2dx_physics3d_Physics3DHingeConstraint_getLowerLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUseFrameOffset", js_cocos2dx_physics3d_Physics3DHingeConstraint_setUseFrameOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getEnableAngularMotor", js_cocos2dx_physics3d_Physics3DHingeConstraint_getEnableAngularMotor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("enableMotor", js_cocos2dx_physics3d_Physics3DHingeConstraint_enableMotor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBFrame", js_cocos2dx_physics3d_Physics3DHingeConstraint_getBFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFrames", js_cocos2dx_physics3d_Physics3DHingeConstraint_setFrames, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUseFrameOffset", js_cocos2dx_physics3d_Physics3DHingeConstraint_getUseFrameOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setAngularOnly", js_cocos2dx_physics3d_Physics3DHingeConstraint_setAngularOnly, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLimit", js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMotorTarget", js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularOnly", js_cocos2dx_physics3d_Physics3DHingeConstraint_getAngularOnly, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setAxis", js_cocos2dx_physics3d_Physics3DHingeConstraint_setAxis, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAFrame", js_cocos2dx_physics3d_Physics3DHingeConstraint_getAFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3DHingeConstraint_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DHingeConstraint_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Physics3DConstraint_prototype), + jsb_cocos2d_Physics3DHingeConstraint_class, + js_cocos2dx_physics3d_Physics3DHingeConstraint_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DHingeConstraint", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DHingeConstraint_class; + p->proto = jsb_cocos2d_Physics3DHingeConstraint_prototype; + p->parentProto = jsb_cocos2d_Physics3DConstraint_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DSliderConstraint_class; +JSObject *jsb_cocos2d_Physics3DSliderConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredAngMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredAngMotor : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredAngMotor : Error processing arguments"); + cobj->setPoweredAngMotor(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredAngMotor : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getDampingLimAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin : Error processing arguments"); + cobj->setRestitutionOrthoLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin : Error processing arguments"); + cobj->setRestitutionDirLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getLinearPos(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getLinearPos : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLinearPos(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getLinearPos : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetA : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getFrameOffsetA(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetA : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetB(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetB : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getFrameOffsetB(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetB : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredLinMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredLinMotor : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredLinMotor : Error processing arguments"); + cobj->setPoweredLinMotor(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredLinMotor : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getDampingDirAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitutionLimLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSoftnessOrthoAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin : Error processing arguments"); + cobj->setSoftnessOrthoLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin : Error processing arguments"); + cobj->setSoftnessLimLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getAngularPos(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getAngularPos : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getAngularPos(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getAngularPos : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng : Error processing arguments"); + cobj->setRestitutionLimAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit : Error processing arguments"); + cobj->setUpperLinLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin : Error processing arguments"); + cobj->setDampingDirLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperAngLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperAngLimit : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getUpperAngLimit(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperAngLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getDampingDirLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSoftnessDirAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredAngMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredAngMotor : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getPoweredAngMotor(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredAngMotor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit : Error processing arguments"); + cobj->setLowerAngLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit : Error processing arguments"); + cobj->setUpperAngLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity : Error processing arguments"); + cobj->setTargetLinMotorVelocity(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng : Error processing arguments"); + cobj->setDampingLimAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitutionLimAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseFrameOffset : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getUseFrameOffset(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseFrameOffset : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSoftnessOrthoLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getDampingOrthoAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUseFrameOffset : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUseFrameOffset : Error processing arguments"); + cobj->setUseFrameOffset(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUseFrameOffset : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit : Error processing arguments"); + cobj->setLowerLinLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitutionDirLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetLinMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetLinMotorVelocity : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getTargetLinMotorVelocity(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetLinMotorVelocity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerLinLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerLinLimit : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLowerLinLimit(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerLinLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSoftnessLimLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng : Error processing arguments"); + cobj->setDampingOrthoAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng : Error processing arguments"); + cobj->setSoftnessDirAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredLinMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredLinMotor : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getPoweredLinMotor(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredLinMotor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng : Error processing arguments"); + cobj->setRestitutionOrthoAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng : Error processing arguments"); + cobj->setDampingDirAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setFrames(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setFrames : Invalid Native Object"); + if (argc == 2) { + cocos2d::Mat4 arg0; + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setFrames : Error processing arguments"); + cobj->setFrames(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setFrames : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitutionOrthoAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxAngMotorForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxAngMotorForce : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getMaxAngMotorForce(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxAngMotorForce : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getDampingOrthoLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperLinLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperLinLimit : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getUpperLinLimit(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperLinLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce : Error processing arguments"); + cobj->setMaxLinMotorForce(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitutionOrthoLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity : Error processing arguments"); + cobj->setTargetAngMotorVelocity(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSoftnessLimAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng : Error processing arguments"); + cobj->setRestitutionDirAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getDampingLimLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerAngLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerAngLimit : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLowerAngLimit(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerAngLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirAng : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRestitutionDirAng(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirAng : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetAngMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetAngMotorVelocity : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getTargetAngMotorVelocity(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetAngMotorVelocity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin : Error processing arguments"); + cobj->setRestitutionLimLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxLinMotorForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxLinMotorForce : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getMaxLinMotorForce(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxLinMotorForce : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin : Error processing arguments"); + cobj->setDampingOrthoLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng : Error processing arguments"); + cobj->setSoftnessOrthoAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin : Error processing arguments"); + cobj->setDampingLimLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin : Error processing arguments"); + cobj->setSoftnessDirLin(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce : Error processing arguments"); + cobj->setMaxAngMotorForce(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirLin(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirLin : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSoftnessDirLin(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirLin : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng : Error processing arguments"); + cobj->setSoftnessLimAng(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseLinearReferenceFrameA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DSliderConstraint* cobj = (cocos2d::Physics3DSliderConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseLinearReferenceFrameA : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getUseLinearReferenceFrameA(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseLinearReferenceFrameA : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 5) { + cocos2d::Physics3DRigidBody* arg0; + cocos2d::Physics3DRigidBody* arg1; + cocos2d::Mat4 arg2; + cocos2d::Mat4 arg3; + bool arg4; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + ok &= jsval_to_matrix(cx, args.get(2), &arg2); + ok &= jsval_to_matrix(cx, args.get(3), &arg3); + arg4 = JS::ToBoolean(args.get(4)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_create : Error processing arguments"); + cocos2d::Physics3DSliderConstraint* ret = cocos2d::Physics3DSliderConstraint::create(arg0, arg1, arg2, arg3, arg4); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DSliderConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DSliderConstraint* cobj = new (std::nothrow) cocos2d::Physics3DSliderConstraint(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DSliderConstraint"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +void js_cocos2d_Physics3DSliderConstraint_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DSliderConstraint)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DSliderConstraint(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DSliderConstraint_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DSliderConstraint_class->name = "Physics3DSliderConstraint"; + jsb_cocos2d_Physics3DSliderConstraint_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DSliderConstraint_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DSliderConstraint_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DSliderConstraint_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DSliderConstraint_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DSliderConstraint_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DSliderConstraint_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DSliderConstraint_class->finalize = js_cocos2d_Physics3DSliderConstraint_finalize; + jsb_cocos2d_Physics3DSliderConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("setPoweredAngMotor", js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredAngMotor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getDampingLimAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitutionOrthoLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitutionDirLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLinearPos", js_cocos2dx_physics3d_Physics3DSliderConstraint_getLinearPos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameOffsetA", js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetA, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameOffsetB", js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPoweredLinMotor", js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredLinMotor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getDampingDirAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitutionLimLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSoftnessOrthoAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSoftnessOrthoLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSoftnessLimLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularPos", js_cocos2dx_physics3d_Physics3DSliderConstraint_getAngularPos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitutionLimAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUpperLinLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDampingDirLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUpperAngLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperAngLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getDampingDirLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSoftnessDirAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPoweredAngMotor", js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredAngMotor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLowerAngLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUpperAngLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setTargetLinMotorVelocity", js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDampingLimAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitutionLimAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUseFrameOffset", js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseFrameOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSoftnessOrthoLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getDampingOrthoAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUseFrameOffset", js_cocos2dx_physics3d_Physics3DSliderConstraint_setUseFrameOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLowerLinLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitutionDirLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTargetLinMotorVelocity", js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetLinMotorVelocity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLowerLinLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerLinLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSoftnessLimLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDampingOrthoAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSoftnessDirAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getPoweredLinMotor", js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredLinMotor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitutionOrthoAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDampingDirAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFrames", js_cocos2dx_physics3d_Physics3DSliderConstraint_setFrames, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitutionOrthoAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMaxAngMotorForce", js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxAngMotorForce, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getDampingOrthoLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUpperLinLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperLinLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMaxLinMotorForce", js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitutionOrthoLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setTargetAngMotorVelocity", js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSoftnessLimAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitutionDirAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getDampingLimLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLowerAngLimit", js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerAngLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRestitutionDirAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirAng, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTargetAngMotorVelocity", js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetAngMotorVelocity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRestitutionLimLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMaxLinMotorForce", js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxLinMotorForce, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDampingOrthoLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSoftnessOrthoAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDampingLimLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSoftnessDirLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMaxAngMotorForce", js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSoftnessDirLin", js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirLin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setSoftnessLimAng", js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUseLinearReferenceFrameA", js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseLinearReferenceFrameA, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3DSliderConstraint_create, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DSliderConstraint_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Physics3DConstraint_prototype), + jsb_cocos2d_Physics3DSliderConstraint_class, + js_cocos2dx_physics3d_Physics3DSliderConstraint_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DSliderConstraint", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DSliderConstraint_class; + p->proto = jsb_cocos2d_Physics3DSliderConstraint_prototype; + p->parentProto = jsb_cocos2d_Physics3DConstraint_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3DConeTwistConstraint_class; +JSObject *jsb_cocos2d_Physics3DConeTwistConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getBFrame(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getBFrame : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getBFrame(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getBFrame : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh : Error processing arguments"); + cobj->setFixThresh(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetB(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetB : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getFrameOffsetB(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetB : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetA(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetA : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getFrameOffsetA(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetA : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFixThresh(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFixThresh : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getFixThresh(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFixThresh : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan2(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan2 : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSwingSpan2(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan2 : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan1(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan1 : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getSwingSpan1(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan1 : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse : Error processing arguments"); + cobj->setMaxMotorImpulse(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFrames(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFrames : Invalid Native Object"); + if (argc == 2) { + cocos2d::Mat4 arg0; + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFrames : Error processing arguments"); + cobj->setFrames(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFrames : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistAngle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistAngle : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getTwistAngle(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistAngle : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle : Invalid Native Object"); + if (argc == 2) { + double arg0; + double arg1; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle : Error processing arguments"); + cocos2d::Vec3 ret = cobj->GetPointForAngle(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized : Error processing arguments"); + cobj->setMaxMotorImpulseNormalized(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistSpan(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistSpan : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getTwistSpan(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistSpan : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping : Error processing arguments"); + cobj->setDamping(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Invalid Native Object"); + if (argc == 3) { + double arg0; + double arg1; + double arg2; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + if (argc == 4) { + double arg0; + double arg1; + double arg2; + double arg3; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2, arg3); + args.rval().setUndefined(); + return true; + } + if (argc == 5) { + double arg0; + double arg1; + double arg2; + double arg3; + double arg4; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2, arg3, arg4); + args.rval().setUndefined(); + return true; + } + if (argc == 6) { + double arg0; + double arg1; + double arg2; + double arg3; + double arg4; + double arg5; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Error processing arguments"); + cobj->setLimit(arg0, arg1, arg2, arg3, arg4, arg5); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : wrong number of arguments: %d, was expecting %d", argc, 3); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getAFrame(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getAFrame : Invalid Native Object"); + if (argc == 0) { + cocos2d::Mat4 ret = cobj->getAFrame(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getAFrame : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_enableMotor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DConeTwistConstraint* cobj = (cocos2d::Physics3DConeTwistConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_enableMotor : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_enableMotor : Error processing arguments"); + cobj->enableMotor(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_enableMotor : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + do { + if (argc == 4) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg2; + ok &= jsval_to_matrix(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg3; + ok &= jsval_to_matrix(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + cocos2d::Physics3DConeTwistConstraint* ret = cocos2d::Physics3DConeTwistConstraint::create(arg0, arg1, arg2, arg3); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DConeTwistConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 2) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Physics3DConeTwistConstraint* ret = cocos2d::Physics3DConeTwistConstraint::create(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DConeTwistConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_create : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DConeTwistConstraint* cobj = new (std::nothrow) cocos2d::Physics3DConeTwistConstraint(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DConeTwistConstraint"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +void js_cocos2d_Physics3DConeTwistConstraint_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DConeTwistConstraint)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3DConeTwistConstraint(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3DConeTwistConstraint_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3DConeTwistConstraint_class->name = "Physics3DConeTwistConstraint"; + jsb_cocos2d_Physics3DConeTwistConstraint_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3DConeTwistConstraint_class->finalize = js_cocos2d_Physics3DConeTwistConstraint_finalize; + jsb_cocos2d_Physics3DConeTwistConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getBFrame", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getBFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFixThresh", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameOffsetB", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameOffsetA", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetA, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFixThresh", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFixThresh, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSwingSpan2", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan2, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getSwingSpan1", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan1, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMaxMotorImpulse", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFrames", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFrames, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTwistAngle", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistAngle, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("GetPointForAngle", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMaxMotorImpulseNormalized", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTwistSpan", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistSpan, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDamping", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLimit", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAFrame", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getAFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("enableMotor", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_enableMotor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3DConeTwistConstraint_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3DConeTwistConstraint_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Physics3DConstraint_prototype), + jsb_cocos2d_Physics3DConeTwistConstraint_class, + js_cocos2dx_physics3d_Physics3DConeTwistConstraint_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3DConeTwistConstraint", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3DConeTwistConstraint_class; + p->proto = jsb_cocos2d_Physics3DConeTwistConstraint_prototype; + p->parentProto = jsb_cocos2d_Physics3DConstraint_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_Physics3D6DofConstraint_class; +JSObject *jsb_cocos2d_Physics3D6DofConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearLowerLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearLowerLimit : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearLowerLimit : Error processing arguments"); + cobj->setLinearLowerLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearLowerLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearLowerLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearLowerLimit : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getLinearLowerLimit(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearLowerLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularUpperLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularUpperLimit : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getAngularUpperLimit(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularUpperLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getUseFrameOffset : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getUseFrameOffset(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getUseFrameOffset : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearUpperLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearUpperLimit : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getLinearUpperLimit(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearUpperLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularLowerLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularLowerLimit : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularLowerLimit : Error processing arguments"); + cobj->setAngularLowerLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularLowerLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_isLimited(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_isLimited : Invalid Native Object"); + if (argc == 1) { + int arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_isLimited : Error processing arguments"); + bool ret = cobj->isLimited(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_isLimited : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setUseFrameOffset : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setUseFrameOffset : Error processing arguments"); + cobj->setUseFrameOffset(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setUseFrameOffset : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearUpperLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearUpperLimit : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearUpperLimit : Error processing arguments"); + cobj->setLinearUpperLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearUpperLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularLowerLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularLowerLimit : Invalid Native Object"); + if (argc == 0) { + cocos2d::Vec3 ret = cobj->getAngularLowerLimit(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularLowerLimit : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularUpperLimit(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3D6DofConstraint* cobj = (cocos2d::Physics3D6DofConstraint *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularUpperLimit : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularUpperLimit : Error processing arguments"); + cobj->setAngularUpperLimit(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularUpperLimit : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + + do { + if (argc == 3) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + bool arg2; + arg2 = JS::ToBoolean(args.get(2)); + if (!ok) { ok = true; break; } + cocos2d::Physics3D6DofConstraint* ret = cocos2d::Physics3D6DofConstraint::create(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3D6DofConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + + do { + if (argc == 5) { + cocos2d::Physics3DRigidBody* arg0; + do { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Physics3DRigidBody* arg1; + do { + if (!args.get(1).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(1).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg1 = (cocos2d::Physics3DRigidBody*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg2; + ok &= jsval_to_matrix(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg3; + ok &= jsval_to_matrix(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + bool arg4; + arg4 = JS::ToBoolean(args.get(4)); + if (!ok) { ok = true; break; } + cocos2d::Physics3D6DofConstraint* ret = cocos2d::Physics3D6DofConstraint::create(arg0, arg1, arg2, arg3, arg4); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3D6DofConstraint*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + } while (0); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3D6DofConstraint_create : wrong number of arguments"); + return false; +} +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3D6DofConstraint* cobj = new (std::nothrow) cocos2d::Physics3D6DofConstraint(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3D6DofConstraint"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +void js_cocos2d_Physics3D6DofConstraint_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Physics3D6DofConstraint)", obj); +} + +void js_register_cocos2dx_physics3d_Physics3D6DofConstraint(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Physics3D6DofConstraint_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Physics3D6DofConstraint_class->name = "Physics3D6DofConstraint"; + jsb_cocos2d_Physics3D6DofConstraint_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Physics3D6DofConstraint_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Physics3D6DofConstraint_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Physics3D6DofConstraint_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Physics3D6DofConstraint_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Physics3D6DofConstraint_class->resolve = JS_ResolveStub; + jsb_cocos2d_Physics3D6DofConstraint_class->convert = JS_ConvertStub; + jsb_cocos2d_Physics3D6DofConstraint_class->finalize = js_cocos2d_Physics3D6DofConstraint_finalize; + jsb_cocos2d_Physics3D6DofConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("setLinearLowerLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearLowerLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLinearLowerLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearLowerLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularUpperLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularUpperLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUseFrameOffset", js_cocos2dx_physics3d_Physics3D6DofConstraint_getUseFrameOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLinearUpperLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearUpperLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setAngularLowerLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularLowerLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isLimited", js_cocos2dx_physics3d_Physics3D6DofConstraint_isLimited, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUseFrameOffset", js_cocos2dx_physics3d_Physics3D6DofConstraint_setUseFrameOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLinearUpperLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearUpperLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getAngularLowerLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularLowerLimit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setAngularUpperLimit", js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularUpperLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_physics3d_Physics3D6DofConstraint_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Physics3D6DofConstraint_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_Physics3DConstraint_prototype), + jsb_cocos2d_Physics3D6DofConstraint_class, + js_cocos2dx_physics3d_Physics3D6DofConstraint_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Physics3D6DofConstraint", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Physics3D6DofConstraint_class; + p->proto = jsb_cocos2d_Physics3D6DofConstraint_prototype; + p->parentProto = jsb_cocos2d_Physics3DConstraint_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj) { + // Get the ns + JS::RootedObject ns(cx); + get_or_create_js_obj(cx, obj, "cc", &ns); + + js_register_cocos2dx_physics3d_Physics3DConstraint(cx, ns); + js_register_cocos2dx_physics3d_Physics3D6DofConstraint(cx, ns); + js_register_cocos2dx_physics3d_Physics3DObject(cx, ns); + js_register_cocos2dx_physics3d_Physics3DRigidBody(cx, ns); + js_register_cocos2dx_physics3d_Physics3DWorld(cx, ns); + js_register_cocos2dx_physics3d_Physics3DSliderConstraint(cx, ns); + js_register_cocos2dx_physics3d_Physics3DComponent(cx, ns); + js_register_cocos2dx_physics3d_Physics3DConeTwistConstraint(cx, ns); + js_register_cocos2dx_physics3d_Physics3DPointToPointConstraint(cx, ns); + js_register_cocos2dx_physics3d_PhysicsSprite3D(cx, ns); + js_register_cocos2dx_physics3d_Physics3DHingeConstraint(cx, ns); + js_register_cocos2dx_physics3d_Physics3DShape(cx, ns); +} + diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp new file mode 100644 index 0000000000..b1986537fc --- /dev/null +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp @@ -0,0 +1,343 @@ +#ifndef __cocos2dx_physics3d_h__ +#define __cocos2dx_physics3d_h__ + +#include "jsapi.h" +#include "jsfriendapi.h" + + +extern JSClass *jsb_cocos2d_Physics3DShape_class; +extern JSObject *jsb_cocos2d_Physics3DShape_prototype; + +bool js_cocos2dx_physics3d_Physics3DShape_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DShape_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DShape(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DShape_getbtShape(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DShape_getShapeType(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DShape_createBox(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DShape_createCylinder(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DShape_createConvexHull(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DShape_createCapsule(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DShape_createSphere(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DObject_class; +extern JSObject *jsb_cocos2d_Physics3DObject_prototype; + +bool js_cocos2dx_physics3d_Physics3DObject_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DObject_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DObject(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DObject_setUserData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_getUserData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_getObjType(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_setPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_getWorldTransform(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_getPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_setMask(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_getCollisionCallback(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_getMask(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DObject_needCollisionCallback(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DRigidBody_class; +extern JSObject *jsb_cocos2d_Physics3DRigidBody_prototype; + +bool js_cocos2dx_physics3d_Physics3DRigidBody_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DRigidBody_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DRigidBody(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setGravity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getFriction(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setAngularFactor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_addConstraint(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getRigidBody(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getTotalForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getConstraintCount(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setFriction(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setKinematic(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setDamping(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_isKinematic(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyTorque(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getCcdMotionThreshold(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getLinearFactor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getAngularVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_init(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyTorqueImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setActive(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setLinearFactor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setLinearVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getLinearVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setAngularVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_applyCentralImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getGravity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getRollingFriction(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setCenterOfMassTransform(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setInvInertiaDiagLocal(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_removeConstraint(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getTotalTorque(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getInvMass(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getRestitution(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getCcdSweptSphereRadius(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getHitFraction(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getAngularDamping(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getInvInertiaDiagLocal(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getCenterOfMassTransform(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getAngularFactor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_getLinearDamping(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DRigidBody_Physics3DRigidBody(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DComponent_class; +extern JSObject *jsb_cocos2d_Physics3DComponent_prototype; + +bool js_cocos2dx_physics3d_Physics3DComponent_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DComponent_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_syncToNode(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_setTransformInPhysics(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DComponentName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DComponent_Physics3DComponent(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_PhysicsSprite3D_class; +extern JSObject *jsb_cocos2d_PhysicsSprite3D_prototype; + +bool js_cocos2dx_physics3d_PhysicsSprite3D_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_PhysicsSprite3D_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_PhysicsSprite3D_PhysicsSprite3D(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DWorld_class; +extern JSObject *jsb_cocos2d_Physics3DWorld_prototype; + +bool js_cocos2dx_physics3d_Physics3DWorld_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DWorld_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_collisionChecking(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_init(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_rayCast(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_debugDraw(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_sweepShape(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_Physics3DWorld(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DConstraint_class; +extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DConstraint_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DConstraint(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DConstraint_setEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getUserData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getBreakingImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getBodyA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_isEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getOverrideNumSolverIterations(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getBodyB(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_setOverrideNumSolverIterations(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getConstraintType(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_setUserData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DPointToPointConstraint_class; +extern JSObject *jsb_cocos2d_Physics3DPointToPointConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DPointToPointConstraint_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DPointToPointConstraint(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_getPivotPointInB(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_setPivotPointInB(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_Physics3DPointToPointConstraint(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DHingeConstraint_class; +extern JSObject *jsb_cocos2d_Physics3DHingeConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DHingeConstraint_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DHingeConstraint(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getHingeAngle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getMotorTargetVelosity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getFrameOffsetB(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getUpperLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getMaxMotorImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getLowerLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getEnableAngularMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_enableMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getBFrame(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setFrames(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setAngularOnly(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getAngularOnly(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setAxis(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_getAFrame(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DHingeConstraint_Physics3DHingeConstraint(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DSliderConstraint_class; +extern JSObject *jsb_cocos2d_Physics3DSliderConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DSliderConstraint_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DSliderConstraint(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredAngMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getLinearPos(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getFrameOffsetB(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setPoweredLinMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getAngularPos(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperAngLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingDirLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredAngMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionLimAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessOrthoLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetLinMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerLinLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getPoweredLinMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setFrames(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxAngMotorForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingOrthoLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUpperLinLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionOrthoLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessLimAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getDampingLimLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getLowerAngLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getRestitutionDirAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getTargetAngMotorVelocity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getMaxLinMotorForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getSoftnessDirLin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_getUseLinearReferenceFrameA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DSliderConstraint_Physics3DSliderConstraint(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3DConeTwistConstraint_class; +extern JSObject *jsb_cocos2d_Physics3DConeTwistConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3DConeTwistConstraint_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3DConeTwistConstraint(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getBFrame(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetB(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFrameOffsetA(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getFixThresh(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan2(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getSwingSpan1(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFrames(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistAngle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getTwistSpan(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_getAFrame(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_enableMotor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_Physics3DConeTwistConstraint(JSContext *cx, uint32_t argc, jsval *vp); + +extern JSClass *jsb_cocos2d_Physics3D6DofConstraint_class; +extern JSObject *jsb_cocos2d_Physics3D6DofConstraint_prototype; + +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_physics3d_Physics3D6DofConstraint_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_physics3d_Physics3D6DofConstraint(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearLowerLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearLowerLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularUpperLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getLinearUpperLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularLowerLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_isLimited(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setUseFrameOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setLinearUpperLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_getAngularLowerLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_setAngularUpperLimit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3D6DofConstraint_Physics3D6DofConstraint(JSContext *cx, uint32_t argc, jsval *vp); +#endif + diff --git a/cocos/scripting/js-bindings/manual/3d/jsb_cocos2dx_3d_manual.cpp b/cocos/scripting/js-bindings/manual/3d/jsb_cocos2dx_3d_manual.cpp index 9085c4670d..87e22e3f36 100644 --- a/cocos/scripting/js-bindings/manual/3d/jsb_cocos2dx_3d_manual.cpp +++ b/cocos/scripting/js-bindings/manual/3d/jsb_cocos2dx_3d_manual.cpp @@ -26,6 +26,7 @@ #include "jsb_cocos2dx_3d_manual.h" #include "cocos2d_specifics.hpp" #include "jsb_cocos2dx_3d_auto.hpp" +#include "3d/CCBundle3D.h" using namespace cocos2d; @@ -284,6 +285,60 @@ bool js_cocos2dx_Terrain_create(JSContext *cx, uint32_t argc, jsval *vp) return false; } +jsval std_vector_vec3_to_jsval(JSContext* cx, const std::vector& triangles) +{ + JS::RootedObject jsarr(cx, JS_NewArrayObject(cx, triangles.size())); + + uint32_t i = 0; + for(auto iter = triangles.begin(); iter != triangles.end(); ++iter) + { + JS::RootedValue element(cx, vector3_to_jsval(cx, *iter)); + JS_SetElement(cx, jsarr, i, element); + ++i; + } + + return OBJECT_TO_JSVAL(jsarr); +} + +bool js_cocos2dx_Bundle3D_getTrianglesList(JSContext *cx, uint32_t argc, jsval *vp) +{ + if(argc == 1) + { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + std::string path; + bool ok = jsval_to_std_string(cx, args.get(0), &path); + JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); + + std::vector triangles = cocos2d::Bundle3D::getTrianglesList(path); + + JS::RootedValue ret(cx, std_vector_vec3_to_jsval(cx, triangles)); + args.rval().set(ret); + return true; + } + JS_ReportError(cx, "wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Terrain_getHeightData(JSContext *cx, uint32_t argc, jsval *vp) +{ + if(argc == 0) + { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Terrain* cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Terrain_getHeightData : Invalid Native Object"); + + auto data = cobj->getHeightData(); + + args.rval().set(std_vector_float_to_jsval(cx, data)); + return true; + } + JS_ReportError(cx, "wrong number of arguments"); + return false; +} + void register_all_cocos2dx_3d_manual(JSContext *cx, JS::HandleObject global) { JS::RootedValue tmpVal(cx); @@ -299,9 +354,15 @@ void register_all_cocos2dx_3d_manual(JSContext *cx, JS::HandleObject global) tmpObj = tmpVal.toObjectOrNull(); JS_DefineFunction(cx, tmpObj, "create", js_cocos2dx_Terrain_create, 2, JSPROP_READONLY | JSPROP_PERMANENT); + JS_GetProperty(cx, ccObj, "Bundle3D", &tmpVal); + tmpObj = tmpVal.toObjectOrNull(); + JS_DefineFunction(cx, tmpObj, "getTrianglesList", js_cocos2dx_Bundle3D_getTrianglesList, 1, JSPROP_READONLY | JSPROP_PERMANENT); + JS_DefineFunction(cx, JS::RootedObject(cx, jsb_cocos2d_Sprite3D_prototype), "getAABB", js_cocos2dx_Sprite3D_getAABB, 0, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, JS::RootedObject(cx, jsb_cocos2d_Mesh_prototype), "getMeshVertexAttribute", js_cocos2dx_Mesh_getMeshVertexAttribute, 1, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, JS::RootedObject(cx, jsb_cocos2d_TextureCube_prototype), "setTexParameters", js_cocos2dx_CCTextureCube_setTexParameters, 4, JSPROP_READONLY | JSPROP_PERMANENT); + + JS_DefineFunction(cx, JS::RootedObject(cx, jsb_cocos2d_Terrain_prototype), "getHeightData", js_cocos2dx_Terrain_getHeightData, 0, JSPROP_READONLY | JSPROP_PERMANENT); } diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index 935d212a2d..05e1fe2528 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -34,7 +34,7 @@ #include "jsb_cocos2dx_auto.hpp" #include "js_bindings_config.h" // for debug socket -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #include #include #else @@ -105,7 +105,7 @@ static std::unordered_map globals; static void cc_closesocket(int fd) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) closesocket(fd); #else close(fd); @@ -347,8 +347,6 @@ bool JSBCore_os(JSContext *cx, uint32_t argc, jsval *vp) os = JS_InternString(cx, "Blackberry"); #elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) os = JS_InternString(cx, "OS X"); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) - os = JS_InternString(cx, "WP8"); #elif (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) os = JS_InternString(cx, "WINRT"); #else @@ -1650,7 +1648,7 @@ static void serverEntryPoint(unsigned int port) int err = 0; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) WSADATA wsaData; err = WSAStartup(MAKEWORD(2, 2),&wsaData); #endif diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 1c53e0e0f0..392d8bf0db 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -5339,6 +5339,89 @@ void get_or_create_js_obj(JSContext* cx, JS::HandleObject obj, const std::string } } +#if CC_ENABLE_BULLET_INTEGRATION && CC_USE_3D_PHYSICS + +#include "physics3d/CCPhysics3D.h" + +bool js_cocos2dx_Scene_setPhysics3DDebugCamera(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Scene* cobj = (cocos2d::Scene *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Scene_setPhysics3DDebugCamera : Invalid Native Object"); + if (argc == 1) + { + cocos2d::Camera* arg0; + do + { + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Camera*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Scene_setPhysics3DDebugCamera : Error processing arguments"); + cobj->setPhysics3DDebugCamera(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Scene_setPhysics3DDebugCamera : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Scene_initWithPhysics(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Scene* cobj = (cocos2d::Scene *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Scene_initWithPhysics : Invalid Native Object"); + if (argc == 0) + { + bool ret = cobj->initWithPhysics(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Scene_initWithPhysics : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Scene_getPhysics3DWorld(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Scene* cobj = (cocos2d::Scene *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Scene_getPhysics3DWorld : Invalid Native Object"); + if (argc == 0) + { + cocos2d::Physics3DWorld* ret = cobj->getPhysics3DWorld(); + jsval jsret = JSVAL_NULL; + do + { + if (ret) + { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DWorld*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else + { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Scene_getPhysics3DWorld : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +#endif //CC_ENABLE_BULLET_INTEGRATION && CC_USE_3D_PHYSICS + void register_cocos2dx_js_core(JSContext* cx, JS::HandleObject global) { JS::RootedObject ccObj(cx); @@ -5633,4 +5716,11 @@ void register_cocos2dx_js_core(JSContext* cx, JS::HandleObject global) get_or_create_js_obj(cx, global, "console", &tmpObj); JS_DefineFunction(cx, tmpObj, "log", js_console_log, 1, JSPROP_READONLY | JSPROP_PERMANENT); + +#if CC_ENABLE_BULLET_INTEGRATION && CC_USE_3D_PHYSICS + tmpObj.set(jsb_cocos2d_Scene_prototype); + JS_DefineFunction(cx, tmpObj, "setPhysics3DDebugCamera", js_cocos2dx_Scene_setPhysics3DDebugCamera, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, tmpObj, "initWithPhysics", js_cocos2dx_Scene_initWithPhysics, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, tmpObj, "getPhysics3DWorld", js_cocos2dx_Scene_getPhysics3DWorld, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); +#endif //CC_ENABLE_BULLET_INTEGRATION && CC_USE_3D_PHYSICS } diff --git a/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_manual.cpp b/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_manual.cpp index bd4e2fe5b3..4975cbced3 100644 --- a/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_manual.cpp +++ b/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_manual.cpp @@ -303,7 +303,7 @@ static bool js_cocos2dx_studio_ActionManagerEx_initWithDictionaryEx(JSContext *c rapidjson::Document arg1Jsondoc; arg1Jsondoc.Parse<0>(arg1); if (arg1Jsondoc.HasParseError()) { - CCLOG("GetParseError %s\n",arg1Jsondoc.GetParseError()); + CCLOG("GetParseError %d\n",arg1Jsondoc.GetParseError()); } do { if (!args.get(2).isObject()) { ok = false; break; } diff --git a/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp b/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp index 187ddadab5..6b85f98ced 100644 --- a/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp +++ b/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp @@ -523,7 +523,7 @@ bool jsval_to_long_long(JSContext *cx, JS::HandleValue vp, long long* r) JSB_PRECONDITION2(str, cx, false, "Error encoding string"); char *endptr; -#if(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +#if(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) __int64 ret = _strtoi64(str, &endptr, 10); #else long long ret = strtoll(str, &endptr, 10); @@ -1337,7 +1337,7 @@ bool jsval_to_std_vector_string( JSContext *cx, JS::HandleValue vp, std::vector< uint32_t len = 0; JS_GetArrayLength(cx, jsobj, &len); - + ret->reserve(len); for (uint32_t i=0; i < len; i++) { JS::RootedValue value(cx); @@ -1368,7 +1368,7 @@ bool jsval_to_std_vector_int( JSContext *cx, JS::HandleValue vp, std::vectorreserve(len); for (uint32_t i=0; i < len; i++) { JS::RootedValue value(cx); @@ -1394,6 +1394,41 @@ bool jsval_to_std_vector_int( JSContext *cx, JS::HandleValue vp, std::vector* ret) +{ + JS::RootedObject jsobj(cx); + bool ok = vp.isObject() && JS_ValueToObject( cx, vp, &jsobj ); + JSB_PRECONDITION3( ok, cx, false, "Error converting value to object"); + JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj), cx, false, "Object must be an array"); + + uint32_t len = 0; + JS_GetArrayLength(cx, jsobj, &len); + ret->reserve(len); + for (uint32_t i=0; i < len; i++) + { + JS::RootedValue value(cx); + if (JS_GetElement(cx, jsobj, i, &value)) + { + if (value.isNumber()) + { + double number = 0.0; + ok = JS::ToNumber(cx, value, &number); + if (ok) + { + ret->push_back(number); + } + } + else + { + JS_ReportError(cx, "not supported type in array"); + return false; + } + } + } + + return true; +} + bool jsval_to_matrix(JSContext *cx, JS::HandleValue vp, cocos2d::Mat4* ret) { JS::RootedObject jsobj(cx); @@ -2458,7 +2493,7 @@ jsval ssize_to_jsval(JSContext *cx, ssize_t v) jsval std_vector_string_to_jsval( JSContext *cx, const std::vector& v) { - JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, 0)); + JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, v.size())); int i = 0; for (const std::string obj : v) @@ -2476,7 +2511,7 @@ jsval std_vector_string_to_jsval( JSContext *cx, const std::vector& jsval std_vector_int_to_jsval( JSContext *cx, const std::vector& v) { - JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, 0)); + JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, v.size())); int i = 0; for (const int obj : v) @@ -2492,6 +2527,24 @@ jsval std_vector_int_to_jsval( JSContext *cx, const std::vector& v) return OBJECT_TO_JSVAL(jsretArr); } +jsval std_vector_float_to_jsval( JSContext *cx, const std::vector& v) +{ + JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, v.size())); + + int i = 0; + for (const float obj : v) + { + JS::RootedValue arrElement(cx); + arrElement = DOUBLE_TO_JSVAL(obj); + + if (!JS_SetElement(cx, jsretArr, i, arrElement)) { + break; + } + ++i; + } + return OBJECT_TO_JSVAL(jsretArr); +} + jsval matrix_to_jsval(JSContext *cx, const cocos2d::Mat4& v) { JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, 16)); diff --git a/cocos/scripting/js-bindings/manual/js_manual_conversions.h b/cocos/scripting/js-bindings/manual/js_manual_conversions.h index 575dc940c6..9d9b1b8538 100644 --- a/cocos/scripting/js-bindings/manual/js_manual_conversions.h +++ b/cocos/scripting/js-bindings/manual/js_manual_conversions.h @@ -181,6 +181,7 @@ bool jsval_to_ccvaluevector(JSContext* cx, JS::HandleValue v, cocos2d::ValueVect bool jsval_to_ssize( JSContext *cx, JS::HandleValue vp, ssize_t* ret); bool jsval_to_std_vector_string( JSContext *cx, JS::HandleValue vp, std::vector* ret); bool jsval_to_std_vector_int( JSContext *cx, JS::HandleValue vp, std::vector* ret); +bool jsval_to_std_vector_float( JSContext *cx, JS::HandleValue vp, std::vector* ret); bool jsval_to_matrix(JSContext *cx, JS::HandleValue vp, cocos2d::Mat4* ret); bool jsval_to_vector2(JSContext *cx, JS::HandleValue vp, cocos2d::Vec2* ret); bool jsval_to_vector3(JSContext *cx, JS::HandleValue vp, cocos2d::Vec3* ret); @@ -327,6 +328,7 @@ jsval ccvaluevector_to_jsval(JSContext* cx, const cocos2d::ValueVector& v); jsval ssize_to_jsval(JSContext *cx, ssize_t v); jsval std_vector_string_to_jsval( JSContext *cx, const std::vector& v); jsval std_vector_int_to_jsval( JSContext *cx, const std::vector& v); +jsval std_vector_float_to_jsval( JSContext *cx, const std::vector& v); jsval matrix_to_jsval(JSContext *cx, const cocos2d::Mat4& v); jsval vector2_to_jsval(JSContext *cx, const cocos2d::Vec2& v); jsval vector3_to_jsval(JSContext *cx, const cocos2d::Vec3& v); diff --git a/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp b/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp new file mode 100644 index 0000000000..0936ffb8f6 --- /dev/null +++ b/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp @@ -0,0 +1,324 @@ +/**************************************************************************** + Copyright (c) 2008-2010 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "jsb_cocos2dx_physics3d_manual.h" + +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + +#include "jsb_cocos2dx_physics3d_auto.hpp" +#include "cocos2d_specifics.hpp" +#include "physics3d/CCPhysics3D.h" + +using namespace cocos2d; + +bool jsval_to_physics3DRigidBodyDes(JSContext* cx, JS::HandleValue v, Physics3DRigidBodyDes* des) +{ + JS::RootedObject jsobj(cx, v.toObjectOrNull()); + JS::RootedValue tmp(cx); + + if(JS_GetProperty(cx, jsobj, "mass", &tmp)) + { + des->mass = tmp.toNumber(); + } + if(JS_GetProperty(cx, jsobj, "shape", &tmp)) + { + js_proxy_t* proxy = jsb_get_js_proxy(tmp.toObjectOrNull()); + des->shape = proxy ? (cocos2d::Physics3DShape*)proxy->ptr : nullptr; + } + if(JS_GetProperty(cx, jsobj, "localInertia", &tmp)) + { + Vec3 v3; + jsval_to_vector3(cx, tmp, &v3); + des->localInertia = v3; + } + if(JS_GetProperty(cx, jsobj, "originalTransform", &tmp)) + { + Mat4 m4; + jsval_to_matrix(cx, tmp, &m4); + des->originalTransform = m4; + } + return true; +} + +bool js_cocos2dx_PhysicsSprite3D_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 2) + { + std::string arg0; + cocos2d::Physics3DRigidBodyDes arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_physics3DRigidBodyDes(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_create : Error processing arguments"); + cocos2d::PhysicsSprite3D* ret = cocos2d::PhysicsSprite3D::create(arg0, &arg1); + + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PhysicsSprite3D*)ret); + jsval jsret = jsProxy ? OBJECT_TO_JSVAL(jsProxy->obj) : JSVAL_VOID; + + args.rval().set(jsret); + return true; + } + if (argc == 3) + { + std::string arg0; + cocos2d::Physics3DRigidBodyDes arg1; + cocos2d::Vec3 arg2; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_physics3DRigidBodyDes(cx, args.get(1), &arg1); + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_create : Error processing arguments"); + cocos2d::PhysicsSprite3D* ret = cocos2d::PhysicsSprite3D::create(arg0, &arg1, arg2); + + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PhysicsSprite3D*)ret); + jsval jsret = jsProxy ? OBJECT_TO_JSVAL(jsProxy->obj) : JSVAL_VOID; + + args.rval().set(jsret); + return true; + } + if (argc == 4) + { + std::string arg0; + cocos2d::Physics3DRigidBodyDes arg1; + cocos2d::Vec3 arg2; + cocos2d::Quaternion arg3; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_physics3DRigidBodyDes(cx, args.get(1), &arg1); + ok &= jsval_to_vector3(cx, args.get(2), &arg2); + ok &= jsval_to_quaternion(cx, args.get(3), &arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_create : Error processing arguments"); + cocos2d::PhysicsSprite3D* ret = cocos2d::PhysicsSprite3D::create(arg0, &arg1, arg2, arg3); + + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PhysicsSprite3D*)ret); + jsval jsret = jsProxy ? OBJECT_TO_JSVAL(jsProxy->obj) : JSVAL_VOID; + + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3DRigidBody_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + if (argc == 1) + { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Physics3DRigidBodyDes arg0; + ok &= jsval_to_physics3DRigidBodyDes(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_create : Error processing arguments"); + cocos2d::Physics3DRigidBody* ret = cocos2d::Physics3DRigidBody::create(&arg0); + + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DRigidBody*)ret); + jsval jsret = OBJECT_TO_JSVAL(jsProxy->obj); + + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DRigidBody_create : wrong number of arguments"); + return false; +} + +std::vector jsval_to_std_vector_vec3(JSContext* cx, JS::HandleValue v) +{ + std::vector ret; + JS::RootedObject jsobj(cx, v.toObjectOrNull()); + uint32_t length; + JS_GetArrayLength(cx, jsobj, &length); + ret.reserve(length); + + for(size_t i = 0; i < length; ++i) + { + JS::RootedValue element(cx); + JS_GetElement(cx, jsobj, (uint32_t)i, &element); + + Vec3 v3; + jsval_to_vector3(cx, element, &v3); + ret.push_back(v3); + } + return ret; +} + +bool js_cocos2dx_physics3d_Physics3dShape_createMesh(JSContext *cx, uint32_t argc, jsval *vp) +{ + if(argc == 2) + { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + std::vector arg0 = jsval_to_std_vector_vec3(cx, args.get(0)); + int arg1; + + bool ok = jsval_to_int(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3dShape_createMesh : Error processing arguments"); + + Physics3DShape* ret = Physics3DShape::createMesh(&arg0[0], arg1); + js_proxy_t* proxy = js_get_or_create_proxy(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(proxy->obj); + + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3dShape_createMesh : wrong number of arguments"); + return false; +} + +jsval physics3d_collisionPoint_to_jsval(JSContext*cx, const Physics3DCollisionInfo::CollisionPoint& point) +{ + JS::RootedObject tmp(cx, JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr())); + + JS_DefineProperty(cx, tmp, "localPositionOnA", JS::RootedValue(cx, vector3_to_jsval(cx, point.localPositionOnA)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineProperty(cx, tmp, "localPositionOnB", JS::RootedValue(cx, vector3_to_jsval(cx, point.localPositionOnB)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineProperty(cx, tmp, "worldPositionOnA", JS::RootedValue(cx, vector3_to_jsval(cx, point.worldPositionOnA)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineProperty(cx, tmp, "worldPositionOnB", JS::RootedValue(cx, vector3_to_jsval(cx, point.worldPositionOnB)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineProperty(cx, tmp, "worldNormalOnB", JS::RootedValue(cx, vector3_to_jsval(cx, point.worldNormalOnB)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + + return OBJECT_TO_JSVAL(tmp); +} + +jsval physics3d_collisioninfo_to_jsval(JSContext* cx, const Physics3DCollisionInfo& ci) +{ + JS::RootedObject tmp(cx, JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr())); + + js_proxy_t* proxy = js_get_or_create_proxy(cx, ci.objA); + JS_DefineProperty(cx, tmp, "objA", JS::RootedValue(cx, OBJECT_TO_JSVAL(proxy->obj)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + + proxy = js_get_or_create_proxy(cx, ci.objB); + JS_DefineProperty(cx, tmp, "objB", JS::RootedValue(cx, OBJECT_TO_JSVAL(proxy->obj)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + + JS::RootedObject jsarr(cx, JS_NewArrayObject(cx, ci.collisionPointList.size())); + uint32_t i = 0; + for(auto iter = ci.collisionPointList.begin(); iter != ci.collisionPointList.end(); ++iter) + { + JS::RootedValue element(cx, physics3d_collisionPoint_to_jsval(cx, *iter)); + JS_SetElement(cx, jsarr, i++, element); + } + JS_DefineProperty(cx, tmp, "collisionPointList", JS::RootedValue(cx, OBJECT_TO_JSVAL(jsarr)), JSPROP_ENUMERATE | JSPROP_PERMANENT); + + return OBJECT_TO_JSVAL(tmp); +} + +bool jsb_cocos2d_Physics3DObject_setCollisionCallback(JSContext *cx, uint32_t argc, jsval *vp) +{ + if(argc == 2) + { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DObject* cobj = (cocos2d::Physics3DObject *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "jsb_cocos2d_Physics3DObject_setCollisionCallback : Invalid Native Object"); + + std::function arg0; + std::shared_ptr func(new JSFunctionWrapper(cx, args.get(1).toObjectOrNull(), args.get(0))); + auto lambda = [=](const Physics3DCollisionInfo &ci) -> void { + JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET + + jsval jsci = physics3d_collisioninfo_to_jsval(cx, ci); + JS::RootedValue rval(cx); + bool ok = func->invoke(1, &jsci, &rval); + if (!ok && JS_IsExceptionPending(cx)) + { + JS_ReportPendingException(cx); + } + }; + arg0 = lambda; + cobj->setCollisionCallback(arg0); + + args.rval().setUndefined(); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3dShape_createMesh : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_physics3d_Physics3dShape_createHeightfield(JSContext *cx, uint32_t argc, jsval *vp) +{ + if (argc == 8 || argc == 9) + { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + int arg0; + int arg1; + std::vector arg2; + double arg3; + double arg4; + double arg5; + bool arg6; + bool arg7; + bool arg8; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); + ok &= jsval_to_std_vector_float(cx, args.get(2), &arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + arg6 = JS::ToBoolean(args.get(6)); + arg7 = JS::ToBoolean(args.get(7)); + if(argc == 9) + arg8 = JS::ToBoolean(args.get(8)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createHeightfield : Error processing arguments"); + + cocos2d::Physics3DShape* ret = nullptr; + if(argc == 8) + ret = cocos2d::Physics3DShape::createHeightfield(arg0, arg1, &arg2[0], arg3, arg4, arg5, arg6, arg7); + else if(argc == 9) + ret = cocos2d::Physics3DShape::createHeightfield(arg0, arg1, &arg2[0], arg3, arg4, arg5, arg6, arg7, arg8); + + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(jsProxy->obj); + + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createHeightfield : wrong number of arguments"); + return false; +} + +void register_all_cocos2dx_physics3d_manual(JSContext *cx, JS::HandleObject global) +{ + JS::RootedObject ccObj(cx); + get_or_create_js_obj(cx, global, "cc", &ccObj); + + JS::RootedValue tmpVal(cx); + JS_GetProperty(cx, ccObj, "PhysicsSprite3D", &tmpVal); + JS::RootedObject tmpObj(cx, tmpVal.toObjectOrNull()); + JS_DefineFunction(cx, tmpObj, "create", js_cocos2dx_PhysicsSprite3D_create, 2, JSPROP_READONLY | JSPROP_PERMANENT); + + JS_GetProperty(cx, ccObj, "Physics3DRigidBody", &tmpVal); + tmpObj = tmpVal.toObjectOrNull(); + JS_DefineFunction(cx, tmpObj, "create", js_cocos2dx_physics3d_Physics3DRigidBody_create, 1, JSPROP_READONLY | JSPROP_PERMANENT); + + JS_GetProperty(cx, ccObj, "Physics3DShape", &tmpVal); + tmpObj = tmpVal.toObjectOrNull(); + JS_DefineFunction(cx, tmpObj, "createMesh", js_cocos2dx_physics3d_Physics3dShape_createMesh, 2, JSPROP_READONLY | JSPROP_PERMANENT); + JS_DefineFunction(cx, tmpObj, "createHeightfield", js_cocos2dx_physics3d_Physics3dShape_createHeightfield, 8, JSPROP_READONLY | JSPROP_PERMANENT); + + JS_DefineFunction(cx, JS::RootedObject(cx, jsb_cocos2d_Physics3DObject_prototype), "setCollisionCallback", jsb_cocos2d_Physics3DObject_setCollisionCallback, 2, JSPROP_READONLY | JSPROP_PERMANENT); +} + +#endif //CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION diff --git a/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.h b/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.h new file mode 100644 index 0000000000..da5ae10550 --- /dev/null +++ b/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.h @@ -0,0 +1,38 @@ +/**************************************************************************** + Copyright (c) 2008-2010 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#ifndef __jsb_cococs2dx_physics3d_manual_h__ +#define __jsb_cococs2dx_physics3d_manual_h__ + +#include "base/ccConfig.h" +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + +#include "jsapi.h" + +void register_all_cocos2dx_physics3d_manual(JSContext *cx, JS::HandleObject global); + +#endif + +#endif //__jsb_cococs2dx_physics3d_manual_h__ diff --git a/cocos/scripting/js-bindings/proj.android/Android.mk b/cocos/scripting/js-bindings/proj.android/Android.mk index 1246b0259f..d11ee2e017 100755 --- a/cocos/scripting/js-bindings/proj.android/Android.mk +++ b/cocos/scripting/js-bindings/proj.android/Android.mk @@ -44,6 +44,7 @@ LOCAL_SRC_FILES := ../auto/jsb_cocos2dx_3d_auto.cpp \ ../auto/jsb_cocos2dx_builder_auto.cpp \ ../auto/jsb_cocos2dx_ui_auto.cpp \ ../auto/jsb_cocos2dx_experimental.cpp \ + ../auto/jsb_cocos2dx_physics3d_auto.cpp \ ../manual/ScriptingCore.cpp \ \ ../manual/cocos2d_specifics.cpp \ ../manual/js_manual_conversions.cpp \ @@ -69,8 +70,9 @@ LOCAL_SRC_FILES := ../auto/jsb_cocos2dx_3d_auto.cpp \ ../manual/network/XMLHTTPRequest.cpp \ ../manual/spine/jsb_cocos2dx_spine_manual.cpp \ ../manual/ui/jsb_cocos2dx_ui_manual.cpp \ - ../manual/experimental/jsb_cocos2dx_experimental_manual.cpp - + ../manual/experimental/jsb_cocos2dx_experimental_manual.cpp \ + ../manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp + LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT @@ -81,6 +83,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual \ $(LOCAL_PATH)/../manual/spine \ $(LOCAL_PATH)/../auto \ $(LOCAL_PATH)/../../../2d \ + $(LOCAL_PATH)/../../../3d \ + $(LOCAL_PATH)/../../../physics3d \ $(LOCAL_PATH)/../../../base \ $(LOCAL_PATH)/../../../ui \ $(LOCAL_PATH)/../../../audio/include \ @@ -93,7 +97,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../manual \ $(LOCAL_PATH)/../auto \ - $(LOCAL_PATH)/../../../audio/include + $(LOCAL_PATH)/../../../audio/include LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_js_android_static diff --git a/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj b/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj index 5286614ffe..ea6cb6d59a 100644 --- a/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj @@ -146,6 +146,14 @@ 420BBCF81AA48EE900493976 /* jsb_cocos2dx_3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 420BBCF51AA48EE900493976 /* jsb_cocos2dx_3d_manual.cpp */; }; 420BBCF91AA48EE900493976 /* jsb_cocos2dx_3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 420BBCF61AA48EE900493976 /* jsb_cocos2dx_3d_manual.h */; }; 420BBCFA1AA48EE900493976 /* jsb_cocos2dx_3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 420BBCF61AA48EE900493976 /* jsb_cocos2dx_3d_manual.h */; }; + 42638FFD1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42638FFB1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp */; }; + 42638FFE1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42638FFB1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp */; }; + 42638FFF1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42638FFC1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp */; }; + 426390001B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42638FFC1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp */; }; + 426390041B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426390021B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp */; }; + 426390051B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426390021B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp */; }; + 426390061B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */; }; + 426390071B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */; }; 42AD256C1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42AD256A1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp */; }; 42AD256D1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42AD256A1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp */; }; 42AD256E1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42AD256B1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.hpp */; }; @@ -263,6 +271,10 @@ 420BBCEF1AA48EDE00493976 /* jsb_cocos2dx_3d_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_3d_auto.hpp; sourceTree = ""; }; 420BBCF51AA48EE900493976 /* jsb_cocos2dx_3d_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_3d_manual.cpp; sourceTree = ""; }; 420BBCF61AA48EE900493976 /* jsb_cocos2dx_3d_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_cocos2dx_3d_manual.h; sourceTree = ""; }; + 42638FFB1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_physics3d_auto.cpp; sourceTree = ""; }; + 42638FFC1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_physics3d_auto.hpp; sourceTree = ""; }; + 426390021B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_physics3d_manual.cpp; sourceTree = ""; }; + 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_cocos2dx_physics3d_manual.h; sourceTree = ""; }; 42AD256A1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_experimental.cpp; sourceTree = ""; }; 42AD256B1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_experimental.hpp; sourceTree = ""; }; 42AD25711AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_experimental_manual.cpp; path = experimental/jsb_cocos2dx_experimental_manual.cpp; sourceTree = ""; }; @@ -334,6 +346,8 @@ 1A119E2E18BDF19200352BAA /* auto */ = { isa = PBXGroup; children = ( + 42638FFB1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp */, + 42638FFC1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp */, 42AD256A1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp */, 42AD256B1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.hpp */, 420BBCEE1AA48EDE00493976 /* jsb_cocos2dx_3d_auto.cpp */, @@ -362,6 +376,7 @@ 1A119E4118BDF19200352BAA /* manual */ = { isa = PBXGroup; children = ( + 426390011B0EC1C6004C53A2 /* physics3d */, 42AD25701AFF9DFC000176E2 /* experimental */, 420BBCF41AA48EE900493976 /* 3d */, 0541A74C1973876100E45470 /* ios */, @@ -538,6 +553,15 @@ path = 3d; sourceTree = ""; }; + 426390011B0EC1C6004C53A2 /* physics3d */ = { + isa = PBXGroup; + children = ( + 426390021B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp */, + 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */, + ); + path = physics3d; + sourceTree = ""; + }; 42AD25701AFF9DFC000176E2 /* experimental */ = { isa = PBXGroup; children = ( @@ -603,7 +627,9 @@ 1AB5E63518D05BF30088DAA4 /* jsb_cocos2dx_ui_manual.h in Headers */, 1A119EE318BDF19200352BAA /* jsb_opengl_functions.h in Headers */, 42AD256E1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.hpp in Headers */, + 42638FFF1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp in Headers */, 0541A74F1973876100E45470 /* JavaScriptObjCBridge.h in Headers */, + 426390061B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h in Headers */, 1AB5E62D18D05BC80088DAA4 /* jsb_cocos2dx_ui_auto.hpp in Headers */, 420BBCF91AA48EE900493976 /* jsb_cocos2dx_3d_manual.h in Headers */, 1A119ED918BDF19200352BAA /* js_bindings_opengl.h in Headers */, @@ -626,6 +652,7 @@ files = ( 1A119EA418BDF19200352BAA /* jsb_cocos2dx_studio_auto.hpp in Headers */, 1A119F0218BDF19200352BAA /* ScriptingCore.h in Headers */, + 426390071B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h in Headers */, 1A119EBE18BDF19200352BAA /* cocos2d_specifics.hpp in Headers */, 83A5661C18DA878400FC31A0 /* jsb_socketio.h in Headers */, 1A1D3B7B18C44FD000922D3C /* jsb_event_dispatcher_manual.h in Headers */, @@ -660,6 +687,7 @@ 1AB5E62E18D05BC80088DAA4 /* jsb_cocos2dx_ui_auto.hpp in Headers */, 1A119EDA18BDF19200352BAA /* js_bindings_opengl.h in Headers */, 1A119EC818BDF19200352BAA /* jsb_cocos2dx_studio_manual.h in Headers */, + 426390001B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp in Headers */, 420BBCFA1AA48EE900493976 /* jsb_cocos2dx_3d_manual.h in Headers */, BA623E0C191A195F00761F37 /* jsb_pluginx_extension_registration.h in Headers */, 1A119EAC18BDF19200352BAA /* js_bindings_chipmunk_auto_classes_registration.h in Headers */, @@ -749,6 +777,7 @@ 1A119E8918BDF19200352BAA /* jsb_cocos2dx_builder_auto.cpp in Sources */, 1A119EAD18BDF19200352BAA /* js_bindings_chipmunk_functions.cpp in Sources */, 1A119EED18BDF19200352BAA /* js_bindings_system_functions.cpp in Sources */, + 426390041B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp in Sources */, 0541A7501973876100E45470 /* JavaScriptObjCBridge.mm in Sources */, 1A119EB318BDF19200352BAA /* js_bindings_chipmunk_manual.cpp in Sources */, 1A119EE918BDF19200352BAA /* jsb_opengl_registration.cpp in Sources */, @@ -779,6 +808,7 @@ 420BBCF01AA48EDE00493976 /* jsb_cocos2dx_3d_auto.cpp in Sources */, 83A5661918DA878400FC31A0 /* jsb_socketio.cpp in Sources */, 1A119EE118BDF19200352BAA /* jsb_opengl_functions.cpp in Sources */, + 42638FFD1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp in Sources */, 1A119EA718BDF19200352BAA /* js_bindings_chipmunk_auto_classes.cpp in Sources */, 1A119EFF18BDF19200352BAA /* ScriptingCore.cpp in Sources */, 1A1D3B7818C44FD000922D3C /* jsb_event_dispatcher_manual.cpp in Sources */, @@ -809,6 +839,8 @@ 1A119EF418BDF19200352BAA /* js_bindings_system_registration.cpp in Sources */, 42AD256D1AFF9D1A000176E2 /* jsb_cocos2dx_experimental.cpp in Sources */, 1A119EBC18BDF19200352BAA /* cocos2d_specifics.cpp in Sources */, + 426390051B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp in Sources */, + 42638FFE1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.cpp in Sources */, 1A119EE618BDF19200352BAA /* jsb_opengl_manual.cpp in Sources */, 1A119F0618BDF19200352BAA /* jsb_cocos2dx_spine_manual.cpp in Sources */, BA623E0F191A195F00761F37 /* jsb_pluginx_manual_protocols.cpp in Sources */, @@ -873,7 +905,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../../../cocos $(SRCROOT)/../../../../cocos/base $(SRCROOT)/../../../../cocos/2d $(SRCROOT)/../../../../cocos/physics $(SRCROOT)/../../../../cocos/math/kazmath $(SRCROOT)/../../../../cocos/platform $(SRCROOT)/../../../../cocos/audio/include $(SRCROOT)/../../../../cocos/editor-support $(SRCROOT)/../../../../cocos/editor-support/cocosbuilder $(SRCROOT)/../../../../cocos/editor-support/cocostudio $(SRCROOT)/../../../../cocos/editor-support/spine $(SRCROOT)/../../../../cocos/ui $(SRCROOT)/../../../../cocos/storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external $(SRCROOT)/../auto $(SRCROOT)/../manual"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../../../cocos $(SRCROOT)/../../../../cocos/base $(SRCROOT)/../../../../cocos/3d $(SRCROOT)/../../../../cocos/2d $(SRCROOT)/../../../../cocos/physics3d $(SRCROOT)/../../../../cocos/platform $(SRCROOT)/../../../../cocos/audio/include $(SRCROOT)/../../../../cocos/editor-support $(SRCROOT)/../../../../cocos/editor-support/cocosbuilder $(SRCROOT)/../../../../cocos/editor-support/cocostudio $(SRCROOT)/../../../../cocos/editor-support/spine $(SRCROOT)/../../../../cocos/ui $(SRCROOT)/../../../../cocos/storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external $(SRCROOT)/../auto $(SRCROOT)/../manual"; }; name = Debug; }; @@ -907,7 +939,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../../../cocos $(SRCROOT)/../../../../cocos/base $(SRCROOT)/../../../../cocos/2d $(SRCROOT)/../../../../cocos/physics $(SRCROOT)/../../../../cocos/math/kazmath $(SRCROOT)/../../../../cocos/platform $(SRCROOT)/../../../../cocos/audio/include $(SRCROOT)/../../../../cocos/editor-support $(SRCROOT)/../../../../cocos/editor-support/cocosbuilder $(SRCROOT)/../../../../cocos/editor-support/cocostudio $(SRCROOT)/../../../../cocos/editor-support/spine $(SRCROOT)/../../../../cocos/ui $(SRCROOT)/../../../../cocos/storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external $(SRCROOT)/../auto $(SRCROOT)/../manual"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../../../cocos $(SRCROOT)/../../../../cocos/base $(SRCROOT)/../../../../cocos/3d $(SRCROOT)/../../../../cocos/2d $(SRCROOT)/../../../../cocos/physics3d $(SRCROOT)/../../../../cocos/platform $(SRCROOT)/../../../../cocos/audio/include $(SRCROOT)/../../../../cocos/editor-support $(SRCROOT)/../../../../cocos/editor-support/cocosbuilder $(SRCROOT)/../../../../cocos/editor-support/cocostudio $(SRCROOT)/../../../../cocos/editor-support/spine $(SRCROOT)/../../../../cocos/ui $(SRCROOT)/../../../../cocos/storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external $(SRCROOT)/../auto $(SRCROOT)/../manual"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj index 8e09d72c6f..4eb40ed7af 100644 --- a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj +++ b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj @@ -17,6 +17,7 @@ + @@ -43,6 +44,7 @@ + @@ -54,6 +56,7 @@ + @@ -86,6 +89,7 @@ + @@ -151,7 +155,7 @@ Level3 Disabled WIN32;_WINDOWS;_DEBUG;_LIB;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)external;$(ProjectDir)..\auto;$(ProjectDir)..\manual;$(ProjectDir)..\manual\cocostudio;$(ProjectDir)..\manual\spine;$(ProjectDir)..\..\..\..\external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)external;$(ProjectDir)..\auto;$(ProjectDir)..\manual;$(ProjectDir)..\manual\cocostudio;$(ProjectDir)..\manual\spine;$(ProjectDir)..\..\..\..\external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4068;4101;4800;4251;4244;4099;4083;4700;%(DisableSpecificWarnings) true false @@ -177,7 +181,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" true true WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)external;$(ProjectDir)..\auto;$(ProjectDir)..\manual;$(ProjectDir)..\manual\cocostudio;$(ProjectDir)..\manual\spine;$(ProjectDir)..\..\..\..\external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)external;$(ProjectDir)..\auto;$(ProjectDir)..\manual;$(ProjectDir)..\manual\cocostudio;$(ProjectDir)..\manual\spine;$(ProjectDir)..\..\..\..\external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4068;4101;4800;4251;4244;4099;4083;4700;%(DisableSpecificWarnings) true None diff --git a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters index 45f154340e..c4e49936c6 100644 --- a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters +++ b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters @@ -39,6 +39,9 @@ {9f37ec66-1e00-4015-baa6-dabdf755f0ff} + + {3aaaf02d-80d8-4339-b4cd-89d89ade5293} + @@ -146,6 +149,12 @@ manual\experimental + + auto + + + manual\physics3d + @@ -274,5 +283,11 @@ manual\experimental + + auto + + + manual\physics3d + \ No newline at end of file diff --git a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems index 62ccfa022d..409eb85c05 100644 --- a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems +++ b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems @@ -20,6 +20,7 @@ + @@ -52,6 +53,7 @@ + @@ -65,6 +67,7 @@ + @@ -91,6 +94,7 @@ + diff --git a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters index e83c0ca52b..6824d69c63 100644 --- a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters +++ b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters @@ -128,6 +128,12 @@ manual\experimental + + auto + + + manual\physics3d + @@ -235,6 +241,12 @@ manual\experimental + + auto + + + manual\physics3d + @@ -276,6 +288,9 @@ {ddd3651e-c6e7-4dea-80c1-a0a3dc51a740} + + {511b128d-2604-48af-88e1-8cc0eba79e19} + diff --git a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Windows/libjscocos2d.Windows.vcxproj b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Windows/libjscocos2d.Windows.vcxproj index bd38032fea..f740fc7a57 100644 --- a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Windows/libjscocos2d.Windows.vcxproj +++ b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Windows/libjscocos2d.Windows.vcxproj @@ -126,10 +126,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) true @@ -146,10 +146,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false OldStyle @@ -168,10 +168,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) true @@ -188,10 +188,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false OldStyle @@ -210,10 +210,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) true @@ -230,10 +230,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false OldStyle diff --git a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.WindowsPhone/libjscocos2d.WindowsPhone.vcxproj b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.WindowsPhone/libjscocos2d.WindowsPhone.vcxproj index 7db401debd..0d4d3dc118 100644 --- a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.WindowsPhone/libjscocos2d.WindowsPhone.vcxproj +++ b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.WindowsPhone/libjscocos2d.WindowsPhone.vcxproj @@ -91,10 +91,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) true @@ -111,10 +111,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false OldStyle @@ -133,10 +133,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) true @@ -153,10 +153,10 @@ NotUsing true false - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;$(EngineRoot)external\spidermonkey\include\winrt_8.1;$(ProjectDir)..\..\..\auto;$(ProjectDir)..\..\..\manual;$(ProjectDir)..\..\..\manual\cocostudio;$(ProjectDir)..\..\..\manual\spine;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories) 4800;4703;4101;4083;4700;4068;4996;%(DisableSpecificWarnings) Level3 - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false OldStyle diff --git a/cocos/scripting/js-bindings/script/jsb.js b/cocos/scripting/js-bindings/script/jsb.js index 1ae745a3c5..e88f281201 100644 --- a/cocos/scripting/js-bindings/script/jsb.js +++ b/cocos/scripting/js-bindings/script/jsb.js @@ -135,5 +135,8 @@ if (jsb.Sprite3D){ } if (jsb.ParticleSystem3D) { - require('script/3d/jsb_cocos2d_3d_ext.js'); -} \ No newline at end of file + require('script/3d/jsb_cocos2d_3d_ext.js'); +} + +if(cc.Physics3DObject) + require("script/physics3d/jsb_physics3d.js"); diff --git a/cocos/scripting/js-bindings/script/physics3d/jsb_physics3d.js b/cocos/scripting/js-bindings/script/physics3d/jsb_physics3d.js new file mode 100644 index 0000000000..932f74ea8c --- /dev/null +++ b/cocos/scripting/js-bindings/script/physics3d/jsb_physics3d.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2014 Chukong Technologies Inc. + * + * 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. + */ + +cc.Physics3DRigidBodyDes = function(){ + this.mass = 0; + this.localInertia = cc.math.vec3(0, 0, 0); + this.shape = null; + this.originalTransform = [1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0]; + this.disableSleep = false; +}; + +cc.physics3DRigidBodyDes = function(){ + return new cc.Physics3DRigidBodyDes(); +}; + +cc.Physics3DComponent.PhysicsSyncFlag = { + NONE : 0, + NODE_TO_PHYSICS : 1, //align node transform to the physics + PHYSICS_TO_NODE : 2, // align physics transform to the node + NODE_AND_NODE : 1 | 2, //pre simulation, align the physics object to the node and align the node transform according to physics object after simulation +}; diff --git a/cocos/scripting/lua-bindings/CMakeLists.txt b/cocos/scripting/lua-bindings/CMakeLists.txt index 0322dd47a8..00e298040d 100644 --- a/cocos/scripting/lua-bindings/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/CMakeLists.txt @@ -18,6 +18,7 @@ include_directories( ${cocos_root}/cocos/editor-support ${cocos_root}/cocos/platform ${cocos_root}/cocos/audio/include + ${cocos_root}/cocos/physics3d manual manual/extension manual/cocostudio @@ -108,6 +109,7 @@ set(lua_bindings_manual_files manual/ui/lua_cocos2dx_ui_manual.cpp manual/video/lua_cocos2dx_experimental_video_manual.cpp manual/audioengine/lua_cocos2dx_audioengine_manual.cpp + manual/physics3d/lua_cocos2dx_physics3d_manual.cpp ) set(lua_bindings_auto_files @@ -125,6 +127,7 @@ set(lua_bindings_auto_files auto/lua_cocos2dx_csloader_auto.cpp auto/lua_cocos2dx_ui_auto.cpp auto/lua_cocos2dx_audioengine_auto.cpp + auto/lua_cocos2dx_physics3d_auto.cpp ) if(MACOSX) diff --git a/cocos/scripting/lua-bindings/auto/api/Camera.lua b/cocos/scripting/lua-bindings/auto/api/Camera.lua index 8e5f1c03b2..40e4fcd581 100644 --- a/cocos/scripting/lua-bindings/auto/api/Camera.lua +++ b/cocos/scripting/lua-bindings/auto/api/Camera.lua @@ -67,6 +67,16 @@ -- @param #vec3_table src -- @return vec2_table#vec2_table ret (return value: vec2_table) +-------------------------------- +-- +-- @function [parent=#Camera] initOrthographic +-- @param self +-- @param #float zoomX +-- @param #float zoomY +-- @param #float nearPlane +-- @param #float farPlane +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Get object depth towards camera -- @function [parent=#Camera] getDepthInView @@ -100,13 +110,10 @@ -------------------------------- -- --- @function [parent=#Camera] initOrthographic +-- @function [parent=#Camera] clearBackground -- @param self --- @param #float zoomX --- @param #float zoomY --- @param #float nearPlane --- @param #float farPlane --- @return bool#bool ret (return value: bool) +-- @param #float depth +-- @return Camera#Camera self (return value: cc.Camera) -------------------------------- -- set additional matrix for the projection matrix, it multiplys mat to projection matrix when called, used by WP8 diff --git a/cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua b/cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua index 1488464d11..3552ff8ddc 100644 --- a/cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua +++ b/cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua @@ -22,9 +22,9 @@ -- param t Duration in seconds.
-- param radius The start radius.
-- param deltaRadius The delta radius.
--- param angleZ The start Angel in Z.
+-- param angleZ The start angle in Z.
-- param deltaAngleZ The delta angle in Z.
--- param angleX The start Angel in X.
+-- param angleX The start angle in X.
-- param deltaAngleX The delta angle in X.
-- return An OrbitCamera. -- @function [parent=#OrbitCamera] create diff --git a/cocos/scripting/lua-bindings/auto/api/TextureCache.lua b/cocos/scripting/lua-bindings/auto/api/TextureCache.lua index 952e8477b4..e61cccc155 100644 --- a/cocos/scripting/lua-bindings/auto/api/TextureCache.lua +++ b/cocos/scripting/lua-bindings/auto/api/TextureCache.lua @@ -85,6 +85,15 @@ -- @param #string key -- @return Texture2D#Texture2D ret (return value: cc.Texture2D) +-------------------------------- +-- Get the file path of the texture
+-- param texture A Texture2D object pointer.
+-- return The full path of the file. +-- @function [parent=#TextureCache] getTextureFilePath +-- @param self +-- @param #cc.Texture2D texture +-- @return string#string ret (return value: string) + -------------------------------- -- Removes unused textures.
-- Textures that have a retain count of 1 will be deleted.
diff --git a/cocos/scripting/lua-bindings/auto/api/UserDefault.lua b/cocos/scripting/lua-bindings/auto/api/UserDefault.lua index 5068512651..4d88d55d71 100644 --- a/cocos/scripting/lua-bindings/auto/api/UserDefault.lua +++ b/cocos/scripting/lua-bindings/auto/api/UserDefault.lua @@ -124,7 +124,7 @@ -- @return string#string ret (return value: string) -------------------------------- --- All supported platforms other iOS & Android use xml file to save values. This function checks whether the xml file exists or not.
+-- All supported platforms other iOS & Android and CC_PLATFORM_WINRT use xml file to save values. This function checks whether the xml file exists or not.
-- return True if the xml file exists, flase if not.
-- js NA -- @function [parent=#UserDefault] isXMLFileExist diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp index 39cde04239..ba9b06447e 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp @@ -495,7 +495,7 @@ int lua_cocos2dx_3d_Animate3D_initWithFrames(lua_State* tolua_S) int arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:initWithFrames"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.Animate3D:initWithFrames"); @@ -642,7 +642,7 @@ int lua_cocos2dx_3d_Animate3D_init(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:init"); if (!ok) { break; } double arg1; @@ -662,7 +662,7 @@ int lua_cocos2dx_3d_Animate3D_init(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:init"); if (!ok) { break; } bool ret = cobj->init(arg0); @@ -844,7 +844,7 @@ int lua_cocos2dx_3d_Animate3D_create(lua_State* tolua_S) if (argc == 3) { cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:create"); if (!ok) { break; } double arg1; ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Animate3D:create"); @@ -863,7 +863,7 @@ int lua_cocos2dx_3d_Animate3D_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:create"); if (!ok) { break; } cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0); object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); @@ -933,7 +933,7 @@ int lua_cocos2dx_3d_Animate3D_createWithFrames(lua_State* tolua_S) cocos2d::Animation3D* arg0; int arg1; int arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:createWithFrames"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.Animate3D:createWithFrames"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.Animate3D:createWithFrames"); if(!ok) @@ -951,7 +951,7 @@ int lua_cocos2dx_3d_Animate3D_createWithFrames(lua_State* tolua_S) int arg1; int arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0, "cc.Animate3D:createWithFrames"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.Animate3D:createWithFrames"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.Animate3D:createWithFrames"); ok &= luaval_to_number(tolua_S, 5,&arg3, "cc.Animate3D:createWithFrames"); @@ -1098,7 +1098,7 @@ int lua_cocos2dx_3d_AttachNode_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Bone3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0, "cc.AttachNode:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_AttachNode_create'", nullptr); @@ -1398,7 +1398,7 @@ int lua_cocos2dx_3d_BillBoard_createWithTexture(lua_State* tolua_S) if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.BillBoard:createWithTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_BillBoard_createWithTexture'", nullptr); @@ -1412,7 +1412,7 @@ int lua_cocos2dx_3d_BillBoard_createWithTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; cocos2d::BillBoard::Mode arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.BillBoard:createWithTexture"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.BillBoard:createWithTexture"); if(!ok) { @@ -1516,7 +1516,7 @@ int lua_cocos2dx_3d_Mesh_setTexture(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Mesh:setTexture"); if (!ok) { break; } cobj->setTexture(arg0); @@ -1718,7 +1718,7 @@ int lua_cocos2dx_3d_Mesh_setMaterial(lua_State* tolua_S) { cocos2d::Material* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Material",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Material",&arg0, "cc.Mesh:setMaterial"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Mesh_setMaterial'", nullptr); @@ -1918,7 +1918,7 @@ int lua_cocos2dx_3d_Mesh_draw(lua_State* tolua_S) cocos2d::Vec4 arg5; bool arg6; - ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0, "cc.Mesh:draw"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Mesh:draw"); @@ -2077,7 +2077,7 @@ int lua_cocos2dx_3d_Mesh_setMeshIndexData(lua_State* tolua_S) { cocos2d::MeshIndexData* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.MeshIndexData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.MeshIndexData",&arg0, "cc.Mesh:setMeshIndexData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Mesh_setMeshIndexData'", nullptr); @@ -2224,7 +2224,7 @@ int lua_cocos2dx_3d_Mesh_setSkin(lua_State* tolua_S) { cocos2d::MeshSkin* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.MeshSkin",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.MeshSkin",&arg0, "cc.Mesh:setSkin"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Mesh_setSkin'", nullptr); @@ -2321,7 +2321,7 @@ int lua_cocos2dx_3d_Mesh_setGLProgramState(lua_State* tolua_S) { cocos2d::GLProgramState* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgramState",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgramState",&arg0, "cc.Mesh:setGLProgramState"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Mesh_setGLProgramState'", nullptr); @@ -2543,7 +2543,7 @@ int lua_cocos2dx_3d_Skeleton3D_addBone(lua_State* tolua_S) { cocos2d::Bone3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0, "cc.Skeleton3D:addBone"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Skeleton3D_addBone'", nullptr); @@ -2837,7 +2837,7 @@ int lua_cocos2dx_3d_Skeleton3D_getBoneIndex(lua_State* tolua_S) { cocos2d::Bone3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0, "cc.Skeleton3D:getBoneIndex"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'", nullptr); @@ -3118,7 +3118,7 @@ int lua_cocos2dx_3d_Skybox_setTexture(lua_State* tolua_S) { cocos2d::TextureCube* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TextureCube",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TextureCube",&arg0, "cc.Skybox:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Skybox_setTexture'", nullptr); @@ -3333,7 +3333,7 @@ int lua_cocos2dx_3d_Sprite3D_setTexture(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite3D:setTexture"); if (!ok) { break; } cobj->setTexture(arg0); @@ -3582,7 +3582,7 @@ int lua_cocos2dx_3d_Sprite3D_setMaterial(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Material* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Material",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Material",&arg0, "cc.Sprite3D:setMaterial"); if (!ok) { break; } int arg1; @@ -3598,7 +3598,7 @@ int lua_cocos2dx_3d_Sprite3D_setMaterial(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Material* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Material",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Material",&arg0, "cc.Sprite3D:setMaterial"); if (!ok) { break; } cobj->setMaterial(arg0); @@ -4860,7 +4860,7 @@ int lua_cocos2dx_3d_Terrain_setAlphaMap(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Terrain:setAlphaMap"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Terrain_setAlphaMap'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.cpp index 25ae7429dc..302f2a90d6 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.cpp @@ -660,7 +660,7 @@ int lua_cocos2dx_audioengine_AudioEngine_play2d(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccexp.AudioEngine:play2d"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "ccexp.AudioEngine:play2d"); ok &= luaval_to_number(tolua_S, 4,&arg2, "ccexp.AudioEngine:play2d"); - ok &= luaval_to_object(tolua_S, 5, "ccexp.AudioProfile",&arg3); + ok &= luaval_to_object(tolua_S, 5, "ccexp.AudioProfile",&arg3, "ccexp.AudioEngine:play2d"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_audioengine_AudioEngine_play2d'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 8ab9cfbee0..fca5c4751e 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -560,7 +560,7 @@ int lua_cocos2dx_Texture2D_initWithImage(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Image* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Image",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Image",&arg0, "cc.Texture2D:initWithImage"); if (!ok) { break; } cocos2d::Texture2D::PixelFormat arg1; @@ -576,7 +576,7 @@ int lua_cocos2dx_Texture2D_initWithImage(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Image* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Image",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Image",&arg0, "cc.Texture2D:initWithImage"); if (!ok) { break; } bool ret = cobj->initWithImage(arg0); @@ -1444,7 +1444,7 @@ int lua_cocos2dx_Texture2D_setGLProgram(lua_State* tolua_S) { cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.Texture2D:setGLProgram"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Texture2D_setGLProgram'", nullptr); @@ -2899,7 +2899,7 @@ int lua_cocos2dx_Node_addChild(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:addChild"); if (!ok) { break; } int arg1; @@ -2915,7 +2915,7 @@ int lua_cocos2dx_Node_addChild(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:addChild"); if (!ok) { break; } cobj->addChild(arg0); @@ -2927,7 +2927,7 @@ int lua_cocos2dx_Node_addChild(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:addChild"); if (!ok) { break; } int arg1; @@ -2947,7 +2947,7 @@ int lua_cocos2dx_Node_addChild(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:addChild"); if (!ok) { break; } int arg1; @@ -2998,7 +2998,7 @@ int lua_cocos2dx_Node_removeComponent(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Component* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Component",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Component",&arg0, "cc.Node:removeComponent"); if (!ok) { break; } bool ret = cobj->removeComponent(arg0); @@ -4348,7 +4348,7 @@ int lua_cocos2dx_Node_removeChild(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:removeChild"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_removeChild'", nullptr); @@ -4363,7 +4363,7 @@ int lua_cocos2dx_Node_removeChild(lua_State* tolua_S) cocos2d::Node* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:removeChild"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Node:removeChild"); if(!ok) @@ -4609,7 +4609,7 @@ int lua_cocos2dx_Node_setGLProgramState(lua_State* tolua_S) { cocos2d::GLProgramState* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgramState",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgramState",&arg0, "cc.Node:setGLProgramState"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setGLProgramState'", nullptr); @@ -4817,7 +4817,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpace(lua_State* tolua_S) { cocos2d::Touch* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0, "cc.Node:convertTouchToNodeSpace"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_convertTouchToNodeSpace'", nullptr); @@ -5012,7 +5012,7 @@ int lua_cocos2dx_Node_setParent(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:setParent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setParent'", nullptr); @@ -5250,7 +5250,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpaceAR(lua_State* tolua_S) { cocos2d::Touch* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0, "cc.Node:convertTouchToNodeSpaceAR"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_convertTouchToNodeSpaceAR'", nullptr); @@ -5460,7 +5460,7 @@ int lua_cocos2dx_Node_reorderChild(lua_State* tolua_S) cocos2d::Node* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:reorderChild"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.Node:reorderChild"); if(!ok) @@ -6097,7 +6097,7 @@ int lua_cocos2dx_Node_addComponent(lua_State* tolua_S) { cocos2d::Component* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Component",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Component",&arg0, "cc.Node:addComponent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_addComponent'", nullptr); @@ -6147,7 +6147,7 @@ int lua_cocos2dx_Node_runAction(lua_State* tolua_S) { cocos2d::Action* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0, "cc.Node:runAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_runAction'", nullptr); @@ -6199,7 +6199,7 @@ int lua_cocos2dx_Node_visit(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Renderer* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0, "cc.Node:visit"); if (!ok) { break; } cocos2d::Mat4 arg1; @@ -6511,7 +6511,7 @@ int lua_cocos2dx_Node_setScheduler(lua_State* tolua_S) { cocos2d::Scheduler* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scheduler",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Scheduler",&arg0, "cc.Node:setScheduler"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setScheduler'", nullptr); @@ -7084,7 +7084,7 @@ int lua_cocos2dx_Node_setActionManager(lua_State* tolua_S) { cocos2d::ActionManager* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionManager",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionManager",&arg0, "cc.Node:setActionManager"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setActionManager'", nullptr); @@ -8615,7 +8615,7 @@ int lua_cocos2dx_Node_setEventDispatcher(lua_State* tolua_S) { cocos2d::EventDispatcher* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.EventDispatcher",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventDispatcher",&arg0, "cc.Node:setEventDispatcher"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setEventDispatcher'", nullptr); @@ -8714,7 +8714,7 @@ int lua_cocos2dx_Node_draw(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Renderer* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0, "cc.Node:draw"); if (!ok) { break; } cocos2d::Mat4 arg1; @@ -8771,7 +8771,7 @@ int lua_cocos2dx_Node_setUserObject(lua_State* tolua_S) { cocos2d::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.Node:setUserObject"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setUserObject'", nullptr); @@ -9066,7 +9066,7 @@ int lua_cocos2dx_Node_setGLProgram(lua_State* tolua_S) { cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.Node:setGLProgram"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setGLProgram'", nullptr); @@ -9401,7 +9401,7 @@ int lua_cocos2dx_Node_stopAction(lua_State* tolua_S) { cocos2d::Action* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0, "cc.Node:stopAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_stopAction'", nullptr); @@ -9769,7 +9769,7 @@ int lua_cocos2dx_Scene_render(lua_State* tolua_S) { cocos2d::Renderer* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0, "cc.Scene:render"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Scene_render'", nullptr); @@ -9819,7 +9819,7 @@ int lua_cocos2dx_Scene_onProjectionChanged(lua_State* tolua_S) { cocos2d::EventCustom* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.EventCustom",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventCustom",&arg0, "cc.Scene:onProjectionChanged"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Scene_onProjectionChanged'", nullptr); @@ -11733,7 +11733,7 @@ int lua_cocos2dx_Director_setEventDispatcher(lua_State* tolua_S) { cocos2d::EventDispatcher* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.EventDispatcher",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventDispatcher",&arg0, "cc.Director:setEventDispatcher"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_setEventDispatcher'", nullptr); @@ -12021,7 +12021,7 @@ int lua_cocos2dx_Director_setActionManager(lua_State* tolua_S) { cocos2d::ActionManager* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionManager",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionManager",&arg0, "cc.Director:setActionManager"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_setActionManager'", nullptr); @@ -12888,7 +12888,7 @@ int lua_cocos2dx_Director_setScheduler(lua_State* tolua_S) { cocos2d::Scheduler* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scheduler",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Scheduler",&arg0, "cc.Director:setScheduler"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_setScheduler'", nullptr); @@ -13464,7 +13464,7 @@ int lua_cocos2dx_Director_setOpenGLView(lua_State* tolua_S) { cocos2d::GLView* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLView",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLView",&arg0, "cc.Director:setOpenGLView"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_setOpenGLView'", nullptr); @@ -13658,7 +13658,7 @@ int lua_cocos2dx_Director_runWithScene(lua_State* tolua_S) { cocos2d::Scene* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "cc.Director:runWithScene"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_runWithScene'", nullptr); @@ -13708,7 +13708,7 @@ int lua_cocos2dx_Director_setNotificationNode(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Director:setNotificationNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_setNotificationNode'", nullptr); @@ -14387,7 +14387,7 @@ int lua_cocos2dx_Director_pushScene(lua_State* tolua_S) { cocos2d::Scene* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "cc.Director:pushScene"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_pushScene'", nullptr); @@ -14628,7 +14628,7 @@ int lua_cocos2dx_Director_replaceScene(lua_State* tolua_S) { cocos2d::Scene* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "cc.Director:replaceScene"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_replaceScene'", nullptr); @@ -15547,7 +15547,7 @@ int lua_cocos2dx_Action_startWithTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Action:startWithTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Action_startWithTarget'", nullptr); @@ -15597,7 +15597,7 @@ int lua_cocos2dx_Action_setOriginalTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Action:setOriginalTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Action_setOriginalTarget'", nullptr); @@ -16032,7 +16032,7 @@ int lua_cocos2dx_Action_setTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Action:setTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Action_setTarget'", nullptr); @@ -16326,7 +16326,7 @@ int lua_cocos2dx_Speed_setInnerAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.Speed:setInnerAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Speed_setInnerAction'", nullptr); @@ -16474,7 +16474,7 @@ int lua_cocos2dx_Speed_initWithAction(lua_State* tolua_S) cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.Speed:initWithAction"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Speed:initWithAction"); if(!ok) @@ -16562,7 +16562,7 @@ int lua_cocos2dx_Speed_create(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.Speed:create"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Speed:create"); if(!ok) { @@ -16724,7 +16724,7 @@ int lua_cocos2dx_Follow_initWithTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Follow:initWithTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Follow_initWithTarget'", nullptr); @@ -16739,7 +16739,7 @@ int lua_cocos2dx_Follow_initWithTarget(lua_State* tolua_S) cocos2d::Node* arg0; cocos2d::Rect arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Follow:initWithTarget"); ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Follow:initWithTarget"); if(!ok) @@ -16826,7 +16826,7 @@ int lua_cocos2dx_Follow_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Follow:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Follow_create'", nullptr); @@ -16840,7 +16840,7 @@ int lua_cocos2dx_Follow_create(lua_State* tolua_S) { cocos2d::Node* arg0; cocos2d::Rect arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Follow:create"); ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Follow:create"); if(!ok) { @@ -17047,7 +17047,7 @@ int lua_cocos2dx_SpriteFrame_setTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setTexture'", nullptr); @@ -17576,7 +17576,7 @@ int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) do{ if (argc == 5) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:initWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; @@ -17604,7 +17604,7 @@ int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:initWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; @@ -17975,7 +17975,7 @@ int lua_cocos2dx_SpriteFrame_createWithTexture(lua_State* tolua_S) if (argc == 5) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:createWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrame:createWithTexture"); @@ -18000,7 +18000,7 @@ int lua_cocos2dx_SpriteFrame_createWithTexture(lua_State* tolua_S) if (argc == 2) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:createWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrame:createWithTexture"); @@ -18127,7 +18127,7 @@ int lua_cocos2dx_AnimationFrame_setSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.AnimationFrame:setSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_AnimationFrame_setSpriteFrame'", nullptr); @@ -18467,7 +18467,7 @@ int lua_cocos2dx_AnimationFrame_initWithSpriteFrame(lua_State* tolua_S) double arg1; cocos2d::ValueMap arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.AnimationFrame:initWithSpriteFrame"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.AnimationFrame:initWithSpriteFrame"); @@ -18511,7 +18511,7 @@ int lua_cocos2dx_AnimationFrame_create(lua_State* tolua_S) cocos2d::SpriteFrame* arg0; double arg1; cocos2d::ValueMap arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.AnimationFrame:create"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.AnimationFrame:create"); ok &= luaval_to_ccvaluemap(tolua_S, 4, &arg2, "cc.AnimationFrame:create"); if(!ok) @@ -18674,7 +18674,7 @@ int lua_cocos2dx_Animation_addSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Animation:addSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Animation_addSpriteFrame'", nullptr); @@ -19447,7 +19447,7 @@ int lua_cocos2dx_Animation_addSpriteFrameWithTexture(lua_State* tolua_S) cocos2d::Texture2D* arg0; cocos2d::Rect arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Animation:addSpriteFrameWithTexture"); ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Animation:addSpriteFrameWithTexture"); if(!ok) @@ -19928,9 +19928,9 @@ int lua_cocos2dx_Sequence_initWithTwoActions(lua_State* tolua_S) cocos2d::FiniteTimeAction* arg0; cocos2d::FiniteTimeAction* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0, "cc.Sequence:initWithTwoActions"); - ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1, "cc.Sequence:initWithTwoActions"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sequence_initWithTwoActions'", nullptr); @@ -20038,7 +20038,7 @@ int lua_cocos2dx_Repeat_setInnerAction(lua_State* tolua_S) { cocos2d::FiniteTimeAction* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0, "cc.Repeat:setInnerAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Repeat_setInnerAction'", nullptr); @@ -20089,7 +20089,7 @@ int lua_cocos2dx_Repeat_initWithAction(lua_State* tolua_S) cocos2d::FiniteTimeAction* arg0; unsigned int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0, "cc.Repeat:initWithAction"); ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.Repeat:initWithAction"); if(!ok) @@ -20177,7 +20177,7 @@ int lua_cocos2dx_Repeat_create(lua_State* tolua_S) { cocos2d::FiniteTimeAction* arg0; unsigned int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0, "cc.Repeat:create"); ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.Repeat:create"); if(!ok) { @@ -20287,7 +20287,7 @@ int lua_cocos2dx_RepeatForever_setInnerAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.RepeatForever:setInnerAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_RepeatForever_setInnerAction'", nullptr); @@ -20337,7 +20337,7 @@ int lua_cocos2dx_RepeatForever_initWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.RepeatForever:initWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_RepeatForever_initWithAction'", nullptr); @@ -20422,7 +20422,7 @@ int lua_cocos2dx_RepeatForever_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.RepeatForever:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_RepeatForever_create'", nullptr); @@ -20532,9 +20532,9 @@ int lua_cocos2dx_Spawn_initWithTwoActions(lua_State* tolua_S) cocos2d::FiniteTimeAction* arg0; cocos2d::FiniteTimeAction* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FiniteTimeAction",&arg0, "cc.Spawn:initWithTwoActions"); - ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1, "cc.Spawn:initWithTwoActions"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Spawn_initWithTwoActions'", nullptr); @@ -22928,7 +22928,7 @@ int lua_cocos2dx_FadeIn_setReverseAction(lua_State* tolua_S) { cocos2d::FadeTo* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.FadeTo",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FadeTo",&arg0, "cc.FadeIn:setReverseAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FadeIn_setReverseAction'", nullptr); @@ -23073,7 +23073,7 @@ int lua_cocos2dx_FadeOut_setReverseAction(lua_State* tolua_S) { cocos2d::FadeTo* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.FadeTo",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.FadeTo",&arg0, "cc.FadeOut:setReverseAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FadeOut_setReverseAction'", nullptr); @@ -23697,7 +23697,7 @@ int lua_cocos2dx_Animate_initWithAnimation(lua_State* tolua_S) { cocos2d::Animation* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0, "cc.Animate:initWithAnimation"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Animate_initWithAnimation'", nullptr); @@ -23747,7 +23747,7 @@ int lua_cocos2dx_Animate_setAnimation(lua_State* tolua_S) { cocos2d::Animation* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0, "cc.Animate:setAnimation"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Animate_setAnimation'", nullptr); @@ -23785,7 +23785,7 @@ int lua_cocos2dx_Animate_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Animation* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0, "cc.Animate:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Animate_create'", nullptr); @@ -23942,9 +23942,9 @@ int lua_cocos2dx_TargetedAction_initWithTarget(lua_State* tolua_S) cocos2d::Node* arg0; cocos2d::FiniteTimeAction* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.TargetedAction:initWithTarget"); - ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1, "cc.TargetedAction:initWithTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TargetedAction_initWithTarget'", nullptr); @@ -23994,7 +23994,7 @@ int lua_cocos2dx_TargetedAction_setForcedTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.TargetedAction:setForcedTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TargetedAction_setForcedTarget'", nullptr); @@ -24033,8 +24033,8 @@ int lua_cocos2dx_TargetedAction_create(lua_State* tolua_S) { cocos2d::Node* arg0; cocos2d::FiniteTimeAction* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.TargetedAction:create"); + ok &= luaval_to_object(tolua_S, 3, "cc.FiniteTimeAction",&arg1, "cc.TargetedAction:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TargetedAction_create'", nullptr); @@ -27047,7 +27047,7 @@ int lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget(lua_State* tolua_S { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.EventDispatcher:pauseEventListenersForTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget'", nullptr); @@ -27062,7 +27062,7 @@ int lua_cocos2dx_EventDispatcher_pauseEventListenersForTarget(lua_State* tolua_S cocos2d::Node* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.EventDispatcher:pauseEventListenersForTarget"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.EventDispatcher:pauseEventListenersForTarget"); if(!ok) @@ -27115,9 +27115,9 @@ int lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority(lua_Stat cocos2d::EventListener* arg0; cocos2d::Node* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0, "cc.EventDispatcher:addEventListenerWithSceneGraphPriority"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.EventDispatcher:addEventListenerWithSceneGraphPriority"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority'", nullptr); @@ -27218,7 +27218,7 @@ int lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority(lua_State* to cocos2d::EventListener* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0, "cc.EventDispatcher:addEventListenerWithFixedPriority"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.EventDispatcher:addEventListenerWithFixedPriority"); if(!ok) @@ -27270,7 +27270,7 @@ int lua_cocos2dx_EventDispatcher_removeEventListener(lua_State* tolua_S) { cocos2d::EventListener* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0, "cc.EventDispatcher:removeEventListener"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_removeEventListener'", nullptr); @@ -27320,7 +27320,7 @@ int lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget(lua_State* tolua_ { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.EventDispatcher:resumeEventListenersForTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget'", nullptr); @@ -27335,7 +27335,7 @@ int lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget(lua_State* tolua_ cocos2d::Node* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.EventDispatcher:resumeEventListenersForTarget"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.EventDispatcher:resumeEventListenersForTarget"); if(!ok) @@ -27387,7 +27387,7 @@ int lua_cocos2dx_EventDispatcher_removeEventListenersForTarget(lua_State* tolua_ { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.EventDispatcher:removeEventListenersForTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_removeEventListenersForTarget'", nullptr); @@ -27402,7 +27402,7 @@ int lua_cocos2dx_EventDispatcher_removeEventListenersForTarget(lua_State* tolua_ cocos2d::Node* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.EventDispatcher:removeEventListenersForTarget"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.EventDispatcher:removeEventListenersForTarget"); if(!ok) @@ -27455,7 +27455,7 @@ int lua_cocos2dx_EventDispatcher_setPriority(lua_State* tolua_S) cocos2d::EventListener* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventListener",&arg0, "cc.EventDispatcher:setPriority"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.EventDispatcher:setPriority"); if(!ok) @@ -27564,7 +27564,7 @@ int lua_cocos2dx_EventDispatcher_dispatchEvent(lua_State* tolua_S) { cocos2d::Event* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Event",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Event",&arg0, "cc.EventDispatcher:dispatchEvent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_dispatchEvent'", nullptr); @@ -27867,9 +27867,9 @@ int lua_cocos2dx_EventFocus_constructor(lua_State* tolua_S) cocos2d::ui::Widget* arg0; cocos2d::ui::Widget* arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "cc.EventFocus:EventFocus"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1, "cc.EventFocus:EventFocus"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventFocus_constructor'", nullptr); @@ -30173,7 +30173,7 @@ int lua_cocos2dx_CardinalSplineTo_initWithDuration(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.CardinalSplineTo:initWithDuration"); - ok &= luaval_to_object(tolua_S, 3, "cc.PointArray",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PointArray",&arg1, "cc.CardinalSplineTo:initWithDuration"); ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.CardinalSplineTo:initWithDuration"); if(!ok) @@ -30345,7 +30345,7 @@ int lua_cocos2dx_CatmullRomTo_initWithDuration(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.CatmullRomTo:initWithDuration"); - ok &= luaval_to_object(tolua_S, 3, "cc.PointArray",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PointArray",&arg1, "cc.CatmullRomTo:initWithDuration"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_CatmullRomTo_initWithDuration'", nullptr); @@ -30418,7 +30418,7 @@ int lua_cocos2dx_CatmullRomBy_initWithDuration(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.CatmullRomBy:initWithDuration"); - ok &= luaval_to_object(tolua_S, 3, "cc.PointArray",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PointArray",&arg1, "cc.CatmullRomBy:initWithDuration"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_CatmullRomBy_initWithDuration'", nullptr); @@ -30488,7 +30488,7 @@ int lua_cocos2dx_ActionEase_initWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.ActionEase:initWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionEase_initWithAction'", nullptr); @@ -30657,7 +30657,7 @@ int lua_cocos2dx_EaseRateAction_initWithAction(lua_State* tolua_S) cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseRateAction:initWithAction"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseRateAction:initWithAction"); if(!ok) @@ -30745,7 +30745,7 @@ int lua_cocos2dx_EaseRateAction_create(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseRateAction:create"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseRateAction:create"); if(!ok) { @@ -30806,7 +30806,7 @@ int lua_cocos2dx_EaseIn_create(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseIn:create"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseIn:create"); if(!ok) { @@ -30902,7 +30902,7 @@ int lua_cocos2dx_EaseOut_create(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseOut:create"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseOut:create"); if(!ok) { @@ -30998,7 +30998,7 @@ int lua_cocos2dx_EaseInOut_create(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseInOut:create"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseInOut:create"); if(!ok) { @@ -31093,7 +31093,7 @@ int lua_cocos2dx_EaseExponentialIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseExponentialIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseExponentialIn_create'", nullptr); @@ -31187,7 +31187,7 @@ int lua_cocos2dx_EaseExponentialOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseExponentialOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseExponentialOut_create'", nullptr); @@ -31281,7 +31281,7 @@ int lua_cocos2dx_EaseExponentialInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseExponentialInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseExponentialInOut_create'", nullptr); @@ -31375,7 +31375,7 @@ int lua_cocos2dx_EaseSineIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseSineIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseSineIn_create'", nullptr); @@ -31469,7 +31469,7 @@ int lua_cocos2dx_EaseSineOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseSineOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseSineOut_create'", nullptr); @@ -31563,7 +31563,7 @@ int lua_cocos2dx_EaseSineInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseSineInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseSineInOut_create'", nullptr); @@ -31719,7 +31719,7 @@ int lua_cocos2dx_EaseElastic_initWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElastic:initWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseElastic_initWithAction'", nullptr); @@ -31734,7 +31734,7 @@ int lua_cocos2dx_EaseElastic_initWithAction(lua_State* tolua_S) cocos2d::ActionInterval* arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElastic:initWithAction"); ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseElastic:initWithAction"); if(!ok) @@ -31844,7 +31844,7 @@ int lua_cocos2dx_EaseElasticIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElasticIn:create"); if (!ok) { break; } cocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0); object_to_luaval(tolua_S, "cc.EaseElasticIn",(cocos2d::EaseElasticIn*)ret); @@ -31857,7 +31857,7 @@ int lua_cocos2dx_EaseElasticIn_create(lua_State* tolua_S) if (argc == 2) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElasticIn:create"); if (!ok) { break; } double arg1; ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseElasticIn:create"); @@ -31953,7 +31953,7 @@ int lua_cocos2dx_EaseElasticOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElasticOut:create"); if (!ok) { break; } cocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0); object_to_luaval(tolua_S, "cc.EaseElasticOut",(cocos2d::EaseElasticOut*)ret); @@ -31966,7 +31966,7 @@ int lua_cocos2dx_EaseElasticOut_create(lua_State* tolua_S) if (argc == 2) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElasticOut:create"); if (!ok) { break; } double arg1; ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseElasticOut:create"); @@ -32062,7 +32062,7 @@ int lua_cocos2dx_EaseElasticInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElasticInOut:create"); if (!ok) { break; } cocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0); object_to_luaval(tolua_S, "cc.EaseElasticInOut",(cocos2d::EaseElasticInOut*)ret); @@ -32075,7 +32075,7 @@ int lua_cocos2dx_EaseElasticInOut_create(lua_State* tolua_S) if (argc == 2) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseElasticInOut:create"); if (!ok) { break; } double arg1; ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EaseElasticInOut:create"); @@ -32189,7 +32189,7 @@ int lua_cocos2dx_EaseBounceIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBounceIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBounceIn_create'", nullptr); @@ -32283,7 +32283,7 @@ int lua_cocos2dx_EaseBounceOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBounceOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBounceOut_create'", nullptr); @@ -32377,7 +32377,7 @@ int lua_cocos2dx_EaseBounceInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBounceInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBounceInOut_create'", nullptr); @@ -32471,7 +32471,7 @@ int lua_cocos2dx_EaseBackIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBackIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBackIn_create'", nullptr); @@ -32565,7 +32565,7 @@ int lua_cocos2dx_EaseBackOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBackOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBackOut_create'", nullptr); @@ -32659,7 +32659,7 @@ int lua_cocos2dx_EaseBackInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBackInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBackInOut_create'", nullptr); @@ -32812,7 +32812,7 @@ int lua_cocos2dx_EaseBezierAction_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseBezierAction:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseBezierAction_create'", nullptr); @@ -32907,7 +32907,7 @@ int lua_cocos2dx_EaseQuadraticActionIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuadraticActionIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuadraticActionIn_create'", nullptr); @@ -33001,7 +33001,7 @@ int lua_cocos2dx_EaseQuadraticActionOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuadraticActionOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuadraticActionOut_create'", nullptr); @@ -33095,7 +33095,7 @@ int lua_cocos2dx_EaseQuadraticActionInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuadraticActionInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuadraticActionInOut_create'", nullptr); @@ -33189,7 +33189,7 @@ int lua_cocos2dx_EaseQuarticActionIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuarticActionIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuarticActionIn_create'", nullptr); @@ -33283,7 +33283,7 @@ int lua_cocos2dx_EaseQuarticActionOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuarticActionOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuarticActionOut_create'", nullptr); @@ -33377,7 +33377,7 @@ int lua_cocos2dx_EaseQuarticActionInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuarticActionInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuarticActionInOut_create'", nullptr); @@ -33471,7 +33471,7 @@ int lua_cocos2dx_EaseQuinticActionIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuinticActionIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuinticActionIn_create'", nullptr); @@ -33565,7 +33565,7 @@ int lua_cocos2dx_EaseQuinticActionOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuinticActionOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuinticActionOut_create'", nullptr); @@ -33659,7 +33659,7 @@ int lua_cocos2dx_EaseQuinticActionInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseQuinticActionInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseQuinticActionInOut_create'", nullptr); @@ -33753,7 +33753,7 @@ int lua_cocos2dx_EaseCircleActionIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseCircleActionIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseCircleActionIn_create'", nullptr); @@ -33847,7 +33847,7 @@ int lua_cocos2dx_EaseCircleActionOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseCircleActionOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseCircleActionOut_create'", nullptr); @@ -33941,7 +33941,7 @@ int lua_cocos2dx_EaseCircleActionInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseCircleActionInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseCircleActionInOut_create'", nullptr); @@ -34035,7 +34035,7 @@ int lua_cocos2dx_EaseCubicActionIn_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseCubicActionIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseCubicActionIn_create'", nullptr); @@ -34129,7 +34129,7 @@ int lua_cocos2dx_EaseCubicActionOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseCubicActionOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseCubicActionOut_create'", nullptr); @@ -34223,7 +34223,7 @@ int lua_cocos2dx_EaseCubicActionInOut_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.EaseCubicActionInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EaseCubicActionInOut_create'", nullptr); @@ -35309,7 +35309,7 @@ int lua_cocos2dx_CallFunc_setTargetCallback(lua_State* tolua_S) { cocos2d::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.CallFunc:setTargetCallback"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_CallFunc_setTargetCallback'", nullptr); @@ -38693,7 +38693,7 @@ int lua_cocos2dx_ActionManager_getActionByTag(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.ActionManager:getActionByTag"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.ActionManager:getActionByTag"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_getActionByTag'", nullptr); @@ -38746,7 +38746,7 @@ int lua_cocos2dx_ActionManager_removeActionByTag(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.ActionManager:removeActionByTag"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.ActionManager:removeActionByTag"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_removeActionByTag'", nullptr); @@ -38845,9 +38845,9 @@ int lua_cocos2dx_ActionManager_addAction(lua_State* tolua_S) cocos2d::Node* arg1; bool arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0, "cc.ActionManager:addAction"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.ActionManager:addAction"); ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.ActionManager:addAction"); if(!ok) @@ -38899,7 +38899,7 @@ int lua_cocos2dx_ActionManager_resumeTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ActionManager:resumeTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_resumeTarget'", nullptr); @@ -38999,7 +38999,7 @@ int lua_cocos2dx_ActionManager_pauseTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ActionManager:pauseTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_pauseTarget'", nullptr); @@ -39049,7 +39049,7 @@ int lua_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget(lua_State* tolu { const cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ActionManager:getNumberOfRunningActionsInTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget'", nullptr); @@ -39099,7 +39099,7 @@ int lua_cocos2dx_ActionManager_removeAllActionsFromTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ActionManager:removeAllActionsFromTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_removeAllActionsFromTarget'", nullptr); @@ -39199,7 +39199,7 @@ int lua_cocos2dx_ActionManager_removeAction(lua_State* tolua_S) { cocos2d::Action* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Action",&arg0, "cc.ActionManager:removeAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_removeAction'", nullptr); @@ -39252,7 +39252,7 @@ int lua_cocos2dx_ActionManager_removeAllActionsByTag(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.ActionManager:removeAllActionsByTag"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.ActionManager:removeAllActionsByTag"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ActionManager_removeAllActionsByTag'", nullptr); @@ -42602,7 +42602,7 @@ int lua_cocos2dx_GLProgramState_setUniformVec4v(lua_State* tolua_S) if (!ok) { break; } const cocos2d::Vec4* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2, "cc.GLProgramState:setUniformVec4v"); if (!ok) { break; } cobj->setUniformVec4v(arg0, arg1, arg2); @@ -42622,7 +42622,7 @@ int lua_cocos2dx_GLProgramState_setUniformVec4v(lua_State* tolua_S) if (!ok) { break; } const cocos2d::Vec4* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2, "cc.GLProgramState:setUniformVec4v"); if (!ok) { break; } cobj->setUniformVec4v(arg0, arg1, arg2); @@ -42786,7 +42786,7 @@ int lua_cocos2dx_GLProgramState_setUniformVec2v(lua_State* tolua_S) if (!ok) { break; } const cocos2d::Vec2* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2, "cc.GLProgramState:setUniformVec2v"); if (!ok) { break; } cobj->setUniformVec2v(arg0, arg1, arg2); @@ -42806,7 +42806,7 @@ int lua_cocos2dx_GLProgramState_setUniformVec2v(lua_State* tolua_S) if (!ok) { break; } const cocos2d::Vec2* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2, "cc.GLProgramState:setUniformVec2v"); if (!ok) { break; } cobj->setUniformVec2v(arg0, arg1, arg2); @@ -43010,7 +43010,7 @@ int lua_cocos2dx_GLProgramState_setGLProgram(lua_State* tolua_S) { cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:setGLProgram"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); @@ -43194,7 +43194,7 @@ int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GLProgramState:setUniformTexture"); if (!ok) { break; } cobj->setUniformTexture(arg0, arg1); @@ -43210,7 +43210,7 @@ int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GLProgramState:setUniformTexture"); if (!ok) { break; } cobj->setUniformTexture(arg0, arg1); @@ -43450,7 +43450,7 @@ int lua_cocos2dx_GLProgramState_setUniformVec3v(lua_State* tolua_S) if (!ok) { break; } const cocos2d::Vec3* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2, "cc.GLProgramState:setUniformVec3v"); if (!ok) { break; } cobj->setUniformVec3v(arg0, arg1, arg2); @@ -43470,7 +43470,7 @@ int lua_cocos2dx_GLProgramState_setUniformVec3v(lua_State* tolua_S) if (!ok) { break; } const cocos2d::Vec3* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2, "cc.GLProgramState:setUniformVec3v"); if (!ok) { break; } cobj->setUniformVec3v(arg0, arg1, arg2); @@ -43554,7 +43554,7 @@ int lua_cocos2dx_GLProgramState_create(lua_State* tolua_S) if (argc == 1) { cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_create'", nullptr); @@ -43626,7 +43626,7 @@ int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram(lua_State* tolua_S) if (argc == 1) { cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:getOrCreateWithGLProgram"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'", nullptr); @@ -43911,7 +43911,7 @@ int lua_cocos2dx_AtlasNode_setTextureAtlas(lua_State* tolua_S) { cocos2d::TextureAtlas* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.AtlasNode:setTextureAtlas"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'", nullptr); @@ -44152,7 +44152,7 @@ int lua_cocos2dx_AtlasNode_setTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.AtlasNode:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_AtlasNode_setTexture'", nullptr); @@ -44205,7 +44205,7 @@ int lua_cocos2dx_AtlasNode_initWithTexture(lua_State* tolua_S) int arg2; int arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.AtlasNode:initWithTexture"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.AtlasNode:initWithTexture"); @@ -44519,7 +44519,7 @@ int lua_cocos2dx_ClippingNode_setStencil(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ClippingNode:setStencil"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ClippingNode_setStencil'", nullptr); @@ -44616,7 +44616,7 @@ int lua_cocos2dx_ClippingNode_init(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ClippingNode:init"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ClippingNode_init'", nullptr); @@ -44799,7 +44799,7 @@ int lua_cocos2dx_ClippingNode_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ClippingNode:create"); if (!ok) { break; } cocos2d::ClippingNode* ret = cocos2d::ClippingNode::create(arg0); object_to_luaval(tolua_S, "cc.ClippingNode",(cocos2d::ClippingNode*)ret); @@ -46304,7 +46304,7 @@ int lua_cocos2dx_SpriteBatchNode_appendChild(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:appendChild"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_appendChild'", nullptr); @@ -46451,7 +46451,7 @@ int lua_cocos2dx_SpriteBatchNode_setTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteBatchNode:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_setTexture'", nullptr); @@ -46554,7 +46554,7 @@ int lua_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:removeSpriteFromAtlas"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas'", nullptr); @@ -46606,7 +46606,7 @@ int lua_cocos2dx_SpriteBatchNode_addSpriteWithoutQuad(lua_State* tolua_S) int arg1; int arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:addSpriteWithoutQuad"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.SpriteBatchNode:addSpriteWithoutQuad"); @@ -46661,7 +46661,7 @@ int lua_cocos2dx_SpriteBatchNode_atlasIndexForChild(lua_State* tolua_S) cocos2d::Sprite* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:atlasIndexForChild"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.SpriteBatchNode:atlasIndexForChild"); if(!ok) @@ -46760,7 +46760,7 @@ int lua_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:lowestAtlasIndexInChild"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild'", nullptr); @@ -46857,7 +46857,7 @@ int lua_cocos2dx_SpriteBatchNode_initWithTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteBatchNode:initWithTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_initWithTexture'", nullptr); @@ -46872,7 +46872,7 @@ int lua_cocos2dx_SpriteBatchNode_initWithTexture(lua_State* tolua_S) cocos2d::Texture2D* arg0; ssize_t arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteBatchNode:initWithTexture"); ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.SpriteBatchNode:initWithTexture"); if(!ok) @@ -46924,7 +46924,7 @@ int lua_cocos2dx_SpriteBatchNode_setTextureAtlas(lua_State* tolua_S) { cocos2d::TextureAtlas* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.SpriteBatchNode:setTextureAtlas"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_setTextureAtlas'", nullptr); @@ -47025,7 +47025,7 @@ int lua_cocos2dx_SpriteBatchNode_insertQuadFromSprite(lua_State* tolua_S) cocos2d::Sprite* arg0; ssize_t arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:insertQuadFromSprite"); ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.SpriteBatchNode:insertQuadFromSprite"); if(!ok) @@ -47195,7 +47195,7 @@ int lua_cocos2dx_SpriteBatchNode_rebuildIndexInOrder(lua_State* tolua_S) cocos2d::Sprite* arg0; ssize_t arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:rebuildIndexInOrder"); ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.SpriteBatchNode:rebuildIndexInOrder"); if(!ok) @@ -47294,7 +47294,7 @@ int lua_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.SpriteBatchNode:highestAtlasIndexInChild"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild'", nullptr); @@ -47383,7 +47383,7 @@ int lua_cocos2dx_SpriteBatchNode_createWithTexture(lua_State* tolua_S) if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteBatchNode:createWithTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteBatchNode_createWithTexture'", nullptr); @@ -47397,7 +47397,7 @@ int lua_cocos2dx_SpriteBatchNode_createWithTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; ssize_t arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteBatchNode:createWithTexture"); ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.SpriteBatchNode:createWithTexture"); if(!ok) { @@ -48772,7 +48772,7 @@ int lua_cocos2dx_Label_setCharMap(lua_State* tolua_S) do{ if (argc == 4) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Label:setCharMap"); if (!ok) { break; } int arg1; @@ -49916,7 +49916,7 @@ int lua_cocos2dx_Label_createWithCharMap(lua_State* tolua_S) if (argc == 4) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Label:createWithCharMap"); if (!ok) { break; } int arg1; ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.Label:createWithCharMap"); @@ -50268,7 +50268,7 @@ int lua_cocos2dx_LabelAtlas_initWithString(lua_State* tolua_S) if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.LabelAtlas:initWithString"); if (!ok) { break; } int arg2; @@ -51930,7 +51930,7 @@ int lua_cocos2dx_LayerMultiplex_addLayer(lua_State* tolua_S) { cocos2d::Layer* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Layer",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Layer",&arg0, "cc.LayerMultiplex:addLayer"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerMultiplex_addLayer'", nullptr); @@ -52487,7 +52487,7 @@ int lua_cocos2dx_MenuItemLabel_setLabel(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.MenuItemLabel:setLabel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemLabel_setLabel'", nullptr); @@ -52635,7 +52635,7 @@ int lua_cocos2dx_MenuItemLabel_initWithLabel(lua_State* tolua_S) cocos2d::Node* arg0; std::function arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.MenuItemLabel:initWithLabel"); do { // Lambda binding for lua is not supported. @@ -53532,7 +53532,7 @@ int lua_cocos2dx_MenuItemSprite_setNormalImage(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.MenuItemSprite:setNormalImage"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemSprite_setNormalImage'", nullptr); @@ -53582,7 +53582,7 @@ int lua_cocos2dx_MenuItemSprite_setDisabledImage(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.MenuItemSprite:setDisabledImage"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemSprite_setDisabledImage'", nullptr); @@ -53635,11 +53635,11 @@ int lua_cocos2dx_MenuItemSprite_initWithNormalSprite(lua_State* tolua_S) cocos2d::Node* arg2; std::function arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.MenuItemSprite:initWithNormalSprite"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.MenuItemSprite:initWithNormalSprite"); - ok &= luaval_to_object(tolua_S, 4, "cc.Node",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Node",&arg2, "cc.MenuItemSprite:initWithNormalSprite"); do { // Lambda binding for lua is not supported. @@ -53695,7 +53695,7 @@ int lua_cocos2dx_MenuItemSprite_setSelectedImage(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.MenuItemSprite:setSelectedImage"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemSprite_setSelectedImage'", nullptr); @@ -54000,7 +54000,7 @@ int lua_cocos2dx_MenuItemImage_setDisabledSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.MenuItemImage:setDisabledSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemImage_setDisabledSpriteFrame'", nullptr); @@ -54050,7 +54050,7 @@ int lua_cocos2dx_MenuItemImage_setSelectedSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.MenuItemImage:setSelectedSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemImage_setSelectedSpriteFrame'", nullptr); @@ -54100,7 +54100,7 @@ int lua_cocos2dx_MenuItemImage_setNormalSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.MenuItemImage:setNormalSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemImage_setNormalSpriteFrame'", nullptr); @@ -54372,7 +54372,7 @@ int lua_cocos2dx_MenuItemToggle_initWithItem(lua_State* tolua_S) { cocos2d::MenuItem* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.MenuItem",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.MenuItem",&arg0, "cc.MenuItemToggle:initWithItem"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemToggle_initWithItem'", nullptr); @@ -54469,7 +54469,7 @@ int lua_cocos2dx_MenuItemToggle_addSubItem(lua_State* tolua_S) { cocos2d::MenuItem* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.MenuItem",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.MenuItem",&arg0, "cc.MenuItemToggle:addSubItem"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MenuItemToggle_addSubItem'", nullptr); @@ -55131,7 +55131,7 @@ int lua_cocos2dx_MotionStreak_setTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.MotionStreak:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_MotionStreak_setTexture'", nullptr); @@ -55576,7 +55576,7 @@ int lua_cocos2dx_MotionStreak_initWithFade(lua_State* tolua_S) if (!ok) { break; } cocos2d::Texture2D* arg4; - ok &= luaval_to_object(tolua_S, 6, "cc.Texture2D",&arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Texture2D",&arg4, "cc.MotionStreak:initWithFade"); if (!ok) { break; } bool ret = cobj->initWithFade(arg0, arg1, arg2, arg3, arg4); @@ -55754,7 +55754,7 @@ int lua_cocos2dx_MotionStreak_create(lua_State* tolua_S) ok &= luaval_to_color3b(tolua_S, 5, &arg3, "cc.MotionStreak:create"); if (!ok) { break; } cocos2d::Texture2D* arg4; - ok &= luaval_to_object(tolua_S, 6, "cc.Texture2D",&arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Texture2D",&arg4, "cc.MotionStreak:create"); if (!ok) { break; } cocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4); object_to_luaval(tolua_S, "cc.MotionStreak",(cocos2d::MotionStreak*)ret); @@ -55896,7 +55896,7 @@ int lua_cocos2dx_NodeGrid_setTarget(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.NodeGrid:setTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_NodeGrid_setTarget'", nullptr); @@ -55993,7 +55993,7 @@ int lua_cocos2dx_NodeGrid_setGrid(lua_State* tolua_S) { cocos2d::GridBase* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GridBase",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GridBase",&arg0, "cc.NodeGrid:setGrid"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_NodeGrid_setGrid'", nullptr); @@ -56138,7 +56138,7 @@ int lua_cocos2dx_ParticleBatchNode_setTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.ParticleBatchNode:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleBatchNode_setTexture'", nullptr); @@ -56189,7 +56189,7 @@ int lua_cocos2dx_ParticleBatchNode_initWithTexture(lua_State* tolua_S) cocos2d::Texture2D* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.ParticleBatchNode:initWithTexture"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ParticleBatchNode:initWithTexture"); if(!ok) @@ -56338,7 +56338,7 @@ int lua_cocos2dx_ParticleBatchNode_setTextureAtlas(lua_State* tolua_S) { cocos2d::TextureAtlas* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.ParticleBatchNode:setTextureAtlas"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleBatchNode_setTextureAtlas'", nullptr); @@ -56636,7 +56636,7 @@ int lua_cocos2dx_ParticleBatchNode_insertChild(lua_State* tolua_S) cocos2d::ParticleSystem* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.ParticleSystem",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ParticleSystem",&arg0, "cc.ParticleBatchNode:insertChild"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ParticleBatchNode:insertChild"); if(!ok) @@ -56780,7 +56780,7 @@ int lua_cocos2dx_ParticleBatchNode_createWithTexture(lua_State* tolua_S) if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.ParticleBatchNode:createWithTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleBatchNode_createWithTexture'", nullptr); @@ -56794,7 +56794,7 @@ int lua_cocos2dx_ParticleBatchNode_createWithTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.ParticleBatchNode:createWithTexture"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ParticleBatchNode:createWithTexture"); if(!ok) { @@ -58169,7 +58169,7 @@ int lua_cocos2dx_ParticleSystem_setTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.ParticleSystem:setTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleSystem_setTexture'", nullptr); @@ -59874,7 +59874,7 @@ int lua_cocos2dx_ParticleSystem_setBatchNode(lua_State* tolua_S) { cocos2d::ParticleBatchNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ParticleBatchNode",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ParticleBatchNode",&arg0, "cc.ParticleSystem:setBatchNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleSystem_setBatchNode'", nullptr); @@ -61848,7 +61848,7 @@ int lua_cocos2dx_ParticleSystemQuad_setDisplayFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.ParticleSystemQuad:setDisplayFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleSystemQuad_setDisplayFrame'", nullptr); @@ -61899,7 +61899,7 @@ int lua_cocos2dx_ParticleSystemQuad_setTextureWithRect(lua_State* tolua_S) cocos2d::Texture2D* arg0; cocos2d::Rect arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.ParticleSystemQuad:setTextureWithRect"); ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.ParticleSystemQuad:setTextureWithRect"); if(!ok) @@ -61951,7 +61951,7 @@ int lua_cocos2dx_ParticleSystemQuad_listenRendererRecreated(lua_State* tolua_S) { cocos2d::EventCustom* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.EventCustom",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.EventCustom",&arg0, "cc.ParticleSystemQuad:listenRendererRecreated"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ParticleSystemQuad_listenRendererRecreated'", nullptr); @@ -64566,7 +64566,7 @@ int lua_cocos2dx_ProgressTimer_initWithSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ProgressTimer:initWithSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ProgressTimer_initWithSprite'", nullptr); @@ -64760,7 +64760,7 @@ int lua_cocos2dx_ProgressTimer_setSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ProgressTimer:setSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ProgressTimer_setSprite'", nullptr); @@ -65191,7 +65191,7 @@ int lua_cocos2dx_ProgressTimer_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ProgressTimer:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ProgressTimer_create'", nullptr); @@ -65304,7 +65304,7 @@ int lua_cocos2dx_ProtectedNode_addProtectedChild(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ProtectedNode:addProtectedChild"); if (!ok) { break; } int arg1; @@ -65320,7 +65320,7 @@ int lua_cocos2dx_ProtectedNode_addProtectedChild(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ProtectedNode:addProtectedChild"); if (!ok) { break; } cobj->addProtectedChild(arg0); @@ -65332,7 +65332,7 @@ int lua_cocos2dx_ProtectedNode_addProtectedChild(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ProtectedNode:addProtectedChild"); if (!ok) { break; } int arg1; @@ -65504,7 +65504,7 @@ int lua_cocos2dx_ProtectedNode_reorderProtectedChild(lua_State* tolua_S) cocos2d::Node* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ProtectedNode:reorderProtectedChild"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ProtectedNode:reorderProtectedChild"); if(!ok) @@ -65750,7 +65750,7 @@ int lua_cocos2dx_ProtectedNode_removeProtectedChild(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ProtectedNode:removeProtectedChild"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ProtectedNode_removeProtectedChild'", nullptr); @@ -65765,7 +65765,7 @@ int lua_cocos2dx_ProtectedNode_removeProtectedChild(lua_State* tolua_S) cocos2d::Node* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ProtectedNode:removeProtectedChild"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.ProtectedNode:removeProtectedChild"); if(!ok) @@ -65960,7 +65960,7 @@ int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:setSpriteFrame"); if (!ok) { break; } cobj->setSpriteFrame(arg0); @@ -66015,7 +66015,7 @@ int lua_cocos2dx_Sprite_setTexture(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:setTexture"); if (!ok) { break; } cobj->setTexture(arg0); @@ -66217,7 +66217,7 @@ int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; @@ -66233,7 +66233,7 @@ int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); if (!ok) { break; } bool ret = cobj->initWithTexture(arg0); @@ -66245,7 +66245,7 @@ int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; @@ -66559,7 +66559,7 @@ int lua_cocos2dx_Sprite_isFrameDisplayed(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:isFrameDisplayed"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); @@ -66656,7 +66656,7 @@ int lua_cocos2dx_Sprite_setBatchNode(lua_State* tolua_S) { cocos2d::SpriteBatchNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0, "cc.Sprite:setBatchNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); @@ -66806,7 +66806,7 @@ int lua_cocos2dx_Sprite_setTextureAtlas(lua_State* tolua_S) { cocos2d::TextureAtlas* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.Sprite:setTextureAtlas"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); @@ -67300,7 +67300,7 @@ int lua_cocos2dx_Sprite_initWithSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:initWithSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); @@ -67544,7 +67544,7 @@ int lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S) if (argc == 2) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); @@ -67560,7 +67560,7 @@ int lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S) if (argc == 3) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); if (!ok) { break; } cocos2d::Rect arg1; ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); @@ -67579,7 +67579,7 @@ int lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S) if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); if (!ok) { break; } cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); @@ -67649,7 +67649,7 @@ int lua_cocos2dx_Sprite_createWithSpriteFrame(lua_State* tolua_S) if (argc == 1) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:createWithSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'", nullptr); @@ -68730,7 +68730,7 @@ int lua_cocos2dx_RenderTexture_setSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.RenderTexture:setSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_RenderTexture_setSprite'", nullptr); @@ -69980,7 +69980,7 @@ int lua_cocos2dx_TransitionEaseScene_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionEaseScene:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionEaseScene_easeActionWithAction'", nullptr); @@ -70147,7 +70147,7 @@ int lua_cocos2dx_TransitionScene_initWithDuration(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionScene:initWithDuration"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionScene:initWithDuration"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionScene_initWithDuration'", nullptr); @@ -70281,7 +70281,7 @@ int lua_cocos2dx_TransitionScene_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionScene:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionScene:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionScene_create'", nullptr); @@ -70396,7 +70396,7 @@ int lua_cocos2dx_TransitionSceneOriented_initWithDuration(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSceneOriented:initWithDuration"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSceneOriented:initWithDuration"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionSceneOriented:initWithDuration"); if(!ok) @@ -70439,7 +70439,7 @@ int lua_cocos2dx_TransitionSceneOriented_create(lua_State* tolua_S) cocos2d::Scene* arg1; cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSceneOriented:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSceneOriented:create"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionSceneOriented:create"); if(!ok) { @@ -70537,7 +70537,7 @@ int lua_cocos2dx_TransitionRotoZoom_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionRotoZoom:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionRotoZoom:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionRotoZoom_create'", nullptr); @@ -70633,7 +70633,7 @@ int lua_cocos2dx_TransitionJumpZoom_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionJumpZoom:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionJumpZoom:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionJumpZoom_create'", nullptr); @@ -70786,7 +70786,7 @@ int lua_cocos2dx_TransitionMoveInL_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionMoveInL:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionMoveInL_easeActionWithAction'", nullptr); @@ -70826,7 +70826,7 @@ int lua_cocos2dx_TransitionMoveInL_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionMoveInL:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionMoveInL:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionMoveInL_create'", nullptr); @@ -70924,7 +70924,7 @@ int lua_cocos2dx_TransitionMoveInR_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionMoveInR:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionMoveInR:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionMoveInR_create'", nullptr); @@ -71020,7 +71020,7 @@ int lua_cocos2dx_TransitionMoveInT_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionMoveInT:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionMoveInT:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionMoveInT_create'", nullptr); @@ -71116,7 +71116,7 @@ int lua_cocos2dx_TransitionMoveInB_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionMoveInB:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionMoveInB:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionMoveInB_create'", nullptr); @@ -71269,7 +71269,7 @@ int lua_cocos2dx_TransitionSlideInL_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionSlideInL:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSlideInL_easeActionWithAction'", nullptr); @@ -71309,7 +71309,7 @@ int lua_cocos2dx_TransitionSlideInL_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSlideInL:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSlideInL:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSlideInL_create'", nullptr); @@ -71407,7 +71407,7 @@ int lua_cocos2dx_TransitionSlideInR_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSlideInR:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSlideInR:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSlideInR_create'", nullptr); @@ -71503,7 +71503,7 @@ int lua_cocos2dx_TransitionSlideInB_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSlideInB:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSlideInB:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSlideInB_create'", nullptr); @@ -71599,7 +71599,7 @@ int lua_cocos2dx_TransitionSlideInT_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSlideInT:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSlideInT:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSlideInT_create'", nullptr); @@ -71705,7 +71705,7 @@ int lua_cocos2dx_TransitionShrinkGrow_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionShrinkGrow:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionShrinkGrow_easeActionWithAction'", nullptr); @@ -71745,7 +71745,7 @@ int lua_cocos2dx_TransitionShrinkGrow_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionShrinkGrow:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionShrinkGrow:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionShrinkGrow_create'", nullptr); @@ -71844,7 +71844,7 @@ int lua_cocos2dx_TransitionFlipX_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFlipX:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFlipX:create"); if (!ok) { break; } cocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionFlipX",(cocos2d::TransitionFlipX*)ret); @@ -71860,7 +71860,7 @@ int lua_cocos2dx_TransitionFlipX_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFlipX:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFlipX:create"); if (!ok) { break; } cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionFlipX:create"); @@ -71959,7 +71959,7 @@ int lua_cocos2dx_TransitionFlipY_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFlipY:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFlipY:create"); if (!ok) { break; } cocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionFlipY",(cocos2d::TransitionFlipY*)ret); @@ -71975,7 +71975,7 @@ int lua_cocos2dx_TransitionFlipY_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFlipY:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFlipY:create"); if (!ok) { break; } cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionFlipY:create"); @@ -72074,7 +72074,7 @@ int lua_cocos2dx_TransitionFlipAngular_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFlipAngular:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFlipAngular:create"); if (!ok) { break; } cocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionFlipAngular",(cocos2d::TransitionFlipAngular*)ret); @@ -72090,7 +72090,7 @@ int lua_cocos2dx_TransitionFlipAngular_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFlipAngular:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFlipAngular:create"); if (!ok) { break; } cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionFlipAngular:create"); @@ -72189,7 +72189,7 @@ int lua_cocos2dx_TransitionZoomFlipX_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionZoomFlipX:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionZoomFlipX:create"); if (!ok) { break; } cocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionZoomFlipX",(cocos2d::TransitionZoomFlipX*)ret); @@ -72205,7 +72205,7 @@ int lua_cocos2dx_TransitionZoomFlipX_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionZoomFlipX:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionZoomFlipX:create"); if (!ok) { break; } cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionZoomFlipX:create"); @@ -72304,7 +72304,7 @@ int lua_cocos2dx_TransitionZoomFlipY_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionZoomFlipY:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionZoomFlipY:create"); if (!ok) { break; } cocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionZoomFlipY",(cocos2d::TransitionZoomFlipY*)ret); @@ -72320,7 +72320,7 @@ int lua_cocos2dx_TransitionZoomFlipY_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionZoomFlipY:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionZoomFlipY:create"); if (!ok) { break; } cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionZoomFlipY:create"); @@ -72419,7 +72419,7 @@ int lua_cocos2dx_TransitionZoomFlipAngular_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionZoomFlipAngular:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionZoomFlipAngular:create"); if (!ok) { break; } cocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionZoomFlipAngular",(cocos2d::TransitionZoomFlipAngular*)ret); @@ -72435,7 +72435,7 @@ int lua_cocos2dx_TransitionZoomFlipAngular_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionZoomFlipAngular:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionZoomFlipAngular:create"); if (!ok) { break; } cocos2d::TransitionScene::Orientation arg2; ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TransitionZoomFlipAngular:create"); @@ -72540,7 +72540,7 @@ int lua_cocos2dx_TransitionFade_initWithDuration(lua_State* tolua_S) if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFade:initWithDuration"); if (!ok) { break; } bool ret = cobj->initWithDuration(arg0, arg1); @@ -72556,7 +72556,7 @@ int lua_cocos2dx_TransitionFade_initWithDuration(lua_State* tolua_S) if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFade:initWithDuration"); if (!ok) { break; } cocos2d::Color3B arg2; @@ -72601,7 +72601,7 @@ int lua_cocos2dx_TransitionFade_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFade:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFade:create"); if (!ok) { break; } cocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1); object_to_luaval(tolua_S, "cc.TransitionFade",(cocos2d::TransitionFade*)ret); @@ -72617,7 +72617,7 @@ int lua_cocos2dx_TransitionFade_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFade:create"); if (!ok) { break; } cocos2d::Scene* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFade:create"); if (!ok) { break; } cocos2d::Color3B arg2; ok &= luaval_to_color3b(tolua_S, 4, &arg2, "cc.TransitionFade:create"); @@ -72715,7 +72715,7 @@ int lua_cocos2dx_TransitionCrossFade_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionCrossFade:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionCrossFade:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionCrossFade_create'", nullptr); @@ -72821,7 +72821,7 @@ int lua_cocos2dx_TransitionTurnOffTiles_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionTurnOffTiles:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionTurnOffTiles_easeActionWithAction'", nullptr); @@ -72861,7 +72861,7 @@ int lua_cocos2dx_TransitionTurnOffTiles_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionTurnOffTiles:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionTurnOffTiles:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionTurnOffTiles_create'", nullptr); @@ -73015,7 +73015,7 @@ int lua_cocos2dx_TransitionSplitCols_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionSplitCols:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSplitCols_easeActionWithAction'", nullptr); @@ -73055,7 +73055,7 @@ int lua_cocos2dx_TransitionSplitCols_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSplitCols:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSplitCols:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSplitCols_create'", nullptr); @@ -73153,7 +73153,7 @@ int lua_cocos2dx_TransitionSplitRows_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionSplitRows:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionSplitRows:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionSplitRows_create'", nullptr); @@ -73259,7 +73259,7 @@ int lua_cocos2dx_TransitionFadeTR_easeActionWithAction(lua_State* tolua_S) { cocos2d::ActionInterval* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ActionInterval",&arg0, "cc.TransitionFadeTR:easeActionWithAction"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionFadeTR_easeActionWithAction'", nullptr); @@ -73349,7 +73349,7 @@ int lua_cocos2dx_TransitionFadeTR_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFadeTR:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFadeTR:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionFadeTR_create'", nullptr); @@ -73447,7 +73447,7 @@ int lua_cocos2dx_TransitionFadeBL_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFadeBL:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFadeBL:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionFadeBL_create'", nullptr); @@ -73543,7 +73543,7 @@ int lua_cocos2dx_TransitionFadeUp_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFadeUp:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFadeUp:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionFadeUp_create'", nullptr); @@ -73639,7 +73639,7 @@ int lua_cocos2dx_TransitionFadeDown_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionFadeDown:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionFadeDown:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionFadeDown_create'", nullptr); @@ -73799,7 +73799,7 @@ int lua_cocos2dx_TransitionPageTurn_initWithDuration(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionPageTurn:initWithDuration"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionPageTurn:initWithDuration"); ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.TransitionPageTurn:initWithDuration"); if(!ok) @@ -73842,7 +73842,7 @@ int lua_cocos2dx_TransitionPageTurn_create(lua_State* tolua_S) cocos2d::Scene* arg1; bool arg2; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionPageTurn:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionPageTurn:create"); ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.TransitionPageTurn:create"); if(!ok) { @@ -73941,7 +73941,7 @@ int lua_cocos2dx_TransitionProgress_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgress:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgress:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgress_create'", nullptr); @@ -74037,7 +74037,7 @@ int lua_cocos2dx_TransitionProgressRadialCCW_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgressRadialCCW:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgressRadialCCW:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgressRadialCCW_create'", nullptr); @@ -74133,7 +74133,7 @@ int lua_cocos2dx_TransitionProgressRadialCW_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgressRadialCW:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgressRadialCW:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgressRadialCW_create'", nullptr); @@ -74229,7 +74229,7 @@ int lua_cocos2dx_TransitionProgressHorizontal_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgressHorizontal:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgressHorizontal:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgressHorizontal_create'", nullptr); @@ -74325,7 +74325,7 @@ int lua_cocos2dx_TransitionProgressVertical_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgressVertical:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgressVertical:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgressVertical_create'", nullptr); @@ -74421,7 +74421,7 @@ int lua_cocos2dx_TransitionProgressInOut_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgressInOut:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgressInOut:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgressInOut_create'", nullptr); @@ -74517,7 +74517,7 @@ int lua_cocos2dx_TransitionProgressOutIn_create(lua_State* tolua_S) double arg0; cocos2d::Scene* arg1; ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.TransitionProgressOutIn:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Scene",&arg1, "cc.TransitionProgressOutIn:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TransitionProgressOutIn_create'", nullptr); @@ -74623,7 +74623,7 @@ int lua_cocos2dx_Camera_setScene(lua_State* tolua_S) { cocos2d::Scene* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "cc.Camera:setScene"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_setScene'", nullptr); @@ -75034,6 +75034,65 @@ int lua_cocos2dx_Camera_project(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Camera_initOrthographic(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Camera* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Camera",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Camera*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Camera_initOrthographic'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 4) + { + double arg0; + double arg1; + double arg2; + double arg3; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Camera:initOrthographic"); + + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Camera:initOrthographic"); + + ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.Camera:initOrthographic"); + + ok &= luaval_to_number(tolua_S, 5,&arg3, "cc.Camera:initOrthographic"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_initOrthographic'", nullptr); + return 0; + } + bool ret = cobj->initOrthographic(arg0, arg1, arg2, arg3); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Camera:initOrthographic",argc, 4); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Camera_initOrthographic'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Camera_getDepthInView(lua_State* tolua_S) { int argc = 0; @@ -75181,7 +75240,7 @@ int lua_cocos2dx_Camera_isVisibleInFrustum(lua_State* tolua_S) { const cocos2d::AABB* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.AABB",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.AABB",&arg0, "cc.Camera:isVisibleInFrustum"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_isVisibleInFrustum'", nullptr); @@ -75251,7 +75310,7 @@ int lua_cocos2dx_Camera_setCameraFlag(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Camera_initOrthographic(lua_State* tolua_S) +int lua_cocos2dx_Camera_clearBackground(lua_State* tolua_S) { int argc = 0; cocos2d::Camera* cobj = nullptr; @@ -75271,41 +75330,32 @@ int lua_cocos2dx_Camera_initOrthographic(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Camera_initOrthographic'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Camera_clearBackground'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 4) + if (argc == 1) { double arg0; - double arg1; - double arg2; - double arg3; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Camera:initOrthographic"); - - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.Camera:initOrthographic"); - - ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.Camera:initOrthographic"); - - ok &= luaval_to_number(tolua_S, 5,&arg3, "cc.Camera:initOrthographic"); + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Camera:clearBackground"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_initOrthographic'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_clearBackground'", nullptr); return 0; } - bool ret = cobj->initOrthographic(arg0, arg1, arg2, arg3); - tolua_pushboolean(tolua_S,(bool)ret); + cobj->clearBackground(arg0); + lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Camera:initOrthographic",argc, 4); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Camera:clearBackground",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Camera_initOrthographic'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Camera_clearBackground'.",&tolua_err); #endif return 0; @@ -75702,11 +75752,12 @@ int lua_register_cocos2dx_Camera(lua_State* tolua_S) tolua_function(tolua_S,"getType",lua_cocos2dx_Camera_getType); tolua_function(tolua_S,"initDefault",lua_cocos2dx_Camera_initDefault); tolua_function(tolua_S,"project",lua_cocos2dx_Camera_project); + tolua_function(tolua_S,"initOrthographic",lua_cocos2dx_Camera_initOrthographic); tolua_function(tolua_S,"getDepthInView",lua_cocos2dx_Camera_getDepthInView); tolua_function(tolua_S,"lookAt",lua_cocos2dx_Camera_lookAt); tolua_function(tolua_S,"isVisibleInFrustum",lua_cocos2dx_Camera_isVisibleInFrustum); tolua_function(tolua_S,"setCameraFlag",lua_cocos2dx_Camera_setCameraFlag); - tolua_function(tolua_S,"initOrthographic",lua_cocos2dx_Camera_initOrthographic); + tolua_function(tolua_S,"clearBackground",lua_cocos2dx_Camera_clearBackground); tolua_function(tolua_S,"setAdditionalProjection",lua_cocos2dx_Camera_setAdditionalProjection); tolua_function(tolua_S,"getDepth",lua_cocos2dx_Camera_getDepth); tolua_function(tolua_S,"setDepth",lua_cocos2dx_Camera_setDepth); @@ -75849,7 +75900,7 @@ int lua_cocos2dx_GridBase_afterDraw(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.GridBase:afterDraw"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GridBase_afterDraw'", nullptr); @@ -76435,7 +76486,7 @@ int lua_cocos2dx_GridBase_initWithSize(lua_State* tolua_S) if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GridBase:initWithSize"); if (!ok) { break; } bool arg2; @@ -76684,7 +76735,7 @@ int lua_cocos2dx_GridBase_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.GridBase:create"); if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GridBase:create"); if (!ok) { break; } bool arg2; ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.GridBase:create"); @@ -76874,7 +76925,7 @@ int lua_cocos2dx_Grid3D_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.Grid3D:create"); if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.Grid3D:create"); if (!ok) { break; } bool arg2; ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Grid3D:create"); @@ -76988,7 +77039,7 @@ int lua_cocos2dx_TiledGrid3D_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.TiledGrid3D:create"); if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.TiledGrid3D:create"); if (!ok) { break; } bool arg2; ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.TiledGrid3D:create"); @@ -79446,7 +79497,7 @@ int lua_cocos2dx_GLProgramCache_addGLProgram(lua_State* tolua_S) cocos2d::GLProgram* arg0; std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramCache:addGLProgram"); ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramCache:addGLProgram"); if(!ok) @@ -80055,7 +80106,7 @@ int lua_cocos2dx_TextureCache_addImage(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Image* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Image",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Image",&arg0, "cc.TextureCache:addImage"); if (!ok) { break; } std::string arg1; @@ -80190,6 +80241,56 @@ int lua_cocos2dx_TextureCache_getTextureForKey(lua_State* tolua_S) return 0; } +int lua_cocos2dx_TextureCache_getTextureFilePath(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::TextureCache* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.TextureCache",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_getTextureFilePath'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Texture2D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.TextureCache:getTextureFilePath"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TextureCache_getTextureFilePath'", nullptr); + return 0; + } + const std::string ret = cobj->getTextureFilePath(arg0); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TextureCache:getTextureFilePath",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TextureCache_getTextureFilePath'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_TextureCache_removeUnusedTextures(lua_State* tolua_S) { int argc = 0; @@ -80267,7 +80368,7 @@ int lua_cocos2dx_TextureCache_removeTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.TextureCache:removeTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TextureCache_removeTexture'", nullptr); @@ -80393,6 +80494,7 @@ int lua_register_cocos2dx_TextureCache(lua_State* tolua_S) tolua_function(tolua_S,"addImage",lua_cocos2dx_TextureCache_addImage); tolua_function(tolua_S,"unbindImageAsync",lua_cocos2dx_TextureCache_unbindImageAsync); tolua_function(tolua_S,"getTextureForKey",lua_cocos2dx_TextureCache_getTextureForKey); + tolua_function(tolua_S,"getTextureFilePath",lua_cocos2dx_TextureCache_getTextureFilePath); tolua_function(tolua_S,"removeUnusedTextures",lua_cocos2dx_TextureCache_removeUnusedTextures); tolua_function(tolua_S,"removeTexture",lua_cocos2dx_TextureCache_removeTexture); tolua_function(tolua_S,"waitForQuit",lua_cocos2dx_TextureCache_waitForQuit); @@ -81098,7 +81200,7 @@ int lua_cocos2dx_AnimationCache_addAnimation(lua_State* tolua_S) cocos2d::Animation* arg0; std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Animation",&arg0, "cc.AnimationCache:addAnimation"); ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.AnimationCache:addAnimation"); if(!ok) @@ -81486,7 +81588,7 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(lua_State* tolu ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFileContent"); - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFileContent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent'", nullptr); @@ -81537,7 +81639,7 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFrame(lua_State* tolua_S) cocos2d::SpriteFrame* arg0; std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.SpriteFrameCache:addSpriteFrame"); ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.SpriteFrameCache:addSpriteFrame"); if(!ok) @@ -81615,7 +81717,7 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S) if (!ok) { break; } cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile"); if (!ok) { break; } cobj->addSpriteFramesWithFile(arg0, arg1); @@ -82055,7 +82157,7 @@ int lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture(lua_State* tolua { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrameCache:removeSpriteFramesFromTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture'", nullptr); @@ -82209,7 +82311,7 @@ int lua_cocos2dx_ParallaxNode_addChild(lua_State* tolua_S) cocos2d::Vec2 arg2; cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ParallaxNode:addChild"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ParallaxNode:addChild"); @@ -85397,11 +85499,11 @@ int lua_cocos2dx_TMXLayer_initWithTilesetInfo(lua_State* tolua_S) cocos2d::TMXLayerInfo* arg1; cocos2d::TMXMapInfo* arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "cc.TMXLayer:initWithTilesetInfo"); - ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1, "cc.TMXLayer:initWithTilesetInfo"); - ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2, "cc.TMXLayer:initWithTilesetInfo"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXLayer_initWithTilesetInfo'", nullptr); @@ -85759,7 +85861,7 @@ int lua_cocos2dx_TMXLayer_setTileSet(lua_State* tolua_S) { cocos2d::TMXTilesetInfo* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "cc.TMXLayer:setTileSet"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXLayer_setTileSet'", nullptr); @@ -85943,9 +86045,9 @@ int lua_cocos2dx_TMXLayer_create(lua_State* tolua_S) cocos2d::TMXTilesetInfo* arg0; cocos2d::TMXLayerInfo* arg1; cocos2d::TMXMapInfo* arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2); + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "cc.TMXLayer:create"); + ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1, "cc.TMXLayer:create"); + ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2, "cc.TMXLayer:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXLayer_create'", nullptr); @@ -87561,7 +87663,7 @@ int lua_cocos2dx_Component_setOwner(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Component:setOwner"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Component_setOwner'", nullptr); @@ -87837,7 +87939,7 @@ int lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpritePolygonCache:removeSpritePolygonCache"); - ok &= luaval_to_object(tolua_S, 3, "cc.Rect",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Rect",&arg1, "cc.SpritePolygonCache:removeSpritePolygonCache"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index ea1bdd252d..d3a5f7ae03 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1970,6 +1970,8 @@ int register_all_cocos2dx(lua_State* tolua_S); + + diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_cocosbuilder_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_cocosbuilder_auto.cpp index 4cd61b2291..c994d734dc 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_cocosbuilder_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_cocosbuilder_auto.cpp @@ -36,9 +36,9 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_moveAnimationsFromNode(lua_Sta cocos2d::Node* arg0; cocos2d::Node* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.CCBAnimationManager:moveAnimationsFromNode"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.CCBAnimationManager:moveAnimationsFromNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_moveAnimationsFromNode'", nullptr); @@ -185,7 +185,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_actionForSoundChannel(lua_Stat { cocosbuilder::CCBSequenceProperty* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequenceProperty",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequenceProperty",&arg0, "cc.CCBAnimationManager:actionForSoundChannel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_actionForSoundChannel'", nullptr); @@ -239,7 +239,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_setBaseValue(lua_State* tolua_ ok &= luaval_to_ccvalue(tolua_S, 2, &arg0, "cc.CCBAnimationManager:setBaseValue"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.CCBAnimationManager:setBaseValue"); ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.CCBAnimationManager:setBaseValue"); if(!ok) @@ -385,7 +385,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_setRootNode(lua_State* tolua_S { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.CCBAnimationManager:setRootNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_setRootNode'", nullptr); @@ -684,9 +684,9 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_setObject(lua_State* tolua_S) cocos2d::Node* arg1; std::string arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.CCBAnimationManager:setObject"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.CCBAnimationManager:setObject"); ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.CCBAnimationManager:setObject"); if(!ok) @@ -738,7 +738,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_getContainerSize(lua_State* to { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.CCBAnimationManager:getContainerSize"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_getContainerSize'", nullptr); @@ -788,7 +788,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_actionForCallbackChannel(lua_S { cocosbuilder::CCBSequenceProperty* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequenceProperty",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequenceProperty",&arg0, "cc.CCBAnimationManager:actionForCallbackChannel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_actionForCallbackChannel'", nullptr); @@ -1370,7 +1370,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_addDocumentOutletNode(lua_Stat { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.CCBAnimationManager:addDocumentOutletNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_addDocumentOutletNode'", nullptr); @@ -1470,7 +1470,7 @@ int lua_cocos2dx_cocosbuilder_CCBAnimationManager_addDocumentCallbackNode(lua_St { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.CCBAnimationManager:addDocumentCallbackNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBAnimationManager_addDocumentCallbackNode'", nullptr); @@ -2101,7 +2101,7 @@ int lua_cocos2dx_cocosbuilder_CCBReader_addOwnerOutletNode(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.CCBReader:addOwnerOutletNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBReader_addOwnerOutletNode'", nullptr); @@ -2198,7 +2198,7 @@ int lua_cocos2dx_cocosbuilder_CCBReader_readSoundKeyframesForSeq(lua_State* tolu { cocosbuilder::CCBSequence* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequence",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequence",&arg0, "cc.CCBReader:readSoundKeyframesForSeq"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBReader_readSoundKeyframesForSeq'", nullptr); @@ -2533,7 +2533,7 @@ int lua_cocos2dx_cocosbuilder_CCBReader_setAnimationManager(lua_State* tolua_S) { cocosbuilder::CCBAnimationManager* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CCBAnimationManager",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CCBAnimationManager",&arg0, "cc.CCBReader:setAnimationManager"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBReader_setAnimationManager'", nullptr); @@ -2583,7 +2583,7 @@ int lua_cocos2dx_cocosbuilder_CCBReader_readCallbackKeyframesForSeq(lua_State* t { cocosbuilder::CCBSequence* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequence",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CCBSequence",&arg0, "cc.CCBReader:readCallbackKeyframesForSeq"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_cocosbuilder_CCBReader_readCallbackKeyframesForSeq'", nullptr); @@ -2793,7 +2793,7 @@ int lua_cocos2dx_cocosbuilder_CCBReader_constructor(lua_State* tolua_S) do{ if (argc == 1) { cocosbuilder::CCBReader* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CCBReader",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CCBReader",&arg0, "cc.CCBReader:CCBReader"); if (!ok) { break; } cobj = new cocosbuilder::CCBReader(arg0); @@ -2808,7 +2808,7 @@ int lua_cocos2dx_cocosbuilder_CCBReader_constructor(lua_State* tolua_S) do{ if (argc == 1) { cocosbuilder::NodeLoaderLibrary* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0, "cc.CCBReader:CCBReader"); if (!ok) { break; } cobj = new cocosbuilder::CCBReader(arg0); @@ -2823,11 +2823,11 @@ int lua_cocos2dx_cocosbuilder_CCBReader_constructor(lua_State* tolua_S) do{ if (argc == 2) { cocosbuilder::NodeLoaderLibrary* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0, "cc.CCBReader:CCBReader"); if (!ok) { break; } cocosbuilder::CCBMemberVariableAssigner* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.CCBMemberVariableAssigner",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.CCBMemberVariableAssigner",&arg1, "cc.CCBReader:CCBReader"); if (!ok) { break; } cobj = new cocosbuilder::CCBReader(arg0, arg1); @@ -2842,15 +2842,15 @@ int lua_cocos2dx_cocosbuilder_CCBReader_constructor(lua_State* tolua_S) do{ if (argc == 3) { cocosbuilder::NodeLoaderLibrary* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0, "cc.CCBReader:CCBReader"); if (!ok) { break; } cocosbuilder::CCBMemberVariableAssigner* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.CCBMemberVariableAssigner",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.CCBMemberVariableAssigner",&arg1, "cc.CCBReader:CCBReader"); if (!ok) { break; } cocosbuilder::CCBSelectorResolver* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.CCBSelectorResolver",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.CCBSelectorResolver",&arg2, "cc.CCBReader:CCBReader"); if (!ok) { break; } cobj = new cocosbuilder::CCBReader(arg0, arg1, arg2); @@ -2865,19 +2865,19 @@ int lua_cocos2dx_cocosbuilder_CCBReader_constructor(lua_State* tolua_S) do{ if (argc == 4) { cocosbuilder::NodeLoaderLibrary* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.NodeLoaderLibrary",&arg0, "cc.CCBReader:CCBReader"); if (!ok) { break; } cocosbuilder::CCBMemberVariableAssigner* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.CCBMemberVariableAssigner",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.CCBMemberVariableAssigner",&arg1, "cc.CCBReader:CCBReader"); if (!ok) { break; } cocosbuilder::CCBSelectorResolver* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.CCBSelectorResolver",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.CCBSelectorResolver",&arg2, "cc.CCBReader:CCBReader"); if (!ok) { break; } cocosbuilder::NodeLoaderListener* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.NodeLoaderListener",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.NodeLoaderListener",&arg3, "cc.CCBReader:CCBReader"); if (!ok) { break; } cobj = new cocosbuilder::CCBReader(arg0, arg1, arg2, arg3); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp index 62dcaeed5b..bd5aae3bf9 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp @@ -734,7 +734,7 @@ int lua_cocos2dx_controller_EventController_constructor(lua_State* tolua_S) if (!ok) { break; } cocos2d::Controller* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Controller",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Controller",&arg1, "cc.EventController:EventController"); if (!ok) { break; } bool arg2; @@ -757,7 +757,7 @@ int lua_cocos2dx_controller_EventController_constructor(lua_State* tolua_S) if (!ok) { break; } cocos2d::Controller* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Controller",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Controller",&arg1, "cc.EventController:EventController"); if (!ok) { break; } int arg2; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_csloader_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_csloader_auto.cpp index 19aeb63aad..8fbb5b5a57 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_csloader_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_csloader_auto.cpp @@ -192,9 +192,9 @@ int lua_cocos2dx_csloader_CSLoader_bindCallback(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.CSLoader:bindCallback"); - ok &= luaval_to_object(tolua_S, 4, "ccui.Widget",&arg2); + ok &= luaval_to_object(tolua_S, 4, "ccui.Widget",&arg2, "cc.CSLoader:bindCallback"); - ok &= luaval_to_object(tolua_S, 5, "cc.Node",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Node",&arg3, "cc.CSLoader:bindCallback"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_csloader_CSLoader_bindCallback'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp index c374abfaec..0a80669d0e 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp @@ -527,7 +527,7 @@ int lua_cocos2dx_experimental_TMXLayer_setupTileSprite(lua_State* tolua_S) cocos2d::Vec2 arg1; int arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "ccexp.TMXLayer:setupTileSprite"); ok &= luaval_to_vec2(tolua_S, 3, &arg1, "ccexp.TMXLayer:setupTileSprite"); @@ -842,7 +842,7 @@ int lua_cocos2dx_experimental_TMXLayer_setTileSet(lua_State* tolua_S) { cocos2d::TMXTilesetInfo* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "ccexp.TMXLayer:setTileSet"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_TMXLayer_setTileSet'", nullptr); @@ -979,9 +979,9 @@ int lua_cocos2dx_experimental_TMXLayer_create(lua_State* tolua_S) cocos2d::TMXTilesetInfo* arg0; cocos2d::TMXLayerInfo* arg1; cocos2d::TMXMapInfo* arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2); + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "ccexp.TMXLayer:create"); + ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1, "ccexp.TMXLayer:create"); + ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2, "ccexp.TMXLayer:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_TMXLayer_create'", nullptr); @@ -1894,7 +1894,7 @@ int lua_cocos2dx_experimental_SpritePolygon_setTexture(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "ccexp.SpritePolygon:setTexture"); if (!ok) { break; } cobj->setTexture(arg0); @@ -1955,7 +1955,7 @@ int lua_cocos2dx_experimental_SpritePolygon_initWithTexture(lua_State* tolua_S) { cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "ccexp.SpritePolygon:initWithTexture"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_SpritePolygon_initWithTexture'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp index 2f09abc130..4be0cfc60c 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp @@ -420,7 +420,7 @@ int lua_cocos2dx_extension_Control_isTouchInside(lua_State* tolua_S) { cocos2d::Touch* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0, "cc.Control:isTouchInside"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Control_isTouchInside'", nullptr); @@ -520,7 +520,7 @@ int lua_cocos2dx_extension_Control_getTouchLocation(lua_State* tolua_S) { cocos2d::Touch* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0, "cc.Control:getTouchLocation"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Control_getTouchLocation'", nullptr); @@ -769,7 +769,7 @@ int lua_cocos2dx_extension_ControlButton_setTitleLabelForState(lua_State* tolua_ cocos2d::Node* arg0; cocos2d::extension::Control::State arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlButton:setTitleLabelForState"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ControlButton:setTitleLabelForState"); if(!ok) @@ -1021,7 +1021,7 @@ int lua_cocos2dx_extension_ControlButton_initWithBackgroundSprite(lua_State* tol { cocos2d::ui::Scale9Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0, "cc.ControlButton:initWithBackgroundSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlButton_initWithBackgroundSprite'", nullptr); @@ -1227,7 +1227,7 @@ int lua_cocos2dx_extension_ControlButton_setTitleLabel(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlButton:setTitleLabel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlButton_setTitleLabel'", nullptr); @@ -1424,7 +1424,7 @@ int lua_cocos2dx_extension_ControlButton_setBackgroundSprite(lua_State* tolua_S) { cocos2d::ui::Scale9Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0, "cc.ControlButton:setBackgroundSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSprite'", nullptr); @@ -1975,7 +1975,7 @@ int lua_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState(lua_St cocos2d::SpriteFrame* arg0; cocos2d::extension::Control::State arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.ControlButton:setBackgroundSpriteFrameForState"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ControlButton:setBackgroundSpriteFrameForState"); if(!ok) @@ -2028,7 +2028,7 @@ int lua_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(lua_State* cocos2d::ui::Scale9Sprite* arg0; cocos2d::extension::Control::State arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0, "cc.ControlButton:setBackgroundSpriteForState"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ControlButton:setBackgroundSpriteForState"); if(!ok) @@ -2472,9 +2472,9 @@ int lua_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite(lua_St cocos2d::Node* arg0; cocos2d::ui::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlButton:initWithLabelAndBackgroundSprite"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1, "cc.ControlButton:initWithLabelAndBackgroundSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite'", nullptr); @@ -2610,7 +2610,7 @@ int lua_cocos2dx_extension_ControlButton_create(lua_State* tolua_S) if (argc == 1) { cocos2d::ui::Scale9Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0, "cc.ControlButton:create"); if (!ok) { break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0); object_to_luaval(tolua_S, "cc.ControlButton",(cocos2d::extension::ControlButton*)ret); @@ -2633,10 +2633,10 @@ int lua_cocos2dx_extension_ControlButton_create(lua_State* tolua_S) if (argc == 2) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlButton:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1, "cc.ControlButton:create"); if (!ok) { break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1); object_to_luaval(tolua_S, "cc.ControlButton",(cocos2d::extension::ControlButton*)ret); @@ -2798,7 +2798,7 @@ int lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(lua_State* tolu cocos2d::Node* arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlHuePicker:initWithTargetAndPos"); ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.ControlHuePicker:initWithTargetAndPos"); if(!ok) @@ -3041,7 +3041,7 @@ int lua_cocos2dx_extension_ControlHuePicker_setBackground(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlHuePicker:setBackground"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlHuePicker_setBackground'", nullptr); @@ -3235,7 +3235,7 @@ int lua_cocos2dx_extension_ControlHuePicker_setSlider(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlHuePicker:setSlider"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlHuePicker_setSlider'", nullptr); @@ -3274,7 +3274,7 @@ int lua_cocos2dx_extension_ControlHuePicker_create(lua_State* tolua_S) { cocos2d::Node* arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlHuePicker:create"); ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.ControlHuePicker:create"); if(!ok) { @@ -3439,7 +3439,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPo cocos2d::Node* arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlSaturationBrightnessPicker:initWithTargetAndPos"); ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.ControlSaturationBrightnessPicker:initWithTargetAndPos"); if(!ok) @@ -3762,7 +3762,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create(lua_State* t { cocos2d::Node* arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ControlSaturationBrightnessPicker:create"); ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.ControlSaturationBrightnessPicker:create"); if(!ok) { @@ -3878,7 +3878,7 @@ int lua_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged(lua_State* cocos2d::Ref* arg0; cocos2d::extension::Control::EventType arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.ControlColourPicker:hueSliderValueChanged"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ControlColourPicker:hueSliderValueChanged"); if(!ok) @@ -4024,7 +4024,7 @@ int lua_cocos2dx_extension_ControlColourPicker_setBackground(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlColourPicker:setBackground"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlColourPicker_setBackground'", nullptr); @@ -4074,7 +4074,7 @@ int lua_cocos2dx_extension_ControlColourPicker_setcolourPicker(lua_State* tolua_ { cocos2d::extension::ControlSaturationBrightnessPicker* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ControlSaturationBrightnessPicker",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ControlSaturationBrightnessPicker",&arg0, "cc.ControlColourPicker:setcolourPicker"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlColourPicker_setcolourPicker'", nullptr); @@ -4125,7 +4125,7 @@ int lua_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged(lua_Stat cocos2d::Ref* arg0; cocos2d::extension::Control::EventType arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.ControlColourPicker:colourSliderValueChanged"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ControlColourPicker:colourSliderValueChanged"); if(!ok) @@ -4177,7 +4177,7 @@ int lua_cocos2dx_extension_ControlColourPicker_setHuePicker(lua_State* tolua_S) { cocos2d::extension::ControlHuePicker* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ControlHuePicker",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ControlHuePicker",&arg0, "cc.ControlColourPicker:setHuePicker"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlColourPicker_setHuePicker'", nullptr); @@ -4774,7 +4774,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_setThumbSprite(lua_State* tolua_ { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlPotentiometer:setThumbSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlPotentiometer_setThumbSprite'", nullptr); @@ -5021,7 +5021,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_setProgressTimer(lua_State* tolu { cocos2d::ProgressTimer* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ProgressTimer",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ProgressTimer",&arg0, "cc.ControlPotentiometer:setProgressTimer"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlPotentiometer_setProgressTimer'", nullptr); @@ -5170,11 +5170,11 @@ int lua_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTime cocos2d::ProgressTimer* arg1; cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlPotentiometer:initWithTrackSprite_ProgressTimer_ThumbSprite"); - ok &= luaval_to_object(tolua_S, 3, "cc.ProgressTimer",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.ProgressTimer",&arg1, "cc.ControlPotentiometer:initWithTrackSprite_ProgressTimer_ThumbSprite"); - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlPotentiometer:initWithTrackSprite_ProgressTimer_ThumbSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite'", nullptr); @@ -5390,7 +5390,7 @@ int lua_cocos2dx_extension_ControlSlider_setBackgroundSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:setBackgroundSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlSlider_setBackgroundSprite'", nullptr); @@ -5481,19 +5481,19 @@ int lua_cocos2dx_extension_ControlSlider_initWithSprites(lua_State* tolua_S) do{ if (argc == 4) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } cocos2d::Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } bool ret = cobj->initWithSprites(arg0, arg1, arg2, arg3); @@ -5505,15 +5505,15 @@ int lua_cocos2dx_extension_ControlSlider_initWithSprites(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSlider:initWithSprites"); if (!ok) { break; } bool ret = cobj->initWithSprites(arg0, arg1, arg2); @@ -5703,7 +5703,7 @@ int lua_cocos2dx_extension_ControlSlider_setProgressSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:setProgressSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlSlider_setProgressSprite'", nullptr); @@ -5850,7 +5850,7 @@ int lua_cocos2dx_extension_ControlSlider_setThumbSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:setThumbSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlSlider_setThumbSprite'", nullptr); @@ -6091,7 +6091,7 @@ int lua_cocos2dx_extension_ControlSlider_locationFromTouch(lua_State* tolua_S) { cocos2d::Touch* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0, "cc.ControlSlider:locationFromTouch"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlSlider_locationFromTouch'", nullptr); @@ -6288,7 +6288,7 @@ int lua_cocos2dx_extension_ControlSlider_setSelectedThumbSprite(lua_State* tolua { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:setSelectedThumbSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlSlider_setSelectedThumbSprite'", nullptr); @@ -6377,13 +6377,13 @@ int lua_cocos2dx_extension_ControlSlider_create(lua_State* tolua_S) if (argc == 3) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2); object_to_luaval(tolua_S, "cc.ControlSlider",(cocos2d::extension::ControlSlider*)ret); @@ -6437,16 +6437,16 @@ int lua_cocos2dx_extension_ControlSlider_create(lua_State* tolua_S) if (argc == 4) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3, "cc.ControlSlider:create"); if (!ok) { break; } cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3); object_to_luaval(tolua_S, "cc.ControlSlider",(cocos2d::extension::ControlSlider*)ret); @@ -6718,9 +6718,9 @@ int lua_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite(lua_S cocos2d::Sprite* arg0; cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlStepper:initWithMinusSpriteAndPlusSprite"); - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlStepper:initWithMinusSpriteAndPlusSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite'", nullptr); @@ -7017,7 +7017,7 @@ int lua_cocos2dx_extension_ControlStepper_setMinusLabel(lua_State* tolua_S) { cocos2d::Label* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Label",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Label",&arg0, "cc.ControlStepper:setMinusLabel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlStepper_setMinusLabel'", nullptr); @@ -7308,7 +7308,7 @@ int lua_cocos2dx_extension_ControlStepper_setPlusLabel(lua_State* tolua_S) { cocos2d::Label* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Label",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Label",&arg0, "cc.ControlStepper:setPlusLabel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlStepper_setPlusLabel'", nullptr); @@ -7452,7 +7452,7 @@ int lua_cocos2dx_extension_ControlStepper_setPlusSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlStepper:setPlusSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlStepper_setPlusSprite'", nullptr); @@ -7502,7 +7502,7 @@ int lua_cocos2dx_extension_ControlStepper_setMinusSprite(lua_State* tolua_S) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlStepper:setMinusSprite"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlStepper_setMinusSprite'", nullptr); @@ -7541,8 +7541,8 @@ int lua_cocos2dx_extension_ControlStepper_create(lua_State* tolua_S) { cocos2d::Sprite* arg0; cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlStepper:create"); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlStepper:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlStepper_create'", nullptr); @@ -7727,7 +7727,7 @@ int lua_cocos2dx_extension_ControlSwitch_locationFromTouch(lua_State* tolua_S) { cocos2d::Touch* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0, "cc.ControlSwitch:locationFromTouch"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ControlSwitch_locationFromTouch'", nullptr); @@ -7818,27 +7818,27 @@ int lua_cocos2dx_extension_ControlSwitch_initWithMaskSprite(lua_State* tolua_S) do{ if (argc == 6) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Label* arg4; - ok &= luaval_to_object(tolua_S, 6, "cc.Label",&arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Label",&arg4, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Label* arg5; - ok &= luaval_to_object(tolua_S, 7, "cc.Label",&arg5); + ok &= luaval_to_object(tolua_S, 7, "cc.Label",&arg5, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } bool ret = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3, arg4, arg5); @@ -7850,19 +7850,19 @@ int lua_cocos2dx_extension_ControlSwitch_initWithMaskSprite(lua_State* tolua_S) do{ if (argc == 4) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } cocos2d::Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3, "cc.ControlSwitch:initWithMaskSprite"); if (!ok) { break; } bool ret = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3); @@ -7947,16 +7947,16 @@ int lua_cocos2dx_extension_ControlSwitch_create(lua_State* tolua_S) if (argc == 4) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3); object_to_luaval(tolua_S, "cc.ControlSwitch",(cocos2d::extension::ControlSwitch*)ret); @@ -7969,22 +7969,22 @@ int lua_cocos2dx_extension_ControlSwitch_create(lua_State* tolua_S) if (argc == 6) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Sprite",&arg1, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Sprite",&arg2, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Sprite",&arg3, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Label* arg4; - ok &= luaval_to_object(tolua_S, 6, "cc.Label",&arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Label",&arg4, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::Label* arg5; - ok &= luaval_to_object(tolua_S, 7, "cc.Label",&arg5); + ok &= luaval_to_object(tolua_S, 7, "cc.Label",&arg5, "cc.ControlSwitch:create"); if (!ok) { break; } cocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3, arg4, arg5); object_to_luaval(tolua_S, "cc.ControlSwitch",(cocos2d::extension::ControlSwitch*)ret); @@ -8140,7 +8140,7 @@ int lua_cocos2dx_extension_ScrollView_setContainer(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ScrollView:setContainer"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ScrollView_setContainer'", nullptr); @@ -8701,7 +8701,7 @@ int lua_cocos2dx_extension_ScrollView_initWithViewSize(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.ScrollView:initWithViewSize"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.ScrollView:initWithViewSize"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ScrollView_initWithViewSize'", nullptr); @@ -8751,7 +8751,7 @@ int lua_cocos2dx_extension_ScrollView_pause(lua_State* tolua_S) { cocos2d::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.ScrollView:pause"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ScrollView_pause'", nullptr); @@ -9206,7 +9206,7 @@ int lua_cocos2dx_extension_ScrollView_resume(lua_State* tolua_S) { cocos2d::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "cc.ScrollView:resume"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ScrollView_resume'", nullptr); @@ -9497,7 +9497,7 @@ int lua_cocos2dx_extension_ScrollView_isNodeVisible(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.ScrollView:isNodeVisible"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ScrollView_isNodeVisible'", nullptr); @@ -9668,7 +9668,7 @@ int lua_cocos2dx_extension_ScrollView_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.ScrollView:create"); if (!ok) { break; } cocos2d::Node* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.ScrollView:create"); if (!ok) { break; } cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0, arg1); object_to_luaval(tolua_S, "cc.ScrollView",(cocos2d::extension::ScrollView*)ret); @@ -10142,7 +10142,7 @@ int lua_cocos2dx_extension_TableView_scrollViewDidZoom(lua_State* tolua_S) { cocos2d::extension::ScrollView* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ScrollView",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ScrollView",&arg0, "cc.TableView:scrollViewDidZoom"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_TableView_scrollViewDidZoom'", nullptr); @@ -10353,7 +10353,7 @@ int lua_cocos2dx_extension_TableView_initWithViewSize(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.TableView:initWithViewSize"); - ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Node",&arg1, "cc.TableView:initWithViewSize"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_TableView_initWithViewSize'", nullptr); @@ -10403,7 +10403,7 @@ int lua_cocos2dx_extension_TableView_scrollViewDidScroll(lua_State* tolua_S) { cocos2d::extension::ScrollView* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.ScrollView",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.ScrollView",&arg0, "cc.TableView:scrollViewDidScroll"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_TableView_scrollViewDidScroll'", nullptr); @@ -11847,7 +11847,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); if(!ok) @@ -11871,7 +11871,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); @@ -11898,7 +11898,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); @@ -11928,7 +11928,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); @@ -11961,7 +11961,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); @@ -11997,7 +11997,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); @@ -12036,7 +12036,7 @@ int lua_cocos2dx_extension_EventAssetsManagerEx_constructor(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); - ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.AssetsManagerEx",&arg1, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.EventAssetsManagerEx:EventAssetsManagerEx"); @@ -12925,7 +12925,7 @@ int lua_cocos2dx_extension_EventListenerAssetsManagerEx_init(lua_State* tolua_S) const cocos2d::extension::AssetsManagerEx* arg0; std::function arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.AssetsManagerEx",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.AssetsManagerEx",&arg0, "cc.EventListenerAssetsManagerEx:init"); do { // Lambda binding for lua is not supported. @@ -13183,7 +13183,7 @@ int lua_cocos2dx_extension_ParticleSystem3D_addAffector(lua_State* tolua_S) { cocos2d::Particle3DAffector* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Particle3DAffector",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Particle3DAffector",&arg0, "cc.ParticleSystem3D:addAffector"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ParticleSystem3D_addAffector'", nullptr); @@ -13327,7 +13327,7 @@ int lua_cocos2dx_extension_ParticleSystem3D_setEmitter(lua_State* tolua_S) { cocos2d::Particle3DEmitter* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Particle3DEmitter",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Particle3DEmitter",&arg0, "cc.ParticleSystem3D:setEmitter"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ParticleSystem3D_setEmitter'", nullptr); @@ -13809,7 +13809,7 @@ int lua_cocos2dx_extension_ParticleSystem3D_setRender(lua_State* tolua_S) { cocos2d::Particle3DRender* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Particle3DRender",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Particle3DRender",&arg0, "cc.ParticleSystem3D:setRender"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_ParticleSystem3D_setRender'", nullptr); @@ -14706,7 +14706,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_forceEmission(lua_State* tolua_S) cocos2d::PUEmitter* arg0; unsigned int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PUEmitter",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUEmitter",&arg0, "cc.PUParticleSystem3D:forceEmission"); ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.PUParticleSystem3D:forceEmission"); if(!ok) @@ -14758,7 +14758,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_addListener(lua_State* tolua_S) { cocos2d::PUListener* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PUListener",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUListener",&arg0, "cc.PUParticleSystem3D:addListener"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_addListener'", nullptr); @@ -15049,7 +15049,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_addEmitter(lua_State* tolua_S) { cocos2d::PUEmitter* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PUEmitter",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUEmitter",&arg0, "cc.PUParticleSystem3D:addEmitter"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_addEmitter'", nullptr); @@ -15099,7 +15099,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_addBehaviourTemplate(lua_State* to { cocos2d::PUBehaviour* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PUBehaviour",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUBehaviour",&arg0, "cc.PUParticleSystem3D:addBehaviourTemplate"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_addBehaviourTemplate'", nullptr); @@ -15199,7 +15199,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_copyAttributesTo(lua_State* tolua_ { cocos2d::PUParticleSystem3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PUParticleSystem3D",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUParticleSystem3D",&arg0, "cc.PUParticleSystem3D:copyAttributesTo"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_copyAttributesTo'", nullptr); @@ -15346,7 +15346,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_removeListener(lua_State* tolua_S) { cocos2d::PUListener* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PUListener",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUListener",&arg0, "cc.PUParticleSystem3D:removeListener"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_removeListener'", nullptr); @@ -15979,7 +15979,7 @@ int lua_cocos2dx_extension_PUParticleSystem3D_addObserver(lua_State* tolua_S) { cocos2d::PUObserver* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PUObserver",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PUObserver",&arg0, "cc.PUParticleSystem3D:addObserver"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_addObserver'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp index a388260869..3b2124eb3e 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp @@ -3090,7 +3090,7 @@ int lua_cocos2dx_physics_PhysicsBody_addShape(lua_State* tolua_S) { cocos2d::PhysicsShape* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.PhysicsBody:addShape"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_PhysicsBody_addShape'", nullptr); @@ -3105,7 +3105,7 @@ int lua_cocos2dx_physics_PhysicsBody_addShape(lua_State* tolua_S) cocos2d::PhysicsShape* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.PhysicsBody:addShape"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.PhysicsBody:addShape"); if(!ok) @@ -4548,7 +4548,7 @@ int lua_cocos2dx_physics_PhysicsBody_removeShape(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::PhysicsShape* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.PhysicsBody:removeShape"); if (!ok) { break; } cobj->removeShape(arg0); @@ -4560,7 +4560,7 @@ int lua_cocos2dx_physics_PhysicsBody_removeShape(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::PhysicsShape* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.PhysicsBody:removeShape"); if (!ok) { break; } bool arg1; @@ -6877,9 +6877,9 @@ int lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_hitTest(lua_State cocos2d::PhysicsShape* arg0; cocos2d::PhysicsShape* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.EventListenerPhysicsContactWithBodies:hitTest"); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1, "cc.EventListenerPhysicsContactWithBodies:hitTest"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_hitTest'", nullptr); @@ -6918,8 +6918,8 @@ int lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_create(lua_State* { cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.EventListenerPhysicsContactWithBodies:create"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.EventListenerPhysicsContactWithBodies:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_create'", nullptr); @@ -6989,9 +6989,9 @@ int lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_hitTest(lua_State cocos2d::PhysicsShape* arg0; cocos2d::PhysicsShape* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.EventListenerPhysicsContactWithShapes:hitTest"); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1, "cc.EventListenerPhysicsContactWithShapes:hitTest"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_hitTest'", nullptr); @@ -7030,8 +7030,8 @@ int lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_create(lua_State* { cocos2d::PhysicsShape* arg0; cocos2d::PhysicsShape* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.EventListenerPhysicsContactWithShapes:create"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1, "cc.EventListenerPhysicsContactWithShapes:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_create'", nullptr); @@ -7101,9 +7101,9 @@ int lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_hitTest(lua_State* cocos2d::PhysicsShape* arg0; cocos2d::PhysicsShape* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsShape",&arg0, "cc.EventListenerPhysicsContactWithGroup:hitTest"); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsShape",&arg1, "cc.EventListenerPhysicsContactWithGroup:hitTest"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_hitTest'", nullptr); @@ -7854,8 +7854,8 @@ int lua_cocos2dx_physics_PhysicsJointFixed_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; cocos2d::Vec2 arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointFixed:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointFixed:construct"); ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointFixed:construct"); if(!ok) { @@ -8349,10 +8349,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) if (argc == 6) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointLimit:construct"); if (!ok) { break; } cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointLimit:construct"); if (!ok) { break; } cocos2d::Vec2 arg2; ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointLimit:construct"); @@ -8377,10 +8377,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) if (argc == 4) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointLimit:construct"); if (!ok) { break; } cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointLimit:construct"); if (!ok) { break; } cocos2d::Vec2 arg2; ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointLimit:construct"); @@ -8497,10 +8497,10 @@ int lua_cocos2dx_physics_PhysicsJointPin_construct(lua_State* tolua_S) if (argc == 4) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointPin:construct"); if (!ok) { break; } cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointPin:construct"); if (!ok) { break; } cocos2d::Vec2 arg2; ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointPin:construct"); @@ -8519,10 +8519,10 @@ int lua_cocos2dx_physics_PhysicsJointPin_construct(lua_State* tolua_S) if (argc == 3) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointPin:construct"); if (!ok) { break; } cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointPin:construct"); if (!ok) { break; } cocos2d::Vec2 arg2; ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointPin:construct"); @@ -8727,8 +8727,8 @@ int lua_cocos2dx_physics_PhysicsJointDistance_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg1; cocos2d::Vec2 arg2; cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointDistance:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointDistance:construct"); ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointDistance:construct"); ok &= luaval_to_vec2(tolua_S, 5, &arg3, "cc.PhysicsJointDistance:construct"); if(!ok) @@ -9326,8 +9326,8 @@ int lua_cocos2dx_physics_PhysicsJointSpring_construct(lua_State* tolua_S) cocos2d::Vec2 arg3; double arg4; double arg5; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointSpring:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointSpring:construct"); ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointSpring:construct"); ok &= luaval_to_vec2(tolua_S, 5, &arg3, "cc.PhysicsJointSpring:construct"); ok &= luaval_to_number(tolua_S, 6,&arg4, "cc.PhysicsJointSpring:construct"); @@ -9740,8 +9740,8 @@ int lua_cocos2dx_physics_PhysicsJointGroove_construct(lua_State* tolua_S) cocos2d::Vec2 arg2; cocos2d::Vec2 arg3; cocos2d::Vec2 arg4; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointGroove:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointGroove:construct"); ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsJointGroove:construct"); ok &= luaval_to_vec2(tolua_S, 5, &arg3, "cc.PhysicsJointGroove:construct"); ok &= luaval_to_vec2(tolua_S, 6, &arg4, "cc.PhysicsJointGroove:construct"); @@ -10148,8 +10148,8 @@ int lua_cocos2dx_physics_PhysicsJointRotarySpring_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg1; double arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointRotarySpring:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointRotarySpring:construct"); ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.PhysicsJointRotarySpring:construct"); ok &= luaval_to_number(tolua_S, 5,&arg3, "cc.PhysicsJointRotarySpring:construct"); if(!ok) @@ -10456,10 +10456,10 @@ int lua_cocos2dx_physics_PhysicsJointRotaryLimit_construct(lua_State* tolua_S) if (argc == 2) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointRotaryLimit:construct"); if (!ok) { break; } cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointRotaryLimit:construct"); if (!ok) { break; } cocos2d::PhysicsJointRotaryLimit* ret = cocos2d::PhysicsJointRotaryLimit::construct(arg0, arg1); object_to_luaval(tolua_S, "cc.PhysicsJointRotaryLimit",(cocos2d::PhysicsJointRotaryLimit*)ret); @@ -10472,10 +10472,10 @@ int lua_cocos2dx_physics_PhysicsJointRotaryLimit_construct(lua_State* tolua_S) if (argc == 4) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointRotaryLimit:construct"); if (!ok) { break; } cocos2d::PhysicsBody* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointRotaryLimit:construct"); if (!ok) { break; } double arg2; ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.PhysicsJointRotaryLimit:construct"); @@ -10881,8 +10881,8 @@ int lua_cocos2dx_physics_PhysicsJointRatchet_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg1; double arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointRatchet:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointRatchet:construct"); ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.PhysicsJointRatchet:construct"); ok &= luaval_to_number(tolua_S, 5,&arg3, "cc.PhysicsJointRatchet:construct"); if(!ok) @@ -11191,8 +11191,8 @@ int lua_cocos2dx_physics_PhysicsJointGear_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg1; double arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointGear:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointGear:construct"); ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.PhysicsJointGear:construct"); ok &= luaval_to_number(tolua_S, 5,&arg3, "cc.PhysicsJointGear:construct"); if(!ok) @@ -11401,8 +11401,8 @@ int lua_cocos2dx_physics_PhysicsJointMotor_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; double arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsJointMotor:construct"); + ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1, "cc.PhysicsJointMotor:construct"); ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.PhysicsJointMotor:construct"); if(!ok) { @@ -11718,7 +11718,7 @@ int lua_cocos2dx_physics_PhysicsWorld_addJoint(lua_State* tolua_S) { cocos2d::PhysicsJoint* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0, "cc.PhysicsWorld:addJoint"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'", nullptr); @@ -11882,7 +11882,7 @@ int lua_cocos2dx_physics_PhysicsWorld_removeBody(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.PhysicsWorld:removeBody"); if (!ok) { break; } cobj->removeBody(arg0); @@ -11931,7 +11931,7 @@ int lua_cocos2dx_physics_PhysicsWorld_removeJoint(lua_State* tolua_S) { cocos2d::PhysicsJoint* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0, "cc.PhysicsWorld:removeJoint"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics_PhysicsWorld_removeJoint'", nullptr); @@ -11946,7 +11946,7 @@ int lua_cocos2dx_physics_PhysicsWorld_removeJoint(lua_State* tolua_S) cocos2d::PhysicsJoint* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsJoint",&arg0, "cc.PhysicsWorld:removeJoint"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.PhysicsWorld:removeJoint"); if(!ok) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp index 1d2d200521..f0247e3ffd 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp @@ -34,7 +34,7 @@ int lua_cocos2dx_studio_ActionFrame_getAction(lua_State* tolua_S) if (!ok) { break; } cocostudio::ActionFrame* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccs.ActionFrame",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.ActionFrame",&arg1, "ccs.ActionFrame:getAction"); if (!ok) { break; } cocos2d::ActionInterval* ret = cobj->getAction(arg0, arg1); @@ -1161,7 +1161,7 @@ int lua_cocos2dx_studio_ActionRotationFrame_getAction(lua_State* tolua_S) if (!ok) { break; } cocostudio::ActionFrame* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccs.ActionFrame",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.ActionFrame",&arg1, "ccs.ActionRotationFrame:getAction"); if (!ok) { break; } cocos2d::ActionInterval* ret = cobj->getAction(arg0, arg1); @@ -2075,7 +2075,7 @@ int lua_cocos2dx_studio_ActionObject_play(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::CallFunc* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.CallFunc",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.CallFunc",&arg0, "ccs.ActionObject:play"); if (!ok) { break; } cobj->play(arg0); @@ -2179,7 +2179,7 @@ int lua_cocos2dx_studio_ActionObject_removeActionNode(lua_State* tolua_S) { cocostudio::ActionNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ActionNode",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ActionNode",&arg0, "ccs.ActionObject:removeActionNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionObject_removeActionNode'", nullptr); @@ -2276,7 +2276,7 @@ int lua_cocos2dx_studio_ActionObject_addActionNode(lua_State* tolua_S) { cocostudio::ActionNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ActionNode",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ActionNode",&arg0, "ccs.ActionObject:addActionNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionObject_addActionNode'", nullptr); @@ -2752,7 +2752,7 @@ int lua_cocos2dx_studio_ActionManagerEx_playActionByName(lua_State* tolua_S) if (!ok) { break; } cocos2d::CallFunc* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.CallFunc",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.CallFunc",&arg2, "ccs.ActionManagerEx:playActionByName"); if (!ok) { break; } cocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1, arg2); @@ -3148,7 +3148,7 @@ int lua_cocos2dx_studio_DisplayData_copy(lua_State* tolua_S) { cocostudio::DisplayData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0, "ccs.DisplayData:copy"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_DisplayData_copy'", nullptr); @@ -3328,7 +3328,7 @@ int lua_cocos2dx_studio_SpriteDisplayData_copy(lua_State* tolua_S) { cocostudio::DisplayData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0, "ccs.SpriteDisplayData:copy"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_SpriteDisplayData_copy'", nullptr); @@ -3752,7 +3752,7 @@ int lua_cocos2dx_studio_BoneData_addDisplayData(lua_State* tolua_S) { cocostudio::DisplayData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0, "ccs.BoneData:addDisplayData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_BoneData_addDisplayData'", nullptr); @@ -3897,7 +3897,7 @@ int lua_cocos2dx_studio_ArmatureData_addBoneData(lua_State* tolua_S) { cocostudio::BoneData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.BoneData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.BoneData",&arg0, "ccs.ArmatureData:addBoneData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureData_addBoneData'", nullptr); @@ -4139,7 +4139,7 @@ int lua_cocos2dx_studio_FrameData_copy(lua_State* tolua_S) { const cocostudio::BaseData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.BaseData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.BaseData",&arg0, "ccs.FrameData:copy"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_FrameData_copy'", nullptr); @@ -4379,7 +4379,7 @@ int lua_cocos2dx_studio_MovementBoneData_addFrameData(lua_State* tolua_S) { cocostudio::FrameData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.FrameData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.FrameData",&arg0, "ccs.MovementBoneData:addFrameData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_MovementBoneData_addFrameData'", nullptr); @@ -4574,7 +4574,7 @@ int lua_cocos2dx_studio_MovementData_addMovementBoneData(lua_State* tolua_S) { cocostudio::MovementBoneData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.MovementBoneData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.MovementBoneData",&arg0, "ccs.MovementData:addMovementBoneData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_MovementData_addMovementBoneData'", nullptr); @@ -4815,7 +4815,7 @@ int lua_cocos2dx_studio_AnimationData_addMovement(lua_State* tolua_S) { cocostudio::MovementData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.MovementData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.MovementData",&arg0, "ccs.AnimationData:addMovement"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_AnimationData_addMovement'", nullptr); @@ -5248,7 +5248,7 @@ int lua_cocos2dx_studio_TextureData_addContourData(lua_State* tolua_S) { cocostudio::ContourData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ContourData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ContourData",&arg0, "ccs.TextureData:addContourData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_TextureData_addContourData'", nullptr); @@ -5494,7 +5494,7 @@ int lua_cocos2dx_studio_Tween_play(lua_State* tolua_S) int arg3; int arg4; - ok &= luaval_to_object(tolua_S, 2, "ccs.MovementBoneData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.MovementBoneData",&arg0, "ccs.Tween:play"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccs.Tween:play"); @@ -5602,7 +5602,7 @@ int lua_cocos2dx_studio_Tween_init(lua_State* tolua_S) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Tween:init"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Tween_init'", nullptr); @@ -5652,7 +5652,7 @@ int lua_cocos2dx_studio_Tween_setAnimation(lua_State* tolua_S) { cocostudio::ArmatureAnimation* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ArmatureAnimation",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ArmatureAnimation",&arg0, "ccs.Tween:setAnimation"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Tween_setAnimation'", nullptr); @@ -5690,7 +5690,7 @@ int lua_cocos2dx_studio_Tween_create(lua_State* tolua_S) if (argc == 1) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Tween:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Tween_create'", nullptr); @@ -6043,7 +6043,7 @@ int lua_cocos2dx_studio_DisplayManager_init(lua_State* tolua_S) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.DisplayManager:init"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_DisplayManager_init'", nullptr); @@ -6181,7 +6181,7 @@ int lua_cocos2dx_studio_DisplayManager_addDisplay(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.DisplayManager:addDisplay"); if (!ok) { break; } int arg1; @@ -6197,7 +6197,7 @@ int lua_cocos2dx_studio_DisplayManager_addDisplay(lua_State* tolua_S) do{ if (argc == 2) { cocostudio::DisplayData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0, "ccs.DisplayManager:addDisplay"); if (!ok) { break; } int arg1; @@ -6688,7 +6688,7 @@ int lua_cocos2dx_studio_DisplayManager_create(lua_State* tolua_S) if (argc == 1) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.DisplayManager:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_DisplayManager_create'", nullptr); @@ -7097,7 +7097,7 @@ int lua_cocos2dx_studio_Bone_addChildBone(lua_State* tolua_S) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Bone:addChildBone"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Bone_addChildBone'", nullptr); @@ -7482,7 +7482,7 @@ int lua_cocos2dx_studio_Bone_setBoneData(lua_State* tolua_S) { cocostudio::BoneData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.BoneData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.BoneData",&arg0, "ccs.Bone:setBoneData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Bone_setBoneData'", nullptr); @@ -7582,7 +7582,7 @@ int lua_cocos2dx_studio_Bone_setParentBone(lua_State* tolua_S) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Bone:setParentBone"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Bone_setParentBone'", nullptr); @@ -7626,7 +7626,7 @@ int lua_cocos2dx_studio_Bone_addDisplay(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.Bone:addDisplay"); if (!ok) { break; } int arg1; @@ -7642,7 +7642,7 @@ int lua_cocos2dx_studio_Bone_addDisplay(lua_State* tolua_S) do{ if (argc == 2) { cocostudio::DisplayData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.DisplayData",&arg0, "ccs.Bone:addDisplay"); if (!ok) { break; } int arg1; @@ -8039,7 +8039,7 @@ int lua_cocos2dx_studio_Bone_setArmature(lua_State* tolua_S) { cocostudio::Armature* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0, "ccs.Bone:setArmature"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Bone_setArmature'", nullptr); @@ -8140,7 +8140,7 @@ int lua_cocos2dx_studio_Bone_removeChildBone(lua_State* tolua_S) cocostudio::Bone* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Bone:removeChildBone"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "ccs.Bone:removeChildBone"); if(!ok) @@ -8192,7 +8192,7 @@ int lua_cocos2dx_studio_Bone_setChildArmature(lua_State* tolua_S) { cocostudio::Armature* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0, "ccs.Bone:setChildArmature"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Bone_setChildArmature'", nullptr); @@ -8891,7 +8891,7 @@ int lua_cocos2dx_studio_ArmatureAnimation_setAnimationData(lua_State* tolua_S) { cocostudio::AnimationData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.AnimationData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.AnimationData",&arg0, "ccs.ArmatureAnimation:setAnimationData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureAnimation_setAnimationData'", nullptr); @@ -9088,7 +9088,7 @@ int lua_cocos2dx_studio_ArmatureAnimation_init(lua_State* tolua_S) { cocostudio::Armature* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0, "ccs.ArmatureAnimation:init"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureAnimation_init'", nullptr); @@ -9394,7 +9394,7 @@ int lua_cocos2dx_studio_ArmatureAnimation_create(lua_State* tolua_S) if (argc == 1) { cocostudio::Armature* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Armature",&arg0, "ccs.ArmatureAnimation:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureAnimation_create'", nullptr); @@ -9613,7 +9613,7 @@ int lua_cocos2dx_studio_ArmatureDataManager_addArmatureData(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ArmatureDataManager:addArmatureData"); - ok &= luaval_to_object(tolua_S, 3, "ccs.ArmatureData",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.ArmatureData",&arg1, "ccs.ArmatureDataManager:addArmatureData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureDataManager_addArmatureData'", nullptr); @@ -9631,7 +9631,7 @@ int lua_cocos2dx_studio_ArmatureDataManager_addArmatureData(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ArmatureDataManager:addArmatureData"); - ok &= luaval_to_object(tolua_S, 3, "ccs.ArmatureData",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.ArmatureData",&arg1, "ccs.ArmatureDataManager:addArmatureData"); ok &= luaval_to_std_string(tolua_S, 4,&arg2, "ccs.ArmatureDataManager:addArmatureData"); if(!ok) @@ -9996,7 +9996,7 @@ int lua_cocos2dx_studio_ArmatureDataManager_addAnimationData(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ArmatureDataManager:addAnimationData"); - ok &= luaval_to_object(tolua_S, 3, "ccs.AnimationData",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.AnimationData",&arg1, "ccs.ArmatureDataManager:addAnimationData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureDataManager_addAnimationData'", nullptr); @@ -10014,7 +10014,7 @@ int lua_cocos2dx_studio_ArmatureDataManager_addAnimationData(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ArmatureDataManager:addAnimationData"); - ok &= luaval_to_object(tolua_S, 3, "ccs.AnimationData",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.AnimationData",&arg1, "ccs.ArmatureDataManager:addAnimationData"); ok &= luaval_to_std_string(tolua_S, 4,&arg2, "ccs.ArmatureDataManager:addAnimationData"); if(!ok) @@ -10263,7 +10263,7 @@ int lua_cocos2dx_studio_ArmatureDataManager_addTextureData(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ArmatureDataManager:addTextureData"); - ok &= luaval_to_object(tolua_S, 3, "ccs.TextureData",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.TextureData",&arg1, "ccs.ArmatureDataManager:addTextureData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ArmatureDataManager_addTextureData'", nullptr); @@ -10281,7 +10281,7 @@ int lua_cocos2dx_studio_ArmatureDataManager_addTextureData(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ArmatureDataManager:addTextureData"); - ok &= luaval_to_object(tolua_S, 3, "ccs.TextureData",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.TextureData",&arg1, "ccs.ArmatureDataManager:addTextureData"); ok &= luaval_to_std_string(tolua_S, 4,&arg2, "ccs.ArmatureDataManager:addTextureData"); if(!ok) @@ -10610,7 +10610,7 @@ int lua_cocos2dx_studio_Armature_changeBoneParent(lua_State* tolua_S) cocostudio::Bone* arg0; std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Armature:changeBoneParent"); ok &= luaval_to_std_string(tolua_S, 3,&arg1, "ccs.Armature:changeBoneParent"); if(!ok) @@ -10662,7 +10662,7 @@ int lua_cocos2dx_studio_Armature_setAnimation(lua_State* tolua_S) { cocostudio::ArmatureAnimation* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ArmatureAnimation",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ArmatureAnimation",&arg0, "ccs.Armature:setAnimation"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Armature_setAnimation'", nullptr); @@ -10957,7 +10957,7 @@ int lua_cocos2dx_studio_Armature_removeBone(lua_State* tolua_S) cocostudio::Bone* arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Armature:removeBone"); ok &= luaval_to_boolean(tolua_S, 3,&arg1, "ccs.Armature:removeBone"); if(!ok) @@ -11054,7 +11054,7 @@ int lua_cocos2dx_studio_Armature_init(lua_State* tolua_S) if (!ok) { break; } cocostudio::Bone* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccs.Bone",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.Bone",&arg1, "ccs.Armature:init"); if (!ok) { break; } bool ret = cobj->init(arg0, arg1); @@ -11115,7 +11115,7 @@ int lua_cocos2dx_studio_Armature_setParentBone(lua_State* tolua_S) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Armature:setParentBone"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Armature_setParentBone'", nullptr); @@ -11165,7 +11165,7 @@ int lua_cocos2dx_studio_Armature_setBatchNode(lua_State* tolua_S) { cocostudio::BatchNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.BatchNode",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.BatchNode",&arg0, "ccs.Armature:setBatchNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Armature_setBatchNode'", nullptr); @@ -11262,7 +11262,7 @@ int lua_cocos2dx_studio_Armature_setArmatureData(lua_State* tolua_S) { cocostudio::ArmatureData* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ArmatureData",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ArmatureData",&arg0, "ccs.Armature:setArmatureData"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Armature_setArmatureData'", nullptr); @@ -11313,7 +11313,7 @@ int lua_cocos2dx_studio_Armature_addBone(lua_State* tolua_S) cocostudio::Bone* arg0; std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Armature:addBone"); ok &= luaval_to_std_string(tolua_S, 3,&arg1, "ccs.Armature:addBone"); if(!ok) @@ -11665,7 +11665,7 @@ int lua_cocos2dx_studio_Armature_create(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.Armature:create"); if (!ok) { break; } cocostudio::Bone* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccs.Bone",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.Bone",&arg1, "ccs.Armature:create"); if (!ok) { break; } cocostudio::Armature* ret = cocostudio::Armature::create(arg0, arg1); object_to_luaval(tolua_S, "ccs.Armature",(cocostudio::Armature*)ret); @@ -11979,7 +11979,7 @@ int lua_cocos2dx_studio_Skin_setBone(lua_State* tolua_S) { cocostudio::Bone* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Bone",&arg0, "ccs.Skin:setBone"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Skin_setBone'", nullptr); @@ -14340,7 +14340,7 @@ int lua_cocos2dx_studio_ComRender_setNode(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.ComRender:setNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ComRender_setNode'", nullptr); @@ -14426,7 +14426,7 @@ int lua_cocos2dx_studio_ComRender_create(lua_State* tolua_S) if (argc == 2) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.ComRender:create"); if (!ok) { break; } const char* arg1; std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "ccs.ComRender:create"); arg1 = arg1_tmp.c_str(); @@ -15823,7 +15823,7 @@ int lua_cocos2dx_studio_Frame_setNode(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.Frame:setNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Frame_setNode'", nullptr); @@ -15873,7 +15873,7 @@ int lua_cocos2dx_studio_Frame_setTimeline(lua_State* tolua_S) { cocostudio::timeline::Timeline* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Timeline",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Timeline",&arg0, "ccs.Frame:setTimeline"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Frame_setTimeline'", nullptr); @@ -20003,7 +20003,7 @@ int lua_cocos2dx_studio_Timeline_setNode(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.Timeline:setNode"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Timeline_setNode'", nullptr); @@ -20101,7 +20101,7 @@ int lua_cocos2dx_studio_Timeline_insertFrame(lua_State* tolua_S) cocostudio::timeline::Frame* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "ccs.Frame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Frame",&arg0, "ccs.Timeline:insertFrame"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccs.Timeline:insertFrame"); if(!ok) @@ -20203,7 +20203,7 @@ int lua_cocos2dx_studio_Timeline_addFrame(lua_State* tolua_S) { cocostudio::timeline::Frame* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Frame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Frame",&arg0, "ccs.Timeline:addFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Timeline_addFrame'", nullptr); @@ -20394,7 +20394,7 @@ int lua_cocos2dx_studio_Timeline_removeFrame(lua_State* tolua_S) { cocostudio::timeline::Frame* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Frame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Frame",&arg0, "ccs.Timeline:removeFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Timeline_removeFrame'", nullptr); @@ -20444,7 +20444,7 @@ int lua_cocos2dx_studio_Timeline_setActionTimeline(lua_State* tolua_S) { cocostudio::timeline::ActionTimeline* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ActionTimeline",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ActionTimeline",&arg0, "ccs.Timeline:setActionTimeline"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_Timeline_setActionTimeline'", nullptr); @@ -20893,7 +20893,7 @@ int lua_cocos2dx_studio_ActionTimeline_addTimeline(lua_State* tolua_S) { cocostudio::timeline::Timeline* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Timeline",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Timeline",&arg0, "ccs.ActionTimeline:addTimeline"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_addTimeline'", nullptr); @@ -21131,7 +21131,7 @@ int lua_cocos2dx_studio_ActionTimeline_removeTimeline(lua_State* tolua_S) { cocostudio::timeline::Timeline* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.Timeline",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.Timeline",&arg0, "ccs.ActionTimeline:removeTimeline"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_removeTimeline'", nullptr); @@ -22378,7 +22378,7 @@ int lua_cocos2dx_studio_ActionTimelineNode_setActionTimeline(lua_State* tolua_S) { cocostudio::timeline::ActionTimeline* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccs.ActionTimeline",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccs.ActionTimeline",&arg0, "ccs.ActionTimelineNode:setActionTimeline"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimelineNode_setActionTimeline'", nullptr); @@ -22429,9 +22429,9 @@ int lua_cocos2dx_studio_ActionTimelineNode_init(lua_State* tolua_S) cocos2d::Node* arg0; cocostudio::timeline::ActionTimeline* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.ActionTimelineNode:init"); - ok &= luaval_to_object(tolua_S, 3, "ccs.ActionTimeline",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccs.ActionTimeline",&arg1, "ccs.ActionTimelineNode:init"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimelineNode_init'", nullptr); @@ -22481,7 +22481,7 @@ int lua_cocos2dx_studio_ActionTimelineNode_setRoot(lua_State* tolua_S) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.ActionTimelineNode:setRoot"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimelineNode_setRoot'", nullptr); @@ -22520,8 +22520,8 @@ int lua_cocos2dx_studio_ActionTimelineNode_create(lua_State* tolua_S) { cocos2d::Node* arg0; cocostudio::timeline::ActionTimeline* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_object(tolua_S, 3, "ccs.ActionTimeline",&arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccs.ActionTimelineNode:create"); + ok &= luaval_to_object(tolua_S, 3, "ccs.ActionTimeline",&arg1, "ccs.ActionTimelineNode:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimelineNode_create'", nullptr); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index f7be1967bb..61d00dac16 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -176,7 +176,7 @@ int lua_cocos2dx_ui_LayoutParameter_copyProperties(lua_State* tolua_S) { cocos2d::ui::LayoutParameter* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.LayoutParameter",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.LayoutParameter",&arg0, "ccui.LayoutParameter:copyProperties"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_LayoutParameter_copyProperties'", nullptr); @@ -1969,7 +1969,7 @@ int lua_cocos2dx_ui_Widget_findNextFocusedWidget(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.Widget:findNextFocusedWidget"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1, "ccui.Widget:findNextFocusedWidget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_findNextFocusedWidget'", nullptr); @@ -2742,7 +2742,7 @@ int lua_cocos2dx_ui_Widget_setLayoutParameter(lua_State* tolua_S) { cocos2d::ui::LayoutParameter* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.LayoutParameter",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.LayoutParameter",&arg0, "ccui.Widget:setLayoutParameter"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_setLayoutParameter'", nullptr); @@ -2984,9 +2984,9 @@ int lua_cocos2dx_ui_Widget_dispatchFocusEvent(lua_State* tolua_S) cocos2d::ui::Widget* arg0; cocos2d::ui::Widget* arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.Widget:dispatchFocusEvent"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1, "ccui.Widget:dispatchFocusEvent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_dispatchFocusEvent'", nullptr); @@ -3376,9 +3376,9 @@ int lua_cocos2dx_ui_Widget_onFocusChange(lua_State* tolua_S) cocos2d::ui::Widget* arg0; cocos2d::ui::Widget* arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.Widget:onFocusChange"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1, "ccui.Widget:onFocusChange"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_onFocusChange'", nullptr); @@ -3667,9 +3667,9 @@ int lua_cocos2dx_ui_Widget_propagateTouchEvent(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.Widget:propagateTouchEvent"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1, "ccui.Widget:propagateTouchEvent"); - ok &= luaval_to_object(tolua_S, 4, "cc.Touch",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Touch",&arg2, "ccui.Widget:propagateTouchEvent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_propagateTouchEvent'", nullptr); @@ -3917,9 +3917,9 @@ int lua_cocos2dx_ui_Widget_interceptTouchEvent(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.Widget:interceptTouchEvent"); - ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1, "ccui.Widget:interceptTouchEvent"); - ok &= luaval_to_object(tolua_S, 4, "cc.Touch",&arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Touch",&arg2, "ccui.Widget:interceptTouchEvent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_interceptTouchEvent'", nullptr); @@ -13549,7 +13549,7 @@ int lua_cocos2dx_ui_ListView_getIndex(lua_State* tolua_S) { cocos2d::ui::Widget* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.ListView:getIndex"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getIndex'", nullptr); @@ -13696,7 +13696,7 @@ int lua_cocos2dx_ui_ListView_pushBackCustomItem(lua_State* tolua_S) { cocos2d::ui::Widget* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.ListView:pushBackCustomItem"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_pushBackCustomItem'", nullptr); @@ -14282,7 +14282,7 @@ int lua_cocos2dx_ui_ListView_setItemModel(lua_State* tolua_S) { cocos2d::ui::Widget* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.ListView:setItemModel"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setItemModel'", nullptr); @@ -14427,7 +14427,7 @@ int lua_cocos2dx_ui_ListView_insertCustomItem(lua_State* tolua_S) cocos2d::ui::Widget* arg0; ssize_t arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.ListView:insertCustomItem"); ok &= luaval_to_ssize(tolua_S, 3, &arg1, "ccui.ListView:insertCustomItem"); if(!ok) @@ -18309,7 +18309,7 @@ int lua_cocos2dx_ui_PageView_addWidgetToPage(lua_State* tolua_S) ssize_t arg1; bool arg2; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.PageView:addWidgetToPage"); ok &= luaval_to_ssize(tolua_S, 3, &arg1, "ccui.PageView:addWidgetToPage"); @@ -18460,7 +18460,7 @@ int lua_cocos2dx_ui_PageView_removePage(lua_State* tolua_S) { cocos2d::ui::Layout* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Layout",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Layout",&arg0, "ccui.PageView:removePage"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_removePage'", nullptr); @@ -18665,7 +18665,7 @@ int lua_cocos2dx_ui_PageView_insertPage(lua_State* tolua_S) cocos2d::ui::Layout* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Layout",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Layout",&arg0, "ccui.PageView:insertPage"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.PageView:insertPage"); if(!ok) @@ -18911,7 +18911,7 @@ int lua_cocos2dx_ui_PageView_addPage(lua_State* tolua_S) { cocos2d::ui::Layout* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.Layout",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Layout",&arg0, "ccui.PageView:addPage"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_addPage'", nullptr); @@ -19168,7 +19168,7 @@ int lua_cocos2dx_ui_Helper_seekActionWidgetByActionTag(lua_State* tolua_S) { cocos2d::ui::Widget* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.Helper:seekActionWidgetByActionTag"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.Helper:seekActionWidgetByActionTag"); if(!ok) { @@ -19206,7 +19206,7 @@ int lua_cocos2dx_ui_Helper_seekWidgetByName(lua_State* tolua_S) { cocos2d::ui::Widget* arg0; std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.Helper:seekWidgetByName"); ok &= luaval_to_std_string(tolua_S, 3,&arg1, "ccui.Helper:seekWidgetByName"); if(!ok) { @@ -19244,7 +19244,7 @@ int lua_cocos2dx_ui_Helper_seekWidgetByTag(lua_State* tolua_S) { cocos2d::ui::Widget* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Widget",&arg0, "ccui.Helper:seekWidgetByTag"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.Helper:seekWidgetByTag"); if(!ok) { @@ -19319,7 +19319,7 @@ int lua_cocos2dx_ui_Helper_doLayout(lua_State* tolua_S) if (argc == 1) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccui.Helper:doLayout"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Helper_doLayout'", nullptr); @@ -19846,7 +19846,7 @@ int lua_cocos2dx_ui_RichElementCustomNode_init(lua_State* tolua_S) ok &= luaval_to_uint16(tolua_S, 4,&arg2, "ccui.RichElementCustomNode:init"); - ok &= luaval_to_object(tolua_S, 5, "cc.Node",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Node",&arg3, "ccui.RichElementCustomNode:init"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_RichElementCustomNode_init'", nullptr); @@ -19890,7 +19890,7 @@ int lua_cocos2dx_ui_RichElementCustomNode_create(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.RichElementCustomNode:create"); ok &= luaval_to_color3b(tolua_S, 3, &arg1, "ccui.RichElementCustomNode:create"); ok &= luaval_to_uint16(tolua_S, 4,&arg2, "ccui.RichElementCustomNode:create"); - ok &= luaval_to_object(tolua_S, 5, "cc.Node",&arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Node",&arg3, "ccui.RichElementCustomNode:create"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_RichElementCustomNode_create'", nullptr); @@ -19998,7 +19998,7 @@ int lua_cocos2dx_ui_RichText_insertElement(lua_State* tolua_S) cocos2d::ui::RichElement* arg0; int arg1; - ok &= luaval_to_object(tolua_S, 2, "ccui.RichElement",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.RichElement",&arg0, "ccui.RichText:insertElement"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.RichText:insertElement"); if(!ok) @@ -20050,7 +20050,7 @@ int lua_cocos2dx_ui_RichText_pushBackElement(lua_State* tolua_S) { cocos2d::ui::RichElement* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.RichElement",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.RichElement",&arg0, "ccui.RichText:pushBackElement"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_RichText_pushBackElement'", nullptr); @@ -20191,7 +20191,7 @@ int lua_cocos2dx_ui_RichText_removeElement(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::ui::RichElement* arg0; - ok &= luaval_to_object(tolua_S, 2, "ccui.RichElement",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.RichElement",&arg0, "ccui.RichText:removeElement"); if (!ok) { break; } cobj->removeElement(arg0); @@ -20852,7 +20852,7 @@ int lua_cocos2dx_ui_Scale9Sprite_updateWithSprite(lua_State* tolua_S) do{ if (argc == 6) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "ccui.Scale9Sprite:updateWithSprite"); if (!ok) { break; } cocos2d::Rect arg1; @@ -20884,7 +20884,7 @@ int lua_cocos2dx_ui_Scale9Sprite_updateWithSprite(lua_State* tolua_S) do{ if (argc == 4) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "ccui.Scale9Sprite:updateWithSprite"); if (!ok) { break; } cocos2d::Rect arg1; @@ -21489,7 +21489,7 @@ int lua_cocos2dx_ui_Scale9Sprite_init(lua_State* tolua_S) do{ if (argc == 3) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "ccui.Scale9Sprite:init"); if (!ok) { break; } cocos2d::Rect arg1; @@ -21509,7 +21509,7 @@ int lua_cocos2dx_ui_Scale9Sprite_init(lua_State* tolua_S) do{ if (argc == 4) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "ccui.Scale9Sprite:init"); if (!ok) { break; } cocos2d::Rect arg1; @@ -21533,7 +21533,7 @@ int lua_cocos2dx_ui_Scale9Sprite_init(lua_State* tolua_S) do{ if (argc == 6) { cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "ccui.Scale9Sprite:init"); if (!ok) { break; } cocos2d::Rect arg1; @@ -21652,7 +21652,7 @@ int lua_cocos2dx_ui_Scale9Sprite_setSpriteFrame(lua_State* tolua_S) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "ccui.Scale9Sprite:setSpriteFrame"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Scale9Sprite_setSpriteFrame'", nullptr); @@ -21667,7 +21667,7 @@ int lua_cocos2dx_ui_Scale9Sprite_setSpriteFrame(lua_State* tolua_S) cocos2d::SpriteFrame* arg0; cocos2d::Rect arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "ccui.Scale9Sprite:setSpriteFrame"); ok &= luaval_to_rect(tolua_S, 3, &arg1, "ccui.Scale9Sprite:setSpriteFrame"); if(!ok) @@ -22237,7 +22237,7 @@ int lua_cocos2dx_ui_Scale9Sprite_initWithSpriteFrame(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "ccui.Scale9Sprite:initWithSpriteFrame"); if (!ok) { break; } bool ret = cobj->initWithSpriteFrame(arg0); @@ -22249,7 +22249,7 @@ int lua_cocos2dx_ui_Scale9Sprite_initWithSpriteFrame(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "ccui.Scale9Sprite:initWithSpriteFrame"); if (!ok) { break; } cocos2d::Rect arg1; @@ -22679,7 +22679,7 @@ int lua_cocos2dx_ui_Scale9Sprite_createWithSpriteFrame(lua_State* tolua_S) if (argc == 2) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "ccui.Scale9Sprite:createWithSpriteFrame"); if (!ok) { break; } cocos2d::Rect arg1; ok &= luaval_to_rect(tolua_S, 3, &arg1, "ccui.Scale9Sprite:createWithSpriteFrame"); @@ -22695,7 +22695,7 @@ int lua_cocos2dx_ui_Scale9Sprite_createWithSpriteFrame(lua_State* tolua_S) if (argc == 1) { cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "ccui.Scale9Sprite:createWithSpriteFrame"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::createWithSpriteFrame(arg0); object_to_luaval(tolua_S, "ccui.Scale9Sprite",(cocos2d::ui::Scale9Sprite*)ret); @@ -23586,7 +23586,7 @@ int lua_cocos2dx_ui_EditBox_touchDownAction(lua_State* tolua_S) cocos2d::Ref* arg0; cocos2d::ui::Widget::TouchEventType arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "ccui.EditBox:touchDownAction"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.EditBox:touchDownAction"); if(!ok) @@ -23739,7 +23739,7 @@ int lua_cocos2dx_ui_EditBox_initWithSizeAndBackgroundSprite(lua_State* tolua_S) if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1, "ccui.EditBox:initWithSizeAndBackgroundSprite"); if (!ok) { break; } bool ret = cobj->initWithSizeAndBackgroundSprite(arg0, arg1); @@ -24201,7 +24201,7 @@ int lua_cocos2dx_ui_EditBox_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1); object_to_luaval(tolua_S, "ccui.EditBox",(cocos2d::ui::EditBox*)ret); @@ -24217,10 +24217,10 @@ int lua_cocos2dx_ui_EditBox_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "ccui.Scale9Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "ccui.Scale9Sprite",&arg2, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1, arg2); object_to_luaval(tolua_S, "ccui.EditBox",(cocos2d::ui::EditBox*)ret); @@ -24236,13 +24236,13 @@ int lua_cocos2dx_ui_EditBox_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg2; - ok &= luaval_to_object(tolua_S, 4, "ccui.Scale9Sprite",&arg2); + ok &= luaval_to_object(tolua_S, 4, "ccui.Scale9Sprite",&arg2, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::Scale9Sprite* arg3; - ok &= luaval_to_object(tolua_S, 5, "ccui.Scale9Sprite",&arg3); + ok &= luaval_to_object(tolua_S, 5, "ccui.Scale9Sprite",&arg3, "ccui.EditBox:create"); if (!ok) { break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1, arg2, arg3); object_to_luaval(tolua_S, "ccui.EditBox",(cocos2d::ui::EditBox*)ret); @@ -26772,7 +26772,7 @@ int lua_cocos2dx_ui_LayoutComponent_bindLayoutComponent(lua_State* tolua_S) if (argc == 1) { cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "ccui.LayoutComponent:bindLayoutComponent"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_LayoutComponent_bindLayoutComponent'", nullptr); diff --git a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp index 7a26bbfe4b..4a2d049931 100644 --- a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp @@ -25,6 +25,7 @@ #include "lua_cocos2dx_3d_auto.hpp" #include "LuaBasicConversions.h" #include "CCLuaEngine.h" +#include "3d/CCBundle3D.h" extern int lua_cocos2dx_3d_Sprite3D_setBlendFunc(lua_State* L); @@ -231,9 +232,9 @@ bool luaval_to_terraindata(lua_State* L, int lo, cocos2d::Terrain::TerrainData* { lua_pushstring(L, "_chunkSize"); lua_gettable(L,lo); - if (!lua_isnil(L, -1)) + if (!lua_isnil(L, lua_gettop(L))) { - luaval_to_size(L, -1, &(outValue->_chunkSize)); + luaval_to_size(L, lua_gettop(L), &(outValue->_chunkSize)); } else { @@ -456,7 +457,7 @@ int lua_cocos2dx_3d_Terrain_getHeight(lua_State* L) if (!ok) { break; } cocos2d::Vec3* arg1; - ok &= luaval_to_object(L, 3, "cc.Vec3",&arg1); + ok &= luaval_to_object(L, 3, "cc.Vec3",&arg1, "cc.Terrain:getHeight"); if (!ok) { break; } double ret = cobj->getHeight(arg0, arg1); @@ -526,6 +527,56 @@ static void extendTerrain(lua_State* L) lua_pop(L, 1); } +int lua_cocos2dx_3d_Bundle3D_getTrianglesList(lua_State* L) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.Bundle3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(L, 2,&arg0, "cc.Bundle3D:getTrianglesList"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_3d_Bundle3D_getTrianglesList'", nullptr); + return 0; + } + + std::vector ret = cocos2d::Bundle3D::getTrianglesList(arg0); + std_vector_vec3_to_luaval(L,ret); + return 1; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Bundle3D:getTrianglesList",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_3d_Bundle3D_getTrianglesList'.",&tolua_err); +#endif + return 0; +} + +void extendBundle3D(lua_State* L) +{ + lua_pushstring(L, "cc.Bundle3D"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "getTrianglesList", lua_cocos2dx_3d_Bundle3D_getTrianglesList); + } + lua_pop(L, 1); +} + + static int register_all_cocos2dx_3d_manual(lua_State* L) { if (nullptr == L) @@ -533,6 +584,7 @@ static int register_all_cocos2dx_3d_manual(lua_State* L) extendSprite3D(L); extendTerrain(L); + extendBundle3D(L); return 0; } @@ -793,7 +845,7 @@ int lua_cocos2dx_3d_AABB_getCorners(lua_State* L) { cocos2d::Vec3* arg0; - ok &= luaval_to_object(L, 2, "cc.Vec3",&arg0); + ok &= luaval_to_object(L, 2, "cc.Vec3",&arg0, "cc.AABB:getCorners"); if(!ok) return 0; cobj->getCorners(arg0); @@ -840,7 +892,7 @@ int lua_cocos2dx_3d_AABB_updateMinMax(lua_State* L) const cocos2d::Vec3* arg0; ssize_t arg1; - ok &= luaval_to_object(L, 2, "cc.Vec3",&arg0); + ok &= luaval_to_object(L, 2, "cc.Vec3",&arg0, "cc.AABB:updateMinMax"); ok &= luaval_to_ssize(L, 3, &arg1, "cc.AABB:updateMinMax"); if(!ok) @@ -1326,7 +1378,7 @@ int lua_cocos2dx_3d_OBB_constructor(lua_State* L) do{ if (argc == 1) { cocos2d::AABB* arg0; - ok &= luaval_to_object(L, 2, "cc.AABB",&arg0); + ok &= luaval_to_object(L, 2, "cc.AABB",&arg0, "cc.OBB:OBB"); if (!ok) { break; } cobj = new cocos2d::OBB(*arg0); @@ -1348,7 +1400,7 @@ int lua_cocos2dx_3d_OBB_constructor(lua_State* L) do{ if (argc == 2) { const cocos2d::Vec3* arg0; - ok &= luaval_to_object(L, 2, "cc.Vec3",&arg0); + ok &= luaval_to_object(L, 2, "cc.Vec3",&arg0, "cc.OBB:OBB"); if (!ok) { break; } int arg1; @@ -1394,7 +1446,7 @@ int lua_cocos2dx_3d_OBB_intersects(lua_State* L) if(1 == argc) { cocos2d::OBB* arg0; - ok &= luaval_to_object(L, 2, "cc.OBB",&arg0); + ok &= luaval_to_object(L, 2, "cc.OBB",&arg0, "cc.OBB:intersects"); if (!ok) return 0; @@ -1985,7 +2037,7 @@ int lua_cocos2dx_3d_Ray_intersects(lua_State* L) if(1 == argc) { cocos2d::OBB* arg0 = nullptr; - ok &= luaval_to_object(L, 2, "cc.OBB",&arg0); + ok &= luaval_to_object(L, 2, "cc.OBB",&arg0, "cc.Ray:intersects"); if (!ok) return 0; diff --git a/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp b/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp index 6a114d5b40..69ef046381 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp @@ -33,6 +33,12 @@ #include "lua_cocos2dx_coco_studio_manual.hpp" #include "lua_cocos2dx_ui_manual.hpp" +#if _MSC_VER > 1800 +#pragma comment(lib,"lua51-2015.lib") +#else +#pragma comment(lib,"lua51.lib") +#endif + NS_CC_BEGIN LuaEngine* LuaEngine::_defaultEngine = nullptr; diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index af337436db..ba5f1c81d1 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -2243,6 +2243,49 @@ bool luaval_to_std_vector_vec2(lua_State* L, int lo, std::vector* return ok; } +bool luaval_to_std_vector_vec3(lua_State* L, int lo, std::vector* ret, const char* funcName) +{ + if (nullptr == L || nullptr == ret || lua_gettop(L) < lo) + return false; + + tolua_Error tolua_err; + bool ok = true; + + if (!tolua_istable(L, lo, 0, &tolua_err)) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err,funcName); +#endif + ok = false; + } + + if (ok) + { + size_t len = lua_objlen(L, lo); + cocos2d::Vec3 value; + for (size_t i = 0; i < len; i++) + { + lua_pushnumber(L, i + 1); + lua_gettable(L,lo); + if (lua_istable(L, lua_gettop(L))) + { + ok &= luaval_to_vec3(L, lua_gettop(L), &value); + if (ok) + { + ret->push_back(value); + } + } + else + { + CCASSERT(false, "vec3 type is needed"); + } + lua_pop(L, 1); + } + } + + return ok; +} + bool luaval_to_std_vector_v3f_c4b_t2f(lua_State* L, int lo, std::vector* ret, const char* funcName) { if (nullptr == L || nullptr == ret || lua_gettop(L) < lo) @@ -3270,3 +3313,20 @@ void texParams_to_luaval(lua_State* L, const cocos2d::Texture2D::TexParams& inVa lua_pushnumber(L, (lua_Number) inValue.wrapT); /* L: table key value*/ lua_rawset(L, -3); } + +void std_vector_vec3_to_luaval(lua_State* L, const std::vector& inValue) +{ + if (nullptr == L) + return; + + lua_newtable(L); + + int index = 1; + for (const cocos2d::Vec3& value : inValue) + { + lua_pushnumber(L, (lua_Number)index); + vec3_to_luaval(L, value); + lua_rawset(L, -3); + ++index; + } +} diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 2fcccc6a79..ec2b0fbbb1 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -697,7 +697,7 @@ extern bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* * @return Return true if the type of Lua value at the index is a Lua userdata, otherwise return false. */ template -bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) +bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret, const char* funcName = "") { if(nullptr == L || lua_gettop(L) < lo) return false; @@ -707,8 +707,8 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) *ret = static_cast(tolua_tousertype(L, lo, 0)); - if (nullptr == ret) - LUA_PRECONDITION(ret, "Invalid Native Object"); + if (nullptr == *ret) + CCLOG("Warning: %s argument %d is invalid native object(nullptr)", funcName, lo); return true; } @@ -818,6 +818,17 @@ extern bool luaval_to_std_vector_v3f_c4b_t2f(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); +/** + * Get a pointer points to a std::vector from a Lua array table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a pointer points to a std::vector. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + */ +extern bool luaval_to_std_vector_vec3(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); + /**@}**/ // from native @@ -1263,6 +1274,14 @@ void quaternion_to_luaval(lua_State* L,const cocos2d::Quaternion& inValue); */ void texParams_to_luaval(lua_State* L, const cocos2d::Texture2D::TexParams& inValue); +/** + * Push a Lua array table converted from a std::vector into the Lua stack. + * The format of table as follows: {vec3Value1, vec3Value2, ..., vec3ValueSize} + * + * @param L the current lua_State. + * @param inValue a std::vector vaule. + */ +void std_vector_vec3_to_luaval(lua_State* L, const std::vector& inValue); // end group /// @} #endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__ diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp index db09e5183a..1b4d94a6a3 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp @@ -2411,7 +2411,7 @@ int lua_cocos2dx_Node_setPhysicsBody(lua_State* tolua_S) { cocos2d::PhysicsBody* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0, "cc.Node:setPhysicsBody"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setPhysicsBody'", nullptr); @@ -4657,6 +4657,106 @@ tolua_lerror: #endif //CC_USE_PHYSICS +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#include "physics3d/CCPhysics3DWorld.h" +int lua_cocos2dx_Scene_getPhysics3DWorld(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Scene* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Scene",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Scene*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Scene_getPhysics3DWorld'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Scene_getPhysics3DWorld'", nullptr); + return 0; + } + cocos2d::Physics3DWorld* ret = cobj->getPhysics3DWorld(); + object_to_luaval(tolua_S, "cc.Physics3DWorld",(cocos2d::Physics3DWorld*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scene:getPhysics3DWorld",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Scene_getPhysics3DWorld'.",&tolua_err); +#endif + + return 0; +} + +int lua_cocos2dx_Scene_setPhysics3DDebugCamera(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Scene* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Scene",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Scene*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Scene_setPhysics3DDebugCamera'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S, 2, "cc.Camera", 0, &tolua_err)) { + goto tolua_lerror; + } +#endif + + cocos2d::Camera* camera = (cocos2d::Camera*)tolua_tousertype(tolua_S,2,0); + cobj->setPhysics3DDebugCamera(camera); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scene:setPhysics3DDebugCamera",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Scene_setPhysics3DDebugCamera'.",&tolua_err); +#endif + + return 0; +} +#endif + static void extendScene(lua_State* tolua_S) { lua_pushstring(tolua_S, "cc.Scene"); @@ -4664,12 +4764,12 @@ static void extendScene(lua_State* tolua_S) if (lua_istable(tolua_S,-1)) { #if CC_USE_PHYSICS - lua_pushstring(tolua_S, "getPhysicsWorld"); - lua_pushcfunction(tolua_S, lua_cocos2dx_Scene_getPhysicsWorld); - lua_rawset(tolua_S, -3); - lua_pushstring(tolua_S, "createWithPhysics"); - lua_pushcfunction(tolua_S, lua_cocos2dx_Scene_createWithPhysics); - lua_rawset(tolua_S, -3); + tolua_function(tolua_S, "getPhysicsWorld", lua_cocos2dx_Scene_getPhysicsWorld); + tolua_function(tolua_S, "createWithPhysics", lua_cocos2dx_Scene_createWithPhysics); +#endif +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + tolua_function(tolua_S, "getPhysics3DWorld", lua_cocos2dx_Scene_getPhysics3DWorld); + tolua_function(tolua_S, "setPhysics3DDebugCamera", lua_cocos2dx_Scene_setPhysics3DDebugCamera); #endif } lua_pop(tolua_S, 1); @@ -8008,6 +8108,253 @@ tolua_lerror: #endif } +int tolua_cocos2d_Mat4_translate(lua_State* tolua_S) +{ + bool ok = true; + int argc = lua_gettop(tolua_S); + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + + if (!tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_istable(tolua_S, 2, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Mat4 mat; + cocos2d::Vec3 vec3; + ok &= luaval_to_mat4(tolua_S, 1, &mat); + if (!ok) + return 0; + + ok &= luaval_to_vec3(tolua_S, 2, &vec3); + if (!ok) + return 0; + + mat.translate(vec3); + mat4_to_luaval(tolua_S, mat); + return 1; + } + } + + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'tolua_cocos2d_Mat4_translate'.",&tolua_err); + return 0; +#endif +} + +int tolua_cocos2d_Mat4_createRotationZ(lua_State* tolua_S) +{ + bool ok = true; + int argc = lua_gettop(tolua_S); + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + if (argc == 2) + { +#if COCOS2D_DEBUG >= 1 + + if (!tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Mat4 mat; + float angle; + ok &= luaval_to_mat4(tolua_S, 1, &mat); + if (!ok) + return 0; + angle = lua_tonumber(tolua_S, 2); + cocos2d::Mat4::createRotationZ(angle, &mat); + mat4_to_luaval(tolua_S, mat); + return 1; + } + } + + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'tolua_cocos2d_Mat4_createRotationZ'.",&tolua_err); + return 0; +#endif +} + +int tolua_cocos2d_Mat4_setIdentity(lua_State* tolua_S) +{ + bool ok = true; + int argc = lua_gettop(tolua_S); + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + + if (!tolua_istable(tolua_S, 1, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Mat4 mat; + ok &= luaval_to_mat4(tolua_S, 1, &mat); + if (!ok) + return 0; + mat.setIdentity(); + mat4_to_luaval(tolua_S, mat); + return 1; + } + } + + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'tolua_cocos2d_Mat4_setIdentity'.",&tolua_err); + return 0; +#endif +} + +int tolua_cocos2d_Mat4_createTranslation(lua_State* tolua_S) +{ + bool ok = true; + int argc = lua_gettop(tolua_S); + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + if (argc == 4) + { +#if COCOS2D_DEBUG >= 1 + + if ( !tolua_isnumber(tolua_S, 1, 0, &tolua_err) || + !tolua_isnumber(tolua_S, 2, 0, &tolua_err) || + !tolua_isnumber(tolua_S, 3, 0, &tolua_err) || + !tolua_istable(tolua_S, 4, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Mat4 dst; + ok &= luaval_to_mat4(tolua_S, 4, &dst, "cc.Mat4.createTranslation"); + if (!ok) + return 0; + + float xTranslation = (float)lua_tonumber(tolua_S, 1); + float yTranslation = (float)lua_tonumber(tolua_S, 2); + float zTranslation = (float)lua_tonumber(tolua_S, 3); + + cocos2d::Mat4::createTranslation(xTranslation, yTranslation, zTranslation, &dst); + mat4_to_luaval(tolua_S, dst); + return 1; + } + } + else if (argc == 2) + { +#if COCOS2D_DEBUG >= 1 + + if ( !tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_istable(tolua_S, 2, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Vec3 translation; + cocos2d::Mat4 dst; + + ok &= luaval_to_vec3(tolua_S, 1, &translation, "cc.Mat4.createTranslation"); + ok &= luaval_to_mat4(tolua_S, 2, &dst, "cc.Mat4.createTranslation"); + if (!ok) + return 0; + + cocos2d::Mat4::createTranslation(translation, &dst); + mat4_to_luaval(tolua_S, dst); + return 1; + } + } + + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'tolua_cocos2d_Mat4_createTranslation'.",&tolua_err); + return 0; +#endif +} + +int tolua_cocos2d_Mat4_createRotation(lua_State* tolua_S) +{ + bool ok = true; + int argc = lua_gettop(tolua_S); + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + if (argc == 2) + { +#if COCOS2D_DEBUG >= 1 + + if ( !tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_istable(tolua_S, 2, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Quaternion quat; + cocos2d::Mat4 dst; + + ok &= luaval_to_quaternion(tolua_S, 1, &quat, "cc.Mat4.createRotation"); + ok &= luaval_to_mat4(tolua_S, 2, &dst, "cc.Mat4.createRotation"); + if (!ok) + return 0; + + cocos2d::Mat4::createRotation(quat, &dst); + mat4_to_luaval(tolua_S, dst); + return 1; + } + } + else if (argc == 3) + { +#if COCOS2D_DEBUG >= 1 + + if ( !tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_isnumber(tolua_S, 2, 0, &tolua_err) || + !tolua_istable(tolua_S, 3, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Vec3 axis; + cocos2d::Mat4 dst; + + ok &= luaval_to_vec3(tolua_S, 1, &axis, "cc.Mat4.createRotation"); + ok &= luaval_to_mat4(tolua_S, 3, &dst, "cc.Mat4.createRotation"); + if (!ok) + return 0; + + float angle = (float)tolua_tonumber(tolua_S, 2, 0); + + cocos2d::Mat4::createRotation(axis, angle, &dst); + mat4_to_luaval(tolua_S, dst); + return 1; + } + } + + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'tolua_cocos2d_Mat4_createRotation'.",&tolua_err); + return 0; +#endif +} + int register_all_cocos2dx_math_manual(lua_State* tolua_S) { if (nullptr == tolua_S) @@ -8020,6 +8367,11 @@ int register_all_cocos2dx_math_manual(lua_State* tolua_S) tolua_function(tolua_S, "mat4_transformVector", tolua_cocos2d_Mat4_transformVector); tolua_function(tolua_S, "mat4_decompose", tolua_cocos2d_Mat4_decompose); tolua_function(tolua_S, "mat4_multiply", tolua_cocos2d_Mat4_multiply); + tolua_function(tolua_S, "mat4_translate", tolua_cocos2d_Mat4_translate); + tolua_function(tolua_S, "mat4_createRotationZ", tolua_cocos2d_Mat4_createRotationZ); + tolua_function(tolua_S, "mat4_setIdentity", tolua_cocos2d_Mat4_setIdentity); + tolua_function(tolua_S, "mat4_createTranslation", tolua_cocos2d_Mat4_createTranslation); + tolua_function(tolua_S, "mat4_createRotation", tolua_cocos2d_Mat4_createRotation); tolua_function(tolua_S, "vec3_cross", tolua_cocos2d_Vec3_cross); tolua_endmodule(tolua_S); return 0; diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp index bb8d05a1b9..3673311eae 100644 --- a/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp +++ b/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp @@ -76,9 +76,9 @@ namespace cocostudio customOptions.Accept(writer); auto stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushString(classType.c_str(), classType.size()); + stack->pushString(classType.c_str(), static_cast(classType.size())); stack->pushObject(widget, "cc.Ref"); - stack->pushString(buffer.GetString(), buffer.Size()); + stack->pushString(buffer.GetString(), static_cast(buffer.GetSize())); stack->executeFunctionByHandler(_setPropsFunc, 3); } } diff --git a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp index 23f1c9d4e7..19a964c980 100644 --- a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp @@ -647,9 +647,9 @@ public: LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX, (void*)&data,2,[&](lua_State* L,int numReturn){ CCASSERT(numReturn == 2, "tableCellSizeForIndex return count error"); ValueVector vec; - width = (float)tolua_tonumber(L, -1, 0); + height = (float)tolua_tonumber(L, -1, 0); lua_pop(L, 1); - height = (float)tolua_tonumber(L, -1, 0); + width = (float)tolua_tonumber(L, -1, 0); lua_pop(L, 1); }); diff --git a/cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.cpp b/cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.cpp new file mode 100644 index 0000000000..43165ac3ab --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.cpp @@ -0,0 +1,826 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#include "platform/CCPlatformConfig.h" +#include "base/ccConfig.h" +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#include "lua_cocos2dx_physics3d_manual.h" +#include "lua_cocos2dx_physics3d_auto.hpp" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" +#include "CCLuaEngine.h" +#include "physics3d/CCPhysics3D.h" + +bool luaval_to_Physics3DRigidBodyDes(lua_State* L,int lo,cocos2d::Physics3DRigidBodyDes* outValue, const char* funcName) +{ + if (nullptr == L || nullptr == outValue) + return false; + + bool ok = true; + + tolua_Error tolua_err; + if (!tolua_istable(L, lo, 0, &tolua_err) ) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err,funcName); +#endif + ok = false; + } + + if (ok) + { + lua_pushstring(L, "mass"); + lua_gettable(L, lo); + outValue->mass = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "localInertia"); + lua_gettable(L, lo); + if (!lua_istable(L, -1)) + { + outValue->localInertia = cocos2d::Vec3(0.0, 0.0, 0.0); + } + else + { + luaval_to_vec3(L, lua_gettop(L), &outValue->localInertia); + } + lua_pop(L, 1); + + lua_pushstring(L, "shape"); + lua_gettable(L, lo); + if (!tolua_isusertype(L, -1, "cc.Physics3DShape", 0, &tolua_err)) + { + outValue->shape = nullptr; + } + else + { + outValue->shape = static_cast(tolua_tousertype(L, lua_gettop(L), nullptr)); + } + lua_pop(L, 1); + + lua_pushstring(L, "originalTransform"); + lua_gettable(L, lo); + if (!lua_istable(L, -1)) + { + outValue->originalTransform = cocos2d::Mat4(); + } + else + { + luaval_to_mat4(L, lua_gettop(L), &outValue->originalTransform); + } + lua_pop(L, 1); + + lua_pushstring(L, "disableSleep"); + lua_gettable(L, lo); + outValue->disableSleep = lua_isnil(L, -1) ? false : lua_toboolean(L, -1); + lua_pop(L, 1); + } + return ok; +} + +bool luaval_to_Physics3DWorld_HitResult(lua_State* L,int lo, cocos2d::Physics3DWorld::HitResult* outValue, const char* funcName) +{ + if (nullptr == L || nullptr == outValue) + return false; + + bool ok = true; + + tolua_Error tolua_err; + if (!tolua_istable(L, lo, 0, &tolua_err) ) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err,funcName); +#endif + ok = false; + } + + if (ok) + { + lua_pushstring(L, "hitPosition"); + lua_gettable(L, lo); + if (!lua_istable(L, -1)) + { + outValue->hitPosition = cocos2d::Vec3(); + } + else + { + luaval_to_vec3(L, lua_gettop(L), &(outValue->hitPosition)); + } + lua_pop(L, 1); + + lua_pushstring(L, "hitNormal"); + lua_gettable(L, lo); + if (!lua_istable(L, -1)) + { + outValue->hitNormal = cocos2d::Vec3(); + } + else + { + luaval_to_vec3(L, lua_gettop(L), &(outValue->hitNormal)); + } + lua_pop(L, 1); + + lua_pushstring(L, "hitObj"); + lua_gettable(L, lo); + if (!tolua_isusertype(L, -1, "cc.Physics3DObject", 0, &tolua_err)) + { + outValue->hitObj = nullptr; + } + else + { + outValue->hitObj = static_cast(tolua_tousertype(L, lua_gettop(L), nullptr)); + } + lua_pop(L, 1); + } + return true; +} + +void Physics3DWorld_HitResult_to_luaval(lua_State* L, const cocos2d::Physics3DWorld::HitResult& hitResult) +{ + if (nullptr == L) + return; + + lua_newtable(L); + lua_pushstring(L, "hitPosition"); + vec3_to_luaval(L, hitResult.hitPosition); + lua_rawset(L, -3); + lua_pushstring(L, "hitNormal"); + vec3_to_luaval(L, hitResult.hitNormal); + lua_rawset(L, -3); + lua_pushstring(L, "hitObj"); + if (nullptr == hitResult.hitObj) + { + lua_pushnil(L); + } + else + { + object_to_luaval(L, "cc.Physics3DObject",hitResult.hitObj); + } + lua_rawset(L, -3); +} + +int lua_cocos2dx_physics3d_PhysicsSprite3D_create(lua_State* L) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.PhysicsSprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 2) + { + std::string arg0; + cocos2d::Physics3DRigidBodyDes arg1; + ok &= luaval_to_std_string(L, 2,&arg0, "cc.PhysicsSprite3D:create"); + ok &= luaval_to_Physics3DRigidBodyDes(L, 3, &arg1, "cc.PhysicsSprite3D:create"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_create'", nullptr); + return 0; + } + cocos2d::PhysicsSprite3D* ret = cocos2d::PhysicsSprite3D::create(arg0, &arg1); + object_to_luaval(L, "cc.PhysicsSprite3D",(cocos2d::PhysicsSprite3D*)ret); + return 1; + } + if (argc == 3) + { + std::string arg0; + cocos2d::Physics3DRigidBodyDes arg1; + cocos2d::Vec3 arg2; + ok &= luaval_to_std_string(L, 2,&arg0, "cc.PhysicsSprite3D:create"); + ok &= luaval_to_Physics3DRigidBodyDes(L, 3, &arg1, "cc.PhysicsSprite3D:create"); + ok &= luaval_to_vec3(L, 4, &arg2, "cc.PhysicsSprite3D:create"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_create'", nullptr); + return 0; + } + cocos2d::PhysicsSprite3D* ret = cocos2d::PhysicsSprite3D::create(arg0, &arg1, arg2); + object_to_luaval(L, "cc.PhysicsSprite3D",(cocos2d::PhysicsSprite3D*)ret); + return 1; + } + if (argc == 4) + { + std::string arg0; + cocos2d::Physics3DRigidBodyDes arg1; + cocos2d::Vec3 arg2; + cocos2d::Quaternion arg3; + ok &= luaval_to_std_string(L, 2,&arg0, "cc.PhysicsSprite3D:create"); + ok &= luaval_to_Physics3DRigidBodyDes(L, 3, &arg1, "cc.PhysicsSprite3D:create"); + ok &= luaval_to_vec3(L, 4, &arg2, "cc.PhysicsSprite3D:create"); + ok &= luaval_to_quaternion(L, 5, &arg3); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_create'", nullptr); + return 0; + } + cocos2d::PhysicsSprite3D* ret = cocos2d::PhysicsSprite3D::create(arg0, &arg1, arg2, arg3); + object_to_luaval(L, "cc.PhysicsSprite3D",(cocos2d::PhysicsSprite3D*)ret); + return 1; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.PhysicsSprite3D:create",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_create'.",&tolua_err); +#endif + return 0; +} + +void extendPhysicsSprite3D(lua_State* L) +{ + lua_pushstring(L, "cc.PhysicsSprite3D"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "create", lua_cocos2dx_physics3d_PhysicsSprite3D_create); + } + lua_pop(L, 1); +} + +int lua_cocos2dx_physics3d_Physics3DRigidBody_create(lua_State* L) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.Physics3DRigidBody",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 1) + { + cocos2d::Physics3DRigidBodyDes arg0; + ok &= luaval_to_Physics3DRigidBodyDes(L, 2, &arg0, "cc.Physics3DRigidBody:create"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DRigidBody_create'", nullptr); + return 0; + } + cocos2d::Physics3DRigidBody* ret = cocos2d::Physics3DRigidBody::create(&arg0); + object_to_luaval(L, "cc.Physics3DRigidBody",(cocos2d::Physics3DRigidBody*)ret); + return 1; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Physics3DRigidBody:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DRigidBody_create'.",&tolua_err); +#endif + return 0; +} + +void extendPhysics3DRigidBody(lua_State* L) +{ + lua_pushstring(L, "cc.Physics3DRigidBody"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "create", lua_cocos2dx_physics3d_Physics3DRigidBody_create); + } + lua_pop(L, 1); +} + +int lua_cocos2dx_physics3d_Physics3DComponent_create(lua_State* L) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.Physics3DComponent",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L)-1; + + do + { + if (argc == 1) + { + cocos2d::Physics3DObject* arg0; + ok &= luaval_to_object(L, 2, "cc.Physics3DObject",&arg0); + if (!ok) { break; } + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0); + object_to_luaval(L, "cc.Physics3DComponent",(cocos2d::Physics3DComponent*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 2) + { + cocos2d::Physics3DObject* arg0; + ok &= luaval_to_object(L, 2, "cc.Physics3DObject",&arg0); + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(L, 3, &arg1, "cc.Physics3DComponent:create"); + if (!ok) { break; } + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0, arg1); + object_to_luaval(L, "cc.Physics3DComponent",(cocos2d::Physics3DComponent*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Physics3DObject* arg0; + ok &= luaval_to_object(L, 2, "cc.Physics3DObject",&arg0); + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(L, 3, &arg1, "cc.Physics3DComponent:create"); + if (!ok) { break; } + cocos2d::Quaternion arg2; + ok &= luaval_to_quaternion(L, 4, &arg2); + if (!ok) { break; } + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0, arg1, arg2); + object_to_luaval(L, "cc.Physics3DComponent",(cocos2d::Physics3DComponent*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 0) + { + cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(); + object_to_luaval(L, "cc.Physics3DComponent",(cocos2d::Physics3DComponent*)ret); + return 1; + } + } while (0); + ok = true; + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d", "cc.Physics3DComponent:create",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DComponent_create'.",&tolua_err); +#endif + return 0; +} + +void extendPhysics3DComponent(lua_State* L) +{ + lua_pushstring(L, "cc.Physics3DComponent"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "create", lua_cocos2dx_physics3d_Physics3DComponent_create); + } + lua_pop(L, 1); +} + +int lua_cocos2dx_physics3d_Physics3DWorld_rayCast(lua_State* L) +{ + int argc = 0; + cocos2d::Physics3DWorld* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(L,1,"cc.Physics3DWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Physics3DWorld*)tolua_tousertype(L,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_rayCast'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(L)-1; + if (argc == 3) + { + cocos2d::Vec3 arg0; + cocos2d::Vec3 arg1; + cocos2d::Physics3DWorld::HitResult arg2; + + ok &= luaval_to_vec3(L, 2, &arg0, "cc.Physics3DWorld:rayCast"); + + ok &= luaval_to_vec3(L, 3, &arg1, "cc.Physics3DWorld:rayCast"); + + ok &= luaval_to_Physics3DWorld_HitResult(L, 4, &arg2, "cc.Physics3DWorld:rayCast"); + + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_rayCast'", nullptr); + return 0; + } + bool ret = cobj->rayCast(arg0, arg1, &arg2); + tolua_pushboolean(L,(bool)ret); + Physics3DWorld_HitResult_to_luaval(L, arg2); + return 2; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:rayCast",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_rayCast'.",&tolua_err); +#endif + + return 0; +} + +void extendPhysics3DWorld(lua_State* L) +{ + lua_pushstring(L, "cc.Physics3DWorld"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "rayCast", lua_cocos2dx_physics3d_Physics3DWorld_rayCast); + } + lua_pop(L, 1); +} + +int lua_cocos2dx_physics3d_Physics3DShape_createMesh(lua_State* L) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.Physics3DShape",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 2) + { + std::vector arg0; + int arg1; + ok &= luaval_to_std_vector_vec3(L, 2, &arg0, "cc.Physics3DShape:createMesh"); + ok &= luaval_to_int32(L, 3,(int *)&arg1, "cc.Physics3DShape:createMesh"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DShape_createMesh'", nullptr); + return 0; + } + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createMesh(&arg0[0], arg1); + object_to_luaval(L, "cc.Physics3DShape",(cocos2d::Physics3DShape*)ret); + return 1; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Physics3DShape:createMesh",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DShape_createMesh'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics3d_Physics3DShape_createHeightfield(lua_State* L) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.Physics3DShape",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 8) + { + int arg0; + int arg1; + std::vector arg2; + double arg3; + double arg4; + double arg5; + bool arg6; + bool arg7; + ok &= luaval_to_int32(L, 2,(int *)&arg0, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_int32(L, 3,(int *)&arg1, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_std_vector_float(L, 4, &arg2,"cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_number(L, 5,&arg3, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_number(L, 6,&arg4, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_number(L, 7,&arg5, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_boolean(L, 8,&arg6, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_boolean(L, 9,&arg7, "cc.Physics3DShape:createHeightfield"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DShape_createHeightfield'", nullptr); + return 0; + } + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createHeightfield(arg0, arg1, &arg2[0], arg3, arg4, arg5, arg6, arg7); + object_to_luaval(L, "cc.Physics3DShape",(cocos2d::Physics3DShape*)ret); + return 1; + } + if (argc == 9) + { + int arg0; + int arg1; + std::vector arg2; + double arg3; + double arg4; + double arg5; + bool arg6; + bool arg7; + bool arg8; + ok &= luaval_to_int32(L, 2,(int *)&arg0, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_int32(L, 3,(int *)&arg1, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_std_vector_float(L, 4, &arg2,"cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_number(L, 5,&arg3, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_number(L, 6,&arg4, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_number(L, 7,&arg5, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_boolean(L, 8,&arg6, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_boolean(L, 9,&arg7, "cc.Physics3DShape:createHeightfield"); + ok &= luaval_to_boolean(L, 10,&arg8, "cc.Physics3DShape:createHeightfield"); + if(!ok) + { + tolua_error(L,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DShape_createHeightfield'", nullptr); + return 0; + } + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createHeightfield(arg0, arg1, &arg2[0], arg3, arg4, arg5, arg6, arg7, arg8); + object_to_luaval(L, "cc.Physics3DShape",(cocos2d::Physics3DShape*)ret); + return 1; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Physics3DShape:createHeightfield",argc, 8); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DShape_createHeightfield'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics3d_Physics3DShape_createCompoundShape(lua_State* L) +{ + int argc = 0; + bool ok = true; + + tolua_Error tolua_err; + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(L,1,"cc.Physics3DShape",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 1) + { + + std::vector> shapes; + if (!tolua_istable(L, 2, 0, &tolua_err) ) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err,"cc.Physics3DShape:createCompoundShape"); +#endif + ok = false; + } + + if (ok) + { + size_t len = lua_objlen(L, 2); + cocos2d::Physics3DShape* shape = nullptr; + cocos2d::Mat4 mat; + for (size_t i = 0; i < len; i++) + { + lua_pushnumber(L,i + 1); + lua_gettable(L,2); + if (lua_istable(L, -1)) + { + lua_pushnumber(L, 1); + lua_gettable(L, -2); + luaval_to_object(L, lua_gettop(L), "cc.Physics3DShape", &shape); + lua_pop(L,1); + + lua_pushnumber(L, 2); + lua_gettable(L, -2); + luaval_to_mat4(L, lua_gettop(L), &mat); + lua_pop(L,1); + + shapes.push_back(std::make_pair(shape, mat)); + } + lua_pop(L, 1); + } + } + + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCompoundShape(shapes); + object_to_luaval(L, "cc.Physics3DShape",(cocos2d::Physics3DShape*)ret); + return 1; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Physics3DShape:createCompoundShape",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DShape_createCompoundShape'.",&tolua_err); +#endif + return 0; +} + +void extendPhysics3DShape(lua_State* L) +{ + lua_pushstring(L, "cc.Physics3DShape"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "createMesh", lua_cocos2dx_physics3d_Physics3DShape_createMesh); + tolua_function(L, "createHeightfield", lua_cocos2dx_physics3d_Physics3DShape_createHeightfield); + tolua_function(L, "createCompoundShape", lua_cocos2dx_physics3d_Physics3DShape_createCompoundShape); + } + lua_pop(L, 1); +} + +void CollisionPoint_to_luaval(lua_State* L,const cocos2d::Physics3DCollisionInfo::CollisionPoint& collisionPoint) +{ + if (nullptr == L) + return; + + lua_newtable(L); + lua_pushstring(L, "localPositionOnA"); + vec3_to_luaval(L, collisionPoint.localPositionOnA); + lua_rawset(L, -3); + lua_pushstring(L, "worldPositionOnA"); + vec3_to_luaval(L, collisionPoint.worldPositionOnA); + lua_rawset(L, -3); + lua_pushstring(L, "localPositionOnB"); + vec3_to_luaval(L, collisionPoint.localPositionOnB); + lua_rawset(L, -3); + lua_pushstring(L, "worldPositionOnB"); + vec3_to_luaval(L, collisionPoint.worldPositionOnB); + lua_rawset(L, -3); + lua_pushstring(L, "worldNormalOnB"); + vec3_to_luaval(L, collisionPoint.worldNormalOnB); + lua_rawset(L, -3); +} + +int lua_cocos2dx_physics3d_Physics3DObject_setCollisionCallback(lua_State* L) +{ + int argc = 0; + cocos2d::Physics3DObject* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(L,1,"cc.Physics3DObject",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Physics3DObject*)tolua_tousertype(L,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DObject_setCollisionCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(L)-1; + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) { + goto tolua_lerror; + } +#endif + LUA_FUNCTION handler = toluafix_ref_function(L,2,0); + cobj->setCollisionCallback([=](const cocos2d::Physics3DCollisionInfo& ci){ + lua_newtable(L); + lua_pushstring(L, "objA"); + if (nullptr == ci.objA) + { + lua_pushnil(L); + } + else + { + object_to_luaval(L, "cc.Physics3DObject", ci.objA); + } + lua_rawset(L, -3); + lua_pushstring(L, "objB"); + if (nullptr == ci.objB) + { + lua_pushnil(L); + } + else + { + object_to_luaval(L, "cc.Physics3DObject", ci.objB); + } + lua_rawset(L, -3); + lua_pushstring(L, "collisionPointList"); + if (ci.collisionPointList.empty()) + { + lua_pushnil(L); + } + else + { + int vecIndex = 1; + lua_newtable(L); + for (auto value : ci.collisionPointList) + { + lua_pushnumber(L, vecIndex); + CollisionPoint_to_luaval(L, value); + lua_rawset(L, -3); + ++vecIndex; + } + } + lua_rawset(L, -3); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); + }); + + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + luaL_error(L, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DObject:setCollisionCallback",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DObject_setCollisionCallback'.",&tolua_err); +#endif + + return 0; +} + +void extendPhysics3DObject(lua_State* L) +{ + lua_pushstring(L, "cc.Physics3DObject"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "setCollisionCallback", lua_cocos2dx_physics3d_Physics3DObject_setCollisionCallback); + } + lua_pop(L, 1); +} + +int register_all_physics3d_manual(lua_State* L) +{ + if (nullptr == L) + return 0; + + extendPhysicsSprite3D(L); + extendPhysics3DRigidBody(L); + extendPhysics3DComponent(L); + extendPhysics3DWorld(L); + extendPhysics3DShape(L); + extendPhysics3DObject(L); + + return 1; +} + +int register_physics3d_module(lua_State* L) +{ + lua_getglobal(L, "_G"); + if (lua_istable(L,-1))//stack:...,_G, + { + register_all_cocos2dx_physics3d(L); + register_all_physics3d_manual(L); + } + lua_pop(L, 1); + return 1; +} + +#endif \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.h b/cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.h new file mode 100644 index 0000000000..2935366387 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.h @@ -0,0 +1,57 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_COCOS2DX_PHYSICS3D_MANUAL_H__ +#define COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_COCOS2DX_PHYSICS3D_MANUAL_H__ + +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + + +/** + * @addtogroup lua + * @{ + */ + +/** + * Call this function can import the lua bindings for the physics3d module. + * After registering, we could call the related physics3d code conveniently in the lua. + * If you don't want to use the physics3d module in the lua, you only don't call this registering function. + * If you don't register the physics3d module, the package size would become smaller . + * The current mechanism,this function is called in the lua_module_register.h + */ + +TOLUA_API int register_physics3d_module(lua_State* L); + +// end group +/// @} + +#endif // #if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_COCOS2DX_PHYSICS3D_MANUAL_H__ diff --git a/cocos/scripting/lua-bindings/proj.android/Android.mk b/cocos/scripting/lua-bindings/proj.android/Android.mk index 109c7ec579..a0ab181509 100644 --- a/cocos/scripting/lua-bindings/proj.android/Android.mk +++ b/cocos/scripting/lua-bindings/proj.android/Android.mk @@ -116,6 +116,10 @@ LOCAL_SRC_FILES += ../manual/ui/lua_cocos2dx_experimental_webview_manual.cpp \ LOCAL_SRC_FILES += ../manual/extension/lua_cocos2dx_extension_manual.cpp \ ../auto/lua_cocos2dx_extension_auto.cpp \ +#physics3d +LOCAL_SRC_FILES += ../manual/physics3d/lua_cocos2dx_physics3d_manual.cpp \ + ../auto/lua_cocos2dx_physics3d_auto.cpp \ + LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../external/lua/tolua \ $(LOCAL_PATH)/../../../../external/lua/luajit/include \ $(LOCAL_PATH)/../../../2d \ @@ -126,6 +130,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../external/lua/tolua \ $(LOCAL_PATH)/../../../editor-support/cocostudio/ActionTimeline \ $(LOCAL_PATH)/../../../editor-support/spine \ $(LOCAL_PATH)/../../../ui \ + $(LOCAL_PATH)/../../../physics3d \ $(LOCAL_PATH)/../../../../extensions \ $(LOCAL_PATH)/../auto \ $(LOCAL_PATH)/../manual \ diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index f3bd4c33e4..585030e6b9 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -151,6 +151,14 @@ 159552411A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1595523E1A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.cpp */; }; 159552421A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1595523F1A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.hpp */; }; 159552431A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1595523F1A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.hpp */; }; + 15A561E51B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A561E31B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp */; }; + 15A561E61B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A561E31B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp */; }; + 15A561E71B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15A561E41B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp */; }; + 15A561E81B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15A561E41B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp */; }; + 15A561EC1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A561EA1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp */; }; + 15A561ED1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A561EA1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp */; }; + 15A561EE1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A561EB1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h */; }; + 15A561EF1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A561EB1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h */; }; 15AC69D519876E9300D17520 /* lua_cocos2dx_physics_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE75218BC45C200215002 /* lua_cocos2dx_physics_auto.cpp */; }; 15AC69D619876EA200D17520 /* lua_cocos2dx_physics_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE75318BC45C200215002 /* lua_cocos2dx_physics_auto.hpp */; }; 15AC69D91987710400D17520 /* tolua_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 1ABCA1F918CD8F6E0087CE3A /* tolua_event.c */; }; @@ -316,6 +324,10 @@ 159552391A25E1C5001E9FC9 /* lua_cocos2dx_csloader_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_csloader_auto.hpp; sourceTree = ""; }; 1595523E1A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_csloader_manual.cpp; sourceTree = ""; }; 1595523F1A25E4B8001E9FC9 /* lua_cocos2dx_csloader_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_csloader_manual.hpp; sourceTree = ""; }; + 15A561E31B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_physics3d_auto.cpp; sourceTree = ""; }; + 15A561E41B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_physics3d_auto.hpp; sourceTree = ""; }; + 15A561EA1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lua_cocos2dx_physics3d_manual.cpp; path = physics3d/lua_cocos2dx_physics3d_manual.cpp; sourceTree = ""; }; + 15A561EB1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_cocos2dx_physics3d_manual.h; path = physics3d/lua_cocos2dx_physics3d_manual.h; sourceTree = ""; }; 15B5754D1A6F4D1500041C20 /* lua-cocos-studio-conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "lua-cocos-studio-conversions.cpp"; sourceTree = ""; }; 15B5754E1A6F4D1500041C20 /* lua-cocos-studio-conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "lua-cocos-studio-conversions.h"; sourceTree = ""; }; 15C1BCC019864D8700A46ACC /* lua_cocos2dx_cocosbuilder_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_cocosbuilder_auto.cpp; sourceTree = ""; }; @@ -476,6 +488,15 @@ path = 3d; sourceTree = ""; }; + 15A561E91B00A3D0005D4720 /* physics3d */ = { + isa = PBXGroup; + children = ( + 15A561EA1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp */, + 15A561EB1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h */, + ); + name = physics3d; + sourceTree = ""; + }; 15C1BCD21986525900A46ACC /* cocos2d */ = { isa = PBXGroup; children = ( @@ -572,6 +593,8 @@ 1AACE74818BC45C200215002 /* auto */ = { isa = PBXGroup; children = ( + 15A561E31B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp */, + 15A561E41B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp */, 15C9A10C1AE4972500C15443 /* lua_cocos2dx_experimental_webview_auto.cpp */, 15C9A10D1AE4972500C15443 /* lua_cocos2dx_experimental_webview_auto.hpp */, 159552381A25E1C5001E9FC9 /* lua_cocos2dx_csloader_auto.cpp */, @@ -608,6 +631,7 @@ 1AACE75B18BC45C200215002 /* manual */ = { isa = PBXGroup; children = ( + 15A561E91B00A3D0005D4720 /* physics3d */, 3E2BDB0719C5E6100055CDCD /* audioengine */, 158C128419A0FA1300781A76 /* 3d */, 15427D41198F73F700DC375D /* cocosdenshion */, @@ -779,6 +803,7 @@ 15EFA1F71989E582000C57D3 /* lua_cocos2dx_experimental_auto.hpp in Headers */, 15415AA719A71A53004F1E71 /* auxiliar.h in Headers */, 155C7E1019A71C9D00F08B25 /* lua_extensions.h in Headers */, + 15A561E71B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp in Headers */, 15415ABF19A71A53004F1E71 /* mime.h in Headers */, 15AC69E21987712500D17520 /* tolua_event.h in Headers */, 15415AD719A71A53004F1E71 /* udp.h in Headers */, @@ -820,6 +845,7 @@ 15C1C2DC19874B4400A46ACC /* xxtea.h in Headers */, 15415AD319A71A53004F1E71 /* timeout.h in Headers */, 15C1C2D5198749BC00A46ACC /* LuaOpengl.h in Headers */, + 15A561EE1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h in Headers */, 155C7E2819A71CE600F08B25 /* lua_cocos2dx_ui_manual.hpp in Headers */, 15C1C2D6198749BC00A46ACC /* lua_cocos2dx_deprecated.h in Headers */, 15C1C2D7198749BC00A46ACC /* lua_cocos2dx_experimental_manual.hpp in Headers */, @@ -860,6 +886,7 @@ 15EFA650198B3342000C57D3 /* lualib.h in Headers */, 155C7E1519A71CAA00F08B25 /* Lua_web_socket.h in Headers */, 15EFA64B198B3320000C57D3 /* tolua_event.h in Headers */, + 15A561EF1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.h in Headers */, 15EFA64C198B3320000C57D3 /* tolua++.h in Headers */, 155C7DF919A71C4500F08B25 /* lua_cocos2dx_cocosdenshion_manual.h in Headers */, 15415AB019A71A53004F1E71 /* except.h in Headers */, @@ -900,6 +927,7 @@ 15EFA622198B2E74000C57D3 /* lua_cocos2dx_experimental_auto.hpp in Headers */, 15EFA623198B2E74000C57D3 /* lua_cocos2dx_auto.hpp in Headers */, 155C7E0119A71C6300F08B25 /* CCBProxy.h in Headers */, + 15A561E81B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.hpp in Headers */, 15415AC819A71A53004F1E71 /* select.h in Headers */, 155C7E1D19A71CC300F08B25 /* lua_cocos2dx_spine_manual.hpp in Headers */, 15EFA624198B2E74000C57D3 /* lua_cocos2dx_physics_auto.hpp in Headers */, @@ -984,6 +1012,7 @@ 15B5754F1A6F4D1500041C20 /* lua-cocos-studio-conversions.cpp in Sources */, 15415A7619A718FB004F1E71 /* lua_cocos2dx_ui_auto.cpp in Sources */, 15415A7719A718FB004F1E71 /* lua_cocos2dx_spine_auto.cpp in Sources */, + 15A561E51B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp in Sources */, 15415A7819A718FB004F1E71 /* lua_cocos2dx_studio_auto.cpp in Sources */, 155C7DEC19A71BF200F08B25 /* lua_cocos2dx_cocosdenshion_auto.cpp in Sources */, 15AC69D91987710400D17520 /* tolua_event.c in Sources */, @@ -1035,6 +1064,7 @@ 155C7DF619A71C3E00F08B25 /* lua_cocos2dx_cocosdenshion_manual.cpp in Sources */, 15415AA519A71A53004F1E71 /* auxiliar.c in Sources */, 155C7E1A19A71CBC00F08B25 /* lua_cocos2dx_spine_manual.cpp in Sources */, + 15A561EC1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp in Sources */, 15C1C2D01987498B00A46ACC /* lua_cocos2dx_experimental_manual.cpp in Sources */, 15C1C2D11987498B00A46ACC /* lua_cocos2dx_manual.cpp in Sources */, 15C1C2D21987498B00A46ACC /* lua_cocos2dx_physics_manual.cpp in Sources */, @@ -1052,6 +1082,7 @@ buildActionMask = 2147483647; files = ( 15415AC619A71A53004F1E71 /* select.c in Sources */, + 15A561ED1B00A3F1005D4720 /* lua_cocos2dx_physics3d_manual.cpp in Sources */, 15EFA646198B3311000C57D3 /* tolua_event.c in Sources */, 3E2BDB0A19C5E6100055CDCD /* lua_cocos2dx_audioengine_manual.cpp in Sources */, 15415AA619A71A53004F1E71 /* auxiliar.c in Sources */, @@ -1076,6 +1107,7 @@ 15415AD219A71A53004F1E71 /* timeout.c in Sources */, F4FE0D5819ECD00100B8B12B /* luasocket_scripts.c in Sources */, 15EFA639198B328B000C57D3 /* tolua_fix.cpp in Sources */, + 15A561E61B00A09A005D4720 /* lua_cocos2dx_physics3d_auto.cpp in Sources */, 155C7DFF19A71C5C00F08B25 /* CCBProxy.cpp in Sources */, 1595523B1A25E1C5001E9FC9 /* lua_cocos2dx_csloader_auto.cpp in Sources */, 15C9A1121AE4973400C15443 /* lua_cocos2dx_experimental_webview_manual.cpp in Sources */, @@ -1142,6 +1174,7 @@ "COCOS2D_DEBUG=1", USE_FILE32API, "CC_ENABLE_CHIPMUNK_INTEGRATION=1", + "CC_ENABLE_BULLET_INTEGRATION=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; @@ -1159,7 +1192,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../3d $(SRCROOT)/../../../2d $(SRCROOT)/../../../deprecated $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../ui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua $(SRCROOT)/../../../editor-support/cocostudio/ActionTimeline"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../3d $(SRCROOT)/../../../2d $(SRCROOT)/../../../deprecated $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../ui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua $(SRCROOT)/../../../editor-support/cocostudio/ActionTimeline $(SRCROOT)/../../../physics3d"; }; name = Debug; }; @@ -1176,6 +1209,7 @@ "CC_ENABLE_CHIPMUNK_INTEGRATION=1", NDEBUG, USE_FILE32API, + "CC_ENABLE_BULLET_INTEGRATION=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; @@ -1192,7 +1226,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../3d $(SRCROOT)/../../../2d $(SRCROOT)/../../../deprecated $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../ui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua $(SRCROOT)/../../../editor-support/cocostudio/ActionTimeline"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../3d $(SRCROOT)/../../../2d $(SRCROOT)/../../../deprecated $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../ui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua $(SRCROOT)/../../../editor-support/cocostudio/ActionTimeline $(SRCROOT)/../../../physics3d"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj index 442584f70c..b2999ebed5 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj @@ -41,6 +41,7 @@ + @@ -71,6 +72,7 @@ + @@ -111,6 +113,7 @@ + @@ -141,6 +144,7 @@ + @@ -269,8 +273,8 @@ Disabled - $(EngineRoot);$(EngineRoot)cocos\2d;$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\ui;$(EngineRoot)external;$(EngineRoot)external\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)extensions;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocostudio\ActionTimeline;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual\extension;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocostudio;$(EngineRoot)cocos\scripting\lua-bindings\manual\ui;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocos2d;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(EngineRoot);$(EngineRoot)cocos\2d;$(EngineRoot)cocos\base;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\physics3d;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\ui;$(EngineRoot)external;$(EngineRoot)external\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)extensions;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocostudio\ActionTimeline;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual\extension;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocostudio;$(EngineRoot)cocos\scripting\lua-bindings\manual\ui;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocos2d;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -301,8 +305,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ MinSpace true - $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\lua;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\scripting\lua-bindings\manual\extension;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocostudio;$(EngineRoot)cocos\scripting\lua-bindings\manual\ui;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocos2d;$(EngineRoot)extensions;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocostudio\ActionTimeline;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)cocos\ui;$(EngineRoot)external;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(EngineRoot);$(EngineRoot)cocos\base;$(EngineRoot)cocos;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\lua;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\3d;$(EngineRoot)cocos\scripting\lua-bindings\manual\extension;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocostudio;$(EngineRoot)cocos\scripting\lua-bindings\manual\ui;$(EngineRoot)cocos\scripting\lua-bindings\manual\cocos2d;$(EngineRoot)extensions;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocostudio\ActionTimeline;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\physics3d;$(EngineRoot)external;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters index f0af1a57a2..6c4950e6bc 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters @@ -73,6 +73,9 @@ {08e7d51a-6f8a-4e54-8abe-a86101be8dad} + + {3934b26e-18b0-465a-a89e-69a3417d107e} + @@ -273,6 +276,12 @@ manual\ui + + auto + + + manual\physics3d + @@ -479,6 +488,12 @@ manual\ui + + auto + + + manual\physics3d + diff --git a/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua b/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua index 5ea571a54c..2ec89cbddc 100644 --- a/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua +++ b/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua @@ -558,3 +558,23 @@ function cc.mat4.createRotation(q, dst) return dst end + +function cc.mat4.translate(self,vec3) + return mat4_translate(self,vec3) +end + +function cc.mat4.createRotationZ(self,angle) + return mat4_createRotationZ(self,angle) +end + +function cc.mat4.setIdentity(self) + return mat4_setIdentity(self) +end + +function cc.mat4.createTranslation(...) + return mat4_createTranslation(...) +end + +function cc.mat4.createRotation(...) + return mat4_createRotation(...) +end \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/script/init.lua b/cocos/scripting/lua-bindings/script/init.lua index 956b38420d..92fc120a00 100644 --- a/cocos/scripting/lua-bindings/script/init.lua +++ b/cocos/scripting/lua-bindings/script/init.lua @@ -101,6 +101,9 @@ end -- cocosbuilder require "cocos.cocosbuilder.CCBReaderLoad" +-- physics3d +require "cocos.physics3d.physics3d-constants" + if CC_USE_FRAMEWORK then require "cocos.framework.init" end diff --git a/cocos/scripting/lua-bindings/script/physics3d/physics3d-constants.lua b/cocos/scripting/lua-bindings/script/physics3d/physics3d-constants.lua new file mode 100644 index 0000000000..f33cef98c5 --- /dev/null +++ b/cocos/scripting/lua-bindings/script/physics3d/physics3d-constants.lua @@ -0,0 +1,17 @@ +if nil == cc.Physics3DComponent then + return +end + +cc.Physics3DComponent.PhysicsSyncFlag = +{ + NONE = 0, + NODE_TO_PHYSICS = 1, + PHYSICS_TO_NODE = 2, + NODE_AND_NODE = 3, +} + +cc.Physics3DObject.PhysicsObjType = +{ + UNKNOWN = 0, + RIGID_BODY = 1, +} \ No newline at end of file diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 20b5ac8959..e7fb405dd5 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -20,7 +20,7 @@ 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 "UIScale9Sprite.h" #include "2d/CCSprite.h" @@ -29,31 +29,35 @@ #include "base/CCDirector.h" #include "renderer/CCGLProgram.h" #include "renderer/ccShaders.h" +#include "platform/CCImage.h" +#include "base/CCNinePatchImageParser.h" + NS_CC_BEGIN namespace ui { Scale9Sprite::Scale9Sprite() - : _spritesGenerated(false) - , _spriteFrameRotated(false) - , _positionsAreDirty(true) - , _scale9Image(nullptr) - , _topLeftSprite(nullptr) - , _topSprite(nullptr) - , _topRightSprite(nullptr) - , _leftSprite(nullptr) - , _centerSprite(nullptr) - , _rightSprite(nullptr) - , _bottomLeftSprite(nullptr) - , _bottomSprite(nullptr) - , _bottomRightSprite(nullptr) - , _scale9Enabled(true) - , _insetLeft(0) - , _insetTop(0) - , _insetRight(0) - , _insetBottom(0) - ,_flippedX(false) - ,_flippedY(false) + : _spritesGenerated(false) + , _spriteFrameRotated(false) + , _positionsAreDirty(true) + , _scale9Image(nullptr) + , _topLeftSprite(nullptr) + , _topSprite(nullptr) + , _topRightSprite(nullptr) + , _leftSprite(nullptr) + , _centerSprite(nullptr) + , _rightSprite(nullptr) + , _bottomLeftSprite(nullptr) + , _bottomSprite(nullptr) + , _bottomRightSprite(nullptr) + , _scale9Enabled(true) + , _insetLeft(0) + , _insetTop(0) + , _insetRight(0) + , _insetBottom(0) + ,_flippedX(false) + ,_flippedY(false) + ,_isPatch9(false) { this->setAnchorPoint(Vec2(0.5,0.5)); @@ -65,6 +69,265 @@ namespace ui { CC_SAFE_RELEASE(_scale9Image); } + bool Scale9Sprite::initWithFile(const Rect& capInsets, const std::string& file) + { + bool pReturn = this->initWithFile(file, Rect::ZERO, capInsets); + return pReturn; + } + + bool Scale9Sprite::initWithFile(const std::string& file) + { + bool pReturn = this->initWithFile(file, Rect::ZERO); + return pReturn; + } + bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, + const Rect& capInsets) + { + Texture2D* texture = spriteFrame->getTexture(); + CCASSERT(texture != NULL, "CCTexture must be not nil"); + Sprite *sprite = Sprite::createWithSpriteFrame(spriteFrame); + CCASSERT(sprite != NULL, "sprite must be not nil"); + bool pReturn = this->init(sprite, + spriteFrame->getRect(), + spriteFrame->isRotated(), + spriteFrame->getOffset(), + spriteFrame->getOriginalSize(), + capInsets); + return pReturn; + } + bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) + { + CCASSERT(spriteFrame != NULL, "Invalid spriteFrame for sprite"); + bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO); + return pReturn; + } + bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName, + const Rect& capInsets) + { + CCASSERT((SpriteFrameCache::getInstance()) != NULL, + "SpriteFrameCache::getInstance() must be non-NULL"); + + SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); + CCASSERT(frame != NULL, "CCSpriteFrame must be non-NULL"); + + if (NULL == frame) return false; + bool pReturn = this->initWithSpriteFrame(frame, capInsets); + return pReturn; + } + bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) + { + bool pReturn = this->initWithSpriteFrameName(spriteFrameName, Rect::ZERO); + return pReturn; + } + + bool Scale9Sprite::init() + { + return this->init(NULL, Rect::ZERO, Rect::ZERO); + } + + bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, const Rect& capInsets) + { + return this->init(sprite, rect, false, capInsets); + } + + bool Scale9Sprite::init(Sprite* sprite, + const Rect& rect, + bool rotated, + const Rect& capInsets) + { + return init(sprite, rect, rotated, Vec2::ZERO, rect.size, capInsets); + } + + bool Scale9Sprite::init(Sprite* sprite, + const Rect& rect, + bool rotated, + const Vec2 &offset, + const Size &originalSize, + const Rect& capInsets) + { + if(sprite) + { + auto texture = sprite->getTexture(); + auto spriteFrame = sprite->getSpriteFrame(); + if (texture->isContain9PatchInfo()) + { + auto parsedCapInset = texture->getSpriteFrameCapInset(spriteFrame); + if(!parsedCapInset.equals(Rect::ZERO)) + { + this->_isPatch9 = true; + if(capInsets.equals(Rect::ZERO)) + { + this->_capInsetsInternal = this->_capInsets = parsedCapInset; + } + + } + } + + this->updateWithSprite(sprite, + rect, + rotated, + offset, + originalSize, + capInsets); + } + + return true; + } + + bool Scale9Sprite::initWithBatchNode(cocos2d::SpriteBatchNode *batchnode, + const cocos2d::Rect &rect, + bool rotated, + const cocos2d::Rect &capInsets) + { + Sprite *sprite = Sprite::createWithTexture(batchnode->getTexture()); + return init(sprite, rect, rotated, capInsets); + } + + bool Scale9Sprite::initWithBatchNode(cocos2d::SpriteBatchNode *batchnode, + const cocos2d::Rect &rect, + const cocos2d::Rect &capInsets) + { + auto sprite = Sprite::createWithTexture(batchnode->getTexture()); + return init(sprite, rect, false, capInsets); + } + bool Scale9Sprite::initWithFile(const std::string& file, + const Rect& rect, + const Rect& capInsets) + { + Sprite *sprite = nullptr; + sprite = Sprite::create(file); + bool pReturn = this->init(sprite, rect, capInsets); + return pReturn; + } + + bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect) + { + bool pReturn = this->initWithFile(file, rect, Rect::ZERO); + return pReturn; + } + + Scale9Sprite* Scale9Sprite::create() + { + Scale9Sprite *pReturn = new (std::nothrow) Scale9Sprite(); + if (pReturn && pReturn->init()) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + Scale9Sprite* Scale9Sprite::create(const std::string& file, + const Rect& rect, + const Rect& capInsets) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(file, rect, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + + Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(file, rect) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + + + Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, + const std::string& file) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(capInsets, file) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + + Scale9Sprite* Scale9Sprite::create(const std::string& file) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithFile(file) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + + Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, + const Rect& capInsets) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + + Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName, + const Rect& capInsets) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + return NULL; + } + + Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName) + { + Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); + if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) ) + { + pReturn->autorelease(); + return pReturn; + } + CC_SAFE_DELETE(pReturn); + + log("Could not allocate Scale9Sprite()"); + return NULL; + + } + void Scale9Sprite::cleanupSlicedSprites() { if (_topLeftSprite && _topLeftSprite->isRunning()) @@ -121,42 +384,6 @@ namespace ui { CC_SAFE_RELEASE_NULL(_bottomRightSprite); } - bool Scale9Sprite::init() - { - return this->init(NULL, Rect::ZERO, Rect::ZERO); - } - - bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, const Rect& capInsets) - { - return this->init(sprite, rect, false, capInsets); - } - - bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets) - { - return init(sprite, rect, rotated, Vec2::ZERO, rect.size, capInsets); - } - - bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, bool rotated, const Vec2 &offset, const Size &originalSize, const Rect& capInsets) - { - if(sprite) - { - this->updateWithSprite(sprite, rect, rotated, offset, originalSize, capInsets); - } - - return true; - } - - bool Scale9Sprite::initWithBatchNode(cocos2d::SpriteBatchNode *batchnode, const cocos2d::Rect &rect, bool rotated, const cocos2d::Rect &capInsets) - { - Sprite *sprite = Sprite::createWithTexture(batchnode->getTexture()); - return init(sprite, rect, rotated, capInsets); - } - - bool Scale9Sprite::initWithBatchNode(cocos2d::SpriteBatchNode *batchnode, const cocos2d::Rect &rect, const cocos2d::Rect &capInsets) - { - auto sprite = Sprite::createWithTexture(batchnode->getTexture()); - return init(sprite, rect, false, capInsets); - } void Scale9Sprite::setBlendFunc(const BlendFunc &blendFunc) { @@ -208,13 +435,24 @@ namespace ui { _bottomRightSprite->setBlendFunc(_blendFunc); } - bool Scale9Sprite::updateWithBatchNode(cocos2d::SpriteBatchNode *batchnode, const cocos2d::Rect &originalRect, bool rotated, const cocos2d::Rect &capInsets) + bool Scale9Sprite::updateWithBatchNode(cocos2d::SpriteBatchNode *batchnode, + const cocos2d::Rect &originalRect, + bool rotated, + const cocos2d::Rect &capInsets) { Sprite *sprite = Sprite::createWithTexture(batchnode->getTexture()); - return this->updateWithSprite(sprite, originalRect, rotated, Vec2::ZERO, originalRect.size, capInsets); + return this->updateWithSprite(sprite, + originalRect, + rotated, + Vec2::ZERO, + originalRect.size, + capInsets); } - bool Scale9Sprite::updateWithSprite(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets) + bool Scale9Sprite::updateWithSprite(Sprite* sprite, + const Rect& rect, + bool rotated, + const Rect& capInsets) { return updateWithSprite(sprite, rect, rotated, Vec2::ZERO, rect.size, capInsets); } @@ -225,15 +463,22 @@ namespace ui { ret.origin.x = std::max(first.origin.x,second.origin.x); ret.origin.y = std::max(first.origin.y,second.origin.y); - float rightRealPoint = std::min(first.origin.x + first.size.width, second.origin.x + second.size.width); - float bottomRealPoint = std::min(first.origin.y + first.size.height, second.origin.y + second.size.height); + float rightRealPoint = std::min(first.origin.x + first.size.width, + second.origin.x + second.size.width); + float bottomRealPoint = std::min(first.origin.y + first.size.height, + second.origin.y + second.size.height); ret.size.width = std::max(rightRealPoint - ret.origin.x, 0.0f); ret.size.height = std::max(bottomRealPoint - ret.origin.y, 0.0f); return ret; } - bool Scale9Sprite::updateWithSprite(Sprite* sprite, const Rect& textureRect, bool rotated, const Vec2 &offset, const Size &originalSize, const Rect& capInsets) + bool Scale9Sprite::updateWithSprite(Sprite* sprite, + const Rect& textureRect, + bool rotated, + const Vec2 &offset, + const Size &originalSize, + const Rect& capInsets) { GLubyte opacity = getOpacity(); Color3B color = getColor(); @@ -277,7 +522,8 @@ namespace ui { Rect rect(textureRect); Size size(originalSize); - _capInsets = capInsets; + if(_capInsets.equals(Rect::ZERO)) + _capInsets = capInsets; // If there is no given rect if ( rect.equals(Rect::ZERO) ) @@ -299,7 +545,10 @@ namespace ui { _spriteFrameRotated = rotated; _originalSize = size; _preferredSize = size; - _capInsetsInternal = capInsets; + if(!capInsets.equals(Rect::ZERO)) + { + _capInsetsInternal = capInsets; + } if (_scale9Enabled) { @@ -307,7 +556,11 @@ namespace ui { } applyBlendFunc(); - + if(this->_isPatch9) + { + size.width = size.width - 2; + size.height = size.height - 2; + } this->setContentSize(size); if (_spritesGenerated) @@ -327,7 +580,7 @@ namespace ui { float height = _originalSize.height; Vec2 offsetPosition(ceilf(_offset.x + (_originalSize.width - _spriteRect.size.width) / 2), - ceilf(_offset.y + (_originalSize.height - _spriteRect.size.height) / 2)); + ceilf(_offset.y + (_originalSize.height - _spriteRect.size.height) / 2)); // If there is no specified center region if ( _capInsetsInternal.equals(Rect::ZERO) ) @@ -336,11 +589,15 @@ namespace ui { _capInsetsInternal = Rect(width /3, height /3, width /3, height /3); } - Rect originalRect; + Rect originalRect=_spriteRect; if(_spriteFrameRotated) - originalRect = Rect(_spriteRect.origin.x - offsetPosition.y, _spriteRect.origin.y - offsetPosition.x, _originalSize.width, _originalSize.height); + originalRect = Rect(_spriteRect.origin.x - offsetPosition.y, + _spriteRect.origin.y - offsetPosition.x, + _originalSize.width, _originalSize.height); else - originalRect = Rect(_spriteRect.origin.x - offsetPosition.x, _spriteRect.origin.y - offsetPosition.y, _originalSize.width, _originalSize.height); + originalRect = Rect(_spriteRect.origin.x - offsetPosition.x, + _spriteRect.origin.y - offsetPosition.y, + _originalSize.width, _originalSize.height); float leftWidth = _capInsetsInternal.origin.x; float centerWidth = _capInsetsInternal.size.width; @@ -355,8 +612,9 @@ namespace ui { // ... top row float x = 0.0; float y = 0.0; - - Rect pixelRect = Rect(offsetPosition.x, offsetPosition.y, _spriteRect.size.width, _spriteRect.size.height); + //why do we need pixelRect? + Rect pixelRect = Rect(offsetPosition.x, offsetPosition.y, + _spriteRect.size.width, _spriteRect.size.height); // top left Rect leftTopBoundsOriginal = Rect(x, y, leftWidth, topHeight); @@ -407,7 +665,7 @@ namespace ui { if((_capInsetsInternal.origin.x + _capInsetsInternal.size.width) <= _originalSize.width || (_capInsetsInternal.origin.y + _capInsetsInternal.size.height) <= _originalSize.height) - //in general case it is error but for legacy support we will check it + //in general case it is error but for legacy support we will check it { leftTopBounds = intersectRect(leftTopBounds, pixelRect); centerTopBounds = intersectRect(centerTopBounds, pixelRect); @@ -458,7 +716,9 @@ namespace ui { rotatedCenterTopBounds = RectApplyAffineTransform(rotatedCenterTopBounds, t); - } else { + } + else + { // set up transformation of coordinates // to handle the case where the sprite is stored rotated // in the spritesheet @@ -503,26 +763,103 @@ namespace ui { _topLeftSize = rotatedLeftTopBoundsOriginal.size; _centerSize = rotatedCenterBoundsOriginal.size; _bottomRightSize = rotatedRightBottomBoundsOriginal.size; + if(_isPatch9) + { + _topLeftSize.width = _topLeftSize.width - 1; + _topLeftSize.height = _topLeftSize.height - 1; + _bottomRightSize.width = _bottomRightSize.width - 1; + _bottomRightSize.height = _bottomRightSize.height - 1; + } if(_spriteFrameRotated) { - float offsetX = (rotatedCenterBounds.origin.x + rotatedCenterBounds.size.height/2) - (rotatedCenterBoundsOriginal.origin.x + rotatedCenterBoundsOriginal.size.height/2); - float offsetY = (rotatedCenterBoundsOriginal.origin.y + rotatedCenterBoundsOriginal.size.width/2)- (rotatedCenterBounds.origin.y + rotatedCenterBounds.size.width/2); + float offsetX = (rotatedCenterBounds.origin.x + rotatedCenterBounds.size.height/2) + - (rotatedCenterBoundsOriginal.origin.x + rotatedCenterBoundsOriginal.size.height/2); + float offsetY = (rotatedCenterBoundsOriginal.origin.y + rotatedCenterBoundsOriginal.size.width/2) + - (rotatedCenterBounds.origin.y + rotatedCenterBounds.size.width/2); _centerOffset.x = -offsetY; _centerOffset.y = offsetX; } else { - float offsetX = (rotatedCenterBounds.origin.x + rotatedCenterBounds.size.width/2) - (rotatedCenterBoundsOriginal.origin.x + rotatedCenterBoundsOriginal.size.width/2); - float offsetY = (rotatedCenterBoundsOriginal.origin.y + rotatedCenterBoundsOriginal.size.height/2)- (rotatedCenterBounds.origin.y + rotatedCenterBounds.size.height/2); + float offsetX = (rotatedCenterBounds.origin.x + rotatedCenterBounds.size.width/2) + - (rotatedCenterBoundsOriginal.origin.x + rotatedCenterBoundsOriginal.size.width/2); + float offsetY = (rotatedCenterBoundsOriginal.origin.y + rotatedCenterBoundsOriginal.size.height/2) + - (rotatedCenterBounds.origin.y + rotatedCenterBounds.size.height/2); _centerOffset.x = offsetX; _centerOffset.y = offsetY; } + //shrink the image size when it is 9-patch + if(_isPatch9) + { + float offset = 1.4; + //Top left + if(!_spriteFrameRotated) + { + rotatedLeftTopBounds.origin.x+=offset; + rotatedLeftTopBounds.origin.y+=offset; + rotatedLeftTopBounds.size.width-=offset; + rotatedLeftTopBounds.size.height-=offset; + //Center left + rotatedLeftCenterBounds.origin.x+=offset; + rotatedLeftCenterBounds.size.width-=offset; + //Bottom left + rotatedLeftBottomBounds.origin.x+=offset; + rotatedLeftBottomBounds.size.width-=offset; + rotatedLeftBottomBounds.size.height-=offset; + //Top center + rotatedCenterTopBounds.size.height-=offset; + rotatedCenterTopBounds.origin.y+=offset; + //Bottom center + rotatedCenterBottomBounds.size.height-=offset; + //Top right + rotatedRightTopBounds.size.width-=offset; + rotatedRightTopBounds.size.height-=offset; + rotatedRightTopBounds.origin.y+=offset; + //Center right + rotatedRightCenterBounds.size.width-=offset; + //Bottom right + rotatedRightBottomBounds.size.width-=offset; + rotatedRightBottomBounds.size.height-=offset; + } + else + { + //Top left + rotatedLeftTopBounds.size.width-=offset; + rotatedLeftTopBounds.size.height-=offset; + rotatedLeftTopBounds.origin.y+=offset; + //Center left + rotatedLeftCenterBounds.origin.y+=offset; + rotatedLeftCenterBounds.size.width-=offset; + //Bottom left + rotatedLeftBottomBounds.origin.x+=offset; + rotatedLeftBottomBounds.origin.y+=offset; + rotatedLeftBottomBounds.size.width-=offset; + rotatedLeftBottomBounds.size.height-=offset; + //Top center + rotatedCenterTopBounds.size.height-=offset; + //Bottom center + rotatedCenterBottomBounds.size.height-=offset; + rotatedCenterBottomBounds.origin.x+=offset; + //Top right + rotatedRightTopBounds.size.width-=offset; + rotatedRightTopBounds.size.height-=offset; + //Center right + rotatedRightCenterBounds.size.width-=offset; + //Bottom right + rotatedRightBottomBounds.size.width-=offset; + rotatedRightBottomBounds.size.height-=offset; + rotatedRightBottomBounds.origin.x+=offset; + } + } + // Centre if(rotatedCenterBounds.size.width > 0 && rotatedCenterBounds.size.height > 0 ) { - _centerSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedCenterBounds, _spriteFrameRotated); + _centerSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedCenterBounds, + _spriteFrameRotated); _centerSprite->retain(); this->addProtectedChild(_centerSprite); } @@ -530,7 +867,9 @@ namespace ui { // Top if(rotatedCenterTopBounds.size.width > 0 && rotatedCenterTopBounds.size.height > 0 ) { - _topSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedCenterTopBounds, _spriteFrameRotated); + _topSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedCenterTopBounds, + _spriteFrameRotated); _topSprite->retain(); this->addProtectedChild(_topSprite); } @@ -538,7 +877,9 @@ namespace ui { // Bottom if(rotatedCenterBottomBounds.size.width > 0 && rotatedCenterBottomBounds.size.height > 0 ) { - _bottomSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedCenterBottomBounds, _spriteFrameRotated); + _bottomSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedCenterBottomBounds, + _spriteFrameRotated); _bottomSprite->retain(); this->addProtectedChild(_bottomSprite); } @@ -546,7 +887,9 @@ namespace ui { // Left if(rotatedLeftCenterBounds.size.width > 0 && rotatedLeftCenterBounds.size.height > 0 ) { - _leftSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedLeftCenterBounds, _spriteFrameRotated); + _leftSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedLeftCenterBounds, + _spriteFrameRotated); _leftSprite->retain(); this->addProtectedChild(_leftSprite); } @@ -554,7 +897,9 @@ namespace ui { // Right if(rotatedRightCenterBounds.size.width > 0 && rotatedRightCenterBounds.size.height > 0 ) { - _rightSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedRightCenterBounds, _spriteFrameRotated); + _rightSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedRightCenterBounds, + _spriteFrameRotated); _rightSprite->retain(); this->addProtectedChild(_rightSprite); } @@ -562,7 +907,9 @@ namespace ui { // Top left if(rotatedLeftTopBounds.size.width > 0 && rotatedLeftTopBounds.size.height > 0 ) { - _topLeftSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedLeftTopBounds, _spriteFrameRotated); + _topLeftSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedLeftTopBounds, + _spriteFrameRotated); _topLeftSprite->retain(); this->addProtectedChild(_topLeftSprite); } @@ -570,7 +917,9 @@ namespace ui { // Top right if(rotatedRightTopBounds.size.width > 0 && rotatedRightTopBounds.size.height > 0 ) { - _topRightSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedRightTopBounds, _spriteFrameRotated); + _topRightSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedRightTopBounds, + _spriteFrameRotated); _topRightSprite->retain(); this->addProtectedChild(_topRightSprite); } @@ -578,7 +927,9 @@ namespace ui { // Bottom left if(rotatedLeftBottomBounds.size.width > 0 && rotatedLeftBottomBounds.size.height > 0 ) { - _bottomLeftSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedLeftBottomBounds, _spriteFrameRotated); + _bottomLeftSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedLeftBottomBounds, + _spriteFrameRotated); _bottomLeftSprite->retain(); this->addProtectedChild(_bottomLeftSprite); } @@ -586,7 +937,9 @@ namespace ui { // Bottom right if(rotatedRightBottomBounds.size.width > 0 && rotatedRightBottomBounds.size.height > 0 ) { - _bottomRightSprite = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedRightBottomBounds, _spriteFrameRotated); + _bottomRightSprite = Sprite::createWithTexture(_scale9Image->getTexture(), + rotatedRightBottomBounds, + _spriteFrameRotated); _bottomRightSprite->retain(); this->addProtectedChild(_bottomRightSprite); } @@ -673,179 +1026,24 @@ namespace ui { if(_centerSprite) { _centerSprite->setAnchorPoint(Vec2(0.5,0.5)); - _centerSprite->setPosition(leftWidth+rescaledWidth/2 + centerOffset.x, bottomHeight+rescaledHeight/2 + centerOffset.y); + _centerSprite->setPosition(leftWidth+rescaledWidth/2 + centerOffset.x, + bottomHeight+rescaledHeight/2 + centerOffset.y); _centerSprite->setScaleX(horizontalScale); _centerSprite->setScaleY(verticalScale); } } - bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect, const Rect& capInsets) - { - Sprite *sprite = Sprite::create(file); - bool pReturn = this->init(sprite, rect, capInsets); - return pReturn; - } - Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect, const Rect& capInsets) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(file, rect, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - - bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect) - { - bool pReturn = this->initWithFile(file, rect, Rect::ZERO); - return pReturn; - } - - Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(file, rect) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - - - bool Scale9Sprite::initWithFile(const Rect& capInsets, const std::string& file) - { - bool pReturn = this->initWithFile(file, Rect::ZERO, capInsets); - return pReturn; - } - - Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& file) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(capInsets, file) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - - bool Scale9Sprite::initWithFile(const std::string& file) - { - bool pReturn = this->initWithFile(file, Rect::ZERO); - return pReturn; - - } - - Scale9Sprite* Scale9Sprite::create(const std::string& file) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(file) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - - bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) - { - Texture2D* texture = spriteFrame->getTexture(); - CCASSERT(texture != NULL, "CCTexture must be not nil"); - - Sprite *sprite = Sprite::createWithSpriteFrame(spriteFrame); - CCASSERT(sprite != NULL, "sprite must be not nil"); - - bool pReturn = this->init(sprite, spriteFrame->getRect(), spriteFrame->isRotated(), spriteFrame->getOffset(), spriteFrame->getOriginalSize(), capInsets); - return pReturn; - } - - Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) - { - CCASSERT(spriteFrame != NULL, "Invalid spriteFrame for sprite"); - bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO); - return pReturn; - } - - Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - - bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) - { - CCASSERT((SpriteFrameCache::getInstance()) != NULL, "SpriteFrameCache::getInstance() must be non-NULL"); - - SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); - CCASSERT(frame != NULL, "CCSpriteFrame must be non-NULL"); - - if (NULL == frame) return false; - - bool pReturn = this->initWithSpriteFrame(frame, capInsets); - return pReturn; - } - - Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } - - bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) - { - bool pReturn = this->initWithSpriteFrameName(spriteFrameName, Rect::ZERO); - return pReturn; - } - - Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName) - { - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - - log("Could not allocate Scale9Sprite()"); - return NULL; - - } Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) const { Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->init(_scale9Image, _spriteRect, _spriteFrameRotated, _offset, _originalSize, _capInsets) ) + if ( pReturn && pReturn->init(_scale9Image, + _spriteRect, + _spriteFrameRotated, + _offset, + _originalSize, + _capInsets) ) { pReturn->autorelease(); return pReturn; @@ -854,34 +1052,23 @@ namespace ui { return NULL; } - Scale9Sprite* Scale9Sprite::create() - { - Scale9Sprite *pReturn = new (std::nothrow) Scale9Sprite(); - if (pReturn && pReturn->init()) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return NULL; - } void Scale9Sprite::setState(cocos2d::ui::Scale9Sprite::State state) { GLProgramState *glState = nullptr; switch (state) { - case State::NORMAL: - { - glState = GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP); - } - break; - case State::GRAY: - { - glState = GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_GRAYSCALE); - } - default: - break; + case State::NORMAL: + { + glState = GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP); + } + break; + case State::GRAY: + { + glState = GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_GRAYSCALE); + } + default: + break; } if (nullptr != _scale9Image) @@ -898,10 +1085,10 @@ namespace ui { } } - /** sets the opacity. - @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. - Values goes from 0 to 255, where 255 means fully opaque. - */ +/** sets the opacity. + @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. + Values goes from 0 to 255, where 255 means fully opaque. +*/ @@ -926,7 +1113,12 @@ namespace ui { void Scale9Sprite::setSpriteFrame(SpriteFrame * spriteFrame, const Rect& capInsets) { Sprite * sprite = Sprite::createWithTexture(spriteFrame->getTexture()); - this->updateWithSprite(sprite, spriteFrame->getRect(), spriteFrame->isRotated(), spriteFrame->getOffset(), spriteFrame->getOriginalSize(), capInsets); + this->updateWithSprite(sprite, + spriteFrame->getRect(), + spriteFrame->isRotated(), + spriteFrame->getOffset(), + spriteFrame->getOriginalSize(), + capInsets); // Reset insets this->_insetLeft = capInsets.origin.x; @@ -945,7 +1137,12 @@ namespace ui { void Scale9Sprite::setCapInsets(const Rect& capInsets) { Size contentSize = this->_contentSize; - this->updateWithSprite(this->_scale9Image, _spriteRect, _spriteFrameRotated, _offset, _originalSize, capInsets); + this->updateWithSprite(this->_scale9Image, + _spriteRect, + _spriteFrameRotated, + _offset, + _originalSize, + capInsets); this->_insetLeft = capInsets.origin.x; this->_insetTop = capInsets.origin.y; this->_insetRight = _originalSize.width - _insetLeft - capInsets.size.width; @@ -1125,7 +1322,12 @@ namespace ui { { if (_scale9Image) { - this->updateWithSprite(this->_scale9Image, _spriteRect, _spriteFrameRotated, _offset, _originalSize, _capInsets); + this->updateWithSprite(this->_scale9Image, + _spriteRect, + _spriteFrameRotated, + _offset, + _originalSize, + _capInsets); } } _positionsAreDirty = true; @@ -1152,7 +1354,9 @@ namespace ui { } if( _reorderProtectedChildDirty ) { - std::sort( std::begin(_protectedChildren), std::end(_protectedChildren), nodeComparisonLess ); + std::sort( std::begin(_protectedChildren), + std::end(_protectedChildren), + nodeComparisonLess ); _reorderProtectedChildDirty = false; } } @@ -1162,7 +1366,7 @@ namespace ui { if (_scale9Image) { _scale9Image->setPosition(_contentSize.width * _scale9Image->getAnchorPoint().x, - _contentSize.height * _scale9Image->getAnchorPoint().y); + _contentSize.height * _scale9Image->getAnchorPoint().y); } } @@ -1382,7 +1586,8 @@ namespace ui { float Scale9Sprite::getScale()const { - CCASSERT(this->getScaleX() == this->getScaleY(), "Scale9Sprite#scale. ScaleX != ScaleY. Don't know which one to return"); + CCASSERT(this->getScaleX() == this->getScaleY(), + "Scale9Sprite#scale. ScaleX != ScaleY. Don't know which one to return"); return this->getScaleX(); } diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 1a90a725cd..076f241281 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -742,6 +742,7 @@ namespace ui { bool _flippedX; bool _flippedY; + bool _isPatch9; }; }} //end of namespace diff --git a/cocos/ui/UIText.cpp b/cocos/ui/UIText.cpp index 9e3a1f85d2..45176ba7c7 100644 --- a/cocos/ui/UIText.cpp +++ b/cocos/ui/UIText.cpp @@ -385,6 +385,7 @@ void Text::copySpecialProperties(Widget *widget) { setFontName(label->_fontName); setFontSize(label->getFontSize()); + setTextColor(label->getTextColor()); setString(label->getString()); setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled); setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment()); diff --git a/extensions/Particle3D/CCParticle3DRender.cpp b/extensions/Particle3D/CCParticle3DRender.cpp index 0c46554e0b..14ca60de3f 100755 --- a/extensions/Particle3D/CCParticle3DRender.cpp +++ b/extensions/Particle3D/CCParticle3DRender.cpp @@ -44,8 +44,8 @@ Particle3DQuadRender::Particle3DQuadRender() , _indexBuffer(nullptr) , _vertexBuffer(nullptr) { - } + Particle3DQuadRender::~Particle3DQuadRender() { CC_SAFE_DELETE(_meshCommand); @@ -159,7 +159,19 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4 &transform, Par GLuint texId = (_texture ? _texture->getName() : 0); float depthZ = -(viewMat.m[2] * transform.m[12] + viewMat.m[6] * transform.m[13] + viewMat.m[10] * transform.m[14] + viewMat.m[14]); - _meshCommand->init(depthZ, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, index, transform, 0); + + _meshCommand->init( + depthZ, + texId, + _glProgramState, + _stateBlock, + _vertexBuffer->getVBO(), + _indexBuffer->getVBO(), + GL_TRIANGLES, + GL_UNSIGNED_SHORT, + index, + transform, + 0); _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); renderer->addCommand(_meshCommand); } @@ -192,26 +204,15 @@ bool Particle3DQuadRender::initQuadRender( const std::string& texFile ) //ret->_indexBuffer->retain(); _meshCommand = new (std::nothrow) MeshCommand(); + _meshCommand->setSkipBatching(true); _meshCommand->setTransparent(true); - _meshCommand->setDepthTestEnabled(_depthTest); - _meshCommand->setDepthWriteEnabled(_depthWrite); - _meshCommand->setCullFace(GL_BACK); - _meshCommand->setCullFaceEnabled(true); + _stateBlock->setDepthTest(_depthTest); + _stateBlock->setDepthWrite(_depthWrite); + _stateBlock->setCullFace(true); + _stateBlock->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK); return true; } -void Particle3DQuadRender::setDepthTest( bool isDepthTest ) -{ - Particle3DRender::setDepthTest(isDepthTest); - _meshCommand->setDepthTestEnabled(_depthTest); -} - -void Particle3DQuadRender::setDepthWrite( bool isDepthWrite ) -{ - Particle3DRender::setDepthWrite(isDepthWrite); - _meshCommand->setDepthWriteEnabled(_depthWrite); -} - ////////////////////////////////////////////////////////////////////////////// Particle3DModelRender::Particle3DModelRender() : _spriteSize(Vec3::ONE) @@ -283,6 +284,41 @@ void Particle3DModelRender::render(Renderer* renderer, const Mat4 &transform, Pa } } +// MARK: Particle3DRender + +Particle3DRender::Particle3DRender() +: _particleSystem(nullptr) +, _isVisible(true) +, _rendererScale(Vec3::ONE) +, _depthTest(true) +, _depthWrite(false) +{ + _stateBlock = RenderState::StateBlock::create(); + _stateBlock->retain(); + + _stateBlock->setCullFace(false); + _stateBlock->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK); + _stateBlock->setDepthTest(false); + _stateBlock->setDepthWrite(false); + _stateBlock->setBlend(true); +}; + +Particle3DRender::~Particle3DRender() +{ + _stateBlock->release(); +} + +void Particle3DRender::copyAttributesTo (Particle3DRender *render) +{ + CC_SAFE_RELEASE(render->_stateBlock); + render->_stateBlock = _stateBlock; + CC_SAFE_RETAIN(render->_stateBlock); + + render->_isVisible = _isVisible; + render->_rendererScale = _rendererScale; + render->_depthTest = _depthTest; + render->_depthWrite = _depthWrite; +} void Particle3DRender::notifyStart() { @@ -299,4 +335,21 @@ void Particle3DRender::notifyRescaled( const Vec3& scale ) _rendererScale = scale; } +void Particle3DRender::setDepthTest( bool isDepthTest ) +{ + _depthTest = isDepthTest; + _stateBlock->setDepthTest(_depthTest); +} + +void Particle3DRender::setDepthWrite( bool isDepthWrite ) +{ + _depthWrite = isDepthWrite; + _stateBlock->setDepthWrite(_depthWrite); +} + +void Particle3DRender::setBlendFunc(const BlendFunc &blendFunc) +{ + _stateBlock->setBlendFunc(blendFunc); +} + NS_CC_END diff --git a/extensions/Particle3D/CCParticle3DRender.h b/extensions/Particle3D/CCParticle3DRender.h index eee9904700..e2cf465222 100644 --- a/extensions/Particle3D/CCParticle3DRender.h +++ b/extensions/Particle3D/CCParticle3DRender.h @@ -25,9 +25,12 @@ #ifndef __CC_PARTICLE_3D_RENDER_H__ #define __CC_PARTICLE_3D_RENDER_H__ +#include + +#include "renderer/CCRenderState.h" #include "base/CCRef.h" #include "math/CCMath.h" -#include + NS_CC_BEGIN @@ -64,21 +67,19 @@ public: bool isVisible() const { return _isVisible; } - virtual void setDepthTest(bool isDepthTest) { _depthTest = isDepthTest; } - virtual void setDepthWrite(bool isDepthWrite) {_depthWrite = isDepthWrite; } - + void setDepthTest(bool isDepthTest); + void setDepthWrite(bool isDepthWrite); + void setBlendFunc(const BlendFunc& blendFunc); + + void copyAttributesTo (Particle3DRender *render); + CC_CONSTRUCTOR_ACCESS: - Particle3DRender() - : _particleSystem(nullptr) - , _isVisible(true) - , _rendererScale(Vec3::ONE) - , _depthTest(true) - , _depthWrite(false) - {}; - virtual ~Particle3DRender(){}; + Particle3DRender(); + virtual ~Particle3DRender(); protected: ParticleSystem3D *_particleSystem; + RenderState::StateBlock* _stateBlock; bool _isVisible; Vec3 _rendererScale; bool _depthTest; @@ -93,9 +94,6 @@ public: virtual void render(Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem) override; - virtual void setDepthTest(bool isDepthTest) override; - virtual void setDepthWrite(bool isDepthWrite) override; - CC_CONSTRUCTOR_ACCESS: Particle3DQuadRender(); virtual ~Particle3DQuadRender(); @@ -105,7 +103,7 @@ protected: bool initQuadRender(const std::string& texFile); protected: - MeshCommand* _meshCommand; + MeshCommand* _meshCommand; Texture2D* _texture; GLProgramState* _glProgramState; IndexBuffer* _indexBuffer; //index buffer diff --git a/extensions/Particle3D/PU/CCPUBeamRender.cpp b/extensions/Particle3D/PU/CCPUBeamRender.cpp index 193835162f..c00afcf3fb 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.cpp +++ b/extensions/Particle3D/PU/CCPUBeamRender.cpp @@ -357,10 +357,9 @@ PUBeamRender* PUBeamRender::clone() return br; } -void PUBeamRender::copyAttributesTo( PURender *render ) +void PUBeamRender::copyAttributesTo(PUBeamRender *beamRender) { - PURender::copyAttributesTo(render); - PUBeamRender *beamRender = static_cast(render); + PURender::copyAttributesTo(beamRender); beamRender->setUseVertexColours(_useVertexColours); beamRender->setMaxChainElements(_maxChainElements); beamRender->setUpdateInterval(_updateInterval); diff --git a/extensions/Particle3D/PU/CCPUBeamRender.h b/extensions/Particle3D/PU/CCPUBeamRender.h index 8c17e45985..fa3556ed1c 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.h +++ b/extensions/Particle3D/PU/CCPUBeamRender.h @@ -127,7 +127,7 @@ public: void destroyAll(void); virtual PUBeamRender* clone() override; - virtual void copyAttributesTo (PURender *render) override; + void copyAttributesTo(PUBeamRender *render); CC_CONSTRUCTOR_ACCESS: PUBeamRender(); diff --git a/extensions/Particle3D/PU/CCPUBillboardChain.cpp b/extensions/Particle3D/PU/CCPUBillboardChain.cpp index 260df910c0..0009830a65 100644 --- a/extensions/Particle3D/PU/CCPUBillboardChain.cpp +++ b/extensions/Particle3D/PU/CCPUBillboardChain.cpp @@ -79,6 +79,15 @@ PUBillboardChain::PUBillboardChain(const std::string& name, const std::string &t _vertexBuffer(nullptr) { + _stateBlock = RenderState::StateBlock::create(); + CC_SAFE_RETAIN(_stateBlock); + + _stateBlock->setCullFace(false); + _stateBlock->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK); + _stateBlock->setDepthTest(false); + _stateBlock->setDepthWrite(false); + _stateBlock->setBlend(true); + _otherTexCoordRange[0] = 0.0f; _otherTexCoordRange[1] = 1.0f; @@ -90,6 +99,7 @@ PUBillboardChain::PUBillboardChain(const std::string& name, const std::string &t PUBillboardChain::~PUBillboardChain() { CC_SAFE_DELETE(_meshCommand); + CC_SAFE_RELEASE(_stateBlock); //CC_SAFE_RELEASE(_texture); CC_SAFE_RELEASE(_glProgramState); CC_SAFE_RELEASE(_vertexBuffer); @@ -666,11 +676,12 @@ void PUBillboardChain::init( const std::string &texFile ) _glProgramState = glProgramState; _meshCommand = new (std::nothrow) MeshCommand(); + _meshCommand->setSkipBatching(true); _meshCommand->setTransparent(true); - _meshCommand->setDepthTestEnabled(true); - _meshCommand->setDepthWriteEnabled(false); - _meshCommand->setCullFace(GL_BACK); - _meshCommand->setCullFaceEnabled(true); + _stateBlock->setDepthTest(true); + _stateBlock->setDepthWrite(false); + _stateBlock->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK); + _stateBlock->setCullFace(true); } void PUBillboardChain::render( Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem ) @@ -678,14 +689,28 @@ void PUBillboardChain::render( Renderer* renderer, const Mat4 &transform, Partic auto camera = Camera::getVisitingCamera(); auto cameraMat = camera->getNodeToWorldTransform(); - if (!_chainSegmentList.empty()){ + if (!_chainSegmentList.empty()) + { updateVertexBuffer(cameraMat); updateIndexBuffer(); - if (!_vertices.empty() && !_indices.empty()){ + if (!_vertices.empty() && !_indices.empty()) + { GLuint texId = (_texture ? _texture->getName() : 0); - _meshCommand->init(0, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, _indices.size(), transform, Node::FLAGS_RENDER_AS_3D); - _meshCommand->setTransparent(true); - _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); + _stateBlock->setBlendFunc(particleSystem->getBlendFunc()); + _meshCommand->init(0, + texId, + _glProgramState, + _stateBlock, + _vertexBuffer->getVBO(), + _indexBuffer->getVBO(), + GL_TRIANGLES, + GL_UNSIGNED_SHORT, + _indices.size(), + transform, + Node::FLAGS_RENDER_AS_3D); + _meshCommand->setSkipBatching(true); + _meshCommand->setTransparent(true); + _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); renderer->addCommand(_meshCommand); } } @@ -693,12 +718,17 @@ void PUBillboardChain::render( Renderer* renderer, const Mat4 &transform, Partic void PUBillboardChain::setDepthTest( bool isDepthTest ) { - _meshCommand->setDepthTestEnabled(isDepthTest); + _stateBlock->setDepthTest(isDepthTest); } void PUBillboardChain::setDepthWrite( bool isDepthWrite ) { - _meshCommand->setDepthWriteEnabled(isDepthWrite); + _stateBlock->setDepthWrite(isDepthWrite); +} + +void PUBillboardChain::setBlendFunc(const BlendFunc& blendFunc) +{ + _stateBlock->setBlendFunc(blendFunc); } //----------------------------------------------------------------------- diff --git a/extensions/Particle3D/PU/CCPUBillboardChain.h b/extensions/Particle3D/PU/CCPUBillboardChain.h index 6111263a6d..1fd9295f8a 100644 --- a/extensions/Particle3D/PU/CCPUBillboardChain.h +++ b/extensions/Particle3D/PU/CCPUBillboardChain.h @@ -26,9 +26,11 @@ #ifndef __CC_PU_PARTICLE_3D_BILLBOARD_CHAIN_H__ #define __CC_PU_PARTICLE_3D_BILLBOARD_CHAIN_H__ +#include +#include "renderer/CCRenderState.h" #include "base/CCRef.h" #include "math/CCMath.h" -#include + NS_CC_BEGIN @@ -54,11 +56,11 @@ public: Element(); - Element(const Vec3 &position, + Element(const Vec3& position, float width, float texCoord, - const Vec4 &colour, - const Quaternion &orientation); + const Vec4& colour, + const Quaternion& orientation); Vec3 position; float width; @@ -79,7 +81,7 @@ public: @param useVertexColours If true, use vertex colours from the chain elements @param dynamic If true, buffers are created with the intention of being updated */ - PUBillboardChain(const std::string& name, const std::string &texFile = "", size_t maxElements = 20, size_t numberOfChains = 1, + PUBillboardChain(const std::string& name, const std::string& texFile = "", size_t maxElements = 20, size_t numberOfChains = 1, bool useTextureCoords = true, bool useColours = true, bool dynamic = true); /// destructor virtual ~PUBillboardChain(); @@ -217,18 +219,19 @@ public: matrix, the segment corresponding to that point will be facing towards UNIT_Z This vector is internally normalized. */ - void setFaceCamera( bool faceCamera, const Vec3 &normalVector=Vec3::UNIT_X ); + void setFaceCamera( bool faceCamera, const Vec3& normalVector=Vec3::UNIT_X ); - virtual void setDepthTest(bool isDepthTest); - virtual void setDepthWrite(bool isDepthWrite); + void setDepthTest(bool isDepthTest); + void setDepthWrite(bool isDepthWrite); + void setBlendFunc(const BlendFunc& blendFunc); - void render(Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem); + void render(Renderer* renderer, const Mat4& transform, ParticleSystem3D* particleSystem); // Overridden members follow - //void _updateRenderQueue(RenderQueue *); - //void getRenderOperation(RenderOperation &); + //void _updateRenderQueue(RenderQueue*); + //void getRenderOperation(RenderOperation&); //virtual bool preRender(SceneManager* sm, RenderSystem* rsys); - //void getWorldTransforms(Matrix4 *) const; + //void getWorldTransforms(Matrix4*) const; /// @copydoc MovableObject::visitRenderables protected: @@ -240,11 +243,11 @@ protected: // Setup buffers virtual void setupBuffers(void); /// Update the contents of the vertex buffer - virtual void updateVertexBuffer(const Mat4 &camMat); + virtual void updateVertexBuffer(const Mat4& camMat); /// Update the contents of the index buffer virtual void updateIndexBuffer(void); - void init(const std::string &texFile); + void init(const std::string& texFile); protected: @@ -312,11 +315,12 @@ protected: Vec2 uv; Vec4 color; }; - MeshCommand* _meshCommand; - Texture2D* _texture; - GLProgramState* _glProgramState; - IndexBuffer* _indexBuffer; //index buffer - VertexBuffer* _vertexBuffer; // vertex buffer + MeshCommand* _meshCommand; + RenderState::StateBlock* _stateBlock; + Texture2D* _texture; + GLProgramState* _glProgramState; + IndexBuffer* _indexBuffer; //index buffer + VertexBuffer* _vertexBuffer; // vertex buffer std::vector _vertices; std::vector _indices; diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp index 7ec249c26f..21fff53b92 100755 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp @@ -1056,7 +1056,7 @@ void PUParticleSystem3D::clearAllParticles() } } -void PUParticleSystem3D::copyAttributesTo( PUParticleSystem3D* system ) +void PUParticleSystem3D::copyAttributesTo(PUParticleSystem3D* system ) { system->removeAllEmitter(); system->removeAllAffector(); @@ -1171,7 +1171,8 @@ void PUParticleSystem3D::draw( Renderer *renderer, const Mat4 &transform, uint32 if (!_emittedSystemParticlePool.empty()) { - for (auto iter : _emittedSystemParticlePool){ + for (auto iter : _emittedSystemParticlePool) + { PUParticle3D *particle = static_cast(iter.second.getFirst()); while (particle) { diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.h b/extensions/Particle3D/PU/CCPUParticleSystem3D.h index d22ff6bd2d..c2d2ce0fc9 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.h @@ -351,7 +351,7 @@ public: void calulateRotationOffset(void); virtual PUParticleSystem3D* clone(); - virtual void copyAttributesTo (PUParticleSystem3D* system); + virtual void copyAttributesTo(PUParticleSystem3D* system); CC_CONSTRUCTOR_ACCESS: PUParticleSystem3D(); diff --git a/extensions/Particle3D/PU/CCPURender.cpp b/extensions/Particle3D/PU/CCPURender.cpp index 96d74e3a03..21ecf3c775 100644 --- a/extensions/Particle3D/PU/CCPURender.cpp +++ b/extensions/Particle3D/PU/CCPURender.cpp @@ -43,11 +43,8 @@ NS_CC_BEGIN void PURender::copyAttributesTo( PURender *render ) { - render->_particleSystem = _particleSystem; - render->_isVisible = _isVisible; - render->_rendererScale = _rendererScale; - render->_depthTest = _depthTest; - render->_depthWrite = _depthWrite; + Particle3DRender::copyAttributesTo(render); + render->_renderType = _renderType; } @@ -243,8 +240,21 @@ void PUParticle3DQuadRender::render(Renderer* renderer, const Mat4 &transform, P _vertexBuffer->updateVertices(&_vertices[0], vertexindex/* * sizeof(_posuvcolors[0])*/, 0); _indexBuffer->updateIndices(&_indices[0], index/* * sizeof(unsigned short)*/, 0); + _stateBlock->setBlendFunc(particleSystem->getBlendFunc()); + GLuint texId = (_texture ? _texture->getName() : 0); - _meshCommand->init(0, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, index, transform, Node::FLAGS_RENDER_AS_3D); + _meshCommand->init(0, + texId, + _glProgramState, + _stateBlock, + _vertexBuffer->getVBO(), + _indexBuffer->getVBO(), + GL_TRIANGLES, + GL_UNSIGNED_SHORT, + index, + transform, + Node::FLAGS_RENDER_AS_3D); + _meshCommand->setSkipBatching(true); _meshCommand->setTransparent(true); _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); renderer->addCommand(_meshCommand); @@ -267,7 +277,6 @@ PUParticle3DQuadRender::PUParticle3DQuadRender() PUParticle3DQuadRender::~PUParticle3DQuadRender() { - } void PUParticle3DQuadRender::getOriginOffset( int &offsetX, int &offsetY ) @@ -396,16 +405,15 @@ void PUParticle3DQuadRender::setType( Type type ) { _type = type; if (_type == PERPENDICULAR_COMMON || _type == PERPENDICULAR_SELF){ - _meshCommand->setCullFaceEnabled(false); + _stateBlock->setCullFace(false); }else{ - _meshCommand->setCullFaceEnabled(true); + _stateBlock->setCullFace(true); } } -void PUParticle3DQuadRender::copyAttributesTo( PURender *render ) +void PUParticle3DQuadRender::copyAttributesTo(PUParticle3DQuadRender *quadRender) { - PURender::copyAttributesTo(render); - PUParticle3DQuadRender *quadRender = static_cast(render); + PURender::copyAttributesTo(quadRender); quadRender->_type = _type; quadRender->_origin = _origin; quadRender->_rotateType = _rotateType; @@ -499,7 +507,7 @@ PUParticle3DModelRender::~PUParticle3DModelRender() } } -void PUParticle3DModelRender::copyAttributesTo( PURender *render ) +void PUParticle3DModelRender::copyAttributesTo(PUParticle3DModelRender *render) { PURender::copyAttributesTo(render); } @@ -519,12 +527,20 @@ PUParticle3DEntityRender::PUParticle3DEntityRender() , _indexBuffer(nullptr) , _vertexBuffer(nullptr) { + _stateBlock = RenderState::StateBlock::create(); + CC_SAFE_RETAIN(_stateBlock); + _stateBlock->setCullFace(false); + _stateBlock->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK); + _stateBlock->setDepthTest(false); + _stateBlock->setDepthWrite(false); + _stateBlock->setBlend(true); } PUParticle3DEntityRender::~PUParticle3DEntityRender() { CC_SAFE_DELETE(_meshCommand); + CC_SAFE_RELEASE(_stateBlock); //CC_SAFE_RELEASE(_texture); CC_SAFE_RELEASE(_glProgramState); CC_SAFE_RELEASE(_vertexBuffer); @@ -556,27 +572,17 @@ bool PUParticle3DEntityRender::initRender( const std::string &texFile ) _glProgramState = glProgramState; _meshCommand = new (std::nothrow) MeshCommand(); + _meshCommand->setSkipBatching(true); _meshCommand->setTransparent(true); - _meshCommand->setDepthTestEnabled(_depthTest); - _meshCommand->setDepthWriteEnabled(_depthWrite); - _meshCommand->setCullFace(GL_BACK); - _meshCommand->setCullFaceEnabled(true); + + _stateBlock->setDepthTest(_depthTest); + _stateBlock->setDepthWrite(_depthWrite); + _stateBlock->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK); + _stateBlock->setCullFace(true); return true; } -void PUParticle3DEntityRender::setDepthTest( bool isDepthTest ) -{ - Particle3DRender::setDepthTest(isDepthTest); - _meshCommand->setDepthTestEnabled(_depthTest); -} - -void PUParticle3DEntityRender::setDepthWrite( bool isDepthWrite ) -{ - Particle3DRender::setDepthWrite(isDepthWrite); - _meshCommand->setDepthWriteEnabled(_depthWrite); -} - -void PUParticle3DEntityRender::copyAttributesTo( PURender *render ) +void PUParticle3DEntityRender::copyAttributesTo(PUParticle3DEntityRender *render) { PURender::copyAttributesTo(render); } @@ -691,8 +697,21 @@ void PUParticle3DBoxRender::render( Renderer* renderer, const Mat4 &transform, P _indexBuffer->updateIndices(&_indices[0], index/* * sizeof(unsigned short)*/, 0); GLuint texId = (_texture ? _texture->getName() : 0); - _meshCommand->init(0, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, index, transform, Node::FLAGS_RENDER_AS_3D); + _stateBlock->setBlendFunc(_particleSystem->getBlendFunc()); + _meshCommand->init(0, + texId, + _glProgramState, + _stateBlock, + _vertexBuffer->getVBO(), + _indexBuffer->getVBO(), + GL_TRIANGLES, + GL_UNSIGNED_SHORT, + index, + transform, + Node::FLAGS_RENDER_AS_3D); + _meshCommand->setSkipBatching(true); _meshCommand->setTransparent(true); + _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); renderer->addCommand(_meshCommand); } @@ -842,9 +861,24 @@ void PUSphereRender::render( Renderer* renderer, const Mat4 &transform, Particle _indexBuffer->updateIndices(&_indices[0], index/* * sizeof(unsigned short)*/, 0); GLuint texId = (_texture ? _texture->getName() : 0); - _meshCommand->init(0, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, index, transform, Node::FLAGS_RENDER_AS_3D); + + _stateBlock->setBlendFunc(particleSystem->getBlendFunc()); + _meshCommand->init( + 0, + texId, + _glProgramState, + _stateBlock, + _vertexBuffer->getVBO(), + _indexBuffer->getVBO(), + GL_TRIANGLES, + GL_UNSIGNED_SHORT, + index, + transform, + Node::FLAGS_RENDER_AS_3D); + _meshCommand->setSkipBatching(true); _meshCommand->setTransparent(true); - _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); + + _glProgramState->setUniformVec4("u_color", Vec4(1,1,1,1)); renderer->addCommand(_meshCommand); } } @@ -908,10 +942,9 @@ PUSphereRender::~PUSphereRender() } -void PUSphereRender::copyAttributesTo( PURender *render ) +void PUSphereRender::copyAttributesTo(PUSphereRender *sphereRender) { - PURender::copyAttributesTo(render); - PUSphereRender *sphereRender = static_cast(render); + PURender::copyAttributesTo(sphereRender); sphereRender->_numberOfRings = _numberOfRings; sphereRender->_numberOfSegments = _numberOfSegments; } diff --git a/extensions/Particle3D/PU/CCPURender.h b/extensions/Particle3D/PU/CCPURender.h index 7760d46cb0..f4600459d3 100644 --- a/extensions/Particle3D/PU/CCPURender.h +++ b/extensions/Particle3D/PU/CCPURender.h @@ -26,10 +26,12 @@ #ifndef __CC_PU_PARTICLE_3D_RENDER_H__ #define __CC_PU_PARTICLE_3D_RENDER_H__ +#include + #include "base/CCRef.h" #include "math/CCMath.h" #include "extensions/Particle3D/CCParticle3DRender.h" -#include +#include "renderer/CCRenderState.h" NS_CC_BEGIN @@ -48,7 +50,7 @@ public: void setRenderType(const std::string& observerType) {_renderType = observerType;}; virtual PURender* clone() = 0; - virtual void copyAttributesTo (PURender *render); + void copyAttributesTo(PURender* render); public: @@ -62,11 +64,7 @@ protected: class CC_DLL PUParticle3DEntityRender : public PURender { public: - - virtual void setDepthTest(bool isDepthTest) override; - virtual void setDepthWrite(bool isDepthWrite) override; - - virtual void copyAttributesTo (PURender *render) override; + void copyAttributesTo(PUParticle3DEntityRender *render); CC_CONSTRUCTOR_ACCESS: PUParticle3DEntityRender(); @@ -85,6 +83,7 @@ protected: Vec4 color; }; MeshCommand* _meshCommand; + RenderState::StateBlock* _stateBlock; Texture2D* _texture; GLProgramState* _glProgramState; IndexBuffer* _indexBuffer; //index buffer @@ -151,7 +150,7 @@ public: virtual void render(Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem) override; virtual PUParticle3DQuadRender* clone() override; - virtual void copyAttributesTo (PURender *render) override; + void copyAttributesTo(PUParticle3DQuadRender *render); CC_CONSTRUCTOR_ACCESS: PUParticle3DQuadRender(); @@ -187,7 +186,7 @@ public: virtual void render(Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem) override; virtual PUParticle3DModelRender* clone() override; - virtual void copyAttributesTo (PURender *render) override; + void copyAttributesTo(PUParticle3DModelRender *render); CC_CONSTRUCTOR_ACCESS: PUParticle3DModelRender(); @@ -229,7 +228,7 @@ public: virtual void render(Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem) override; virtual PUSphereRender* clone() override; - virtual void copyAttributesTo (PURender *render) override; + void copyAttributesTo(PUSphereRender *render); CC_CONSTRUCTOR_ACCESS: PUSphereRender(); diff --git a/extensions/Particle3D/PU/CCPURendererTranslator.cpp b/extensions/Particle3D/PU/CCPURendererTranslator.cpp index 68c85a20ce..1d71a72d16 100644 --- a/extensions/Particle3D/PU/CCPURendererTranslator.cpp +++ b/extensions/Particle3D/PU/CCPURendererTranslator.cpp @@ -602,6 +602,7 @@ void PURendererTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode if (material){ _renderer->setDepthTest(material->depthTest); _renderer->setDepthWrite(material->depthWrite); + _renderer->setBlendFunc(material->blendFunc); static_cast(_renderer)->setRenderType(type); } system->setRender(_renderer); diff --git a/extensions/Particle3D/PU/CCPURibbonTrail.h b/extensions/Particle3D/PU/CCPURibbonTrail.h index dc01ebb4ab..00ccf78781 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.h +++ b/extensions/Particle3D/PU/CCPURibbonTrail.h @@ -77,7 +77,7 @@ public: /** @copydoc BillboardChain::setMaxChainElements */ void setMaxChainElements(size_t maxElements); /** @copydoc BillboardChain::setNumberOfChains */ - void setNumberOfChains(size_t numChains); + virtual void setNumberOfChains(size_t numChains) override; /** @copydoc BillboardChain::clearChain */ void clearChain(size_t chainIndex); diff --git a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp index ac7b8b4b8b..5f0a436387 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp @@ -369,10 +369,9 @@ PURibbonTrailRender* PURibbonTrailRender::clone() return tr; } -void PURibbonTrailRender::copyAttributesTo( PURender *render ) +void PURibbonTrailRender::copyAttributesTo(PURibbonTrailRender *trailRender) { - PURender::copyAttributesTo(render); - PURibbonTrailRender *trailRender = static_cast(render); + PURender::copyAttributesTo(trailRender); trailRender->setUseVertexColors(_useVertexColours); trailRender->setMaxChainElements(_maxChainElements); trailRender->setTrailLength(_trailLength); diff --git a/extensions/Particle3D/PU/CCPURibbonTrailRender.h b/extensions/Particle3D/PU/CCPURibbonTrailRender.h index 9481043640..ea54912143 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.h +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.h @@ -126,7 +126,7 @@ public: void destroyAll(void); virtual PURibbonTrailRender* clone() override; - virtual void copyAttributesTo (PURender *render) override; + void copyAttributesTo(PURibbonTrailRender *render); CC_CONSTRUCTOR_ACCESS: PURibbonTrailRender(); diff --git a/extensions/Particle3D/PU/CCPUTranslateManager.h b/extensions/Particle3D/PU/CCPUTranslateManager.h index 70d737294c..f53b942a53 100644 --- a/extensions/Particle3D/PU/CCPUTranslateManager.h +++ b/extensions/Particle3D/PU/CCPUTranslateManager.h @@ -77,7 +77,7 @@ public: CC_CONSTRUCTOR_ACCESS: PUTranslateManager(); - ~PUTranslateManager(); + virtual ~PUTranslateManager(); }; NS_CC_END diff --git a/extensions/assets-manager/Manifest.cpp b/extensions/assets-manager/Manifest.cpp index c5224be997..d7541f7a2d 100644 --- a/extensions/assets-manager/Manifest.cpp +++ b/extensions/assets-manager/Manifest.cpp @@ -86,7 +86,7 @@ void Manifest::loadJson(const std::string& url) if (offset > 0) offset--; std::string errorSnippet = content.substr(offset, 10); - CCLOG("File parse error %s at <%s>\n", _json.GetParseError(), errorSnippet.c_str()); + CCLOG("File parse error %d at <%s>\n", _json.GetParseError(), errorSnippet.c_str()); } } } @@ -324,7 +324,7 @@ void Manifest::setAssetDownloadState(const std::string &key, const Manifest::Dow rapidjson::Value &assets = _json[KEY_ASSETS]; if (assets.IsObject()) { - for (rapidjson::Value::MemberIterator itr = assets.MemberonBegin(); itr != assets.MemberonEnd(); ++itr) + for (rapidjson::Value::MemberIterator itr = assets.MemberBegin(); itr != assets.MemberEnd(); ++itr) { std::string jkey = itr->name.GetString(); if (jkey == key) { @@ -426,7 +426,7 @@ void Manifest::loadVersion(const rapidjson::Document &json) const rapidjson::Value& groupVers = json[KEY_GROUP_VERSIONS]; if (groupVers.IsObject()) { - for (rapidjson::Value::ConstMemberIterator itr = groupVers.MemberonBegin(); itr != groupVers.MemberonEnd(); ++itr) + for (rapidjson::Value::ConstMemberIterator itr = groupVers.MemberBegin(); itr != groupVers.MemberEnd(); ++itr) { std::string group = itr->name.GetString(); std::string version = "0"; @@ -470,7 +470,7 @@ void Manifest::loadManifest(const rapidjson::Document &json) const rapidjson::Value& assets = json[KEY_ASSETS]; if (assets.IsObject()) { - for (rapidjson::Value::ConstMemberIterator itr = assets.MemberonBegin(); itr != assets.MemberonEnd(); ++itr) + for (rapidjson::Value::ConstMemberIterator itr = assets.MemberBegin(); itr != assets.MemberEnd(); ++itr) { std::string key = itr->name.GetString(); Asset asset = parseAsset(key, itr->value); @@ -508,4 +508,4 @@ void Manifest::saveToFile(const std::string &filepath) output << buffer.GetString() << std::endl; } -NS_CC_EXT_END \ No newline at end of file +NS_CC_EXT_END diff --git a/external/config.json b/external/config.json index 8ca703e5d2..817c48e85a 100644 --- a/external/config.json +++ b/external/config.json @@ -1,5 +1,5 @@ { - "version":"v3-deps-52", + "version":"v3-deps-55", "zip_file_size":"116842586", "repo_name":"cocos2d-x-3rd-party-libs-bin", "repo_parent":"https://github.com/cocos2d/", diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index f8d4376393..7a30b795b9 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -6,9 +6,9 @@ "README.cmake", "README.md", "build/android-build.py", - "build/cocos2d-js-win32.vc2013.sln", + "build/cocos2d-js-win32.sln", "build/cocos2d-js-win8.1-universal.sln", - "build/cocos2d-win32.vc2013.sln", + "build/cocos2d-win32.sln", "build/cocos2d-win8.1-universal.sln", "build/cocos2d_js_tests.xcodeproj/project.pbxproj", "build/cocos2d_libs.xcodeproj/project.pbxproj", @@ -315,6 +315,12 @@ "cocos/audio/win32/SimpleAudioEngine.cpp", "cocos/audio/winrt/Audio.cpp", "cocos/audio/winrt/Audio.h", + "cocos/audio/winrt/AudioCachePlayer.cpp", + "cocos/audio/winrt/AudioCachePlayer.h", + "cocos/audio/winrt/AudioEngine-winrt.cpp", + "cocos/audio/winrt/AudioEngine-winrt.h", + "cocos/audio/winrt/AudioSourceReader.cpp", + "cocos/audio/winrt/AudioSourceReader.h", "cocos/audio/winrt/MediaStreamer.cpp", "cocos/audio/winrt/MediaStreamer.h", "cocos/audio/winrt/SimpleAudioEngine.cpp", @@ -378,6 +384,8 @@ "cocos/base/CCMap.h", "cocos/base/CCNS.cpp", "cocos/base/CCNS.h", + "cocos/base/CCNinePatchImageParser.cpp", + "cocos/base/CCNinePatchImageParser.h", "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProperties.cpp", @@ -394,6 +402,7 @@ "cocos/base/CCTouch.h", "cocos/base/CCUserDefault-android.cpp", "cocos/base/CCUserDefault-apple.mm", + "cocos/base/CCUserDefault-winrt.cpp", "cocos/base/CCUserDefault.cpp", "cocos/base/CCUserDefault.h", "cocos/base/CCValue.cpp", @@ -917,6 +926,12 @@ "cocos/platform/android/jni/JniHelper.cpp", "cocos/platform/android/jni/JniHelper.h", "cocos/platform/android/jni/TouchesJni.cpp", + "cocos/platform/android/libcocos2dx-with-controller/AndroidManifest.xml", + "cocos/platform/android/libcocos2dx-with-controller/build.gradle", + "cocos/platform/android/libcocos2dx-with-controller/proguard-rules.pro", + "cocos/platform/android/libcocos2dx/AndroidManifest.xml", + "cocos/platform/android/libcocos2dx/build.gradle", + "cocos/platform/android/libcocos2dx/proguard-rules.pro", "cocos/platform/apple/CCFileUtils-apple.h", "cocos/platform/apple/CCFileUtils-apple.mm", "cocos/platform/apple/CCLock-apple.cpp", @@ -2155,6 +2170,12 @@ "external/bullet/btBulletDynamicsCommon.h", "external/bullet/proj.win32/libbullet.vcxproj", "external/bullet/proj.win32/libbullet.vcxproj.filters", + "external/bullet/proj.win8.1-universal/libbullet.Shared/libbullet.Shared.vcxitems", + "external/bullet/proj.win8.1-universal/libbullet.Shared/libbullet.Shared.vcxitems.filters", + "external/bullet/proj.win8.1-universal/libbullet.Windows/libbullet.Windows.vcxproj", + "external/bullet/proj.win8.1-universal/libbullet.Windows/libbullet.Windows.vcxproj.filters", + "external/bullet/proj.win8.1-universal/libbullet.WindowsPhone/libbullet.WindowsPhone.vcxproj", + "external/bullet/proj.win8.1-universal/libbullet.WindowsPhone/libbullet.WindowsPhone.vcxproj.filters", "external/bullet/vectormath/neon/boolInVec.h", "external/bullet/vectormath/neon/floatInVec.h", "external/bullet/vectormath/neon/mat_aos.h", @@ -2208,7 +2229,9 @@ "external/chipmunk/prebuilt/linux/32-bit/libchipmunk.a", "external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a", "external/chipmunk/prebuilt/mac/libchipmunk.a", + "external/chipmunk/prebuilt/win32/debug-lib/libchipmunk-2015.lib", "external/chipmunk/prebuilt/win32/debug-lib/libchipmunk.lib", + "external/chipmunk/prebuilt/win32/release-lib/libchipmunk-2015.lib", "external/chipmunk/prebuilt/win32/release-lib/libchipmunk.lib", "external/chipmunk/prebuilt/winrt_8.1/arm/chipmunk.lib", "external/chipmunk/prebuilt/winrt_8.1/win32/chipmunk.lib", @@ -2737,6 +2760,7 @@ "external/glfw3/include/win32/glfw3.h", "external/glfw3/include/win32/glfw3native.h", "external/glfw3/prebuilt/mac/libglfw3.a", + "external/glfw3/prebuilt/win32/glfw3-2015.lib", "external/glfw3/prebuilt/win32/glfw3.lib", "external/jpeg/CMakeLists.txt", "external/jpeg/include/android/jconfig.h", @@ -2764,12 +2788,31 @@ "external/jpeg/prebuilt/linux/32-bit/libjpeg.a", "external/jpeg/prebuilt/linux/64-bit/libjpeg.a", "external/jpeg/prebuilt/mac/libjpeg.a", + "external/jpeg/prebuilt/win32/libjpeg-2015.lib", "external/jpeg/prebuilt/win32/libjpeg.lib", + "external/json/allocators.h", "external/json/document.h", + "external/json/encodedstream.h", + "external/json/encodings.h", + "external/json/error/en.h", + "external/json/error/error.h", + "external/json/filereadstream.h", "external/json/filestream.h", + "external/json/filewritestream.h", + "external/json/internal/biginteger.h", + "external/json/internal/diyfp.h", + "external/json/internal/dtoa.h", + "external/json/internal/ieee754.h", + "external/json/internal/itoa.h", + "external/json/internal/meta.h", "external/json/internal/pow10.h", "external/json/internal/stack.h", "external/json/internal/strfunc.h", + "external/json/internal/strtod.h", + "external/json/memorybuffer.h", + "external/json/memorystream.h", + "external/json/msinttypes/inttypes.h", + "external/json/msinttypes/stdint.h", "external/json/prettywriter.h", "external/json/rapidjson.h", "external/json/reader.h", @@ -2817,6 +2860,7 @@ "external/png/prebuilt/android/x86/libpng.a", "external/png/prebuilt/ios/libpng.a", "external/png/prebuilt/mac/libpng.a", + "external/png/prebuilt/win32/libpng-2015.lib", "external/png/prebuilt/win32/libpng.lib", "external/poly2tri/common/shapes.cc", "external/poly2tri/common/shapes.h", @@ -2872,6 +2916,7 @@ "external/tiff/prebuilt/linux/32-bit/libtiff.a", "external/tiff/prebuilt/linux/64-bit/libtiff.a", "external/tiff/prebuilt/mac/libtiff.a", + "external/tiff/prebuilt/win32/libtiff-2015.lib", "external/tiff/prebuilt/win32/libtiff.dll", "external/tiff/prebuilt/win32/libtiff.lib", "external/tinyxml2/CMakeLists.txt", @@ -4919,6 +4964,97 @@ "tools/fbx-conv/README.md", "tools/fbx-conv/mac/fbx-conv", "tools/fbx-conv/mac/libfbxsdk.dylib", + "tools/framework-compile/bin-templates/cpp-template-default/Classes/AppDelegate.cpp", + "tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp", + "tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.h", + "tools/framework-compile/bin-templates/cpp-template-default/cocos-project-template.json", + "tools/framework-compile/bin-templates/cpp-template-default/proj.android/jni/Android.mk", + "tools/framework-compile/bin-templates/cpp-template-default/proj.win32/HelloCpp.sln", + "tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.ccs", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.cfg", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.udf", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/HelloWorld.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/MainScene.csb", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/HelloWorld.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/MainScene.csd", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.ccs", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.cfg", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.udf", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/HelloWorld.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/MainScene.csb", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/HelloWorld.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/MainScene.csd", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-568h@2x.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-667h@2x.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-736h@3x.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default.png", + "tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default@2x.png", + "tools/framework-compile/bin-templates/js-template-runtime/.project", + "tools/framework-compile/bin-templates/js-template-runtime/cocos-project-template.json", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.cpp", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.h", + "tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/targetver.h", + "tools/framework-compile/bin-templates/js-template-runtime/index.html", + "tools/framework-compile/bin-templates/js-template-runtime/main.js", + "tools/framework-compile/bin-templates/js-template-runtime/project.json", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.ccs", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.cfg", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.udf", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/HelloWorld.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/MainScene.csd", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/HelloWorld.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/MainScene.json", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.ccs", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.cfg", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.udf", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/HelloWorld.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/MainScene.csd", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/HelloWorld.png", + "tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/MainScene.json", + "tools/framework-compile/bin-templates/js-template-runtime/src/app.js", + "tools/framework-compile/bin-templates/js-template-runtime/src/resource.js", + "tools/framework-compile/bin-templates/lua-template-runtime/cocos-project-template.json", + "tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk", + "tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln", + "tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.ccs", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.cfg", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.udf", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/HelloWorld.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/MainScene.csd", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/HelloWorld.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/MainScene.csb", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.ccs", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.cfg", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.udf", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/HelloWorld.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/MainScene.csd", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/HelloWorld.png", + "tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/MainScene.csb", + "tools/framework-compile/bin-templates/lua-template-runtime/src/app/MyApp.lua", + "tools/framework-compile/bin-templates/lua-template-runtime/src/app/views/MainScene.lua", + "tools/framework-compile/bin-templates/lua-template-runtime/src/config.lua", + "tools/framework-compile/gen_cocos_libs.sh", + "tools/framework-compile/x-modified/cocos/audio/android/prebuilt-mk/Android.mk", + "tools/framework-compile/x-modified/cocos/prebuilt-mk/Android.mk", + "tools/framework-compile/x-modified/cocos/scripting/js-bindings/proj.android/prebuilt-mk/Android.mk", + "tools/framework-compile/x-modified/cocos/scripting/lua-bindings/proj.android/prebuilt-mk/Android.mk", "tools/gen-prebuilt/README.md", "tools/gen-prebuilt/build_config.json", "tools/gen-prebuilt/excopy.py", @@ -5160,6 +5296,7 @@ "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_builder_auto_api.js", "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_api.js", "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_extension_auto_api.js", + "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js", "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_spine_auto_api.js", "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_studio_auto_api.js", "cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js", @@ -5175,6 +5312,8 @@ "cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.hpp", "cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp", "cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.hpp", + "cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp", + "cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp", "cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp", "cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.hpp", "cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp", @@ -5235,6 +5374,8 @@ "cocos/scripting/js-bindings/manual/network/jsb_socketio.h", "cocos/scripting/js-bindings/manual/network/jsb_websocket.cpp", "cocos/scripting/js-bindings/manual/network/jsb_websocket.h", + "cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp", + "cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.h", "cocos/scripting/js-bindings/manual/platform/android/CCJavascriptJavaBridge.cpp", "cocos/scripting/js-bindings/manual/platform/android/CCJavascriptJavaBridge.h", "cocos/scripting/js-bindings/manual/platform/ios/JavaScriptObjCBridge.h", @@ -5290,6 +5431,7 @@ "cocos/scripting/js-bindings/script/jsb_property_apis.js", "cocos/scripting/js-bindings/script/jsb_property_impls.js", "cocos/scripting/js-bindings/script/jsb_spine.js", + "cocos/scripting/js-bindings/script/physics3d/jsb_physics3d.js", "cocos/scripting/js-bindings/script/physicsSprite/jsb_physicsSprite.js", "cocos/scripting/js-bindings/script/studio/jsb_cocos2d_studio.js", "cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js", @@ -6056,6 +6198,7 @@ "tools/tojs/cocos2dx_builder.ini", "tools/tojs/cocos2dx_experimental.ini", "tools/tojs/cocos2dx_extension.ini", + "tools/tojs/cocos2dx_physics3d.ini", "tools/tojs/cocos2dx_spine.ini", "tools/tojs/cocos2dx_studio.ini", "tools/tojs/cocos2dx_ui.ini", @@ -6913,6 +7056,8 @@ "cocos/scripting/lua-bindings/manual/network/lua_extensions.h", "cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp", "cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.h", + "cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.cpp", + "cocos/scripting/lua-bindings/manual/physics3d/lua_cocos2dx_physics3d_manual.h", "cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp", "cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h", "cocos/scripting/lua-bindings/manual/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp", @@ -6991,6 +7136,7 @@ "cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua", "cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua", "cocos/scripting/lua-bindings/script/network/NetworkConstants.lua", + "cocos/scripting/lua-bindings/script/physics3d/physics3d-constants.lua", "cocos/scripting/lua-bindings/script/spine/SpineConstants.lua", "cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua", "cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua", @@ -7068,6 +7214,7 @@ "external/lua/luajit/prebuilt/android/x86/libluajit.a", "external/lua/luajit/prebuilt/ios/libluajit.a", "external/lua/luajit/prebuilt/mac/libluajit.a", + "external/lua/luajit/prebuilt/win32/lua51-2015.lib", "external/lua/luajit/prebuilt/win32/lua51.dll", "external/lua/luajit/prebuilt/win32/lua51.lib", "external/lua/luasocket/auxiliar.c", @@ -7203,6 +7350,7 @@ "tools/tolua/cocos2dx_experimental_webview.ini", "tools/tolua/cocos2dx_extension.ini", "tools/tolua/cocos2dx_physics.ini", + "tools/tolua/cocos2dx_physics3d.ini", "tools/tolua/cocos2dx_spine.ini", "tools/tolua/cocos2dx_studio.ini", "tools/tolua/cocos2dx_ui.ini", diff --git a/templates/cpp-template-default/proj.android-studio/.gitignore b/templates/cpp-template-default/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/templates/cpp-template-default/proj.android-studio/app/.gitignore b/templates/cpp-template-default/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml b/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..2bc0113bdd --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/cpp-template-default/proj.android-studio/app/build.gradle b/templates/cpp-template-default/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..7725be188f --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.cpp_empty_test" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/templates/cpp-template-default/proj.android-studio/app/jni/Android.mk b/templates/cpp-template-default/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..9cded81589 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,33 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d) +$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/external) +$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/cocos) + +LOCAL_MODULE := cocos2dcpp_shared + +LOCAL_MODULE_FILENAME := libcocos2dcpp + +LOCAL_SRC_FILES := hellocpp/main.cpp \ + ../../../Classes/AppDelegate.cpp \ + ../../../Classes/HelloWorldScene.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes + +# _COCOS_HEADER_ANDROID_BEGIN +# _COCOS_HEADER_ANDROID_END + + +LOCAL_STATIC_LIBRARIES := cocos2dx_static + +# _COCOS_LIB_ANDROID_BEGIN +# _COCOS_LIB_ANDROID_END + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,.) + +# _COCOS_LIB_IMPORT_ANDROID_BEGIN +# _COCOS_LIB_IMPORT_ANDROID_END diff --git a/templates/cpp-template-default/proj.android-studio/app/jni/Application.mk b/templates/cpp-template-default/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..07aa592b13 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/templates/cpp-template-default/proj.android-studio/app/jni/hellocpp/main.cpp b/templates/cpp-template-default/proj.android-studio/app/jni/hellocpp/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/jni/hellocpp/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/templates/cpp-template-default/proj.android-studio/app/proguard-rules.pro b/templates/cpp-template-default/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/templates/cpp-template-default/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/templates/cpp-template-default/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android-studio/app/res/values/strings.xml b/templates/cpp-template-default/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..4fb39f4955 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + HelloCpp + diff --git a/templates/cpp-template-default/proj.android-studio/app/src/org/cocos2dx/cpp/AppActivity.java b/templates/cpp-template-default/proj.android-studio/app/src/org/cocos2dx/cpp/AppActivity.java new file mode 100644 index 0000000000..26813bbcf9 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/app/src/org/cocos2dx/cpp/AppActivity.java @@ -0,0 +1,29 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.cpp; + +import org.cocos2dx.lib.Cocos2dxActivity; + +public class AppActivity extends Cocos2dxActivity { +} diff --git a/templates/cpp-template-default/proj.android-studio/build.gradle b/templates/cpp-template-default/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/templates/cpp-template-default/proj.android-studio/gradle.properties b/templates/cpp-template-default/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/templates/cpp-template-default/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/templates/cpp-template-default/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/templates/cpp-template-default/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/templates/cpp-template-default/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/templates/cpp-template-default/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/templates/cpp-template-default/proj.android-studio/gradlew b/templates/cpp-template-default/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/templates/cpp-template-default/proj.android-studio/gradlew.bat b/templates/cpp-template-default/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/templates/cpp-template-default/proj.android-studio/settings.gradle b/templates/cpp-template-default/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..e9cae16445 --- /dev/null +++ b/templates/cpp-template-default/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx') +include ':app' diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows.vcxproj b/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows.vcxproj index e48a4c0aea..b724fccccb 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows.vcxproj +++ b/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows.vcxproj @@ -123,6 +123,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -132,6 +133,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions)
@@ -141,6 +143,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -150,6 +153,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -159,6 +163,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -168,6 +173,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.Windows/Package.appxmanifest b/templates/cpp-template-default/proj.win8.1-universal/App.Windows/Package.appxmanifest index 1f5d2e56b1..91951e9a31 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/App.Windows/Package.appxmanifest +++ b/templates/cpp-template-default/proj.win8.1-universal/App.Windows/Package.appxmanifest @@ -1,6 +1,6 @@  - + HelloCpp.Windows msopentech diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/HelloCpp.WindowsPhone.vcxproj b/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/HelloCpp.WindowsPhone.vcxproj index 19157fa0d1..5f2cff6e4d 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/HelloCpp.WindowsPhone.vcxproj +++ b/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/HelloCpp.WindowsPhone.vcxproj @@ -89,7 +89,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false - CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -99,7 +99,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false - CC_WINDOWS_PHONE_8_1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -109,7 +109,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false - CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -119,7 +119,7 @@ pch.h ../../Classes;%(AdditionalIncludeDirectories) false - CC_WINDOWS_PHONE_8_1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest b/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest index eb4bab30a4..a2181cf8a0 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest +++ b/templates/cpp-template-default/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest @@ -1,10 +1,10 @@  - - + + HelloCpp.WindowsPhone - dalestam + msopentech Assets\StoreLogo.png diff --git a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln index be071c12a8..bd25e49291 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln +++ b/templates/cpp-template-default/proj.win8.1-universal/HelloCpp.sln @@ -36,14 +36,25 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", ". EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.WindowsPhone", "..\cocos2d\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}") = "libbullet", "libbullet", "{72850ED1-A006-4767-B703-27A27C3F13FC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Shared", "..\cocos2d\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems", "{16AF311F-74CA-45A3-A82D-6334200FB124}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Windows", "..\cocos2d\external\bullet\proj.win8.1-universal\libbullet.Windows\libbullet.Windows.vcxproj", "{EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.WindowsPhone", "..\cocos2d\external\bullet\proj.win8.1-universal\libbullet.WindowsPhone\libbullet.WindowsPhone.vcxproj", "{E35634BD-B91B-4A6D-B957-96F56DD065F9}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution ..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4 App.Shared\HelloCpp.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9 ..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4 ..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9 + ..\cocos2d\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{e35634bd-b91b-4a6d-b957-96f56dd065f9}*SharedItemsImports = 4 App.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4 + ..\cocos2d\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{ec2b1292-2d8c-4feb-a84b-2550b32c1ae7}*SharedItemsImports = 4 ..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9 + ..\cocos2d\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{16af311f-74ca-45a3-a82d-6334200fb124}*SharedItemsImports = 9 ..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9 ..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4 ..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{22f3b9df-1209-4574-8331-003966f562bf}*SharedItemsImports = 4 @@ -158,6 +169,28 @@ Global {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 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.ActiveCfg = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.Build.0 = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.ActiveCfg = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.Build.0 = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.ActiveCfg = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.Build.0 = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.ActiveCfg = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.Build.0 = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.ActiveCfg = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.Build.0 = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.ActiveCfg = Release|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.Build.0 = Release|x64 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.ActiveCfg = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.Build.0 = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.Build.0 = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|x64.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.ActiveCfg = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.Build.0 = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.ActiveCfg = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.Build.0 = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -177,5 +210,9 @@ Global {5D6F020F-7E72-4494-90A0-2DF11D235DF9} = {80DA05C1-6532-4D2A-8606-EF02079B1373} {9335005F-678E-4E8E-9B84-50037216AEC8} = {80DA05C1-6532-4D2A-8606-EF02079B1373} {22F3B9DF-1209-4574-8331-003966F562BF} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + {72850ED1-A006-4767-B703-27A27C3F13FC} = {F13CB4F7-BEE5-4368-A815-A971797387D8} + {16AF311F-74CA-45A3-A82D-6334200FB124} = {72850ED1-A006-4767-B703-27A27C3F13FC} + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7} = {72850ED1-A006-4767-B703-27A27C3F13FC} + {E35634BD-B91B-4A6D-B957-96F56DD065F9} = {72850ED1-A006-4767-B703-27A27C3F13FC} EndGlobalSection EndGlobal diff --git a/templates/js-template-default/cocos-project-template.json b/templates/js-template-default/cocos-project-template.json index a70ca555e5..0272903ee9 100644 --- a/templates/js-template-default/cocos-project-template.json +++ b/templates/js-template-default/cocos-project-template.json @@ -2,16 +2,6 @@ "do_default":{ "exclude_from_template":[ "frameworks/runtime-src" - ], - "append_h5_engine":{ - "from":"web", - "to":"frameworks/cocos2d-html5" - }, - "append_file":[ - { - "from":"web/jsb_apis.js", - "to":"frameworks/cocos2d-html5/jsb_apis.js" - } ] }, "do_add_native_support":{ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/.gitignore b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/.gitignore b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..0df71de5f7 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..08c5dd07cc --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.hellolua" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..2d1704c4bc --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,21 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2djs_shared + +LOCAL_MODULE_FILENAME := libcocos2djs + +LOCAL_SRC_FILES := hellojavascript/main.cpp \ + ../../../Classes/AppDelegate.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes + +LOCAL_STATIC_LIBRARIES := cocos2d_js_static + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT + +include $(BUILD_SHARED_LIBRARY) + + +$(call import-module, scripting/js-bindings/proj.android) diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..706af60331 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,15 @@ +APP_STL := gnustl_static + +# Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices +#APP_ABI := armeabi-v7a + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/hellojavascript/main.cpp b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/hellojavascript/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/hellojavascript/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..02634ac6bd --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + HelloJavascript + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java new file mode 100644 index 0000000000..6b14791fad --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java @@ -0,0 +1,39 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.javascript; + +import org.cocos2dx.lib.Cocos2dxActivity; +import org.cocos2dx.lib.Cocos2dxGLSurfaceView; + +public class AppActivity extends Cocos2dxActivity { + + @Override + public Cocos2dxGLSurfaceView onCreateView() { + Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); + // TestCpp should create stencil buffer + glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); + + return glSurfaceView; + } +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew.bat b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..aa7d6ba93b --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../cocos2d-x/cocos/platform/android/libcocos2dx') +include ':app' diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj index 26f8cbeafb..dd0a618c31 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj @@ -122,6 +122,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -131,6 +132,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) @@ -140,6 +142,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -149,6 +152,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) @@ -158,6 +162,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -167,6 +172,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj index d0b374b373..88a3886a31 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj @@ -89,6 +89,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) @@ -98,6 +99,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) @@ -107,6 +109,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) @@ -116,6 +119,7 @@ pch.h $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) false + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) @@ -148,4 +152,4 @@ - + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln index 3658166bb4..6ba8f81a9a 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln @@ -44,14 +44,25 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d.Windows", "..\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d.WindowsPhone", "..\..\cocos2d-x\cocos\scripting\js-bindings\proj.win8.1-universal\libjscocos2d\libjscocos2d.WindowsPhone\libjscocos2d.WindowsPhone.vcxproj", "{CA082EC4-17CE-430B-8207-D1E947A5D1E9}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbullet", "libbullet", "{74FBA998-B56C-4170-AF95-CFC4FFB40468}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Shared", "..\..\cocos2d-x\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems", "{16AF311F-74CA-45A3-A82D-6334200FB124}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.Windows", "..\..\cocos2d-x\external\bullet\proj.win8.1-universal\libbullet.Windows\libbullet.Windows.vcxproj", "{EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet.WindowsPhone", "..\..\cocos2d-x\external\bullet\proj.win8.1-universal\libbullet.WindowsPhone\libbullet.WindowsPhone.vcxproj", "{E35634BD-B91B-4A6D-B957-96F56DD065F9}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution ..\..\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4 App.Shared\HelloJavascript.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9 ..\..\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4 ..\..\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9 + ..\..\cocos2d-x\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{e35634bd-b91b-4a6d-b957-96f56dd065f9}*SharedItemsImports = 4 App.Shared\HelloJavascript.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4 + ..\..\cocos2d-x\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{ec2b1292-2d8c-4feb-a84b-2550b32c1ae7}*SharedItemsImports = 4 ..\..\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9 + ..\..\cocos2d-x\external\bullet\proj.win8.1-universal\libbullet.Shared\libbullet.Shared.vcxitems*{16af311f-74ca-45a3-a82d-6334200fb124}*SharedItemsImports = 9 ..\..\cocos2d-x\cocos\scripting\js-bindings\proj.win8.1-universal\libjscocos2d\libjscocos2d.Shared\libjscocos2d.Shared.vcxitems*{ca082ec4-17ce-430b-8207-d1e947a5d1e9}*SharedItemsImports = 4 ..\..\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9 ..\..\cocos2d-x\cocos\scripting\js-bindings\proj.win8.1-universal\libjscocos2d\libjscocos2d.Shared\libjscocos2d.Shared.vcxitems*{bea66276-51dd-4c53-92a8-f3d1fea50892}*SharedItemsImports = 9 @@ -191,6 +202,28 @@ Global {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|Win32.ActiveCfg = Release|Win32 {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|Win32.Build.0 = Release|Win32 {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|x64.ActiveCfg = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.ActiveCfg = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|ARM.Build.0 = Debug|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.ActiveCfg = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|Win32.Build.0 = Debug|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.ActiveCfg = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Debug|x64.Build.0 = Debug|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.ActiveCfg = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|ARM.Build.0 = Release|ARM + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.ActiveCfg = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|Win32.Build.0 = Release|Win32 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.ActiveCfg = Release|x64 + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7}.Release|x64.Build.0 = Release|x64 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.ActiveCfg = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|ARM.Build.0 = Debug|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|Win32.Build.0 = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Debug|x64.ActiveCfg = Debug|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.ActiveCfg = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|ARM.Build.0 = Release|ARM + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.ActiveCfg = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|Win32.Build.0 = Release|Win32 + {E35634BD-B91B-4A6D-B957-96F56DD065F9}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -213,5 +246,9 @@ Global {BEA66276-51DD-4C53-92A8-F3D1FEA50892} = {FCB0EDBB-7A20-48D0-926B-E5617D40E6E5} {BCF5546D-66A0-4998-AFD6-C5514F618930} = {FCB0EDBB-7A20-48D0-926B-E5617D40E6E5} {CA082EC4-17CE-430B-8207-D1E947A5D1E9} = {FCB0EDBB-7A20-48D0-926B-E5617D40E6E5} + {74FBA998-B56C-4170-AF95-CFC4FFB40468} = {F13CB4F7-BEE5-4368-A815-A971797387D8} + {16AF311F-74CA-45A3-A82D-6334200FB124} = {74FBA998-B56C-4170-AF95-CFC4FFB40468} + {EC2B1292-2D8C-4FEB-A84B-2550B32C1AE7} = {74FBA998-B56C-4170-AF95-CFC4FFB40468} + {E35634BD-B91B-4A6D-B957-96F56DD065F9} = {74FBA998-B56C-4170-AF95-CFC4FFB40468} EndGlobalSection EndGlobal diff --git a/templates/js-template-default/project.json b/templates/js-template-default/project.json index e54f870660..6a7f37a61e 100644 --- a/templates/js-template-default/project.json +++ b/templates/js-template-default/project.json @@ -6,7 +6,7 @@ "frameRate" : 60, "id" : "gameCanvas", "renderMode" : 0, - "engineDir":"frameworks/cocos2d-html5", + "engineDir":"frameworks/cocos2d-x/web", "modules" : ["cocos2d"], diff --git a/templates/js-template-runtime/.project b/templates/js-template-runtime/.project new file mode 100644 index 0000000000..c816f0eddb --- /dev/null +++ b/templates/js-template-runtime/.project @@ -0,0 +1,23 @@ + + + HelloJavascript + + + + + + + org.ccdt.cocosproject + org.ccdt.jsdt.core.jsNature + + + 1.2 + + + + script + 2 + PROJECT_LOC/frameworks/js-bindings/bindings/script + + + diff --git a/templates/js-template-runtime/.settings/version.json b/templates/js-template-runtime/.settings/version.json new file mode 100644 index 0000000000..0369027256 --- /dev/null +++ b/templates/js-template-runtime/.settings/version.json @@ -0,0 +1,4 @@ +{ + "templateVersion":"1.8", + "runtimeVersion":"1.8" +} diff --git a/templates/js-template-runtime/cocos-project-template.json b/templates/js-template-runtime/cocos-project-template.json new file mode 100644 index 0000000000..b55c15e5ba --- /dev/null +++ b/templates/js-template-runtime/cocos-project-template.json @@ -0,0 +1,295 @@ +{ + "do_default":{ + "exclude_from_template":[ + "frameworks/runtime-src" + ], + "project_replace_project_name":{ + "src_project_name":"HelloJavascript", + "files":[ + "config.json", + ".project" + ] + }, + "append_dir":[ + { + "from":"plugin/plugins/facebook/proj.android/DependProject/src", + "to":"frameworks/cocos2d-x/plugin/plugins/facebook/proj.android/DependProject/src" + }, + { + "from":"cocos/scripting/js-bindings/script", + "to":"runtime/mac/PrebuiltRuntimeJs.app/Contents/Resources/script", + "exclude":[] + }, + { + "from":"cocos/scripting/js-bindings/script", + "to":"runtime/ios/PrebuiltRuntimeJs.app/script", + "exclude":[] + }, + { + "from":"cocos/scripting/js-bindings/script", + "to":"runtime/win32/script", + "exclude":[] + }, + { + "from":"templates/js-template-runtime/src", + "to":"runtime/win32/src", + "exclude":[] + }, + { + "from":"templates/js-template-runtime/res", + "to":"runtime/win32/res", + "exclude":[] + }, + { + "from":"external/win32-specific/gles/prebuilt", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/win32-specific/icon/prebuilt", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/win32-specific/MP3Decoder/prebuilt", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/win32-specific/OggDecoder/prebuilt", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/win32-specific/OpenalSoft/prebuilt", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/win32-specific/zlib/prebuilt", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/curl/prebuilt/win32", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/sqlite3/libraries/win32", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/websockets/prebuilt/win32", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/tiff/prebuilt/win32", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from":"external/spidermonkey/prebuilt/win32", + "to":"runtime/win32", + "include": [ + "*.dll" + ] + } + ], + "append_file":[ + { + "from":"tools/simulator/frameworks/runtime-src/Classes/ide-support/lang", + "to":"runtime/win32/lang" + }, + { + "from":"templates/js-template-runtime/project.json", + "to":"runtime/ios/PrebuiltRuntimeJs.app/project.json" + }, + { + "from":"templates/js-template-runtime/project.json", + "to":"runtime/win32/project.json" + }, + { + "from":"templates/js-template-runtime/config.json", + "to":"runtime/win32/config.json" + }, + { + "from":"templates/js-template-runtime/main.js", + "to":"runtime/win32/main.js" + } + ] + }, + "do_add_native_support":{ + "append_from_template":{ + "from":"frameworks/runtime-src", + "to":"frameworks/runtime-src", + "exclude":[ + "proj.android/bin", + "proj.android/assets", + "proj.ios_mac/HelloJavascript.xcodeproj/project.xcworkspace", + "proj.ios_mac/HelloJavascript.xcodeproj/xcuserdata", + "proj.win32/Debug.win32", + "proj.win32/Release.win32", + "proj.win32/HelloJavascript.sdf" + ] + }, + "append_dir":[ + { + "from":"tools/bindings-generator", + "to":"tools/bindings-generator", + "exclude":[ + ".git" + ] + }, + { + "from":"tools", + "to":"tools", + "include":[ + "tojs" + ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/Classes/ide-support", + "to": "frameworks/runtime-src/Classes/ide-support", + "exclude": [ + "RuntimeLuaImpl.*", + "lua_debugger.*" + ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.ios_mac/ios", + "to": "frameworks/runtime-src/proj.ios_mac/ios", + "exclude": [ + "RootViewController.*", + "Info.plist" + ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.ios_mac/mac", + "to": "frameworks/runtime-src/proj.ios_mac/mac", + "exclude": [ + "Info.plist", + "Icon.icns", + "build-cfg.json" + ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/build-cfg.json", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + }, + { + "from": "templates/lua-template-default/frameworks/runtime-src/proj.win32/game.rc", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/main.cpp", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/main.h", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/res", + "to": "frameworks/runtime-src/proj.win32/res", + "exclude": [] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/resource.h", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.cpp", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + }, + { + "from": "tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.h", + "to": "frameworks/runtime-src/proj.win32/", + "exclude": [] + } + ], + "append_x_engine":{ + "from": ".", + "to": "frameworks/cocos2d-x" + }, + "project_rename":{ + "src_project_name":"HelloJavascript", + "files":[ + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloJavascript", + "files":[ + "config.json", + "manifest.webapp", + ".project", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win32/main.cpp", + "frameworks/runtime-src/proj.android/.project", + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android/build.xml", + "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.ios_mac/ios/main.m", + "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", + "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", + "frameworks/runtime-src/Classes/AppDelegate.cpp" + ] + }, + "project_replace_package_name":{ + "src_package_name":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.android/AndroidManifest.xml" + ] + }, + "project_replace_mac_bundleid":{ + "src_bundle_id":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid":{ + "src_bundle_id":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] + } + } +} + diff --git a/templates/js-template-runtime/config.json b/templates/js-template-runtime/config.json new file mode 100644 index 0000000000..dc3ef56c2b --- /dev/null +++ b/templates/js-template-runtime/config.json @@ -0,0 +1,60 @@ +{ + "init_cfg":{ + "isLandscape": true, + "isWindowTop": false, + "name": "HelloJavascript", + "width": 960, + "height": 640, + "entry": "main.js", + "consolePort": 6050, + "uploadPort": 6060, + "debugPort": 5086 + }, + "simulator_screen_size": [ + { + "title": "iPhone 3Gs (480x320)", + "width": 480, + "height": 320 + }, + { + "title": "iPhone 4 (960x640)", + "width": 960, + "height": 640 + }, + { + "title": "iPhone 5 (1136x640)", + "width": 1136, + "height": 640 + }, + { + "title": "iPad (1024x768)", + "width": 1024, + "height": 768 + }, + { + "title": "iPad Retina (2048x1536)", + "width": 2048, + "height": 1536 + }, + { + "title": "Android (800x480)", + "width": 800, + "height": 480 + }, + { + "title": "Android (854x480)", + "width": 854, + "height": 480 + }, + { + "title": "Android (1280x720)", + "width": 1280, + "height": 720 + }, + { + "title": "Android (1920x1080)", + "width": 1920, + "height": 1080 + } + ] +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/js-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..81a01e10c2 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -0,0 +1,102 @@ +#include "AppDelegate.h" +#include "SimpleAudioEngine.h" + +#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX) +#include "ide-support/CodeIDESupport.h" +#endif + +#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) +#include "runtime/Runtime.h" +#include "ide-support/RuntimeJsImpl.h" +#else +#include "js_module_register.h" +#endif + +USING_NS_CC; +using namespace CocosDenshion; + +AppDelegate::AppDelegate() +{ +} + +AppDelegate::~AppDelegate() +{ + SimpleAudioEngine::end(); + ScriptEngineManager::destroyInstance(); + +#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) + // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE + RuntimeEngine::getInstance()->end(); +#endif +} + +//if you want a different context,just modify the value of glContextAttrs +//it will takes effect on all platforms +void AppDelegate::initGLContextAttrs() +{ + //set OpenGL context attributions,now can only set six attributions: + //red,green,blue,alpha,depth,stencil + GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; + + GLView::setGLContextAttrs(glContextAttrs); +} + +bool AppDelegate::applicationDidFinishLaunching() +{ + // initialize director + auto director = Director::getInstance(); + + // set FPS. the default value is 1.0/60 if you don't call this + director->setAnimationInterval(1.0 / 60); + +#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + // for getIPAddress + extern void setActivityPathForAndroid(const std::string &path); + setActivityPathForAndroid("org/cocos2dx/javascript/AppActivity"); +#endif + + auto runtimeEngine = RuntimeEngine::getInstance(); + auto jsRuntime = RuntimeJsImpl::create(); + runtimeEngine->addRuntime(jsRuntime, kRuntimeEngineJs); + runtimeEngine->start(); + + // js need special debug port + if (runtimeEngine->getProjectConfig().getDebuggerType() != kCCRuntimeDebuggerNone) + { + jsRuntime->startWithDebugger(); + } +#else + js_module_register(); + ScriptingCore* sc = ScriptingCore::getInstance(); + sc->start(); + sc->runScript("script/jsb_boot.js"); + ScriptEngineProtocol *engine = ScriptingCore::getInstance(); + ScriptEngineManager::getInstance()->setScriptEngine(engine); + ScriptingCore::getInstance()->runScript("main.js"); +#endif + + return true; +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() +{ + auto director = Director::getInstance(); + director->stopAnimation(); + director->getEventDispatcher()->dispatchCustomEvent("game_on_hide"); + SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); + SimpleAudioEngine::getInstance()->pauseAllEffects(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() +{ + auto director = Director::getInstance(); + director->startAnimation(); + director->getEventDispatcher()->dispatchCustomEvent("game_on_show"); + SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); + SimpleAudioEngine::getInstance()->resumeAllEffects(); +} + diff --git a/templates/js-template-runtime/frameworks/runtime-src/Classes/AppDelegate.h b/templates/js-template-runtime/frameworks/runtime-src/Classes/AppDelegate.h new file mode 100644 index 0000000000..a17ef82644 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/Classes/AppDelegate.h @@ -0,0 +1,47 @@ +// +// GCTestAppDelegate.h +// GCTest +// +// Created by Rohan Kuruvilla on 06/08/2012. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// + +#ifndef _APP_DELEGATE_H_ +#define _APP_DELEGATE_H_ + +#include "cocos2d.h" +/** + @brief The cocos2d Application. + + The reason for implement as private inheritance is to hide some interface call by Director. + */ +class AppDelegate : private cocos2d::Application +{ +public: + AppDelegate(); + virtual ~AppDelegate(); + + void initGLContextAttrs() override; + + /** + @brief Implement Director and Scene init code here. + @return true Initialize success, app continue. + @return false Initialize failed, app terminate. + */ + virtual bool applicationDidFinishLaunching(); + + /** + @brief The function be called when the application enter background + @param the pointer of the application + */ + virtual void applicationDidEnterBackground(); + + /** + @brief The function be called when the application enter foreground + @param the pointer of the application + */ + virtual void applicationWillEnterForeground(); +}; + +#endif // __APP_DELEGATE_H__ + diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h b/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h similarity index 100% rename from templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h rename to templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h diff --git a/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp b/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp new file mode 100644 index 0000000000..af4e6fff18 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp @@ -0,0 +1,70 @@ + +#include "json/document.h" +#include "json/filestream.h" +#include "json/stringbuffer.h" +#include "json/writer.h" +#include "SimpleConfigParser.h" + +// SimpleConfigParser +SimpleConfigParser *SimpleConfigParser::s_sharedSimpleConfigParserInstance = NULL; +SimpleConfigParser *SimpleConfigParser::getInstance(void) +{ + if (!s_sharedSimpleConfigParserInstance) + { + s_sharedSimpleConfigParserInstance = new SimpleConfigParser(); + s_sharedSimpleConfigParserInstance->readConfig(); + } + return s_sharedSimpleConfigParserInstance; +} + +void SimpleConfigParser::purge() +{ + CC_SAFE_DELETE(s_sharedSimpleConfigParserInstance); +} + +void SimpleConfigParser::readConfig(const string &filepath) +{ + string fullPathFile = filepath; + + // read config file + if (fullPathFile.empty()) + { + fullPathFile = FileUtils::getInstance()->fullPathForFilename(CONFIG_FILE); + } + string fileContent = FileUtils::getInstance()->getStringFromFile(fullPathFile); + + if(fileContent.empty()) + return; + + if (_docRootjson.Parse<0>(fileContent.c_str()).HasParseError()) { + cocos2d::log("read json file %s failed because of %d", fullPathFile.c_str(), _docRootjson.GetParseError()); + return; + } + + if (_docRootjson.HasMember("init_cfg")) + { + if(_docRootjson["init_cfg"].IsObject()) + { + const rapidjson::Value& objectInitView = _docRootjson["init_cfg"]; + if (objectInitView.HasMember("isLandscape") && objectInitView["isLandscape"].IsBool()) + { + _isLandscape = objectInitView["isLandscape"].GetBool(); + } + } + } +} + +SimpleConfigParser::SimpleConfigParser(void) : +_isLandscape(true) +{ +} + +rapidjson::Document& SimpleConfigParser::getConfigJsonRoot() +{ + return _docRootjson; +} + +bool SimpleConfigParser::isLanscape() +{ + return _isLandscape; +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.h b/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.h new file mode 100644 index 0000000000..2dc1aa0d8f --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.h @@ -0,0 +1,31 @@ +#ifndef __SIMPLE_CONFIG_PARSER_H__ +#define __SIMPLE_CONFIG_PARSER_H__ + +#include +#include +#include "cocos2d.h" +#include "json/document.h" +using namespace std; +USING_NS_CC; + +#define CONFIG_FILE "config.json" + +class SimpleConfigParser +{ +public: + static SimpleConfigParser *getInstance(void); + static void purge(); + + void readConfig(const string &filepath = ""); + bool isLanscape(); + rapidjson::Document& getConfigJsonRoot(); +private: + SimpleConfigParser(void); + static SimpleConfigParser *s_sharedSimpleConfigParserInstance; + bool _isLandscape; + + rapidjson::Document _docRootjson; +}; + +#endif // __SIMPLE_CONFIG_PARSER_H__ + diff --git a/templates/js-template-runtime/frameworks/runtime-src/Classes/js_module_register.h b/templates/js-template-runtime/frameworks/runtime-src/Classes/js_module_register.h new file mode 100644 index 0000000000..561b63bdc7 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/Classes/js_module_register.h @@ -0,0 +1,80 @@ +#ifndef __JS_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_JS_MODULE_HELPER_H__ +#define __JS_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_JS_MODULE_HELPER_H__ + +#include "scripting/js-bindings/manual/ScriptingCore.h" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_ui_auto.hpp" +#include "jsb_cocos2dx_studio_auto.hpp" +#include "jsb_cocos2dx_builder_auto.hpp" +#include "jsb_cocos2dx_spine_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" +#include "ui/jsb_cocos2dx_ui_manual.h" +#include "cocostudio/jsb_cocos2dx_studio_manual.h" +#include "cocosbuilder/js_bindings_ccbreader.h" +#include "spine/jsb_cocos2dx_spine_manual.h" +#include "extension/jsb_cocos2dx_extension_manual.h" +#include "localstorage/js_bindings_system_registration.h" +#include "chipmunk/js_bindings_chipmunk_registration.h" +#include "jsb_opengl_registration.h" +#include "network/XMLHTTPRequest.h" +#include "network/jsb_websocket.h" +#include "network/jsb_socketio.h" +#include "cocos2d_specifics.hpp" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#include "platform/android/CCJavascriptJavaBridge.h" +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#include "platform/ios/JavaScriptObjCBridge.h" +#endif + +USING_NS_CC; +int js_module_register() +{ + ScriptingCore* sc = ScriptingCore::getInstance(); + sc->addRegisterCallback(register_all_cocos2dx); + sc->addRegisterCallback(register_cocos2dx_js_core); + //sc->addRegisterCallback(register_cocos2dx_js_extensions); + sc->addRegisterCallback(jsb_register_system); + + // extension can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_extension); + sc->addRegisterCallback(register_all_cocos2dx_extension_manual); + + // chipmunk can be commented out to reduce the package + sc->addRegisterCallback(jsb_register_chipmunk); + // opengl can be commented out to reduce the package + sc->addRegisterCallback(JSB_register_opengl); + + // builder can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_builder); + sc->addRegisterCallback(register_CCBuilderReader); + + // ui can be commented out to reduce the package, attension studio need ui module + sc->addRegisterCallback(register_all_cocos2dx_ui); + sc->addRegisterCallback(register_all_cocos2dx_ui_manual); + + // studio can be commented out to reduce the package, + sc->addRegisterCallback(register_all_cocos2dx_studio); + sc->addRegisterCallback(register_all_cocos2dx_studio_manual); + + // spine can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_spine); + sc->addRegisterCallback(register_all_cocos2dx_spine_manual); + + // XmlHttpRequest can be commented out to reduce the package + sc->addRegisterCallback(MinXmlHttpRequest::_js_register); + // websocket can be commented out to reduce the package + sc->addRegisterCallback(register_jsb_websocket); + // sokcet io can be commented out to reduce the package + sc->addRegisterCallback(register_jsb_socketio); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + sc->addRegisterCallback(JavascriptJavaBridge::_js_register); +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS|| CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + sc->addRegisterCallback(JavaScriptObjCBridge::_js_register); +#endif + return 1; +} + +#endif // __JS_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_JS_MODULE_HELPER_H__ + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/.classpath b/templates/js-template-runtime/frameworks/runtime-src/proj.android/.classpath new file mode 100644 index 0000000000..d57ec02513 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/.project b/templates/js-template-runtime/frameworks/runtime-src/proj.android/.project new file mode 100644 index 0000000000..df461895c5 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/.project @@ -0,0 +1,65 @@ + + + HelloJavascript + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + Classes + 2 + COCOS2DX/projects/HelloJavascript/Classes + + + cocos2dx + 2 + COCOS2DX/cocos2dx + + + extensions + 2 + COCOS2DX/extensions + + + scripting + 2 + COCOS2DX/scripting + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs b/templates/js-template-runtime/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..b080d2ddc8 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml b/templates/js-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml new file mode 100644 index 0000000000..0aaa49d85f --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/README.md b/templates/js-template-runtime/frameworks/runtime-src/proj.android/README.md new file mode 100644 index 0000000000..312835611a --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/README.md @@ -0,0 +1,87 @@ +## Prerequisites: + +* Android NDK +* Android SDK **OR** Eclipse ADT Bundle +* Android AVD target installed + +## Building project + +There are two ways of building Android projects. + +1. Eclipse +2. Command Line + +### Import Project in Eclipse + +#### Features: + +1. Complete workflow from Eclipse, including: + * Build C++. + * Clean C++. + * Build and Run whole project. + * Logcat view. + * Debug Java code. + * Javascript editor. + * Project management. +2. True C++ editing, including: + * Code completion. + * Jump to definition. + * Refactoring tools etc. + * Quick open C++ files. + + +#### Setup Eclipse Environment (only once) + + +**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. + +1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) + + **OR** + + Install Eclipse with Java. Add ADT and CDT plugins. + +2. Only for Windows + 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). + 2. Add `Cygwin\bin` directory to system PATH variable. + 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. + +3. Set up Variables: + 1. Path Variable `COCOS2DX`: + * Eclipse->Preferences->General->Workspace->**Linked Resources** + * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. + ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) + + 2. C/C++ Environment Variable `NDK_ROOT`: + * Eclipse->Preferences->C/C++->Build->**Environment**. + * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. + ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) + * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` + +4. Import libcocos2dx library project: + 1. File->New->Project->Android Project From Existing Code. + 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. + 3. Click **Finish** to add project. + +#### Adding and running from Eclipse + +![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) + +1. File->New->Project->Android Project From Existing Code +2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` +3. Add the project +4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. + + +### Running project from Command Line + + $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ + $ export NDK_ROOT=/path/to/ndk + $ ./build_native.sh + $ ant debug install + +If the last command results in sdk.dir missing error then do: + + $ android list target + $ android update project -p . -t (id from step 6) + $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/ant.properties b/templates/js-template-runtime/frameworks/runtime-src/proj.android/ant.properties new file mode 100644 index 0000000000..f8af38bfb4 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/ant.properties @@ -0,0 +1 @@ +aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json b/templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json new file mode 100644 index 0000000000..fe8df19150 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json @@ -0,0 +1,35 @@ +{ + "ndk_module_path" :[ + "../../cocos2d-x", + "../../cocos2d-x/cocos", + "../../cocos2d-x/external" + ], + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + } + ], + "must_copy_resources": [ + { + "from": "../../cocos2d-x/cocos/scripting/js-bindings/script", + "to": "script" + }, + { + "from": "../../../config.json", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + } + ] +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/build.xml b/templates/js-template-runtime/frameworks/runtime-src/proj.android/build.xml new file mode 100644 index 0000000000..b46375fda9 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk new file mode 100644 index 0000000000..d2bd9dbe81 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk @@ -0,0 +1,30 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2djs_shared + +LOCAL_MODULE_FILENAME := libcocos2djs + +LOCAL_ARM_MODE := arm + +LOCAL_SRC_FILES := \ +../../Classes/AppDelegate.cpp \ +../../Classes/ide-support/SimpleConfigParser.cpp \ +../../Classes/ide-support/RuntimeJsImpl.cpp \ +hellojavascript/main.cpp + +LOCAL_C_INCLUDES := \ +$(LOCAL_PATH)/../../Classes \ +$(LOCAL_PATH)/../../../cocos2d-x/tools/simulator/libsimulator/lib \ +$(LOCAL_PATH)/../../../cocos2d-x/tools/simulator/libsimulator/lib/protobuf-lite + + +LOCAL_STATIC_LIBRARIES := cocos2d_js_static +LOCAL_STATIC_LIBRARIES += cocos2d_simulator_static + +include $(BUILD_SHARED_LIBRARY) + + +$(call import-module,scripting/js-bindings/proj.android) +$(call import-module,tools/simulator/libsimulator/proj.android) diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Application.mk b/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Application.mk new file mode 100644 index 0000000000..c36a5d06ec --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Application.mk @@ -0,0 +1,16 @@ +APP_STL := gnustl_static + +# Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices +#APP_ABI := armeabi-v7a + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp b/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp new file mode 100644 index 0000000000..bb3ea221bc --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp @@ -0,0 +1,34 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include +#include "ide-support/SimpleConfigParser.h" + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} + + +extern "C" +{ + bool Java_org_cocos2dx_javascript_AppActivity_nativeIsLandScape(JNIEnv *env, jobject thisz) + { + return SimpleConfigParser::getInstance()->isLanscape(); + } + + bool Java_org_cocos2dx_javascript_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz) + { +#if (COCOS2D_DEBUG > 0) + return true; +#else + return false; +#endif + } +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/proguard-project.txt b/templates/js-template-runtime/frameworks/runtime-src/proj.android/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png new file mode 100644 index 0000000000..8aa4767c2f Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png new file mode 100644 index 0000000000..17ce11a085 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png new file mode 100644 index 0000000000..3780aac46c Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/values/strings.xml b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/values/strings.xml new file mode 100644 index 0000000000..c847de2851 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + HelloJavascript + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java b/templates/js-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java new file mode 100644 index 0000000000..c1ec91b5eb --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java @@ -0,0 +1,83 @@ +/**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.javascript; + +import org.cocos2dx.lib.Cocos2dxActivity; +import org.cocos2dx.lib.Cocos2dxGLSurfaceView; +import android.content.pm.ActivityInfo; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; +import android.os.Bundle; +import android.view.WindowManager; + + +// The name of .so is specified in AndroidMenifest.xml. NativityActivity will load it automatically for you. +// You can use "System.loadLibrary()" to load other .so files. + +public class AppActivity extends Cocos2dxActivity{ + + static String hostIPAdress = "0.0.0.0"; + @Override + protected void onCreate(Bundle savedInstanceState) { + // TODO Auto-generated method stub + super.onCreate(savedInstanceState); + + if(nativeIsLandScape()) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); + } else { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); + } + if(nativeIsDebug()){ + getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + } + hostIPAdress = getHostIpAddress(); + } + + @Override + public Cocos2dxGLSurfaceView onCreateView() { + Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); + // TestCpp should create stencil buffer + glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); + + return glSurfaceView; + } + + public String getHostIpAddress() { + WifiManager wifiMgr = (WifiManager) getSystemService(WIFI_SERVICE); + WifiInfo wifiInfo = wifiMgr.getConnectionInfo(); + int ip = wifiInfo.getIpAddress(); + return ((ip & 0xFF) + "." + ((ip >>>= 8) & 0xFF) + "." + ((ip >>>= 8) & 0xFF) + "." + ((ip >>>= 8) & 0xFF)); + } + + public static String getLocalIpAddress() { + return hostIPAdress; + } + + private static native boolean nativeIsLandScape(); + private static native boolean nativeIsDebug(); + +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..3c49e23c65 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -0,0 +1,1224 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */; }; + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */; }; + 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */; }; + 1AC22EDE18CA0E11007112B9 /* project.json in Resources */ = {isa = PBXBuildFile; fileRef = 1A1A081B18C9DF05005C6854 /* project.json */; }; + 1AD7E0A818C9DB93004817A6 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6BF21418C9DB5900FB0E1C /* main.js */; }; + 1AD7E0A918C9DBE3004817A6 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6BF21418C9DB5900FB0E1C /* main.js */; }; + 1AE159EC18C9DF3600FCA372 /* project.json in Resources */ = {isa = PBXBuildFile; fileRef = 1A1A081B18C9DF05005C6854 /* project.json */; }; + 3E12D1A51957FA03002FF0FD /* script in Resources */ = {isa = PBXBuildFile; fileRef = 3E12D1A41957FA03002FF0FD /* script */; }; + 3E12D1A61957FA03002FF0FD /* script in Resources */ = {isa = PBXBuildFile; fileRef = 3E12D1A41957FA03002FF0FD /* script */; }; + 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 502380DB17EBB88200990C9B /* libcurl.dylib */; }; + 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731417ECDF7A00D62437 /* Icon-29.png */; }; + 5091731B17ECDF7A00D62437 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731517ECDF7A00D62437 /* Icon-40.png */; }; + 5091731C17ECDF7A00D62437 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731617ECDF7A00D62437 /* Icon-50.png */; }; + 5091731D17ECDF7A00D62437 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731717ECDF7A00D62437 /* Icon-58.png */; }; + 5091731E17ECDF7A00D62437 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731817ECDF7A00D62437 /* Icon-80.png */; }; + 5091731F17ECDF7A00D62437 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731917ECDF7A00D62437 /* Icon-100.png */; }; + 509D4A8117EBB24E00697056 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; + 509D4A8817EBB24E00697056 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */; }; + 509D4A8917EBB24E00697056 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D454520B156E22BD00887EB5 /* libz.dylib */; }; + 509D4A8A17EBB24E00697056 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + 509D4A8C17EBB24E00697056 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + 509D4A8D17EBB24E00697056 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + 509D4A9017EBB24E00697056 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + 509D4A9117EBB24E00697056 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + 509D4ABC17EBB2AB00697056 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 509D4AAC17EBB2AB00697056 /* AppController.mm */; }; + 509D4ABD17EBB2AB00697056 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */; }; + 509D4ABE17EBB2AB00697056 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AAE17EBB2AB00697056 /* Default.png */; }; + 509D4ABF17EBB2AB00697056 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AAF17EBB2AB00697056 /* Default@2x.png */; }; + 509D4AC017EBB2AB00697056 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB017EBB2AB00697056 /* Icon-57.png */; }; + 509D4AC117EBB2AB00697056 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB117EBB2AB00697056 /* Icon-72.png */; }; + 509D4AC217EBB2AB00697056 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB217EBB2AB00697056 /* Icon-76.png */; }; + 509D4AC317EBB2AB00697056 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB317EBB2AB00697056 /* Icon-114.png */; }; + 509D4AC417EBB2AB00697056 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB417EBB2AB00697056 /* Icon-120.png */; }; + 509D4AC517EBB2AB00697056 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB517EBB2AB00697056 /* Icon-144.png */; }; + 509D4AC617EBB2AB00697056 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB617EBB2AB00697056 /* Icon-152.png */; }; + 509D4AC817EBB2AB00697056 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 509D4AB817EBB2AB00697056 /* main.m */; }; + 509D4AC917EBB2AB00697056 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 509D4ABB17EBB2AB00697056 /* RootViewController.mm */; }; + 509D4ACF17EBB2BE00697056 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 509D4ACB17EBB2BE00697056 /* Icon.icns */; }; + 509D4AE717EBB81800697056 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 509D4AE617EBB81800697056 /* OpenGL.framework */; }; + 509D4AE917EBB82000697056 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 509D4AE817EBB82000697056 /* AppKit.framework */; }; + 509D4AEB17EBB82600697056 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 509D4AEA17EBB82600697056 /* IOKit.framework */; }; + 87D4C4451AB2187000F68C44 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 87D4C4441AB2187000F68C44 /* Security.framework */; }; + 9F20C9E61A5BD38A006FB50B /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F20C9E11A5BBE85006FB50B /* Security.framework */; }; + 9FD1E6B11A51361B0009A6C5 /* ConsoleWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FD1E69E1A51361B0009A6C5 /* ConsoleWindow.xib */; }; + 9FD1E6B21A51361B0009A6C5 /* ConsoleWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6A01A51361B0009A6C5 /* ConsoleWindowController.m */; }; + 9FD1E6B31A51361B0009A6C5 /* DeviceEx-mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6A11A51361B0009A6C5 /* DeviceEx-mac.mm */; }; + 9FD1E6B41A51361B0009A6C5 /* OpenUDIDMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6A41A51361B0009A6C5 /* OpenUDIDMac.m */; }; + 9FD1E6B51A51361B0009A6C5 /* PlayerEditBoxServiceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6A61A51361B0009A6C5 /* PlayerEditBoxServiceMac.mm */; }; + 9FD1E6B61A51361B0009A6C5 /* PlayerFileDialogServiceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6A81A51361B0009A6C5 /* PlayerFileDialogServiceMac.mm */; }; + 9FD1E6B71A51361B0009A6C5 /* PlayerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6AA1A51361B0009A6C5 /* PlayerMac.mm */; }; + 9FD1E6B81A51361B0009A6C5 /* PlayerMenuServiceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6AC1A51361B0009A6C5 /* PlayerMenuServiceMac.mm */; }; + 9FD1E6B91A51361B0009A6C5 /* PlayerMessageBoxServiceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6AE1A51361B0009A6C5 /* PlayerMessageBoxServiceMac.mm */; }; + 9FD1E6BA1A51361B0009A6C5 /* PlayerTaskServiceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9FD1E6B01A51361B0009A6C5 /* PlayerTaskServiceMac.mm */; }; + 9FD1E6BD1A51362E0009A6C5 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FD1E6BB1A51362E0009A6C5 /* MainMenu.xib */; }; + 9FFEB9A91A6AB7F70095C43A /* lang in Resources */ = {isa = PBXBuildFile; fileRef = 9FFEB9A01A6AB7F70095C43A /* lang */; }; + 9FFEB9AC1A6AB7F70095C43A /* RuntimeJsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FFEB9A31A6AB7F70095C43A /* RuntimeJsImpl.cpp */; }; + 9FFEB9AD1A6AB7F70095C43A /* RuntimeJsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FFEB9A31A6AB7F70095C43A /* RuntimeJsImpl.cpp */; }; + 9FFEB9BF1A6ABE9C0095C43A /* libsimulator Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FFEB9B81A6AB8810095C43A /* libsimulator Mac.a */; }; + 9FFEB9C21A6B86360095C43A /* SimpleConfigParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FFEB9C01A6B86360095C43A /* SimpleConfigParser.cpp */; }; + 9FFEB9C31A6B87420095C43A /* libsimulator iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FFEB9BA1A6AB8810095C43A /* libsimulator iOS.a */; }; + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + A92275441517C094001B78AA /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275431517C094001B78AA /* OpenGLES.framework */; }; + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; + A922754C1517C094001B78AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754B1517C094001B78AA /* UIKit.framework */; }; + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + BA4E718719EB6E7900932425 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA4E718619EB6E7900932425 /* MediaPlayer.framework */; }; + C03780EB18BEE0E400FE4F13 /* src in Resources */ = {isa = PBXBuildFile; fileRef = C03780EA18BEE0E400FE4F13 /* src */; }; + C03780EC18BEE0E400FE4F13 /* src in Resources */ = {isa = PBXBuildFile; fileRef = C03780EA18BEE0E400FE4F13 /* src */; }; + C037820C18BF77C500FE4F13 /* libjscocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C037820918BF76AF00FE4F13 /* libjscocos2d iOS.a */; }; + C037820F18BF77DE00FE4F13 /* libjscocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C037820718BF76AF00FE4F13 /* libjscocos2d Mac.a */; }; + C03C8B4B18A770DD00723415 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C03C8B4818A770DD00723415 /* main.m */; }; + C05D1C171923467600B808A4 /* config.json in Resources */ = {isa = PBXBuildFile; fileRef = C05D1C161923467600B808A4 /* config.json */; }; + C05D1C181923467600B808A4 /* config.json in Resources */ = {isa = PBXBuildFile; fileRef = C05D1C161923467600B808A4 /* config.json */; }; + C0799CB918BAE62000E9C828 /* res in Resources */ = {isa = PBXBuildFile; fileRef = C0799CB518BAE62000E9C828 /* res */; }; + C0799CBA18BAE62000E9C828 /* res in Resources */ = {isa = PBXBuildFile; fileRef = C0799CB518BAE62000E9C828 /* res */; }; + C0C2F37418AA0C66003976DA /* SimulatorApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C2F37318AA0C66003976DA /* SimulatorApp.mm */; }; + D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D454520B156E22BD00887EB5 /* libz.dylib */; }; + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; + D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061231803AB9F0077942B /* CoreMotion.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1551A33E158F2AB200E66CFE; + remoteInfo = "cocos2dx Mac"; + }; + 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2FC117814595006731B9; + remoteInfo = "cocos2dx-extensions Mac"; + }; + 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2B781780BD04006731B9; + remoteInfo = "chipmunk Mac"; + }; + 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2E9817814268006731B9; + remoteInfo = "CocosDenshion Mac"; + }; + 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1A676830180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1A676832180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1A676834180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1551A33F158F2AB200E66CFE; + remoteInfo = "cocos2dx Mac"; + }; + 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2FD617814595006731B9; + remoteInfo = "cocos2dx-extensions Mac"; + }; + 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2CB81780BD04006731B9; + remoteInfo = "chipmunk Mac"; + }; + 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2D9B1780BDF7006731B9; + remoteInfo = "box2d Mac"; + }; + 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2ED617814268006731B9; + remoteInfo = "CocosDenshion Mac"; + }; + 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4D641783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 9FFEB9B71A6AB8810095C43A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9F7214351A5C271F00DAED06; + remoteInfo = "libsimulator Mac"; + }; + 9FFEB9B91A6AB8810095C43A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9F7214851A5C28BA00DAED06; + remoteInfo = "libsimulator iOS"; + }; + 9FFEB9BB1A6AB8940095C43A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 9F7214341A5C271F00DAED06; + remoteInfo = "libsimulator Mac"; + }; + 9FFEB9BD1A6AB89B0095C43A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 9F7214841A5C28BA00DAED06; + remoteInfo = "libsimulator iOS"; + }; + 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4EFC1783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4F3B178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4F9E1783876B0073F6A7; + remoteInfo = "box2d iOS"; + }; + 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4FB4178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + C037820618BF76AF00FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1A5410A418B785A10016A3AF; + remoteInfo = "jsbindings Mac"; + }; + C037820818BF76AF00FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1A5410A518B785A10016A3AF; + remoteInfo = "jsbindings iOS"; + }; + C037820A18BF77BC00FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4FB5178387750073F6A7; + remoteInfo = "jsbindings iOS"; + }; + C037820D18BF77D100FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F31E81781479B006731B9; + remoteInfo = "jsbindings Mac"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1A1A081B18C9DF05005C6854 /* project.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = project.json; path = ../../../project.json; sourceTree = ""; }; + 1A6BF21418C9DB5900FB0E1C /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../../../main.js; sourceTree = ""; }; + 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + 1A96A4F2174A3432008653A9 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "../../cocos2d-x/cocos2dx/platform/third_party/ios/libraries/libcurl.a"; sourceTree = ""; }; + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = ""; }; + 3E12D1A41957FA03002FF0FD /* script */ = {isa = PBXFileReference; lastKnownFileType = folder; name = script; path = "../../cocos2d-x/cocos/scripting/js-bindings/script"; sourceTree = ""; }; + 502380DB17EBB88200990C9B /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; + 5091731417ECDF7A00D62437 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-29.png"; path = "ios/Icon-29.png"; sourceTree = ""; }; + 5091731517ECDF7A00D62437 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-40.png"; path = "ios/Icon-40.png"; sourceTree = ""; }; + 5091731617ECDF7A00D62437 /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-50.png"; path = "ios/Icon-50.png"; sourceTree = ""; }; + 5091731717ECDF7A00D62437 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-58.png"; path = "ios/Icon-58.png"; sourceTree = ""; }; + 5091731817ECDF7A00D62437 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-80.png"; path = "ios/Icon-80.png"; sourceTree = ""; }; + 5091731917ECDF7A00D62437 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-100.png"; path = "ios/Icon-100.png"; sourceTree = ""; }; + 509D4AAA17EBB24E00697056 /* HelloJavascript-desktop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloJavascript-desktop.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 509D4AAB17EBB2AB00697056 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = ios/AppController.h; sourceTree = ""; }; + 509D4AAC17EBB2AB00697056 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppController.mm; path = ios/AppController.mm; sourceTree = ""; }; + 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "ios/Default-568h@2x.png"; sourceTree = ""; }; + 509D4AAE17EBB2AB00697056 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = ios/Default.png; sourceTree = ""; }; + 509D4AAF17EBB2AB00697056 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "ios/Default@2x.png"; sourceTree = ""; }; + 509D4AB017EBB2AB00697056 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-57.png"; path = "ios/Icon-57.png"; sourceTree = ""; }; + 509D4AB117EBB2AB00697056 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "ios/Icon-72.png"; sourceTree = ""; }; + 509D4AB217EBB2AB00697056 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-76.png"; path = "ios/Icon-76.png"; sourceTree = ""; }; + 509D4AB317EBB2AB00697056 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-114.png"; path = "ios/Icon-114.png"; sourceTree = ""; }; + 509D4AB417EBB2AB00697056 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-120.png"; path = "ios/Icon-120.png"; sourceTree = ""; }; + 509D4AB517EBB2AB00697056 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-144.png"; path = "ios/Icon-144.png"; sourceTree = ""; }; + 509D4AB617EBB2AB00697056 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-152.png"; path = "ios/Icon-152.png"; sourceTree = ""; }; + 509D4AB717EBB2AB00697056 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ios/Info.plist; sourceTree = ""; }; + 509D4AB817EBB2AB00697056 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ios/main.m; sourceTree = ""; }; + 509D4AB917EBB2AB00697056 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = ios/Prefix.pch; sourceTree = ""; }; + 509D4ABA17EBB2AB00697056 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewController.h; path = ios/RootViewController.h; sourceTree = ""; }; + 509D4ABB17EBB2AB00697056 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RootViewController.mm; path = ios/RootViewController.mm; sourceTree = ""; }; + 509D4ACB17EBB2BE00697056 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; + 509D4ACC17EBB2BE00697056 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 509D4ACE17EBB2BE00697056 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; + 509D4AE617EBB81800697056 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 509D4AE817EBB82000697056 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 509D4AEA17EBB82600697056 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 87D4C4441AB2187000F68C44 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 9F20C9E11A5BBE85006FB50B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + 9FD1E69E1A51361B0009A6C5 /* ConsoleWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ConsoleWindow.xib; sourceTree = ""; }; + 9FD1E69F1A51361B0009A6C5 /* ConsoleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleWindowController.h; sourceTree = ""; }; + 9FD1E6A01A51361B0009A6C5 /* ConsoleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleWindowController.m; sourceTree = ""; }; + 9FD1E6A11A51361B0009A6C5 /* DeviceEx-mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DeviceEx-mac.mm"; sourceTree = ""; }; + 9FD1E6A31A51361B0009A6C5 /* OpenUDIDMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenUDIDMac.h; sourceTree = ""; }; + 9FD1E6A41A51361B0009A6C5 /* OpenUDIDMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenUDIDMac.m; sourceTree = ""; }; + 9FD1E6A51A51361B0009A6C5 /* PlayerEditBoxServiceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerEditBoxServiceMac.h; sourceTree = ""; }; + 9FD1E6A61A51361B0009A6C5 /* PlayerEditBoxServiceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlayerEditBoxServiceMac.mm; sourceTree = ""; }; + 9FD1E6A71A51361B0009A6C5 /* PlayerFileDialogServiceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerFileDialogServiceMac.h; sourceTree = ""; }; + 9FD1E6A81A51361B0009A6C5 /* PlayerFileDialogServiceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlayerFileDialogServiceMac.mm; sourceTree = ""; }; + 9FD1E6A91A51361B0009A6C5 /* PlayerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerMac.h; sourceTree = ""; }; + 9FD1E6AA1A51361B0009A6C5 /* PlayerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlayerMac.mm; sourceTree = ""; }; + 9FD1E6AB1A51361B0009A6C5 /* PlayerMenuServiceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerMenuServiceMac.h; sourceTree = ""; }; + 9FD1E6AC1A51361B0009A6C5 /* PlayerMenuServiceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlayerMenuServiceMac.mm; sourceTree = ""; }; + 9FD1E6AD1A51361B0009A6C5 /* PlayerMessageBoxServiceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerMessageBoxServiceMac.h; sourceTree = ""; }; + 9FD1E6AE1A51361B0009A6C5 /* PlayerMessageBoxServiceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlayerMessageBoxServiceMac.mm; sourceTree = ""; }; + 9FD1E6AF1A51361B0009A6C5 /* PlayerTaskServiceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerTaskServiceMac.h; sourceTree = ""; }; + 9FD1E6B01A51361B0009A6C5 /* PlayerTaskServiceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlayerTaskServiceMac.mm; sourceTree = ""; }; + 9FD1E6BC1A51362E0009A6C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 9FD1E6BE1A5136370009A6C5 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.xib"; sourceTree = ""; }; + 9FFEB99F1A6AB7F70095C43A /* CodeIDESupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeIDESupport.h; sourceTree = ""; }; + 9FFEB9A01A6AB7F70095C43A /* lang */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lang; sourceTree = ""; }; + 9FFEB9A31A6AB7F70095C43A /* RuntimeJsImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeJsImpl.cpp; sourceTree = ""; }; + 9FFEB9A41A6AB7F70095C43A /* RuntimeJsImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeJsImpl.h; sourceTree = ""; }; + 9FFEB9A71A6AB7F70095C43A /* js_module_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_module_register.h; sourceTree = ""; }; + 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libsimulator.xcodeproj; path = "../../cocos2d-x/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj"; sourceTree = ""; }; + 9FFEB9C01A6B86360095C43A /* SimpleConfigParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleConfigParser.cpp; sourceTree = ""; }; + 9FFEB9C11A6B86360095C43A /* SimpleConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleConfigParser.h; sourceTree = ""; }; + A922753D1517C094001B78AA /* HelloJavascript-mobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloJavascript-mobile.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + A92275411517C094001B78AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + A92275431517C094001B78AA /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + A92275451517C094001B78AA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + A92275471517C094001B78AA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + A92275491517C094001B78AA /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + A922754B1517C094001B78AA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + A922754D1517C094001B78AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + A922754F1517C094001B78AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + BA4E718619EB6E7900932425 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; + C03780EA18BEE0E400FE4F13 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../../../src; sourceTree = ""; }; + C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_js_bindings.xcodeproj; path = "../../cocos2d-x/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj"; sourceTree = ""; }; + C03C8B4818A770DD00723415 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + C05D1C161923467600B808A4 /* config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = config.json; path = ../../../config.json; sourceTree = ""; }; + C0799CB518BAE62000E9C828 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../../../res; sourceTree = ""; }; + C0C2F37218AA0C66003976DA /* SimulatorApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatorApp.h; sourceTree = ""; }; + C0C2F37318AA0C66003976DA /* SimulatorApp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimulatorApp.mm; sourceTree = ""; }; + D454520B156E22BD00887EB5 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + D4545215156E28EF00887EB5 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; + D4545216156E28EF00887EB5 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + D6B061231803AB9F0077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 509D4A8217EBB24E00697056 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 87D4C4451AB2187000F68C44 /* Security.framework in Frameworks */, + 9FFEB9BF1A6ABE9C0095C43A /* libsimulator Mac.a in Frameworks */, + C037820F18BF77DE00FE4F13 /* libjscocos2d Mac.a in Frameworks */, + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */, + 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */, + 509D4A8817EBB24E00697056 /* libsqlite3.dylib in Frameworks */, + 509D4A8917EBB24E00697056 /* libz.dylib in Frameworks */, + 509D4AEB17EBB82600697056 /* IOKit.framework in Frameworks */, + 509D4AE917EBB82000697056 /* AppKit.framework in Frameworks */, + 509D4AE717EBB81800697056 /* OpenGL.framework in Frameworks */, + 509D4A8A17EBB24E00697056 /* QuartzCore.framework in Frameworks */, + 509D4A8C17EBB24E00697056 /* OpenAL.framework in Frameworks */, + 509D4A8D17EBB24E00697056 /* AudioToolbox.framework in Frameworks */, + 509D4A9017EBB24E00697056 /* Foundation.framework in Frameworks */, + 509D4A9117EBB24E00697056 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A922753A1517C094001B78AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9FFEB9C31A6B87420095C43A /* libsimulator iOS.a in Frameworks */, + 9F20C9E61A5BD38A006FB50B /* Security.framework in Frameworks */, + BA4E718719EB6E7900932425 /* MediaPlayer.framework in Frameworks */, + C037820C18BF77C500FE4F13 /* libjscocos2d iOS.a in Frameworks */, + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */, + D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */, + 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */, + D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */, + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, + A92275441517C094001B78AA /* OpenGLES.framework in Frameworks */, + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */, + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */, + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */, + A922754C1517C094001B78AA /* UIKit.framework in Frameworks */, + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 15628F5B15F0F5C2000CF24B /* Resources */ = { + isa = PBXGroup; + children = ( + C05D1C161923467600B808A4 /* config.json */, + 1A1A081B18C9DF05005C6854 /* project.json */, + 1A6BF21418C9DB5900FB0E1C /* main.js */, + C0799CB518BAE62000E9C828 /* res */, + C03780EA18BEE0E400FE4F13 /* src */, + ); + name = Resources; + sourceTree = ""; + }; + 1AC6FB35180E9ACB004C840B /* Products */ = { + isa = PBXGroup; + children = ( + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */, + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */, + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */, + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */, + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */, + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */, + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */, + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */, + ); + name = Products; + sourceTree = ""; + }; + 5091732E17ECDF8A00D62437 /* Icons */ = { + isa = PBXGroup; + children = ( + 5091731417ECDF7A00D62437 /* Icon-29.png */, + 5091731517ECDF7A00D62437 /* Icon-40.png */, + 5091731617ECDF7A00D62437 /* Icon-50.png */, + 5091731717ECDF7A00D62437 /* Icon-58.png */, + 5091731817ECDF7A00D62437 /* Icon-80.png */, + 5091731917ECDF7A00D62437 /* Icon-100.png */, + 509D4AB017EBB2AB00697056 /* Icon-57.png */, + 509D4AB117EBB2AB00697056 /* Icon-72.png */, + 509D4AB217EBB2AB00697056 /* Icon-76.png */, + 509D4AB317EBB2AB00697056 /* Icon-114.png */, + 509D4AB417EBB2AB00697056 /* Icon-120.png */, + 509D4AB517EBB2AB00697056 /* Icon-144.png */, + 509D4AB617EBB2AB00697056 /* Icon-152.png */, + ); + name = Icons; + sourceTree = ""; + }; + 509D4ACA17EBB2BE00697056 /* mac */ = { + isa = PBXGroup; + children = ( + 9FD1E69D1A51361B0009A6C5 /* service */, + C0C2F37218AA0C66003976DA /* SimulatorApp.h */, + C0C2F37318AA0C66003976DA /* SimulatorApp.mm */, + C03C8B4818A770DD00723415 /* main.m */, + 9FD1E6BB1A51362E0009A6C5 /* MainMenu.xib */, + 509D4ACB17EBB2BE00697056 /* Icon.icns */, + 509D4ACC17EBB2BE00697056 /* Info.plist */, + 509D4ACE17EBB2BE00697056 /* Prefix.pch */, + ); + path = mac; + sourceTree = ""; + }; + 9FD1E69D1A51361B0009A6C5 /* service */ = { + isa = PBXGroup; + children = ( + 9FD1E69E1A51361B0009A6C5 /* ConsoleWindow.xib */, + 9FD1E69F1A51361B0009A6C5 /* ConsoleWindowController.h */, + 9FD1E6A01A51361B0009A6C5 /* ConsoleWindowController.m */, + 9FD1E6A11A51361B0009A6C5 /* DeviceEx-mac.mm */, + 9FD1E6A21A51361B0009A6C5 /* openudid */, + 9FD1E6A51A51361B0009A6C5 /* PlayerEditBoxServiceMac.h */, + 9FD1E6A61A51361B0009A6C5 /* PlayerEditBoxServiceMac.mm */, + 9FD1E6A71A51361B0009A6C5 /* PlayerFileDialogServiceMac.h */, + 9FD1E6A81A51361B0009A6C5 /* PlayerFileDialogServiceMac.mm */, + 9FD1E6A91A51361B0009A6C5 /* PlayerMac.h */, + 9FD1E6AA1A51361B0009A6C5 /* PlayerMac.mm */, + 9FD1E6AB1A51361B0009A6C5 /* PlayerMenuServiceMac.h */, + 9FD1E6AC1A51361B0009A6C5 /* PlayerMenuServiceMac.mm */, + 9FD1E6AD1A51361B0009A6C5 /* PlayerMessageBoxServiceMac.h */, + 9FD1E6AE1A51361B0009A6C5 /* PlayerMessageBoxServiceMac.mm */, + 9FD1E6AF1A51361B0009A6C5 /* PlayerTaskServiceMac.h */, + 9FD1E6B01A51361B0009A6C5 /* PlayerTaskServiceMac.mm */, + ); + path = service; + sourceTree = ""; + }; + 9FD1E6A21A51361B0009A6C5 /* openudid */ = { + isa = PBXGroup; + children = ( + 9FD1E6A31A51361B0009A6C5 /* OpenUDIDMac.h */, + 9FD1E6A41A51361B0009A6C5 /* OpenUDIDMac.m */, + ); + path = openudid; + sourceTree = ""; + }; + 9FFEB99E1A6AB7F70095C43A /* ide-support */ = { + isa = PBXGroup; + children = ( + 9FFEB9C01A6B86360095C43A /* SimpleConfigParser.cpp */, + 9FFEB9C11A6B86360095C43A /* SimpleConfigParser.h */, + 9FFEB99F1A6AB7F70095C43A /* CodeIDESupport.h */, + 9FFEB9A01A6AB7F70095C43A /* lang */, + 9FFEB9A31A6AB7F70095C43A /* RuntimeJsImpl.cpp */, + 9FFEB9A41A6AB7F70095C43A /* RuntimeJsImpl.h */, + ); + path = "ide-support"; + sourceTree = ""; + }; + 9FFEB9B31A6AB8810095C43A /* Products */ = { + isa = PBXGroup; + children = ( + 9FFEB9B81A6AB8810095C43A /* libsimulator Mac.a */, + 9FFEB9BA1A6AB8810095C43A /* libsimulator iOS.a */, + ); + name = Products; + sourceTree = ""; + }; + A92275321517C094001B78AA = { + isa = PBXGroup; + children = ( + 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */, + C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */, + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */, + C06D18B718C02D4A003D1A65 /* JS Common */, + D4545214156E28EF00887EB5 /* Classes */, + A92275401517C094001B78AA /* Frameworks */, + D45446CC156DE73F00887EB5 /* ios */, + 509D4ACA17EBB2BE00697056 /* mac */, + A922753E1517C094001B78AA /* Products */, + 15628F5B15F0F5C2000CF24B /* Resources */, + ); + sourceTree = ""; + }; + A922753E1517C094001B78AA /* Products */ = { + isa = PBXGroup; + children = ( + A922753D1517C094001B78AA /* HelloJavascript-mobile.app */, + 509D4AAA17EBB24E00697056 /* HelloJavascript-desktop.app */, + ); + name = Products; + sourceTree = ""; + }; + A92275401517C094001B78AA /* Frameworks */ = { + isa = PBXGroup; + children = ( + BA4E718219EB6E4600932425 /* GameController.framework */, + BA4E718019EB6E3E00932425 /* MediaPlayer.framework */, + 87D4C4441AB2187000F68C44 /* Security.framework */, + 9F20C9E11A5BBE85006FB50B /* Security.framework */, + D6B061231803AB9F0077942B /* CoreMotion.framework */, + 502380DB17EBB88200990C9B /* libcurl.dylib */, + 509D4AEA17EBB82600697056 /* IOKit.framework */, + 509D4AE817EBB82000697056 /* AppKit.framework */, + 509D4AE617EBB81800697056 /* OpenGL.framework */, + 1A96A4F2174A3432008653A9 /* libcurl.a */, + 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */, + D454520B156E22BD00887EB5 /* libz.dylib */, + A92275411517C094001B78AA /* QuartzCore.framework */, + A92275431517C094001B78AA /* OpenGLES.framework */, + A92275451517C094001B78AA /* OpenAL.framework */, + A92275471517C094001B78AA /* AudioToolbox.framework */, + A92275491517C094001B78AA /* AVFoundation.framework */, + A922754B1517C094001B78AA /* UIKit.framework */, + A922754D1517C094001B78AA /* Foundation.framework */, + A922754F1517C094001B78AA /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C037820218BF76AF00FE4F13 /* Products */ = { + isa = PBXGroup; + children = ( + C037820718BF76AF00FE4F13 /* libjscocos2d Mac.a */, + C037820918BF76AF00FE4F13 /* libjscocos2d iOS.a */, + ); + name = Products; + sourceTree = ""; + }; + C06D18B718C02D4A003D1A65 /* JS Common */ = { + isa = PBXGroup; + children = ( + 3E12D1A41957FA03002FF0FD /* script */, + ); + name = "JS Common"; + sourceTree = ""; + }; + D45446CC156DE73F00887EB5 /* ios */ = { + isa = PBXGroup; + children = ( + 509D4AAB17EBB2AB00697056 /* AppController.h */, + 509D4AAC17EBB2AB00697056 /* AppController.mm */, + 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */, + 509D4AAE17EBB2AB00697056 /* Default.png */, + 509D4AAF17EBB2AB00697056 /* Default@2x.png */, + 5091732E17ECDF8A00D62437 /* Icons */, + 509D4AB717EBB2AB00697056 /* Info.plist */, + 509D4AB817EBB2AB00697056 /* main.m */, + 509D4AB917EBB2AB00697056 /* Prefix.pch */, + 509D4ABA17EBB2AB00697056 /* RootViewController.h */, + 509D4ABB17EBB2AB00697056 /* RootViewController.mm */, + ); + name = ios; + sourceTree = ""; + }; + D4545214156E28EF00887EB5 /* Classes */ = { + isa = PBXGroup; + children = ( + 9FFEB99E1A6AB7F70095C43A /* ide-support */, + 9FFEB9A71A6AB7F70095C43A /* js_module_register.h */, + D4545215156E28EF00887EB5 /* AppDelegate.cpp */, + D4545216156E28EF00887EB5 /* AppDelegate.h */, + ); + name = Classes; + path = ../Classes; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 509D4A7517EBB24E00697056 /* HelloJavascript-desktop */ = { + isa = PBXNativeTarget; + buildConfigurationList = 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "HelloJavascript-desktop" */; + buildPhases = ( + 509D4A8017EBB24E00697056 /* Sources */, + 509D4A9317EBB24E00697056 /* Resources */, + 509D4A8217EBB24E00697056 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 9FFEB9BC1A6AB8940095C43A /* PBXTargetDependency */, + C037820E18BF77D100FE4F13 /* PBXTargetDependency */, + 1A676820180E9BF70076BC67 /* PBXTargetDependency */, + 1A676822180E9BF70076BC67 /* PBXTargetDependency */, + 1A676824180E9BF70076BC67 /* PBXTargetDependency */, + 1A676826180E9BF70076BC67 /* PBXTargetDependency */, + ); + name = "HelloJavascript-desktop"; + productName = HelloJavascript; + productReference = 509D4AAA17EBB24E00697056 /* HelloJavascript-desktop.app */; + productType = "com.apple.product-type.application"; + }; + A922753C1517C094001B78AA /* HelloJavascript-mobile */ = { + isa = PBXNativeTarget; + buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "HelloJavascript-mobile" */; + buildPhases = ( + A92275391517C094001B78AA /* Sources */, + A922753A1517C094001B78AA /* Frameworks */, + A922753B1517C094001B78AA /* Resources */, + 3EC03834196541CD00D72B70 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 9FFEB9BE1A6AB89B0095C43A /* PBXTargetDependency */, + C037820B18BF77BC00FE4F13 /* PBXTargetDependency */, + 1A67682F180E9C110076BC67 /* PBXTargetDependency */, + 1A676831180E9C110076BC67 /* PBXTargetDependency */, + 1A676833180E9C110076BC67 /* PBXTargetDependency */, + 1A676835180E9C110076BC67 /* PBXTargetDependency */, + ); + name = "HelloJavascript-mobile"; + productName = HelloJavascript; + productReference = A922753D1517C094001B78AA /* HelloJavascript-mobile.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A92275341517C094001B78AA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + TargetAttributes = { + A922753C1517C094001B78AA = { + DevelopmentTeam = MDDB52YB8L; + }; + }; + }; + buildConfigurationList = A92275371517C094001B78AA /* Build configuration list for PBXProject "HelloJavascript" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + "zh-Hans", + ); + mainGroup = A92275321517C094001B78AA; + productRefGroup = A922753E1517C094001B78AA /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = C037820218BF76AF00FE4F13 /* Products */; + ProjectRef = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + }, + { + ProductGroup = 1AC6FB35180E9ACB004C840B /* Products */; + ProjectRef = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + }, + { + ProductGroup = 9FFEB9B31A6AB8810095C43A /* Products */; + ProjectRef = 9FFEB9B21A6AB8810095C43A /* libsimulator.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + A922753C1517C094001B78AA /* HelloJavascript-mobile */, + 509D4A7517EBB24E00697056 /* HelloJavascript-desktop */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx Mac.a"; + remoteRef = 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx-extensions Mac.a"; + remoteRef = 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libchipmunk Mac.a"; + remoteRef = 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libbox2d Mac.a"; + remoteRef = 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCocosDenshion Mac.a"; + remoteRef = 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx iOS.a"; + remoteRef = 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx-extensions iOS.a"; + remoteRef = 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 9FFEB9B81A6AB8810095C43A /* libsimulator Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libsimulator Mac.a"; + remoteRef = 9FFEB9B71A6AB8810095C43A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 9FFEB9BA1A6AB8810095C43A /* libsimulator iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libsimulator iOS.a"; + remoteRef = 9FFEB9B91A6AB8810095C43A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libchipmunk iOS.a"; + remoteRef = 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libbox2d iOS.a"; + remoteRef = 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCocosDenshion iOS.a"; + remoteRef = 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C037820718BF76AF00FE4F13 /* libjscocos2d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libjscocos2d Mac.a"; + remoteRef = C037820618BF76AF00FE4F13 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C037820918BF76AF00FE4F13 /* libjscocos2d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libjscocos2d iOS.a"; + remoteRef = C037820818BF76AF00FE4F13 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 509D4A9317EBB24E00697056 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1AC22EDE18CA0E11007112B9 /* project.json in Resources */, + 9FD1E6B11A51361B0009A6C5 /* ConsoleWindow.xib in Resources */, + 1AD7E0A918C9DBE3004817A6 /* main.js in Resources */, + C05D1C181923467600B808A4 /* config.json in Resources */, + 3E12D1A61957FA03002FF0FD /* script in Resources */, + C0799CBA18BAE62000E9C828 /* res in Resources */, + 509D4ACF17EBB2BE00697056 /* Icon.icns in Resources */, + 9FFEB9A91A6AB7F70095C43A /* lang in Resources */, + C03780EC18BEE0E400FE4F13 /* src in Resources */, + 9FD1E6BD1A51362E0009A6C5 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A922753B1517C094001B78AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1AE159EC18C9DF3600FCA372 /* project.json in Resources */, + 1AD7E0A818C9DB93004817A6 /* main.js in Resources */, + 509D4ABE17EBB2AB00697056 /* Default.png in Resources */, + C05D1C171923467600B808A4 /* config.json in Resources */, + 5091731E17ECDF7A00D62437 /* Icon-80.png in Resources */, + 5091731F17ECDF7A00D62437 /* Icon-100.png in Resources */, + 509D4AC117EBB2AB00697056 /* Icon-72.png in Resources */, + 509D4AC017EBB2AB00697056 /* Icon-57.png in Resources */, + 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */, + C03780EB18BEE0E400FE4F13 /* src in Resources */, + 509D4AC617EBB2AB00697056 /* Icon-152.png in Resources */, + 3E12D1A51957FA03002FF0FD /* script in Resources */, + C0799CB918BAE62000E9C828 /* res in Resources */, + 509D4AC517EBB2AB00697056 /* Icon-144.png in Resources */, + 509D4AC317EBB2AB00697056 /* Icon-114.png in Resources */, + 509D4ABD17EBB2AB00697056 /* Default-568h@2x.png in Resources */, + 509D4ABF17EBB2AB00697056 /* Default@2x.png in Resources */, + 509D4AC217EBB2AB00697056 /* Icon-76.png in Resources */, + 5091731B17ECDF7A00D62437 /* Icon-40.png in Resources */, + 5091731C17ECDF7A00D62437 /* Icon-50.png in Resources */, + 509D4AC417EBB2AB00697056 /* Icon-120.png in Resources */, + 5091731D17ECDF7A00D62437 /* Icon-58.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3EC03834196541CD00D72B70 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 12; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "find ${SRCROOT}/../../../src/ -name \"*\" -exec touch -cm {} \\;\nfind ${SRCROOT}/../../../res/ -name \"*\" -exec touch -cm {} \\;"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 509D4A8017EBB24E00697056 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9FD1E6B61A51361B0009A6C5 /* PlayerFileDialogServiceMac.mm in Sources */, + 3E12D1E61957FB18002FF0FD /* common.cc in Sources */, + 9FD1E6B51A51361B0009A6C5 /* PlayerEditBoxServiceMac.mm in Sources */, + 9FD1E6EE1A5169230009A6C5 /* AppLang.cpp in Sources */, + 9FD1E6B21A51361B0009A6C5 /* ConsoleWindowController.m in Sources */, + 3E12D1E81957FB18002FF0FD /* once.cc in Sources */, + 9FD1E6ED1A5169230009A6C5 /* AppEvent.cpp in Sources */, + 3E12D1E01957FB18002FF0FD /* message_lite.cc in Sources */, + 3E12D1D61957FB18002FF0FD /* extension_set.cc in Sources */, + C00FD4B51938628E00C6382D /* PlayDisable_png.cpp in Sources */, + AB9079D519E931D80033128B /* ConsoleCommand.cpp in Sources */, + 3E12D1EA1957FB18002FF0FD /* stringprintf.cc in Sources */, + C06C37891918E81100617BED /* ConfigParser.cpp in Sources */, + 9FD1E6B71A51361B0009A6C5 /* PlayerMac.mm in Sources */, + 509D4A8117EBB24E00697056 /* AppDelegate.cpp in Sources */, + 9FD1E6BA1A51361B0009A6C5 /* PlayerTaskServiceMac.mm in Sources */, + C0C2F37418AA0C66003976DA /* SimulatorApp.mm in Sources */, + 9FD1E6B41A51361B0009A6C5 /* OpenUDIDMac.m in Sources */, + 9FD1E6B91A51361B0009A6C5 /* PlayerMessageBoxServiceMac.mm in Sources */, + 9FD1E6B31A51361B0009A6C5 /* DeviceEx-mac.mm in Sources */, + C03C8B4B18A770DD00723415 /* main.m in Sources */, + 9FD1E6B81A51361B0009A6C5 /* PlayerMenuServiceMac.mm in Sources */, + 9FFEB9AD1A6AB7F70095C43A /* RuntimeJsImpl.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A92275391517C094001B78AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 509D4AC917EBB2AB00697056 /* RootViewController.mm in Sources */, + 9FFEB9AC1A6AB7F70095C43A /* RuntimeJsImpl.cpp in Sources */, + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */, + 509D4AC817EBB2AB00697056 /* main.m in Sources */, + 9FFEB9C21A6B86360095C43A /* SimpleConfigParser.cpp in Sources */, + 509D4ABC17EBB2AB00697056 /* AppController.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 1A676820180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx Mac"; + targetProxy = 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676822180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions Mac"; + targetProxy = 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676824180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk Mac"; + targetProxy = 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676826180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion Mac"; + targetProxy = 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A67682F180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 9FFEB9BC1A6AB8940095C43A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libsimulator Mac"; + targetProxy = 9FFEB9BB1A6AB8940095C43A /* PBXContainerItemProxy */; + }; + 9FFEB9BE1A6AB89B0095C43A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libsimulator iOS"; + targetProxy = 9FFEB9BD1A6AB89B0095C43A /* PBXContainerItemProxy */; + }; + 1A676831180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 1A676830180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676833180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 1A676832180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676835180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 1A676834180E9C110076BC67 /* PBXContainerItemProxy */; + }; + C037820B18BF77BC00FE4F13 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings iOS"; + targetProxy = C037820A18BF77BC00FE4F13 /* PBXContainerItemProxy */; + }; + C037820E18BF77D100FE4F13 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings Mac"; + targetProxy = C037820D18BF77D100FE4F13 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 9FD1E6BB1A51362E0009A6C5 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 9FD1E6BC1A51362E0009A6C5 /* Base */, + 9FD1E6BE1A5136370009A6C5 /* zh-Hans */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 509D4AA817EBB24E00697056 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; + CONFIGURATION_BUILD_DIR = ../../../runtime/mac; + DEAD_CODE_STRIPPING = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = mac/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + GLFW_EXPOSE_NATIVE_COCOA, + GLFW_EXPOSE_NATIVE_NSGL, + CC_TARGET_OS_MAC, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/", + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/protobuf-lite", + ); + INFOPLIST_FILE = mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.8; + OTHER_LDFLAGS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/mac $(SRCROOT)/../../cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/mac"; + }; + name = Debug; + }; + 509D4AA917EBB24E00697056 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = mac/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + GLFW_EXPOSE_NATIVE_COCOA, + GLFW_EXPOSE_NATIVE_NSGL, + CC_TARGET_OS_MAC, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/", + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/protobuf-lite", + ); + INFOPLIST_FILE = mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.8; + OTHER_LDFLAGS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/mac $(SRCROOT)/../../cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/mac"; + }; + name = Release; + }; + A92276FE1517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "COCOS2D_DEBUG=1", + USE_FILE32API, + COCOS2D_JAVASCRIPT, + CC_ENABLE_CHIPMUNK_INTEGRATION, + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cocos2d-x $(SRCROOT)/../../cocos2d-x/cocos $(SRCROOT)/../../cocos2d-x/cocos/base $(SRCROOT)/../../cocos2d-x/cocos/physics $(SRCROOT)/../../cocos2d-x/cocos/math/kazmath $(SRCROOT)/../../cocos2d-x/cocos/2d $(SRCROOT)/../../cocos2d-x/cocos/gui $(SRCROOT)/../../cocos2d-x/cocos/network $(SRCROOT)/../../cocos2d-x/cocos/audio/include $(SRCROOT)/../../cocos2d-x/cocos/editor-support $(SRCROOT)/../../cocos2d-x/extensions $(SRCROOT)/../../cocos2d-x/external $(SRCROOT)/../../cocos2d-x/external/chipmunk/include/chipmunk $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/auto $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/manual"; + }; + name = Debug; + }; + A92276FF1517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = ( + NDEBUG, + USE_FILE32API, + COCOS2D_JAVASCRIPT, + CC_ENABLE_CHIPMUNK_INTEGRATION, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cocos2d-x $(SRCROOT)/../../cocos2d-x/cocos $(SRCROOT)/../../cocos2d-x/cocos/base $(SRCROOT)/../../cocos2d-x/cocos/physics $(SRCROOT)/../../cocos2d-x/cocos/math/kazmath $(SRCROOT)/../../cocos2d-x/cocos/2d $(SRCROOT)/../../cocos2d-x/cocos/gui $(SRCROOT)/../../cocos2d-x/cocos/network $(SRCROOT)/../../cocos2d-x/cocos/audio/include $(SRCROOT)/../../cocos2d-x/cocos/editor-support $(SRCROOT)/../../cocos2d-x/extensions $(SRCROOT)/../../cocos2d-x/external $(SRCROOT)/../../cocos2d-x/external/chipmunk/include/chipmunk $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/auto $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/manual"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A92277011517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COMPRESS_PNG_FILES = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ios/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + CC_TARGET_OS_IPHONE, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../Classes", + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/", + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/protobuf-lite", + ); + INFOPLIST_FILE = ios/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos $(SRCROOT)/../../cocos2d-x/cocos/platform/ios $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/ios $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/auto $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/manual $(SRCROOT)/../../cocos2d-x/external/curl/include/ios"; + VALID_ARCHS = "arm64 armv7"; + }; + name = Debug; + }; + A92277021517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COMPRESS_PNG_FILES = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ios/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + CC_TARGET_OS_IPHONE, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../Classes", + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/", + "$(SRCROOT)/../../cocos2d-x/tools/simulator/libsimulator/lib/protobuf-lite", + ); + INFOPLIST_FILE = ios/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos $(SRCROOT)/../../cocos2d-x/cocos/platform/ios $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/ios $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/auto $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/manual $(SRCROOT)/../../cocos2d-x/external/curl/include/ios"; + VALID_ARCHS = "arm64 armv7"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "HelloJavascript-desktop" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 509D4AA817EBB24E00697056 /* Debug */, + 509D4AA917EBB24E00697056 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A92275371517C094001B78AA /* Build configuration list for PBXProject "HelloJavascript" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92276FE1517C097001B78AA /* Debug */, + A92276FF1517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "HelloJavascript-mobile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92277011517C097001B78AA /* Debug */, + A92277021517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A92275341517C094001B78AA /* Project object */; +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/AppController.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/AppController.h new file mode 100644 index 0000000000..2e8186124e --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/AppController.h @@ -0,0 +1,35 @@ +/**************************************************************************** + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +@class RootViewController; + +@interface AppController : NSObject +{ + UIWindow *window; + RootViewController *viewController; +} + +@end + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm new file mode 100644 index 0000000000..81f19ebcdd --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm @@ -0,0 +1,144 @@ +/**************************************************************************** + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import +#import "cocos2d.h" + +#import "AppController.h" +#import "AppDelegate.h" +#import "RootViewController.h" +#import "platform/ios/CCEAGLView-ios.h" + +@implementation AppController + +#pragma mark - +#pragma mark Application lifecycle + +// cocos2d application instance +static AppDelegate s_sharedApplication; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + + // Override point for customization after application launch. + + // Add the view controller's view to the window and display. + window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] + pixelFormat: kEAGLColorFormatRGBA8 + depthFormat: GL_DEPTH24_STENCIL8_OES + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + [eaglView setMultipleTouchEnabled:YES]; + + // Use RootViewController manage CCEAGLView + viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; + viewController.wantsFullScreenLayout = YES; + viewController.view = eaglView; + + // Set RootViewController to window + if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) + { + // warning: addSubView doesn't work on iOS6 + [window addSubview: viewController.view]; + } + else + { + // use this method on ios6 + [window setRootViewController:viewController]; + } + + [window makeKeyAndVisible]; + + [[UIApplication sharedApplication] setStatusBarHidden: YES]; + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + + cocos2d::Application::getInstance()->run(); + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ + cocos2d::Director::getInstance()->pause(); +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ + cocos2d::Director::getInstance()->resume(); +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, called instead of applicationWillTerminate: when the user quits. + */ + cocos2d::Application::getInstance()->applicationDidEnterBackground(); +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + /* + Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. + */ + cocos2d::Application::getInstance()->applicationWillEnterForeground(); +} + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ + cocos2d::Director::getInstance()->purgeCachedData(); +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png new file mode 100644 index 0000000000..66c6d1cead Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default.png new file mode 100644 index 0000000000..dcb80725de Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png new file mode 100644 index 0000000000..84689888a1 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png new file mode 100644 index 0000000000..ef38d4500a Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png new file mode 100644 index 0000000000..c3807861ad Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png new file mode 100644 index 0000000000..a5b49ccbb1 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png new file mode 100644 index 0000000000..1526615c02 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png new file mode 100644 index 0000000000..8aa82506d0 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png new file mode 100644 index 0000000000..0500184c86 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png new file mode 100644 index 0000000000..775685daca Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png new file mode 100644 index 0000000000..ac381bc20e Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png new file mode 100644 index 0000000000..4fcc6fddff Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png new file mode 100644 index 0000000000..f0f8b7fe98 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png new file mode 100644 index 0000000000..2c573c8df4 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png new file mode 100644 index 0000000000..8a1fa1850c Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png new file mode 100644 index 0000000000..d9c7ab446b Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist new file mode 100644 index 0000000000..59405f5dce --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist @@ -0,0 +1,98 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + Icon.png + Icon@2x.png + Icon-72.png + Icon-144.png + Icon-57.png + Icon-114.png + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon-80 + Icon-58 + Icon-29 + Icon-120 + Icon-72.png + Icon.png + Icon@2x.png + Icon-57.png + Icon-114.png + Icon-144.png + + UIPrerenderedIcon + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon-58 + Icon-29 + Icon-80 + Icon-40 + Icon-100 + Icon-50 + Icon-152 + Icon-76 + Icon-120 + Icon-72.png + Icon.png + Icon@2x.png + Icon-57.png + Icon-114.png + Icon-144.png + + UIPrerenderedIcon + + + + CFBundleIdentifier + org.cocos2dx.hellojavascript + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIPrerenderedIcon + + UIRequiredDeviceCapabilities + + accelerometer + + opengles-1 + + + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationLandscapeLeft + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch new file mode 100644 index 0000000000..168ddec406 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'HelloJavascript' target in the 'HelloJavascript' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h new file mode 100644 index 0000000000..11dfc4bf88 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h @@ -0,0 +1,33 @@ +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + 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. + ****************************************************************************/ + +#import + + +@interface RootViewController : UIViewController { + +} +- (BOOL)prefersStatusBarHidden; +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm new file mode 100644 index 0000000000..a43163a2f1 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm @@ -0,0 +1,129 @@ +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + 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. + ****************************************************************************/ + +#import "RootViewController.h" +#import "cocos2d.h" +#import "platform/ios/CCEAGLView-ios.h" +#include "ide-support/SimpleConfigParser.h" + +@implementation RootViewController + +/* + // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + // Custom initialization + } + return self; +} +*/ + +/* +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView { +} +*/ + +/* +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; +} + +*/ +// Override to allow orientations other than the default portrait orientation. +// This method is deprecated on ios6 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + + if (SimpleConfigParser::getInstance()->isLanscape()) { + return UIInterfaceOrientationIsLandscape( interfaceOrientation ); + }else{ + return UIInterfaceOrientationIsPortrait( interfaceOrientation ); + } + +} + +// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead +- (NSUInteger) supportedInterfaceOrientations{ +#ifdef __IPHONE_6_0 + if (SimpleConfigParser::getInstance()->isLanscape()) { + return UIInterfaceOrientationMaskLandscape; + }else{ + return UIInterfaceOrientationMaskPortrait; + } +#endif +} + +- (BOOL) shouldAutorotate { + if (SimpleConfigParser::getInstance()->isLanscape()) { + return YES; + }else{ + return NO; + } +} + +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + + cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView(); + + if (glview) + { + cocos2d::CCEGLView *eaglview = (cocos2d::CCEGLView*) glview->getEAGLView(); + + if (eaglview) + { + CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); + cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); + } + } +} + +//fix not hide status on ios7 +- (BOOL)prefersStatusBarHidden +{ + return YES; +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/build-cfg.json b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/build-cfg.json new file mode 100644 index 0000000000..94e1ccd1f4 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/build-cfg.json @@ -0,0 +1,7 @@ +{ + "remove_res" : [ + "src", + "res", + "main.js" + ] +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/main.m b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/main.m new file mode 100644 index 0000000000..b1286e31be --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/main.m @@ -0,0 +1,11 @@ + + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); + [pool release]; + return retVal; +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/MainMenu.xib b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/MainMenu.xib new file mode 100644 index 0000000000..95349511fa --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/MainMenu.xib @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns new file mode 100644 index 0000000000..2040fc6fe6 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist new file mode 100644 index 0000000000..aa22263424 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon + CFBundleIdentifier + org.cocos2dx.hellojavascript + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSApplicationCategoryType + public.app-category.games + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2013. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch new file mode 100644 index 0000000000..46c36a7e99 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.h new file mode 100644 index 0000000000..4652e58184 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.h @@ -0,0 +1,56 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + + +#include +#import + +#import "ConsoleWindowController.h" +#include "ProjectConfig/ProjectConfig.h" +#include "ProjectConfig/SimulatorConfig.h" +#include "AppDelegate.h" + +@interface AppController : NSObject +{ + NSWindow *_window; + NSMenu *menu; + + AppDelegate *_app; + ProjectConfig _project; + int _debugLogFile; + + //log file + ConsoleWindowController *_consoleController; + NSFileHandle *_fileHandle; + + //console pipe + NSPipe *_pipe; + NSFileHandle *_pipeReadHandle; +} + +@property (nonatomic, assign) IBOutlet NSMenu* menu; + +-(IBAction)onFileClose:(id)sender; +-(IBAction)onWindowAlwaysOnTop:(id)sender; +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm new file mode 100644 index 0000000000..9d646cde28 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm @@ -0,0 +1,608 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include +#include +#include +#include +#include + +#import "SimulatorApp.h" +#include "AppDelegate.h" +#include "glfw3.h" +#include "glfw3native.h" +#include "runtime/Runtime.h" +#include "runtime/ConfigParser.h" + +#include "cocos2d.h" +#include "CodeIDESupport.h" + +#include "platform/mac/PlayerMac.h" +#include "AppEvent.h" +#include "AppLang.h" + + +#if (GLFW_VERSION_MAJOR >= 3) && (GLFW_VERSION_MINOR >= 1) +#define PLAYER_SUPPORT_DROP 1 +#else +#define PLAYER_SUPPORT_DROP 0 +#endif + +using namespace std; +using namespace cocos2d; + +static id SIMULATOR = nullptr; +@implementation AppController + +@synthesize menu; + +std::string getCurAppPath(void) +{ + return [[[NSBundle mainBundle] bundlePath] UTF8String]; +} + +std::string getCurAppName(void) +{ + string appName = [[[NSProcessInfo processInfo] processName] UTF8String]; + int found = appName.find(" "); + if (found!=std::string::npos) + appName = appName.substr(0,found); + + return appName; +} + +#if (PLAYER_SUPPORT_DROP > 0) +static void glfwDropFunc(GLFWwindow *window, int count, const char **files) +{ + AppEvent forwardEvent(kAppEventDropName, APP_EVENT_DROP); + std::string firstFile(files[0]); + forwardEvent.setDataString(firstFile); + + Director::getInstance()->getEventDispatcher()->dispatchEvent(&forwardEvent); +} +#endif + +-(void) dealloc +{ + Director::getInstance()->end(); + player::PlayerProtocol::getInstance()->purgeInstance(); + [super dealloc]; +} + +#pragma mark - +#pragma delegates + +- (void) applicationDidFinishLaunching:(NSNotification *)aNotification +{ + SIMULATOR = self; + player::PlayerMac::create(); + + _debugLogFile = 0; + + [self parseCocosProjectConfig:&_project]; + [self updateProjectFromCommandLineArgs:&_project]; + [self createWindowAndGLView]; + [self startup]; +} + + +#pragma mark - +#pragma mark functions + +- (BOOL) windowShouldClose:(id)sender +{ + return YES; +} + +- (void) windowWillClose:(NSNotification *)notification +{ + [[NSRunningApplication currentApplication] terminate]; +} + +- (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication +{ + return YES; +} + +- (NSMutableArray*) makeCommandLineArgsFromProjectConfig +{ + return [self makeCommandLineArgsFromProjectConfig:kProjectConfigAll]; +} + +- (NSMutableArray*) makeCommandLineArgsFromProjectConfig:(unsigned int)mask +{ + _project.setWindowOffset(Vec2(_window.frame.origin.x, _window.frame.origin.y)); + vector args = _project.makeCommandLineVector(); + NSMutableArray *commandArray = [NSMutableArray arrayWithCapacity:args.size()]; + for (auto &path : args) + { + [commandArray addObject:[NSString stringWithUTF8String:path.c_str()]]; + } + return commandArray; +} + +- (void) parseCocosProjectConfig:(ProjectConfig*)config +{ + // get project directory + ProjectConfig tmpConfig; + NSArray *nsargs = [[NSProcessInfo processInfo] arguments]; + long n = [nsargs count]; + if (n >= 2) + { + vector args; + for (int i = 0; i < [nsargs count]; ++i) + { + string arg = [[nsargs objectAtIndex:i] cStringUsingEncoding:NSUTF8StringEncoding]; + if (arg.length()) args.push_back(arg); + } + + if (args.size() && args.at(1).at(0) == '/') + { + // FIXME: + // for Code IDE before RC2 + tmpConfig.setProjectDir(args.at(1)); + } + + tmpConfig.parseCommandLine(args); + } + + // set project directory as search root path + FileUtils::getInstance()->setDefaultResourceRootPath(tmpConfig.getProjectDir()); + + // parse config.json + auto parser = ConfigParser::getInstance(); + auto configPath = tmpConfig.getProjectDir().append(CONFIG_FILE); + parser->readConfig(configPath); + + // set information + config->setConsolePort(parser->getConsolePort()); + config->setFileUploadPort(parser->getUploadPort()); + config->setFrameSize(parser->getInitViewSize()); + if (parser->isLanscape()) + { + config->changeFrameOrientationToLandscape(); + } + else + { + config->changeFrameOrientationToPortait(); + } + config->setScriptFile(parser->getEntryFile()); +} + +- (void) updateProjectFromCommandLineArgs:(ProjectConfig*)config +{ + NSArray *nsargs = [[NSProcessInfo processInfo] arguments]; + long n = [nsargs count]; + if (n >= 2) + { + vector args; + for (int i = 0; i < [nsargs count]; ++i) + { + string arg = [[nsargs objectAtIndex:i] cStringUsingEncoding:NSUTF8StringEncoding]; + if (arg.length()) args.push_back(arg); + } + + if (args.size() && args.at(1).at(0) == '/') + { + // for Code IDE before RC2 + config->setProjectDir(args.at(1)); + config->setDebuggerType(kCCRuntimeDebuggerCodeIDE); + } + config->parseCommandLine(args); + } +} + +- (bool) launch:(NSArray*)args +{ + NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]; + NSMutableDictionary *configuration = [NSMutableDictionary dictionaryWithObject:args forKey:NSWorkspaceLaunchConfigurationArguments]; + NSError *error = [[[NSError alloc] init] autorelease]; + [[NSWorkspace sharedWorkspace] launchApplicationAtURL:url + options:NSWorkspaceLaunchNewInstance + configuration:configuration + error:&error]; + + if (error.code != 0) + { + NSLog(@"Failed to launch app: %@", [error localizedDescription]); + } + return (error.code==0); +} + +- (void) relaunch:(NSArray*)args +{ + if ([self launch:args]) + { + [[NSApplication sharedApplication] terminate:self]; + } + else + { + NSLog(@"RELAUNCH: %@", args); + } +} + +- (void) relaunch +{ + [self relaunch:[self makeCommandLineArgsFromProjectConfig]]; +} + +- (void) createWindowAndGLView +{ + GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; + GLView::setGLContextAttrs(glContextAttrs); + + // create console window **MUST** before create opengl view + if (_project.isShowConsole()) + { + [self openConsoleWindow]; + CCLOG("%s\n",Configuration::getInstance()->getInfo().c_str()); + } + + float frameScale = _project.getFrameScale(); + + // create opengl view + cocos2d::Size frameSize = _project.getFrameSize(); + ConfigParser::getInstance()->setInitViewSize(frameSize); + + const cocos2d::Rect frameRect = cocos2d::Rect(0, 0, frameSize.width, frameSize.height); + std::stringstream title; + title << "Cocos Simulator - " << ConfigParser::getInstance()->getInitViewName(); + GLViewImpl *eglView = GLViewImpl::createWithRect(title.str(), frameRect, frameScale); + + auto director = Director::getInstance(); + director->setOpenGLView(eglView); + + _window = eglView->getCocoaWindow(); + [[NSApplication sharedApplication] setDelegate: self]; + [_window center]; + + [self setZoom:_project.getFrameScale()]; + Vec2 pos = _project.getWindowOffset(); + if (pos.x != 0 && pos.y != 0) + { + [_window setFrameOrigin:NSMakePoint(pos.x, pos.y)]; + } + +#if (PLAYER_SUPPORT_DROP > 0) + glfwSetDropCallback(eglView->getWindow(), glfwDropFunc); +#endif +} + +- (void) adjustEditMenuIndex +{ + NSApplication *thisApp = [NSApplication sharedApplication]; + NSMenu *mainMenu = [thisApp mainMenu]; + + NSMenuItem *editMenuItem = [mainMenu itemWithTitle:@"Edit"]; + if (editMenuItem) + { + NSUInteger index = 2; + if (index > [mainMenu itemArray].count) + index = [mainMenu itemArray].count; + [[editMenuItem menu] removeItem:editMenuItem]; + [mainMenu insertItem:editMenuItem atIndex:index]; + } +} +- (void) startup +{ + FileUtils::getInstance()->setPopupNotify(false); + + _project.dump(); + + const string projectDir = _project.getProjectDir(); + if (projectDir.length()) + { + FileUtils::getInstance()->setDefaultResourceRootPath(projectDir); + if (_project.isWriteDebugLogToFile()) + { + [self writeDebugLogToFile:_project.getDebugLogFilePath()]; + } + } + + const string writablePath = _project.getWritableRealPath(); + if (writablePath.length()) + { + FileUtils::getInstance()->setWritablePath(writablePath.c_str()); + } + + // path for looking Lang file, Studio Default images + NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; + FileUtils::getInstance()->addSearchPath(resourcePath.UTF8String); + + // app + _app = new AppDelegate(); + + [self setupUI]; + [self adjustEditMenuIndex]; + + RuntimeEngine::getInstance()->setProjectConfig(_project); + Application::getInstance()->run(); + // After run, application needs to be terminated immediately. + [NSApp terminate: self]; +} + +- (void) setupUI +{ + auto menuBar = player::PlayerProtocol::getInstance()->getMenuService(); + + // VIEW + menuBar->addItem("VIEW_MENU", tr("View")); + SimulatorConfig *config = SimulatorConfig::getInstance(); + int current = config->checkScreenSize(_project.getFrameSize()); + for (int i = 0; i < config->getScreenSizeCount(); i++) + { + SimulatorScreenSize size = config->getScreenSize(i); + std::stringstream menuId; + menuId << "VIEWSIZE_ITEM_MENU_" << i; + auto menuItem = menuBar->addItem(menuId.str(), size.title.c_str(), "VIEW_MENU"); + + if (i == current) + { + menuItem->setChecked(true); + } + } + + menuBar->addItem("DIRECTION_MENU_SEP", "-", "VIEW_MENU"); + menuBar->addItem("DIRECTION_PORTRAIT_MENU", tr("Portrait"), "VIEW_MENU") + ->setChecked(_project.isPortraitFrame()); + menuBar->addItem("DIRECTION_LANDSCAPE_MENU", tr("Landscape"), "VIEW_MENU") + ->setChecked(_project.isLandscapeFrame()); + + menuBar->addItem("VIEW_SCALE_MENU_SEP", "-", "VIEW_MENU"); + + std::vector scaleMenuVector; + auto scale100Menu = menuBar->addItem("VIEW_SCALE_MENU_100", tr("Zoom Out").append(" (100%)"), "VIEW_MENU"); + scale100Menu->setShortcut("super+0"); + + auto scale75Menu = menuBar->addItem("VIEW_SCALE_MENU_75", tr("Zoom Out").append(" (75%)"), "VIEW_MENU"); + scale75Menu->setShortcut("super+7"); + + auto scale50Menu = menuBar->addItem("VIEW_SCALE_MENU_50", tr("Zoom Out").append(" (50%)"), "VIEW_MENU"); + scale50Menu->setShortcut("super+6"); + + auto scale25Menu = menuBar->addItem("VIEW_SCALE_MENU_25", tr("Zoom Out").append(" (25%)"), "VIEW_MENU"); + scale25Menu->setShortcut("super+5"); + + int frameScale = int(_project.getFrameScale() * 100); + if (frameScale == 100) + { + scale100Menu->setChecked(true); + } + else if (frameScale == 75) + { + scale75Menu->setChecked(true); + } + else if (frameScale == 50) + { + scale50Menu->setChecked(true); + } + else if (frameScale == 25) + { + scale25Menu->setChecked(true); + } + else + { + scale100Menu->setChecked(true); + } + + scaleMenuVector.push_back(scale100Menu); + scaleMenuVector.push_back(scale75Menu); + scaleMenuVector.push_back(scale50Menu); + scaleMenuVector.push_back(scale25Menu); + + menuBar->addItem("REFRESH_MENU_SEP", "-", "VIEW_MENU"); + menuBar->addItem("REFRESH_MENU", tr("Refresh"), "VIEW_MENU")->setShortcut("super+r"); + + ProjectConfig &project = _project; + auto dispatcher = Director::getInstance()->getEventDispatcher(); + dispatcher->addEventListenerWithFixedPriority(EventListenerCustom::create(kAppEventName, [&project, scaleMenuVector](EventCustom* event){ + auto menuEvent = dynamic_cast(event); + if (menuEvent) + { + rapidjson::Document dArgParse; + dArgParse.Parse<0>(menuEvent->getDataString().c_str()); + if (dArgParse.HasMember("name")) + { + string strcmd = dArgParse["name"].GetString(); + + if (strcmd == "menuClicked") + { + player::PlayerMenuItem *menuItem = static_cast(menuEvent->getUserData()); + if (menuItem) + { + if (menuItem->isChecked()) + { + return ; + } + + string data = dArgParse["data"].GetString(); + if ((data == "CLOSE_MENU") || (data == "EXIT_MENU")) + { + Director::getInstance()->end(); + } + else if (data == "REFRESH_MENU") + { + [SIMULATOR relaunch]; + } + else if (data.find("VIEW_SCALE_MENU_") == 0) // begin with VIEW_SCALE_MENU_ + { + string tmp = data.erase(0, strlen("VIEW_SCALE_MENU_")); + float scale = atof(tmp.c_str()) / 100.0f; + project.setFrameScale(scale); + + auto glview = static_cast(Director::getInstance()->getOpenGLView()); + glview->setFrameZoomFactor(scale); + + // update scale menu state + for (auto &it : scaleMenuVector) + { + it->setChecked(false); + } + menuItem->setChecked(true); + } + else if (data.find("VIEWSIZE_ITEM_MENU_") == 0) // begin with VIEWSIZE_ITEM_MENU_ + { + string tmp = data.erase(0, strlen("VIEWSIZE_ITEM_MENU_")); + int index = atoi(tmp.c_str()); + SimulatorScreenSize size = SimulatorConfig::getInstance()->getScreenSize(index); + + if (project.isLandscapeFrame()) + { + std::swap(size.width, size.height); + } + + project.setFrameSize(cocos2d::Size(size.width, size.height)); + [SIMULATOR relaunch]; + } + else if (data == "DIRECTION_PORTRAIT_MENU") + { + project.changeFrameOrientationToPortait(); + [SIMULATOR relaunch]; + } + else if (data == "DIRECTION_LANDSCAPE_MENU") + { + project.changeFrameOrientationToLandscape(); + [SIMULATOR relaunch]; + } + } + } + } + } + }), 1); + + // drop + AppDelegate *app = _app; + auto listener = EventListenerCustom::create(kAppEventDropName, [&project, app](EventCustom* event) + { + AppEvent *dropEvent = dynamic_cast(event); + if (dropEvent) + { + string dirPath = dropEvent->getDataString() + "/"; + string configFilePath = dirPath + CONFIG_FILE; + + if (FileUtils::getInstance()->isDirectoryExist(dirPath) && + FileUtils::getInstance()->isFileExist(configFilePath)) + { + // parse config.json + ConfigParser::getInstance()->readConfig(configFilePath); + + project.setProjectDir(dirPath); + project.setScriptFile(ConfigParser::getInstance()->getEntryFile()); + project.setWritablePath(dirPath); + + RuntimeEngine::getInstance()->setProjectConfig(project); +// app->setProjectConfig(project); +// app->reopenProject(); + } + } + }); + dispatcher->addEventListenerWithFixedPriority(listener, 1); +} + +- (void) openConsoleWindow +{ + if (!_consoleController) + { + _consoleController = [[ConsoleWindowController alloc] initWithWindowNibName:@"ConsoleWindow"]; + } + [_consoleController.window orderFrontRegardless]; + + //set console pipe + _pipe = [NSPipe pipe] ; + _pipeReadHandle = [_pipe fileHandleForReading] ; + + int outfd = [[_pipe fileHandleForWriting] fileDescriptor]; + if (dup2(outfd, fileno(stderr)) != fileno(stderr) || dup2(outfd, fileno(stdout)) != fileno(stdout)) + { + perror("Unable to redirect output"); + // [self showAlert:@"Unable to redirect output to console!" withTitle:@"player error"]; + } + else + { + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleNotification:) name: NSFileHandleReadCompletionNotification object: _pipeReadHandle] ; + [_pipeReadHandle readInBackgroundAndNotify] ; + } +} + +- (bool) writeDebugLogToFile:(const string)path +{ + if (_debugLogFile) return true; + //log to file + if(_fileHandle) return true; + NSString *fPath = [NSString stringWithCString:path.c_str() encoding:[NSString defaultCStringEncoding]]; + [[NSFileManager defaultManager] createFileAtPath:fPath contents:nil attributes:nil] ; + _fileHandle = [NSFileHandle fileHandleForWritingAtPath:fPath]; + [_fileHandle retain]; + return true; +} + +- (void)handleNotification:(NSNotification *)note +{ + //NSLog(@"Received notification: %@", note); + [_pipeReadHandle readInBackgroundAndNotify] ; + NSData *data = [[note userInfo] objectForKey:NSFileHandleNotificationDataItem]; + NSString *str = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + + //show log to console + [_consoleController trace:str]; + if(_fileHandle!=nil){ + [_fileHandle writeData:[str dataUsingEncoding:NSUTF8StringEncoding]]; + } + +} + +- (void) setZoom:(float)scale +{ + Director::getInstance()->getOpenGLView()->setFrameZoomFactor(scale); + _project.setFrameScale(scale); +} + +- (BOOL) applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag +{ + return NO; +} + +#pragma mark - + +-(IBAction)onFileClose:(id)sender +{ + [[NSApplication sharedApplication] terminate:self]; +} + +-(IBAction)onWindowAlwaysOnTop:(id)sender +{ + NSInteger state = [sender state]; + + if (state == NSOffState) + { + [_window setLevel:NSFloatingWindowLevel]; + [sender setState:NSOnState]; + } + else + { + [_window setLevel:NSNormalWindowLevel]; + [sender setState:NSOffState]; + } +} +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/build-cfg.json b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/build-cfg.json new file mode 100644 index 0000000000..58ff86e820 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/build-cfg.json @@ -0,0 +1,9 @@ +{ + "remove_res" : [ + "src", + "res", + "main.js", + "project.json", + "config.json" + ] +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/main.m b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/main.m new file mode 100644 index 0000000000..658f0c14ee --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/main.m @@ -0,0 +1,7 @@ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindow.xib b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindow.xib new file mode 100644 index 0000000000..1cc9932310 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindow.xib @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindowController.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindowController.h new file mode 100644 index 0000000000..7b1c06d215 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindowController.h @@ -0,0 +1,23 @@ + +#import + +@interface ConsoleWindowController : NSWindowController +{ + NSTextView *textView; + IBOutlet NSButton *checkScroll; + IBOutlet NSButton *topCheckBox; + NSMutableArray *linesCount; + NSUInteger traceCount; +} + +@property (assign) IBOutlet NSTextView *textView; + +- (void) trace:(NSString*)msg; +- (IBAction)onClear:(id)sender; +- (IBAction)onScrollChange:(id)sender; +- (IBAction)onTopChange:(id)sender; + +@end + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindowController.m b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindowController.m new file mode 100644 index 0000000000..aa56938433 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/ConsoleWindowController.m @@ -0,0 +1,100 @@ + +#import "ConsoleWindowController.h" + +@interface ConsoleWindowController () + +@end + +#define SKIP_LINES_COUNT 3 +#define MAX_LINE_LEN 4096 +#define MAX_LINES_COUNT 200 + +@implementation ConsoleWindowController +@synthesize textView; + +- (id)initWithWindow:(NSWindow *)window +{ + self = [super initWithWindow:window]; + if (self) + { + // Initialization code here. + linesCount = [[NSMutableArray arrayWithCapacity:MAX_LINES_COUNT + 1] retain]; + } + + return self; +} + +- (void)dealloc +{ + [linesCount release]; + [super dealloc]; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. +} + +- (void) trace:(NSString*)msg +{ + if (traceCount >= SKIP_LINES_COUNT && [msg length] > MAX_LINE_LEN) + { + msg = [NSString stringWithFormat:@"%@ ...", [msg substringToIndex:MAX_LINE_LEN - 4]]; + } + traceCount++; + NSFont *font = [NSFont fontWithName:@"Monaco" size:12.0]; + NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName]; + NSAttributedString *string = [[NSAttributedString alloc] initWithString:msg attributes:attrsDictionary]; + NSNumber *len = [NSNumber numberWithUnsignedInteger:[string length]]; + [linesCount addObject:len]; + + NSTextStorage *storage = [textView textStorage]; + [storage beginEditing]; + [storage appendAttributedString:string]; + + if ([linesCount count] >= MAX_LINES_COUNT) + { + len = [linesCount objectAtIndex:0]; + [storage deleteCharactersInRange:NSMakeRange(0, [len unsignedIntegerValue])]; + [linesCount removeObjectAtIndex:0]; + } + + [storage endEditing]; + [self changeScroll]; +} + +- (void) changeScroll +{ + BOOL scroll = [checkScroll state] == NSOnState; + if(scroll) + { + [self.textView scrollRangeToVisible: NSMakeRange(self.textView.string.length, 0)]; + } +} + +- (IBAction)onClear:(id)sender +{ + NSTextStorage *storage = [textView textStorage]; + [storage setAttributedString:[[[NSAttributedString alloc] initWithString:@""] autorelease]]; +} + +- (IBAction)onScrollChange:(id)sender +{ + [self changeScroll]; +} + +- (IBAction)onTopChange:(id)sender +{ + BOOL isTop = [topCheckBox state] == NSOnState; + if(isTop) + { + [self.window setLevel:NSFloatingWindowLevel]; + } + else + { + [self.window setLevel:NSNormalWindowLevel]; + } +} + +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/DeviceEx-mac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/DeviceEx-mac.mm new file mode 100644 index 0000000000..afae0e88c7 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/DeviceEx-mac.mm @@ -0,0 +1,70 @@ +#include "DeviceEx.h" + +#import "openudid/OpenUDIDMac.h" + +using namespace std; +PLAYER_NS_BEGIN + +DeviceEx *DeviceEx::getInstance() +{ + static DeviceEx *instance = NULL; + if (!instance) + { + instance = new DeviceEx(); + instance->init(); + } + return instance; +} + +std::string DeviceEx::getCurrentUILangName() +{ + return _uiLangName; +} + +std::string DeviceEx::getUserGUID() +{ + return _userGUID; +} + + +////////// private ////////// + +DeviceEx::DeviceEx() + : _uiLangName("en") +{ + +} + +void DeviceEx::init() +{ + makeUILangName(); + makeUserGUID(); +} + +void DeviceEx::makeUILangName() +{ + NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; + NSArray *languages = [defs objectForKey:@"AppleLanguages"]; + if ([languages count] > 0) + { + NSString *lang = [languages objectAtIndex:0]; + _uiLangName = lang.UTF8String; + } +} + +std::string DeviceEx::makeUserGUID() +{ + if (_userGUID.length() <= 0) + { + _userGUID = string([[OpenUDIDMac value] cStringUsingEncoding:NSUTF8StringEncoding]); + + if (_userGUID.length() <= 0) + { + _userGUID = "guid-fixed-1234567890"; + } + } + + return _userGUID; +} + +PLAYER_NS_END diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerEditBoxServiceMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerEditBoxServiceMac.h new file mode 100644 index 0000000000..1feb536ed7 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerEditBoxServiceMac.h @@ -0,0 +1,62 @@ +// +// EditBoxServiceMac.h +// player +// + +#ifndef __player__EditBoxServiceMac__ +#define __player__EditBoxServiceMac__ + +#include "PlayerEditBoxServiceProtocol.h" + + +@interface EditBoxServiceImplMac : NSObject +{ + NSTextField* textField_; + void* editBox_; + BOOL editState_; + NSMutableDictionary* placeholderAttributes_; +} + +@property(nonatomic, retain) NSTextField* textField; +@property(nonatomic, retain) NSMutableDictionary* placeholderAttributes; +@property(nonatomic, readonly, getter = isEditState) BOOL editState; +@property(nonatomic, assign) void* editBox; + +-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox; +-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; +-(void) setPosition:(NSPoint) pos; +-(void) setContentSize:(NSSize) size; +-(void) visit; +-(void) openKeyboard; +-(void) closeKeyboard; + +@end + + +PLAYER_NS_BEGIN +class PlayerEditBoxServiceMac : public PlayerEditBoxServiceProtocol +{ +public: + PlayerEditBoxServiceMac(); + virtual ~PlayerEditBoxServiceMac(); + + // overwrite + virtual void showSingleLineEditBox(const cocos2d::Rect &rect) ; + virtual void showMultiLineEditBox(const cocos2d::Rect &rect) ; + virtual void hide() ; + + virtual void setText(const std::string &text); + virtual void setFont(const std::string &name, int size); + virtual void setFontColor(const cocos2d::Color3B &color); + + virtual void setFormator(int formator); +private: + void show(); + +private: + EditBoxServiceImplMac* _sysEdit; +}; + +PLAYER_NS_END + +#endif diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerEditBoxServiceMac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerEditBoxServiceMac.mm new file mode 100644 index 0000000000..4be9bb1654 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerEditBoxServiceMac.mm @@ -0,0 +1,219 @@ + +#include "PlayerEditBoxServiceMac.h" + +#include "cocos2d.h" +#include "glfw3native.h" + +// internal + +@implementation EditBoxServiceImplMac + +@synthesize textField = textField_; +@synthesize placeholderAttributes = placeholderAttributes_; +@synthesize editState = editState_; +@synthesize editBox = editBox_; + +- (id) getNSWindow +{ + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + return glview->getCocoaWindow(); +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [textField_ removeFromSuperview]; + [textField_ release]; + + [placeholderAttributes_ release]; + [super dealloc]; +} + +-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox +{ + self = [super init]; + + if (self) + { + editState_ = NO; + self.textField = [[[NSTextField alloc] initWithFrame:frameRect] autorelease]; + + NSColor *newColor = [NSColor colorWithCalibratedRed:255 / 255.0f green:0 blue:0 alpha:1.0f]; + self.textField.textColor = newColor; + + NSFont *font = [NSFont systemFontOfSize:10]; //TODO need to delete hard code here. + textField_.font = font; + + [self setupTextField:textField_]; + + self.editBox = editBox; + self.placeholderAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys: + font, NSFontAttributeName, + [NSColor grayColor], NSForegroundColorAttributeName, + nil]; + + [[[self getNSWindow] contentView] addSubview:textField_]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(onTextDidChanged:) + name:NSControlTextDidEndEditingNotification + object:nil]; + } + + return self; +} + +- (void)onTextDidChanged:(NSNotification *) notification +{ + // hide first + [self.textField setHidden:YES]; +} + +- (void)setupTextField:(NSTextField *)textField +{ + [textField setTextColor:[NSColor whiteColor]]; + [textField setBackgroundColor:[NSColor clearColor]]; + [textField setBordered:NO]; + [textField setHidden:NO]; + [textField setWantsLayer:YES]; + [textField setDelegate:self]; +} + +-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance +{ + [[[self getNSWindow] contentView] doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; +} + +-(void) setPosition:(NSPoint) pos +{ + NSRect frame = [textField_ frame]; + frame.origin = pos; + [textField_ setFrame:frame]; +} + +-(void) setContentSize:(NSSize) size +{ + [self.textField setFrameSize:size]; +} + +-(void) visit +{ + +} + +-(void) openKeyboard +{ + if ([textField_ superview]) { + [textField_ becomeFirstResponder]; + } +} + +-(void) closeKeyboard +{ + if ([textField_ superview]) { + [textField_ resignFirstResponder]; + } +} + +- (BOOL)textFieldShouldReturn:(NSTextField *)sender +{ + if (sender == textField_) { + [sender resignFirstResponder]; + } + return NO; +} + +-(void)animationSelector +{ +} + +- (BOOL) control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector +{ + return NO; +} + +@end + + + +PLAYER_NS_BEGIN; + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +PlayerEditBoxServiceMac::PlayerEditBoxServiceMac() +{ + _handler = 0; + NSRect rect = NSMakeRect(0, 0, 100, 20); + _sysEdit = [[EditBoxServiceImplMac alloc] initWithFrame:rect editBox:this]; +} + +PlayerEditBoxServiceMac::~PlayerEditBoxServiceMac() +{ + [_sysEdit release]; +} + +void PlayerEditBoxServiceMac::showSingleLineEditBox(const cocos2d::Rect &rect) +{ + [[_sysEdit.textField cell] setLineBreakMode:NSLineBreakByTruncatingTail]; + [[_sysEdit.textField cell] setTruncatesLastVisibleLine:YES]; + + [_sysEdit setPosition:NSMakePoint(rect.origin.x, rect.origin.y)]; + [_sysEdit setContentSize:NSMakeSize(rect.size.width, rect.size.height)]; + + show(); +} + +void PlayerEditBoxServiceMac::showMultiLineEditBox(const cocos2d::Rect &rect) +{ + [[_sysEdit.textField cell] setLineBreakMode:NSLineBreakByCharWrapping]; + [[_sysEdit.textField cell] setTruncatesLastVisibleLine:NO]; + + [_sysEdit setPosition:NSMakePoint(rect.origin.x, rect.origin.y)]; + [_sysEdit setContentSize:NSMakeSize(rect.size.width, rect.size.height)]; + + show(); +} + +void PlayerEditBoxServiceMac::setText(const std::string &text) +{ + _sysEdit.textField.stringValue = [NSString stringWithUTF8String:text.c_str()]; +} + +void PlayerEditBoxServiceMac::setFont(const std::string &name, int size) +{ + NSString *fntName = [NSString stringWithUTF8String:name.c_str()]; + NSFont *textFont = [NSFont fontWithName:fntName size:size]; + if (textFont != nil) + { + [_sysEdit.textField setFont:textFont]; + } +} + +void PlayerEditBoxServiceMac::setFontColor(const cocos2d::Color3B &color) +{ + NSColor *textColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; + _sysEdit.textField.textColor = textColor; +} + +// hide editbox +void PlayerEditBoxServiceMac::hide() +{ + [_sysEdit.textField setHidden:YES]; + [_sysEdit closeKeyboard]; +} + +void PlayerEditBoxServiceMac::show() +{ + [_sysEdit.textField setHidden:NO]; + [_sysEdit openKeyboard]; +} + +void PlayerEditBoxServiceMac::setFormator(int formator) +{ + CCLOG("Not support yet."); +} + +PLAYER_NS_END; \ No newline at end of file diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerFileDialogServiceMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerFileDialogServiceMac.h new file mode 100644 index 0000000000..49ed2c2a94 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerFileDialogServiceMac.h @@ -0,0 +1,29 @@ +#ifndef __PLAY_FILE_DIALOG_SERVICE_MAC_H +#define __PLAY_FILE_DIALOG_SERVICE_MAC_H + +#include "PlayerMacros.h" +#include "PlayerFileDialogServiceProtocol.h" + +PLAYER_NS_BEGIN + +class PlayerFileDialogServiceMac : public PlayerFileDialogServiceProtocol +{ +public: + virtual std::string openFile(const std::string &title, + const std::string &directory, + const std::string &extensions) const; + + virtual std::vector openMultiple(const std::string &title, + const std::string &directory, + const std::string &extensions) const; + + virtual std::string saveFile(const std::string &title, + const std::string &path) const; + + virtual std::string openDirectory(const std::string &title, + const std::string &directory)const; +}; + +PLAYER_NS_END + +#endif // __PLAY_FILE_DIALOG_SERVICE_MAC_H \ No newline at end of file diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerFileDialogServiceMac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerFileDialogServiceMac.mm new file mode 100644 index 0000000000..413452bf9a --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerFileDialogServiceMac.mm @@ -0,0 +1,174 @@ + +#include "PlayerFileDialogServiceMac.h" + +#include "glfw3.h" +#include "glfw3native.h" + +#define VALIDATE_FRAMEBUFFER { \ +NSOpenGLContext *__context = glfwGetNSGLContext(glfwGetCurrentContext()); \ +[__context makeCurrentContext]; \ +} + +PLAYER_NS_BEGIN + +std::string PlayerFileDialogServiceMac::openFile(const std::string &title, + const std::string &directory, + const std::string &extensions) const +{ + NSOpenPanel* openDlg = [NSOpenPanel openPanel]; + [openDlg setTitle:[NSString stringWithUTF8String:title.c_str()]]; + [openDlg setCanChooseDirectories:NO]; + [openDlg setCanChooseFiles:YES]; + [openDlg setCanHide:YES]; + [openDlg setCanCreateDirectories:NO]; + [openDlg setCanSelectHiddenExtension:NO]; + [openDlg setAllowsMultipleSelection:NO]; + + if (directory.length()) { + [openDlg setDirectoryURL:[NSURL fileURLWithPath:[NSString stringWithUTF8String:directory.c_str()]]]; + } + + if (extensions.length()) + { + NSMutableArray *fileTypes = [NSMutableArray array]; + + NSString *buff = [NSString stringWithUTF8String:extensions.c_str()]; + NSArray *extensionArray = [buff componentsSeparatedByString:@";"]; + + for (NSString *oneExtension in extensionArray) { + NSArray *tmpData = [oneExtension componentsSeparatedByString:@"|"]; + if ([tmpData count] > 1) + { + NSString *suffixString = [tmpData objectAtIndex:1]; + suffixString = [suffixString stringByReplacingOccurrencesOfString:@"*." withString:@""]; + [fileTypes addObjectsFromArray:[suffixString componentsSeparatedByString:@","]]; + } + } + + [openDlg setAllowedFileTypes:fileTypes]; + } + + std::string filePath; + if ([openDlg runModal] == NSFileHandlingPanelOKButton) + { + NSURL *url = [openDlg.URLs objectAtIndex:0]; + filePath = [[url path] UTF8String]; + } + + [openDlg close]; + VALIDATE_FRAMEBUFFER + return filePath; +} + +std::string PlayerFileDialogServiceMac::openDirectory( const std::string &title, + const std::string &directory) const +{ + NSOpenPanel* openDlg = [NSOpenPanel openPanel]; + [openDlg setTitle:[NSString stringWithUTF8String:title.c_str()]]; + [openDlg setCanChooseDirectories:YES]; + [openDlg setCanChooseFiles:NO]; + [openDlg setCanHide:YES]; + [openDlg setCanCreateDirectories:NO]; + [openDlg setCanSelectHiddenExtension:NO]; + [openDlg setAllowsMultipleSelection:NO]; + + if (directory.length()) { + [openDlg setDirectoryURL:[NSURL fileURLWithPath:[NSString stringWithUTF8String:directory.c_str()]]]; + } + + std::string path; + if ([openDlg runModal] == NSFileHandlingPanelOKButton) + { + NSURL *url = [openDlg.URLs objectAtIndex:0]; + path = [[url path] UTF8String]; + } + + [openDlg close]; + VALIDATE_FRAMEBUFFER + return path; +} + +std::vector PlayerFileDialogServiceMac::openMultiple( const std::string &title, + const std::string &directory, + const std::string &extensions) const +{ + NSOpenPanel* openDlg = [NSOpenPanel openPanel]; + [openDlg setTitle:[NSString stringWithUTF8String:title.c_str()]]; + [openDlg setCanChooseDirectories:YES]; + [openDlg setCanChooseFiles:YES]; + [openDlg setCanHide:YES]; + [openDlg setCanCreateDirectories:NO]; + [openDlg setCanSelectHiddenExtension:NO]; + [openDlg setAllowsMultipleSelection:YES]; + + if (directory.length()) { + [openDlg setDirectoryURL:[NSURL fileURLWithPath:[NSString stringWithUTF8String:directory.c_str()]]]; + } + + if (extensions.length()) + { + NSMutableArray *fileTypes = [NSMutableArray array]; + + NSString *buff = [NSString stringWithUTF8String:extensions.c_str()]; + NSArray *extensionArray = [buff componentsSeparatedByString:@";"]; + + for (NSString *oneExtension in extensionArray) { + NSArray *tmpData = [oneExtension componentsSeparatedByString:@"|"]; + if ([tmpData count] > 1) + { + NSString *suffixString = [tmpData objectAtIndex:1]; + suffixString = [suffixString stringByReplacingOccurrencesOfString:@"*." withString:@""]; + [fileTypes addObjectsFromArray:[suffixString componentsSeparatedByString:@","]]; + } + } + + [openDlg setAllowedFileTypes:fileTypes]; + } + + std::vector pathes; + if ([openDlg runModal] == NSFileHandlingPanelOKButton) + { + for (NSURL *url in openDlg.URLs) { + pathes.push_back([[url path] UTF8String]); + } + } + + [openDlg close]; + VALIDATE_FRAMEBUFFER + return pathes; +} + +std::string PlayerFileDialogServiceMac::saveFile(const std::string &title, + const std::string &path) const +{ + NSSavePanel* saveDlg = [NSSavePanel savePanel]; + [saveDlg setTitle:[NSString stringWithUTF8String:title.c_str()]]; + [saveDlg setCanHide:YES]; + [saveDlg setCanCreateDirectories:NO]; + [saveDlg setCanSelectHiddenExtension:NO]; + + + // set directory + NSString *tempPath = [NSString stringWithUTF8String:path.c_str()]; + NSString *directory = [tempPath stringByDeletingLastPathComponent]; + if (directory) + { + [saveDlg setDirectoryURL:[NSURL fileURLWithPath:directory]]; + } + + // set filename + [saveDlg setNameFieldStringValue:[tempPath lastPathComponent]]; + + std::string filePath; + if ([saveDlg runModal] == NSFileHandlingPanelOKButton) + { + NSURL *url = saveDlg.URL; + filePath = [[url path] UTF8String]; + } + + [saveDlg close]; + VALIDATE_FRAMEBUFFER + return filePath; +} + +PLAYER_NS_END diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMac.h new file mode 100644 index 0000000000..971ada3630 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMac.h @@ -0,0 +1,52 @@ + +#ifndef __PLAYER_MAC_H_ +#define __PLAYER_MAC_H_ + +#include "PlayerProtocol.h" + +#include "PlayerEditBoxServiceMac.h" +#include "PlayerFileDialogServiceMac.h" +#include "PlayerMenuServiceMac.h" +#include "PlayerMessageBoxServiceMac.h" +#include "PlayerTaskServiceMac.h" + +#include "PlayerUtils.h" + +#include "ProjectConfig/ProjectConfig.h" +PLAYER_NS_BEGIN + +class PlayerMac : public PlayerProtocol +{ +public: + static PlayerMac *create(); + virtual ~PlayerMac(); + + virtual PlayerFileDialogServiceProtocol *getFileDialogService(); + virtual PlayerMessageBoxServiceProtocol *getMessageBoxService(); + virtual PlayerMenuServiceProtocol *getMenuService(); + virtual PlayerEditBoxServiceProtocol *getEditBoxService(); + virtual PlayerTaskServiceProtocol *getTaskService(); + + void quit(); + void relaunch(); + void openNewPlayer(); + void openNewPlayerWithProjectConfig(const ProjectConfig& config); + void openProjectWithProjectConfig(const ProjectConfig& config); + + void setController(id controller); + int getPositionX(); + int getPositionY(); +protected: + PlayerMac(); + + PlayerMenuServiceMac *_menuService; + PlayerMessageBoxServiceMac *_messageBoxService; + PlayerFileDialogServiceMac *_fileDialogService; + PlayerEditBoxServiceMac *_editBoxService; + PlayerTaskServiceMac *_taskService; + id _appController; +}; + +PLAYER_NS_END + +#endif // __PLAYER_MAC_H_ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMac.mm new file mode 100644 index 0000000000..7bebdfeb04 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMac.mm @@ -0,0 +1,135 @@ + + +#include "PlayerMac.h" + + +PLAYER_NS_BEGIN +using namespace cocos2d; + +PlayerMac* PlayerMac::create() +{ + return new PlayerMac(); +} + + +PlayerMac::PlayerMac() +: PlayerProtocol() +, _fileDialogService(nullptr) +, _messageBoxService(nullptr) +, _menuService(nullptr) +, _editBoxService(nullptr) +, _appController(nullptr) +, _taskService(nullptr) +{ +} + + +PlayerMac::~PlayerMac() +{ + CC_SAFE_DELETE(_fileDialogService); + CC_SAFE_DELETE(_fileDialogService); + CC_SAFE_DELETE(_messageBoxService); + CC_SAFE_DELETE(_menuService); + CC_SAFE_DELETE(_editBoxService); + CC_SAFE_DELETE(_taskService); +} + +PlayerFileDialogServiceProtocol *PlayerMac::getFileDialogService() +{ + if (!_fileDialogService) + { + _fileDialogService = new PlayerFileDialogServiceMac(); + } + return _fileDialogService; +} + +PlayerMessageBoxServiceProtocol *PlayerMac::getMessageBoxService() +{ + if (!_messageBoxService) + { + _messageBoxService = new PlayerMessageBoxServiceMac(); + } + return _messageBoxService; +} + +PlayerMenuServiceProtocol *PlayerMac::getMenuService() +{ + if (!_menuService) + { + _menuService = new PlayerMenuServiceMac(); + } + return _menuService; +} + +PlayerEditBoxServiceProtocol *PlayerMac::getEditBoxService() +{ + if (!_editBoxService) + { + _editBoxService = new PlayerEditBoxServiceMac(); + } + return _editBoxService; +} + +PlayerTaskServiceProtocol *PlayerMac::getTaskService() +{ + + if (!_taskService) + { + _taskService = new PlayerTaskServiceMac(); + } + return _taskService; +} + +void PlayerMac::quit() +{ + cocos2d::Director::getInstance()->end(); +} + +void PlayerMac::relaunch() +{ + if (_appController && [_appController respondsToSelector:NSSelectorFromString(@"relaunch")]) + { + [_appController performSelector:NSSelectorFromString(@"relaunch")]; + } +} + +void PlayerMac::openNewPlayer() +{ +} + +void PlayerMac::openNewPlayerWithProjectConfig(const ProjectConfig& config) +{ + if (_appController && [_appController respondsToSelector:NSSelectorFromString(@"launch:")]) + { + NSString *commandLine = [NSString stringWithCString:config.makeCommandLine().c_str() + encoding:NSUTF8StringEncoding]; + NSArray *arguments = [NSMutableArray arrayWithArray:[commandLine componentsSeparatedByString:@" "]]; + + [_appController performSelector:NSSelectorFromString(@"launch:") withObject:arguments]; + } +} + +void PlayerMac::openProjectWithProjectConfig(const ProjectConfig& config) +{ + this->openNewPlayerWithProjectConfig(config); + this->quit(); +} + +void PlayerMac::setController(id controller) +{ + _appController = controller; +} + +int PlayerMac::getPositionX() +{ + NSWindow *window = dynamic_cast(Director::getInstance()->getOpenGLView())->getCocoaWindow(); + return window.frame.origin.x; +} + +int PlayerMac::getPositionY() +{ + NSWindow *window = dynamic_cast(Director::getInstance()->getOpenGLView())->getCocoaWindow(); + return window.frame.origin.y; +} + +PLAYER_NS_END diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMenuServiceMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMenuServiceMac.h new file mode 100644 index 0000000000..3697c5258f --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMenuServiceMac.h @@ -0,0 +1,82 @@ + +#ifndef __PLAYER_MENU_SERVICE_MAC_H_ +#define __PLAYER_MENU_SERVICE_MAC_H_ + +#include + +#include "cocos2d.h" +#include "PlayerMacros.h" +#include "PlayerMenuServiceProtocol.h" + +// +// Menu item Helper +// + +PLAYER_NS_BEGIN +class PlayerMenuItemMac; +PLAYER_NS_END + +@interface NNMenuItem : NSMenuItem +{ + int scriptHandler; + player::PlayerMenuItemMac *macMenuItem; +} +@property (nonatomic) int scriptHandler; +@property (nonatomic) const player::PlayerMenuItemMac *macMenuItem; + ++(id) createMenuItem:(const player::PlayerMenuItemMac *) macMenuItem; +@end + + +// +// PlayerMenuItemMac +// + +PLAYER_NS_BEGIN + +class PlayerMenuItemMac : public PlayerMenuItem +{ +public: + static PlayerMenuItemMac *create(const std::string &menuId, const std::string &title); + virtual ~PlayerMenuItemMac(); + + virtual void setTitle(const std::string &title); + virtual void setEnabled(bool enabled); + virtual void setChecked(bool checked); + virtual void setShortcut(const std::string &shortcut); + +protected: + PlayerMenuItemMac(); + + PlayerMenuItemMac *_parent; + NNMenuItem *_menuItem; + NSMenu *_menu; + cocos2d::Vector _children; + + friend class PlayerMenuServiceMac; +}; + +class PlayerMenuServiceMac : public PlayerMenuServiceProtocol +{ +public: + PlayerMenuServiceMac(); + virtual ~PlayerMenuServiceMac(); + + virtual PlayerMenuItem *addItem(const std::string &menuId, const std::string &title, const std::string &parentId, int order = MAX_ORDER); + virtual PlayerMenuItem *addItem(const std::string &menuId, const std::string &title); + virtual PlayerMenuItem *getItem(const std::string &menuId); + virtual bool removeItem(const std::string &menuId); + virtual void setMenuBarEnabled(bool enabled); + +private: + bool removeItemInternal(const std::string &menuId, bool isUpdateChildrenOrder); + void updateChildrenOrder(PlayerMenuItemMac *parent); + +private: + PlayerMenuItemMac _root; + std::unordered_map _items; +}; + +PLAYER_NS_END + +#endif // __PLAYER_MENU_SERVICE_MAC_H_ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMenuServiceMac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMenuServiceMac.mm new file mode 100644 index 0000000000..eed14debcd --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMenuServiceMac.mm @@ -0,0 +1,370 @@ + +#include "PlayerMenuServiceMac.h" +#include "PlayerUtils.h" + +#include "cocos2d.h" +#include "AppEvent.h" + +USING_NS_CC; + +/////////////////////////////////////// menu helper ////////////////////////////////////////////// +static bool __G_IS_MENUBAR_ENABLED__ = true; // WTF + +@implementation NNMenuItem +@synthesize scriptHandler; +@synthesize macMenuItem; + ++(id) createMenuItem:(const player::PlayerMenuItemMac *) macMenuItem +{ + if (macMenuItem->getTitle().compare("-") == 0) + { + return [NSMenuItem separatorItem]; + } + else + { + return [[[NNMenuItem alloc] initWithMenuItem:macMenuItem] autorelease]; + } + + return NULL; +} + +-(id) initWithMenuItem:(const player::PlayerMenuItemMac *) menuItem +{ + NSString *title = [NSString stringWithUTF8String:menuItem->getTitle().c_str()]; + title = [title stringByReplacingOccurrencesOfString:@"&" withString:@""]; + if ([super initWithTitle:title action:@selector(onClicked:) keyEquivalent:@""]) + { + self.target = self; + } + + self.macMenuItem = menuItem; + + return self; +} + +-(void) setShortcut:(std::string) shortcut +{ + std::vector fields = player::splitString(shortcut, std::string("+")); + + NSUInteger mask = [self keyEquivalentModifierMask]; + for (auto cut : fields) + { + if (cut == kPlayerSuperModifyKey) + { + mask |= NSCommandKeyMask; + } + else if (cut == kPlayerShiftModifyKey) + { + mask |= NSShiftKeyMask; + } + else if (cut == kPlayerCtrlModifyKey) + { + mask |= NSControlKeyMask; + } + else if (cut == kPlayerAltModifyKey) + { + mask |= NSAlternateKeyMask; + } + else + { + if (cut.length() == 1) + { + [self setKeyEquivalent:[NSString stringWithUTF8String:cut.c_str()]]; + } + else + { + CCLOG("[modifyItem] shortcut (%s) is invalid.", shortcut.c_str()); + } + } + } + + if (mask != 0) + { + [self setKeyEquivalentModifierMask:mask]; + } +} + +-(void) onClicked:(id)sender +{ + AppEvent event(kAppEventName, APP_EVENT_MENU); + + std::stringstream buf; + buf << "{\"data\":\"" << self.macMenuItem->getMenuId().c_str() << "\""; + buf << ",\"name\":" << "\"menuClicked\"" << "}"; + event.setDataString(buf.str()); + event.setUserData((void*)self.macMenuItem); + Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); +} + +-(BOOL) validateMenuItem:(NSMenuItem *)menuItem +{ + return __G_IS_MENUBAR_ENABLED__; +} + +@end + + + +PLAYER_NS_BEGIN + +// + +PlayerMenuItemMac *PlayerMenuItemMac::create(const std::string &menuId, const std::string &title) +{ + PlayerMenuItemMac *item = new PlayerMenuItemMac(); + item->_menuId = menuId; + item->_title = title; + item->autorelease(); + return item; +} + +PlayerMenuItemMac::PlayerMenuItemMac() + : _parent(nullptr) + , _menuItem(nullptr) + , _menu(nullptr) +{ +} + +PlayerMenuItemMac::~PlayerMenuItemMac() +{ + CC_SAFE_RELEASE(_parent); + if (_menuItem) + { + [_parent->_menu removeItem:_menuItem]; + } + + CCLOG("PlayerMenuItemWin::~PlayerMenuItemWin() - %s", _menuId.c_str()); +} + +void PlayerMenuItemMac::setTitle(const std::string &title) +{ + if (title.length() == 0) + { + CCLOG("MenuServiceWin::setTitle() - can not set menu title to empty, menu id (%s)", _menuId.c_str()); + return; + } + + _menuItem.title = [NSString stringWithUTF8String:title.c_str()]; + if (_menu) + { + _menu.title = _menuItem.title; + } + + _title = title; +} + +void PlayerMenuItemMac::setEnabled(bool enabled) +{ + _isEnabled = enabled; + + if (enabled) + { + [_menuItem setAction:@selector(onClicked:)]; + } + else + { + [_menuItem setAction:nil]; + } +} + +void PlayerMenuItemMac::setChecked(bool checked) +{ + _isChecked = checked; + [_menuItem setState:checked ? NSOnState : NSOffState]; +} + +void PlayerMenuItemMac::setShortcut(const std::string &shortcut) +{ + _shortcut = shortcut; + [_menuItem setShortcut:shortcut]; +} + + + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +PlayerMenuServiceMac::PlayerMenuServiceMac() +{ + // @TODO: build menu with **EDIT** menu + + NSApplication *thisApp = [NSApplication sharedApplication]; + _root._menu = [thisApp mainMenu]; +} + +PlayerMenuServiceMac::~PlayerMenuServiceMac() +{ + log("~PlayerMenuServiceMac"); + _items.clear(); +} + +PlayerMenuItem* PlayerMenuServiceMac::addItem(const std::string &menuId, const std::string &title, + const std::string &parentId, int order) +{ + if (menuId.length() == 0 || title.length() == 0) + { + CCLOG("PlayerMenuServiceMac::addItem() - menuId and title must is non-empty"); + return nullptr; + } + + // check menu id is exists + if (_items.find(menuId) != _items.end()) + { + CCLOG("PlayerMenuServiceMac::addItem() - menu id (%s) is exists", menuId.c_str()); + return nullptr; + } + + // set parent + PlayerMenuItemMac *parent = &_root; + if (parentId.length()) + { + // query parent menu + auto it = _items.find(parentId); + if (it != _items.end()) + { + parent = it->second; + } + } + + if (!parent->_menu) + { + NSMenu *nsmenu = [[NSMenu alloc] initWithTitle:[parent->_menuItem title]]; + [parent->_parent->_menu setSubmenu:nsmenu forItem:parent->_menuItem]; + parent->_menu = nsmenu; + parent->_isGroup = true; + } + + + // create new menu item + PlayerMenuItemMac *item = PlayerMenuItemMac::create(menuId, title); + item->_parent = parent; + item->_parent->retain(); + + // check new menu item position + int childSize = (int) [parent->_menu itemArray].count; + childSize = (int) parent->_children.size(); + if (order > childSize) + { + order = childSize; + } + else if (order < 0) + { + order = 0; + } + + + // add menu item to menu bar + int newIndex = order; + if (parent == &_root) + { + newIndex += 1; + } + NNMenuItem *newItem = [NNMenuItem createMenuItem:item]; + [parent->_menu insertItem:newItem atIndex:newIndex]; + item->_menuItem = newItem; + + + // update menu state + parent->_children.insert(order, item); + _items[item->_menuId] = item; + updateChildrenOrder(parent); + + return item; +} + +PlayerMenuItem* PlayerMenuServiceMac::addItem(const std::string &menuId, const std::string &title) +{ + return addItem(menuId, title, ""); +} + +PlayerMenuItem* PlayerMenuServiceMac::getItem(const std::string &menuId) +{ + auto it = _items.find(menuId); + if (it == _items.end()) + { + CCLOG("MenuServiceWin::getItem() - Invalid menu id (%s)", menuId.c_str()); + return nullptr; + } + + return it->second; +} + +bool PlayerMenuServiceMac::removeItem(const std::string &menuId) +{ + return removeItemInternal(menuId, true);; +} + +void PlayerMenuServiceMac::setMenuBarEnabled(bool enabled) +{ + __G_IS_MENUBAR_ENABLED__ = enabled; +} + +#pragma mark - private - + +bool PlayerMenuServiceMac::removeItemInternal(const std::string &menuId, bool isUpdateChildrenOrder) +{ + auto it = _items.find(menuId); + if (it == _items.end()) + { + CCLOG("MenuServiceWin::removeItem() - Invalid menu id (%s)", menuId.c_str()); + return false; + } + + PlayerMenuItemMac *item = it->second; + if (item->_children.size() == 0) + { + // remove item from parent + bool removed = false; + auto *theChildren = &item->_parent->_children; + for (auto it = theChildren->begin(); it != theChildren->end(); ++it) + { + if ((*it)->_menuItem == item->_menuItem) + { + theChildren->erase(it); + removed = true; + break; + } + } + + if (!removed) + { + CCLOG("MenuServiceWin::removeItem() - remove menu item (%s) failed, not found command id from parent->children", item->_menuId.c_str()); + } + + // remove menu id mapping + _items.erase(menuId); + if (isUpdateChildrenOrder) + { + updateChildrenOrder(item->_parent); + } + return true; + } + else + { + // remove all children + while (item->_children.size() != 0) + { + PlayerMenuItemMac *child = *item->_children.begin(); + if (!removeItemInternal(child->_menuId.c_str(), false)) + { + break; + return false; + } + } + return removeItemInternal(menuId, true); + } + + return false; +} + +void PlayerMenuServiceMac::updateChildrenOrder(PlayerMenuItemMac *parent) +{ + auto *children = &parent->_children; + int order = 0; + for (auto it = children->begin(); it != children->end(); ++it) + { + (*it)->_order = order; + order++; + } +} + +PLAYER_NS_END \ No newline at end of file diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMessageBoxServiceMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMessageBoxServiceMac.h new file mode 100644 index 0000000000..0aec41fae5 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMessageBoxServiceMac.h @@ -0,0 +1,29 @@ + +#ifndef __PLAYER_MessageBoxServiceMac_h +#define __PLAYER_MessageBoxServiceMac_h + +#include + +#include "PlayerMacros.h" +#include "PlayerMessageBoxServiceProtocol.h" + +PLAYER_NS_BEGIN + +class PlayerMessageBoxServiceMac : public PlayerMessageBoxServiceProtocol +{ +public: + virtual int showMessageBox(const std::string &title, + const std::string &message, + int buttonsType = BUTTONS_OK); +protected: + struct MessageBoxInfo + { + std::string title; + const int buttonId; + }; + std::vector getTitles(int buttons); +}; + +PLAYER_NS_END + +#endif // __PLAYER_MessageBoxServiceMac_h diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMessageBoxServiceMac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMessageBoxServiceMac.mm new file mode 100644 index 0000000000..fe3f77b5ad --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerMessageBoxServiceMac.mm @@ -0,0 +1,58 @@ + +#include "PlayerMessageBoxServiceMac.h" + +PLAYER_NS_BEGIN + +int PlayerMessageBoxServiceMac::showMessageBox(const std::string &title, + const std::string &message, + int buttonsType) +{ + NSAlert *alert = [[NSAlert alloc] init]; + + auto titles = getTitles(buttonsType); + for (auto& title : titles) + { + [alert addButtonWithTitle:[NSString stringWithUTF8String:title.title.c_str()]]; + } + + [alert setMessageText:[NSString stringWithUTF8String:title.c_str()]]; + [alert setInformativeText:[NSString stringWithUTF8String:message.c_str()]]; + [alert setAlertStyle:NSWarningAlertStyle]; + + int index = (int)[alert runModal] - NSAlertFirstButtonReturn; + return titles.at(index).buttonId; +} + +std::vector PlayerMessageBoxServiceMac::getTitles(int buttons) +{ + std::vector titles; + + switch (buttons) { + case BUTTONS_OK: + titles.push_back({"OK", BUTTON_OK}); + break; + + case BUTTONS_OK_CANCEL: + titles.push_back({"OK", BUTTON_OK}); + titles.push_back({"Cancel", BUTTON_CANCEL}); + break; + + case BUTTONS_YES_NO: + titles.push_back({"Yes", BUTTON_YES}); + titles.push_back({"No", BUTTON_NO}); + break; + + case BUTTONS_YES_NO_CANCEL: + titles.push_back({"Yes", BUTTON_YES}); + titles.push_back({"No", BUTTON_NO}); + titles.push_back({"Cancel", BUTTON_CANCEL}); + break; + + default: + break; + } + + return titles; +} + +PLAYER_NS_END \ No newline at end of file diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerTaskServiceMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerTaskServiceMac.h new file mode 100644 index 0000000000..67155e0b09 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerTaskServiceMac.h @@ -0,0 +1,81 @@ + +#ifndef __PLAYER_TASK_SERVICE_MAC_H_ +#define __PLAYER_TASK_SERVICE_MAC_H_ + +#include + +#include "PlayerTaskServiceProtocol.h" + +PLAYER_NS_BEGIN +class PlayerTaskMac; +PLAYER_NS_END + +@interface PlayerTaskPrivate : NSObject +{ + NSFileHandle *fileHandle; + + // compatible code + NSTask *_buildTask; + BOOL _isRunning; + int _exitCode; + NSString *_output; +} + +@property (assign) NSTask *buildTask; +@property (assign) BOOL isRunning; +@property (assign) int exitCode; +@property (retain) NSString *output; + +- (void) runScriptAsyn:(NSString *)absScriptPath withArguments:(NSArray *) arguments; +@end + +PLAYER_NS_BEGIN + +class PlayerTaskMac : public PlayerTask +{ +public: + static PlayerTaskMac *create(const std::string &name, + const std::string &executePath, + const std::string &commandLineArguments); + + virtual ~PlayerTaskMac(); + + virtual bool run(); + virtual void stop(); + virtual void runInTerminal(); + + // check task status + virtual void update(float dt); + + void appendOutput(const char *data); +protected: + PlayerTaskMac(const std::string &name, + const std::string &executePath, + const std::string &commandLineArguments); + + void cleanup(); + std::u16string makeCommandLine() const; + + PlayerTaskPrivate *_taskPrivate; +}; + +class PlayerTaskServiceMac : public PlayerTaskServiceProtocol +{ +public: + PlayerTaskServiceMac(); + virtual ~PlayerTaskServiceMac(); + + virtual PlayerTask *createTask(const std::string &name, + const std::string &executePath, + const std::string &commandLineArguments); + virtual PlayerTask *getTask(const std::string &name); + virtual void removeTask(const std::string &name); + +protected: + cocos2d::Map _tasks; +}; + +PLAYER_NS_END + + +#endif // __PLAYER_TASK_SERVICE_MAC_H_ \ No newline at end of file diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerTaskServiceMac.mm b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerTaskServiceMac.mm new file mode 100644 index 0000000000..d4e79635db --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/PlayerTaskServiceMac.mm @@ -0,0 +1,246 @@ + +#include "PlayerTaskServiceMac.h" + +@implementation PlayerTaskPrivate + +@synthesize buildTask = _buildTask; +@synthesize isRunning = _isRunning; +@synthesize exitCode = _exitCode; +@synthesize output = _output; + +-(id) init +{ + if ((self = [super init])) { + _isRunning = NO; + _exitCode = 0; + } + + return self; +} + +-(void) dealloc +{ + [_output release]; + [super dealloc]; +} + +-(void)performSelectorInBackground:(SEL)selector withObjects:(id)object, ... +{ + NSMethodSignature *signature = [self methodSignatureForSelector:selector]; + + // setup the invocation + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; + invocation.target = self; + invocation.selector = selector; + + // associate the arguments + va_list objects; + va_start(objects, object); + unsigned int objectCounter = 2; + for (id obj = object; obj != nil; obj = va_arg(objects, id)) + { + [invocation setArgument:&obj atIndex:objectCounter++]; + } + va_end(objects); + + // make sure to invoke on a background queue + NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithInvocation:invocation]; + NSOperationQueue *backgroundQueue = [[NSOperationQueue alloc] init]; + [backgroundQueue addOperation:operation]; +} + +- (void) runScriptAsyn:(NSString *)absScriptPath withArguments:(NSArray *) arguments +{ + _isRunning = YES; + [self performSelectorInBackground:@selector(runScriptSync:withArguments:) + withObjects:absScriptPath, arguments, nil]; +} + +- (void) runScriptSync:(NSString *)absScriptPath withArguments:(NSArray *)arguments +{ + if (!absScriptPath) + { + CCLOG("Please check your script (%s)", absScriptPath.UTF8String); + return ; + } + + _buildTask = [[NSTask alloc] init]; + [_buildTask setLaunchPath:absScriptPath]; + + if (!arguments) + { + arguments = [NSArray array]; + } + [_buildTask setArguments:arguments]; + + // + NSPipe *pipe; + pipe = [NSPipe pipe]; + [_buildTask setStandardOutput: pipe]; + + fileHandle = [pipe fileHandleForReading]; + + // + [_buildTask launch]; + [_buildTask waitUntilExit]; + + NSData *data; + data = [fileHandle readDataToEndOfFile]; + + _output = [[NSString alloc] initWithData: data + encoding: NSUTF8StringEncoding]; + _isRunning = NO; + _exitCode = [_buildTask terminationStatus]; + + [fileHandle closeFile]; + [_buildTask release]; + _buildTask = nil; +} + +@end + +PLAYER_NS_BEGIN + +PlayerTaskMac *PlayerTaskMac::create(const std::string &name, const std::string &executePath, const std::string &commandLineArguments) +{ + PlayerTaskMac *task = new PlayerTaskMac(name, executePath, commandLineArguments); + task->autorelease(); + return task; +} + +PlayerTaskMac::PlayerTaskMac(const std::string &name, + const std::string &executePath, + const std::string &commandLineArguments) +: PlayerTask(name, executePath, commandLineArguments) +{ + _taskPrivate = [[PlayerTaskPrivate alloc] init]; +} + +PlayerTaskMac::~PlayerTaskMac() +{ + cleanup(); +} + +bool PlayerTaskMac::run() +{ + if (!isIdle()) + { + CCLOG("PlayerTaskMac::run() - task is not idle"); + return false; + } + + NSString *commandLine = [NSString stringWithCString:_commandLineArguments.c_str() + encoding:NSUTF8StringEncoding]; + [_taskPrivate runScriptAsyn:[NSString stringWithUTF8String:_executePath.data()] + withArguments:[NSMutableArray arrayWithArray:[commandLine componentsSeparatedByString:@" "]]]; + _state = STATE_RUNNING; + + cocos2d::Director::getInstance()->getScheduler()->scheduleUpdate(this, 0, false); + return true; +} + +void PlayerTaskMac::runInTerminal() +{ + NSString *s = [NSString stringWithFormat: + @"tell application \"Terminal\" to do script \"%s %s\"", _executePath.c_str(), _commandLineArguments.c_str()]; + + NSAppleScript *as = [[NSAppleScript alloc] initWithSource: s]; + [as executeAndReturnError:nil]; +} + +void PlayerTaskMac::stop() +{ + cleanup(); +} + +void PlayerTaskMac::update(float dt) +{ + _lifetime += dt; + + if (_taskPrivate.isRunning) + { + return ; + } + + cocos2d::Director::getInstance()->getScheduler()->unscheduleAllForTarget(this); + cleanup(); +} + +void PlayerTaskMac::appendOutput(const char *data) +{ + _output.append(data); +} + +void PlayerTaskMac::cleanup() +{ + + _state = STATE_COMPLETED; + + [NSObject cancelPreviousPerformRequestsWithTarget:_taskPrivate]; + [_taskPrivate.buildTask interrupt]; + + _resultCode = _taskPrivate.exitCode; + _output.append(_taskPrivate.output.UTF8String); + + [_taskPrivate release]; + _taskPrivate = nil; + CCLOG("\nCMD: (exit code: %d) %s", _resultCode, _output.c_str()); + + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchCustomEvent(_name); +} + +std::u16string PlayerTaskMac::makeCommandLine() const +{ + std::stringstream buf; + buf << "\""; + buf << _executePath; + buf << "\" "; + buf << _commandLineArguments; + + std::u16string u16command; + cocos2d::StringUtils::UTF8ToUTF16(buf.str(), u16command); + return u16command; +} + +PlayerTaskServiceMac::PlayerTaskServiceMac() +{ +} + +PlayerTaskServiceMac::~PlayerTaskServiceMac() +{ + for (auto it = _tasks.begin(); it != _tasks.end(); ++it) + { + it->second->stop(); + } +} + +PlayerTask *PlayerTaskServiceMac::createTask(const std::string &name, + const std::string &executePath, + const std::string &commandLineArguments) +{ + CCASSERT(_tasks.find(name) == _tasks.end(), "Task already exists."); + PlayerTaskMac *task = PlayerTaskMac::create(name, executePath, commandLineArguments); + _tasks.insert(name, task); + return task; +} + +PlayerTask *PlayerTaskServiceMac::getTask(const std::string &name) +{ + auto it = _tasks.find(name); + return it != _tasks.end() ? it->second : nullptr; +} + +void PlayerTaskServiceMac::removeTask(const std::string &name) +{ + auto it = _tasks.find(name); + if (it != _tasks.end()) + { + if (!it->second->isCompleted()) + { + it->second->stop(); + } + _tasks.erase(it); + } +} + +PLAYER_NS_END diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/openudid/OpenUDIDMac.h b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/openudid/OpenUDIDMac.h new file mode 100644 index 0000000000..57d5d115bd --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/openudid/OpenUDIDMac.h @@ -0,0 +1,65 @@ +// +// OpenUDID.h +// openudid +// +// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11. +// Copyright 2011 OpenUDID.org +// +// Main branches +// iOS code: https://github.com/ylechelle/OpenUDID +// + +/* + !!! IMPORTANT !!! + + IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY, + PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN, + E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO + USING OpenUDID IN THEIR OWN CODE. + + !!! IMPORTANT !!! + +*/ + +/* + http://en.wikipedia.org/wiki/Zlib_License + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ + +#import + +// +// Usage: +// #include "OpenUDID.h" +// NSString* openUDID = [OpenUDID value]; +// + +#define kOpenUDIDErrorNone 0 +#define kOpenUDIDErrorOptedOut 1 +#define kOpenUDIDErrorCompromised 2 + +@interface OpenUDIDMac : NSObject { +} ++ (NSString*) value; ++ (NSString*) valueWithError:(NSError**)error; ++ (void) setOptOut:(BOOL)optOutValue; + +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/openudid/OpenUDIDMac.m b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/openudid/OpenUDIDMac.m new file mode 100644 index 0000000000..9e9026cabb --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/service/openudid/OpenUDIDMac.m @@ -0,0 +1,383 @@ +// +// OpenUDIDMac.m +// openudid +// +// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11. +// Copyright 2011 OpenUDID.org +// +// Initiators/root branches +// iOS code: https://github.com/ylechelle/OpenUDID +// Android code: https://github.com/vieux/OpenUDID +// +// Contributors: +// https://github.com/ylechelle/OpenUDID/contributors +// + +/* + http://en.wikipedia.org/wiki/Zlib_License + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ + +#if __has_feature(objc_arc) +#error This file uses the classic non-ARC retain/release model; hints below... + // to selectively compile this file as non-ARC, do as follows: + // https://img.skitch.com/20120717-g3ag5h9a6ehkgpmpjiuen3qpwp.png +#endif + +#import "OpenUDIDMac.h" +#import // Need to import for CC_MD5 access +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR +#import +#import +#else +#import +#endif + +#define OpenUDIDLog(fmt, ...) +//#define OpenUDIDLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); +//#define OpenUDIDLog(fmt, ...) NSLog((@"[Line %d] " fmt), __LINE__, ##__VA_ARGS__); + +static NSString * kOpenUDIDSessionCache = nil; +static NSString * const kOpenUDIDKey = @"OpenUDID"; +static NSString * const kOpenUDIDSlotKey = @"OpenUDID_slot"; +static NSString * const kOpenUDIDAppUIDKey = @"OpenUDID_appUID"; +static NSString * const kOpenUDIDTSKey = @"OpenUDID_createdTS"; +static NSString * const kOpenUDIDOOTSKey = @"OpenUDID_optOutTS"; +static NSString * const kOpenUDIDDomain = @"org.OpenUDID"; +static NSString * const kOpenUDIDSlotPBPrefix = @"org.OpenUDID.slot."; +static int const kOpenUDIDRedundancySlots = 100; + +@interface OpenUDIDMac (Private) ++ (void) _setDict:(id)dict forPasteboard:(id)pboard; ++ (NSMutableDictionary*) _getDictFromPasteboard:(id)pboard; ++ (NSString*) _generateFreshOpenUDID; +@end + +@implementation OpenUDIDMac + +// Archive a NSDictionary inside a pasteboard of a given type +// Convenience method to support iOS & Mac OS X +// ++ (void) _setDict:(id)dict forPasteboard:(id)pboard { +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + [pboard setData:[NSKeyedArchiver archivedDataWithRootObject:dict] forPasteboardType:kOpenUDIDDomain]; +#else + [pboard setData:[NSKeyedArchiver archivedDataWithRootObject:dict] forType:kOpenUDIDDomain]; +#endif +} + +// Retrieve an NSDictionary from a pasteboard of a given type +// Convenience method to support iOS & Mac OS X +// ++ (NSMutableDictionary*) _getDictFromPasteboard:(id)pboard { +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + id item = [pboard dataForPasteboardType:kOpenUDIDDomain]; +#else + id item = [pboard dataForType:kOpenUDIDDomain]; +#endif + if (item) { + @try{ + item = [NSKeyedUnarchiver unarchiveObjectWithData:item]; + } @catch(NSException* e) { + OpenUDIDLog(@"Unable to unarchive item %@ on pasteboard!", [pboard name]); + item = nil; + } + } + + // return an instance of a MutableDictionary + return [NSMutableDictionary dictionaryWithDictionary:(item == nil || [item isKindOfClass:[NSDictionary class]]) ? item : nil]; +} + +// Private method to create and return a new OpenUDID +// Theoretically, this function is called once ever per application when calling [OpenUDID value] for the first time. +// After that, the caching/pasteboard/redundancy mechanism inside [OpenUDID value] returns a persistent and cross application OpenUDID +// ++ (NSString*) _generateFreshOpenUDID { + + NSString* _openUDID = nil; + + // August 2011: One day, this may no longer be allowed in iOS. When that is, just comment this line out. + // March 25th 2012: this day has come, let's remove this "outlawed" call... +#if TARGET_OS_IPHONE +// if([UIDevice instancesRespondToSelector:@selector(uniqueIdentifier)]){ +// _openUDID = [[UIDevice currentDevice] uniqueIdentifier]; +// } +#endif + // Next we generate a UUID. + // UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs + // (Interface Identifiers), are 128-bit values guaranteed to be unique. A UUID is made unique over + // both space and time by combining a value unique to the computer on which it was generated—usually the + // Ethernet hardware address—and a value representing the number of 100-nanosecond intervals since + // October 15, 1582 at 00:00:00. + // We then hash this UUID with md5 to get 32 bytes, and then add 4 extra random bytes + // Collision is possible of course, but unlikely and suitable for most industry needs (e.g. aggregate tracking) + // + if (_openUDID==nil) { + CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); + CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, uuid); + const char *cStr = CFStringGetCStringPtr(cfstring,CFStringGetFastestEncoding(cfstring)); + unsigned char result[16]; + CC_MD5( cStr, (unsigned int)strlen(cStr), result ); + CFRelease(uuid); + + _openUDID = [NSString stringWithFormat: + @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%08x", + result[0], result[1], result[2], result[3], + result[4], result[5], result[6], result[7], + result[8], result[9], result[10], result[11], + result[12], result[13], result[14], result[15], + (unsigned int)(arc4random() % NSUIntegerMax)]; + } + + // Call to other developers in the Open Source community: + // + // feel free to suggest better or alternative "UDID" generation code above. + // NOTE that the goal is NOT to find a better hash method, but rather, find a decentralized (i.e. not web-based) + // 160 bits / 20 bytes random string generator with the fewest possible collisions. + // + + return _openUDID; +} + + +// Main public method that returns the OpenUDID +// This method will generate and store the OpenUDID if it doesn't exist, typically the first time it is called +// It will return the null udid (forty zeros) if the user has somehow opted this app out (this is subject to 3rd party implementation) +// Otherwise, it will register the current app and return the OpenUDID +// ++ (NSString*) value { + return [OpenUDIDMac valueWithError:nil]; +} + ++ (NSString*) valueWithError:(NSError **)error { + + if (kOpenUDIDSessionCache!=nil) { + if (error!=nil) + *error = [NSError errorWithDomain:kOpenUDIDDomain + code:kOpenUDIDErrorNone + userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID in cache from first call",@"description", nil]]; + return kOpenUDIDSessionCache; + } + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + // The AppUID will uniquely identify this app within the pastebins + // + NSString * appUID = (NSString *) [defaults objectForKey:kOpenUDIDAppUIDKey]; + if(appUID == nil) + { + // generate a new uuid and store it in user defaults + CFUUIDRef uuid = CFUUIDCreate(NULL); + appUID = (NSString *) CFUUIDCreateString(NULL, uuid); + CFRelease(uuid); + } + + NSString* openUDID = nil; + NSString* myRedundancySlotPBid = nil; + NSDate* optedOutDate = nil; + BOOL optedOut = NO; + BOOL saveLocalDictToDefaults = NO; + BOOL isCompromised = NO; + + // Do we have a local copy of the OpenUDID dictionary? + // This local copy contains a copy of the openUDID, myRedundancySlotPBid (and unused in this block, the local bundleid, and the timestamp) + // + id localDict = [defaults objectForKey:kOpenUDIDKey]; + if ([localDict isKindOfClass:[NSDictionary class]]) { + localDict = [NSMutableDictionary dictionaryWithDictionary:localDict]; // we might need to set/overwrite the redundancy slot + openUDID = [localDict objectForKey:kOpenUDIDKey]; + myRedundancySlotPBid = [localDict objectForKey:kOpenUDIDSlotKey]; + optedOutDate = [localDict objectForKey:kOpenUDIDOOTSKey]; + optedOut = optedOutDate!=nil; + OpenUDIDLog(@"localDict = %@",localDict); + } + + // Here we go through a sequence of slots, each of which being a UIPasteboard created by each participating app + // The idea behind this is to both multiple and redundant representations of OpenUDIDs, as well as serve as placeholder for potential opt-out + // + NSString* availableSlotPBid = nil; + NSMutableDictionary* frequencyDict = [NSMutableDictionary dictionaryWithCapacity:kOpenUDIDRedundancySlots]; + for (int n=0; n0)? [arrayOfUDIDs lastObject] : nil; + OpenUDIDLog(@"Freq Dict = %@\nMost reliable %@",frequencyDict,mostReliableOpenUDID); + + // if openUDID was not retrieved from the local preferences, then let's try to get it from the frequency dictionary above + // + if (openUDID==nil) { + if (mostReliableOpenUDID==nil) { + // this is the case where this app instance is likely to be the first one to use OpenUDID on this device + // we create the OpenUDID, legacy or semi-random (i.e. most certainly unique) + // + openUDID = [OpenUDIDMac _generateFreshOpenUDID]; + } else { + // or we leverage the OpenUDID shared by other apps that have already gone through the process + // + openUDID = mostReliableOpenUDID; + } + // then we create a local representation + // + if (localDict==nil) { + localDict = [NSMutableDictionary dictionaryWithCapacity:4]; + [localDict setObject:openUDID forKey:kOpenUDIDKey]; + [localDict setObject:appUID forKey:kOpenUDIDAppUIDKey]; + [localDict setObject:[NSDate date] forKey:kOpenUDIDTSKey]; + if (optedOut) [localDict setObject:optedOutDate forKey:kOpenUDIDTSKey]; + saveLocalDictToDefaults = YES; + } + } + else { + // Sanity/tampering check + // + if (mostReliableOpenUDID!=nil && ![mostReliableOpenUDID isEqualToString:openUDID]) + isCompromised = YES; + } + + // Here we store in the available PB slot, if applicable + // + OpenUDIDLog(@"Available Slot %@ Existing Slot %@",availableSlotPBid,myRedundancySlotPBid); + if (availableSlotPBid!=nil && (myRedundancySlotPBid==nil || [availableSlotPBid isEqualToString:myRedundancySlotPBid])) { +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:availableSlotPBid create:YES]; + [slotPB setPersistent:YES]; +#else + NSPasteboard* slotPB = [NSPasteboard pasteboardWithName:availableSlotPBid]; +#endif + + // save slotPBid to the defaults, and remember to save later + // + if (localDict) { + [localDict setObject:availableSlotPBid forKey:kOpenUDIDSlotKey]; + saveLocalDictToDefaults = YES; + } + + // Save the local dictionary to the corresponding UIPasteboard slot + // + if (openUDID && localDict) + [OpenUDIDMac _setDict:localDict forPasteboard:slotPB]; + } + + // Save the dictionary locally if applicable + // + if (localDict && saveLocalDictToDefaults) + [defaults setObject:localDict forKey:kOpenUDIDKey]; + + // If the UIPasteboard external representation marks this app as opted-out, then to respect privacy, we return the ZERO OpenUDID, a sequence of 40 zeros... + // This is a *new* case that developers have to deal with. Unlikely, statistically low, but still. + // To circumvent this and maintain good tracking (conversion ratios, etc.), developers are invited to calculate how many of their users have opted-out from the full set of users. + // This ratio will let them extrapolate convertion ratios more accurately. + // + if (optedOut) { + if (error!=nil) *error = [NSError errorWithDomain:kOpenUDIDDomain + code:kOpenUDIDErrorOptedOut + userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Application with unique id %@ is opted-out from OpenUDID as of %@",appUID,optedOutDate],@"description", nil]]; + + kOpenUDIDSessionCache = [[NSString stringWithFormat:@"%040x",0] retain]; + return kOpenUDIDSessionCache; + } + + // return the well earned openUDID! + // + if (error!=nil) { + if (isCompromised) + *error = [NSError errorWithDomain:kOpenUDIDDomain + code:kOpenUDIDErrorCompromised + userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Found a discrepancy between stored OpenUDID (reliable) and redundant copies; one of the apps on the device is most likely corrupting the OpenUDID protocol",@"description", nil]]; + else + *error = [NSError errorWithDomain:kOpenUDIDDomain + code:kOpenUDIDErrorNone + userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]]; + } + kOpenUDIDSessionCache = [openUDID retain]; + return kOpenUDIDSessionCache; +} + ++ (void) setOptOut:(BOOL)optOutValue { + + // init call + [OpenUDIDMac value]; + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + // load the dictionary from local cache or create one + id dict = [defaults objectForKey:kOpenUDIDKey]; + if ([dict isKindOfClass:[NSDictionary class]]) { + dict = [NSMutableDictionary dictionaryWithDictionary:dict]; + } else { + dict = [NSMutableDictionary dictionaryWithCapacity:2]; + } + + // set the opt-out date or remove key, according to parameter + if (optOutValue) + [dict setObject:[NSDate date] forKey:kOpenUDIDOOTSKey]; + else + [dict removeObjectForKey:kOpenUDIDOOTSKey]; + + // store the dictionary locally + [defaults setObject:dict forKey:kOpenUDIDKey]; + + OpenUDIDLog(@"Local dict after opt-out = %@",dict); + + // reset memory cache + kOpenUDIDSessionCache = nil; + +} + +@end diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib new file mode 100644 index 0000000000..8b6ba8420f --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln new file mode 100644 index 0000000000..c44446e92e --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln @@ -0,0 +1,62 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript", "HelloJavascript.vcxproj", "{3B0B58B1-2734-488E-A542-ECEC11EB2455}" + ProjectSection(ProjectDependencies) = postProject + {39379840-825A-45A0-B363-C09FFEF864BD} = {39379840-825A-45A0-B363-C09FFEF864BD} + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{8C6B0381-B325-4D7F-B1BB-474ABACE46AC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\cocos2d-x\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\cocos2d-x\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d", "..\..\cocos2d-x\cocos\scripting\js-bindings\proj.win32\libjscocos2d.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsimulator", "..\..\cocos2d-x\tools\simulator\libsimulator\proj.win32\libsimulator.vcxproj", "{001B324A-BB91-4E83-875C-C92F75C40857}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet", "..\..\cocos2d-x\external\bullet\proj.win32\libbullet.vcxproj", "{012DFF48-A13F-4F52-B07B-F8B9D21CE95B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Debug|Win32.Build.0 = Debug|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Release|Win32.ActiveCfg = Release|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Release|Win32.Build.0 = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Debug|Win32.ActiveCfg = Debug|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Debug|Win32.Build.0 = Debug|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Release|Win32.ActiveCfg = Release|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Release|Win32.Build.0 = Release|Win32 + {001B324A-BB91-4E83-875C-C92F75C40857}.Debug|Win32.ActiveCfg = Debug|Win32 + {001B324A-BB91-4E83-875C-C92F75C40857}.Debug|Win32.Build.0 = Debug|Win32 + {001B324A-BB91-4E83-875C-C92F75C40857}.Release|Win32.ActiveCfg = Release|Win32 + {001B324A-BB91-4E83-875C-C92F75C40857}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {8C6B0381-B325-4D7F-B1BB-474ABACE46AC} + {929480E7-23C0-4DF6-8456-096D71547116} = {8C6B0381-B325-4D7F-B1BB-474ABACE46AC} + EndGlobalSection +EndGlobal diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj new file mode 100644 index 0000000000..8a8e2c64e6 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj @@ -0,0 +1,221 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3B0B58B1-2734-488E-A542-ECEC11EB2455} + HelloJavascript + + + + Application + Unicode + v100 + v110 + v110_xp + v120 + v120_xp + + + Application + Unicode + v100 + v110 + v110_xp + v120 + v120_xp + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + + _DEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)game.tlb + game.h + + + game_i.c + game_p.c + + + Disabled + $(ProjectDir)..\Classes;$(ProjectDir)..\Classes\service;$(EngineRoot)tools\simulator\libsimulator\lib\runtime;$(EngineRoot)tools\simulator\libsimulator\lib\protobuf-lite;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)tools\simulator\libsimulator\proj.win32;$(EngineRoot)tools\simulator\libsimulator\lib;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)external;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + 4267;4251;4244;4800;4099;%(DisableSpecificWarnings) + true + $(IntDir)vc$(PlatformToolsetVersion).pdb + algorithm + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) + + + if not exist "$(OutDir)" mkdir "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\cocos2d-x\external\spidermonkey\prebuilt\win32\debug-build\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\cocos2d-x\external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + + libcurl_imp.lib;mozjs-33.lib;ws2_32.lib;sqlite3.lib;websockets.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + $(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt) + $(ProjectDir)../../../runtime/win32/$(TargetName).pdb + + + xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\js-bindings\script" "$(OutDir)\script" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\src" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\res" /D /E /I /F /Y +copy "$(ProjectDir)..\..\..\main.js" "$(OutDir)\" /Y +copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y + + + Copy js and resource files. + + + xcopy /Y /Q "$(OutDir)*.dll" "$(ProjectDir)..\..\..\runtime\win32\" +xcopy /Y /Q "$(ProjectDir)..\Classes\ide-support\lang" "$(ProjectDir)..\..\..\runtime\win32\" + + + + + NDEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)game.tlb + game.h + + + game_i.c + game_p.c + + + $(ProjectDir)..\Classes;$(ProjectDir)..\Classes\service;$(EngineRoot)tools\simulator\libsimulator\lib\runtime;$(EngineRoot)tools\simulator\libsimulator\lib\protobuf-lite;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)tools\simulator\libsimulator\proj.win32;$(EngineRoot)tools\simulator\libsimulator\lib;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)external;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) + + + MultiThreadedDLL + + + Level3 + + + 4267;4251;4244;4800;%(DisableSpecificWarnings) + true + algorithm + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) + + + if not exist "$(OutDir)" mkdir "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\cocos2d-x\external\spidermonkey\prebuilt\win32\release-build\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\cocos2d-x\external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + + libcurl_imp.lib;mozjs-33.lib;ws2_32.lib;sqlite3.lib;websockets.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) + Windows + MachineX86 + true + + + xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\js-bindings\script" "$(OutDir)\script" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\src" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\res" /D /E /I /F /Y +copy "$(ProjectDir)..\..\..\main.js" "$(OutDir)\" /Y +copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y + Copy js and resource files. + + + + + + + + + + + + + + + + + + + + + + + + {39379840-825a-45a0-b363-c09ffef864bd} + + + {001b324a-bb91-4e83-875c-c92f75c40857} + + + + + + + + + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj.filters b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj.filters new file mode 100644 index 0000000000..92fd39588d --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest + + + {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} + + + {e93a77e1-af1e-4400-87d3-504b62ebdbb0} + + + {5bec5a39-9bec-42e8-a3e4-823d4eacec56} + + + + + win32 + + + Classes + + + Classes\ide-support + + + Classes\ide-support + + + win32 + + + + + Classes + + + win32 + + + + Classes\ide-support + + + Classes\ide-support + + + Classes\ide-support + + + win32 + + + + + resource + + + + + resource + + + \ No newline at end of file diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json new file mode 100644 index 0000000000..09470485f6 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json @@ -0,0 +1,30 @@ +{ + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + }, + { + "from": "../../../config.json", + "to": "" + } + ], + "must_copy_resources": [ + { + "from": "../../cocos2d-x/cocos/scripting/js-bindings/script", + "to": "script" + } + ] +} diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/game.rc b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/game.rc new file mode 100644 index 0000000000..31e9582f75 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/game.rc @@ -0,0 +1,199 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Simplified, PRC) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU_COCOS MENU +BEGIN + POPUP "帮助(&H)" + BEGIN + MENUITEM "关于(&A)", ID_HELP_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG_ABOUT DIALOGEX 0, 0, 243, 94 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Simulator" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,173,69,63,18 + CTEXT "Cocos Simulator",IDC_STATIC,28,23,173,17 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_DIALOG_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 236 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Chinese (Simplified, PRC) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU_COCOS MENU +BEGIN + POPUP "&Help" + BEGIN + MENUITEM "&About ...", ID_HELP_ABOUT + END +END + +#endif // English resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +GLFW_ICON ICON "res\\game.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "FileDescription", "game Module" + VALUE "FileVersion", "1, 0, 0, 1" + VALUE "InternalName", "game" + VALUE "LegalCopyright", "Copyright " + VALUE "OriginalFilename", "game.exe" + VALUE "ProductName", "game Module" + VALUE "ProductVersion", "1, 0, 0, 1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/res/game.ico b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/res/game.ico new file mode 100644 index 0000000000..feaf932a74 Binary files /dev/null and b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/res/game.ico differ diff --git a/templates/js-template-runtime/frameworks/runtime-src/proj.win32/resource.h b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/resource.h new file mode 100644 index 0000000000..ba8936c684 --- /dev/null +++ b/templates/js-template-runtime/frameworks/runtime-src/proj.win32/resource.h @@ -0,0 +1,38 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by game.rc +// +#define IDS_PROJNAME 100 +#define IDR_TESTJS 100 +#define IDR_MENU_COCOS 201 +#define IDD_DIALOG1 202 +#define IDD_DIALOG_ABOUT 202 +#define IDC_EDIT2 1001 +#define ID_VIEW_SIZE 30001 +#define ID_FILE_NEW_WINDOW 32771 +#define ID_VIEW_PORTRAIT 32775 +#define ID_VIEW_LANDSCAPE 32776 +#define ID_VIEW_CUSTOM 32777 +#define ID_HELP_ABOUT 32778 +#define ID_FILE_EXIT 32779 +#define ID_Menu 32780 +#define ID_Menu32781 32781 +#define ID_TEST_RESET 32782 +#define ID_CONTROL 32783 +#define ID_CONTROL_RELOAD 32784 +#define ID_VIEW_ZOOMOUT100 32785 +#define ID_VIEW_ZOOMOUT75 32786 +#define ID_VIEW_ZOOMOUT50 32787 +#define ID_VIEW_ZOOMOUT25 32788 +#define ID_CONTROL_TOP 32793 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 204 +#define _APS_NEXT_COMMAND_VALUE 32785 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/templates/js-template-runtime/main.js b/templates/js-template-runtime/main.js new file mode 100644 index 0000000000..95f14b8224 --- /dev/null +++ b/templates/js-template-runtime/main.js @@ -0,0 +1,67 @@ +/** + * A brief explanation for "project.json": + * Here is the content of project.json file, this is the global configuration for your game, you can modify it to customize some behavior. + * The detail of each field is under it. + { + "project_type": "javascript", + // "project_type" indicate the program language of your project, you can ignore this field + + "debugMode" : 1, + // "debugMode" possible values : + // 0 - No message will be printed. + // 1 - cc.error, cc.assert, cc.warn, cc.log will print in console. + // 2 - cc.error, cc.assert, cc.warn will print in console. + // 3 - cc.error, cc.assert will print in console. + // 4 - cc.error, cc.assert, cc.warn, cc.log will print on canvas, available only on web. + // 5 - cc.error, cc.assert, cc.warn will print on canvas, available only on web. + // 6 - cc.error, cc.assert will print on canvas, available only on web. + + "showFPS" : true, + // Left bottom corner fps information will show when "showFPS" equals true, otherwise it will be hide. + + "frameRate" : 60, + // "frameRate" set the wanted frame rate for your game, but the real fps depends on your game implementation and the running environment. + + "id" : "gameCanvas", + // "gameCanvas" sets the id of your canvas element on the web page, it's useful only on web. + + "renderMode" : 0, + // "renderMode" sets the renderer type, only useful on web : + // 0 - Automatically chosen by engine + // 1 - Forced to use canvas renderer + // 2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers + + "engineDir" : "frameworks/cocos2d-html5/", + // In debug mode, if you use the whole engine to develop your game, you should specify its relative path with "engineDir", + // but if you are using a single engine file, you can ignore it. + + "modules" : ["cocos2d"], + // "modules" defines which modules you will need in your game, it's useful only on web, + // using this can greatly reduce your game's resource size, and the cocos console tool can package your game with only the modules you set. + // For details about modules definitions, you can refer to "../../frameworks/cocos2d-html5/modulesConfig.json". + + "jsList" : [ + ] + // "jsList" sets the list of js files in your game. + } + * + */ + +cc.game.onStart = function(){ + if(!cc.sys.isNative && document.getElementById("cocosLoading")) //If referenced loading.js, please remove it + document.body.removeChild(document.getElementById("cocosLoading")); + + // Pass true to enable retina display, disabled by default to improve performance + cc.view.enableRetina(false); + // Adjust viewport meta + cc.view.adjustViewPort(true); + // Setup the resolution policy and design resolution size + cc.view.setDesignResolutionSize(800, 450, cc.ResolutionPolicy.SHOW_ALL); + // The game will be resized when browser size change + cc.view.resizeWithBrowserSize(true); + //load resources + cc.LoaderScene.preload(g_resources, function () { + cc.director.runScene(new HelloWorldScene()); + }, this); +}; +cc.game.run(); \ No newline at end of file diff --git a/templates/js-template-runtime/manifest.webapp b/templates/js-template-runtime/manifest.webapp new file mode 100644 index 0000000000..e9ecf73f0b --- /dev/null +++ b/templates/js-template-runtime/manifest.webapp @@ -0,0 +1,19 @@ +{ + "version": "1.0", + "name": "HelloJavascript", + "description": "HelloJavascript", + "launch_path": "/index.html", + "icons": { + "128": "/res/icon.png" + }, + "developer": { + "name": "Cocos2d-html5", + "url": "http://cocos2d-x.org/" + }, + "default_locale": "en", + "installs_allowed_from": [ + "*" + ], + "orientation": "portrait-primary", + "fullscreen": "true" +} diff --git a/templates/js-template-runtime/project.json b/templates/js-template-runtime/project.json new file mode 100644 index 0000000000..e54f870660 --- /dev/null +++ b/templates/js-template-runtime/project.json @@ -0,0 +1,17 @@ +{ + "project_type": "javascript", + + "debugMode" : 1, + "showFPS" : true, + "frameRate" : 60, + "id" : "gameCanvas", + "renderMode" : 0, + "engineDir":"frameworks/cocos2d-html5", + + "modules" : ["cocos2d"], + + "jsList" : [ + "src/resource.js", + "src/app.js" + ] +} diff --git a/templates/js-template-runtime/res/CloseNormal.png b/templates/js-template-runtime/res/CloseNormal.png new file mode 100644 index 0000000000..5657a13b58 Binary files /dev/null and b/templates/js-template-runtime/res/CloseNormal.png differ diff --git a/templates/js-template-runtime/res/CloseSelected.png b/templates/js-template-runtime/res/CloseSelected.png new file mode 100644 index 0000000000..e4c82da775 Binary files /dev/null and b/templates/js-template-runtime/res/CloseSelected.png differ diff --git a/templates/js-template-runtime/res/HelloWorld.png b/templates/js-template-runtime/res/HelloWorld.png new file mode 100644 index 0000000000..3a20f2538a Binary files /dev/null and b/templates/js-template-runtime/res/HelloWorld.png differ diff --git a/templates/js-template-runtime/res/favicon.ico b/templates/js-template-runtime/res/favicon.ico new file mode 100644 index 0000000000..1ad6a0907b Binary files /dev/null and b/templates/js-template-runtime/res/favicon.ico differ diff --git a/templates/js-template-runtime/runtime/config.json b/templates/js-template-runtime/runtime/config.json new file mode 100644 index 0000000000..1449e545c1 --- /dev/null +++ b/templates/js-template-runtime/runtime/config.json @@ -0,0 +1,6 @@ +{ + "version":"v4-js-runtime-1.0", + "zip_file_size":"43441816", + "repo_name":"cocos-runtime-bin", + "repo_parent":"https://github.com/natural-law/" +} diff --git a/templates/js-template-runtime/src/app.js b/templates/js-template-runtime/src/app.js new file mode 100644 index 0000000000..8df4e42ce8 --- /dev/null +++ b/templates/js-template-runtime/src/app.js @@ -0,0 +1,78 @@ + +var HelloWorldLayer = cc.Layer.extend({ + sprite:null, + ctor:function () { + ////////////////////////////// + // 1. super init first + this._super(); + + ///////////////////////////// + // 2. add a menu item with "X" image, which is clicked to quit the program + // you may modify it. + // ask the window size + var size = cc.winSize; + + // add a "close" icon to exit the progress. it's an autorelease object + var closeItem = new cc.MenuItemImage( + res.CloseNormal_png, + res.CloseSelected_png, + function () { + cc.log("Menu is clicked!"); + }, this); + closeItem.attr({ + x: size.width - 20, + y: 20, + anchorX: 0.5, + anchorY: 0.5 + }); + + var menu = new cc.Menu(closeItem); + menu.x = 0; + menu.y = 0; + this.addChild(menu, 1); + + ///////////////////////////// + // 3. add your codes below... + // add a label shows "Hello World" + // create and initialize a label + var helloLabel = new cc.LabelTTF("Hello World", "Arial", 38); + // position the label on the center of the screen + helloLabel.x = size.width / 2; + helloLabel.y = 0; + // add the label as a child to this layer + this.addChild(helloLabel, 5); + + // add "HelloWorld" splash screen" + this.sprite = new cc.Sprite(res.HelloWorld_png); + this.sprite.attr({ + x: size.width / 2, + y: size.height / 2, + scale: 0.5, + rotation: 180 + }); + this.addChild(this.sprite, 0); + + this.sprite.runAction( + cc.sequence( + cc.rotateTo(2, 0), + cc.scaleTo(2, 1, 1) + ) + ); + helloLabel.runAction( + cc.spawn( + cc.moveBy(2.5, cc.p(0, size.height - 40)), + cc.tintTo(2.5,255,125,0) + ) + ); + return true; + } +}); + +var HelloWorldScene = cc.Scene.extend({ + onEnter:function () { + this._super(); + var layer = new HelloWorldLayer(); + this.addChild(layer); + } +}); + diff --git a/templates/js-template-runtime/src/resource.js b/templates/js-template-runtime/src/resource.js new file mode 100644 index 0000000000..4438ab1b86 --- /dev/null +++ b/templates/js-template-runtime/src/resource.js @@ -0,0 +1,10 @@ +var res = { + HelloWorld_png : "res/HelloWorld.png", + CloseNormal_png : "res/CloseNormal.png", + CloseSelected_png : "res/CloseSelected.png" +}; + +var g_resources = []; +for (var i in res) { + g_resources.push(res[i]); +} \ No newline at end of file diff --git a/templates/lua-template-default/cocos-project-template.json b/templates/lua-template-default/cocos-project-template.json index 303c2e6f95..9d4bf2af92 100644 --- a/templates/lua-template-default/cocos-project-template.json +++ b/templates/lua-template-default/cocos-project-template.json @@ -135,6 +135,18 @@ "proj.win32/Debug", "proj.win32/Release" ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/Classes/ide-support", + "to": "frameworks/runtime-src/Classes/ide-support", + "exclude": [ + "RuntimeJsImpl.h", + "RuntimeJsImpl.cpp" + ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/Classes/lua_module_register.h", + "to": "frameworks/runtime-src/Classes/" } ], "project_rename": { diff --git a/templates/lua-template-default/frameworks/CMakeLists.txt b/templates/lua-template-default/frameworks/CMakeLists.txt index 9e0621aba5..eb5755c7ed 100644 --- a/templates/lua-template-default/frameworks/CMakeLists.txt +++ b/templates/lua-template-default/frameworks/CMakeLists.txt @@ -34,6 +34,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${COCOS2D_ROOT}/cmake/Modules/") include(CocosBuildHelpers) option(DEBUG_MODE "Debug or release?" ON) +option(USE_BULLET "Use bullet for physics3d library" ON) if(DEBUG_MODE) set(CMAKE_BUILD_TYPE DEBUG) @@ -41,6 +42,11 @@ else(DEBUG_MODE) set(CMAKE_BUILD_TYPE RELEASE) endif(DEBUG_MODE) +if(USE_BULLET) + add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=1) + add_definitions(-DCC_USE_PHYSICS=1) +endif(USE_BULLET) + # libcocos2d set(BUILD_CPP_TESTS OFF CACHE BOOL "turn off build cpp-tests") @@ -129,5 +135,7 @@ pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/extension ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/network ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/ui ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/3d ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua-bindings/script/physics3d ${APP_BIN_DIR}/Resources ) diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp deleted file mode 100644 index 9b07cc7b96..0000000000 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp +++ /dev/null @@ -1,342 +0,0 @@ -// -// RuntimeLuaImpl.cpp -// Simulator -// -// - -#include "RuntimeLuaImpl.h" - -#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) - -#include -#include - -#include "lua_debugger.h" -#include "CCLuaEngine.h" -#include "LuaBasicConversions.h" -#include "lua_module_register.h" - -#include "runtime/Runtime.h" -#include "runtime/ConfigParser.h" -#include "runtime/FileServer.h" - -extern std::string g_projectPath; // Runtime.cpp - -USING_NS_CC; -using namespace std; - -static void resetLuaModule(const string& fileName) -{ - if (fileName.empty()) - { - return; - } - auto engine = LuaEngine::getInstance(); - LuaStack* luaStack = engine->getLuaStack(); - lua_State* stack = luaStack->getLuaState(); - lua_getglobal(stack, "package"); /* L: package */ - lua_getfield(stack, -1, "loaded"); /* L: package loaded */ - lua_pushnil(stack); /* L: lotable ?-.. nil */ - while (0 != lua_next(stack, -2)) /* L: lotable ?-.. key value */ - { - //CCLOG("%s - %s \n", tolua_tostring(stack, -2, ""), lua_typename(stack, lua_type(stack, -1))); - std::string key = tolua_tostring(stack, -2, ""); - std::string tableKey = key; - size_t found = tableKey.rfind(".lua"); - if (found != std::string::npos) - tableKey = tableKey.substr(0, found); - tableKey = replaceAll(tableKey, ".", "/"); - tableKey = replaceAll(tableKey, "\\", "/"); - tableKey.append(".lua"); - found = fileName.rfind(tableKey); - if (0 == found || (found != std::string::npos && fileName.at(found - 1) == '/')) - { - lua_pushstring(stack, key.c_str()); - lua_pushnil(stack); - if (lua_istable(stack, -5)) - { - lua_settable(stack, -5); - } - } - lua_pop(stack, 1); - } - lua_pop(stack, 2); -} - -bool reloadScript(const string& file) -{ - auto director = Director::getInstance(); - FontFNT::purgeCachedData(); - if (director->getOpenGLView()) - { - SpriteFrameCache::getInstance()->removeSpriteFrames(); - director->getTextureCache()->removeAllTextures(); - } - FileUtils::getInstance()->purgeCachedEntries(); - string modulefile = file; - - if (! modulefile.empty()) - { - resetLuaModule(modulefile); - } - else - { - modulefile = ConfigParser::getInstance()->getEntryFile().c_str(); - } - - auto engine = LuaEngine::getInstance(); - LuaStack* luaStack = engine->getLuaStack(); - std::string require = "require \'" + modulefile + "\'"; - return luaStack->executeString(require.c_str()); -} - -int lua_cocos2dx_runtime_addSearchPath(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FileUtils* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_addSearchPath'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1 || argc == 2) - { - std::string arg0; - bool arg1 = false; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - - if (argc == 2) - { - ok &= luaval_to_boolean(tolua_S, 3, &arg1); - } - - if(!ok) - return 0; - - if (! FileUtils::getInstance()->isAbsolutePath(arg0)) - { - // add write path to search path - if (FileServer::getShareInstance()->getIsUsingWritePath()) - { - cobj->addSearchPath(FileServer::getShareInstance()->getWritePath() + arg0, arg1); - } else - { - cobj->addSearchPath(arg0, arg1); - } - -#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - // add project path to search path - cobj->addSearchPath(g_projectPath + arg0, arg1); -#endif - } - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "addSearchPath",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_addSearchPath'.",&tolua_err); -#endif - - return 0; -} - -int lua_cocos2dx_runtime_setSearchPaths(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FileUtils* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_runtime_setSearchPaths'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::vector vecPaths, writePaths; - - ok &= luaval_to_std_vector_string(tolua_S, 2, &vecPaths); - if(!ok) - return 0; - std::vector originPath; // for IOS platform. - std::vector projPath; // for Desktop platform. - for (size_t i = 0; i < vecPaths.size(); i++) - { - if (!FileUtils::getInstance()->isAbsolutePath(vecPaths[i])) - { - originPath.push_back(vecPaths[i]); // for IOS platform. - projPath.push_back(g_projectPath + vecPaths[i]); //for Desktop platform. - writePaths.push_back(FileServer::getShareInstance()->getWritePath() + vecPaths[i]); - } - } - -#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - vecPaths.insert(vecPaths.end(), projPath.begin(), projPath.end()); -#endif - if (FileServer::getShareInstance()->getIsUsingWritePath()) - { - vecPaths.insert(vecPaths.end(), writePaths.begin(), writePaths.end()); - } else - { - vecPaths.insert(vecPaths.end(), originPath.begin(), originPath.end()); - } - - cobj->setSearchPaths(vecPaths); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSearchPaths",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_runtime_setSearchPaths'.",&tolua_err); -#endif - - return 0; -} - -static void register_runtime_override_function(lua_State* tolua_S) -{ - lua_pushstring(tolua_S, "cc.FileUtils"); - lua_rawget(tolua_S, LUA_REGISTRYINDEX); - if (lua_istable(tolua_S,-1)){ - tolua_function(tolua_S,"addSearchPath",lua_cocos2dx_runtime_addSearchPath); - tolua_function(tolua_S,"setSearchPaths",lua_cocos2dx_runtime_setSearchPaths); - } - lua_pop(tolua_S, 1); -} - -static void luaScriptLoader(std::string strDebugArg) -{ - -} - -//////////////////////////////////////// - -RuntimeLuaImpl *RuntimeLuaImpl::create() -{ - auto instance = new RuntimeLuaImpl(); - return instance; -} - -void RuntimeLuaImpl::onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse) -{ - // Lua - char szDebugArg[1024] = {0}; - sprintf(szDebugArg, "require('debugger')(%s,'%s')",dArgParse["debugcfg"].GetString(), ""); - startScript(szDebugArg); - dReplyParse.AddMember("code", 0, dReplyParse.GetAllocator()); -} - -void RuntimeLuaImpl::onReload(const rapidjson::Document &dArgParse, rapidjson::Document &dReplyParse) -{ - // lua - if (dArgParse.HasMember("modulefiles")) - { - rapidjson::Value bodyvalue(rapidjson::kObjectType); - const rapidjson::Value& objectfiles = dArgParse["modulefiles"]; - for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++) - { - if (!reloadScript(objectfiles[i].GetString())) - { - bodyvalue.AddMember(objectfiles[i].GetString(), 1, dReplyParse.GetAllocator()); - } - } - if (0 == objectfiles.Size()) - { - reloadScript(""); - } - dReplyParse.AddMember("body", bodyvalue, dReplyParse.GetAllocator()); - } - - dReplyParse.AddMember("code", 0, dReplyParse.GetAllocator()); -} - -void RuntimeLuaImpl::startScript(const std::string& strDebugArg) -{ - init(); - auto engine = LuaEngine::getInstance(); - auto stack = engine->getLuaStack(); - - const ProjectConfig &project = RuntimeEngine::getInstance()->getProjectConfig(); - - // set search path - stack->addSearchPath(project.getProjectDir().c_str()); - string path = FileUtils::getInstance()->fullPathForFilename(project.getScriptFileRealPath().c_str()); - size_t pos; - while ((pos = path.find_first_of("\\")) != std::string::npos) - { - path.replace(pos, 1, "/"); - } - size_t p = path.find_last_of("/"); - string workdir; - if (p != path.npos) - { - workdir = path.substr(0, p); - stack->addSearchPath(workdir.c_str()); - FileUtils::getInstance()->addSearchPath(workdir); - } - - // register lua engine - if (!strDebugArg.empty()) - { - // open debugger.lua module - cocos2d::log("debug args = %s", strDebugArg.c_str()); - luaopen_lua_debugger(engine->getLuaStack()->getLuaState()); - engine->executeString(strDebugArg.c_str()); - } - std::string code("require \""); - code.append(ConfigParser::getInstance()->getEntryFile().c_str()); - code.append("\""); - engine->executeString(code.c_str()); -} - -// -// private -// - -void RuntimeLuaImpl::init() -{ - auto engine = LuaEngine::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(engine); - lua_module_register(engine->getLuaStack()->getLuaState()); - register_runtime_override_function(engine->getLuaStack()->getLuaState()); - engine->getLuaStack()->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA")); -} - -#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) \ No newline at end of file diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.h b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.h deleted file mode 100644 index d67c923669..0000000000 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// RuntimeLuaImpl.h -// Simulator -// -// - -#ifndef __Simulator__RuntimeLuaImpl__ -#define __Simulator__RuntimeLuaImpl__ - -#include "CodeIDESupport.h" -#include "cocos2d.h" - -#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) - -#include "runtime/RuntimeProtocol.h" - -class RuntimeLuaImpl : public RuntimeProtocol -{ -public: - static RuntimeLuaImpl *create(); - - void onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse); - void onReload(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse); - void startScript(const std::string& strDebugArg); - -private: - void init(); -}; - -#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) - -#endif /* defined(__Simulator__RuntimeLua__) */ diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp index 54519e75df..af4e6fff18 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/SimpleConfigParser.cpp @@ -37,7 +37,7 @@ void SimpleConfigParser::readConfig(const string &filepath) return; if (_docRootjson.Parse<0>(fileContent.c_str()).HasParseError()) { - cocos2d::log("read json file %s failed because of %s", fullPathFile.c_str(), _docRootjson.GetParseError()); + cocos2d::log("read json file %s failed because of %d", fullPathFile.c_str(), _docRootjson.GetParseError()); return; } diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lang b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lang deleted file mode 100644 index 1c13dacd89..0000000000 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lang +++ /dev/null @@ -1,29 +0,0 @@ -{ - "zh-CN": { - "View": "视图(&V)", - "Exit": "退出(&X)", - "File": "文件(&F)", - "Portrait": "竖屏", - "Landscape": "横屏", - "Refresh": "刷新(重启)", - "Zoom Out": "缩放", - "Simulator": "模拟器", - "Open File": "打开文件", - "Open Project": "打开工程", - "Error": "错误", - "Help": "帮助(&H)", - "About": "关于(&A)" - }, - "zh-Hans": { - "View": "视图", - "Exit": "退出", - "File": "文件", - "Portrait": "竖屏", - "Landscape": "横屏", - "Refresh": "刷新(重启)", - "Zoom Out": "缩放", - "Simulator": "模拟器", - "Help": "帮助(&H)", - "About": "关于(&A)" - } -} \ No newline at end of file diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lua_debugger.c b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lua_debugger.c deleted file mode 100644 index 2b695a1349..0000000000 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lua_debugger.c +++ /dev/null @@ -1,8673 +0,0 @@ - -/* lua_debugger.c */ - -#if __cplusplus -extern "C" { -#endif - -#include "lua.h" -#include "lauxlib.h" -#include "lua_debugger.h" - -/* debugger */ -static const char lua_m_debugger[] = { - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29, - 0x20,0x32,0x30,0x31,0x31,0x2d,0x32,0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72, - 0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f, - 0x74,0x68,0x65,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69, - 0x67,0x68,0x74,0x73,0x20,0x72,0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54, - 0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20, - 0x74,0x68,0x65,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67, - 0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72, - 0x65,0x20,0x6d,0x61,0x64,0x65,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65, - 0x20,0x75,0x6e,0x64,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73, - 0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20, - 0x50,0x75,0x62,0x6c,0x69,0x63,0x20,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76, - 0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63, - 0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69, - 0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20, - 0x69,0x73,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a, - 0x2d,0x2d,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63, - 0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f, - 0x65,0x70,0x6c,0x2d,0x76,0x31,0x30,0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74,0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a, - 0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57, - 0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61, - 0x6c,0x20,0x41,0x50,0x49,0x20,0x61,0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d, - 0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x44,0x65,0x62,0x75, - 0x67,0x67,0x65,0x72,0x20,0x75,0x73,0x69,0x6e,0x67,0x20,0x44,0x42,0x47,0x70,0x20, - 0x70,0x72,0x6f,0x74,0x6f,0x63,0x6f,0x6c,0x2e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x65, - 0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x73,0x20, - 0x61,0x20,0x73,0x69,0x6e,0x67,0x6c,0x65,0x20,0x69,0x6e,0x69,0x74,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x74,0x61,0x6b, - 0x65,0x73,0x20,0x36,0x20,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x73,0x20, - 0x28,0x49,0x44,0x45,0x48,0x4f,0x53,0x54,0x2c,0x20,0x49,0x44,0x45,0x50,0x4f,0x52, - 0x54,0x2c,0x20,0x49,0x44,0x45,0x4b,0x45,0x59,0x2c,0x20,0x54,0x52,0x41,0x4e,0x53, - 0x50,0x4f,0x52,0x54,0x2c,0x20,0x50,0x4c,0x41,0x54,0x46,0x4f,0x52,0x4d,0x2c,0x20, - 0x57,0x4f,0x52,0x4b,0x49,0x4e,0x47,0x44,0x49,0x52,0x29,0x2e,0x0a,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x49,0x44,0x45,0x48,0x4f,0x53,0x54,0x3a,0x20,0x74,0x68,0x65,0x20, - 0x68,0x6f,0x73,0x74,0x20,0x6e,0x61,0x6d,0x65,0x20,0x6f,0x72,0x20,0x74,0x68,0x65, - 0x20,0x69,0x70,0x20,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x20,0x6f,0x66,0x20,0x74, - 0x68,0x65,0x20,0x44,0x42,0x47,0x50,0x20,0x73,0x65,0x72,0x76,0x65,0x72,0x20,0x28, - 0x73,0x6f,0x20,0x79,0x6f,0x75,0x72,0x20,0x69,0x64,0x65,0x29,0x0a,0x2d,0x2d,0x20, - 0x69,0x66,0x20,0x48,0x4f,0x53,0x54,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c,0x20, - 0x74,0x68,0x65,0x20,0x44,0x42,0x47,0x50,0x5f,0x49,0x44,0x45,0x48,0x4f,0x53,0x54, - 0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64, - 0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20,0x74,0x68,0x65,0x20,0x65,0x6e,0x76,0x20, - 0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x74,0x68,0x65,0x20, - 0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x27,0x31, - 0x32,0x37,0x2e,0x30,0x2e,0x30,0x2e,0x31,0x27,0x20,0x69,0x73,0x20,0x75,0x73,0x65, - 0x64,0x2e,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x44,0x45,0x50,0x4f,0x52,0x54, - 0x3a,0x20,0x74,0x68,0x65,0x20,0x70,0x6f,0x72,0x74,0x20,0x6f,0x66,0x20,0x74,0x68, - 0x65,0x20,0x44,0x42,0x47,0x50,0x20,0x73,0x65,0x72,0x76,0x65,0x72,0x20,0x28,0x6d, - 0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x63,0x6f,0x6e,0x66,0x69,0x67,0x75,0x72,0x65, - 0x20,0x69,0x6e,0x20,0x74,0x68,0x65,0x20,0x49,0x44,0x45,0x29,0x0a,0x2d,0x2d,0x20, - 0x69,0x66,0x20,0x50,0x4f,0x52,0x54,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c,0x20, - 0x74,0x68,0x65,0x20,0x44,0x42,0x47,0x50,0x5f,0x49,0x44,0x45,0x50,0x4f,0x52,0x54, - 0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64, - 0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20,0x74,0x68,0x65,0x20,0x65,0x6e,0x76,0x20, - 0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x74,0x68,0x65,0x20, - 0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x27,0x31, - 0x30,0x30,0x30,0x30,0x27,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x2e,0x0a,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x44,0x45,0x49,0x44,0x45,0x4b,0x45,0x59,0x3a,0x20, - 0x61,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x69, - 0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x61,0x73,0x20,0x73,0x65,0x73,0x73,0x69,0x6f, - 0x6e,0x20,0x6b,0x65,0x79,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20,0x49,0x44,0x45,0x4b, - 0x45,0x59,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x74,0x68,0x65,0x20,0x44, - 0x42,0x47,0x50,0x5f,0x49,0x44,0x45,0x4b,0x45,0x59,0x20,0x65,0x6e,0x76,0x20,0x76, - 0x61,0x72,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x69, - 0x66,0x20,0x74,0x68,0x65,0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73, - 0x20,0x6e,0x69,0x6c,0x2c,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x66,0x61,0x75,0x6c, - 0x74,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x27,0x6c,0x75,0x61,0x69,0x64,0x65,0x6b, - 0x65,0x79,0x27,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x54,0x52,0x41,0x4e,0x53,0x50,0x4f,0x52,0x54,0x3a,0x20,0x28,0x61, - 0x64,0x76,0x61,0x6e,0x63,0x65,0x64,0x20,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x29,0x20,0x74,0x68,0x65,0x20, - 0x6d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x6e,0x61,0x6d,0x65,0x20,0x6f,0x66,0x20,0x77, - 0x68,0x69,0x63,0x68,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x20,0x74, - 0x68,0x65,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x20,0x69,0x6e,0x74, - 0x65,0x72,0x66,0x61,0x63,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x64, - 0x6f,0x20,0x74,0x68,0x65,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x77,0x69,0x74,0x68,0x20,0x74,0x68,0x65,0x20,0x73,0x65,0x72,0x76,0x65,0x72, - 0x2e,0x0a,0x2d,0x2d,0x20,0x62,0x79,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20, - 0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x75,0x73,0x65, - 0x20,0x61,0x6e,0x20,0x20,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x69,0x6d, - 0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x62,0x61,0x73, - 0x65,0x64,0x20,0x6f,0x6e,0x20,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2c, - 0x20,0x62,0x75,0x74,0x20,0x69,0x66,0x20,0x63,0x61,0x6e,0x20,0x6e,0x6f,0x74,0x20, - 0x75,0x73,0x65,0x20,0x69,0x74,0x2c,0x20,0x79,0x6f,0x75,0x20,0x63,0x6f,0x75,0x6c, - 0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x20,0x6f,0x72,0x20,0x75, - 0x73,0x65,0x20,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x74,0x72,0x61,0x6e,0x73, - 0x70,0x6f,0x72,0x74,0x20,0x6c,0x61,0x79,0x65,0x72,0x20,0x69,0x6d,0x70,0x6c,0x65, - 0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66, - 0x20,0x54,0x52,0x41,0x4e,0x53,0x50,0x4f,0x52,0x54,0x20,0x69,0x73,0x20,0x6e,0x69, - 0x6c,0x2c,0x20,0x74,0x68,0x65,0x20,0x44,0x42,0x47,0x50,0x5f,0x54,0x52,0x41,0x4e, - 0x53,0x50,0x4f,0x52,0x54,0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73, - 0x20,0x75,0x73,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20,0x74,0x68,0x65, - 0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c, - 0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20,0x76,0x61,0x6c, - 0x75,0x65,0x20,0x27,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x74,0x72,0x61, - 0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74, - 0x27,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x3a,0x20,0x74,0x68,0x69,0x73, - 0x20,0x69,0x73,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20, - 0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x62, - 0x61,0x73,0x65,0x64,0x20,0x6f,0x6e,0x20,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65, - 0x74,0x2e,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x50,0x4c,0x41,0x54,0x46,0x4f,0x52, - 0x4d,0x3a,0x20,0x28,0x61,0x64,0x76,0x61,0x6e,0x63,0x65,0x64,0x20,0x6f,0x70,0x74, - 0x69,0x6f,0x6e,0x61,0x6c,0x20,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x29, - 0x20,0x27,0x75,0x6e,0x69,0x78,0x27,0x20,0x6f,0x72,0x20,0x27,0x77,0x69,0x6e,0x33, - 0x32,0x27,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x77,0x68,0x69,0x63,0x68,0x20, - 0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x74,0x68,0x65,0x20,0x6b,0x69,0x6e,0x64,0x20, - 0x6f,0x66,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x6f,0x6e,0x20,0x77, - 0x68,0x69,0x63,0x68,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d, - 0x20,0x74,0x6f,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x69,0x73,0x20,0x65,0x78,0x65, - 0x63,0x75,0x74,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x62,0x79,0x20,0x64,0x65,0x66, - 0x61,0x75,0x6c,0x74,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x20,0x77,0x69,0x6c,0x6c,0x20,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x67,0x75, - 0x65,0x73,0x73,0x20,0x69,0x74,0x20,0x61,0x6e,0x64,0x20,0x73,0x75,0x72,0x65,0x6c, - 0x79,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x2c,0x20,0x69,0x66,0x20,0x66,0x6f, - 0x72,0x20,0x73,0x6f,0x6d,0x65,0x20,0x72,0x65,0x61,0x73,0x6f,0x6e,0x73,0x20,0x69, - 0x74,0x20,0x66,0x61,0x69,0x6c,0x73,0x20,0x79,0x6f,0x75,0x20,0x63,0x6f,0x75,0x6c, - 0x64,0x20,0x68,0x65,0x6c,0x70,0x20,0x69,0x74,0x20,0x62,0x79,0x20,0x70,0x72,0x65, - 0x63,0x69,0x73,0x65,0x20,0x74,0x68,0x65,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69, - 0x6f,0x6e,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x0a,0x2d,0x2d,0x20, - 0x69,0x66,0x20,0x50,0x4c,0x41,0x54,0x46,0x4f,0x52,0x4d,0x20,0x69,0x73,0x20,0x6e, - 0x69,0x6c,0x2c,0x20,0x74,0x68,0x65,0x20,0x44,0x42,0x47,0x50,0x5f,0x50,0x4c,0x41, - 0x54,0x46,0x4f,0x52,0x4d,0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73, - 0x20,0x75,0x73,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20,0x74,0x68,0x65, - 0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c,0x2c, - 0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x77,0x69, - 0x6c,0x6c,0x20,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x67,0x75,0x65,0x73,0x73,0x20, - 0x69,0x74,0x2e,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x57,0x4f,0x52,0x4b,0x49,0x4e, - 0x47,0x44,0x49,0x52,0x3a,0x20,0x28,0x61,0x64,0x76,0x61,0x6e,0x63,0x65,0x64,0x20, - 0x6f,0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x70,0x61,0x72,0x61,0x6d,0x65,0x74, - 0x65,0x72,0x29,0x20,0x74,0x68,0x65,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x20, - 0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x20,0x69,0x6e,0x20,0x77,0x68,0x69, - 0x63,0x68,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x74, - 0x6f,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x69,0x73,0x20,0x65,0x78,0x65,0x63,0x75, - 0x74,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x62,0x79,0x20,0x64,0x65,0x66,0x61,0x75, - 0x6c,0x74,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20, - 0x77,0x69,0x6c,0x6c,0x20,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x67,0x75,0x65,0x73, - 0x73,0x20,0x69,0x74,0x20,0x61,0x6e,0x64,0x20,0x73,0x75,0x72,0x65,0x6c,0x79,0x20, - 0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x2c,0x20,0x69,0x66,0x20,0x66,0x6f,0x72,0x20, - 0x73,0x6f,0x6d,0x65,0x20,0x72,0x65,0x61,0x73,0x6f,0x6e,0x73,0x20,0x69,0x74,0x20, - 0x66,0x61,0x69,0x6c,0x73,0x20,0x79,0x6f,0x75,0x20,0x63,0x6f,0x75,0x6c,0x64,0x20, - 0x68,0x65,0x6c,0x70,0x20,0x69,0x74,0x20,0x62,0x79,0x20,0x70,0x72,0x65,0x63,0x69, - 0x73,0x65,0x20,0x74,0x68,0x65,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x20,0x64, - 0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20, - 0x57,0x4f,0x52,0x4b,0x49,0x4e,0x47,0x44,0x49,0x52,0x20,0x69,0x73,0x20,0x6e,0x69, - 0x6c,0x2c,0x20,0x74,0x68,0x65,0x20,0x44,0x42,0x47,0x50,0x5f,0x57,0x4f,0x52,0x4b, - 0x49,0x4e,0x47,0x44,0x49,0x52,0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69, - 0x73,0x20,0x75,0x73,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x69,0x66,0x20,0x74,0x68, - 0x65,0x20,0x65,0x6e,0x76,0x20,0x76,0x61,0x72,0x20,0x69,0x73,0x20,0x6e,0x69,0x6c, - 0x2c,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x77, - 0x69,0x6c,0x6c,0x20,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x67,0x75,0x65,0x73,0x73, - 0x20,0x69,0x74,0x2e,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x4b,0x6e,0x6f,0x77,0x6e, - 0x20,0x49,0x73,0x73,0x75,0x65,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20, - 0x46,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74, - 0x20,0x62,0x65,0x20,0x63,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x75,0x73,0x69,0x6e, - 0x67,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x61, - 0x6e,0x64,0x20,0x74,0x68,0x65,0x6e,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64,0x20,0x69, - 0x6e,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x62,0x65,0x63,0x61,0x75,0x73, - 0x65,0x20,0x74,0x68,0x65,0x69,0x72,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d, - 0x65,0x6e,0x74,0x20,0x69,0x73,0x20,0x6d,0x61,0x70,0x70,0x65,0x64,0x20,0x64,0x69, - 0x72,0x65,0x63,0x74,0x6c,0x79,0x20,0x74,0x6f,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20, - 0x20,0x61,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x69,0x6e,0x74,0x65, - 0x72,0x6e,0x61,0x6c,0x20,0x73,0x74,0x72,0x75,0x63,0x74,0x75,0x72,0x65,0x20,0x77, - 0x68,0x69,0x63,0x68,0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x70, - 0x65,0x72,0x73,0x69,0x73,0x74,0x65,0x64,0x20,0x28,0x69,0x2e,0x65,0x2e,0x20,0x75, - 0x73,0x65,0x64,0x20,0x6f,0x75,0x74,0x73,0x69,0x64,0x65,0x20,0x6f,0x66,0x20,0x74, - 0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x5f,0x68,0x6f,0x6f,0x6b,0x29,0x2e,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x54,0x68,0x65,0x20,0x44,0x4c,0x54,0x4b,0x20, - 0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, - 0x61,0x74,0x69,0x6f,0x6e,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x68, - 0x61,0x6e,0x64,0x6c,0x65,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x66,0x6f, - 0x72,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x2e,0x20,0x41,0x73, - 0x20,0x61,0x20,0x77,0x6f,0x72,0x6b,0x61,0x72,0x6f,0x75,0x6e,0x64,0x2c,0x20,0x74, - 0x68,0x65,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x69,0x73,0x20,0x65,0x6e, - 0x63,0x6f,0x64,0x65,0x64,0x20,0x69,0x6e,0x74,0x6f,0x20,0x74,0x68,0x65,0x0a,0x2d, - 0x2d,0x20,0x20,0x20,0x20,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x61, - 0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x6f,0x66,0x20,0x65,0x61,0x63,0x68, - 0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x61,0x6e,0x64,0x20,0x69,0x73, - 0x20,0x75,0x73,0x65,0x64,0x20,0x6c,0x69,0x6b,0x65,0x77,0x69,0x73,0x65,0x20,0x69, - 0x6e,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x67,0x65,0x74,0x20,0x63, - 0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x2e,0x20,0x54,0x68,0x65,0x20,0x73,0x79,0x6e, - 0x74,0x61,0x78,0x20,0x69,0x73,0x20,0x22,0x3c,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x20,0x49,0x44,0x3e,0x7c,0x3c,0x66,0x75,0x6c,0x6c,0x20,0x6e,0x61,0x6d,0x65,0x3e, - 0x22,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x44,0x79,0x6e,0x61,0x6d,0x69,0x63, - 0x20,0x63,0x6f,0x64,0x65,0x20,0x28,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x64,0x20, - 0x77,0x69,0x74,0x68,0x20,0x6c,0x6f,0x61,0x64,0x20,0x6f,0x72,0x20,0x6c,0x6f,0x61, - 0x64,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x68,0x61,0x6e,0x64,0x6c,0x65,0x64,0x20,0x28,0x74,0x68,0x65,0x20,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x20,0x77,0x69,0x6c,0x6c,0x20,0x73,0x74,0x65,0x70,0x20, - 0x6f,0x76,0x65,0x72,0x20,0x69,0x74,0x2c,0x20,0x6c,0x69,0x6b,0x65,0x20,0x43,0x20, - 0x63,0x6f,0x64,0x65,0x29,0x0a,0x2d,0x2d,0x20,0x44,0x65,0x73,0x69,0x67,0x6e,0x20, - 0x6e,0x6f,0x74,0x65,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x54,0x68, - 0x65,0x20,0x77,0x68,0x6f,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x20,0x73,0x74,0x61,0x74,0x65,0x20,0x69,0x73,0x20,0x6b,0x65,0x70,0x74,0x20,0x69, - 0x6e,0x20,0x61,0x20,0x28,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x6c,0x79,0x29,0x20, - 0x75,0x6e,0x69,0x71,0x75,0x65,0x20,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x20,0x69,0x6e,0x20,0x6f,0x72,0x64,0x65,0x72,0x20,0x74,0x6f, - 0x20,0x65,0x61,0x73,0x65,0x20,0x65,0x76,0x65,0x6e,0x74,0x75,0x61,0x6c,0x20,0x61, - 0x64,0x61,0x70,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x74,0x6f,0x20,0x61,0x20,0x6d, - 0x75,0x6c,0x74,0x69,0x2d,0x74,0x68,0x72,0x65,0x61,0x64,0x65,0x64,0x0a,0x2d,0x2d, - 0x20,0x20,0x20,0x20,0x20,0x6d,0x6f,0x64,0x65,0x6c,0x2c,0x20,0x61,0x73,0x20,0x44, - 0x42,0x47,0x70,0x20,0x6e,0x65,0x65,0x64,0x73,0x20,0x6f,0x6e,0x65,0x20,0x63,0x6f, - 0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x70,0x65,0x72,0x20,0x74,0x68,0x72, - 0x65,0x61,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x46,0x75,0x6c,0x6c, - 0x20,0x6e,0x61,0x6d,0x65,0x73,0x20,0x6f,0x66,0x20,0x70,0x72,0x6f,0x70,0x65,0x72, - 0x74,0x69,0x65,0x73,0x20,0x61,0x72,0x65,0x20,0x62,0x61,0x73,0x65,0x36,0x34,0x20, - 0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x20,0x62,0x65,0x63,0x61,0x75,0x73,0x65,0x20, - 0x74,0x68,0x65,0x79,0x20,0x63,0x61,0x6e,0x20,0x63,0x6f,0x6e,0x74,0x61,0x69,0x6e, - 0x20,0x61,0x72,0x62,0x69,0x74,0x72,0x61,0x72,0x79,0x20,0x64,0x61,0x74,0x61,0x20, - 0x28,0x73,0x70,0x61,0x63,0x65,0x73,0x2c,0x20,0x65,0x73,0x63,0x61,0x70,0x65,0x20, - 0x63,0x68,0x61,0x72,0x61,0x63,0x74,0x65,0x72,0x73,0x2c,0x20,0x2e,0x2e,0x2e,0x29, - 0x2c,0x20,0x74,0x68,0x69,0x73,0x20,0x6d,0x61,0x6b,0x65,0x73,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x20,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x70,0x61,0x72,0x73, - 0x69,0x6e,0x67,0x20,0x6d,0x75,0x6e,0x63,0x68,0x20,0x65,0x61,0x73,0x69,0x65,0x72, - 0x20,0x61,0x6e,0x64,0x20,0x66,0x61,0x73,0x74,0x65,0x72,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x2a,0x20,0x54,0x68,0x69,0x73,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x20,0x73,0x75,0x70,0x70,0x6f,0x72,0x74,0x73,0x20,0x61,0x73,0x79,0x6e,0x63,0x68, - 0x72,0x6f,0x6e,0x6f,0x75,0x73,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x3a, - 0x20,0x61,0x6e,0x79,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x63,0x61,0x6e, - 0x20,0x62,0x65,0x20,0x64,0x6f,0x6e,0x65,0x20,0x61,0x74,0x20,0x61,0x6e,0x79,0x20, - 0x74,0x69,0x6d,0x65,0x2c,0x20,0x62,0x75,0x74,0x20,0x73,0x6f,0x6d,0x65,0x20,0x6f, - 0x66,0x20,0x74,0x68,0x65,0x6d,0x20,0x28,0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x61, - 0x74,0x69,0x6f,0x6e,0x73,0x29,0x20,0x63,0x61,0x6e,0x20,0x6c,0x65,0x61,0x64,0x20, - 0x74,0x6f,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x63,0x6f,0x6e,0x73, - 0x69,0x73,0x74,0x65,0x6e,0x74,0x20,0x73,0x74,0x61,0x74,0x65,0x73,0x2e,0x20,0x49, - 0x6e,0x20,0x61,0x64,0x64,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x69,0x73, - 0x20,0x68,0x61,0x76,0x65,0x20,0x61,0x20,0x71,0x75,0x69,0x74,0x65,0x20,0x62,0x69, - 0x67,0x20,0x6f,0x76,0x65,0x72,0x68,0x65,0x61,0x64,0x20,0x28,0x7e,0x36,0x36,0x25, - 0x29,0x2c,0x20,0x69,0x66,0x20,0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63, - 0x65,0x20,0x69,0x73,0x20,0x61,0x6e,0x20,0x69,0x73,0x73,0x75,0x65,0x2c,0x20,0x61, - 0x20,0x63,0x75,0x73,0x74,0x6f,0x6d,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20, - 0x74,0x6f,0x20,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x20,0x20,0x61,0x73,0x79,0x6e,0x63,0x20,0x6d,0x6f,0x64,0x65,0x20,0x63,0x6f,0x75, - 0x6c,0x64,0x20,0x62,0x65,0x20,0x64,0x6f,0x6e,0x65,0x2e,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x2a,0x20,0x41,0x6c,0x6c,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20, - 0x61,0x72,0x65,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65,0x64,0x20, - 0x69,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x73,0x2c,0x20,0x73,0x65,0x65,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f,0x6d,0x6d, - 0x65,0x6e,0x74,0x73,0x20,0x6f,0x6e,0x20,0x74,0x68,0x69,0x73,0x20,0x74,0x61,0x62, - 0x6c,0x65,0x20,0x74,0x6f,0x20,0x61,0x64,0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c, - 0x20,0x64,0x65,0x74,0x61,0x69,0x6c,0x73,0x20,0x61,0x62,0x6f,0x75,0x74,0x20,0x63, - 0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e, - 0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x54,0x68, - 0x65,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x73,0x20,0x69, - 0x6e,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x72,0x65,0x20,0x65,0x76,0x61,0x6c, - 0x75,0x61,0x74,0x65,0x64,0x20,0x75,0x73,0x65,0x72,0x20,0x63,0x6f,0x64,0x65,0x20, - 0x28,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x2a,0x20,0x61,0x6e,0x64,0x20, - 0x65,0x76,0x61,0x6c,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x2c,0x20,0x63, - 0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x62,0x72,0x65,0x61,0x6b, - 0x70,0x6f,0x69,0x6e,0x74,0x73,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x20,0x69,0x73,0x20, - 0x61,0x20,0x72,0x65,0x61,0x64,0x2f,0x77,0x72,0x69,0x74,0x65,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x20,0x20,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x20,0x6f,0x66,0x20,0x74, - 0x68,0x65,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e, - 0x6d,0x65,0x6e,0x74,0x20,0x6f,0x66,0x20,0x61,0x20,0x67,0x69,0x76,0x65,0x6e,0x20, - 0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x28,0x63,0x61,0x6e, - 0x20,0x62,0x65,0x20,0x61,0x63,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x77,0x69,0x74, - 0x68,0x20,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x20,0x6e,0x61,0x6d,0x65,0x73, - 0x29,0x2e,0x20,0x53,0x65,0x65,0x20,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x66, - 0x6f,0x72,0x20,0x61,0x64,0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x64,0x65, - 0x74,0x61,0x69,0x6c,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x43,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x74,0x69,0x61,0x74, - 0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x70,0x6f,0x6f,0x6c,0x65,0x64,0x20,0x69,0x6e, - 0x73,0x69,0x64,0x65,0x20,0x61,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x69,0x6e,0x67, - 0x20,0x6c,0x6f,0x6f,0x70,0x20,0x77,0x69,0x74,0x68,0x20,0x43,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x4d,0x61,0x6e,0x61,0x67,0x65,0x72,0x20,0x28,0x65,0x61,0x63,0x68,0x20, - 0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x69,0x73,0x20,0x69, - 0x6e,0x73,0x74,0x61,0x6e,0x74,0x69,0x61,0x74,0x65,0x64,0x20,0x6f,0x6e,0x6c,0x79, - 0x20,0x6f,0x6e,0x63,0x65,0x29,0x2e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x4f, - 0x75,0x74,0x70,0x75,0x74,0x20,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x69,0x73,0x20,0x64,0x6f,0x6e,0x65,0x20,0x62,0x79,0x20,0x72,0x65,0x64, - 0x65,0x66,0x69,0x6e,0x69,0x6e,0x67,0x20,0x70,0x72,0x69,0x6e,0x74,0x20,0x61,0x6e, - 0x64,0x20,0x73,0x6f,0x6d,0x65,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x20,0x69,0x6e, - 0x73,0x69,0x64,0x65,0x20,0x74,0x68,0x65,0x20,0x69,0x6f,0x20,0x74,0x61,0x62,0x6c, - 0x65,0x2e,0x20,0x53,0x65,0x65,0x20,0x22,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x72, - 0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x68,0x61,0x6e,0x64,0x6c, - 0x69,0x6e,0x67,0x22,0x20,0x66,0x6f,0x72,0x20,0x64,0x65,0x74,0x61,0x69,0x6c,0x73, - 0x2e,0x0a,0x2d,0x2d,0x20,0x54,0x6f,0x64,0x6f,0x20,0x6c,0x69,0x73,0x74,0x3a,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x4f,0x76,0x65,0x72,0x72,0x69,0x64,0x65,0x20, - 0x49,0x2f,0x4f,0x20,0x69,0x6e,0x20,0x69,0x6e,0x69,0x74,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x69,0x6e,0x73,0x74,0x65,0x61,0x64,0x20,0x6f,0x66,0x20, - 0x6f,0x6e,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x6c,0x6f,0x61,0x64,0x69,0x6e, - 0x67,0x2e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x41,0x6c,0x6c,0x6f,0x77,0x20, - 0x74,0x6f,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d, - 0x61,0x74,0x69,0x63,0x61,0x6c,0x6c,0x79,0x20,0x28,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x62,0x72,0x65,0x61,0x6b,0x28,0x29,0x29,0x2e,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x2a,0x20,0x42,0x72,0x65,0x61,0x6b,0x2d,0x6f,0x6e,0x2d,0x65,0x72,0x72, - 0x6f,0x72,0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x20,0x28,0x62,0x72,0x65,0x61, - 0x6b,0x20,0x69,0x66,0x20,0x61,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x69,0x73, - 0x20,0x74,0x68,0x72,0x6f,0x77,0x6e,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x72, - 0x65,0x20,0x69,0x73,0x20,0x6e,0x6f,0x20,0x70,0x63,0x61,0x6c,0x6c,0x20,0x69,0x6e, - 0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x74,0x6f,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65, - 0x20,0x69,0x74,0x29,0x2e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x55,0x73,0x65, - 0x20,0x6e,0x65,0x77,0x20,0x35,0x2e,0x32,0x20,0x66,0x61,0x63,0x69,0x6c,0x69,0x74, - 0x69,0x65,0x73,0x20,0x74,0x6f,0x20,0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x20,0x69, - 0x6e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x69,0x6f,0x6e,0x73,0x20,0x61,0x62,0x6f,0x75, - 0x74,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x61,0x72,0x67,0x75, - 0x6d,0x65,0x6e,0x74,0x73,0x20,0x6e,0x61,0x6d,0x65,0x73,0x2c,0x20,0x76,0x61,0x72, - 0x61,0x72,0x67,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a, - 0x20,0x41,0x6c,0x6c,0x6f,0x77,0x20,0x74,0x6f,0x20,0x73,0x65,0x65,0x20,0x2e,0x2e, - 0x2e,0x20,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x20,0x66,0x6f,0x72,0x20,0x76,0x61, - 0x72,0x61,0x72,0x67,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x28, - 0x35,0x2e,0x32,0x20,0x6f,0x6e,0x6c,0x79,0x29,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x2a, - 0x20,0x49,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x4c,0x75,0x61,0x4a,0x49,0x54,0x20, - 0x43,0x20,0x64,0x61,0x74,0x61,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x6c, - 0x75,0x61,0x2d,0x75,0x73,0x65,0x72,0x73,0x2e,0x6f,0x72,0x67,0x2f,0x6c,0x69,0x73, - 0x74,0x73,0x2f,0x6c,0x75,0x61,0x2d,0x6c,0x2f,0x32,0x30,0x31,0x31,0x2d,0x30,0x32, - 0x2f,0x6d,0x73,0x67,0x30,0x31,0x30,0x31,0x32,0x2e,0x68,0x74,0x6d,0x6c,0x29,0x2d, - 0x2d,0x20,0x2f,0x21,0x5c,0x20,0x54,0x68,0x69,0x73,0x20,0x66,0x69,0x6c,0x65,0x20, - 0x69,0x73,0x20,0x61,0x75,0x74,0x6f,0x2d,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65, - 0x64,0x2e,0x20,0x44,0x6f,0x20,0x6e,0x6f,0x74,0x20,0x61,0x6c,0x74,0x65,0x72,0x20, - 0x6d,0x61,0x6e,0x75,0x61,0x6c,0x6c,0x79,0x20,0x2f,0x21,0x5c,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d, - 0x2d,0x20,0x20,0x53,0x75,0x62,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x73,0x20,0x62,0x6f, - 0x64,0x79,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f, - 0x72,0x74,0x2e,0x61,0x70,0x72,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70, - 0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x61,0x70,0x72,0x22,0x5d, - 0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63, - 0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32,0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72, - 0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20, - 0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72, - 0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20, - 0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64, - 0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e, - 0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61, - 0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c, - 0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d, - 0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65, - 0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20, - 0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63, - 0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64, - 0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64, - 0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74, - 0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65, - 0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c, - 0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30,0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74,0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73, - 0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20, - 0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69, - 0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61,0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65, - 0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x41,0x70,0x61, - 0x63,0x68,0x65,0x20,0x50,0x6f,0x72,0x74,0x61,0x62,0x6c,0x65,0x20,0x52,0x75,0x6e, - 0x74,0x69,0x6d,0x65,0x20,0x62,0x61,0x63,0x6b,0x65,0x6e,0x64,0x20,0x66,0x6f,0x72, - 0x20,0x44,0x42,0x47,0x50,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x0a, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x70,0x72,0x20,0x3d,0x20,0x72,0x65,0x71, - 0x75,0x69,0x72,0x65,0x20,0x22,0x61,0x70,0x72,0x22,0x0a,0x0a,0x2d,0x2d,0x20,0x62, - 0x61,0x73,0x65,0x20,0x36,0x34,0x20,0x77,0x72,0x61,0x70,0x70,0x69,0x6e,0x67,0x0a, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x62,0x36,0x34,0x5f,0x77,0x72,0x61, - 0x70,0x28,0x73,0x72,0x63,0x29,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74, - 0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x36, - 0x34,0x5f,0x73,0x72,0x63,0x20,0x3d,0x20,0x6d,0x69,0x6d,0x65,0x2e,0x62,0x36,0x34, - 0x28,0x73,0x72,0x63,0x29,0x0a,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x31,0x2c, - 0x20,0x23,0x62,0x36,0x34,0x5f,0x73,0x72,0x63,0x2c,0x20,0x37,0x36,0x20,0x64,0x6f, - 0x20,0x74,0x5b,0x23,0x74,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x62,0x36,0x34,0x5f,0x73, - 0x72,0x63,0x3a,0x73,0x75,0x62,0x28,0x69,0x2c,0x20,0x69,0x2b,0x37,0x35,0x29,0x2e, - 0x2e,0x22,0x5c,0x72,0x5c,0x6e,0x22,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61, - 0x74,0x28,0x74,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x69,0x6d,0x70, - 0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x20,0x61,0x20,0x73,0x75,0x62,0x73,0x65,0x74, - 0x20,0x6f,0x66,0x20,0x4c,0x75,0x61,0x53,0x6f,0x63,0x6b,0x65,0x74,0x20,0x41,0x50, - 0x49,0x20,0x75,0x73,0x69,0x6e,0x67,0x20,0x41,0x50,0x52,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x53,0x4f,0x43,0x4b,0x45,0x54,0x5f,0x4d,0x54,0x20,0x3d,0x20,0x7b,0x0a, - 0x20,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x64,0x64,0x72,0x65, - 0x73,0x73,0x2c,0x20,0x70,0x6f,0x72,0x74,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a,0x63,0x6f,0x6e,0x6e,0x65,0x63, - 0x74,0x28,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x2c,0x20,0x70,0x6f,0x72,0x74,0x29, - 0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x20, - 0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c, - 0x20,0x6e,0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a, - 0x72,0x65,0x61,0x64,0x28,0x6e,0x29,0x20,0x65,0x6e,0x64,0x2c,0x20,0x2d,0x2d,0x20, - 0x6f,0x6e,0x6c,0x79,0x20,0x6e,0x75,0x6d,0x65,0x72,0x69,0x63,0x20,0x72,0x65,0x61, - 0x64,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x0a,0x20,0x20,0x73,0x65,0x6e,0x64, - 0x20,0x20,0x20,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73, - 0x65,0x6c,0x66,0x2c,0x20,0x64,0x61,0x74,0x61,0x29,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c,0x66,0x2e, - 0x73,0x6b,0x74,0x3a,0x77,0x72,0x69,0x74,0x65,0x28,0x64,0x61,0x74,0x61,0x29,0x20, - 0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x20,0x20,0x3d, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x29,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a,0x63, - 0x6c,0x6f,0x73,0x65,0x28,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x73,0x65, - 0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x73,0x65,0x63,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x20,0x20,0x20,0x20,0x73,0x65,0x63,0x20,0x3d,0x3d, - 0x20,0x6e,0x69,0x6c,0x20,0x74,0x68,0x65,0x6e,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73, - 0x6b,0x74,0x3a,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x5f,0x73,0x65,0x74,0x28,0x74, - 0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20, - 0x73,0x65,0x63,0x20,0x3d,0x3d,0x20,0x30,0x20,0x20,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74, - 0x5f,0x73,0x65,0x74,0x28,0x66,0x61,0x6c,0x73,0x65,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a, - 0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x5f,0x73,0x65,0x74,0x28,0x6d,0x61,0x74,0x68, - 0x2e,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x73,0x65,0x63,0x20,0x2a,0x20,0x31,0x30,0x30, - 0x30,0x30,0x30,0x30,0x29,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x7d,0x0a,0x53,0x4f,0x43,0x4b,0x45,0x54,0x5f,0x4d,0x54,0x2e,0x5f,0x5f,0x69, - 0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x53,0x4f,0x43,0x4b,0x45,0x54,0x5f,0x4d,0x54, - 0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x63, - 0x72,0x65,0x61,0x74,0x65,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73, - 0x6b,0x74,0x2c,0x20,0x65,0x72,0x72,0x20,0x3d,0x20,0x61,0x70,0x72,0x2e,0x73,0x6f, - 0x63,0x6b,0x65,0x74,0x5f,0x63,0x72,0x65,0x61,0x74,0x65,0x28,0x27,0x74,0x63,0x70, - 0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x73,0x6b,0x74,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x6e,0x69,0x6c,0x2c,0x20,0x65,0x72,0x72,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x74,0x6d,0x65,0x74, - 0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x73,0x6b,0x74,0x20,0x3d,0x20,0x73,0x6b, - 0x74,0x7d,0x2c,0x20,0x53,0x4f,0x43,0x4b,0x45,0x54,0x5f,0x4d,0x54,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x73,0x6c,0x65,0x65, - 0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20,0x61,0x70,0x72,0x2e,0x73,0x6c,0x65, - 0x65,0x70,0x2c,0x20,0x2d,0x2d,0x20,0x65,0x78,0x61,0x63,0x74,0x20,0x73,0x61,0x6d, - 0x65,0x20,0x41,0x50,0x49,0x20,0x61,0x73,0x20,0x4c,0x75,0x61,0x53,0x6f,0x63,0x6b, - 0x65,0x74,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x42,0x61,0x73,0x65,0x36, - 0x34,0x20,0x72,0x65,0x6c,0x61,0x74,0x65,0x64,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f, - 0x64,0x65,0x73,0x20,0x61,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74, - 0x6f,0x20,0x42,0x61,0x73,0x65,0x36,0x34,0x20,0x77,0x69,0x74,0x68,0x20,0x6c,0x69, - 0x6e,0x65,0x20,0x77,0x72,0x61,0x70,0x70,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x64,0x61,0x74,0x61,0x20,0x28, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x64,0x61,0x74,0x61,0x20,0x74,0x6f,0x20, - 0x65,0x6e,0x63,0x6f,0x64,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61,0x73,0x65,0x36,0x34,0x20,0x65,0x6e,0x63, - 0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20, - 0x62,0x36,0x34,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x64, - 0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x20,0x3d, - 0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x62,0x36,0x34,0x5f,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x61,0x70,0x72, - 0x2e,0x62,0x61,0x73,0x65,0x36,0x34,0x5f,0x65,0x6e,0x63,0x6f,0x64,0x65,0x28,0x64, - 0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72, - 0x20,0x69,0x3d,0x31,0x2c,0x20,0x23,0x62,0x36,0x34,0x5f,0x64,0x61,0x74,0x61,0x2c, - 0x20,0x37,0x36,0x20,0x64,0x6f,0x20,0x74,0x5b,0x23,0x74,0x2b,0x31,0x5d,0x20,0x3d, - 0x20,0x62,0x36,0x34,0x5f,0x64,0x61,0x74,0x61,0x3a,0x73,0x75,0x62,0x28,0x69,0x2c, - 0x20,0x69,0x2b,0x37,0x35,0x29,0x2e,0x2e,0x22,0x5c,0x72,0x5c,0x6e,0x22,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28,0x74, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f,0x64,0x65,0x73,0x20,0x61,0x20,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74,0x6f,0x20,0x42,0x61,0x73,0x65,0x36,0x34, - 0x2c,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x61,0x6e,0x79,0x20,0x65,0x78, - 0x74,0x72,0x61,0x20,0x70,0x61,0x72,0x73,0x69,0x6e,0x67,0x20,0x28,0x77,0x72,0x61, - 0x70,0x70,0x69,0x6e,0x67,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x64,0x61,0x74,0x61,0x20,0x28, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x64,0x61,0x74,0x61,0x20,0x74,0x6f,0x20, - 0x65,0x6e,0x63,0x6f,0x64,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x64,0x20,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x72,0x61,0x77,0x62,0x36,0x34,0x20, - 0x3d,0x20,0x61,0x70,0x72,0x2e,0x62,0x61,0x73,0x65,0x36,0x34,0x5f,0x65,0x6e,0x63, - 0x6f,0x64,0x65,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x44,0x65, - 0x63,0x6f,0x64,0x65,0x73,0x20,0x62,0x61,0x73,0x65,0x36,0x34,0x20,0x64,0x61,0x74, - 0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20, - 0x64,0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x62,0x61, - 0x73,0x65,0x36,0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x20,0x64,0x61,0x74, - 0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x0a, - 0x20,0x20,0x20,0x20,0x75,0x6e,0x62,0x36,0x34,0x20,0x3d,0x20,0x61,0x70,0x72,0x2e, - 0x62,0x61,0x73,0x65,0x36,0x34,0x5f,0x64,0x65,0x63,0x6f,0x64,0x65,0x2c,0x0a,0x7d, - 0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f,0x66, - 0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e, - 0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x61,0x70,0x72,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75, - 0x67,0x67,0x65,0x72,0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c, - 0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65, - 0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c,0x75,0x61, - 0x73,0x6f,0x63,0x6b,0x65,0x74,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79, - 0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32, - 0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c, - 0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a, - 0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65, - 0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f, - 0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63, - 0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20, - 0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20, - 0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65, - 0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20, - 0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20, - 0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65, - 0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74, - 0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69, - 0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70, - 0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f, - 0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30, - 0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74, - 0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20, - 0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73, - 0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61, - 0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f, - 0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x4c,0x75,0x61,0x53,0x6f,0x63,0x6b,0x65,0x74,0x20,0x62, - 0x61,0x63,0x6b,0x65,0x6e,0x64,0x20,0x66,0x6f,0x72,0x20,0x44,0x42,0x47,0x50,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x20,0x69,0x6e, - 0x20,0x6f,0x72,0x64,0x65,0x72,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x61,0x73,0x20, - 0x6c,0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x61,0x73,0x20,0x70, - 0x6f,0x73,0x73,0x69,0x62,0x6c,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x4c,0x75,0x61, - 0x73,0x6f,0x63,0x6b,0x65,0x74,0x2c,0x20,0x63,0x6f,0x72,0x65,0x20,0x41,0x50,0x49, - 0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x64,0x69,0x72,0x65, - 0x63,0x74,0x6c,0x79,0x20,0x28,0x74,0x6f,0x20,0x6e,0x6f,0x20,0x61,0x64,0x64,0x20, - 0x79,0x65,0x74,0x20,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x6c,0x61,0x79,0x65, - 0x72,0x29,0x0a,0x0a,0x2d,0x2d,0x46,0x49,0x58,0x4d,0x45,0x3a,0x20,0x72,0x65,0x6d, - 0x6f,0x76,0x65,0x20,0x74,0x68,0x69,0x73,0x20,0x68,0x61,0x63,0x6b,0x20,0x61,0x73, - 0x20,0x73,0x6f,0x6f,0x6e,0x20,0x61,0x73,0x20,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b, - 0x65,0x74,0x20,0x6f,0x66,0x66,0x69,0x63,0x69,0x61,0x6c,0x6c,0x79,0x20,0x73,0x75, - 0x70,0x70,0x6f,0x72,0x74,0x20,0x35,0x2e,0x32,0x0a,0x69,0x66,0x20,0x5f,0x56,0x45, - 0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d,0x3d,0x20,0x22,0x4c,0x75,0x61,0x20,0x35,0x2e, - 0x32,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e, - 0x67,0x65,0x74,0x6e,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x74,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x20,0x61,0x6e,0x64,0x20, - 0x23,0x74,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69, - 0x72,0x65,0x20,0x22,0x73,0x6f,0x63,0x6b,0x65,0x74,0x22,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x6d,0x69,0x6d,0x65,0x20,0x20,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69, - 0x72,0x65,0x20,0x22,0x6d,0x69,0x6d,0x65,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x6c,0x74,0x6e,0x31,0x32,0x20,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65, - 0x20,0x22,0x6c,0x74,0x6e,0x31,0x32,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72, - 0x65,0x67,0x20,0x3d,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x72,0x65, - 0x67,0x69,0x73,0x74,0x72,0x79,0x28,0x29,0x0a,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x63,0x72,0x65,0x61,0x74,0x65,0x20,0x3d, - 0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x74,0x63,0x70,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x73,0x6c,0x65,0x65,0x70,0x20,0x20,0x3d,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74, - 0x2e,0x73,0x6c,0x65,0x65,0x70,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x42,0x61,0x73,0x65,0x36,0x34,0x20,0x72,0x65,0x6c,0x61,0x74,0x65,0x64,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d, - 0x20,0x45,0x6e,0x63,0x6f,0x64,0x65,0x73,0x20,0x61,0x20,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x20,0x69,0x6e,0x74,0x6f,0x20,0x42,0x61,0x73,0x65,0x36,0x34,0x20,0x77,0x69, - 0x74,0x68,0x20,0x6c,0x69,0x6e,0x65,0x20,0x77,0x72,0x61,0x70,0x70,0x69,0x6e,0x67, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x64, - 0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x64,0x61,0x74, - 0x61,0x20,0x74,0x6f,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61,0x73,0x65,0x36, - 0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72,0x69,0x6e,0x67, - 0x0a,0x20,0x20,0x20,0x20,0x62,0x36,0x34,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x20,0x3d, - 0x20,0x6c,0x74,0x6e,0x31,0x32,0x2e,0x66,0x69,0x6c,0x74,0x65,0x72,0x2e,0x63,0x68, - 0x61,0x69,0x6e,0x28,0x6d,0x69,0x6d,0x65,0x2e,0x65,0x6e,0x63,0x6f,0x64,0x65,0x28, - 0x22,0x62,0x61,0x73,0x65,0x36,0x34,0x22,0x29,0x2c,0x20,0x6d,0x69,0x6d,0x65,0x2e, - 0x77,0x72,0x61,0x70,0x28,0x22,0x62,0x61,0x73,0x65,0x36,0x34,0x22,0x29,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x69, - 0x6e,0x6b,0x2c,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x3d,0x20,0x6c,0x74,0x6e, - 0x31,0x32,0x2e,0x73,0x69,0x6e,0x6b,0x2e,0x74,0x61,0x62,0x6c,0x65,0x28,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x74,0x6e,0x31,0x32,0x2e,0x70,0x75, - 0x6d,0x70,0x2e,0x61,0x6c,0x6c,0x28,0x6c,0x74,0x6e,0x31,0x32,0x2e,0x73,0x6f,0x75, - 0x72,0x63,0x65,0x2e,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x64,0x61,0x74,0x61,0x29, - 0x2c,0x20,0x6c,0x74,0x6e,0x31,0x32,0x2e,0x73,0x69,0x6e,0x6b,0x2e,0x63,0x68,0x61, - 0x69,0x6e,0x28,0x66,0x69,0x6c,0x74,0x65,0x72,0x2c,0x20,0x73,0x69,0x6e,0x6b,0x29, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28,0x6f,0x75, - 0x74,0x70,0x75,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f,0x64,0x65,0x73,0x20, - 0x61,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74,0x6f,0x20,0x42,0x61, - 0x73,0x65,0x36,0x34,0x2c,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x61,0x6e, - 0x79,0x20,0x65,0x78,0x74,0x72,0x61,0x20,0x70,0x61,0x72,0x73,0x69,0x6e,0x67,0x20, - 0x28,0x77,0x72,0x61,0x70,0x70,0x69,0x6e,0x67,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x64,0x61, - 0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x64,0x61,0x74,0x61, - 0x20,0x74,0x6f,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x65,0x63,0x6f,0x64,0x65, - 0x64,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x72,0x61,0x77, - 0x62,0x36,0x34,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x64, - 0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x28,0x6d,0x69,0x6d,0x65,0x2e,0x62,0x36,0x34,0x28,0x64,0x61, - 0x74,0x61,0x29,0x29,0x20,0x2d,0x2d,0x20,0x66,0x69,0x72,0x73,0x74,0x20,0x72,0x65, - 0x73,0x75,0x6c,0x74,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x6c,0x6f,0x77,0x2d, - 0x6c,0x65,0x76,0x65,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x69, - 0x73,0x20,0x66,0x69,0x6e,0x65,0x20,0x68,0x65,0x72,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x44,0x65, - 0x63,0x6f,0x64,0x65,0x73,0x20,0x62,0x61,0x73,0x65,0x36,0x34,0x20,0x64,0x61,0x74, - 0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20, - 0x64,0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x62,0x61, - 0x73,0x65,0x36,0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x20,0x64,0x61,0x74, - 0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x0a, - 0x20,0x20,0x20,0x20,0x75,0x6e,0x62,0x36,0x34,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d,0x69,0x6d,0x65,0x2e, - 0x75,0x6e,0x62,0x36,0x34,0x28,0x64,0x61,0x74,0x61,0x29,0x29,0x20,0x2d,0x2d,0x20, - 0x66,0x69,0x72,0x73,0x74,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x6f,0x66,0x20, - 0x74,0x68,0x65,0x20,0x6c,0x6f,0x77,0x2d,0x6c,0x65,0x76,0x65,0x6c,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x66,0x69,0x6e,0x65,0x20,0x68, - 0x65,0x72,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d,0x0a,0x0a, - 0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f,0x66,0x20,0x6d, - 0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x74,0x72, - 0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65, - 0x74,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f, - 0x72,0x74,0x2e,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74,0x5f,0x73,0x63,0x68, - 0x65,0x64,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70,0x72,0x65,0x6c,0x6f, - 0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x74,0x72,0x61, - 0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74, - 0x5f,0x73,0x63,0x68,0x65,0x64,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79, - 0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32, - 0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c, - 0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a, - 0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65, - 0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f, - 0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63, - 0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20, - 0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20, - 0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65, - 0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20, - 0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20, - 0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65, - 0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74, - 0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69, - 0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70, - 0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f, - 0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30, - 0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74, - 0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20, - 0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73, - 0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61, - 0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f, - 0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x4c,0x75,0x61,0x53,0x6f,0x63,0x6b,0x65,0x74,0x20,0x77, - 0x69,0x74,0x68,0x20,0x4c,0x75,0x61,0x53,0x63,0x68,0x65,0x64,0x20,0x62,0x61,0x63, - 0x6b,0x65,0x6e,0x64,0x20,0x66,0x6f,0x72,0x20,0x44,0x42,0x47,0x50,0x20,0x64,0x65, - 0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x20,0x41,0x73,0x20,0x4c, - 0x75,0x61,0x53,0x68,0x65,0x64,0x20,0x74,0x6f,0x74,0x61,0x6c,0x6c,0x79,0x20,0x68, - 0x69,0x64,0x65,0x73,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x2c,0x20,0x74,0x68,0x69,0x73,0x20,0x6d,0x6f, - 0x64,0x75,0x6c,0x65,0x20,0x4d,0x55,0x53,0x54,0x20,0x62,0x65,0x20,0x6c,0x6f,0x61, - 0x64,0x65,0x64,0x20,0x6f,0x6e,0x20,0x74,0x68,0x65,0x20,0x76,0x65,0x72,0x79,0x20, - 0x73,0x74,0x61,0x72,0x74,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x6f, - 0x67,0x72,0x61,0x6d,0x0a,0x2d,0x2d,0x20,0x28,0x62,0x65,0x66,0x6f,0x72,0x65,0x20, - 0x6c,0x6f,0x61,0x64,0x69,0x6e,0x67,0x20,0x73,0x63,0x68,0x65,0x64,0x29,0x20,0x74, - 0x6f,0x20,0x63,0x61,0x74,0x63,0x68,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63, - 0x65,0x73,0x20,0x74,0x6f,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x2e,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x63,0x6f,0x72,0x65,0x20,0x3d,0x20,0x72,0x65, - 0x71,0x75,0x69,0x72,0x65,0x22,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x63,0x6f,0x72, - 0x65,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x20, - 0x20,0x20,0x20,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64, - 0x65,0x62,0x75,0x67,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x67,0x20, - 0x3d,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x72,0x65,0x67,0x69,0x73, - 0x74,0x72,0x79,0x28,0x29,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f, - 0x63,0x6b,0x69,0x6e,0x67,0x63,0x72,0x65,0x61,0x74,0x65,0x20,0x20,0x3d,0x20,0x73, - 0x6f,0x63,0x6b,0x65,0x74,0x63,0x6f,0x72,0x65,0x2e,0x74,0x63,0x70,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x73,0x6c,0x65,0x65, - 0x70,0x20,0x20,0x20,0x3d,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x63,0x6f,0x72,0x65, - 0x2e,0x73,0x6c,0x65,0x65,0x70,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c, - 0x6f,0x63,0x6b,0x69,0x6e,0x67,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x20,0x20,0x20, - 0x20,0x3d,0x20,0x72,0x65,0x67,0x5b,0x22,0x74,0x63,0x70,0x7b,0x6d,0x61,0x73,0x74, - 0x65,0x72,0x7d,0x22,0x5d,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x63,0x6f, - 0x6e,0x6e,0x65,0x63,0x74,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f,0x63, - 0x6b,0x69,0x6e,0x67,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x20,0x20,0x20,0x20,0x3d, - 0x20,0x72,0x65,0x67,0x5b,0x22,0x74,0x63,0x70,0x7b,0x63,0x6c,0x69,0x65,0x6e,0x74, - 0x7d,0x22,0x5d,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x72,0x65,0x63,0x65, - 0x69,0x76,0x65,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69, - 0x6e,0x67,0x73,0x65,0x6e,0x64,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20,0x72, - 0x65,0x67,0x5b,0x22,0x74,0x63,0x70,0x7b,0x63,0x6c,0x69,0x65,0x6e,0x74,0x7d,0x22, - 0x5d,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x73,0x65,0x6e,0x64,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x73,0x65,0x74, - 0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x20,0x3d,0x20,0x72,0x65,0x67,0x5b,0x22,0x74, - 0x63,0x70,0x7b,0x6d,0x61,0x73,0x74,0x65,0x72,0x7d,0x22,0x5d,0x2e,0x5f,0x5f,0x69, - 0x6e,0x64,0x65,0x78,0x2e,0x73,0x65,0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x63,0x6c, - 0x6f,0x73,0x65,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20,0x72,0x65,0x67,0x5b,0x22, - 0x74,0x63,0x70,0x7b,0x6d,0x61,0x73,0x74,0x65,0x72,0x7d,0x22,0x5d,0x2e,0x5f,0x5f, - 0x69,0x6e,0x64,0x65,0x78,0x2e,0x63,0x6c,0x6f,0x73,0x65,0x0a,0x0a,0x2d,0x2d,0x20, - 0x77,0x65,0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x73,0x65,0x74,0x20,0x61,0x20, - 0x6e,0x65,0x77,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x20,0x64,0x69, - 0x72,0x65,0x63,0x74,0x6c,0x79,0x20,0x6f,0x6e,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74, - 0x20,0x6f,0x62,0x6a,0x65,0x63,0x74,0x2c,0x20,0x73,0x6f,0x20,0x77,0x72,0x61,0x70, - 0x20,0x69,0x74,0x20,0x69,0x6e,0x74,0x6f,0x20,0x61,0x20,0x6e,0x65,0x77,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x0a,0x2d,0x2d,0x20,0x61,0x6e,0x64,0x20,0x66,0x6f,0x72,0x77, - 0x61,0x72,0x64,0x20,0x61,0x6c,0x6c,0x20,0x63,0x61,0x6c,0x6c,0x73,0x2e,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x74,0x63,0x70, - 0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x20,0x20, - 0x20,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c, - 0x66,0x2c,0x20,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x2c,0x20,0x70,0x6f,0x72,0x74, - 0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e, - 0x67,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b, - 0x74,0x2c,0x20,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x2c,0x20,0x70,0x6f,0x72,0x74, - 0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x72,0x65,0x63,0x65,0x69,0x76,0x65, - 0x20,0x20,0x20,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73, - 0x65,0x6c,0x66,0x2c,0x20,0x6e,0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x6c,0x6f,0x63,0x6b, - 0x69,0x6e,0x67,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x28,0x73,0x65,0x6c,0x66,0x2e, - 0x73,0x6b,0x74,0x2c,0x20,0x6e,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x73, - 0x65,0x6e,0x64,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x64,0x61,0x74,0x61,0x29, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x73,0x65,0x6e,0x64,0x28,0x73,0x65, - 0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x64,0x61,0x74,0x61,0x29,0x20,0x65,0x6e, - 0x64,0x2c,0x0a,0x20,0x20,0x73,0x65,0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x20, - 0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c, - 0x20,0x73,0x65,0x63,0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x73, - 0x65,0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73, - 0x6b,0x74,0x2c,0x20,0x73,0x65,0x63,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20, - 0x63,0x6c,0x6f,0x73,0x65,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x29,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x63,0x6c,0x6f,0x73,0x65,0x28, - 0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d, - 0x0a,0x0a,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x74,0x63,0x70,0x2e,0x5f,0x5f, - 0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67, - 0x74,0x63,0x70,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x69,0x6d,0x65,0x20, - 0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x6d,0x69,0x6d,0x65, - 0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x74,0x6e,0x31,0x32,0x20,0x3d,0x20, - 0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x6c,0x74,0x6e,0x31,0x32,0x22,0x0a, - 0x0a,0x2d,0x2d,0x20,0x76,0x65,0x72,0x69,0x66,0x79,0x20,0x74,0x68,0x61,0x74,0x20, - 0x74,0x68,0x65,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x61,0x72,0x65,0x20,0x74,0x68,0x65,0x20,0x72,0x65,0x61,0x6c, - 0x20,0x6f,0x6e,0x65,0x73,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x73,0x63, - 0x68,0x65,0x64,0x20,0x6e,0x6f,0x74,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67, - 0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x73,0x0a,0x61,0x73,0x73,0x65,0x72,0x74, - 0x28,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x62, - 0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x63,0x72,0x65,0x61,0x74,0x65,0x2c,0x20,0x22, - 0x53,0x22,0x29,0x2e,0x77,0x68,0x61,0x74,0x20,0x3d,0x3d,0x20,0x22,0x43,0x22,0x2c, - 0x20,0x22,0x54,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6e, - 0x65,0x65,0x64,0x73,0x20,0x74,0x68,0x65,0x20,0x72,0x65,0x61,0x6c,0x20,0x73,0x6f, - 0x63,0x6b,0x65,0x74,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x21, - 0x22,0x29,0x0a,0x2d,0x2d,0x20,0x63,0x6c,0x65,0x61,0x6e,0x75,0x70,0x20,0x74,0x68, - 0x65,0x20,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x6c,0x6f,0x61,0x64,0x65,0x64, - 0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x28,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x63, - 0x6f,0x72,0x65,0x20,0x61,0x64,0x64,0x73,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x20, - 0x66,0x69,0x65,0x6c,0x64,0x20,0x69,0x6e,0x74,0x6f,0x20,0x69,0x74,0x29,0x0a,0x70, - 0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x6c,0x6f,0x61,0x64,0x65,0x64,0x2e,0x73,0x6f, - 0x63,0x6b,0x65,0x74,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x0a,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x63,0x72,0x65,0x61,0x74,0x65,0x20, - 0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65, - 0x28,0x7b,0x20,0x73,0x6b,0x74,0x20,0x3d,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69,0x6e, - 0x67,0x63,0x72,0x65,0x61,0x74,0x65,0x28,0x29,0x20,0x7d,0x2c,0x20,0x62,0x6c,0x6f, - 0x63,0x6b,0x69,0x6e,0x67,0x74,0x63,0x70,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x73,0x6c,0x65,0x65,0x70,0x20,0x20,0x3d,0x20,0x62,0x6c,0x6f,0x63, - 0x6b,0x69,0x6e,0x67,0x73,0x6c,0x65,0x65,0x70,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x42,0x61,0x73,0x65,0x36,0x34,0x20,0x72,0x65,0x6c,0x61,0x74,0x65, - 0x64,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f,0x64,0x65,0x73,0x20,0x61,0x20,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74,0x6f,0x20,0x42,0x61,0x73,0x65,0x36,0x34, - 0x20,0x77,0x69,0x74,0x68,0x20,0x6c,0x69,0x6e,0x65,0x20,0x77,0x72,0x61,0x70,0x70, - 0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61, - 0x6d,0x20,0x64,0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20, - 0x64,0x61,0x74,0x61,0x20,0x74,0x6f,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61, - 0x73,0x65,0x36,0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x62,0x36,0x34,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x6c,0x74,0x65, - 0x72,0x20,0x3d,0x20,0x6c,0x74,0x6e,0x31,0x32,0x2e,0x66,0x69,0x6c,0x74,0x65,0x72, - 0x2e,0x63,0x68,0x61,0x69,0x6e,0x28,0x6d,0x69,0x6d,0x65,0x2e,0x65,0x6e,0x63,0x6f, - 0x64,0x65,0x28,0x22,0x62,0x61,0x73,0x65,0x36,0x34,0x22,0x29,0x2c,0x20,0x6d,0x69, - 0x6d,0x65,0x2e,0x77,0x72,0x61,0x70,0x28,0x22,0x62,0x61,0x73,0x65,0x36,0x34,0x22, - 0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x73,0x69,0x6e,0x6b,0x2c,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x3d,0x20, - 0x6c,0x74,0x6e,0x31,0x32,0x2e,0x73,0x69,0x6e,0x6b,0x2e,0x74,0x61,0x62,0x6c,0x65, - 0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x74,0x6e,0x31,0x32, - 0x2e,0x70,0x75,0x6d,0x70,0x2e,0x61,0x6c,0x6c,0x28,0x6c,0x74,0x6e,0x31,0x32,0x2e, - 0x73,0x6f,0x75,0x72,0x63,0x65,0x2e,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x64,0x61, - 0x74,0x61,0x29,0x2c,0x20,0x6c,0x74,0x6e,0x31,0x32,0x2e,0x73,0x69,0x6e,0x6b,0x2e, - 0x63,0x68,0x61,0x69,0x6e,0x28,0x66,0x69,0x6c,0x74,0x65,0x72,0x2c,0x20,0x73,0x69, - 0x6e,0x6b,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74, - 0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f,0x64, - 0x65,0x73,0x20,0x61,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74,0x6f, - 0x20,0x42,0x61,0x73,0x65,0x36,0x34,0x2c,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74, - 0x20,0x61,0x6e,0x79,0x20,0x65,0x78,0x74,0x72,0x61,0x20,0x70,0x61,0x72,0x73,0x69, - 0x6e,0x67,0x20,0x28,0x77,0x72,0x61,0x70,0x70,0x69,0x6e,0x67,0x2c,0x20,0x2e,0x2e, - 0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d, - 0x20,0x64,0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x64, - 0x61,0x74,0x61,0x20,0x74,0x6f,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x65,0x63, - 0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x61,0x77,0x62,0x36,0x34,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x28,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d,0x69,0x6d,0x65,0x2e,0x62,0x36,0x34, - 0x28,0x64,0x61,0x74,0x61,0x29,0x29,0x20,0x2d,0x2d,0x20,0x66,0x69,0x72,0x73,0x74, - 0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x6c, - 0x6f,0x77,0x2d,0x6c,0x65,0x76,0x65,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x69,0x73,0x20,0x66,0x69,0x6e,0x65,0x20,0x68,0x65,0x72,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d, - 0x20,0x44,0x65,0x63,0x6f,0x64,0x65,0x73,0x20,0x62,0x61,0x73,0x65,0x36,0x34,0x20, - 0x64,0x61,0x74,0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x64,0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x29, - 0x20,0x62,0x61,0x73,0x65,0x36,0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x20, - 0x64,0x61,0x74,0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x64,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x75,0x6e,0x62,0x36,0x34,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d,0x69, - 0x6d,0x65,0x2e,0x75,0x6e,0x62,0x36,0x34,0x28,0x64,0x61,0x74,0x61,0x29,0x29,0x20, - 0x2d,0x2d,0x20,0x66,0x69,0x72,0x73,0x74,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20, - 0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x6c,0x6f,0x77,0x2d,0x6c,0x65,0x76,0x65,0x6c, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x66,0x69,0x6e, - 0x65,0x20,0x68,0x65,0x72,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a, - 0x7d,0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f, - 0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c,0x75,0x61,0x73,0x6f, - 0x63,0x6b,0x65,0x74,0x5f,0x73,0x63,0x68,0x65,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d, - 0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x2e,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x0a,0x70,0x61,0x63,0x6b,0x61, - 0x67,0x65,0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75, - 0x67,0x67,0x65,0x72,0x2e,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x22,0x5d,0x20, - 0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29, - 0x20,0x32,0x30,0x31,0x31,0x2d,0x32,0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72, - 0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f, - 0x74,0x68,0x65,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69, - 0x67,0x68,0x74,0x73,0x20,0x72,0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54, - 0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20, - 0x74,0x68,0x65,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67, - 0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72, - 0x65,0x20,0x6d,0x61,0x64,0x65,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65, - 0x20,0x75,0x6e,0x64,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73, - 0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20, - 0x50,0x75,0x62,0x6c,0x69,0x63,0x20,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76, - 0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63, - 0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69, - 0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20, - 0x69,0x73,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a, - 0x2d,0x2d,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63, - 0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f, - 0x65,0x70,0x6c,0x2d,0x76,0x31,0x30,0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74,0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a, - 0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57, - 0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61, - 0x6c,0x20,0x41,0x50,0x49,0x20,0x61,0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d, - 0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6d,0x6d, - 0x61,0x6e,0x64,0x73,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x72,0x73,0x20,0x66,0x6f, - 0x72,0x20,0x44,0x42,0x47,0x70,0x20,0x70,0x72,0x6f,0x74,0x6f,0x63,0x6f,0x6c,0x2e, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x44,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x63,0x6f,0x6d, - 0x6d,0x61,0x6e,0x64,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x2e,0x20, - 0x45,0x61,0x63,0x68,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x68,0x61, - 0x6e,0x64,0x6c,0x65,0x20,0x61,0x20,0x64,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x74, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x41,0x20,0x63, - 0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x69,0x73,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x33, - 0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x31,0x2e,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x73,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x0a,0x2d,0x2d, - 0x20,0x20,0x20,0x32,0x2e,0x20,0x74,0x68,0x65,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e, - 0x64,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x20,0x61,0x73,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x33,0x2e,0x20,0x74,0x68,0x65, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x64,0x61,0x74,0x61,0x2c,0x20,0x69, - 0x66,0x20,0x61,0x6e,0x79,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x65,0x20,0x72,0x65,0x73, - 0x75,0x6c,0x74,0x20,0x69,0x73,0x20,0x65,0x69,0x74,0x68,0x65,0x72,0x20,0x3a,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x74,0x72,0x75,0x65,0x20,0x28,0x6f,0x72,0x20, - 0x61,0x6e,0x79,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x65,0x76,0x61,0x6c,0x75,0x61, - 0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x74,0x72,0x75,0x65,0x29,0x20,0x3a,0x20,0x74, - 0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x77,0x69,0x6c,0x6c, - 0x20,0x72,0x65,0x73,0x75,0x6d,0x65,0x20,0x74,0x68,0x65,0x20,0x65,0x78,0x65,0x63, - 0x75,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x61,0x70,0x70, - 0x6c,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x28,0x63,0x6f,0x6e,0x74,0x69,0x6e, - 0x75,0x61,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x29,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x66,0x61,0x6c,0x73,0x65,0x20,0x3a,0x20,0x6f, - 0x6e,0x6c,0x79,0x20,0x69,0x6e,0x20,0x61,0x73,0x79,0x6e,0x63,0x20,0x6d,0x6f,0x64, - 0x65,0x2c,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20, - 0x57,0x49,0x4c,0x4c,0x20,0x77,0x61,0x69,0x74,0x20,0x66,0x6f,0x72,0x20,0x66,0x75, - 0x72,0x74,0x68,0x65,0x72,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20,0x69, - 0x6e,0x73,0x74,0x65,0x61,0x64,0x20,0x6f,0x66,0x20,0x63,0x6f,0x6e,0x74,0x69,0x6e, - 0x75,0x69,0x6e,0x67,0x20,0x28,0x74,0x79,0x70,0x69,0x63,0x61,0x6c,0x6c,0x79,0x2c, - 0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x29,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x2a,0x20,0x6e,0x69,0x6c,0x2f,0x6e,0x6f,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x3a,0x20,0x69,0x6e,0x20,0x73,0x79,0x6e,0x63,0x20,0x6d, - 0x6f,0x64,0x65,0x2c,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x20,0x77,0x69,0x6c,0x6c,0x20,0x77,0x61,0x69,0x74,0x20,0x66,0x6f,0x72,0x20, - 0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x2e, - 0x20,0x49,0x6e,0x20,0x61,0x73,0x79,0x6e,0x63,0x20,0x6d,0x6f,0x64,0x65,0x20,0x74, - 0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x77,0x69,0x6c,0x6c, - 0x20,0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,0x20,0x74,0x68,0x65,0x20,0x65,0x78, - 0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63, - 0x6f,0x77,0x72,0x61,0x70,0x2c,0x20,0x63,0x6f,0x79,0x69,0x65,0x6c,0x64,0x20,0x3d, - 0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x77,0x72,0x61,0x70,0x2c, - 0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x79,0x69,0x65,0x6c,0x64, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x3d,0x20,0x72, - 0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x22,0x0a,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x65,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64, - 0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x63,0x6f,0x72,0x65,0x22,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x64,0x62,0x67,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x64,0x62,0x67,0x70,0x22,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x75,0x74,0x69,0x6c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x2e,0x75,0x74,0x69,0x6c,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20, - 0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x2e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x22,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f, - 0x6e,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65, - 0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x63,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x6f,0x67,0x20,0x3d,0x20, - 0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x67,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x4d,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x20,0x2d,0x2d,0x20,0x63,0x6f,0x6d,0x6d,0x61, - 0x6e,0x64,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x72,0x73,0x20,0x74,0x61,0x62,0x6c, - 0x65,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x47,0x65,0x74,0x73,0x20,0x74,0x68,0x65,0x20, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x62,0x65,0x68,0x69,0x6e,0x64, - 0x20,0x61,0x6e,0x20,0x69,0x64,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x72,0x6f,0x77,0x73, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x73,0x20,0x6f,0x6e,0x20,0x75,0x6e,0x6b,0x6e,0x6f, - 0x77,0x6e,0x20,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x73,0x0a,0x2d, - 0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x20,0x63,0x6f,0x72,0x6f,0x5f,0x69, - 0x64,0x20,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x6f,0x72,0x20,0x6e,0x69, - 0x6c,0x29,0x20,0x43,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x64,0x65, - 0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x20,0x28, - 0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x43,0x6f, - 0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65, - 0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x20,0x28,0x69,0x66,0x20,0x63,0x6f,0x72,0x6f, - 0x5f,0x69,0x64,0x20,0x77,0x61,0x73,0x20,0x6e,0x69,0x6c,0x20,0x6f,0x72,0x20,0x69, - 0x66,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x73,0x20,0x74, - 0x68,0x65,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x63,0x6f,0x72,0x6f,0x75, - 0x74,0x69,0x6e,0x65,0x29,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x74,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x5f,0x69,0x64, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x6f,0x72,0x6f,0x5f,0x69,0x64, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x64,0x62,0x67,0x70,0x2e, - 0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x33,0x39,0x39,0x2c,0x20,0x63,0x6f,0x72,0x65, - 0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x5b,0x74,0x6f,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x28,0x63,0x6f,0x72,0x6f,0x5f,0x69,0x64,0x29,0x5d,0x2c,0x20,0x22, - 0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70, - 0x2e,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x33,0x39,0x39,0x2c,0x20,0x63,0x6f,0x72, - 0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x73,0x74,0x61,0x74,0x75,0x73,0x28,0x63,0x6f, - 0x72,0x6f,0x29,0x20,0x7e,0x3d,0x20,0x22,0x64,0x65,0x61,0x64,0x22,0x2c,0x20,0x22, - 0x43,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x73,0x20,0x64,0x65,0x61, - 0x64,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63, - 0x6f,0x72,0x6f,0x20,0x7e,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x63,0x6f,0x72,0x6f, - 0x5b,0x31,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x75,0x74,0x69,0x6c,0x2e,0x46,0x6f,0x72,0x65,0x69,0x67,0x6e,0x54,0x68,0x72,0x65, - 0x61,0x64,0x28,0x63,0x6f,0x72,0x6f,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x65,0x6c,0x66,0x2e,0x63,0x6f,0x72,0x6f,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x4d, - 0x5b,0x22,0x62,0x72,0x65,0x61,0x6b,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x74,0x65,0x20, - 0x3d,0x20,0x22,0x62,0x72,0x65,0x61,0x6b,0x22,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x73,0x65,0x6e,0x64,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20,0x74, - 0x6f,0x20,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x20,0x63,0x6f,0x6d,0x6d,0x61, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76, - 0x69,0x6f,0x75,0x73,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5f,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x28,0x73,0x65,0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x73,0x65,0x20,0x74,0x6f,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x63,0x6f, - 0x6d,0x6d,0x61,0x6e,0x64,0x20,0x69,0x74,0x73,0x65,0x6c,0x66,0x0a,0x20,0x20,0x20, - 0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73, - 0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d, - 0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74, - 0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20, - 0x22,0x62,0x72,0x65,0x61,0x6b,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63, - 0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69, - 0x2c,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x31,0x20,0x7d,0x20, - 0x7d,0x20,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66, - 0x61,0x6c,0x73,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x4d,0x2e,0x73,0x74,0x61,0x74,0x75,0x73,0x28,0x73,0x65,0x6c,0x66, - 0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70, - 0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73, - 0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x20,0x3d,0x20,0x22,0x73,0x74,0x61,0x74,0x75,0x73,0x22,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x61,0x73,0x6f,0x6e,0x20,0x3d,0x20,0x22,0x6f, - 0x6b,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x74, - 0x75,0x73,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x74,0x65,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63, - 0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69, - 0x20,0x7d,0x20,0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x73,0x74,0x6f,0x70,0x28,0x73,0x65,0x6c,0x66, - 0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70, - 0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73, - 0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x20,0x3d,0x20,0x22,0x73,0x74,0x6f,0x70,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x61,0x73,0x6f,0x6e,0x20,0x3d,0x20,0x22,0x6f,0x6b,0x22, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x74,0x75,0x73, - 0x20,0x3d,0x20,0x22,0x73,0x74,0x6f,0x70,0x70,0x65,0x64,0x22,0x2c,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f, - 0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x20,0x7d,0x20, - 0x7d,0x20,0x29,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74, - 0x3a,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x6f,0x73,0x2e, - 0x65,0x78,0x69,0x74,0x28,0x31,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x5f, - 0x67,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d, - 0x20,0x61,0x72,0x67,0x73,0x2e,0x6e,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20,0x3d,0x20,0x75,0x74,0x69, - 0x6c,0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x5b,0x6e,0x61,0x6d,0x65,0x5d, - 0x20,0x6f,0x72,0x20,0x28,0x6e,0x6f,0x74,0x20,0x6e,0x6f,0x74,0x20,0x4d,0x5b,0x6e, - 0x61,0x6d,0x65,0x5d,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73, - 0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74, - 0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f, - 0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x20,0x3d,0x20,0x22,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x5f,0x67,0x65,0x74,0x22, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x65,0x61,0x74, - 0x75,0x72,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x6e,0x61,0x6d,0x65,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x75,0x70,0x70,0x6f, - 0x72,0x74,0x65,0x64,0x20,0x3d,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20, - 0x61,0x6e,0x64,0x20,0x22,0x31,0x22,0x20,0x6f,0x72,0x20,0x22,0x30,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x61,0x6e,0x73,0x61, - 0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e, - 0x69,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x28,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x29,0x20, - 0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x5f,0x73,0x65,0x74,0x28, - 0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x6e,0x2c,0x20,0x61,0x72,0x67,0x73, - 0x2e,0x76,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x75,0x63, - 0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x70,0x63,0x61,0x6c,0x6c,0x28,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x20,0x75,0x74,0x69,0x6c,0x2e,0x66,0x65,0x61, - 0x74,0x75,0x72,0x65,0x73,0x5b,0x6e,0x61,0x6d,0x65,0x5d,0x20,0x3d,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67, - 0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e, - 0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65, - 0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e, - 0x64,0x20,0x3d,0x20,0x22,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x5f,0x73,0x65,0x74, - 0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x65,0x61,0x74,0x75, - 0x72,0x65,0x20,0x3d,0x20,0x6e,0x61,0x6d,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x73,0x75,0x63, - 0x63,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x31,0x20,0x6f,0x72,0x20,0x30,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63, - 0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69, - 0x0a,0x20,0x20,0x20,0x20,0x7d,0x20,0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x74,0x79,0x70,0x65,0x6d, - 0x61,0x70,0x5f,0x67,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67, - 0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x6e,0x61, - 0x6d,0x65,0x2c,0x20,0x74,0x79,0x70,0x65,0x2c,0x20,0x78,0x73,0x64,0x74,0x79,0x70, - 0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x6d,0x61,0x70,0x22,0x2c, - 0x20,0x61,0x74,0x74,0x73,0x20,0x3d,0x20,0x7b,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d, - 0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x74,0x79, - 0x70,0x65,0x2c,0x20,0x5b,0x22,0x78,0x73,0x69,0x3a,0x74,0x79,0x70,0x65,0x22,0x5d, - 0x20,0x3d,0x20,0x78,0x73,0x64,0x74,0x79,0x70,0x65,0x20,0x7d,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70, - 0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73, - 0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6d, - 0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x74,0x79,0x70,0x65,0x6d,0x61,0x70,0x5f, - 0x67,0x65,0x74,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64, - 0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5b,0x22,0x78,0x6d,0x6c,0x6e,0x73,0x3a,0x78, - 0x73,0x69,0x22,0x5d,0x20,0x3d,0x20,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77, - 0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x31,0x2f,0x58, - 0x4d,0x4c,0x53,0x63,0x68,0x65,0x6d,0x61,0x2d,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63, - 0x65,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x5b,0x22,0x78,0x6d,0x6c,0x6e,0x73,0x3a,0x78,0x73,0x64,0x22,0x5d,0x20,0x3d,0x20, - 0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f, - 0x72,0x67,0x2f,0x32,0x30,0x30,0x31,0x2f,0x58,0x4d,0x4c,0x53,0x63,0x68,0x65,0x6d, - 0x61,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x22, - 0x6e,0x69,0x6c,0x22,0x2c,0x20,0x22,0x6e,0x75,0x6c,0x6c,0x22,0x29,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x22, - 0x62,0x6f,0x6f,0x6c,0x65,0x61,0x6e,0x22,0x2c,0x20,0x22,0x62,0x6f,0x6f,0x6c,0x22, - 0x2c,0x20,0x22,0x78,0x73,0x64,0x3a,0x62,0x6f,0x6f,0x6c,0x65,0x61,0x6e,0x22,0x29, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70, - 0x65,0x28,0x22,0x6e,0x75,0x6d,0x62,0x65,0x72,0x22,0x2c,0x20,0x22,0x66,0x6c,0x6f, - 0x61,0x74,0x22,0x2c,0x20,0x22,0x78,0x73,0x64,0x3a,0x66,0x6c,0x6f,0x61,0x74,0x22, - 0x29,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79, - 0x70,0x65,0x28,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x2c,0x20,0x22,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x22,0x2c,0x20,0x22,0x78,0x73,0x64,0x3a,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x22,0x29,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65, - 0x6e,0x74,0x79,0x70,0x65,0x28,0x22,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x22, - 0x2c,0x20,0x22,0x72,0x65,0x73,0x6f,0x75,0x72,0x63,0x65,0x22,0x29,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x22, - 0x75,0x73,0x65,0x72,0x64,0x61,0x74,0x61,0x22,0x2c,0x20,0x22,0x72,0x65,0x73,0x6f, - 0x75,0x72,0x63,0x65,0x22,0x29,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x22,0x74,0x68,0x72,0x65,0x61,0x64,0x22, - 0x2c,0x20,0x22,0x72,0x65,0x73,0x6f,0x75,0x72,0x63,0x65,0x22,0x29,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x22, - 0x74,0x61,0x62,0x6c,0x65,0x22,0x2c,0x20,0x22,0x68,0x61,0x73,0x68,0x22,0x29,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65, - 0x28,0x22,0x73,0x65,0x71,0x75,0x65,0x6e,0x63,0x65,0x22,0x2c,0x20,0x22,0x61,0x72, - 0x72,0x61,0x79,0x22,0x29,0x2c,0x20,0x2d,0x2d,0x20,0x61,0x72,0x74,0x69,0x66,0x69, - 0x63,0x69,0x61,0x6c,0x20,0x74,0x79,0x70,0x65,0x20,0x74,0x6f,0x20,0x72,0x65,0x70, - 0x72,0x65,0x73,0x65,0x6e,0x74,0x20,0x73,0x65,0x71,0x75,0x65,0x6e,0x63,0x65,0x73, - 0x20,0x28,0x31,0x2d,0x6e,0x20,0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x6f,0x75,0x73, - 0x20,0x69,0x6e,0x64,0x65,0x78,0x65,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x67,0x65,0x6e,0x74,0x79,0x70,0x65,0x28,0x22,0x6d,0x75,0x6c,0x74,0x69, - 0x76,0x61,0x6c,0x22,0x2c,0x20,0x22,0x61,0x72,0x72,0x61,0x79,0x22,0x29,0x2c,0x20, - 0x2d,0x2d,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x72,0x65,0x70,0x72,0x65, - 0x73,0x65,0x6e,0x74,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x72,0x75,0x6e,0x28,0x73, - 0x65,0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72, - 0x65,0x76,0x5f,0x62,0x72,0x65,0x61,0x6b,0x5f,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20, - 0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74, - 0x72,0x75,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x73,0x74,0x65,0x70,0x5f,0x6f,0x76,0x65,0x72,0x28,0x73,0x65, - 0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65, - 0x6e,0x74,0x73,0x2e,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x22,0x6f,0x76, - 0x65,0x72,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x74,0x72,0x75,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x4d,0x2e,0x73,0x74,0x65,0x70,0x5f,0x6f,0x75,0x74,0x28,0x73,0x65, - 0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65, - 0x6e,0x74,0x73,0x2e,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x22,0x6f,0x75, - 0x74,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74, - 0x72,0x75,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x73,0x74,0x65,0x70,0x5f,0x69,0x6e,0x74,0x6f,0x28,0x73,0x65, - 0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65, - 0x6e,0x74,0x73,0x2e,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x22,0x69,0x6e, - 0x74,0x6f,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x74,0x72,0x75,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x4d,0x2e,0x65,0x76,0x61,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20, - 0x61,0x72,0x67,0x73,0x2c,0x20,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x67,0x28,0x22,0x44,0x45,0x42,0x55,0x47,0x22,0x2c,0x20,0x22,0x47,0x6f, - 0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x65,0x76,0x61,0x6c,0x20,0x22,0x2e,0x2e,0x64, - 0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72, - 0x65,0x73,0x75,0x6c,0x74,0x2c,0x20,0x65,0x72,0x72,0x2c,0x20,0x73,0x75,0x63,0x63, - 0x65,0x73,0x73,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x6e, - 0x76,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x63,0x6b,0x28,0x73, - 0x65,0x6c,0x66,0x2e,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x66,0x69,0x72,0x73,0x74,0x2c,0x20,0x74,0x72,0x79,0x20,0x74, - 0x6f,0x20,0x6c,0x6f,0x61,0x64,0x20,0x61,0x73,0x20,0x65,0x78,0x70,0x72,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x44,0x42,0x47,0x70, - 0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x70,0x70,0x6f,0x72, - 0x74,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x68,0x65, - 0x72,0x65,0x2c,0x20,0x73,0x65,0x65,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x62, - 0x75,0x67,0x73,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x73,0x74,0x61,0x74,0x65,0x2e, - 0x63,0x6f,0x6d,0x2f,0x73,0x68,0x6f,0x77,0x5f,0x62,0x75,0x67,0x2e,0x63,0x67,0x69, - 0x3f,0x69,0x64,0x3d,0x38,0x31,0x31,0x37,0x38,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x2c,0x20,0x65,0x72,0x72,0x20,0x3d,0x20, - 0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x61,0x64,0x69,0x6e,0x28,0x22,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x22,0x2e,0x2e,0x64,0x61,0x74,0x61,0x2c,0x20,0x65,0x6e,0x76, - 0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x66,0x20,0x69,0x74,0x20, - 0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x61,0x6e,0x20,0x65,0x78,0x70,0x72,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x72,0x79,0x20,0x61,0x73,0x20,0x73,0x74,0x61, - 0x74,0x65,0x6d,0x65,0x6e,0x74,0x20,0x28,0x61,0x73,0x73,0x69,0x67,0x6e,0x6d,0x65, - 0x6e,0x74,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6e,0x6f,0x74,0x20,0x66,0x75,0x6e,0x63,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x2c,0x20,0x65,0x72,0x72,0x20, - 0x3d,0x20,0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x61,0x64,0x69,0x6e,0x28,0x64,0x61, - 0x74,0x61,0x2c,0x20,0x65,0x6e,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x66,0x75,0x6e,0x63,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x75,0x63,0x63,0x65, - 0x73,0x73,0x2c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x70,0x63,0x61, - 0x6c,0x6c,0x28,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x2e,0x4d,0x75,0x6c,0x74,0x69,0x76,0x61,0x6c,0x28,0x66,0x75,0x6e,0x63, - 0x28,0x29,0x29,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x65,0x72,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c, - 0x74,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73, - 0x65,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x65,0x76,0x61,0x6c, - 0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69, - 0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x20,0x7d,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x65,0x72,0x72,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x6e,0x72,0x65,0x73,0x75,0x6c,0x74,0x73,0x20,0x3d,0x20,0x72,0x65,0x73,0x75, - 0x6c,0x74,0x2e,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6e,0x72,0x65,0x73,0x75,0x6c,0x74,0x73,0x20,0x3d,0x3d,0x20,0x31,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x72,0x65,0x73,0x75, - 0x6c,0x74,0x5b,0x31,0x5d,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x74,0x6f,0x72,0x65,0x20,0x72,0x65,0x73,0x75, - 0x6c,0x74,0x20,0x66,0x6f,0x72,0x20,0x66,0x75,0x72,0x74,0x68,0x65,0x72,0x20,0x75, - 0x73,0x65,0x20,0x28,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x2a,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x54,0x4f,0x44,0x4f,0x3a, - 0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65,0x20,0x6f, - 0x70,0x74,0x69,0x6d,0x69,0x7a,0x65,0x64,0x3a,0x20,0x74,0x68,0x69,0x73,0x20,0x69, - 0x73,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x75,0x73,0x65,0x64,0x20,0x66,0x6f,0x72,0x20, - 0x45,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x73,0x20,0x76,0x69,0x65,0x77, - 0x20,0x61,0x6e,0x64,0x20,0x74,0x6f,0x74,0x61,0x6c,0x6c,0x79,0x20,0x75,0x73,0x65, - 0x6c,0x65,0x73,0x73,0x20,0x66,0x6f,0x72,0x20,0x69,0x6e,0x74,0x65,0x72,0x61,0x63, - 0x74,0x69,0x76,0x65,0x20,0x63,0x6f,0x6e,0x73,0x6f,0x6c,0x65,0x2c,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73, - 0x6f,0x20,0x73,0x74,0x6f,0x72,0x69,0x6e,0x67,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, - 0x20,0x6f,0x72,0x20,0x6e,0x6f,0x74,0x20,0x63,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65, - 0x20,0x73,0x65,0x74,0x20,0x62,0x79,0x20,0x61,0x6e,0x20,0x61,0x72,0x67,0x75,0x6d, - 0x65,0x6e,0x74,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x69,0x64,0x78,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x6e,0x72,0x65,0x73,0x75,0x6c,0x74,0x73,0x20,0x3e,0x20,0x30,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x63,0x61,0x63,0x68,0x65,0x20,0x3d,0x20,0x65,0x6e,0x76, - 0x5b,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x2e,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x5b,0x2d,0x31,0x5d,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x64,0x78,0x20,0x3d,0x20,0x23,0x63,0x61,0x63,0x68,0x65,0x20,0x2b, - 0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, - 0x61,0x63,0x68,0x65,0x5b,0x69,0x64,0x78,0x5d,0x20,0x3d,0x20,0x72,0x65,0x73,0x75, - 0x6c,0x74,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x41,0x73,0x20,0x6f,0x66, - 0x20,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x2c,0x20,0x74,0x68,0x65,0x20,0x6d,0x61, - 0x78,0x69,0x6d,0x75,0x6d,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x73,0x69,0x7a,0x65, - 0x20,0x28,0x61,0x6e,0x64,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x63,0x6f,0x75, - 0x6e,0x74,0x29,0x20,0x69,0x73,0x20,0x38,0x30,0x30,0x30,0x2c,0x20,0x74,0x68,0x69, - 0x73,0x20,0x6c,0x69,0x6d,0x69,0x74,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20, - 0x74,0x6f,0x20,0x66,0x69,0x74,0x20,0x61,0x6c,0x6c,0x20,0x72,0x65,0x73,0x75,0x6c, - 0x74,0x73,0x20,0x69,0x6e,0x20,0x6f,0x6e,0x65,0x20,0x70,0x61,0x67,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x5b, - 0x31,0x5d,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79, - 0x28,0x2d,0x31,0x2c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x2c,0x20,0x69,0x64,0x78, - 0x20,0x6f,0x72,0x20,0x22,0x22,0x2c,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x31,0x2c,0x20, - 0x38,0x30,0x30,0x30,0x2c,0x20,0x30,0x2c,0x20,0x6e,0x69,0x6c,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x2e,0x61, - 0x74,0x74,0x72,0x2e,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x31,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x2e,0x61,0x74,0x74,0x72,0x2e,0x73, - 0x75,0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x30,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x5b,0x31,0x5d,0x20,0x3d, - 0x20,0x64,0x62,0x67,0x70,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x65,0x72,0x72,0x6f,0x72, - 0x28,0x32,0x30,0x36,0x2c,0x20,0x65,0x72,0x72,0x29,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64, - 0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x72, - 0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x5f,0x73,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72, - 0x67,0x73,0x2c,0x20,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x61,0x72,0x67,0x73,0x2e,0x6f,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20, - 0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73, - 0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b, - 0x61,0x72,0x67,0x73,0x2e,0x6f,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x62,0x67, - 0x70,0x2e,0x65,0x72,0x72,0x6f,0x72,0x28,0x32,0x30,0x30,0x2c,0x20,0x22,0x49,0x6e, - 0x76,0x61,0x6c,0x69,0x64,0x20,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x3a,0x20,0x22,0x2e, - 0x2e,0x61,0x72,0x67,0x73,0x2e,0x6f,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x2c, - 0x20,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x66, - 0x2c,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e, - 0x6e,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x69,0x66,0x20,0x69,0x74,0x20,0x69, - 0x73,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6e,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74, - 0x20,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x20,0x70,0x61,0x74,0x68,0x2c,0x20,0x69, - 0x67,0x6e,0x6f,0x72,0x65,0x20,0x74,0x68,0x65,0x20,0x62,0x72,0x65,0x61,0x6b,0x70, - 0x6f,0x69,0x6e,0x74,0x5f,0x73,0x65,0x74,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x2c,0x20,0x73,0x65,0x6e,0x64,0x20,0x65,0x6d,0x70,0x74,0x79,0x20,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x20,0x74,0x6f,0x20,0x61,0x76,0x6f,0x69,0x64,0x20,0x62, - 0x6c,0x6f,0x63,0x6b,0x69,0x6e,0x67,0x20,0x28,0x61,0x64,0x64,0x20,0x62,0x79,0x20, - 0x67,0x75,0x61,0x6e,0x79,0x75,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e, - 0x6f,0x74,0x20,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x3a,0x66,0x69,0x6e,0x64, - 0x28,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x62,0x61,0x73,0x65,0x5f,0x64, - 0x69,0x72,0x2c,0x31,0x2c,0x74,0x72,0x75,0x65,0x29,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e, - 0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20, - 0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73, - 0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d, - 0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69, - 0x6e,0x74,0x5f,0x73,0x65,0x74,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63, - 0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69, - 0x7d,0x20,0x7d,0x20,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x70,0x20,0x3d, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x79,0x70,0x65,0x20, - 0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x74,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x73,0x74,0x61,0x74,0x65,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x73, - 0x20,0x6f,0x72,0x20,0x22,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64,0x22,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x65,0x6d,0x70,0x6f,0x72,0x61,0x72,0x79, - 0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x72,0x20,0x3d,0x3d,0x20,0x22,0x31,0x22, - 0x2c,0x20,0x2d,0x2d,0x20,0x22,0x30,0x22,0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x20, - 0x6d,0x61,0x6b,0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x70,0x65, - 0x72,0x74,0x79,0x20,0x66,0x61,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x68,0x69,0x74,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x20,0x3d,0x20,0x30,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d, - 0x65,0x20,0x3d,0x20,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x2c,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x20,0x3d,0x20,0x6c, - 0x69,0x6e,0x65,0x6e,0x6f,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68, - 0x69,0x74,0x5f,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x68,0x20,0x6f,0x72,0x20,0x30,0x29, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x74,0x5f,0x63,0x6f, - 0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x6f, - 0x20,0x6f,0x72,0x20,0x22,0x3e,0x3d,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x72,0x67,0x73,0x2e,0x74,0x20,0x3d, - 0x3d,0x20,0x22,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x22,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x70,0x2e, - 0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x64,0x61,0x74, - 0x61,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65, - 0x20,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x63, - 0x6f,0x6d,0x70,0x69,0x6c,0x65,0x64,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x6f,0x6e,0x63, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x70,0x2e,0x63,0x6f,0x6e, - 0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x64,0x62,0x67,0x70,0x2e,0x61,0x73, - 0x73,0x65,0x72,0x74,0x28,0x32,0x30,0x37,0x2c,0x20,0x6c,0x6f,0x61,0x64,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x22,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x22,0x20, - 0x2e,0x2e,0x20,0x64,0x61,0x74,0x61,0x20,0x2e,0x2e,0x20,0x22,0x29,0x22,0x29,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x61,0x72,0x67,0x73, - 0x2e,0x74,0x20,0x7e,0x3d,0x20,0x22,0x6c,0x69,0x6e,0x65,0x22,0x20,0x74,0x68,0x65, - 0x6e,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f,0x72,0x28,0x32,0x30,0x31, - 0x2c,0x20,0x22,0x42,0x50,0x20,0x74,0x79,0x70,0x65,0x20,0x22,0x20,0x2e,0x2e,0x20, - 0x61,0x72,0x67,0x73,0x2e,0x74,0x20,0x2e,0x2e,0x20,0x22,0x20,0x6e,0x6f,0x74,0x20, - 0x79,0x65,0x74,0x20,0x73,0x75,0x70,0x70,0x6f,0x72,0x74,0x65,0x64,0x22,0x29,0x20, - 0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62, - 0x70,0x69,0x64,0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b, - 0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x69,0x6e,0x73,0x65,0x72,0x74,0x28,0x62,0x70, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f, - 0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20, - 0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22, - 0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61, - 0x6e,0x64,0x20,0x3d,0x20,0x22,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74, - 0x5f,0x73,0x65,0x74,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69, - 0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x2c,0x20, - 0x73,0x74,0x61,0x74,0x65,0x20,0x3d,0x20,0x62,0x70,0x2e,0x73,0x74,0x61,0x74,0x65, - 0x2c,0x20,0x69,0x64,0x20,0x3d,0x20,0x62,0x70,0x69,0x64,0x20,0x7d,0x20,0x7d,0x20, - 0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x4d,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x67,0x65,0x74, - 0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73, - 0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d, - 0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x74,0x74,0x72,0x20, - 0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x62, - 0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x67,0x65,0x74,0x22,0x2c,0x20, - 0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d, - 0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x61,0x73, - 0x73,0x65,0x72,0x74,0x28,0x32,0x30,0x35,0x2c,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62, - 0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x67,0x65,0x74,0x5f,0x78, - 0x6d,0x6c,0x28,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73, - 0x2e,0x64,0x29,0x29,0x29,0x20,0x7d,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x5f,0x6c,0x69,0x73,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61, - 0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62, - 0x70,0x73,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65, - 0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20, - 0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x62,0x72,0x65, - 0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x6c,0x69,0x73,0x74,0x22,0x2c,0x20,0x74, - 0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20, - 0x61,0x72,0x67,0x73,0x2e,0x69,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6f,0x72,0x20,0x69,0x64,0x2c,0x20,0x62,0x70,0x20,0x69,0x6e,0x20,0x70,0x61,0x69, - 0x72,0x73,0x28,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69, - 0x6e,0x74,0x73,0x2e,0x67,0x65,0x74,0x28,0x29,0x29,0x20,0x64,0x6f,0x20,0x62,0x70, - 0x73,0x5b,0x23,0x62,0x70,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x63,0x6f, - 0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x67, - 0x65,0x74,0x5f,0x78,0x6d,0x6c,0x28,0x69,0x64,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c, - 0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x62,0x70,0x73,0x29,0x0a, - 0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e, - 0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x75,0x70,0x64,0x61,0x74, - 0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x70,0x20,0x3d,0x20,0x63,0x6f,0x72, - 0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x67,0x65, - 0x74,0x28,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e, - 0x64,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x62, - 0x70,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f, - 0x72,0x28,0x32,0x30,0x35,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20, - 0x62,0x72,0x65,0x61,0x6b,0x70,0x69,0x6e,0x74,0x20,0x22,0x2e,0x2e,0x61,0x72,0x67, - 0x73,0x2e,0x64,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x61,0x72,0x67,0x73,0x2e,0x6f,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x63, - 0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e, - 0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x61, - 0x72,0x67,0x73,0x2e,0x6f,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x62,0x67,0x70, - 0x2e,0x65,0x72,0x72,0x6f,0x72,0x28,0x32,0x30,0x30,0x2c,0x20,0x22,0x49,0x6e,0x76, - 0x61,0x6c,0x69,0x64,0x20,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69, - 0x6f,0x6e,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x3a,0x20,0x22,0x2e,0x2e, - 0x61,0x72,0x67,0x73,0x2e,0x6f,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20,0x3d, - 0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e, - 0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f, - 0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x5f,0x75,0x70,0x64,0x61,0x74,0x65,0x22,0x2c,0x20,0x74,0x72,0x61, - 0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72, - 0x67,0x73,0x2e,0x69,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x6e,0x65,0x65,0x64,0x55,0x70,0x64,0x61,0x74,0x65,0x20,0x3d,0x20, - 0x66,0x61,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x6f,0x6c,0x64,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x62,0x70,0x2e,0x6c,0x69,0x6e, - 0x65,0x6e,0x6f,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x74,0x6f,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x6e,0x29,0x20,0x7e,0x3d,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x62,0x70,0x2e,0x6c,0x69,0x6e,0x65,0x6e, - 0x6f,0x29,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6e,0x65,0x65,0x64,0x55,0x70,0x64,0x61,0x74,0x65,0x20,0x3d,0x20,0x74,0x72,0x75, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x62,0x70, - 0x2e,0x73,0x74,0x61,0x74,0x65,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x73,0x20, - 0x6f,0x72,0x20,0x62,0x70,0x2e,0x73,0x74,0x61,0x74,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x62,0x70,0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75, - 0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x6e,0x20,0x6f,0x72,0x20,0x62, - 0x70,0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20,0x62,0x70, - 0x2e,0x68,0x69,0x74,0x5f,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x74,0x6f,0x6e, - 0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x68,0x20,0x6f,0x72,0x20, - 0x62,0x70,0x2e,0x68,0x69,0x74,0x5f,0x76,0x61,0x6c,0x75,0x65,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x62,0x70,0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69, - 0x6f,0x6e,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x6f,0x20,0x6f,0x72,0x20,0x62, - 0x70,0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x65,0x65,0x64,0x55,0x70,0x64,0x61,0x74, - 0x65,0x20,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73, - 0x2e,0x75,0x70,0x64,0x61,0x74,0x65,0x28,0x6f,0x6c,0x64,0x6c,0x69,0x6e,0x65,0x2c, - 0x20,0x62,0x70,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73, - 0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73, - 0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x4d,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x72,0x65, - 0x6d,0x6f,0x76,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x70,0x6f, - 0x6e,0x73,0x65,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72, - 0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d, - 0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x62,0x72, - 0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x72,0x65,0x6d,0x6f,0x76,0x65,0x22, - 0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64, - 0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x61,0x72,0x67,0x73,0x2e,0x64,0x20,0x6d,0x61,0x79,0x20, - 0x62,0x65,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x62,0x65,0x63,0x61,0x75,0x73,0x65,0x20, - 0x74,0x68,0x65,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x64, - 0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x62,0x65,0x6c,0x6f,0x6e,0x67,0x20,0x74, - 0x6f,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x70,0x72,0x6f,0x6a,0x65,0x63, - 0x74,0x20,0x28,0x61,0x64,0x64,0x20,0x62,0x79,0x20,0x67,0x75,0x61,0x6e,0x79,0x75, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x72,0x67,0x73,0x2e,0x64,0x20, - 0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65, - 0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x72,0x65,0x6d,0x6f,0x76,0x65,0x28, - 0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x64,0x29, - 0x29,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f, - 0x72,0x28,0x32,0x30,0x35,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20, - 0x62,0x72,0x65,0x61,0x6b,0x70,0x69,0x6e,0x74,0x20,0x22,0x2e,0x2e,0x61,0x72,0x67, - 0x73,0x2e,0x64,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67, - 0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e, - 0x73,0x6b,0x74,0x2c,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x29,0x0a,0x65, - 0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x73, - 0x74,0x61,0x63,0x6b,0x5f,0x64,0x65,0x70,0x74,0x68,0x28,0x73,0x65,0x6c,0x66,0x2c, - 0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x30,0x0a,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20, - 0x61,0x72,0x67,0x73,0x2e,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, - 0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d,0x20,0x30,0x2c,0x20,0x6d,0x61,0x74,0x68,0x2e, - 0x68,0x75,0x67,0x65,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20,0x63,0x6f,0x72, - 0x6f,0x3a,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x6c,0x65,0x76,0x65,0x6c,0x2c, - 0x20,0x22,0x53,0x74,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6e,0x66,0x6f,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x62,0x72,0x65,0x61,0x6b,0x20,0x65,0x6e,0x64,0x20,0x2d,0x2d,0x20,0x65,0x6e,0x64, - 0x20,0x6f,0x66,0x20,0x73,0x74,0x61,0x63,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x64,0x65,0x70,0x74,0x68,0x20, - 0x2b,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69, - 0x6e,0x66,0x6f,0x2e,0x69,0x73,0x74,0x61,0x69,0x6c,0x63,0x61,0x6c,0x6c,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x64,0x65,0x70,0x74, - 0x68,0x20,0x2b,0x20,0x31,0x20,0x65,0x6e,0x64,0x20,0x2d,0x2d,0x20,0x61,0x20,0x27, - 0x66,0x61,0x6b,0x65,0x27,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x69,0x73,0x20,0x61, - 0x64,0x64,0x65,0x64,0x20,0x69,0x6e,0x20,0x74,0x68,0x61,0x74,0x20,0x63,0x61,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69,0x6e,0x66, - 0x6f,0x2e,0x77,0x68,0x61,0x74,0x20,0x3d,0x3d,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22, - 0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x65,0x6e,0x64,0x20, - 0x2d,0x2d,0x20,0x6c,0x65,0x76,0x65,0x6c,0x73,0x20,0x62,0x65,0x6c,0x6f,0x77,0x20, - 0x6d,0x61,0x69,0x6e,0x20,0x63,0x68,0x75,0x6e,0x6b,0x20,0x61,0x72,0x65,0x20,0x6e, - 0x6f,0x74,0x20,0x69,0x6e,0x74,0x65,0x72,0x65,0x73,0x74,0x69,0x6e,0x67,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e, - 0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b, - 0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20, - 0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x73,0x74,0x61,0x63,0x6b, - 0x5f,0x64,0x65,0x70,0x74,0x68,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63, - 0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69, - 0x2c,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x64,0x65,0x70,0x74,0x68,0x7d, - 0x20,0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x4d,0x2e,0x73,0x74,0x61,0x63,0x6b,0x5f,0x67,0x65,0x74,0x28,0x73, - 0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x20,0x2d,0x2d,0x20,0x54,0x4f, - 0x44,0x4f,0x3a,0x20,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x20,0x63,0x6f,0x64,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x70,0x65,0x63,0x69,0x61,0x6c,0x20, - 0x55,0x52,0x49,0x73,0x20,0x74,0x6f,0x20,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x79, - 0x20,0x75,0x6e,0x72,0x65,0x61,0x63,0x68,0x61,0x62,0x6c,0x65,0x20,0x73,0x74,0x61, - 0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x73,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x77,0x68,0x61,0x74,0x32,0x75,0x72,0x69,0x20,0x3d,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x61,0x69,0x6c,0x20,0x3d,0x20, - 0x22,0x74,0x61,0x69,0x6c,0x72,0x65,0x74,0x75,0x72,0x6e,0x3a,0x2f,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x43,0x20,0x20,0x20,0x20,0x3d,0x20,0x22, - 0x63,0x63,0x6f,0x64,0x65,0x3a,0x2f,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x69, - 0x6e,0x66,0x6f,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d, - 0x20,0x7b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d,0x20,0x6c,0x65,0x76,0x65,0x6c, - 0x2c,0x20,0x77,0x68,0x65,0x72,0x65,0x20,0x3d,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x74,0x79,0x70,0x65,0x3d,0x22,0x66,0x69,0x6c,0x65,0x22, - 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x75,0x72,0x69,0x20,0x3d,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e, - 0x67,0x65,0x74,0x5f,0x75,0x72,0x69,0x28,0x69,0x6e,0x66,0x6f,0x2e,0x73,0x6f,0x75, - 0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x75,0x72,0x69,0x20,0x61,0x6e,0x64,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x63,0x75,0x72, - 0x72,0x65,0x6e,0x74,0x6c,0x69,0x6e,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d, - 0x20,0x72,0x65,0x61,0x63,0x68,0x61,0x62,0x6c,0x65,0x20,0x6c,0x65,0x76,0x65,0x6c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x74,0x74, - 0x72,0x2e,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x75,0x72,0x69, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x74,0x74, - 0x72,0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x20,0x3d,0x20,0x69,0x6e,0x66,0x6f,0x2e, - 0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x6c,0x69,0x6e,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x61,0x74,0x74,0x72,0x2e,0x66,0x69,0x6c,0x65,0x6e,0x61, - 0x6d,0x65,0x20,0x3d,0x20,0x77,0x68,0x61,0x74,0x32,0x75,0x72,0x69,0x5b,0x69,0x6e, - 0x66,0x6f,0x2e,0x77,0x68,0x61,0x74,0x5d,0x20,0x6f,0x72,0x20,0x22,0x75,0x6e,0x6b, - 0x6e,0x6f,0x77,0x6e,0x3a,0x2f,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x61,0x74,0x74,0x72,0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x20, - 0x3d,0x20,0x2d,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x73,0x74,0x61,0x63,0x6b,0x22,0x2c, - 0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x61,0x74,0x74,0x72,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x6e,0x6f,0x64,0x65,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d, - 0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74, - 0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20, - 0x22,0x73,0x74,0x61,0x63,0x6b,0x5f,0x67,0x65,0x74,0x22,0x2c,0x20,0x74,0x72,0x61, - 0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72, - 0x67,0x73,0x2e,0x69,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f,0x63,0x6f,0x72, - 0x6f,0x75,0x74,0x69,0x6e,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67, - 0x73,0x2e,0x6f,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x72,0x67, - 0x73,0x2e,0x64,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76, - 0x65,0x6c,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72, - 0x67,0x73,0x2e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6e,0x6f, - 0x64,0x65,0x5b,0x23,0x6e,0x6f,0x64,0x65,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x6d,0x61, - 0x6b,0x65,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x63,0x6f,0x72,0x6f,0x3a,0x67,0x65, - 0x74,0x69,0x6e,0x66,0x6f,0x28,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65, - 0x6c,0x2c,0x20,0x22,0x6e,0x53,0x6c,0x22,0x29,0x2c,0x20,0x73,0x74,0x61,0x63,0x6b, - 0x5f,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x30, - 0x2c,0x20,0x6d,0x61,0x74,0x68,0x2e,0x68,0x75,0x67,0x65,0x20,0x64,0x6f,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20,0x63,0x6f,0x72,0x6f,0x3a,0x67,0x65,0x74, - 0x69,0x6e,0x66,0x6f,0x28,0x69,0x2c,0x20,0x22,0x6e,0x53,0x6c,0x74,0x22,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e, - 0x6f,0x74,0x20,0x69,0x6e,0x66,0x6f,0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72,0x65, - 0x61,0x6b,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6e,0x6f,0x64,0x65,0x5b,0x23,0x6e,0x6f,0x64,0x65,0x2b,0x31,0x5d, - 0x20,0x3d,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x69,0x6e, - 0x66,0x6f,0x2c,0x20,0x69,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x61,0x64,0x64,0x20,0x61,0x20,0x66,0x61,0x6b,0x65, - 0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x6f,0x66,0x20,0x73,0x74,0x61,0x63,0x6b,0x20, - 0x66,0x6f,0x72,0x20,0x74,0x61,0x69,0x6c,0x20,0x63,0x61,0x6c,0x6c,0x73,0x20,0x28, - 0x74,0x65,0x6c,0x6c,0x73,0x20,0x75,0x73,0x65,0x72,0x20,0x74,0x68,0x61,0x74,0x20, - 0x74,0x68,0x65,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x68,0x61,0x73, - 0x20,0x6e,0x6f,0x74,0x20,0x62,0x65,0x65,0x6e,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64, - 0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x6c,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x69, - 0x73,0x74,0x61,0x69,0x6c,0x63,0x61,0x6c,0x6c,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6e, - 0x6f,0x64,0x65,0x5b,0x23,0x6e,0x6f,0x64,0x65,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x7b, - 0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x73,0x74,0x61,0x63,0x6b,0x22,0x2c,0x20, - 0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x3d,0x69, - 0x2c,0x20,0x74,0x79,0x70,0x65,0x3d,0x22,0x66,0x69,0x6c,0x65,0x22,0x2c,0x20,0x66, - 0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x3d,0x22,0x74,0x61,0x69,0x6c,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x3a,0x2f,0x22,0x2c,0x20,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x3d,0x2d, - 0x31,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x77,0x68,0x61,0x74,0x20,0x3d, - 0x3d,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72, - 0x65,0x61,0x6b,0x20,0x65,0x6e,0x64,0x20,0x2d,0x2d,0x20,0x6c,0x65,0x76,0x65,0x6c, - 0x73,0x20,0x62,0x65,0x6c,0x6f,0x77,0x20,0x6d,0x61,0x69,0x6e,0x20,0x63,0x68,0x75, - 0x6e,0x6b,0x20,0x61,0x72,0x65,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6e,0x74,0x65,0x72, - 0x65,0x73,0x74,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65, - 0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x6e,0x6f,0x64,0x65,0x29,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x4c,0x69,0x73,0x74,0x73,0x20,0x61,0x6c,0x6c, - 0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x61, - 0x20,0x6c,0x69,0x73,0x74,0x20,0x6f,0x66,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x20, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20,0x77,0x69,0x74,0x68,0x20, - 0x74,0x68,0x65,0x69,0x72,0x20,0x69,0x64,0x20,0x28,0x61,0x6e,0x20,0x61,0x72,0x62, - 0x69,0x74,0x72,0x61,0x72,0x79,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x20,0x74, - 0x6f,0x20,0x71,0x75,0x65,0x72,0x79,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x61,0x6e, - 0x64,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x2e,0x20,0x54,0x68, - 0x65,0x20,0x69,0x64,0x20,0x69,0x73,0x0a,0x2d,0x2d,0x20,0x67,0x75,0x61,0x72,0x61, - 0x6e,0x74,0x65,0x65,0x64,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x75,0x6e,0x69,0x71, - 0x75,0x65,0x20,0x61,0x6e,0x64,0x20,0x73,0x74,0x61,0x62,0x6c,0x65,0x20,0x66,0x6f, - 0x72,0x20,0x61,0x6c,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20, - 0x6c,0x69,0x66,0x65,0x20,0x28,0x74,0x68,0x65,0x79,0x20,0x63,0x61,0x6e,0x20,0x62, - 0x65,0x20,0x72,0x65,0x75,0x73,0x65,0x64,0x20,0x61,0x73,0x20,0x6c,0x6f,0x6e,0x67, - 0x20,0x61,0x73,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x65,0x78, - 0x69,0x73,0x74,0x73,0x29,0x2e,0x0a,0x2d,0x2d,0x20,0x4f,0x74,0x68,0x65,0x72,0x73, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20,0x73,0x75,0x63,0x68,0x20,0x61, - 0x73,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x67,0x65,0x74,0x20,0x6f,0x72,0x20,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x2a,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e, - 0x64,0x73,0x20,0x74,0x61,0x6b,0x65,0x73,0x20,0x61,0x6e,0x20,0x61,0x64,0x64,0x69, - 0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x2d,0x6f,0x20,0x73,0x77,0x69,0x74,0x63,0x68, - 0x20,0x74,0x6f,0x20,0x71,0x75,0x65,0x72,0x79,0x20,0x61,0x20,0x70,0x61,0x72,0x74, - 0x69,0x63,0x75,0x6c,0x61,0x72,0x20,0x63,0x4f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x2e,0x0a,0x2d,0x2d,0x20,0x49,0x66,0x20,0x74,0x68,0x65,0x20,0x73,0x77,0x69,0x74, - 0x63,0x68,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x67,0x69,0x76,0x65,0x6e,0x2c, - 0x20,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x20,0x77,0x69,0x6c,0x6c,0x20,0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x2e, - 0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x20,0x63,0x61,0x73,0x65,0x20,0x6f,0x66,0x20,0x65, - 0x72,0x72,0x6f,0x72,0x20,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x20,0x28,0x6d,0x6f,0x73,0x74,0x20,0x6c,0x69,0x6b,0x65,0x6c,0x79,0x20, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x6e,0x6f,0x74,0x20,0x66,0x6f, - 0x75,0x6e,0x64,0x20,0x6f,0x72,0x20,0x64,0x65,0x61,0x64,0x29,0x2c,0x20,0x61,0x6e, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x33,0x39,0x39,0x20,0x69,0x73,0x20,0x74,0x68, - 0x72,0x6f,0x77,0x6e,0x2e,0x0a,0x2d,0x2d,0x20,0x4e,0x6f,0x74,0x65,0x20,0x74,0x68, - 0x65,0x72,0x65,0x20,0x69,0x73,0x20,0x61,0x6e,0x20,0x69,0x6d,0x70,0x6f,0x72,0x74, - 0x61,0x6e,0x74,0x20,0x6c,0x69,0x6d,0x69,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x64, - 0x75,0x65,0x20,0x74,0x6f,0x20,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x20,0x63,0x6f, - 0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e, - 0x74,0x61,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x79,0x6f,0x75,0x20,0x63,0x61,0x6e,0x6e, - 0x6f,0x74,0x20,0x71,0x75,0x65,0x72,0x79,0x20,0x6d,0x61,0x69,0x6e,0x20,0x22,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x22,0x20,0x66,0x72,0x6f,0x6d,0x0a,0x2d, - 0x2d,0x20,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x6f,0x6e,0x65,0x2c,0x20,0x73, - 0x6f,0x20,0x6d,0x61,0x69,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6e,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x65,0x64,0x20,0x6c,0x69,0x73,0x74,0x20,0x28,0x74,0x68,0x69,0x73,0x20,0x77, - 0x69,0x6c,0x6c,0x20,0x63,0x68,0x61,0x6e,0x67,0x65,0x20,0x77,0x69,0x74,0x68,0x20, - 0x4c,0x75,0x61,0x20,0x35,0x2e,0x32,0x29,0x2e,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x54,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x6e,0x6f,0x6e,0x2d,0x73,0x74, - 0x61,0x6e,0x64,0x61,0x72,0x64,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x2e,0x20, - 0x54,0x68,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x65,0x64,0x20,0x58,0x4d,0x4c, - 0x20,0x68,0x61,0x73,0x20,0x74,0x68,0x65,0x20,0x66,0x6f,0x6c,0x6c,0x6f,0x77,0x69, - 0x6e,0x67,0x20,0x73,0x74,0x72,0x75,0x63,0x75,0x74,0x75,0x72,0x65,0x3a,0x0a,0x2d, - 0x2d,0x20,0x20,0x20,0x20,0x20,0x3c,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20, - 0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x3d,0x22,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x5f,0x6c,0x69,0x73,0x74,0x22,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63, - 0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x3d,0x22,0x30,0x22,0x3e,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x20,0x6e,0x61,0x6d,0x65,0x3d,0x22,0x3c,0x73,0x6f,0x6d,0x65,0x20,0x70,0x72,0x69, - 0x6e,0x74,0x74,0x61,0x62,0x6c,0x65,0x20,0x6e,0x61,0x6d,0x65,0x3e,0x22,0x20,0x69, - 0x64,0x3d,0x22,0x3c,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x64, - 0x3e,0x22,0x20,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x3d,0x22,0x30,0x7c,0x31,0x22, - 0x20,0x2f,0x3e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2e,0x2e,0x2e, - 0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x3c,0x2f,0x72,0x65,0x73,0x70,0x6f,0x6e, - 0x73,0x65,0x3e,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x5f,0x6c,0x69,0x73,0x74,0x28,0x73,0x65, - 0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x20,0x3d,0x20,0x73,0x65, - 0x6c,0x66,0x2e,0x63,0x6f,0x72,0x6f,0x5b,0x31,0x5d,0x0a,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20, - 0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f, - 0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63, - 0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x63,0x6f,0x72,0x6f,0x75,0x74, - 0x69,0x6e,0x65,0x5f,0x6c,0x69,0x73,0x74,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73, - 0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73, - 0x2e,0x69,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x61,0x73, - 0x20,0x61,0x6e,0x79,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f, - 0x6e,0x20,0x6d,0x61,0x69,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x20,0x77,0x69,0x6c,0x6c,0x20,0x66,0x61,0x69,0x6c,0x2c,0x20,0x69,0x74,0x20,0x69, - 0x73,0x20,0x6e,0x6f,0x74,0x20,0x79,0x65,0x74,0x20,0x6c,0x69,0x73,0x74,0x65,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d, - 0x20,0x22,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x22,0x2c,0x20,0x61,0x74, - 0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x69,0x64,0x20,0x3d,0x20,0x30,0x2c,0x20,0x6e, - 0x61,0x6d,0x65,0x20,0x3d,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x2c,0x20,0x72,0x75, - 0x6e,0x6e,0x69,0x6e,0x67,0x20,0x3d,0x20,0x28,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67, - 0x20,0x3d,0x3d,0x20,0x6e,0x69,0x6c,0x29,0x20,0x61,0x6e,0x64,0x20,0x22,0x31,0x22, - 0x20,0x6f,0x72,0x20,0x22,0x30,0x22,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6f,0x72,0x20,0x69,0x64,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x69,0x6e,0x20, - 0x70,0x61,0x69,0x72,0x73,0x28,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76, - 0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x66,0x72,0x6f, - 0x6d,0x5f,0x69,0x64,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x69,0x64,0x20,0x7e,0x3d,0x20,0x22,0x6e,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x5b,0x23,0x63,0x6f,0x72,0x6f,0x75, - 0x74,0x69,0x6e,0x65,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x74, - 0x61,0x67,0x20,0x3d,0x20,0x22,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x22, - 0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x69,0x64,0x20,0x3d,0x20, - 0x69,0x64,0x2c,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x63,0x6f,0x72,0x6f,0x29,0x2c,0x20,0x72,0x75,0x6e,0x6e,0x69, - 0x6e,0x67,0x20,0x3d,0x20,0x28,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x3d,0x20,0x72,0x75, - 0x6e,0x6e,0x69,0x6e,0x67,0x29,0x20,0x61,0x6e,0x64,0x20,0x22,0x31,0x22,0x20,0x6f, - 0x72,0x20,0x22,0x30,0x22,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28, - 0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74, - 0x69,0x6e,0x65,0x73,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5f,0x6e,0x61, - 0x6d,0x65,0x73,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d, - 0x20,0x67,0x65,0x74,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x28,0x73, - 0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x2e,0x6f,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x64,0x20,0x6f, - 0x72,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69, - 0x6e,0x66,0x6f,0x20,0x3d,0x20,0x63,0x6f,0x72,0x6f,0x3a,0x67,0x65,0x74,0x69,0x6e, - 0x66,0x6f,0x28,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x22,0x66,0x22,0x29,0x20,0x6f, - 0x72,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f,0x72,0x28,0x33,0x30,0x31, - 0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20,0x73,0x74,0x61,0x63,0x6b, - 0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x28,0x6c,0x65,0x76,0x65,0x6c,0x29,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x73,0x20, - 0x61,0x72,0x65,0x20,0x61,0x6c,0x77,0x61,0x79,0x73,0x20,0x70,0x61,0x73,0x73,0x65, - 0x64,0x2c,0x20,0x65,0x76,0x65,0x6e,0x20,0x69,0x66,0x20,0x65,0x6d,0x70,0x74,0x79, - 0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x68,0x6f,0x77,0x20,0x44,0x4c, - 0x54,0x4b,0x20,0x65,0x78,0x70,0x65,0x63,0x74,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78, - 0x74,0x2c,0x20,0x77,0x68,0x61,0x74,0x20,0x61,0x62,0x6f,0x75,0x74,0x20,0x6f,0x74, - 0x68,0x65,0x72,0x73,0x20,0x3f,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x73,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22,0x63,0x6f,0x6e,0x74, - 0x65,0x78,0x74,0x5f,0x6e,0x61,0x6d,0x65,0x73,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e, - 0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67, - 0x73,0x2e,0x69,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, - 0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x22, - 0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x6e,0x61,0x6d,0x65,0x20, - 0x3d,0x20,0x22,0x4c,0x6f,0x63,0x61,0x6c,0x22,0x2c,0x20,0x20,0x20,0x69,0x64,0x20, - 0x3d,0x20,0x30,0x20,0x7d,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x63,0x6f,0x6e,0x74,0x65,0x78, - 0x74,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x6e,0x61,0x6d, - 0x65,0x20,0x3d,0x20,0x22,0x55,0x70,0x76,0x61,0x6c,0x75,0x65,0x22,0x2c,0x20,0x69, - 0x64,0x20,0x3d,0x20,0x32,0x20,0x7d,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x63,0x6f,0x6e,0x74, - 0x65,0x78,0x74,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x6e, - 0x61,0x6d,0x65,0x20,0x3d,0x20,0x22,0x47,0x6c,0x6f,0x62,0x61,0x6c,0x22,0x2c,0x20, - 0x20,0x69,0x64,0x20,0x3d,0x20,0x31,0x20,0x7d,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e, - 0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20, - 0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x73,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x63,0x6f,0x6e,0x74,0x65,0x78, - 0x74,0x5f,0x67,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x78,0x74,0x5f, - 0x6e,0x75,0x6d,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61, - 0x72,0x67,0x73,0x2e,0x63,0x20,0x6f,0x72,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x78,0x74,0x5f,0x69,0x64,0x20,0x3d,0x20,0x63, - 0x6f,0x6e,0x74,0x65,0x78,0x74,0x2e,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5b,0x63, - 0x78,0x74,0x5f,0x6e,0x75,0x6d,0x5d,0x20,0x6f,0x72,0x20,0x64,0x62,0x67,0x70,0x2e, - 0x65,0x72,0x72,0x6f,0x72,0x28,0x33,0x30,0x32,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73, - 0x75,0x63,0x68,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x3a,0x20,0x22,0x2e,0x2e, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d, - 0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x65,0x76, - 0x65,0x6c,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72, - 0x67,0x73,0x2e,0x64,0x20,0x6f,0x72,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20, - 0x61,0x72,0x67,0x73,0x2e,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x63,0x78,0x74,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61, - 0x63,0x6b,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x65, - 0x72,0x74,0x69,0x65,0x73,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20, - 0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72, - 0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x22, - 0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5f,0x67,0x65,0x74,0x22,0x2c,0x20,0x74,0x72, - 0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61, - 0x72,0x67,0x73,0x2e,0x69,0x2c,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x3d, - 0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x69,0x74,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x76,0x65, - 0x72,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x69,0x73,0x20,0x64,0x69,0x66,0x66, - 0x65,0x72,0x65,0x6e,0x74,0x20,0x28,0x74,0x68,0x69,0x73,0x20,0x63,0x6f,0x75,0x6c, - 0x64,0x20,0x62,0x65,0x20,0x75,0x6e,0x69,0x66,0x69,0x65,0x64,0x20,0x69,0x6e,0x20, - 0x4c,0x75,0x61,0x20,0x35,0x2e,0x32,0x20,0x74,0x68,0x61,0x6e,0x6b,0x73,0x20,0x74, - 0x6f,0x20,0x5f,0x5f,0x70,0x61,0x69,0x72,0x73,0x20,0x6d,0x65,0x74,0x61,0x6d,0x65, - 0x74,0x68,0x6f,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6e,0x61, - 0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x28,0x63,0x78,0x74,0x5f, - 0x6e,0x75,0x6d,0x20,0x3d,0x3d,0x20,0x31,0x20,0x61,0x6e,0x64,0x20,0x6e,0x65,0x78, - 0x74,0x20,0x6f,0x72,0x20,0x67,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x28,0x63,0x78,0x74,0x5b,0x63,0x78,0x74,0x5f,0x69,0x64,0x5d,0x29,0x2e,0x69, - 0x74,0x65,0x72,0x61,0x74,0x6f,0x72,0x29,0x2c,0x20,0x63,0x78,0x74,0x5b,0x63,0x78, - 0x74,0x5f,0x69,0x64,0x5d,0x2c,0x20,0x6e,0x69,0x6c,0x20,0x64,0x6f,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65,0x20,0x44,0x42,0x47, - 0x70,0x20,0x73,0x70,0x65,0x63,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, - 0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x65,0x61,0x72,0x20,0x61,0x62,0x6f, - 0x75,0x74,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x6f,0x66,0x20, - 0x61,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5f,0x67,0x65,0x74,0x2c,0x20,0x62, - 0x75,0x74,0x20,0x61,0x20,0x72,0x65,0x63,0x75,0x72,0x73,0x69,0x76,0x65,0x20,0x67, - 0x65,0x74,0x20,0x63,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65,0x20,0x2a,0x72,0x65,0x61, - 0x6c,0x6c,0x79,0x2a,0x20,0x73,0x6c,0x6f,0x77,0x20,0x69,0x6e,0x20,0x4c,0x75,0x61, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x69,0x65,0x73,0x5b,0x23,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x20, - 0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63, - 0x74,0x69,0x6f,0x6e,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x70,0x72,0x6f,0x70,0x65,0x72, - 0x74,0x79,0x28,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x2c,0x20,0x76,0x61,0x6c,0x2c, - 0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x30,0x2c,0x20,0x75, - 0x74,0x69,0x6c,0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x2e,0x6d,0x61,0x78, - 0x5f,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x2c,0x20,0x30,0x2c,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x75,0x74,0x69,0x6c,0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x2e, - 0x6d,0x61,0x78,0x5f,0x64,0x61,0x74,0x61,0x2c,0x20,0x63,0x78,0x74,0x5f,0x6e,0x75, - 0x6d,0x20,0x7e,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78, - 0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x70,0x72,0x6f, - 0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d, - 0x20,0x20,0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x2a,0x20,0x63,0x6f,0x6d, - 0x6d,0x61,0x6e,0x64,0x73,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x69,0x73,0x20,0x69,0x6e, - 0x20,0x74,0x68,0x65,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74, - 0x20,0x69,0x6e,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x70,0x72,0x6f,0x70,0x65,0x72, - 0x74,0x69,0x65,0x73,0x20,0x61,0x72,0x65,0x20,0x67,0x65,0x74,0x20,0x6f,0x72,0x20, - 0x73,0x65,0x74,0x2e,0x0a,0x2d,0x2d,0x20,0x49,0x74,0x20,0x6e,0x6f,0x74,0x61,0x62, - 0x6c,0x79,0x20,0x63,0x6f,0x6e,0x74,0x61,0x69,0x6e,0x20,0x61,0x20,0x63,0x6f,0x6c, - 0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x70,0x72,0x6f,0x78,0x79, - 0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x68,0x61,0x6e, - 0x64,0x6c,0x65,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x61,0x72,0x65,0x6e,0x74,0x65, - 0x6c,0x79,0x20,0x67,0x65,0x74,0x2f,0x73,0x65,0x74,0x20,0x6f,0x70,0x65,0x72,0x61, - 0x74,0x69,0x6f,0x6e,0x73,0x20,0x6f,0x6e,0x20,0x73,0x70,0x65,0x63,0x69,0x61,0x6c, - 0x20,0x66,0x69,0x65,0x6c,0x64,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x6e,0x64,0x20,0x74, - 0x68,0x65,0x20,0x63,0x61,0x63,0x68,0x65,0x20,0x6f,0x66,0x20,0x63,0x6f,0x6d,0x70, - 0x6c,0x65,0x78,0x20,0x6b,0x65,0x79,0x73,0x2e,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x65,0x76,0x61,0x6c,0x75,0x61,0x74, - 0x69,0x6f,0x6e,0x5f,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20, - 0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68, - 0x65,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f, - 0x6e,0x2e,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x20,0x3d,0x20,0x73,0x65,0x74, - 0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x7d,0x2c,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78, - 0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66, - 0x2c,0x20,0x74,0x62,0x6c,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65, - 0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x74,0x62,0x6c,0x29,0x20, - 0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x5f,0x6e, - 0x65,0x77,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x74,0x62,0x6c,0x2c,0x20,0x6d,0x74, - 0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61, - 0x74,0x61,0x62,0x6c,0x65,0x28,0x74,0x62,0x6c,0x2c,0x20,0x6d,0x74,0x29,0x20,0x65, - 0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x29,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x3d,0x20,0x75,0x74, - 0x69,0x6c,0x2e,0x65,0x76,0x61,0x6c,0x5f,0x65,0x6e,0x76,0x2c,0x0a,0x7d,0x0a,0x2d, - 0x2d,0x20,0x74,0x6f,0x20,0x61,0x6c,0x6c,0x6f,0x77,0x73,0x20,0x74,0x6f,0x20,0x62, - 0x65,0x20,0x73,0x65,0x74,0x20,0x61,0x73,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62, - 0x6c,0x65,0x0a,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x65,0x76,0x61,0x6c, - 0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65, - 0x6e,0x74,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x70,0x72,0x6f, - 0x70,0x65,0x72,0x74,0x79,0x5f,0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e, - 0x5f,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x0a,0x0a,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x79,0x5f,0x67,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x54,0x4f,0x44,0x4f,0x20,0x42,0x55,0x47, - 0x20,0x45,0x43,0x4c,0x49,0x50,0x53,0x45,0x20,0x54,0x4f,0x4f,0x4c,0x53,0x4c,0x49, - 0x4e,0x55,0x58,0x2d,0x39,0x39,0x20,0x33,0x35,0x32,0x33,0x31,0x36,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x2c, - 0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x75, - 0x74,0x69,0x6c,0x2e,0x75,0x6e,0x62,0x36,0x34,0x28,0x61,0x72,0x67,0x73,0x2e,0x6e, - 0x29,0x3a,0x6d,0x61,0x74,0x63,0x68,0x28,0x22,0x5e,0x28,0x25,0x2d,0x3f,0x25,0x64, - 0x2b,0x29,0x7c,0x28,0x2e,0x2a,0x29,0x24,0x22,0x29,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62, - 0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x63,0x20,0x6f,0x72,0x20,0x63,0x78,0x74, - 0x5f,0x6e,0x75,0x6d,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x63,0x78,0x74,0x5f,0x69,0x64,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x2e,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5b,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d, - 0x5d,0x20,0x6f,0x72,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f,0x72,0x28, - 0x33,0x30,0x32,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20,0x63,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x3a,0x20,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x28,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x29,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x64,0x20,0x6f, - 0x72,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63, - 0x6f,0x72,0x6f,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74, - 0x69,0x6e,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x2e,0x6f, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x69,0x7a,0x65, - 0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73, - 0x2e,0x6d,0x20,0x6f,0x72,0x20,0x75,0x74,0x69,0x6c,0x2e,0x66,0x65,0x61,0x74,0x75, - 0x72,0x65,0x73,0x2e,0x6d,0x61,0x78,0x5f,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x73,0x69,0x7a,0x65,0x20,0x3c,0x20,0x30,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e, - 0x64,0x20,0x2d,0x2d,0x20,0x63,0x61,0x6c,0x6c,0x20,0x66,0x72,0x6f,0x6d,0x20,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x67,0x65,0x20,0x3d,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x70,0x20,0x6f, - 0x72,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63, - 0x78,0x74,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x63,0x6b,0x28, - 0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x68,0x75,0x6e,0x6b,0x20,0x3d,0x20,0x64, - 0x62,0x67,0x70,0x2e,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x32,0x30,0x36,0x2c,0x20, - 0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x61,0x64,0x69,0x6e,0x28,0x22,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x22,0x2e,0x2e,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x70,0x72,0x6f, - 0x70,0x65,0x72,0x74,0x79,0x5f,0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e, - 0x5f,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x29,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x20,0x3d,0x20, - 0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x32,0x2c,0x20,0x64,0x62,0x67,0x70,0x2e,0x61, - 0x73,0x73,0x65,0x72,0x74,0x28,0x33,0x30,0x30,0x2c,0x20,0x70,0x63,0x61,0x6c,0x6c, - 0x28,0x63,0x68,0x75,0x6e,0x6b,0x2c,0x20,0x63,0x78,0x74,0x5b,0x63,0x78,0x74,0x5f, - 0x69,0x64,0x5d,0x29,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72, - 0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x2c, - 0x20,0x70,0x72,0x6f,0x70,0x2c,0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x6e,0x61,0x6d, - 0x65,0x2c,0x20,0x75,0x74,0x69,0x6c,0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73, - 0x2e,0x6d,0x61,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x2c,0x20,0x75,0x74,0x69,0x6c, - 0x2e,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x2e,0x6d,0x61,0x78,0x5f,0x63,0x68, - 0x69,0x6c,0x64,0x72,0x65,0x6e,0x2c,0x20,0x70,0x61,0x67,0x65,0x2c,0x20,0x73,0x69, - 0x7a,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6d,0x61,0x6b,0x65,0x5f, - 0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x66,0x6c,0x61,0x67,0x20,0x73,0x70,0x65, - 0x63,0x69,0x61,0x6c,0x20,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x73,0x20,0x61, - 0x73,0x20,0x73,0x75,0x63,0x68,0x20,0x77,0x68,0x65,0x6e,0x20,0x74,0x68,0x65,0x79, - 0x20,0x61,0x72,0x65,0x20,0x61,0x74,0x20,0x72,0x6f,0x6f,0x74,0x20,0x6f,0x66,0x20, - 0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x73,0x70,0x65,0x63,0x69,0x61,0x6c,0x20,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65, - 0x73,0x20,0x71,0x75,0x65,0x72,0x69,0x65,0x73,0x20,0x61,0x72,0x65,0x20,0x69,0x6e, - 0x20,0x74,0x68,0x65,0x20,0x66,0x6f,0x72,0x6d,0x20,0x22,0x3c,0x70,0x72,0x6f,0x78, - 0x79,0x20,0x6e,0x61,0x6d,0x65,0x3e,0x5b,0x28,0x2e,0x2e,0x2e,0x29,0x5b,0x61,0x5d, - 0x5b,0x62,0x5d,0x3c,0x2e,0x2e,0x2e,0x3e,0x5d,0x22,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x73,0x75,0x63,0x68,0x20,0x70,0x61,0x72, - 0x73,0x69,0x6e,0x67,0x20,0x69,0x73,0x20,0x66,0x61,0x72,0x20,0x66,0x72,0x6f,0x6d, - 0x20,0x70,0x65,0x72,0x66,0x65,0x63,0x74,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6e,0x61,0x6d,0x65,0x3a,0x6d,0x61,0x74,0x63,0x68,0x28,0x22,0x5e,0x5b,0x25,0x77, - 0x5f,0x5d,0x2b,0x25,0x5b,0x2e,0x2d,0x25,0x62,0x5b,0x5d,0x25,0x5d,0x24,0x22,0x29, - 0x20,0x3d,0x3d,0x20,0x6e,0x61,0x6d,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65, - 0x73,0x70,0x6f,0x6e,0x73,0x65,0x2e,0x61,0x74,0x74,0x72,0x2e,0x74,0x79,0x70,0x65, - 0x20,0x3d,0x20,0x22,0x73,0x70,0x65,0x63,0x69,0x61,0x6c,0x22,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78, - 0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74, - 0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61, - 0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20, - 0x3d,0x20,0x22,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x67,0x65,0x74,0x22, - 0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64, - 0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x2c,0x20,0x63,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x7d,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73, - 0x70,0x6f,0x6e,0x73,0x65,0x20,0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72, - 0x74,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61, - 0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x61,0x72,0x67,0x73,0x2e,0x6d,0x20, - 0x3d,0x20,0x2d,0x31,0x0a,0x20,0x20,0x20,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65, - 0x72,0x74,0x79,0x5f,0x67,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72, - 0x67,0x73,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x73,0x65,0x74, - 0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x2c,0x20,0x64,0x61,0x74, - 0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x78,0x74, - 0x5f,0x6e,0x75,0x6d,0x2c,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x61,0x73,0x73, - 0x65,0x72,0x74,0x28,0x75,0x74,0x69,0x6c,0x2e,0x75,0x6e,0x62,0x36,0x34,0x28,0x61, - 0x72,0x67,0x73,0x2e,0x6e,0x29,0x3a,0x6d,0x61,0x74,0x63,0x68,0x28,0x22,0x5e,0x28, - 0x25,0x2d,0x3f,0x25,0x64,0x2b,0x29,0x7c,0x28,0x2e,0x2a,0x29,0x24,0x22,0x29,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x20,0x3d,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x63,0x20,0x6f, - 0x72,0x20,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x63,0x78,0x74,0x5f,0x69,0x64,0x20,0x3d,0x20,0x63,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x2e,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5b,0x63,0x78, - 0x74,0x5f,0x6e,0x75,0x6d,0x5d,0x20,0x6f,0x72,0x20,0x64,0x62,0x67,0x70,0x2e,0x65, - 0x72,0x72,0x6f,0x72,0x28,0x33,0x30,0x32,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75, - 0x63,0x68,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x3a,0x20,0x22,0x2e,0x2e,0x74, - 0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x63,0x78,0x74,0x5f,0x6e,0x75,0x6d,0x29, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x65,0x76,0x65, - 0x6c,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67, - 0x73,0x2e,0x64,0x20,0x6f,0x72,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61, - 0x72,0x67,0x73,0x2e,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x63,0x78,0x74,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x63, - 0x6b,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x65,0x20, - 0x74,0x68,0x65,0x20,0x6e,0x65,0x77,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x69,0x6e, - 0x20,0x74,0x68,0x65,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x76,0x61,0x6c, - 0x75,0x65,0x20,0x3d,0x20,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x32,0x2c,0x20,0x64, - 0x62,0x67,0x70,0x2e,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x32,0x30,0x36,0x2c,0x20, - 0x70,0x63,0x61,0x6c,0x6c,0x28,0x64,0x62,0x67,0x70,0x2e,0x61,0x73,0x73,0x65,0x72, - 0x74,0x28,0x32,0x30,0x36,0x2c,0x20,0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x61,0x64, - 0x69,0x6e,0x28,0x22,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x2e,0x2e,0x64,0x61, - 0x74,0x61,0x2c,0x20,0x63,0x78,0x74,0x29,0x29,0x29,0x29,0x29,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x68,0x75,0x6e,0x6b,0x20,0x3d,0x20, - 0x64,0x62,0x67,0x70,0x2e,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x32,0x30,0x36,0x2c, - 0x20,0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x61,0x64,0x69,0x6e,0x28,0x6e,0x61,0x6d, - 0x65,0x20,0x2e,0x2e,0x20,0x22,0x20,0x3d,0x20,0x76,0x61,0x6c,0x75,0x65,0x22,0x2c, - 0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20, - 0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x7d,0x2c, - 0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x5f,0x65,0x76,0x61,0x6c,0x75,0x61, - 0x74,0x69,0x6f,0x6e,0x5f,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74, - 0x29,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x61,0x73,0x73, - 0x65,0x72,0x74,0x28,0x32,0x30,0x36,0x2c,0x20,0x70,0x63,0x61,0x6c,0x6c,0x28,0x63, - 0x68,0x75,0x6e,0x6b,0x2c,0x20,0x63,0x78,0x74,0x5b,0x63,0x78,0x74,0x5f,0x69,0x64, - 0x5d,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e, - 0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20, - 0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73, - 0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x73,0x75,0x63, - 0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x31,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61, - 0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e, - 0x69,0x20,0x7d,0x20,0x7d,0x20,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x54, - 0x4f,0x44,0x4f,0x20,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x20,0x63,0x6f,0x64,0x65, - 0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x65, - 0x20,0x44,0x42,0x47,0x70,0x20,0x73,0x70,0x65,0x63,0x69,0x66,0x69,0x63,0x61,0x74, - 0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x65,0x61,0x72, - 0x20,0x61,0x62,0x6f,0x75,0x74,0x20,0x74,0x68,0x65,0x20,0x6c,0x69,0x6e,0x65,0x20, - 0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x6d,0x65,0x61,0x6e,0x69,0x6e,0x67,0x2c,0x20, - 0x74,0x68,0x69,0x73,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74, - 0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x31,0x2d,0x62,0x61,0x73,0x65,0x64,0x20,0x61, - 0x6e,0x64,0x20,0x6e,0x75,0x6d,0x62,0x65,0x72,0x73,0x20,0x61,0x72,0x65,0x20,0x69, - 0x6e,0x63,0x6c,0x75,0x73,0x69,0x76,0x65,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x73,0x6f,0x75,0x72,0x63,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c, - 0x20,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x70,0x61,0x74,0x68,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x72,0x67, - 0x73,0x2e,0x66,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d, - 0x2e,0x67,0x65,0x74,0x5f,0x70,0x61,0x74,0x68,0x28,0x61,0x72,0x67,0x73,0x2e,0x66, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x63, - 0x6f,0x72,0x6f,0x3a,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x30,0x2c,0x20,0x22, - 0x53,0x22,0x29,0x2e,0x73,0x6f,0x75,0x72,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x70,0x61,0x74,0x68,0x3a,0x73, - 0x75,0x62,0x28,0x31,0x2c,0x31,0x29,0x20,0x3d,0x3d,0x20,0x22,0x40,0x22,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70, - 0x61,0x74,0x68,0x3a,0x73,0x75,0x62,0x28,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x6c, - 0x65,0x2c,0x20,0x65,0x72,0x72,0x20,0x3d,0x20,0x69,0x6f,0x2e,0x6f,0x70,0x65,0x6e, - 0x28,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f, - 0x74,0x20,0x66,0x69,0x6c,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x62,0x67,0x70, - 0x2e,0x65,0x72,0x72,0x6f,0x72,0x28,0x31,0x30,0x30,0x2c,0x20,0x65,0x72,0x72,0x2c, - 0x20,0x7b,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x30,0x20,0x7d, - 0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x54,0x72,0x79, - 0x20,0x74,0x6f,0x20,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x79,0x20,0x63,0x6f,0x6d, - 0x70,0x69,0x6c,0x65,0x64,0x20,0x66,0x69,0x6c,0x65,0x73,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x66,0x69,0x6c,0x65,0x3a,0x72,0x65,0x61,0x64,0x28,0x31,0x29,0x20, - 0x3d,0x3d,0x20,0x22,0x5c,0x30,0x33,0x33,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x64, - 0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f,0x72,0x28,0x31,0x30,0x30,0x2c,0x20,0x61, - 0x72,0x67,0x73,0x2e,0x66,0x2e,0x2e,0x22,0x20,0x69,0x73,0x20,0x62,0x79,0x74,0x65, - 0x63,0x6f,0x64,0x65,0x22,0x2c,0x20,0x7b,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73, - 0x20,0x3d,0x20,0x30,0x20,0x7d,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x69,0x6c,0x65,0x3a,0x73,0x65,0x65,0x6b,0x28,0x22,0x73,0x65,0x74,0x22,0x2c, - 0x20,0x30,0x29,0x0a,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x73,0x72,0x63,0x6c,0x69,0x6e,0x65,0x73,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x65,0x67,0x69,0x6e,0x6c,0x69, - 0x6e,0x65,0x2c,0x20,0x65,0x6e,0x64,0x6c,0x69,0x6e,0x65,0x2c,0x20,0x63,0x75,0x72, - 0x72,0x65,0x6e,0x74,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e,0x62,0x20,0x6f,0x72,0x20,0x30,0x29, - 0x2c,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x61,0x72,0x67,0x73,0x2e, - 0x65,0x20,0x6f,0x72,0x20,0x6d,0x61,0x74,0x68,0x2e,0x68,0x75,0x67,0x65,0x29,0x2c, - 0x20,0x30,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6c,0x69,0x6e,0x65,0x20, - 0x69,0x6e,0x20,0x66,0x69,0x6c,0x65,0x3a,0x6c,0x69,0x6e,0x65,0x73,0x28,0x29,0x20, - 0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x75,0x72,0x72,0x65, - 0x6e,0x74,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74, - 0x6c,0x69,0x6e,0x65,0x20,0x2b,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x6c,0x69,0x6e,0x65,0x20, - 0x3e,0x3d,0x20,0x62,0x65,0x67,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x61,0x6e,0x64, - 0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x6c,0x69,0x6e,0x65,0x20,0x3c,0x3d,0x20, - 0x65,0x6e,0x64,0x6c,0x69,0x6e,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x72,0x63,0x6c,0x69,0x6e,0x65, - 0x73,0x5b,0x23,0x73,0x72,0x63,0x6c,0x69,0x6e,0x65,0x73,0x20,0x2b,0x20,0x31,0x5d, - 0x20,0x3d,0x20,0x6c,0x69,0x6e,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x6c,0x69, - 0x6e,0x65,0x20,0x3e,0x3d,0x20,0x65,0x6e,0x64,0x6c,0x69,0x6e,0x65,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x66,0x69,0x6c,0x65,0x3a,0x63,0x6c, - 0x6f,0x73,0x65,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x73,0x72,0x63,0x6c,0x69,0x6e, - 0x65,0x73,0x5b,0x23,0x73,0x72,0x63,0x6c,0x69,0x6e,0x65,0x73,0x20,0x2b,0x20,0x31, - 0x5d,0x20,0x3d,0x20,0x22,0x22,0x20,0x2d,0x2d,0x20,0x74,0x6f,0x20,0x61,0x64,0x64, - 0x20,0x61,0x20,0x74,0x72,0x61,0x69,0x6c,0x69,0x6e,0x67,0x20,0x5c,0x6e,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d, - 0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61, - 0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x74, - 0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d, - 0x20,0x22,0x73,0x6f,0x75,0x72,0x63,0x65,0x22,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73, - 0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73, - 0x2e,0x69,0x2c,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x31,0x7d, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x75,0x74,0x69,0x6c,0x2e,0x62,0x36,0x34,0x28,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63, - 0x6f,0x6e,0x63,0x61,0x74,0x28,0x73,0x72,0x63,0x6c,0x69,0x6e,0x65,0x73,0x2c,0x20, - 0x22,0x5c,0x6e,0x22,0x29,0x29,0x20,0x7d,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d, - 0x2d,0x20,0x46,0x61,0x63,0x74,0x6f,0x72,0x79,0x20,0x66,0x6f,0x72,0x20,0x62,0x6f, - 0x74,0x68,0x20,0x73,0x74,0x64,0x6f,0x75,0x74,0x20,0x61,0x6e,0x64,0x20,0x73,0x74, - 0x64,0x65,0x72,0x72,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x2c,0x20,0x63, - 0x68,0x61,0x6e,0x67,0x65,0x20,0x66,0x69,0x6c,0x65,0x20,0x64,0x65,0x73,0x63,0x72, - 0x69,0x70,0x74,0x6f,0x72,0x20,0x69,0x6e,0x20,0x69,0x6f,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75, - 0x74,0x5f,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x5f,0x68,0x61,0x6e,0x64,0x6c,0x65, - 0x72,0x5f,0x66,0x61,0x63,0x74,0x6f,0x72,0x79,0x28,0x6d,0x6f,0x64,0x65,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x72,0x67,0x73,0x2e, - 0x63,0x20,0x3d,0x3d,0x20,0x22,0x30,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d, - 0x20,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x6f,0x5b,0x6d,0x6f,0x64,0x65,0x5d,0x20,0x3d,0x20, - 0x69,0x6f,0x2e,0x62,0x61,0x73,0x65,0x5b,0x6d,0x6f,0x64,0x65,0x5d,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6f,0x5b,0x6d,0x6f,0x64,0x65,0x5d,0x20, - 0x3d,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b, - 0x20,0x73,0x6b,0x74,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c, - 0x20,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x6d,0x6f,0x64,0x65,0x20,0x7d,0x2c,0x20, - 0x61,0x72,0x67,0x73,0x2e,0x63,0x20,0x3d,0x3d,0x20,0x22,0x31,0x22,0x20,0x61,0x6e, - 0x64,0x20,0x63,0x6f,0x72,0x65,0x2e,0x63,0x6f,0x70,0x79,0x5f,0x6f,0x75,0x74,0x70, - 0x75,0x74,0x20,0x6f,0x72,0x20,0x63,0x6f,0x72,0x65,0x2e,0x72,0x65,0x64,0x69,0x72, - 0x65,0x63,0x74,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65, - 0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20, - 0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72, - 0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x6d, - 0x6f,0x64,0x65,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e, - 0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x2c,0x20,0x73,0x75, - 0x63,0x63,0x65,0x73,0x73,0x20,0x3d,0x20,0x22,0x31,0x22,0x20,0x7d,0x20,0x7d,0x20, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x4d, - 0x2e,0x73,0x74,0x64,0x6f,0x75,0x74,0x20,0x3d,0x20,0x6f,0x75,0x74,0x70,0x75,0x74, - 0x5f,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x5f,0x68,0x61,0x6e,0x64,0x6c,0x65,0x72, - 0x5f,0x66,0x61,0x63,0x74,0x6f,0x72,0x79,0x28,0x22,0x73,0x74,0x64,0x6f,0x75,0x74, - 0x22,0x29,0x0a,0x4d,0x2e,0x73,0x74,0x64,0x65,0x72,0x72,0x20,0x3d,0x20,0x6f,0x75, - 0x74,0x70,0x75,0x74,0x5f,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x5f,0x68,0x61,0x6e, - 0x64,0x6c,0x65,0x72,0x5f,0x66,0x61,0x63,0x74,0x6f,0x72,0x79,0x28,0x22,0x73,0x74, - 0x64,0x65,0x72,0x72,0x22,0x29,0x0a,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x4d,0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f, - 0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65, - 0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x22,0x5d,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30, - 0x31,0x31,0x2d,0x32,0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57, - 0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65, - 0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74, - 0x73,0x20,0x72,0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73, - 0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65, - 0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61, - 0x74,0x65,0x72,0x69,0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d, - 0x61,0x64,0x65,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e, - 0x64,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66, - 0x20,0x74,0x68,0x65,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62, - 0x6c,0x69,0x63,0x20,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30, - 0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70, - 0x61,0x6e,0x69,0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72, - 0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20, - 0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20, - 0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70, - 0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c, - 0x2d,0x76,0x31,0x30,0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x43,0x6f,0x6e,0x74,0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d, - 0x20,0x20,0x20,0x20,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65, - 0x6c,0x65,0x73,0x73,0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41, - 0x50,0x49,0x20,0x61,0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, - 0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x43,0x6f,0x6e,0x74,0x65,0x78, - 0x74,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x3a,0x20,0x61,0x6c,0x6c,0x6f, - 0x77,0x73,0x20,0x74,0x6f,0x20,0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x65,0x20,0x63, - 0x6f,0x64,0x65,0x20,0x73,0x6e,0x69,0x70,0x70,0x65,0x74,0x73,0x20,0x69,0x6e,0x20, - 0x74,0x68,0x65,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x6f,0x66,0x20,0x61, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x4d,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x64,0x62,0x67,0x70,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x64,0x62,0x67,0x70,0x22,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x75,0x74,0x69,0x6c,0x20,0x3d,0x20,0x72,0x65,0x71,0x75, - 0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x75,0x74, - 0x69,0x6c,0x22,0x0a,0x0a,0x2d,0x2d,0x20,0x6d,0x61,0x6b,0x65,0x20,0x75,0x6e,0x69, - 0x71,0x75,0x65,0x20,0x6f,0x62,0x6a,0x65,0x63,0x74,0x20,0x74,0x6f,0x20,0x61,0x63, - 0x63,0x65,0x73,0x73,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x73,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x4c,0x4f,0x43,0x41,0x4c,0x2c,0x20,0x55,0x50,0x56,0x41,0x4c, - 0x2c,0x20,0x47,0x4c,0x4f,0x42,0x41,0x4c,0x2c,0x20,0x45,0x56,0x41,0x4c,0x2c,0x20, - 0x53,0x54,0x4f,0x52,0x45,0x2c,0x20,0x48,0x41,0x4e,0x44,0x4c,0x45,0x20,0x3d,0x20, - 0x7b,0x7d,0x2c,0x20,0x7b,0x7d,0x2c,0x20,0x7b,0x7d,0x2c,0x20,0x7b,0x7d,0x2c,0x20, - 0x7b,0x7d,0x2c,0x20,0x7b,0x7d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x67,0x65, - 0x74,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x73,0x0a,0x69,0x66,0x20,0x5f,0x56,0x45,0x52, - 0x53,0x49,0x4f,0x4e,0x20,0x3d,0x3d,0x20,0x22,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31, - 0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x67,0x65,0x74,0x67,0x6c, - 0x6f,0x62,0x61,0x6c,0x73,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x66,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x66,0x65, - 0x6e,0x76,0x28,0x66,0x29,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6c,0x73,0x65,0x69,0x66, - 0x20,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d,0x3d,0x20,0x22,0x4c,0x75, - 0x61,0x20,0x35,0x2e,0x32,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x67,0x65,0x74,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x73,0x20,0x3d,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x66,0x2c,0x20,0x63,0x78,0x74,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x27,0x67,0x6c,0x6f,0x62,0x61,0x6c, - 0x27,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x3a,0x20,0x74, - 0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x65,0x69,0x74,0x68,0x65,0x72,0x20,0x74,0x68, - 0x65,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x5f,0x45,0x4e,0x56,0x20,0x6f,0x72,0x20, - 0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x20,0x5f,0x45,0x4e,0x56,0x2e,0x20,0x41,0x20, - 0x73,0x70,0x65,0x63,0x69,0x61,0x6c,0x20,0x63,0x61,0x73,0x65,0x20,0x68,0x61,0x70, - 0x70,0x65,0x6e,0x20,0x77,0x68,0x65,0x6e,0x20,0x61,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x64, - 0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63, - 0x65,0x20,0x61,0x6e,0x79,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x76,0x61,0x72, - 0x69,0x61,0x62,0x6c,0x65,0x3a,0x20,0x74,0x68,0x65,0x20,0x75,0x70,0x76,0x61,0x6c, - 0x75,0x65,0x20,0x5f,0x45,0x4e,0x56,0x20,0x6d,0x61,0x79,0x20,0x6e,0x6f,0x74,0x20, - 0x65,0x78,0x69,0x73,0x74,0x20,0x61,0x74,0x20,0x61,0x6c,0x6c,0x2e,0x20,0x49,0x6e, - 0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x61,0x73,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x65,0x6e, - 0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74, - 0x20,0x72,0x65,0x6c,0x65,0x76,0x61,0x6e,0x74,0x20,0x73,0x6f,0x20,0x69,0x74,0x20, - 0x69,0x73,0x20,0x66,0x69,0x78,0x65,0x64,0x20,0x74,0x6f,0x20,0x61,0x6e,0x20,0x65, - 0x6d,0x70,0x74,0x79,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x20,0x41,0x6e,0x6f,0x74, - 0x68,0x65,0x72,0x20,0x73,0x6f,0x6c,0x75,0x74,0x69,0x6f,0x6e,0x20,0x77,0x6f,0x75, - 0x6c,0x64,0x20,0x62,0x65,0x20,0x74,0x6f,0x20,0x73,0x65,0x74,0x20,0x69,0x74,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x6f,0x20,0x74,0x68, - 0x65,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x66,0x72, - 0x6f,0x6d,0x20,0x61,0x62,0x6f,0x76,0x65,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c, - 0x65,0x76,0x65,0x6c,0x20,0x62,0x75,0x74,0x20,0x69,0x74,0x20,0x77,0x6f,0x75,0x6c, - 0x64,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x73,0x6f,0x6d,0x65,0x20,0x6f, - 0x76,0x65,0x72,0x68,0x65,0x61,0x64,0x20,0x28,0x65,0x73,0x70,0x65,0x63,0x69,0x61, - 0x6c,0x6c,0x79,0x20,0x69,0x66,0x20,0x6d,0x75,0x6c,0x74,0x69,0x70,0x6c,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6c,0x65,0x76,0x65,0x6c, - 0x73,0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e, - 0x74,0x69,0x61,0x74,0x65,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x20,0x20,0x20,0x20,0x63,0x78,0x74,0x5b,0x4c,0x4f,0x43,0x41,0x4c, - 0x5d,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b,0x22,0x5f,0x45,0x4e,0x56,0x22,0x5d, - 0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x78,0x74, - 0x5b,0x4c,0x4f,0x43,0x41,0x4c,0x5d,0x5b,0x22,0x5f,0x45,0x4e,0x56,0x22,0x5d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x63, - 0x78,0x74,0x5b,0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d, - 0x5b,0x22,0x5f,0x45,0x4e,0x56,0x22,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x63,0x78,0x74,0x5b,0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b, - 0x22,0x5f,0x45,0x4e,0x56,0x22,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x7b,0x20,0x7d,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x20,0x43,0x61,0x70,0x74,0x75,0x72,0x65,0x73,0x20,0x76,0x61, - 0x72,0x69,0x61,0x62,0x6c,0x65,0x73,0x20,0x66,0x6f,0x72,0x20,0x67,0x69,0x76,0x65, - 0x6e,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2e,0x20,0x54, - 0x68,0x65,0x20,0x63,0x61,0x70,0x74,0x75,0x72,0x65,0x20,0x63,0x6f,0x6e,0x74,0x61, - 0x69,0x6e,0x73,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x2c,0x20,0x75,0x70,0x76,0x61,0x6c, - 0x75,0x65,0x73,0x20,0x61,0x6e,0x64,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x76, - 0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x65, - 0x20,0x63,0x61,0x70,0x74,0x75,0x72,0x65,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20, - 0x73,0x65,0x65,0x6e,0x20,0x61,0x73,0x20,0x61,0x20,0x70,0x72,0x6f,0x78,0x79,0x20, - 0x74,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x61, - 0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x3a,0x20,0x61,0x6e,0x79,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x71,0x75,0x65,0x72,0x69, - 0x65,0x64,0x20,0x6f,0x72,0x20,0x73,0x65,0x74,0x20,0x6e,0x6f,0x20,0x6d,0x61,0x74, - 0x74,0x65,0x72,0x0a,0x2d,0x2d,0x20,0x69,0x74,0x20,0x69,0x73,0x20,0x61,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x6f,0x72,0x20,0x61,0x6e,0x20,0x75,0x70,0x76,0x61,0x6c, - 0x75,0x65,0x2e,0x0a,0x2d,0x2d,0x20,0x54,0x68,0x65,0x20,0x69,0x6e,0x64,0x69,0x76, - 0x69,0x64,0x75,0x61,0x6c,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x6e,0x64,0x20, - 0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x73,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x20,0x61,0x72,0x65,0x20,0x61,0x6c,0x73,0x6f,0x20,0x61,0x76,0x61,0x69,0x6c,0x61, - 0x62,0x6c,0x65,0x20,0x61,0x6e,0x64,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x71, - 0x75,0x65,0x72,0x69,0x65,0x64,0x20,0x61,0x6e,0x64,0x20,0x6d,0x6f,0x64,0x69,0x66, - 0x69,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x69,0x6e,0x64,0x65,0x78,0x65,0x64, - 0x20,0x6e,0x6f,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x74,0x6f,0x6f,0x2e,0x0a,0x2d, - 0x2d,0x20,0x54,0x68,0x65,0x73,0x65,0x20,0x6f,0x62,0x6a,0x65,0x63,0x74,0x73,0x20, - 0x61,0x72,0x65,0x20,0x4e,0x4f,0x54,0x20,0x70,0x65,0x72,0x73,0x69,0x73,0x74,0x61, - 0x6e,0x74,0x20,0x61,0x6e,0x64,0x20,0x6d,0x75,0x73,0x74,0x20,0x6e,0x6f,0x74,0x20, - 0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x6f,0x75,0x74,0x73,0x69,0x64,0x65,0x20, - 0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6c,0x6f,0x6f, - 0x70,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x69, - 0x61,0x74,0x65,0x64,0x20,0x74,0x68,0x65,0x6d,0x20,0x21,0x0a,0x4d,0x2e,0x43,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x69,0x64,0x65,0x6e,0x74,0x69,0x66, - 0x69,0x65,0x72,0x73,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x61,0x63,0x63,0x65, - 0x73,0x73,0x65,0x64,0x20,0x62,0x79,0x20,0x74,0x68,0x65,0x69,0x72,0x20,0x44,0x42, - 0x47,0x70,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x49,0x44,0x0a,0x20,0x20, - 0x20,0x20,0x5b,0x30,0x5d,0x20,0x3d,0x20,0x4c,0x4f,0x43,0x41,0x4c,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x47,0x4c,0x4f,0x42,0x41,0x4c,0x2c, - 0x20,0x2d,0x2d,0x20,0x44,0x4c,0x54,0x4b,0x20,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61, - 0x6c,0x20,0x49,0x44,0x20,0x66,0x6f,0x72,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x73, - 0x20,0x69,0x73,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x5b,0x32,0x5d,0x20,0x3d,0x20, - 0x55,0x50,0x56,0x41,0x4c,0x2c,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x45,0x56, - 0x41,0x4c,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x6b,0x65, - 0x65,0x70,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x73,0x20,0x66,0x72,0x6f,0x6d,0x20, - 0x65,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x63,0x61,0x63,0x68,0x65,0x20,0x69,0x6e, - 0x20,0x6f,0x72,0x64,0x65,0x72,0x20,0x74,0x6f,0x20,0x62,0x72,0x6f,0x77,0x73,0x65, - 0x20,0x6f,0x72,0x20,0x6d,0x6f,0x64,0x69,0x66,0x79,0x20,0x74,0x68,0x65,0x6d,0x2c, - 0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x73,0x20,0x61,0x72,0x65,0x20,0x73,0x74,0x6f, - 0x72,0x65,0x64,0x20,0x61,0x73,0x20,0x73,0x65,0x71,0x75,0x65,0x6e,0x63,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x5b,0x2d,0x31,0x5d,0x20,0x3d,0x20,0x45,0x56,0x41,0x4c,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x53,0x54,0x4f,0x52,0x45,0x20,0x3d,0x20,0x53,0x54,0x4f, - 0x52,0x45,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65,0x74,0x73, - 0x20,0x61,0x20,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x20,0x62,0x79,0x20,0x6e, - 0x61,0x6d,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x63,0x6f,0x72,0x72,0x65,0x63,0x74, - 0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x20,0x6f,0x66,0x20,0x4c,0x75,0x61, - 0x20,0x73,0x63,0x6f,0x70,0x65,0x20,0x63,0x68,0x61,0x69,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x74,0x68,0x65,0x20,0x6f,0x72,0x20,0x63,0x68,0x61,0x69,0x6e, - 0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x77,0x6f,0x72,0x6b,0x20,0x68, - 0x65,0x72,0x65,0x20,0x62,0x65,0x61,0x63,0x61,0x75,0x73,0x65,0x20,0x5f,0x5f,0x69, - 0x6e,0x64,0x65,0x78,0x20,0x6d,0x65,0x74,0x61,0x6d,0x65,0x74,0x68,0x6f,0x64,0x20, - 0x77,0x6f,0x75,0x6c,0x64,0x20,0x72,0x61,0x69,0x73,0x65,0x20,0x61,0x6e,0x20,0x65, - 0x72,0x72,0x6f,0x72,0x20,0x69,0x6e,0x73,0x74,0x65,0x61,0x64,0x20,0x6f,0x66,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x69,0x6e,0x67,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20, - 0x20,0x20,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6b,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x20,0x20,0x20,0x20,0x73,0x65,0x6c, - 0x66,0x5b,0x4c,0x4f,0x43,0x41,0x4c,0x5d,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b, - 0x6b,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73, - 0x65,0x6c,0x66,0x5b,0x4c,0x4f,0x43,0x41,0x4c,0x5d,0x5b,0x6b,0x5d,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x73,0x65,0x6c, - 0x66,0x5b,0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b, - 0x6b,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73, - 0x65,0x6c,0x66,0x5b,0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b,0x6b,0x5d,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x73,0x65,0x6c,0x66,0x5b,0x47,0x4c,0x4f,0x42,0x41,0x4c,0x5d,0x5b,0x6b, - 0x5d,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x5f,0x5f,0x6e,0x65,0x77,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6b, - 0x2c,0x20,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x5b,0x4c,0x4f,0x43,0x41,0x4c,0x5d,0x5b, - 0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b,0x6b,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x73, - 0x65,0x6c,0x66,0x5b,0x4c,0x4f,0x43,0x41,0x4c,0x5d,0x5b,0x6b,0x5d,0x20,0x3d,0x20, - 0x76,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66, - 0x20,0x73,0x65,0x6c,0x66,0x5b,0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b,0x53,0x54,0x4f, - 0x52,0x45,0x5d,0x5b,0x6b,0x5d,0x20,0x74,0x68,0x65,0x6e,0x20,0x73,0x65,0x6c,0x66, - 0x5b,0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b,0x6b,0x5d,0x20,0x3d,0x20,0x76,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x20,0x73,0x65,0x6c,0x66, - 0x5b,0x47,0x4c,0x4f,0x42,0x41,0x4c,0x5d,0x5b,0x6b,0x5d,0x20,0x3d,0x20,0x76,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x6f,0x6e,0x6c,0x79,0x20, - 0x21,0x21,0x0a,0x20,0x20,0x20,0x20,0x5f,0x5f,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c, - 0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x62,0x75,0x66,0x20,0x3d,0x20,0x7b,0x20,0x22,0x4c,0x6f,0x63,0x61,0x6c,0x73, - 0x3a,0x20,0x5c,0x6e,0x22,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x66,0x6f,0x72,0x20,0x6b,0x2c,0x76,0x20,0x69,0x6e,0x20,0x70,0x61,0x69,0x72,0x73, - 0x28,0x73,0x65,0x6c,0x66,0x5b,0x4c,0x4f,0x43,0x41,0x4c,0x5d,0x5b,0x53,0x54,0x4f, - 0x52,0x45,0x5d,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x62,0x75,0x66,0x5b,0x23,0x62,0x75,0x66,0x2b,0x31,0x5d,0x20, - 0x3d,0x20,0x22,0x5c,0x74,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67, - 0x28,0x6b,0x29,0x2e,0x2e,0x22,0x28,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x28,0x76,0x29,0x2e,0x2e,0x22,0x29,0x3d,0x22,0x2e,0x2e,0x74,0x6f,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x28,0x73,0x65,0x6c,0x66,0x5b,0x4c,0x4f,0x43,0x41,0x4c, - 0x5d,0x5b,0x6b,0x5d,0x29,0x2e,0x2e,0x22,0x5c,0x6e,0x22,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x62,0x75,0x66,0x5b,0x23,0x62,0x75,0x66,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x22,0x55, - 0x70,0x76,0x61,0x6c,0x75,0x65,0x73,0x3a,0x20,0x5c,0x6e,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x76,0x20,0x69,0x6e,0x20, - 0x70,0x61,0x69,0x72,0x73,0x28,0x73,0x65,0x6c,0x66,0x5b,0x55,0x50,0x56,0x41,0x4c, - 0x5d,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x75,0x66,0x5b,0x23,0x62,0x75, - 0x66,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x22,0x5c,0x74,0x22,0x2e,0x2e,0x74,0x6f,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x28,0x6b,0x29,0x2e,0x2e,0x22,0x28,0x22,0x2e,0x2e,0x74, - 0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x29,0x2e,0x2e,0x22,0x29,0x3d,0x22, - 0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x73,0x65,0x6c,0x66,0x5b, - 0x55,0x50,0x56,0x41,0x4c,0x5d,0x5b,0x6b,0x5d,0x29,0x2e,0x2e,0x22,0x5c,0x6e,0x22, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x61,0x62,0x6c, - 0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28,0x62,0x75,0x66,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x4c,0x6f,0x63,0x61, - 0x6c,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6b,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x5b, - 0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b,0x6b,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6e,0x64, - 0x65,0x78,0x20,0x74,0x68,0x65,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x54, - 0x68,0x65,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x6b,0x29,0x2e,0x2e,0x22,0x20,0x64,0x6f,0x65,0x73,0x20, - 0x6e,0x6f,0x74,0x20,0x65,0x78,0x69,0x73,0x74,0x73,0x2e,0x22,0x29,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x20,0x3d,0x20,0x73,0x65,0x6c, - 0x66,0x5b,0x48,0x41,0x4e,0x44,0x4c,0x45,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c, - 0x65,0x63,0x74,0x28,0x32,0x2c,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x2e,0x63,0x6f, - 0x72,0x6f,0x3a,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x68,0x61,0x6e,0x64, - 0x6c,0x65,0x2e,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x69,0x6e,0x64,0x65,0x78,0x29, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x5f,0x6e,0x65,0x77,0x69,0x6e,0x64,0x65, - 0x78,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c, - 0x66,0x2c,0x20,0x6b,0x2c,0x20,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x64,0x65,0x78, - 0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b,0x6b, - 0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x5b, - 0x48,0x41,0x4e,0x44,0x4c,0x45,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x2e,0x63, - 0x6f,0x72,0x6f,0x3a,0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x68,0x61,0x6e, - 0x64,0x6c,0x65,0x2e,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x69,0x6e,0x64,0x65,0x78, - 0x2c,0x20,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x43,0x61,0x6e, - 0x6e,0x6f,0x74,0x20,0x73,0x65,0x74,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x22,0x20, - 0x2e,0x2e,0x20,0x6b,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x4c,0x75,0x61,0x20,0x35,0x2e,0x32,0x20,0x72,0x65,0x61,0x64,0x79,0x20, - 0x3a,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x5f,0x5f,0x70, - 0x61,0x69,0x72,0x73,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x73,0x65,0x6c,0x66,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74, - 0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x73,0x65,0x6c,0x66,0x29,0x2e, - 0x69,0x74,0x65,0x72,0x61,0x74,0x6f,0x72,0x2c,0x20,0x73,0x65,0x6c,0x66,0x2c,0x20, - 0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x74,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x70,0x72,0x65,0x76,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x6b,0x65,0x79,0x2c,0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20, - 0x6e,0x65,0x78,0x74,0x28,0x73,0x65,0x6c,0x66,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d, - 0x2c,0x20,0x70,0x72,0x65,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6b,0x65,0x79,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x65,0x79,0x2c,0x20,0x73,0x65,0x6c,0x66, - 0x5b,0x6b,0x65,0x79,0x5d,0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x2c,0x0a,0x0a,0x20, - 0x20,0x20,0x20,0x55,0x70,0x76,0x61,0x6c,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20, - 0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x5f,0x69,0x6e, - 0x64,0x65,0x78,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73, - 0x65,0x6c,0x66,0x2c,0x20,0x6b,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x64,0x65,0x78,0x20, - 0x3d,0x20,0x73,0x65,0x6c,0x66,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b,0x6b,0x5d, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6e,0x6f,0x74,0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x74,0x68,0x65,0x6e,0x20,0x65, - 0x72,0x72,0x6f,0x72,0x28,0x22,0x54,0x68,0x65,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x6b,0x29,0x2e,0x2e, - 0x22,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x65,0x78,0x69,0x74,0x73, - 0x74,0x73,0x2e,0x22,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c, - 0x65,0x63,0x74,0x28,0x32,0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74, - 0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x28,0x73,0x65,0x6c,0x66,0x5b,0x48,0x41,0x4e, - 0x44,0x4c,0x45,0x5d,0x2c,0x20,0x69,0x6e,0x64,0x65,0x78,0x29,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x5f,0x5f,0x6e,0x65,0x77,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6b, - 0x2c,0x20,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x73, - 0x65,0x6c,0x66,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x5b,0x6b,0x5d,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69,0x6e,0x64, - 0x65,0x78,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x73,0x65, - 0x74,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x28,0x73,0x65,0x6c,0x66,0x5b,0x48,0x41, - 0x4e,0x44,0x4c,0x45,0x5d,0x2c,0x20,0x69,0x6e,0x64,0x65,0x78,0x2c,0x20,0x76,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x43,0x61,0x6e,0x6e,0x6f,0x74,0x20, - 0x73,0x65,0x74,0x20,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x20,0x22,0x20,0x2e,0x2e, - 0x20,0x6b,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x4c,0x75,0x61,0x20,0x35,0x2e,0x32,0x20,0x72,0x65,0x61,0x64,0x79,0x20,0x3a,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x5f,0x5f,0x70,0x61, - 0x69,0x72,0x73,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73, - 0x65,0x6c,0x66,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x6d, - 0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x73,0x65,0x6c,0x66,0x29,0x2e,0x69, - 0x74,0x65,0x72,0x61,0x74,0x6f,0x72,0x2c,0x20,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6e, - 0x69,0x6c,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x74,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x70,0x72,0x65,0x76,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x6b,0x65,0x79,0x2c,0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x6e, - 0x65,0x78,0x74,0x28,0x73,0x65,0x6c,0x66,0x5b,0x53,0x54,0x4f,0x52,0x45,0x5d,0x2c, - 0x20,0x70,0x72,0x65,0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x6b,0x65,0x79,0x20,0x74,0x68,0x65,0x6e,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x65,0x79,0x2c,0x20,0x73,0x65,0x6c,0x66,0x5b, - 0x6b,0x65,0x79,0x5d,0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x2c,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x63,0x6f, - 0x6e,0x73,0x74,0x72,0x75,0x63,0x74,0x6f,0x72,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x63,0x6f,0x72,0x6f,0x20,0x20,0x28,0x75, - 0x74,0x69,0x6c,0x2e,0x2a,0x54,0x68,0x72,0x65,0x61,0x64,0x20,0x69,0x6e,0x73,0x74, - 0x61,0x6e,0x63,0x65,0x29,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20, - 0x74,0x6f,0x20,0x6d,0x61,0x70,0x20,0x74,0x6f,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x28,0x6e, - 0x75,0x6d,0x62,0x65,0x72,0x29,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76, - 0x65,0x6c,0x20,0x64,0x6f,0x20,0x64,0x75,0x6d,0x70,0x20,0x28,0x73,0x63,0x72,0x69, - 0x70,0x74,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6e,0x65,0x77,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x28,0x63,0x6c,0x73,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c,0x65, - 0x76,0x65,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x2c,0x20,0x75,0x70,0x76,0x61,0x6c, - 0x75,0x65,0x73,0x20,0x3d,0x20,0x7b,0x7d,0x2c,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3c,0x20, - 0x30,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f, - 0x72,0x28,0x33,0x30,0x31,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20, - 0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x3a,0x20,0x22,0x2e,0x2e, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x6c,0x65,0x76,0x65,0x6c,0x29,0x29, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x20,0x3d,0x20,0x28,0x63,0x6f,0x72,0x6f,0x3a, - 0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x22, - 0x66,0x22,0x29,0x20,0x6f,0x72,0x20,0x64,0x62,0x67,0x70,0x2e,0x65,0x72,0x72,0x6f, - 0x72,0x28,0x33,0x30,0x31,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20, - 0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x3a,0x20,0x22,0x2e,0x2e, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x6c,0x65,0x76,0x65,0x6c,0x29,0x29, - 0x29,0x2e,0x66,0x75,0x6e,0x63,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x76,0x61,0x72,0x69,0x61,0x62,0x6c, - 0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69, - 0x3d,0x31,0x2c,0x20,0x6d,0x61,0x74,0x68,0x2e,0x68,0x75,0x67,0x65,0x20,0x64,0x6f, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x20,0x3d,0x20,0x63, - 0x6f,0x72,0x6f,0x3a,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x6c,0x65,0x76, - 0x65,0x6c,0x2c,0x20,0x69,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x6e,0x61,0x6d,0x65,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x6e,0x61,0x6d, - 0x65,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29,0x20,0x7e,0x3d,0x20,0x22,0x28, - 0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x73,0x6b,0x69,0x70,0x20,0x69, - 0x6e,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x73,0x5b,0x6e,0x61,0x6d,0x65,0x5d,0x20,0x3d,0x20,0x69,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x73, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x31, - 0x2c,0x20,0x6d,0x61,0x74,0x68,0x2e,0x68,0x75,0x67,0x65,0x20,0x64,0x6f,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x20,0x3d,0x20,0x64,0x65,0x62, - 0x75,0x67,0x2e,0x67,0x65,0x74,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x28,0x66,0x75, - 0x6e,0x63,0x2c,0x20,0x69,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x6e,0x61,0x6d,0x65,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x75,0x70,0x76,0x61,0x6c,0x75, - 0x65,0x73,0x5b,0x6e,0x61,0x6d,0x65,0x5d,0x20,0x3d,0x20,0x69,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x20,0x3d,0x20,0x73,0x65,0x74,0x6d,0x65, - 0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x5b,0x53,0x54,0x4f,0x52,0x45, - 0x5d,0x20,0x3d,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x2c,0x20,0x5b,0x48,0x41,0x4e, - 0x44,0x4c,0x45,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d, - 0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x63, - 0x6f,0x72,0x6f,0x20,0x7d,0x20,0x7d,0x2c,0x20,0x63,0x6c,0x73,0x2e,0x4c,0x6f,0x63, - 0x61,0x6c,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x73,0x20,0x3d,0x20,0x73,0x65, - 0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x5b,0x53,0x54, - 0x4f,0x52,0x45,0x5d,0x20,0x3d,0x20,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x73,0x2c, - 0x20,0x5b,0x48,0x41,0x4e,0x44,0x4c,0x45,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x20,0x7d,0x2c,0x20,0x63,0x6c,0x73,0x2e,0x55,0x70,0x76,0x61,0x6c,0x43,0x6f,0x6e, - 0x74,0x65,0x78,0x74,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x73,0x65, - 0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x5b,0x4c,0x4f, - 0x43,0x41,0x4c,0x5d,0x20,0x3d,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x73,0x2c,0x20,0x5b, - 0x55,0x50,0x56,0x41,0x4c,0x5d,0x20,0x3d,0x20,0x75,0x70,0x76,0x61,0x6c,0x75,0x65, - 0x73,0x2c,0x20,0x5b,0x45,0x56,0x41,0x4c,0x5d,0x20,0x3d,0x20,0x7b,0x7d,0x20,0x7d, - 0x2c,0x20,0x63,0x6c,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x61,0x77,0x73,0x65,0x74,0x28,0x72,0x65,0x73,0x75,0x6c,0x74,0x2c,0x20,0x47,0x4c, - 0x4f,0x42,0x41,0x4c,0x2c,0x20,0x67,0x65,0x74,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x73, - 0x28,0x66,0x75,0x6e,0x63,0x2c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x29,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72, - 0x65,0x73,0x75,0x6c,0x74,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d, - 0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x48,0x61,0x6e,0x64,0x6c,0x65,0x20,0x63,0x61,0x63, - 0x68,0x69,0x6e,0x67,0x20,0x6f,0x66,0x20,0x61,0x6c,0x6c,0x20,0x69,0x6e,0x73,0x74, - 0x61,0x6e,0x74,0x69,0x61,0x74,0x65,0x64,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x2e,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x61,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x74,0x61, - 0x6b,0x65,0x73,0x20,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x73, - 0x3a,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x61,0x6e,0x64,0x20,0x73,0x74,0x61, - 0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x73,0x20,0x74,0x68,0x65,0x20,0x63,0x6f,0x72,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x64,0x69,0x6e,0x67,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x2e,0x20, - 0x49,0x66,0x20,0x74,0x68,0x69,0x73,0x0a,0x2d,0x2d,0x20,0x63,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x20,0x68,0x61,0x73,0x20,0x62,0x65,0x65,0x6e,0x20,0x61,0x6c,0x72,0x65, - 0x61,0x64,0x79,0x20,0x71,0x75,0x65,0x72,0x69,0x65,0x64,0x20,0x74,0x68,0x65,0x72, - 0x65,0x20,0x69,0x73,0x20,0x6e,0x6f,0x20,0x6e,0x65,0x77,0x20,0x69,0x6e,0x73,0x74, - 0x61,0x6e,0x74,0x69,0x61,0x74,0x69,0x6f,0x6e,0x2e,0x20,0x41,0x20,0x43,0x6f,0x6e, - 0x74,0x65,0x78,0x74,0x4d,0x61,0x6e,0x61,0x67,0x65,0x72,0x20,0x69,0x73,0x20,0x76, - 0x61,0x6c,0x69,0x64,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x64,0x75,0x72,0x69,0x6e,0x67, - 0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x6c,0x6f,0x6f,0x70,0x0a, - 0x2d,0x2d,0x20,0x6f,0x6e,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x69,0x74,0x20,0x68, - 0x61,0x73,0x20,0x62,0x65,0x65,0x6e,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x74,0x69, - 0x61,0x74,0x65,0x64,0x2e,0x20,0x52,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73, - 0x20,0x74,0x6f,0x20,0x61,0x20,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x4d,0x61,0x6e, - 0x61,0x67,0x65,0x72,0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x6c,0x6f,0x73, - 0x74,0x20,0x61,0x66,0x74,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x65,0x6e,0x64,0x20, - 0x6f,0x66,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x6c,0x6f,0x6f,0x70,0x20,0x28,0x73, - 0x6f,0x0a,0x2d,0x2d,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x73,0x20,0x63,0x61,0x6e, - 0x20,0x62,0x65,0x20,0x63,0x6f,0x6c,0x6c,0x65,0x63,0x74,0x65,0x64,0x29,0x2e,0x0a, - 0x2d,0x2d,0x20,0x49,0x66,0x20,0x61,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20, - 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e, - 0x74,0x69,0x61,0x74,0x65,0x64,0x2c,0x20,0x61,0x6e,0x20,0x33,0x30,0x31,0x20,0x44, - 0x42,0x47,0x50,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x69,0x73,0x20,0x74,0x68,0x72, - 0x6f,0x77,0x6e,0x2e,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e, - 0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x4d,0x61,0x6e,0x61,0x67,0x65,0x72,0x28,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x61,0x63,0x68,0x65, - 0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x74,0x68,0x72,0x65,0x61, - 0x64,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65,0x20,0x72,0x65,0x61,0x6c,0x20,0x63,0x6f, - 0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20, - 0x61,0x73,0x20,0x6b,0x65,0x79,0x20,0x28,0x6e,0x6f,0x74,0x20,0x74,0x68,0x65,0x20, - 0x77,0x72,0x61,0x70,0x70,0x65,0x64,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65, - 0x20,0x61,0x73,0x20,0x69,0x74,0x73,0x20,0x75,0x6e,0x69,0x63,0x69,0x74,0x79,0x20, - 0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x67,0x75,0x61,0x72,0x61,0x6e,0x74,0x65,0x65, - 0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6f,0x74, - 0x68,0x65,0x72,0x77,0x69,0x73,0x65,0x2c,0x20,0x74,0x72,0x75,0x65,0x20,0x69,0x73, - 0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x69,0x64,0x65,0x6e,0x74,0x69,0x66, - 0x79,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64, - 0x20,0x28,0x61,0x73,0x20,0x6e,0x69,0x6c,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x61,0x20,0x76,0x61,0x6c,0x69,0x64,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x6b,0x65, - 0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x6b,0x65,0x79,0x20,0x3d,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x5b,0x31,0x5d, - 0x20,0x6f,0x72,0x20,0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x63,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x73,0x20,0x3d,0x20,0x63,0x61,0x63,0x68,0x65,0x5b,0x6b, - 0x65,0x79,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e, - 0x6f,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78, - 0x74,0x73,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x63,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x73,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x61,0x63,0x68,0x65,0x5b,0x6b,0x65,0x79,0x5d, - 0x20,0x3d,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78, - 0x74,0x73,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x20,0x3d,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x63, - 0x6f,0x6e,0x74,0x65,0x78,0x74,0x73,0x5b,0x6c,0x65,0x76,0x65,0x6c,0x5d,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x63,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x3d, - 0x20,0x4d,0x2e,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x3a,0x6e,0x65,0x77,0x28,0x74, - 0x68,0x72,0x65,0x61,0x64,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64, - 0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x73,0x5b,0x6c,0x65,0x76,0x65,0x6c,0x5d, - 0x20,0x3d,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x4d,0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e, - 0x64,0x20,0x6f,0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x2e,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d, - 0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x64,0x62,0x67,0x70,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e, - 0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x2e,0x64,0x62,0x67,0x70,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79, - 0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32, - 0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c, - 0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a, - 0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65, - 0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f, - 0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63, - 0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20, - 0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20, - 0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65, - 0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20, - 0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20, - 0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65, - 0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74, - 0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69, - 0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70, - 0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f, - 0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30, - 0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74, - 0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20, - 0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73, - 0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61, - 0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f, - 0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x44,0x42,0x47,0x70,0x20,0x70,0x72,0x6f,0x74,0x6f,0x63, - 0x6f,0x6c,0x20,0x75,0x74,0x69,0x6c,0x69,0x74,0x79,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x28,0x70,0x61,0x72,0x73,0x69,0x6e,0x67,0x2c,0x20,0x65,0x72, - 0x72,0x6f,0x72,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x2c,0x20,0x58,0x4d, - 0x4c,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x29,0x2e,0x0a,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x74,0x69,0x6c,0x20,0x3d,0x20,0x72,0x65,0x71, - 0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x75, - 0x74,0x69,0x6c,0x22,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x72,0x72,0x6f, - 0x72,0x2c,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x2c, - 0x20,0x74,0x79,0x70,0x65,0x2c,0x20,0x70,0x61,0x69,0x72,0x73,0x2c,0x20,0x69,0x70, - 0x61,0x69,0x72,0x73,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20, - 0x74,0x63,0x6f,0x6e,0x63,0x61,0x74,0x20,0x3d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x72,0x72,0x6f,0x72,0x2c,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61, - 0x62,0x6c,0x65,0x2c,0x20,0x74,0x79,0x70,0x65,0x2c,0x20,0x70,0x61,0x69,0x72,0x73, - 0x2c,0x20,0x69,0x70,0x61,0x69,0x72,0x73,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2c,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74, - 0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4d,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x20,0x50,0x61,0x72,0x73,0x65,0x73,0x20,0x74,0x68,0x65,0x20, - 0x44,0x42,0x47,0x70,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x61,0x72,0x67, - 0x75,0x6d,0x65,0x6e,0x74,0x73,0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x73,0x20,0x69,0x74,0x20,0x61,0x73,0x20,0x61,0x20,0x4c,0x75,0x61,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x6b,0x65,0x79,0x2f,0x76,0x61, - 0x6c,0x75,0x65,0x20,0x70,0x61,0x69,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x46,0x6f, - 0x72,0x20,0x65,0x78,0x61,0x6d,0x70,0x6c,0x65,0x2c,0x20,0x74,0x68,0x65,0x20,0x73, - 0x65,0x71,0x75,0x65,0x6e,0x63,0x65,0x20,0x3c,0x63,0x6f,0x64,0x65,0x3e,0x2d,0x69, - 0x20,0x35,0x20,0x2d,0x6a,0x20,0x66,0x6f,0x6f,0x3c,0x2f,0x63,0x6f,0x64,0x65,0x3e, - 0x20,0x77,0x69,0x6c,0x6c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x69,0x6e,0x20, - 0x3c,0x63,0x6f,0x64,0x65,0x3e,0x7b,0x69,0x3d,0x35,0x2c,0x20,0x6a,0x3d,0x66,0x6f, - 0x6f,0x7d,0x3c,0x2f,0x63,0x6f,0x64,0x65,0x3e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61, - 0x72,0x61,0x6d,0x20,0x63,0x6d,0x64,0x5f,0x61,0x72,0x67,0x73,0x20,0x28,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x29,0x20,0x73,0x65,0x71,0x75,0x65,0x6e,0x63,0x65,0x20,0x6f, - 0x66,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x0a,0x2d,0x2d,0x20,0x40, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x64,0x65,0x73, - 0x63,0x72,0x69,0x62,0x65,0x64,0x20,0x61,0x62,0x6f,0x76,0x65,0x0a,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x61,0x72,0x67,0x5f,0x70,0x61,0x72,0x73, - 0x65,0x28,0x63,0x6d,0x64,0x5f,0x61,0x72,0x67,0x73,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x72,0x67,0x73,0x20,0x3d,0x20,0x7b,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x61,0x72,0x67,0x2c,0x20,0x76,0x61,0x6c, - 0x20,0x69,0x6e,0x20,0x63,0x6d,0x64,0x5f,0x61,0x72,0x67,0x73,0x3a,0x67,0x6d,0x61, - 0x74,0x63,0x68,0x28,0x22,0x25,0x2d,0x28,0x25,0x77,0x29,0x20,0x28,0x25,0x53,0x2b, - 0x29,0x22,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61, - 0x72,0x67,0x73,0x5b,0x61,0x72,0x67,0x5d,0x20,0x3d,0x20,0x76,0x61,0x6c,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x61,0x72,0x67,0x73,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x20, - 0x50,0x61,0x72,0x73,0x65,0x73,0x20,0x61,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x20,0x6c,0x69,0x6e,0x65,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x65,0x20,0x6e,0x61,0x6d,0x65,0x20,0x28, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x72, - 0x75,0x6e,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x20,0x28,0x74,0x61, - 0x62,0x6c,0x65,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x64,0x61,0x74,0x61,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x6f,0x70, - 0x74,0x69,0x6f,0x6e,0x61,0x6c,0x29,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x4d,0x2e,0x63,0x6d,0x64,0x5f,0x70,0x61,0x72,0x73,0x65,0x28,0x63,0x6d,0x64, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6d,0x64,0x5f, - 0x6e,0x61,0x6d,0x65,0x2c,0x20,0x61,0x72,0x67,0x73,0x2c,0x20,0x64,0x61,0x74,0x61, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x6d,0x64,0x3a,0x66,0x69,0x6e,0x64, - 0x28,0x22,0x2d,0x2d,0x22,0x2c,0x20,0x31,0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65,0x72,0x65,0x20,0x69,0x73, - 0x20,0x61,0x20,0x64,0x61,0x74,0x61,0x20,0x70,0x61,0x72,0x74,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x63,0x6d,0x64,0x5f,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x61, - 0x72,0x67,0x73,0x2c,0x20,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x63,0x6d,0x64,0x3a, - 0x6d,0x61,0x74,0x63,0x68,0x28,0x22,0x5e,0x28,0x25,0x53,0x2b,0x29,0x25,0x73,0x2b, - 0x28,0x2e,0x2a,0x29,0x25,0x73,0x2b,0x25,0x2d,0x25,0x2d,0x25,0x73,0x2a,0x28,0x2e, - 0x2a,0x29,0x24,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x61, - 0x74,0x61,0x20,0x3d,0x20,0x75,0x74,0x69,0x6c,0x2e,0x75,0x6e,0x62,0x36,0x34,0x28, - 0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6d,0x64,0x5f,0x6e,0x61,0x6d,0x65,0x2c, - 0x20,0x61,0x72,0x67,0x73,0x20,0x3d,0x20,0x63,0x6d,0x64,0x3a,0x6d,0x61,0x74,0x63, - 0x68,0x28,0x22,0x5e,0x28,0x25,0x53,0x2b,0x29,0x25,0x73,0x2b,0x28,0x2e,0x2a,0x29, - 0x24,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6d,0x64,0x5f,0x6e,0x61,0x6d,0x65,0x2c, - 0x20,0x4d,0x2e,0x61,0x72,0x67,0x5f,0x70,0x61,0x72,0x73,0x65,0x28,0x61,0x72,0x67, - 0x73,0x29,0x2c,0x20,0x64,0x61,0x74,0x61,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x74,0x68,0x65,0x20,0x70,0x61, - 0x63,0x6b,0x65,0x74,0x20,0x72,0x65,0x61,0x64,0x20,0x66,0x72,0x6f,0x6d,0x20,0x73, - 0x6f,0x63,0x6b,0x65,0x74,0x2c,0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x20,0x66,0x6f, - 0x6c,0x6c,0x6f,0x77,0x65,0x64,0x20,0x62,0x79,0x20,0x61,0x6e,0x20,0x65,0x72,0x72, - 0x6f,0x72,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x20,0x6f,0x6e,0x20,0x65,0x72, - 0x72,0x6f,0x72,0x73,0x2e,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d, - 0x2e,0x72,0x65,0x61,0x64,0x5f,0x70,0x61,0x63,0x6b,0x65,0x74,0x28,0x73,0x6b,0x74, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x69,0x7a,0x65, - 0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20, - 0x74,0x72,0x75,0x65,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x79,0x74,0x65,0x2c,0x20,0x65,0x72,0x72,0x20, - 0x3d,0x20,0x73,0x6b,0x74,0x3a,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x28,0x31,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x62,0x79,0x74,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x6e,0x69,0x6c,0x2c,0x20,0x65,0x72,0x72,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x62,0x79,0x74,0x65,0x20,0x3d,0x3d, - 0x20,0x22,0x5c,0x30,0x30,0x30,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72,0x65, - 0x61,0x6b,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73, - 0x69,0x7a,0x65,0x5b,0x23,0x73,0x69,0x7a,0x65,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x62, - 0x79,0x74,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28,0x73, - 0x69,0x7a,0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x4d,0x2e,0x44,0x42,0x47,0x50, - 0x5f,0x45,0x52,0x52,0x5f,0x4d,0x45,0x54,0x41,0x54,0x41,0x42,0x4c,0x45,0x20,0x3d, - 0x20,0x7b,0x7d,0x20,0x2d,0x2d,0x20,0x75,0x6e,0x69,0x71,0x75,0x65,0x20,0x6f,0x62, - 0x6a,0x65,0x63,0x74,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x69,0x64,0x65, - 0x6e,0x74,0x69,0x66,0x79,0x20,0x44,0x42,0x47,0x70,0x20,0x65,0x72,0x72,0x6f,0x72, - 0x73,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x54,0x68,0x72,0x6f,0x77,0x73,0x20,0x61,0x20, - 0x63,0x6f,0x72,0x72,0x65,0x63,0x74,0x20,0x44,0x42,0x47,0x70,0x20,0x65,0x72,0x72, - 0x6f,0x72,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20, - 0x69,0x6e,0x20,0x61,0x20,0x66,0x69,0x6e,0x65,0x20,0x74,0x75,0x6e,0x65,0x64,0x20, - 0x65,0x72,0x72,0x6f,0x72,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x20,0x74,0x6f, - 0x20,0x74,0x68,0x65,0x20,0x73,0x65,0x72,0x76,0x65,0x72,0x2e,0x0a,0x2d,0x2d,0x20, - 0x49,0x74,0x20,0x69,0x73,0x20,0x69,0x6e,0x74,0x65,0x6e,0x64,0x65,0x64,0x20,0x74, - 0x6f,0x20,0x62,0x65,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64,0x20,0x69,0x6e,0x74,0x6f, - 0x20,0x61,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x74,0x6f,0x20,0x6d,0x61, - 0x6b,0x65,0x20,0x61,0x20,0x75,0x73,0x65,0x66,0x75,0x6c,0x20,0x65,0x72,0x72,0x6f, - 0x72,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x2c,0x20,0x61,0x20,0x73,0x74,0x61, - 0x6e,0x64,0x61,0x72,0x64,0x20,0x4c,0x75,0x61,0x20,0x65,0x72,0x72,0x6f,0x72,0x0a, - 0x2d,0x2d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x69,0x6e,0x20,0x61,0x20,0x63, - 0x6f,0x64,0x65,0x20,0x39,0x39,0x38,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x28,0x69, - 0x6e,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x29,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x63,0x6f,0x64,0x65,0x20,0x6e,0x75,0x6d,0x65,0x72,0x69,0x63,0x61, - 0x6c,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x63,0x6f,0x64,0x65,0x0a,0x2d,0x2d,0x20, - 0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x20,0x6d, - 0x65,0x73,0x73,0x61,0x67,0x65,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x28,0x6f, - 0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x61,0x74,0x74,0x72,0x20,0x65,0x78,0x74,0x72,0x61,0x20,0x61,0x74, - 0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x73,0x20,0x74,0x6f,0x20,0x61,0x64,0x64,0x20, - 0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x20, - 0x74,0x61,0x67,0x20,0x28,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x29,0x0a,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x65,0x72,0x72,0x6f,0x72,0x28, - 0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x2c,0x20,0x61, - 0x74,0x74,0x72,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x73, - 0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x63,0x6f, - 0x64,0x65,0x20,0x3d,0x20,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x65,0x73,0x73,0x61, - 0x67,0x65,0x20,0x3d,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x2c,0x20,0x61,0x74, - 0x74,0x72,0x20,0x3d,0x20,0x61,0x74,0x74,0x72,0x20,0x6f,0x72,0x20,0x7b,0x7d,0x20, - 0x7d,0x2c,0x20,0x4d,0x2e,0x44,0x42,0x47,0x50,0x5f,0x45,0x52,0x52,0x5f,0x4d,0x45, - 0x54,0x41,0x54,0x41,0x42,0x4c,0x45,0x29,0x2c,0x20,0x32,0x29,0x0a,0x65,0x6e,0x64, - 0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x4c,0x69,0x6b,0x65,0x20,0x63,0x6f,0x72,0x65,0x20, - 0x61,0x73,0x73,0x65,0x72,0x74,0x20,0x62,0x75,0x74,0x20,0x74,0x68,0x72,0x6f,0x77, - 0x73,0x20,0x61,0x20,0x44,0x42,0x47,0x70,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x69, - 0x66,0x20,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x6e, - 0x6f,0x74,0x20,0x6d,0x65,0x74,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61, - 0x6d,0x20,0x63,0x6f,0x64,0x65,0x20,0x6e,0x75,0x6d,0x65,0x72,0x69,0x63,0x61,0x6c, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x63,0x6f,0x64,0x65,0x20,0x74,0x68,0x72,0x6f, - 0x77,0x6e,0x20,0x69,0x66,0x20,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20, - 0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x6d,0x65,0x74,0x2e,0x0a,0x2d,0x2d,0x20,0x40, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x20,0x63,0x6f, - 0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x74,0x6f,0x20,0x74,0x65,0x73,0x74,0x0a, - 0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x2e,0x2e,0x2e,0x20,0x77,0x69, - 0x6c,0x6c,0x20,0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x61,0x73,0x20,0x65,0x72, - 0x72,0x6f,0x72,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x20,0x69,0x66,0x20,0x74, - 0x65,0x73,0x74,0x20,0x66,0x61,0x69,0x6c,0x73,0x2e,0x0a,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x63,0x6f,0x64, - 0x65,0x2c,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x2c,0x20,0x2e,0x2e,0x2e,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x63,0x63, - 0x65,0x73,0x73,0x20,0x74,0x68,0x65,0x6e,0x20,0x4d,0x2e,0x65,0x72,0x72,0x6f,0x72, - 0x28,0x63,0x6f,0x64,0x65,0x2c,0x20,0x28,0x2e,0x2e,0x2e,0x29,0x29,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x75,0x63, - 0x63,0x65,0x73,0x73,0x2c,0x20,0x2e,0x2e,0x2e,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d, - 0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x4f,0x75,0x74,0x67,0x6f,0x69,0x6e,0x67,0x20, - 0x64,0x61,0x74,0x61,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x78,0x6d,0x6c,0x61,0x74,0x74,0x72,0x5f,0x73,0x70,0x65,0x63,0x69,0x61,0x6c,0x63, - 0x68,0x61,0x72,0x73,0x20,0x3d,0x20,0x7b,0x20,0x5b,0x27,0x22,0x27,0x5d,0x20,0x3d, - 0x20,0x22,0x26,0x71,0x75,0x6f,0x74,0x3b,0x22,0x2c,0x20,0x5b,0x22,0x3c,0x22,0x5d, - 0x20,0x3d,0x20,0x22,0x26,0x6c,0x74,0x3b,0x22,0x2c,0x20,0x5b,0x22,0x26,0x22,0x5d, - 0x20,0x3d,0x20,0x22,0x26,0x61,0x6d,0x70,0x3b,0x22,0x20,0x7d,0x0a,0x2d,0x2d,0x2d, - 0x20,0x56,0x65,0x72,0x79,0x20,0x62,0x61,0x73,0x69,0x63,0x20,0x58,0x4d,0x4c,0x20, - 0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x0a,0x2d,0x2d,0x20,0x47,0x65,0x6e, - 0x65,0x72,0x61,0x74,0x65,0x73,0x20,0x61,0x20,0x58,0x4d,0x4c,0x20,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x20,0x66,0x72,0x6f,0x6d,0x20,0x61,0x20,0x4c,0x75,0x61,0x20,0x4f, - 0x62,0x6a,0x65,0x63,0x74,0x20,0x4d,0x6f,0x64,0x65,0x6c,0x20,0x28,0x4c,0x4f,0x4d, - 0x29,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x0a,0x2d,0x2d,0x20,0x53,0x65,0x65,0x20, - 0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x6d,0x61,0x74,0x74,0x68,0x65,0x77,0x77,0x69, - 0x6c,0x64,0x2e,0x63,0x6f,0x2e,0x75,0x6b,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74, - 0x73,0x2f,0x6c,0x75,0x61,0x65,0x78,0x70,0x61,0x74,0x2f,0x6c,0x6f,0x6d,0x2e,0x68, - 0x74,0x6d,0x6c,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x6c, - 0x6f,0x6d,0x32,0x73,0x74,0x72,0x28,0x78,0x6d,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x69,0x65,0x63,0x65,0x73,0x20,0x3d,0x20,0x7b, - 0x20,0x7d,0x20,0x2d,0x2d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x62,0x75,0x66, - 0x66,0x65,0x72,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65, - 0x28,0x6e,0x6f,0x64,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70, - 0x69,0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63,0x65,0x73,0x20,0x2b,0x20, - 0x31,0x5d,0x20,0x3d,0x20,0x22,0x3c,0x22,0x2e,0x2e,0x6e,0x6f,0x64,0x65,0x2e,0x74, - 0x61,0x67,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x69,0x65,0x63,0x65, - 0x73,0x5b,0x23,0x70,0x69,0x65,0x63,0x65,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d, - 0x20,0x22,0x20,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x6f,0x72,0x64,0x65,0x72,0x69, - 0x6e,0x67,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x68,0x6f,0x6e,0x6f,0x72,0x65, - 0x64,0x20,0x68,0x65,0x72,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, - 0x6f,0x72,0x20,0x61,0x74,0x74,0x72,0x2c,0x20,0x76,0x61,0x6c,0x20,0x69,0x6e,0x20, - 0x70,0x61,0x69,0x72,0x73,0x28,0x6e,0x6f,0x64,0x65,0x2e,0x61,0x74,0x74,0x72,0x20, - 0x6f,0x72,0x20,0x7b,0x7d,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x74,0x79,0x70,0x65,0x28,0x61,0x74, - 0x74,0x72,0x29,0x20,0x3d,0x3d,0x20,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x70,0x69,0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65, - 0x63,0x65,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x61,0x74,0x74,0x72,0x20, - 0x2e,0x2e,0x20,0x27,0x3d,0x22,0x27,0x20,0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x76,0x61,0x6c,0x29,0x3a,0x67,0x73,0x75,0x62,0x28,0x27,0x5b, - 0x22,0x26,0x3c,0x5d,0x27,0x2c,0x20,0x78,0x6d,0x6c,0x61,0x74,0x74,0x72,0x5f,0x73, - 0x70,0x65,0x63,0x69,0x61,0x6c,0x63,0x68,0x61,0x72,0x73,0x29,0x20,0x2e,0x2e,0x20, - 0x27,0x22,0x27,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x70,0x69,0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63, - 0x65,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x22,0x20,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x70,0x69,0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63,0x65,0x73, - 0x5d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x2d,0x2d,0x20,0x72,0x65,0x6d,0x6f,0x76, - 0x65,0x20,0x74,0x68,0x65,0x20,0x6c,0x61,0x73,0x74,0x20,0x73,0x65,0x70,0x61,0x72, - 0x61,0x74,0x6f,0x72,0x20,0x28,0x75,0x73,0x65,0x6c,0x65,0x73,0x73,0x29,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x64,0x65,0x5b, - 0x31,0x5d,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x70,0x69,0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63, - 0x65,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x22,0x3e,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x5f,0x2c, - 0x20,0x63,0x68,0x69,0x6c,0x64,0x20,0x69,0x6e,0x20,0x69,0x70,0x61,0x69,0x72,0x73, - 0x28,0x6e,0x6f,0x64,0x65,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x74,0x79,0x70, - 0x65,0x28,0x63,0x68,0x69,0x6c,0x64,0x29,0x20,0x3d,0x3d,0x20,0x22,0x74,0x61,0x62, - 0x6c,0x65,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74, - 0x65,0x28,0x63,0x68,0x69,0x6c,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x20,0x70,0x69, - 0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63,0x65,0x73,0x20,0x2b,0x20,0x31, - 0x5d,0x20,0x3d,0x20,0x22,0x3c,0x21,0x5b,0x43,0x44,0x41,0x54,0x41,0x5b,0x22,0x20, - 0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x63,0x68,0x69,0x6c, - 0x64,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5d,0x5d,0x3e,0x22,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x69,0x65,0x63, - 0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63,0x65,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20, - 0x3d,0x20,0x22,0x3c,0x2f,0x22,0x20,0x2e,0x2e,0x20,0x6e,0x6f,0x64,0x65,0x2e,0x74, - 0x61,0x67,0x20,0x2e,0x2e,0x20,0x22,0x3e,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x70,0x69,0x65,0x63,0x65,0x73,0x5b,0x23,0x70,0x69,0x65,0x63,0x65, - 0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x22,0x2f,0x3e,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x28, - 0x78,0x6d,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x74,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28,0x70,0x69,0x65,0x63,0x65,0x73,0x29,0x0a, - 0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e, - 0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x6b,0x74,0x2c,0x20,0x72,0x65, - 0x73,0x70,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x72, - 0x65,0x73,0x70,0x2e,0x61,0x74,0x74,0x72,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65, - 0x73,0x70,0x2e,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x7d,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x70,0x2e,0x61,0x74,0x74,0x72,0x2e,0x78, - 0x6d,0x6c,0x6e,0x73,0x20,0x3d,0x20,0x22,0x75,0x72,0x6e,0x3a,0x64,0x65,0x62,0x75, - 0x67,0x67,0x65,0x72,0x5f,0x70,0x72,0x6f,0x74,0x6f,0x63,0x6f,0x6c,0x5f,0x76,0x31, - 0x22,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x61,0x74, - 0x61,0x20,0x3d,0x20,0x27,0x3c,0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73,0x69, - 0x6f,0x6e,0x3d,0x22,0x31,0x2e,0x30,0x22,0x20,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e, - 0x67,0x3d,0x22,0x55,0x54,0x46,0x2d,0x38,0x22,0x20,0x3f,0x3e,0x5c,0x6e,0x27,0x2e, - 0x2e,0x4d,0x2e,0x6c,0x6f,0x6d,0x32,0x73,0x74,0x72,0x28,0x72,0x65,0x73,0x70,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x75,0x74,0x69,0x6c,0x2e,0x6c,0x6f,0x67,0x28,0x22,0x44, - 0x45,0x42,0x55,0x47,0x22,0x2c,0x20,0x22,0x53,0x65,0x6e,0x64,0x20,0x22,0x20,0x2e, - 0x2e,0x20,0x64,0x61,0x74,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x73,0x6b,0x74,0x3a, - 0x73,0x65,0x6e,0x64,0x28,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x23,0x64, - 0x61,0x74,0x61,0x29,0x2e,0x2e,0x22,0x5c,0x30,0x30,0x30,0x22,0x2e,0x2e,0x64,0x61, - 0x74,0x61,0x2e,0x2e,0x22,0x5c,0x30,0x30,0x30,0x22,0x29,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x6e,0x20,0x58, - 0x4d,0x4c,0x20,0x74,0x61,0x67,0x20,0x64,0x65,0x73,0x63,0x72,0x69,0x62,0x69,0x6e, - 0x67,0x20,0x61,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x65,0x72,0x72, - 0x6f,0x72,0x2c,0x20,0x77,0x69,0x74,0x68,0x20,0x61,0x6e,0x20,0x6f,0x70,0x74,0x69, - 0x6f,0x6e,0x61,0x6c,0x20,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x0a,0x2d,0x2d,0x20, - 0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x63,0x6f,0x64,0x65,0x20,0x28,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x29,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x63,0x6f,0x64,0x65,0x20, - 0x28,0x73,0x65,0x65,0x20,0x44,0x42,0x47,0x70,0x20,0x73,0x70,0x65,0x63,0x69,0x66, - 0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x6d,0x73,0x67,0x20,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c, - 0x20,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x29,0x20,0x74,0x65,0x78,0x74,0x75, - 0x61,0x6c,0x20,0x64,0x65,0x73,0x63,0x72,0x69,0x70,0x74,0x69,0x6f,0x6e,0x20,0x6f, - 0x66,0x20,0x65,0x72,0x72,0x6f,0x72,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2c,0x20,0x73,0x75,0x69,0x74,0x61,0x62, - 0x6c,0x65,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72,0x74, - 0x65,0x64,0x20,0x69,0x6e,0x74,0x6f,0x20,0x58,0x4d,0x4c,0x0a,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x65,0x72,0x72,0x6f, - 0x72,0x28,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x73,0x67,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x6c,0x65,0x6d,0x20,0x3d,0x20,0x7b,0x20, - 0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x65,0x72,0x72,0x6f,0x72,0x22,0x2c,0x20,0x61, - 0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x64,0x65,0x20,0x3d,0x20,0x63, - 0x6f,0x64,0x65,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6d, - 0x73,0x67,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x65,0x6d,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x74,0x6f,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x6d,0x73,0x67,0x29,0x2c,0x20,0x74,0x61,0x67,0x20,0x3d, - 0x20,0x22,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x22,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x65,0x6c,0x65,0x6d,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x4d,0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20, - 0x6f,0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x2e,0x64,0x62,0x67,0x70,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f, - 0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e, - 0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x0a,0x70,0x61,0x63,0x6b, - 0x61,0x67,0x65,0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74, - 0x69,0x6f,0x6e,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67, - 0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32,0x30,0x31,0x32, - 0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73, - 0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20, - 0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65,0x73,0x65,0x72, - 0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61, - 0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70, - 0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x73, - 0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20,0x61,0x76,0x61, - 0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20,0x74,0x68,0x65, - 0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x45,0x63, - 0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20,0x4c,0x69,0x63, - 0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69, - 0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65,0x73,0x20,0x74, - 0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e, - 0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62, - 0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f, - 0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f, - 0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30,0x2e,0x68,0x74, - 0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74,0x72,0x69,0x62, - 0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x4a,0x75, - 0x6c,0x69,0x65,0x6e,0x20,0x44,0x65,0x73,0x67,0x61,0x74,0x73,0x20,0x2d,0x20,0x69, - 0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61,0x6e,0x64,0x20,0x69, - 0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d, - 0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d, - 0x20,0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x20,0x67,0x65,0x6e,0x65, - 0x72,0x61,0x74,0x69,0x6f,0x6e,0x2e,0x20,0x47,0x65,0x6e,0x65,0x72,0x61,0x74,0x65, - 0x20,0x61,0x20,0x4c,0x4f,0x4d,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x74, - 0x68,0x20,0x64,0x61,0x74,0x61,0x20,0x66,0x72,0x6f,0x6d,0x20,0x69,0x6e,0x74,0x72, - 0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x0a,0x2d,0x2d,0x20,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72, - 0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69, - 0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c,0x61, - 0x74,0x66,0x6f,0x72,0x6d,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x74,0x69, - 0x6c,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x75,0x74,0x69,0x6c,0x22,0x0a,0x0a,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x74,0x79,0x70, - 0x65,0x2c,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x2c,0x20,0x6e,0x65,0x78,0x74,0x2c, - 0x20,0x72,0x61,0x77,0x67,0x65,0x74,0x2c,0x20,0x67,0x65,0x74,0x6d,0x65,0x74,0x61, - 0x74,0x61,0x62,0x6c,0x65,0x2c,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61, - 0x62,0x6c,0x65,0x2c,0x20,0x67,0x65,0x74,0x66,0x65,0x6e,0x76,0x2c,0x20,0x73,0x65, - 0x6c,0x65,0x63,0x74,0x2c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f, - 0x79,0x69,0x65,0x6c,0x64,0x2c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, - 0x6f,0x63,0x72,0x65,0x61,0x74,0x65,0x2c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x63,0x6f,0x73,0x74,0x61,0x74,0x75,0x73,0x2c,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x73,0x75,0x6d,0x65,0x2c,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x73,0x66,0x6f,0x72,0x6d,0x61,0x74,0x2c,0x20,0x20,0x20,0x20,0x20, - 0x20,0x74,0x63,0x6f,0x6e,0x63,0x61,0x74,0x20,0x3d,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x74,0x79,0x70,0x65,0x2c, - 0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x2c,0x20,0x6e,0x65,0x78,0x74,0x2c,0x20,0x72, - 0x61,0x77,0x67,0x65,0x74,0x2c,0x20,0x67,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61, - 0x62,0x6c,0x65,0x2c,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x2c,0x20,0x67,0x65,0x74,0x66,0x65,0x6e,0x76,0x2c,0x20,0x73,0x65,0x6c,0x65, - 0x63,0x74,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x79,0x69, - 0x65,0x6c,0x64,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x63, - 0x72,0x65,0x61,0x74,0x65,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x2e,0x73,0x74,0x61,0x74,0x75,0x73,0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x2e,0x72,0x65,0x73,0x75,0x6d,0x65,0x2c,0x20,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x2c,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e, - 0x63,0x6f,0x6e,0x63,0x61,0x74,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4d,0x55, - 0x4c,0x54,0x49,0x56,0x41,0x4c,0x5f,0x4d,0x54,0x20,0x3d,0x20,0x7b,0x20,0x5f,0x5f, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x20, - 0x65,0x6e,0x64,0x20,0x7d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x62, - 0x65,0x73,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x50,0x75, - 0x62,0x6c,0x69,0x63,0x20,0x41,0x50,0x49,0x20,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x6c,0x6f,0x67,0x69,0x63,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x6d, - 0x6f,0x64,0x75,0x6c,0x65,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73, - 0x20,0x4c,0x75,0x61,0x20,0x6f,0x62,0x6a,0x65,0x63,0x74,0x73,0x20,0x69,0x6e,0x74, - 0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x61,0x6e,0x64,0x0a,0x2d, - 0x2d,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x73,0x20,0x61,0x20,0x5b,0x44, - 0x42,0x47,0x50,0x5d,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x78,0x64,0x65,0x62, - 0x75,0x67,0x2e,0x6f,0x72,0x67,0x2f,0x64,0x6f,0x63,0x73,0x2d,0x64,0x62,0x67,0x70, - 0x2e,0x70,0x68,0x70,0x29,0x20,0x63,0x6f,0x6d,0x70,0x61,0x74,0x69,0x62,0x6c,0x65, - 0x0a,0x2d,0x2d,0x20,0x5b,0x4c,0x4f,0x4d,0x5d,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f, - 0x2f,0x6d,0x61,0x74,0x74,0x68,0x65,0x77,0x77,0x69,0x6c,0x64,0x2e,0x63,0x6f,0x2e, - 0x75,0x6b,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x75,0x61,0x65, - 0x78,0x70,0x61,0x74,0x2f,0x6c,0x6f,0x6d,0x2e,0x68,0x74,0x6d,0x6c,0x29,0x20,0x64, - 0x61,0x74,0x61,0x20,0x73,0x63,0x72,0x75,0x63,0x74,0x75,0x72,0x65,0x2e,0x0a,0x2d, - 0x2d,0x20,0x40,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4d,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a, - 0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74, - 0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x74,0x75,0x61,0x6c,0x20,0x64,0x61,0x74,0x61, - 0x20,0x74,0x6f,0x20,0x73,0x65,0x6e,0x64,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x0a,0x2d,0x2d,0x20,0x46,0x75,0x6c, - 0x6c,0x20,0x58,0x4d,0x4c,0x20,0x73,0x70,0x65,0x63,0x69,0x66,0x69,0x63,0x61,0x74, - 0x69,0x6f,0x6e,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x66,0x6f,0x75,0x6e,0x64, - 0x20,0x69,0x6e,0x20,0x5b,0x44,0x42,0x47,0x50,0x20,0x73,0x70,0x65,0x63,0x69,0x66, - 0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x5d,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f, - 0x78,0x64,0x65,0x62,0x75,0x67,0x2e,0x6f,0x72,0x67,0x2f,0x64,0x6f,0x63,0x73,0x2d, - 0x64,0x62,0x67,0x70,0x2e,0x70,0x68,0x70,0x23,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x69,0x65,0x73,0x2d,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x73,0x2d,0x61,0x6e, - 0x64,0x2d,0x76,0x61,0x6c,0x75,0x65,0x73,0x29,0x2e,0x0a,0x2d,0x2d,0x20,0x4d,0x6f, - 0x64,0x69,0x66,0x79,0x69,0x6e,0x67,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x69, - 0x65,0x73,0x20,0x61,0x66,0x74,0x65,0x72,0x20,0x74,0x68,0x65,0x69,0x72,0x20,0x67, - 0x65,0x6e,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x70,0x6f,0x73, - 0x73,0x69,0x62,0x6c,0x65,0x20,0x28,0x61,0x73,0x20,0x61,0x63,0x74,0x75,0x61,0x6c, - 0x20,0x64,0x61,0x74,0x61,0x20,0x73,0x65,0x72,0x69,0x61,0x6c,0x69,0x7a,0x61,0x74, - 0x69,0x6f,0x6e,0x2f,0x73,0x65,0x6e,0x64,0x69,0x6e,0x67,0x20,0x69,0x73,0x20,0x64, - 0x65,0x6c,0x61,0x79,0x65,0x64,0x29,0x0a,0x2d,0x2d,0x20,0x62,0x75,0x74,0x20,0x73, - 0x68,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x77,0x69, - 0x74,0x68,0x20,0x63,0x61,0x72,0x65,0x2e,0x20,0x54,0x68,0x65,0x20,0x58,0x4d,0x4c, - 0x20,0x73,0x74,0x72,0x75,0x63,0x74,0x75,0x72,0x65,0x20,0x75,0x73,0x65,0x73,0x20, - 0x74,0x68,0x65,0x20,0x5b,0x4c,0x4f,0x4d,0x5d,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f, - 0x2f,0x6d,0x61,0x74,0x74,0x68,0x65,0x77,0x77,0x69,0x6c,0x64,0x2e,0x63,0x6f,0x2e, - 0x75,0x6b,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x75,0x61,0x65, - 0x78,0x70,0x61,0x74,0x2f,0x6c,0x6f,0x6d,0x2e,0x68,0x74,0x6d,0x6c,0x29,0x0a,0x2d, - 0x2d,0x20,0x66,0x6f,0x72,0x6d,0x61,0x74,0x2c,0x20,0x72,0x65,0x66,0x65,0x72,0x20, - 0x74,0x6f,0x20,0x74,0x68,0x65,0x73,0x65,0x20,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e, - 0x74,0x73,0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x6d,0x6f,0x72,0x65,0x20,0x69, - 0x6e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x69,0x6f,0x6e,0x73,0x20,0x61,0x62,0x6f,0x75, - 0x74,0x20,0x66,0x69,0x65,0x6c,0x64,0x73,0x2e,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x49,0x6e,0x20,0x61,0x64,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x74,0x6f,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x20,0x66,0x69,0x65,0x6c,0x64,0x73,0x2c,0x20,0x69,0x74,0x20, - 0x68,0x61,0x73,0x20,0x61,0x6e,0x20,0x61,0x72,0x72,0x61,0x79,0x20,0x70,0x61,0x72, - 0x74,0x2c,0x20,0x60,0x5b,0x31,0x5d,0x60,0x20,0x62,0x65,0x69,0x6e,0x67,0x20,0x74, - 0x68,0x65,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x72,0x65,0x70,0x72,0x65,0x73, - 0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x28,0x62,0x61,0x73,0x65,0x36,0x34, - 0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x29,0x2c,0x0a,0x2d,0x2d,0x20,0x70,0x6f, - 0x73,0x73,0x69,0x62,0x6c,0x79,0x20,0x66,0x6f,0x6c,0x6c,0x6f,0x77,0x65,0x64,0x20, - 0x62,0x79,0x20,0x63,0x68,0x6c,0x69,0x64,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x69,0x65,0x73,0x20,0x28,0x40,0x7b,0x23,0x44,0x42,0x47,0x50,0x50,0x72,0x6f,0x70, - 0x65,0x72,0x74,0x79,0x7d,0x20,0x74,0x68,0x65,0x6d,0x73,0x65,0x6c,0x76,0x65,0x73, - 0x29,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x40,0x66,0x69,0x65,0x6c,0x64,0x20,0x23, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x74,0x61,0x67,0x20,0x41,0x6c,0x77,0x61,0x79, - 0x73,0x20,0x22,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x22,0x0a,0x2d,0x2d,0x20, - 0x40,0x66,0x69,0x65,0x6c,0x64,0x20,0x23,0x74,0x61,0x62,0x6c,0x65,0x20,0x61,0x74, - 0x74,0x72,0x20,0x58,0x4d,0x4c,0x20,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65, - 0x73,0x2c,0x20,0x73,0x65,0x65,0x20,0x44,0x42,0x47,0x50,0x20,0x73,0x70,0x65,0x63, - 0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x20,0x40,0x74,0x79, - 0x70,0x65,0x20,0x44,0x42,0x47,0x50,0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x70,0x65,0x63,0x74,0x6f,0x72, - 0x73,0x20,0x74,0x61,0x62,0x6c,0x65,0x2c,0x20,0x63,0x6f,0x6e,0x74,0x61,0x69,0x6e, - 0x20,0x61,0x6c,0x6c,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x4b,0x65,0x79, - 0x73,0x20,0x61,0x72,0x65,0x20,0x65,0x69,0x74,0x68,0x65,0x72,0x20,0x74,0x79,0x70, - 0x65,0x20,0x6e,0x61,0x6d,0x65,0x73,0x20,0x28,0x60,0x73,0x74,0x72,0x69,0x6e,0x67, - 0x60,0x2c,0x20,0x60,0x6e,0x75,0x6d,0x62,0x65,0x72,0x60,0x2c,0x20,0x2e,0x2e,0x2e, - 0x29,0x20,0x6f,0x72,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x73,0x0a, - 0x2d,0x2d,0x20,0x74,0x68,0x61,0x74,0x20,0x68,0x61,0x76,0x65,0x20,0x61,0x20,0x63, - 0x75,0x73,0x74,0x6f,0x6d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x20, - 0x61,0x74,0x74,0x61,0x63,0x68,0x65,0x64,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x66,0x69, - 0x65,0x6c,0x64,0x20,0x5b,0x70,0x61,0x72,0x65,0x6e,0x74,0x3d,0x23,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74, - 0x69,0x6f,0x6e,0x5d,0x20,0x23,0x74,0x61,0x62,0x6c,0x65,0x20,0x69,0x6e,0x73,0x70, - 0x65,0x63,0x74,0x6f,0x72,0x73,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x73,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x2d,0x0a,0x2d, - 0x2d,0x20,0x47,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x20,0x61,0x20,0x44,0x42,0x47, - 0x50,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x69,0x66,0x20,0x6e,0x65, - 0x65,0x64,0x65,0x64,0x2e,0x20,0x49,0x66,0x20,0x64,0x61,0x74,0x61,0x20,0x69,0x73, - 0x20,0x69,0x6e,0x20,0x64,0x61,0x74,0x61,0x20,0x70,0x61,0x67,0x69,0x6e,0x61,0x74, - 0x69,0x6f,0x6e,0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x63,0x75,0x72,0x73,0x69,0x6f, - 0x6e,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x72,0x61,0x6e,0x67,0x65,0x73,0x2c,0x0a, - 0x2d,0x2d,0x20,0x61,0x6e,0x64,0x20,0x73,0x65,0x6e,0x64,0x20,0x61,0x20,0x70,0x72, - 0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x64,0x65, - 0x62,0x75,0x67,0x67,0x65,0x72,0x2c,0x20,0x6f,0x74,0x68,0x65,0x72,0x77,0x69,0x73, - 0x65,0x20,0x64,0x72,0x6f,0x70,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x23,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x20, - 0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x6e,0x61,0x6d,0x65,0x20,0x28,0x64, - 0x69,0x73,0x70,0x6c,0x61,0x79,0x65,0x64,0x20,0x69,0x6e,0x20,0x49,0x44,0x45,0x29, - 0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x20,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x79,0x70,0x65, - 0x20,0x6e,0x61,0x6d,0x65,0x20,0x28,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x65,0x64, - 0x20,0x69,0x6e,0x20,0x49,0x44,0x45,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x23,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x72,0x65,0x70,0x72,0x20, - 0x56,0x61,0x6c,0x75,0x65,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x72,0x65,0x70, - 0x72,0x65,0x73,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x20,0x40, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x44,0x42,0x47,0x50,0x50,0x72,0x6f,0x70,0x65, - 0x72,0x74,0x79,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x50,0x61,0x72,0x65,0x6e, - 0x74,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x0a,0x2d,0x2d,0x20,0x40,0x70, - 0x61,0x72,0x61,0x6d,0x20,0x23,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x20,0x4c,0x75,0x61,0x20,0x65,0x78,0x70,0x72,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x67,0x65,0x74, - 0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x62,0x61,0x63,0x6b,0x20,0x69,0x6e,0x20,0x66, - 0x75,0x72,0x74,0x68,0x65,0x72,0x20,0x63,0x61,0x6c,0x6c,0x73,0x0a,0x2d,0x2d,0x20, - 0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x23,0x74,0x61,0x62,0x6c,0x65,0x20,0x64, - 0x65,0x73,0x63,0x72,0x69,0x70,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x20,0x40,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x70,0x61,0x72,0x65,0x6e,0x74,0x3d, - 0x23,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73, - 0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x5d,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x79,0x0a,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x3d,0x20,0x63, - 0x6f,0x79,0x69,0x65,0x6c,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x41, - 0x64,0x64,0x73,0x20,0x61,0x20,0x70,0x72,0x6f,0x62,0x65,0x20,0x74,0x68,0x61,0x74, - 0x20,0x77,0x69,0x6c,0x6c,0x20,0x62,0x65,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64,0x20, - 0x66,0x6f,0x72,0x20,0x65,0x76,0x65,0x72,0x79,0x20,0x75,0x6e,0x6b,0x6e,0x6f,0x77, - 0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2f,0x75,0x73,0x65,0x72,0x64,0x61,0x74,0x61, - 0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x70,0x72,0x6f,0x62,0x65,0x20,0x49,0x6e,0x73,0x70, - 0x65,0x63,0x74,0x6f,0x72,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x74, - 0x6f,0x20,0x63,0x61,0x6c,0x6c,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x5b,0x70,0x61,0x72,0x65,0x6e,0x74,0x3d,0x23,0x64,0x65, - 0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63, - 0x74,0x69,0x6f,0x6e,0x5d,0x20,0x61,0x64,0x64,0x5f,0x70,0x72,0x6f,0x62,0x65,0x0a, - 0x4d,0x2e,0x61,0x64,0x64,0x5f,0x70,0x72,0x6f,0x62,0x65,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x70,0x72,0x6f,0x62,0x65,0x29,0x20,0x70,0x72, - 0x6f,0x62,0x65,0x73,0x5b,0x23,0x70,0x72,0x6f,0x62,0x65,0x73,0x20,0x2b,0x20,0x31, - 0x5d,0x20,0x3d,0x20,0x70,0x72,0x6f,0x62,0x65,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x2d, - 0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x73,0x70,0x65,0x63,0x74,0x73,0x20,0x61, - 0x20,0x4c,0x75,0x61,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x62,0x79,0x20,0x64,0x69, - 0x73,0x70,0x61,0x74,0x63,0x68,0x69,0x6e,0x67,0x20,0x69,0x74,0x20,0x74,0x6f,0x20, - 0x63,0x6f,0x72,0x72,0x65,0x63,0x74,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f, - 0x72,0x2e,0x20,0x49,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x68,0x61,0x76,0x65,0x20,0x74,0x68,0x65,0x20, - 0x73,0x61,0x6d,0x65,0x20,0x41,0x50,0x49,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61, - 0x72,0x61,0x6d,0x20,0x23,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65, - 0x20,0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x6e,0x61,0x6d,0x65,0x20,0x28, - 0x77,0x69,0x6c,0x6c,0x20,0x62,0x65,0x20,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x65, - 0x64,0x20,0x62,0x79,0x20,0x49,0x44,0x45,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61, - 0x72,0x61,0x6d,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x56,0x61,0x6c,0x75,0x65,0x20, - 0x74,0x6f,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x0a,0x2d,0x2d,0x20,0x40,0x70, - 0x61,0x72,0x61,0x6d,0x20,0x23,0x74,0x61,0x62,0x6c,0x65,0x20,0x70,0x61,0x72,0x65, - 0x6e,0x74,0x20,0x50,0x61,0x72,0x65,0x6e,0x74,0x20,0x70,0x72,0x6f,0x70,0x65,0x72, - 0x74,0x79,0x20,0x28,0x4c,0x4f,0x4d,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x6f,0x66, - 0x20,0x74,0x68,0x65,0x20,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d, - 0x20,0x23,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d, - 0x65,0x20,0x45,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x75,0x73,0x65, - 0x64,0x20,0x74,0x6f,0x20,0x72,0x65,0x74,0x72,0x69,0x65,0x76,0x65,0x20,0x60,0x76, - 0x61,0x6c,0x75,0x65,0x60,0x20,0x66,0x6f,0x72,0x20,0x66,0x75,0x72,0x74,0x68,0x65, - 0x72,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x63,0x61,0x6c,0x6c,0x73, - 0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x23,0x44,0x42,0x47, - 0x50,0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x54,0x68,0x65,0x20,0x69,0x6e, - 0x73,0x70,0x65,0x63,0x74,0x65,0x64,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x61,0x73, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x65,0x64,0x20,0x62,0x79,0x20,0x40,0x7b,0x64, - 0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65, - 0x63,0x74,0x69,0x6f,0x6e,0x23,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69, - 0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x70,0x72,0x6f, - 0x70,0x65,0x72,0x74,0x79,0x7d,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x23,0x6e,0x69,0x6c,0x20,0x49,0x66,0x20,0x74,0x68,0x65,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x20,0x68,0x61,0x73,0x20,0x6e,0x6f,0x74,0x20,0x62,0x65,0x65, - 0x6e,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x40, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x70,0x61,0x72,0x65,0x6e,0x74, - 0x3d,0x23,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f, - 0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x5d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63, - 0x74,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c, - 0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c, - 0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x28,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x5b,0x74, - 0x79,0x70,0x65,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x5d,0x20,0x6f,0x72,0x20,0x4d, - 0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x64,0x65,0x66,0x61, - 0x75,0x6c,0x74,0x29,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65, - 0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61, - 0x6d,0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x55,0x74,0x69,0x6c,0x69,0x74,0x79,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x73,0x20,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d,0x2d, - 0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20, - 0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x2e,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x74,0x79, - 0x70,0x65,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x2c,0x20,0x70,0x61,0x72,0x65, - 0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x73,0x70,0x65,0x63,0x74,0x73,0x20,0x74, - 0x79,0x70,0x65,0x73,0x20,0x74,0x68,0x61,0x74,0x20,0x63,0x61,0x6e,0x20,0x68,0x61, - 0x76,0x65,0x20,0x61,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x20,0x28, - 0x74,0x61,0x62,0x6c,0x65,0x20,0x61,0x6e,0x64,0x20,0x75,0x73,0x65,0x72,0x64,0x61, - 0x74,0x61,0x29,0x2e,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x31,0x29,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x20,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x32,0x29,0x20, - 0x62,0x6f,0x6f,0x6c,0x65,0x61,0x6e,0x20,0x69,0x6e,0x64,0x69,0x63,0x61,0x74,0x69, - 0x6e,0x67,0x20,0x77,0x68,0x65,0x74,0x68,0x65,0x72,0x20,0x61,0x20,0x63,0x75,0x73, - 0x74,0x6f,0x6d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x20,0x68,0x61, - 0x73,0x20,0x62,0x65,0x65,0x6e,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64,0x20,0x28,0x69, - 0x6e,0x20,0x74,0x68,0x61,0x74,0x20,0x63,0x61,0x73,0x65,0x2c,0x20,0x64,0x6f,0x20, - 0x6e,0x6f,0x74,0x20,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x20,0x61,0x6e,0x79,0x20,0x66,0x75,0x72,0x74,0x68,0x65,0x72,0x29,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x6d,0x65, - 0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f, - 0x72,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70, - 0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x74,0x20,0x3d,0x20, - 0x67,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x76,0x61,0x6c, - 0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x66,0x69,0x6e,0x64,0x20,0x20,0x62,0x79,0x20,0x6d, - 0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x75,0x73,0x74,0x6f,0x6d,0x20,0x3d,0x20, - 0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x5b,0x6d,0x74,0x5d, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x75,0x73,0x74, - 0x6f,0x6d,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63, - 0x75,0x73,0x74,0x6f,0x6d,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x29,0x2c,0x20,0x74,0x72,0x75,0x65,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6f,0x72,0x20,0x65,0x6c,0x73, - 0x65,0x20,0x63,0x61,0x6c,0x6c,0x20,0x70,0x72,0x6f,0x62,0x65,0x73,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x31,0x2c,0x20,0x23, - 0x70,0x72,0x6f,0x62,0x65,0x73,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x20,0x3d, - 0x20,0x70,0x72,0x6f,0x62,0x65,0x73,0x5b,0x69,0x5d,0x28,0x6e,0x61,0x6d,0x65,0x2c, - 0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20, - 0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x72,0x6f,0x70,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70,0x2c,0x20,0x74,0x72, - 0x75,0x65,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x20,0x3d,0x20,0x64,0x65,0x66, - 0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x28,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65, - 0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x6d,0x74,0x20,0x61,0x6e,0x64,0x20,0x70,0x72,0x6f,0x70, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x6d,0x74,0x70,0x72,0x6f,0x70,0x20,0x3d,0x20,0x4d,0x2e,0x69, - 0x6e,0x73,0x70,0x65,0x63,0x74,0x28,0x22,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x22,0x2c,0x20,0x6d,0x74,0x2c,0x20,0x70,0x72,0x6f,0x70,0x2c,0x20,0x22,0x6d, - 0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x5b,0x22,0x2e,0x2e,0x70,0x72,0x6f,0x70, - 0x2e,0x61,0x74,0x74,0x72,0x2e,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2e,0x2e, - 0x22,0x5d,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6d,0x74,0x70,0x72,0x6f,0x70,0x20,0x74,0x68,0x65,0x6e,0x20,0x6d,0x74,0x70,0x72, - 0x6f,0x70,0x2e,0x61,0x74,0x74,0x72,0x2e,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x22, - 0x73,0x70,0x65,0x63,0x69,0x61,0x6c,0x22,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x70,0x72,0x6f,0x70,0x2c,0x20,0x66,0x61,0x6c,0x73,0x65,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x66,0x61,0x6e,0x63,0x79,0x5f,0x66,0x75,0x6e,0x63,0x5f,0x72,0x65,0x70,0x72,0x28, - 0x66,0x2c,0x20,0x69,0x6e,0x66,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x61,0x72,0x67,0x73,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x31,0x2c,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x6e, - 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x61,0x72,0x67,0x73,0x5b,0x69,0x5d,0x20,0x3d,0x20,0x64,0x65,0x62,0x75, - 0x67,0x2e,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x66,0x2c,0x20,0x69,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x69,0x6e,0x66,0x6f,0x2e,0x69,0x73,0x76,0x61,0x72,0x61,0x72,0x67,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x72,0x67,0x73, - 0x5b,0x23,0x61,0x72,0x67,0x73,0x2b,0x31,0x5d,0x20,0x3d,0x20,0x22,0x2e,0x2e,0x2e, - 0x22,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x22,0x20,0x2e,0x2e,0x20,0x74,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28,0x61,0x72,0x67, - 0x73,0x2c,0x20,0x22,0x2c,0x20,0x22,0x29,0x20,0x2e,0x2e,0x20,0x22,0x29,0x22,0x0a, - 0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x47,0x65,0x6e,0x65,0x72,0x61,0x74, - 0x65,0x20,0x61,0x20,0x6e,0x61,0x6d,0x65,0x20,0x73,0x69,0x75,0x74,0x61,0x62,0x6c, - 0x65,0x20,0x66,0x6f,0x72,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x69,0x6e,0x64,0x65, - 0x78,0x20,0x73,0x79,0x6e,0x74,0x61,0x78,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x6e,0x61,0x6d,0x65,0x20,0x4b,0x65,0x79,0x20,0x6e,0x61,0x6d,0x65, - 0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x23,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x20,0x41,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x69,0x6e,0x64,0x65, - 0x78,0x20,0x73,0x74,0x79,0x6c,0x65,0x20,0x69,0x6e,0x64,0x65,0x78,0x0a,0x2d,0x2d, - 0x20,0x40,0x75,0x73,0x61,0x67,0x65,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65, - 0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x28,0x27, - 0x66,0x6f,0x6f,0x27,0x29,0x20,0x3d,0x3e,0x20,0x27,0x5b,0x22,0x66,0x6f,0x6f,0x22, - 0x5d,0x27,0x0a,0x2d,0x2d,0x20,0x40,0x75,0x73,0x61,0x67,0x65,0x20,0x67,0x65,0x6e, - 0x65,0x72,0x61,0x74,0x65,0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x5f, - 0x6b,0x65,0x79,0x28,0x31,0x32,0x29,0x20,0x20,0x20,0x20,0x3d,0x3e,0x20,0x27,0x5b, - 0x31,0x32,0x5d,0x27,0x0a,0x2d,0x2d,0x20,0x40,0x75,0x73,0x61,0x67,0x65,0x20,0x67, - 0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c, - 0x65,0x5f,0x6b,0x65,0x79,0x28,0x7b,0x7d,0x29,0x20,0x20,0x20,0x20,0x3d,0x3e,0x20, - 0x27,0x5b,0x74,0x61,0x62,0x6c,0x65,0x3a,0x20,0x30,0x78,0x31,0x32,0x33,0x34,0x35, - 0x36,0x37,0x38,0x5d,0x0a,0x2d,0x2d,0x20,0x40,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x5b,0x70,0x61,0x72,0x65,0x6e,0x74,0x3d,0x23,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f, - 0x6e,0x5d,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x70,0x72,0x69,0x6e, - 0x74,0x61,0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74, - 0x65,0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x28, - 0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x22,0x5b,0x22,0x20,0x2e,0x2e,0x20,0x28,0x74,0x79,0x70,0x65,0x28,0x6e,0x61, - 0x6d,0x65,0x29,0x20,0x3d,0x3d,0x20,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x20, - 0x61,0x6e,0x64,0x20,0x73,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28,0x22,0x25,0x71,0x22, - 0x2c,0x20,0x6e,0x61,0x6d,0x65,0x29,0x20,0x6f,0x72,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x6e,0x61,0x6d,0x65,0x29,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5d, - 0x22,0x0a,0x65,0x6e,0x64,0x0a,0x4d,0x2e,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65, - 0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x20,0x3d, - 0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x70,0x72,0x69,0x6e,0x74,0x61, - 0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x0a,0x0a,0x2d,0x2d,0x20,0x55,0x73,0x65,0x64, - 0x20,0x74,0x6f,0x20,0x73,0x74,0x6f,0x72,0x65,0x20,0x63,0x6f,0x6d,0x70,0x6c,0x65, - 0x78,0x20,0x6b,0x65,0x79,0x73,0x20,0x28,0x6f,0x74,0x68,0x65,0x72,0x20,0x74,0x68, - 0x61,0x6e,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x61,0x6e,0x64,0x20,0x6e,0x75, - 0x6d,0x62,0x65,0x72,0x29,0x20,0x61,0x73,0x20,0x74,0x68,0x65,0x79,0x20,0x63,0x61, - 0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x70,0x61,0x73,0x73,0x65,0x64,0x20,0x69, - 0x6e,0x20,0x74,0x65,0x78,0x74,0x0a,0x2d,0x2d,0x20,0x46,0x6f,0x72,0x20,0x74,0x68, - 0x65,0x73,0x65,0x20,0x6b,0x65,0x79,0x73,0x2c,0x20,0x74,0x68,0x65,0x20,0x72,0x65, - 0x73,0x75,0x6c,0x74,0x69,0x6e,0x67,0x20,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69, - 0x6f,0x6e,0x20,0x77,0x69,0x6c,0x6c,0x20,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x74, - 0x68,0x65,0x20,0x6b,0x65,0x79,0x20,0x69,0x74,0x73,0x65,0x6c,0x66,0x20,0x62,0x75, - 0x74,0x20,0x22,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x5b,0x2e,0x2e,0x2e, - 0x5d,0x22,0x0a,0x2d,0x2d,0x20,0x77,0x68,0x65,0x72,0x65,0x20,0x6b,0x65,0x79,0x5f, - 0x63,0x61,0x63,0x68,0x65,0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x6d,0x61, - 0x70,0x70,0x65,0x64,0x20,0x74,0x6f,0x20,0x74,0x68,0x69,0x73,0x20,0x74,0x61,0x62, - 0x6c,0x65,0x20,0x74,0x6f,0x20,0x72,0x65,0x73,0x6f,0x6c,0x76,0x65,0x20,0x6b,0x65, - 0x79,0x20,0x63,0x6f,0x72,0x72,0x65,0x63,0x74,0x6c,0x79,0x2e,0x0a,0x4d,0x2e,0x6b, - 0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x20,0x3d,0x20,0x73,0x65,0x74,0x6d,0x65, - 0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x6e,0x3d,0x30,0x20,0x7d,0x2c, - 0x20,0x7b,0x20,0x5f,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x22,0x76,0x22,0x20, - 0x7d,0x29,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x6b,0x65,0x79,0x28, - 0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x74,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x74,0x79,0x70,0x65,0x28,0x6e,0x61,0x6d, - 0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x74,0x6e,0x61,0x6d,0x65,0x20, - 0x3d,0x3d,0x20,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28, - 0x22,0x25,0x71,0x22,0x2c,0x20,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x74,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x3d,0x20, - 0x22,0x6e,0x75,0x6d,0x62,0x65,0x72,0x22,0x20,0x6f,0x72,0x20,0x74,0x6e,0x61,0x6d, - 0x65,0x20,0x3d,0x3d,0x20,0x22,0x62,0x6f,0x6f,0x6c,0x65,0x61,0x6e,0x22,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c, - 0x73,0x65,0x20,0x2d,0x2d,0x20,0x63,0x6f,0x6d,0x70,0x6c,0x65,0x78,0x20,0x6b,0x65, - 0x79,0x2c,0x20,0x75,0x73,0x65,0x20,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65, - 0x20,0x66,0x6f,0x72,0x20,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x20,0x3d,0x20,0x4d,0x2e, - 0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x2e,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x4d,0x2e,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x5b, - 0x69,0x5d,0x20,0x3d,0x20,0x6e,0x61,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x4d,0x2e,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x2e,0x6e,0x20, - 0x3d,0x20,0x69,0x2b,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x22,0x6b,0x65,0x79,0x5f,0x63,0x61,0x63,0x68,0x65,0x5b, - 0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x69,0x29,0x2e,0x2e, - 0x22,0x5d,0x22,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x20,0x47,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x20,0x61,0x20, - 0x75,0x73,0x61,0x62,0x6c,0x65,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20, - 0x66,0x6f,0x72,0x20,0x61,0x20,0x76,0x61,0x6c,0x75,0x65,0x2e,0x0a,0x2d,0x2d,0x20, - 0x42,0x61,0x73,0x65,0x64,0x20,0x6f,0x6e,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20, - 0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x61,0x6e,0x64,0x20,0x6b,0x65,0x79, - 0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61, - 0x20,0x76,0x61,0x6c,0x69,0x64,0x20,0x4c,0x75,0x61,0x20,0x65,0x78,0x70,0x72,0x65, - 0x73,0x73,0x69,0x6f,0x6e,0x2e,0x0a,0x2d,0x2d,0x20,0x4b,0x65,0x79,0x20,0x63,0x61, - 0x6e,0x20,0x62,0x65,0x20,0x61,0x6e,0x79,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x28, - 0x61,0x73,0x20,0x61,0x6e,0x79,0x74,0x68,0x69,0x6e,0x67,0x20,0x63,0x61,0x6e,0x20, - 0x61,0x63,0x74,0x20,0x61,0x73,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x6b,0x65,0x79, - 0x29,0x2e,0x20,0x49,0x66,0x20,0x69,0x74,0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x0a, - 0x2d,0x2d,0x20,0x62,0x65,0x20,0x73,0x65,0x72,0x69,0x61,0x6c,0x69,0x7a,0x65,0x64, - 0x20,0x28,0x6f,0x6e,0x6c,0x79,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x6e, - 0x75,0x6d,0x62,0x65,0x72,0x20,0x61,0x6e,0x64,0x20,0x62,0x6f,0x6f,0x6c,0x65,0x61, - 0x6e,0x20,0x63,0x61,0x6e,0x29,0x2c,0x20,0x69,0x74,0x20,0x77,0x69,0x6c,0x6c,0x20, - 0x62,0x65,0x20,0x74,0x65,0x6d,0x70,0x6f,0x72,0x61,0x72,0x6c,0x79,0x0a,0x2d,0x2d, - 0x20,0x73,0x74,0x6f,0x72,0x65,0x64,0x20,0x69,0x6e,0x20,0x61,0x6e,0x20,0x69,0x6e, - 0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x63,0x61,0x63,0x68,0x65,0x20,0x74,0x6f,0x20, - 0x62,0x65,0x20,0x72,0x65,0x74,0x72,0x69,0x65,0x76,0x65,0x64,0x20,0x6c,0x61,0x74, - 0x65,0x72,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x50,0x61,0x72, - 0x65,0x6e,0x74,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x0a,0x2d,0x2d,0x20, - 0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x6b,0x65,0x79,0x20,0x54,0x68,0x65,0x20,0x63, - 0x68,0x69,0x6c,0x64,0x20,0x6b,0x65,0x79,0x20,0x74,0x6f,0x20,0x67,0x65,0x6e,0x65, - 0x72,0x61,0x74,0x65,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x66,0x6f, - 0x72,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x23,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x20,0x41,0x20,0x76,0x61,0x6c,0x69,0x64,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x20,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e, - 0x0a,0x2d,0x2d,0x20,0x40,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x70, - 0x61,0x72,0x65,0x6e,0x74,0x3d,0x23,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e, - 0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x5d,0x20,0x6d, - 0x61,0x6b,0x65,0x5f,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x0a,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x6d,0x61,0x6b,0x65, - 0x5f,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x28,0x70,0x61,0x72,0x65,0x6e,0x74, - 0x2c,0x20,0x6b,0x65,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x2e,0x2e,0x20,0x22,0x5b,0x22,0x20, - 0x2e,0x2e,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x6b,0x65,0x79,0x28, - 0x6b,0x65,0x79,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5d,0x22,0x0a,0x65,0x6e,0x64,0x0a, - 0x4d,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20, - 0x3d,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x0a, - 0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x20, - 0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x20,0x2d,0x2d,0x0a,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72, - 0x73,0x2e,0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x20,0x20,0x3d,0x20,0x64,0x65,0x66, - 0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x0a,0x4d, - 0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x62,0x6f,0x6f,0x6c, - 0x65,0x61,0x6e,0x20,0x20,0x3d,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69, - 0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65, - 0x63,0x74,0x6f,0x72,0x73,0x5b,0x22,0x6e,0x69,0x6c,0x22,0x5d,0x20,0x20,0x20,0x3d, - 0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e, - 0x75,0x73,0x65,0x72,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x64,0x65,0x66,0x61,0x75, - 0x6c,0x74,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x0a,0x4d,0x2e,0x69, - 0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x74,0x68,0x72,0x65,0x61,0x64, - 0x20,0x20,0x20,0x3d,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e,0x73, - 0x70,0x65,0x63,0x74,0x6f,0x72,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x73,0x2e,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20,0x20,0x3d,0x20,0x64, - 0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72, - 0x20,0x2d,0x2d,0x20,0x61,0x6c,0x6c,0x6f,0x77,0x73,0x20,0x33,0x72,0x64,0x20,0x70, - 0x61,0x72,0x74,0x79,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x20, - 0x74,0x6f,0x20,0x75,0x73,0x65,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x66,0x61,0x75, - 0x6c,0x74,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x20,0x69,0x66,0x20, - 0x6e,0x65,0x65,0x64,0x65,0x64,0x0a,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63, - 0x74,0x6f,0x72,0x73,0x2e,0x75,0x73,0x65,0x72,0x64,0x61,0x74,0x61,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x28,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x5f,0x69,0x6e, - 0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x29,0x29,0x20,0x2d,0x2d,0x20,0x64,0x72,0x6f,0x70,0x20, - 0x73,0x65,0x63,0x6f,0x6e,0x64,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65, - 0x63,0x74,0x6f,0x72,0x73,0x2e,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x65,0x73, - 0x63,0x61,0x70,0x65,0x20,0x6c,0x69,0x6e,0x65,0x62,0x72,0x65,0x61,0x6b,0x73,0x20, - 0x61,0x73,0x20,0x5c,0x6e,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x61,0x73, - 0x20,0x5c,0x3c,0x30,0x78,0x30,0x41,0x3e,0x20,0x6c,0x69,0x6b,0x65,0x20,0x25,0x71, - 0x20,0x64,0x6f,0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65, - 0x2c,0x20,0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x2c,0x20,0x73,0x66,0x6f,0x72, - 0x6d,0x61,0x74,0x28,0x22,0x25,0x71,0x22,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x29, - 0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x5c,0x5c,0x5c,0x6e,0x22,0x2c,0x20,0x22,0x5c, - 0x5c,0x6e,0x22,0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x4d,0x2e,0x69, - 0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x5b,0x22,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61, - 0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x66,0x6f,0x20,0x3d, - 0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x22,0x6e,0x53,0x66,0x6c,0x75,0x22,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x77,0x68,0x61,0x74,0x20,0x7e, - 0x3d,0x20,0x22,0x43,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x63,0x72,0x65, - 0x61,0x74,0x65,0x20,0x61,0x20,0x66,0x61,0x6e,0x63,0x79,0x20,0x72,0x65,0x70,0x72, - 0x65,0x73,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x69,0x66,0x20,0x70,0x6f, - 0x73,0x73,0x69,0x62,0x6c,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x70,0x72,0x20,0x3d,0x20,0x69,0x6e,0x66,0x6f, - 0x2e,0x6e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x61,0x6e,0x64,0x20,0x66,0x61,0x6e, - 0x63,0x79,0x5f,0x66,0x75,0x6e,0x63,0x5f,0x72,0x65,0x70,0x72,0x28,0x76,0x61,0x6c, - 0x75,0x65,0x2c,0x20,0x69,0x6e,0x66,0x6f,0x29,0x20,0x6f,0x72,0x20,0x74,0x6f,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x73,0x6f,0x75, - 0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29,0x20,0x3d,0x3d,0x20, - 0x22,0x40,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x70,0x72,0x20,0x3d,0x20,0x72,0x65,0x70,0x72, - 0x20,0x2e,0x2e,0x20,0x22,0x5c,0x6e,0x22,0x20,0x2e,0x2e,0x20,0x70,0x6c,0x61,0x74, - 0x66,0x6f,0x72,0x6d,0x2e,0x67,0x65,0x74,0x5f,0x75,0x72,0x69,0x28,0x22,0x40,0x22, - 0x20,0x2e,0x2e,0x20,0x69,0x6e,0x66,0x6f,0x2e,0x73,0x6f,0x75,0x72,0x63,0x65,0x29, - 0x20,0x2e,0x2e,0x20,0x22,0x5c,0x6e,0x22,0x20,0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x69,0x6e,0x66,0x6f,0x2e,0x6c,0x69,0x6e,0x65,0x64,0x65, - 0x66,0x69,0x6e,0x65,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70,0x20, - 0x3d,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d, - 0x65,0x2c,0x20,0x22,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x4c,0x75, - 0x61,0x29,0x22,0x2c,0x20,0x72,0x65,0x70,0x72,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e, - 0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72, - 0x6f,0x70,0x20,0x3d,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28, - 0x6e,0x61,0x6d,0x65,0x2c,0x20,0x22,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x22, - 0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x61,0x6c,0x75,0x65, - 0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x70,0x72,0x6f,0x70,0x20,0x74,0x68,0x65, - 0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x28,0x35,0x2e,0x31,0x20,0x6f,0x6e, - 0x6c,0x79,0x29,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20, - 0x69,0x73,0x20,0x64,0x75,0x6d,0x70,0x65,0x64,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x69, - 0x66,0x20,0x69,0x74,0x20,0x69,0x73,0x20,0x64,0x69,0x66,0x66,0x65,0x72,0x65,0x6e, - 0x74,0x20,0x66,0x72,0x6f,0x6d,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x65,0x6e, - 0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x6e, - 0x6f,0x74,0x20,0x61,0x20,0x63,0x6f,0x72,0x72,0x65,0x63,0x74,0x20,0x62,0x65,0x68, - 0x61,0x76,0x69,0x6f,0x72,0x3a,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65, - 0x6e,0x74,0x20,0x73,0x68,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65,0x20,0x64,0x75,0x6d, - 0x70,0x65,0x64,0x20,0x69,0x66,0x20,0x69,0x73,0x20,0x64,0x69,0x66,0x66,0x65,0x72, - 0x65,0x6e,0x74,0x20,0x66,0x72,0x6f,0x6d,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74, - 0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x6f,0x6e,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x65,0x6e,0x76,0x20, - 0x3d,0x20,0x67,0x65,0x74,0x66,0x65,0x6e,0x76,0x20,0x61,0x6e,0x64,0x20,0x67,0x65, - 0x74,0x66,0x65,0x6e,0x76,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x66,0x65,0x6e,0x76,0x20,0x61,0x6e,0x64,0x20,0x66,0x65,0x6e, - 0x76,0x20,0x7e,0x3d,0x20,0x67,0x65,0x74,0x66,0x65,0x6e,0x76,0x28,0x30,0x29,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x66,0x65,0x6e,0x76,0x70,0x72,0x6f,0x70,0x20,0x3d,0x20,0x4d,0x2e, - 0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x28,0x22,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e, - 0x6d,0x65,0x6e,0x74,0x22,0x2c,0x20,0x66,0x65,0x6e,0x76,0x2c,0x20,0x70,0x72,0x6f, - 0x70,0x2c,0x20,0x22,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x5b, - 0x22,0x2e,0x2e,0x70,0x72,0x6f,0x70,0x2e,0x61,0x74,0x74,0x72,0x2e,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x2e,0x2e,0x22,0x5d,0x22,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x66,0x65,0x6e,0x76,0x70,0x72,0x6f,0x70,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x66,0x65,0x6e,0x76,0x70,0x72,0x6f,0x70,0x2e,0x61,0x74, - 0x74,0x72,0x2e,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x22,0x73,0x70,0x65,0x63,0x69, - 0x61,0x6c,0x22,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70, - 0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x73,0x2e,0x74,0x61,0x62,0x6c,0x65,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65, - 0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61, - 0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72, - 0x6f,0x70,0x2c,0x20,0x69,0x73,0x63,0x75,0x73,0x74,0x6f,0x6d,0x20,0x3d,0x20,0x6d, - 0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x5f,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20, - 0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x70,0x72,0x6f, - 0x70,0x20,0x6f,0x72,0x20,0x69,0x73,0x63,0x75,0x73,0x74,0x6f,0x6d,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70,0x20,0x65, - 0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x74,0x65,0x72,0x61, - 0x74,0x65,0x20,0x6f,0x76,0x65,0x72,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x73,0x20,0x61,0x6e,0x64,0x20,0x64,0x65,0x74,0x65,0x63,0x74,0x20, - 0x61,0x72,0x72,0x61,0x79,0x73,0x20,0x61,0x74,0x20,0x74,0x68,0x65,0x20,0x73,0x61, - 0x6d,0x65,0x20,0x74,0x69,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6e, - 0x65,0x78,0x74,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x63, - 0x69,0x72,0x63,0x75,0x6d,0x76,0x65,0x6e,0x74,0x20,0x5f,0x5f,0x70,0x61,0x69,0x72, - 0x73,0x20,0x6d,0x65,0x74,0x61,0x6d,0x65,0x74,0x68,0x6f,0x64,0x20,0x69,0x6e,0x20, - 0x35,0x2e,0x32,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x73, - 0x61,0x72,0x72,0x61,0x79,0x2c,0x20,0x69,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x2c, - 0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x76,0x20,0x69, - 0x6e,0x20,0x6e,0x65,0x78,0x74,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x6e, - 0x69,0x6c,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e, - 0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x28,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65, - 0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x28,0x6b, - 0x29,0x2c,0x20,0x76,0x2c,0x20,0x70,0x72,0x6f,0x70,0x2c,0x20,0x6d,0x61,0x6b,0x65, - 0x5f,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x28,0x66,0x75,0x6c,0x6c,0x6e,0x61, - 0x6d,0x65,0x2c,0x20,0x6b,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x61,0x72,0x72,0x61,0x79,0x20,0x64,0x65,0x74,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x3a,0x20,0x6b,0x65,0x79,0x73,0x20,0x73,0x68,0x6f,0x75,0x6c,0x64,0x20, - 0x62,0x65,0x20,0x61,0x63,0x63,0x65,0x73,0x73,0x69,0x62,0x6c,0x65,0x20,0x62,0x79, - 0x20,0x31,0x2e,0x2e,0x6e,0x20,0x6b,0x65,0x79,0x73,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x73,0x61,0x72,0x72,0x61,0x79,0x20,0x3d,0x20,0x69,0x73,0x61, - 0x72,0x72,0x61,0x79,0x20,0x61,0x6e,0x64,0x20,0x72,0x61,0x77,0x67,0x65,0x74,0x28, - 0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x69,0x29,0x20,0x7e,0x3d,0x20,0x6e,0x69,0x6c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x20,0x3d,0x20,0x69,0x20,0x2b, - 0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x65,0x6d,0x70,0x74,0x79,0x20,0x74,0x61,0x62,0x6c,0x65,0x73,0x20,0x61, - 0x72,0x65,0x20,0x63,0x6f,0x6e,0x73,0x69,0x64,0x65,0x72,0x65,0x64,0x20,0x61,0x73, - 0x20,0x74,0x61,0x62,0x6c,0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69, - 0x73,0x61,0x72,0x72,0x61,0x79,0x20,0x61,0x6e,0x64,0x20,0x69,0x20,0x3e,0x20,0x31, - 0x20,0x74,0x68,0x65,0x6e,0x20,0x70,0x72,0x6f,0x70,0x2e,0x61,0x74,0x74,0x72,0x2e, - 0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x22,0x73,0x65,0x71,0x75,0x65,0x6e,0x63,0x65, - 0x22,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x70,0x72,0x6f,0x70,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x4d,0x2e,0x69,0x6e, - 0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x5b,0x4d,0x55,0x4c,0x54,0x49,0x56,0x41, - 0x4c,0x5f,0x4d,0x54,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61, - 0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x76,0x61,0x6c,0x75,0x65,0x2e,0x6e,0x20,0x3d, - 0x3d,0x20,0x31,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x69,0x72,0x65,0x63, - 0x74,0x6c,0x79,0x20,0x74,0x68,0x65,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x61,0x73, - 0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x5b,0x31,0x5d,0x2c, - 0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d, - 0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x77,0x72,0x61,0x70,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x73,0x20,0x69,0x6e,0x73,0x69,0x64,0x65,0x20,0x61,0x20,0x6d,0x75,0x6c,0x74, - 0x69,0x76,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x74,0x61,0x69,0x6e,0x65,0x72,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f, - 0x70,0x20,0x3d,0x20,0x4d,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x22,0x6d,0x75,0x6c,0x74,0x69,0x76,0x61,0x6c,0x22,0x2c, - 0x20,0x22,0x22,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x6e,0x6f,0x74,0x20,0x70,0x72,0x6f,0x70,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x31,0x2c,0x20, - 0x76,0x61,0x6c,0x75,0x65,0x2e,0x6e,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x28,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x70,0x72,0x69,0x6e,0x74,0x61, - 0x62,0x6c,0x65,0x5f,0x6b,0x65,0x79,0x28,0x69,0x29,0x2c,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x5b,0x69,0x5d,0x2c,0x20,0x70,0x72,0x6f,0x70,0x2c,0x20,0x66,0x75,0x6c,0x6c, - 0x6e,0x61,0x6d,0x65,0x20,0x2e,0x2e,0x20,0x22,0x5b,0x22,0x20,0x2e,0x2e,0x20,0x69, - 0x20,0x2e,0x2e,0x20,0x22,0x5d,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x74,0x65, - 0x72,0x6e,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x20,0x2d,0x2d,0x0a,0x0a, - 0x2d,0x2d,0x20,0x55,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x69,0x6e,0x73,0x70,0x65, - 0x63,0x74,0x20,0x22,0x6d,0x75,0x6c,0x74,0x69,0x76,0x61,0x6c,0x22,0x20,0x6f,0x72, - 0x20,0x22,0x76,0x61,0x72,0x61,0x72,0x67,0x22,0x20,0x76,0x61,0x6c,0x75,0x65,0x73, - 0x2e,0x20,0x54,0x68,0x65,0x20,0x74,0x79,0x70,0x69,0x63,0x61,0x6c,0x20,0x75,0x73, - 0x65,0x20,0x69,0x73,0x20,0x74,0x6f,0x20,0x70,0x61,0x63,0x6b,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x28,0x73,0x29,0x20, - 0x69,0x6e,0x20,0x61,0x20,0x73,0x69,0x6e,0x67,0x6c,0x65,0x0a,0x2d,0x2d,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x20,0x74,0x6f,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x2e, - 0x20,0x54,0x68,0x65,0x20,0x4d,0x75,0x6c,0x74,0x69,0x76,0x61,0x6c,0x20,0x69,0x6e, - 0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x70, - 0x61,0x73,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x70,0x72, - 0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x61,0x73,0x20,0x61,0x20,0x73,0x69,0x6e,0x67, - 0x6c,0x65,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x74,0x68,0x65,0x79,0x20,0x77, - 0x69,0x6c,0x6c,0x20,0x62,0x65,0x0a,0x2d,0x2d,0x20,0x63,0x6f,0x72,0x72,0x65,0x63, - 0x74,0x6c,0x79,0x20,0x72,0x65,0x70,0x6f,0x72,0x74,0x65,0x64,0x20,0x74,0x6f,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x4d,0x75,0x6c,0x74,0x69,0x76,0x61,0x6c,0x28,0x2e,0x2e,0x2e, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x74, - 0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x6e,0x3d,0x73,0x65, - 0x6c,0x65,0x63,0x74,0x28,0x22,0x23,0x22,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x2c,0x20, - 0x2e,0x2e,0x2e,0x20,0x7d,0x2c,0x20,0x4d,0x55,0x4c,0x54,0x49,0x56,0x41,0x4c,0x5f, - 0x4d,0x54,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x4d,0x61,0x6b, - 0x65,0x73,0x20,0x61,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x66,0x6f, - 0x72,0x6d,0x20,0x61,0x20,0x6e,0x61,0x6d,0x65,0x2f,0x76,0x61,0x6c,0x75,0x65,0x20, - 0x70,0x61,0x69,0x72,0x20,0x28,0x61,0x6e,0x64,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61, - 0x6d,0x65,0x29,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x6e,0x20, - 0x2a,0x2a,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61,0x6c,0x2a,0x2a,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x73,0x68,0x6f,0x75,0x6c, - 0x64,0x20,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x62,0x79, - 0x20,0x33,0x72,0x64,0x20,0x70,0x61,0x72,0x74,0x79,0x20,0x69,0x6e,0x73,0x70,0x65, - 0x63,0x74,0x6f,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d, - 0x20,0x23,0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x63,0x78,0x74,0x5f,0x69,0x64,0x20, - 0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x49,0x44,0x20,0x69,0x6e,0x20,0x77,0x68, - 0x69,0x63,0x68,0x20,0x74,0x68,0x69,0x73,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x72, - 0x65,0x73,0x69,0x64,0x65,0x73,0x20,0x28,0x77,0x6f,0x72,0x6b,0x61,0x72,0x6f,0x75, - 0x6e,0x64,0x20,0x62,0x75,0x67,0x20,0x33,0x35,0x32,0x33,0x31,0x36,0x29,0x0a,0x2d, - 0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x54, - 0x68,0x65,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x74,0x6f,0x20,0x64,0x65,0x62,0x75, - 0x67,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x6e,0x61,0x6d,0x65, - 0x20,0x54,0x68,0x65,0x20,0x6e,0x61,0x6d,0x65,0x20,0x61,0x73,0x73,0x6f,0x63,0x69, - 0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c, - 0x20,0x70,0x61,0x73,0x73,0x65,0x64,0x20,0x74,0x68,0x72,0x6f,0x75,0x67,0x68,0x20, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x73,0x6f,0x20,0x69,0x74,0x20, - 0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x61,0x6e,0x79,0x74,0x68,0x69,0x6e,0x67,0x0a, - 0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x41,0x20,0x4c,0x75,0x61, - 0x20,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x74,0x6f,0x20,0x65, - 0x76,0x61,0x6c,0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x74,0x68,0x61,0x74,0x20, - 0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x61,0x67,0x61,0x69,0x6e,0x20,0x28, - 0x69,0x66,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x63,0x6f,0x6d,0x70,0x75,0x74,0x65,0x64, - 0x20,0x61,0x75,0x74,0x6f,0x6d,0x61,0x74,0x69,0x63,0x61,0x6c,0x6c,0x79,0x29,0x0a, - 0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x6e,0x75,0x6d,0x62,0x65, - 0x72,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x54,0x68,0x65,0x20,0x6d,0x61,0x78,0x69, - 0x6d,0x75,0x6d,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x64,0x65,0x70, - 0x74,0x68,0x20,0x28,0x72,0x65,0x63,0x75,0x72,0x73,0x69,0x76,0x65,0x20,0x63,0x61, - 0x6c,0x6c,0x73,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23, - 0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x70,0x61,0x67,0x65,0x73,0x69,0x7a,0x65,0x20, - 0x6d,0x61,0x78,0x69,0x6d,0x75,0x6d,0x20,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e, - 0x20,0x74,0x6f,0x20,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x0a,0x2d,0x2d,0x20,0x40, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x70,0x61, - 0x67,0x65,0x20,0x54,0x68,0x65,0x20,0x70,0x61,0x67,0x65,0x20,0x74,0x6f,0x20,0x67, - 0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x20,0x28,0x30,0x20,0x62,0x61,0x73,0x65,0x64, - 0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x23,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x20,0x73,0x69,0x7a,0x65,0x5f,0x6c,0x69,0x6d,0x69,0x74,0x20,0x4f, - 0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x2c,0x20,0x69,0x66,0x20,0x73,0x65,0x74,0x2c, - 0x20,0x74,0x68,0x65,0x20,0x6d,0x61,0x78,0x69,0x6d,0x75,0x6d,0x20,0x73,0x69,0x7a, - 0x65,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20, - 0x72,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x28, - 0x69,0x6e,0x20,0x62,0x79,0x74,0x65,0x73,0x29,0x0a,0x2d,0x2d,0x20,0x40,0x70,0x61, - 0x72,0x61,0x6d,0x20,0x23,0x62,0x6f,0x6f,0x6c,0x65,0x61,0x6e,0x20,0x73,0x61,0x66, - 0x65,0x5f,0x6e,0x61,0x6d,0x65,0x20,0x49,0x66,0x20,0x74,0x72,0x75,0x65,0x2c,0x20, - 0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x20, - 0x74,0x68,0x65,0x20,0x6e,0x61,0x6d,0x65,0x20,0x61,0x73,0x20,0x74,0x61,0x62,0x6c, - 0x65,0x20,0x6b,0x65,0x79,0x0a,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x23,0x44,0x42,0x47,0x50,0x50,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x72, - 0x6f,0x6f,0x74,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x0a,0x2d,0x2d,0x20, - 0x40,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x70,0x61,0x72,0x65,0x6e, - 0x74,0x3d,0x23,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e,0x74,0x72, - 0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x5d,0x20,0x6d,0x61,0x6b,0x65,0x5f, - 0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x0a,0x2d,0x2d,0x54,0x4f,0x44,0x4f,0x20, - 0x42,0x55,0x47,0x20,0x45,0x43,0x4c,0x49,0x50,0x53,0x45,0x20,0x54,0x4f,0x4f,0x4c, - 0x53,0x4c,0x49,0x4e,0x55,0x58,0x2d,0x39,0x39,0x20,0x33,0x35,0x32,0x33,0x31,0x36, - 0x20,0x3a,0x20,0x61,0x73,0x20,0x61,0x20,0x77,0x6f,0x72,0x6b,0x61,0x72,0x6f,0x75, - 0x6e,0x64,0x2c,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x69,0x73,0x20,0x65, - 0x6e,0x63,0x6f,0x64,0x65,0x64,0x20,0x69,0x6e,0x74,0x6f,0x20,0x74,0x68,0x65,0x20, - 0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x79,0x0a,0x4d,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x79,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x63,0x78,0x74, - 0x5f,0x69,0x64,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x6e,0x61,0x6d,0x65, - 0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x64,0x65,0x70,0x74, - 0x68,0x2c,0x20,0x70,0x61,0x67,0x65,0x73,0x69,0x7a,0x65,0x2c,0x20,0x70,0x61,0x67, - 0x65,0x2c,0x20,0x73,0x69,0x7a,0x65,0x5f,0x6c,0x69,0x6d,0x69,0x74,0x2c,0x20,0x73, - 0x61,0x66,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d, - 0x65,0x20,0x6f,0x72,0x20,0x22,0x28,0x2e,0x2e,0x2e,0x29,0x5b,0x22,0x20,0x2e,0x2e, - 0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x5f,0x6b,0x65,0x79,0x28,0x6e,0x61, - 0x6d,0x65,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5d,0x22,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x6e,0x6f,0x74,0x20,0x73,0x61,0x66,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x67,0x65,0x6e,0x65, - 0x72,0x61,0x74,0x65,0x5f,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x5f,0x6b, - 0x65,0x79,0x28,0x6e,0x61,0x6d,0x65,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f, - 0x72,0x20,0x3d,0x20,0x63,0x6f,0x63,0x72,0x65,0x61,0x74,0x65,0x28,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d, - 0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x29,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b,0x20,0x3d,0x20, - 0x7b,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x6f, - 0x6f,0x74,0x6e,0x6f,0x64,0x65,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x63,0x61,0x74,0x63,0x68,0x74,0x68,0x69,0x73,0x20,0x3d,0x20,0x74,0x72,0x75, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6e,0x6f,0x64,0x65, - 0x73,0x74,0x6f,0x73,0x6b,0x69,0x70,0x20,0x3d,0x20,0x70,0x61,0x67,0x65,0x20,0x2a, - 0x20,0x70,0x61,0x67,0x65,0x73,0x69,0x7a,0x65,0x20,0x2d,0x2d,0x20,0x6e,0x6f,0x64, - 0x65,0x73,0x20,0x74,0x6f,0x20,0x73,0x6b,0x69,0x70,0x20,0x61,0x74,0x20,0x72,0x6f, - 0x6f,0x74,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x74,0x6f,0x20,0x72,0x65,0x73,0x70, - 0x65,0x63,0x74,0x20,0x70,0x61,0x67,0x69,0x6e,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d, - 0x65,0x5f,0x70,0x72,0x65,0x66,0x69,0x78,0x20,0x3d,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x63,0x78,0x74,0x5f,0x69,0x64,0x29,0x2e,0x2e,0x22,0x7c,0x22, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x74,0x72,0x75,0x65, - 0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x2c,0x20,0x6e,0x61,0x6d,0x65,0x2c,0x20, - 0x64,0x61,0x74,0x61,0x74,0x79,0x70,0x65,0x2c,0x20,0x72,0x65,0x70,0x72,0x2c,0x20, - 0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65, - 0x20,0x3d,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x63,0x6f,0x72,0x65,0x73,0x75, - 0x6d,0x65,0x28,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x2c,0x20,0x63,0x61, - 0x74,0x63,0x68,0x74,0x68,0x69,0x73,0x20,0x61,0x6e,0x64,0x20,0x70,0x72,0x6f,0x70, - 0x73,0x74,0x61,0x63,0x6b,0x5b,0x23,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b, - 0x5d,0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x66,0x69,0x6e,0x61,0x6c,0x69,0x7a,0x65,0x20,0x61, - 0x6e,0x64,0x20,0x70,0x6f,0x70,0x20,0x61,0x6c,0x6c,0x20,0x66,0x69,0x6e,0x69,0x73, - 0x68,0x65,0x64,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x70,0x72,0x6f, - 0x70,0x73,0x74,0x61,0x63,0x6b,0x5b,0x23,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63, - 0x6b,0x5d,0x20,0x7e,0x3d,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x64,0x6f,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x74,0x6f,0x70,0x6f,0x70,0x20,0x3d,0x20,0x70,0x72,0x6f,0x70,0x73,0x74, - 0x61,0x63,0x6b,0x5b,0x23,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b,0x5d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x70,0x6f, - 0x70,0x2e,0x61,0x74,0x74,0x72,0x2e,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20, - 0x3d,0x20,0x75,0x74,0x69,0x6c,0x2e,0x72,0x61,0x77,0x62,0x36,0x34,0x28,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x5f,0x70,0x72,0x65,0x66,0x69,0x78,0x20,0x2e,0x2e, - 0x20,0x74,0x6f,0x70,0x6f,0x70,0x2e,0x61,0x74,0x74,0x72,0x2e,0x66,0x75,0x6c,0x6c, - 0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b,0x5b,0x23,0x70,0x72,0x6f, - 0x70,0x73,0x74,0x61,0x63,0x6b,0x5d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x63,0x6f,0x73,0x74,0x61,0x74,0x75,0x73,0x28,0x67,0x65, - 0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x29,0x20,0x3d,0x3d,0x20,0x22,0x64,0x65,0x61, - 0x64,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x65,0x6e, - 0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x70,0x72,0x6f,0x70,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x70,0x72,0x6f,0x70,0x65, - 0x72,0x74,0x79,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x20,0x3d,0x20, - 0x30,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70, - 0x61,0x67,0x65,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x61,0x67,0x65,0x73,0x69, - 0x7a,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x70,0x61,0x67,0x65,0x20,0x3d,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x61,0x6e, - 0x64,0x20,0x30,0x20,0x6f,0x72,0x20,0x70,0x61,0x67,0x65,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x79,0x70,0x65,0x20,0x3d,0x20, - 0x64,0x61,0x74,0x61,0x74,0x79,0x70,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x6e,0x61,0x6d, - 0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, - 0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61, - 0x6d,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x22,0x62,0x61,0x73,0x65, - 0x36,0x34,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x23,0x72,0x65,0x70,0x72,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x75,0x74,0x69,0x6c,0x2e,0x62,0x36,0x34,0x28,0x73, - 0x69,0x7a,0x65,0x5f,0x6c,0x69,0x6d,0x69,0x74,0x20,0x61,0x6e,0x64,0x20,0x72,0x65, - 0x70,0x72,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x20,0x73,0x69,0x7a,0x65,0x5f,0x6c, - 0x69,0x6d,0x69,0x74,0x29,0x20,0x6f,0x72,0x20,0x72,0x65,0x70,0x72,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x72, - 0x65,0x6e,0x74,0x2e,0x61,0x74,0x74,0x72,0x2e,0x63,0x68,0x69,0x6c,0x64,0x72,0x65, - 0x6e,0x20,0x3d,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2e,0x61,0x74,0x74,0x72,0x2e,0x6e,0x75, - 0x6d,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x20,0x3d,0x20,0x28,0x70,0x61,0x72, - 0x65,0x6e,0x74,0x2e,0x61,0x74,0x74,0x72,0x2e,0x6e,0x75,0x6d,0x63,0x68,0x69,0x6c, - 0x64,0x72,0x65,0x6e,0x20,0x6f,0x72,0x20,0x30,0x29,0x20,0x2b,0x20,0x31,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x61, - 0x6b,0x65,0x20,0x70,0x61,0x67,0x69,0x6e,0x61,0x74,0x69,0x6f,0x6e,0x20,0x69,0x6e, - 0x74,0x6f,0x20,0x61,0x63,0x63,0x6f,0x6e,0x74,0x20,0x74,0x6f,0x20,0x6b,0x6e,0x6f, - 0x77,0x20,0x69,0x66,0x20,0x6e,0x6f,0x64,0x65,0x20,0x6e,0x65,0x65,0x64,0x73,0x20, - 0x74,0x6f,0x20,0x62,0x65,0x20,0x63,0x61,0x74,0x63,0x68,0x65,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x61,0x74,0x63,0x68,0x74, - 0x68,0x69,0x73,0x20,0x3d,0x20,0x23,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x3c,0x3d, - 0x20,0x70,0x61,0x67,0x65,0x73,0x69,0x7a,0x65,0x20,0x61,0x6e,0x64,0x20,0x23,0x70, - 0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b,0x20,0x3c,0x3d,0x20,0x64,0x65,0x70,0x74, - 0x68,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x3d,0x3d,0x20,0x72,0x6f,0x6f,0x74,0x6e, - 0x6f,0x64,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x61,0x74,0x63,0x68,0x74,0x68, - 0x69,0x73,0x20,0x3d,0x20,0x63,0x61,0x74,0x63,0x68,0x74,0x68,0x69,0x73,0x20,0x61, - 0x6e,0x64,0x20,0x6e,0x6f,0x64,0x65,0x73,0x74,0x6f,0x73,0x6b,0x69,0x70,0x20,0x3c, - 0x3d,0x20,0x30,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6e,0x6f,0x64,0x65,0x73,0x74,0x6f,0x73,0x6b,0x69,0x70,0x20, - 0x3d,0x20,0x6e,0x6f,0x64,0x65,0x73,0x74,0x6f,0x73,0x6b,0x69,0x70,0x20,0x2d,0x20, - 0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x61,0x64,0x64,0x20,0x6e,0x6f,0x64,0x65,0x20,0x74,0x6f,0x20,0x74,0x72,0x65, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x63,0x61,0x74,0x63,0x68,0x74,0x68,0x69,0x73,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61, - 0x72,0x65,0x6e,0x74,0x5b,0x23,0x70,0x61,0x72,0x65,0x6e,0x74,0x20,0x2b,0x20,0x31, - 0x5d,0x20,0x3d,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b, - 0x5b,0x23,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b,0x20,0x2b,0x20,0x31,0x5d, - 0x20,0x3d,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x6f,0x6f,0x74,0x6e,0x6f,0x64,0x65,0x20,0x3d,0x20,0x70,0x72,0x6f,0x70, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x61,0x74, - 0x63,0x68,0x74,0x68,0x69,0x73,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70,0x73,0x74, - 0x61,0x63,0x6b,0x5b,0x23,0x70,0x72,0x6f,0x70,0x73,0x74,0x61,0x63,0x6b,0x20,0x2b, - 0x20,0x31,0x5d,0x20,0x3d,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x6f,0x6f,0x74,0x6e, - 0x6f,0x64,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x4d,0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f, - 0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x0a,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c,0x75,0x67,0x69,0x6e,0x73,0x2e,0x66,0x66, - 0x69,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61, - 0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c,0x75,0x67, - 0x69,0x6e,0x73,0x2e,0x66,0x66,0x69,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70, - 0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x32,0x2d, - 0x32,0x30,0x31,0x33,0x20,0x4a,0x75,0x6c,0x69,0x65,0x6e,0x20,0x44,0x65,0x73,0x67, - 0x61,0x74,0x73,0x0a,0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74, - 0x73,0x20,0x72,0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73, - 0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65, - 0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61, - 0x74,0x65,0x72,0x69,0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d, - 0x61,0x64,0x65,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e, - 0x64,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66, - 0x20,0x74,0x68,0x65,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62, - 0x6c,0x69,0x63,0x20,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30, - 0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70, - 0x61,0x6e,0x69,0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72, - 0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20, - 0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20, - 0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70, - 0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c, - 0x2d,0x76,0x31,0x30,0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x43,0x6f,0x6e,0x74,0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d, - 0x20,0x20,0x20,0x20,0x20,0x4a,0x75,0x6c,0x69,0x65,0x6e,0x20,0x44,0x65,0x73,0x67, - 0x61,0x74,0x73,0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50, - 0x49,0x20,0x61,0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61, - 0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x4c,0x75,0x61,0x4a,0x49,0x54,0x20,0x63, - 0x64,0x61,0x74,0x61,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x6c,0x69,0x62,0x72,0x61,0x72,0x79,0x2e,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x20, - 0x6b,0x6e,0x6f,0x77,0x6e,0x20,0x69,0x73,0x73,0x75,0x65,0x73,0x3a,0x0a,0x2d,0x2d, - 0x20,0x20,0x2a,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x61, - 0x72,0x65,0x20,0x64,0x65,0x2d,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x64, - 0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x69,0x66,0x20,0x69,0x6e,0x73,0x70,0x65,0x63, - 0x74,0x5f,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x69,0x73,0x20, - 0x75,0x6e,0x73,0x65,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x2a,0x20,0x69,0x73,0x20,0x61, - 0x75,0x74,0x6f,0x6d,0x61,0x74,0x69,0x63,0x20,0x70,0x6f,0x69,0x6e,0x74,0x65,0x72, - 0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x20,0x64, - 0x65,0x2d,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x69,0x6e,0x67,0x20,0x69,0x73, - 0x20,0x70,0x6f,0x73,0x73,0x69,0x62,0x6c,0x65,0x20,0x3f,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x20,0x28,0x6f,0x6e,0x6c,0x79,0x20,0x66,0x6f,0x72,0x20,0x66,0x69,0x72,0x73, - 0x74,0x20,0x69,0x74,0x65,0x6d,0x20,0x69,0x6e,0x20,0x63,0x61,0x73,0x65,0x20,0x6f, - 0x66,0x20,0x61,0x72,0x72,0x61,0x79,0x73,0x29,0x2e,0x20,0x50,0x6f,0x73,0x73,0x69, - 0x62,0x6c,0x65,0x20,0x6c,0x65,0x61,0x64,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x74,0x61,0x63,0x6b,0x6f,0x76,0x65, - 0x72,0x66,0x6c,0x6f,0x77,0x2e,0x63,0x6f,0x6d,0x2f,0x71,0x75,0x65,0x73,0x74,0x69, - 0x6f,0x6e,0x73,0x2f,0x37,0x31,0x33,0x34,0x35,0x39,0x30,0x2f,0x68,0x6f,0x77,0x2d, - 0x74,0x6f,0x2d,0x74,0x65,0x73,0x74,0x2d,0x69,0x66,0x2d,0x61,0x6e,0x2d,0x61,0x64, - 0x64,0x72,0x65,0x73,0x73,0x2d,0x69,0x73,0x2d,0x72,0x65,0x61,0x64,0x61,0x62,0x6c, - 0x65,0x2d,0x69,0x6e,0x2d,0x6c,0x69,0x6e,0x75,0x78,0x2d,0x75,0x73,0x65,0x72,0x73, - 0x70,0x61,0x63,0x65,0x2d,0x61,0x70,0x70,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x68, - 0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x6f,0x66,0x74,0x77,0x61, - 0x72,0x65,0x76,0x65,0x72,0x69,0x66,0x79,0x2e,0x63,0x6f,0x6d,0x2f,0x62,0x6c,0x6f, - 0x67,0x2f,0x3f,0x70,0x3d,0x33,0x31,0x39,0x0a,0x2d,0x2d,0x20,0x20,0x2a,0x20,0x77, - 0x68,0x65,0x6e,0x20,0x73,0x65,0x74,0x74,0x69,0x6e,0x67,0x20,0x61,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x20,0x66,0x72,0x6f,0x6d,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65, - 0x2c,0x20,0x74,0x68,0x65,0x20,0x74,0x79,0x70,0x65,0x20,0x69,0x73,0x20,0x73,0x6f, - 0x6d,0x65,0x74,0x69,0x6d,0x65,0x73,0x20,0x63,0x68,0x61,0x6e,0x67,0x65,0x64,0x20, - 0x28,0x65,0x2e,0x67,0x2e,0x20,0x69,0x6e,0x74,0x20,0x3d,0x3e,0x20,0x6e,0x75,0x6d, - 0x62,0x65,0x72,0x29,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x74,0x72, - 0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x72,0x65,0x71,0x75, - 0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x69,0x6e, - 0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x22,0x0a,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x71, - 0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70, - 0x6c,0x75,0x67,0x69,0x6e,0x73,0x2e,0x66,0x66,0x69,0x2e,0x72,0x65,0x66,0x6c,0x65, - 0x63,0x74,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x66,0x69,0x20,0x3d,0x20, - 0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x66,0x66,0x69,0x22,0x0a,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x2c,0x20,0x74,0x79,0x70,0x65,0x2c,0x20,0x61, - 0x73,0x73,0x65,0x72,0x74,0x2c,0x20,0x73,0x66,0x6f,0x72,0x6d,0x61,0x74,0x2c,0x20, - 0x74,0x63,0x6f,0x6e,0x63,0x61,0x74,0x20,0x3d,0x20,0x74,0x6f,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2c,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x2c,0x20,0x74,0x79, - 0x70,0x65,0x2c,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x2c,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x2c,0x20,0x74,0x61,0x62,0x6c,0x65, - 0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4d, - 0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x57,0x68,0x65,0x74, - 0x68,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63, - 0x65,0x20,0x74,0x79,0x70,0x65,0x73,0x20,0x61,0x72,0x65,0x20,0x69,0x6e,0x73,0x70, - 0x65,0x63,0x74,0x65,0x64,0x2e,0x20,0x55,0x73,0x75,0x61,0x6c,0x6c,0x79,0x20,0x72, - 0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x73,0x68,0x6f,0x75,0x6c,0x64, - 0x20,0x62,0x65,0x20,0x73,0x61,0x66,0x65,0x20,0x28,0x61,0x74,0x20,0x6c,0x65,0x61, - 0x73,0x74,0x20,0x61,0x20,0x62,0x69,0x74,0x0a,0x2d,0x2d,0x20,0x73,0x61,0x66,0x65, - 0x72,0x20,0x74,0x68,0x61,0x6e,0x20,0x70,0x6f,0x69,0x6e,0x74,0x65,0x72,0x73,0x29, - 0x20,0x73,0x6f,0x20,0x74,0x68,0x65,0x79,0x20,0x61,0x72,0x65,0x20,0x69,0x6e,0x73, - 0x70,0x65,0x63,0x74,0x65,0x64,0x2e,0x20,0x49,0x66,0x20,0x61,0x20,0x72,0x65,0x66, - 0x65,0x72,0x65,0x6e,0x63,0x65,0x20,0x70,0x6f,0x69,0x6e,0x74,0x73,0x20,0x74,0x6f, - 0x20,0x75,0x6e,0x73,0x61,0x66,0x65,0x20,0x6d,0x65,0x6d,0x6f,0x72,0x79,0x2c,0x20, - 0x74,0x68,0x65,0x20,0x77,0x68,0x6f,0x6c,0x65,0x0a,0x2d,0x2d,0x20,0x70,0x72,0x6f, - 0x67,0x72,0x61,0x6d,0x20,0x63,0x6f,0x75,0x6c,0x64,0x20,0x63,0x72,0x61,0x73,0x68, - 0x20,0x21,0x0a,0x2d,0x2d,0x20,0x49,0x66,0x20,0x74,0x68,0x69,0x73,0x20,0x66,0x65, - 0x61,0x74,0x75,0x72,0x65,0x20,0x69,0x73,0x20,0x64,0x69,0x73,0x61,0x62,0x6c,0x65, - 0x64,0x2c,0x20,0x64,0x65,0x65,0x70,0x6c,0x79,0x20,0x6e,0x65,0x73,0x74,0x65,0x64, - 0x20,0x43,0x20,0x74,0x79,0x70,0x65,0x73,0x20,0x77,0x69,0x6c,0x6c,0x20,0x6e,0x6f, - 0x74,0x20,0x62,0x65,0x20,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x65,0x64,0x20,0x63, - 0x6f,0x72,0x72,0x65,0x63,0x74,0x6c,0x79,0x20,0x61,0x73,0x20,0x65,0x76,0x61,0x6c, - 0x75,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x20,0x68,0x61,0x73,0x20,0x61,0x20, - 0x72,0x65,0x63,0x75,0x72,0x73,0x69,0x6f,0x6e,0x20,0x6c,0x69,0x6d,0x69,0x74,0x2c, - 0x20,0x61,0x6e,0x79,0x20,0x66,0x75,0x72,0x74,0x68,0x65,0x72,0x20,0x65,0x76,0x61, - 0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x64,0x6f,0x6e,0x65,0x20, - 0x74,0x68,0x72,0x6f,0x75,0x67,0x68,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63, - 0x65,0x73,0x2e,0x0a,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x5f,0x72,0x65, - 0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x0a, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65, - 0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74, - 0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x77,0x68,0x61,0x74,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x74,0x20,0x3d,0x3d,0x20,0x22,0x69,0x6e,0x74,0x22,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x72,0x65,0x66,0x63,0x74,0x2e,0x62,0x6f,0x6f,0x6c,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x74,0x20,0x3d,0x20,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x75,0x73,0x65,0x20,0x43,0x39,0x39,0x20,0x74, - 0x79,0x70,0x65,0x20,0x6e,0x6f,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x74,0x6f,0x20, - 0x67,0x69,0x76,0x65,0x20,0x6d,0x6f,0x72,0x65,0x20,0x64,0x65,0x74,0x61,0x69,0x6c, - 0x73,0x20,0x61,0x62,0x6f,0x75,0x74,0x20,0x61,0x63,0x75,0x74,0x61,0x6c,0x20,0x74, - 0x79,0x70,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x74,0x20,0x3d,0x20,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x75,0x6e,0x73,0x69,0x67, - 0x6e,0x65,0x64,0x20,0x61,0x6e,0x64,0x20,0x22,0x75,0x69,0x6e,0x74,0x22,0x20,0x6f, - 0x72,0x20,0x22,0x69,0x6e,0x74,0x22,0x29,0x20,0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x73,0x69,0x7a,0x65,0x20, - 0x2a,0x20,0x38,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5f,0x74,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x69,0x66,0x20,0x74,0x20,0x3d,0x3d,0x20,0x22,0x66,0x6c,0x6f,0x61,0x74,0x22, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x61,0x73,0x73,0x75,0x6d,0x65,0x20,0x49,0x45,0x45,0x45,0x37,0x35,0x34,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x66,0x63,0x74,0x2e,0x73,0x69,0x7a,0x65,0x20,0x3d,0x3d,0x20,0x20,0x38,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x74,0x20,0x3d,0x20,0x22,0x64,0x6f,0x75,0x62,0x6c,0x65, - 0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66, - 0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x73,0x69,0x7a,0x65,0x20,0x3d,0x3d,0x20,0x31, - 0x36,0x20,0x74,0x68,0x65,0x6e,0x20,0x74,0x20,0x3d,0x20,0x22,0x6c,0x6f,0x6e,0x67, - 0x20,0x64,0x6f,0x75,0x62,0x6c,0x65,0x22,0x20,0x2d,0x2d,0x20,0x6e,0x6f,0x74,0x20, - 0x72,0x65,0x61,0x6c,0x6c,0x79,0x20,0x73,0x75,0x72,0x65,0x20,0x74,0x68,0x69,0x73, - 0x20,0x6f,0x6e,0x65,0x20,0x69,0x73,0x20,0x61,0x6c,0x77,0x61,0x79,0x73,0x20,0x74, - 0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x74,0x20,0x3d,0x3d,0x20, - 0x22,0x73,0x74,0x72,0x75,0x63,0x74,0x22,0x20,0x6f,0x72,0x20,0x74,0x20,0x3d,0x3d, - 0x20,0x22,0x65,0x6e,0x75,0x6d,0x22,0x20,0x6f,0x72,0x20,0x74,0x20,0x3d,0x3d,0x20, - 0x22,0x75,0x6e,0x69,0x6f,0x6e,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x6e, - 0x61,0x6d,0x65,0x20,0x61,0x6e,0x64,0x20,0x28,0x74,0x20,0x2e,0x2e,0x20,0x22,0x20, - 0x22,0x20,0x2e,0x2e,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x6e,0x61,0x6d,0x65,0x29, - 0x20,0x6f,0x72,0x20,0x28,0x22,0x61,0x6e,0x6f,0x6e,0x79,0x6d,0x6f,0x75,0x73,0x20, - 0x22,0x2e,0x2e,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66, - 0x20,0x74,0x20,0x3d,0x3d,0x20,0x22,0x66,0x75,0x6e,0x63,0x22,0x20,0x74,0x68,0x65, - 0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x20,0x3d,0x20,0x22,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x46,0x46,0x49,0x29,0x22,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x74,0x20,0x3d,0x3d,0x20,0x22, - 0x70,0x74,0x72,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x74,0x20,0x3d,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e, - 0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x65,0x6c,0x65,0x6d,0x65,0x6e, - 0x74,0x5f,0x74,0x79,0x70,0x65,0x29,0x20,0x2e,0x2e,0x20,0x22,0x2a,0x22,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x74,0x20,0x3d,0x3d,0x20,0x22, - 0x72,0x65,0x66,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x74,0x20,0x3d,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e, - 0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x65,0x6c,0x65,0x6d,0x65,0x6e, - 0x74,0x5f,0x74,0x79,0x70,0x65,0x29,0x20,0x2e,0x2e,0x20,0x22,0x26,0x22,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x74,0x20,0x3d,0x3d,0x20,0x22, - 0x66,0x69,0x65,0x6c,0x64,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x6b,0x65,0x5f, - 0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x74, - 0x79,0x70,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20, - 0x74,0x20,0x3d,0x3d,0x20,0x22,0x62,0x69,0x74,0x66,0x69,0x65,0x6c,0x64,0x22,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x20,0x3d, - 0x20,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x2e,0x75,0x6e,0x73, - 0x69,0x67,0x6e,0x65,0x64,0x20,0x61,0x6e,0x64,0x20,0x22,0x75,0x6e,0x73,0x69,0x67, - 0x6e,0x65,0x64,0x22,0x20,0x6f,0x72,0x20,0x22,0x73,0x69,0x67,0x6e,0x65,0x64,0x22, - 0x29,0x20,0x2e,0x2e,0x20,0x22,0x3a,0x22,0x20,0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x73,0x69,0x7a,0x65,0x20, - 0x2a,0x20,0x38,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x66, - 0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x72,0x65,0x66,0x63,0x74,0x2e,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x74,0x20,0x3d,0x20,0x22,0x63,0x6f,0x6e,0x73,0x74,0x20,0x22,0x20,0x2e,0x2e, - 0x20,0x74,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x72,0x65, - 0x66,0x63,0x74,0x2e,0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x20,0x74,0x68,0x65, - 0x6e,0x20,0x74,0x20,0x3d,0x20,0x22,0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x20, - 0x22,0x20,0x2e,0x2e,0x20,0x74,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20, - 0x69,0x66,0x20,0x63,0x64,0x61,0x74,0x61,0x6b,0x69,0x6e,0x64,0x20,0x69,0x73,0x20, - 0x75,0x6e,0x6b,0x6e,0x6f,0x77,0x6e,0x2c,0x20,0x74,0x68,0x69,0x73,0x20,0x6f,0x6e, - 0x65,0x20,0x77,0x69,0x6c,0x6c,0x20,0x62,0x65,0x20,0x63,0x61,0x6c,0x6c,0x65,0x64, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69, - 0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72,0x6f, - 0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x6f,0x72,0x73,0x2e,0x6e,0x75,0x6d,0x62,0x65,0x72,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x0a,0x0a,0x2d,0x2d,0x20,0x72,0x65,0x63, - 0x75,0x72,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x68, - 0x61,0x6e,0x64,0x6c,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x73,0x6f,0x6d,0x65, - 0x20,0x63,0x61,0x72,0x65,0x3a,0x20,0x69,0x66,0x20,0x77,0x65,0x20,0x63,0x61,0x6c, - 0x6c,0x20,0x72,0x65,0x67,0x75,0x6c,0x61,0x72,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73, - 0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x0a, - 0x2d,0x2d,0x20,0x77,0x65,0x20,0x6d,0x61,0x79,0x20,0x63,0x72,0x65,0x61,0x74,0x65, - 0x20,0x62,0x6f,0x78,0x65,0x64,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65, - 0x73,0x20,0x6f,0x72,0x20,0x4c,0x75,0x61,0x20,0x6e,0x61,0x74,0x69,0x76,0x65,0x20, - 0x6f,0x62,0x6a,0x65,0x63,0x74,0x73,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x77,0x69, - 0x6c,0x6c,0x20,0x62,0x65,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x65,0x64,0x20, - 0x61,0x73,0x20,0x73,0x75,0x63,0x68,0x0a,0x2d,0x2d,0x20,0x28,0x6c,0x65,0x61,0x64, - 0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x77,0x72,0x6f,0x6e,0x67,0x20,0x74,0x79,0x70, - 0x65,0x20,0x6e,0x61,0x6d,0x65,0x73,0x29,0x2e,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x72,0x65,0x63,0x75,0x72,0x73,0x65, - 0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61, - 0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20, - 0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x74,0x79, - 0x70,0x65,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x20,0x3d,0x3d,0x20,0x22,0x63,0x64, - 0x61,0x74,0x61,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74, - 0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61, - 0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20, - 0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72, - 0x6f,0x70,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x28,0x6e,0x61,0x6d,0x65,0x2c, - 0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20, - 0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x70,0x72,0x6f,0x70,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70,0x2e, - 0x61,0x74,0x74,0x72,0x2e,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x6d,0x61,0x6b,0x65, - 0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63,0x74,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x20,0x63,0x64,0x61,0x74,0x61,0x20,0x73,0x70,0x65,0x63,0x69,0x66,0x69,0x63,0x20, - 0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x20,0x3d,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x3d,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x20,0x3d, - 0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x6d,0x61, - 0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63, - 0x74,0x29,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x61,0x6c, - 0x75,0x65,0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x63,0x68,0x69,0x6c,0x64, - 0x72,0x65,0x6e,0x2c,0x20,0x69,0x66,0x20,0x6e,0x65,0x65,0x64,0x65,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x72,0x6f,0x70,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x66,0x6f,0x72,0x20,0x6d,0x65,0x6d,0x62,0x65,0x72,0x20,0x69,0x6e,0x20,0x72,0x65, - 0x66,0x63,0x74,0x3a,0x6d,0x65,0x6d,0x62,0x65,0x72,0x73,0x28,0x29,0x20,0x64,0x6f, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x6d, - 0x65,0x6d,0x62,0x65,0x72,0x2e,0x6e,0x61,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x63,0x75,0x72, - 0x73,0x65,0x28,0x6d,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x5b, - 0x6d,0x6e,0x61,0x6d,0x65,0x5d,0x2c,0x20,0x70,0x72,0x6f,0x70,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x2e,0x2e,0x20,0x73,0x66,0x6f,0x72,0x6d,0x61, - 0x74,0x28,0x27,0x5b,0x25,0x71,0x5d,0x27,0x2c,0x20,0x6d,0x6e,0x61,0x6d,0x65,0x29, - 0x2c,0x20,0x6d,0x65,0x6d,0x62,0x65,0x72,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x61,0x72,0x72,0x61,0x79,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x74,0x79, - 0x70,0x65,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x65,0x6c,0x65,0x6d,0x65, - 0x6e,0x74,0x5f,0x74,0x79,0x70,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x66,0x6f,0x72,0x20,0x56,0x4c,0x41,0x73,0x2c,0x20,0x72,0x65,0x66, - 0x6c,0x65,0x63,0x74,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x67,0x69, - 0x76,0x65,0x20,0x73,0x69,0x7a,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x72,0x65,0x66, - 0x63,0x74,0x2e,0x73,0x69,0x7a,0x65,0x20,0x7e,0x3d,0x20,0x22,0x6e,0x6f,0x6e,0x65, - 0x22,0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x73,0x69,0x7a,0x65, - 0x20,0x6f,0x72,0x20,0x66,0x66,0x69,0x2e,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x76, - 0x61,0x6c,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x69, - 0x7a,0x65,0x20,0x3d,0x20,0x73,0x69,0x7a,0x65,0x20,0x61,0x6e,0x64,0x20,0x28,0x73, - 0x69,0x7a,0x65,0x20,0x2f,0x20,0x65,0x74,0x79,0x70,0x65,0x2e,0x73,0x69,0x7a,0x65, - 0x29,0x20,0x2d,0x2d,0x20,0x77,0x65,0x27,0x76,0x65,0x20,0x67,0x6f,0x74,0x20,0x74, - 0x68,0x65,0x20,0x62,0x79,0x74,0x65,0x20,0x73,0x69,0x7a,0x65,0x2c,0x20,0x6e,0x6f, - 0x74,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x20,0x63,0x6f,0x75,0x6e,0x74,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74, - 0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x74, - 0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x65,0x74,0x79,0x70,0x65,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f, - 0x70,0x20,0x3d,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f, - 0x6e,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c, - 0x20,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x2e,0x2e,0x20,0x22,0x5b,0x22, - 0x20,0x2e,0x2e,0x20,0x28,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x73,0x69, - 0x7a,0x65,0x29,0x20,0x6f,0x72,0x20,0x22,0x22,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5d, - 0x22,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x61,0x6c,0x75, - 0x65,0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c, - 0x6e,0x61,0x6d,0x65,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x70,0x72,0x6f,0x70,0x20,0x61,0x6e,0x64,0x20,0x73,0x69,0x7a,0x65,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x30,0x2c,0x20,0x73,0x69,0x7a,0x65,0x2d,0x31, - 0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x64,0x78,0x20,0x3d,0x20, - 0x22,0x5b,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x69,0x29, - 0x2e,0x2e,0x22,0x5d,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x63,0x75,0x72,0x73,0x65,0x28,0x69,0x64, - 0x78,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x5b,0x69,0x5d,0x2c,0x20,0x70,0x72,0x6f, - 0x70,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x20,0x2e,0x2e,0x20,0x69, - 0x64,0x78,0x2c,0x20,0x65,0x74,0x79,0x70,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x72,0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x72,0x67, - 0x73,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x66,0x6f,0x72,0x20,0x61,0x72,0x67,0x20,0x69,0x6e,0x20,0x72,0x65,0x66,0x63,0x74, - 0x3a,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x28,0x29,0x20,0x64,0x6f,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x72,0x67,0x73, - 0x5b,0x23,0x61,0x72,0x67,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d,0x20,0x6d,0x61, - 0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x61,0x72,0x67,0x2e, - 0x74,0x79,0x70,0x65,0x29,0x20,0x2e,0x2e,0x20,0x22,0x20,0x22,0x20,0x2e,0x2e,0x20, - 0x61,0x72,0x67,0x2e,0x6e,0x61,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x76,0x61,0x72,0x61,0x72,0x67,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61, - 0x72,0x67,0x73,0x5b,0x23,0x61,0x72,0x67,0x73,0x20,0x2b,0x20,0x31,0x5d,0x20,0x3d, - 0x20,0x22,0x2e,0x2e,0x2e,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x72,0x65,0x70,0x72,0x20,0x3d,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79, - 0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x5f,0x74,0x79,0x70,0x65,0x29,0x20,0x2e,0x2e,0x20,0x22,0x20,0x22, - 0x20,0x2e,0x2e,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x6e,0x61,0x6d,0x65,0x20,0x2e, - 0x2e,0x20,0x22,0x28,0x22,0x20,0x2e,0x2e,0x20,0x74,0x63,0x6f,0x6e,0x63,0x61,0x74, - 0x28,0x61,0x72,0x67,0x73,0x2c,0x20,0x22,0x2c,0x20,0x22,0x29,0x20,0x2e,0x2e,0x20, - 0x22,0x29,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e, - 0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20, - 0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65, - 0x66,0x63,0x74,0x29,0x2c,0x20,0x72,0x65,0x70,0x72,0x2c,0x20,0x70,0x61,0x72,0x65, - 0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x75,0x6d, - 0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65, - 0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c, - 0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x72,0x65,0x70,0x72,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28, - 0x76,0x61,0x6c,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72,0x74, - 0x20,0x6e,0x75,0x6d,0x65,0x72,0x69,0x63,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x69, - 0x6e,0x74,0x6f,0x20,0x65,0x6e,0x75,0x6d,0x20,0x6e,0x61,0x6d,0x65,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x69,0x73, - 0x20,0x74,0x68,0x65,0x72,0x65,0x20,0x61,0x20,0x66,0x61,0x73,0x74,0x65,0x72,0x20, - 0x6d,0x65,0x74,0x68,0x6f,0x64,0x20,0x74,0x6f,0x20,0x6d,0x61,0x6b,0x65,0x20,0x69, - 0x74,0x20,0x3f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, - 0x76,0x61,0x6c,0x20,0x69,0x6e,0x20,0x72,0x65,0x66,0x63,0x74,0x3a,0x76,0x61,0x6c, - 0x75,0x65,0x73,0x28,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x76,0x61,0x6c,0x2e,0x76,0x61,0x6c,0x75, - 0x65,0x20,0x3d,0x3d,0x20,0x72,0x65,0x70,0x72,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x70,0x72,0x20,0x3d,0x20,0x76,0x61,0x6c,0x2e,0x6e,0x61,0x6d,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, - 0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x6d,0x61, - 0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63, - 0x74,0x29,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x72,0x65,0x70, - 0x72,0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c, - 0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20, - 0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65, - 0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x74,0x68,0x69,0x73,0x20,0x6d,0x61,0x79,0x20,0x62,0x65,0x20, - 0x75,0x6e,0x73,0x61,0x66,0x65,0x2c,0x20,0x73,0x65,0x65,0x20,0x69,0x6e,0x73,0x70, - 0x65,0x63,0x74,0x5f,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x73, - 0x65,0x74,0x74,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20, - 0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65, - 0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6e,0x6f,0x74,0x20,0x4d,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x5f,0x72,0x65, - 0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x74,0x79, - 0x70,0x65,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67, - 0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c, - 0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x20,0x3d,0x20,0x72,0x65,0x63, - 0x75,0x72,0x73,0x65,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65, - 0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61, - 0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x65,0x6c,0x65,0x6d,0x65,0x6e, - 0x74,0x5f,0x74,0x79,0x70,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x70,0x72,0x6f,0x70,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70,0x2e,0x61,0x74, - 0x74,0x72,0x2e,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x74,0x79,0x70,0x65,0x6e,0x61, - 0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x72, - 0x6f,0x70,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x6e,0x74,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72, - 0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72, - 0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x69,0x6e,0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69, - 0x6f,0x6e,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65, - 0x2c,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x28, - 0x72,0x65,0x66,0x63,0x74,0x29,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67, - 0x28,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x76,0x61,0x6c,0x75,0x65,0x29, - 0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x70,0x6f,0x69,0x6e,0x74,0x65,0x72,0x73,0x20,0x61, - 0x72,0x65,0x20,0x74,0x6f,0x6f,0x20,0x75,0x6e,0x73,0x61,0x66,0x65,0x2c,0x20,0x64, - 0x6f,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x74,0x68, - 0x65,0x6d,0x0a,0x20,0x20,0x20,0x20,0x70,0x74,0x72,0x20,0x3d,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x6e,0x74,0x72,0x6f, - 0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x6d,0x61,0x6b,0x65,0x5f,0x74,0x79,0x70, - 0x65,0x6e,0x61,0x6d,0x65,0x28,0x72,0x65,0x66,0x63,0x74,0x29,0x2c,0x20,0x74,0x6f, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x2c,0x20,0x70, - 0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d,0x0a,0x0a,0x69,0x6e,0x73, - 0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x75,0x6e,0x69,0x6f,0x6e,0x20,0x3d,0x20, - 0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x73,0x74,0x72,0x75,0x63, - 0x74,0x0a,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x3d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e, - 0x69,0x6e,0x74,0x0a,0x0a,0x2d,0x2d,0x20,0x66,0x6f,0x72,0x20,0x73,0x74,0x72,0x75, - 0x63,0x74,0x2f,0x75,0x6e,0x69,0x6f,0x6e,0x20,0x66,0x69,0x65,0x6c,0x64,0x73,0x2c, - 0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x74,0x75,0x61,0x6c,0x20,0x74,0x79,0x70,0x65, - 0x20,0x69,0x73,0x20,0x6e,0x65,0x73,0x74,0x65,0x64,0x20,0x69,0x6e,0x74,0x6f,0x20, - 0x74,0x68,0x65,0x20,0x72,0x65,0x66,0x63,0x74,0x0a,0x69,0x6e,0x73,0x70,0x65,0x63, - 0x74,0x6f,0x72,0x73,0x2e,0x66,0x69,0x65,0x6c,0x64,0x20,0x3d,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75, - 0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x28,0x6e, - 0x61,0x6d,0x65,0x2c,0x20,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65, - 0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72,0x65, - 0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x69,0x6e, - 0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x62,0x69,0x74,0x66,0x69,0x65,0x6c, - 0x64,0x20,0x3d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x73,0x2e,0x66, - 0x69,0x65,0x6c,0x64,0x0a,0x0a,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x6f,0x6e, - 0x6c,0x79,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x2c,0x20,0x6e,0x6f,0x74,0x20,0x63, - 0x74,0x79,0x70,0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x46,0x49,0x58,0x4d, - 0x45,0x3a,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x61,0x75,0x73,0x65,0x20,0x72,0x65, - 0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x64, - 0x65,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x64,0x20,0x61,0x6e,0x64,0x20, - 0x63,0x72,0x61,0x73,0x68,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x6f,0x63,0x65,0x73, - 0x73,0x20,0x69,0x66,0x20,0x74,0x68,0x65,0x79,0x20,0x61,0x72,0x65,0x20,0x77,0x72, - 0x6f,0x6e,0x67,0x20,0x21,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x66,0x66,0x69, - 0x2e,0x74,0x79,0x70,0x65,0x6f,0x66,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x20,0x7e, - 0x3d,0x20,0x76,0x61,0x6c,0x75,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66, - 0x63,0x74,0x20,0x6f,0x72,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x2e,0x74,0x79, - 0x70,0x65,0x6f,0x66,0x28,0x76,0x61,0x6c,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x69,0x6e,0x73,0x70, - 0x65,0x63,0x74,0x6f,0x72,0x73,0x5b,0x72,0x65,0x66,0x63,0x74,0x2e,0x77,0x68,0x61, - 0x74,0x5d,0x20,0x6f,0x72,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x5f,0x69,0x6e, - 0x73,0x70,0x65,0x63,0x74,0x6f,0x72,0x29,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75, - 0x6c,0x6c,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x20,0x73,0x69,0x6d,0x70,0x6c,0x65,0x20,0x70, - 0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x20,0x66,0x6f,0x72,0x20,0x63,0x74,0x79,0x70, - 0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x6e, - 0x74,0x72,0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x70,0x72,0x6f,0x70, - 0x65,0x72,0x74,0x79,0x28,0x6e,0x61,0x6d,0x65,0x2c,0x20,0x22,0x63,0x74,0x79,0x70, - 0x65,0x22,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x76,0x61,0x6c, - 0x75,0x65,0x29,0x2c,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x2c,0x20,0x66,0x75,0x6c, - 0x6c,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x69,0x6e,0x74,0x72, - 0x6f,0x73,0x70,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2e,0x69,0x6e,0x73,0x70,0x65,0x63, - 0x74,0x6f,0x72,0x73,0x2e,0x63,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x69,0x6e,0x73, - 0x70,0x65,0x63,0x74,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x0a,0x0a, - 0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f,0x66,0x20,0x6d, - 0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c, - 0x75,0x67,0x69,0x6e,0x73,0x2e,0x66,0x66,0x69,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20, - 0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x70,0x6c,0x75,0x67,0x69,0x6e,0x73,0x2e,0x66,0x66,0x69,0x2e,0x72,0x65,0x66, - 0x6c,0x65,0x63,0x74,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70,0x72,0x65, - 0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70, - 0x6c,0x75,0x67,0x69,0x6e,0x73,0x2e,0x66,0x66,0x69,0x2e,0x72,0x65,0x66,0x6c,0x65, - 0x63,0x74,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x5b,0x5b,0x20,0x4c,0x75,0x61,0x4a,0x49,0x54, - 0x20,0x46,0x46,0x49,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x4c,0x69,0x62,0x72,0x61,0x72,0x79,0x20,0x5d,0x5d,0x2d,0x2d,0x0a,0x2d,0x2d,0x5b, - 0x5b,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20, - 0x32,0x30,0x31,0x33,0x20,0x50,0x65,0x74,0x65,0x72,0x20,0x43,0x61,0x77,0x6c,0x65, - 0x79,0x20,0x3c,0x6c,0x75,0x61,0x40,0x63,0x6f,0x72,0x73,0x69,0x78,0x2e,0x6f,0x72, - 0x67,0x3e,0x2e,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72, - 0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x0a,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73, - 0x73,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x68,0x65,0x72,0x65,0x62,0x79,0x20,0x67, - 0x72,0x61,0x6e,0x74,0x65,0x64,0x2c,0x20,0x66,0x72,0x65,0x65,0x20,0x6f,0x66,0x20, - 0x63,0x68,0x61,0x72,0x67,0x65,0x2c,0x20,0x74,0x6f,0x20,0x61,0x6e,0x79,0x20,0x70, - 0x65,0x72,0x73,0x6f,0x6e,0x20,0x6f,0x62,0x74,0x61,0x69,0x6e,0x69,0x6e,0x67,0x20, - 0x61,0x20,0x63,0x6f,0x70,0x79,0x0a,0x6f,0x66,0x20,0x74,0x68,0x69,0x73,0x20,0x73, - 0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x20,0x61,0x6e,0x64,0x20,0x61,0x73,0x73,0x6f, - 0x63,0x69,0x61,0x74,0x65,0x64,0x20,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x61, - 0x74,0x69,0x6f,0x6e,0x20,0x66,0x69,0x6c,0x65,0x73,0x20,0x28,0x74,0x68,0x65,0x20, - 0x22,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x22,0x29,0x2c,0x20,0x74,0x6f,0x20, - 0x64,0x65,0x61,0x6c,0x0a,0x69,0x6e,0x20,0x74,0x68,0x65,0x20,0x53,0x6f,0x66,0x74, - 0x77,0x61,0x72,0x65,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x72,0x65,0x73, - 0x74,0x72,0x69,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x69,0x6e,0x63,0x6c,0x75,0x64, - 0x69,0x6e,0x67,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x6c,0x69,0x6d,0x69, - 0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x74,0x68,0x65,0x20,0x72,0x69,0x67,0x68,0x74, - 0x73,0x0a,0x74,0x6f,0x20,0x75,0x73,0x65,0x2c,0x20,0x63,0x6f,0x70,0x79,0x2c,0x20, - 0x6d,0x6f,0x64,0x69,0x66,0x79,0x2c,0x20,0x6d,0x65,0x72,0x67,0x65,0x2c,0x20,0x70, - 0x75,0x62,0x6c,0x69,0x73,0x68,0x2c,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75, - 0x74,0x65,0x2c,0x20,0x73,0x75,0x62,0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x2c,0x20, - 0x61,0x6e,0x64,0x2f,0x6f,0x72,0x20,0x73,0x65,0x6c,0x6c,0x0a,0x63,0x6f,0x70,0x69, - 0x65,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x53,0x6f,0x66,0x74,0x77,0x61, - 0x72,0x65,0x2c,0x20,0x61,0x6e,0x64,0x20,0x74,0x6f,0x20,0x70,0x65,0x72,0x6d,0x69, - 0x74,0x20,0x70,0x65,0x72,0x73,0x6f,0x6e,0x73,0x20,0x74,0x6f,0x20,0x77,0x68,0x6f, - 0x6d,0x20,0x74,0x68,0x65,0x20,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x20,0x69, - 0x73,0x0a,0x66,0x75,0x72,0x6e,0x69,0x73,0x68,0x65,0x64,0x20,0x74,0x6f,0x20,0x64, - 0x6f,0x20,0x73,0x6f,0x2c,0x20,0x73,0x75,0x62,0x6a,0x65,0x63,0x74,0x20,0x74,0x6f, - 0x20,0x74,0x68,0x65,0x20,0x66,0x6f,0x6c,0x6c,0x6f,0x77,0x69,0x6e,0x67,0x20,0x63, - 0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x73,0x3a,0x0a,0x0a,0x54,0x68,0x65,0x20, - 0x61,0x62,0x6f,0x76,0x65,0x20,0x63,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20, - 0x6e,0x6f,0x74,0x69,0x63,0x65,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x69,0x73,0x20, - 0x70,0x65,0x72,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x20,0x6e,0x6f,0x74,0x69,0x63, - 0x65,0x20,0x73,0x68,0x61,0x6c,0x6c,0x20,0x62,0x65,0x20,0x69,0x6e,0x63,0x6c,0x75, - 0x64,0x65,0x64,0x20,0x69,0x6e,0x0a,0x61,0x6c,0x6c,0x20,0x63,0x6f,0x70,0x69,0x65, - 0x73,0x20,0x6f,0x72,0x20,0x73,0x75,0x62,0x73,0x74,0x61,0x6e,0x74,0x69,0x61,0x6c, - 0x20,0x70,0x6f,0x72,0x74,0x69,0x6f,0x6e,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65, - 0x20,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x2e,0x0a,0x0a,0x54,0x48,0x45,0x20, - 0x53,0x4f,0x46,0x54,0x57,0x41,0x52,0x45,0x20,0x49,0x53,0x20,0x50,0x52,0x4f,0x56, - 0x49,0x44,0x45,0x44,0x20,0x22,0x41,0x53,0x20,0x49,0x53,0x22,0x2c,0x20,0x57,0x49, - 0x54,0x48,0x4f,0x55,0x54,0x20,0x57,0x41,0x52,0x52,0x41,0x4e,0x54,0x59,0x20,0x4f, - 0x46,0x20,0x41,0x4e,0x59,0x20,0x4b,0x49,0x4e,0x44,0x2c,0x20,0x45,0x58,0x50,0x52, - 0x45,0x53,0x53,0x20,0x4f,0x52,0x0a,0x49,0x4d,0x50,0x4c,0x49,0x45,0x44,0x2c,0x20, - 0x49,0x4e,0x43,0x4c,0x55,0x44,0x49,0x4e,0x47,0x20,0x42,0x55,0x54,0x20,0x4e,0x4f, - 0x54,0x20,0x4c,0x49,0x4d,0x49,0x54,0x45,0x44,0x20,0x54,0x4f,0x20,0x54,0x48,0x45, - 0x20,0x57,0x41,0x52,0x52,0x41,0x4e,0x54,0x49,0x45,0x53,0x20,0x4f,0x46,0x20,0x4d, - 0x45,0x52,0x43,0x48,0x41,0x4e,0x54,0x41,0x42,0x49,0x4c,0x49,0x54,0x59,0x2c,0x0a, - 0x46,0x49,0x54,0x4e,0x45,0x53,0x53,0x20,0x46,0x4f,0x52,0x20,0x41,0x20,0x50,0x41, - 0x52,0x54,0x49,0x43,0x55,0x4c,0x41,0x52,0x20,0x50,0x55,0x52,0x50,0x4f,0x53,0x45, - 0x20,0x41,0x4e,0x44,0x20,0x4e,0x4f,0x4e,0x49,0x4e,0x46,0x52,0x49,0x4e,0x47,0x45, - 0x4d,0x45,0x4e,0x54,0x2e,0x20,0x20,0x49,0x4e,0x20,0x4e,0x4f,0x20,0x45,0x56,0x45, - 0x4e,0x54,0x20,0x53,0x48,0x41,0x4c,0x4c,0x20,0x54,0x48,0x45,0x0a,0x41,0x55,0x54, - 0x48,0x4f,0x52,0x53,0x20,0x4f,0x52,0x20,0x43,0x4f,0x50,0x59,0x52,0x49,0x47,0x48, - 0x54,0x20,0x48,0x4f,0x4c,0x44,0x45,0x52,0x53,0x20,0x42,0x45,0x20,0x4c,0x49,0x41, - 0x42,0x4c,0x45,0x20,0x46,0x4f,0x52,0x20,0x41,0x4e,0x59,0x20,0x43,0x4c,0x41,0x49, - 0x4d,0x2c,0x20,0x44,0x41,0x4d,0x41,0x47,0x45,0x53,0x20,0x4f,0x52,0x20,0x4f,0x54, - 0x48,0x45,0x52,0x0a,0x4c,0x49,0x41,0x42,0x49,0x4c,0x49,0x54,0x59,0x2c,0x20,0x57, - 0x48,0x45,0x54,0x48,0x45,0x52,0x20,0x49,0x4e,0x20,0x41,0x4e,0x20,0x41,0x43,0x54, - 0x49,0x4f,0x4e,0x20,0x4f,0x46,0x20,0x43,0x4f,0x4e,0x54,0x52,0x41,0x43,0x54,0x2c, - 0x20,0x54,0x4f,0x52,0x54,0x20,0x4f,0x52,0x20,0x4f,0x54,0x48,0x45,0x52,0x57,0x49, - 0x53,0x45,0x2c,0x20,0x41,0x52,0x49,0x53,0x49,0x4e,0x47,0x20,0x46,0x52,0x4f,0x4d, - 0x2c,0x0a,0x4f,0x55,0x54,0x20,0x4f,0x46,0x20,0x4f,0x52,0x20,0x49,0x4e,0x20,0x43, - 0x4f,0x4e,0x4e,0x45,0x43,0x54,0x49,0x4f,0x4e,0x20,0x57,0x49,0x54,0x48,0x20,0x54, - 0x48,0x45,0x20,0x53,0x4f,0x46,0x54,0x57,0x41,0x52,0x45,0x20,0x4f,0x52,0x20,0x54, - 0x48,0x45,0x20,0x55,0x53,0x45,0x20,0x4f,0x52,0x20,0x4f,0x54,0x48,0x45,0x52,0x20, - 0x44,0x45,0x41,0x4c,0x49,0x4e,0x47,0x53,0x20,0x49,0x4e,0x0a,0x54,0x48,0x45,0x20, - 0x53,0x4f,0x46,0x54,0x57,0x41,0x52,0x45,0x2e,0x0a,0x2d,0x2d,0x5d,0x5d,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x66,0x66,0x69,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69, - 0x72,0x65,0x20,0x22,0x66,0x66,0x69,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62, - 0x69,0x74,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x62,0x69, - 0x74,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74, - 0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x6c,0x65,0x76,0x61, - 0x6e,0x74,0x20,0x6d,0x69,0x6e,0x69,0x6d,0x61,0x6c,0x20,0x64,0x65,0x66,0x69,0x6e, - 0x69,0x74,0x69,0x6f,0x6e,0x73,0x20,0x66,0x72,0x6f,0x6d,0x20,0x6c,0x6a,0x5f,0x63, - 0x74,0x79,0x70,0x65,0x2e,0x68,0x0a,0x66,0x66,0x69,0x2e,0x63,0x64,0x65,0x66,0x20, - 0x5b,0x5b,0x0a,0x20,0x20,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x73,0x74,0x72, - 0x75,0x63,0x74,0x20,0x43,0x54,0x79,0x70,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x66,0x6f,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x69,0x7a,0x65, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x31,0x36,0x5f,0x74,0x20,0x73, - 0x69,0x62,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x31,0x36,0x5f,0x74, - 0x20,0x6e,0x65,0x78,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x33, - 0x32,0x5f,0x74,0x20,0x6e,0x61,0x6d,0x65,0x3b,0x0a,0x20,0x20,0x7d,0x20,0x43,0x54, - 0x79,0x70,0x65,0x3b,0x0a,0x0a,0x20,0x20,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20, - 0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x43,0x54,0x79,0x70,0x65,0x20,0x2a,0x74,0x61,0x62,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x6f, - 0x70,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20, - 0x73,0x69,0x7a,0x65,0x74,0x61,0x62,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x6f,0x69, - 0x64,0x20,0x2a,0x4c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x6f,0x69,0x64,0x20,0x2a, - 0x67,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x6f,0x69,0x64,0x20,0x2a,0x66,0x69,0x6e, - 0x61,0x6c,0x69,0x7a,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x6f,0x69,0x64, - 0x20,0x2a,0x6d,0x69,0x73,0x63,0x6d,0x61,0x70,0x3b,0x0a,0x20,0x20,0x7d,0x20,0x43, - 0x54,0x53,0x74,0x61,0x74,0x65,0x3b,0x0a,0x5d,0x5d,0x0a,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x63,0x5f,0x73,0x74, - 0x72,0x28,0x67,0x63,0x72,0x65,0x66,0x29,0x20,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x76, - 0x65,0x72,0x74,0x20,0x61,0x20,0x47,0x43,0x72,0x65,0x66,0x20,0x28,0x74,0x6f,0x20, - 0x61,0x20,0x47,0x43,0x73,0x74,0x72,0x29,0x20,0x69,0x6e,0x74,0x6f,0x20,0x61,0x20, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x0a,0x20,0x20,0x69,0x66,0x20,0x67,0x63,0x72,0x65, - 0x66,0x20,0x7e,0x3d,0x20,0x30,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x73,0x20,0x3d,0x20,0x66,0x66,0x69,0x2e,0x63, - 0x61,0x73,0x74,0x28,0x22,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x22,0x2c, - 0x20,0x67,0x63,0x72,0x65,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x66,0x66,0x69,0x2e,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x74,0x73, - 0x20,0x2b,0x20,0x34,0x2c,0x20,0x74,0x73,0x5b,0x33,0x5d,0x29,0x0a,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x6d,0x70,0x74,0x72,0x28,0x67,0x63, - 0x6f,0x62,0x6a,0x29,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x6f, - 0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28, - 0x67,0x63,0x6f,0x62,0x6a,0x29,0x3a,0x6d,0x61,0x74,0x63,0x68,0x22,0x25,0x78,0x2a, - 0x24,0x22,0x2c,0x20,0x31,0x36,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20, - 0x41,0x63,0x71,0x75,0x69,0x72,0x65,0x20,0x61,0x20,0x70,0x6f,0x69,0x6e,0x74,0x65, - 0x72,0x20,0x74,0x6f,0x20,0x74,0x68,0x69,0x73,0x20,0x4c,0x75,0x61,0x20,0x75,0x6e, - 0x69,0x76,0x65,0x72,0x73,0x65,0x27,0x73,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x20,0x64, - 0x6f,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x20,0x3d,0x20,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x63,0x72,0x65,0x61,0x74,0x65,0x28, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x65,0x6e,0x64,0x29,0x20,0x2d, - 0x2d,0x20,0x41,0x6e,0x79,0x20,0x6c,0x69,0x76,0x65,0x20,0x63,0x6f,0x72,0x6f,0x75, - 0x74,0x69,0x6e,0x65,0x20,0x77,0x69,0x6c,0x6c,0x20,0x64,0x6f,0x2e,0x0a,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x70,0x74,0x72, - 0x20,0x3d,0x20,0x66,0x66,0x69,0x2e,0x74,0x79,0x70,0x65,0x6f,0x66,0x28,0x22,0x75, - 0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x22,0x29,0x0a,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x47,0x20,0x3d,0x20,0x66,0x66,0x69,0x2e,0x63,0x61,0x73,0x74,0x28, - 0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x70,0x74,0x72,0x2c,0x20,0x66,0x66,0x69,0x2e, - 0x63,0x61,0x73,0x74,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x70,0x74,0x72,0x2c, - 0x20,0x6d,0x65,0x6d,0x70,0x74,0x72,0x28,0x63,0x6f,0x29,0x29,0x5b,0x32,0x5d,0x29, - 0x0a,0x20,0x20,0x2d,0x2d,0x20,0x49,0x6e,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f, - 0x53,0x74,0x61,0x74,0x65,0x2c,0x20,0x60,0x4d,0x52,0x65,0x66,0x20,0x63,0x74,0x79, - 0x70,0x65,0x5f,0x73,0x74,0x61,0x74,0x65,0x60,0x20,0x69,0x73,0x20,0x69,0x6d,0x6d, - 0x65,0x64,0x69,0x61,0x74,0x65,0x6c,0x79,0x20,0x62,0x65,0x66,0x6f,0x72,0x65,0x20, - 0x60,0x47,0x43,0x52,0x65,0x66,0x20,0x67,0x63,0x72,0x6f,0x6f,0x74,0x5b,0x47,0x43, - 0x52,0x4f,0x4f,0x54,0x5f,0x4d,0x41,0x58,0x5d,0x60,0x2e,0x0a,0x20,0x20,0x2d,0x2d, - 0x20,0x57,0x65,0x20,0x66,0x69,0x72,0x73,0x74,0x20,0x66,0x69,0x6e,0x64,0x20,0x28, - 0x61,0x6e,0x20,0x65,0x6e,0x74,0x72,0x79,0x20,0x69,0x6e,0x29,0x20,0x67,0x63,0x72, - 0x6f,0x6f,0x74,0x20,0x62,0x79,0x20,0x6c,0x6f,0x6f,0x6b,0x69,0x6e,0x67,0x20,0x66, - 0x6f,0x72,0x20,0x61,0x20,0x6d,0x65,0x74,0x61,0x6d,0x65,0x74,0x68,0x6f,0x64,0x20, - 0x6e,0x61,0x6d,0x65,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x0a,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x61,0x6e,0x63,0x68,0x6f,0x72,0x20,0x3d,0x20,0x66,0x66, - 0x69,0x2e,0x63,0x61,0x73,0x74,0x28,0x22,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74, - 0x22,0x2c,0x20,0x66,0x66,0x69,0x2e,0x63,0x61,0x73,0x74,0x28,0x22,0x63,0x6f,0x6e, - 0x73,0x74,0x20,0x63,0x68,0x61,0x72,0x2a,0x22,0x2c,0x20,0x22,0x5f,0x5f,0x69,0x6e, - 0x64,0x65,0x78,0x22,0x29,0x29,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69, - 0x20,0x3d,0x20,0x30,0x0a,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x6d,0x61,0x74, - 0x68,0x2e,0x61,0x62,0x73,0x28,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x47, - 0x5b,0x69,0x5d,0x20,0x2d,0x20,0x61,0x6e,0x63,0x68,0x6f,0x72,0x29,0x29,0x20,0x3e, - 0x20,0x36,0x34,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x69,0x20,0x3d,0x20,0x69, - 0x20,0x2b,0x20,0x31,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x2d,0x2d,0x20, - 0x57,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x77,0x6f,0x72,0x6b,0x20,0x62,0x61,0x63, - 0x6b,0x77,0x61,0x72,0x64,0x73,0x20,0x6c,0x6f,0x6f,0x6b,0x69,0x6e,0x67,0x20,0x66, - 0x6f,0x72,0x20,0x73,0x6f,0x6d,0x65,0x74,0x68,0x69,0x6e,0x67,0x20,0x72,0x65,0x73, - 0x65,0x6d,0x62,0x6c,0x69,0x6e,0x67,0x20,0x63,0x74,0x79,0x70,0x65,0x5f,0x73,0x74, - 0x61,0x74,0x65,0x2e,0x0a,0x20,0x20,0x72,0x65,0x70,0x65,0x61,0x74,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x20,0x3d,0x20,0x69,0x20,0x2d,0x20,0x31,0x0a,0x20,0x20,0x20,0x20, - 0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x20,0x3d,0x20,0x66,0x66,0x69,0x2e,0x63,0x61, - 0x73,0x74,0x28,0x22,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x2a,0x22,0x2c,0x20,0x47, - 0x5b,0x69,0x5d,0x29,0x0a,0x20,0x20,0x75,0x6e,0x74,0x69,0x6c,0x20,0x66,0x66,0x69, - 0x2e,0x63,0x61,0x73,0x74,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x70,0x74,0x72, - 0x2c,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x2e,0x67,0x29,0x20,0x3d,0x3d,0x20, - 0x47,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x41,0x63,0x71,0x75,0x69,0x72, - 0x65,0x20,0x74,0x68,0x65,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x27,0x73,0x20, - 0x6d,0x69,0x73,0x63,0x6d,0x61,0x70,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x61,0x73, - 0x20,0x61,0x20,0x4c,0x75,0x61,0x20,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x69,0x73,0x63,0x6d,0x61,0x70,0x20,0x64,0x6f, - 0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b, - 0x20,0x74,0x5b,0x30,0x5d,0x20,0x3d,0x20,0x74,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x74,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x66,0x66,0x69,0x2e,0x63, - 0x61,0x73,0x74,0x28,0x22,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x22,0x2c, - 0x20,0x6d,0x65,0x6d,0x70,0x74,0x72,0x28,0x74,0x29,0x29,0x5b,0x32,0x5d,0x0a,0x20, - 0x20,0x66,0x66,0x69,0x2e,0x63,0x61,0x73,0x74,0x28,0x22,0x75,0x69,0x6e,0x74,0x33, - 0x32,0x5f,0x74,0x2a,0x22,0x2c,0x20,0x74,0x76,0x61,0x6c,0x75,0x65,0x29,0x5b,0x66, - 0x66,0x69,0x2e,0x61,0x62,0x69,0x22,0x6c,0x65,0x22,0x20,0x61,0x6e,0x64,0x20,0x30, - 0x20,0x6f,0x72,0x20,0x31,0x5d,0x20,0x3d,0x20,0x66,0x66,0x69,0x2e,0x63,0x61,0x73, - 0x74,0x28,0x22,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x22,0x2c,0x20,0x66,0x66, - 0x69,0x2e,0x63,0x61,0x73,0x74,0x28,0x22,0x75,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f, - 0x74,0x22,0x2c,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x2e,0x6d,0x69,0x73,0x63, - 0x6d,0x61,0x70,0x29,0x29,0x0a,0x20,0x20,0x6d,0x69,0x73,0x63,0x6d,0x61,0x70,0x20, - 0x3d,0x20,0x74,0x5b,0x30,0x5d,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x49, - 0x6e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6f,0x72,0x20,0x75, - 0x6e,0x70,0x61,0x63,0x6b,0x69,0x6e,0x67,0x20,0x61,0x20,0x60,0x73,0x74,0x72,0x75, - 0x63,0x74,0x20,0x43,0x54,0x79,0x70,0x65,0x60,0x2e,0x0a,0x2d,0x2d,0x20,0x4f,0x6e, - 0x65,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x70,0x65,0x72,0x20,0x43,0x54,0x5f,0x2a, - 0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x2c,0x20,0x63,0x6f,0x6e,0x74,0x61, - 0x69,0x6e,0x69,0x6e,0x67,0x3a,0x0a,0x2d,0x2d,0x20,0x2a,0x20,0x41,0x20,0x6e,0x61, - 0x6d,0x65,0x20,0x66,0x6f,0x72,0x20,0x74,0x68,0x61,0x74,0x20,0x43,0x54,0x5f,0x0a, - 0x2d,0x2d,0x20,0x2a,0x20,0x52,0x6f,0x6c,0x65,0x73,0x20,0x6f,0x66,0x20,0x74,0x68, - 0x65,0x20,0x63,0x69,0x64,0x20,0x61,0x6e,0x64,0x20,0x73,0x69,0x7a,0x65,0x20,0x66, - 0x69,0x65,0x6c,0x64,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x2a,0x20,0x57,0x68,0x65,0x74, - 0x68,0x65,0x72,0x20,0x74,0x68,0x65,0x20,0x73,0x69,0x62,0x20,0x66,0x69,0x65,0x6c, - 0x64,0x20,0x69,0x73,0x20,0x6d,0x65,0x61,0x6e,0x69,0x6e,0x67,0x66,0x75,0x6c,0x2e, - 0x0a,0x2d,0x2d,0x20,0x2a,0x20,0x5a,0x65,0x72,0x6f,0x20,0x6f,0x72,0x20,0x6d,0x6f, - 0x72,0x65,0x20,0x61,0x70,0x70,0x6c,0x69,0x63,0x61,0x62,0x6c,0x65,0x20,0x62,0x6f, - 0x6f,0x6c,0x65,0x61,0x6e,0x20,0x66,0x6c,0x61,0x67,0x73,0x2e,0x0a,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x43,0x54,0x73,0x20,0x3d,0x20,0x7b,0x5b,0x30,0x5d,0x20,0x3d,0x0a, - 0x20,0x20,0x7b,0x22,0x69,0x6e,0x74,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x22,0x22, - 0x2c,0x20,0x22,0x73,0x69,0x7a,0x65,0x22,0x2c,0x20,0x66,0x61,0x6c,0x73,0x65,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30, - 0x2c,0x20,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x30,0x78,0x30,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x66,0x6c,0x6f, - 0x61,0x74,0x22,0x2c,0x20,0x22,0x73,0x75,0x62,0x77,0x68,0x61,0x74,0x22,0x7d,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30, - 0x2c,0x20,0x22,0x63,0x6f,0x6e,0x73,0x74,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x7b,0x30,0x78,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x6f, - 0x6c,0x61,0x74,0x69,0x6c,0x65,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30, - 0x78,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x75,0x6e,0x73,0x69, - 0x67,0x6e,0x65,0x64,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30, - 0x30,0x34,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x6c,0x6f,0x6e,0x67,0x22,0x7d, - 0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x73,0x74,0x72,0x75,0x63, - 0x74,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x22,0x22,0x2c,0x20,0x22,0x73,0x69,0x7a, - 0x65,0x22,0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30, - 0x78,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x63,0x6f,0x6e,0x73, - 0x74,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x31,0x30,0x30, - 0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x22, - 0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x30,0x38,0x30,0x30,0x30, - 0x30,0x30,0x2c,0x20,0x22,0x75,0x6e,0x69,0x6f,0x6e,0x22,0x2c,0x20,0x22,0x73,0x75, - 0x62,0x77,0x68,0x61,0x74,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78, - 0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x6c,0x61,0x22,0x7d, - 0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x70,0x74,0x72,0x22,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x22,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x5f,0x74,0x79, - 0x70,0x65,0x22,0x2c,0x20,0x22,0x73,0x69,0x7a,0x65,0x22,0x2c,0x20,0x66,0x61,0x6c, - 0x73,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x32,0x30,0x30,0x30, - 0x30,0x30,0x30,0x2c,0x20,0x22,0x63,0x6f,0x6e,0x73,0x74,0x22,0x7d,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20, - 0x22,0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x30,0x78,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x72, - 0x65,0x66,0x22,0x2c,0x20,0x22,0x73,0x75,0x62,0x77,0x68,0x61,0x74,0x22,0x7d,0x2c, - 0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x61,0x72,0x72,0x61,0x79,0x22, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x22,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x5f,0x74, - 0x79,0x70,0x65,0x22,0x2c,0x20,0x22,0x73,0x69,0x7a,0x65,0x22,0x2c,0x20,0x66,0x61, - 0x6c,0x73,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x38,0x30,0x30, - 0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x65,0x63,0x74,0x6f,0x72,0x22,0x7d,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x34,0x30,0x30,0x30,0x30,0x30,0x30, - 0x2c,0x20,0x22,0x63,0x6f,0x6d,0x70,0x6c,0x65,0x78,0x22,0x7d,0x2c,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x30,0x78,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22, - 0x63,0x6f,0x6e,0x73,0x74,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78, - 0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x6f,0x6c,0x61,0x74, - 0x69,0x6c,0x65,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x30, - 0x31,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x6c,0x61,0x22,0x7d,0x2c,0x0a, - 0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x76,0x6f,0x69,0x64,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x22,0x22,0x2c,0x20,0x22,0x73,0x69,0x7a,0x65,0x22,0x2c,0x20, - 0x66,0x61,0x6c,0x73,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x32, - 0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x63,0x6f,0x6e,0x73,0x74,0x22,0x7d, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x31,0x30,0x30,0x30,0x30,0x30, - 0x30,0x2c,0x20,0x22,0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x22,0x7d,0x2c,0x0a, - 0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x65,0x6e,0x75,0x6d,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x22,0x74,0x79,0x70,0x65,0x22,0x2c,0x20,0x22,0x73,0x69,0x7a, - 0x65,0x22,0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20, - 0x20,0x7b,0x22,0x66,0x75,0x6e,0x63,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x22,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x5f,0x74,0x79,0x70,0x65,0x22,0x2c,0x20,0x22,0x6e,0x61, - 0x72,0x67,0x73,0x22,0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x7b,0x30,0x78,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76,0x61, - 0x72,0x61,0x72,0x67,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30, - 0x30,0x34,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x73,0x73,0x65,0x5f,0x72,0x65, - 0x67,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x7d,0x2c, - 0x0a,0x20,0x20,0x7b,0x22,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x22,0x2c,0x20,0x2d, - 0x2d,0x20,0x4e,0x6f,0x74,0x20,0x73,0x65,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x22, - 0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x5f,0x74,0x79,0x70,0x65,0x22,0x2c,0x20,0x22, - 0x22,0x2c,0x20,0x66,0x61,0x6c,0x73,0x65,0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20, - 0x20,0x7b,0x22,0x61,0x74,0x74,0x72,0x69,0x62,0x22,0x2c,0x20,0x2d,0x2d,0x20,0x4f, - 0x6e,0x6c,0x79,0x20,0x73,0x65,0x65,0x6e,0x20,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61, - 0x6c,0x6c,0x79,0x0a,0x20,0x20,0x20,0x20,0x22,0x74,0x79,0x70,0x65,0x22,0x2c,0x20, - 0x22,0x76,0x61,0x6c,0x75,0x65,0x22,0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20, - 0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x66,0x69,0x65,0x6c,0x64,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x22,0x74,0x79,0x70,0x65,0x22,0x2c,0x20,0x22,0x6f,0x66,0x66, - 0x73,0x65,0x74,0x22,0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x7d,0x2c, - 0x0a,0x20,0x20,0x7b,0x22,0x62,0x69,0x74,0x66,0x69,0x65,0x6c,0x64,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x22,0x22,0x2c,0x20,0x22,0x6f,0x66,0x66,0x73,0x65,0x74,0x22, - 0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30, - 0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30,0x32,0x30,0x30,0x30,0x30,0x30, - 0x30,0x2c,0x20,0x22,0x63,0x6f,0x6e,0x73,0x74,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x30,0x78,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x76, - 0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x30,0x78,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x75,0x6e,0x73, - 0x69,0x67,0x6e,0x65,0x64,0x22,0x7d,0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20, - 0x7b,0x22,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x22,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x22,0x74,0x79,0x70,0x65,0x22,0x2c,0x20,0x22,0x76,0x61,0x6c,0x75,0x65,0x22, - 0x2c,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7b,0x30,0x78,0x30, - 0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x2c,0x20,0x22,0x63,0x6f,0x6e,0x73,0x74,0x22, - 0x7d,0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x65,0x78,0x74,0x65, - 0x72,0x6e,0x22,0x2c,0x20,0x2d,0x2d,0x20,0x4e,0x6f,0x74,0x20,0x73,0x65,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x22,0x43,0x49,0x44,0x22,0x2c,0x20,0x22,0x22,0x2c,0x20, - 0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x7b,0x22,0x6b, - 0x77,0x22,0x2c,0x20,0x2d,0x2d,0x20,0x4e,0x6f,0x74,0x20,0x73,0x65,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x22,0x54,0x4f,0x4b,0x22,0x2c,0x20,0x22,0x73,0x69,0x7a,0x65, - 0x22,0x2c,0x0a,0x20,0x20,0x7d,0x2c,0x0a,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x53,0x65, - 0x74,0x20,0x6f,0x66,0x20,0x43,0x54,0x79,0x70,0x65,0x3a,0x3a,0x63,0x69,0x64,0x20, - 0x72,0x6f,0x6c,0x65,0x73,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x72,0x65,0x20, - 0x61,0x20,0x43,0x54,0x79,0x70,0x65,0x49,0x44,0x2e,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x74,0x79,0x70,0x65,0x5f,0x6b,0x65,0x79,0x73,0x20,0x3d,0x20,0x7b,0x0a,0x20, - 0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x5f,0x74,0x79,0x70,0x65,0x20,0x3d,0x20, - 0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x5f,0x74, - 0x79,0x70,0x65,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a,0x20,0x20,0x76,0x61, - 0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x2c, - 0x0a,0x20,0x20,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x2c,0x0a, - 0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x43,0x72,0x65,0x61,0x74,0x65,0x20,0x61,0x20,0x6d, - 0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x20,0x66,0x6f,0x72,0x20,0x65,0x61,0x63, - 0x68,0x20,0x43,0x54,0x2e,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x65,0x74,0x61, - 0x74,0x61,0x62,0x6c,0x65,0x73,0x20,0x3d,0x20,0x7b,0x0a,0x7d,0x0a,0x66,0x6f,0x72, - 0x20,0x5f,0x2c,0x20,0x43,0x54,0x20,0x69,0x6e,0x20,0x69,0x70,0x61,0x69,0x72,0x73, - 0x28,0x43,0x54,0x73,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x77,0x68,0x61,0x74,0x20,0x3d,0x20,0x43,0x54,0x5b,0x31,0x5d,0x0a,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x74,0x20,0x3d,0x20,0x7b,0x5f,0x5f,0x69,0x6e, - 0x64,0x65,0x78,0x20,0x3d,0x20,0x7b,0x7d,0x7d,0x0a,0x20,0x20,0x6d,0x65,0x74,0x61, - 0x74,0x61,0x62,0x6c,0x65,0x73,0x5b,0x77,0x68,0x61,0x74,0x5d,0x20,0x3d,0x20,0x6d, - 0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x4c,0x6f,0x67,0x69,0x63,0x20, - 0x66,0x6f,0x72,0x20,0x6d,0x65,0x72,0x67,0x69,0x6e,0x67,0x20,0x61,0x6e,0x20,0x61, - 0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x43,0x54,0x79,0x70,0x65,0x20,0x6f, - 0x6e,0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x61,0x6e,0x6e,0x6f,0x74,0x61,0x74,0x65, - 0x64,0x20,0x43,0x54,0x79,0x70,0x65,0x2e,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43, - 0x54,0x41,0x73,0x20,0x3d,0x20,0x7b,0x5b,0x30,0x5d,0x20,0x3d,0x0a,0x20,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x61,0x2c,0x20,0x72,0x65,0x66,0x63,0x74, - 0x29,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x43, - 0x54,0x41,0x5f,0x4e,0x4f,0x4e,0x45,0x22,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x61,0x2c,0x20,0x72,0x65,0x66, - 0x63,0x74,0x29,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x54,0x4f,0x44,0x4f,0x3a, - 0x20,0x43,0x54,0x41,0x5f,0x51,0x55,0x41,0x4c,0x22,0x29,0x20,0x65,0x6e,0x64,0x2c, - 0x0a,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x61,0x2c,0x20,0x72, - 0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x61,0x20,0x3d,0x20,0x32,0x5e, - 0x61,0x2e,0x76,0x61,0x6c,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63, - 0x74,0x2e,0x61,0x6c,0x69,0x67,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x3d,0x20,0x61,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x61,0x74,0x74,0x72,0x69,0x62, - 0x75,0x74,0x65,0x73,0x2e,0x61,0x6c,0x69,0x67,0x6e,0x20,0x3d,0x20,0x61,0x0a,0x20, - 0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x61,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x66,0x63,0x74,0x2e,0x74,0x72,0x61,0x6e,0x73,0x70,0x61,0x72,0x65,0x6e,0x74, - 0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63, - 0x74,0x2e,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x73,0x2e,0x73,0x75,0x62, - 0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70, - 0x65,0x69,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x61,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x20, - 0x72,0x65,0x66,0x63,0x74,0x2e,0x73,0x79,0x6d,0x5f,0x6e,0x61,0x6d,0x65,0x20,0x3d, - 0x20,0x61,0x2e,0x6e,0x61,0x6d,0x65,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x61,0x2c,0x20,0x72,0x65,0x66,0x63,0x74, - 0x29,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x43, - 0x54,0x41,0x5f,0x42,0x41,0x44,0x22,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d,0x0a, - 0x0a,0x2d,0x2d,0x20,0x43,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63, - 0x61,0x6c,0x6c,0x69,0x6e,0x67,0x20,0x63,0x6f,0x6e,0x76,0x65,0x6e,0x74,0x69,0x6f, - 0x6e,0x73,0x20,0x28,0x43,0x54,0x43,0x43,0x5f,0x2a,0x20,0x63,0x6f,0x6e,0x73,0x74, - 0x61,0x6e,0x74,0x73,0x20,0x69,0x6e,0x20,0x6c,0x6a,0x5f,0x72,0x65,0x66,0x63,0x74, - 0x2e,0x68,0x29,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43,0x54,0x43,0x43,0x73,0x20, - 0x3d,0x20,0x7b,0x5b,0x30,0x5d,0x20,0x3d,0x0a,0x20,0x20,0x22,0x63,0x64,0x65,0x63, - 0x6c,0x22,0x2c,0x0a,0x20,0x20,0x22,0x74,0x68,0x69,0x73,0x63,0x61,0x6c,0x6c,0x22, - 0x2c,0x0a,0x20,0x20,0x22,0x66,0x61,0x73,0x74,0x63,0x61,0x6c,0x6c,0x22,0x2c,0x0a, - 0x20,0x20,0x22,0x73,0x74,0x64,0x63,0x61,0x6c,0x6c,0x22,0x2c,0x0a,0x7d,0x0a,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x72, - 0x65,0x66,0x63,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x28,0x69,0x64,0x29, - 0x20,0x2d,0x2d,0x20,0x72,0x65,0x66,0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63, - 0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x28,0x43,0x54,0x79,0x70,0x65,0x49, - 0x44,0x29,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x74,0x79,0x70,0x65, - 0x20,0x3d,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x2e,0x74,0x61,0x62,0x5b,0x69, - 0x64,0x5d,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43,0x54,0x5f,0x63,0x6f, - 0x64,0x65,0x20,0x3d,0x20,0x62,0x69,0x74,0x2e,0x72,0x73,0x68,0x69,0x66,0x74,0x28, - 0x63,0x74,0x79,0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x32,0x38,0x29,0x0a, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43,0x54,0x20,0x3d,0x20,0x43,0x54,0x73, - 0x5b,0x43,0x54,0x5f,0x63,0x6f,0x64,0x65,0x5d,0x0a,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x77,0x68,0x61,0x74,0x20,0x3d,0x20,0x43,0x54,0x5b,0x31,0x5d,0x0a,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x66,0x63,0x74,0x20,0x3d,0x20,0x73, - 0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x77,0x68,0x61,0x74,0x20,0x3d,0x20,0x77,0x68,0x61,0x74,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x74,0x79,0x70,0x65,0x69,0x64,0x20,0x3d,0x20,0x69,0x64,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x67,0x63,0x5f,0x73,0x74, - 0x72,0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x6e,0x61,0x6d,0x65,0x29,0x2c,0x0a,0x20, - 0x20,0x7d,0x2c,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x73,0x5b,0x77, - 0x68,0x61,0x74,0x5d,0x29,0x0a,0x0a,0x20,0x20,0x2d,0x2d,0x20,0x49,0x6e,0x74,0x65, - 0x72,0x70,0x72,0x65,0x74,0x20,0x28,0x6d,0x6f,0x73,0x74,0x20,0x6f,0x66,0x29,0x20, - 0x74,0x68,0x65,0x20,0x43,0x54,0x79,0x70,0x65,0x3a,0x3a,0x69,0x6e,0x66,0x6f,0x20, - 0x66,0x69,0x65,0x6c,0x64,0x0a,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x20,0x3d,0x20, - 0x35,0x2c,0x20,0x23,0x43,0x54,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e,0x64,0x28,0x63,0x74,0x79,0x70,0x65,0x2e, - 0x69,0x6e,0x66,0x6f,0x2c,0x20,0x43,0x54,0x5b,0x69,0x5d,0x5b,0x31,0x5d,0x29,0x20, - 0x7e,0x3d,0x20,0x30,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x43,0x54,0x5b,0x69,0x5d,0x5b,0x33,0x5d,0x20,0x3d,0x3d,0x20,0x22, - 0x73,0x75,0x62,0x77,0x68,0x61,0x74,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x77,0x68,0x61,0x74, - 0x20,0x3d,0x20,0x43,0x54,0x5b,0x69,0x5d,0x5b,0x32,0x5d,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x66,0x63,0x74,0x5b,0x43,0x54,0x5b,0x69,0x5d,0x5b,0x32,0x5d,0x5d,0x20,0x3d, - 0x20,0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x69,0x66,0x20,0x43,0x54,0x5f,0x63,0x6f,0x64,0x65,0x20,0x3c,0x3d,0x20,0x35,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x61, - 0x6c,0x69,0x67,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x3d,0x20,0x62,0x69,0x74,0x2e,0x6c, - 0x73,0x68,0x69,0x66,0x74,0x28,0x31,0x2c,0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e, - 0x64,0x28,0x62,0x69,0x74,0x2e,0x72,0x73,0x68,0x69,0x66,0x74,0x28,0x63,0x74,0x79, - 0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x31,0x36,0x29,0x2c,0x20,0x31,0x35, - 0x29,0x29,0x0a,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x77,0x68,0x61,0x74, - 0x20,0x3d,0x3d,0x20,0x22,0x66,0x75,0x6e,0x63,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x63,0x6f,0x6e,0x76,0x65,0x6e, - 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x43,0x54,0x43,0x43,0x73,0x5b,0x62,0x69,0x74, - 0x2e,0x62,0x61,0x6e,0x64,0x28,0x62,0x69,0x74,0x2e,0x72,0x73,0x68,0x69,0x66,0x74, - 0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x31,0x36,0x29, - 0x2c,0x20,0x33,0x29,0x5d,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x69, - 0x66,0x20,0x43,0x54,0x5b,0x32,0x5d,0x20,0x7e,0x3d,0x20,0x22,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x2d,0x2d,0x20,0x49,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x20, - 0x74,0x68,0x65,0x20,0x43,0x54,0x79,0x70,0x65,0x3a,0x3a,0x63,0x69,0x64,0x20,0x66, - 0x69,0x65,0x6c,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6b, - 0x20,0x3d,0x20,0x43,0x54,0x5b,0x32,0x5d,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x63,0x69,0x64,0x20,0x3d,0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e, - 0x64,0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x30,0x78, - 0x66,0x66,0x66,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x74,0x79,0x70, - 0x65,0x5f,0x6b,0x65,0x79,0x73,0x5b,0x6b,0x5d,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x69,0x64,0x20,0x3d,0x3d,0x20,0x30, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x69, - 0x64,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c, - 0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x69,0x64,0x20,0x3d, - 0x20,0x72,0x65,0x66,0x63,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x28,0x63, - 0x69,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x5b, - 0x6b,0x5d,0x20,0x3d,0x20,0x63,0x69,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a, - 0x20,0x20,0x69,0x66,0x20,0x43,0x54,0x5b,0x33,0x5d,0x20,0x7e,0x3d,0x20,0x22,0x22, - 0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x49,0x6e,0x74,0x65,0x72,0x70,0x72, - 0x65,0x74,0x20,0x74,0x68,0x65,0x20,0x43,0x54,0x79,0x70,0x65,0x3a,0x3a,0x73,0x69, - 0x7a,0x65,0x20,0x66,0x69,0x65,0x6c,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x6b,0x20,0x3d,0x20,0x43,0x54,0x5b,0x33,0x5d,0x0a,0x20,0x20,0x20, - 0x20,0x72,0x65,0x66,0x63,0x74,0x5b,0x6b,0x5d,0x20,0x3d,0x20,0x63,0x74,0x79,0x70, - 0x65,0x2e,0x73,0x69,0x7a,0x65,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6b,0x20, - 0x3d,0x3d,0x20,0x22,0x73,0x69,0x7a,0x65,0x22,0x20,0x61,0x6e,0x64,0x20,0x62,0x69, - 0x74,0x2e,0x62,0x6e,0x6f,0x74,0x28,0x72,0x65,0x66,0x63,0x74,0x5b,0x6b,0x5d,0x29, - 0x20,0x3d,0x3d,0x20,0x30,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x66,0x63,0x74,0x5b,0x6b,0x5d,0x20,0x3d,0x20,0x22,0x6e,0x6f,0x6e, - 0x65,0x22,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x0a,0x20,0x20,0x69,0x66,0x20,0x77,0x68,0x61,0x74,0x20,0x3d,0x3d,0x20,0x22, - 0x61,0x74,0x74,0x72,0x69,0x62,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x4d,0x65,0x72,0x67,0x65,0x20,0x6c,0x65,0x61,0x64,0x69,0x6e, - 0x67,0x20,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x73,0x20,0x6f,0x6e,0x74, - 0x6f,0x20,0x74,0x68,0x65,0x20,0x74,0x79,0x70,0x65,0x20,0x62,0x65,0x69,0x6e,0x67, - 0x20,0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65,0x64,0x2e,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43,0x54,0x41,0x20,0x3d,0x20,0x43,0x54,0x41,0x73, - 0x5b,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e,0x64,0x28,0x62,0x69,0x74,0x2e,0x72,0x73, - 0x68,0x69,0x66,0x74,0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c, - 0x20,0x31,0x36,0x29,0x2c,0x20,0x30,0x78,0x66,0x66,0x29,0x5d,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x74,0x2e,0x61,0x74,0x74,0x72,0x69,0x62,0x75, - 0x74,0x65,0x73,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x43, - 0x54,0x41,0x28,0x72,0x65,0x66,0x63,0x74,0x2c,0x20,0x63,0x74,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x69,0x64,0x20,0x3d,0x20, - 0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x69,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x20,0x3d,0x20,0x63,0x74,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x66, - 0x63,0x74,0x2e,0x43,0x54,0x41,0x20,0x3d,0x20,0x43,0x54,0x41,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x77,0x68, - 0x61,0x74,0x20,0x3d,0x3d,0x20,0x22,0x62,0x69,0x74,0x66,0x69,0x65,0x6c,0x64,0x22, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x44,0x65,0x63, - 0x6f,0x64,0x65,0x20,0x65,0x78,0x74,0x72,0x61,0x20,0x62,0x69,0x74,0x66,0x69,0x65, - 0x6c,0x64,0x20,0x66,0x69,0x65,0x6c,0x64,0x73,0x2c,0x20,0x61,0x6e,0x64,0x20,0x6d, - 0x61,0x6b,0x65,0x20,0x69,0x74,0x20,0x6c,0x6f,0x6f,0x6b,0x20,0x6c,0x69,0x6b,0x65, - 0x20,0x61,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x66,0x69,0x65,0x6c,0x64,0x2e, - 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x6f,0x66,0x66,0x73,0x65, - 0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74, - 0x20,0x2b,0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e,0x64,0x28,0x63,0x74,0x79,0x70, - 0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x31,0x32,0x37,0x29,0x20,0x2f,0x20,0x38, - 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x73,0x69,0x7a,0x65,0x20, - 0x3d,0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e,0x64,0x28,0x62,0x69,0x74,0x2e,0x72, - 0x73,0x68,0x69,0x66,0x74,0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f, - 0x2c,0x20,0x38,0x29,0x2c,0x20,0x31,0x32,0x37,0x29,0x20,0x2f,0x20,0x38,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x20,0x3d,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x68,0x61,0x74,0x20,0x3d,0x20,0x22, - 0x69,0x6e,0x74,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c, - 0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x62,0x6f,0x6f,0x6c,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x3d,0x20,0x72,0x65,0x66, - 0x63,0x74,0x2e,0x63,0x6f,0x6e,0x73,0x74,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74, - 0x2e,0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,0x20,0x3d,0x20,0x72,0x65,0x66,0x63, - 0x74,0x2e,0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e, - 0x64,0x28,0x62,0x69,0x74,0x2e,0x72,0x73,0x68,0x69,0x66,0x74,0x28,0x63,0x74,0x79, - 0x70,0x65,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x31,0x36,0x29,0x2c,0x20,0x31,0x32, - 0x37,0x29,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, - 0x66,0x63,0x74,0x2e,0x62,0x6f,0x6f,0x6c,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x2e, - 0x63,0x6f,0x6e,0x73,0x74,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x76,0x6f,0x6c, - 0x61,0x74,0x69,0x6c,0x65,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x75,0x6e,0x73, - 0x69,0x67,0x6e,0x65,0x64,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x0a,0x20,0x20,0x69,0x66,0x20,0x43,0x54,0x5b,0x34,0x5d,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x2d,0x2d,0x20,0x4d,0x65,0x72,0x67,0x65,0x20,0x73,0x69,0x62,0x6c, - 0x69,0x6e,0x67,0x20,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x73,0x20,0x6f, - 0x6e,0x74,0x6f,0x20,0x74,0x68,0x69,0x73,0x20,0x74,0x79,0x70,0x65,0x2e,0x0a,0x20, - 0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x63,0x74,0x79,0x70,0x65,0x2e,0x73, - 0x69,0x62,0x20,0x7e,0x3d,0x20,0x30,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x6e,0x74,0x72,0x79,0x20,0x3d,0x20,0x43, - 0x54,0x53,0x74,0x61,0x74,0x65,0x2e,0x74,0x61,0x62,0x5b,0x63,0x74,0x79,0x70,0x65, - 0x2e,0x73,0x69,0x62,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x43, - 0x54,0x73,0x5b,0x62,0x69,0x74,0x2e,0x72,0x73,0x68,0x69,0x66,0x74,0x28,0x65,0x6e, - 0x74,0x72,0x79,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x32,0x38,0x29,0x5d,0x5b,0x31, - 0x5d,0x20,0x7e,0x3d,0x20,0x22,0x61,0x74,0x74,0x72,0x69,0x62,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x62,0x69,0x74,0x2e,0x62,0x61,0x6e,0x64,0x28,0x65, - 0x6e,0x74,0x72,0x79,0x2e,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x30,0x78,0x66,0x66,0x66, - 0x66,0x29,0x20,0x7e,0x3d,0x20,0x30,0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72,0x65, - 0x61,0x6b,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x73,0x69,0x62,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x5f,0x66, - 0x72,0x6f,0x6d,0x5f,0x69,0x64,0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x73,0x69,0x62, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x69,0x62,0x3a,0x43,0x54,0x41,0x28, - 0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x74,0x79, - 0x70,0x65,0x20,0x3d,0x20,0x65,0x6e,0x74,0x72,0x79,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x72,0x65,0x66,0x63,0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x73,0x69,0x62, - 0x5f,0x69,0x74,0x65,0x72,0x28,0x73,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x29,0x0a, - 0x20,0x20,0x72,0x65,0x70,0x65,0x61,0x74,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x63,0x74,0x79,0x70,0x65,0x20,0x3d,0x20,0x43,0x54,0x53,0x74,0x61, - 0x74,0x65,0x2e,0x74,0x61,0x62,0x5b,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70, - 0x65,0x69,0x64,0x5d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x74,0x79,0x70, - 0x65,0x2e,0x73,0x69,0x62,0x20,0x3d,0x3d,0x20,0x30,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x66,0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74,0x5f,0x66,0x72,0x6f, - 0x6d,0x5f,0x69,0x64,0x28,0x63,0x74,0x79,0x70,0x65,0x2e,0x73,0x69,0x62,0x29,0x0a, - 0x20,0x20,0x75,0x6e,0x74,0x69,0x6c,0x20,0x72,0x65,0x66,0x63,0x74,0x2e,0x77,0x68, - 0x61,0x74,0x20,0x7e,0x3d,0x20,0x22,0x61,0x74,0x74,0x72,0x69,0x62,0x22,0x20,0x2d, - 0x2d,0x20,0x50,0x75,0x72,0x65,0x20,0x61,0x74,0x74,0x72,0x69,0x62,0x73,0x20,0x61, - 0x72,0x65,0x20,0x73,0x6b,0x69,0x70,0x70,0x65,0x64,0x2e,0x0a,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x66,0x63,0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x73, - 0x69,0x62,0x6c,0x69,0x6e,0x67,0x73,0x28,0x72,0x65,0x66,0x63,0x74,0x29,0x0a,0x20, - 0x20,0x2d,0x2d,0x20,0x46,0x6f,0x6c,0x6c,0x6f,0x77,0x20,0x74,0x6f,0x20,0x74,0x68, - 0x65,0x20,0x65,0x6e,0x64,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x61,0x74,0x74, - 0x72,0x69,0x62,0x20,0x63,0x68,0x61,0x69,0x6e,0x2c,0x20,0x69,0x66,0x20,0x61,0x6e, - 0x79,0x2e,0x0a,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x72,0x65,0x66,0x63,0x74, - 0x2e,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x73,0x20,0x64,0x6f,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x66,0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x63,0x74, - 0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x28,0x72,0x65,0x66,0x63,0x74,0x2e,0x61, - 0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x73,0x2e,0x73,0x75,0x62,0x74,0x79,0x70, - 0x65,0x20,0x6f,0x72,0x20,0x43,0x54,0x53,0x74,0x61,0x74,0x65,0x2e,0x74,0x61,0x62, - 0x5b,0x72,0x65,0x66,0x63,0x74,0x2e,0x74,0x79,0x70,0x65,0x69,0x64,0x5d,0x2e,0x73, - 0x69,0x62,0x29,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x73,0x69,0x62,0x5f,0x69,0x74,0x65,0x72,0x2c,0x20,0x6e,0x69, - 0x6c,0x2c,0x20,0x72,0x65,0x66,0x63,0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x6d,0x65, - 0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x73,0x2e,0x73,0x74,0x72,0x75,0x63,0x74,0x2e, - 0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x6d,0x65,0x6d,0x62,0x65,0x72,0x73,0x20, - 0x3d,0x20,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67,0x73,0x0a,0x6d,0x65,0x74,0x61,0x74, - 0x61,0x62,0x6c,0x65,0x73,0x2e,0x66,0x75,0x6e,0x63,0x2e,0x5f,0x5f,0x69,0x6e,0x64, - 0x65,0x78,0x2e,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x20,0x3d,0x20,0x73, - 0x69,0x62,0x6c,0x69,0x6e,0x67,0x73,0x0a,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x73,0x2e,0x65,0x6e,0x75,0x6d,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e, - 0x76,0x61,0x6c,0x75,0x65,0x73,0x20,0x3d,0x20,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67, - 0x73,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x66,0x69,0x6e,0x64,0x5f,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67,0x28,0x72, - 0x65,0x66,0x63,0x74,0x2c,0x20,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x6e,0x75,0x6d,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62, - 0x65,0x72,0x28,0x6e,0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x69,0x66,0x20,0x6e,0x75, - 0x6d,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x73, - 0x69,0x62,0x20,0x69,0x6e,0x20,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67,0x73,0x28,0x72, - 0x65,0x66,0x63,0x74,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x6e,0x75,0x6d,0x20,0x3d,0x3d,0x20,0x31,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73, - 0x69,0x62,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6e,0x75,0x6d,0x20,0x3d,0x20,0x6e,0x75,0x6d,0x20,0x2d,0x20,0x31, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x73,0x69,0x62,0x20,0x69,0x6e,0x20,0x73, - 0x69,0x62,0x6c,0x69,0x6e,0x67,0x73,0x28,0x72,0x65,0x66,0x63,0x74,0x29,0x20,0x64, - 0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x69,0x62,0x2e,0x6e, - 0x61,0x6d,0x65,0x20,0x3d,0x3d,0x20,0x6e,0x61,0x6d,0x65,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x69,0x62,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x73,0x2e,0x73,0x74,0x72,0x75, - 0x63,0x74,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x6d,0x65,0x6d,0x62,0x65, - 0x72,0x20,0x3d,0x20,0x66,0x69,0x6e,0x64,0x5f,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67, - 0x0a,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x73,0x2e,0x66,0x75,0x6e,0x63, - 0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e, - 0x74,0x20,0x3d,0x20,0x66,0x69,0x6e,0x64,0x5f,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67, - 0x0a,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x73,0x2e,0x65,0x6e,0x75,0x6d, - 0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d, - 0x20,0x66,0x69,0x6e,0x64,0x5f,0x73,0x69,0x62,0x6c,0x69,0x6e,0x67,0x0a,0x0a,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x2e, - 0x74,0x79,0x70,0x65,0x6f,0x66,0x28,0x78,0x29,0x20,0x2d,0x2d,0x20,0x72,0x65,0x66, - 0x63,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x2e,0x74,0x79,0x70, - 0x65,0x6f,0x66,0x28,0x63,0x74,0x29,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x72,0x65,0x66,0x63,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x28,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x66,0x66,0x69,0x2e,0x74,0x79,0x70,0x65, - 0x6f,0x66,0x28,0x78,0x29,0x29,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x2e,0x67,0x65, - 0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x78,0x29,0x20,0x2d,0x2d, - 0x20,0x6d,0x74,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x2e,0x67,0x65, - 0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x63,0x74,0x29,0x0a,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x69,0x73,0x63,0x6d,0x61,0x70,0x5b, - 0x2d,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x28,0x66,0x66,0x69,0x2e,0x74,0x79, - 0x70,0x65,0x6f,0x66,0x28,0x78,0x29,0x29,0x5d,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x0a,0x65,0x6e, - 0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f,0x66,0x20,0x6d,0x6f,0x64, - 0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c,0x75,0x67, - 0x69,0x6e,0x73,0x2e,0x66,0x66,0x69,0x2e,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x0a, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65, - 0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x0a, - 0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b, - 0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x70,0x6c,0x61,0x74,0x66,0x6f, - 0x72,0x6d,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68, - 0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32,0x30,0x31,0x32,0x20, - 0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20, - 0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x41, - 0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65,0x73,0x65,0x72,0x76, - 0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d, - 0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61, - 0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x73,0x0a, - 0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20,0x61,0x76,0x61,0x69, - 0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20,0x74,0x68,0x65,0x20, - 0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x45,0x63,0x6c, - 0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20,0x4c,0x69,0x63,0x65, - 0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63, - 0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65,0x73,0x20,0x74,0x68, - 0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x2c, - 0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c, - 0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77, - 0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f,0x72,0x67,0x2f,0x6c, - 0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30,0x2e,0x68,0x74,0x6d, - 0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74,0x72,0x69,0x62,0x75, - 0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x53,0x69,0x65, - 0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x2d,0x20,0x69, - 0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61,0x6e,0x64,0x20,0x69, - 0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d, - 0x20,0x50,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2f,0x4f,0x53,0x20,0x73,0x70,0x65, - 0x63,0x69,0x66,0x69,0x63,0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x20,0x61, - 0x6e,0x64,0x20,0x70,0x61,0x74,0x68,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67, - 0x2e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x6c,0x20,0x3d,0x20,0x72, - 0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x2e,0x75,0x72,0x6c,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x74,0x69,0x6c, - 0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75, - 0x67,0x67,0x65,0x72,0x2e,0x75,0x74,0x69,0x6c,0x22,0x0a,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x4d,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x45,0x78, - 0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x20,0x70,0x6c,0x61,0x66,0x6f,0x72,0x6d,0x20, - 0x28,0x63,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65,0x20,0x77,0x69,0x6e,0x20,0x6f,0x72, - 0x20,0x75,0x6e,0x69,0x78,0x29,0x0a,0x2d,0x2d,0x20,0x55,0x73,0x65,0x64,0x20,0x74, - 0x6f,0x20,0x6d,0x61,0x6e,0x61,0x67,0x65,0x20,0x66,0x69,0x6c,0x65,0x20,0x70,0x61, - 0x74,0x68,0x20,0x64,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x20,0x62,0x65, - 0x74,0x77,0x65,0x65,0x6e,0x20,0x74,0x68,0x65,0x20,0x32,0x20,0x70,0x6c,0x61,0x74, - 0x66,0x6f,0x72,0x6d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x6c,0x61,0x74,0x66, - 0x6f,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x0a,0x2d,0x2d,0x20,0x6b,0x65, - 0x65,0x70,0x20,0x61,0x6c,0x6c,0x20,0x63,0x6f,0x6d,0x70,0x75,0x74,0x65,0x64,0x20, - 0x55,0x52,0x49,0x73,0x20,0x69,0x6e,0x20,0x63,0x61,0x63,0x68,0x65,0x20,0x28,0x61, - 0x73,0x20,0x74,0x68,0x65,0x79,0x20,0x61,0x72,0x65,0x20,0x71,0x75,0x69,0x74,0x65, - 0x20,0x6c,0x6f,0x6e,0x67,0x20,0x74,0x6f,0x20,0x63,0x6f,0x6d,0x70,0x75,0x74,0x65, - 0x29,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x69,0x5f,0x63,0x61,0x63,0x68, - 0x65,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x70,0x61,0x72,0x73, - 0x65,0x20,0x61,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x20,0x70, - 0x61,0x74,0x68,0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61, - 0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x6f,0x66,0x20,0x65,0x61,0x63,0x68,0x20,0x73, - 0x65,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x2d,0x2d,0x20,0x79,0x6f,0x75,0x20,0x63,0x6f, - 0x75,0x6c,0x64,0x20,0x70,0x72,0x65,0x63,0x69,0x73,0x65,0x20,0x74,0x68,0x65,0x20, - 0x70,0x61,0x74,0x68,0x20,0x73,0x65,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x2e,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x73, - 0x70,0x6c,0x69,0x74,0x28,0x70,0x61,0x74,0x68,0x2c,0x73,0x65,0x70,0x29,0x0a,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20, - 0x66,0x6f,0x72,0x20,0x77,0x20,0x69,0x6e,0x20,0x70,0x61,0x74,0x68,0x3a,0x67,0x6d, - 0x61,0x74,0x63,0x68,0x28,0x22,0x5b,0x5e,0x22,0x2e,0x2e,0x28,0x73,0x65,0x70,0x20, - 0x6f,0x72,0x20,0x22,0x2f,0x22,0x29,0x2e,0x2e,0x22,0x5d,0x2b,0x22,0x29,0x64,0x6f, - 0x0a,0x20,0x20,0x20,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x69,0x6e,0x73,0x65,0x72, - 0x74,0x28,0x74,0x2c,0x20,0x77,0x29,0x0a,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x20,0x74,0x61,0x62,0x6c,0x65,0x3a, - 0x20,0x6b,0x65,0x79,0x3d,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68,0x6e, - 0x61,0x6d,0x65,0x2c,0x76,0x61,0x6c,0x75,0x65,0x3d,0x74,0x72,0x75,0x65,0x20,0x28, - 0x61,0x64,0x64,0x20,0x62,0x79,0x20,0x67,0x75,0x61,0x6e,0x79,0x75,0x29,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f, - 0x6e,0x76,0x65,0x72,0x74,0x5f,0x74,0x6f,0x5f,0x73,0x65,0x61,0x72,0x63,0x68,0x5f, - 0x70,0x61,0x74,0x68,0x73,0x28,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68, - 0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x20,0x3d, - 0x20,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x77,0x20,0x69, - 0x6e,0x20,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68,0x73,0x3a,0x67,0x6d, - 0x61,0x74,0x63,0x68,0x28,0x22,0x5b,0x5e,0x3b,0x5d,0x2b,0x22,0x29,0x20,0x64,0x6f, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x5b,0x77,0x5d,0x20,0x3d,0x20, - 0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x3b,0x0a,0x65,0x6e,0x64,0x0a,0x0a, - 0x2d,0x2d,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x20,0x72,0x65,0x6c,0x61, - 0x74,0x69,0x76,0x65,0x20,0x75,0x72,0x69,0x20,0x74,0x6f,0x20,0x4d,0x2e,0x62,0x61, - 0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x66,0x6f,0x72,0x20,0x61,0x20,0x67,0x69,0x76, - 0x65,0x6e,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x2c,0x20,0x66,0x6f,0x72,0x20,0x61, - 0x6e,0x64,0x72,0x6f,0x69,0x64,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x28,0x61, - 0x64,0x64,0x65,0x64,0x20,0x62,0x79,0x20,0x67,0x75,0x61,0x6e,0x79,0x75,0x29,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63, - 0x6f,0x6e,0x76,0x65,0x72,0x74,0x5f,0x74,0x6f,0x5f,0x61,0x6e,0x64,0x72,0x6f,0x69, - 0x64,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75,0x72,0x69,0x28,0x73,0x6f,0x75,0x72,0x63, - 0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x6f,0x75,0x72,0x63,0x65, - 0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x36,0x29,0x20,0x3d,0x3d,0x20,0x22,0x61,0x73, - 0x73,0x65,0x74,0x73,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x72,0x65, - 0x70,0x6c,0x61,0x63,0x65,0x20,0x61,0x73,0x73,0x65,0x74,0x73,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x3d,0x20,0x73,0x6f, - 0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x38,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x4d,0x2e,0x73,0x65,0x61,0x72,0x63,0x68,0x5f, - 0x70,0x61,0x74,0x68,0x73,0x20,0x74,0x68,0x65,0x6e,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x20,0x2f,0x6d,0x6e,0x74,0x2f,0x73,0x64,0x63, - 0x61,0x72,0x64,0x2f,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x6e,0x61,0x6d,0x65,0x2f, - 0x20,0x77,0x69,0x74,0x68,0x20,0x65,0x6d,0x70,0x74,0x79,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b, - 0x2c,0x20,0x76,0x20,0x69,0x6e,0x20,0x70,0x61,0x69,0x72,0x73,0x28,0x4d,0x2e,0x73, - 0x65,0x61,0x72,0x63,0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x29,0x20,0x64,0x6f,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x23, - 0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x3e,0x20,0x23,0x6b,0x20,0x61,0x6e,0x64,0x20, - 0x4d,0x2e,0x73,0x65,0x61,0x72,0x63,0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x5b,0x73, - 0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x23,0x6b,0x29,0x5d, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x3d,0x20,0x73, - 0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x23,0x6b,0x2b,0x31,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x2d,0x2d,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x20,0x72,0x65,0x6c, - 0x61,0x74,0x69,0x76,0x65,0x20,0x75,0x72,0x69,0x20,0x74,0x6f,0x20,0x4d,0x2e,0x62, - 0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x66,0x6f,0x72,0x20,0x61,0x20,0x67,0x69, - 0x76,0x65,0x6e,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x2c,0x20,0x2c,0x20,0x66,0x6f, - 0x72,0x20,0x69,0x6f,0x73,0x20,0x73,0x69,0x6d,0x75,0x6c,0x61,0x74,0x6f,0x72,0x2f, - 0x64,0x65,0x76,0x69,0x63,0x65,0x3f,0x20,0x28,0x61,0x64,0x64,0x65,0x64,0x20,0x62, - 0x79,0x20,0x67,0x75,0x61,0x6e,0x79,0x75,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72,0x74,0x5f, - 0x74,0x6f,0x5f,0x69,0x6f,0x73,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75,0x72,0x69,0x28, - 0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x69,0x66,0x20,0x4d,0x2e, - 0x73,0x65,0x61,0x72,0x63,0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x20,0x74,0x68,0x65, - 0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x20,0x76, - 0x20,0x69,0x6e,0x20,0x70,0x61,0x69,0x72,0x73,0x28,0x4d,0x2e,0x73,0x65,0x61,0x72, - 0x63,0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x23,0x73,0x6f,0x75,0x72,0x63, - 0x65,0x20,0x3e,0x20,0x23,0x6b,0x20,0x61,0x6e,0x64,0x20,0x4d,0x2e,0x73,0x65,0x61, - 0x72,0x63,0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x5b,0x73,0x6f,0x75,0x72,0x63,0x65, - 0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x23,0x6b,0x29,0x5d,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73, - 0x6f,0x75,0x72,0x63,0x65,0x20,0x3d,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x73, - 0x75,0x62,0x28,0x23,0x6b,0x2b,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x63,0x6f,0x6e,0x76,0x65,0x72,0x74,0x5f,0x74,0x6f,0x5f,0x72,0x65,0x6c,0x61,0x74, - 0x69,0x76,0x65,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75,0x72,0x69,0x28,0x73,0x6f,0x75, - 0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x69,0x66,0x20,0x4d,0x2e,0x73,0x65,0x61, - 0x72,0x63,0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x20,0x76,0x20,0x69,0x6e, - 0x20,0x70,0x61,0x69,0x72,0x73,0x28,0x4d,0x2e,0x73,0x65,0x61,0x72,0x63,0x68,0x5f, - 0x70,0x61,0x74,0x68,0x73,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x23,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x3e, - 0x20,0x23,0x6b,0x20,0x61,0x6e,0x64,0x20,0x4d,0x2e,0x73,0x65,0x61,0x72,0x63,0x68, - 0x5f,0x70,0x61,0x74,0x68,0x73,0x5b,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75, - 0x62,0x28,0x31,0x2c,0x23,0x6b,0x29,0x5d,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x6f,0x75,0x72, - 0x63,0x65,0x20,0x3d,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28, - 0x23,0x6b,0x2b,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x61,0x20,0x52,0x46,0x43,0x32, - 0x33,0x39,0x36,0x20,0x63,0x6f,0x6d,0x70,0x6c,0x69,0x61,0x6e,0x74,0x20,0x55,0x52, - 0x49,0x20,0x66,0x6f,0x72,0x20,0x67,0x69,0x76,0x65,0x6e,0x20,0x73,0x6f,0x75,0x72, - 0x63,0x65,0x2c,0x20,0x6f,0x72,0x20,0x66,0x61,0x6c,0x73,0x65,0x20,0x69,0x66,0x20, - 0x74,0x68,0x65,0x20,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x20,0x66,0x61,0x69,0x6c, - 0x65,0x64,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x67,0x65,0x74,0x5f,0x61,0x62,0x73,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75, - 0x72,0x69,0x20,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x69,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29, - 0x20,0x3d,0x3d,0x20,0x22,0x40,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20, - 0x72,0x65,0x61,0x6c,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x66,0x69,0x6c,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73, - 0x6f,0x75,0x72,0x63,0x65,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x6f,0x75,0x72, - 0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x4d,0x2e,0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x63,0x6f, - 0x6e,0x76,0x65,0x72,0x74,0x5f,0x74,0x6f,0x5f,0x72,0x65,0x6c,0x61,0x74,0x69,0x76, - 0x65,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75,0x72,0x69,0x28,0x73,0x6f,0x75,0x72,0x63, - 0x65,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68,0x20, - 0x3d,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x6f, - 0x75,0x72,0x63,0x65,0x70,0x61,0x74,0x68,0x29,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x4d,0x2e,0x69,0x73,0x5f, - 0x70,0x61,0x74,0x68,0x5f,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x28,0x6e,0x6f, - 0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68,0x29,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68,0x20, - 0x3d,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x4d,0x2e, - 0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x2e,0x2e,0x20,0x22,0x2f,0x22,0x20, - 0x2e,0x2e,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74, - 0x68,0x29,0x2d,0x2d,0x4d,0x2e,0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x2e, - 0x2e,0x20,0x22,0x2f,0x73,0x72,0x63,0x2f,0x22,0x20,0x2e,0x2e,0x20,0x6e,0x6f,0x72, - 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x2e,0x74,0x6f,0x5f,0x66,0x69, - 0x6c,0x65,0x5f,0x75,0x72,0x69,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x64,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69, - 0x66,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62,0x28,0x23,0x73,0x6f, - 0x75,0x72,0x63,0x65,0x2d,0x33,0x2c,0x2d,0x31,0x29,0x3a,0x6c,0x6f,0x77,0x65,0x72, - 0x28,0x29,0x20,0x3d,0x3d,0x20,0x22,0x2e,0x6c,0x75,0x61,0x22,0x20,0x74,0x68,0x65, - 0x6e,0x20,0x2d,0x2d,0x20,0x6c,0x6f,0x61,0x64,0x73,0x74,0x72,0x69,0x6e,0x67,0x20, - 0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x73,0x6f, - 0x75,0x72,0x63,0x65,0x20,0x66,0x69,0x6c,0x65,0x20,0x28,0x61,0x64,0x64,0x65,0x64, - 0x20,0x62,0x79,0x20,0x67,0x75,0x61,0x6e,0x79,0x75,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x61,0x6e,0x64,0x72,0x6f,0x69,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f, - 0x72,0x6d,0x20,0x3d,0x3d,0x20,0x22,0x61,0x6e,0x64,0x72,0x6f,0x69,0x64,0x22,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72, - 0x74,0x5f,0x74,0x6f,0x5f,0x61,0x6e,0x64,0x72,0x6f,0x69,0x64,0x5f,0x66,0x69,0x6c, - 0x65,0x5f,0x75,0x72,0x69,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x6f,0x73,0x20,0x3f,0x3f,0x3f, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20, - 0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x3d,0x3d,0x20,0x22,0x69,0x6f,0x73, - 0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x76, - 0x65,0x72,0x74,0x5f,0x74,0x6f,0x5f,0x69,0x6f,0x73,0x5f,0x66,0x69,0x6c,0x65,0x5f, - 0x75,0x72,0x69,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64, - 0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, - 0x7a,0x65,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x4d,0x2e,0x69,0x73, - 0x5f,0x70,0x61,0x74,0x68,0x5f,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x28,0x6e, - 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68,0x29,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68, - 0x20,0x3d,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x4d, - 0x2e,0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x2e,0x2e,0x20,0x22,0x2f,0x22, - 0x20,0x2e,0x2e,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61, - 0x74,0x68,0x29,0x2d,0x2d,0x4d,0x2e,0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20, - 0x2e,0x2e,0x20,0x22,0x2f,0x73,0x72,0x63,0x2f,0x22,0x20,0x2e,0x2e,0x20,0x6e,0x6f, - 0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x2e,0x74,0x6f,0x5f,0x66, - 0x69,0x6c,0x65,0x5f,0x75,0x72,0x69,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, - 0x65,0x64,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, - 0x20,0x2d,0x2d,0x20,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x20,0x63,0x6f,0x64,0x65, - 0x2c,0x20,0x73,0x74,0x72,0x69,0x70,0x70,0x65,0x64,0x20,0x62,0x79,0x74,0x65,0x63, - 0x6f,0x64,0x65,0x2c,0x20,0x74,0x61,0x69,0x6c,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x2c,0x20,0x2e,0x2e,0x2e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x66,0x61,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x46,0x49,0x58,0x4d,0x45,0x3a, - 0x20,0x61,0x73,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x69,0x73,0x20,0x63,0x61, - 0x63,0x68,0x65,0x64,0x2c,0x20,0x63,0x68,0x61,0x6e,0x67,0x65,0x73,0x20,0x69,0x6e, - 0x20,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70,0x61,0x74,0x68,0x20,0x74,0x68, - 0x61,0x74,0x20,0x6d,0x6f,0x64,0x69,0x66,0x79,0x20,0x74,0x68,0x65,0x20,0x6d,0x6f, - 0x64,0x75,0x6c,0x65,0x20,0x6e,0x61,0x6d,0x65,0x20,0x61,0x72,0x65,0x20,0x6d,0x69, - 0x73,0x73,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x28,0x6d,0x6f,0x73,0x74,0x6c,0x79,0x20, - 0x61,0x66,0x66,0x65,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x20,0x6d,0x6f,0x64,0x75, - 0x6c,0x65,0x20,0x77,0x68,0x65,0x6e,0x20,0x4c,0x75,0x61,0x20,0x69,0x6e,0x74,0x65, - 0x72,0x70,0x72,0x65,0x74,0x65,0x72,0x20,0x69,0x73,0x20,0x6c,0x61,0x75,0x6e,0x63, - 0x68,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x61,0x6e,0x20,0x61,0x62,0x73,0x6f, - 0x6c,0x75,0x74,0x65,0x20,0x70,0x61,0x74,0x68,0x29,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x74,0x5f,0x6d,0x6f, - 0x64,0x75,0x6c,0x65,0x5f,0x75,0x72,0x69,0x20,0x28,0x73,0x6f,0x75,0x72,0x63,0x65, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a, - 0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29,0x20,0x3d,0x3d,0x20,0x22,0x40,0x22,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x72,0x65,0x61,0x6c,0x20,0x73,0x6f,0x75, - 0x72,0x63,0x65,0x20,0x66,0x69,0x6c,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x69,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x70, - 0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x73,0x75,0x62, - 0x28,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70,0x61,0x74,0x68, - 0x20,0x3d,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73, - 0x6f,0x75,0x72,0x63,0x65,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x75,0x61,0x70,0x61,0x74,0x68, - 0x74,0x61,0x62,0x6c,0x65,0x20,0x3d,0x20,0x73,0x70,0x6c,0x69,0x74,0x20,0x28,0x70, - 0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x70,0x61,0x74,0x68,0x2c,0x20,0x22,0x3b,0x22, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x69,0x73,0x5f,0x73,0x6f,0x75,0x72,0x63,0x65,0x5f,0x61,0x62,0x73,0x6f,0x6c,0x75, - 0x74,0x65,0x20,0x3d,0x20,0x4d,0x2e,0x69,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x61, - 0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x70,0x61, - 0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x77, - 0x6f,0x72,0x6b,0x61,0x72,0x72,0x6f,0x75,0x6e,0x64,0x20,0x3a,0x20,0x41,0x64,0x64, - 0x20,0x61,0x6c,0x77,0x61,0x79,0x73,0x20,0x74,0x68,0x65,0x20,0x3f,0x2e,0x6c,0x75, - 0x61,0x20,0x65,0x6e,0x74,0x72,0x79,0x20,0x74,0x6f,0x20,0x73,0x75,0x70,0x70,0x6f, - 0x72,0x74,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68, - 0x65,0x20,0x63,0x61,0x73,0x65,0x20,0x77,0x68,0x65,0x72,0x65,0x20,0x66,0x69,0x6c, - 0x65,0x20,0x77,0x61,0x73,0x20,0x6c,0x6f,0x61,0x64,0x65,0x64,0x20,0x62,0x79,0x20, - 0x3a,0x20,0x22,0x6c,0x75,0x61,0x20,0x6d,0x79,0x66,0x69,0x6c,0x65,0x2e,0x6c,0x75, - 0x61,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x61,0x62,0x6c,0x65, - 0x2e,0x69,0x6e,0x73,0x65,0x72,0x74,0x28,0x6c,0x75,0x61,0x70,0x61,0x74,0x68,0x74, - 0x61,0x62,0x6c,0x65,0x2c,0x22,0x3f,0x2e,0x6c,0x75,0x61,0x22,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x2c,0x76,0x61,0x72,0x20, - 0x69,0x6e,0x20,0x69,0x70,0x61,0x69,0x72,0x73,0x28,0x6c,0x75,0x61,0x70,0x61,0x74, - 0x68,0x74,0x61,0x62,0x6c,0x65,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x61,0x76,0x6f,0x69,0x64,0x20, - 0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x20,0x70,0x61,0x74,0x74,0x65,0x72,0x6e, - 0x73,0x20,0x6d,0x61,0x74,0x63,0x68,0x69,0x6e,0x67,0x20,0x61,0x62,0x73,0x6f,0x6c, - 0x75,0x74,0x65,0x20,0x6f,0x6e,0x65,0x73,0x20,0x28,0x65,0x2e,0x67,0x2e,0x20,0x3f, - 0x2e,0x6c,0x75,0x61,0x20,0x6d,0x61,0x74,0x63,0x68,0x65,0x73,0x20,0x61,0x6e,0x79, - 0x74,0x68,0x69,0x6e,0x67,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x4d,0x2e,0x69,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f, - 0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x28,0x76,0x61,0x72,0x29,0x20,0x3d,0x3d, - 0x20,0x69,0x73,0x5f,0x73,0x6f,0x75,0x72,0x63,0x65,0x5f,0x61,0x62,0x73,0x6f,0x6c, - 0x75,0x74,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65, - 0x73,0x63,0x61,0x70,0x65,0x64,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e, - 0x67,0x73,0x75,0x62,0x28,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x28,0x76,0x61,0x72,0x29,0x2c,0x22,0x5b,0x25,0x5e,0x25,0x24,0x25,0x28,0x25,0x29, - 0x25,0x25,0x25,0x2e,0x25,0x5b,0x25,0x5d,0x25,0x2a,0x25,0x2b,0x25,0x2d,0x25,0x3f, - 0x5d,0x22,0x2c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x63,0x29,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x25,0x22,0x2e,0x2e,0x63,0x20,0x65,0x6e,0x64, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x74,0x74,0x65,0x72,0x6e,0x20, - 0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x65,0x73, - 0x63,0x61,0x70,0x65,0x64,0x2c,0x22,0x25,0x25,0x25,0x3f,0x22,0x2c,0x22,0x28,0x2e, - 0x2b,0x29,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x6f,0x64,0x75,0x6c, - 0x65,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x6d, - 0x61,0x74,0x63,0x68,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x70, - 0x61,0x74,0x68,0x2c,0x70,0x61,0x74,0x74,0x65,0x72,0x6e,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6d,0x6f,0x64,0x75,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x20,0x3d, - 0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x6d,0x6f,0x64, - 0x75,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x2c,0x22,0x2f,0x22,0x2c,0x22,0x2e,0x22,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x66,0x20,0x77,0x65,0x20,0x66, - 0x69,0x6e,0x64,0x20,0x6d,0x6f,0x72,0x65,0x20,0x74,0x68,0x61,0x6e,0x20,0x31,0x20, - 0x70,0x6f,0x73,0x73,0x69,0x62,0x6c,0x65,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x6e, - 0x61,0x6d,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x68,0x65,0x20,0x73, - 0x68,0x6f,0x72,0x74,0x65,0x72,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f, - 0x74,0x20,0x75,0x72,0x69,0x20,0x6f,0x72,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e, - 0x6c,0x65,0x6e,0x28,0x75,0x72,0x69,0x29,0x3e,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e, - 0x6c,0x65,0x6e,0x28,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x29,0x20, - 0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x75,0x72,0x69, - 0x20,0x3d,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x75,0x72,0x69,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x22,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x3a,0x2f,0x2f,0x2f,0x22,0x2e,0x2e,0x75, - 0x72,0x69,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x61,0x6c,0x73,0x65,0x0a, - 0x65,0x6e,0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e, - 0x67,0x65,0x74,0x5f,0x75,0x72,0x69,0x20,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x65,0x61,0x72,0x63,0x68,0x20,0x69, - 0x6e,0x20,0x63,0x61,0x63,0x68,0x65,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x75,0x72,0x69,0x20,0x3d,0x20,0x75,0x72,0x69,0x5f,0x63,0x61,0x63,0x68, - 0x65,0x5b,0x73,0x6f,0x75,0x72,0x63,0x65,0x5d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x75,0x72,0x69,0x20,0x7e,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x75,0x72,0x69,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e, - 0x64,0x2c,0x20,0x63,0x72,0x65,0x61,0x74,0x65,0x20,0x75,0x72,0x69,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x75,0x74,0x69,0x6c,0x2e,0x66,0x65,0x61,0x74,0x75,0x72, - 0x65,0x73,0x2e,0x75,0x72,0x69,0x20,0x3d,0x3d,0x20,0x22,0x6d,0x6f,0x64,0x75,0x6c, - 0x65,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x75,0x72,0x69,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f,0x6d,0x6f,0x64,0x75,0x6c,0x65, - 0x5f,0x75,0x72,0x69,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x75,0x72,0x69,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x75,0x72,0x69,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f,0x61, - 0x62,0x73,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75,0x72,0x69,0x20,0x28,0x73,0x6f,0x75, - 0x72,0x63,0x65,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x75,0x72,0x69,0x20,0x3d,0x20, - 0x20,0x67,0x65,0x74,0x5f,0x61,0x62,0x73,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75,0x72, - 0x69,0x20,0x28,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x75,0x72,0x69,0x5f,0x63,0x61,0x63,0x68, - 0x65,0x5b,0x73,0x6f,0x75,0x72,0x63,0x65,0x5d,0x20,0x3d,0x20,0x75,0x72,0x69,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x75,0x72,0x69,0x0a,0x65, - 0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x70,0x61,0x74,0x68,0x20, - 0x66,0x69,0x6c,0x65,0x20,0x66,0x72,0x6f,0x6d,0x20,0x75,0x72,0x69,0x0a,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x67,0x65,0x74,0x5f,0x70,0x61,0x74, - 0x68,0x20,0x28,0x75,0x72,0x69,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x5f,0x70,0x61,0x74,0x68,0x20,0x3d,0x20, - 0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x75,0x72,0x6c,0x2e,0x70,0x61,0x72,0x73,0x65, - 0x28,0x75,0x72,0x69,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x61, - 0x72,0x73,0x65,0x64,0x5f,0x70,0x61,0x74,0x68,0x2e,0x73,0x63,0x68,0x65,0x6d,0x65, - 0x20,0x3d,0x3d,0x20,0x22,0x66,0x69,0x6c,0x65,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d, - 0x2e,0x74,0x6f,0x5f,0x70,0x61,0x74,0x68,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x5f, - 0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x65,0x61,0x72,0x63,0x68, - 0x20,0x69,0x6e,0x20,0x63,0x61,0x63,0x68,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x77,0x65,0x20,0x73,0x68,0x6f,0x75,0x6c,0x64,0x20,0x73, - 0x75,0x72,0x65,0x6c,0x79,0x20,0x63,0x61,0x6c,0x63,0x75,0x6c,0x61,0x74,0x65,0x20, - 0x69,0x74,0x20,0x69,0x6e,0x73,0x74,0x65,0x61,0x64,0x20,0x6f,0x66,0x20,0x66,0x69, - 0x6e,0x64,0x20,0x69,0x6e,0x20,0x63,0x61,0x63,0x68,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x76,0x20,0x69,0x6e,0x20,0x70, - 0x61,0x69,0x72,0x73,0x28,0x75,0x72,0x69,0x5f,0x63,0x61,0x63,0x68,0x65,0x29,0x64, - 0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x76,0x20,0x3d,0x3d,0x20,0x75,0x72,0x69,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61, - 0x73,0x73,0x65,0x72,0x74,0x28,0x6b,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29, - 0x20,0x3d,0x3d,0x20,0x22,0x40,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x6b,0x3a,0x73,0x75,0x62,0x28,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64, - 0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x6e,0x6f,0x72, - 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x72,0x74,0x73,0x20,0x3d,0x20,0x7b, - 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x77,0x20,0x69,0x6e,0x20, - 0x70,0x61,0x74,0x68,0x3a,0x67,0x6d,0x61,0x74,0x63,0x68,0x28,0x22,0x5b,0x5e,0x2f, - 0x5d,0x2b,0x22,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x20,0x20,0x20,0x20,0x77,0x20,0x3d,0x3d,0x20,0x22,0x2e,0x2e,0x22, - 0x20,0x61,0x6e,0x64,0x20,0x23,0x70,0x61,0x72,0x74,0x73,0x20,0x7e,0x3d,0x30,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x72,0x65,0x6d,0x6f,0x76, - 0x65,0x28,0x70,0x61,0x72,0x74,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x77,0x20,0x7e,0x3d,0x20,0x22,0x2e,0x22, - 0x20,0x20,0x74,0x68,0x65,0x6e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x69,0x6e,0x73, - 0x65,0x72,0x74,0x28,0x70,0x61,0x72,0x74,0x73,0x2c,0x20,0x77,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x70,0x61, - 0x74,0x68,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29,0x20,0x3d,0x3d,0x20,0x22, - 0x2f,0x22,0x20,0x61,0x6e,0x64,0x20,0x22,0x2f,0x22,0x20,0x6f,0x72,0x20,0x22,0x22, - 0x29,0x20,0x2e,0x2e,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61, - 0x74,0x28,0x70,0x61,0x72,0x74,0x73,0x2c,0x20,0x22,0x2f,0x22,0x29,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x69,0x6e, - 0x69,0x74,0x28,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74, - 0x66,0x6f,0x72,0x6d,0x2c,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x64,0x69,0x72,0x65, - 0x63,0x74,0x6f,0x72,0x79,0x2c,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68, - 0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x20, - 0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x68,0x65,0x63,0x6b,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x65,0x74,0x65,0x72,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x65,0x78, - 0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20, - 0x61,0x6e,0x64,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61, - 0x74,0x66,0x6f,0x72,0x6d,0x20,0x7e,0x3d,0x20,0x22,0x75,0x6e,0x69,0x78,0x22,0x20, - 0x61,0x6e,0x64,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61, - 0x74,0x66,0x6f,0x72,0x6d,0x20,0x7e,0x3d,0x22,0x77,0x69,0x6e,0x22,0x20,0x61,0x6e, - 0x64,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66, - 0x6f,0x72,0x6d,0x20,0x7e,0x3d,0x22,0x61,0x6e,0x64,0x72,0x6f,0x69,0x64,0x22,0x20, - 0x61,0x6e,0x64,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61, - 0x74,0x66,0x6f,0x72,0x6d,0x20,0x7e,0x3d,0x22,0x69,0x6f,0x73,0x22,0x74,0x68,0x65, - 0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x72,0x72,0x6f,0x72,0x28, - 0x22,0x55,0x6e,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x69,0x6e,0x69,0x74,0x69, - 0x61,0x6c,0x69,0x7a,0x65,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x6d, - 0x6f,0x64,0x75,0x6c,0x65,0x20,0x3a,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f, - 0x6e,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x73,0x68,0x6f,0x75,0x6c, - 0x64,0x20,0x62,0x65,0x20,0x27,0x75,0x6e,0x69,0x78,0x27,0x20,0x6f,0x72,0x20,0x27, - 0x77,0x69,0x6e,0x27,0x2e,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x75,0x73,0x65,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x65,0x74,0x65,0x72,0x20,0x61,0x73,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74, - 0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66,0x6f, - 0x72,0x6d,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x3d,0x20,0x65,0x78,0x65,0x63,0x75, - 0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x74,0x72, - 0x79,0x20,0x74,0x6f,0x20,0x67,0x75,0x65,0x73,0x73,0x20,0x69,0x74,0x2e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x77,0x69,0x6e,0x64,0x6f,0x77,0x73,0x28, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x70,0x20,0x3d,0x20,0x69,0x6f,0x2e,0x70,0x6f,0x70,0x65,0x6e, - 0x28,0x22,0x65,0x63,0x68,0x6f,0x20,0x25,0x6f,0x73,0x25,0x22,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, - 0x20,0x3d,0x70,0x3a,0x72,0x65,0x61,0x64,0x28,0x22,0x2a,0x6c,0x22,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70, - 0x3a,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x3d,0x20,0x22,0x57,0x69,0x6e,0x64,0x6f, - 0x77,0x73,0x5f,0x4e,0x54,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x61,0x6c,0x73,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x74,0x61,0x74,0x75, - 0x73,0x2c,0x20,0x69,0x73,0x77,0x69,0x6e,0x20,0x3d,0x20,0x70,0x63,0x61,0x6c,0x6c, - 0x28,0x69,0x73,0x77,0x69,0x6e,0x64,0x6f,0x77,0x73,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x74,0x61,0x74,0x75,0x73,0x20,0x61,0x6e, - 0x64,0x20,0x69,0x73,0x77,0x69,0x6e,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72, - 0x6d,0x20,0x3d,0x20,0x22,0x77,0x69,0x6e,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x3d,0x20,0x22,0x75, - 0x6e,0x69,0x78,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x64,0x65,0x70,0x65,0x6e,0x64,0x65, - 0x6e,0x74,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x3d,0x3d,0x20,0x22,0x75, - 0x6e,0x69,0x78,0x22,0x20,0x6f,0x72,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d, - 0x20,0x3d,0x3d,0x20,0x22,0x61,0x6e,0x64,0x72,0x6f,0x69,0x64,0x22,0x20,0x6f,0x72, - 0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20,0x3d,0x3d,0x20,0x22,0x69,0x6f, - 0x73,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x54,0x68,0x65,0x20,0x50,0x61,0x74,0x68,0x20,0x73,0x65,0x70,0x61, - 0x72,0x61,0x74,0x6f,0x72,0x20,0x63,0x68,0x61,0x72,0x61,0x63,0x74,0x65,0x72,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x70,0x61,0x74,0x68,0x5f,0x73, - 0x65,0x70,0x20,0x3d,0x20,0x22,0x2f,0x22,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x54,0x4f,0x44,0x4f,0x20,0x74,0x68,0x65,0x20,0x77,0x61, - 0x79,0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x74,0x68,0x65,0x20,0x61,0x62,0x73, - 0x6f,0x6c,0x75,0x74,0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x63,0x61,0x6e,0x20,0x62, - 0x65,0x20,0x77,0x72,0x6f,0x6e,0x67,0x20,0x69,0x66,0x20,0x74,0x68,0x65,0x20,0x70, - 0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x6c,0x6f,0x61,0x64,0x73,0x20,0x6e,0x65,0x77, - 0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x66,0x69,0x6c,0x65,0x73,0x20,0x62,0x79, - 0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x61, - 0x66,0x74,0x65,0x72,0x20,0x61,0x20,0x63,0x64,0x2e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x6c,0x79,0x2c, - 0x20,0x74,0x68,0x65,0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x20,0x69, - 0x73,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x65,0x64,0x20,0x6f,0x6e,0x20, - 0x73,0x74,0x61,0x72,0x74,0x2c,0x20,0x74,0x68,0x69,0x73,0x20,0x61,0x6c,0x6c,0x6f, - 0x77,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x74,0x6f,0x20,0x6c,0x6f, - 0x61,0x64,0x20,0x61,0x6e,0x79,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x66,0x69, - 0x6c,0x65,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x6e,0x20,0x63,0x68,0x61,0x6e, - 0x67,0x65,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x20,0x64,0x69,0x72,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x77,0x68,0x69,0x63,0x68, - 0x20,0x69,0x73,0x20,0x74,0x68,0x65,0x20,0x6d,0x6f,0x73,0x74,0x20,0x63,0x6f,0x6d, - 0x6d,0x6f,0x6e,0x20,0x75,0x73,0x65,0x20,0x63,0x61,0x73,0x65,0x2e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72, - 0x20,0x3d,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x64,0x69,0x72,0x65,0x63,0x74, - 0x6f,0x72,0x79,0x20,0x6f,0x72,0x20,0x6f,0x73,0x2e,0x67,0x65,0x74,0x65,0x6e,0x76, - 0x28,0x22,0x50,0x57,0x44,0x22,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72,0x74,0x20,0x70,0x61,0x72,0x73, - 0x65,0x64,0x20,0x55,0x52,0x4c,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20, - 0x66,0x69,0x6c,0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x20,0x66,0x6f,0x72,0x20,0x74, - 0x68,0x65,0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x4f,0x53,0x20,0x28,0x73, - 0x65,0x65,0x20,0x75,0x72,0x6c,0x2e,0x70,0x61,0x72,0x73,0x65,0x20,0x66,0x72,0x6f, - 0x6d,0x20,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x74,0x6f,0x5f,0x66,0x69,0x6c,0x65,0x5f,0x75, - 0x72,0x69,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x70, - 0x61,0x74,0x68,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x66,0x69,0x6e,0x64,0x28, - 0x70,0x61,0x74,0x68,0x2c,0x22,0x2f,0x22,0x29,0x20,0x7e,0x3d,0x20,0x31,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x70,0x61,0x74,0x68,0x3d,0x22,0x2f,0x22,0x2e,0x2e,0x70,0x61, - 0x74,0x68,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x75,0x72,0x6c,0x2e,0x62,0x75,0x69,0x6c,0x64,0x7b, - 0x73,0x63,0x68,0x65,0x6d,0x65,0x3d,0x22,0x66,0x69,0x6c,0x65,0x22,0x2c,0x61,0x75, - 0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x3d,0x22,0x22,0x2c,0x20,0x70,0x61,0x74,0x68, - 0x3d,0x70,0x61,0x74,0x68,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x72,0x75,0x65,0x20,0x69,0x73,0x20,0x74,0x68, - 0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x69,0x73,0x20,0x61,0x62,0x73,0x6f,0x6c,0x75, - 0x74,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68, - 0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x6e, - 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x4d,0x2e,0x69,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x61,0x62,0x73,0x6f, - 0x6c,0x75,0x74,0x65,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x28,0x70,0x61,0x74,0x68,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61, - 0x74,0x68,0x3a,0x73,0x75,0x62,0x28,0x31,0x2c,0x31,0x29,0x20,0x3d,0x3d,0x20,0x22, - 0x2f,0x22,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72,0x74,0x20,0x61,0x62,0x73,0x6f,0x6c, - 0x75,0x74,0x65,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x20,0x70, - 0x61,0x74,0x68,0x20,0x66,0x69,0x6c,0x65,0x20,0x74,0x6f,0x20,0x75,0x72,0x69,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x74,0x6f,0x5f,0x70,0x61,0x74, - 0x68,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x70,0x61, - 0x72,0x73,0x65,0x64,0x5f,0x75,0x72,0x6c,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x75,0x72,0x6c,0x2e,0x75,0x6e,0x65,0x73,0x63,0x61,0x70,0x65,0x28,0x70,0x61, - 0x72,0x73,0x65,0x64,0x5f,0x75,0x72,0x6c,0x2e,0x70,0x61,0x74,0x68,0x29,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, - 0x61,0x74,0x69,0x6f,0x6e,0x73,0x20,0x66,0x6f,0x72,0x20,0x57,0x69,0x6e,0x64,0x6f, - 0x77,0x73,0x2c,0x20,0x73,0x65,0x65,0x20,0x55,0x4e,0x49,0x58,0x20,0x76,0x65,0x72, - 0x73,0x69,0x6f,0x6e,0x73,0x20,0x66,0x6f,0x72,0x20,0x64,0x6f,0x63,0x75,0x6d,0x65, - 0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x2e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x4d,0x2e,0x70,0x61,0x74,0x68,0x5f,0x73,0x65,0x70,0x20,0x3d,0x20,0x22,0x5c, - 0x5c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x69,0x73,0x5f, - 0x70,0x61,0x74,0x68,0x5f,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x70,0x61,0x74,0x68,0x29,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61,0x74,0x68,0x3a,0x6d,0x61,0x74,0x63, - 0x68,0x28,0x22,0x5e,0x25,0x61,0x3a,0x2f,0x22,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x74,0x6f,0x5f,0x66,0x69,0x6c,0x65, - 0x5f,0x75,0x72,0x69,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x28,0x70,0x61,0x74,0x68,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x75,0x72, - 0x6c,0x2e,0x62,0x75,0x69,0x6c,0x64,0x7b,0x73,0x63,0x68,0x65,0x6d,0x65,0x3d,0x22, - 0x66,0x69,0x6c,0x65,0x22,0x2c,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x3d, - 0x22,0x22,0x2c,0x20,0x70,0x61,0x74,0x68,0x3d,0x22,0x2f,0x22,0x2e,0x2e,0x70,0x61, - 0x74,0x68,0x7d,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x4d,0x2e,0x74,0x6f,0x5f,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x5f,0x75,0x72,0x6c, - 0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x75,0x72,0x6c,0x2e,0x75,0x6e,0x65, - 0x73,0x63,0x61,0x70,0x65,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x5f,0x75,0x72,0x6c, - 0x2e,0x70,0x61,0x74,0x68,0x29,0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x5e,0x2f,0x22, - 0x2c,0x20,0x22,0x22,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x6e,0x69,0x78,0x6e,0x6f,0x72, - 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x20,0x3d,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61, - 0x6c,0x69,0x7a,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x6e, - 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x70,0x61,0x74,0x68,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x75,0x6e,0x69,0x78,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x70, - 0x61,0x74,0x68,0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x5c,0x5c,0x22,0x2c,0x22,0x2f, - 0x22,0x29,0x3a,0x6c,0x6f,0x77,0x65,0x72,0x28,0x29,0x29,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x64,0x65,0x74,0x65, - 0x72,0x6d,0x69,0x6e,0x65,0x20,0x62,0x61,0x73,0x65,0x20,0x64,0x69,0x72,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x74,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67, - 0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x28,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x20, - 0x3d,0x20,0x69,0x6f,0x2e,0x70,0x6f,0x70,0x65,0x6e,0x28,0x22,0x65,0x63,0x68,0x6f, - 0x20,0x25,0x63,0x64,0x25,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x20,0x3d,0x20,0x70,0x3a,0x72,0x65,0x61,0x64, - 0x28,0x22,0x2a,0x6c,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x3a,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x69,0x7a,0x65,0x28,0x72,0x65,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x2e,0x62, - 0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x3d,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e, - 0x67,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x20,0x6f,0x72,0x20,0x67,0x65, - 0x74,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72, - 0x79,0x28,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x66,0x69,0x78,0x20,0x62,0x75,0x67,0x3a,0x20,0x63,0x61,0x6e,0x20, - 0x6e,0x6f,0x74,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x77,0x68,0x65,0x6e,0x20,0x70, - 0x72,0x6f,0x6a,0x65,0x63,0x74,0x20,0x70,0x61,0x74,0x68,0x20,0x63,0x6f,0x6e,0x74, - 0x61,0x69,0x6e,0x73,0x20,0x62,0x6c,0x61,0x6e,0x6b,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x20,0x62,0x6c,0x61,0x6e,0x6b,0x20,0x77, - 0x69,0x74,0x68,0x20,0x25,0x32,0x30,0x20,0x28,0x61,0x64,0x64,0x20,0x62,0x79,0x20, - 0x67,0x75,0x61,0x6e,0x79,0x75,0x29,0x0a,0x20,0x20,0x20,0x20,0x4d,0x2e,0x62,0x61, - 0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x3d,0x20,0x4d,0x2e,0x62,0x61,0x73,0x65,0x5f, - 0x64,0x69,0x72,0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x20,0x22,0x2c,0x22,0x25,0x25, - 0x32,0x30,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65,0x20, - 0x6a,0x73,0x2f,0x6c,0x75,0x61,0x20,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x73,0x65, - 0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68,0x20,0x69,0x66,0x20,0x68,0x61,0x73,0x20, - 0x6d,0x6f,0x72,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x6f,0x6e,0x65,0x2c,0x20,0x73, - 0x70,0x6c,0x69,0x74,0x20,0x74,0x68,0x65,0x6d,0x20,0x77,0x69,0x74,0x68,0x20,0x61, - 0x20,0x73,0x65,0x6d,0x69,0x63,0x6f,0x6c,0x6f,0x6e,0x20,0x22,0x3b,0x22,0x20,0x28, - 0x61,0x64,0x64,0x65,0x64,0x20,0x62,0x79,0x20,0x67,0x75,0x61,0x6e,0x79,0x75,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61, - 0x74,0x68,0x73,0x20,0x74,0x68,0x65,0x6e,0x20,0x4d,0x2e,0x73,0x65,0x61,0x72,0x63, - 0x68,0x5f,0x70,0x61,0x74,0x68,0x73,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72, - 0x74,0x5f,0x74,0x6f,0x5f,0x73,0x65,0x61,0x72,0x63,0x68,0x5f,0x70,0x61,0x74,0x68, - 0x73,0x28,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68,0x73,0x29,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x4d,0x2e, - 0x62,0x61,0x73,0x65,0x5f,0x64,0x69,0x72,0x20,0x74,0x68,0x65,0x6e,0x20,0x65,0x72, - 0x72,0x6f,0x72,0x28,0x22,0x55,0x6e,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x64, - 0x65,0x74,0x65,0x72,0x6d,0x69,0x6e,0x65,0x20,0x74,0x68,0x65,0x20,0x77,0x6f,0x72, - 0x6b,0x69,0x6e,0x67,0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x2e,0x22, - 0x29,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x4d,0x0a,0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64, - 0x20,0x6f,0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d, - 0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x2e,0x75,0x74,0x69,0x6c,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e, - 0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x2e,0x75,0x74,0x69,0x6c,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70,0x79, - 0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d,0x32, - 0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c, - 0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e,0x0a, - 0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72,0x65, - 0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f, - 0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x63, - 0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65,0x20, - 0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72,0x20, - 0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68,0x65, - 0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63,0x20, - 0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d,0x20, - 0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69,0x65, - 0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74, - 0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61,0x69, - 0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74,0x70, - 0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e,0x6f, - 0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31,0x30, - 0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e,0x74, - 0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20, - 0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73, - 0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20,0x61, - 0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f, - 0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x55,0x74,0x69,0x6c,0x69,0x74,0x79,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x73,0x2e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4d, - 0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x6c,0x6f,0x67,0x20,0x73, - 0x79,0x73,0x74,0x65,0x6d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4c,0x45,0x56,0x45, - 0x4c,0x53,0x20,0x3d,0x20,0x7b,0x20,0x45,0x52,0x52,0x4f,0x52,0x20,0x3d,0x20,0x30, - 0x2c,0x20,0x57,0x41,0x52,0x4e,0x49,0x4e,0x47,0x20,0x3d,0x20,0x31,0x2c,0x20,0x49, - 0x4e,0x46,0x4f,0x20,0x3d,0x20,0x32,0x2c,0x20,0x44,0x45,0x54,0x41,0x49,0x4c,0x20, - 0x3d,0x20,0x33,0x2c,0x20,0x44,0x45,0x42,0x55,0x47,0x20,0x3d,0x20,0x34,0x20,0x7d, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x4c,0x4f,0x47,0x5f,0x4c,0x45,0x56,0x45,0x4c, - 0x20,0x3d,0x20,0x4c,0x45,0x56,0x45,0x4c,0x53,0x2e,0x57,0x41,0x52,0x4e,0x49,0x4e, - 0x47,0x0a,0x0a,0x2d,0x2d,0x20,0x44,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x66, - 0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67, - 0x2e,0x20,0x41,0x6e,0x79,0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x20,0x63,0x61, - 0x6e,0x20,0x62,0x65,0x20,0x67,0x65,0x74,0x20,0x6c,0x69,0x6b,0x65,0x20,0x61,0x6e, - 0x79,0x20,0x72,0x65,0x67,0x75,0x6c,0x61,0x72,0x20,0x74,0x61,0x62,0x6c,0x65,0x2c, - 0x20,0x73,0x65,0x74,0x74,0x69,0x6e,0x67,0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65, - 0x73,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x69,0x6e,0x0a,0x2d,0x2d,0x20,0x65, - 0x72,0x72,0x6f,0x72,0x20,0x66,0x6f,0x72,0x20,0x75,0x6e,0x6b,0x6e,0x6f,0x77,0x6e, - 0x20,0x6f,0x72,0x20,0x72,0x65,0x61,0x64,0x2d,0x6f,0x6e,0x6c,0x79,0x20,0x66,0x65, - 0x61,0x74,0x75,0x72,0x65,0x73,0x2e,0x0a,0x4d,0x2e,0x66,0x65,0x61,0x74,0x75,0x72, - 0x65,0x73,0x20,0x3d,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x28,0x7b,0x20,0x7d,0x2c,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x74,0x68,0x61,0x74,0x20,0x66, - 0x6f,0x72,0x6d,0x61,0x74,0x2f,0x76,0x61,0x6c,0x69,0x64,0x61,0x74,0x65,0x20,0x64, - 0x61,0x74,0x61,0x2e,0x20,0x49,0x66,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x64, - 0x2c,0x20,0x74,0x68,0x65,0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x20,0x63,0x61, - 0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64, - 0x2e,0x0a,0x20,0x20,0x20,0x20,0x76,0x61,0x6c,0x69,0x64,0x61,0x74,0x6f,0x72,0x73, - 0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x75,0x6c, - 0x74,0x69,0x70,0x6c,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x73,0x20,0x3d, - 0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x74,0x6f, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6d,0x61,0x78,0x5f,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x20,0x3d,0x20,0x74, - 0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6d,0x61,0x78,0x5f,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75, - 0x6d,0x62,0x65,0x72,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x61, - 0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62, - 0x65,0x72,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x68,0x6f,0x77, - 0x5f,0x68,0x69,0x64,0x64,0x65,0x6e,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x75,0x6d,0x62, - 0x65,0x72,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x75,0x72,0x69,0x20, - 0x3d,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6c,0x65,0x76,0x65,0x6c,0x5f,0x6e, - 0x61,0x6d,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x73,0x65,0x74,0x20,0x6e,0x75,0x6d,0x65,0x72,0x69,0x63,0x61, - 0x6c,0x20,0x69,0x6e,0x64,0x65,0x78,0x20,0x69,0x6e,0x20,0x69,0x6e,0x74,0x65,0x72, - 0x6e,0x61,0x6c,0x20,0x76,0x61,0x72,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x4c,0x4f,0x47,0x5f,0x4c,0x45,0x56,0x45,0x4c,0x20,0x3d,0x20, - 0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x4c,0x45,0x56,0x45,0x4c,0x53,0x5b,0x6c,0x65, - 0x76,0x65,0x6c,0x5f,0x6e,0x61,0x6d,0x65,0x5d,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73, - 0x75,0x63,0x68,0x20,0x6c,0x65,0x76,0x65,0x6c,0x22,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6c, - 0x65,0x76,0x65,0x6c,0x5f,0x6e,0x61,0x6d,0x65,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65, - 0x20,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x65,0x64,0x20,0x6c,0x65,0x76,0x65,0x6c, - 0x20,0x69,0x73,0x20,0x73,0x74,0x69,0x6c,0x6c,0x20,0x74,0x68,0x65,0x20,0x6e,0x61, - 0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20,0x20,0x5f,0x5f,0x69,0x6e,0x64, - 0x65,0x78,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d, - 0x75,0x6c,0x74,0x69,0x70,0x6c,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x73, - 0x20,0x3d,0x20,0x30,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x63,0x6f,0x64,0x69,0x6e,0x67,0x20,0x3d,0x22,0x55,0x54,0x46,0x2d,0x38,0x22,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x61,0x78,0x5f,0x63,0x68,0x69, - 0x6c,0x64,0x72,0x65,0x6e,0x20,0x3d,0x20,0x33,0x32,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6d,0x61,0x78,0x5f,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x30, - 0x78,0x46,0x46,0x46,0x46,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d, - 0x61,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x31,0x2c,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x68,0x6f,0x77,0x5f,0x68,0x69,0x64,0x64,0x65, - 0x6e,0x20,0x3d,0x20,0x31,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x75, - 0x72,0x69,0x20,0x3d,0x20,0x22,0x66,0x69,0x6c,0x65,0x22,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d, - 0x20,0x22,0x57,0x41,0x52,0x4e,0x49,0x4e,0x47,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x72,0x65,0x61,0x64,0x20,0x6f,0x6e,0x6c,0x79, - 0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x5f,0x73,0x75,0x70,0x70,0x6f, - 0x72,0x74,0x73,0x5f,0x74,0x68,0x72,0x65,0x61,0x64,0x73,0x20,0x3d,0x20,0x30,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67, - 0x65,0x5f,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x22,0x4c,0x75,0x61,0x22,0x2c,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65, - 0x5f,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x56,0x45,0x52,0x53, - 0x49,0x4f,0x4e,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f, - 0x74,0x6f,0x63,0x6f,0x6c,0x5f,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20, - 0x31,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x75,0x70,0x70,0x6f, - 0x72,0x74,0x73,0x5f,0x61,0x73,0x79,0x6e,0x63,0x20,0x3d,0x20,0x31,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x61,0x74,0x61,0x5f,0x65,0x6e,0x63,0x6f, - 0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x22,0x62,0x61,0x73,0x65,0x36,0x34,0x22,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x5f,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x73,0x20,0x3d,0x20, - 0x22,0x4c,0x75,0x61,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, - 0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x74,0x79,0x70,0x65,0x73,0x20, - 0x3d,0x20,0x22,0x6c,0x69,0x6e,0x65,0x20,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f, - 0x6e,0x61,0x6c,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x2c,0x0a,0x20,0x20,0x20, - 0x20,0x5f,0x5f,0x6e,0x65,0x77,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6b,0x2c,0x20, - 0x76,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x6d,0x74,0x20,0x3d,0x20,0x67,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62, - 0x6c,0x65,0x28,0x73,0x65,0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x2c,0x20,0x76, - 0x61,0x6c,0x69,0x64,0x61,0x74,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x74,0x2e,0x5f,0x5f, - 0x69,0x6e,0x64,0x65,0x78,0x2c,0x20,0x6d,0x74,0x2e,0x76,0x61,0x6c,0x69,0x64,0x61, - 0x74,0x6f,0x72,0x73,0x5b,0x6b,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x5b,0x6b,0x5d,0x20,0x3d,0x3d,0x20, - 0x6e,0x69,0x6c,0x20,0x74,0x68,0x65,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22, - 0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20,0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x20, - 0x22,0x20,0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x6b,0x29, - 0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x6e,0x6f,0x74,0x20,0x76,0x61,0x6c,0x69,0x64,0x61,0x74,0x6f,0x72,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x22,0x54,0x68,0x65,0x20,0x66, - 0x65,0x61,0x74,0x75,0x72,0x65,0x20,0x22,0x20,0x2e,0x2e,0x20,0x74,0x6f,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x28,0x6b,0x29,0x20,0x2e,0x2e,0x20,0x22,0x20,0x69,0x73,0x20, - 0x72,0x65,0x61,0x64,0x2d,0x6f,0x6e,0x6c,0x79,0x22,0x29,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x61,0x73,0x73,0x65, - 0x72,0x74,0x28,0x76,0x61,0x6c,0x69,0x64,0x61,0x74,0x6f,0x72,0x28,0x76,0x29,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x5b, - 0x6b,0x5d,0x20,0x3d,0x20,0x76,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c,0x0a, - 0x7d,0x29,0x0a,0x0a,0x2d,0x2d,0x20,0x57,0x72,0x61,0x70,0x73,0x20,0x64,0x65,0x62, - 0x75,0x67,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x61,0x6e,0x64,0x20, - 0x61,0x6e,0x20,0x61,0x74,0x74,0x61,0x63,0x68,0x65,0x64,0x20,0x74,0x68,0x72,0x65, - 0x61,0x64,0x0a,0x2d,0x2d,0x20,0x61,0x6c,0x73,0x6f,0x20,0x68,0x61,0x6e,0x64,0x6c, - 0x65,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x26,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74, - 0x69,0x6e,0x65,0x20,0x6d,0x61,0x6e,0x61,0x67,0x65,0x6d,0x65,0x6e,0x74,0x20,0x64, - 0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x63,0x69,0x65,0x73,0x20,0x62,0x65,0x74,0x77, - 0x65,0x65,0x6e,0x20,0x4c,0x75,0x61,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x73, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x2c,0x20, - 0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x2c,0x20,0x73,0x65,0x74,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x3d,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x69,0x6e, - 0x66,0x6f,0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x6c,0x6f,0x63, - 0x61,0x6c,0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x73,0x65,0x74,0x6c,0x6f,0x63, - 0x61,0x6c,0x0a,0x0a,0x2d,0x2d,0x20,0x46,0x6f,0x72,0x65,0x69,0x67,0x6e,0x20,0x74, - 0x68,0x72,0x65,0x61,0x64,0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f, - 0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x70,0x61,0x75,0x73,0x65,0x64,0x20,0x74,0x68, - 0x72,0x65,0x61,0x64,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x46,0x6f,0x72,0x65,0x69, - 0x67,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x20,0x3d,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x20,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76, - 0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x73,0x65,0x6c, - 0x66,0x5b,0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61, - 0x74,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x67,0x65,0x74,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x69,0x64,0x78, - 0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65, - 0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x73,0x65,0x6c,0x66,0x5b,0x31,0x5d,0x2c,0x20, - 0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x69,0x64,0x78,0x29,0x20,0x65,0x6e,0x64,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c, - 0x65,0x76,0x65,0x6c,0x2c,0x20,0x69,0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28, - 0x73,0x65,0x6c,0x66,0x5b,0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20, - 0x69,0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d, - 0x0a,0x46,0x6f,0x72,0x65,0x69,0x67,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54, - 0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x46,0x6f,0x72,0x65,0x69, - 0x67,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x0a,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x46,0x6f,0x72,0x65,0x69,0x67,0x6e,0x54,0x68,0x72, - 0x65,0x61,0x64,0x28,0x63,0x6f,0x72,0x6f,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20, - 0x63,0x6f,0x72,0x6f,0x20,0x7d,0x2c,0x20,0x46,0x6f,0x72,0x65,0x69,0x67,0x6e,0x54, - 0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x20,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, - 0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x64,0x65,0x62,0x75,0x67, - 0x20,0x74,0x68,0x65,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x74,0x68,0x61,0x74, - 0x20,0x63,0x61,0x75,0x73,0x65,0x64,0x20,0x74,0x68,0x65,0x20,0x68,0x6f,0x6f,0x6b, - 0x0a,0x2d,0x2d,0x20,0x69,0x6e,0x74,0x65,0x6e,0x64,0x65,0x64,0x20,0x74,0x6f,0x20, - 0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x2a,0x4f,0x4e,0x4c,0x59,0x2a,0x20,0x69, - 0x6e,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x6c,0x6f,0x6f,0x70,0x20,0x28,0x65,0x78, - 0x65,0x63,0x75,0x74,0x65,0x64,0x20,0x69,0x6e,0x20,0x61,0x20,0x6e,0x65,0x77,0x20, - 0x74,0x68,0x72,0x65,0x61,0x64,0x29,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x43,0x75, - 0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x20,0x3d,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x20,0x20,0x3d, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20, - 0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28, - 0x73,0x65,0x6c,0x66,0x5b,0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x2b, - 0x20,0x32,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76, - 0x65,0x6c,0x2c,0x20,0x69,0x64,0x78,0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x73,0x65, - 0x6c,0x66,0x5b,0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x2b,0x20,0x32, - 0x2c,0x20,0x69,0x64,0x78,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c, - 0x20,0x69,0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x73,0x65,0x6c,0x66,0x5b, - 0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x2b,0x20,0x32,0x2c,0x20,0x69, - 0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d,0x0a, - 0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x2e, - 0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x43,0x75,0x72,0x72,0x65,0x6e, - 0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x4d,0x2e,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65, - 0x61,0x64,0x28,0x63,0x6f,0x72,0x6f,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x7b,0x20,0x63, - 0x6f,0x72,0x6f,0x20,0x7d,0x2c,0x20,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68, - 0x72,0x65,0x61,0x64,0x4d,0x54,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x0a,0x2d,0x2d, - 0x20,0x53,0x6f,0x6d,0x65,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x64,0x65, - 0x70,0x65,0x6e,0x64,0x61,0x6e,0x74,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x73,0x0a,0x69,0x66,0x20,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d,0x3d, - 0x20,0x22,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x6f,0x61,0x64,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x2c,0x20,0x67,0x65,0x74,0x66,0x65,0x6e,0x76,0x2c,0x20,0x73, - 0x65,0x74,0x66,0x65,0x6e,0x76,0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x5f,0x67,0x65, - 0x74,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x4d,0x61,0x69,0x6e,0x54,0x68,0x72,0x65,0x61, - 0x64,0x20,0x3d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x61,0x64,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20,0x67,0x65,0x74,0x66,0x65,0x6e, - 0x76,0x2c,0x20,0x73,0x65,0x74,0x66,0x65,0x6e,0x76,0x2c,0x20,0x64,0x65,0x62,0x75, - 0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x6e,0x69,0x6c,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x6e,0x20,0x35,0x2e,0x31,0x20,0x22,0x74, - 0x22,0x20,0x66,0x6c,0x61,0x67,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x65,0x78,0x69,0x73,0x74,0x20,0x61,0x6e,0x64,0x20,0x74,0x72,0x69,0x67,0x67,0x65, - 0x72,0x20,0x61,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x73,0x6f,0x20,0x72,0x65, - 0x6d,0x6f,0x76,0x65,0x20,0x69,0x74,0x20,0x66,0x72,0x6f,0x6d,0x20,0x77,0x68,0x61, - 0x74,0x0a,0x20,0x20,0x20,0x20,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72, - 0x65,0x61,0x64,0x4d,0x54,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c, - 0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x73,0x65,0x6c,0x66,0x5b, - 0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x2b,0x20,0x32,0x2c,0x20,0x77, - 0x68,0x61,0x74,0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x74,0x22,0x2c,0x20,0x22,0x22, - 0x2c,0x20,0x31,0x29,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x46,0x6f, - 0x72,0x65,0x69,0x67,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x4d,0x54,0x2e,0x67,0x65, - 0x74,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68, - 0x61,0x74,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x69,0x6e, - 0x66,0x6f,0x28,0x73,0x65,0x6c,0x66,0x5b,0x31,0x5d,0x2c,0x20,0x6c,0x65,0x76,0x65, - 0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x74,0x22, - 0x2c,0x20,0x22,0x22,0x2c,0x20,0x31,0x29,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x77,0x68,0x65,0x6e,0x20,0x77,0x65,0x27,0x72,0x65, - 0x20,0x66,0x6f,0x72,0x63,0x65,0x64,0x20,0x74,0x6f,0x20,0x73,0x74,0x61,0x72,0x74, - 0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x6c,0x6f,0x6f,0x70,0x20,0x6f,0x6e,0x20,0x74, - 0x6f,0x70,0x20,0x6f,0x66,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x73,0x74, - 0x61,0x63,0x6b,0x20,0x28,0x77,0x68,0x65,0x6e,0x20,0x6f,0x6e,0x20,0x6d,0x61,0x69, - 0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x74,0x68,0x69,0x73,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65, - 0x73,0x20,0x73,0x6f,0x6d,0x65,0x20,0x68,0x61,0x63,0x6b,0x65,0x72,0x79,0x20,0x74, - 0x6f,0x20,0x67,0x65,0x74,0x20,0x72,0x69,0x67,0x68,0x74,0x20,0x73,0x74,0x61,0x63, - 0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x46,0x61,0x6c,0x6c,0x62,0x61,0x63,0x6b,0x20,0x6d,0x65,0x74,0x68,0x6f,0x64,0x20, - 0x74,0x6f,0x20,0x69,0x6e,0x73,0x70,0x65,0x63,0x74,0x20,0x72,0x75,0x6e,0x6e,0x69, - 0x6e,0x67,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x28,0x6f,0x6e,0x6c,0x79,0x20, - 0x66,0x6f,0x72,0x20,0x6d,0x61,0x69,0x6e,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, - 0x69,0x6e,0x20,0x35,0x2e,0x31,0x20,0x6f,0x72,0x20,0x66,0x6f,0x72,0x20,0x63,0x6f, - 0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x62,0x72,0x65,0x61,0x6b,0x70, - 0x6f,0x69,0x6e,0x74,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x47, - 0x65,0x74,0x73,0x20,0x61,0x20,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x73,0x74,0x61, - 0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x77,0x69,0x74,0x68,0x20,0x61,0x64, - 0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x20,0x6c,0x6f,0x67,0x69,0x63,0x20,0x61,0x64,0x64,0x65,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x6c,0x20,0x28,0x6e, - 0x75,0x6d,0x62,0x65,0x72,0x29,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76, - 0x65,0x6c,0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x66,0x6f,0x72,0x20,0x64,0x65, - 0x62,0x75,0x67,0x67,0x65,0x64,0x20,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x28,0x30, - 0x20,0x62,0x61,0x73,0x65,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x61,0x6c,0x20,0x4c,0x75,0x61,0x20, - 0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x73,0x75,0x69,0x74, - 0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x70,0x61,0x73,0x73,0x65, - 0x64,0x20,0x74,0x68,0x72,0x6f,0x75,0x67,0x68,0x20,0x64,0x65,0x75,0x62,0x67,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x67,0x65,0x74, - 0x5f,0x73,0x63,0x72,0x69,0x70,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x6c,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x68, - 0x6f,0x6f,0x6b,0x20,0x3d,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x68, - 0x6f,0x6f,0x6b,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f, - 0x72,0x20,0x69,0x3d,0x32,0x2c,0x20,0x6d,0x61,0x74,0x68,0x2e,0x68,0x75,0x67,0x65, - 0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x64,0x65,0x62,0x75,0x67,0x2e, - 0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x69,0x2c,0x20,0x22,0x66,0x22,0x29,0x29, - 0x2e,0x66,0x75,0x6e,0x63,0x20,0x3d,0x3d,0x20,0x68,0x6f,0x6f,0x6b,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x20,0x2b,0x20,0x6c,0x20, - 0x2d,0x2d,0x20,0x74,0x68,0x65,0x20,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x74,0x6f, - 0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x69,0x73,0x20,0x6a,0x75,0x73,0x74,0x20,0x62, - 0x65,0x6c,0x6f,0x77,0x2c,0x20,0x62,0x75,0x74,0x20,0x62,0x65,0x63,0x61,0x75,0x73, - 0x65,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x65,0x78,0x74,0x72,0x61,0x20,0x63, - 0x61,0x6c,0x6c,0x20,0x74,0x6f,0x20,0x74,0x68,0x69,0x73,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x65,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20, - 0x69,0x73,0x20,0x6f,0x6b,0x20,0x66,0x6f,0x72,0x20,0x63,0x61,0x6c,0x6c,0x65,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x72,0x61,0x77, - 0x67,0x65,0x74,0x28,0x5f,0x47,0x2c,0x20,0x22,0x6a,0x69,0x74,0x22,0x29,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4d,0x61,0x69,0x6e, - 0x54,0x68,0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x22,0x6d,0x61, - 0x69,0x6e,0x22,0x2c,0x20,0x2d,0x2d,0x20,0x61,0x73,0x20,0x74,0x68,0x65,0x20,0x72, - 0x61,0x77,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x6f,0x62,0x6a,0x65,0x63,0x74, - 0x20,0x69,0x73,0x20,0x75,0x73,0x65,0x64,0x20,0x61,0x73,0x20,0x74,0x61,0x62,0x6c, - 0x65,0x20,0x6b,0x65,0x79,0x73,0x2c,0x20,0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x20, - 0x61,0x20,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x6d,0x65,0x6e,0x74,0x2e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x4c,0x75, - 0x61,0x4a,0x49,0x54,0x20,0x63,0x6f,0x6d,0x70,0x6c,0x65,0x74,0x65,0x6c,0x79,0x20, - 0x65,0x6c,0x69,0x6d,0x69,0x6e,0x61,0x74,0x65,0x73,0x20,0x74,0x61,0x69,0x6c,0x20, - 0x63,0x61,0x6c,0x6c,0x73,0x20,0x66,0x72,0x6f,0x6d,0x20,0x73,0x74,0x61,0x63,0x6b, - 0x2c,0x20,0x73,0x6f,0x20,0x67,0x65,0x74,0x5f,0x73,0x63,0x72,0x69,0x70,0x74,0x5f, - 0x6c,0x65,0x76,0x65,0x6c,0x20,0x72,0x65,0x74,0x75,0x6e,0x72,0x73,0x20,0x77,0x72, - 0x6f,0x6e,0x67,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x69,0x6e,0x20,0x74,0x68, - 0x69,0x73,0x20,0x63,0x61,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x20,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65, - 0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x67,0x65, - 0x74,0x5f,0x73,0x63,0x72,0x69,0x70,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x6c, - 0x65,0x76,0x65,0x6c,0x29,0x20,0x2d,0x20,0x31,0x2c,0x20,0x77,0x68,0x61,0x74,0x3a, - 0x67,0x73,0x75,0x62,0x28,0x22,0x74,0x22,0x2c,0x20,0x22,0x22,0x2c,0x20,0x31,0x29, - 0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76, - 0x65,0x6c,0x2c,0x20,0x69,0x64,0x78,0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x67,0x65, - 0x74,0x5f,0x73,0x63,0x72,0x69,0x70,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x6c, - 0x65,0x76,0x65,0x6c,0x29,0x20,0x2d,0x20,0x31,0x2c,0x20,0x69,0x64,0x78,0x29,0x20, - 0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c, - 0x2c,0x20,0x69,0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x67,0x65,0x74,0x5f, - 0x73,0x63,0x72,0x69,0x70,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x6c,0x65,0x76, - 0x65,0x6c,0x29,0x20,0x2d,0x20,0x31,0x2c,0x20,0x69,0x64,0x78,0x2c,0x20,0x76,0x61, - 0x6c,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x4d,0x61,0x69,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x20,0x3d,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5b,0x31, - 0x5d,0x20,0x3d,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x20, - 0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66, - 0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x69,0x6e,0x66, - 0x6f,0x28,0x67,0x65,0x74,0x5f,0x73,0x63,0x72,0x69,0x70,0x74,0x5f,0x6c,0x65,0x76, - 0x65,0x6c,0x28,0x6c,0x65,0x76,0x65,0x6c,0x29,0x20,0x2c,0x20,0x77,0x68,0x61,0x74, - 0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x74,0x22,0x2c,0x20,0x22,0x22,0x2c,0x20,0x31, - 0x29,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65, - 0x76,0x65,0x6c,0x2c,0x20,0x69,0x64,0x78,0x29,0x20,0x20,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x67, - 0x65,0x74,0x5f,0x73,0x63,0x72,0x69,0x70,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28, - 0x6c,0x65,0x76,0x65,0x6c,0x29,0x2c,0x20,0x69,0x64,0x78,0x29,0x20,0x65,0x6e,0x64, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x65, - 0x74,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x69, - 0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x65,0x74,0x6c,0x6f,0x63,0x61,0x6c,0x28,0x67,0x65,0x74,0x5f,0x73,0x63,0x72, - 0x69,0x70,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x28,0x6c,0x65,0x76,0x65,0x6c,0x29, - 0x2c,0x20,0x69,0x64,0x78,0x2c,0x20,0x76,0x61,0x6c,0x29,0x20,0x65,0x6e,0x64,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x0a,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x49,0x66,0x20, - 0x74,0x68,0x65,0x20,0x56,0x4d,0x20,0x69,0x73,0x20,0x76,0x61,0x6e,0x69,0x6c,0x6c, - 0x61,0x20,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x20,0x6f,0x72,0x20,0x4c,0x75,0x61, - 0x4a,0x49,0x54,0x20,0x32,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x35,0x2e, - 0x32,0x20,0x63,0x6f,0x6d,0x70,0x61,0x74,0x69,0x62,0x69,0x6c,0x69,0x74,0x79,0x2c, - 0x20,0x74,0x68,0x65,0x72,0x65,0x20,0x69,0x73,0x20,0x6e,0x6f,0x20,0x77,0x61,0x79, - 0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x61,0x20,0x72,0x65,0x66,0x65,0x72,0x65, - 0x6e,0x63,0x65,0x20,0x74,0x6f,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68, - 0x65,0x20,0x6d,0x61,0x69,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x2c,0x20,0x73,0x6f,0x20,0x66,0x61,0x6c,0x6c,0x20,0x62,0x61,0x63,0x6b,0x20,0x74, - 0x6f,0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x20,0x6d,0x6f,0x64,0x65,0x3a,0x20,0x74, - 0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6c,0x6f,0x6f,0x70, - 0x20,0x69,0x73,0x20,0x73,0x74,0x61,0x72,0x74,0x65,0x64,0x20,0x6f,0x6e,0x20,0x74, - 0x68,0x65,0x20,0x74,0x6f,0x70,0x20,0x6f,0x66,0x20,0x6d,0x61,0x69,0x6e,0x20,0x74, - 0x68,0x72,0x65,0x61,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x61,0x6e,0x64, - 0x20,0x74,0x68,0x65,0x20,0x61,0x63,0x74,0x75,0x61,0x6c,0x20,0x6c,0x65,0x76,0x65, - 0x6c,0x20,0x69,0x73,0x20,0x72,0x65,0x63,0x6f,0x6d,0x70,0x75,0x74,0x65,0x64,0x20, - 0x65,0x61,0x63,0x68,0x20,0x74,0x69,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x6f,0x6c,0x64,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68, - 0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x4d,0x2e,0x43,0x75,0x72,0x72,0x65,0x6e,0x74, - 0x54,0x68,0x72,0x65,0x61,0x64,0x0a,0x20,0x20,0x20,0x20,0x4d,0x2e,0x43,0x75,0x72, - 0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x28,0x63,0x6f,0x72,0x6f,0x29,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x20,0x61,0x6e,0x64,0x20,0x6f,0x6c,0x64,0x43, - 0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x28,0x63,0x6f,0x72, - 0x6f,0x29,0x20,0x6f,0x72,0x20,0x4d,0x61,0x69,0x6e,0x54,0x68,0x72,0x65,0x61,0x64, - 0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6c,0x6f,0x61, - 0x64,0x20,0x61,0x20,0x70,0x69,0x65,0x63,0x65,0x20,0x6f,0x66,0x20,0x63,0x6f,0x64, - 0x65,0x20,0x61,0x6c,0x6f,0x67,0x20,0x77,0x69,0x74,0x68,0x20,0x69,0x74,0x73,0x20, - 0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x6c,0x6f,0x61,0x64,0x69, - 0x6e,0x28,0x63,0x6f,0x64,0x65,0x2c,0x20,0x65,0x6e,0x76,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x2c,0x65,0x72,0x72,0x20,0x3d, - 0x20,0x6c,0x6f,0x61,0x64,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x63,0x6f,0x64,0x65, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x66, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x65,0x72,0x72,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x20,0x61,0x6e,0x64,0x20,0x73,0x65, - 0x74,0x66,0x65,0x6e,0x76,0x28,0x66,0x2c,0x20,0x65,0x6e,0x76,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x74,0x68, - 0x61,0x74,0x20,0x6d,0x61,0x70,0x73,0x20,0x5b,0x67,0x73,0x5d,0x65,0x74,0x20,0x65, - 0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x74,0x6f,0x20,0x69,0x6e, - 0x64,0x65,0x78,0x0a,0x20,0x20,0x20,0x20,0x4d,0x2e,0x65,0x76,0x61,0x6c,0x5f,0x65, - 0x6e,0x76,0x20,0x3d,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x28,0x7b,0x20,0x7d,0x2c,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x66,0x75,0x6e,0x63,0x29,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x67,0x65,0x74,0x66,0x65,0x6e,0x76,0x28,0x66, - 0x75,0x6e,0x63,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x5f,0x5f,0x6e,0x65,0x77,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x66,0x75, - 0x6e,0x63,0x2c,0x20,0x65,0x6e,0x76,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x65,0x74,0x66,0x65,0x6e,0x76,0x28,0x66,0x75,0x6e,0x63,0x2c,0x20,0x65,0x6e, - 0x76,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x7d,0x29,0x0a,0x65, - 0x6c,0x73,0x65,0x69,0x66,0x20,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d, - 0x3d,0x20,0x22,0x4c,0x75,0x61,0x20,0x35,0x2e,0x32,0x22,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x6f,0x61,0x64,0x2c, - 0x20,0x64,0x65,0x62,0x75,0x67,0x5f,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x20,0x3d, - 0x20,0x6c,0x6f,0x61,0x64,0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74, - 0x69,0x6e,0x66,0x6f,0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x4d,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x63,0x6f,0x72,0x6f, - 0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x6f,0x72,0x6f,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x65,0x62,0x75,0x67, - 0x5f,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c, - 0x65,0x76,0x65,0x6c,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x64,0x65,0x62,0x75,0x67,0x5f,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x6c,0x65, - 0x76,0x65,0x6c,0x20,0x2b,0x20,0x31,0x2c,0x20,0x77,0x68,0x61,0x74,0x29,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x6c,0x6f,0x61,0x64,0x69, - 0x6e,0x28,0x63,0x6f,0x64,0x65,0x2c,0x20,0x65,0x6e,0x76,0x29,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x6c,0x6f,0x61,0x64,0x28,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6e, - 0x69,0x6c,0x2c,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x65,0x6e,0x76,0x29,0x20,0x65,0x6e, - 0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x6e,0x6f,0x20,0x65,0x76,0x61, - 0x6c,0x5f,0x65,0x6e,0x76,0x20,0x66,0x6f,0x72,0x20,0x35,0x2e,0x32,0x20,0x61,0x73, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x64,0x6f,0x65,0x73,0x20, - 0x6e,0x6f,0x74,0x20,0x68,0x61,0x76,0x65,0x20,0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e, - 0x6d,0x65,0x6e,0x74,0x73,0x20,0x61,0x6e,0x79,0x6d,0x6f,0x72,0x65,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x42,0x61,0x72,0x65,0x20,0x6d,0x69,0x6e,0x69,0x6d, - 0x61,0x6c,0x20,0x6c,0x6f,0x67,0x20,0x73,0x79,0x73,0x74,0x65,0x6d,0x2e,0x0a,0x2d, - 0x2d,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x4d,0x2e,0x6c,0x6f,0x67,0x28,0x6c,0x65, - 0x76,0x65,0x6c,0x2c,0x20,0x6d,0x73,0x67,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x4c,0x45,0x56,0x45,0x4c,0x53,0x5b,0x6c,0x65, - 0x76,0x65,0x6c,0x5d,0x20,0x6f,0x72,0x20,0x2d,0x31,0x29,0x20,0x3e,0x20,0x4c,0x4f, - 0x47,0x5f,0x4c,0x45,0x56,0x45,0x4c,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73, - 0x65,0x6c,0x65,0x63,0x74,0x28,0x22,0x23,0x22,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x20, - 0x3e,0x20,0x30,0x20,0x74,0x68,0x65,0x6e,0x20,0x6d,0x73,0x67,0x20,0x3d,0x20,0x6d, - 0x73,0x67,0x3a,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28,0x2e,0x2e,0x2e,0x29,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x6f,0x2e,0x62,0x61,0x73,0x65,0x2e,0x73, - 0x74,0x64,0x65,0x72,0x72,0x3a,0x77,0x72,0x69,0x74,0x65,0x28,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28,0x22,0x44,0x45,0x42,0x55,0x47, - 0x47,0x45,0x52,0x5c,0x74,0x25,0x73,0x5c,0x74,0x25,0x73,0x5c,0x6e,0x22,0x2c,0x20, - 0x6c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x6d,0x73,0x67,0x29,0x29,0x0a,0x65,0x6e,0x64, - 0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x4d,0x0a,0x0a,0x65,0x6e,0x64,0x0a, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f,0x66,0x20,0x6d,0x6f,0x64,0x75,0x6c, - 0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x75,0x74,0x69,0x6c,0x0a,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x75,0x72,0x6c,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67, - 0x65,0x2e,0x70,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x2e,0x75,0x72,0x6c,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x55,0x52,0x49,0x20,0x70, - 0x61,0x72,0x73,0x69,0x6e,0x67,0x2c,0x20,0x63,0x6f,0x6d,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x61,0x6e,0x64,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65, - 0x20,0x55,0x52,0x4c,0x20,0x72,0x65,0x73,0x6f,0x6c,0x75,0x74,0x69,0x6f,0x6e,0x0a, - 0x2d,0x2d,0x20,0x4c,0x75,0x61,0x53,0x6f,0x63,0x6b,0x65,0x74,0x20,0x74,0x6f,0x6f, - 0x6c,0x6b,0x69,0x74,0x2e,0x0a,0x2d,0x2d,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x3a, - 0x20,0x44,0x69,0x65,0x67,0x6f,0x20,0x4e,0x65,0x68,0x61,0x62,0x0a,0x2d,0x2d,0x20, - 0x52,0x43,0x53,0x20,0x49,0x44,0x3a,0x20,0x24,0x49,0x64,0x3a,0x20,0x75,0x72,0x6c, - 0x2e,0x6c,0x75,0x61,0x2c,0x76,0x20,0x31,0x2e,0x33,0x38,0x20,0x32,0x30,0x30,0x36, - 0x2f,0x30,0x34,0x2f,0x30,0x33,0x20,0x30,0x34,0x3a,0x34,0x35,0x3a,0x34,0x32,0x20, - 0x64,0x69,0x65,0x67,0x6f,0x20,0x45,0x78,0x70,0x20,0x24,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x44,0x65,0x63,0x6c, - 0x61,0x72,0x65,0x20,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x28, - 0x22,0x73,0x74,0x72,0x69,0x6e,0x67,0x22,0x29,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x5f,0x47,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x74,0x61,0x62,0x6c,0x65,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x28, - 0x22,0x74,0x61,0x62,0x6c,0x65,0x22,0x29,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x5f,0x45,0x4e,0x56,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x69,0x66,0x20,0x73,0x65, - 0x74,0x66,0x65,0x6e,0x76,0x20,0x74,0x68,0x65,0x6e,0x20,0x73,0x65,0x74,0x66,0x65, - 0x6e,0x76,0x28,0x31,0x2c,0x20,0x5f,0x45,0x4e,0x56,0x29,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d, - 0x2d,0x20,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x5f, - 0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d,0x20,0x22,0x55,0x52,0x4c,0x20,0x31, - 0x2e,0x30,0x2e,0x31,0x22,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f,0x64,0x65,0x73,0x20, - 0x61,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74,0x6f,0x20,0x69,0x74, - 0x73,0x20,0x65,0x73,0x63,0x61,0x70,0x65,0x64,0x20,0x68,0x65,0x78,0x61,0x64,0x65, - 0x63,0x69,0x6d,0x61,0x6c,0x20,0x72,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x61, - 0x74,0x69,0x6f,0x6e,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x70,0x75,0x74,0x0a,0x2d,0x2d, - 0x20,0x20,0x20,0x73,0x3a,0x20,0x62,0x69,0x6e,0x61,0x72,0x79,0x20,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65, - 0x64,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20, - 0x20,0x20,0x65,0x73,0x63,0x61,0x70,0x65,0x64,0x20,0x72,0x65,0x70,0x72,0x65,0x73, - 0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x20,0x62,0x69,0x6e,0x61,0x72,0x79,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x65,0x73,0x63,0x61,0x70,0x65,0x28,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75, - 0x62,0x28,0x73,0x2c,0x20,0x22,0x28,0x5b,0x5e,0x41,0x2d,0x5a,0x61,0x2d,0x7a,0x30, - 0x2d,0x39,0x5f,0x5d,0x29,0x22,0x2c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x63,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74, - 0x28,0x22,0x25,0x25,0x25,0x30,0x32,0x78,0x22,0x2c,0x20,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x2e,0x62,0x79,0x74,0x65,0x28,0x63,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x50,0x72,0x6f,0x74,0x65,0x63, - 0x74,0x73,0x20,0x61,0x20,0x70,0x61,0x74,0x68,0x20,0x73,0x65,0x67,0x6d,0x65,0x6e, - 0x74,0x2c,0x20,0x74,0x6f,0x20,0x70,0x72,0x65,0x76,0x65,0x6e,0x74,0x20,0x69,0x74, - 0x20,0x66,0x72,0x6f,0x6d,0x20,0x69,0x6e,0x74,0x65,0x72,0x66,0x65,0x72,0x69,0x6e, - 0x67,0x20,0x77,0x69,0x74,0x68,0x20,0x74,0x68,0x65,0x0a,0x2d,0x2d,0x20,0x75,0x72, - 0x6c,0x20,0x70,0x61,0x72,0x73,0x69,0x6e,0x67,0x2e,0x0a,0x2d,0x2d,0x20,0x49,0x6e, - 0x70,0x75,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x73,0x3a,0x20,0x62,0x69,0x6e,0x61, - 0x72,0x79,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x62,0x65,0x20, - 0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72, - 0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x65,0x73,0x63,0x61,0x70,0x65,0x64,0x20, - 0x72,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f, - 0x66,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x62,0x69,0x6e,0x61,0x72,0x79,0x0a, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x6d,0x61,0x6b, - 0x65,0x5f,0x73,0x65,0x74,0x28,0x74,0x29,0x0a,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x73,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x09,0x66,0x6f,0x72,0x20,0x69,0x2c,0x76,0x20, - 0x69,0x6e,0x20,0x62,0x61,0x73,0x65,0x2e,0x69,0x70,0x61,0x69,0x72,0x73,0x28,0x74, - 0x29,0x20,0x64,0x6f,0x0a,0x09,0x09,0x73,0x5b,0x74,0x5b,0x69,0x5d,0x5d,0x20,0x3d, - 0x20,0x31,0x0a,0x09,0x65,0x6e,0x64,0x0a,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x74,0x68,0x65,0x73,0x65,0x20, - 0x61,0x72,0x65,0x20,0x61,0x6c,0x6c,0x6f,0x77,0x65,0x64,0x20,0x77,0x69,0x74,0x68, - 0x69,0x6e,0x67,0x20,0x61,0x20,0x70,0x61,0x74,0x68,0x20,0x73,0x65,0x67,0x6d,0x65, - 0x6e,0x74,0x2c,0x20,0x61,0x6c,0x6f,0x6e,0x67,0x20,0x77,0x69,0x74,0x68,0x20,0x61, - 0x6c,0x70,0x68,0x61,0x6e,0x75,0x6d,0x0a,0x2d,0x2d,0x20,0x6f,0x74,0x68,0x65,0x72, - 0x20,0x63,0x68,0x61,0x72,0x61,0x63,0x74,0x65,0x72,0x73,0x20,0x6d,0x75,0x73,0x74, - 0x20,0x62,0x65,0x20,0x65,0x73,0x63,0x61,0x70,0x65,0x64,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x73,0x65,0x74,0x20,0x3d,0x20, - 0x6d,0x61,0x6b,0x65,0x5f,0x73,0x65,0x74,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x22, - 0x2d,0x22,0x2c,0x20,0x22,0x5f,0x22,0x2c,0x20,0x22,0x2e,0x22,0x2c,0x20,0x22,0x21, - 0x22,0x2c,0x20,0x22,0x7e,0x22,0x2c,0x20,0x22,0x2a,0x22,0x2c,0x20,0x22,0x27,0x22, - 0x2c,0x20,0x22,0x28,0x22,0x2c,0x0a,0x09,0x22,0x29,0x22,0x2c,0x20,0x22,0x3a,0x22, - 0x2c,0x20,0x22,0x40,0x22,0x2c,0x20,0x22,0x26,0x22,0x2c,0x20,0x22,0x3d,0x22,0x2c, - 0x20,0x22,0x2b,0x22,0x2c,0x20,0x22,0x24,0x22,0x2c,0x20,0x22,0x2c,0x22,0x2c,0x0a, - 0x7d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e, - 0x74,0x28,0x73,0x29,0x0a,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x73,0x2c,0x20,0x22,0x28,0x5b,0x5e, - 0x41,0x2d,0x5a,0x61,0x2d,0x7a,0x30,0x2d,0x39,0x5f,0x5d,0x29,0x22,0x2c,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x63,0x29,0x0a,0x09,0x09,0x69,0x66, - 0x20,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x73,0x65,0x74,0x5b,0x63,0x5d,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x0a,0x09,0x09, - 0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28,0x22,0x25,0x25,0x25,0x30,0x32, - 0x78,0x22,0x2c,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x62,0x79,0x74,0x65,0x28, - 0x63,0x29,0x29,0x20,0x65,0x6e,0x64,0x0a,0x09,0x65,0x6e,0x64,0x29,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x63,0x6f,0x64,0x65,0x73,0x20,0x61,0x20,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x20,0x69,0x6e,0x74,0x6f,0x20,0x69,0x74,0x73,0x20,0x65,0x73, - 0x63,0x61,0x70,0x65,0x64,0x20,0x68,0x65,0x78,0x61,0x64,0x65,0x63,0x69,0x6d,0x61, - 0x6c,0x20,0x72,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e, - 0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x70,0x75,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x73, - 0x3a,0x20,0x62,0x69,0x6e,0x61,0x72,0x79,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20, - 0x74,0x6f,0x20,0x62,0x65,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x64,0x0a,0x2d,0x2d, - 0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x65,0x73, - 0x63,0x61,0x70,0x65,0x64,0x20,0x72,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x61, - 0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x62, - 0x69,0x6e,0x61,0x72,0x79,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x75,0x6e,0x65, - 0x73,0x63,0x61,0x70,0x65,0x28,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28, - 0x73,0x2c,0x20,0x22,0x25,0x25,0x28,0x25,0x78,0x25,0x78,0x29,0x22,0x2c,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x68,0x65,0x78,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x63,0x68,0x61,0x72,0x28,0x62,0x61,0x73,0x65,0x2e,0x74,0x6f,0x6e, - 0x75,0x6d,0x62,0x65,0x72,0x28,0x68,0x65,0x78,0x2c,0x20,0x31,0x36,0x29,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x29,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x42, - 0x75,0x69,0x6c,0x64,0x73,0x20,0x61,0x20,0x70,0x61,0x74,0x68,0x20,0x66,0x72,0x6f, - 0x6d,0x20,0x61,0x20,0x62,0x61,0x73,0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x61,0x6e, - 0x64,0x20,0x61,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x20,0x70,0x61,0x74, - 0x68,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x70,0x75,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x62,0x61,0x73,0x65,0x5f,0x70,0x61,0x74,0x68,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x72, - 0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x74,0x68,0x0a,0x2d,0x2d,0x20, - 0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x63,0x6f,0x72, - 0x72,0x65,0x73,0x70,0x6f,0x6e,0x64,0x69,0x6e,0x67,0x20,0x61,0x62,0x73,0x6f,0x6c, - 0x75,0x74,0x65,0x20,0x70,0x61,0x74,0x68,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x5f,0x70, - 0x61,0x74,0x68,0x28,0x62,0x61,0x73,0x65,0x5f,0x70,0x61,0x74,0x68,0x2c,0x20,0x72, - 0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x74,0x68,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x73,0x75,0x62,0x28, - 0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x74,0x68,0x2c,0x20,0x31, - 0x2c,0x20,0x31,0x29,0x20,0x3d,0x3d,0x20,0x22,0x2f,0x22,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65, - 0x5f,0x70,0x61,0x74,0x68,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x62,0x61,0x73,0x65,0x5f,0x70,0x61,0x74,0x68, - 0x2c,0x20,0x22,0x5b,0x5e,0x2f,0x5d,0x2a,0x24,0x22,0x2c,0x20,0x22,0x22,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20, - 0x2e,0x2e,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x74,0x68, - 0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x70,0x61,0x74,0x68,0x2c,0x20,0x22,0x28, - 0x5b,0x5e,0x2f,0x5d,0x2a,0x25,0x2e,0x2f,0x29,0x22,0x2c,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x28,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x73,0x20,0x7e,0x3d,0x20,0x22,0x2e,0x2f,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x20,0x65,0x6c,0x73,0x65, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x74,0x68, - 0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x70, - 0x61,0x74,0x68,0x2c,0x20,0x22,0x2f,0x25,0x2e,0x24,0x22,0x2c,0x20,0x22,0x2f,0x22, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x64,0x75, - 0x63,0x65,0x64,0x0a,0x20,0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x72,0x65, - 0x64,0x75,0x63,0x65,0x64,0x20,0x7e,0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x64,0x6f, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x64,0x75,0x63,0x65,0x64, - 0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73, - 0x75,0x62,0x28,0x72,0x65,0x64,0x75,0x63,0x65,0x64,0x2c,0x20,0x22,0x28,0x5b,0x5e, - 0x2f,0x5d,0x2a,0x2f,0x25,0x2e,0x25,0x2e,0x2f,0x29,0x22,0x2c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x20,0x7e,0x3d,0x20,0x22,0x2e, - 0x2e,0x2f,0x2e,0x2e,0x2f,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x22,0x22,0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x73,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67, - 0x73,0x75,0x62,0x28,0x72,0x65,0x64,0x75,0x63,0x65,0x64,0x2c,0x20,0x22,0x28,0x5b, - 0x5e,0x2f,0x5d,0x2a,0x2f,0x25,0x2e,0x25,0x2e,0x29,0x24,0x22,0x2c,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x28,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x73,0x20,0x7e,0x3d,0x20,0x22,0x2e,0x2e,0x2f,0x2e, - 0x2e,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22, - 0x22,0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61,0x74,0x68,0x0a,0x65,0x6e,0x64, - 0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a, - 0x2d,0x2d,0x20,0x50,0x61,0x72,0x73,0x65,0x73,0x20,0x61,0x20,0x75,0x72,0x6c,0x20, - 0x61,0x6e,0x64,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x61,0x20,0x74,0x61, - 0x62,0x6c,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x61,0x6c,0x6c,0x20,0x69,0x74,0x73, - 0x20,0x70,0x61,0x72,0x74,0x73,0x20,0x61,0x63,0x63,0x6f,0x72,0x64,0x69,0x6e,0x67, - 0x20,0x74,0x6f,0x20,0x52,0x46,0x43,0x20,0x32,0x33,0x39,0x36,0x0a,0x2d,0x2d,0x20, - 0x54,0x68,0x65,0x20,0x66,0x6f,0x6c,0x6c,0x6f,0x77,0x69,0x6e,0x67,0x20,0x67,0x72, - 0x61,0x6d,0x6d,0x61,0x72,0x20,0x64,0x65,0x73,0x63,0x72,0x69,0x62,0x65,0x73,0x20, - 0x74,0x68,0x65,0x20,0x6e,0x61,0x6d,0x65,0x73,0x20,0x67,0x69,0x76,0x65,0x6e,0x20, - 0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x55,0x52,0x4c,0x20,0x70,0x61,0x72,0x74,0x73, - 0x0a,0x2d,0x2d,0x20,0x3c,0x75,0x72,0x6c,0x3e,0x20,0x3a,0x3a,0x3d,0x20,0x3c,0x73, - 0x63,0x68,0x65,0x6d,0x65,0x3e,0x3a,0x2f,0x2f,0x3c,0x61,0x75,0x74,0x68,0x6f,0x72, - 0x69,0x74,0x79,0x3e,0x2f,0x3c,0x70,0x61,0x74,0x68,0x3e,0x3b,0x3c,0x70,0x61,0x72, - 0x61,0x6d,0x73,0x3e,0x3f,0x3c,0x71,0x75,0x65,0x72,0x79,0x3e,0x23,0x3c,0x66,0x72, - 0x61,0x67,0x6d,0x65,0x6e,0x74,0x3e,0x0a,0x2d,0x2d,0x20,0x3c,0x61,0x75,0x74,0x68, - 0x6f,0x72,0x69,0x74,0x79,0x3e,0x20,0x3a,0x3a,0x3d,0x20,0x3c,0x75,0x73,0x65,0x72, - 0x69,0x6e,0x66,0x6f,0x3e,0x40,0x3c,0x68,0x6f,0x73,0x74,0x3e,0x3a,0x3c,0x70,0x6f, - 0x72,0x74,0x3e,0x0a,0x2d,0x2d,0x20,0x3c,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f, - 0x3e,0x20,0x3a,0x3a,0x3d,0x20,0x3c,0x75,0x73,0x65,0x72,0x3e,0x5b,0x3a,0x3c,0x70, - 0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x3e,0x5d,0x0a,0x2d,0x2d,0x20,0x3c,0x70,0x61, - 0x74,0x68,0x3e,0x20,0x3a,0x3a,0x20,0x3d,0x20,0x7b,0x3c,0x73,0x65,0x67,0x6d,0x65, - 0x6e,0x74,0x3e,0x2f,0x7d,0x3c,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x3e,0x0a,0x2d, - 0x2d,0x20,0x49,0x6e,0x70,0x75,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x75,0x72,0x6c, - 0x3a,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x72,0x65,0x73,0x6f,0x75,0x72, - 0x63,0x65,0x20,0x6c,0x6f,0x63,0x61,0x74,0x6f,0x72,0x20,0x6f,0x66,0x20,0x72,0x65, - 0x71,0x75,0x65,0x73,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x64,0x65,0x66,0x61,0x75, - 0x6c,0x74,0x3a,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x64, - 0x65,0x66,0x61,0x75,0x6c,0x74,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x20,0x66,0x6f, - 0x72,0x20,0x65,0x61,0x63,0x68,0x20,0x66,0x69,0x65,0x6c,0x64,0x0a,0x2d,0x2d,0x20, - 0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x74,0x61,0x62, - 0x6c,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x74,0x68,0x65,0x20,0x66,0x6f,0x6c,0x6c, - 0x6f,0x77,0x69,0x6e,0x67,0x20,0x66,0x69,0x65,0x6c,0x64,0x73,0x2c,0x20,0x77,0x68, - 0x65,0x72,0x65,0x20,0x52,0x46,0x43,0x20,0x6e,0x61,0x6d,0x69,0x6e,0x67,0x20,0x63, - 0x6f,0x6e,0x76,0x65,0x6e,0x74,0x69,0x6f,0x6e,0x73,0x20,0x68,0x61,0x76,0x65,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x62,0x65,0x65,0x6e,0x20,0x70,0x72,0x65,0x73,0x65,0x72, - 0x76,0x65,0x64,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x73,0x63,0x68,0x65, - 0x6d,0x65,0x2c,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x2c,0x20,0x75, - 0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x75,0x73,0x65,0x72,0x2c,0x20,0x70, - 0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x2c,0x20,0x68,0x6f,0x73,0x74,0x2c,0x20,0x70, - 0x6f,0x72,0x74,0x2c,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x74,0x68, - 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20,0x71,0x75,0x65,0x72,0x79,0x2c, - 0x20,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x2d,0x2d,0x20,0x4f,0x62,0x73, - 0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x74,0x68,0x65,0x20,0x6c,0x65,0x61,0x64,0x69, - 0x6e,0x67,0x20,0x27,0x2f,0x27,0x20,0x69,0x6e,0x20,0x7b,0x2f,0x3c,0x70,0x61,0x74, - 0x68,0x3e,0x7d,0x20,0x69,0x73,0x20,0x63,0x6f,0x6e,0x73,0x69,0x64,0x65,0x72,0x65, - 0x64,0x20,0x70,0x61,0x72,0x74,0x20,0x6f,0x66,0x20,0x3c,0x70,0x61,0x74,0x68,0x3e, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x70,0x61,0x72,0x73,0x65,0x28,0x75,0x72, - 0x6c,0x2c,0x20,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x69,0x7a,0x65,0x20,0x64,0x65, - 0x66,0x61,0x75,0x6c,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x73, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x72,0x73,0x65, - 0x64,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69, - 0x2c,0x76,0x20,0x69,0x6e,0x20,0x62,0x61,0x73,0x65,0x2e,0x70,0x61,0x69,0x72,0x73, - 0x28,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x20,0x6f,0x72,0x20,0x70,0x61,0x72,0x73, - 0x65,0x64,0x29,0x20,0x64,0x6f,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x5b,0x69,0x5d, - 0x20,0x3d,0x20,0x76,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x65,0x6d,0x70,0x74,0x79,0x20,0x75,0x72,0x6c,0x20,0x69,0x73,0x20,0x70,0x61,0x72, - 0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x6e,0x6f,0x74,0x20,0x75,0x72,0x6c,0x20,0x6f,0x72,0x20,0x75,0x72,0x6c, - 0x20,0x3d,0x3d,0x20,0x22,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x22,0x69,0x6e,0x76,0x61,0x6c,0x69,0x64, - 0x20,0x75,0x72,0x6c,0x22,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x72,0x65,0x6d,0x6f,0x76,0x65,0x20,0x77,0x68,0x69,0x74,0x65,0x73,0x70,0x61, - 0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x75,0x72,0x6c,0x20,0x3d,0x20, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x75,0x72,0x6c,0x2c, - 0x20,0x22,0x25,0x73,0x22,0x2c,0x20,0x22,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x67,0x65,0x74,0x20,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x20, - 0x20,0x20,0x20,0x75,0x72,0x6c,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e, - 0x67,0x73,0x75,0x62,0x28,0x75,0x72,0x6c,0x2c,0x20,0x22,0x23,0x28,0x2e,0x2a,0x29, - 0x24,0x22,0x2c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x66,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x3d,0x20,0x66,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65, - 0x74,0x20,0x73,0x63,0x68,0x65,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x75,0x72,0x6c, - 0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x75, - 0x72,0x6c,0x2c,0x20,0x22,0x5e,0x28,0x5b,0x25,0x77,0x5d,0x5b,0x25,0x77,0x25,0x2b, - 0x25,0x2d,0x25,0x2e,0x5d,0x2a,0x29,0x25,0x3a,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x29,0x20, - 0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x73,0x63,0x68,0x65,0x6d,0x65,0x20,0x3d,0x20, - 0x73,0x3b,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x20,0x65,0x6e,0x64, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x61,0x75,0x74, - 0x68,0x6f,0x72,0x69,0x74,0x79,0x0a,0x20,0x20,0x20,0x20,0x75,0x72,0x6c,0x20,0x3d, - 0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x75,0x72,0x6c, - 0x2c,0x20,0x22,0x5e,0x2f,0x2f,0x28,0x5b,0x5e,0x2f,0x5d,0x2a,0x29,0x22,0x2c,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6e,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x61,0x75,0x74,0x68,0x6f, - 0x72,0x69,0x74,0x79,0x20,0x3d,0x20,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x71, - 0x75,0x65,0x72,0x79,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x69,0x6e,0x67,0x0a,0x20, - 0x20,0x20,0x20,0x75,0x72,0x6c,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e, - 0x67,0x73,0x75,0x62,0x28,0x75,0x72,0x6c,0x2c,0x20,0x22,0x25,0x3f,0x28,0x2e,0x2a, - 0x29,0x22,0x2c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x71,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x71, - 0x75,0x65,0x72,0x79,0x20,0x3d,0x20,0x71,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x73,0x0a,0x20,0x20,0x20,0x20,0x75,0x72,0x6c,0x20,0x3d,0x20, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x75,0x72,0x6c,0x2c, - 0x20,0x22,0x25,0x3b,0x28,0x2e,0x2a,0x29,0x22,0x2c,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x70,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70, - 0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x22,0x22,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x70,0x61,0x74,0x68,0x20,0x69,0x73,0x20,0x77,0x68,0x61,0x74,0x65, - 0x76,0x65,0x72,0x20,0x77,0x61,0x73,0x20,0x6c,0x65,0x66,0x74,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x75,0x72,0x6c,0x20,0x7e,0x3d,0x20,0x22,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x20,0x3d, - 0x20,0x75,0x72,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x3d,0x20,0x70, - 0x61,0x72,0x73,0x65,0x64,0x2e,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x61,0x75,0x74,0x68,0x6f, - 0x72,0x69,0x74,0x79,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x3d,0x20,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74, - 0x79,0x2c,0x22,0x5e,0x28,0x5b,0x5e,0x40,0x5d,0x2a,0x29,0x40,0x22,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x75,0x29,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x75,0x73,0x65,0x72,0x69,0x6e, - 0x66,0x6f,0x20,0x3d,0x20,0x75,0x3b,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22, - 0x22,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x61,0x75,0x74,0x68,0x6f, - 0x72,0x69,0x74,0x79,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73, - 0x75,0x62,0x28,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x2c,0x20,0x22,0x3a, - 0x28,0x5b,0x5e,0x3a,0x5d,0x2a,0x29,0x24,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x70,0x29,0x20,0x70, - 0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x6f,0x72,0x74,0x20,0x3d,0x20,0x70,0x3b,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x20,0x65,0x6e,0x64,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20, - 0x7e,0x3d,0x20,0x22,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x70,0x61,0x72,0x73,0x65, - 0x64,0x2e,0x68,0x6f,0x73,0x74,0x20,0x3d,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69, - 0x74,0x79,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20,0x70,0x61,0x72,0x73, - 0x65,0x64,0x2e,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61,0x72,0x73, - 0x65,0x64,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x75,0x73,0x65,0x72,0x69, - 0x6e,0x66,0x6f,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75, - 0x62,0x28,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x2c,0x20,0x22,0x3a,0x28,0x5b, - 0x5e,0x3a,0x5d,0x2a,0x29,0x24,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x70,0x29,0x20,0x70,0x61,0x72, - 0x73,0x65,0x64,0x2e,0x70,0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x20,0x3d,0x20,0x70, - 0x3b,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x22,0x22,0x20,0x65,0x6e,0x64,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x75,0x73,0x65,0x72, - 0x20,0x3d,0x20,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x52,0x65,0x62,0x75,0x69,0x6c,0x64,0x73,0x20,0x61,0x20,0x70, - 0x61,0x72,0x73,0x65,0x64,0x20,0x55,0x52,0x4c,0x20,0x66,0x72,0x6f,0x6d,0x20,0x69, - 0x74,0x73,0x20,0x63,0x6f,0x6d,0x70,0x6f,0x6e,0x65,0x6e,0x74,0x73,0x2e,0x0a,0x2d, - 0x2d,0x20,0x43,0x6f,0x6d,0x70,0x6f,0x6e,0x65,0x6e,0x74,0x73,0x20,0x61,0x72,0x65, - 0x20,0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,0x20,0x69,0x66,0x20,0x61,0x6e, - 0x79,0x20,0x72,0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x20,0x6f,0x72,0x20,0x75,0x6e, - 0x61,0x6c,0x6c,0x6f,0x77,0x65,0x64,0x20,0x63,0x68,0x61,0x72,0x61,0x63,0x74,0x65, - 0x72,0x73,0x20,0x61,0x72,0x65,0x20,0x66,0x6f,0x75,0x6e,0x64,0x0a,0x2d,0x2d,0x20, - 0x49,0x6e,0x70,0x75,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x70,0x61,0x72,0x73,0x65, - 0x64,0x3a,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x55,0x52,0x4c,0x2c,0x20,0x61, - 0x73,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x65,0x64,0x20,0x62,0x79,0x20,0x70,0x61, - 0x72,0x73,0x65,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d, - 0x2d,0x20,0x20,0x20,0x61,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x69,0x6e,0x67,0x20, - 0x77,0x69,0x74,0x68,0x20,0x74,0x68,0x65,0x20,0x63,0x6f,0x72,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x64,0x69,0x6e,0x67,0x20,0x55,0x52,0x4c,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x62,0x75,0x69,0x6c,0x64,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x70,0x61,0x74,0x68,0x20, - 0x3d,0x20,0x70,0x61,0x72,0x73,0x65,0x5f,0x70,0x61,0x74,0x68,0x28,0x70,0x61,0x72, - 0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x20,0x6f,0x72,0x20,0x22,0x22,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x6c,0x20,0x3d,0x20, - 0x62,0x75,0x69,0x6c,0x64,0x5f,0x70,0x61,0x74,0x68,0x28,0x70,0x70,0x61,0x74,0x68, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e, - 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x74,0x68,0x65,0x6e,0x20,0x75,0x72,0x6c,0x20, - 0x3d,0x20,0x75,0x72,0x6c,0x20,0x2e,0x2e,0x20,0x22,0x3b,0x22,0x20,0x2e,0x2e,0x20, - 0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e, - 0x71,0x75,0x65,0x72,0x79,0x20,0x74,0x68,0x65,0x6e,0x20,0x75,0x72,0x6c,0x20,0x3d, - 0x20,0x75,0x72,0x6c,0x20,0x2e,0x2e,0x20,0x22,0x3f,0x22,0x20,0x2e,0x2e,0x20,0x70, - 0x61,0x72,0x73,0x65,0x64,0x2e,0x71,0x75,0x65,0x72,0x79,0x20,0x65,0x6e,0x64,0x0a, - 0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79, - 0x20,0x3d,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x61,0x75,0x74,0x68,0x6f,0x72, - 0x69,0x74,0x79,0x0a,0x09,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x68, - 0x6f,0x73,0x74,0x20,0x74,0x68,0x65,0x6e,0x0a,0x09,0x09,0x61,0x75,0x74,0x68,0x6f, - 0x72,0x69,0x74,0x79,0x20,0x3d,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x68,0x6f, - 0x73,0x74,0x0a,0x09,0x09,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70, - 0x6f,0x72,0x74,0x20,0x74,0x68,0x65,0x6e,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69, - 0x74,0x79,0x20,0x3d,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x2e, - 0x2e,0x20,0x22,0x3a,0x22,0x20,0x2e,0x2e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e, - 0x70,0x6f,0x72,0x74,0x20,0x65,0x6e,0x64,0x0a,0x09,0x09,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20,0x70,0x61,0x72,0x73, - 0x65,0x64,0x2e,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x0a,0x09,0x09,0x69,0x66, - 0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x75,0x73,0x65,0x72,0x20,0x74,0x68,0x65, - 0x6e,0x0a,0x09,0x09,0x09,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20, - 0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x75,0x73,0x65,0x72,0x0a,0x09,0x09,0x09,0x69, - 0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x73,0x73,0x77,0x6f,0x72, - 0x64,0x20,0x74,0x68,0x65,0x6e,0x0a,0x09,0x09,0x09,0x09,0x75,0x73,0x65,0x72,0x69, - 0x6e,0x66,0x6f,0x20,0x3d,0x20,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x20,0x2e, - 0x2e,0x20,0x22,0x3a,0x22,0x20,0x2e,0x2e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e, - 0x70,0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x0a,0x09,0x09,0x09,0x65,0x6e,0x64,0x0a, - 0x09,0x09,0x65,0x6e,0x64,0x0a,0x09,0x09,0x69,0x66,0x20,0x75,0x73,0x65,0x72,0x69, - 0x6e,0x66,0x6f,0x20,0x74,0x68,0x65,0x6e,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69, - 0x74,0x79,0x20,0x3d,0x20,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x20,0x2e,0x2e, - 0x20,0x22,0x40,0x22,0x20,0x2e,0x2e,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74, - 0x79,0x20,0x65,0x6e,0x64,0x0a,0x09,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x75,0x72,0x6c,0x20,0x3d,0x20,0x22,0x2f,0x2f,0x22,0x20,0x2e,0x2e,0x20,0x61, - 0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x2e,0x2e,0x20,0x75,0x72,0x6c,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65, - 0x64,0x2e,0x73,0x63,0x68,0x65,0x6d,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x75,0x72, - 0x6c,0x20,0x3d,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x73,0x63,0x68,0x65,0x6d, - 0x65,0x20,0x2e,0x2e,0x20,0x22,0x3a,0x22,0x20,0x2e,0x2e,0x20,0x75,0x72,0x6c,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65, - 0x64,0x2e,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x75,0x72,0x6c,0x20,0x3d,0x20,0x75,0x72,0x6c,0x20,0x2e,0x2e,0x20,0x22,0x23,0x22, - 0x20,0x2e,0x2e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x66,0x72,0x61,0x67,0x6d, - 0x65,0x6e,0x74,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x75, - 0x72,0x6c,0x20,0x3d,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62, - 0x28,0x75,0x72,0x6c,0x2c,0x20,0x22,0x25,0x73,0x22,0x2c,0x20,0x22,0x22,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x75,0x72,0x6c,0x0a,0x65, - 0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x2d,0x2d,0x20,0x42,0x75,0x69,0x6c,0x64,0x73,0x20,0x61,0x20,0x61,0x62, - 0x73,0x6f,0x6c,0x75,0x74,0x65,0x20,0x55,0x52,0x4c,0x20,0x66,0x72,0x6f,0x6d,0x20, - 0x61,0x20,0x62,0x61,0x73,0x65,0x20,0x61,0x6e,0x64,0x20,0x61,0x20,0x72,0x65,0x6c, - 0x61,0x74,0x69,0x76,0x65,0x20,0x55,0x52,0x4c,0x20,0x61,0x63,0x63,0x6f,0x72,0x64, - 0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x52,0x46,0x43,0x20,0x32,0x33,0x39,0x36,0x0a, - 0x2d,0x2d,0x20,0x49,0x6e,0x70,0x75,0x74,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x62,0x61, - 0x73,0x65,0x5f,0x75,0x72,0x6c,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x72,0x65,0x6c,0x61, - 0x74,0x69,0x76,0x65,0x5f,0x75,0x72,0x6c,0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75, - 0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x63,0x6f,0x72,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x64,0x69,0x6e,0x67,0x20,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x20, - 0x75,0x72,0x6c,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x61,0x62,0x73,0x6f,0x6c, - 0x75,0x74,0x65,0x28,0x62,0x61,0x73,0x65,0x5f,0x75,0x72,0x6c,0x2c,0x20,0x72,0x65, - 0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x72,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x62,0x61,0x73,0x65,0x2e,0x74,0x79,0x70,0x65,0x28,0x62,0x61,0x73, - 0x65,0x5f,0x75,0x72,0x6c,0x29,0x20,0x3d,0x3d,0x20,0x22,0x74,0x61,0x62,0x6c,0x65, - 0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, - 0x61,0x73,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x3d,0x20,0x62,0x61,0x73, - 0x65,0x5f,0x75,0x72,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61, - 0x73,0x65,0x5f,0x75,0x72,0x6c,0x20,0x3d,0x20,0x62,0x75,0x69,0x6c,0x64,0x28,0x62, - 0x61,0x73,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73, - 0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x3d,0x20,0x70,0x61,0x72,0x73,0x65, - 0x28,0x62,0x61,0x73,0x65,0x5f,0x75,0x72,0x6c,0x29,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x6c, - 0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x3d,0x20,0x70, - 0x61,0x72,0x73,0x65,0x28,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x72, - 0x6c,0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x62,0x61, - 0x73,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x74,0x68,0x65,0x6e,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x75, - 0x72,0x6c,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x6e,0x6f, - 0x74,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65, - 0x64,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61, - 0x73,0x65,0x5f,0x75,0x72,0x6c,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69, - 0x66,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65, - 0x64,0x2e,0x73,0x63,0x68,0x65,0x6d,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x72, - 0x6c,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73, - 0x65,0x64,0x2e,0x73,0x63,0x68,0x65,0x6d,0x65,0x20,0x3d,0x20,0x62,0x61,0x73,0x65, - 0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x73,0x63,0x68,0x65,0x6d,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65, - 0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x61,0x75, - 0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76, - 0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x61,0x75,0x74,0x68,0x6f,0x72,0x69, - 0x74,0x79,0x20,0x3d,0x20,0x62,0x61,0x73,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64, - 0x2e,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65, - 0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61, - 0x74,0x68,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65, - 0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x62, - 0x61,0x73,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f, - 0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f, - 0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20, - 0x62,0x61,0x73,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x72,0x61, - 0x6d,0x73,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65, - 0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x71,0x75, - 0x65,0x72,0x79,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64, - 0x2e,0x71,0x75,0x65,0x72,0x79,0x20,0x3d,0x20,0x62,0x61,0x73,0x65,0x5f,0x70,0x61, - 0x72,0x73,0x65,0x64,0x2e,0x71,0x75,0x65,0x72,0x79,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65, - 0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x61, - 0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x5f,0x70,0x61,0x74,0x68,0x28,0x62,0x61,0x73, - 0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x20,0x6f,0x72, - 0x20,0x22,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6c,0x61,0x74,0x69,0x76, - 0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x70,0x61,0x74,0x68,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x75,0x69,0x6c,0x64,0x28, - 0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x65,0x5f,0x70,0x61,0x72,0x73,0x65,0x64,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x42, - 0x72,0x65,0x61,0x6b,0x73,0x20,0x61,0x20,0x70,0x61,0x74,0x68,0x20,0x69,0x6e,0x74, - 0x6f,0x20,0x69,0x74,0x73,0x20,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x73,0x2c,0x20, - 0x75,0x6e,0x65,0x73,0x63,0x61,0x70,0x69,0x6e,0x67,0x20,0x74,0x68,0x65,0x20,0x73, - 0x65,0x67,0x6d,0x65,0x6e,0x74,0x73,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x70,0x75,0x74, - 0x0a,0x2d,0x2d,0x20,0x20,0x20,0x70,0x61,0x74,0x68,0x0a,0x2d,0x2d,0x20,0x52,0x65, - 0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x73,0x65,0x67,0x6d,0x65, - 0x6e,0x74,0x3a,0x20,0x61,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x74,0x68, - 0x20,0x6f,0x6e,0x65,0x20,0x65,0x6e,0x74,0x72,0x79,0x20,0x70,0x65,0x72,0x20,0x73, - 0x65,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x70,0x61, - 0x72,0x73,0x65,0x5f,0x70,0x61,0x74,0x68,0x28,0x70,0x61,0x74,0x68,0x29,0x0a,0x09, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x3d,0x20,0x7b, - 0x7d,0x0a,0x09,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x6f, - 0x72,0x20,0x22,0x22,0x0a,0x09,0x2d,0x2d,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x73, - 0x74,0x72,0x69,0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x70,0x61,0x74,0x68,0x2c, - 0x20,0x22,0x25,0x73,0x22,0x2c,0x20,0x22,0x22,0x29,0x0a,0x09,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x67,0x73,0x75,0x62,0x28,0x70,0x61,0x74,0x68,0x2c,0x20,0x22,0x28, - 0x5b,0x5e,0x2f,0x5d,0x2b,0x29,0x22,0x2c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x28,0x73,0x29,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x69,0x6e,0x73,0x65, - 0x72,0x74,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x2c,0x20,0x73,0x29,0x20,0x65,0x6e, - 0x64,0x29,0x0a,0x09,0x66,0x6f,0x72,0x20,0x69,0x20,0x3d,0x20,0x31,0x2c,0x20,0x23, - 0x70,0x61,0x72,0x73,0x65,0x64,0x20,0x64,0x6f,0x0a,0x09,0x09,0x70,0x61,0x72,0x73, - 0x65,0x64,0x5b,0x69,0x5d,0x20,0x3d,0x20,0x75,0x6e,0x65,0x73,0x63,0x61,0x70,0x65, - 0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x5b,0x69,0x5d,0x29,0x0a,0x09,0x65,0x6e,0x64, - 0x0a,0x09,0x69,0x66,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x73,0x75,0x62,0x28, - 0x70,0x61,0x74,0x68,0x2c,0x20,0x31,0x2c,0x20,0x31,0x29,0x20,0x3d,0x3d,0x20,0x22, - 0x2f,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x69, - 0x73,0x5f,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x20,0x3d,0x20,0x31,0x20,0x65, - 0x6e,0x64,0x0a,0x09,0x69,0x66,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x73,0x75, - 0x62,0x28,0x70,0x61,0x74,0x68,0x2c,0x20,0x2d,0x31,0x2c,0x20,0x2d,0x31,0x29,0x20, - 0x3d,0x3d,0x20,0x22,0x2f,0x22,0x20,0x74,0x68,0x65,0x6e,0x20,0x70,0x61,0x72,0x73, - 0x65,0x64,0x2e,0x69,0x73,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x20, - 0x3d,0x20,0x31,0x20,0x65,0x6e,0x64,0x0a,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x70,0x61,0x72,0x73,0x65,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x42,0x75,0x69, - 0x6c,0x64,0x73,0x20,0x61,0x20,0x70,0x61,0x74,0x68,0x20,0x63,0x6f,0x6d,0x70,0x6f, - 0x6e,0x65,0x6e,0x74,0x20,0x66,0x72,0x6f,0x6d,0x20,0x69,0x74,0x73,0x20,0x73,0x65, - 0x67,0x6d,0x65,0x6e,0x74,0x73,0x2c,0x20,0x65,0x73,0x63,0x61,0x70,0x69,0x6e,0x67, - 0x20,0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,0x20,0x63,0x68,0x61,0x72,0x61, - 0x63,0x74,0x65,0x72,0x73,0x2e,0x0a,0x2d,0x2d,0x20,0x49,0x6e,0x70,0x75,0x74,0x0a, - 0x2d,0x2d,0x20,0x20,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x3a,0x20,0x70,0x61,0x74, - 0x68,0x20,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x73,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x75,0x6e,0x73,0x61,0x66,0x65,0x3a,0x20,0x69,0x66,0x20,0x74,0x72,0x75,0x65,0x2c, - 0x20,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x73,0x20,0x61,0x72,0x65,0x20,0x6e,0x6f, - 0x74,0x20,0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,0x20,0x62,0x65,0x66,0x6f, - 0x72,0x65,0x20,0x70,0x61,0x74,0x68,0x20,0x69,0x73,0x20,0x62,0x75,0x69,0x6c,0x74, - 0x0a,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x70,0x61,0x74,0x68,0x3a,0x20,0x63,0x6f,0x72,0x72,0x65,0x73,0x70,0x6f,0x6e, - 0x64,0x69,0x6e,0x67,0x20,0x70,0x61,0x74,0x68,0x20,0x73,0x74,0x72,0x69,0x6e,0x67, - 0x69,0x6e,0x67,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x62,0x75,0x69,0x6c,0x64, - 0x5f,0x70,0x61,0x74,0x68,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x2c,0x20,0x75,0x6e, - 0x73,0x61,0x66,0x65,0x29,0x0a,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x74, - 0x68,0x20,0x3d,0x20,0x22,0x22,0x0a,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6e,0x20, - 0x3d,0x20,0x23,0x70,0x61,0x72,0x73,0x65,0x64,0x0a,0x09,0x69,0x66,0x20,0x75,0x6e, - 0x73,0x61,0x66,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a,0x09,0x09,0x66,0x6f,0x72,0x20, - 0x69,0x20,0x3d,0x20,0x31,0x2c,0x20,0x6e,0x2d,0x31,0x20,0x64,0x6f,0x0a,0x09,0x09, - 0x09,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x2e,0x2e,0x20, - 0x70,0x61,0x72,0x73,0x65,0x64,0x5b,0x69,0x5d,0x0a,0x09,0x09,0x09,0x70,0x61,0x74, - 0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x2e,0x2e,0x20,0x22,0x2f,0x22,0x0a, - 0x09,0x09,0x65,0x6e,0x64,0x0a,0x09,0x09,0x69,0x66,0x20,0x6e,0x20,0x3e,0x20,0x30, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x09,0x09,0x09,0x70,0x61,0x74,0x68,0x20,0x3d,0x20, - 0x70,0x61,0x74,0x68,0x20,0x2e,0x2e,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x5b,0x6e, - 0x5d,0x0a,0x09,0x09,0x09,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x69, - 0x73,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x2e,0x2e,0x20, - 0x22,0x2f,0x22,0x20,0x65,0x6e,0x64,0x0a,0x09,0x09,0x65,0x6e,0x64,0x0a,0x09,0x65, - 0x6c,0x73,0x65,0x0a,0x09,0x09,0x66,0x6f,0x72,0x20,0x69,0x20,0x3d,0x20,0x31,0x2c, - 0x20,0x6e,0x2d,0x31,0x20,0x64,0x6f,0x0a,0x09,0x09,0x09,0x70,0x61,0x74,0x68,0x20, - 0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x2e,0x2e,0x20,0x70,0x72,0x6f,0x74,0x65,0x63, - 0x74,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x28,0x70,0x61,0x72,0x73,0x65,0x64, - 0x5b,0x69,0x5d,0x29,0x0a,0x09,0x09,0x09,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70, - 0x61,0x74,0x68,0x20,0x2e,0x2e,0x20,0x22,0x2f,0x22,0x0a,0x09,0x09,0x65,0x6e,0x64, - 0x0a,0x09,0x09,0x69,0x66,0x20,0x6e,0x20,0x3e,0x20,0x30,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x09,0x09,0x09,0x70,0x61,0x74,0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20, - 0x2e,0x2e,0x20,0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x5f,0x73,0x65,0x67,0x6d,0x65, - 0x6e,0x74,0x28,0x70,0x61,0x72,0x73,0x65,0x64,0x5b,0x6e,0x5d,0x29,0x0a,0x09,0x09, - 0x09,0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x69,0x73,0x5f,0x64,0x69, - 0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x20,0x74,0x68,0x65,0x6e,0x20,0x70,0x61,0x74, - 0x68,0x20,0x3d,0x20,0x70,0x61,0x74,0x68,0x20,0x2e,0x2e,0x20,0x22,0x2f,0x22,0x20, - 0x65,0x6e,0x64,0x0a,0x09,0x09,0x65,0x6e,0x64,0x0a,0x09,0x65,0x6e,0x64,0x0a,0x09, - 0x69,0x66,0x20,0x70,0x61,0x72,0x73,0x65,0x64,0x2e,0x69,0x73,0x5f,0x61,0x62,0x73, - 0x6f,0x6c,0x75,0x74,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x70,0x61,0x74,0x68,0x20, - 0x3d,0x20,0x22,0x2f,0x22,0x20,0x2e,0x2e,0x20,0x70,0x61,0x74,0x68,0x20,0x65,0x6e, - 0x64,0x0a,0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x61,0x74,0x68,0x0a,0x65, - 0x6e,0x64,0x0a,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x45,0x4e,0x56,0x0a, - 0x0a,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x45,0x6e,0x64,0x20,0x6f,0x66,0x20, - 0x6d,0x6f,0x64,0x75,0x6c,0x65,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x75, - 0x72,0x6c,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x0a,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4d,0x61,0x69,0x6e,0x20, - 0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x70, - 0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x31,0x2d, - 0x32,0x30,0x31,0x32,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65, - 0x6c,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x74,0x68,0x65,0x72,0x73,0x2e, - 0x0a,0x2d,0x2d,0x20,0x41,0x6c,0x6c,0x20,0x72,0x69,0x67,0x68,0x74,0x73,0x20,0x72, - 0x65,0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73,0x20,0x70,0x72, - 0x6f,0x67,0x72,0x61,0x6d,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x61,0x63, - 0x63,0x6f,0x6d,0x70,0x61,0x6e,0x79,0x69,0x6e,0x67,0x20,0x6d,0x61,0x74,0x65,0x72, - 0x69,0x61,0x6c,0x73,0x0a,0x2d,0x2d,0x20,0x61,0x72,0x65,0x20,0x6d,0x61,0x64,0x65, - 0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x75,0x6e,0x64,0x65,0x72, - 0x20,0x74,0x68,0x65,0x20,0x74,0x65,0x72,0x6d,0x73,0x20,0x6f,0x66,0x20,0x74,0x68, - 0x65,0x20,0x45,0x63,0x6c,0x69,0x70,0x73,0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x63, - 0x20,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x20,0x76,0x31,0x2e,0x30,0x0a,0x2d,0x2d, - 0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x61,0x63,0x63,0x6f,0x6d,0x70,0x61,0x6e,0x69, - 0x65,0x73,0x20,0x74,0x68,0x69,0x73,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75, - 0x74,0x69,0x6f,0x6e,0x2c,0x20,0x61,0x6e,0x64,0x20,0x69,0x73,0x20,0x61,0x76,0x61, - 0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x61,0x74,0x0a,0x2d,0x2d,0x20,0x68,0x74,0x74, - 0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x65,0x63,0x6c,0x69,0x70,0x73,0x65,0x2e, - 0x6f,0x72,0x67,0x2f,0x6c,0x65,0x67,0x61,0x6c,0x2f,0x65,0x70,0x6c,0x2d,0x76,0x31, - 0x30,0x2e,0x68,0x74,0x6d,0x6c,0x0a,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x43,0x6f,0x6e, - 0x74,0x72,0x69,0x62,0x75,0x74,0x6f,0x72,0x73,0x3a,0x0a,0x2d,0x2d,0x20,0x20,0x20, - 0x20,0x20,0x53,0x69,0x65,0x72,0x72,0x61,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73, - 0x73,0x20,0x2d,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x20,0x41,0x50,0x49,0x20, - 0x61,0x6e,0x64,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69, - 0x6f,0x6e,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x44,0x42,0x47,0x50,0x5f,0x43, - 0x4c,0x49,0x45,0x4e,0x54,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d,0x20, - 0x22,0x31,0x2e,0x31,0x2e,0x30,0x22,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64, - 0x65,0x62,0x75,0x67,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22, - 0x64,0x65,0x62,0x75,0x67,0x22,0x0a,0x0a,0x2d,0x2d,0x20,0x54,0x6f,0x20,0x61,0x76, - 0x6f,0x69,0x64,0x20,0x63,0x79,0x63,0x6c,0x69,0x63,0x20,0x64,0x65,0x70,0x65,0x6e, - 0x64,0x65,0x6e,0x63,0x79,0x2c,0x20,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20, - 0x73,0x74,0x61,0x74,0x65,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x20,0x74,0x68,0x61,0x74,0x20,0x6d,0x75,0x73,0x74,0x20, - 0x62,0x65,0x20,0x61,0x63,0x63,0x65,0x73,0x73,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x65, - 0x6c,0x73,0x65,0x77,0x68,0x65,0x72,0x65,0x20,0x28,0x69,0x6e,0x20,0x63,0x6f,0x6d, - 0x6d,0x61,0x6e,0x64,0x73,0x20,0x6d,0x6f,0x73,0x74,0x20,0x6c,0x69,0x6b,0x65,0x6c, - 0x79,0x29,0x20,0x77,0x69,0x6c,0x6c,0x20,0x62,0x65,0x20,0x73,0x74,0x6f,0x72,0x65, - 0x64,0x20,0x69,0x6e,0x20,0x61,0x20,0x66,0x61,0x6b,0x65,0x20,0x6d,0x6f,0x64,0x75, - 0x6c,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x63,0x6f,0x72, - 0x65,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x65,0x20,0x3d,0x20, - 0x7b,0x20,0x7d,0x0a,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x6c,0x6f,0x61,0x64, - 0x65,0x64,0x5b,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x63,0x6f,0x72, - 0x65,0x22,0x5d,0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x0a,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x75,0x74,0x69,0x6c,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65, - 0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x75,0x74,0x69,0x6c,0x22, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20, - 0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x2e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x22,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x64,0x62,0x67,0x70,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69, - 0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x64,0x62,0x67, - 0x70,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64, - 0x73,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x2e,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x22,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x3d,0x20, - 0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65, - 0x72,0x2e,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x75,0x72,0x6c,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x20,0x22, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x75,0x72,0x6c,0x22,0x0a,0x0a,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x6c,0x6f,0x67,0x20,0x3d,0x20,0x75,0x74,0x69,0x6c,0x2e, - 0x6c,0x6f,0x67,0x0a,0x0a,0x0a,0x2d,0x2d,0x20,0x54,0x4f,0x44,0x4f,0x20,0x63,0x6f, - 0x6d,0x70,0x6c,0x65,0x74,0x65,0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x64,0x6c,0x69, - 0x62,0x20,0x61,0x63,0x63,0x65,0x73,0x73,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63, - 0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x2c,0x20,0x63,0x6f,0x63,0x72,0x65,0x61, - 0x74,0x65,0x2c,0x20,0x63,0x6f,0x77,0x72,0x61,0x70,0x2c,0x20,0x63,0x6f,0x79,0x69, - 0x65,0x6c,0x64,0x2c,0x20,0x63,0x6f,0x72,0x65,0x73,0x75,0x6d,0x65,0x2c,0x20,0x63, - 0x6f,0x73,0x74,0x61,0x74,0x75,0x73,0x20,0x3d,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74, - 0x69,0x6e,0x65,0x2e,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x2c,0x20,0x63,0x6f,0x72, - 0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x63,0x72,0x65,0x61,0x74,0x65,0x2c,0x20,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x77,0x72,0x61,0x70,0x2c,0x20,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x79,0x69,0x65,0x6c,0x64,0x2c,0x20, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x72,0x65,0x73,0x75,0x6d,0x65, - 0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x73,0x74,0x61,0x74, - 0x75,0x73,0x0a,0x0a,0x0a,0x2d,0x2d,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, - 0x20,0x74,0x68,0x65,0x20,0x55,0x52,0x49,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2c,0x20,0x74,0x6f,0x20,0x6e,0x6f,0x74, - 0x20,0x6a,0x75,0x6d,0x70,0x20,0x69,0x6e,0x74,0x6f,0x20,0x77,0x69,0x74,0x68,0x20, - 0x72,0x65,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x20,0x6f,0x72,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20, - 0x62,0x6f,0x6f,0x74,0x73,0x74,0x72,0x61,0x70,0x20,0x73,0x74,0x75,0x66,0x66,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x75, - 0x72,0x69,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x2d,0x2d,0x20,0x73,0x65,0x74,0x20, - 0x69,0x6e,0x20,0x69,0x6e,0x69,0x74,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74, - 0x6d,0x6f,0x64,0x75,0x6c,0x65,0x5f,0x75,0x72,0x69,0x20,0x3d,0x20,0x6e,0x69,0x6c, - 0x20,0x2d,0x2d,0x20,0x73,0x65,0x74,0x20,0x69,0x6e,0x20,0x69,0x6e,0x69,0x74,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x0a,0x0a,0x2d,0x2d,0x20,0x77,0x69,0x6c, - 0x6c,0x20,0x63,0x6f,0x6e,0x74,0x61,0x69,0x6e,0x20,0x74,0x68,0x65,0x20,0x73,0x65, - 0x73,0x73,0x69,0x6f,0x6e,0x20,0x6f,0x62,0x6a,0x65,0x63,0x74,0x2c,0x20,0x61,0x6e, - 0x64,0x20,0x70,0x6f,0x73,0x73,0x69,0x62,0x6c,0x79,0x20,0x61,0x20,0x6c,0x69,0x73, - 0x74,0x20,0x6f,0x66,0x20,0x61,0x6c,0x6c,0x20,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e, - 0x73,0x20,0x69,0x66,0x20,0x61,0x20,0x6d,0x75,0x6c,0x74,0x69,0x2d,0x74,0x68,0x72, - 0x65,0x61,0x64,0x65,0x64,0x20,0x6d,0x6f,0x64,0x65,0x6c,0x20,0x69,0x73,0x20,0x61, - 0x64,0x6f,0x70,0x74,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x74,0x68,0x69,0x73,0x20,0x69, - 0x73,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x75,0x73,0x65,0x64,0x20,0x66,0x6f,0x72,0x20, - 0x61,0x73,0x79,0x6e,0x63,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x2e,0x0a, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x0a,0x2d,0x2d,0x20,0x74, - 0x72,0x61,0x63,0x6b,0x73,0x20,0x61,0x6c,0x6c,0x20,0x61,0x63,0x74,0x69,0x76,0x65, - 0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20,0x61,0x6e,0x64,0x20, - 0x61,0x73,0x73,0x6f,0x63,0x69,0x61,0x74,0x65,0x20,0x61,0x6e,0x20,0x69,0x64,0x20, - 0x74,0x6f,0x20,0x74,0x68,0x65,0x6d,0x2c,0x20,0x74,0x68,0x65,0x20,0x74,0x61,0x62, - 0x6c,0x65,0x20,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x20,0x69,0x73,0x20,0x74,0x68, - 0x65,0x20,0x69,0x64,0x3d,0x3e,0x63,0x6f,0x72,0x6f,0x20,0x6d,0x61,0x70,0x70,0x69, - 0x6e,0x67,0x2c,0x20,0x74,0x68,0x65,0x20,0x74,0x61,0x62,0x6c,0x65,0x20,0x66,0x72, - 0x6f,0x6d,0x5f,0x63,0x6f,0x72,0x6f,0x20,0x69,0x73,0x20,0x74,0x68,0x65,0x20,0x72, - 0x65,0x76,0x65,0x72,0x73,0x65,0x0a,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69, - 0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20,0x3d,0x20, - 0x7b,0x20,0x6e,0x20,0x3d,0x20,0x30,0x2c,0x20,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64, - 0x20,0x3d,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28, - 0x7b,0x20,0x7d,0x2c,0x20,0x7b,0x20,0x5f,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20, - 0x22,0x76,0x22,0x20,0x7d,0x29,0x2c,0x20,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x6f,0x72, - 0x6f,0x20,0x3d,0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65, - 0x28,0x7b,0x20,0x7d,0x2c,0x20,0x7b,0x20,0x5f,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d, - 0x20,0x22,0x6b,0x22,0x20,0x7d,0x29,0x20,0x7d,0x0a,0x0a,0x63,0x6f,0x72,0x65,0x2e, - 0x70,0x72,0x65,0x76,0x5f,0x62,0x72,0x65,0x61,0x6b,0x5f,0x6c,0x69,0x6e,0x65,0x20, - 0x3d,0x20,0x6e,0x69,0x6c,0x20,0x2d,0x2d,0x20,0x73,0x65,0x74,0x20,0x69,0x6e,0x20, - 0x6c,0x69,0x6e,0x65,0x5f,0x68,0x6f,0x6f,0x6b,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x0a,0x0a,0x2d,0x2d,0x20,0x22,0x42,0x45,0x47,0x49,0x4e,0x20,0x56,0x45, - 0x52,0x53,0x49,0x4f,0x4e,0x20,0x44,0x45,0x50,0x45,0x4e,0x44,0x45,0x4e,0x54,0x20, - 0x43,0x4f,0x44,0x45,0x22,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x65,0x74,0x62, - 0x70,0x65,0x6e,0x76,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x65,0x74,0x20, - 0x65,0x6e,0x76,0x69,0x72,0x6f,0x6e,0x6d,0x65,0x6e,0x74,0x20,0x6f,0x66,0x20,0x61, - 0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x28,0x63,0x6f,0x6d, - 0x70,0x69,0x6c,0x65,0x64,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x29,0x0a, - 0x69,0x66,0x20,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x3d,0x3d,0x20,0x22, - 0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x65,0x74,0x66,0x65,0x6e,0x76,0x20, - 0x3d,0x20,0x73,0x65,0x74,0x66,0x65,0x6e,0x76,0x0a,0x20,0x20,0x20,0x20,0x73,0x65, - 0x74,0x62,0x70,0x65,0x6e,0x76,0x20,0x3d,0x20,0x73,0x65,0x74,0x66,0x65,0x6e,0x76, - 0x0a,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e, - 0x20,0x3d,0x3d,0x20,0x22,0x4c,0x75,0x61,0x20,0x35,0x2e,0x32,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x65,0x74, - 0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x64,0x65,0x62,0x75,0x67,0x2e, - 0x73,0x65,0x74,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x5f,0x45,0x4e,0x56,0x20,0x69,0x73,0x20,0x74,0x68,0x65,0x20,0x66,0x69, - 0x72,0x73,0x74,0x20,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x0a,0x20,0x20,0x20,0x20, - 0x73,0x65,0x74,0x62,0x70,0x65,0x6e,0x76,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x66,0x2c,0x20,0x74,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x73,0x65,0x74,0x75,0x70,0x76,0x61,0x6c,0x75,0x65,0x28,0x66,0x2c,0x20,0x31, - 0x2c,0x20,0x74,0x29,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6c,0x73,0x65,0x20,0x65,0x72, - 0x72,0x6f,0x72,0x28,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x2e,0x2e,0x20, - 0x22,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x70,0x70,0x6f,0x72,0x74,0x65, - 0x64,0x2e,0x22,0x29,0x20,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x20,0x22,0x45,0x4e,0x44, - 0x20,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x20,0x44,0x45,0x50,0x45,0x4e,0x44,0x45, - 0x4e,0x54,0x20,0x43,0x4f,0x44,0x45,0x22,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x4f,0x75, - 0x74,0x70,0x75,0x74,0x20,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x4f,0x76,0x65, - 0x72,0x72,0x69,0x64,0x65,0x20,0x73,0x74,0x61,0x6e,0x64,0x61,0x72,0x64,0x20,0x6f, - 0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20, - 0x26,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x73,0x20,0x74,0x6f,0x20,0x72, - 0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x20,0x64,0x61,0x74,0x61,0x20,0x77,0x72,0x69, - 0x74,0x74,0x65,0x6e,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,0x73,0x65,0x20,0x66,0x69, - 0x6c,0x65,0x73,0x20,0x74,0x6f,0x20,0x49,0x44,0x45,0x20,0x74,0x6f,0x6f,0x2e,0x0a, - 0x2d,0x2d,0x20,0x54,0x68,0x69,0x73,0x20,0x77,0x6f,0x72,0x6b,0x73,0x20,0x6f,0x6e, - 0x6c,0x79,0x20,0x66,0x6f,0x72,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x64,0x6f, - 0x6e,0x65,0x20,0x69,0x6e,0x20,0x4c,0x75,0x61,0x2c,0x20,0x6f,0x75,0x74,0x70,0x75, - 0x74,0x20,0x77,0x72,0x69,0x74,0x74,0x65,0x6e,0x20,0x62,0x79,0x20,0x43,0x20,0x65, - 0x78,0x74,0x65,0x6e,0x73,0x69,0x6f,0x6e,0x73,0x20,0x69,0x73,0x20,0x73,0x74,0x69, - 0x6c,0x6c,0x20,0x67,0x6f,0x20,0x74,0x6f,0x20,0x73,0x79,0x73,0x74,0x65,0x6d,0x20, - 0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0x2e,0x0a,0x0a,0x2d,0x2d, - 0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x20,0x74,0x6f,0x20,0x6e, - 0x61,0x74,0x69,0x76,0x65,0x20,0x76,0x61,0x6c,0x75,0x65,0x73,0x0a,0x69,0x6f,0x2e, - 0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x7b,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20, - 0x3d,0x20,0x69,0x6f,0x2e,0x6f,0x75,0x74,0x70,0x75,0x74,0x2c,0x20,0x73,0x74,0x64, - 0x69,0x6e,0x20,0x3d,0x20,0x69,0x6f,0x2e,0x73,0x74,0x64,0x69,0x6e,0x2c,0x20,0x73, - 0x74,0x64,0x6f,0x75,0x74,0x20,0x3d,0x20,0x69,0x6f,0x2e,0x73,0x74,0x64,0x6f,0x75, - 0x74,0x2c,0x20,0x73,0x74,0x64,0x65,0x72,0x72,0x20,0x3d,0x20,0x69,0x6f,0x2e,0x73, - 0x74,0x64,0x65,0x72,0x72,0x20,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x63,0x6f,0x6d,0x6d, - 0x65,0x6e,0x74,0x20,0x6f,0x75,0x74,0x20,0x62,0x79,0x20,0x67,0x75,0x61,0x6e,0x79, - 0x75,0x5f,0x79,0x61,0x6e,0x2c,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65,0x64,0x69,0x72, - 0x65,0x63,0x74,0x20,0x69,0x6f,0x2e,0x0a,0x2d,0x2d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x2d, - 0x2d,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x75,0x66,0x20, - 0x3d,0x20,0x7b,0x2e,0x2e,0x2e,0x7d,0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x66, - 0x6f,0x72,0x20,0x69,0x3d,0x31,0x2c,0x20,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x22, - 0x23,0x22,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x20,0x64,0x6f,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x75,0x66,0x5b,0x69,0x5d,0x20,0x3d,0x20, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x62,0x75,0x66,0x5b,0x69,0x5d,0x29, - 0x0a,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x2d,0x2d,0x20,0x20, - 0x20,0x20,0x20,0x69,0x6f,0x2e,0x73,0x74,0x64,0x6f,0x75,0x74,0x3a,0x77,0x72,0x69, - 0x74,0x65,0x28,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28, - 0x62,0x75,0x66,0x2c,0x20,0x22,0x5c,0x74,0x22,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5c, - 0x6e,0x22,0x29,0x0a,0x2d,0x2d,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x41, - 0x63,0x74,0x75,0x61,0x6c,0x6c,0x79,0x20,0x63,0x68,0x61,0x6e,0x67,0x65,0x20,0x73, - 0x74,0x61,0x6e,0x64,0x61,0x72,0x64,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66, - 0x69,0x6c,0x65,0x20,0x62,0x75,0x74,0x20,0x73,0x74,0x69,0x6c,0x6c,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x74,0x68,0x65,0x20,0x22,0x66,0x61,0x6b,0x65,0x22,0x20, - 0x73,0x74,0x64,0x6f,0x75,0x74,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x69,0x6f,0x2e,0x6f,0x75,0x74,0x70,0x75,0x74,0x28,0x6f,0x75,0x74,0x70,0x75,0x74, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x69,0x6f,0x2e,0x62,0x61,0x73,0x65,0x2e,0x6f,0x75, - 0x74,0x70,0x75,0x74,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x6f,0x2e,0x73,0x74,0x64,0x6f,0x75, - 0x74,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x75,0x6d, - 0x6d,0x79,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x20, - 0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c, - 0x65,0x20,0x66,0x6f,0x72,0x20,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6e, - 0x67,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x28,0x6e,0x6f,0x74,0x20,0x70,0x72, - 0x69,0x6e,0x74,0x65,0x64,0x20,0x61,0x74,0x20,0x61,0x6c,0x6c,0x20,0x69,0x6e,0x20, - 0x61,0x63,0x74,0x75,0x61,0x6c,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x29,0x0a,0x63, - 0x6f,0x72,0x65,0x2e,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x6f,0x75,0x74, - 0x70,0x75,0x74,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x77,0x72,0x69,0x74, - 0x65,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c, - 0x66,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x75,0x66,0x20,0x3d,0x20,0x7b,0x2e,0x2e,0x2e, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d, - 0x31,0x2c,0x20,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x22,0x23,0x22,0x2c,0x20,0x2e, - 0x2e,0x2e,0x29,0x20,0x64,0x6f,0x20,0x62,0x75,0x66,0x5b,0x69,0x5d,0x20,0x3d,0x20, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x62,0x75,0x66,0x5b,0x69,0x5d,0x29, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x75,0x66, - 0x20,0x3d,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x63,0x6f,0x6e,0x63,0x61,0x74,0x28, - 0x62,0x75,0x66,0x29,0x3a,0x67,0x73,0x75,0x62,0x28,0x22,0x5c,0x6e,0x22,0x2c,0x20, - 0x22,0x5c,0x72,0x5c,0x6e,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65, - 0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20, - 0x22,0x73,0x74,0x72,0x65,0x61,0x6d,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d, - 0x20,0x7b,0x20,0x74,0x79,0x70,0x65,0x3d,0x73,0x65,0x6c,0x66,0x2e,0x6d,0x6f,0x64, - 0x65,0x20,0x7d,0x2c,0x20,0x20,0x75,0x74,0x69,0x6c,0x2e,0x62,0x36,0x34,0x28,0x62, - 0x75,0x66,0x29,0x20,0x7d,0x20,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x75,0x73,0x68,0x20,0x3d,0x20,0x64,0x75,0x6d, - 0x6d,0x79,0x2c,0x0a,0x20,0x20,0x20,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x3d,0x20, - 0x64,0x75,0x6d,0x6d,0x79,0x2c,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x74,0x76,0x62, - 0x75,0x66,0x20,0x3d,0x20,0x64,0x75,0x6d,0x6d,0x79,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x73,0x65,0x65,0x6b,0x20,0x3d,0x20,0x64,0x75,0x6d,0x6d,0x79,0x0a,0x7d,0x0a,0x63, - 0x6f,0x72,0x65,0x2e,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x6f,0x75,0x74, - 0x70,0x75,0x74,0x2e,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x63,0x6f, - 0x72,0x65,0x2e,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x6f,0x75,0x74,0x70, - 0x75,0x74,0x0a,0x0a,0x2d,0x2d,0x20,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65, - 0x20,0x66,0x6f,0x72,0x20,0x63,0x6c,0x6f,0x6e,0x69,0x6e,0x67,0x20,0x6f,0x75,0x74, - 0x70,0x75,0x74,0x20,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x20,0x74,0x6f,0x20, - 0x61,0x63,0x74,0x75,0x61,0x6c,0x20,0x73,0x79,0x73,0x74,0x65,0x6d,0x20,0x61,0x6e, - 0x64,0x20,0x73,0x65,0x6e,0x64,0x20,0x74,0x6f,0x20,0x49,0x44,0x45,0x29,0x0a,0x63, - 0x6f,0x72,0x65,0x2e,0x63,0x6f,0x70,0x79,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x20, - 0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x77,0x72,0x69,0x74,0x65,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x2e, - 0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65, - 0x2e,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74, - 0x2e,0x77,0x72,0x69,0x74,0x65,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x2e,0x2e,0x2e, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6f,0x2e,0x62,0x61,0x73, - 0x65,0x5b,0x73,0x65,0x6c,0x66,0x2e,0x6d,0x6f,0x64,0x65,0x5d,0x3a,0x77,0x72,0x69, - 0x74,0x65,0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x2c, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x75,0x73,0x68,0x20,0x20,0x20,0x3d,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x2e,0x2e, - 0x2e,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c,0x66,0x2e,0x6f, - 0x75,0x74,0x3a,0x66,0x6c,0x75,0x73,0x68,0x28,0x2e,0x2e,0x2e,0x29,0x20,0x65,0x6e, - 0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x20,0x20,0x3d, - 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20, - 0x2e,0x2e,0x2e,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65,0x6c,0x66, - 0x2e,0x6f,0x75,0x74,0x3a,0x63,0x6c,0x6f,0x73,0x65,0x28,0x2e,0x2e,0x2e,0x29,0x20, - 0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x74,0x76,0x62,0x75,0x66, - 0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x73,0x65,0x6c,0x66, - 0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x65, - 0x6c,0x66,0x2e,0x6f,0x75,0x74,0x3a,0x73,0x65,0x74,0x76,0x62,0x75,0x66,0x28,0x2e, - 0x2e,0x2e,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x65, - 0x6b,0x20,0x20,0x20,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28, - 0x73,0x65,0x6c,0x66,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x73,0x65,0x6c,0x66,0x2e,0x6f,0x75,0x74,0x3a,0x73,0x65,0x65,0x6b,0x28, - 0x2e,0x2e,0x2e,0x29,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x7d,0x0a,0x63,0x6f,0x72,0x65, - 0x2e,0x63,0x6f,0x70,0x79,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x5f,0x5f,0x69, - 0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x2e,0x63,0x6f,0x70,0x79, - 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x0a,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x2d,0x2d,0x20,0x20,0x42,0x72,0x65, - 0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x72,0x79, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x52,0x65,0x67,0x69,0x73,0x74,0x72,0x79,0x20,0x6f,0x66,0x20, - 0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6c,0x65, - 0x76,0x65,0x6c,0x73,0x20,0x6f,0x66,0x20,0x61,0x6c,0x6c,0x20,0x72,0x75,0x6e,0x6e, - 0x69,0x6e,0x67,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x73,0x0a,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x20,0x3d, - 0x20,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x20,0x7b, - 0x20,0x7d,0x2c,0x20,0x7b,0x20,0x5f,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x22, - 0x6b,0x22,0x20,0x7d,0x20,0x29,0x0a,0x0a,0x2d,0x2d,0x20,0x46,0x69,0x6c,0x65,0x2f, - 0x6c,0x69,0x6e,0x65,0x20,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x20,0x66,0x6f,0x72, - 0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x20,0x28,0x42,0x50, - 0x29,0x2e,0x20,0x46,0x6f,0x72,0x20,0x61,0x20,0x67,0x69,0x76,0x65,0x6e,0x20,0x66, - 0x69,0x6c,0x65,0x2f,0x6c,0x69,0x6e,0x65,0x2c,0x20,0x61,0x20,0x6c,0x69,0x73,0x74, - 0x20,0x6f,0x66,0x20,0x42,0x50,0x20,0x69,0x73,0x20,0x61,0x73,0x73,0x6f,0x63,0x69, - 0x61,0x74,0x65,0x64,0x20,0x28,0x44,0x42,0x47,0x70,0x20,0x73,0x70,0x65,0x63,0x69, - 0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x73,0x65,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x37,0x2e,0x36,0x2e,0x31,0x0a,0x2d,0x2d,0x20,0x72,0x65,0x71,0x75,0x69,0x72, - 0x65,0x20,0x74,0x68,0x61,0x74,0x20,0x6d,0x75,0x6c,0x74,0x69,0x70,0x6c,0x65,0x20, - 0x42,0x50,0x20,0x61,0x74,0x20,0x73,0x61,0x6d,0x65,0x20,0x70,0x6c,0x61,0x63,0x65, - 0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x64, - 0x29,0x0a,0x2d,0x2d,0x20,0x41,0x20,0x42,0x50,0x20,0x69,0x73,0x20,0x61,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x74,0x68,0x20,0x61,0x6c,0x6c,0x20,0x61,0x64, - 0x64,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x20,0x70,0x72,0x6f,0x70,0x65,0x72,0x74, - 0x69,0x65,0x73,0x20,0x28,0x74,0x79,0x70,0x65,0x2c,0x20,0x63,0x6f,0x6e,0x64,0x69, - 0x74,0x69,0x6f,0x6e,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x20,0x74,0x68,0x65,0x20,0x69, - 0x64,0x20,0x69,0x73,0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20, - 0x72,0x65,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f, - 0x66,0x20,0x74,0x68,0x65,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x0a,0x63,0x6f,0x72, - 0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x20,0x3d,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x73,0x20,0x74,0x6f,0x20,0x63,0x61,0x6c,0x6c,0x20,0x74,0x6f,0x20,0x6d,0x61, - 0x74,0x63,0x68,0x20,0x68,0x69,0x74,0x20,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f, - 0x6e,0x73,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69, - 0x74,0x69,0x6f,0x6e,0x73,0x20,0x3d,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x5b,0x22,0x3e,0x3d,0x22,0x5d,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x28,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20,0x74,0x61,0x72,0x67,0x65, - 0x74,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x61,0x6c,0x75,0x65,0x20, - 0x3e,0x3d,0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5b,0x22,0x3d,0x3d,0x22,0x5d,0x20,0x3d,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x76,0x61,0x6c,0x75,0x65,0x2c,0x20, - 0x74,0x61,0x72,0x67,0x65,0x74,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76, - 0x61,0x6c,0x75,0x65,0x20,0x3d,0x3d,0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x20,0x65, - 0x6e,0x64,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5b,0x22,0x25,0x22, - 0x5d,0x20,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x76,0x61, - 0x6c,0x75,0x65,0x2c,0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x29,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x28,0x76,0x61,0x6c,0x75,0x65,0x20,0x25,0x20,0x74,0x61,0x72, - 0x67,0x65,0x74,0x29,0x20,0x3d,0x3d,0x20,0x30,0x20,0x65,0x6e,0x64,0x2c,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x2d,0x2d,0x20,0x74,0x72,0x61,0x63,0x6b, - 0x73,0x20,0x65,0x76,0x65,0x6e,0x74,0x73,0x20,0x73,0x75,0x63,0x68,0x20,0x61,0x73, - 0x20,0x73,0x74,0x65,0x70,0x5f,0x69,0x6e,0x74,0x6f,0x20,0x6f,0x72,0x20,0x73,0x74, - 0x65,0x70,0x5f,0x6f,0x76,0x65,0x72,0x0a,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65, - 0x6e,0x74,0x73,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x0a,0x64,0x6f,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70, - 0x70,0x69,0x6e,0x67,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x69,0x64,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x20, - 0x3d,0x20,0x7b,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x77,0x61,0x69,0x74,0x69,0x6e,0x67,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x73, - 0x20,0x3d,0x20,0x7b,0x20,0x7d,0x20,0x2d,0x2d,0x20,0x73,0x65,0x73,0x73,0x69,0x6f, - 0x6e,0x73,0x20,0x74,0x68,0x61,0x74,0x20,0x77,0x61,0x69,0x74,0x20,0x66,0x6f,0x72, - 0x20,0x61,0x6e,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x28,0x6f,0x76,0x65,0x72,0x2c, - 0x20,0x69,0x6e,0x74,0x6f,0x2c,0x20,0x6f,0x75,0x74,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x74,0x65,0x70,0x5f,0x69,0x6e,0x74,0x6f,0x20, - 0x3d,0x20,0x6e,0x69,0x6c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x74,0x68,0x61,0x74,0x20,0x72,0x65,0x67, - 0x69,0x73,0x74,0x65,0x72,0x65,0x64,0x20,0x61,0x20,0x73,0x74,0x65,0x70,0x5f,0x69, - 0x6e,0x74,0x6f,0x20,0x65,0x76,0x65,0x6e,0x74,0x2c,0x20,0x69,0x66,0x20,0x61,0x6e, - 0x79,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x65,0x71,0x75, - 0x65,0x6e,0x63,0x65,0x20,0x3d,0x20,0x30,0x20,0x2d,0x2d,0x20,0x75,0x73,0x65,0x64, - 0x20,0x74,0x6f,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x20,0x62,0x72,0x65, - 0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x49,0x44,0x73,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69, - 0x6e,0x67,0x20,0x3d,0x20,0x7b,0x7d,0x20,0x20,0x2d,0x2d,0x20,0x75,0x73,0x65,0x20, - 0x74,0x6f,0x20,0x72,0x65,0x63,0x6f,0x72,0x64,0x20,0x74,0x68,0x65,0x20,0x6c,0x69, - 0x6e,0x65,0x20,0x6f,0x66,0x20,0x62,0x70,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x69,0x6e,0x73, - 0x65,0x72,0x74,0x5f,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67, - 0x28,0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c, - 0x69,0x6e,0x65,0x5d,0x20,0x3d,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x6e, - 0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d,0x20, - 0x3d,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x6e, - 0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d,0x20, - 0x3d,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c, - 0x69,0x6e,0x65,0x5d,0x20,0x2b,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x72,0x65,0x6d,0x6f,0x76,0x65,0x5f,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70, - 0x70,0x69,0x6e,0x67,0x28,0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d, - 0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d,0x20,0x61,0x6e,0x64, - 0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69, - 0x6e,0x65,0x5d,0x20,0x3e,0x20,0x31,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61, - 0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d,0x20,0x3d,0x20,0x6c,0x69, - 0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d, - 0x20,0x2d,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69, - 0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d, - 0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72, - 0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x67,0x75,0x65,0x73,0x73,0x28, - 0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e, - 0x67,0x5b,0x6c,0x69,0x6e,0x65,0x5d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f, - 0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x75, - 0x70,0x64,0x61,0x74,0x65,0x28,0x6f,0x6c,0x64,0x6c,0x69,0x6e,0x65,0x2c,0x6e,0x65, - 0x77,0x62,0x70,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x66,0x69,0x6c,0x65,0x20,0x3d,0x20,0x6e,0x65,0x77,0x62,0x70,0x2e, - 0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x6f,0x6c, - 0x64,0x6c,0x69,0x6e,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x20,0x3d,0x20,0x66,0x69, - 0x6c,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x66,0x69,0x6c,0x65,0x5d, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x69,0x6e,0x65,0x72,0x65, - 0x67,0x20,0x3d,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x5b,0x6c,0x69,0x6e,0x65, - 0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74, - 0x20,0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6d,0x6f,0x76,0x65,0x5f,0x6c,0x69,0x6e,0x65, - 0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x28,0x6f,0x6c,0x64,0x6c,0x69,0x6e,0x65, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d, - 0x31,0x2c,0x20,0x23,0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x20,0x64,0x6f,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6c,0x69, - 0x6e,0x65,0x72,0x65,0x67,0x5b,0x69,0x5d,0x2e,0x69,0x64,0x20,0x3d,0x3d,0x20,0x6e, - 0x65,0x77,0x62,0x70,0x2e,0x69,0x64,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x61,0x62, - 0x6c,0x65,0x2e,0x72,0x65,0x6d,0x6f,0x76,0x65,0x28,0x6c,0x69,0x6e,0x65,0x72,0x65, - 0x67,0x2c,0x20,0x69,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x73,0x65,0x72,0x74,0x5f,0x6c,0x69,0x6e,0x65, - 0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x28,0x6e,0x65,0x77,0x62,0x70,0x2e,0x6c, - 0x69,0x6e,0x65,0x6e,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74, - 0x61,0x62,0x6c,0x65,0x2e,0x69,0x6e,0x73,0x65,0x72,0x74,0x28,0x6c,0x69,0x6e,0x65, - 0x72,0x65,0x67,0x2c,0x20,0x6e,0x65,0x77,0x62,0x70,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x5b,0x6e,0x65,0x77,0x62, - 0x70,0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x5d,0x20,0x3d,0x20,0x6c,0x69,0x6e,0x65, - 0x72,0x65,0x67,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x2d,0x20,0x49,0x6e,0x73,0x65,0x72,0x74,0x73,0x20,0x61,0x20,0x6e, - 0x65,0x77,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x69,0x6e, - 0x74,0x6f,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x72,0x79,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x62,0x70,0x20,0x28,0x74,0x61, - 0x62,0x6c,0x65,0x29,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20, - 0x64,0x61,0x74,0x61,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x75,0x72,0x69,0x20,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x2c,0x20, - 0x6f,0x70,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x29,0x20,0x41,0x62,0x73,0x6f,0x6c,0x75, - 0x74,0x65,0x20,0x66,0x69,0x6c,0x65,0x20,0x55,0x52,0x49,0x2c,0x20,0x66,0x6f,0x72, - 0x20,0x6c,0x69,0x6e,0x65,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74, - 0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20, - 0x6c,0x69,0x6e,0x65,0x20,0x28,0x6e,0x75,0x6d,0x62,0x65,0x72,0x2c,0x20,0x6f,0x70, - 0x74,0x69,0x6f,0x6e,0x61,0x6c,0x29,0x20,0x4c,0x69,0x6e,0x65,0x20,0x77,0x68,0x65, - 0x72,0x65,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x73,0x74, - 0x6f,0x70,0x73,0x2c,0x20,0x66,0x6f,0x72,0x20,0x6c,0x69,0x6e,0x65,0x20,0x62,0x72, - 0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x20,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x65, - 0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x69,0x6e,0x73, - 0x65,0x72,0x74,0x28,0x62,0x70,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x70,0x69,0x64,0x20,0x3d,0x20,0x73,0x65,0x71, - 0x75,0x65,0x6e,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x65, - 0x71,0x75,0x65,0x6e,0x63,0x65,0x20,0x3d,0x20,0x62,0x70,0x69,0x64,0x20,0x2b,0x20, - 0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x70,0x2e,0x69,0x64,0x20, - 0x3d,0x20,0x62,0x70,0x69,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x72,0x65,0x2d,0x65,0x6e,0x63,0x6f,0x64,0x65,0x20,0x74,0x68,0x65,0x20, - 0x55,0x52,0x49,0x20,0x74,0x6f,0x20,0x61,0x76,0x6f,0x69,0x64,0x20,0x61,0x6e,0x79, - 0x20,0x6d,0x69,0x73,0x6d,0x61,0x74,0x63,0x68,0x20,0x28,0x77,0x69,0x74,0x68,0x20, - 0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x20,0x66,0x6f,0x72,0x20,0x65,0x78, - 0x61,0x6d,0x70,0x6c,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, - 0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x69,0x20,0x3d,0x20,0x75,0x72,0x6c,0x2e,0x70, - 0x61,0x72,0x73,0x65,0x28,0x62,0x70,0x2e,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x70,0x2e,0x66,0x69,0x6c, - 0x65,0x6e,0x61,0x6d,0x65,0x20,0x3d,0x20,0x75,0x72,0x6c,0x2e,0x62,0x75,0x69,0x6c, - 0x64,0x7b,0x20,0x73,0x63,0x68,0x65,0x6d,0x65,0x3d,0x75,0x72,0x69,0x2e,0x73,0x63, - 0x68,0x65,0x6d,0x65,0x2c,0x20,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x3d, - 0x22,0x22,0x2c,0x20,0x70,0x61,0x74,0x68,0x3d,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72, - 0x6d,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x75,0x72,0x69,0x2e, - 0x70,0x61,0x74,0x68,0x29,0x7d,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x20,0x3d,0x20, - 0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x62,0x70,0x2e, - 0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x20,0x3d,0x20,0x7b,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6c,0x65, - 0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x62,0x70,0x2e,0x66,0x69,0x6c,0x65, - 0x6e,0x61,0x6d,0x65,0x5d,0x20,0x3d,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x69,0x6e,0x65,0x72, - 0x65,0x67,0x20,0x3d,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67,0x5b,0x62,0x70,0x2e, - 0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x20,0x3d,0x20,0x7b,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6c,0x65,0x72,0x65,0x67, - 0x5b,0x62,0x70,0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x5d,0x20,0x3d,0x20,0x6c,0x69, - 0x6e,0x65,0x72,0x65,0x67,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x73,0x65,0x72,0x74, - 0x5f,0x6c,0x69,0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x28,0x62,0x70, - 0x2e,0x6c,0x69,0x6e,0x65,0x6e,0x6f,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x69,0x6e,0x73,0x65,0x72,0x74,0x28,0x6c, - 0x69,0x6e,0x65,0x72,0x65,0x67,0x2c,0x20,0x62,0x70,0x29,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x64,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b, - 0x62,0x70,0x69,0x64,0x5d,0x20,0x3d,0x20,0x62,0x70,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x70,0x69,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20, - 0x49,0x66,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x28,0x73,0x29, - 0x20,0x65,0x78,0x69,0x73,0x74,0x73,0x20,0x66,0x6f,0x72,0x20,0x67,0x69,0x76,0x65, - 0x6e,0x20,0x66,0x69,0x6c,0x65,0x2f,0x6c,0x69,0x6e,0x65,0x2c,0x20,0x75,0x70,0x74, - 0x61,0x74,0x65,0x73,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20, - 0x63,0x6f,0x75,0x6e,0x74,0x65,0x72,0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x61,0x6e,0x64,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x77,0x68,0x65,0x74, - 0x68,0x65,0x72,0x20,0x61,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74, - 0x20,0x68,0x61,0x73,0x20,0x6d,0x61,0x74,0x63,0x68,0x65,0x64,0x20,0x28,0x62,0x6f, - 0x6f,0x6c,0x65,0x61,0x6e,0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x73,0x2e,0x61,0x74,0x28,0x66,0x69,0x6c,0x65,0x2c,0x20,0x6c,0x69, - 0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x74,0x65,0x6d,0x70,0x20,0x3d,0x20,0x66,0x69,0x6c,0x65,0x3a,0x73,0x75, - 0x62,0x28,0x23,0x22,0x66,0x69,0x6c,0x65,0x3a,0x2f,0x2f,0x22,0x2b,0x31,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x20,0x5f, - 0x20,0x69,0x6e,0x20,0x70,0x61,0x69,0x72,0x73,0x28,0x66,0x69,0x6c,0x65,0x5f,0x6d, - 0x61,0x70,0x70,0x69,0x6e,0x67,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x2c,0x6a,0x20,0x3d, - 0x20,0x6b,0x3a,0x66,0x69,0x6e,0x64,0x28,0x74,0x65,0x6d,0x70,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x6a,0x20,0x3d,0x3d,0x20, - 0x23,0x6b,0x29,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6c,0x65,0x20,0x3d,0x20,0x6b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72, - 0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x70,0x73, - 0x20,0x3d,0x20,0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b, - 0x66,0x69,0x6c,0x65,0x5d,0x20,0x61,0x6e,0x64,0x20,0x66,0x69,0x6c,0x65,0x5f,0x6d, - 0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x66,0x69,0x6c,0x65,0x5d,0x5b,0x6c,0x69,0x6e, - 0x65,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f, - 0x74,0x20,0x62,0x70,0x73,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x64,0x6f,0x5f,0x62,0x72,0x65,0x61, - 0x6b,0x20,0x3d,0x20,0x66,0x61,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x66,0x6f,0x72,0x20,0x5f,0x2c,0x20,0x62,0x70,0x20,0x69,0x6e,0x20,0x70, - 0x61,0x69,0x72,0x73,0x28,0x62,0x70,0x73,0x29,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x62,0x70,0x2e,0x73, - 0x74,0x61,0x74,0x65,0x20,0x3d,0x3d,0x20,0x22,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64, - 0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6d,0x61,0x74, - 0x63,0x68,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x62,0x70,0x2e, - 0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x74,0x68,0x69,0x73, - 0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20,0x74,0x68,0x65,0x20,0x6f,0x70,0x74,0x69, - 0x6d,0x61,0x6c,0x20,0x73,0x6f,0x6c,0x75,0x74,0x69,0x6f,0x6e,0x20,0x62,0x65,0x63, - 0x61,0x75,0x73,0x65,0x20,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x63,0x61,0x6e, - 0x20,0x62,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x74,0x69,0x61,0x74,0x65,0x64, - 0x20,0x74,0x77,0x69,0x63,0x65,0x20,0x69,0x66,0x20,0x74,0x68,0x65,0x20,0x62,0x72, - 0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x6d,0x61,0x74,0x63,0x68,0x65,0x73, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x78,0x74,0x20,0x3d, - 0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x2e,0x43,0x6f,0x6e,0x74,0x65,0x78,0x74, - 0x3a,0x6e,0x65,0x77,0x28,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73, - 0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x73,0x65,0x74,0x62,0x70,0x65,0x6e,0x76,0x28,0x62,0x70,0x2e,0x63,0x6f,0x6e, - 0x64,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x63,0x78,0x74,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x2c,0x20, - 0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x70,0x63,0x61,0x6c,0x6c,0x28,0x62, - 0x70,0x2e,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x6c,0x6f,0x67,0x28,0x22,0x45,0x52,0x52,0x4f,0x52,0x22, - 0x2c,0x20,0x22,0x43,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f,0x6e,0x20,0x65,0x76,0x61, - 0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x61,0x69,0x6c,0x65,0x64,0x20,0x66, - 0x6f,0x72,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x61,0x74, - 0x20,0x25,0x73,0x3a,0x25,0x64,0x3a,0x20,0x25,0x73,0x22,0x2c,0x20,0x66,0x69,0x6c, - 0x65,0x2c,0x20,0x6c,0x69,0x6e,0x65,0x2c,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x29, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x64,0x65,0x62,0x75, - 0x67,0x67,0x65,0x72,0x20,0x61,0x6c,0x77,0x61,0x79,0x73,0x20,0x73,0x74,0x6f,0x70, - 0x73,0x20,0x69,0x66,0x20,0x61,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x6f,0x63, - 0x63,0x75,0x72,0x73,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x61,0x74,0x63,0x68,0x20,0x3d, - 0x20,0x28,0x6e,0x6f,0x74,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73,0x29,0x20,0x6f, - 0x72,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6d,0x61,0x74,0x63,0x68,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, - 0x70,0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x20,0x3d,0x20,0x62,0x70, - 0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x20,0x2b,0x20,0x31,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b, - 0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e,0x64,0x69, - 0x74,0x69,0x6f,0x6e,0x73,0x5b,0x62,0x70,0x2e,0x68,0x69,0x74,0x5f,0x63,0x6f,0x6e, - 0x64,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x28,0x62,0x70,0x2e,0x68,0x69,0x74,0x5f,0x63, - 0x6f,0x75,0x6e,0x74,0x2c,0x20,0x62,0x70,0x2e,0x68,0x69,0x74,0x5f,0x76,0x61,0x6c, - 0x75,0x65,0x29,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x62,0x70,0x2e,0x74,0x65,0x6d,0x70,0x6f,0x72,0x61,0x72,0x79, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e, - 0x74,0x73,0x2e,0x72,0x65,0x6d,0x6f,0x76,0x65,0x28,0x62,0x70,0x2e,0x69,0x64,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b,0x20,0x3d,0x20, - 0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x74,0x68,0x65,0x72,0x65,0x20,0x69,0x73,0x20,0x6e,0x6f,0x20,0x62,0x72,0x65,0x61, - 0x6b,0x20,0x74,0x6f,0x20,0x68,0x61,0x6e,0x64,0x6c,0x65,0x20,0x6d,0x75,0x6c,0x74, - 0x69,0x70,0x6c,0x65,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73, - 0x3a,0x20,0x61,0x6c,0x6c,0x20,0x68,0x69,0x74,0x20,0x63,0x6f,0x75,0x6e,0x74,0x73, - 0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x75,0x70,0x64,0x61,0x74,0x65,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b, - 0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61, - 0x6b,0x70,0x6f,0x69,0x6e,0x74,0x73,0x2e,0x67,0x65,0x74,0x28,0x69,0x64,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x69,0x64,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x64,0x5f,0x6d,0x61,0x70, - 0x70,0x69,0x6e,0x67,0x5b,0x69,0x64,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x69,0x64,0x5f, - 0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e, - 0x74,0x73,0x2e,0x72,0x65,0x6d,0x6f,0x76,0x65,0x28,0x69,0x64,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x70,0x20,0x3d, - 0x20,0x69,0x64,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x69,0x64,0x5d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x62,0x70,0x20,0x74,0x68, - 0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x64,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x69,0x64,0x5d,0x20,0x3d,0x20, - 0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x20,0x3d,0x20, - 0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x62,0x70,0x2e, - 0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x5d,0x5b,0x62,0x70,0x2e,0x6c,0x69,0x6e, - 0x65,0x6e,0x6f,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x31,0x2c,0x20,0x23,0x6c,0x69,0x6e,0x65,0x72, - 0x65,0x67,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6c,0x69,0x6e,0x65,0x72,0x65,0x67, - 0x5b,0x69,0x5d,0x20,0x3d,0x3d,0x20,0x62,0x70,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x74,0x61,0x62,0x6c,0x65,0x2e,0x72,0x65,0x6d,0x6f,0x76,0x65,0x28, - 0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x2c,0x20,0x69,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x6d,0x6f,0x76,0x65,0x5f,0x6c,0x69, - 0x6e,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x28,0x62,0x70,0x2e,0x6c,0x69, - 0x6e,0x65,0x6e,0x6f,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x6c,0x65,0x61,0x6e,0x75,0x70,0x20,0x66,0x69, - 0x6c,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x6e,0x65, - 0x78,0x74,0x28,0x6c,0x69,0x6e,0x65,0x72,0x65,0x67,0x29,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x62,0x70, - 0x2e,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65,0x5d,0x5b,0x62,0x70,0x2e,0x6c,0x69, - 0x6e,0x65,0x6e,0x6f,0x5d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e, - 0x6f,0x74,0x20,0x6e,0x65,0x78,0x74,0x28,0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70, - 0x70,0x69,0x6e,0x67,0x5b,0x62,0x70,0x2e,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65, - 0x5d,0x29,0x20,0x74,0x68,0x65,0x6e,0x20,0x66,0x69,0x6c,0x65,0x5f,0x6d,0x61,0x70, - 0x70,0x69,0x6e,0x67,0x5b,0x62,0x70,0x2e,0x66,0x69,0x6c,0x65,0x6e,0x61,0x6d,0x65, - 0x5d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74, - 0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66, - 0x61,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x61,0x6e, - 0x20,0x58,0x4d,0x4c,0x20,0x64,0x61,0x74,0x61,0x20,0x73,0x74,0x72,0x75,0x63,0x74, - 0x75,0x72,0x65,0x20,0x74,0x68,0x61,0x74,0x20,0x64,0x65,0x73,0x63,0x72,0x69,0x62, - 0x65,0x73,0x20,0x67,0x69,0x76,0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f, - 0x69,0x6e,0x74,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61, - 0x6d,0x20,0x69,0x64,0x20,0x28,0x6e,0x75,0x6d,0x62,0x65,0x72,0x29,0x20,0x62,0x72, - 0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x49,0x44,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x54,0x61,0x62,0x6c,0x65, - 0x20,0x64,0x65,0x73,0x63,0x72,0x69,0x62,0x69,0x6e,0x67,0x20,0x61,0x20,0x3c,0x62, - 0x72,0x65,0x61,0x6b,0x70,0x6f,0x6f,0x69,0x6e,0x74,0x3e,0x20,0x74,0x61,0x67,0x20, - 0x6f,0x72,0x20,0x6e,0x69,0x6c,0x20,0x66,0x6f,0x6c,0x6c,0x6f,0x77,0x65,0x64,0x20, - 0x62,0x79,0x20,0x61,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x20,0x6d,0x65,0x73,0x73, - 0x61,0x67,0x65,0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74, - 0x73,0x2e,0x67,0x65,0x74,0x5f,0x78,0x6d,0x6c,0x28,0x69,0x64,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x62,0x70,0x20,0x3d, - 0x20,0x69,0x64,0x5f,0x6d,0x61,0x70,0x70,0x69,0x6e,0x67,0x5b,0x69,0x64,0x5d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x62, - 0x70,0x20,0x74,0x68,0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6e,0x69, - 0x6c,0x2c,0x20,0x22,0x4e,0x6f,0x20,0x73,0x75,0x63,0x68,0x20,0x62,0x72,0x65,0x61, - 0x6b,0x70,0x6f,0x69,0x6e,0x74,0x3a,0x20,0x22,0x2e,0x2e,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x69,0x64,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x72,0x65,0x73,0x70,0x6f, - 0x6e,0x73,0x65,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x62, - 0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x22,0x2c,0x20,0x61,0x74,0x74,0x72, - 0x20,0x3d,0x20,0x7b,0x20,0x7d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x6f,0x72,0x20,0x6b,0x2c,0x76,0x20,0x69,0x6e,0x20,0x70,0x61,0x69,0x72, - 0x73,0x28,0x62,0x70,0x29,0x20,0x64,0x6f,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73, - 0x65,0x2e,0x61,0x74,0x74,0x72,0x5b,0x6b,0x5d,0x20,0x3d,0x20,0x76,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x62,0x70,0x2e, - 0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x74,0x68,0x65,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x73,0x65,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x74,0x61,0x67,0x20, - 0x3d,0x20,0x22,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x22,0x2c,0x20, - 0x20,0x62,0x70,0x2e,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x7d, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61, - 0x6c,0x20,0x75,0x73,0x65,0x20,0x6f,0x6e,0x6c,0x79,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x2e,0x61,0x74,0x74,0x72, - 0x2e,0x65,0x78,0x70,0x72,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6e,0x69, - 0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e, - 0x73,0x65,0x2e,0x61,0x74,0x74,0x72,0x2e,0x63,0x6f,0x6e,0x64,0x69,0x74,0x69,0x6f, - 0x6e,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x2e,0x61,0x74,0x74,0x72,0x2e,0x74,0x65, - 0x6d,0x70,0x6f,0x72,0x61,0x72,0x79,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x2d,0x2d, - 0x20,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x74,0x68,0x65,0x20,0x73,0x70,0x65,0x63,0x69, - 0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x63,0x6c,0x65,0x61,0x72,0x20,0x77,0x68,0x65,0x74,0x68,0x65,0x72,0x20,0x74,0x68, - 0x69,0x73,0x20,0x73,0x68,0x6f,0x75,0x6c,0x64,0x20,0x62,0x65,0x20,0x70,0x72,0x6f, - 0x76,0x69,0x64,0x65,0x64,0x2c,0x20,0x73,0x65,0x65,0x20,0x6f,0x74,0x68,0x65,0x72, - 0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x73, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x52,0x65,0x67,0x69,0x73,0x74, - 0x65,0x72,0x20,0x61,0x6e,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x74,0x6f,0x20,0x62, - 0x65,0x20,0x74,0x72,0x69,0x67,0x67,0x65,0x72,0x65,0x64,0x2e,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x40,0x70,0x61,0x72,0x61,0x6d,0x20,0x65,0x76,0x65,0x6e,0x74, - 0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x6e,0x61,0x6d,0x65,0x20,0x74,0x6f,0x20,0x72, - 0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x20,0x28,0x6d,0x75,0x73,0x74,0x20,0x62,0x65, - 0x20,0x22,0x6f,0x76,0x65,0x72,0x22,0x2c,0x20,0x22,0x6f,0x75,0x74,0x22,0x20,0x6f, - 0x72,0x20,0x22,0x69,0x6e,0x74,0x6f,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x75, - 0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65,0x6e, - 0x74,0x73,0x2e,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x65,0x76,0x65,0x6e, - 0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x61,0x63,0x74,0x69,0x76,0x65, - 0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x5b,0x31,0x5d, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x28,0x22,0x44,0x45, - 0x42,0x55,0x47,0x22,0x2c,0x20,0x22,0x52,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x65, - 0x64,0x20,0x25,0x73,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x66,0x6f,0x72,0x20,0x25, - 0x73,0x20,0x28,0x25,0x64,0x29,0x22,0x2c,0x20,0x65,0x76,0x65,0x6e,0x74,0x2c,0x20, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x29, - 0x2c,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74, - 0x68,0x72,0x65,0x61,0x64,0x5d,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x3d,0x3d,0x20,0x22,0x69,0x6e,0x74, - 0x6f,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x73,0x74,0x65,0x70,0x5f,0x69,0x6e,0x74,0x6f,0x20,0x3d,0x20, - 0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x61, - 0x69,0x74,0x69,0x6e,0x67,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x73,0x5b,0x74, - 0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x65,0x76,0x65,0x6e,0x74, - 0x2c,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74, - 0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x73,0x20,0x69,0x66, - 0x20,0x61,0x6e,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x28,0x73,0x74,0x65,0x70,0x20, - 0x69,0x6e,0x74,0x6f,0x2c,0x20,0x6f,0x76,0x65,0x72,0x2c,0x20,0x6f,0x75,0x74,0x29, - 0x20,0x69,0x73,0x20,0x74,0x72,0x69,0x67,0x67,0x65,0x72,0x65,0x64,0x2e,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x44,0x6f,0x65,0x73,0x20,0x2a,0x6e,0x6f,0x74,0x2a, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x20,0x65,0x76,0x65,0x6e,0x74,0x73,0x20, - 0x28,0x65,0x76,0x65,0x6e,0x20,0x69,0x66,0x20,0x74,0x68,0x65,0x79,0x20,0x6d,0x61, - 0x74,0x63,0x68,0x29,0x20,0x61,0x73,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x6d,0x75, - 0x73,0x74,0x20,0x62,0x65,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x65,0x64,0x20, - 0x6d,0x61,0x6e,0x75,0x61,0x6c,0x6c,0x79,0x20,0x69,0x66,0x20,0x61,0x20,0x62,0x72, - 0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x20,0x6d,0x61,0x74,0x63,0x68,0x20,0x62, - 0x65,0x66,0x6f,0x72,0x65,0x20,0x61,0x6e,0x79,0x77,0x61,0x79,0x2e,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x40,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x72,0x75, - 0x65,0x20,0x69,0x66,0x20,0x61,0x6e,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x68,0x61, - 0x73,0x20,0x6d,0x61,0x74,0x63,0x68,0x65,0x64,0x2c,0x20,0x66,0x61,0x6c,0x73,0x65, - 0x20,0x6f,0x74,0x68,0x65,0x72,0x77,0x69,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65, - 0x6e,0x74,0x73,0x2e,0x64,0x6f,0x65,0x73,0x5f,0x6d,0x61,0x74,0x63,0x68,0x28,0x6c, - 0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x73,0x74,0x65,0x70,0x5f,0x69,0x6e,0x74,0x6f,0x20,0x61,0x6e,0x64,0x20,0x63,0x6f, - 0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x5f,0x62,0x72,0x65,0x61,0x6b,0x5f,0x6c,0x69, - 0x6e,0x65,0x20,0x7e,0x3d,0x20,0x6c,0x69,0x6e,0x65,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x74,0x72,0x75,0x65,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74, - 0x68,0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73, - 0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x5b,0x31,0x5d,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x76,0x65, - 0x6e,0x74,0x20,0x3d,0x20,0x77,0x61,0x69,0x74,0x69,0x6e,0x67,0x5f,0x73,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x73,0x5b,0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x76,0x65,0x6e,0x74,0x5f,0x74,0x79,0x70,0x65, - 0x2c,0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d, - 0x20,0x75,0x6e,0x70,0x61,0x63,0x6b,0x28,0x65,0x76,0x65,0x6e,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c, - 0x20,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3d, - 0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74,0x68, - 0x72,0x65,0x61,0x64,0x5d,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x65,0x76,0x65,0x6e,0x74,0x5f,0x74,0x79,0x70, - 0x65,0x20,0x3d,0x3d,0x20,0x22,0x6f,0x76,0x65,0x72,0x22,0x20,0x61,0x6e,0x64,0x20, - 0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3c,0x3d, - 0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x61,0x6e, - 0x64,0x20,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x5f,0x62,0x72,0x65,0x61, - 0x6b,0x5f,0x6c,0x69,0x6e,0x65,0x20,0x7e,0x3d,0x20,0x6c,0x69,0x6e,0x65,0x29,0x20, - 0x6f,0x72,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x74,0x65,0x70,0x20,0x6f,0x76,0x65, - 0x72,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x28,0x65,0x76,0x65,0x6e,0x74,0x5f,0x74,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20, - 0x22,0x6f,0x75,0x74,0x22,0x20,0x20,0x61,0x6e,0x64,0x20,0x63,0x75,0x72,0x72,0x65, - 0x6e,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x20,0x3c,0x20,0x20,0x74,0x61,0x72,0x67, - 0x65,0x74,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x29,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d, - 0x2d,0x20,0x73,0x74,0x65,0x70,0x20,0x6f,0x75,0x74,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x28,0x22, - 0x44,0x45,0x42,0x55,0x47,0x22,0x2c,0x20,0x22,0x45,0x76,0x65,0x6e,0x74,0x20,0x25, - 0x73,0x20,0x6d,0x61,0x74,0x63,0x68,0x65,0x64,0x21,0x22,0x2c,0x20,0x65,0x76,0x65, - 0x6e,0x74,0x5f,0x74,0x79,0x70,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x74,0x72,0x75,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x66,0x61,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x2d,0x20,0x44,0x69,0x73,0x63,0x61,0x72,0x64,0x73,0x20, - 0x65,0x76,0x65,0x6e,0x74,0x20,0x66,0x6f,0x72,0x20,0x63,0x75,0x72,0x72,0x65,0x6e, - 0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x28,0x69,0x66,0x20,0x61,0x6e,0x79, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63, - 0x6f,0x72,0x65,0x2e,0x65,0x76,0x65,0x6e,0x74,0x73,0x2e,0x64,0x69,0x73,0x63,0x61, - 0x72,0x64,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x61,0x69, - 0x74,0x69,0x6e,0x67,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x73,0x5b,0x61,0x63, - 0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72, - 0x6f,0x5b,0x31,0x5d,0x5d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x73,0x74,0x65,0x70,0x5f,0x69,0x6e,0x74,0x6f,0x20,0x3d,0x20, - 0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a, - 0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x0a,0x2d,0x2d,0x20,0x20,0x44,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6d,0x61, - 0x69,0x6e,0x20,0x6c,0x6f,0x6f,0x70,0x0a,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d, - 0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x0a,0x0a,0x2d,0x2d,0x2d,0x20,0x53,0x65,0x6e, - 0x64,0x20,0x74,0x68,0x65,0x20,0x58,0x4d,0x4c,0x20,0x72,0x65,0x73,0x70,0x6f,0x6e, - 0x73,0x65,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x65,0x76,0x69,0x6f, - 0x75,0x73,0x20,0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x20, - 0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x61,0x6e,0x64,0x20,0x63,0x6c,0x65,0x61, - 0x72,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x20,0x63, - 0x6f,0x6e,0x74,0x65,0x78,0x74,0x0a,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x5f,0x63,0x6f, - 0x6e,0x74,0x65,0x78,0x74,0x5f,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x28,0x73, - 0x65,0x6c,0x66,0x2c,0x20,0x72,0x65,0x61,0x73,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x73,0x65,0x6c,0x66,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x5f,0x63, - 0x6f,0x6e,0x74,0x65,0x78,0x74,0x2e,0x73,0x74,0x61,0x74,0x75,0x73,0x20,0x3d,0x20, - 0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x74,0x65,0x0a,0x20,0x20,0x20,0x20,0x73, - 0x65,0x6c,0x66,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x5f,0x63,0x6f,0x6e, - 0x74,0x65,0x78,0x74,0x2e,0x72,0x65,0x61,0x73,0x6f,0x6e,0x20,0x3d,0x20,0x72,0x65, - 0x61,0x73,0x6f,0x6e,0x20,0x6f,0x72,0x20,0x22,0x6f,0x6b,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73, - 0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d, - 0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74, - 0x72,0x20,0x3d,0x20,0x73,0x65,0x6c,0x66,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75, - 0x73,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x7d,0x20,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x5f, - 0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x65,0x6e, - 0x64,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x20,0x63,0x6c,0x65,0x61,0x6e,0x75,0x70,0x28,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x72,0x65,0x73,0x75,0x6d,0x65, - 0x2c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x77,0x72,0x61,0x70, - 0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x73,0x75,0x6d,0x65,0x2c,0x20,0x63,0x6f,0x77, - 0x72,0x61,0x70,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x5f,0x2c,0x20,0x63, - 0x6f,0x72,0x6f,0x20,0x69,0x6e,0x20,0x70,0x61,0x69,0x72,0x73,0x28,0x63,0x6f,0x72, - 0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x29,0x20,0x64,0x6f,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x73,0x65, - 0x74,0x68,0x6f,0x6f,0x6b,0x28,0x63,0x6f,0x72,0x6f,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x6f,0x20,0x72,0x65, - 0x6d,0x6f,0x76,0x65,0x20,0x68,0x6f,0x6f,0x6b,0x20,0x6f,0x6e,0x20,0x74,0x68,0x65, - 0x20,0x6d,0x61,0x69,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2c, - 0x20,0x69,0x74,0x20,0x6d,0x75,0x73,0x74,0x20,0x62,0x65,0x20,0x74,0x68,0x65,0x20, - 0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x20,0x6f,0x6e,0x65,0x20,0x28,0x6f,0x74,0x68, - 0x65,0x72,0x77,0x69,0x73,0x65,0x2c,0x20,0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20, - 0x61,0x20,0x6e,0x6f,0x2d,0x6f,0x70,0x29,0x20,0x61,0x6e,0x64,0x20,0x74,0x68,0x69, - 0x73,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x0a,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x68,0x61,0x76,0x65,0x20,0x74,0x6f,0x20,0x62,0x65,0x20,0x63,0x61,0x6c, - 0x6c,0x65,0x64,0x20,0x61,0x64,0x61,0x69,0x6e,0x20,0x6c,0x61,0x74,0x65,0x72,0x20, - 0x6f,0x6e,0x20,0x74,0x68,0x65,0x20,0x6d,0x61,0x69,0x6e,0x20,0x74,0x68,0x72,0x65, - 0x61,0x64,0x20,0x74,0x6f,0x20,0x66,0x69,0x6e,0x69,0x73,0x68,0x20,0x63,0x6c,0x65, - 0x61,0x75,0x70,0x0a,0x20,0x20,0x20,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x73,0x65, - 0x74,0x68,0x6f,0x6f,0x6b,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65, - 0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f,0x69,0x64,0x2c,0x20,0x63,0x6f,0x72,0x65, - 0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x7b, - 0x20,0x7d,0x2c,0x20,0x7b,0x20,0x7d,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x2d, - 0x20,0x54,0x68,0x69,0x73,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x68, - 0x61,0x6e,0x64,0x6c,0x65,0x73,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20,0x77,0x68,0x69, - 0x6c,0x65,0x20,0x74,0x68,0x65,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e, - 0x20,0x69,0x73,0x20,0x70,0x61,0x75,0x73,0x65,0x64,0x2e,0x20,0x54,0x68,0x69,0x73, - 0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x75,0x73,0x65,0x20,0x63,0x6f, - 0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20,0x62,0x65,0x63,0x61,0x75,0x73,0x65, - 0x20,0x74,0x68,0x65,0x72,0x65,0x20,0x69,0x73,0x20,0x6e,0x6f,0x0a,0x2d,0x2d,0x20, - 0x77,0x61,0x79,0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x6d,0x61,0x69,0x6e,0x20, - 0x63,0x6f,0x72,0x6f,0x20,0x69,0x6e,0x20,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x20, - 0x28,0x6f,0x6e,0x6c,0x79,0x20,0x69,0x6e,0x20,0x35,0x2e,0x32,0x29,0x0a,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x5f,0x6c,0x6f,0x6f,0x70,0x28,0x73,0x65,0x6c,0x66,0x2c, - 0x20,0x61,0x73,0x79,0x6e,0x63,0x5f,0x70,0x61,0x63,0x6b,0x65,0x74,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a,0x73,0x65,0x74,0x74, - 0x69,0x6d,0x65,0x6f,0x75,0x74,0x28,0x6e,0x69,0x6c,0x29,0x20,0x2d,0x2d,0x20,0x73, - 0x65,0x74,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x69, - 0x6e,0x67,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x6e,0x20,0x61,0x73, - 0x79,0x6e,0x63,0x20,0x6d,0x6f,0x64,0x65,0x2c,0x20,0x74,0x68,0x65,0x20,0x64,0x65, - 0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x77,0x61,0x69,0x74,0x20,0x66,0x6f,0x72,0x20,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x62,0x65,0x66,0x6f,0x72,0x65,0x20, - 0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x69,0x6e,0x67,0x20,0x61,0x6e,0x64,0x20,0x64, - 0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x6d,0x6f,0x64,0x69,0x66,0x79,0x20,0x70, - 0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x61,0x73,0x79,0x6e,0x63,0x5f, - 0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x61,0x73,0x79,0x6e,0x63,0x5f,0x70,0x61,0x63, - 0x6b,0x65,0x74,0x20,0x7e,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x73,0x65,0x6c,0x66,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73, - 0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74, - 0x20,0x61,0x73,0x79,0x6e,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74, - 0x61,0x74,0x65,0x20,0x3d,0x20,0x22,0x62,0x72,0x65,0x61,0x6b,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x69, - 0x6f,0x75,0x73,0x5f,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x5f,0x72,0x65,0x73,0x70, - 0x6f,0x6e,0x73,0x65,0x28,0x73,0x65,0x6c,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74,0x61,0x63, - 0x6b,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x2e,0x43,0x6f,0x6e,0x74, - 0x65,0x78,0x74,0x4d,0x61,0x6e,0x61,0x67,0x65,0x72,0x28,0x73,0x65,0x6c,0x66,0x2e, - 0x63,0x6f,0x72,0x6f,0x29,0x20,0x2d,0x2d,0x20,0x77,0x69,0x6c,0x6c,0x20,0x62,0x65, - 0x20,0x75,0x73,0x65,0x64,0x20,0x74,0x6f,0x20,0x6d,0x75,0x74,0x75,0x61,0x6c,0x69, - 0x7a,0x65,0x20,0x63,0x6f,0x6e,0x74,0x65,0x78,0x74,0x20,0x61,0x6c,0x6c,0x6f,0x63, - 0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6f,0x72,0x20,0x65,0x61,0x63,0x68,0x20,0x6c, - 0x6f,0x6f,0x70,0x0a,0x0a,0x20,0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x74, - 0x72,0x75,0x65,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x72,0x65,0x61,0x64,0x73,0x20,0x70,0x61,0x63,0x6b,0x65,0x74,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x70,0x61,0x63, - 0x6b,0x65,0x74,0x20,0x3d,0x20,0x61,0x73,0x79,0x6e,0x63,0x5f,0x70,0x61,0x63,0x6b, - 0x65,0x74,0x20,0x6f,0x72,0x20,0x64,0x62,0x67,0x70,0x2e,0x72,0x65,0x61,0x64,0x5f, - 0x70,0x61,0x63,0x6b,0x65,0x74,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x70,0x61,0x63,0x6b,0x65,0x74,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x28,0x22,0x57,0x41,0x52,0x4e,0x49, - 0x4e,0x47,0x22,0x2c,0x20,0x22,0x6c,0x6f,0x73,0x74,0x20,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x22,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6c,0x65,0x61,0x6e, - 0x75,0x70,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, - 0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x73,0x79,0x6e,0x63,0x5f, - 0x70,0x61,0x63,0x6b,0x65,0x74,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x28,0x22,0x44,0x45,0x42,0x55,0x47,0x22, - 0x2c,0x20,0x70,0x61,0x63,0x6b,0x65,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6d,0x64,0x2c,0x20,0x61,0x72,0x67, - 0x73,0x2c,0x20,0x64,0x61,0x74,0x61,0x20,0x3d,0x20,0x64,0x62,0x67,0x70,0x2e,0x63, - 0x6d,0x64,0x5f,0x70,0x61,0x72,0x73,0x65,0x28,0x70,0x61,0x63,0x6b,0x65,0x74,0x29, - 0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x46,0x49,0x58, - 0x4d,0x45,0x3a,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x73,0x75,0x63,0x68, - 0x20,0x61,0x73,0x20,0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e, - 0x73,0x20,0x73,0x65,0x6e,0x74,0x20,0x69,0x6e,0x20,0x61,0x73,0x79,0x6e,0x63,0x20, - 0x6d,0x6f,0x64,0x65,0x20,0x63,0x6f,0x75,0x6c,0x64,0x20,0x6c,0x65,0x61,0x64,0x20, - 0x62,0x6f,0x74,0x68,0x20,0x65,0x6e,0x67,0x69,0x6e,0x65,0x20,0x61,0x6e,0x64,0x20, - 0x49,0x44,0x45,0x20,0x69,0x6e,0x20,0x69,0x6e,0x63,0x6f,0x6e,0x73,0x69,0x73,0x74, - 0x65,0x6e,0x74,0x20,0x73,0x74,0x61,0x74,0x65,0x20,0x3a,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x61, - 0x6b,0x65,0x20,0x61,0x20,0x62,0x6c,0x61,0x63,0x6b,0x6c,0x69,0x73,0x74,0x2f,0x77, - 0x68,0x69,0x74,0x65,0x6c,0x69,0x73,0x74,0x20,0x6f,0x66,0x20,0x66,0x6f,0x72,0x62, - 0x69,0x64,0x64,0x65,0x6e,0x20,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x6f,0x77,0x65,0x64, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20,0x69,0x6e,0x20,0x61,0x73,0x79, - 0x6e,0x63,0x20,0x3f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x69,0x6e,0x76,0x6f,0x6b,0x65,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75, - 0x6e,0x63,0x20,0x3d,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x5b,0x63,0x6d, - 0x64,0x5d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x66,0x75, - 0x6e,0x63,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6f,0x6b,0x2c,0x20,0x63,0x6f, - 0x6e,0x74,0x20,0x3d,0x20,0x78,0x70,0x63,0x61,0x6c,0x6c,0x28,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x28,0x29,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x75, - 0x6e,0x63,0x28,0x73,0x65,0x6c,0x66,0x2c,0x20,0x61,0x72,0x67,0x73,0x2c,0x20,0x64, - 0x61,0x74,0x61,0x29,0x20,0x65,0x6e,0x64,0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x2e, - 0x74,0x72,0x61,0x63,0x65,0x62,0x61,0x63,0x6b,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x6f,0x6b, - 0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x69,0x6e,0x74,0x65,0x72,0x6e,0x61, - 0x6c,0x20,0x65,0x78,0x63,0x65,0x70,0x74,0x69,0x6f,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61, - 0x6c,0x20,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x73,0x67,0x2c,0x20,0x61,0x74,0x74, - 0x72,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x74,0x79,0x70,0x65,0x28,0x63,0x6f,0x6e,0x74,0x29,0x20, - 0x3d,0x3d,0x20,0x22,0x74,0x61,0x62,0x6c,0x65,0x22,0x20,0x61,0x6e,0x64,0x20,0x67, - 0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x28,0x63,0x6f,0x6e,0x74, - 0x29,0x20,0x3d,0x3d,0x20,0x64,0x62,0x67,0x70,0x2e,0x44,0x42,0x47,0x50,0x5f,0x45, - 0x52,0x52,0x5f,0x4d,0x45,0x54,0x41,0x54,0x41,0x42,0x4c,0x45,0x20,0x74,0x68,0x65, - 0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x73,0x67,0x2c, - 0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6e,0x74,0x2e,0x63,0x6f,0x64, - 0x65,0x2c,0x20,0x63,0x6f,0x6e,0x74,0x2e,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x2c, - 0x20,0x63,0x6f,0x6e,0x74,0x2e,0x61,0x74,0x74,0x72,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x73,0x67,0x2c,0x20,0x61, - 0x74,0x74,0x72,0x20,0x3d,0x20,0x39,0x39,0x38,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72, - 0x69,0x6e,0x67,0x28,0x63,0x6f,0x6e,0x74,0x29,0x2c,0x20,0x7b,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x67,0x28,0x22,0x45,0x52,0x52,0x4f,0x52,0x22,0x2c,0x20, - 0x22,0x43,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x25,0x73,0x20,0x63,0x61,0x75,0x73, - 0x65,0x64,0x3a,0x20,0x28,0x25,0x64,0x29,0x20,0x25,0x73,0x22,0x2c,0x20,0x63,0x6d, - 0x64,0x2c,0x20,0x63,0x6f,0x64,0x65,0x2c,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e, - 0x67,0x28,0x6d,0x73,0x67,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x74,0x74,0x72,0x2e,0x63,0x6f,0x6d, - 0x6d,0x61,0x6e,0x64,0x2c,0x20,0x61,0x74,0x74,0x72,0x2e,0x74,0x72,0x61,0x6e,0x73, - 0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x63,0x6d,0x64,0x2c, - 0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e, - 0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c,0x20, - 0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e,0x73, - 0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x61,0x74,0x74,0x72,0x2c, - 0x20,0x64,0x62,0x67,0x70,0x2e,0x6d,0x61,0x6b,0x65,0x5f,0x65,0x72,0x72,0x6f,0x72, - 0x28,0x63,0x6f,0x64,0x65,0x2c,0x20,0x6d,0x73,0x67,0x29,0x20,0x7d,0x20,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, - 0x69,0x66,0x20,0x63,0x6f,0x6e,0x74,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x65,0x6c, - 0x66,0x2e,0x70,0x72,0x65,0x76,0x69,0x6f,0x75,0x73,0x5f,0x63,0x6f,0x6e,0x74,0x65, - 0x78,0x74,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d, - 0x20,0x63,0x6d,0x64,0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x61,0x63,0x74,0x69,0x6f, - 0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72,0x67,0x73,0x2e,0x69,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x62,0x72,0x65,0x61,0x6b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x63,0x6f,0x6e,0x74,0x20,0x3d,0x3d, - 0x20,0x6e,0x69,0x6c,0x20,0x61,0x6e,0x64,0x20,0x61,0x73,0x79,0x6e,0x63,0x5f,0x6d, - 0x6f,0x64,0x65,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69, - 0x66,0x20,0x63,0x6f,0x6e,0x74,0x20,0x3d,0x3d,0x20,0x66,0x61,0x6c,0x73,0x65,0x20, - 0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d,0x20,0x49,0x6e,0x20,0x63,0x61,0x73,0x65,0x20, - 0x6f,0x66,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20,0x74,0x68,0x61,0x74, - 0x20,0x66,0x75,0x6c,0x6c,0x79,0x20,0x72,0x65,0x73,0x75,0x6d,0x65,0x73,0x20,0x64, - 0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6c,0x6f,0x6f,0x70,0x2c,0x20,0x74,0x68, - 0x65,0x20,0x6d,0x6f,0x64,0x65,0x20,0x69,0x73,0x20,0x73,0x79,0x6e,0x63,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61, - 0x73,0x79,0x6e,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x66,0x61,0x6c,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e, - 0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x67,0x28,0x22, - 0x47,0x6f,0x74,0x20,0x75,0x6e,0x6b,0x6e,0x6f,0x77,0x6e,0x20,0x63,0x6f,0x6d,0x6d, - 0x61,0x6e,0x64,0x3a,0x20,0x22,0x2e,0x2e,0x63,0x6d,0x64,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65, - 0x6e,0x64,0x5f,0x78,0x6d,0x6c,0x28,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x2c, - 0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22,0x72,0x65,0x73,0x70,0x6f,0x6e, - 0x73,0x65,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x20,0x63,0x6f, - 0x6d,0x6d,0x61,0x6e,0x64,0x20,0x3d,0x20,0x63,0x6d,0x64,0x2c,0x20,0x74,0x72,0x61, - 0x6e,0x73,0x61,0x63,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x64,0x20,0x3d,0x20,0x61,0x72, - 0x67,0x73,0x2e,0x69,0x2c,0x20,0x7d,0x2c,0x20,0x64,0x62,0x67,0x70,0x2e,0x6d,0x61, - 0x6b,0x65,0x5f,0x65,0x72,0x72,0x6f,0x72,0x28,0x34,0x29,0x20,0x7d,0x20,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74, - 0x61,0x63,0x6b,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x2d,0x2d,0x20,0x66,0x72,0x65, - 0x65,0x20,0x61,0x6c,0x6c,0x6f,0x63,0x61,0x74,0x65,0x64,0x20,0x63,0x6f,0x6e,0x74, - 0x65,0x78,0x74,0x73,0x0a,0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x74, - 0x61,0x74,0x65,0x20,0x3d,0x20,0x22,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x22,0x0a, - 0x20,0x20,0x20,0x20,0x73,0x65,0x6c,0x66,0x2e,0x73,0x6b,0x74,0x3a,0x73,0x65,0x74, - 0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x28,0x30,0x29,0x20,0x2d,0x2d,0x20,0x72,0x65, - 0x73,0x65,0x74,0x20,0x73,0x6f,0x63,0x6b,0x65,0x74,0x20,0x74,0x6f,0x20,0x61,0x73, - 0x79,0x6e,0x63,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x2d,0x2d,0x20,0x53,0x74,0x61,0x63, - 0x6b,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x20,0x63,0x61,0x6e,0x20,0x62, - 0x65,0x20,0x70,0x72,0x65,0x74,0x74,0x79,0x20,0x63,0x6f,0x6d,0x70,0x6c,0x65,0x78, - 0x20,0x73,0x6f,0x6d,0x65,0x74,0x69,0x6d,0x65,0x73,0x2c,0x20,0x65,0x73,0x70,0x65, - 0x63,0x69,0x61,0x6c,0x6c,0x79,0x20,0x77,0x69,0x74,0x68,0x20,0x4c,0x75,0x61,0x4a, - 0x49,0x54,0x20,0x28,0x61,0x73,0x20,0x74,0x61,0x69,0x6c,0x2d,0x63,0x61,0x6c,0x6c, - 0x20,0x6f,0x70,0x74,0x69,0x6d,0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x20,0x61,0x72, - 0x65,0x0a,0x2d,0x2d,0x20,0x6d,0x6f,0x72,0x65,0x20,0x61,0x67,0x67,0x72,0x65,0x73, - 0x73,0x69,0x76,0x65,0x20,0x61,0x73,0x20,0x73,0x74,0x6f,0x63,0x6b,0x20,0x4c,0x75, - 0x61,0x29,0x2e,0x20,0x53,0x6f,0x20,0x61,0x6c,0x6c,0x20,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x20,0x73,0x74,0x75,0x66,0x66,0x20,0x69,0x73,0x20,0x64,0x6f,0x6e, - 0x65,0x20,0x69,0x6e,0x20,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x63,0x6f,0x72, - 0x6f,0x75,0x74,0x69,0x6e,0x65,0x2c,0x20,0x77,0x68,0x69,0x63,0x68,0x20,0x6c,0x65, - 0x61,0x76,0x65,0x20,0x74,0x68,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x0a, - 0x2d,0x2d,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x69,0x6e,0x20,0x61,0x20,0x63,0x6c, - 0x65,0x61,0x6e,0x20,0x73,0x74,0x61,0x74,0x65,0x20,0x61,0x6e,0x64,0x20,0x61,0x6c, - 0x6c,0x6f,0x77,0x20,0x66,0x61,0x73,0x74,0x65,0x72,0x20,0x61,0x6e,0x64,0x20,0x63, - 0x6c,0x65,0x61,0x72,0x65,0x72,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x6f,0x70,0x65, - 0x72,0x61,0x74,0x69,0x6f,0x6e,0x73,0x20,0x28,0x6e,0x6f,0x20,0x6e,0x65,0x65,0x64, - 0x20,0x74,0x6f,0x20,0x72,0x65,0x6d,0x6f,0x76,0x65,0x20,0x61,0x6c,0x6c,0x20,0x64, - 0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x63,0x61,0x6c,0x6c,0x73,0x0a,0x2d,0x2d, - 0x20,0x66,0x72,0x6f,0x6d,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x66,0x6f,0x72,0x20, - 0x65,0x61,0x63,0x68,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x29,0x2e, - 0x0a,0x2d,0x2d,0x20,0x48,0x6f,0x77,0x65,0x76,0x65,0x72,0x2c,0x20,0x74,0x68,0x69, - 0x73,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x61,0x6c,0x77,0x61,0x79, - 0x73,0x20,0x77,0x6f,0x72,0x6b,0x20,0x77,0x69,0x74,0x68,0x20,0x73,0x74,0x6f,0x63, - 0x6b,0x20,0x4c,0x75,0x61,0x20,0x35,0x2e,0x31,0x20,0x61,0x73,0x20,0x74,0x68,0x65, - 0x20,0x6d,0x61,0x69,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x20, - 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x72,0x65,0x66,0x65,0x72,0x65, - 0x6e,0x63,0x65,0x64,0x0a,0x2d,0x2d,0x20,0x28,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x2e,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x28,0x29,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x6e,0x69,0x6c,0x29,0x2e,0x20,0x46,0x6f,0x72,0x20,0x74,0x68, - 0x69,0x73,0x20,0x70,0x61,0x72,0x74,0x69,0x63,0x75,0x6c,0x61,0x72,0x20,0x63,0x61, - 0x73,0x65,0x2c,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72, - 0x20,0x6c,0x6f,0x6f,0x70,0x20,0x69,0x73,0x20,0x73,0x74,0x61,0x72,0x74,0x65,0x64, - 0x20,0x6f,0x6e,0x20,0x74,0x68,0x65,0x20,0x74,0x6f,0x70,0x20,0x6f,0x66,0x0a,0x2d, - 0x2d,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x73,0x74,0x61,0x63,0x6b,0x20, - 0x61,0x6e,0x64,0x20,0x65,0x76,0x65,0x72,0x79,0x20,0x73,0x74,0x61,0x63,0x6b,0x20, - 0x6f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x20,0x69,0x73,0x20,0x72,0x65,0x6c, - 0x61,0x74,0x69,0x76,0x65,0x20,0x74,0x68,0x65,0x20,0x74,0x68,0x65,0x20,0x68,0x6f, - 0x6f,0x6b,0x20,0x6c,0x65,0x76,0x65,0x6c,0x20,0x28,0x73,0x65,0x65,0x20,0x4d,0x61, - 0x69,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x20,0x69,0x6e,0x20,0x75,0x74,0x69,0x6c, - 0x2e,0x6c,0x75,0x61,0x29,0x2e,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x68,0x6f,0x6f,0x6b,0x28, - 0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b,0x2c,0x20,0x70,0x61,0x63,0x6b,0x65,0x74, - 0x20,0x3d,0x20,0x6e,0x69,0x6c,0x2c,0x20,0x6e,0x69,0x6c,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x5f,0x62, - 0x72,0x65,0x61,0x6b,0x5f,0x6c,0x69,0x6e,0x65,0x20,0x7e,0x3d,0x20,0x6c,0x69,0x6e, - 0x65,0x29,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69, - 0x6e,0x74,0x73,0x2e,0x67,0x75,0x65,0x73,0x73,0x28,0x6c,0x69,0x6e,0x65,0x29,0x20, - 0x7e,0x3d,0x20,0x6e,0x69,0x6c,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e, - 0x66,0x6f,0x20,0x3d,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73, - 0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x3a,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f, - 0x28,0x30,0x2c,0x20,0x22,0x53,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x72,0x69,0x20,0x3d, - 0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x67,0x65,0x74,0x5f,0x75,0x72, - 0x69,0x28,0x69,0x6e,0x66,0x6f,0x2e,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x75,0x72, - 0x69,0x20,0x61,0x6e,0x64,0x20,0x75,0x72,0x69,0x20,0x7e,0x3d,0x20,0x64,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x5f,0x75,0x72,0x69,0x20,0x61,0x6e,0x64,0x20,0x75,0x72, - 0x69,0x20,0x7e,0x3d,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x6d,0x6f, - 0x64,0x75,0x6c,0x65,0x5f,0x75,0x72,0x69,0x20,0x74,0x68,0x65,0x6e,0x20,0x2d,0x2d, - 0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x64,0x6f, - 0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x62,0x72,0x65,0x61,0x6b,0x20,0x69,0x66,0x20, - 0x74,0x68,0x65,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x69,0x73,0x20,0x6e,0x6f, - 0x74,0x20,0x6b,0x6e,0x6f,0x77,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b, - 0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x2e,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69, - 0x6e,0x74,0x73,0x2e,0x61,0x74,0x28,0x75,0x72,0x69,0x2c,0x20,0x6c,0x69,0x6e,0x65, - 0x29,0x20,0x2d,0x2d,0x6f,0x72,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65,0x6e, - 0x74,0x73,0x2e,0x64,0x6f,0x65,0x73,0x5f,0x6d,0x61,0x74,0x63,0x68,0x28,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b,0x20,0x3d, - 0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65,0x6e,0x74,0x73,0x2e,0x64,0x6f,0x65, - 0x73,0x5f,0x6d,0x61,0x74,0x63,0x68,0x28,0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x64,0x6f,0x5f, - 0x62,0x72,0x65,0x61,0x6b,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x5f,0x62,0x72,0x65, - 0x61,0x6b,0x5f,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x6c,0x69,0x6e,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x65,0x76,0x65,0x6e, - 0x74,0x73,0x2e,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x28,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x68,0x65,0x63, - 0x6b,0x20,0x66,0x6f,0x72,0x20,0x61,0x73,0x79,0x6e,0x63,0x20,0x63,0x6f,0x6d,0x6d, - 0x61,0x6e,0x64,0x73,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x64,0x6f,0x5f,0x62,0x72,0x65,0x61,0x6b,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,0x65,0x74,0x20,0x3d,0x20,0x64, - 0x62,0x67,0x70,0x2e,0x72,0x65,0x61,0x64,0x5f,0x70,0x61,0x63,0x6b,0x65,0x74,0x28, - 0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x73, - 0x6b,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x70, - 0x61,0x63,0x6b,0x65,0x74,0x20,0x74,0x68,0x65,0x6e,0x20,0x64,0x6f,0x5f,0x62,0x72, - 0x65,0x61,0x6b,0x20,0x3d,0x20,0x74,0x72,0x75,0x65,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x64,0x6f, - 0x5f,0x62,0x72,0x65,0x61,0x6b,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x70,0x72,0x65,0x76,0x5f,0x62,0x72, - 0x65,0x61,0x6b,0x5f,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x6c,0x69,0x6e,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x75, - 0x63,0x63,0x65,0x73,0x73,0x2c,0x20,0x65,0x72,0x72,0x20,0x3d,0x20,0x70,0x63,0x61, - 0x6c,0x6c,0x28,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x6c,0x6f,0x6f,0x70, - 0x2c,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e, - 0x2c,0x20,0x70,0x61,0x63,0x6b,0x65,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x63,0x63,0x65,0x73,0x73, - 0x20,0x74,0x68,0x65,0x6e,0x20,0x6c,0x6f,0x67,0x28,0x22,0x45,0x52,0x52,0x4f,0x52, - 0x22,0x2c,0x20,0x22,0x45,0x72,0x72,0x6f,0x72,0x20,0x77,0x68,0x69,0x6c,0x65,0x20, - 0x64,0x65,0x62,0x75,0x67,0x20,0x6c,0x6f,0x6f,0x70,0x3a,0x20,0x22,0x2e,0x2e,0x65, - 0x72,0x72,0x29,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x65,0x6e,0x64,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6c,0x69,0x6e,0x65,0x5f, - 0x68,0x6f,0x6f,0x6b,0x5f,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x63,0x6f,0x63,0x72, - 0x65,0x61,0x74,0x65,0x28,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x28,0x6c,0x69, - 0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x74,0x72, - 0x75,0x65,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69, - 0x6e,0x65,0x5f,0x68,0x6f,0x6f,0x6b,0x28,0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x6e,0x65,0x20,0x3d,0x20,0x63,0x6f,0x79, - 0x69,0x65,0x6c,0x64,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65, - 0x6e,0x64,0x29,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x68,0x6f,0x6f, - 0x6b,0x28,0x65,0x76,0x65,0x6e,0x74,0x2c,0x20,0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, - 0x3d,0x20,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x28,0x29,0x20,0x6f,0x72, - 0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x65, - 0x76,0x65,0x6e,0x74,0x20,0x3d,0x3d,0x20,0x22,0x63,0x61,0x6c,0x6c,0x22,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x63, - 0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74,0x68,0x72,0x65,0x61,0x64,0x5d, - 0x20,0x3d,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b, - 0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x2b,0x20,0x31,0x0a,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x3d,0x3d,0x20, - 0x22,0x74,0x61,0x69,0x6c,0x20,0x63,0x61,0x6c,0x6c,0x22,0x20,0x74,0x68,0x65,0x6e, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x61,0x69,0x6c, - 0x20,0x63,0x61,0x6c,0x6c,0x73,0x20,0x68,0x61,0x73,0x20,0x6e,0x6f,0x20,0x65,0x66, - 0x66,0x65,0x63,0x74,0x73,0x20,0x6f,0x6e,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x68, - 0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x3a,0x20,0x69,0x74,0x20,0x69,0x73,0x20,0x6f, - 0x6e,0x6c,0x79,0x20,0x75,0x73,0x65,0x64,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x66,0x6f, - 0x72,0x20,0x73,0x74,0x65,0x70,0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x73,0x20, - 0x62,0x75,0x74,0x20,0x61,0x20,0x73,0x75,0x63,0x68,0x20,0x65,0x76,0x65,0x6e,0x20, - 0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x69,0x6e,0x74,0x65,0x72,0x66,0x65,0x72,0x65,0x20,0x77,0x69, - 0x74,0x68,0x20,0x61,0x6e,0x79,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x6d,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20, - 0x3d,0x3d,0x20,0x22,0x72,0x65,0x74,0x75,0x72,0x6e,0x22,0x20,0x6f,0x72,0x20,0x65, - 0x76,0x65,0x6e,0x74,0x20,0x3d,0x3d,0x20,0x22,0x74,0x61,0x69,0x6c,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b, - 0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x3d,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f, - 0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x2d, - 0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x20,0x2d,0x2d,0x20,0x6c, - 0x69,0x6e,0x65,0x20,0x65,0x76,0x65,0x6e,0x74,0x3a,0x20,0x63,0x68,0x65,0x63,0x6b, - 0x20,0x66,0x6f,0x72,0x20,0x62,0x72,0x65,0x61,0x6b,0x70,0x6f,0x69,0x6e,0x74,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73, - 0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x75,0x74, - 0x69,0x6c,0x2e,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65,0x61,0x64, - 0x28,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x28,0x29,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f, - 0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x5b,0x31,0x5d,0x20, - 0x3d,0x3d,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x6e,0x65,0x5f, - 0x68,0x6f,0x6f,0x6b,0x28,0x6c,0x69,0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x72,0x75,0x6e,0x20,0x74,0x68,0x65,0x20,0x64, - 0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6c,0x6f,0x6f,0x70,0x20,0x69,0x6e,0x20, - 0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x6f, - 0x6e,0x20,0x74,0x68,0x65,0x20,0x6f,0x74,0x68,0x65,0x72,0x20,0x63,0x61,0x73,0x65, - 0x73,0x20,0x28,0x73,0x69,0x6d,0x70,0x6c,0x69,0x66,0x69,0x65,0x73,0x20,0x73,0x74, - 0x61,0x63,0x6b,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x73,0x73,0x65,0x72,0x74, - 0x28,0x63,0x6f,0x72,0x65,0x73,0x75,0x6d,0x65,0x28,0x6c,0x69,0x6e,0x65,0x5f,0x68, - 0x6f,0x6f,0x6b,0x5f,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c,0x69,0x6e,0x65,0x29,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73, - 0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x69,0x66,0x20,0x72, - 0x61,0x77,0x67,0x65,0x74,0x28,0x5f,0x47,0x2c,0x20,0x22,0x6a,0x69,0x74,0x22,0x29, - 0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x64,0x65,0x62,0x75,0x67,0x67, - 0x65,0x72,0x5f,0x68,0x6f,0x6f,0x6b,0x20,0x3d,0x20,0x66,0x75,0x6e,0x63,0x74,0x69, - 0x6f,0x6e,0x28,0x65,0x76,0x65,0x6e,0x74,0x2c,0x20,0x6c,0x69,0x6e,0x65,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67, - 0x28,0x29,0x20,0x6f,0x72,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x3d,0x3d, - 0x20,0x22,0x63,0x61,0x6c,0x6c,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x64,0x65,0x62,0x75, - 0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x32,0x2c,0x20,0x22,0x53,0x22, - 0x29,0x2e,0x77,0x68,0x61,0x74,0x20,0x3d,0x3d,0x20,0x22,0x43,0x22,0x20,0x74,0x68, - 0x65,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f, - 0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x3d, - 0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x74,0x68, - 0x72,0x65,0x61,0x64,0x5d,0x20,0x2b,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x3d, - 0x3d,0x20,0x22,0x72,0x65,0x74,0x75,0x72,0x6e,0x22,0x20,0x6f,0x72,0x20,0x65,0x76, - 0x65,0x6e,0x74,0x20,0x3d,0x3d,0x20,0x22,0x74,0x61,0x69,0x6c,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x52,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x68,0x6f,0x6f,0x6b,0x73,0x20,0x61,0x72,0x65,0x20,0x6e,0x6f,0x74,0x20,0x63,0x61, - 0x6c,0x6c,0x65,0x64,0x20,0x66,0x6f,0x72,0x20,0x74,0x61,0x69,0x6c,0x20,0x63,0x61, - 0x6c,0x6c,0x73,0x20,0x69,0x6e,0x20,0x4a,0x49,0x54,0x20,0x28,0x62,0x75,0x74,0x20, - 0x75,0x6e,0x6c,0x69,0x6b,0x65,0x20,0x35,0x2e,0x32,0x20,0x74,0x68,0x65,0x72,0x65, - 0x20,0x69,0x73,0x20,0x6e,0x6f,0x20,0x77,0x61,0x79,0x20,0x74,0x6f,0x20,0x6b,0x6e, - 0x6f,0x77,0x20,0x77,0x68,0x65,0x74,0x68,0x65,0x72,0x20,0x61,0x20,0x63,0x61,0x6c, - 0x6c,0x20,0x69,0x73,0x20,0x74,0x61,0x69,0x6c,0x20,0x6f,0x72,0x20,0x6e,0x6f,0x74, - 0x29,0x2e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d, - 0x2d,0x20,0x53,0x6f,0x20,0x74,0x68,0x65,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x72,0x65, - 0x6c,0x69,0x61,0x62,0x6c,0x65,0x20,0x77,0x61,0x79,0x20,0x74,0x6f,0x20,0x6b,0x6e, - 0x6f,0x77,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x69, - 0x73,0x20,0x74,0x6f,0x20,0x77,0x61,0x6c,0x6b,0x20,0x69,0x74,0x2e,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x32,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x54,0x4f,0x44,0x4f,0x3a,0x20,0x66, - 0x69,0x6e,0x64,0x20,0x74,0x68,0x65,0x20,0x66,0x61,0x73,0x74,0x65,0x73,0x74,0x20, - 0x77,0x61,0x79,0x20,0x74,0x6f,0x20,0x63,0x61,0x6c,0x6c,0x20,0x67,0x65,0x74,0x69, - 0x6e,0x66,0x6f,0x20,0x28,0x27,0x77,0x68,0x61,0x74,0x27,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x65,0x74,0x65,0x72,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x67, - 0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x64,0x65,0x70,0x74,0x68,0x2c,0x20,0x22,0x66, - 0x22,0x29,0x20,0x64,0x6f,0x20,0x64,0x65,0x70,0x74,0x68,0x20,0x3d,0x20,0x64,0x65, - 0x70,0x74,0x68,0x20,0x2b,0x20,0x31,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65, - 0x76,0x65,0x6c,0x73,0x5b,0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x3d,0x20,0x64, - 0x65,0x70,0x74,0x68,0x20,0x2d,0x20,0x32,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x69,0x66,0x20,0x65,0x76,0x65,0x6e,0x74,0x20,0x3d,0x3d, - 0x20,0x22,0x6c,0x69,0x6e,0x65,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f, - 0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x75, - 0x74,0x69,0x6c,0x2e,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x54,0x68,0x72,0x65,0x61, - 0x64,0x28,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x28,0x29,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x61,0x63, - 0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x2e,0x63,0x6f,0x72, - 0x6f,0x5b,0x31,0x5d,0x20,0x3d,0x3d,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x20,0x74, - 0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x6c,0x69,0x6e,0x65,0x5f,0x68,0x6f,0x6f,0x6b,0x28,0x6c,0x69, - 0x6e,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x72,0x75,0x6e,0x20,0x74,0x68,0x65,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x20,0x6c,0x6f,0x6f,0x70,0x20,0x69,0x6e, - 0x20,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, - 0x6f,0x6e,0x20,0x74,0x68,0x65,0x20,0x6f,0x74,0x68,0x65,0x72,0x20,0x63,0x61,0x73, - 0x65,0x73,0x20,0x28,0x73,0x69,0x6d,0x70,0x6c,0x69,0x66,0x69,0x65,0x73,0x20,0x73, - 0x74,0x61,0x63,0x6b,0x20,0x68,0x61,0x6e,0x64,0x6c,0x69,0x6e,0x67,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61, - 0x73,0x73,0x65,0x72,0x74,0x28,0x63,0x6f,0x72,0x65,0x73,0x75,0x6d,0x65,0x28,0x6c, - 0x69,0x6e,0x65,0x5f,0x68,0x6f,0x6f,0x6b,0x5f,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x6c, - 0x69,0x6e,0x65,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e, - 0x2e,0x63,0x6f,0x72,0x6f,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x65,0x6e,0x64,0x0a,0x0a,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74, - 0x69,0x6f,0x6e,0x20,0x69,0x6e,0x69,0x74,0x28,0x68,0x6f,0x73,0x74,0x2c,0x20,0x70, - 0x6f,0x72,0x74,0x2c,0x20,0x69,0x64,0x65,0x6b,0x65,0x79,0x2c,0x20,0x74,0x72,0x61, - 0x6e,0x73,0x70,0x6f,0x72,0x74,0x2c,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f, - 0x6e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2c,0x20,0x77,0x6f,0x72,0x6b,0x69, - 0x6e,0x67,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x2c,0x20,0x73,0x65,0x61, - 0x72,0x63,0x68,0x70,0x61,0x74,0x68,0x73,0x29,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d, - 0x20,0x67,0x65,0x74,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20, - 0x64,0x61,0x74,0x61,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x68, - 0x6f,0x73,0x74,0x20,0x3d,0x20,0x68,0x6f,0x73,0x74,0x20,0x6f,0x72,0x20,0x6f,0x73, - 0x2e,0x67,0x65,0x74,0x65,0x6e,0x76,0x20,0x22,0x44,0x42,0x47,0x50,0x5f,0x49,0x44, - 0x45,0x48,0x4f,0x53,0x54,0x22,0x20,0x6f,0x72,0x20,0x22,0x31,0x32,0x37,0x2e,0x30, - 0x2e,0x30,0x2e,0x31,0x22,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x70,0x6f,0x72,0x74,0x20,0x3d,0x20,0x70,0x6f,0x72,0x74,0x20,0x6f,0x72,0x20,0x6f, - 0x73,0x2e,0x67,0x65,0x74,0x65,0x6e,0x76,0x20,0x22,0x44,0x42,0x47,0x50,0x5f,0x49, - 0x44,0x45,0x50,0x4f,0x52,0x54,0x22,0x20,0x6f,0x72,0x20,0x22,0x31,0x30,0x30,0x30, - 0x30,0x22,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x64,0x65, - 0x6b,0x65,0x79,0x20,0x3d,0x20,0x69,0x64,0x65,0x6b,0x65,0x79,0x20,0x6f,0x72,0x20, - 0x6f,0x73,0x2e,0x67,0x65,0x74,0x65,0x6e,0x76,0x28,0x22,0x44,0x42,0x47,0x50,0x5f, - 0x49,0x44,0x45,0x4b,0x45,0x59,0x22,0x29,0x20,0x6f,0x72,0x20,0x22,0x6c,0x75,0x61, - 0x69,0x64,0x65,0x6b,0x65,0x79,0x22,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20, - 0x69,0x6e,0x69,0x74,0x20,0x70,0x6c,0x61,0x66,0x6f,0x72,0x6d,0x20,0x6d,0x6f,0x64, - 0x75,0x6c,0x65,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x65,0x78, - 0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x20, - 0x3d,0x20,0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66, - 0x6f,0x72,0x6d,0x20,0x6f,0x72,0x20,0x6f,0x73,0x2e,0x67,0x65,0x74,0x65,0x6e,0x76, - 0x28,0x22,0x44,0x42,0x47,0x50,0x5f,0x50,0x4c,0x41,0x54,0x46,0x4f,0x52,0x4d,0x22, - 0x29,0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63, - 0x61,0x6c,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x64,0x69,0x72,0x65,0x63,0x74, - 0x6f,0x72,0x79,0x20,0x3d,0x20,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x64,0x69,0x72, - 0x65,0x63,0x74,0x6f,0x72,0x79,0x20,0x6f,0x72,0x20,0x6f,0x73,0x2e,0x67,0x65,0x74, - 0x65,0x6e,0x76,0x28,0x22,0x44,0x42,0x47,0x50,0x5f,0x57,0x4f,0x52,0x4b,0x49,0x4e, - 0x47,0x44,0x49,0x52,0x22,0x29,0x20,0x6f,0x72,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20, - 0x20,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x69,0x6e,0x69,0x74,0x28, - 0x65,0x78,0x65,0x63,0x75,0x74,0x69,0x6f,0x6e,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72, - 0x6d,0x2c,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,0x64,0x69,0x72,0x65,0x63,0x74,0x6f, - 0x72,0x79,0x2c,0x73,0x65,0x61,0x72,0x63,0x68,0x70,0x61,0x74,0x68,0x73,0x29,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x74,0x72,0x61,0x6e, - 0x73,0x70,0x6f,0x72,0x74,0x20,0x6c,0x61,0x79,0x65,0x72,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x70, - 0x61,0x74,0x68,0x20,0x3d,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x20, - 0x6f,0x72,0x20,0x6f,0x73,0x2e,0x67,0x65,0x74,0x65,0x6e,0x76,0x28,0x22,0x44,0x42, - 0x47,0x50,0x5f,0x54,0x52,0x41,0x4e,0x53,0x50,0x4f,0x52,0x54,0x22,0x29,0x20,0x6f, - 0x72,0x20,0x22,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x2e,0x74,0x72,0x61,0x6e, - 0x73,0x70,0x6f,0x72,0x74,0x2e,0x6c,0x75,0x61,0x73,0x6f,0x63,0x6b,0x65,0x74,0x22, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x74,0x72,0x61,0x6e,0x73, - 0x70,0x6f,0x72,0x74,0x20,0x3d,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x28,0x74, - 0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x70,0x61,0x74,0x68,0x29,0x0a,0x0a,0x20, - 0x20,0x20,0x20,0x2d,0x2d,0x20,0x69,0x6e,0x73,0x74,0x61,0x6c,0x6c,0x20,0x62,0x61, - 0x73,0x65,0x36,0x34,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x69, - 0x6e,0x74,0x6f,0x20,0x75,0x74,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x75,0x74,0x69, - 0x6c,0x2e,0x62,0x36,0x34,0x2c,0x20,0x75,0x74,0x69,0x6c,0x2e,0x72,0x61,0x77,0x62, - 0x36,0x34,0x2c,0x20,0x75,0x74,0x69,0x6c,0x2e,0x75,0x6e,0x62,0x36,0x34,0x20,0x3d, - 0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x62,0x36,0x34,0x2c,0x20, - 0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x72,0x61,0x77,0x62,0x36,0x34, - 0x2c,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x75,0x6e,0x62,0x36, - 0x34,0x0a,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x6b,0x74, - 0x20,0x3d,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x74,0x72,0x61,0x6e,0x73,0x70, - 0x6f,0x72,0x74,0x2e,0x63,0x72,0x65,0x61,0x74,0x65,0x28,0x29,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x73,0x6b,0x74,0x3a,0x73,0x65,0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74, - 0x28,0x6e,0x69,0x6c,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x72, - 0x79,0x20,0x74,0x6f,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x20,0x73,0x65,0x76, - 0x65,0x72,0x61,0x6c,0x20,0x74,0x69,0x6d,0x65,0x73,0x3a,0x20,0x69,0x66,0x20,0x49, - 0x44,0x45,0x20,0x6c,0x61,0x75,0x6e,0x63,0x68,0x65,0x73,0x20,0x62,0x6f,0x74,0x68, - 0x20,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x20,0x61,0x6e,0x64,0x20,0x73,0x65,0x72, - 0x76,0x65,0x72,0x20,0x61,0x74,0x20,0x73,0x61,0x6d,0x65,0x20,0x74,0x69,0x6d,0x65, - 0x2c,0x20,0x66,0x69,0x72,0x73,0x74,0x20,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x20, - 0x61,0x74,0x74,0x65,0x6d,0x70,0x74,0x73,0x20,0x6d,0x61,0x79,0x20,0x66,0x61,0x69, - 0x6c,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x6f,0x6b,0x2c,0x20, - 0x65,0x72,0x72,0x0a,0x20,0x20,0x20,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x73,0x74, - 0x72,0x69,0x6e,0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28,0x22,0x44,0x65,0x62, - 0x75,0x67,0x67,0x65,0x72,0x20,0x76,0x25,0x73,0x22,0x2c,0x20,0x44,0x42,0x47,0x50, - 0x5f,0x43,0x4c,0x49,0x45,0x4e,0x54,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x29, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x73,0x74,0x72,0x69, - 0x6e,0x67,0x2e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x28,0x22,0x44,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x3a,0x20,0x54,0x72,0x79,0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x63, - 0x6f,0x6e,0x6e,0x65,0x63,0x74,0x20,0x74,0x6f,0x20,0x25,0x73,0x3a,0x25,0x73,0x20, - 0x2e,0x2e,0x2e,0x20,0x22,0x2c,0x20,0x68,0x6f,0x73,0x74,0x2c,0x20,0x70,0x6f,0x72, - 0x74,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x6f,0x6b,0x2c,0x20,0x65,0x72,0x72,0x20, - 0x3d,0x20,0x73,0x6b,0x74,0x3a,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x28,0x68,0x6f, - 0x73,0x74,0x2c,0x20,0x70,0x6f,0x72,0x74,0x29,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f, - 0x72,0x20,0x69,0x3d,0x31,0x2c,0x20,0x34,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6f,0x6b,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x22, - 0x44,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x3a,0x20,0x43,0x6f,0x6e,0x6e,0x65,0x63, - 0x74,0x69,0x6f,0x6e,0x20,0x73,0x75,0x63,0x63,0x65,0x65,0x64,0x2e,0x22,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x77,0x61,0x69,0x74,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f, - 0x72,0x74,0x2e,0x73,0x6c,0x65,0x65,0x70,0x28,0x30,0x2e,0x35,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x74,0x68,0x65,0x6e,0x20, - 0x72,0x65,0x74,0x72,0x79,0x2e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x66,0x6f, - 0x72,0x6d,0x61,0x74,0x28,0x22,0x44,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x3a,0x20, - 0x52,0x65,0x74,0x72,0x79,0x69,0x6e,0x67,0x20,0x74,0x6f,0x20,0x63,0x6f,0x6e,0x6e, - 0x65,0x63,0x74,0x20,0x74,0x6f,0x20,0x25,0x73,0x3a,0x25,0x73,0x20,0x2e,0x2e,0x2e, - 0x20,0x22,0x2c,0x20,0x68,0x6f,0x73,0x74,0x2c,0x20,0x70,0x6f,0x72,0x74,0x29,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x6b,0x2c,0x20,0x65, - 0x72,0x72,0x20,0x3d,0x20,0x73,0x6b,0x74,0x3a,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74, - 0x28,0x68,0x6f,0x73,0x74,0x2c,0x20,0x70,0x6f,0x72,0x74,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x65,0x72,0x72,0x20,0x74,0x68,0x65,0x6e, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x73,0x74,0x72,0x69,0x6e,0x67,0x2e,0x66,0x6f, - 0x72,0x6d,0x61,0x74,0x28,0x22,0x43,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6f,0x6e, - 0x6e,0x65,0x63,0x74,0x20,0x74,0x6f,0x20,0x25,0x73,0x3a,0x25,0x64,0x20,0x3a,0x20, - 0x25,0x73,0x22,0x2c,0x20,0x68,0x6f,0x73,0x74,0x2c,0x20,0x70,0x6f,0x72,0x74,0x2c, - 0x20,0x65,0x72,0x72,0x29,0x29,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x74,0x68,0x65,0x20,0x64,0x65,0x62,0x75,0x67, - 0x67,0x65,0x72,0x20,0x61,0x6e,0x64,0x20,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72, - 0x74,0x20,0x6c,0x61,0x79,0x65,0x72,0x20,0x55,0x52,0x49,0x0a,0x20,0x20,0x20,0x20, - 0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x75,0x72,0x69,0x20,0x3d,0x20,0x70, - 0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x67,0x65,0x74,0x5f,0x75,0x72,0x69,0x28, - 0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x31,0x29, - 0x2e,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x74,0x72,0x61, - 0x6e,0x73,0x70,0x6f,0x72,0x74,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x5f,0x75,0x72,0x69, - 0x20,0x3d,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x67,0x65,0x74,0x5f, - 0x75,0x72,0x69,0x28,0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66, - 0x6f,0x28,0x74,0x72,0x61,0x6e,0x73,0x70,0x6f,0x72,0x74,0x2e,0x63,0x72,0x65,0x61, - 0x74,0x65,0x29,0x2e,0x73,0x6f,0x75,0x72,0x63,0x65,0x29,0x0a,0x0a,0x20,0x20,0x20, - 0x20,0x2d,0x2d,0x20,0x67,0x65,0x74,0x20,0x74,0x68,0x65,0x20,0x72,0x6f,0x6f,0x74, - 0x20,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x70,0x61,0x74,0x68,0x20,0x28,0x74,0x68, - 0x65,0x20,0x68,0x69,0x67,0x68,0x65,0x73,0x74,0x20,0x70,0x6f,0x73,0x73,0x69,0x62, - 0x6c,0x65,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x69,0x6e,0x64,0x65,0x78,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x6f,0x75,0x72,0x63,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x69,0x3d,0x32,0x2c,0x20,0x6d,0x61, - 0x74,0x68,0x2e,0x68,0x75,0x67,0x65,0x20,0x64,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x69,0x6e,0x66,0x6f,0x20,0x3d,0x20, - 0x64,0x65,0x62,0x75,0x67,0x2e,0x67,0x65,0x74,0x69,0x6e,0x66,0x6f,0x28,0x69,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x69,0x6e,0x66,0x6f,0x20,0x74,0x68,0x65,0x6e,0x20,0x62,0x72,0x65,0x61,0x6b,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x6f,0x75,0x72, - 0x63,0x65,0x20,0x3d,0x20,0x70,0x6c,0x61,0x74,0x66,0x6f,0x72,0x6d,0x2e,0x67,0x65, - 0x74,0x5f,0x75,0x72,0x69,0x28,0x69,0x6e,0x66,0x6f,0x2e,0x73,0x6f,0x75,0x72,0x63, - 0x65,0x29,0x20,0x6f,0x72,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20, - 0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x74,0x68,0x65,0x6e,0x20,0x73,0x6f,0x75,0x72, - 0x63,0x65,0x20,0x3d,0x20,0x22,0x75,0x6e,0x6b,0x6e,0x6f,0x77,0x6e,0x3a,0x2f,0x22, - 0x20,0x65,0x6e,0x64,0x20,0x2d,0x2d,0x20,0x77,0x68,0x65,0x6e,0x20,0x6c,0x6f,0x61, - 0x64,0x65,0x64,0x20,0x62,0x65,0x66,0x6f,0x72,0x65,0x20,0x61,0x63,0x74,0x75,0x61, - 0x6c,0x20,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x28,0x77,0x69,0x74,0x68,0x20,0x61, - 0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x20,0x6c,0x69,0x6e,0x65,0x20,0x73,0x77, - 0x69,0x74,0x63,0x68,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x67,0x65, - 0x6e,0x65,0x72,0x61,0x74,0x65,0x20,0x73,0x6f,0x6d,0x65,0x20,0x6b,0x69,0x6e,0x64, - 0x20,0x6f,0x66,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x69,0x64,0x65,0x6e,0x74, - 0x69,0x66,0x69,0x65,0x72,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20, - 0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x3d,0x20,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69, - 0x6e,0x67,0x28,0x29,0x20,0x6f,0x72,0x20,0x22,0x6d,0x61,0x69,0x6e,0x22,0x0a,0x20, - 0x20,0x20,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b, - 0x74,0x68,0x72,0x65,0x61,0x64,0x5d,0x20,0x3d,0x20,0x31,0x20,0x2d,0x2d,0x20,0x74, - 0x68,0x65,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x76,0x65,0x6e,0x74,0x20, - 0x77,0x69,0x6c,0x6c,0x20,0x73,0x65,0x74,0x20,0x74,0x68,0x65,0x20,0x63,0x6f,0x75, - 0x6e,0x74,0x65,0x72,0x20,0x74,0x6f,0x20,0x30,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f, - 0x63,0x61,0x6c,0x20,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x69,0x64,0x20,0x3d,0x20, - 0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x6f,0x73,0x2e,0x74,0x69,0x6d,0x65, - 0x28,0x29,0x29,0x20,0x2e,0x2e,0x20,0x22,0x5f,0x22,0x20,0x2e,0x2e,0x20,0x74,0x6f, - 0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x29,0x0a,0x0a, - 0x20,0x20,0x20,0x20,0x64,0x62,0x67,0x70,0x2e,0x73,0x65,0x6e,0x64,0x5f,0x78,0x6d, - 0x6c,0x28,0x73,0x6b,0x74,0x2c,0x20,0x7b,0x20,0x74,0x61,0x67,0x20,0x3d,0x20,0x22, - 0x69,0x6e,0x69,0x74,0x22,0x2c,0x20,0x61,0x74,0x74,0x72,0x20,0x3d,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x70,0x70,0x69,0x64,0x20,0x3d,0x20, - 0x22,0x4c,0x75,0x61,0x20,0x44,0x42,0x47,0x70,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x69,0x64,0x65,0x6b,0x65,0x79,0x20,0x3d,0x20,0x69,0x64,0x65, - 0x6b,0x65,0x79,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x65,0x73, - 0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x69,0x64, - 0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64, - 0x20,0x3d,0x20,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x28,0x74,0x68,0x72,0x65, - 0x61,0x64,0x29,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x61,0x72, - 0x65,0x6e,0x74,0x20,0x3d,0x20,0x22,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x20,0x3d,0x20,0x22,0x4c,0x75, - 0x61,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x74, - 0x6f,0x63,0x6f,0x6c,0x5f,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x22, - 0x31,0x2e,0x30,0x22,0x2c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69, - 0x6c,0x65,0x75,0x72,0x69,0x20,0x3d,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x20,0x7d,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x46, - 0x49,0x58,0x4d,0x45,0x20,0x75,0x74,0x69,0x6c,0x2e,0x43,0x75,0x72,0x72,0x65,0x6e, - 0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x28,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e, - 0x67,0x29,0x20,0x3d,0x3e,0x20,0x75,0x74,0x69,0x6c,0x2e,0x43,0x75,0x72,0x72,0x65, - 0x6e,0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x28,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69, - 0x6e,0x67,0x28,0x29,0x29,0x20,0x57,0x48,0x41,0x54,0x20,0x44,0x4f,0x45,0x53,0x20, - 0x49,0x54,0x20,0x46,0x49,0x58,0x45,0x53,0x20,0x3f,0x3f,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x73,0x65,0x73,0x73,0x20,0x3d,0x20,0x7b,0x20,0x73, - 0x6b,0x74,0x20,0x3d,0x20,0x73,0x6b,0x74,0x2c,0x20,0x73,0x74,0x61,0x74,0x65,0x20, - 0x3d,0x20,0x22,0x73,0x74,0x61,0x72,0x74,0x69,0x6e,0x67,0x22,0x2c,0x20,0x69,0x64, - 0x20,0x3d,0x20,0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x69,0x64,0x2c,0x20,0x63,0x6f, - 0x72,0x6f,0x20,0x3d,0x20,0x75,0x74,0x69,0x6c,0x2e,0x43,0x75,0x72,0x72,0x65,0x6e, - 0x74,0x54,0x68,0x72,0x65,0x61,0x64,0x28,0x63,0x6f,0x72,0x75,0x6e,0x6e,0x69,0x6e, - 0x67,0x29,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x5f, - 0x73,0x65,0x73,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x65,0x73,0x73,0x0a,0x20, - 0x20,0x20,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x6c,0x6f,0x6f,0x70, - 0x28,0x73,0x65,0x73,0x73,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73, - 0x65,0x74,0x20,0x64,0x65,0x62,0x75,0x67,0x20,0x68,0x6f,0x6f,0x6b,0x73,0x0a,0x20, - 0x20,0x20,0x20,0x64,0x65,0x62,0x75,0x67,0x2e,0x73,0x65,0x74,0x68,0x6f,0x6f,0x6b, - 0x28,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x68,0x6f,0x6f,0x6b,0x2c,0x20, - 0x22,0x72,0x6c,0x63,0x22,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x69, - 0x6e,0x73,0x74,0x61,0x6c,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x20,0x63,0x6f,0x6c,0x6c,0x65,0x63,0x74,0x69,0x6e,0x67,0x20,0x66,0x75,0x6e,0x63, - 0x74,0x69,0x6f,0x6e,0x73,0x2e,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x54,0x4f, - 0x44,0x4f,0x3a,0x20,0x6d,0x61,0x69,0x6e,0x74,0x61,0x69,0x6e,0x20,0x61,0x20,0x6c, - 0x69,0x73,0x74,0x20,0x6f,0x66,0x20,0x2a,0x61,0x6c,0x6c,0x2a,0x20,0x63,0x6f,0x72, - 0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x6f, - 0x76,0x65,0x72,0x6b,0x69,0x6c,0x6c,0x20,0x28,0x66,0x6f,0x72,0x20,0x65,0x78,0x61, - 0x6d,0x70,0x6c,0x65,0x2c,0x20,0x74,0x68,0x65,0x20,0x6f,0x6e,0x65,0x73,0x20,0x63, - 0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x63,0x6f,0x70,0x63,0x61,0x6c, - 0x6c,0x29,0x2c,0x20,0x6d,0x61,0x6b,0x65,0x20,0x61,0x20,0x65,0x78,0x74,0x65,0x6e, - 0x73,0x69,0x6f,0x6e,0x20,0x70,0x6f,0x69,0x6e,0x74,0x20,0x74,0x6f,0x0a,0x20,0x20, - 0x20,0x20,0x2d,0x2d,0x20,0x63,0x75,0x73,0x74,0x6f,0x6d,0x69,0x7a,0x65,0x20,0x64, - 0x65,0x62,0x75,0x67,0x67,0x65,0x64,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e, - 0x65,0x73,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74, - 0x69,0x6e,0x65,0x73,0x20,0x61,0x72,0x65,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e, - 0x63,0x65,0x64,0x20,0x64,0x75,0x72,0x69,0x6e,0x67,0x20,0x74,0x68,0x65,0x69,0x72, - 0x20,0x66,0x69,0x72,0x73,0x74,0x20,0x72,0x65,0x73,0x75,0x6d,0x65,0x20,0x28,0x73, - 0x6f,0x20,0x77,0x65,0x20,0x61,0x72,0x65,0x20,0x73,0x75,0x72,0x65,0x20,0x74,0x68, - 0x61,0x74,0x20,0x74,0x68,0x65,0x79,0x20,0x61,0x6c,0x77,0x61,0x79,0x73,0x20,0x68, - 0x61,0x76,0x65,0x20,0x61,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,0x66,0x72,0x61,0x6d, - 0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x72,0x65,0x73,0x75,0x6d,0x65,0x5f,0x68,0x61,0x6e, - 0x64,0x6c,0x65,0x72,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x63,0x6f,0x73,0x74,0x61, - 0x74,0x75,0x73,0x28,0x63,0x6f,0x72,0x6f,0x29,0x20,0x3d,0x3d,0x20,0x22,0x64,0x65, - 0x61,0x64,0x22,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f,0x72,0x6f,0x5f, - 0x69,0x64,0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65, - 0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d, - 0x5f,0x63,0x6f,0x72,0x6f,0x5b,0x63,0x6f,0x72,0x6f,0x5d,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74, - 0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x66, - 0x72,0x6f,0x6d,0x5f,0x69,0x64,0x5b,0x63,0x6f,0x72,0x6f,0x5f,0x69,0x64,0x5d,0x20, - 0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f, - 0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x6f, - 0x72,0x6f,0x5b,0x63,0x6f,0x72,0x6f,0x5d,0x20,0x3d,0x20,0x6e,0x69,0x6c,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x63,0x6b, - 0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x63,0x6f,0x72,0x6f,0x5d,0x20,0x3d,0x20, - 0x6e,0x69,0x6c,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x2e, - 0x2e,0x2e,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69, - 0x6e,0x65,0x2e,0x72,0x65,0x73,0x75,0x6d,0x65,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20, - 0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x6e,0x6f,0x74,0x20,0x73,0x74,0x61,0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73, - 0x5b,0x63,0x6f,0x72,0x6f,0x5d,0x20,0x74,0x68,0x65,0x6e,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x66,0x69,0x72,0x73,0x74, - 0x20,0x74,0x69,0x6d,0x65,0x20,0x72,0x65,0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x64, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x61, - 0x63,0x6b,0x5f,0x6c,0x65,0x76,0x65,0x6c,0x73,0x5b,0x63,0x6f,0x72,0x6f,0x5d,0x20, - 0x3d,0x20,0x30,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f, - 0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x6e,0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x2e, - 0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65, - 0x73,0x2e,0x6e,0x20,0x2b,0x20,0x31,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f, - 0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f, - 0x69,0x64,0x5b,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63, - 0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x6e,0x5d,0x20,0x3d,0x20,0x63, - 0x6f,0x72,0x6f,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x63,0x6f,0x72,0x65,0x2e,0x61,0x63,0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f, - 0x75,0x74,0x69,0x6e,0x65,0x73,0x2e,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x6f,0x72,0x6f, - 0x5b,0x63,0x6f,0x72,0x6f,0x5d,0x20,0x3d,0x20,0x63,0x6f,0x72,0x65,0x2e,0x61,0x63, - 0x74,0x69,0x76,0x65,0x5f,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x2e, - 0x6e,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x65, - 0x62,0x75,0x67,0x2e,0x73,0x65,0x74,0x68,0x6f,0x6f,0x6b,0x28,0x63,0x6f,0x72,0x6f, - 0x2c,0x20,0x64,0x65,0x62,0x75,0x67,0x67,0x65,0x72,0x5f,0x68,0x6f,0x6f,0x6b,0x2c, - 0x20,0x22,0x72,0x6c,0x63,0x22,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x72,0x65,0x73,0x75,0x6d,0x65,0x5f,0x68,0x61,0x6e,0x64,0x6c,0x65, - 0x72,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x63,0x6f,0x72,0x65,0x73,0x75,0x6d,0x65, - 0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x63,0x6f,0x72, - 0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x77,0x72,0x61,0x70,0x20,0x75,0x73,0x65,0x73, - 0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x6c,0x79,0x20,0x43,0x20,0x41,0x50,0x49,0x20, - 0x66,0x6f,0x72,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x73,0x20,0x61, - 0x6e,0x64,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x74,0x72,0x69,0x67, - 0x67,0x65,0x72,0x20,0x6f,0x75,0x72,0x20,0x6f,0x76,0x65,0x72,0x72,0x69,0x64,0x64, - 0x65,0x6e,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x72,0x65,0x73, - 0x75,0x6d,0x65,0x0a,0x20,0x20,0x20,0x20,0x2d,0x2d,0x20,0x73,0x6f,0x20,0x74,0x68, - 0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x6e,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65, - 0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x77,0x72,0x61,0x70,0x20, - 0x69,0x6e,0x20,0x70,0x75,0x72,0x65,0x20,0x4c,0x75,0x61,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x6f,0x63,0x61,0x6c,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x77, - 0x72,0x61,0x70,0x5f,0x68,0x61,0x6e,0x64,0x6c,0x65,0x72,0x28,0x73,0x74,0x61,0x74, - 0x75,0x73,0x2c,0x20,0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x6e,0x6f,0x74,0x20,0x73,0x74,0x61,0x74,0x75,0x73,0x20,0x74, - 0x68,0x65,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x28,0x28,0x2e,0x2e,0x2e,0x29,0x29, - 0x20,0x65,0x6e,0x64,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x2e,0x2e,0x2e,0x0a,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x63,0x6f, - 0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x77,0x72,0x61,0x70,0x28,0x66,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x63,0x6f, - 0x72,0x6f,0x20,0x3d,0x20,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e,0x63, - 0x72,0x65,0x61,0x74,0x65,0x28,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e, - 0x28,0x2e,0x2e,0x2e,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x77,0x72,0x61,0x70,0x5f,0x68,0x61, - 0x6e,0x64,0x6c,0x65,0x72,0x28,0x63,0x6f,0x72,0x6f,0x75,0x74,0x69,0x6e,0x65,0x2e, - 0x72,0x65,0x73,0x75,0x6d,0x65,0x28,0x63,0x6f,0x72,0x6f,0x2c,0x20,0x2e,0x2e,0x2e, - 0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6e,0x64,0x0a,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x73,0x65,0x73,0x73,0x0a,0x65,0x6e,0x64,0x0a,0x0a,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x69,0x6e,0x69,0x74,0x0a, -}; - - - -int luaopen_lua_m_debugger(lua_State *L) { - luaL_loadbuffer(L, - (const char*)lua_m_debugger, - sizeof(lua_m_debugger), - "debugger"); - return 1; -} - - -static luaL_Reg lua_debugger_modules[] = { - {"debugger", luaopen_lua_m_debugger}, - {NULL, NULL} -}; - -void luaopen_lua_debugger(lua_State* L) -{ - luaL_Reg* lib = lua_debugger_modules; - lua_getglobal(L, "package"); - lua_getfield(L, -1, "preload"); - for (; lib->func; lib++) - { - lib->func(L); - lua_setfield(L, -2, lib->name); - } - lua_pop(L, 2); -} - -#if __cplusplus -} -#endif diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lua_debugger.h b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lua_debugger.h deleted file mode 100644 index 43c2c8ae35..0000000000 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/lua_debugger.h +++ /dev/null @@ -1,23 +0,0 @@ - -/* lua_debugger.h.h */ - -#ifndef __LUA_MODULES_049C000C96FE547176CCBB7690BA01B6_H_ -#define __LUA_MODULES_049C000C96FE547176CCBB7690BA01B6_H_ - -#if __cplusplus -extern "C" { -#endif - -#include "lua.h" - -void luaopen_lua_debugger(lua_State* L); - -/* -int luaopen_lua_m_debugger(lua_State* L); -*/ - -#if __cplusplus -} -#endif - -#endif /* __LUA_MODULES_049C000C96FE547176CCBB7690BA01B6_H_ */ diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h b/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h deleted file mode 100644 index 58977985e3..0000000000 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/lua_module_register.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ -#define __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ - -#include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" -#include "network/lua_cocos2dx_network_manual.h" -#include "cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h" -#include "cocostudio/lua_cocos2dx_coco_studio_manual.hpp" -#include "extension/lua_cocos2dx_extension_manual.h" -#include "ui/lua_cocos2dx_ui_manual.hpp" -#include "spine/lua_cocos2dx_spine_manual.hpp" -#include "3d/lua_cocos2dx_3d_manual.h" -#include "audioengine/lua_cocos2dx_audioengine_manual.h" - -static int lua_module_register(lua_State* L) -{ - //Dont' change the module register order unless you know what your are doing - register_cocosdenshion_module(L); - register_network_module(L); - register_cocosbuilder_module(L); - register_cocostudio_module(L); - register_ui_moudle(L); - register_extension_module(L); - register_spine_module(L); - register_cocos3d_module(L); - register_audioengine_module(L); - return 1; -} - -#endif // __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ - diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/.gitignore b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/.gitignore b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..331146586c --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..08c5dd07cc --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.hellolua" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..d0355b5524 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,37 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2dlua_shared + +LOCAL_MODULE_FILENAME := libcocos2dlua + +LOCAL_SRC_FILES := \ +../../../Classes/AppDelegate.cpp \ +../../../Classes/ide-support/SimpleConfigParser.cpp \ +../../../Classes/ide-support/RuntimeLuaImpl.cpp \ +../../../Classes/ide-support/lua_debugger.c \ +hellolua/main.cpp + +LOCAL_C_INCLUDES := \ +$(LOCAL_PATH)/../../../Classes \ +$(LOCAL_PATH)/../../../../cocos2d-x/external \ +$(LOCAL_PATH)/../../../../cocos2d-x/tools/simulator/libsimulator/lib \ +$(LOCAL_PATH)/../../../../cocos2d-x/tools/simulator/libsimulator/lib/protobuf-lite + +# _COCOS_HEADER_ANDROID_BEGIN +# _COCOS_HEADER_ANDROID_END + +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocos2d_simulator_static + +# _COCOS_LIB_ANDROID_BEGIN +# _COCOS_LIB_ANDROID_END + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/lua-bindings/proj.android) +$(call import-module,tools/simulator/libsimulator/proj.android) + +# _COCOS_LIB_IMPORT_ANDROID_BEGIN +# _COCOS_LIB_IMPORT_ANDROID_END diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..07aa592b13 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/hellolua/main.cpp b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/hellolua/main.cpp new file mode 100644 index 0000000000..fff9f825a6 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/jni/hellolua/main.cpp @@ -0,0 +1,35 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include +#include "ide-support/SimpleConfigParser.h" +#include "ide-support/CodeIDESupport.h" + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} + +extern "C" +{ + bool Java_org_cocos2dx_lua_AppActivity_nativeIsLandScape(JNIEnv *env, jobject thisz) + { + return SimpleConfigParser::getInstance()->isLanscape(); + } + + bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz) + { +#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) + return true; +#else + return false; +#endif + } +} + diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..edf858c4ca --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + HelloLua + diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/lua/AppActivity.java b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/lua/AppActivity.java new file mode 100644 index 0000000000..3d3d3b0034 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/lua/AppActivity.java @@ -0,0 +1,127 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.lua; + +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.Enumeration; +import java.util.ArrayList; + +import org.cocos2dx.lib.Cocos2dxActivity; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.ActivityInfo; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; +import android.os.Bundle; +import android.provider.Settings; +import android.text.format.Formatter; +import android.util.Log; +import android.view.WindowManager; +import android.widget.Toast; + + +public class AppActivity extends Cocos2dxActivity{ + + static String hostIPAdress = "0.0.0.0"; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + if(nativeIsLandScape()) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); + } else { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); + } + + //2.Set the format of window + + // Check the wifi is opened when the native is debug. + if(nativeIsDebug()) + { + getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + if(!isNetworkConnected()) + { + AlertDialog.Builder builder=new AlertDialog.Builder(this); + builder.setTitle("Warning"); + builder.setMessage("Please open WIFI for debuging..."); + builder.setPositiveButton("OK",new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); + finish(); + System.exit(0); + } + }); + + builder.setNegativeButton("Cancel", null); + builder.setCancelable(true); + builder.show(); + } + hostIPAdress = getHostIpAddress(); + } + } + private boolean isNetworkConnected() { + ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); + if (cm != null) { + NetworkInfo networkInfo = cm.getActiveNetworkInfo(); + ArrayList networkTypes = new ArrayList(); + networkTypes.add(ConnectivityManager.TYPE_WIFI); + try { + networkTypes.add(ConnectivityManager.class.getDeclaredField("TYPE_ETHERNET").getInt(null)); + } catch (NoSuchFieldException nsfe) { + } + catch (IllegalAccessException iae) { + throw new RuntimeException(iae); + } + if (networkInfo != null && networkTypes.contains(networkInfo.getType())) { + return true; + } + } + return false; + } + + public String getHostIpAddress() { + WifiManager wifiMgr = (WifiManager) getSystemService(WIFI_SERVICE); + WifiInfo wifiInfo = wifiMgr.getConnectionInfo(); + int ip = wifiInfo.getIpAddress(); + return ((ip & 0xFF) + "." + ((ip >>>= 8) & 0xFF) + "." + ((ip >>>= 8) & 0xFF) + "." + ((ip >>>= 8) & 0xFF)); + } + + public static String getLocalIpAddress() { + return hostIPAdress; + } + + private static native boolean nativeIsLandScape(); + private static native boolean nativeIsDebug(); + +} diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew.bat b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..aa7d6ba93b --- /dev/null +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../cocos2d-x/cocos/platform/android/libcocos2dx') +include ':app' diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Application.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Application.mk index 07aa592b13..18444678c9 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Application.mk +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/Application.mk @@ -1,6 +1,6 @@ APP_STL := gnustl_static -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char APP_LDFLAGS := -latomic diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 7a7c05a379..a132ea77cd 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -830,6 +830,7 @@ USE_FILE32API, "CC_LUA_ENGINE_ENABLED=1", "CC_ENABLE_CHIPMUNK_INTEGRATION=1", + "CC_ENABLE_BULLET_INTEGRATION=1", GLFW_EXPOSE_NATIVE_COCOA, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; @@ -853,6 +854,7 @@ USE_FILE32API, "CC_LUA_ENGINE_ENABLED=1", "CC_ENABLE_CHIPMUNK_INTEGRATION=1", + "CC_ENABLE_BULLET_INTEGRATION=1", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 12d7aafba4..19b6938464 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -1,4 +1,4 @@ - + @@ -77,7 +77,7 @@ EditAndContinue EnableFastChecks Disabled - WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;CC_ENABLE_BULLET_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) 4267;4251;4244;%(DisableSpecificWarnings) true $(IntDir)vc$(PlatformToolsetVersion).pdb @@ -89,7 +89,7 @@ MachineX86 true $(OutDir);%(AdditionalLibraryDirectories);$(_COCOS_LIB_PATH_WIN32_BEGIN);$(_COCOS_LIB_PATH_WIN32_END) - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies);$(_COCOS_LIB_WIN32_BEGIN);$(_COCOS_LIB_WIN32_END) + libcurl_imp.lib;websockets.lib;%(AdditionalDependencies);$(_COCOS_LIB_WIN32_BEGIN);$(_COCOS_LIB_WIN32_END) $(ProjectDir)../../../runtime/win32/$(TargetName).pdb $(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt) @@ -135,7 +135,7 @@ xcopy "$(ProjectDir)..\..\..\src" "$(ProjectDir)..\..\..\runtime\win32\src" /D / ProgramDatabase - WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;CC_ENABLE_BULLET_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) 4267;4251;4244;%(DisableSpecificWarnings) true $(IntDir)vc$(PlatformToolsetVersion).pdb @@ -146,7 +146,8 @@ xcopy "$(ProjectDir)..\..\..\src" "$(ProjectDir)..\..\..\runtime\win32\src" /D / Windows MachineX86 $(OutDir);%(AdditionalLibraryDirectories);$(_COCOS_LIB_PATH_WIN32_BEGIN);$(_COCOS_LIB_PATH_WIN32_END) - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies);$(_COCOS_LIB_WIN32_BEGIN);$(_COCOS_LIB_WIN32_END) + libcurl_imp.lib;websockets.lib;%(AdditionalDependencies);$(_COCOS_LIB_WIN32_BEGIN);$(_COCOS_LIB_WIN32_END) + libcmt.lib true $(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt) diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index fa03afca47..9775b85688 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -135,6 +135,18 @@ "proj.win32/Debug", "proj.win32/Release" ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/Classes/ide-support", + "to": "frameworks/runtime-src/Classes/ide-support", + "exclude": [ + "RuntimeJsImpl.h", + "RuntimeJsImpl.cpp" + ] + }, + { + "from": "tools/simulator/frameworks/runtime-src/Classes/lua_module_register.h", + "to": "frameworks/runtime-src/Classes/" } ], "project_rename": { diff --git a/tests/cpp-empty-test/proj.android-studio/.gitignore b/tests/cpp-empty-test/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/cpp-empty-test/proj.android-studio/app/.gitignore b/tests/cpp-empty-test/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/cpp-empty-test/proj.android-studio/app/AndroidManifest.xml b/tests/cpp-empty-test/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..908029d414 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cpp-empty-test/proj.android-studio/app/build.gradle b/tests/cpp-empty-test/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..7725be188f --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.cpp_empty_test" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/tests/cpp-empty-test/proj.android-studio/app/jni/Android.mk b/tests/cpp-empty-test/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..c4966a4251 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,22 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cpp_empty_test_shared + +LOCAL_MODULE_FILENAME := libcpp_empty_test + +LOCAL_SRC_FILES := main.cpp \ + ../../../Classes/AppDelegate.cpp \ + ../../../Classes/HelloWorldScene.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \ + $(LOCAL_PATH)/../../../../../extensions \ + $(LOCAL_PATH)/../../../../.. \ + $(LOCAL_PATH)/../../../../../cocos/editor-support + +LOCAL_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,.) diff --git a/tests/cpp-empty-test/proj.android-studio/app/jni/Application.mk b/tests/cpp-empty-test/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..07aa592b13 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/cpp-empty-test/proj.android-studio/app/jni/main.cpp b/tests/cpp-empty-test/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..feab560c09 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,16 @@ +#include "AppDelegate.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#include "cocos2d.h" + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/tests/cpp-empty-test/proj.android-studio/app/proguard-rules.pro b/tests/cpp-empty-test/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/cpp-empty-test/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android-studio/app/res/values/strings.xml b/tests/cpp-empty-test/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..35a12a294d --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + CppEmptyTest + diff --git a/tests/cpp-empty-test/proj.android-studio/app/src/org/cocos2dx/cpp_empty_test/AppActivity.java b/tests/cpp-empty-test/proj.android-studio/app/src/org/cocos2dx/cpp_empty_test/AppActivity.java new file mode 100644 index 0000000000..21e337ef05 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/app/src/org/cocos2dx/cpp_empty_test/AppActivity.java @@ -0,0 +1,29 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.cpp_empty_test; + +import org.cocos2dx.lib.Cocos2dxActivity; + +public class AppActivity extends Cocos2dxActivity { +} diff --git a/tests/cpp-empty-test/proj.android-studio/build.gradle b/tests/cpp-empty-test/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/cpp-empty-test/proj.android-studio/gradle.properties b/tests/cpp-empty-test/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/cpp-empty-test/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/cpp-empty-test/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/cpp-empty-test/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/cpp-empty-test/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/cpp-empty-test/proj.android-studio/gradlew b/tests/cpp-empty-test/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/cpp-empty-test/proj.android-studio/gradlew.bat b/tests/cpp-empty-test/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/cpp-empty-test/proj.android-studio/settings.gradle b/tests/cpp-empty-test/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..25a3ed500d --- /dev/null +++ b/tests/cpp-empty-test/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') +include ':app' diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp index d8d894b3fd..0d2b6b4928 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp @@ -58,3 +58,66 @@ void BugChild::switchChild(Ref *sender) CCLOG("Child attached to parent1"); } } + +bool BugCameraMask::init() +{ + if (!BugsTestBase::init()) return false; + + auto size = Director::getInstance()->getWinSize(); + + auto node = Node::create(); + node->setPosition(size.width/4, size.height/3); + _sprite = Sprite::create("Images/grossini.png"); + node->addChild(_sprite); + node->setCameraMask((unsigned short)CameraFlag::USER1); + auto move = MoveBy::create(2, Vec2(200,0)); + + node->runAction(RepeatForever::create(Sequence::createWithTwoActions(move, move->reverse()))); + addChild(node); + + auto camera = Camera::create(); + camera->setCameraFlag(CameraFlag::USER1); + addChild(camera); + + + auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugCameraMask::switchSpriteFlag, this)); + + auto menu = Menu::create(item1, nullptr); + + menu->alignItemsVertically(); + menu->setPosition(size.width/2, 100); + addChild(menu); + + _spriteMaskLabel = Label::create(); + _spriteMaskLabel->setPosition(size.width/2, 120); + addChild(_spriteMaskLabel); + updateSpriteMaskLabel(); + + auto label = Label::create(); + label->setPosition(size.width/2, size.height * 0.9); + label->setString("Sprite should always run action."); + addChild(label); + + return true; +} + +void BugCameraMask::switchSpriteFlag(Ref *sender) +{ + if((unsigned short) CameraFlag::USER1 == _sprite->getCameraMask()) + { + _sprite->setCameraMask((unsigned short)CameraFlag::DEFAULT); + } + else + { + _sprite->setCameraMask((unsigned short)CameraFlag::USER1); + } + + updateSpriteMaskLabel(); +} + +void BugCameraMask::updateSpriteMaskLabel() +{ + std::stringstream stream; + stream<<"The camera Mask is "<<(_sprite->getCameraMask() == 1 ? "CamereFlag::Default" : "CameraFlag::User1")<setString(stream.str()); +} diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h index 0f1aaf4d23..c74213e80e 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h @@ -30,4 +30,17 @@ protected: cocos2d::Menu* menu; }; +class BugCameraMask : public BugsTestBase +{ +public: + CREATE_FUNC(BugCameraMask); + + virtual bool init() override; + + void switchSpriteFlag(cocos2d::Ref* sender); + void updateSpriteMaskLabel(); + Node* _sprite; + cocos2d::Label* _spriteMaskLabel; +}; + #endif /* defined(__Bug_Child__) */ diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index 3012dd1094..f2bfecc07a 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -22,4 +22,5 @@ BugsTests::BugsTests() ADD_TEST_CASE(Bug1159Layer); ADD_TEST_CASE(Bug1174Layer); ADD_TEST_CASE(BugChild); + ADD_TEST_CASE(BugCameraMask); } diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp index 9679b9818b..9bf0008120 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp @@ -111,7 +111,7 @@ void Material_2DEffects::onEnter() { MaterialSystemBaseTest::onEnter(); - auto properties = Properties::createWithoutAutorelease("Materials/2d_effects.material#sample"); + auto properties = Properties::createNonRefCounted("Materials/2d_effects.material#sample"); // Print the properties of every namespace within this one. printProperties(properties, 0); diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp index 3f794bd566..41b8248b6b 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "NewAudioEngineTest.h" #include "ui/CocosGUI.h" @@ -288,7 +288,11 @@ bool AudioControlTest::init() auto playItem = TextButton::create("play", [&](TextButton* button){ if (_audioID == AudioEngine::INVALID_AUDIO_ID) { +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + _audioID = AudioEngine::play2d("background.wav", _loopEnabled, _volume); +#else _audioID = AudioEngine::play2d("background.mp3", _loopEnabled, _volume); +#endif if(_audioID != AudioEngine::INVALID_AUDIO_ID) { button->setEnabled(false); @@ -350,7 +354,11 @@ bool AudioControlTest::init() addChild(loopItem); auto uncacheItem = TextButton::create("uncache", [&](TextButton* button){ +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + AudioEngine::uncache("background.wav"); +#else AudioEngine::uncache("background.mp3"); +#endif _audioID = AudioEngine::INVALID_AUDIO_ID; ((TextButton*)_playItem)->setEnabled(true); @@ -440,7 +448,11 @@ bool PlaySimultaneouslyTest::init() char text[36]; int tmp = 81; for(int index = 0; index < TEST_COUNT; ++index){ +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + sprintf(text, "audio/SoundEffectsFX009/FX0%d.wav", tmp + index); +#else sprintf(text,"audio/SoundEffectsFX009/FX0%d.mp3",tmp + index); +#endif _files[index] = text; } _playingcount = 0; @@ -490,7 +502,11 @@ bool AudioProfileTest::init() auto ret = AudioEngineTestDemo::init(); char text[30]; +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + _files[0] = "background.wav"; +#else _files[0] = "background.mp3"; +#endif #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC _files[1] = "background.caf"; #else @@ -627,7 +643,11 @@ bool LargeAudioFileTest::init() auto ret = AudioEngineTestDemo::init(); auto playItem = TextButton::create("play large audio file", [&](TextButton* button){ +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT + AudioEngine::play2d("audio/LuckyDay.wav"); +#else AudioEngine::play2d("audio/LuckyDay.mp3"); +#endif }); playItem->setNormalizedPosition(Vec2::ANCHOR_MIDDLE); this->addChild(playItem); diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h index 18dd00243c..033c901cc7 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h @@ -23,7 +23,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #ifndef __NEWAUDIOENGINE_TEST_H_ #define __NEWAUDIOENGINE_TEST_H_ diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 769f706afe..2baf2f8d87 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -101,8 +101,8 @@ public: } // normal effect: order == 0 - _quadCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, transform, flags); - renderer->addCommand(&_quadCommand); + _trianglesCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, getRenderedTriangles(), transform, flags); + renderer->addCommand(&_trianglesCommand); // postive effects: oder >= 0 for(auto it = std::begin(_effects)+idx; it != std::end(_effects); ++it) { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index 76a6d7fad1..0218af0b1f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -52,6 +52,7 @@ UIScale9SpriteTests::UIScale9SpriteTests() ADD_TEST_CASE(UIS9ZOrder); ADD_TEST_CASE(UIS9Flip); ADD_TEST_CASE(UIS9ChangeAnchorPoint); + ADD_TEST_CASE(UIS9NinePatchTest); } // UIScale9SpriteTest @@ -847,7 +848,54 @@ bool UIS9ChangeAnchorPoint::init() }); this->addChild(button2); - + + return true; + } + return false; +} + +bool UIS9NinePatchTest::init() +{ + if (UIScene::init()) { + SpriteFrameCache::getInstance()->addSpriteFramesWithFile("cocosui/android9patch.plist"); + + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2 + 50); + + auto preferedSize = Size(99,99); + + //9-patch sprite with filename + auto playerSprite = ui::Scale9Sprite::create("cocosui/player.9.png"); + playerSprite->setPosition(x, y); + playerSprite->setContentSize(preferedSize); + auto capInsets = playerSprite->getCapInsets(); + CCLOG("player sprite capInset = %f, %f %f, %f", capInsets.origin.x, + capInsets.origin.y, capInsets.size.width, capInsets.size.height); + this->addChild(playerSprite); + + auto animationBtnSprite = ui::Scale9Sprite::createWithSpriteFrameName("animationbuttonpressed.png"); + animationBtnSprite->setPosition(x-100, y-100); + capInsets = animationBtnSprite->getCapInsets(); + CCLOG("animationBtnSprite capInset = %f, %f %f, %f", capInsets.origin.x, + capInsets.origin.y, capInsets.size.width, capInsets.size.height); + this->addChild(animationBtnSprite); + + + auto monsterSprite = ui::Scale9Sprite::createWithSpriteFrameName("monster.9.png"); + monsterSprite->setPosition(x+100, y-100); + capInsets = monsterSprite->getCapInsets(); + monsterSprite->setContentSize(preferedSize); + CCLOG("monsterSprite capInset = %f, %f %f, %f", capInsets.origin.x, + capInsets.origin.y, capInsets.size.width, capInsets.size.height); + this->addChild(monsterSprite); + + auto spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("buttonnormal.9.png"); + auto buttonScale9Sprite = Scale9Sprite::createWithSpriteFrame(spriteFrame); + buttonScale9Sprite->setContentSize(Size(150,80)); + buttonScale9Sprite->setPosition(Vec2(100,200)); + this->addChild(buttonScale9Sprite); + return true; } return false; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h index 3edba14cb4..4138593e26 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h @@ -250,4 +250,12 @@ public: virtual bool init() override; }; +class UIS9NinePatchTest : public UIScene +{ +public: + CREATE_FUNC(UIS9NinePatchTest); + + virtual bool init() override; +}; + #endif /* defined(__cocos2d_tests__UIScale9SpriteTest__) */ diff --git a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp index 12f28a324b..1f7aee2cb4 100644 --- a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp +++ b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp @@ -1,12 +1,18 @@ #include "UserDefaultTest.h" #include "stdio.h" #include "stdlib.h" +#include +#include +#include + +using namespace std; USING_NS_CC; // enable log #define COCOS2D_DEBUG 1 + UserDefaultTests::UserDefaultTests() { ADD_TEST_CASE(UserDefaultTest); @@ -22,6 +28,51 @@ UserDefaultTest::UserDefaultTest() doTest(); } +template +void logData(const char* key) +{ + Data data = UserDefault::getInstance()->getDataForKey(key); + T* buffer = (T*) data.getBytes(); + int length = data.getSize() / sizeof(T); + + std::ostringstream ss; + ss << setprecision(2) << std::fixed; + for (int i = 0; i < length; i++) + { + ss << buffer[i] << " "; + } + + CCLOG("%s is %s", key, ss.str().c_str()); +} + +template +void setData(const char* key) +{ + Data data; + vector v; + + for (int i = 0; i <= 5; i++) + { + v.push_back(static_cast(i)); + } + data.copy((unsigned char*) v.data(), v.size() * sizeof(T)); + UserDefault::getInstance()->setDataForKey(key, data); +} + +template +void setData2(const char* key) +{ + Data data; + vector v; + + for (int i = 5; i >= 0; i--) + { + v.push_back(static_cast(i)); + } + data.copy((unsigned char*) v.data(), v.size() * sizeof(T)); + UserDefault::getInstance()->setDataForKey(key, data); +} + void UserDefaultTest::doTest() { CCLOG("********************** init value ***********************"); @@ -34,6 +85,11 @@ void UserDefaultTest::doTest() UserDefault::getInstance()->setDoubleForKey("double", 2.4); UserDefault::getInstance()->setBoolForKey("bool", true); + // test saving of Data buffers + setData("int_data"); + setData("float_data"); + setData("double_data"); + // print value std::string ret = UserDefault::getInstance()->getStringForKey("string"); @@ -57,7 +113,11 @@ void UserDefaultTest::doTest() { CCLOG("bool is false"); } - + + logData("int_data"); + logData("float_data"); + logData("double_data"); + //CCUserDefault::getInstance()->flush(); CCLOG("********************** after change value ***********************"); @@ -70,6 +130,10 @@ void UserDefaultTest::doTest() UserDefault::getInstance()->setDoubleForKey("double", 2.6); UserDefault::getInstance()->setBoolForKey("bool", false); + setData2("int_data"); + setData2("float_data"); + setData2("double_data"); + UserDefault::getInstance()->flush(); // print value @@ -95,6 +159,10 @@ void UserDefaultTest::doTest() { CCLOG("bool is false"); } + + logData("int_data"); + logData("float_data"); + logData("double_data"); } diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 7a41b9fdb8..8dccd6e6d5 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -24,7 +24,7 @@ public: addTest("Actions - Progress", [](){return new (std::nothrow) ActionsProgressTests(); }); addTest("Allocator - Basic", [](){return new (std::nothrow) AllocatorTests(); }); addTest("Audio - CocosDenshion", []() { return new (std::nothrow) CocosDenshionTests(); }); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) addTest("Audio - NewAudioEngine", []() { return new (std::nothrow) AudioEngineTests(); }); #endif #if CC_ENABLE_BOX2D_INTEGRATION diff --git a/tests/cpp-tests/Classes/tests.h b/tests/cpp-tests/Classes/tests.h index b4fba11740..5a23eee399 100644 --- a/tests/cpp-tests/Classes/tests.h +++ b/tests/cpp-tests/Classes/tests.h @@ -41,7 +41,7 @@ #include "PerformanceTest/PerformanceTest.h" #include "ZwoptexTest/ZwoptexTest.h" #include "CocosDenshionTest/CocosDenshionTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #include "NewAudioEngineTest/NewAudioEngineTest.h" #endif #if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPEN) diff --git a/tests/cpp-tests/Resources/audio/LuckyDay.wav b/tests/cpp-tests/Resources/audio/LuckyDay.wav new file mode 100644 index 0000000000..e7c645e683 Binary files /dev/null and b/tests/cpp-tests/Resources/audio/LuckyDay.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX081.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX081.wav new file mode 100644 index 0000000000..4c1f379e9f Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX081.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX082.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX082.wav new file mode 100644 index 0000000000..54a0e3e63c Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX082.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX083.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX083.wav new file mode 100644 index 0000000000..27f21b57f8 Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX083.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX084.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX084.wav new file mode 100644 index 0000000000..769f699248 Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX084.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX085.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX085.wav new file mode 100644 index 0000000000..28e28c5c13 Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX085.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX086.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX086.wav new file mode 100644 index 0000000000..088de66fe7 Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX086.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX087.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX087.wav new file mode 100644 index 0000000000..148282432e Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX087.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX088.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX088.wav new file mode 100644 index 0000000000..bee0267afc Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX088.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX089.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX089.wav new file mode 100644 index 0000000000..b385e368c3 Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX089.wav differ diff --git a/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX090.wav b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX090.wav new file mode 100644 index 0000000000..7a4f2c9eca Binary files /dev/null and b/tests/cpp-tests/Resources/audio/SoundEffectsFX009/FX090.wav differ diff --git a/tests/cpp-tests/Resources/background-music-aac.mp3 b/tests/cpp-tests/Resources/background-music-aac.mp3 new file mode 100644 index 0000000000..c1de365baf Binary files /dev/null and b/tests/cpp-tests/Resources/background-music-aac.mp3 differ diff --git a/tests/cpp-tests/Resources/background-music-aac.wav b/tests/cpp-tests/Resources/background-music-aac.wav new file mode 100644 index 0000000000..db5624cd76 Binary files /dev/null and b/tests/cpp-tests/Resources/background-music-aac.wav differ diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index 0f5e0dff1a..17afb919e9 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit 0f5e0dff1a7545eef7bbe8f23d4b232d0d2d6ae3 +Subproject commit 17afb919e9368b9a41e7e480bfd53d27ccce8feb diff --git a/tests/cpp-tests/proj.android-studio/.gitignore b/tests/cpp-tests/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/cpp-tests/proj.android-studio/app/.gitignore b/tests/cpp-tests/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/cpp-tests/proj.android-studio/app/AndroidManifest.xml b/tests/cpp-tests/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..60c767fd3b --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cpp-tests/proj.android-studio/app/build.gradle b/tests/cpp-tests/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..4d07f2efc8 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.cpp_tests" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/tests/cpp-tests/proj.android-studio/app/jni/Android.mk b/tests/cpp-tests/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..074dc23dd6 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,213 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cpp_tests_shared + +LOCAL_MODULE_FILENAME := libcpp_tests + +LOCAL_SRC_FILES := main.cpp \ +../../../Classes/ActionManagerTest/ActionManagerTest.cpp \ +../../../Classes/ActionsEaseTest/ActionsEaseTest.cpp \ +../../../Classes/ActionsProgressTest/ActionsProgressTest.cpp \ +../../../Classes/ActionsTest/ActionsTest.cpp \ +../../../Classes/AllocatorTest/AllocatorTest.cpp \ +../../../Classes/AppDelegate.cpp \ +../../../Classes/BaseTest.cpp \ +../../../Classes/BillBoardTest/BillBoardTest.cpp \ +../../../Classes/Box2DTest/Box2dTest.cpp \ +../../../Classes/Box2DTestBed/Box2dView.cpp \ +../../../Classes/Box2DTestBed/GLES-Render.cpp \ +../../../Classes/Box2DTestBed/Test.cpp \ +../../../Classes/Box2DTestBed/TestEntries.cpp \ +../../../Classes/BugsTest/Bug-1159.cpp \ +../../../Classes/BugsTest/Bug-1174.cpp \ +../../../Classes/BugsTest/Bug-350.cpp \ +../../../Classes/BugsTest/Bug-422.cpp \ +../../../Classes/BugsTest/Bug-458/Bug-458.cpp \ +../../../Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ +../../../Classes/BugsTest/Bug-624.cpp \ +../../../Classes/BugsTest/Bug-886.cpp \ +../../../Classes/BugsTest/Bug-899.cpp \ +../../../Classes/BugsTest/Bug-914.cpp \ +../../../Classes/BugsTest/Bug-Child.cpp \ +../../../Classes/BugsTest/BugsTest.cpp \ +../../../Classes/Camera3DTest/Camera3DTest.cpp \ +../../../Classes/ChipmunkTest/ChipmunkTest.cpp \ +../../../Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ +../../../Classes/ClippingNodeTest/ClippingNodeTest.cpp \ +../../../Classes/CocosDenshionTest/CocosDenshionTest.cpp \ +../../../Classes/CocosStudio3DTest/CocosStudio3DTest.cpp \ +../../../Classes/ConfigurationTest/ConfigurationTest.cpp \ +../../../Classes/ConsoleTest/ConsoleTest.cpp \ +../../../Classes/CurlTest/CurlTest.cpp \ +../../../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ +../../../Classes/DataVisitorTest/DataVisitorTest.cpp \ +../../../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ +../../../Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ +../../../Classes/EffectsTest/EffectsTest.cpp \ +../../../Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp \ +../../../Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp \ +../../../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ +../../../Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ +../../../Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ +../../../Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ +../../../Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ +../../../Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ +../../../Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ +../../../Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ +../../../Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp \ +../../../Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ +../../../Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ +../../../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ +../../../Classes/ExtensionsTest/ExtensionsTest.cpp \ +../../../Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ +../../../Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ +../../../Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ +../../../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ +../../../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ +../../../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ +../../../Classes/FileUtilsTest/FileUtilsTest.cpp \ +../../../Classes/FontTest/FontTest.cpp \ +../../../Classes/InputTest/MouseTest.cpp \ +../../../Classes/IntervalTest/IntervalTest.cpp \ +../../../Classes/LabelTest/LabelTest.cpp \ +../../../Classes/LabelTest/LabelTestNew.cpp \ +../../../Classes/LayerTest/LayerTest.cpp \ +../../../Classes/LightTest/LightTest.cpp \ +../../../Classes/MaterialSystemTest/MaterialSystemTest.cpp \ +../../../Classes/MenuTest/MenuTest.cpp \ +../../../Classes/MotionStreakTest/MotionStreakTest.cpp \ +../../../Classes/MutiTouchTest/MutiTouchTest.cpp \ +../../../Classes/NewAudioEngineTest/NewAudioEngineTest.cpp \ +../../../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ +../../../Classes/NewRendererTest/NewRendererTest.cpp \ +../../../Classes/NodeTest/NodeTest.cpp \ +../../../Classes/OpenURLTest/OpenURLTest.cpp \ +../../../Classes/ParallaxTest/ParallaxTest.cpp \ +../../../Classes/Particle3DTest/Particle3DTest.cpp \ +../../../Classes/ParticleTest/ParticleTest.cpp \ +../../../Classes/PerformanceTest/PerformanceAllocTest.cpp \ +../../../Classes/PerformanceTest/PerformanceCallbackTest.cpp \ +../../../Classes/PerformanceTest/PerformanceContainerTest.cpp \ +../../../Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp \ +../../../Classes/PerformanceTest/PerformanceLabelTest.cpp \ +../../../Classes/PerformanceTest/PerformanceMathTest.cpp \ +../../../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ +../../../Classes/PerformanceTest/PerformanceParticle3DTest.cpp \ +../../../Classes/PerformanceTest/PerformanceParticleTest.cpp \ +../../../Classes/PerformanceTest/PerformanceRendererTest.cpp \ +../../../Classes/PerformanceTest/PerformanceScenarioTest.cpp \ +../../../Classes/PerformanceTest/PerformanceSpriteTest.cpp \ +../../../Classes/PerformanceTest/PerformanceTest.cpp \ +../../../Classes/PerformanceTest/PerformanceTextureTest.cpp \ +../../../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ +../../../Classes/PhysicsTest/PhysicsTest.cpp \ +../../../Classes/Physics3DTest/Physics3DTest.cpp \ +../../../Classes/ReleasePoolTest/ReleasePoolTest.cpp \ +../../../Classes/RenderTextureTest/RenderTextureTest.cpp \ +../../../Classes/RotateWorldTest/RotateWorldTest.cpp \ +../../../Classes/SceneTest/SceneTest.cpp \ +../../../Classes/SchedulerTest/SchedulerTest.cpp \ +../../../Classes/ShaderTest/ShaderTest.cpp \ +../../../Classes/ShaderTest/ShaderTest2.cpp \ +../../../Classes/SpineTest/SpineTest.cpp \ +../../../Classes/Sprite3DTest/DrawNode3D.cpp \ +../../../Classes/Sprite3DTest/Sprite3DTest.cpp \ +../../../Classes/SpritePolygonTest/SpritePolygonTest.cpp \ +../../../Classes/SpriteTest/SpriteTest.cpp \ +../../../Classes/TerrainTest/TerrainTest.cpp \ +../../../Classes/TextInputTest/TextInputTest.cpp \ +../../../Classes/Texture2dTest/Texture2dTest.cpp \ +../../../Classes/TextureCacheTest/TextureCacheTest.cpp \ +../../../Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ +../../../Classes/TileMapTest/TileMapTest.cpp \ +../../../Classes/TileMapTest/TileMapTest2.cpp \ +../../../Classes/TouchesTest/Ball.cpp \ +../../../Classes/TouchesTest/Paddle.cpp \ +../../../Classes/TouchesTest/TouchesTest.cpp \ +../../../Classes/TransitionsTest/TransitionsTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomRootNode.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomRootNodeReader.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageViewReader.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidgetReader.cpp \ +../../../Classes/UITest/CocoStudioGUITest/CustomWidget/CustomReader.cpp \ +../../../Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIScene.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UISceneManager.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UISceneManager_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp \ +../../../Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp \ +../../../Classes/UITest/UITest.cpp \ +../../../Classes/UnitTest/RefPtrTest.cpp \ +../../../Classes/UnitTest/UnitTest.cpp \ +../../../Classes/UserDefaultTest/UserDefaultTest.cpp \ +../../../Classes/VisibleRect.cpp \ +../../../Classes/ZwoptexTest/ZwoptexTest.cpp \ +../../../Classes/controller.cpp \ +../../../Classes/testBasic.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \ + $(LOCAL_PATH)/../../../../.. + +LOCAL_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,cocos) diff --git a/tests/cpp-tests/proj.android-studio/app/jni/Application.mk b/tests/cpp-tests/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..85aaa1e860 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif + diff --git a/tests/cpp-tests/proj.android-studio/app/jni/main.cpp b/tests/cpp-tests/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/tests/cpp-tests/proj.android-studio/app/proguard-rules.pro b/tests/cpp-tests/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/cpp-tests/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/cpp-tests/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/cpp-tests/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/cpp-tests/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/cpp-tests/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/cpp-tests/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/cpp-tests/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/cpp-tests/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/cpp-tests/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android-studio/app/res/values/strings.xml b/tests/cpp-tests/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..1f4d55e23a --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + CppTests + diff --git a/tests/cpp-tests/proj.android-studio/app/src/org/cocos2dx/cpp_tests/AppActivity.java b/tests/cpp-tests/proj.android-studio/app/src/org/cocos2dx/cpp_tests/AppActivity.java new file mode 100644 index 0000000000..91847adae5 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/app/src/org/cocos2dx/cpp_tests/AppActivity.java @@ -0,0 +1,30 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.cpp_tests; + +import org.cocos2dx.lib.Cocos2dxActivity; +import org.cocos2dx.lib.Cocos2dxGLSurfaceView; + +public class AppActivity extends Cocos2dxActivity { +} diff --git a/tests/cpp-tests/proj.android-studio/build.gradle b/tests/cpp-tests/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/cpp-tests/proj.android-studio/gradle.properties b/tests/cpp-tests/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/cpp-tests/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/cpp-tests/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/cpp-tests/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/cpp-tests/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/cpp-tests/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/cpp-tests/proj.android-studio/gradlew b/tests/cpp-tests/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/cpp-tests/proj.android-studio/gradlew.bat b/tests/cpp-tests/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/cpp-tests/proj.android-studio/settings.gradle b/tests/cpp-tests/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..25a3ed500d --- /dev/null +++ b/tests/cpp-tests/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') +include ':app' diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems index 273ff343a2..f0e6ca19a6 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems @@ -110,6 +110,7 @@ + @@ -376,6 +377,7 @@ + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters index 75b451a0c7..62e5be59d8 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters @@ -787,6 +787,9 @@ Classes\Physics3DTest + + Classes\NewAudioEngineTest + Classes\Scene3DTest @@ -1749,6 +1752,9 @@ Classes\Physics3DTest + + Classes\NewAudioEngineTest + Classes\Scene3DTest diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj index a4b34f4c3c..db50b67dd4 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Windows/cpp-tests.Windows.vcxproj @@ -111,8 +111,8 @@ %(DisableSpecificWarnings) pch.h pch.h - CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false false @@ -130,8 +130,8 @@ %(DisableSpecificWarnings) pch.h pch.h - CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false false @@ -149,8 +149,8 @@ %(DisableSpecificWarnings) pch.h pch.h - CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) false false @@ -177,6 +177,9 @@ {3b26a12d-3a44-47ea-82d2-282660fc844d} + + {ec2b1292-2d8c-4feb-a84b-2550b32c1ae7} + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj index b54b35bd68..209d85d0b5 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.WindowsPhone/cpp-tests.WindowsPhone.vcxproj @@ -83,8 +83,8 @@ pch.h %(DisableSpecificWarnings) %(DisableSpecificWarnings) - CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) - CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) Use Use false @@ -105,8 +105,8 @@ pch.h %(DisableSpecificWarnings) %(DisableSpecificWarnings) - CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) - CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) + CC_WINDOWS_PHONE_8_1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) Use Use false @@ -115,7 +115,7 @@ True - x86 + arm false @@ -146,6 +146,9 @@ {22f798d8-bfff-4754-996f-a5395343d5ec} + + {e35634bd-b91b-4a6d-b957-96f56dd065f9} + diff --git a/tests/game-controller-test/proj.android-studio/.gitignore b/tests/game-controller-test/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/game-controller-test/proj.android-studio/app/.gitignore b/tests/game-controller-test/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/game-controller-test/proj.android-studio/app/AndroidManifest.xml b/tests/game-controller-test/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..12ce1f878c --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/game-controller-test/proj.android-studio/app/build.gradle b/tests/game-controller-test/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..9c67e24c82 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.game_controller_test" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx_with_controller') +} diff --git a/tests/game-controller-test/proj.android-studio/app/jni/Android.mk b/tests/game-controller-test/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..a6f4c33c22 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,20 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := game_controller_test_shared + +LOCAL_MODULE_FILENAME := libgame_controller_test + +LOCAL_SRC_FILES := main.cpp \ + ../../../Classes/AppDelegate.cpp \ + ../../../Classes/GameControllerTest.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \ + $(LOCAL_PATH)/../../../../../external + +LOCAL_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,.) diff --git a/tests/game-controller-test/proj.android-studio/app/jni/Application.mk b/tests/game-controller-test/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..07aa592b13 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/game-controller-test/proj.android-studio/app/jni/main.cpp b/tests/game-controller-test/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..feab560c09 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,16 @@ +#include "AppDelegate.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#include "cocos2d.h" + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/tests/game-controller-test/proj.android-studio/app/proguard-rules.pro b/tests/game-controller-test/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/game-controller-test/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/game-controller-test/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/game-controller-test/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/game-controller-test/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/game-controller-test/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/game-controller-test/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/game-controller-test/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/game-controller-test/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/game-controller-test/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android-studio/app/res/values/strings.xml b/tests/game-controller-test/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..70a6c79e3c --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + GameControllerTest + diff --git a/tests/game-controller-test/proj.android-studio/app/src/org/cocos2dx/game_controller_test/AppActivity.java b/tests/game-controller-test/proj.android-studio/app/src/org/cocos2dx/game_controller_test/AppActivity.java new file mode 100644 index 0000000000..97b31b36d4 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/app/src/org/cocos2dx/game_controller_test/AppActivity.java @@ -0,0 +1,44 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.game_controller_test; + +import org.cocos2dx.lib.GameControllerActivity; +//import org.cocos2dx.lib.GameControllerHelper.ControllerListener; + +import android.os.Bundle; + +public class AppActivity extends GameControllerActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + //The standard controller,without doing anything special. e.g: Amazon Fire TV + + //Manually specify an adapter. + this.connectController(DRIVERTYPE_NIBIRU); + this.connectController(DRIVERTYPE_MOGA); + this.connectController(DRIVERTYPE_OUYA); + } +} diff --git a/tests/game-controller-test/proj.android-studio/build.gradle b/tests/game-controller-test/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/game-controller-test/proj.android-studio/gradle.properties b/tests/game-controller-test/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/game-controller-test/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/game-controller-test/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/game-controller-test/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/game-controller-test/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/game-controller-test/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/game-controller-test/proj.android-studio/gradlew b/tests/game-controller-test/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/game-controller-test/proj.android-studio/gradlew.bat b/tests/game-controller-test/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/game-controller-test/proj.android-studio/settings.gradle b/tests/game-controller-test/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..d2f6c77247 --- /dev/null +++ b/tests/game-controller-test/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx_with_controller' +project(':libcocos2dx_with_controller').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx-with-controller') +include ':app' diff --git a/tests/js-tests/project.json b/tests/js-tests/project.json index e8b658db86..a014ce397f 100644 --- a/tests/js-tests/project.json +++ b/tests/js-tests/project.json @@ -38,6 +38,7 @@ "src/TransitionsTest/TransitionsTest.js", "src/DrawPrimitivesTest/DrawPrimitivesTest.js", "src/ParticleTest/ParticleTest.js", + "src/Particle3DTest/Particle3DTest.js", "src/ProgressActionsTest/ProgressActionsTest.js", "src/LayerTest/LayerTest.js", "src/SceneTest/SceneTest.js", @@ -186,6 +187,8 @@ "src/ReflectionTest/ReflectionTest.js", "src/SpritePolygonTest/SpritePolygonTest.js", - "src/MaterialSystemTest/MaterialSystemTest.js" + "src/MaterialSystemTest/MaterialSystemTest.js", + "src/TerrainTest/TerrainTest.js", + "src/Physics3DTest/Physics3DTest.js" ] } diff --git a/tests/js-tests/project/Classes/AppDelegate.cpp b/tests/js-tests/project/Classes/AppDelegate.cpp index edbcae902c..05e5b34e31 100644 --- a/tests/js-tests/project/Classes/AppDelegate.cpp +++ b/tests/js-tests/project/Classes/AppDelegate.cpp @@ -10,6 +10,8 @@ #include "jsb_cocos2dx_3d_auto.hpp" #include "jsb_cocos2dx_3d_extension_auto.hpp" #include "jsb_cocos2dx_experimental.hpp" +#include "jsb_cocos2dx_physics3d_auto.hpp" +#include "physics3d/jsb_cocos2dx_physics3d_manual.h" #include "experimental/jsb_cocos2dx_experimental_manual.h" #include "3d/jsb_cocos2dx_3d_manual.h" #include "extension/jsb_cocos2dx_extension_manual.h" @@ -35,9 +37,7 @@ #include "platform/ios/JavaScriptObjCBridge.h" #endif -#if(CC_TARGET_PLATFORM != CC_PLATFORM_WP8) #include "js_Effect3D_bindings.h" -#endif USING_NS_CC; USING_NS_CC_EXT; @@ -65,7 +65,7 @@ bool AppDelegate::applicationDidFinishLaunching() auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if(!glview) { -#if(CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if(CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) glview = cocos2d::GLViewImpl::create("js-tests"); #else glview = cocos2d::GLViewImpl::createWithRect("js-tests", Rect(0,0,900,640)); @@ -109,6 +109,9 @@ bool AppDelegate::applicationDidFinishLaunching() sc->addRegisterCallback(register_all_cocos2dx_experimental); sc->addRegisterCallback(register_all_cocos2dx_experimental_manual); + + sc->addRegisterCallback(register_all_cocos2dx_physics3d); + sc->addRegisterCallback(register_all_cocos2dx_physics3d_manual); #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) sc->addRegisterCallback(JavascriptJavaBridge::_js_register); @@ -117,9 +120,7 @@ bool AppDelegate::applicationDidFinishLaunching() #endif sc->addRegisterCallback(register_DrawNode3D_bindings); -#if(CC_TARGET_PLATFORM != CC_PLATFORM_WP8) sc->addRegisterCallback(register_Effect3D_bindings); -#endif sc->start(); sc->runScript("script/jsb_boot.js"); diff --git a/tests/js-tests/project/Classes/js_Effect3D_bindings.cpp b/tests/js-tests/project/Classes/js_Effect3D_bindings.cpp index f83aeca744..b4de7b6830 100644 --- a/tests/js-tests/project/Classes/js_Effect3D_bindings.cpp +++ b/tests/js-tests/project/Classes/js_Effect3D_bindings.cpp @@ -66,7 +66,7 @@ protected: float _outlineWidth; //weak reference EffectSprite3D* _sprite; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) EventListenerCustom* _backToForegroundListener; #endif @@ -227,7 +227,7 @@ Effect3DOutline::Effect3DOutline() , _outlineColor(1, 1, 1) , _sprite(nullptr) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { @@ -244,7 +244,7 @@ Effect3DOutline::Effect3DOutline() Effect3DOutline::~Effect3DOutline() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/tests/js-tests/project/proj.android-studio/.gitignore b/tests/js-tests/project/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/js-tests/project/proj.android-studio/app/.gitignore b/tests/js-tests/project/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/js-tests/project/proj.android-studio/app/AndroidManifest.xml b/tests/js-tests/project/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..f9799d4df7 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/js-tests/project/proj.android-studio/app/build.gradle b/tests/js-tests/project/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..9dab38f291 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.js_tests" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/tests/js-tests/project/proj.android-studio/app/jni/Android.mk b/tests/js-tests/project/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..dab475af1c --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,23 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := js_tests_shared + +LOCAL_MODULE_FILENAME := libjs_tests + +LOCAL_SRC_FILES := main.cpp \ + ../../../Classes/AppDelegate.cpp \ + ../../../Classes/js_DrawNode3D_bindings.cpp \ + ../../../Classes/js_Effect3D_bindings.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes + +LOCAL_STATIC_LIBRARIES := cocos2d_js_static + + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=1 + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/js-bindings/proj.android) diff --git a/tests/js-tests/project/proj.android-studio/app/jni/Application.mk b/tests/js-tests/project/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..706af60331 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,15 @@ +APP_STL := gnustl_static + +# Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices +#APP_ABI := armeabi-v7a + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/js-tests/project/proj.android-studio/app/jni/main.cpp b/tests/js-tests/project/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..baf5ca9810 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,17 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); + JavaVM* vm; + env->GetJavaVM(&vm); +} diff --git a/tests/js-tests/project/proj.android-studio/app/proguard-rules.pro b/tests/js-tests/project/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/js-tests/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/js-tests/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/js-tests/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/js-tests/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/js-tests/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/js-tests/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/js-tests/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/js-tests/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/js-tests/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android-studio/app/res/values/strings.xml b/tests/js-tests/project/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..e0eefac763 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + JSTests + diff --git a/tests/js-tests/project/proj.android-studio/app/src/org/cocos2dx/js_tests/AppActivity.java b/tests/js-tests/project/proj.android-studio/app/src/org/cocos2dx/js_tests/AppActivity.java new file mode 100644 index 0000000000..72a437b604 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/app/src/org/cocos2dx/js_tests/AppActivity.java @@ -0,0 +1,80 @@ +/**************************************************************************** +Copyright (c) 2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.js_tests; + +import org.cocos2dx.js_tests.R; +import org.cocos2dx.lib.Cocos2dxActivity; +import org.cocos2dx.lib.Cocos2dxGLSurfaceView; +import org.cocos2dx.lib.Cocos2dxJavascriptJavaBridge; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Bundle; + +public class AppActivity extends Cocos2dxActivity { + + private static AppActivity app = null; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + app = this; + } + + @Override + public Cocos2dxGLSurfaceView onCreateView() { + Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); + // TestCpp should create stencil buffer + glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); + + return glSurfaceView; + } + + public static void showAlertDialog(final String title, final String message) { + app.runOnUiThread(new Runnable() { + @Override + public void run() { + AlertDialog alertDialog = new AlertDialog.Builder(app).create(); + alertDialog.setTitle(title); + alertDialog.setMessage(message); + alertDialog.setCancelable(true); + alertDialog.setIcon(R.mipmap.ic_launcher); + alertDialog.setButton("OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + app.runOnGLThread(new Runnable() { + @Override + public void run() { + + Cocos2dxJavascriptJavaBridge.evalString("cc.log(\"Javascript Java bridge!\")"); + } + }); + } + }); + alertDialog.show(); + } + }); + } + +} diff --git a/tests/js-tests/project/proj.android-studio/build.gradle b/tests/js-tests/project/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/js-tests/project/proj.android-studio/gradle.properties b/tests/js-tests/project/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/js-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/js-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/js-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/js-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/js-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/js-tests/project/proj.android-studio/gradlew b/tests/js-tests/project/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/js-tests/project/proj.android-studio/gradlew.bat b/tests/js-tests/project/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/js-tests/project/proj.android-studio/settings.gradle b/tests/js-tests/project/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..1de06f6b29 --- /dev/null +++ b/tests/js-tests/project/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') +include ':app' diff --git a/tests/js-tests/project/proj.win8.1-universal/App.Windows/js-tests.Windows.vcxproj b/tests/js-tests/project/proj.win8.1-universal/App.Windows/js-tests.Windows.vcxproj index 14c9ea25f5..057df48bb8 100644 --- a/tests/js-tests/project/proj.win8.1-universal/App.Windows/js-tests.Windows.vcxproj +++ b/tests/js-tests/project/proj.win8.1-universal/App.Windows/js-tests.Windows.vcxproj @@ -123,6 +123,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -136,6 +137,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -149,6 +151,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -162,6 +165,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -175,6 +179,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -186,6 +191,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) echo "Copying Windows 8.1 Universal App CPP template files" diff --git a/tests/js-tests/project/proj.win8.1-universal/App.WindowsPhone/js-tests.WindowsPhone.vcxproj b/tests/js-tests/project/proj.win8.1-universal/App.WindowsPhone/js-tests.WindowsPhone.vcxproj index b9b5a08fcb..bad622cc1f 100644 --- a/tests/js-tests/project/proj.win8.1-universal/App.WindowsPhone/js-tests.WindowsPhone.vcxproj +++ b/tests/js-tests/project/proj.win8.1-universal/App.WindowsPhone/js-tests.WindowsPhone.vcxproj @@ -89,6 +89,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -98,6 +99,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) @@ -107,6 +109,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -116,6 +119,7 @@ pch.h $(ProjectDir)..\..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) false + CC_ENABLE_BULLET_INTEGRATION=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) diff --git a/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js b/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js index 8881ff875f..60d38c45bb 100644 --- a/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js +++ b/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js @@ -558,9 +558,9 @@ var TestParticleDisplay = ArmatureTestLayer.extend({ this.armature.getAnimation().setSpeedScale(0.5); this.addChild(this.armature); - var p1 = new cc.ParticleSystem("res/Particles/SmallSun.plist"); + var p1 = new cc.ParticleSystem("Particles/SmallSun.plist"); p1.setTotalParticles(30); - var p2 = new cc.ParticleSystem("res/Particles/SmallSun.plist"); + var p2 = new cc.ParticleSystem("Particles/SmallSun.plist"); p2.setTotalParticles(30); var bone = new ccs.Bone("p1"); bone.addDisplay(p1, 0); diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js index 5d13cf29bb..3051d2b3b2 100644 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js +++ b/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js @@ -42,7 +42,7 @@ var ComponentsTestLayer = cc.LayerColor.extend({ createGameScene: function () { var root = new cc.Node(); var winSize = cc.director.getWinSize(); - var player = new cc.Sprite("res/components/Player.png", cc.rect(0, 0, 27, 40)); + var player = new cc.Sprite("components/Player.png", cc.rect(0, 0, 27, 40)); player.x = 30; player.y = winSize.height / 2; root.addChild(player, 1, 1); @@ -59,7 +59,7 @@ var ComponentsTestLayer = cc.LayerColor.extend({ }, toExtensionsMainLayer: function (sender) { - cc.audioEngine.stopMusic("res/Sound/background-music-aac.wav"); + cc.audioEngine.stopMusic("background-music-aac.wav"); var scene = new CocoStudioTestScene(); scene.runThisTest(); } diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js index 03dc538619..d49f7c1526 100644 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js +++ b/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js @@ -44,14 +44,14 @@ var PlayerController = ccs.ComController.extend({ onTouchesEnded: function (touch, event) { var location = touch[0].getLocation(); - var projectile = new cc.Sprite("res/components/Projectile.png", cc.rect(0, 0, 20, 20)); + var projectile = new cc.Sprite("components/Projectile.png", cc.rect(0, 0, 20, 20)); this.getOwner().parent.addChild(projectile, 1, 4); var com = ProjectileController.create(); projectile.addComponent(com); com.move(location.x, location.y); - this.getOwner().getComponent("Audio").playEffect("res/Sound/pew-pew-lei.wav"); + this.getOwner().getComponent("Audio").playEffect("pew-pew-lei.wav"); }, onExit:function(){ cc.eventManager.removeListener(this._listener1); diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js index e244174e99..ea4a515ea1 100644 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js +++ b/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js @@ -43,7 +43,7 @@ var SceneController = ccs.ComController.extend({ this._addTargetTime = 1; this._targets = []; this._projectiles = []; - this.getOwner().getComponent("Audio").playBackgroundMusic("res/Sound/background-music-aac.wav", true); + this.getOwner().getComponent("Audio").playBackgroundMusic("background-music-aac.wav", true); this.getOwner().getComponent("CCComAttribute").setInt("KillCount", 0); }, @@ -60,7 +60,7 @@ var SceneController = ccs.ComController.extend({ }, addTarget: function () { - var target = new cc.Sprite("res/components/Target.png", cc.rect(0, 0, 27, 40)); + var target = new cc.Sprite("components/Target.png", cc.rect(0, 0, 27, 40)); this.getOwner().addChild(target, 1, 2); target.addComponent(EnemyController.create()); target.tag = 2; diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js index 57042f3e62..32193417af 100644 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js +++ b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js @@ -33,7 +33,7 @@ var CustomImageLayer = cc.Layer.extend({ customImageViewReader, customImageViewReader.setProperties); - var layout = guiReader.widgetFromJsonFile("res/cocosui/CustomImageViewTest/NewProject_2_1.ExportJson"); + var layout = guiReader.widgetFromJsonFile("css-res/cocosui/CustomImageViewTest/NewProject_2_1.ExportJson"); this.addChild(layout); } }); diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js index 772f2c1c2e..3b150a183f 100644 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js +++ b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js @@ -35,7 +35,7 @@ var CustomParticleWidgetLayer = cc.Layer.extend({ var custom = CustomParticleWidget.create(); custom.setPosition(cc.p(370, 210)); - custom.setParticlePlist("res/Particles/BoilingFoam.plist"); + custom.setParticlePlist("Particles/BoilingFoam.plist"); this.addChild(custom, 10, -1); } diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js index cfff52221a..e782f88291 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js @@ -27,7 +27,7 @@ var UIButtonEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/Button/Button_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIButton/Button_1.json"); this._mainNode.addChild(root); var back_label = ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js index d5f89573a4..e9b09bd745 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js @@ -29,7 +29,7 @@ var UICheckBoxEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); var left_button = new ccui.Button(); - left_button.loadTextures("res/Images/b1.png", "res/Images/b2.png", ""); + left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); left_button.x = 240-50; left_button.y = 50; left_button.anchorX = 0.5; @@ -38,7 +38,7 @@ var UICheckBoxEditorTest = UIBaseLayer.extend({ this._mainNode.addChild(left_button, 999); var right_button = new ccui.Button(); - right_button.loadTextures("res/Images/f1.png", "res/Images/f2.png", ""); + right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); right_button.x = 240+50; right_button.y = 50; right_button.anchorX = 0.5; @@ -86,7 +86,7 @@ var UICheckBoxEditorTest = UIBaseLayer.extend({ var UICheckBoxOldTest = UICheckBoxEditorTest.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/CheckBox/checkbox_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UICheckBox/checkbox_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); @@ -100,7 +100,7 @@ var UICheckBoxOldTest = UICheckBoxEditorTest.extend({ var UICheckBoxNewTest = UICheckBoxEditorTest.extend({ ctor: function () { this._super(); - var root = ccs.load("res/cocosui/CCS/CheckBox/MainScene.json"); + var root = ccs.load("ccs-res/cocosui/UIEditorTest/UICheckBox/MainScene.json"); this._mainNode.addChild(root.node); var checkbox = ccui.helper.seekWidgetByName(root.node, "CheckBox_1"); checkbox.addEventListener(this.selectedStateEvent,this); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js index f92f400761..30a8b24e6a 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js @@ -27,7 +27,7 @@ var UIImageViewEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/ImageView/ImageView_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIImageView/ImageView_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js index 6284598fca..399c64315c 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ var LAYOUT_RES = [ - "res/cocosui/CCS/Layout/Layout/layout_1.json", - "res/cocosui/CCS/Layout/Color/color_1.json", - "res/cocosui/CCS/Layout/Gradient_Color/gradient_color_1.json", - "res/cocosui/CCS/Layout/BackgroundImage/backgroundimage_1.json", - "res/cocosui/CCS/Layout/Scale9/scale9.json", - "res/cocosui/CCS/Layout/Linear_Vertical/linear_vertical.json", - "res/cocosui/CCS/Layout/Linear_Horizontal/linear_horizontal.json", - "res/cocosui/CCS/Layout/Relative_Align_Parent/relative_align_parent.json", - "res/cocosui/CCS/Layout/Relative_Align_Location/relative_align_location.json" + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/layout_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/color_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/gradient_color_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/backgroundimage_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/scale9.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/linear_vertical.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/linear_horizontal.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/relative_align_parent.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/relative_align_location.json" ]; var LAYOUT_INDEX = 0; var UILayoutEditorTest = UIBaseLayer.extend({ @@ -45,7 +45,7 @@ var UILayoutEditorTest = UIBaseLayer.extend({ back_label.addTouchEventListener(this.backEvent, this); var left_button = new ccui.Button(); - left_button.loadTextures("res/Images/b1.png", "res/Images/b2.png", ""); + left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); left_button.x = 240-50; left_button.y = 50; left_button.anchorX = 0.5; @@ -55,7 +55,7 @@ var UILayoutEditorTest = UIBaseLayer.extend({ this._mainNode.addChild(left_button); var right_button = new ccui.Button(); - right_button.loadTextures("res/Images/f1.png", "res/Images/f2.png", ""); + right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); right_button.x = 240+50; right_button.y = 50; right_button.zOrder = 999; diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js index 54201c6dcb..11aad78a66 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ var LISTVIEW_RES = [ - "res/cocosui/CCS/ListView/Vertical/vertical_1.json", - "res/cocosui/CCS/ListView/Horizontal/horizontal_1.json" + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/vertical_1.json", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/horizontal_1.json" ]; var LISTVIEW_INDEX = 0; var UIListViewEditorTest = UIBaseLayer.extend({ @@ -41,7 +41,7 @@ var UIListViewEditorTest = UIBaseLayer.extend({ listView.addEventListener(this.selectedItemEvent,this); var left_button = new ccui.Button(); - left_button.loadTextures("res/Images/b1.png", "res/Images/b2.png", ""); + left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); left_button.x = 240-50; left_button.y = 50; left_button.anchorX = 0.5; @@ -51,7 +51,7 @@ var UIListViewEditorTest = UIBaseLayer.extend({ this._mainNode.addChild(left_button); var right_button = new ccui.Button(); - right_button.loadTextures("res/Images/f1.png", "res/Images/f2.png", ""); + right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); right_button.x = 240+50; right_button.y = 50; right_button.zOrder = 999; diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js index 677f71301b..6be9d13de9 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js @@ -30,7 +30,7 @@ var UILoadingBarEditorTest = UIBaseLayer.extend({ _loadingBar_right_to_left:null, ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/LoadingBar/loadingbar_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILoadingBar/loadingbar_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js index f2f047cb0c..d03af69b74 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js @@ -27,13 +27,13 @@ var UIWidgetAddNodeEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/WidgetAddNode/widget_add_node.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/widget_add_node.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); back_label.addTouchEventListener(this.backEvent,this); - var sprite = new cc.Sprite("res/cocosui/ccicon.png"); + var sprite = new cc.Sprite("ccs-res/cocosui/ccicon.png"); sprite.x = 240; sprite.y = 160; root.addNode(sprite,9999); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js index f50749bfe0..94c20a1838 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js @@ -27,7 +27,7 @@ var UIPageViewEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/PageView/pageview_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIPageView/pageview_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js index 16c0ce2324..6a1f9a0617 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js @@ -35,7 +35,7 @@ var UIRichTextTest = UISceneEditor.extend({ var widgetSize = this._widget.getContentSize(); var button = new ccui.Button(); button.setTouchEnabled(true); - button.loadTextures("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png", ""); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); button.setTitleText("switch"); button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); button.addTouchEventListener(this.touchEvent,this); @@ -53,9 +53,9 @@ var UIRichTextTest = UISceneEditor.extend({ var re4 = new ccui.RichElementText(4, cc.color.GREEN, 255, "And green. ", "Helvetica", 10); var re5 = new ccui.RichElementText(5, cc.color.RED, 255, "Last one is red ", "Helvetica", 10); - var reimg = new ccui.RichElementImage(6, cc.color.WHITE, 255, "res/cocosui/sliderballnormal.png"); + var reimg = new ccui.RichElementImage(6, cc.color.WHITE, 255, "ccs-res/cocosui/sliderballnormal.png"); - ccs.armatureDataManager.addArmatureFileInfo("res/cocosui/100/100.ExportJson"); + ccs.armatureDataManager.addArmatureFileInfo("ccs-res/cocosui/100/100.ExportJson"); var pAr = new ccs.Armature("100"); pAr.getAnimation().play("Animation1"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js index 6bf63a4bfc..9a3d2bfcac 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js @@ -25,9 +25,9 @@ ****************************************************************************/ var SCROLLVIEW_RES = [ - "res/cocosui/CCS/ScrollView/Vertical/vertical_1.json", - "res/cocosui/CCS/ScrollView/Horizontal/horizontal_1.json", - "res/cocosui/CCS/ScrollView/Both/both_1.json" + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/vertical_1.json", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/horizontal_1.json", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/both_1.json" ]; var SCROLLVIEW_INDEX = 0; var UIScrollViewEditorTest = UIBaseLayer.extend({ @@ -40,7 +40,7 @@ var UIScrollViewEditorTest = UIBaseLayer.extend({ back_label.addTouchEventListener(this.backEvent, this); var left_button = new ccui.Button(); - left_button.loadTextures("res/Images/b1.png", "res/Images/b2.png", ""); + left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); left_button.x = 240-50; left_button.y = 50; left_button.anchorX = 0.5; @@ -50,7 +50,7 @@ var UIScrollViewEditorTest = UIBaseLayer.extend({ this._mainNode.addChild(left_button); var right_button = new ccui.Button(); - right_button.loadTextures("res/Images/f1.png", "res/Images/f2.png", ""); + right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); right_button.x = 240+50; right_button.y = 50; right_button.zOrder = 999; diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js index 727e9cddc3..5540ba681f 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js @@ -27,7 +27,7 @@ var UISliderEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/Slider/slider_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UISlider/slider_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js index d7aed9254c..8871058d71 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js @@ -28,7 +28,7 @@ var UITextAtlasEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/LabelAtlas/labelatlas_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILabelAtlas/labelatlas_1.json"); this._mainNode.addChild(root); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js index 1b23e535e6..830038a63e 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js @@ -28,7 +28,7 @@ var UITextBMFontEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/LabelBMFont/labelbmfont_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILabelBMFont/labelbmfont_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js index e8fa7a86a1..ff1d443fbc 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js @@ -27,7 +27,7 @@ var UITextFieldEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/TextField/textfield_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UITextField/textfield_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js index ecadf762f1..46b7c20a60 100644 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js +++ b/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js @@ -28,7 +28,7 @@ var UITextEditorTest = UIBaseLayer.extend({ ctor: function () { this._super(); - var root = this._parseUIFile("res/cocosui/CCS/Label/label_1.json"); + var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILabel/label_1.json"); this._mainNode.addChild(root); var back_label =ccui.helper.seekWidgetByName(root, "back"); diff --git a/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js b/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js index 5fbd215ebc..f59b8ec35c 100644 --- a/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js +++ b/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js @@ -27,22 +27,22 @@ var g_parsersTests = [ { title: "cocostudio 1.3", test: function(){ - new CocostudioParserJsonScene("res/cocosui/CCS/ccs1_3/CCSV1_3_1.ExportJson").runThisTest(); + new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_3_1.ExportJson").runThisTest(); } },{ title: "cocostudio 1.4", test: function(){ - new CocostudioParserJsonScene("res/cocosui/CCS/ccs1_4/CCS1_4_1.ExportJson").runThisTest(); + new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_4_1.ExportJson").runThisTest(); } },{ title: "cocostudio 1.5", test: function(){ - new CocostudioParserJsonScene("res/cocosui/CCS/ccs1_5/CCS1_5_1.ExportJson").runThisTest(); + new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_5_1.ExportJson").runThisTest(); } },{ title: "cocostudio 2.1", test: function(){ - new CocostudioParserJsonScene("res/cocosui/CCS/2.1/MainScene.json").runThisTest(); + new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/2.1/MainScene.json").runThisTest(); } } ]; diff --git a/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js b/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js index 7a4238df2b..451a961640 100644 --- a/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js +++ b/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js @@ -151,7 +151,7 @@ var LoadSceneEdtiorFileTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; + file = "ccs-res/scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -183,7 +183,7 @@ var SpriteComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/SpriteComponentTest/SpriteComponentTest.json"; + file = "ccs-res/scenetest/SpriteComponentTest/SpriteComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -219,7 +219,7 @@ var ArmatureComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; + file = "ccs-res/scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -254,7 +254,7 @@ var UIComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/UIComponentTest/UIComponentTest.json"; + file = "ccs-res/scenetest/UIComponentTest/UIComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -299,7 +299,7 @@ var TmxMapComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; + file = "ccs-res/scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -340,7 +340,7 @@ var ParticleComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/ParticleComponentTest/ParticleComponentTest.json"; + file = "ccs-res/scenetest/ParticleComponentTest/ParticleComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -374,7 +374,7 @@ var EffectComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/EffectComponentTest/EffectComponentTest.json"; + file = "ccs-res/scenetest/EffectComponentTest/EffectComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -414,7 +414,7 @@ var BackgroundComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; + file = "ccs-res/scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -450,7 +450,7 @@ var AttributeComponentTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/AttributeComponentTest/AttributeComponentTest.json"; + file = "ccs-res/scenetest/AttributeComponentTest/AttributeComponentTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); @@ -488,7 +488,7 @@ var TriggerTest = SceneEditorTestLayer.extend({ onEnter: function () { this._super(); var node, - file = "res/scenetest/TriggerTest/TriggerTest.json"; + file = "ccs-res/scenetest/TriggerTest/TriggerTest.json"; if(cocoStudioOldApiFlag == 0){ cc.log("ccs.load : %s", file); var json = ccs.load(file); diff --git a/tests/js-tests/src/CocosDenshionTest/CocosDenshionTest.js b/tests/js-tests/src/CocosDenshionTest/CocosDenshionTest.js index b076eca8e1..711e514009 100644 --- a/tests/js-tests/src/CocosDenshionTest/CocosDenshionTest.js +++ b/tests/js-tests/src/CocosDenshionTest/CocosDenshionTest.js @@ -26,8 +26,8 @@ var audioEngine = cc.audioEngine; -var MUSIC_FILE = cc.sys.os == cc.sys.OS_WP8 || cc.sys.os == cc.sys.OS_WINRT ? "res/Sound/background-music-aac.wav" : "res/Sound/background.mp3"; -var EFFECT_FILE = cc.sys.os == cc.sys.OS_WP8 || cc.sys.os == cc.sys.OS_WINRT ? "res/Sound/pew-pew-lei.wav" : "res/Sound/effect2.mp3"; +var MUSIC_FILE = cc.sys.os == cc.sys.OS_WINRT ? "res/background.wav" : "res/Sound/background.mp3"; +var EFFECT_FILE = cc.sys.os == cc.sys.OS_WINRT ? "res/effect1.wav" : "res/Sound/effect2.mp3"; var _DenshionTests = [ 'Music Test' diff --git a/tests/js-tests/src/ExtensionsTest/AssetsManagerTest/AssetsManagerTest.js b/tests/js-tests/src/ExtensionsTest/AssetsManagerTest/AssetsManagerTest.js index acd1c664fe..50e66aec79 100644 --- a/tests/js-tests/src/ExtensionsTest/AssetsManagerTest/AssetsManagerTest.js +++ b/tests/js-tests/src/ExtensionsTest/AssetsManagerTest/AssetsManagerTest.js @@ -115,12 +115,12 @@ var AssetsManagerLoaderScene = TestScene.extend({ icon.y = cc.winSize.height/2; layer.addChild(icon); - this._loadingBar = new ccui.LoadingBar("res/cocosui/sliderProgress.png"); + this._loadingBar = new ccui.LoadingBar("ccs-res/cocosui/sliderProgress.png"); this._loadingBar.x = cc.visibleRect.center.x; this._loadingBar.y = cc.visibleRect.top.y - 40; layer.addChild(this._loadingBar); - this._fileLoadingBar = new ccui.LoadingBar("res/cocosui/sliderProgress.png"); + this._fileLoadingBar = new ccui.LoadingBar("ccs-res/cocosui/sliderProgress.png"); this._fileLoadingBar.x = cc.visibleRect.center.x; this._fileLoadingBar.y = cc.visibleRect.top.y - 80; layer.addChild(this._fileLoadingBar); diff --git a/tests/js-tests/src/GUITest/UIButtonTest/UIButtonTest.js b/tests/js-tests/src/GUITest/UIButtonTest/UIButtonTest.js index 2596a4f6b5..50f90d2586 100644 --- a/tests/js-tests/src/GUITest/UIButtonTest/UIButtonTest.js +++ b/tests/js-tests/src/GUITest/UIButtonTest/UIButtonTest.js @@ -34,7 +34,7 @@ var UIButtonTest = UIScene.extend({ // Create the button var button = new ccui.Button(); button.setTouchEnabled(true); - button.loadTextures("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png", ""); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); button.x = widgetSize.width / 2.0; button.y = widgetSize.height / 2.0; button.addTouchEventListener(this.touchEvent, this); @@ -79,7 +79,7 @@ var UIButtonTest_Scale9 = UIScene.extend({ var button = new ccui.Button(); button.setTouchEnabled(true); button.setScale9Enabled(true); - button.loadTextures("res/cocosui/button.png", "res/cocosui/buttonHighlighted.png", ""); + button.loadTextures("ccs-res/cocosui/button.png", "ccs-res/cocosui/buttonHighlighted.png", ""); button.x = this._widget.width / 2.0; button.y = this._widget.height / 2.0; button.setContentSize(cc.size(150, 48)); @@ -124,7 +124,7 @@ var UIButtonTest_PressedAction = UIScene.extend({ var button = new ccui.Button(); button.setTouchEnabled(true); button.setPressedActionEnabled(true); - button.loadTextures("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png", ""); + button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); button.x = widgetSize.width / 2; button.y = widgetSize.height / 2; button.addTouchEventListener(this.touchEvent ,this); @@ -165,7 +165,7 @@ var UIButtonTest_Title = UIScene.extend({ // Create the text button var textButton = new ccui.Button(); textButton.setTouchEnabled(true); - textButton.loadTextures("res/cocosui/backtotopnormal.png", "res/cocosui/backtotoppressed.png", ""); + textButton.loadTextures("ccs-res/cocosui/backtotopnormal.png", "ccs-res/cocosui/backtotoppressed.png", ""); textButton.setTitleText("Title Button"); textButton.x = widgetSize.width / 2.0; textButton.y = widgetSize.height / 2.0; @@ -218,8 +218,8 @@ var UIButtonTestRemoveSelf = UIScene.extend({ this._mainNode.addChild(layout); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png", - "res/cocosui/animationbuttonpressed.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", + "ccs-res/cocosui/animationbuttonpressed.png"); button.setPosition(layout.width / 2.0, layout.height / 2.0); button.addTouchEventListener(this.touchEvent, this); layout.addChild(button); @@ -264,8 +264,8 @@ var UIButtonTestSwitchScale9 = UIScene.extend({ this._bottomDisplayLabel.setString(""); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png", - "res/cocosui/animationbuttonpressed.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", + "ccs-res/cocosui/animationbuttonpressed.png"); button.setPosition(widgetSize.width / 2.0, widgetSize.height / 2.0); button.addTouchEventListener(this.touchEvent, this); button.setTitleText("Button Title"); @@ -313,7 +313,7 @@ var UIButtonTestZoomScale = UIScene.extend({ this._bottomDisplayLabel.setString(""); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button.setPosition(widgetSize.width / 2.0, widgetSize.height / 2.0 ); button.setPressedActionEnabled(true); button.addClickEventListener(function () { @@ -324,9 +324,9 @@ var UIButtonTestZoomScale = UIScene.extend({ button.setZoomScale(-0.5); var slider = new ccui.Slider(); - slider.loadBarTexture("res/cocosui/sliderTrack.png"); - slider.loadSlidBallTextures("res/cocosui/sliderThumb.png", "res/cocosui/sliderThumb.png", ""); - slider.loadProgressBarTexture("res/cocosui/sliderProgress.png"); + slider.loadBarTexture("ccs-res/cocosui/sliderTrack.png"); + slider.loadSlidBallTextures("ccs-res/cocosui/sliderThumb.png", "ccs-res/cocosui/sliderThumb.png", ""); + slider.loadProgressBarTexture("ccs-res/cocosui/sliderProgress.png"); slider.setPosition(widgetSize.width / 2.0 , widgetSize.height / 2.0 - 50); slider.addEventListener(this.sliderEvent, this); slider.setPercent(button.getZoomScale() * 100); @@ -382,7 +382,7 @@ var UIButtonIgnoreContentSizeTest = UIScene.extend({ this._bottomDisplayLabel.setString(""); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button.ignoreContentAdaptWithSize(false); button.setContentSize(200,100); button.setNormalizedPosition(0.3, 0.5); @@ -396,7 +396,7 @@ var UIButtonIgnoreContentSizeTest = UIScene.extend({ this.addChild(button); // Create the button - var button2 = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button2 = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button2.ignoreContentAdaptWithSize(false); button2.setContentSize(200,100); button2.setNormalizedPosition(0.8, 0.5); @@ -425,10 +425,10 @@ var UIButtonTitleEffectTest = UIScene.extend({ this._bottomDisplayLabel.setString(""); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button.setNormalizedPosition(0.3, 0.5); button.setTitleText("PLAY GAME"); - //button.setTitleFontName("fonts/Marker Felt.ttf"); + //button.setTitleFontName("Marker Felt"); button.setZoomScale(0.3); button.setScale(2.0); button.setPressedActionEnabled(true); @@ -438,7 +438,7 @@ var UIButtonTitleEffectTest = UIScene.extend({ this.addChild(button); // Create the button - var button2 = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button2 = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button2.setNormalizedPosition(0.8, 0.5); button2.setTitleText("PLAY GAME"); var title2 = button2.getTitleRenderer(); @@ -459,10 +459,10 @@ var UIButtonFlipTest = UIScene.extend({ this._bottomDisplayLabel.setString(""); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button.setNormalizedPosition(0.3, 0.5); button.setTitleText("PLAY GAME"); - //button.setTitleFontName("fonts/Marker Felt.ttf"); + //button.setTitleFontName("Marker Felt"); button.setZoomScale(0.3); button.setScale(2.0); button.setFlippedX(true); @@ -474,7 +474,7 @@ var UIButtonFlipTest = UIScene.extend({ this.addChild(titleLabel); // Create the button - var button2 = new ccui.Button("res/cocosui/animationbuttonnormal.png", "res/cocosui/animationbuttonpressed.png"); + var button2 = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png"); button2.setNormalizedPosition(0.8, 0.5); button2.setTitleText("PLAY GAME"); button2.setFlippedY(true); @@ -506,14 +506,14 @@ var UIButtonNormalDefaultTest = UIScene.extend({ this._mainNode.addChild(alert); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png"); button.setPosition(widgetSize.width / 2.0 - 80, widgetSize.height / 2.0 + 40); button.setZoomScale(0.4); button.setPressedActionEnabled(true); this._mainNode.addChild(button); // Create the button - var buttonScale9 = new ccui.Button("res/cocosui/button.png"); + var buttonScale9 = new ccui.Button("ccs-res/cocosui/button.png"); // open scale9 render buttonScale9.setScale9Enabled(true); buttonScale9.setPosition(widgetSize.width / 2.0 + 50, widgetSize.height / 2.0 + 40); @@ -541,7 +541,7 @@ var UIButtonDisableDefaultTest = UIScene.extend({ this._mainNode.addChild(alert); // Create the button - var button = new ccui.Button("res/cocosui/animationbuttonnormal.png"); + var button = new ccui.Button("ccs-res/cocosui/animationbuttonnormal.png"); button.setPosition(widgetSize.width / 2.0 - 80, widgetSize.height / 2.0 + 40); button.setZoomScale(0.4); button.setPressedActionEnabled(true); @@ -552,7 +552,7 @@ var UIButtonDisableDefaultTest = UIScene.extend({ this._mainNode.addChild(button); // Create the button - var buttonScale9 = new ccui.Button("res/cocosui/button.png"); + var buttonScale9 = new ccui.Button("ccs-res/cocosui/button.png"); // open scale9 render buttonScale9.setScale9Enabled(true); buttonScale9.setPosition(widgetSize.width / 2.0 + 50, widgetSize.height / 2.0 + 40); diff --git a/tests/js-tests/src/GUITest/UICheckBoxTest/UICheckBoxTest.js b/tests/js-tests/src/GUITest/UICheckBoxTest/UICheckBoxTest.js index 4ed941f959..0140ec0d38 100644 --- a/tests/js-tests/src/GUITest/UICheckBoxTest/UICheckBoxTest.js +++ b/tests/js-tests/src/GUITest/UICheckBoxTest/UICheckBoxTest.js @@ -34,11 +34,11 @@ var UICheckBoxTest = UIScene.extend({ // Create the checkbox var checkBox = new ccui.CheckBox(); checkBox.setTouchEnabled(true); - checkBox.loadTextures("res/cocosui/check_box_normal.png", - "res/cocosui/check_box_normal_press.png", - "res/cocosui/check_box_active.png", - "res/cocosui/check_box_normal_disable.png", - "res/cocosui/check_box_active_disable.png"); + checkBox.loadTextures("ccs-res/cocosui/check_box_normal.png", + "ccs-res/cocosui/check_box_normal_press.png", + "ccs-res/cocosui/check_box_active.png", + "ccs-res/cocosui/check_box_normal_disable.png", + "ccs-res/cocosui/check_box_active_disable.png"); checkBox.x = widgetSize.width / 2.0; checkBox.y = widgetSize.height / 2.0; checkBox.addEventListener(this.selectedStateEvent, this); @@ -85,14 +85,14 @@ var UICheckBoxDefaultBehaviorTest = UIScene.extend({ this._mainNode.addChild(alert); // Create the checkbox - var checkBox = new ccui.CheckBox("res/cocosui/check_box_normal.png", "res/cocosui/check_box_active.png"); + var checkBox = new ccui.CheckBox("ccs-res/cocosui/check_box_normal.png", "ccs-res/cocosui/check_box_active.png"); checkBox.setPosition(cc.p(widgetSize.width / 2 - 50, widgetSize.height / 2)); this._mainNode.addChild(checkBox); // Create the checkbox - var checkBox2 = new ccui.CheckBox("res/cocosui/check_box_normal.png", "res/cocosui/check_box_active.png"); + var checkBox2 = new ccui.CheckBox("ccs-res/cocosui/check_box_normal.png", "ccs-res/cocosui/check_box_active.png"); checkBox2.setPosition(cc.p(widgetSize.width / 2 - 150, widgetSize.height / 2)); checkBox2.ignoreContentAdaptWithSize(false); checkBox2.setZoomScale(0.5); @@ -102,13 +102,13 @@ var UICheckBoxDefaultBehaviorTest = UIScene.extend({ // Create the checkbox - var checkBoxDisabled = new ccui.CheckBox("res/cocosui/check_box_normal.png", "res/cocosui/check_box_active.png"); + var checkBoxDisabled = new ccui.CheckBox("ccs-res/cocosui/check_box_normal.png", "ccs-res/cocosui/check_box_active.png"); checkBoxDisabled.setPosition(cc.p(widgetSize.width / 2 + 20, widgetSize.height / 2)); checkBoxDisabled.setEnabled(false); checkBoxDisabled.setBright(false); this._mainNode.addChild(checkBoxDisabled); - var checkBoxDisabled2 = new ccui.CheckBox("res/cocosui/check_box_normal.png", "res/cocosui/check_box_active.png"); + var checkBoxDisabled2 = new ccui.CheckBox("ccs-res/cocosui/check_box_normal.png", "ccs-res/cocosui/check_box_active.png"); checkBoxDisabled2.setPosition(cc.p(widgetSize.width / 2 + 70, widgetSize.height / 2)); checkBoxDisabled2.setBright(false); checkBoxDisabled2.setSelected(true); diff --git a/tests/js-tests/src/GUITest/UIFocusTest/UIFocusTest.js b/tests/js-tests/src/GUITest/UIFocusTest/UIFocusTest.js index 6facfd3db3..7ba67664ec 100644 --- a/tests/js-tests/src/GUITest/UIFocusTest/UIFocusTest.js +++ b/tests/js-tests/src/GUITest/UIFocusTest/UIFocusTest.js @@ -128,7 +128,7 @@ var UIFocusTestHorizontal = UIFocusTestBase.extend({ var count = 3; for (var i=0; i 0 && this._camera){ + var touch = touches[0]; + var delta = touch.getDelta(); + + this._angle -= cc.degreesToRadians(delta.x); + this._camera.setPosition3D(cc.math.vec3(100*Math.sin(this._angle), 50, 100*Math.cos(this._angle))); + this._camera.lookAt(cc.math.vec3(0, 0, 0), cc.math.vec3(0, 1, 0)); + + if(delta.x * delta.x + delta.y + delta.y > 16) + this._needShootBox = false; + } + }, + + onTouchesEnded:function(touches, event){ + if(!this._needShootBox) + return; + if(touches.length > 0){ + var location = touches[0].getLocationInView(); + + var nearP = cc.math.vec3(location.x, location.y, -1); + var farP = cc.math.vec3(location.x, location.y, 1); + nearP = this._camera.unproject(nearP); + farP = this._camera.unproject(farP); + + var dir = cc.math.vec3Sub(farP, nearP); + this.shootBox(cc.math.vec3Add(this._camera.getPosition3D(), cc.math.vec3(dir.x*10, dir.y*10, dir.z*10))); + } + }, + + shootBox:function(des){ + var rbDes = cc.physics3DRigidBodyDes(); + var linearVel = cc.math.vec3Sub(des, this._camera.getPosition3D()); + linearVel.normalize(); + linearVel.x *= 100; + linearVel.y *= 100; + linearVel.z *= 100; + + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(0.5, 0.5, 0.5)); + var v = this._camera.getPosition3D(); + rbDes.originalTransform[12] = v.x; + rbDes.originalTransform[13] = v.y; + rbDes.originalTransform[14] = v.z; + var sprite = cc.PhysicsSprite3D.create("Sprite3DTest/box.c3t", rbDes); + sprite.setTexture("Images/Icon.png"); + + var rigidBody = sprite.getPhysicsObj(); + rigidBody.setLinearFactor(cc.math.vec3(1, 1, 1)); + rigidBody.setLinearVelocity(linearVel); + rigidBody.setAngularVelocity(cc.math.vec3(0, 0, 0)); + rigidBody.setCcdMotionThreshold(0.5); + rigidBody.setCcdSweptSphereRadius(0.4); + + this.addChild(sprite); + sprite.setPosition3D(this._camera.getPosition3D()); + sprite.setScale(0.5); + sprite.syncToNode(); + sprite.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE); + sprite.setCameraMask(cc.CameraFlag.USER1); + }, + + // + // Menu + // + onEnter:function () { + this._super(); + + var label = new cc.LabelTTF(this._title, "Arial", 28); + this.addChild(label, 100, BASE_TEST_TITLE_TAG); + label.x = winSize.width / 2; + label.y = winSize.height - 50; + + var label2 = new cc.LabelTTF(this._subtitle, "Thonburi", 16); + this.addChild(label2, 101, BASE_TEST_SUBTITLE_TAG); + label2.x = winSize.width / 2; + label2.y = winSize.height - 80; + + var item1 = new cc.MenuItemImage(s_pathB1, s_pathB2, this.onBackCallback, this); + var item2 = new cc.MenuItemImage(s_pathR1, s_pathR2, this.onRestartCallback, this); + var item3 = new cc.MenuItemImage(s_pathF1, s_pathF2, this.onNextCallback, this); + + item1.tag = BASE_TEST_MENUITEM_PREV_TAG; + item2.tag = BASE_TEST_MENUITEM_RESET_TAG; + item3.tag = BASE_TEST_MENUITEM_NEXT_TAG; + + var menu = new cc.Menu(item1, item2, item3); + + menu.x = 0; + menu.y = 0; + var width = item2.width, height = item2.height; + item1.x = winSize.width/2 - width*2; + item1.y = height/2 ; + item2.x = winSize.width/2; + item2.y = height/2 ; + item3.x = winSize.width/2 + width*2; + item3.y = height/2 ; + + this.addChild(menu, 102, BASE_TEST_MENU_TAG); + }, + + onRestartCallback:function (sender) { + var s = new Physics3DTestScene(); + s.addChild(restartPhysics3DTest()); + director.runScene(s); + }, + + onNextCallback:function (sender) { + var s = new Physics3DTestScene(); + s.addChild(nextPhysics3DTest()); + director.runScene(s); + }, + + onBackCallback:function (sender) { + var s = new Physics3DTestScene(); + s.addChild(previousPhysics3DTest()); + director.runScene(s); + } +}); + +var Physics3DTestScene = cc.Scene.extend({ + ctor:function () { + this._super(); + + var label = new cc.LabelTTF("Main Menu", "Arial", 20); + var menuItem = new cc.MenuItemLabel(label, this.onMainMenuCallback, this); + + var menu = new cc.Menu(menuItem); + menu.x = 0; + menu.y = 0; + menuItem.x = winSize.width - 50; + menuItem.y = 25; + this.addChild(menu); + + this.initWithPhysics(); + this.getPhysics3DWorld().setDebugDrawEnable(false); + physicsScene = this; + }, + onMainMenuCallback:function () { + var scene = new cc.Scene(); + var layer = new TestController(); + scene.addChild(layer); + director.runScene(scene); + }, + runThisTest:function (num) { + Physics3DTestIdx = (num || num == 0) ? (num - 1) : -1; + var layer = nextPhysics3DTest(); + this.addChild(layer); + + director.runScene(this); + } +}); + +var BasicPhysics3DDemo = Physics3DTestDemo.extend({ + _subtitle:"Basic Physics3D", + + ctor:function(){ + this._super(); + + var rbDes = cc.physics3DRigidBodyDes(); + rbDes.mass = 0; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(60, 1, 60)); + + var floor = cc.PhysicsSprite3D.create("Sprite3DTest/box.c3t", rbDes); + floor.setTexture("Sprite3DTest/plane.png"); + floor.setScaleX(60); + floor.setScaleZ(60); + this.addChild(floor); + floor.setCameraMask(cc.CameraFlag.USER1); + floor.syncToNode(); + //static object sync is not needed + floor.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.NONE); + + //create several boxes using PhysicsSprite3D + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(0.8, 0.8, 0.8)); + var start_x = START_POS_X - ARRAY_SIZE_X/2; + var start_y = START_POS_Y; + var start_z = START_POS_Z - ARRAY_SIZE_Z/2; + + for(var k = 0; k < ARRAY_SIZE_Y; ++k){ + for(var i = 0; i < ARRAY_SIZE_X; ++i){ + for(var j = 0; j < ARRAY_SIZE_Z; ++j){ + var x = i + start_x, + y = 5 + k + start_y, + z = j + start_z; + var sprite = cc.PhysicsSprite3D.create("Sprite3DTest/box.c3t", rbDes); + sprite.setTexture("Images/CyanSquare.png"); + sprite.setPosition3D(cc.math.vec3(x, y, z)); + sprite.syncToNode(); + sprite.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE); + sprite.setCameraMask(cc.CameraFlag.USER1); + sprite.setScale(0.8); + this.addChild(sprite); + } + } + } + + physicsScene.setPhysics3DDebugCamera(this._camera); + } +}); + +var Physics3DConstraintDemo = Physics3DTestDemo.extend({ + _subtitle:"Physics3D Constraint", + + ctor:function(){ + this._super(); + + //PhysicsSprite3d = Sprite3D + Physics3DComponent + var rbDes = cc.physics3DRigidBodyDes(); + rbDes.disableSleep = true; + rbDes.mass = 10; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(5, 5, 5)); + + var rigidBody = cc.Physics3DRigidBody.create(rbDes); + var quat = cc.math.quaternion(cc.math.vec3(0, 1, 0), cc.degreesToRadians(180)); + var component = cc.Physics3DComponent.create(rigidBody, cc.math.vec3(0, -3, 0), quat); + + var sprite = new jsb.Sprite3D("Sprite3DTest/orc.c3b"); + sprite.addComponent(component); + this.addChild(sprite); + sprite.setCameraMask(cc.CameraFlag.USER1); + sprite.setScale(0.4); + sprite.setPosition3D(cc.math.vec3(-20, 5, 0)); + component.syncToNode(); + component.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE); + + physicsScene.setPhysics3DDebugCamera(this._camera); + + //create point to point constraint + var constraint = cc.Physics3DPointToPointConstraint.create(rigidBody, cc.math.vec3(2.5, 2.5, 2.5)); + physicsScene.getPhysics3DWorld().addPhysics3DConstraint(constraint); + + //create hinge constraint + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(8, 8, 1)); + rigidBody = cc.Physics3DRigidBody.create(rbDes); + component = cc.Physics3DComponent.create(rigidBody); + sprite = new jsb.Sprite3D("Sprite3DTest/box.c3t"); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setScaleX(8); + sprite.setScaleZ(8); + sprite.setPosition3D(cc.math.vec3(5, 0, 0)); + sprite.addComponent(component); + sprite.setCameraMask(cc.CameraFlag.USER1); + this.addChild(sprite); + component.syncToNode(); + rigidBody.setAngularVelocity(cc.math.vec3(0, 3, 0)); + constraint = cc.Physics3DHingeConstraint.create(rigidBody, cc.math.vec3(4, 4, 0.5), cc.math.vec3(0, 1, 0)); + physicsScene.getPhysics3DWorld().addPhysics3DConstraint(constraint); + + //create slider constraint + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(3, 2, 3)); + rigidBody = cc.Physics3DRigidBody.create(rbDes); + component = cc.Physics3DComponent.create(rigidBody); + sprite = new jsb.Sprite3D("Sprite3DTest/box.c3t"); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setScaleX(3); + sprite.setScaleZ(3); + sprite.setPosition3D(cc.math.vec3(30, 15, 0)); + sprite.addComponent(component); + sprite.setCameraMask(cc.CameraFlag.USER1); + this.addChild(sprite); + component.syncToNode(); + rigidBody.setLinearVelocity(cc.math.vec3(0, 3, 0)); + + rbDes.mass = 0; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(3, 3, 3)); + var rigidBodyB = cc.Physics3DRigidBody.create(rbDes); + component = cc.Physics3DComponent.create(rigidBodyB); + sprite = new jsb.Sprite3D("Sprite3DTest/box.c3t"); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setScale(3); + sprite.setPosition3D(cc.math.vec3(30, 5, 0)); + sprite.addComponent(component); + sprite.setCameraMask(cc.CameraFlag.USER1); + this.addChild(sprite); + component.syncToNode(); + + var frameInA = [-4.37114e-08, 1, 0, 0, -1, -4.37114e-08, 0, 0, 0, 0, 1, 0, 0, -5, 0, 1]; + var frameInB = [-4.37114e-08, 1, 0, 0, -1, -4.37114e-08, 0, 0, 0, 0, 1, 0, 0, 5, 0, 1]; + constraint = cc.Physics3DSliderConstraint.create(rigidBody, rigidBodyB, frameInA, frameInB, false); + physicsScene.getPhysics3DWorld().addPhysics3DConstraint(constraint); + constraint.setLowerLinLimit(-5); + constraint.setUpperLinLimit(5); + + //create ConeTwist constraint + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(3, 3, 3)); + rigidBody = cc.Physics3DRigidBody.create(rbDes); + component = cc.Physics3DComponent.create(rigidBody); + sprite = new jsb.Sprite3D("Sprite3DTest/box.c3t"); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setScale(3); + sprite.setPosition3D(cc.math.vec3(-10, 5, 5)); + sprite.addComponent(component); + sprite.setCameraMask(cc.CameraFlag.USER1); + this.addChild(sprite); + component.syncToNode(); + + frameInA = [-4.37114e-08, 1, 0, 0, -1, -4.37114e-08, 0, 0, 0, 0, 1, 0, 0, -10, 0, 1]; + constraint = cc.Physics3DConeTwistConstraint.create(rigidBody, frameInA); + physicsScene.getPhysics3DWorld().addPhysics3DConstraint(constraint, true); + constraint.setLimit(cc.degreesToRadians(10), cc.degreesToRadians(10), cc.degreesToRadians(40)); + + //create 6 dof constraint + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(3, 3, 3)); + rigidBody = cc.Physics3DRigidBody.create(rbDes); + component = cc.Physics3DComponent.create(rigidBody); + sprite = new jsb.Sprite3D("Sprite3DTest/box.c3t"); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setScale(3); + sprite.setPosition3D(cc.math.vec3(30, -5, 0)); + sprite.addComponent(component); + sprite.setCameraMask(cc.CameraFlag.USER1); + this.addChild(sprite); + component.syncToNode(); + + frameInA = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; + constraint = cc.Physics3D6DofConstraint.create(rigidBody, frameInA, false); + physicsScene.getPhysics3DWorld().addPhysics3DConstraint(constraint); + constraint.setAngularLowerLimit(cc.math.vec3(0, 0, 0)); + constraint.setAngularUpperLimit(cc.math.vec3(0, 0, 0)); + constraint.setLinearLowerLimit(cc.math.vec3(-10, 0, 0)); + constraint.setLinearUpperLimit(cc.math.vec3(10, 0, 0)); + } +}); + +var Physics3DKinematicDemo = Physics3DTestDemo.extend({ + _subtitle:"Physics3D Kinematic", + + ctor:function(){ + this._super(); + + var rbDes = cc.physics3DRigidBodyDes(); + rbDes.mass = 0; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(60, 1, 60)); + + var floor = cc.PhysicsSprite3D.create("Sprite3DTest/box.c3t", rbDes); + floor.setTexture("Sprite3DTest/plane.png"); + floor.setScaleX(60); + floor.setScaleZ(60); + floor.setPosition3D(cc.math.vec3(0, -1, 0)); + this.addChild(floor); + floor.setCameraMask(cc.CameraFlag.USER1); + floor.syncToNode(); + //static object sync is not needed + floor.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.NONE); + + //create Kinematics + for(let i = 0; i < 3; ++i){ + rbDes.mass = 0; + rbDes.shape = cc.Physics3DShape.createBox(cc.math.vec3(2, 2, 2)); + + let sprite = cc.PhysicsSprite3D.create("Sprite3DTest/box.c3t", rbDes); + sprite.setTexture("Images/CyanSquare.png"); + sprite.setCameraMask(cc.CameraFlag.USER1); + let rigidBody = sprite.getPhysicsObj(); + rigidBody.setKinematic(true); + + this.addChild(sprite); + + sprite.setScale(2); + sprite.setPosition3D(cc.math.vec3(-15, 0, 15-15*i)); + let moveby = cc.moveBy(2+i, cc.math.vec3(30, 0, 0)); + sprite.runAction(cc.sequence(moveby, moveby.reverse()).repeatForever()); + } + + //create Dynamic + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createSphere(0.5); + var start_x = START_POS_X - ARRAY_SIZE_X/2; + var start_y = START_POS_Y + 5; + var start_z = START_POS_Z - ARRAY_SIZE_Z/2; + + for(var k = 0; k < ARRAY_SIZE_Y; ++k){ + for(var i = 0; i < ARRAY_SIZE_X; ++i){ + for(var j = 0; j < ARRAY_SIZE_Z; ++j){ + var x = i + start_x, + y = 5 + k + start_y, + z = j + start_z; + + rbDes.originalTransform[12] = x; + rbDes.originalTransform[13] = y; + rbDes.originalTransform[14] = z; + + var sprite = cc.PhysicsSprite3D.create("Sprite3DTest/sphere.c3b", rbDes); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setPosition3D(cc.math.vec3(x, y, z)); + sprite.syncToNode(); + sprite.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE); + sprite.setCameraMask(cc.CameraFlag.USER1); + sprite.setScale(1/sprite.getContentSize().width); + this.addChild(sprite); + } + } + } + + physicsScene.setPhysics3DDebugCamera(this._camera); + } +}); + +var Physics3DCollisionCallbackDemo = Physics3DTestDemo.extend({ + _subtitle:"Physics3D CollisionCallback", + + ctor:function(){ + this._super(); + + var rbDes = cc.physics3DRigidBodyDes(); + + var scale = 2; + var trianglesList = jsb.Bundle3D.getTrianglesList("Sprite3DTest/boss.c3b"); + + for(var i = 0; i < trianglesList.length; ++i){ + trianglesList[i].x *= scale; + trianglesList[i].y *= scale; + trianglesList[i].z *= scale; + } + + rbDes.mass = 0; + rbDes.shape = cc.Physics3DShape.createMesh(trianglesList, trianglesList.length/3); + + var rigidBody = cc.Physics3DRigidBody.create(rbDes); + var component = cc.Physics3DComponent.create(rigidBody); + var sprite = new jsb.Sprite3D("Sprite3DTest/boss.c3b"); + sprite.addComponent(component); + sprite.setRotation3D(cc.math.vec3(-90, 0, 0)); + sprite.setScale(scale); + sprite.setCameraMask(cc.CameraFlag.USER1); + this.addChild(sprite); + + rigidBody.setCollisionCallback(function(collisionInfo){ + if(collisionInfo.collisionPointList.length > 0 && collisionInfo.objA.getMask() != 0){ + var ps = jsb.PUParticleSystem3D.create("Particle3D/scripts/mp_hit_04.pu"); + ps.setPosition3D(collisionInfo.collisionPointList[0].worldPositionOnB); + ps.setScale(0.05); + ps.startParticleSystem(); + ps.setCameraMask(2); + this.addChild(ps); + + ps.runAction(cc.sequence(cc.delayTime(1), cc.callFunc(function(){ + ps.removeFromParent(); + }))); + + collisionInfo.objA.setMask(0); + } + + }, this); + + physicsScene.setPhysics3DDebugCamera(this._camera); + } +}); + +var Physics3DTerrainDemo = Physics3DTestDemo.extend({ + _subtitle:"Physics3D Terrain", + + ctor:function(){ + this._super(); + + var r = jsb.Terrain.detailMap("TerrainTest/dirt.jpg"), + g = jsb.Terrain.detailMap("TerrainTest/Grass2.jpg", 10), + b = jsb.Terrain.detailMap("TerrainTest/road.jpg"), + a = jsb.Terrain.detailMap("TerrainTest/GreenSkin.jpg", 20); + var data = jsb.Terrain.terrainData( + "TerrainTest/heightmap129.jpg", + "TerrainTest/alphamap.png", + [r, g, b, a], + cc.size(32,32), + 20, + 1 + ); + + var terrain = jsb.Terrain.create(data, jsb.Terrain.CrackFixedType.SKIRT); + terrain.setSkirtHeightRatio(3); + terrain.setLODDistance(64, 128, 192); + terrain.setMaxDetailMapAmount(4); + terrain.setCameraMask(2); + terrain.setDrawWire(false); + + var rbDes = cc.physics3DRigidBodyDes(); + rbDes.mass = 0; + + var heightData = terrain.getHeightData(); + var size = terrain.getTerrainSize(); + rbDes.shape = cc.Physics3DShape.createHeightfield(size.width, size.height, heightData, 1.0, terrain.getMinHeight(), terrain.getMaxHeight(), true, false, true); + var rigidBody = cc.Physics3DRigidBody.create(rbDes); + var component = cc.Physics3DComponent.create(rigidBody); + terrain.addComponent(component); + component.syncToNode(); + component.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.NONE); + + this.addChild(terrain); + + //create several spheres + rbDes.mass = 1; + rbDes.shape = cc.Physics3DShape.createSphere(0.5); + var start_x = START_POS_X - ARRAY_SIZE_X/2 + 5; + var start_y = START_POS_Y + 20; + var start_z = START_POS_Z - ARRAY_SIZE_Z/2; + + for(var k = 0; k < ARRAY_SIZE_Y; ++k){ + for(var i = 0; i < ARRAY_SIZE_X; ++i){ + for(var j = 0; j < ARRAY_SIZE_Z; ++j){ + var x = i + start_x, + y = 5 + k + start_y, + z = j + start_z; + + var sprite = cc.PhysicsSprite3D.create("Sprite3DTest/sphere.c3b", rbDes); + sprite.setTexture("Sprite3DTest/plane.png"); + sprite.setPosition3D(cc.math.vec3(x, y, z)); + sprite.syncToNode(); + sprite.setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE); + sprite.setCameraMask(cc.CameraFlag.USER1); + sprite.setScale(1/sprite.getContentSize().width); + this.addChild(sprite); + } + } + } + + //create mesh + var trianglesList = jsb.Bundle3D.getTrianglesList("Sprite3DTest/boss.c3b"); + rbDes.mass = 0; + rbDes.shape = cc.Physics3DShape.createMesh(trianglesList, trianglesList.length/3); + rigidBody = cc.Physics3DRigidBody.create(rbDes); + component = cc.Physics3DComponent.create(rigidBody); + var sprite = new jsb.Sprite3D("Sprite3DTest/boss.c3b"); + sprite.addComponent(component); + sprite.setRotation3D(cc.math.vec3(-90, 0, 0)); + sprite.setPosition3D(cc.math.vec3(0, 15, 0)); + sprite.setCameraMask(2); + this.addChild(sprite); + + + physicsScene.setPhysics3DDebugCamera(this._camera); + } +}); + +// +// Flow control +// +var arrayOfPhysics3DTest = [ + BasicPhysics3DDemo, + Physics3DConstraintDemo, + Physics3DKinematicDemo, + Physics3DCollisionCallbackDemo, + Physics3DTerrainDemo +]; + +var nextPhysics3DTest = function () { + Physics3DTestIdx++; + Physics3DTestIdx = Physics3DTestIdx % arrayOfPhysics3DTest.length; + + return new arrayOfPhysics3DTest[Physics3DTestIdx ](); +}; +var previousPhysics3DTest = function () { + Physics3DTestIdx--; + if (Physics3DTestIdx < 0) + Physics3DTestIdx += arrayOfPhysics3DTest.length; + + return new arrayOfPhysics3DTest[Physics3DTestIdx ](); +}; +var restartPhysics3DTest = function () { + return new arrayOfPhysics3DTest[Physics3DTestIdx ](); +}; diff --git a/tests/js-tests/src/SceneTest/SceneTest.js b/tests/js-tests/src/SceneTest/SceneTest.js index 50df170891..cf622438d6 100644 --- a/tests/js-tests/src/SceneTest/SceneTest.js +++ b/tests/js-tests/src/SceneTest/SceneTest.js @@ -43,8 +43,17 @@ var SceneTestLayer1 = cc.Layer.extend({ var item3 = new cc.MenuItemFont("Quit", function () { cc.log("quit!") }, this); + var item4 = new cc.MenuItemFont("setNotificationNode", function () { + var layerTemp = new cc.LayerColor(cc.color(0, 255, 255, 120)); + cc.director.setNotificationNode(layerTemp); + cc.log("setNotificationNode!"); + }, this); + var item5 = new cc.MenuItemFont("clearNotificationNode", function () { + cc.log("clearNotificationNode!"); + cc.director.setNotificationNode(null); + }, this); - var menu = new cc.Menu(item1, item2, item3); + var menu = new cc.Menu(item1, item2, item3, item4, item5); menu.alignItemsVertically(); this.addChild(menu); diff --git a/tests/js-tests/src/SchedulerTest/SchedulerTest.js b/tests/js-tests/src/SchedulerTest/SchedulerTest.js index ac0c3c96f5..cd0380be48 100644 --- a/tests/js-tests/src/SchedulerTest/SchedulerTest.js +++ b/tests/js-tests/src/SchedulerTest/SchedulerTest.js @@ -589,9 +589,9 @@ var SchedulerTimeScale = SchedulerTestLayer.extend({ slider = new ccui.Slider(); slider.setTouchEnabled(true); - slider.loadBarTexture("res/cocosui/sliderTrack.png"); - slider.loadSlidBallTextures("res/cocosui/sliderThumb.png", "res/cocosui/sliderThumb.png", ""); - slider.loadProgressBarTexture("res/cocosui/sliderProgress.png"); + slider.loadBarTexture("ccs-res/cocosui/sliderTrack.png"); + slider.loadSlidBallTextures("ccs-res/cocosui/sliderThumb.png", "ccs-res/cocosui/sliderThumb.png", ""); + slider.loadProgressBarTexture("ccs-res/cocosui/sliderProgress.png"); slider.x = cc.winSize.width / 2.0; slider.y = cc.winSize.height / 3.0 * 2; slider.addEventListener(this.sliderEventForGrossini, this); @@ -605,9 +605,9 @@ var SchedulerTimeScale = SchedulerTestLayer.extend({ slider = new ccui.Slider(); slider.setTouchEnabled(true); - slider.loadBarTexture("res/cocosui/sliderTrack.png"); - slider.loadSlidBallTextures("res/cocosui/sliderThumb.png", "res/cocosui/sliderThumb.png", ""); - slider.loadProgressBarTexture("res/cocosui/sliderProgress.png"); + slider.loadBarTexture("ccs-res/cocosui/sliderTrack.png"); + slider.loadSlidBallTextures("ccs-res/cocosui/sliderThumb.png", "ccs-res/cocosui/sliderThumb.png", ""); + slider.loadProgressBarTexture("ccs-res/cocosui/sliderProgress.png"); slider.x = cc.winSize.width / 2.0; slider.y = cc.winSize.height / 3.0; slider.addEventListener(this.sliderEventForGlobal, this); diff --git a/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js b/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js index f4f2973c8c..1e25b3ea78 100644 --- a/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js +++ b/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js @@ -1531,6 +1531,85 @@ var Sprite3DBasicToonShaderTest = Sprite3DTestDemo.extend({ } }); +var Sprite3DCubeMapTest = Sprite3DTestDemo.extend({ + _title:"CubeMap & Skybox Test", + _subtitle:"", + _camera:null, + _angle:0, + + ctor:function(){ + this._super(); + + var visibleSize = cc.director.getVisibleSize(); + var camera = cc.Camera.createPerspective(60, visibleSize.width/visibleSize.height, 10, 1000); + camera.setCameraFlag(cc.CameraFlag.USER1); + camera.setPosition3D(cc.math.vec3(0, 0, 50)); + + cc.eventManager.addListener({ + event:cc.EventListener.TOUCH_ALL_AT_ONCE, + onTouchesMoved:this.onTouchesMoved.bind(this) + }, this); + + //create a teap + var teapot = new jsb.Sprite3D("Sprite3DTest/teapot.c3b"); + + //create and set our custom shader + var shader = new cc.GLProgram("Sprite3DTest/cube_map.vert","Sprite3DTest/cube_map.frag"); + var state = cc.GLProgramState.create(shader); + + //create the second texture for cylinder + var textureCube = jsb.TextureCube.create("Sprite3DTest/skybox/left.jpg","Sprite3DTest/skybox/right.jpg", "Sprite3DTest/skybox/top.jpg", "Sprite3DTest/skybox/bottom.jpg", "Sprite3DTest/skybox/front.jpg", "Sprite3DTest/skybox/back.jpg"); + + //set the texture parameters + textureCube.setTexParameters(gl.LINEAR, gl.LINEAR, gl.MIRRORED_REPEAT, gl.MIRRORED_REPEAT); + + //pass the texture sampler to our custom shader + state.setUniformTexture("u_cubeTex", textureCube); + + teapot.setGLProgramState(state); + teapot.setPosition3D(cc.math.vec3(0, -5, 0)); + teapot.setRotation3D(cc.math.vec3(-90, 180, 0)); + + teapot.runAction(cc.rotateBy(1.5, cc.math.vec3(0, 30, 0)).repeatForever()); + + //pass mesh's attribute to shader + var offset = 0; + var attributeCount = teapot.getMesh().getMeshVertexAttribCount(); + for(var i = 0; i < attributeCount; ++i){ + var meshattribute = teapot.getMesh().getMeshVertexAttribute(i); + state.setVertexAttribPointer(cc.attributeNames[meshattribute.vertexAttrib], + meshattribute.size, + meshattribute.type, + gl.FALSE, + teapot.getMesh().getVertexSizeInBytes(), + offset); + offset += meshattribute.attribSizeBytes; + } + + this.addChild(teapot); + + //config skybox + var skybox = jsb.Skybox.create(); + skybox.setTexture(textureCube); + this.addChild(skybox); + skybox.setScale(700); + + this.addChild(camera); + this.setCameraMask(2); + this._camera = camera; + }, + + onTouchesMoved:function(touches, event){ + if(touches.length > 0){ + var touch = touches[0]; + var delta = touch.getDelta(); + + this._angle -= cc.degreesToRadians(delta.x); + this._camera.setPosition3D(cc.math.vec3(50*Math.sin(this._angle), 0, 50*Math.cos(this._angle))); + this._camera.lookAt(cc.math.vec3(0, 0, 0), cc.math.vec3(0, 1, 0)); + } + } +}); // // Flow control // @@ -1548,7 +1627,8 @@ var arrayOfSprite3DTest = [ Sprite3DEmptyTest, Sprite3DForceDepthTest, UseCaseSprite3D1, - UseCaseSprite3D2 + UseCaseSprite3D2, + Sprite3DCubeMapTest ]; // 3DEffect use custom shader which is not supported on WP8/WinRT yet. diff --git a/tests/js-tests/src/TerrainTest/TerrainTest.js b/tests/js-tests/src/TerrainTest/TerrainTest.js new file mode 100644 index 0000000000..3f7759cb74 --- /dev/null +++ b/tests/js-tests/src/TerrainTest/TerrainTest.js @@ -0,0 +1,426 @@ +/**************************************************************************** + Copyright (c) 2008-2010 Ricardo Quesada + Copyright (c) 2011-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +if(cc.sys.isNative)(function(){ + +var TerrainTestIdx = -1; + +var TerrainTestDemo = cc.Layer.extend({ + _title:"", + _subtitle:"", + + ctor:function () { + this._super(); + }, + + // + // Menu + // + onEnter:function () { + this._super(); + + var label = new cc.LabelTTF(this._title, "Arial", 28); + this.addChild(label, 100, BASE_TEST_TITLE_TAG); + label.x = winSize.width / 2; + label.y = winSize.height - 50; + + var label2 = new cc.LabelTTF(this._subtitle, "Thonburi", 16); + this.addChild(label2, 101, BASE_TEST_SUBTITLE_TAG); + label2.x = winSize.width / 2; + label2.y = winSize.height - 80; + + var item1 = new cc.MenuItemImage(s_pathB1, s_pathB2, this.onBackCallback, this); + var item2 = new cc.MenuItemImage(s_pathR1, s_pathR2, this.onRestartCallback, this); + var item3 = new cc.MenuItemImage(s_pathF1, s_pathF2, this.onNextCallback, this); + + item1.tag = BASE_TEST_MENUITEM_PREV_TAG; + item2.tag = BASE_TEST_MENUITEM_RESET_TAG; + item3.tag = BASE_TEST_MENUITEM_NEXT_TAG; + + var menu = new cc.Menu(item1, item2, item3); + + menu.x = 0; + menu.y = 0; + var width = item2.width, height = item2.height; + item1.x = winSize.width/2 - width*2; + item1.y = height/2 ; + item2.x = winSize.width/2; + item2.y = height/2 ; + item3.x = winSize.width/2 + width*2; + item3.y = height/2 ; + + this.addChild(menu, 102, BASE_TEST_MENU_TAG); + }, + + onRestartCallback:function (sender) { + var s = new TerrainTestScene(); + s.addChild(restartTerrainTest()); + director.runScene(s); + }, + + onNextCallback:function (sender) { + var s = new TerrainTestScene(); + s.addChild(nextTerrainTest()); + director.runScene(s); + }, + + onBackCallback:function (sender) { + var s = new TerrainTestScene(); + s.addChild(previousTerrainTest()); + director.runScene(s); + }, +}); + +TerrainTestScene = cc.Scene.extend({ + ctor:function () { + this._super(); + + var label = new cc.LabelTTF("Main Menu", "Arial", 20); + var menuItem = new cc.MenuItemLabel(label, this.onMainMenuCallback, this); + + var menu = new cc.Menu(menuItem); + menu.x = 0; + menu.y = 0; + menuItem.x = winSize.width - 50; + menuItem.y = 25; + this.addChild(menu); + }, + onMainMenuCallback:function () { + var scene = new cc.Scene(); + var layer = new TestController(); + scene.addChild(layer); + director.runScene(scene); + }, + runThisTest:function (num) { + TerrainTestIdx = (num || num == 0) ? (num - 1) : -1; + var layer = nextTerrainTest(); + this.addChild(layer); + + director.runScene(this); + } +}); + +var TerrainSimple = TerrainTestDemo.extend({ + _title:"Terrain with skirt", + _subtitle:"Drag to walkthru", + _camera:null, + + ctor:function(){ + this._super(); + + var visibleSize = cc.director.getVisibleSize(); + + //use custom camera + this._camera = cc.Camera.createPerspective(60,visibleSize.width/visibleSize.height,0.1,800); + this._camera.setCameraFlag(cc.CameraFlag.USER1); + this._camera.setPosition3D(cc.math.vec3(-1, 1.6, 4)); + this.addChild(this._camera); + + var r = jsb.Terrain.detailMap("TerrainTest/dirt.jpg", 35), + g = jsb.Terrain.detailMap("TerrainTest/Grass2.jpg", 35), + b = jsb.Terrain.detailMap("TerrainTest/road.jpg", 35), + a = jsb.Terrain.detailMap("TerrainTest/GreenSkin.jpg", 35); + var data = jsb.Terrain.terrainData( + "TerrainTest/heightmap16.jpg", + "TerrainTest/alphamap.png", + [r, g, b, a], + cc.size(32,32), + 2, + 0.1 + ); + + var terrain = jsb.Terrain.create(data, jsb.Terrain.CrackFixedType.SKIRT); + terrain.setLODDistance(3.2,6.4,9.6); + terrain.setMaxDetailMapAmount(4); + this.addChild(terrain); + terrain.setCameraMask(2); + terrain.setDrawWire(false); + + cc.eventManager.addListener({ + event:cc.EventListener.TOUCH_ALL_AT_ONCE, + onTouchesMoved:this.onTouchesMoved.bind(this) + }, this); + }, + + onTouchesMoved:function(touches, event){ + var delta = cc.director.getDeltaTime(); + var touch = touches[0]; + var location = touch.getLocation(); + var previousLocation = touch.getPreviousLocation(); + var newPos = cc.p(previousLocation.x - location.x, previousLocation.y - location.y); + + var m = this._camera.getNodeToWorldTransform3D(); + var cameraDir = cc.math.vec3(-m[8], -m[9], -m[10]); + cameraDir.normalize(); + cameraDir.y = 0; + + var cameraRightDir = cc.math.vec3(m[0], m[1], m[2]); + cameraRightDir.normalize(); + cameraRightDir.y = 0; + + var cameraPos = this._camera.getPosition3D(); + cameraPos.x += cameraDir.x * newPos.y * 0.5 *delta + cameraRightDir.x * newPos.x * 0.5 *delta; + cameraPos.y += cameraDir.y * newPos.y * 0.5 *delta + cameraRightDir.y * newPos.x * 0.5 *delta; + cameraPos.z += cameraDir.z * newPos.y * 0.5 *delta + cameraRightDir.z * newPos.x * 0.5 *delta; + this._camera.setPosition3D(cameraPos); + } +}); + +var TerrainWalkThru = (function(){ + const PlayerState = { + LEFT : 0, + RIGHT : 1, + IDLE : 2, + FORWARD : 3, + BACKWARD : 4 + }; + + const PLAYER_HEIGHT = 0; + const camera_offset = cc.math.vec3(0, 45, 60); + + var Player = jsb.Sprite3D.extend({ + _targetPos:null, + _headingAxis:null, + _headingAngle:0, + _playerState:PlayerState.IDLE, + _camera:null, + _terrain:null, + + ctor:function(file, camera, terrain){ + this._super(file); + this._camera = camera; + this._terrain = terrain; + this.scheduleUpdate(); + }, + + update:function(dt){ + switch(this._playerState){ + case PlayerState.IDLE: + break; + case PlayerState.FORWARD: + var curPos = this.getPosition3D(); + var newFaceDir = cc.math.vec3Sub(this._targetPos, curPos); + newFaceDir.y = 0; + newFaceDir.normalize(); + curPos.x += newFaceDir.x * 25 * dt; + curPos.y += newFaceDir.y * 25 * dt; + curPos.z += newFaceDir.z * 25 * dt; + this.setPosition3D(curPos); + break; + case PlayerState.BACKWARD: + break; + case PlayerState.LEFT: + this.setRotation3D(cc.math.vec3Add(this.getRotation3D(), cc.math.vec3(0, 25*dt, 0))); + break; + case PlayerState.RIGHT: + this.setRotation3D(cc.math.vec3Add(this.getRotation3D(), cc.math.vec3(0, -25*dt, 0))); + break; + default: + break; + } + + var player_h = this._terrain.getHeight(this.getPositionX(), this.getVertexZ()); + this.y = player_h + PLAYER_HEIGHT; + this._camera.setPosition3D(cc.math.vec3Add(this.getPosition3D(), camera_offset)); + + if(this._headingAxis){ + var quat = cc.math.quaternion(cc.math.vec3(0, 1, 0), -Math.PI); + var headingQ = cc.math.quaternion(this._headingAxis, this._headingAngle); + this.setRotationQuat(cc.math.quatMultiply(quat, headingQ)); + } + + this.updateState(); + }, + + turnLeft:function(){ + this._playerState = PlayerState.LEFT; + }, + + turnRight:function(){ + this._playerState = PlayerState.RIGHT; + }, + + forward:function(){ + this._playerState = PlayerState.FORWARD; + }, + + backward:function(){ + this._playerState = PlayerState.BACKWARD; + }, + + idle:function(){ + this._playerState = PlayerState.IDLE; + }, + + updateState:function(){ + if(this._playerState === PlayerState.FORWARD){ + var playerPos = cc.p(this.getPositionX(), this.getVertexZ()); + var targetPos = cc.p(this._targetPos.x, this._targetPos.z); + var dist = cc.pDistance(playerPos, targetPos); + if(dist < 1){ + this._playerState = PlayerState.IDLE; + } + } + } + }); + + return TerrainTestDemo.extend({ + _title:"Player walk around in terrain", + _subtitle:"touch to move", + _camera:null, + _player:null, + _terrain:null, + + ctor:function(){ + this._super(); + + cc.eventManager.addListener({ + event:cc.EventListener.TOUCH_ALL_AT_ONCE, + onTouchesEnded:this.onTouchesEnded.bind(this) + }, this); + + var visibleSize = cc.director.getVisibleSize(); + this._camera = cc.Camera.createPerspective(60, visibleSize.width/visibleSize.height, 0.1, 200); + this._camera.setCameraFlag(cc.CameraFlag.USER1); + this.addChild(this._camera); + + var r = jsb.Terrain.detailMap("TerrainTest/dirt.jpg"), + g = jsb.Terrain.detailMap("TerrainTest/Grass2.jpg", 10), + b = jsb.Terrain.detailMap("TerrainTest/road.jpg"), + a = jsb.Terrain.detailMap("TerrainTest/GreenSkin.jpg", 20); + var data = jsb.Terrain.terrainData( + "TerrainTest/heightmap16.jpg", + "TerrainTest/alphamap.png", + [r, g, b, a], + cc.size(32,32), + 40.0, + 2 + ); + + this._terrain = jsb.Terrain.create(data, jsb.Terrain.CrackFixedType.SKIRT); + this._terrain.setLODDistance(64, 128, 192); + this._terrain.setMaxDetailMapAmount(4); + this._terrain.setCameraMask(2); + this._terrain.setDrawWire(false); + this._terrain.setSkirtHeightRatio(3); + this.addChild(this._terrain); + + this._player = new Player("Sprite3DTest/girl.c3b", this._camera, this._terrain); + this._player.setCameraMask(2); + this._player.setScale(0.08); + this._player.y = this._terrain.getHeight(this._player.x, this._player.getVertexZ()) + PLAYER_HEIGHT; + + var animation = jsb.Animation3D.create("Sprite3DTest/girl.c3b", "Take 001"); + if(animation){ + var animate = jsb.Animate3D.create(animation); + this._player.runAction(cc.repeatForever(animate)); + } + + this.addChild(this._player); + + this._camera.setPosition3D(cc.math.vec3Add(this._player.getPosition3D(), camera_offset)); + this._camera.setRotation3D(cc.math.vec3(-45, 0, 0)); + }, + + onTouchesEnded:function(touches, event){ + var touch = touches[0]; + var location = touch.getLocationInView(); + if(this._camera && this._player){ + var nearP = cc.math.vec3(location.x, location.y, 0); + var farP = cc.math.vec3(location.x, location.y, 1); + + nearP = this._camera.unproject(nearP); + farP = this._camera.unproject(farP); + + var dir = cc.math.vec3Sub(farP, nearP); + dir.normalize(); + var rayStep = cc.math.vec3(15*dir.x, 15*dir.y, 15*dir.z); + var rayPos = nearP; + var rayStartPosition = nearP; + var lastRayPosition = rayPos; + rayPos.x += rayStep.x; + rayPos.y += rayStep.y; + rayPos.z += rayStep.z; + + // Linear search - Loop until find a point inside and outside the terrain Vector3 + var height = this._terrain.getHeight(rayPos.x, rayPos.z); + while(rayPos.y > height){ + lastRayPosition = rayPos; + rayPos.x += rayStep.x; + rayPos.y += rayStep.y; + rayPos.z += rayStep.z; + height = this._terrain.getHeight(rayPos.x, rayPos.z); + } + + var startPosition = lastRayPosition; + var endPosition = rayPos; + + for(var i = 0; i < 32; ++i){ + // Binary search pass + var middlePoint = cc.math.vec3((startPosition.x+endPosition.x)*0.5, (startPosition.y+endPosition.y)*0.5, (startPosition.z+endPosition.z)*0.5); + if(middlePoint.y < height) + endPosition = middlePoint; + else + startPosition = middlePoint; + } + + var collisionPoint = cc.math.vec3((startPosition.x+endPosition.x)*0.5, (startPosition.y+endPosition.y)*0.5, (startPosition.z+endPosition.z)*0.5); + dir = cc.math.vec3Sub(collisionPoint, this._player.getPosition3D()); + dir.y = 0; + dir.normalize(); + this._player._headingAngle = -1 * Math.acos(cc.math.vec3Dot(dir, cc.math.vec3(0, 0, -1))); + this._player._headingAxis = cc.math.vec3Cross(dir, cc.math.vec3(0, 0, -1)); + this._player._targetPos = collisionPoint; + this._player.forward(); + } + } + }); +})(); +// +// Flow control +// +var arrayOfTerrainTest = [ + TerrainSimple, + TerrainWalkThru +]; + +var nextTerrainTest = function () { + TerrainTestIdx++; + TerrainTestIdx = TerrainTestIdx % arrayOfTerrainTest.length; + + return new arrayOfTerrainTest[TerrainTestIdx ](); +}; +var previousTerrainTest = function () { + TerrainTestIdx--; + if (TerrainTestIdx < 0) + TerrainTestIdx += arrayOfTerrainTest.length; + + return new arrayOfTerrainTest[TerrainTestIdx ](); +}; +var restartTerrainTest = function () { + return new arrayOfTerrainTest[TerrainTestIdx ](); +}; + +})(); \ No newline at end of file diff --git a/tests/js-tests/src/tests-main.js b/tests/js-tests/src/tests-main.js index 6bff256fd0..eb632b6722 100644 --- a/tests/js-tests/src/tests-main.js +++ b/tests/js-tests/src/tests-main.js @@ -497,6 +497,13 @@ var testNames = [ return new ParallaxTestScene(); } }, + { + title:"Particle3D Test", + platforms: PLATFORM_JSB, + testScene:function () { + return new Particle3DTestScene(); + } + }, { title:"Particle Test", platforms: PLATFORM_ALL, @@ -523,6 +530,14 @@ var testNames = [ return new PerformanceTestScene(); } }, + { + title:"Physics3D Test", + platforms: PLATFORM_JSB, + linksrc:"src/Physics3DTest/Physics3DTest.js", + testScene:function () { + return new Physics3DTestScene(); + } + }, { title:"ProgressActions Test", platforms: PLATFORM_ALL, @@ -614,6 +629,14 @@ var testNames = [ return new S9SpriteTestScene(); } }, + { + title:"Terrain Test", + platforms: PLATFORM_JSB, + linksrc:"src/TerrainTest/TerrainTest.js", + testScene:function () { + return new TerrainTestScene(); + } + }, { title:"TextInput Test", platforms: PLATFORM_HTML5, diff --git a/tests/js-tests/src/tests_resources.js b/tests/js-tests/src/tests_resources.js index b17d38166c..1a0857663e 100644 --- a/tests/js-tests/src/tests_resources.js +++ b/tests/js-tests/src/tests_resources.js @@ -59,40 +59,40 @@ var s_tcc_issue_2 = "animations/tcc_issue_2.png"; var s_tcc_issue_1_plist = "animations/tcc_issue_1.plist"; var s_tcc_issue_2_plist = "animations/tcc_issue_2.plist"; -var s_Cowboy_json = "armatuCowboy.ExportJson"; -var s_Cowboy_plist = "armatuCowboy0.plist"; -var s_Cowboy_png = "armatuCowboy0.png"; -var s_hero_json = "armatuhero.ExportJson"; -var s_hero0_plist = "armatuhero0.plist"; -var s_hero0_png = "armatuhero0.png"; -var s_horse_json = "armatuhorse.ExportJson"; -var s_horse0_plist = "armatuhorse0.plist"; -var s_horse0_png = "armatuhorse0.png"; -var s_bear_json = "armatubear.ExportJson"; -var s_bear0_plist = "armatubear0.plist"; -var s_bear0_png = "armatubear0.png"; -var s_blood_plist = "armatublood.plist"; -var s_HeroAnimation_json = "armatuHeroAnimation.ExportJson"; -var s_HeroAnimation0_plist = "armatuHeroAnimation0.plist"; -var s_HeroAnimation0_png = "armatuHeroAnimation0.png"; -var s_cyborg_plist = "armatucyborg.plist"; -var s_cyborg_png = "armatucyborg.png"; -var s_cyborg_xml = "armatucyborg.xml"; -var s_Dragon_plist = "armatuDragon.plist"; -var s_Dragon_png = "armatuDragon.png"; -var s_Dragon_xml = "armatuDragon.xml"; -var s_knight_plist = "armatuknight.plist"; -var s_knight_png = "armatuknight.png"; -var s_knight_xml = "armatuknight.xml"; -var s_robot_plist = "armaturobot.plist"; -var s_robot_png = "armaturobot.png"; -var s_robot_xml = "armaturobot.xml"; -var s_weapon_plist = "armatuweapon.plist"; -var s_weapon_png = "armatuweapon.png"; -var s_weapon_xml = "armatuweapon.xml"; -var s_testEasing_json = "armatutestEasing.ExportJson"; -var s_testEasing0_plist = "armatutestEasing0.plist"; -var s_testEasing0_png = "armatutestEasing0.png"; +var s_Cowboy_json = "ccs-res/armature/Cowboy.ExportJson"; +var s_Cowboy_plist = "ccs-res/armature/Cowboy0.plist"; +var s_Cowboy_png = "ccs-res/armature/Cowboy0.png"; +var s_hero_json = "ccs-res/armature/hero.ExportJson"; +var s_hero0_plist = "ccs-res/armature/hero0.plist"; +var s_hero0_png = "ccs-res/armature/hero0.png"; +var s_horse_json = "ccs-res/armature/horse.ExportJson"; +var s_horse0_plist = "ccs-res/armature/horse0.plist"; +var s_horse0_png = "ccs-res/armature/horse0.png"; +var s_bear_json = "ccs-res/armature/bear.ExportJson"; +var s_bear0_plist = "ccs-res/armature/bear0.plist"; +var s_bear0_png = "ccs-res/armature/bear0.png"; +var s_blood_plist = "ccs-res/armature/blood.plist"; +var s_HeroAnimation_json = "ccs-res/armature/HeroAnimation.ExportJson"; +var s_HeroAnimation0_plist = "ccs-res/armature/HeroAnimation0.plist"; +var s_HeroAnimation0_png = "ccs-res/armature/HeroAnimation0.png"; +var s_cyborg_plist = "ccs-res/armature/cyborg.plist"; +var s_cyborg_png = "ccs-res/armature/cyborg.png"; +var s_cyborg_xml = "ccs-res/armature/cyborg.xml"; +var s_Dragon_plist = "ccs-res/armature/Dragon.plist"; +var s_Dragon_png = "ccs-res/armature/Dragon.png"; +var s_Dragon_xml = "ccs-res/armature/Dragon.xml"; +var s_knight_plist = "ccs-res/armature/knight.plist"; +var s_knight_png = "ccs-res/armature/knight.png"; +var s_knight_xml = "ccs-res/armature/knight.xml"; +var s_robot_plist = "ccs-res/armature/robot.plist"; +var s_robot_png = "ccs-res/armature/robot.png"; +var s_robot_xml = "ccs-res/armature/robot.xml"; +var s_weapon_plist = "ccs-res/armature/weapon.plist"; +var s_weapon_png = "ccs-res/armature/weapon.png"; +var s_weapon_xml = "ccs-res/armature/weapon.xml"; +var s_testEasing_json = "ccs-res/armature/testEasing.ExportJson"; +var s_testEasing0_plist = "ccs-res/armature/testEasing0.plist"; +var s_testEasing0_png = "ccs-res/armature/testEasing0.png"; var s_s9s_blocks9 = "Images/blocks9ss.png"; var s_s9s_blocks9_plist = "Images/blocks9ss.plist"; @@ -393,10 +393,10 @@ var g_box2d = [ ]; var g_cocosdeshion = [ - "Sound/background.mp3", - "Sound/effect2.mp3" - //"Sound/background.ogg", //one sound only, cc.audio can auto select other format to load if the sound format isn't supported on some browser. - //"Sound/effect2.ogg" + "background.mp3", + "effect2.mp3" + //"background.ogg", //one sound only, cc.audio can auto select other format to load if the sound format isn't supported on some browser. + //"effect2.ogg" ]; var g_parallax = [ @@ -587,374 +587,374 @@ var g_cocoStudio = [ "Images/b2.png", "Images/f1.png", "Images/f2.png", - "cocosui/CCS/Button/background.png", - "cocosui/CCS/Button/buttonBackground.png", - "cocosui/CCS/Button/buttonHighlighted.png", - "cocosui/CCS/Button/button_n.png", - "cocosui/CCS/Button/button_p.png", - "cocosui/CCS/Button/ribbon.png", - "cocosui/CCS/Button/Button_1.json", - "cocosui/CCS/CheckBox/background.png", - "cocosui/CCS/CheckBox/buttonBackground.png", - "cocosui/CCS/CheckBox/ribbon.png", - "cocosui/CCS/CheckBox/selected01.png", - "cocosui/CCS/CheckBox/selected02.png", - "cocosui/CCS/CheckBox/checkbox_1.json", - "cocosui/CCS/CheckBox/MainScene.json", - "cocosui/CCS/CheckBox/Default/CheckBox_Disable.png", - "cocosui/CCS/CheckBox/img/btn_music.png", - "cocosui/CCS/CheckBox/img/btn_sound_off.png", - "cocosui/CCS/ImageView/background.png", - "cocosui/CCS/ImageView/buttonBackground.png", - "cocosui/CCS/ImageView/buttonHighlighted.png", - "cocosui/CCS/ImageView/GUI/image.png", - "cocosui/CCS/ImageView/ribbon.png", - "cocosui/CCS/ImageView/ImageView_1.json", - "cocosui/CCS/LabelAtlas/background.png", - "cocosui/CCS/LabelAtlas/buttonBackground.png", - "cocosui/CCS/LabelAtlas/GUI/labelatlasimg.png", - "cocosui/CCS/LabelAtlas/ribbon.png", - "cocosui/CCS/LabelAtlas/labelatlas_1.json", - "cocosui/CCS/LabelBMFont/background.png", - "cocosui/CCS/LabelBMFont/buttonBackground.png", - "cocosui/CCS/LabelBMFont/GUI/missing-font.fnt", - "cocosui/CCS/LabelBMFont/GUI/missing-font.png", - "cocosui/CCS/LabelBMFont/ribbon.png", - "cocosui/CCS/LabelBMFont/labelbmfont_1.json", - "cocosui/CCS/Label/background.png", - "cocosui/CCS/Label/buttonBackground.png", - "cocosui/CCS/Label/ribbon.png", - "cocosui/CCS/Label/label_1.json", - "cocosui/CCS/Layout/BackgroundImage/background.png", - "cocosui/CCS/Layout/BackgroundImage/buttonBackground.png", - "cocosui/CCS/Layout/BackgroundImage/button_n.png", - "cocosui/CCS/Layout/BackgroundImage/button_p.png", - "cocosui/CCS/Layout/BackgroundImage/GUI/image.png", - "cocosui/CCS/Layout/BackgroundImage/Hello.png", - "cocosui/CCS/Layout/BackgroundImage/ribbon.png", - "cocosui/CCS/Layout/BackgroundImage/selected01.png", - "cocosui/CCS/Layout/BackgroundImage/selected02.png", - "cocosui/CCS/Layout/BackgroundImage/backgroundimage_1.json", - "cocosui/CCS/Layout/Color/background.png", - "cocosui/CCS/Layout/Color/buttonBackground.png", - "cocosui/CCS/Layout/Color/button_n.png", - "cocosui/CCS/Layout/Color/button_p.png", - "cocosui/CCS/Layout/Color/GUI/image.png", - "cocosui/CCS/Layout/Color/ribbon.png", - "cocosui/CCS/Layout/Color/selected01.png", - "cocosui/CCS/Layout/Color/selected02.png", - "cocosui/CCS/Layout/Color/color_1.json", - "cocosui/CCS/Layout/Layout/background.png", - "cocosui/CCS/Layout/Layout/buttonBackground.png", - "cocosui/CCS/Layout/Layout/button_n.png", - "cocosui/CCS/Layout/Layout/button_p.png", - "cocosui/CCS/Layout/Layout/GUI/image.png", - "cocosui/CCS/Layout/Layout/ribbon.png", - "cocosui/CCS/Layout/Layout/selected01.png", - "cocosui/CCS/Layout/Layout/selected02.png", - "cocosui/CCS/Layout/Layout/layout_1.json", - "cocosui/CCS/Layout/Gradient_Color/background.png", - "cocosui/CCS/Layout/Gradient_Color/buttonBackground.png", - "cocosui/CCS/Layout/Gradient_Color/button_n.png", - "cocosui/CCS/Layout/Gradient_Color/button_p.png", - "cocosui/CCS/Layout/Gradient_Color/GUI/image.png", - "cocosui/CCS/Layout/Gradient_Color/ribbon.png", - "cocosui/CCS/Layout/Gradient_Color/selected01.png", - "cocosui/CCS/Layout/Gradient_Color/selected02.png", - "cocosui/CCS/Layout/Gradient_Color/gradient_color_1.json", - "cocosui/CCS/Layout/Linear_Horizontal/background.png", - "cocosui/CCS/Layout/Linear_Horizontal/buttonBackground.png", - "cocosui/CCS/Layout/Linear_Horizontal/button_n.png", - "cocosui/CCS/Layout/Linear_Horizontal/button_p.png", - "cocosui/CCS/Layout/Linear_Horizontal/GUI/image.png", - "cocosui/CCS/Layout/Linear_Horizontal/ribbon.png", - "cocosui/CCS/Layout/Linear_Horizontal/selected01.png", - "cocosui/CCS/Layout/Linear_Horizontal/selected02.png", - "cocosui/CCS/Layout/Linear_Horizontal/linear_horizontal.json", - "cocosui/CCS/Layout/Linear_Vertical/background.png", - "cocosui/CCS/Layout/Linear_Vertical/buttonBackground.png", - "cocosui/CCS/Layout/Linear_Vertical/button_n.png", - "cocosui/CCS/Layout/Linear_Vertical/button_p.png", - "cocosui/CCS/Layout/Linear_Vertical/GUI/image.png", - "cocosui/CCS/Layout/Linear_Vertical/ribbon.png", - "cocosui/CCS/Layout/Linear_Vertical/selected01.png", - "cocosui/CCS/Layout/Linear_Vertical/selected02.png", - "cocosui/CCS/Layout/Linear_Vertical/linear_vertical.json", - "cocosui/CCS/Layout/Relative_Align_Location/background.png", - "cocosui/CCS/Layout/Relative_Align_Location/buttonBackground.png", - "cocosui/CCS/Layout/Relative_Align_Location/button_n.png", - "cocosui/CCS/Layout/Relative_Align_Location/button_p.png", - "cocosui/CCS/Layout/Relative_Align_Location/GUI/image.png", - "cocosui/CCS/Layout/Relative_Align_Location/ribbon.png", - "cocosui/CCS/Layout/Relative_Align_Location/selected01.png", - "cocosui/CCS/Layout/Relative_Align_Location/selected02.png", - "cocosui/CCS/Layout/Relative_Align_Location/relative_align_location.json", - "cocosui/CCS/Layout/Relative_Align_Parent/background.png", - "cocosui/CCS/Layout/Relative_Align_Parent/buttonBackground.png", - "cocosui/CCS/Layout/Relative_Align_Parent/button_n.png", - "cocosui/CCS/Layout/Relative_Align_Parent/button_p.png", - "cocosui/CCS/Layout/Relative_Align_Parent/GUI/image.png", - "cocosui/CCS/Layout/Relative_Align_Parent/ribbon.png", - "cocosui/CCS/Layout/Relative_Align_Parent/selected01.png", - "cocosui/CCS/Layout/Relative_Align_Parent/selected02.png", - "cocosui/CCS/Layout/Relative_Align_Parent/relative_align_parent.json", - "cocosui/CCS/Layout/Scale9/background.png", - "cocosui/CCS/Layout/Scale9/buttonBackground.png", - "cocosui/CCS/Layout/Scale9/button_n.png", - "cocosui/CCS/Layout/Scale9/button_p.png", - "cocosui/CCS/Layout/Scale9/GUI/image.png", - "cocosui/CCS/Layout/Scale9/ribbon.png", - "cocosui/CCS/Layout/Scale9/selected01.png", - "cocosui/CCS/Layout/Scale9/selected02.png", - "cocosui/CCS/Layout/Scale9/slider_bar.png", - "cocosui/CCS/Layout/Scale9/scale9.json", - "cocosui/CCS/ListView/Horizontal/background.png", - "cocosui/CCS/ListView/Horizontal/buttonBackground.png", - "cocosui/CCS/ListView/Horizontal/button_p.png", - "cocosui/CCS/ListView/Horizontal/GUI/button.png", - "cocosui/CCS/ListView/Horizontal/GUI/image.png", - "cocosui/CCS/ListView/Horizontal/ribbon.png", - "cocosui/CCS/ListView/Horizontal/horizontal_1.json", - "cocosui/CCS/ListView/Vertical/background.png", - "cocosui/CCS/ListView/Vertical/buttonBackground.png", - "cocosui/CCS/ListView/Vertical/button_p.png", - "cocosui/CCS/ListView/Vertical/GUI/button.png", - "cocosui/CCS/ListView/Vertical/GUI/image.png", - "cocosui/CCS/ListView/Vertical/ribbon.png", - "cocosui/CCS/ListView/Vertical/vertical_1.json", - "cocosui/CCS/LoadingBar/background.png", - "cocosui/CCS/LoadingBar/buttonBackground.png", - "cocosui/CCS/LoadingBar/GUI/loadingbar.png", - "cocosui/CCS/LoadingBar/ribbon.png", - "cocosui/CCS/LoadingBar/loadingbar_1.json", - "cocosui/CCS/PageView/background.png", - "cocosui/CCS/PageView/buttonBackground.png", - "cocosui/CCS/PageView/button_n.png", - "cocosui/CCS/PageView/ribbon.png", - "cocosui/CCS/PageView/pageview_1.json", - "cocosui/CCS/ScrollView/Both/background.png", - "cocosui/CCS/ScrollView/Both/buttonBackground.png", - "cocosui/CCS/ScrollView/Both/button_n.png", - "cocosui/CCS/ScrollView/Both/button_p.png", - "cocosui/CCS/ScrollView/Both/GUI/image.png", - "cocosui/CCS/ScrollView/Both/ribbon.png", - "cocosui/CCS/ScrollView/Both/selected01.png", - "cocosui/CCS/ScrollView/Both/selected02.png", - "cocosui/CCS/ScrollView/Both/both_1.json", - "cocosui/CCS/ScrollView/Horizontal/background.png", - "cocosui/CCS/ScrollView/Horizontal/buttonBackground.png", - "cocosui/CCS/ScrollView/Horizontal/button_n.png", - "cocosui/CCS/ScrollView/Horizontal/button_p.png", - "cocosui/CCS/ScrollView/Horizontal/GUI/image.png", - "cocosui/CCS/ScrollView/Horizontal/ribbon.png", - "cocosui/CCS/ScrollView/Horizontal/selected01.png", - "cocosui/CCS/ScrollView/Horizontal/selected02.png", - "cocosui/CCS/ScrollView/Horizontal/horizontal_1.json", - "cocosui/CCS/ScrollView/Vertical/background.png", - "cocosui/CCS/ScrollView/Vertical/buttonBackground.png", - "cocosui/CCS/ScrollView/Vertical/button_n.png", - "cocosui/CCS/ScrollView/Vertical/button_p.png", - "cocosui/CCS/ScrollView/Vertical/GUI/image.png", - "cocosui/CCS/ScrollView/Vertical/ribbon.png", - "cocosui/CCS/ScrollView/Vertical/selected01.png", - "cocosui/CCS/ScrollView/Vertical/selected02.png", - "cocosui/CCS/ScrollView/Vertical/vertical_1.json", - "cocosui/CCS/Slider/2014-1-26 11-42-09.png", - "cocosui/CCS/Slider/2014-1-26 11-43-52.png", - "cocosui/CCS/Slider/background.png", - "cocosui/CCS/Slider/buttonBackground.png", - "cocosui/CCS/Slider/ribbon.png", - "cocosui/CCS/Slider/silder_progressBar.png", - "cocosui/CCS/Slider/slider_bar.png", - "cocosui/CCS/Slider/slider_bar_button.png", - "cocosui/CCS/Slider/slider_1.json", - "cocosui/CCS/TextField/background.png", - "cocosui/CCS/TextField/buttonBackground.png", - "cocosui/CCS/TextField/ribbon.png", - "cocosui/CCS/TextField/textfield_1.json", - "cocosui/CCS/WidgetAddNode/background.png", - "cocosui/CCS/WidgetAddNode/buttonBackground.png", - "cocosui/CCS/WidgetAddNode/ribbon.png", - "cocosui/CCS/WidgetAddNode/widget_add_node.json", - "Sound/background-music-aac.wav", - "Sound/pew-pew-lei.wav", + "ccs-res/cocosui/UIEditorTest/UIButton/background.png", + "ccs-res/cocosui/UIEditorTest/UIButton/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIButton/buttonHighlighted.png", + "ccs-res/cocosui/UIEditorTest/UIButton/button_n.png", + "ccs-res/cocosui/UIEditorTest/UIButton/button_p.png", + "ccs-res/cocosui/UIEditorTest/UIButton/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIButton/Button_1.json", + "ccs-res/cocosui/UIEditorTest/UICheckBox/background.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/selected01.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/selected02.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/checkbox_1.json", + "ccs-res/cocosui/UIEditorTest/UICheckBox/MainScene.json", + "ccs-res/cocosui/UIEditorTest/UICheckBox/Default/CheckBox_Disable.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/img/btn_music.png", + "ccs-res/cocosui/UIEditorTest/UICheckBox/img/btn_sound_off.png", + "ccs-res/cocosui/UIEditorTest/UIImageView/background.png", + "ccs-res/cocosui/UIEditorTest/UIImageView/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIImageView/buttonHighlighted.png", + "ccs-res/cocosui/UIEditorTest/UIImageView/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UIImageView/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIImageView/ImageView_1.json", + "ccs-res/cocosui/UIEditorTest/UILabelAtlas/background.png", + "ccs-res/cocosui/UIEditorTest/UILabelAtlas/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILabelAtlas/GUI/labelatlasimg.png", + "ccs-res/cocosui/UIEditorTest/UILabelAtlas/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILabelAtlas/labelatlas_1.json", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont/background.png", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont/GUI/missing-font.fnt", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont/GUI/missing-font.png", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont/labelbmfont_1.json", + "ccs-res/cocosui/UIEditorTest/UILabel/background.png", + "ccs-res/cocosui/UIEditorTest/UILabel/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILabel/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILabel/label_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/Hello.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/backgroundimage_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Color/color_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Layout/layout_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/gradient_color_1.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/linear_horizontal.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/linear_vertical.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/relative_align_location.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/relative_align_parent.json", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/background.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/button_n.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/button_p.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/selected01.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/selected02.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/slider_bar.png", + "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/scale9.json", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/background.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/button_p.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/GUI/button.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/horizontal_1.json", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/background.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/button_p.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/GUI/button.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/vertical_1.json", + "ccs-res/cocosui/UIEditorTest/UILoadingBar/background.png", + "ccs-res/cocosui/UIEditorTest/UILoadingBar/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UILoadingBar/GUI/loadingbar.png", + "ccs-res/cocosui/UIEditorTest/UILoadingBar/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UILoadingBar/loadingbar_1.json", + "ccs-res/cocosui/UIEditorTest/UIPageView/background.png", + "ccs-res/cocosui/UIEditorTest/UIPageView/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIPageView/button_n.png", + "ccs-res/cocosui/UIEditorTest/UIPageView/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIPageView/pageview_1.json", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/background.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/button_n.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/button_p.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/selected01.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/selected02.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/both_1.json", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/background.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/button_n.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/button_p.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/selected01.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/selected02.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/horizontal_1.json", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/background.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/button_n.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/button_p.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/GUI/image.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/selected01.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/selected02.png", + "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/vertical_1.json", + "ccs-res/cocosui/UIEditorTest/UISlider/2014-1-26 11-42-09.png", + "ccs-res/cocosui/UIEditorTest/UISlider/2014-1-26 11-43-52.png", + "ccs-res/cocosui/UIEditorTest/UISlider/background.png", + "ccs-res/cocosui/UIEditorTest/UISlider/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UISlider/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UISlider/silder_progressBar.png", + "ccs-res/cocosui/UIEditorTest/UISlider/slider_bar.png", + "ccs-res/cocosui/UIEditorTest/UISlider/slider_bar_button.png", + "ccs-res/cocosui/UIEditorTest/UISlider/slider_1.json", + "ccs-res/cocosui/UIEditorTest/UITextField/background.png", + "ccs-res/cocosui/UIEditorTest/UITextField/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UITextField/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UITextField/textfield_1.json", + "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/background.png", + "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/buttonBackground.png", + "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/ribbon.png", + "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/widget_add_node.json", + "background-music-aac.wav", + "pew-pew-lei.wav", //Components "components/Player.png", "components/Projectile.png", "components/Target.png", //Scene - "scenetest/ArmatureComponentTest/ArmatureComponentTest.json", - "scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish.ExportJson", - "scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.plist", - "scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png", - "scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.plist", - "scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png", - "scenetest/ArmatureComponentTest/Images/startMenuBG.png", - "scenetest/AttributeComponentTest/AttributeComponentTest.json", - "scenetest/AttributeComponentTest/grossinis_sister1.png", - "scenetest/AttributeComponentTest/grossinis_sister2.png", - "scenetest/AttributeComponentTest/PlayerAttribute.json", - "scenetest/BackgroundComponentTest/BackgroundComponentTest.json", - "scenetest/BackgroundComponentTest/Images/startMenuBG.png", - "scenetest/BackgroundComponentTest/Misc/music_logo.mp3", - "scenetest/BackgroundComponentTest/Misc/music_logo.wav", - "scenetest/BackgroundComponentTest/Particles/qipao01.plist", - "scenetest/BackgroundComponentTest/Particles/qipao01.png", - "scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png", - "scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png", - "scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png", - "scenetest/BackgroundComponentTest/startMenu/startMenu_1.json", - "scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson", - "scenetest/EffectComponentTest/CowBoy/Cowboy0.plist", - "scenetest/EffectComponentTest/CowBoy/Cowboy0.png", - "scenetest/EffectComponentTest/EffectComponentTest.json", - "scenetest/EffectComponentTest/pew-pew-lei.wav", - "scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish.ExportJson", - "scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.plist", - "scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png", - "scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.plist", - "scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png", - "scenetest/LoadSceneEdtiorFileTest/FishJoy2.json", - "scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png", - "scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3", - "scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav", - "scenetest/LoadSceneEdtiorFileTest/Particles/qipao01.plist", - "scenetest/LoadSceneEdtiorFileTest/Particles/qipao01.png", - "scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png", - "scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png", - "scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png", - "scenetest/LoadSceneEdtiorFileTest/startMenu/startMenu_1.json", - "scenetest/ParticleComponentTest/ParticleComponentTest.json", - "scenetest/ParticleComponentTest/SmallSun.plist", - "scenetest/ParticleComponentTest/Upsidedown.plist", - "scenetest/SpriteComponentTest/grossinis_sister1.png", - "scenetest/SpriteComponentTest/grossinis_sister2.png", - "scenetest/SpriteComponentTest/SpriteComponentTest.json", - "scenetest/TmxMapComponentTest/iso-test.png", - "scenetest/TmxMapComponentTest/iso-test.tmx", - "scenetest/TmxMapComponentTest/TmxMapComponentTest.json", - "scenetest/TriggerTest/fishes/blowFish/Blowfish.ExportJson", - "scenetest/TriggerTest/fishes/blowFish/Blowfish0.plist", - "scenetest/TriggerTest/fishes/blowFish/Blowfish0.png", - "scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.plist", - "scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png", - "scenetest/TriggerTest/Images/startMenuBG.png", - "scenetest/TriggerTest/TriggerTest.json", - "scenetest/UIComponentTest/fishes/blowFish/Blowfish.ExportJson", - "scenetest/UIComponentTest/fishes/blowFish/Blowfish0.plist", - "scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png", - "scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.plist", - "scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png", - "scenetest/UIComponentTest/Images/startMenuBG.png", - "scenetest/UIComponentTest/starMenuButton/starMenuButton.ExportJson", - "scenetest/UIComponentTest/starMenuButton/starMenuButton0.plist", - "scenetest/UIComponentTest/starMenuButton/starMenuButton0.png", - "scenetest/UIComponentTest/UIComponentTest.json", + "ccs-res/scenetest/ArmatureComponentTest/ArmatureComponentTest.json", + "ccs-res/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish.ExportJson", + "ccs-res/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.plist", + "ccs-res/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png", + "ccs-res/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish.ExportJson", + "ccs-res/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.plist", + "ccs-res/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png", + "ccs-res/scenetest/ArmatureComponentTest/Images/startMenuBG.png", + "ccs-res/scenetest/AttributeComponentTest/AttributeComponentTest.json", + "ccs-res/scenetest/AttributeComponentTest/grossinis_sister1.png", + "ccs-res/scenetest/AttributeComponentTest/grossinis_sister2.png", + "ccs-res/scenetest/AttributeComponentTest/PlayerAttribute.json", + "ccs-res/scenetest/BackgroundComponentTest/BackgroundComponentTest.json", + "ccs-res/scenetest/BackgroundComponentTest/Images/startMenuBG.png", + "ccs-res/scenetest/BackgroundComponentTest/Misc/music_logo.mp3", + "ccs-res/scenetest/BackgroundComponentTest/Misc/music_logo.wav", + "ccs-res/scenetest/BackgroundComponentTest/Particles/qipao01.plist", + "ccs-res/scenetest/BackgroundComponentTest/Particles/qipao01.png", + "ccs-res/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png", + "ccs-res/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png", + "ccs-res/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png", + "ccs-res/scenetest/BackgroundComponentTest/startMenu/startMenu_1.json", + "ccs-res/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson", + "ccs-res/scenetest/EffectComponentTest/CowBoy/Cowboy0.plist", + "ccs-res/scenetest/EffectComponentTest/CowBoy/Cowboy0.png", + "ccs-res/scenetest/EffectComponentTest/EffectComponentTest.json", + "ccs-res/scenetest/EffectComponentTest/pew-pew-lei.wav", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish.ExportJson", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.plist", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish.ExportJson", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.plist", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/FishJoy2.json", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/Particles/qipao01.plist", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/Particles/qipao01.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png", + "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/startMenu_1.json", + "ccs-res/scenetest/ParticleComponentTest/ParticleComponentTest.json", + "ccs-res/scenetest/ParticleComponentTest/SmallSun.plist", + "ccs-res/scenetest/ParticleComponentTest/Upsidedown.plist", + "ccs-res/scenetest/SpriteComponentTest/grossinis_sister1.png", + "ccs-res/scenetest/SpriteComponentTest/grossinis_sister2.png", + "ccs-res/scenetest/SpriteComponentTest/SpriteComponentTest.json", + "ccs-res/scenetest/TmxMapComponentTest/iso-test.png", + "ccs-res/scenetest/TmxMapComponentTest/iso-test.tmx", + "ccs-res/scenetest/TmxMapComponentTest/TmxMapComponentTest.json", + "ccs-res/scenetest/TriggerTest/fishes/blowFish/Blowfish.ExportJson", + "ccs-res/scenetest/TriggerTest/fishes/blowFish/Blowfish0.plist", + "ccs-res/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png", + "ccs-res/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish.ExportJson", + "ccs-res/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.plist", + "ccs-res/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png", + "ccs-res/scenetest/TriggerTest/Images/startMenuBG.png", + "ccs-res/scenetest/TriggerTest/TriggerTest.json", + "ccs-res/scenetest/UIComponentTest/fishes/blowFish/Blowfish.ExportJson", + "ccs-res/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.plist", + "ccs-res/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png", + "ccs-res/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish.ExportJson", + "ccs-res/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.plist", + "ccs-res/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png", + "ccs-res/scenetest/UIComponentTest/Images/startMenuBG.png", + "ccs-res/scenetest/UIComponentTest/starMenuButton/starMenuButton.ExportJson", + "ccs-res/scenetest/UIComponentTest/starMenuButton/starMenuButton0.plist", + "ccs-res/scenetest/UIComponentTest/starMenuButton/starMenuButton0.png", + "ccs-res/scenetest/UIComponentTest/UIComponentTest.json", //parser - "cocosui/CCS/ccs1_3/CCSV1_3_1.ExportJson", - "cocosui/CCS/ccs1_3/CocostudioV1_30.plist", - "cocosui/CCS/ccs1_3/CocostudioV1_30.png", - "cocosui/CCS/ccs1_3/SmallSun.plist", - "cocosui/CCS/ccs1_3/GUI/labelatlasimg.png", - "cocosui/CCS/ccs1_3/GUI/missing-font.fnt", - "cocosui/CCS/ccs1_3/GUI/missing-font.png", - "cocosui/CCS/ccs1_4/CCS1_4_1.ExportJson", - "cocosui/CCS/ccs1_4/Cocostudio1_40.plist", - "cocosui/CCS/ccs1_4/Cocostudio1_40.png", - "cocosui/CCS/ccs1_4/SmallSun.plist", - "cocosui/CCS/ccs1_4/GUI/labelatlasimg.png", - "cocosui/CCS/ccs1_4/GUI/missing-font.fnt", - "cocosui/CCS/ccs1_4/GUI/missing-font.png", - "cocosui/CCS/ccs1_5/CCS1_5_1.ExportJson", - "cocosui/CCS/ccs1_5/Cocostudio1_50.plist", - "cocosui/CCS/ccs1_5/Cocostudio1_50.png", - "cocosui/CCS/ccs1_5/SmallSun.plist", - "cocosui/CCS/ccs1_5/GUI/labelatlasimg.png", - "cocosui/CCS/ccs1_5/GUI/missing-font.fnt", - "cocosui/CCS/ccs1_5/GUI/missing-font.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_3_1.ExportJson", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_30.plist", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_30.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/SmallSun.plist", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/GUI/labelatlasimg.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/GUI/missing-font.fnt", + "ccs-res/cocosui/UIEditorTest/cocostudio1_3/GUI/missing-font.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_4_1.ExportJson", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_40.plist", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_40.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/SmallSun.plist", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/GUI/labelatlasimg.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/GUI/missing-font.fnt", + "ccs-res/cocosui/UIEditorTest/cocostudio1_4/GUI/missing-font.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_5_1.ExportJson", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_50.plist", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_50.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/SmallSun.plist", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/GUI/labelatlasimg.png", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/GUI/missing-font.fnt", + "ccs-res/cocosui/UIEditorTest/cocostudio1_5/GUI/missing-font.png", - "cocosui/CCS/2.1/MainScene.json", - "cocosui/CCS/2.1/plist1/Plist.plist", - "cocosui/CCS/2.1/Plist/ui.plist", - "cocosui/CCS/2.1/LoadingBar/pipe2.png", - "cocosui/CCS/2.1/Slider/2013-8-13 15-44-11.png", - "cocosui/CCS/2.1/Slider/teehanlax - iOS 6 - iPhone_slider01.png", - "cocosui/CCS/2.1/particle/blue.plist", - "cocosui/CCS/2.1/Default/Slider_Back.png", - "cocosui/CCS/2.1/Default/SliderNode_Normal.png", - "cocosui/CCS/2.1/Default/SliderNode_Press.png", - "cocosui/CCS/2.1/Default/SliderNode_Disable.png", - "cocosui/CCS/2.1/Default/Slider_PressBar.png", - "cocosui/CCS/2.1/Default/defaultParticle.plist", - "cocosui/CCS/2.1/Default/TextAtlas.png", - "cocosui/CCS/2.1/fonts_weapon_001-hd.png", - "cocosui/CCS/2.1/FNT/futura.fnt", - "cocosui/CCS/2.1/Default/defaultBMFont.fnt", - "cocosui/CCS/2.1/FNT/Heiti18.fnt", + "ccs-res/cocosui/UIEditorTest/2.1/MainScene.json", + "ccs-res/cocosui/UIEditorTest/2.1/plist1/Plist.plist", + "ccs-res/cocosui/UIEditorTest/2.1/Plist/ui.plist", + "ccs-res/cocosui/UIEditorTest/2.1/LoadingBar/pipe2.png", + "ccs-res/cocosui/UIEditorTest/2.1/Slider/2013-8-13 15-44-11.png", + "ccs-res/cocosui/UIEditorTest/2.1/Slider/teehanlax - iOS 6 - iPhone_slider01.png", + "ccs-res/cocosui/UIEditorTest/2.1/particle/blue.plist", + "ccs-res/cocosui/UIEditorTest/2.1/Default/Slider_Back.png", + "ccs-res/cocosui/UIEditorTest/2.1/Default/SliderNode_Normal.png", + "ccs-res/cocosui/UIEditorTest/2.1/Default/SliderNode_Press.png", + "ccs-res/cocosui/UIEditorTest/2.1/Default/SliderNode_Disable.png", + "ccs-res/cocosui/UIEditorTest/2.1/Default/Slider_PressBar.png", + "ccs-res/cocosui/UIEditorTest/2.1/Default/defaultParticle.plist", + "ccs-res/cocosui/UIEditorTest/2.1/Default/TextAtlas.png", + "ccs-res/cocosui/UIEditorTest/2.1/fonts_weapon_001-hd.png", + "ccs-res/cocosui/UIEditorTest/2.1/FNT/futura.fnt", + "ccs-res/cocosui/UIEditorTest/2.1/Default/defaultBMFont.fnt", + "ccs-res/cocosui/UIEditorTest/2.1/FNT/Heiti18.fnt", "Particles/BoilingFoam.plist", - "cocosui/CustomImageViewTest/NewProject_2_1.ExportJson", - "cocosui/CustomImageViewTest/NewProject_20.plist", - "cocosui/CustomImageViewTest/NewProject_20.png" + "ccs-res/cocosui/CustomImageViewTest/NewProject_2_1.ExportJson", + "ccs-res/cocosui/CustomImageViewTest/NewProject_20.plist", + "ccs-res/cocosui/CustomImageViewTest/NewProject_20.png" ]; var g_ui = [ - "cocosui/switch-mask.png", - "cocosui/animationbuttonnormal.png", - "cocosui/animationbuttonpressed.png", - "cocosui/arrow.png", - "cocosui/b11.png", - "cocosui/backtotopnormal.png", - "cocosui/backtotoppressed.png", - "cocosui/bitmapFontTest2.fnt", - "cocosui/bitmapFontTest2.png", - "cocosui/button.png", - "cocosui/buttonHighlighted.png", - "cocosui/ccicon.png", - "cocosui/check_box_active.png", - "cocosui/check_box_active_disable.png", - "cocosui/check_box_active_press.png", - "cocosui/check_box_normal.png", - "cocosui/check_box_normal_disable.png", - "cocosui/check_box_normal_press.png", - "cocosui/CloseNormal.png", - "cocosui/CloseSelected.png", - "cocosui/green_edit.png", - "cocosui/grossini-aliases.png", - "cocosui/Hello.png", - "cocosui/labelatlas.png", - "cocosui/loadingbar.png", - {type:"font", name:"Marker Felt", srcs:["cocosui/Marker Felt.ttf"]}, - "cocosui/scrollviewbg.png", - "cocosui/slidbar.png", - "cocosui/sliderballnormal.png", - "cocosui/sliderballpressed.png", - "cocosui/sliderProgress.png", - "cocosui/sliderProgress2.png", - "cocosui/sliderThumb.png", - "cocosui/sliderTrack.png", - "cocosui/sliderTrack2.png", - "cocosui/slider_bar_active_9patch.png", - "cocosui/UITest/b1.png", - "cocosui/UITest/b2.png", - "cocosui/UITest/background.png", - "cocosui/UITest/buttonBackground.png", - "cocosui/UITest/f1.png", - "cocosui/UITest/f2.png", - "cocosui/UITest/r1.png", - "cocosui/UITest/r2.png", - "cocosui/UITest/ribbon.png", - "cocosui/UITest/UITest.json", - "cocosui/100/100.ExportJson", - "cocosui/100/1000.plist", - "cocosui/100/1000.png", + "ccs-res/cocosui/switch-mask.png", + "ccs-res/cocosui/animationbuttonnormal.png", + "ccs-res/cocosui/animationbuttonpressed.png", + "ccs-res/cocosui/arrow.png", + "ccs-res/cocosui/b11.png", + "ccs-res/cocosui/backtotopnormal.png", + "ccs-res/cocosui/backtotoppressed.png", + "ccs-res/cocosui/bitmapFontTest2.fnt", + "ccs-res/cocosui/bitmapFontTest2.png", + "ccs-res/cocosui/button.png", + "ccs-res/cocosui/buttonHighlighted.png", + "ccs-res/cocosui/ccicon.png", + "ccs-res/cocosui/check_box_active.png", + "ccs-res/cocosui/check_box_active_disable.png", + "ccs-res/cocosui/check_box_active_press.png", + "ccs-res/cocosui/check_box_normal.png", + "ccs-res/cocosui/check_box_normal_disable.png", + "ccs-res/cocosui/check_box_normal_press.png", + "ccs-res/cocosui/CloseNormal.png", + "ccs-res/cocosui/CloseSelected.png", + "ccs-res/cocosui/green_edit.png", + "ccs-res/cocosui/grossini-aliases.png", + "ccs-res/cocosui/Hello.png", + "ccs-res/cocosui/labelatlas.png", + "ccs-res/cocosui/loadingbar.png", + {type:"font", name:"Marker Felt", srcs:["../cpp-tests/Resources/fonts/Marker Felt.ttf"]}, + "ccs-res/cocosui/scrollviewbg.png", + "ccs-res/cocosui/slidbar.png", + "ccs-res/cocosui/sliderballnormal.png", + "ccs-res/cocosui/sliderballpressed.png", + "ccs-res/cocosui/sliderProgress.png", + "ccs-res/cocosui/sliderProgress2.png", + "ccs-res/cocosui/sliderThumb.png", + "ccs-res/cocosui/sliderTrack.png", + "ccs-res/cocosui/sliderTrack2.png", + "ccs-res/cocosui/slider_bar_active_9patch.png", + "ccs-res/cocosui/UITest/b1.png", + "ccs-res/cocosui/UITest/b2.png", + "ccs-res/cocosui/UITest/background.png", + "ccs-res/cocosui/UITest/buttonBackground.png", + "ccs-res/cocosui/UITest/f1.png", + "ccs-res/cocosui/UITest/f2.png", + "ccs-res/cocosui/UITest/r1.png", + "ccs-res/cocosui/UITest/r2.png", + "ccs-res/cocosui/UITest/ribbon.png", + "ccs-res/cocosui/UITest/UITest.json", + "ccs-res/cocosui/100/100.ExportJson", + "ccs-res/cocosui/100/1000.plist", + "ccs-res/cocosui/100/1000.png", s_s9s_blocks9_plist, - "cocosui/CloseSelected.png" + "ccs-res/cocosui/CloseSelected.png" ]; var g_performace = [ @@ -1087,6 +1087,6 @@ var g_spine = [ var g_ccs2 = [ "ActionTimeline/boy_1.csb", "ActionTimeline/armature/Cowboy0.plist", - "cocosui/UIEditorTest/UILabelBMFont_Editor/GUI/missing-font.fnt", - "cocosui/UIEditorTest/UILabelBMFont_Editor/GUI/missing-font.png" + "ccs-res/cocosui/UIEditorTest/UILabelBMFont_Editor/GUI/missing-font.fnt", + "ccs-res/cocosui/UIEditorTest/UILabelBMFont_Editor/GUI/missing-font.png" ]; diff --git a/tests/lua-empty-test/project/proj.android-studio/.gitignore b/tests/lua-empty-test/project/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/lua-empty-test/project/proj.android-studio/app/.gitignore b/tests/lua-empty-test/project/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/lua-empty-test/project/proj.android-studio/app/AndroidManifest.xml b/tests/lua-empty-test/project/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..ab2f62caf8 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/lua-empty-test/project/proj.android-studio/app/build.gradle b/tests/lua-empty-test/project/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..91b109622c --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.lua_empty_test" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/tests/lua-empty-test/project/proj.android-studio/app/jni/Android.mk b/tests/lua-empty-test/project/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..759fefdd0b --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := lua_empty_test_shared + +LOCAL_MODULE_FILENAME := liblua_empty_test + +LOCAL_SRC_FILES := main.cpp \ + ../../../Classes/AppDelegate.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \ + $(LOCAL_PATH)/../../../../../../external/lua/tolua \ + +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/lua-bindings/proj.android) diff --git a/tests/lua-empty-test/project/proj.android-studio/app/jni/Application.mk b/tests/lua-empty-test/project/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..07aa592b13 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/lua-empty-test/project/proj.android-studio/app/jni/main.cpp b/tests/lua-empty-test/project/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/tests/lua-empty-test/project/proj.android-studio/app/proguard-rules.pro b/tests/lua-empty-test/project/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/lua-empty-test/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android-studio/app/res/values/strings.xml b/tests/lua-empty-test/project/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..d5cf210926 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + LuaEmptyTest + diff --git a/tests/lua-empty-test/project/proj.android-studio/app/src/org/cocos2dx/lua_empty_test/AppActivity.java b/tests/lua-empty-test/project/proj.android-studio/app/src/org/cocos2dx/lua_empty_test/AppActivity.java new file mode 100644 index 0000000000..472c11fec5 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/app/src/org/cocos2dx/lua_empty_test/AppActivity.java @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2015 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +package org.cocos2dx.lua_empty_test; + +import org.cocos2dx.lib.Cocos2dxActivity; + +public class AppActivity extends Cocos2dxActivity { +} diff --git a/tests/lua-empty-test/project/proj.android-studio/build.gradle b/tests/lua-empty-test/project/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/lua-empty-test/project/proj.android-studio/gradle.properties b/tests/lua-empty-test/project/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/lua-empty-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/lua-empty-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/lua-empty-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/lua-empty-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/lua-empty-test/project/proj.android-studio/gradlew b/tests/lua-empty-test/project/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/lua-empty-test/project/proj.android-studio/gradlew.bat b/tests/lua-empty-test/project/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/lua-empty-test/project/proj.android-studio/settings.gradle b/tests/lua-empty-test/project/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..1de06f6b29 --- /dev/null +++ b/tests/lua-empty-test/project/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') +include ':app' diff --git a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj index 7750d25d6f..6c9ceecd58 100644 --- a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj +++ b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj @@ -1,4 +1,4 @@ - + @@ -99,11 +99,12 @@ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) $(OutDir);$(SolutionDir)$(Configuration).win32;%(AdditionalLibraryDirectories) true Windows MachineX86 + libcmt.lib;%(IgnoreSpecificDefaultLibraries) xcopy "$(ProjectDir)..\..\res" "$(OutDir)res" /D /E /I /F /Y @@ -149,11 +150,12 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) $(OutDir);$(SolutionDir)$(Configuration).win32;%(AdditionalLibraryDirectories) Windows MachineX86 true + libcmt.lib diff --git a/tests/lua-game-controller-test/project/proj.android-studio/.gitignore b/tests/lua-game-controller-test/project/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/.gitignore b/tests/lua-game-controller-test/project/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/AndroidManifest.xml b/tests/lua-game-controller-test/project/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..fabdbb6491 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle b/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..60fbff611d --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.LuaGameControllerTest" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx_with_controller') +} diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/jni/Android.mk b/tests/lua-game-controller-test/project/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..5736173d0b --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,24 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := lua_game_controller_test_shared + +LOCAL_MODULE_FILENAME := liblua_game_controller + +LOCAL_SRC_FILES := main.cpp \ + ../../../Classes/AppDelegate.cpp \ + ../../../../../../cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp \ + ../../../../../../cocos/scripting/lua-bindings/manual/controller/lua_cocos2dx_controller_manual.cpp \ + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \ + $(LOCAL_PATH)/../../../../../../external/lua/tolua \ + $(LOCAL_PATH)/../../../../../../cocos/scripting/lua-bindings/auto \ + $(LOCAL_PATH)/../../../../../../cocos/scripting/lua-bindings/manual\controller \ + $(LOCAL_PATH)/../../../../../../cocos/base + +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/lua-bindings/proj.android) diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/jni/Application.mk b/tests/lua-game-controller-test/project/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..07aa592b13 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/jni/main.cpp b/tests/lua-game-controller-test/project/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..882c5632e7 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new (std::nothrow) AppDelegate(); +} diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/proguard-rules.pro b/tests/lua-game-controller-test/project/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/res/values/strings.xml b/tests/lua-game-controller-test/project/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..feebb709fc --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + LuaGameControllerTest + diff --git a/tests/lua-game-controller-test/project/proj.android-studio/app/src/org/cocos2dx/LuaGameControllerTest/AppActivity.java b/tests/lua-game-controller-test/project/proj.android-studio/app/src/org/cocos2dx/LuaGameControllerTest/AppActivity.java new file mode 100644 index 0000000000..bde8a217f0 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/app/src/org/cocos2dx/LuaGameControllerTest/AppActivity.java @@ -0,0 +1,44 @@ +/**************************************************************************** + Copyright (c) 2015 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +package org.cocos2dx.LuaGameControllerTest; + +import org.cocos2dx.lib.GameControllerActivity; + +import android.os.Bundle; + +public class AppActivity extends GameControllerActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + //The standard controller,without doing anything special. e.g: Amazon Fire TV + + //Manually specify an adapter. + this.connectController(DRIVERTYPE_NIBIRU); + //this.connectController(DRIVERTYPE_MOGA); + //this.connectController(DRIVERTYPE_OUYA); + } +} diff --git a/tests/lua-game-controller-test/project/proj.android-studio/build.gradle b/tests/lua-game-controller-test/project/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/lua-game-controller-test/project/proj.android-studio/gradle.properties b/tests/lua-game-controller-test/project/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/lua-game-controller-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/lua-game-controller-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/lua-game-controller-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/lua-game-controller-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/lua-game-controller-test/project/proj.android-studio/gradlew b/tests/lua-game-controller-test/project/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/lua-game-controller-test/project/proj.android-studio/gradlew.bat b/tests/lua-game-controller-test/project/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle b/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..5b5eda1247 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx_with_controller' +project(':libcocos2dx_with_controller').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx-with-controller') +include ':app' diff --git a/tests/lua-tests/project/Classes/lua_module_register.h b/tests/lua-tests/project/Classes/lua_module_register.h index 1f560f4ac3..446d0a0950 100644 --- a/tests/lua-tests/project/Classes/lua_module_register.h +++ b/tests/lua-tests/project/Classes/lua_module_register.h @@ -10,6 +10,7 @@ #include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h" #include "3d/lua_cocos2dx_3d_manual.h" #include "audioengine/lua_cocos2dx_audioengine_manual.h" +#include "physics3d/lua_cocos2dx_physics3d_manual.h" int lua_module_register(lua_State* L) @@ -24,6 +25,9 @@ int lua_module_register(lua_State* L) register_cocosdenshion_module(L); register_cocos3d_module(L); register_audioengine_module(L); +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + register_physics3d_module(L); +#endif return 1; } diff --git a/tests/lua-tests/project/proj.android-studio/.gitignore b/tests/lua-tests/project/proj.android-studio/.gitignore new file mode 100644 index 0000000000..9c4de5825b --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/tests/lua-tests/project/proj.android-studio/app/.gitignore b/tests/lua-tests/project/proj.android-studio/app/.gitignore new file mode 100644 index 0000000000..1de99493d6 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/.gitignore @@ -0,0 +1,2 @@ +/build +/jniLibs diff --git a/tests/lua-tests/project/proj.android-studio/app/AndroidManifest.xml b/tests/lua-tests/project/proj.android-studio/app/AndroidManifest.xml new file mode 100644 index 0000000000..c246fd87b5 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/lua-tests/project/proj.android-studio/app/build.gradle b/tests/lua-tests/project/proj.android-studio/app/build.gradle new file mode 100644 index 0000000000..079457bf84 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "org.cocos2dx.lua_tests" + minSdkVersion 10 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + + } + + sourceSets.main { + java.srcDir "src" + res.srcDir "res" + jniLibs.srcDir "libs" + manifest.srcFile "AndroidManifest.xml" + assets.srcDir "assets" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile project(':libcocos2dx') +} diff --git a/tests/lua-tests/project/proj.android-studio/app/jni/Android.mk b/tests/lua-tests/project/proj.android-studio/app/jni/Android.mk new file mode 100644 index 0000000000..9b29c5b7c6 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/jni/Android.mk @@ -0,0 +1,21 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := lua_tests_shared + +LOCAL_MODULE_FILENAME := liblua_tests + +LOCAL_SRC_FILES += main.cpp \ + ../../../Classes/AppDelegate.cpp \ + ../../../Classes/lua_assetsmanager_test_sample.cpp \ + ../../../Classes/lua_test_bindings.cpp + + +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../Classes + +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/lua-bindings/proj.android) diff --git a/tests/lua-tests/project/proj.android-studio/app/jni/Application.mk b/tests/lua-tests/project/proj.android-studio/app/jni/Application.mk new file mode 100644 index 0000000000..18444678c9 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/jni/Application.mk @@ -0,0 +1,13 @@ +APP_STL := gnustl_static + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/lua-tests/project/proj.android-studio/app/jni/main.cpp b/tests/lua-tests/project/proj.android-studio/app/jni/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/jni/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/tests/lua-tests/project/proj.android-studio/app/proguard-rules.pro b/tests/lua-tests/project/proj.android-studio/app/proguard-rules.pro new file mode 100644 index 0000000000..6618e28017 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/lua-tests/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..45ee51d15f Binary files /dev/null and b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0dd2a60899 Binary files /dev/null and b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a32f16f930 Binary files /dev/null and b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..332f268edc Binary files /dev/null and b/tests/lua-tests/project/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android-studio/app/res/values/strings.xml b/tests/lua-tests/project/proj.android-studio/app/res/values/strings.xml new file mode 100644 index 0000000000..690361df4a --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/res/values/strings.xml @@ -0,0 +1,3 @@ + + LuaTests + diff --git a/tests/lua-tests/project/proj.android-studio/app/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java b/tests/lua-tests/project/proj.android-studio/app/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java new file mode 100644 index 0000000000..969fb7be47 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java @@ -0,0 +1,38 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + ****************************************************************************/ +package com.cocos2dx.sample.LuaJavaBridgeTest; + +import org.cocos2dx.lib.Cocos2dxLuaJavaBridge; + +public class LuaJavaBridgeTest +{ + public static int addTwoNumbers(final int num1,final int num2){ + return num1 + num2; + } + + public static void callbackLua(final String tipInfo,final int luaFunc){ + Cocos2dxLuaJavaBridge.callLuaFunctionWithString(luaFunc, "success"); + Cocos2dxLuaJavaBridge.releaseLuaFunction(luaFunc); + } +} diff --git a/tests/lua-tests/project/proj.android-studio/app/src/org/cocos2dx/lua_tests/AppActivity.java b/tests/lua-tests/project/proj.android-studio/app/src/org/cocos2dx/lua_tests/AppActivity.java new file mode 100644 index 0000000000..3931aa4f01 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/app/src/org/cocos2dx/lua_tests/AppActivity.java @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2015 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +package org.cocos2dx.lua_tests; + +import org.cocos2dx.lib.Cocos2dxActivity; +import org.cocos2dx.lib.Cocos2dxGLSurfaceView; + +public class AppActivity extends Cocos2dxActivity{ + + public Cocos2dxGLSurfaceView onCreateView() { + Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); + // Tests should create stencil buffer + glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); + + return glSurfaceView; + } +} diff --git a/tests/lua-tests/project/proj.android-studio/build.gradle b/tests/lua-tests/project/proj.android-studio/build.gradle new file mode 100644 index 0000000000..9405f3fd18 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/build.gradle @@ -0,0 +1,19 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/tests/lua-tests/project/proj.android-studio/gradle.properties b/tests/lua-tests/project/proj.android-studio/gradle.properties new file mode 100644 index 0000000000..1d3591c8a4 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/tests/lua-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar b/tests/lua-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..8c0fb64a86 Binary files /dev/null and b/tests/lua-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/lua-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/tests/lua-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/tests/lua-tests/project/proj.android-studio/gradlew b/tests/lua-tests/project/proj.android-studio/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tests/lua-tests/project/proj.android-studio/gradlew.bat b/tests/lua-tests/project/proj.android-studio/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tests/lua-tests/project/proj.android-studio/settings.gradle b/tests/lua-tests/project/proj.android-studio/settings.gradle new file mode 100644 index 0000000000..1de06f6b29 --- /dev/null +++ b/tests/lua-tests/project/proj.android-studio/settings.gradle @@ -0,0 +1,3 @@ +include ':libcocos2dx' +project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') +include ':app' diff --git a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj index c0c8031646..054c4e89fa 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -1,4 +1,4 @@ - + @@ -77,7 +77,7 @@ OldStyle EnableFastChecks Disabled - WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) 4267;4251;4244;%(DisableSpecificWarnings) true @@ -86,7 +86,8 @@ MachineX86 true $(OutDir);$(SolutionDir)$(Configuration).win32;%(AdditionalLibraryDirectories) - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) + libcmt.lib 0x0409 @@ -129,7 +130,7 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y ProgramDatabase - WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions) 4267;4251;4244;%(DisableSpecificWarnings) true @@ -137,8 +138,9 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y Windows MachineX86 $(OutDir);$(SolutionDir)$(Configuration).win32;%(AdditionalLibraryDirectories) - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;%(AdditionalDependencies) true + libcmt.lib 0x0409 diff --git a/tests/lua-tests/src/Physics3DTest/Physics3DTest.lua b/tests/lua-tests/src/Physics3DTest/Physics3DTest.lua new file mode 100644 index 0000000000..0e47383996 --- /dev/null +++ b/tests/lua-tests/src/Physics3DTest/Physics3DTest.lua @@ -0,0 +1,712 @@ + +local START_POS_X = -0.5 +local START_POS_Y = -2.5 +local START_POS_Z = -0.5 + +local ARRAY_SIZE_X = 4 +local ARRAY_SIZE_Y = 3 +local ARRAY_SIZE_Z = 4 +---------------------------------------- +----Physics3DTestDemo +---------------------------------------- +local Physics3DTestDemo = class("Physics3DTestDemo", function () + -- body + local layer = cc.Layer:create() + return layer +end) + +function Physics3DTestDemo:ctor() + + Helper.initWithLayer(self) + Helper.titleLabel:setString(self:title()) + Helper.subtitleLabel:setString(self:subtitle()) + + local function onNodeEvent(event) + if "enter" == event then + self:onEnter() + elseif "exit" == event then + self:onExit() + end + end + + self:registerScriptHandler(onNodeEvent) +end + +function Physics3DTestDemo:title() + return "Physics3D Test" +end + +function Physics3DTestDemo:subtitle() + return "" +end + +function Physics3DTestDemo:shootBox(des) + local rbDes = {} + local cameraPosition = self._camera:getPosition3D() + local linearVec = cc.vec3normalize(cc.vec3(des.x - cameraPosition.x, des.y - cameraPosition.y, des.z - cameraPosition.z)) + linearVec = cc.vec3(linearVec.x * 100, linearVec.y * 100, linearVec.z * 100) + + rbDes.originalTransform = cc.mat4.translate(cc.mat4.createIdentity(), self._camera:getPosition3D()) + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(0.5, 0.5, 0.5)) + + local sprite = cc.PhysicsSprite3D:create("Sprite3DTest/box.c3t", rbDes) + sprite:setTexture("Images/Icon.png") + + local rigidBody = sprite:getPhysicsObj() + rigidBody:setLinearFactor(cc.vec3(1.0, 1.0, 1.0)) + rigidBody:setLinearVelocity(linearVec) + rigidBody:setAngularVelocity(cc.vec3(0.0, 0.0, 0.0)) + rigidBody:setCcdMotionThreshold(0.5) + rigidBody:setCcdSweptSphereRadius(0.4) + + self:addChild(sprite) + sprite:setPosition3D(self._camera:getPosition3D()) + sprite:setScale(0.5) + sprite:syncToNode() + + --optimize, only sync node to physics + sprite:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE) --sync node to physics + + sprite:setCameraMask(cc.CameraFlag.USER1) +end + +function Physics3DTestDemo:onEnter() + local scene = cc.Director:getInstance():getRunningScene() + if nil ~= scene then + self._physicsScene = scene + local physics3DWorld = scene:getPhysics3DWorld() + physics3DWorld:setDebugDrawEnable(false) + + local size = cc.Director:getInstance():getWinSize() + self._camera = cc.Camera:createPerspective(30.0, size.width / size.height, 1.0, 1000.0) + self._camera:setPosition3D(cc.vec3(0.0, 50.0, 100.0)) + self._camera:lookAt(cc.vec3(0.0, 0.0, 0.0), cc.vec3(0.0, 1.0, 0.0)) + self._camera:setCameraFlag(cc.CameraFlag.USER1) + self:addChild(self._camera) + + if Helper.index ~= 2 then + local listener = cc.EventListenerTouchAllAtOnce:create() + listener:registerScriptHandler(function(touches, event) + self._needShootBox = true + end,cc.Handler.EVENT_TOUCHES_BEGAN) + + listener:registerScriptHandler(function(touches, event) + + if #touches > 0 and self._camera ~= nil then + local touch = touches[1] + local delta = touch:getDelta() + + self._angle = self._angle - delta.x * math.pi / 180.0 + self._camera:setPosition3D(cc.vec3(100.0 * math.sin(self._angle), 50.0, 100.0 * math.cos(self._angle))) + self._camera:lookAt(cc.vec3(0.0, 0.0, 0.0), cc.vec3(0.0, 1.0, 0.0)) + + if (delta.x * delta.x + delta.y * delta.y) > 16 then + self._needShootBox = false + end + end + end, cc.Handler.EVENT_TOUCHES_MOVED) + + listener:registerScriptHandler(function(touches, event) + if self._needShootBox == false then + return + end + + if #touches > 0 then + local location = touches[1]:getLocationInView() + local nearP = cc.vec3(location.x, location.y, -1.0) + local farP = cc.vec3(location.x, location.y, 1.0) + nearP = self._camera:unproject(nearP) + farP = self._camera:unproject(farP) + + local dir = cc.vec3(farP.x - nearP.x, farP.y - nearP.y, farP.z - nearP.z) + local cameraPosition = self._camera:getPosition3D() + self:shootBox(cc.vec3(cameraPosition.x + dir.x * 10, cameraPosition.y + dir.y * 10, cameraPosition.z + dir.z * 10)) + end + end, cc.Handler.EVENT_TOUCHES_ENDED) + + local eventDispatcher = self:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) + end + + local ttfConfig = {} + ttfConfig.fontFilePath = "fonts/arial.ttf" + ttfConfig.fontSize = 10 + local label = cc.Label:createWithTTF(ttfConfig,"DebugDraw OFF") + local menuItem = cc.MenuItemLabel:create(label) + menuItem:registerScriptTapHandler(function (tag, sender) + if physics3DWorld:isDebugDrawEnabled() then + physics3DWorld:setDebugDrawEnable(false) + label:setString("DebugDraw OFF") + else + physics3DWorld:setDebugDrawEnable(true) + label:setString("DebugDraw ON") + end + end) + + local menu = cc.Menu:create(menuItem) + menu:setPosition(cc.p(0.0,0.0)) + menuItem:setAnchorPoint(cc.p(0.0, 1.0)) + menuItem:setPosition(cc.p(VisibleRect:left().x, VisibleRect:top().y-50)) + self:addChild(menu) + + self._angle = 0.0 + + self:extend() + end +end + +function Physics3DTestDemo:onExit() + +end + +function Physics3DTestDemo:extend() + +end + +---------------------------------------- +----BasicPhysics3DDemo +---------------------------------------- +local BasicPhysics3DDemo = class("BasicPhysics3DDemo", Physics3DTestDemo) + +function BasicPhysics3DDemo:subtitle() + return "Basic Physics3D" +end + +function BasicPhysics3DDemo:extend() + local rbDes = {} + rbDes.mass = 0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(60.0, 1.0, 60.0)) + + local floor = cc.PhysicsSprite3D:create("Sprite3DTest/box.c3t", rbDes) + floor:setTexture("Sprite3DTest/plane.png") + floor:setScaleX(60) + floor:setScaleZ(60) + self:addChild(floor) + floor:setCameraMask(cc.CameraFlag.USER1) + floor:syncToNode() + floor:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.NONE) + + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(0.8, 0.8, 0.8)) + + local start_x = START_POS_X - ARRAY_SIZE_X/2 + local start_y = START_POS_Y + local start_z = START_POS_Z - ARRAY_SIZE_Z/2 + + for k = 1, ARRAY_SIZE_Y do + for i = 1, ARRAY_SIZE_X do + for j = 1, ARRAY_SIZE_Z do + local x = 1.0 * (i - 1) + start_x + local y = 5.0+1.0 * (k - 1) + start_y + local z = 1.0 * (j - 1) + start_z + + local sprite = cc.PhysicsSprite3D:create("Sprite3DTest/box.c3t", rbDes) + sprite:setTexture("Images/CyanSquare.png") + sprite:setPosition3D(cc.vec3(x, y, z)) + sprite:syncToNode() + sprite:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE) + sprite:setCameraMask(cc.CameraFlag.USER1) + sprite:setScale(0.8) + self:addChild(sprite) + end + end + end + + self._physicsScene:setPhysics3DDebugCamera(self._camera) +end + +---------------------------------------- +----Physics3DConstraintDemo +---------------------------------------- +local Physics3DConstraintDemo = class("Physics3DConstraintDemo", Physics3DTestDemo) + +function Physics3DConstraintDemo:subtitle() + return "Physics3D Constraint" +end + +function Physics3DConstraintDemo:extend() + + local listener = cc.EventListenerTouchAllAtOnce:create() + listener:registerScriptHandler(function(touches, event) + if nil ~= self._camera then + local touch = touches[1] + local location = touch:getLocationInView() + local nearP = cc.vec3(location.x, location.y, 0.0) + local farP = cc.vec3(location.x, location.y, 1.0) + + local size = cc.Director:getInstance():getWinSize() + nearP = self._camera:unproject(size, nearP, nearP) + farP = self._camera:unproject(size, farP, farP) + + local physicsWorld = self._physicsScene:getPhysics3DWorld() + local hitResult = {} + local ret = false + ret, hitResult = physicsWorld:rayCast(nearP, farP, hitResult) + if true == ret and nil ~= hitResult.hitObj and hitResult.hitObj:getObjType() == cc.Physics3DObject.PhysicsObjType.RIGID_BODY then + local mat = cc.mat4.getInversed(hitResult.hitObj:getWorldTransform()) + local position = {x = 0, y = 0, z = 0} + position = cc.mat4.transformVector(mat, cc.vec4(hitResult.hitPosition.x, hitResult.hitPosition.y, hitResult.hitPosition.z, 1.0),position) + + self._constraint = cc.Physics3DPointToPointConstraint:create(hitResult.hitObj, position) + physicsWorld:addPhysics3DConstraint(self._constraint, true) + self._pickingDistance = math.sqrt(math.pow(hitResult.hitPosition.x - nearP.x, 2) + math.pow(hitResult.hitPosition.y - nearP.y, 2) + math.pow(hitResult.hitPosition.z - nearP.z, 2)) + return + end + end + self._needShootBox = false + end,cc.Handler.EVENT_TOUCHES_BEGAN) + + listener:registerScriptHandler(function(touches, event) + + if self._constraint ~= nil then + local touch = touches[1] + local location = touch:getLocationInView() + local nearP = cc.vec3(location.x, location.y, 0.0) + local farP = cc.vec3(location.x, location.y, 1.0) + + local size = cc.Director:getInstance():getWinSize() + nearP = self._camera:unproject(size, nearP, nearP) + farP = self._camera:unproject(size, farP, farP) + local dir = cc.vec3normalize(cc.vec3(farP.x - nearP.x, farP.y - nearP.y, farP.z - nearP.z)) + self._constraint:setPivotPointInB(cc.vec3(nearP.x + dir.x * self._pickingDistance, nearP.y + dir.y * self._pickingDistance, nearP.z + dir.z * self._pickingDistance)) + return + end + + if #touches > 0 and self._camera ~= nil then + local touch = touches[1] + local delta = touch:getDelta() + + self._angle = self._angle - delta.x * math.pi / 180.0 + self._camera:setPosition3D(cc.vec3(100.0 * math.sin(self._angle), 50.0, 100.0 * math.cos(self._angle))) + self._camera:lookAt(cc.vec3(0.0, 0.0, 0.0), cc.vec3(0.0, 1.0, 0.0)) + + if (delta.x * delta.x + delta.y * delta.y) > 16 then + self._needShootBox = false + end + end + end, cc.Handler.EVENT_TOUCHES_MOVED) + + listener:registerScriptHandler(function(touches, event) + + if self._constraint ~= nil then + self._physicsScene:getPhysics3DWorld():removePhysics3DConstraint(self._constraint) + self._constraint = nil + return + end + + if self._needShootBox == false then + return + end + + if #touches > 0 then + local location = touches[1]:getLocationInView() + local nearP = cc.vec3(location.x, location.y, -1.0) + local farP = cc.vec3(location.x, location.y, 1.0) + nearP = self._camera:unproject(nearP) + farP = self._camera:unproject(farP) + + local dir = cc.vec3(farP.x - nearP.x, farP.y - nearP.y, farP.z - nearP.z) + local cameraPosition = self._camera:getPosition3D() + self:shootBox(cc.vec3(cameraPosition.x + dir.x * 10, cameraPosition.y + dir.y * 10, cameraPosition.z + dir.z * 10)) + end + end, cc.Handler.EVENT_TOUCHES_ENDED) + + local eventDispatcher = self:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) + + local rbDes = {} + rbDes.disableSleep = true + --create box + local sprite = cc.Sprite3D:create("Sprite3DTest/orc.c3b") + rbDes.mass = 10.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(5.0, 5.0, 5.0)) + local rigidBody = cc.Physics3DRigidBody:create(rbDes) + + local quat = cc.quaternion_createFromAxisAngle(cc.vec3(0, 1, 0), math.pi) + local component = cc.Physics3DComponent:create(rigidBody, cc.vec3(0.0, -3.0, 0.0), quat) + + sprite:addComponent(component) + self:addChild(sprite) + sprite:setCameraMask(cc.CameraFlag.USER1) + sprite:setScale(0.4) + sprite:setPosition3D(cc.vec3(-20.0, 5.0, 0.0)) + --sync node position to physics + component:syncToNode() + --physics controlled, we will not set position for it, so we can skip sync node position to physics + component:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE) + + self._physicsScene:setPhysics3DDebugCamera(self._camera) + + local physicsWorld = self._physicsScene:getPhysics3DWorld() + --create point to point constraint + local constraint = cc.Physics3DPointToPointConstraint:create(rigidBody, cc.vec3(2.5, 2.5, 2.5)) + physicsWorld:addPhysics3DConstraint(constraint) + + --create hinge constraint + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(8.0, 8.0, 1.0)) + rigidBody = cc.Physics3DRigidBody:create(rbDes) + component = cc.Physics3DComponent:create(rigidBody) + sprite = cc.Sprite3D:create("Sprite3DTest/box.c3t") + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setScaleX(8.0) + sprite:setScaleY(8.0) + sprite:setPosition3D(cc.vec3(5.0, 0.0, 0.0)) + sprite:addComponent(component) + sprite:setCameraMask(cc.CameraFlag.USER1) + self:addChild(sprite) + component:syncToNode() + rigidBody:setAngularVelocity(cc.vec3(0,3,0)) + constraint = cc.Physics3DHingeConstraint:create(rigidBody, cc.vec3(4.0, 4.0, 0.5), cc.vec3(0.0, 1.0, 0.0)) + physicsWorld:addPhysics3DConstraint(constraint) + + --create slider constraint + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(3.0, 2.0, 3.0)) + rigidBody = cc.Physics3DRigidBody:create(rbDes) + component = cc.Physics3DComponent:create(rigidBody) + sprite = cc.Sprite3D:create("Sprite3DTest/box.c3t") + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setScaleX(3.0) + sprite:setScaleZ(3.0) + sprite:setPosition3D(cc.vec3(30.0, 15.0, 0.0)) + sprite:addComponent(component) + sprite:setCameraMask(cc.CameraFlag.USER1) + self:addChild(sprite) + component:syncToNode() + rigidBody:setLinearVelocity(cc.vec3(0,3,0)) + + rbDes.mass = 0.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(3.0, 3.0, 3.0)) + local rigidBodyB = cc.Physics3DRigidBody:create(rbDes) + component = cc.Physics3DComponent:create(rigidBodyB) + sprite = cc.Sprite3D:create("Sprite3DTest/box.c3t") + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setScale(3.0) + sprite:setPosition3D(cc.vec3(30.0, 5.0, 0.0)) + sprite:addComponent(component) + sprite:setCameraMask(cc.CameraFlag.USER1) + self:addChild(sprite) + component:syncToNode() + + local frameInA = cc.mat4.createRotationZ(cc.mat4.createIdentity(), math.pi / 2) + local frameInB = frameInA + frameInA[14] = -5.0 + frameInB[14] = 5.0 + constraint = cc.Physics3DSliderConstraint:create(rigidBody, rigidBodyB, frameInA, frameInB, false) + physicsWorld:addPhysics3DConstraint(constraint) + constraint:setLowerLinLimit(-5.0) + constraint:setUpperLinLimit(5.0) + + --create ConeTwist constraint + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(3.0, 3.0, 3.0)) + rigidBody = cc.Physics3DRigidBody:create(rbDes) + component = cc.Physics3DComponent:create(rigidBody) + sprite = cc.Sprite3D:create("Sprite3DTest/box.c3t") + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setScale(3.0) + sprite:setPosition3D(cc.vec3(-10.0, 5.0, 0.0)) + sprite:addComponent(component) + sprite:setCameraMask(cc.CameraFlag.USER1) + self:addChild(sprite) + component:syncToNode() + + frameInA = cc.mat4.createRotationZ(frameInA, math.pi / 2) + frameInA[13] = 0.0 + frameInA[14] = -10.0 + frameInA[15] = 0.0 + constraint = cc.Physics3DConeTwistConstraint:create(rigidBody, frameInA) + physicsWorld:addPhysics3DConstraint(constraint, true) + constraint:setLimit(math.pi / 180 * 10, math.pi / 180 * 10, math.pi / 180 * 40) + + --reate 6 dof constraint + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(3.0, 3.0, 3.0)) + rigidBody = cc.Physics3DRigidBody:create(rbDes) + component = cc.Physics3DComponent:create(rigidBody) + sprite = cc.Sprite3D:create("Sprite3DTest/box.c3t") + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setScale(3.0) + sprite:setPosition3D(cc.vec3(30.0, -5.0, 0.0)) + sprite:addComponent(component) + sprite:setCameraMask(cc.CameraFlag.USER1) + self:addChild(sprite) + component:syncToNode() + frameInA = cc.mat4.setIdentity(frameInA) + constraint = cc.Physics3D6DofConstraint:create(rigidBody, frameInA, false) + physicsWorld:addPhysics3DConstraint(constraint) + constraint:setAngularLowerLimit(cc.vec3(0,0,0)) + constraint:setAngularUpperLimit(cc.vec3(0,0,0)) + constraint:setLinearLowerLimit(cc.vec3(-10,0,0)) + constraint:setLinearUpperLimit(cc.vec3(10,0,0)) +end + +---------------------------------------- +----Physics3DKinematicDemo +---------------------------------------- +local Physics3DKinematicDemo = class("Physics3DKinematicDemo", Physics3DTestDemo) + +function Physics3DKinematicDemo:subtitle() + return "Physics3D Kinematic" +end + +function Physics3DKinematicDemo:extend() + local rbDes = {} + rbDes.mass = 0.0 + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(60.0, 1.0, 60.0)) + local floor = cc.PhysicsSprite3D:create("Sprite3DTest/box.c3t", rbDes) + floor:setTexture("Sprite3DTest/plane.png") + floor:setScaleX(60) + floor:setScaleZ(60) + floor:setPosition3D(cc.vec3(0.0, -1.0, 0.0)) + self:addChild(floor) + floor:setCameraMask(cc.CameraFlag.USER1) + floor:syncToNode() + --static object sync is not needed + floor:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.NONE) + + for i=1, 3 do + + rbDes.mass = 0.0 --kinematic objects. zero mass so that it can not be affected by other dynamic objects + rbDes.shape = cc.Physics3DShape:createBox(cc.vec3(2.0, 2.0, 2.0)) + + local sprite = cc.PhysicsSprite3D:create("Sprite3DTest/box.c3t", rbDes) + sprite:setTexture("Images/CyanSquare.png") + sprite:setCameraMask(cc.CameraFlag.USER1) + local rigidBody = sprite:getPhysicsObj() + rigidBody:setKinematic(true) + + self:addChild(sprite) + + sprite:setScale(2.0) + sprite:setPosition3D(cc.vec3(-15.0, 0.0, 15.0 - 15.0 * (i - 1) )) + local moveby = cc.MoveBy:create(2.0 + (i - 1), cc.vec3(30.0, 0.0, 0.0)) + sprite:runAction(cc.RepeatForever:create(cc.Sequence:create(moveby, moveby:reverse()))) + end + + --create Dynamic + --create several spheres + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createSphere(0.5) + local start_x = START_POS_X - ARRAY_SIZE_X/2 + local start_y = START_POS_Y + 5.0 + local start_z = START_POS_Z - ARRAY_SIZE_Z/2 + + for k = 1,ARRAY_SIZE_Y do + for i = 1,ARRAY_SIZE_X do + for j = 1,ARRAY_SIZE_Z do + local x = 1.0 * (i - 1) + start_x + local y = 5.0 + 1.0 * (k - 1) + start_y + local z = 1.0 * (j - 1) + start_z + if rbDes.originalTransform == nil then + rbDes.originalTransform = cc.mat4.createIdentity() + else + rbDes.originalTransform = cc.mat4.setIdentity(rbDes.originalTransform) + end + + rbDes.originalTransform = cc.mat4.translate(rbDes.originalTransform, cc.vec3(x, y, z)) + + local sprite = cc.PhysicsSprite3D:create("Sprite3DTest/sphere.c3b", rbDes) + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setCameraMask(cc.CameraFlag.USER1) + sprite:setScale(1.00 / sprite:getContentSize().width) + self:addChild(sprite) + sprite:setPosition3D(cc.vec3(x, y, z)) + sprite:syncToNode() + sprite:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE) + end + end + end + + self._physicsScene:setPhysics3DDebugCamera(self._camera) +end + +---------------------------------------- +----Physics3DCollisionCallbackDemo +---------------------------------------- +local Physics3DCollisionCallbackDemo = class("Physics3DCollisionCallbackDemo", Physics3DTestDemo) + +function Physics3DCollisionCallbackDemo:subtitle() + return "Physics3D CollisionCallback" +end + +function Physics3DCollisionCallbackDemo:extend() + local rbDes = {} + + local scale = 2.0 + local trianglesList = cc.Bundle3D:getTrianglesList("Sprite3DTest/boss.c3b") + for i = 1, #trianglesList do + trianglesList[i] = {x = trianglesList[i].x * scale, y = trianglesList[i].y * scale, z = trianglesList[i].z * scale} + end + + rbDes.mass = 0.0 + rbDes.shape = cc.Physics3DShape:createMesh(trianglesList, math.floor(#trianglesList / 3)) + local rigidBody = cc.Physics3DRigidBody:create(rbDes) + local component = cc.Physics3DComponent:create(rigidBody) + local sprite = cc.Sprite3D:create("Sprite3DTest/boss.c3b") + sprite:addComponent(component) + sprite:setRotation3D(cc.vec3(-90.0, 0.0, 0.0)) + sprite:setScale(scale) + sprite:setCameraMask(cc.CameraFlag.USER1) + self:addChild(sprite) + + rigidBody:setCollisionCallback(function (collisionInfo) + if nil ~= collisionInfo.collisionPointList and #collisionInfo.collisionPointList > 0 then + if collisionInfo.objA:getMask() ~= 0 then + local ps = cc.PUParticleSystem3D:create("Particle3D/scripts/mp_hit_04.pu") + ps:setPosition3D(collisionInfo.collisionPointList[1].worldPositionOnB) + ps:setScale(0.05) + ps:startParticleSystem() + ps:setCameraMask(2) + self:addChild(ps) + ps:runAction(cc.Sequence:create(cc.DelayTime:create(1.0), cc.CallFunc:create(function() + ps:removeFromParent() + end))) + collisionInfo.objA:setMask(0) + end + end + end) + + self._physicsScene:setPhysics3DDebugCamera(self._camera) +end + +---------------------------------------- +----Physics3DTerrainDemo +---------------------------------------- +local Physics3DTerrainDemo = class("Physics3DTerrainDemo", Physics3DTestDemo) + +function Physics3DTerrainDemo:subtitle() + return "Physics3D Terrain" +end + +function Physics3DTerrainDemo:extend() + + local detailMapR = { _detailMapSrc = "TerrainTest/dirt.jpg", _detailMapSize = 35} + local detailMapG = { _detailMapSrc = "TerrainTest/Grass2.jpg", _detailMapSize = 10} + local detailMapB = { _detailMapSrc = "TerrainTest/road.jpg", _detailMapSize = 35} + local detailMapA = { _detailMapSrc = "TerrainTest/GreenSkin.jpg", _detailMapSize = 20} + local terrainData = { _heightMapSrc = "TerrainTest/heightmap129.jpg", _alphaMapSrc = "TerrainTest/alphamap.png" , _detailMaps = {detailMapR, detailMapG, detailMapB, detailMapA}, _detailMapAmount = 4, _mapHeight = 20.0, _mapScale = 1.0, _chunkSize = cc.size(32,32)} + + local terrain = cc.Terrain:create(terrainData,cc.Terrain.CrackFixedType.SKIRT) + terrain:setMaxDetailMapAmount(4) + terrain:setCameraMask(2) + terrain:setDrawWire(false) + + terrain:setSkirtHeightRatio(3) + terrain:setLODDistance(64,128,192) + terrain:setCameraMask(cc.CameraFlag.USER1) + + --create terrain + local rbDes = {} + rbDes.mass = 0.0 + local heidata = terrain:getHeightData() + local size = terrain:getTerrainSize() + rbDes.shape = cc.Physics3DShape:createHeightfield(size.width, size.height, heidata, 1.0, terrain:getMinHeight(), terrain:getMaxHeight(), true, false, true) + local rigidBody = cc.Physics3DRigidBody:create(rbDes) + local component = cc.Physics3DComponent:create(rigidBody) + terrain:addComponent(component) + self:addChild(terrain) + component:syncToNode() + component:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.NONE) + + --create several spheres + rbDes.mass = 1.0 + rbDes.shape = cc.Physics3DShape:createSphere(0.5) + local start_x = START_POS_X - ARRAY_SIZE_X/2 + 5.0 + local start_y = START_POS_Y + 20.0 + local start_z = START_POS_Z - ARRAY_SIZE_Z/2 + + for k = 1, ARRAY_SIZE_Y do + for i = 1, ARRAY_SIZE_X do + for j = 1, ARRAY_SIZE_Z do + local x = 1.0 * (i - 1) + start_x + local y = 5.0+1.0 * (k - 1) + start_y + local z = 1.0 * (j - 1) + start_z + + local sprite = cc.PhysicsSprite3D:create("Sprite3DTest/sphere.c3b", rbDes) + sprite:setTexture("Sprite3DTest/plane.png") + sprite:setCameraMask(cc.CameraFlag.USER1) + sprite:setScale(1.0 / sprite:getContentSize().width) + sprite:setPosition3D(cc.vec3(x, y, z)) + self:addChild(sprite) + sprite:syncToNode() + sprite:setSyncFlag(cc.Physics3DComponent.PhysicsSyncFlag.PHYSICS_TO_NODE) + end + end + end + + --create mesh + local trianglesList = cc.Bundle3D:getTrianglesList("Sprite3DTest/boss.c3b") + + rbDes.mass = 0.0 + rbDes.shape = cc.Physics3DShape:createMesh(trianglesList, math.floor(#trianglesList / 3)) + local rigidBody = cc.Physics3DRigidBody:create(rbDes) + local component = cc.Physics3DComponent:create(rigidBody) + local sprite = cc.Sprite3D:create("Sprite3DTest/boss.c3b") + sprite:addComponent(component) + sprite:setRotation3D(cc.vec3(-90.0, 0.0, 0.0)) + sprite:setPosition3D(cc.vec3(0.0, 15.0, 0.0)) + sprite:setCameraMask(2) + self:addChild(sprite) + + local shapeList = {} + local localTrans = cc.mat4.createIdentity() + local bodyshape = cc.Physics3DShape:createBox(cc.vec3(2.0, 4.0, 2.0)) + localTrans = cc.mat4.createTranslation(0.0, 2.0, 0.0, localTrans) + table.insert(shapeList, {bodyshape, localTrans}) + + local headshape = cc.Physics3DShape:createSphere(1.5) + localTrans = cc.mat4.createTranslation(0.6, 5.0, -1.5, localTrans) + table.insert(shapeList, {headshape, localTrans}) + + local lhandshape = cc.Physics3DShape:createBox(cc.vec3(1.0, 3.0, 1.0)) + localTrans = cc.mat4.createRotation(cc.vec3(1.0, 0.0, 0.0), 15.0 * math.pi / 180, localTrans) + localTrans[13] = -1.5 + localTrans[14] = 2.5 + localTrans[15] = -2.5 + table.insert(shapeList, {lhandshape, localTrans}) + + local rhandshape = cc.Physics3DShape:createBox(cc.vec3(1.0, 3.0, 1.0)) + localTrans = cc.mat4.createRotation(cc.vec3(1.0, 0.0, 0.0), -15.0 * math.pi / 180, localTrans) + localTrans[13] = 2.0 + localTrans[14] = 2.5 + localTrans[15] = 1.0 + table.insert(shapeList, {rhandshape, localTrans}) + + rbDes.mass = 10.0 + rbDes.shape = cc.Physics3DShape:createCompoundShape(shapeList) + rigidBody = cc.Physics3DRigidBody:create(rbDes) + component = cc.Physics3DComponent:create(rigidBody) + local sprite = cc.Sprite3D:create("Sprite3DTest/orc.c3b") + sprite:addComponent(component) + sprite:setRotation3D(cc.vec3(0.0, 180.0, 0.0)) + sprite:setPosition3D(cc.vec3(-5.0, 20.0, 0.0)) + sprite:setScale(0.4) + sprite:setCameraMask(2) + self:addChild(sprite) + + self._physicsScene:setPhysics3DDebugCamera(self._camera) +end + +function Physics3DTest() + + Helper.usePhysics = true + + local scene = cc.Scene:createWithPhysics() + + Helper.createFunctionTable = + { + BasicPhysics3DDemo.create, + Physics3DConstraintDemo.create, + Physics3DKinematicDemo.create, + Physics3DCollisionCallbackDemo.create, + Physics3DTerrainDemo.create, + } + + scene:addChild(BasicPhysics3DDemo.create()) + scene:addChild(CreateBackMenuItem()) + + return scene +end \ No newline at end of file diff --git a/tests/lua-tests/src/Scene3DTest/Scene3DTest.lua b/tests/lua-tests/src/Scene3DTest/Scene3DTest.lua new file mode 100644 index 0000000000..355930382a --- /dev/null +++ b/tests/lua-tests/src/Scene3DTest/Scene3DTest.lua @@ -0,0 +1,680 @@ + +local GAME_LAYER = +{ + LAYER_SKYBOX = 1, + LAYER_GAME = 2, + LAYER_UI = 3, + LAYER_ACTOR = 4, + LAYER_ZOOM = 5, + LAYER_OSD = 6, + LAYER_COUNT = 7, +} + +local s_CF = +{ + cc.CameraFlag.DEFAULT, + cc.CameraFlag.USER1, + cc.CameraFlag.USER2, + cc.CameraFlag.USER3, + cc.CameraFlag.USER4, + cc.CameraFlag.USER5, +} + +local s_CM = +{ + s_CF[1], + s_CF[2], + s_CF[3], + s_CF[4], + s_CF[5], + s_CF[6], +} + + +---------------------------------------- +----TerrainWalkThru +---------------------------------------- + +local PLAER_STATE = +{ + LEFT = 0, + RIGHT = 1, + IDLE = 2, + FORWARD = 3, + BACKWARD = 4, +} + +local PLAYER_HEIGHT = 0 + +local camera_offset = cc.vec3(0, 45, 60) + +local Player = class("Player", function(file, cam, terrain) + local sprite = cc.Sprite3D:create(file) + if nil ~= sprite then + sprite._headingAngle = 0 + sprite._playerState = PLAER_STATE.IDLE + sprite._cam = cam + sprite._terrain = terrain + end + return sprite +end) + +function Player:ctor() + -- body + self:init() +end + +function Player:init() + self._headingAxis = cc.vec3(0.0, 0.0, 0.0) + self:scheduleUpdateWithPriorityLua(function(dt) + local curPos = self:getPosition3D() + if self._playerState == PLAER_STATE.IDLE then + + elseif self._playerState == PLAER_STATE.FORWARD then + local newFaceDir = cc.vec3( self._targetPos.x - curPos.x, self._targetPos.y - curPos.y, self._targetPos.z - curPos.z) + newFaceDir.y = 0.0 + newFaceDir = cc.vec3normalize(newFaceDir) + local offset = cc.vec3(newFaceDir.x * 25.0 * dt, newFaceDir.y * 25.0 * dt, newFaceDir.z * 25.0 * dt) + curPos = cc.vec3(curPos.x + offset.x, curPos.y + offset.y, curPos.z + offset.z) + self:setPosition3D(curPos) + elseif self._playerState == PLAER_STATE.BACKWARD then + + local transform = self:getNodeToWorldTransform() + local forward_vec = cc.vec3(-transform[9], -transform[10], -transform[11]) + forward_vec = cc.vec3normalize(forward_vec) + self:setPosition3D(cc.vec3(curPos.x - forward_vec.x * 15 * dt, curPos.y - forward_vec.y * 15 * dt, curPos.z - forward_vec.z * 15 *dt)) + elseif self._playerState == PLAER_STATE.LEFT then + player:setRotation3D(cc.vec3(curPos.x, curPos.y + 25 * dt, curPos.z)) + elseif self._playerState == PLAER_STATE.RIGHT then + player:setRotation3D(cc.vec3(curPos.x, curPos.y - 25 * dt, curPos.z)) + end + + local normal = cc.vec3(0.0, 0.0, 0.0) + local player_h, normal = self._terrain:getHeight(self:getPositionX(), self:getPositionZ(), normal) + self:setPositionY(player_h + PLAYER_HEIGHT) + + --need to scriptfile + local q2 = cc.quaternion_createFromAxisAngle(cc.vec3(0, 1, 0), -math.pi) + local headingQ = cc.quaternion_createFromAxisAngle(self._headingAxis, self._headingAngle) + local x = headingQ.w * q2.x + headingQ.x * q2.w + headingQ.y * q2.z - headingQ.z * q2.y + local y = headingQ.w * q2.y - headingQ.x * q2.z + headingQ.y * q2.w + headingQ.z * q2.x + local z = headingQ.w * q2.z + headingQ.x * q2.y - headingQ.y * q2.x + headingQ.z * q2.w + local w = headingQ.w * q2.w - headingQ.x * q2.x - headingQ.y * q2.y - headingQ.z * q2.z + headingQ = cc.quaternion(x, y, z, w) + self:setRotationQuat(headingQ) + + local vec_offset = cc.vec4(camera_offset.x, camera_offset.y, camera_offset.z, 1) + local transform = self:getNodeToWorldTransform() + local dst = cc.vec4(0.0, 0.0, 0.0, 0.0) + vec_offset = mat4_transformVector(transform, vec_offset, dst) + local playerPos = self:getPosition3D() + self._cam:setPosition3D(cc.vec3(playerPos.x + camera_offset.x, playerPos.y + camera_offset.y, playerPos.z + camera_offset.z)) + self:updateState() + end, 0) + + self:registerScriptHandler(function (event) + -- body + if "exit" == event then + self:unscheduleUpdate() + end + end) +end + +function Player:updateState() + if self._playerState == PLAER_STATE.FORWARD then + local player_pos = cc.p(self:getPositionX(),self:getPositionZ()) + local targetPos = cc.p(self._targetPos.x, self._targetPos.z) + local dist = cc.pGetDistance(player_pos, targetPos) + if dist < 1 then + self._playerState = PLAER_STATE.IDLE + end + end +end + +local TerrainWalkThru = class("TerrainWalkThru", function () + local layer = cc.Layer:create() + Helper.initWithLayer(layer) + return layer +end) + +function TerrainWalkThru:ctor() + -- body + local function onNodeEvent(event) + if "enter" == event then + self:onEnter() + elseif "exit" == event then + self:onExit() + end + end + self:registerScriptHandler(onNodeEvent) +end + +function TerrainWalkThru:onEnter() + self:init() +end + +function TerrainWalkThru:onExit() + +end + +function TerrainWalkThru:init() + Helper.titleLabel:setString(self:title()) + Helper.subtitleLabel:setString(self:subtitle()) + + local listener = cc.EventListenerTouchAllAtOnce:create() + + listener:registerScriptHandler(function (touches, event) + + end,cc.Handler.EVENT_TOUCHES_BEGAN) + + listener:registerScriptHandler(function (touches, event) + + local touch = touches[1] + local location = touch:getLocationInView() + if self._camera ~= nil then + if self._player ~= nil then + local nearP = cc.vec3(location.x, location.y, 0.0) + local farP = cc.vec3(location.x, location.y, 1.0) + + local size = cc.Director:getInstance():getWinSize() + nearP = self._camera:unproject(size, nearP, nearP) + farP = self._camera:unproject(size, farP, farP) + local dir = cc.vec3(farP.x - nearP.x, farP.y - nearP.y, farP.z - nearP.z) + dir = cc.vec3normalize(dir) + + local rayStep = cc.vec3(15 * dir.x, 15 * dir.y, 15 * dir.z) + local rayPos = nearP + local rayStartPosition = nearP + local lastRayPosition = rayPos + rayPos = cc.vec3(rayPos.x + rayStep.x, rayPos.y + rayStep.y, rayPos.z + rayStep.z) + -- Linear search - Loop until find a point inside and outside the terrain Vector3 + local height = self._terrain:getHeight(rayPos.x, rayPos.z) + + while rayPos.y > height do + lastRayPosition = rayPos + rayPos = cc.vec3(rayPos.x + rayStep.x, rayPos.y + rayStep.y, rayPos.z + rayStep.z) + height = self._terrain:getHeight(rayPos.x,rayPos.z) + end + + local startPosition = lastRayPosition + local endPosition = rayPos + + for i = 1, 32 do + -- Binary search pass + local middlePoint = cc.vec3(0.5 * (startPosition.x + endPosition.x), 0.5 * (startPosition.y + endPosition.y), 0.5 * (startPosition.z + endPosition.z)) + if (middlePoint.y < height) then + endPosition = middlePoint + else + startPosition = middlePoint + end + end + + local collisionPoint = cc.vec3(0.5 * (startPosition.x + endPosition.x), 0.5 * (startPosition.y + endPosition.y), 0.5 * (startPosition.z + endPosition.z)) + local playerPos = self._player:getPosition3D() + dir = cc.vec3(collisionPoint.x - playerPos.x, collisionPoint.y - playerPos.y, collisionPoint.z - playerPos.z) + dir.y = 0 + dir = cc.vec3normalize(dir) + self._player._headingAngle = -1 * math.acos(-dir.z) + + self._player._headingAxis = vec3_cross(dir, cc.vec3(0, 0, -1), self._player._headingAxis) + self._player._targetPos = collisionPoint + -- self._player:forward() + self._player._playerState = PLAER_STATE.FORWARD + end + end + end,cc.Handler.EVENT_TOUCHES_ENDED) + + local eventDispatcher = self:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) + + local visibleSize = cc.Director:getInstance():getVisibleSize() + self._camera = cc.Camera:createPerspective(60, visibleSize.width/visibleSize.height, 0.1, 200) + self._camera:setCameraFlag(cc.CameraFlag.USER1) + self:addChild(self._camera) + + local detailMapR = { _detailMapSrc = "TerrainTest/dirt.jpg", _detailMapSize = 35} + local detailMapG = { _detailMapSrc = "TerrainTest/Grass2.jpg", _detailMapSize = 10} + local detailMapB = { _detailMapSrc = "TerrainTest/road.jpg", _detailMapSize = 35} + local detailMapA = { _detailMapSrc = "TerrainTest/GreenSkin.jpg", _detailMapSize = 20} + local terrainData = { _heightMapSrc = "TerrainTest/heightmap16.jpg", _alphaMapSrc = "TerrainTest/alphamap.png" , _detailMaps = {detailMapR, detailMapG, detailMapB, detailMapA}, _detailMapAmount = 4, _mapHeight = 40.0, _mapScale = 2.0 } + + self._terrain = cc.Terrain:create(terrainData,cc.Terrain.CrackFixedType.SKIRT) + self._terrain:setMaxDetailMapAmount(4) + self._terrain:setCameraMask(2) + self._terrain:setDrawWire(false) + + self._terrain:setSkirtHeightRatio(3) + self._terrain:setLODDistance(64,128,192) + + self._player = Player:create("Sprite3DTest/girl.c3b", self._camera, self._terrain) + self._player:setCameraMask(2) + self._player:setScale(0.08) + self._player:setPositionY(self._terrain:getHeight(self._player:getPositionX(), self._player:getPositionZ()) + PLAYER_HEIGHT) + + --add Particle3D for test blend + local rootps = cc.PUParticleSystem3D:create("Particle3D/scripts/mp_torch.pu") + rootps:setCameraMask(cc.CameraFlag.USER1) + rootps:setScale(30.0) + rootps:startParticleSystem() + self._player:addChild(rootps) + + --add BillBoard for test blend + local billboard = cc.BillBoard:create("Images/btn-play-normal.png") + billboard:setPosition3D(cc.vec3(0,180,0)) + billboard:setCameraMask(cc.CameraFlag.USER1) + self._player:addChild(billboard) + + local animation = cc.Animation3D:create("Sprite3DTest/girl.c3b","Take 001") + if nil ~= animation then + local animate = cc.Animate3D:create(animation) + self._player:runAction(cc.RepeatForever:create(animate)) + end + + local playerPos = self._player:getPosition3D() + self._camera:setPosition3D(cc.vec3(playerPos.x + camera_offset.x, playerPos.y + camera_offset.y, playerPos.z + camera_offset.z)) + self._camera:setRotation3D(cc.vec3(-45,0,0)) + + self:addChild(self._player) + self:addChild(self._terrain) + + self:extend() +end + +function TerrainWalkThru:title() + return "Player walk around in terrain" +end + +function TerrainWalkThru:subtitle() + return "touch to move" +end + +function TerrainWalkThru:extend() + +end + +---------------------------------------- +----Scene3DTest +---------------------------------------- +local Scene3DTest = class("Scene3DTest", TerrainWalkThru) + +function Scene3DTest:create3DWorld() + -- terrain and player has been create in TerrainWalkThru:init + -- we only need override there camera mask + self._terrain:setCameraMask(s_CM[GAME_LAYER.LAYER_GAME]) + self._player:setCameraMask(s_CM[GAME_LAYER.LAYER_GAME]) + self._player:setScale(self._player:getScale() * 1.5) + + --add two Sprite3D monster, one is transparent + local playerPos = self._player:getPosition3D() + local monster = cc.Sprite3D:create("Sprite3DTest/orc.c3b") + monster:setRotation3D(cc.vec3(0,180,0)) + monster:setPosition3D(cc.vec3(playerPos.x + 50, playerPos.y - 10, playerPos.z)) + monster:setCameraMask(s_CM[GAME_LAYER.LAYER_GAME]) + monster:setOpacity(128) + self:addChild(monster) + monster = cc.Sprite3D:create("Sprite3DTest/orc.c3b") + monster:setRotation3D(cc.vec3(0,180,0)) + monster:setPosition3D(cc.vec3(playerPos.x - 50, playerPos.y - 5, playerPos.z)) + monster:setCameraMask(s_CM[GAME_LAYER.LAYER_GAME]) + self:addChild(monster) + + --add a particle 3d above player + local rootps = cc.PUParticleSystem3D:create("Particle3D/scripts/blackHole.pu", "Particle3D/materials/pu_mediapack_01.material") + rootps:setScale(2) + rootps:setPosition3D(cc.vec3(0, 150, 0)) + rootps:setCameraMask(s_CM[GAME_LAYER.LAYER_GAME]) + local moveby = cc.MoveBy:create(2.0, cc.p(50.0, 0.0)) + local moveby1 = cc.MoveBy:create(2.0, cc.p(-50.0, 0.0)) + rootps:runAction(cc.RepeatForever:create(cc.Sequence:create(moveby, moveby1))) + rootps:startParticleSystem() + self._player:addChild(rootps, 0) + + --then, create skybox + --create and set our custom shader + local shader = cc.GLProgram:createWithFilenames("Sprite3DTest/cube_map.vert", "Sprite3DTest/cube_map.frag") + local state = cc.GLProgramState:create(shader) + + --create the second texture for cylinder + self._textureCube = cc.TextureCube:create("Sprite3DTest/skybox/left.jpg", "Sprite3DTest/skybox/right.jpg", + "Sprite3DTest/skybox/top.jpg", "Sprite3DTest/skybox/bottom.jpg", + "Sprite3DTest/skybox/front.jpg", "Sprite3DTest/skybox/back.jpg") + + --set texture parameters + local tRepeatParams = { magFilter = gl.LINEAR , minFilter = gl.LINEAR , wrapS = gl.MIRRORED_REPEAT , wrapT = gl.MIRRORED_REPEAT } + self._textureCube:setTexParameters(tRepeatParams) + + --pass the texture sampler to our custom shader + state:setUniformTexture("u_cubeTex", self._textureCube) + + --add skybox + self._skyBox = cc.Skybox:create() + self._skyBox:setCameraMask(s_CM[GAME_LAYER.LAYER_SKYBOX]) + self._skyBox:setTexture(self._textureCube) + self._skyBox:setScale(700.0) + self:addChild(self._skyBox) + + local targetPlatform = cc.Application:getInstance():getTargetPlatform() + if targetPlatform == cc.PLATFORM_OS_ANDROID or targetPlatform == cc.PLATFORM_OS_WINRT or targetPlatform == cc.PLATFORM_OS_WP8 then + self._backToForegroundListener = cc.EventListenerCustom:create("event_renderer_recreated", function (eventCustom) + + local state = self._skyBox:getGLProgramState() + local glProgram = state:getGLProgram() + glProgram:reset() + glProgram:initWithFilenames("Sprite3DTest/cube_map.vert", "Sprite3DTest/cube_map.frag") + glProgram:link() + glProgram:updateUniforms() + + self._textureCube:reloadTexture() + + local tRepeatParams = { magFilter = gl.NEAREST , minFilter = gl.NEAREST , wrapS = gl.MIRRORED_REPEAT , wrapT = gl.MIRRORED_REPEAT } + self._textureCube:setTexParameters(tRepeatParams) + state:setUniformTexture("u_cubeTex", self._textureCube) + + self._skyBox:reload() + self._skyBox:setTexture(self._textureCube) + end) + cc.Director:getInstance():getEventDispatcher():addEventListenerWithFixedPriority(self._backToForegroundListener, 1) + end +end + +function Scene3DTest:createUI() + --add player button + local showLeftDlgItem = cc.MenuItemImage:create("Images/Pea.png", "Images/Pea.png") + showLeftDlgItem:registerScriptTapHandler(function (tag, sender) + if nil ~= self._playerDlg then + self._playerDlg:setVisible(not self._playerDlg:isVisible()) + end + end) + showLeftDlgItem:setPosition(VisibleRect:left().x + 30, VisibleRect:top().y - 30) + + local ttfConfig = { fontFilePath = "fonts/arial.ttf", fontSize = 20} + local descItem = cc.MenuItemLabel:create(cc.Label:createWithTTF(ttfConfig, "Description")) + descItem:registerScriptTapHandler(function(tag, sender) + if nil ~= self._descDlg then + self._descDlg:setVisible(not self._descDlg:isVisible()) + end + end) + descItem:setPosition(cc.p(VisibleRect:right().x - 50, VisibleRect:top().y - 25)) + + local backItem = cc.MenuItemLabel:create(cc.Label:createWithTTF(ttfConfig, "Back")) + backItem:setPosition(cc.p(VisibleRect:right().x - 50, VisibleRect:bottom().y + 25)) + + local menu = cc.Menu:create(showLeftDlgItem, descItem, backItem) + menu:setPosition(cc.p(0.0, 0.0)) + menu:setCameraMask(s_CM[GAME_LAYER.LAYER_UI], true) + self:addChild(menu) +end + +function Scene3DTest:createPlayerDlg() + cc.SpriteFrameCache:getInstance():addSpriteFrames(s_s9s_ui_plist) + + local dlgSize = cc.size(190, 240) + local pos = VisibleRect:center() + local margin = 10 + + --first, create dialog ui part, include background, title and buttons + self._playerDlg = ccui.Scale9Sprite:createWithSpriteFrameName("button_actived.png") + self._playerDlg:setContentSize(dlgSize) + self._playerDlg:setAnchorPoint(cc.p(1, 0.5)) + pos.y = pos.y - margin + pos.x = pos.x - margin + self._playerDlg:setPosition(pos) + + --title + local title = cc.Label:createWithTTF("Player Dialog","fonts/arial.ttf",16) + title:setPosition(dlgSize.width / 2, dlgSize.height - margin * 2) + self._playerDlg:addChild(title) + + --player background + local bgSize = cc.size(110, 180) + local bgPos = cc.p(margin, dlgSize.height / 2 - margin) + local playerBg = ccui.Scale9Sprite:createWithSpriteFrameName("item_bg.png") + playerBg:setContentSize(bgSize) + playerBg:setAnchorPoint(cc.p(0, 0.5)) + playerBg:setPosition(bgPos) + self._playerDlg:addChild(playerBg) + + --item background and item + local itemSize = cc.size(48, 48) + local itemAnchor = cc.p(0, 1) + local itemPos = cc.p(bgPos.x + bgSize.width + margin, bgPos.y + bgSize.height / 2) + local itemBg = ccui.Scale9Sprite:createWithSpriteFrameName("item_bg.png") + itemBg:setContentSize(itemSize) + itemBg:setAnchorPoint(itemAnchor) + itemBg:setPosition(itemPos) + self._playerDlg:addChild(itemBg) + + local item = ccui.Button:create("crystal.png", "", "", ccui.TextureResType.plistType) + item:setScale(1.5) + item:setAnchorPoint(itemAnchor) + item:setPosition(itemPos) + item:addClickEventListener(function(sender) + if self._detailDlg ~= nil then + self._detailDlg:setVisible(not self._detailDlg:isVisible()) + end + end) + self._playerDlg:addChild(item) + + --after add ui element, add player dialog to scene + self._playerDlg:setCameraMask(s_CM[GAME_LAYER.LAYER_UI]) + self:addChild(self._playerDlg) + + --second, add 3d actor, which on dialog layer + local girl = cc.Sprite3D:create("Sprite3DTest/girl.c3b") + girl:setScale(0.5) + girl:setPosition(bgSize.width / 2, margin * 2) + girl:setCameraMask(s_CM[GAME_LAYER.LAYER_ACTOR]) + playerBg:addChild(girl) + + --third, add zoom in/out button, which is 2d ui element and over 3d actor + local zoomIn = ccui.Button:create("cocosui/animationbuttonnormal.png","cocosui/animationbuttonpressed.png") + zoomIn:setScale(0.5) + zoomIn:setAnchorPoint(cc.p(1, 1)) + zoomIn:setPosition(cc.p(bgSize.width / 2 - margin / 2, bgSize.height - margin)) + zoomIn:addClickEventListener(function(sender) + girl:setScale(girl:getScale() * 2) + end) + zoomIn:setTitleText("Zoom In") + zoomIn:setCameraMask(s_CM[GAME_LAYER.LAYER_ZOOM]) + playerBg:addChild(zoomIn) + + local zoomOut = ccui.Button:create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png") + zoomOut:setScale(0.5) + zoomOut:setAnchorPoint(cc.p(0, 1)) + zoomOut:setPosition(cc.p(bgSize.width / 2 + margin / 2, bgSize.height - margin)) + zoomOut:addClickEventListener(function(sender) + girl:setScale(girl:getScale() / 2) + end) + zoomOut:setTitleText("Zoom Out") + zoomOut:setCameraMask(s_CM[GAME_LAYER.LAYER_ZOOM]) + playerBg:addChild(zoomOut) +end + +function Scene3DTest:createDetailDlg() + cc.SpriteFrameCache:getInstance():addSpriteFrames(s_s9s_ui_plist) + + local dlgSize = cc.size(190, 240) + local pos = VisibleRect:center() + local margin = 10 + + --create dialog + self._detailDlg = ccui.Scale9Sprite:createWithSpriteFrameName("button_actived.png") + self._detailDlg:setContentSize(dlgSize) + self._detailDlg:setAnchorPoint(cc.p(0, 0.5)) + self._detailDlg:setOpacity(224) + pos.y = pos.y - margin + pos.x = pos.x + margin + self._detailDlg:setPosition(pos) + + -- title + local title = cc.Label:createWithTTF("Detail Dialog","fonts/arial.ttf",16) + title:setPosition(dlgSize.width / 2, dlgSize.height - margin * 2) + self._detailDlg:addChild(title) + + -- add a spine ffd animation on it + local skeletonNode = sp.SkeletonAnimation:create("spine/goblins-ffd.json", "spine/goblins-ffd.atlas", 1.5) + skeletonNode:setAnimation(0, "walk", true) + skeletonNode:setSkin("goblin") + + skeletonNode:setScale(0.25) + local windowSize = cc.Director:getInstance():getWinSize() + skeletonNode:setPosition(cc.p(dlgSize.width / 2, 20)) + self._detailDlg:addChild(skeletonNode) + + local listener = cc.EventListenerTouchOneByOne:create() + listener:registerScriptHandler(function (touch, event) + if (not skeletonNode:getDebugBonesEnabled()) then + skeletonNode:setDebugBonesEnabled(true) + elseif skeletonNode:getTimeScale() == 1 then + skeletonNode:setTimeScale(0.3) + else + skeletonNode:setTimeScale(1) + skeletonNode:setDebugBonesEnabled(false) + end + + return true + end,cc.Handler.EVENT_TOUCH_BEGAN ) + + local eventDispatcher = self:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) + + --after add ui element, add dialog to scene + self._detailDlg:setCameraMask(s_CM[GAME_LAYER.LAYER_UI]) + self:addChild(self._detailDlg) +end + +function Scene3DTest:createDescDlg() + cc.SpriteFrameCache:getInstance():addSpriteFrames(s_s9s_ui_plist) + + local dlgSize = cc.size(440, 240) + local pos = VisibleRect:center() + local margin = 10 + + --create dialog + self._descDlg = ccui.Scale9Sprite:createWithSpriteFrameName("button_actived.png") + self._descDlg:setContentSize(dlgSize) + self._descDlg:setOpacity(224) + self._descDlg:setPosition(pos) + + --title + local title = cc.Label:createWithTTF("Description Dialog","fonts/arial.ttf",16) + title:setPosition(dlgSize.width / 2, dlgSize.height - margin * 2) + self._descDlg:addChild(title) + + --add a label to retain description text + local textSize = cc.size(400, 220) + local desc = "Scene 3D test for 2D and 3D mix rendering.\n" .. + "\n" .. + "- Game world composite with terrain, skybox and 3D objects.\n" .. + "- UI composite with 2D nodes.\n" .. + "- Click the icon at the topleft conner, will show a player dialog which" .. + "there is a 3D sprite on it.\n" .. + "- There are two button to zoom the player model, which should keep above" .. + "on 3D model.\n" .. + "- This description dialog should above all other elements.\n" .. + "\n" .. + "Click \"Description\" button to hide this dialog.\n" + + local text = cc.Label:createWithSystemFont(desc, "Helvetica", 12, textSize) + text:setAnchorPoint(cc.p(0, 1)) + text:setPosition(margin, dlgSize.height - (20 + margin)) + self._descDlg:addChild(text) + + --after add ui element, add dialog to scene + self._descDlg:setCameraMask(s_CM[GAME_LAYER.LAYER_OSD]) + self:addChild(self._descDlg) +end + +function Scene3DTest:extend() + self._playerDlg = nil + self._detailDlg = nil + self._descDlg = nil + self._gameCameras = {nil, nil, nil, nil, nil, nil} + + cc.Director:getInstance():setDisplayStats(false) + + local ca = nil + local visibleSize = cc.Director:getInstance():getVisibleSize() + --first, create a camera to look the skybox + ca = cc.Camera:createPerspective(60, visibleSize.width / visibleSize.height, 10, 1000) + ca:setPosition3D(cc.vec3(0.0, 0.0, 50.0)) + ca:setCameraFlag(s_CF[GAME_LAYER.LAYER_SKYBOX]) + ca:setDepth(GAME_LAYER.LAYER_SKYBOX) + self._gameCameras[GAME_LAYER.LAYER_SKYBOX] = ca + self:addChild(ca) + + -- second, create a camera to look the 3D game scene + -- it has been create in TerrainWalkThru:init + ca = self._camera + ca:setCameraFlag(s_CF[GAME_LAYER.LAYER_GAME]) + ca:setDepth(GAME_LAYER.LAYER_GAME) + self._gameCameras[GAME_LAYER.LAYER_GAME] = ca + + --third, use the default camera to look 2D base UI layer + local scene = cc.Director:getInstance():getRunningScene() + ca = scene:getDefaultCamera() + ca:setCameraFlag(s_CF[GAME_LAYER.LAYER_UI]) + ca:setDepth(GAME_LAYER.LAYER_UI) + self._gameCameras[GAME_LAYER.LAYER_UI] = ca + + --forth, create a camera to look the 3D model in dialogs + ca = cc.Camera:create() + ca:setCameraFlag(s_CF[GAME_LAYER.LAYER_ACTOR]) + ca:setDepth(GAME_LAYER.LAYER_ACTOR) + self._gameCameras[GAME_LAYER.LAYER_ACTOR] = ca + self:addChild(ca) + + -- fifth, create a camera to look the UI element over on the 3D models + ca = cc.Camera:create() + ca:setCameraFlag(s_CF[GAME_LAYER.LAYER_ZOOM]) + ca:setDepth(GAME_LAYER.LAYER_ZOOM) + self._gameCameras[GAME_LAYER.LAYER_ZOOM] = ca + self:addChild(ca) + + --sixth, create a camera to look the OSD UI + ca = cc.Camera:create() + ca:setCameraFlag(s_CF[GAME_LAYER.LAYER_OSD]) + ca:setDepth(GAME_LAYER.LAYER_OSD) + self._gameCameras[GAME_LAYER.LAYER_OSD] = ca + self:addChild(ca) + + self:create3DWorld() + self:createUI() + self:createPlayerDlg() + self:createDetailDlg() + self:createDescDlg() + + self._playerDlg:setVisible(false) + self._detailDlg:setVisible(false) +end + +function Scene3DTest:title() + return "" +end + +function Scene3DTest:subtitle() + return "" +end + +function Scene3DTest:onExit() + local targetPlatform = cc.Application:getInstance():getTargetPlatform() + if targetPlatform == cc.PLATFORM_OS_ANDROID or targetPlatform == cc.PLATFORM_OS_WINRT or targetPlatform == cc.PLATFORM_OS_WP8 then + cc.Director:getInstance():getEventDispatcher():removeEventListener(self._backToForegroundListener) + end +end + + + +function Scene3DTestMain() + local scene = cc.Scene:create() + + Helper.createFunctionTable = + { + Scene3DTest.create, + } + + scene:addChild(Scene3DTest.create()) + scene:addChild(CreateBackMenuItem()) + + return scene +end diff --git a/tests/lua-tests/src/TerrainTest/TerrainTest.lua b/tests/lua-tests/src/TerrainTest/TerrainTest.lua index 85b2b048b3..09a84544cd 100644 --- a/tests/lua-tests/src/TerrainTest/TerrainTest.lua +++ b/tests/lua-tests/src/TerrainTest/TerrainTest.lua @@ -69,6 +69,12 @@ function TerrainSimple:init() local eventDispatcher = self:getEventDispatcher() eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) + + --add Particle3D for test blend + local rootps = cc.PUParticleSystem3D:create("Particle3D/scripts/mp_torch.pu") + rootps:setCameraMask(cc.CameraFlag.USER1) + rootps:startParticleSystem() + self:addChild(rootps, 0, 0) end function TerrainSimple:title() @@ -272,7 +278,6 @@ function TerrainWalkThru:init() local terrainData = { _heightMapSrc = "TerrainTest/heightmap16.jpg", _alphaMapSrc = "TerrainTest/alphamap.png" , _detailMaps = {detailMapR, detailMapG, detailMapB, detailMapA}, _detailMapAmount = 4, _mapHeight = 40.0, _mapScale = 2.0 } self._terrain = cc.Terrain:create(terrainData,cc.Terrain.CrackFixedType.SKIRT) - self._terrain:setLODDistance(1000.2, 6.4, 9.6) self._terrain:setMaxDetailMapAmount(4) self._terrain:setCameraMask(2) self._terrain:setDrawWire(false) @@ -285,6 +290,19 @@ function TerrainWalkThru:init() self._player:setScale(0.08) self._player:setPositionY(self._terrain:getHeight(self._player:getPositionX(), self._player:getPositionZ()) + PLAYER_HEIGHT) + --add Particle3D for test blend + local rootps = cc.PUParticleSystem3D:create("Particle3D/scripts/mp_torch.pu") + rootps:setCameraMask(cc.CameraFlag.USER1) + rootps:setScale(30.0) + rootps:startParticleSystem() + self._player:addChild(rootps) + + --add BillBoard for test blend + local billboard = cc.BillBoard:create("Images/btn-play-normal.png") + billboard:setPosition3D(cc.vec3(0,180,0)) + billboard:setCameraMask(cc.CameraFlag.USER1) + self._player:addChild(billboard) + local animation = cc.Animation3D:create("Sprite3DTest/girl.c3b","Take 001") if nil ~= animation then local animate = cc.Animate3D:create(animation) diff --git a/tests/lua-tests/src/helper.lua b/tests/lua-tests/src/helper.lua index 84dbc49827..a3b95a2536 100644 --- a/tests/lua-tests/src/helper.lua +++ b/tests/lua-tests/src/helper.lua @@ -28,30 +28,6 @@ function CreateEnumTable(tbl, index) return enumTable end --- back menu callback -local function MainMenuCallback() - local scene = cc.Scene:create() - scene:addChild(CreateTestMenu()) - - cc.Director:getInstance():replaceScene(scene) -end - --- add the menu item for back to main menu -function CreateBackMenuItem() - local label = cc.Label:createWithTTF("MainMenu", s_arialPath, 20) - label:setAnchorPoint(cc.p(0.5, 0.5)) - local MenuItem = cc.MenuItemLabel:create(label) - MenuItem:registerScriptTapHandler(MainMenuCallback) - - local s = cc.Director:getInstance():getWinSize() - local Menu = cc.Menu:create() - Menu:addChild(MenuItem) - Menu:setPosition(0, 0) - MenuItem:setPosition(s.width - 50, 25) - - return Menu -end - Helper = { index = 1, createFunctioinTable = nil, @@ -59,6 +35,7 @@ Helper = { titleLabel = nil, subtitleLabel = nil } + function Helper.nextAction() Helper.index = Helper.index + 1 if Helper.index > table.getn(Helper.createFunctionTable) then @@ -131,6 +108,30 @@ function Helper.initWithLayer(layer) layer:addChild(background, -10) end +-- back menu callback +local function MainMenuCallback() + local scene = cc.Scene:create() + scene:addChild(CreateTestMenu()) + Helper.usePhysics = false + cc.Director:getInstance():replaceScene(scene) +end + +-- add the menu item for back to main menu +function CreateBackMenuItem() + local label = cc.Label:createWithTTF("MainMenu", s_arialPath, 20) + label:setAnchorPoint(cc.p(0.5, 0.5)) + local MenuItem = cc.MenuItemLabel:create(label) + MenuItem:registerScriptTapHandler(MainMenuCallback) + + local s = cc.Director:getInstance():getWinSize() + local Menu = cc.Menu:create() + Menu:addChild(MenuItem) + Menu:setPosition(0, 0) + MenuItem:setPosition(s.width - 50, 25) + + return Menu +end + function createTestLayer(title, subtitle) local layer = cc.Layer:create() Helper.initWithLayer(layer) diff --git a/tests/lua-tests/src/mainMenu.lua b/tests/lua-tests/src/mainMenu.lua index eb00acd95b..3dbfe32286 100644 --- a/tests/lua-tests/src/mainMenu.lua +++ b/tests/lua-tests/src/mainMenu.lua @@ -60,6 +60,8 @@ require "NewAudioEngineTest/NewAudioEngineTest" require "CocosStudio3DTest/CocosStudio3DTest" require "WebViewTest/WebViewTest" require "SpritePolygonTest/SpritePolygonTest" +require "Physics3DTest/Physics3DTest" +require "Scene3DTest/Scene3DTest" local LINE_SPACE = 40 @@ -119,12 +121,14 @@ local _allTests = { { isSupported = true, name = "Particle3D (PU)" , create_func = Particle3DTest }, { isSupported = true, name = "PerformanceTest" , create_func= PerformanceTestMain }, { isSupported = true, name = "PhysicsTest" , create_func = PhysicsTest }, + { isSupported = true, name = "Physics3DTest" , create_func = Physics3DTest }, { isSupported = true, name = "RenderTextureTest" , create_func = RenderTextureTestMain }, { isSupported = true, name = "RotateWorldTest" , create_func = RotateWorldTest }, { isSupported = true, name = "SceneTest" , create_func = SceneTestMain }, + { isSupported = true, name = "Scene3DTest" , create_func= Scene3DTestMain }, { isSupported = true, name = "SpineTest" , create_func = SpineTestMain }, { isSupported = false, name = "SchdulerTest" , create_func= SchdulerTestMain }, - { isSupported = false, name = "ShaderTest" , create_func= ShaderTestMain }, + { isSupported = false, name = "ShaderTest" , create_func= ShaderTestMain }, { isSupported = true, name = "Sprite3DTest" , create_func = Sprite3DTest }, { isSupported = true, name = "TerrainTest" , create_func = TerrainTest }, { isSupported = true, name = "SpriteTest" , create_func = SpriteTest }, @@ -198,13 +202,17 @@ function CreateTestMenu() if cc.PLATFORM_OS_IPHONE ~= targetPlatform and cc.PLATFORM_OS_ANDROID ~= targetPlatform then testMenuItem:setEnabled(false) end - end + end if obj.name == "WebViewTest" then if cc.PLATFORM_OS_IPHONE ~= targetPlatform and cc.PLATFORM_OS_ANDROID ~= targetPlatform then testMenuItem:setEnabled(false) end - end + end + + if obj.name == "Physics3DTest" and nil == cc.Physics3DComponent then + testMenuItem:setEnabled(false) + end testMenuItem:registerScriptTapHandler(menuCallback) testMenuItem:setPosition(cc.p(s.width / 2, (s.height - (index) * LINE_SPACE))) diff --git a/tests/lua-tests/src/testResource.lua b/tests/lua-tests/src/testResource.lua index 466082560f..b125786b74 100644 --- a/tests/lua-tests/src/testResource.lua +++ b/tests/lua-tests/src/testResource.lua @@ -45,3 +45,5 @@ s_markerFeltFontPath = "fonts/Marker Felt.ttf" s_arialPath = "fonts/arial.ttf" s_thonburiPath = "fonts/Thonburi.ttf" s_tahomaPath = "fonts/tahoma.ttf" + +s_s9s_ui_plist = "Images/ui.plist" diff --git a/tools/bindings-generator b/tools/bindings-generator index ca96fc9301..0b64fbf99e 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit ca96fc9301c1fd7eceff05f033eb96cb09d74a47 +Subproject commit 0b64fbf99ef824bc33a56fe584ec78aedbdb464f diff --git a/tools/cocos2d-console b/tools/cocos2d-console index b09e7d9c8c..ccca2ee5ad 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit b09e7d9c8c9d00804ae46fff882b35b96d287882 +Subproject commit ccca2ee5ad0d36188e674cff9f4db7428897bae8 diff --git a/tools/framework-compile/bin-templates/cpp-template-default/Classes/AppDelegate.cpp b/tools/framework-compile/bin-templates/cpp-template-default/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..61c8759b30 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/Classes/AppDelegate.cpp @@ -0,0 +1,67 @@ +#include "AppDelegate.h" +#include "HelloWorldScene.h" + +USING_NS_CC; + +AppDelegate::AppDelegate() { + +} + +AppDelegate::~AppDelegate() +{ +} + +//if you want a different context,just modify the value of glContextAttrs +//it will takes effect on all platforms +void AppDelegate::initGLContextAttrs() +{ + //set OpenGL context attributions,now can only set six attributions: + //red,green,blue,alpha,depth,stencil + GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; + + GLView::setGLContextAttrs(glContextAttrs); +} + +bool AppDelegate::applicationDidFinishLaunching() { + // initialize director + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLViewImpl::createWithRect("HelloCpp", Rect(0, 0, 960, 640)); + director->setOpenGLView(glview); + } + + director->getOpenGLView()->setDesignResolutionSize(960, 640, ResolutionPolicy::SHOW_ALL); + + // turn on display FPS + director->setDisplayStats(true); + + // set FPS. the default value is 1.0/60 if you don't call this + director->setAnimationInterval(1.0 / 60); + + FileUtils::getInstance()->addSearchPath("res"); + + // create a scene. it's an autorelease object + auto scene = HelloWorld::createScene(); + + // run + director->runWithScene(scene); + + return true; +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() { + Director::getInstance()->stopAnimation(); + + // if you use SimpleAudioEngine, it must be pause + // SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() { + Director::getInstance()->startAnimation(); + + // if you use SimpleAudioEngine, it must resume here + // SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); +} diff --git a/tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp b/tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp new file mode 100644 index 0000000000..3b69de8682 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -0,0 +1,39 @@ +#include "HelloWorldScene.h" +#include "cocostudio/CocoStudio.h" +#include "ui/CocosGUI.h" + +USING_NS_CC; + +using namespace cocostudio::timeline; + +Scene* HelloWorld::createScene() +{ + // 'scene' is an autorelease object + auto scene = Scene::create(); + + // 'layer' is an autorelease object + auto layer = HelloWorld::create(); + + // add layer as a child to scene + scene->addChild(layer); + + // return the scene + return scene; +} + +// on "init" you need to initialize your instance +bool HelloWorld::init() +{ + ////////////////////////////// + // 1. super init first + if ( !Layer::init() ) + { + return false; + } + + auto rootNode = CSLoader::createNode("MainScene.csb"); + + addChild(rootNode); + + return true; +} diff --git a/tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.h b/tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.h new file mode 100644 index 0000000000..97c7312abe --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/Classes/HelloWorldScene.h @@ -0,0 +1,19 @@ +#ifndef __HELLOWORLD_SCENE_H__ +#define __HELLOWORLD_SCENE_H__ + +#include "cocos2d.h" + +class HelloWorld : public cocos2d::Layer +{ +public: + // there's no 'id' in cpp, so we recommend returning the class instance pointer + static cocos2d::Scene* createScene(); + + // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone + virtual bool init(); + + // implement the "static create()" method manually + CREATE_FUNC(HelloWorld); +}; + +#endif // __HELLOWORLD_SCENE_H__ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/cocos-project-template.json b/tools/framework-compile/bin-templates/cpp-template-default/cocos-project-template.json new file mode 100644 index 0000000000..ee6547410c --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/cocos-project-template.json @@ -0,0 +1,110 @@ +{ + "do_default":{ + "exclude_from_template": [ + "res-landscape", + "res-portrait" + ], + "append_from_template": { + "from": "res-landscape", + "to": "" + }, + "project_rename":{ + "src_project_name":"HelloCpp", + "files":[ + "proj.win32/PROJECT_NAME.vcxproj", + "proj.win32/PROJECT_NAME.vcxproj.filters", + "proj.win32/PROJECT_NAME.vcxproj.user", + "proj.win32/PROJECT_NAME.sln", + "proj.ios_mac/PROJECT_NAME.xcodeproj", + "PROJECT_NAME.ccs", + "PROJECT_NAME.cfg", + "PROJECT_NAME.udf" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloCpp", + "files":[ + "Classes/AppDelegate.cpp", + "proj.win32/PROJECT_NAME.vcxproj", + "proj.win32/PROJECT_NAME.vcxproj.filters", + "proj.win32/PROJECT_NAME.vcxproj.user", + "proj.win32/PROJECT_NAME.sln", + "PROJECT_NAME.ccs", + "proj.win32/main.cpp", + "proj.android/.project", + "proj.android/.cproject", + "proj.android/AndroidManifest.xml", + "proj.android/build.xml", + "proj.android/res/values/strings.xml", + "proj.ios_mac/ios/main.m", + "proj.ios_mac/ios/Prefix.pch", + "proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj" + ] + }, + "project_replace_package_name":{ + "src_package_name":"org.cocos2dx.hellocpp", + "files":[ + "proj.android/AndroidManifest.xml" + ] + }, + "project_replace_mac_bundleid": { + "src_bundle_id": "org.cocos2dx.hellocpp", + "files": [ + "proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid": { + "src_bundle_id": "org.cocos2dx.hellocpp", + "files": [ + "proj.ios_mac/ios/Info.plist" + ] + } + }, + "change_orientation": { + "append_from_template": { + "from": "res-portrait", + "to": "" + }, + "modify_files": [ + { + "file_path": "Classes/AppDelegate.cpp", + "pattern": "GLViewImpl::createWithRect\\((.*),\\s*Rect\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)\\)\\)", + "replace_string": "GLViewImpl::createWithRect(\\1, Rect(\\2, \\3, \\5, \\4))" + }, + { + "file_path": "Classes/AppDelegate.cpp", + "pattern": "setDesignResolutionSize\\(\\s*(\\d+),\\s*(\\d+),(.*)\\)", + "replace_string": "setDesignResolutionSize(\\2, \\1,\\3)" + }, + { + "file_path": "proj.ios_mac/ios/Info.plist", + "pattern": "UIInterfaceOrientationLandscapeRight", + "replace_string": "UIInterfaceOrientationPortrait" + }, + { + "file_path": "proj.ios_mac/ios/Info.plist", + "pattern": "UIInterfaceOrientationLandscapeLeft", + "replace_string": "UIInterfaceOrientationPortraitUpsideDown" + }, + { + "file_path": "proj.android/AndroidManifest.xml", + "pattern": "android:screenOrientation=\\\".*\\\"", + "replace_string": "android:screenOrientation=\"portrait\"" + } + ], + "project_rename":{ + "src_project_name":"HelloCpp", + "files":[ + "PROJECT_NAME.ccs", + "PROJECT_NAME.cfg", + "PROJECT_NAME.udf" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloCpp", + "files":[ + "PROJECT_NAME.ccs" + ] + } + } +} diff --git a/tools/framework-compile/bin-templates/cpp-template-default/proj.android/jni/Android.mk b/tools/framework-compile/bin-templates/cpp-template-default/proj.android/jni/Android.mk new file mode 100644 index 0000000000..87dd5b18d8 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/proj.android/jni/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2dcpp_shared + +LOCAL_MODULE_FILENAME := libcocos2dcpp + +LOCAL_SRC_FILES := hellocpp/main.cpp \ + ../../Classes/AppDelegate.cpp \ + ../../Classes/HelloWorldScene.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes + +LOCAL_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,./prebuilt-mk) diff --git a/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/HelloCpp.sln b/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/HelloCpp.sln new file mode 100644 index 0000000000..7ce5950d05 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/HelloCpp.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "HelloCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp b/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp new file mode 100644 index 0000000000..38ae466fb6 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp @@ -0,0 +1,22 @@ +#include "main.h" +#include "AppDelegate.h" +#include "cocos2d.h" + +USING_NS_CC; + +#pragma comment(lib,"libcocos2d.lib") +#pragma comment(lib,"libbox2d.lib") +#pragma comment(lib,"libSpine.lib") + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + // create the application instance + AppDelegate app; + return Application::getInstance()->run(); +} diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.ccs b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.ccs new file mode 100644 index 0000000000..85b613be7f --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.ccs @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.cfg b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.cfg new file mode 100644 index 0000000000..6cc05df521 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.cfg @@ -0,0 +1 @@ + diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.udf b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.udf new file mode 100644 index 0000000000..6aca43ea0b --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/HelloCpp.udf @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/HelloWorld.png b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/HelloWorld.png new file mode 100644 index 0000000000..b5500fbaf8 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/MainScene.csb b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/MainScene.csb new file mode 100644 index 0000000000..4719ea61b2 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/Resources/res/MainScene.csb differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/HelloWorld.png b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/HelloWorld.png new file mode 100644 index 0000000000..b5500fbaf8 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/MainScene.csd b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/MainScene.csd new file mode 100644 index 0000000000..8f21e41f91 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-landscape/cocosstudio/MainScene.csd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.ccs b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.ccs new file mode 100644 index 0000000000..85b613be7f --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.ccs @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.cfg b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.cfg new file mode 100644 index 0000000000..dde42893e1 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.cfg @@ -0,0 +1 @@ + diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.udf b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.udf new file mode 100644 index 0000000000..6aca43ea0b --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/HelloCpp.udf @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/HelloWorld.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/HelloWorld.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/MainScene.csb b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/MainScene.csb new file mode 100644 index 0000000000..023aea8024 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/Resources/res/MainScene.csb differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/HelloWorld.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/HelloWorld.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/MainScene.csd b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/MainScene.csd new file mode 100644 index 0000000000..378cea89b1 --- /dev/null +++ b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/cocosstudio/MainScene.csd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-568h@2x.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-568h@2x.png new file mode 100644 index 0000000000..44addc0dc7 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-568h@2x.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-667h@2x.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-667h@2x.png new file mode 100644 index 0000000000..c53043134c Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-667h@2x.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-736h@3x.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-736h@3x.png new file mode 100644 index 0000000000..c707886c8d Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default-736h@3x.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default.png new file mode 100644 index 0000000000..dcb80725de Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default.png differ diff --git a/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default@2x.png b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default@2x.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/cpp-template-default/res-portrait/proj.ios_mac/ios/Default@2x.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/.project b/tools/framework-compile/bin-templates/js-template-runtime/.project new file mode 100644 index 0000000000..9e20382744 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/.project @@ -0,0 +1,16 @@ + + + HelloJavascript + + + + + + + org.ccdt.cocosproject + org.ccdt.jsdt.core.jsNature + + + 1.2 + + diff --git a/tools/framework-compile/bin-templates/js-template-runtime/cocos-project-template.json b/tools/framework-compile/bin-templates/js-template-runtime/cocos-project-template.json new file mode 100644 index 0000000000..b21b2215db --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/cocos-project-template.json @@ -0,0 +1,166 @@ +{ + "do_default":{ + "exclude_from_template":[ + "frameworks/runtime-src", + "res-landscape", + "res-portrait" + ], + "append_from_template": { + "from": "res-landscape", + "to": "" + }, + "project_rename": { + "src_project_name": "HelloJavascript", + "files": [ + "PROJECT_NAME.ccs", + "PROJECT_NAME.cfg", + "PROJECT_NAME.udf" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloJavascript", + "files":[ + "config.json", + ".project", + "PROJECT_NAME.ccs" + ] + }, + "append_dir":[ + { + "from": "cocos/scripting/js-bindings/script", + "to": "script", + "include": [ + "*.js" + ] + } + ] + }, + "do_add_native_support":{ + "append_from_template":{ + "from":"frameworks/runtime-src", + "to":"frameworks/runtime-src", + "exclude":[ + "proj.android/bin", + "proj.android/assets", + "proj.ios_mac/HelloJavascript.xcodeproj/project.xcworkspace", + "proj.ios_mac/HelloJavascript.xcodeproj/xcuserdata", + "proj.win32/Debug.win32", + "proj.win32/Release.win32", + "proj.win32/HelloJavascript.sdf" + ] + }, + "append_dir":[ + { + "from":"tools/bindings-generator", + "to":"tools/bindings-generator", + "exclude":[ + ".git" + ] + }, + { + "from":"tools", + "to":"tools", + "include":[ + "tojs" + ] + } + ], + "project_rename":{ + "src_project_name":"HelloJavascript", + "files":[ + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloJavascript", + "files":[ + "config.json", + ".project", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win32/main.cpp", + "frameworks/runtime-src/proj.android/.project", + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android/build.xml", + "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.ios_mac/ios/main.m", + "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", + "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", + "frameworks/runtime-src/Classes/AppDelegate.cpp" + ] + }, + "project_replace_package_name":{ + "src_package_name":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.android/AndroidManifest.xml" + ] + }, + "project_replace_mac_bundleid":{ + "src_bundle_id":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid":{ + "src_bundle_id":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] + } + }, + "change_orientation": { + "append_from_template": { + "from": "res-portrait", + "to": "" + }, + "modify_files": [ + { + "file_path": "config.json", + "pattern": "\\\"isLandscape\\\"\\s*:.*,", + "replace_string": "\"isLandscape\": false," + }, + { + "file_path": "main.js", + "pattern": "setDesignResolutionSize\\(\\s*(\\d+),\\s*(\\d+),(.*)\\)", + "replace_string": "setDesignResolutionSize(\\2, \\1,\\3)" + }, + { + "file_path": "frameworks/runtime-src/proj.ios_mac/ios/Info.plist", + "pattern": "UIInterfaceOrientationLandscapeRight", + "replace_string": "UIInterfaceOrientationPortrait" + }, + { + "file_path": "frameworks/runtime-src/proj.ios_mac/ios/Info.plist", + "pattern": "UIInterfaceOrientationLandscapeLeft", + "replace_string": "UIInterfaceOrientationPortraitUpsideDown" + }, + { + "file_path": "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "pattern": "android:screenOrientation=\\\".*\\\"", + "replace_string": "android:screenOrientation=\"portrait\"" + } + ], + "project_rename":{ + "src_project_name":"HelloJavascript", + "files":[ + "PROJECT_NAME.ccs", + "PROJECT_NAME.cfg", + "PROJECT_NAME.udf" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloJavascript", + "files":[ + "PROJECT_NAME.ccs" + ] + } + } +} + diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json new file mode 100644 index 0000000000..fc702ad446 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/build-cfg.json @@ -0,0 +1,35 @@ +{ + "ndk_module_path" :[ + "../../cocos2d-x", + "../../cocos2d-x/cocos", + "../../cocos2d-x/external" + ], + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + } + ], + "must_copy_resources": [ + { + "from": "../../../config.json", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + }, + { + "from": "../../../script", + "to": "script" + } + ] +} diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk new file mode 100644 index 0000000000..0e65d7c033 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk @@ -0,0 +1,25 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2djs_shared + +LOCAL_MODULE_FILENAME := libcocos2djs + +LOCAL_SRC_FILES := \ +../../Classes/AppDelegate.cpp \ +../../Classes/ide-support/SimpleConfigParser.cpp \ +../../Classes/ide-support/RuntimeJsImpl.cpp \ +hellojavascript/main.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes + + +LOCAL_STATIC_LIBRARIES := cocos2d_js_static +LOCAL_STATIC_LIBRARIES += cocos2d_simulator_static + +include $(BUILD_SHARED_LIBRARY) + + +$(call import-module,scripting/js-bindings/proj.android/prebuilt-mk) +$(call import-module,tools/simulator/libsimulator/proj.android/prebuilt-mk) diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln new file mode 100644 index 0000000000..3b7a101943 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/HelloJavascript.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript", "HelloJavascript.vcxproj", "{3B0B58B1-2734-488E-A542-ECEC11EB2455}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Debug|Win32.Build.0 = Debug|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Release|Win32.ActiveCfg = Release|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json new file mode 100644 index 0000000000..4b878ccb25 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/build-cfg.json @@ -0,0 +1,34 @@ +{ + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + }, + { + "from": "../../../config.json", + "to": "" + }, + { + "from": "../Classes/ide-support/lang", + "to": "" + } + ], + "must_copy_resources": [ + { + "from": "../../../script", + "to": "script" + } + ] +} diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp new file mode 100644 index 0000000000..9229bc26b1 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp @@ -0,0 +1,20 @@ +#include "main.h" +#include "SimulatorWin.h" +#include + +#pragma comment(lib,"libcocos2d.lib") +#pragma comment(lib,"libjscocos2d.lib") +#pragma comment(lib,"libbox2d.lib") +#pragma comment(lib,"libSpine.lib") +#pragma comment(lib,"libsimulator.lib") + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + auto simulator = SimulatorWin::getInstance(); + return simulator->run(); +} diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.cpp b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.cpp new file mode 100644 index 0000000000..b8b9773e01 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// player.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.h b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.h new file mode 100644 index 0000000000..bb80440ee2 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/stdafx.h @@ -0,0 +1,21 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + +// C RunTime Header Files +#include +#include +#include +#include + + +// TODO: reference additional headers your program requires here diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/targetver.h b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/targetver.h new file mode 100644 index 0000000000..87c0086de7 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/tools/framework-compile/bin-templates/js-template-runtime/index.html b/tools/framework-compile/bin-templates/js-template-runtime/index.html new file mode 100644 index 0000000000..2687063cc2 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/index.html @@ -0,0 +1,27 @@ + + + + + Cocos2d-html5 Hello World test + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/main.js b/tools/framework-compile/bin-templates/js-template-runtime/main.js new file mode 100644 index 0000000000..bd03fe9460 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/main.js @@ -0,0 +1,59 @@ +/** + * A brief explanation for "project.json": + * Here is the content of project.json file, this is the global configuration for your game, you can modify it to customize some behavior. + * The detail of each field is under it. + { + "project_type": "javascript", + // "project_type" indicate the program language of your project, you can ignore this field + + "debugMode" : 1, + // "debugMode" possible values : + // 0 - No message will be printed. + // 1 - cc.error, cc.assert, cc.warn, cc.log will print in console. + // 2 - cc.error, cc.assert, cc.warn will print in console. + // 3 - cc.error, cc.assert will print in console. + // 4 - cc.error, cc.assert, cc.warn, cc.log will print on canvas, available only on web. + // 5 - cc.error, cc.assert, cc.warn will print on canvas, available only on web. + // 6 - cc.error, cc.assert will print on canvas, available only on web. + + "showFPS" : true, + // Left bottom corner fps information will show when "showFPS" equals true, otherwise it will be hide. + + "frameRate" : 60, + // "frameRate" set the wanted frame rate for your game, but the real fps depends on your game implementation and the running environment. + + "id" : "gameCanvas", + // "gameCanvas" sets the id of your canvas element on the web page, it's useful only on web. + + "renderMode" : 0, + // "renderMode" sets the renderer type, only useful on web : + // 0 - Automatically chosen by engine + // 1 - Forced to use canvas renderer + // 2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers + + "engineDir" : "frameworks/cocos2d-html5/", + // In debug mode, if you use the whole engine to develop your game, you should specify its relative path with "engineDir", + // but if you are using a single engine file, you can ignore it. + + "modules" : ["cocos2d"], + // "modules" defines which modules you will need in your game, it's useful only on web, + // using this can greatly reduce your game's resource size, and the cocos console tool can package your game with only the modules you set. + // For details about modules definitions, you can refer to "../../frameworks/cocos2d-html5/modulesConfig.json". + + "jsList" : [ + ] + // "jsList" sets the list of js files in your game. + } + * + */ + +cc.game.onStart = function(){ + cc.view.adjustViewPort(true); + cc.view.setDesignResolutionSize(960, 640, cc.ResolutionPolicy.SHOW_ALL); + cc.view.resizeWithBrowserSize(true); + //load resources + cc.LoaderScene.preload(g_resources, function () { + cc.director.runScene(new HelloWorldScene()); + }, this); +}; +cc.game.run(); diff --git a/tools/framework-compile/bin-templates/js-template-runtime/project.json b/tools/framework-compile/bin-templates/js-template-runtime/project.json new file mode 100644 index 0000000000..c49eeb0a5d --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/project.json @@ -0,0 +1,17 @@ +{ + "project_type": "javascript", + + "debugMode" : 1, + "showFPS" : true, + "frameRate" : 60, + "id" : "gameCanvas", + "renderMode" : 0, + "engineDir":"frameworks/cocos2d-html5", + + "modules" : ["cocos2d", "cocostudio"], + + "jsList" : [ + "src/resource.js", + "src/app.js" + ] +} diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.ccs b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.ccs new file mode 100644 index 0000000000..419dc8db77 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.ccs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.cfg b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.cfg new file mode 100644 index 0000000000..847a2e3733 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.cfg @@ -0,0 +1 @@ + diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.udf b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.udf new file mode 100644 index 0000000000..6aca43ea0b --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/HelloJavascript.udf @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/HelloWorld.png b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/HelloWorld.png new file mode 100644 index 0000000000..b5500fbaf8 Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/MainScene.csd b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/MainScene.csd new file mode 100644 index 0000000000..8f21e41f91 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/cocosstudio/MainScene.csd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/HelloWorld.png b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/HelloWorld.png new file mode 100644 index 0000000000..b5500fbaf8 Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/MainScene.json b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/MainScene.json new file mode 100644 index 0000000000..50e08edf9f --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-landscape/res/MainScene.json @@ -0,0 +1,85 @@ +{ + "ID": "a2ee0952-26b5-49ae-8bf9-4f1d6279b798", + "Version": "2.1.0.0", + "Type": "Scene", + "Name": "MainScene", + "Content": { + "Content": { + "Animation": { + "Duration": 0, + "Speed": 1.0, + "Timelines": [], + "ctype": "TimelineActionData" + }, + "AnimationList": [], + "ObjectData": { + "PrePosition": { + "X": 0.0, + "Y": 0.0 + }, + "PreSize": { + "X": 0.0, + "Y": 0.0 + }, + "RightMargin": -960.0, + "TopMargin": -640.0, + "Children": [ + { + "FileData": { + "Type": "Normal", + "Path": "HelloWorld.png" + }, + "Tag": 5, + "PrePosition": { + "X": 0.5, + "Y": 0.5 + }, + "PreSize": { + "X": 0.0, + "Y": 0.0 + }, + "ActionTag": 953446860, + "Position": { + "X": 480.0, + "Y": 320.0 + }, + "Scale": { + "ScaleX": 1.0, + "ScaleY": 1.0 + }, + "AnchorPoint": { + "ScaleX": 0.5, + "ScaleY": 0.5 + }, + "CColor": {}, + "Size": { + "X": 960.0, + "Y": 640.0 + }, + "FrameEvent": "", + "Name": "Default", + "ctype": "SpriteObjectData" + } + ], + "Position": { + "X": 0.0, + "Y": 0.0 + }, + "Scale": { + "ScaleX": 1.0, + "ScaleY": 1.0 + }, + "AnchorPoint": {}, + "CColor": {}, + "Size": { + "X": 960.0, + "Y": 640.0 + }, + "FrameEvent": "", + "Name": "Scene", + "ctype": "SingleNodeObjectData" + }, + "ctype": "GameProjectData" + } + } +} \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.ccs b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.ccs new file mode 100644 index 0000000000..419dc8db77 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.ccs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.cfg b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.cfg new file mode 100644 index 0000000000..eef30416de --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.cfg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.udf b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.udf new file mode 100644 index 0000000000..6aca43ea0b --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/HelloJavascript.udf @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/HelloWorld.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/HelloWorld.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/MainScene.csd b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/MainScene.csd new file mode 100644 index 0000000000..378cea89b1 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/cocosstudio/MainScene.csd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png new file mode 100644 index 0000000000..44addc0dc7 Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png new file mode 100644 index 0000000000..c53043134c Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png new file mode 100644 index 0000000000..c707886c8d Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png new file mode 100644 index 0000000000..dcb80725de Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/HelloWorld.png b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/HelloWorld.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/MainScene.json b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/MainScene.json new file mode 100644 index 0000000000..2aea47c0c4 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/res-portrait/res/MainScene.json @@ -0,0 +1,83 @@ +{ + "ID": "a2ee0952-26b5-49ae-8bf9-4f1d6279b798", + "Version": "2.1.0.0", + "Type": "Scene", + "Name": "MainScene", + "Content": { + "Content": { + "Animation": { + "Duration": 0, + "Speed": 1.0, + "Timelines": [], + "ctype": "TimelineActionData" + }, + "AnimationList": [], + "ObjectData": { + "PrePosition": { + "X": 0.0, + "Y": 0.0 + }, + "PreSize": { + "X": 0.0, + "Y": 0.0 + }, + "Children": [ + { + "FileData": { + "Type": "Normal", + "Path": "HelloWorld.png" + }, + "Tag": 5, + "PrePosition": { + "X": 0.5, + "Y": 0.5 + }, + "PreSize": { + "X": 0.0, + "Y": 0.0 + }, + "ActionTag": -620272433, + "Position": { + "X": 320.0, + "Y": 480.0 + }, + "Scale": { + "ScaleX": 1.0, + "ScaleY": 1.0 + }, + "AnchorPoint": { + "ScaleX": 0.5, + "ScaleY": 0.5 + }, + "CColor": {}, + "Size": { + "X": 640.0, + "Y": 960.0 + }, + "FrameEvent": "", + "Name": "Default", + "ctype": "SpriteObjectData" + } + ], + "Position": { + "X": 0.0, + "Y": 0.0 + }, + "Scale": { + "ScaleX": 1.0, + "ScaleY": 1.0 + }, + "AnchorPoint": {}, + "CColor": {}, + "Size": { + "X": 640.0, + "Y": 960.0 + }, + "FrameEvent": "", + "Name": "Scene", + "ctype": "SingleNodeObjectData" + }, + "ctype": "GameProjectData" + } + } +} \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/js-template-runtime/src/app.js b/tools/framework-compile/bin-templates/js-template-runtime/src/app.js new file mode 100644 index 0000000000..48fde6a0f0 --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/src/app.js @@ -0,0 +1,29 @@ + +var HelloWorldLayer = cc.Layer.extend({ + sprite:null, + ctor:function () { + ////////////////////////////// + // 1. super init first + this._super(); + + ///////////////////////////// + // 2. add a menu item with "X" image, which is clicked to quit the program + // you may modify it. + // ask the window size + var size = cc.winSize; + + var mainscene = ccs.load(res.MainScene_json); + this.addChild(mainscene.node); + + return true; + } +}); + +var HelloWorldScene = cc.Scene.extend({ + onEnter:function () { + this._super(); + var layer = new HelloWorldLayer(); + this.addChild(layer); + } +}); + diff --git a/tools/framework-compile/bin-templates/js-template-runtime/src/resource.js b/tools/framework-compile/bin-templates/js-template-runtime/src/resource.js new file mode 100644 index 0000000000..f7ee39fbde --- /dev/null +++ b/tools/framework-compile/bin-templates/js-template-runtime/src/resource.js @@ -0,0 +1,9 @@ +var res = { + HelloWorld_png : "res/HelloWorld.png", + MainScene_json : "res/MainScene.json" +}; + +var g_resources = []; +for (var i in res) { + g_resources.push(res[i]); +} diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/cocos-project-template.json b/tools/framework-compile/bin-templates/lua-template-runtime/cocos-project-template.json new file mode 100644 index 0000000000..9afbe4c6e7 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/cocos-project-template.json @@ -0,0 +1,152 @@ +{ + "do_default": { + "exclude_from_template": [ + "frameworks/runtime-src", + "res-landscape", + "res-portrait" + ], + "append_from_template": { + "from": "res-landscape", + "to": "" + }, + "project_rename": { + "src_project_name": "HelloLua", + "files": [ + "PROJECT_NAME.ccs", + "PROJECT_NAME.cfg", + "PROJECT_NAME.udf" + ] + }, + "project_replace_project_name": { + "src_project_name": "HelloLua", + "files": [ + "config.json", + ".project", + "PROJECT_NAME.ccs" + ] + }, + "append_dir": [ + { + "from": "cocos/scripting/lua-bindings/script", + "to": "src/cocos", + "exclude": [] + } + ] + }, + "do_add_native_support": { + "append_from_template": { + "from": "frameworks/runtime-src", + "to": "frameworks/runtime-src", + "exclude": [ + "proj.android/bin", + "proj.android/assets", + "proj.ios_mac/HelloLua.xcodeproj/project.xcworkspace", + "proj.ios_mac/HelloLua.xcodeproj/xcuserdata", + "proj.win32/Debug.win32", + "proj.win32/Release.win32", + "proj.win32/HelloLua.sdf" + ] + }, + "project_rename": { + "src_project_name": "HelloLua", + "files": [ + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj" + ] + }, + "project_replace_project_name": { + "src_project_name": "HelloLua", + "files": [ + "config.json", + ".project", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win32/main.cpp", + "frameworks/runtime-src/proj.android/.project", + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android/build.xml", + "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.ios_mac/ios/main.m", + "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", + "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", + "frameworks/runtime-src/Classes/AppDelegate.cpp" + ] + }, + "project_replace_package_name": { + "src_package_name": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.android/AndroidManifest.xml" + ] + }, + "project_replace_mac_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] + } + }, + "change_orientation": { + "append_from_template": { + "from": "res-portrait", + "to": "" + }, + "modify_files": [ + { + "file_path": "config.json", + "pattern": "\\\"isLandscape\\\"\\s*:.*,", + "replace_string": "\"isLandscape\": false," + }, + { + "file_path": "src/config.lua", + "pattern": "width\\s*=.*,", + "replace_string": "width = 640," + }, + { + "file_path": "src/config.lua", + "pattern": "height\\s*=.*,", + "replace_string": "height = 960," + }, + { + "file_path": "frameworks/runtime-src/proj.ios_mac/ios/Info.plist", + "pattern": "UIInterfaceOrientationLandscapeRight", + "replace_string": "UIInterfaceOrientationPortrait" + }, + { + "file_path": "frameworks/runtime-src/proj.ios_mac/ios/Info.plist", + "pattern": "UIInterfaceOrientationLandscapeLeft", + "replace_string": "UIInterfaceOrientationPortraitUpsideDown" + }, + { + "file_path": "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "pattern": "android:screenOrientation=\\\".*\\\"", + "replace_string": "android:screenOrientation=\"portrait\"" + } + ], + "project_rename":{ + "src_project_name":"HelloLua", + "files":[ + "PROJECT_NAME.ccs", + "PROJECT_NAME.cfg", + "PROJECT_NAME.udf" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloLua", + "files":[ + "PROJECT_NAME.ccs" + ] + } + } +} diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk new file mode 100644 index 0000000000..2194cb485d --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/Android.mk @@ -0,0 +1,25 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2dlua_shared + +LOCAL_MODULE_FILENAME := libcocos2dlua + +FILE_LIST := hellolua/main.cpp +FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) +FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/ide-support/*.cpp) +FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/ide-support/*.c) + +LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes + +LOCAL_STATIC_LIBRARIES := cocos2d_lua_static +LOCAL_STATIC_LIBRARIES += cocos2d_simulator_static + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/lua-bindings/proj.android/prebuilt-mk) +$(call import-module,tools/simulator/libsimulator/proj.android/prebuilt-mk) + diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln new file mode 100644 index 0000000000..c2509746ae --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp new file mode 100644 index 0000000000..ba3b237f11 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp @@ -0,0 +1,21 @@ +#include "main.h" +#include "SimulatorWin.h" +#include + +#pragma comment(lib,"libcocos2d.lib") +#pragma comment(lib,"libluacocos2d.lib") +#pragma comment(lib,"libbox2d.lib") +#pragma comment(lib,"libSpine.lib") +#pragma comment(lib,"libsimulator.lib") + + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + auto simulator = SimulatorWin::getInstance(); + return simulator->run(); +} diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.ccs b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.ccs new file mode 100644 index 0000000000..a05198a093 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.ccs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.cfg b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.cfg new file mode 100644 index 0000000000..847a2e3733 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.cfg @@ -0,0 +1 @@ + diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.udf b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.udf new file mode 100644 index 0000000000..6aca43ea0b --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/HelloLua.udf @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/HelloWorld.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/HelloWorld.png new file mode 100644 index 0000000000..b5500fbaf8 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/MainScene.csd b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/MainScene.csd new file mode 100644 index 0000000000..8f21e41f91 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/cocosstudio/MainScene.csd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/HelloWorld.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/HelloWorld.png new file mode 100644 index 0000000000..b5500fbaf8 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/MainScene.csb b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/MainScene.csb new file mode 100644 index 0000000000..4719ea61b2 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-landscape/res/MainScene.csb differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.ccs b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.ccs new file mode 100644 index 0000000000..a05198a093 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.ccs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.cfg b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.cfg new file mode 100644 index 0000000000..eef30416de --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.cfg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.udf b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.udf new file mode 100644 index 0000000000..6aca43ea0b --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/HelloLua.udf @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/HelloWorld.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/HelloWorld.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/MainScene.csd b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/MainScene.csd new file mode 100644 index 0000000000..378cea89b1 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/cocosstudio/MainScene.csd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png new file mode 100644 index 0000000000..44addc0dc7 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png new file mode 100644 index 0000000000..c53043134c Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png new file mode 100644 index 0000000000..c707886c8d Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png new file mode 100644 index 0000000000..dcb80725de Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/HelloWorld.png b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/HelloWorld.png new file mode 100644 index 0000000000..0a82fdeb40 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/HelloWorld.png differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/MainScene.csb b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/MainScene.csb new file mode 100644 index 0000000000..023aea8024 Binary files /dev/null and b/tools/framework-compile/bin-templates/lua-template-runtime/res-portrait/res/MainScene.csb differ diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/src/app/MyApp.lua b/tools/framework-compile/bin-templates/lua-template-runtime/src/app/MyApp.lua new file mode 100644 index 0000000000..e8d1a9f35b --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/src/app/MyApp.lua @@ -0,0 +1,8 @@ + +local MyApp = class("MyApp", cc.load("mvc").AppBase) + +function MyApp:onCreate() + math.randomseed(os.time()) +end + +return MyApp diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/src/app/views/MainScene.lua b/tools/framework-compile/bin-templates/lua-template-runtime/src/app/views/MainScene.lua new file mode 100644 index 0000000000..9696977793 --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/src/app/views/MainScene.lua @@ -0,0 +1,10 @@ + +local MainScene = class("MainScene", cc.load("mvc").ViewBase) + +MainScene.RESOURCE_FILENAME = "MainScene.csb" + +function MainScene:onCreate() + printf("resource node = %s", tostring(self:getResourceNode())) +end + +return MainScene diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/src/config.lua b/tools/framework-compile/bin-templates/lua-template-runtime/src/config.lua new file mode 100644 index 0000000000..2a7389f3ae --- /dev/null +++ b/tools/framework-compile/bin-templates/lua-template-runtime/src/config.lua @@ -0,0 +1,26 @@ + +-- 0 - disable debug info, 1 - less debug info, 2 - verbose debug info +DEBUG = 2 + +-- use framework, will disable all deprecated API, false - use legacy API +CC_USE_FRAMEWORK = true + +-- show FPS on screen +CC_SHOW_FPS = true + +-- disable create unexpected global variable +CC_DISABLE_GLOBAL = true + +-- for module display +CC_DESIGN_RESOLUTION = { + width = 960, + height = 640, + autoscale = "SHOW_ALL", + callback = function(framesize) + local ratio = framesize.width / framesize.height + if ratio <= 1.34 then + -- iPad 768*1024(1536*2048) is 4:3 screen + return {autoscale = "SHOW_ALL"} + end + end +} diff --git a/tools/framework-compile/gen_cocos_libs.sh b/tools/framework-compile/gen_cocos_libs.sh new file mode 100644 index 0000000000..f4b1416a4c --- /dev/null +++ b/tools/framework-compile/gen_cocos_libs.sh @@ -0,0 +1 @@ +python ./bin/gen_cocos_libs.py --repo-x ../../ -c diff --git a/tools/framework-compile/x-modified/cocos/audio/android/prebuilt-mk/Android.mk b/tools/framework-compile/x-modified/cocos/audio/android/prebuilt-mk/Android.mk new file mode 100644 index 0000000000..d1c0de6237 --- /dev/null +++ b/tools/framework-compile/x-modified/cocos/audio/android/prebuilt-mk/Android.mk @@ -0,0 +1,28 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := cocosdenshion_static + +LOCAL_MODULE_FILENAME := libcocosdenshion + +LOCAL_SRC_FILES := __LIBS_DIR__/android/$(TARGET_ARCH_ABI)/libcocosdenshion.a + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include + + +include $(PREBUILT_STATIC_LIBRARY) + +#new audio engine +include $(CLEAR_VARS) + +LOCAL_MODULE := audioengine_static + +LOCAL_MODULE_FILENAME := libaudioengine + +LOCAL_SRC_FILES := __LIBS_DIR__/android/$(TARGET_ARCH_ABI)/libaudioengine.a + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include + +LOCAL_EXPORT_LDLIBS := -lOpenSLES + +include $(PREBUILT_STATIC_LIBRARY) diff --git a/tools/framework-compile/x-modified/cocos/prebuilt-mk/Android.mk b/tools/framework-compile/x-modified/cocos/prebuilt-mk/Android.mk new file mode 100644 index 0000000000..4b10f22afa --- /dev/null +++ b/tools/framework-compile/x-modified/cocos/prebuilt-mk/Android.mk @@ -0,0 +1,86 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2dx_internal_static + +LOCAL_MODULE_FILENAME := libcocos2dxinternal + +LOCAL_SRC_FILES := __LIBS_DIR__/android/$(TARGET_ARCH_ABI)/libcocos2dxinternal.a + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ +$(LOCAL_PATH)/../. \ +$(LOCAL_PATH)/../platform \ +$(LOCAL_PATH)/../base \ +$(LOCAL_PATH)/../../external \ +$(LOCAL_PATH)/../../external/tinyxml2 \ +$(LOCAL_PATH)/../../external/unzip \ +$(LOCAL_PATH)/../../external/chipmunk/include/chipmunk \ +$(LOCAL_PATH)/../../external/xxhash \ +$(LOCAL_PATH)/../../external/nslog + + +LOCAL_EXPORT_LDLIBS := -lGLESv2 \ + -llog \ + -landroid + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_freetype2_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_png_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jpeg_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_tiff_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_webp_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_chipmunk_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_zlib_static + +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static + +# define the macro to compile through support/zip_support/ioapi.c +LOCAL_CFLAGS := -DUSE_FILE32API +LOCAL_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat +LOCAL_EXPORT_CFLAGS := -DUSE_FILE32API +LOCAL_EXPORT_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat + +include $(PREBUILT_STATIC_LIBRARY) + +#============================================================== + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2dx_static +LOCAL_MODULE_FILENAME := libcocos2d + +LOCAL_SRC_FILES := __LIBS_DIR__/android/$(TARGET_ARCH_ABI)/libcocos2d.a + +LOCAL_WHOLE_STATIC_LIBRARIES := cocostudio_static +LOCAL_WHOLE_STATIC_LIBRARIES += audioengine_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static + +include $(PREBUILT_STATIC_LIBRARY) + +#============================================================== +$(call import-module,freetype2/prebuilt/android) +$(call import-module, platform/android/prebuilt-mk) +$(call import-module,png/prebuilt/android) +$(call import-module,jpeg/prebuilt/android) +$(call import-module,tiff/prebuilt/android) +$(call import-module,webp/prebuilt/android) +$(call import-module,chipmunk/prebuilt/android) +$(call import-module, 3d/prebuilt-mk) +$(call import-module, audio/android/prebuilt-mk) +$(call import-module, editor-support/cocosbuilder/prebuilt-mk) +$(call import-module, editor-support/cocostudio/prebuilt-mk) +$(call import-module, editor-support/spine/prebuilt-mk) +$(call import-module, network/prebuilt-mk) +$(call import-module, ui/prebuilt-mk) +$(call import-module, extensions/prebuilt-mk) +$(call import-module, Box2D/prebuilt-mk) +$(call import-module,curl/prebuilt/android) +$(call import-module,websockets/prebuilt/android) +$(call import-module, flatbuffers/prebuilt-mk) +$(call import-module, zlib/prebuilt/android) + + diff --git a/tools/framework-compile/x-modified/cocos/scripting/js-bindings/proj.android/prebuilt-mk/Android.mk b/tools/framework-compile/x-modified/cocos/scripting/js-bindings/proj.android/prebuilt-mk/Android.mk new file mode 100644 index 0000000000..a532a9a883 --- /dev/null +++ b/tools/framework-compile/x-modified/cocos/scripting/js-bindings/proj.android/prebuilt-mk/Android.mk @@ -0,0 +1,66 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2d_js_android_static + +LOCAL_MODULE_FILENAME := libjscocos2dandroid + +LOCAL_SRC_FILES := __LIBS_DIR__/android/$(TARGET_ARCH_ABI)/libjscocos2dandroid.a + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../.. \ + $(LOCAL_PATH)/../manual \ + $(LOCAL_PATH)/../manual/platform/android \ + $(LOCAL_PATH)/../../../base \ + $(LOCAL_PATH)/../../../../external/chipmunk/include/chipmunk + +LOCAL_EXPORT_LDLIBS := -lGLESv2 \ + -llog \ + -landroid + +LOCAL_STATIC_LIBRARIES := spidermonkey_static + +include $(PREBUILT_STATIC_LIBRARY) + +#============================================================== + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2d_js_static + +LOCAL_MODULE_FILENAME := libjscocos2d + +LOCAL_SRC_FILES := __LIBS_DIR__/prebuilt/android/$(TARGET_ARCH_ABI)/libjscocos2d.a + + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../manual \ + $(LOCAL_PATH)/../auto \ + $(LOCAL_PATH)/../../../2d \ + $(LOCAL_PATH)/../../../base \ + $(LOCAL_PATH)/../../../ui \ + $(LOCAL_PATH)/../../../audio/include \ + $(LOCAL_PATH)/../../../storage \ + $(LOCAL_PATH)/../../../../extensions \ + $(LOCAL_PATH)/../../../editor-support/spine \ + $(LOCAL_PATH)/../../../editor-support/cocosbuilder \ + $(LOCAL_PATH)/../../../editor-support/cocostudio + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../manual \ + $(LOCAL_PATH)/../../auto \ + $(LOCAL_PATH)/../../../../audio/include + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_js_android_static + +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_localstorage_static + +include $(PREBUILT_STATIC_LIBRARY) + +$(call import-module,./prebuilt-mk) +$(call import-module,external/spidermonkey/prebuilt/android) +$(call import-module,storage/local-storage/prebuilt-mk) diff --git a/tools/framework-compile/x-modified/cocos/scripting/lua-bindings/proj.android/prebuilt-mk/Android.mk b/tools/framework-compile/x-modified/cocos/scripting/lua-bindings/proj.android/prebuilt-mk/Android.mk new file mode 100644 index 0000000000..f51b6f34a2 --- /dev/null +++ b/tools/framework-compile/x-modified/cocos/scripting/lua-bindings/proj.android/prebuilt-mk/Android.mk @@ -0,0 +1,54 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2d_lua_android_static + +LOCAL_MODULE_FILENAME := libluacocos2dandroid + +LOCAL_SRC_FILES := __LIBS_DIR__/prebuilt/android/$(TARGET_ARCH_ABI)/libluacocos2dandroid.a + + +LOCAL_EXPORT_LDLIBS := -lGLESv2 \ + -llog \ + -landroid + +LOCAL_WHOLE_STATIC_LIBRARIES := luajit_static + +include $(PREBUILT_STATIC_LIBRARY) + +#============================================================== + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2d_lua_static + +LOCAL_MODULE_FILENAME := libluacocos2d + +LOCAL_SRC_FILES := __LIBS_DIR__/prebuilt/android/$(TARGET_ARCH_ABI)/libluacocos2d.a + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../external/lua/tolua \ +$(LOCAL_PATH)/../../../../../external/lua/luajit/include \ +$(LOCAL_PATH)/../../auto \ +$(LOCAL_PATH)/../../manual \ +$(LOCAL_PATH)/../../manual/cocos2d \ +$(LOCAL_PATH)/../../manual/3d \ +$(LOCAL_PATH)/../../manual/cocosdenshion \ +$(LOCAL_PATH)/../../manual/audioengine \ +$(LOCAL_PATH)/../../manual/network \ +$(LOCAL_PATH)/../../manual/cocosbuilder \ +$(LOCAL_PATH)/../../manual/cocostudio \ +$(LOCAL_PATH)/../../manual/spine \ +$(LOCAL_PATH)/../../manual/extension \ +$(LOCAL_PATH)/../../manual/ui \ +$(LOCAL_PATH)/../../../../../external/lua/quick \ +$(LOCAL_PATH)/../../../../.. + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2d_lua_android_static + +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static + +include $(PREBUILT_STATIC_LIBRARY) + +$(call import-module,lua/luajit/prebuilt/android) +$(call import-module, ./prebuilt-mk) diff --git a/tools/jenkins-scripts/daily-build.py b/tools/jenkins-scripts/daily-build.py index 1927826709..cb092a034a 100644 --- a/tools/jenkins-scripts/daily-build.py +++ b/tools/jenkins-scripts/daily-build.py @@ -70,7 +70,7 @@ def do_build_slaves(): # patch_cpp_empty_test() slave_build_scripts = jenkins_script_path + "android-build.sh" elif(node_name == 'win32' or node_name == 'win32_win7' or node_name == 'win32_bak'): - slave_build_scripts = jenkins_script_path + "win32-vs2013-build.bat" + slave_build_scripts = jenkins_script_path + "win32-build.bat" elif(node_name == 'windows-universal' or node_name == 'windows-universal_bak'): slave_build_scripts = jenkins_script_path + "windows-universal.bat" elif(node_name == 'ios_mac' or node_name == 'ios' or node_name == 'ios_bak'): diff --git a/tools/jenkins-scripts/do-pull-request-builder.py b/tools/jenkins-scripts/do-pull-request-builder.py index 1b923a3ab9..6665ae31fe 100755 --- a/tools/jenkins-scripts/do-pull-request-builder.py +++ b/tools/jenkins-scripts/do-pull-request-builder.py @@ -44,7 +44,7 @@ def do_build_slaves(): # patch_cpp_empty_test() slave_build_scripts = jenkins_script_path + "android-build.sh" elif(node_name == 'win32' or node_name == 'win32_win7' or node_name == 'win32_bak'): - slave_build_scripts = jenkins_script_path + "win32-vs2013-build.bat" + slave_build_scripts = jenkins_script_path + "win32-build.bat" elif(node_name == 'windows-universal' or node_name == 'windows-universal_bak'): slave_build_scripts = jenkins_script_path + "windows-universal.bat" elif(node_name == 'ios_mac' or node_name == 'ios' or node_name == 'ios_bak'): diff --git a/tools/jenkins-scripts/slave-scripts/win32-build.bat b/tools/jenkins-scripts/slave-scripts/win32-build.bat new file mode 100644 index 0000000000..7f29e5337d --- /dev/null +++ b/tools/jenkins-scripts/slave-scripts/win32-build.bat @@ -0,0 +1,2 @@ +call "%VS120COMNTOOLS%vsvars32.bat" +msbuild build\cocos2d-win32.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m diff --git a/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat b/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat deleted file mode 100755 index 945812c170..0000000000 --- a/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat +++ /dev/null @@ -1,2 +0,0 @@ -call "%VS120COMNTOOLS%vsvars32.bat" -msbuild build\cocos2d-win32.vc2013.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m diff --git a/tools/simulator/frameworks/runtime-src/Classes/lua_module_register.h b/tools/simulator/frameworks/runtime-src/Classes/lua_module_register.h index 76e9671243..253fffd927 100755 --- a/tools/simulator/frameworks/runtime-src/Classes/lua_module_register.h +++ b/tools/simulator/frameworks/runtime-src/Classes/lua_module_register.h @@ -10,9 +10,9 @@ #include "spine/lua_cocos2dx_spine_manual.hpp" #include "3d/lua_cocos2dx_3d_manual.h" #include "audioengine/lua_cocos2dx_audioengine_manual.h" -#include "lua/quick/lua_cocos2dx_quick_manual.hpp" +#include "physics3d/lua_cocos2dx_physics3d_manual.h" -int lua_module_register(lua_State* L) +static int lua_module_register(lua_State* L) { //Dont' change the module register order unless you know what your are doing register_cocosdenshion_module(L); @@ -24,6 +24,9 @@ int lua_module_register(lua_State* L) register_spine_module(L); register_cocos3d_module(L); register_audioengine_module(L); +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + register_physics3d_module(L); +#endif return 1; } diff --git a/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj b/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj index 30633aecc9..cb6d726a63 100644 --- a/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj +++ b/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj @@ -1,4 +1,4 @@ - + @@ -21,6 +21,8 @@ Unicode v110 v120 + v140 + v140_xp Application @@ -28,6 +30,8 @@ Unicode v110 v120 + v140 + v140_xp @@ -84,7 +88,7 @@ MachineX86 true $(OutDir);$(EngineRoot)external\spidermonkey\prebuilt\win32;%(AdditionalLibraryDirectories) - libcurl_imp.lib;lua51.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies) $(ProjectDir)../../../runtime/win32/$(TargetName).pdb $(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt) @@ -149,7 +153,7 @@ xcopy /Y /Q "$(OutDir)lang" "$(ProjectDir)..\..\..\runtime\win32" Windows MachineX86 $(OutDir);$(EngineRoot)external\spidermonkey\prebuilt\win32;%(AdditionalLibraryDirectories) - libcurl_imp.lib;lua51.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies) + libcurl_imp.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies) false $(OutDir)$(ProjectName).exe @@ -238,4 +242,4 @@ xcopy /Y /Q "$(OutDir)lang" "$(ProjectDir)..\..\..\runtime\win32" - \ No newline at end of file + diff --git a/tools/simulator/libsimulator/lib/AppLang.cpp b/tools/simulator/libsimulator/lib/AppLang.cpp index 437ca8bdd8..b5a95494eb 100644 --- a/tools/simulator/libsimulator/lib/AppLang.cpp +++ b/tools/simulator/libsimulator/lib/AppLang.cpp @@ -33,7 +33,7 @@ void AppLang::readLocalizationFile() if (_docRootjson.Parse<0>(fileContent.c_str()).HasParseError()) { - cocos2d::log("[WARNING]:read json file %s failed because of %s", _localizationFileName.c_str(), _docRootjson.GetParseError()); + cocos2d::log("[WARNING]:read json file %s failed because of %d", _localizationFileName.c_str(), _docRootjson.GetParseError()); return; } } diff --git a/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp b/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp index cfdb60eb6f..2d345dfe8c 100644 --- a/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp +++ b/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp @@ -51,7 +51,7 @@ void ConfigParser::readConfig(const string &filepath) return; if (_docRootjson.Parse<0>(fileContent.c_str()).HasParseError()) { - cocos2d::log("read json file %s failed because of %s", fullPathFile.c_str(), _docRootjson.GetParseError()); + cocos2d::log("read json file %s failed because of %d", fullPathFile.c_str(), _docRootjson.GetParseError()); return; } diff --git a/tools/simulator/libsimulator/lib/runtime/FileServer.cpp b/tools/simulator/libsimulator/lib/runtime/FileServer.cpp index b1476681c2..4b189877d5 100644 --- a/tools/simulator/libsimulator/lib/runtime/FileServer.cpp +++ b/tools/simulator/libsimulator/lib/runtime/FileServer.cpp @@ -222,17 +222,17 @@ void FileServer::stop() _writeEndThread = true; _responseEndThread = true; - if(_receiveRunning) + if (_receiveRunning && _receiveThread.joinable()) { _receiveThread.join(); } - if (_writeRunning) + if (_writeRunning && _writeThread.joinable()) { _writeThread.join(); } - if (_responseRunning) + if (_responseRunning && _responseThread.joinable()) { _responseThread.join(); } diff --git a/tools/simulator/libsimulator/proj.win32/libsimulator.vcxproj b/tools/simulator/libsimulator/proj.win32/libsimulator.vcxproj index e44617b9ce..fe88156831 100644 --- a/tools/simulator/libsimulator/proj.win32/libsimulator.vcxproj +++ b/tools/simulator/libsimulator/proj.win32/libsimulator.vcxproj @@ -21,6 +21,8 @@ true v120 v120_xp + v140 + v140_xp Unicode @@ -28,6 +30,8 @@ false v120 v120_xp + v140 + v140_xp true Unicode @@ -56,7 +60,7 @@ NotUsing Level3 Disabled - WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS $(ProjectDir);$(ProjectDir)..\lib\protobuf-lite;$(ProjectDir)..\lib;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\lua\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories) @@ -80,7 +84,7 @@ MinSpace true true - COCOS2D_DEBUG=1;WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions) + COCOS2D_DEBUG=1;WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS true $(ProjectDir);$(ProjectDir)..\lib\protobuf-lite;$(ProjectDir)..\lib;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\lua\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories) CompileAsCpp diff --git a/tools/tojs/cocos2dx_3d.ini b/tools/tojs/cocos2dx_3d.ini index 4245fd6d2d..c582da19a2 100644 --- a/tools/tojs/cocos2dx_3d.ini +++ b/tools/tojs/cocos2dx_3d.ini @@ -22,11 +22,11 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/cocos2d.h +headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/3d/CCBundle3D.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Animate3D Sprite3D Animation3D Skeleton3D ^Mesh$ AttachNode BillBoard Sprite3DCache TextureCube Skybox Terrain +classes = Animate3D Sprite3D Animation3D Skeleton3D ^Mesh$ AttachNode BillBoard Sprite3DCache TextureCube Skybox Terrain Bundle3D classes_need_extend = Sprite3D @@ -43,7 +43,8 @@ skip = Skeleton3D::[create], Sprite3DCache::[addSprite3DData getSpriteData], Animation3D::[getBoneCurves], TextureCube::[setTexParameters], - Terrain::[getAABB getQuadTree create getHeightData] + Terrain::[getAABB getQuadTree create getHeightData], + Bundle3D::[getTrianglesList calculateAABB] rename_functions = diff --git a/tools/tojs/cocos2dx_physics3d.ini b/tools/tojs/cocos2dx_physics3d.ini new file mode 100644 index 0000000000..893c8a69d1 --- /dev/null +++ b/tools/tojs/cocos2dx_physics3d.ini @@ -0,0 +1,66 @@ +[cocos2dx_physics3d] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_physics3d + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = cc + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include +android_flags = -D_SIZE_T_DEFINED_ + +clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include +clang_flags = -nostdinc -x c++ -std=c++11 -D CC_ENABLE_BULLET_INTEGRATION -D CC_USE_3D_PHYSICS + +win32_clang_flags = -U __SSE__ + +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external + +cocos_flags = -DANDROID + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/physics3d/CCPhysics3D.h + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". +classes = Physics3DWorld Physics3DShape PhysicsSprite3D Physics3DObject Physics3DRigidBody Physics3DShapesk Physics3DComponent Physics3DConstraint Physics3DPointToPointConstraint Physics3DHingeConstraint Physics3DSliderConstraint Physics3DConeTwistConstraint Physics3D6DofConstraint + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = Physics3DShape::[createCompoundShape createMesh createHeightfield], + Physics3DObject::[setCollisionCallback], + Physics3DWorld::[getPhysicsObjects], + Physics3DConeTwistConstraint::[setMotorTarget setMotorTargetInConstraintSpace], + PhysicsSprite3D::[create], + Physics3DRigidBody::[create] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = Ref + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = Physics3DObject + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no diff --git a/tools/tojs/genbindings.py b/tools/tojs/genbindings.py index 11f861df39..10c4d58a16 100755 --- a/tools/tojs/genbindings.py +++ b/tools/tojs/genbindings.py @@ -142,7 +142,8 @@ def main(): 'cocos2dx_spine.ini' : ('cocos2dx_spine', 'jsb_cocos2dx_spine_auto'), \ 'cocos2dx_3d.ini' : ('cocos2dx_3d', 'jsb_cocos2dx_3d_auto'), \ 'cocos2dx_3d_ext.ini' : ('cocos2dx_3d_extension', 'jsb_cocos2dx_3d_extension_auto'), \ - 'cocos2dx_experimental.ini' : ('cocos2dx_experimental', 'jsb_cocos2dx_experimental') + 'cocos2dx_experimental.ini' : ('cocos2dx_experimental', 'jsb_cocos2dx_experimental'), \ + 'cocos2dx_physics3d.ini' : ('cocos2dx_physics3d', 'jsb_cocos2dx_physics3d_auto') } target = 'spidermonkey' generator_py = '%s/generator.py' % cxx_generator_root diff --git a/tools/tolua/cocos2dx_3d.ini b/tools/tolua/cocos2dx_3d.ini index bc477cc2a2..95cb26d185 100644 --- a/tools/tolua/cocos2dx_3d.ini +++ b/tools/tolua/cocos2dx_3d.ini @@ -22,11 +22,11 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/cocos2d.h +headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/3d/CCBundle3D.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Animate3D Sprite3D Animation3D Skeleton3D ^Mesh$ AttachNode BillBoard Sprite3DCache TextureCube Skybox Terrain +classes = Animate3D Sprite3D Animation3D Skeleton3D ^Mesh$ AttachNode BillBoard Sprite3DCache TextureCube Skybox Terrain Bundle3D # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -41,7 +41,8 @@ skip = Mesh::[create getAABB getVertexBuffer hasVertexAttrib getSkin getMeshInde Animation3D::[getBoneCurveByName getBoneCurves], BillBoard::[draw], Sprite3DCache::[addSprite3DData getSpriteData], - Terrain::[lookForIndicesLODSkrit lookForIndicesLOD insertIndicesLOD insertIndicesLODSkirt getIntersectionPoint getAABB getQuadTree create getHeight getHeightData] + Terrain::[lookForIndicesLODSkrit lookForIndicesLOD insertIndicesLOD insertIndicesLODSkirt getIntersectionPoint getAABB getQuadTree create ^getHeight$], + Bundle3D::[calculateAABB loadMeshDatas getTrianglesList] rename_functions = diff --git a/tools/tolua/cocos2dx_physics3d.ini b/tools/tolua/cocos2dx_physics3d.ini new file mode 100644 index 0000000000..d6bbfb74f4 --- /dev/null +++ b/tools/tolua/cocos2dx_physics3d.ini @@ -0,0 +1,71 @@ +[cocos2dx_physics3d] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_physics3d + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = cc + +macro_judgement = #if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include +android_flags = -D_SIZE_T_DEFINED_ + +clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include +clang_flags = -nostdinc -x c++ -std=c++11 -D CC_ENABLE_BULLET_INTEGRATION + +win32_clang_flags = -U __SSE__ + +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external + +cocos_flags = -DANDROID + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/physics3d/CCPhysics3D.h + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". +classes = Physics3DWorld Physics3DShape PhysicsSprite3D Physics3DObject Physics3DRigidBody Physics3DShapesk Physics3DComponent Physics3DConstraint Physics3DPointToPointConstraint Physics3DHingeConstraint Physics3DSliderConstraint Physics3DConeTwistConstraint Physics3D6DofConstraint + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = Physics3DWorld::[getPhysicsObjects getPhysicsObject init rayCast sweepShape create], + Physics3DShape::[createCompoundShape createMesh createHeightfield], + PhysicsSprite3D::[create], + Physics3DComponent::[setTransformInPhysics create], + Physics3DRigidBody::[create], + Physics3DHingeConstraint::[setMotorTarget], + Physics3DConeTwistConstraint::[setMotorTarget setMotorTargetInConstraintSpace], + Physics3DObject::[setCollisionCallback] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = Physics3DObject + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + diff --git a/tools/tolua/genbindings.py b/tools/tolua/genbindings.py index abe05e5f08..da62efb385 100755 --- a/tools/tolua/genbindings.py +++ b/tools/tolua/genbindings.py @@ -148,6 +148,7 @@ def main(): 'cocos2dx_audioengine.ini': ('cocos2dx_audioengine', 'lua_cocos2dx_audioengine_auto'), \ 'cocos2dx_csloader.ini' : ('cocos2dx_csloader', 'lua_cocos2dx_csloader_auto'), \ 'cocos2dx_experimental_webview.ini' : ('cocos2dx_experimental_webview', 'lua_cocos2dx_experimental_webview_auto'), \ + 'cocos2dx_physics3d.ini' : ('cocos2dx_physics3d', 'lua_cocos2dx_physics3d_auto'), \ } target = 'lua' generator_py = '%s/generator.py' % cxx_generator_root